mage-ai 0.9.58__py3-none-any.whl → 0.9.59__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/logging.py +11 -7
- mage_ai/api/policies/BlockPolicy.py +1 -0
- mage_ai/api/policies/CommandCenterItemPolicy.py +56 -0
- mage_ai/api/policies/CustomTemplatePolicy.py +0 -3
- mage_ai/api/policies/GitBranchPolicy.py +8 -1
- mage_ai/api/policies/GitFilePolicy.py +1 -0
- mage_ai/api/policies/PipelinePolicy.py +2 -0
- mage_ai/api/policies/PipelineSchedulePolicy.py +1 -0
- mage_ai/api/policies/VersionControlBranchPolicy.py +98 -0
- mage_ai/api/policies/VersionControlFilePolicy.py +96 -0
- mage_ai/api/policies/VersionControlProjectPolicy.py +92 -0
- mage_ai/api/policies/VersionControlRemotePolicy.py +94 -0
- mage_ai/api/presenters/CommandCenterItemPresenter.py +19 -0
- mage_ai/api/presenters/GitBranchPresenter.py +2 -0
- mage_ai/api/presenters/GitCustomBranchPresenter.py +1 -0
- mage_ai/api/presenters/PipelinePresenter.py +5 -5
- mage_ai/api/presenters/PipelineSchedulePresenter.py +4 -0
- mage_ai/api/presenters/VersionControlBranchPresenter.py +15 -0
- mage_ai/api/presenters/VersionControlFilePresenter.py +15 -0
- mage_ai/api/presenters/VersionControlProjectPresenter.py +14 -0
- mage_ai/api/presenters/VersionControlRemotePresenter.py +15 -0
- mage_ai/api/resources/BlockResource.py +110 -80
- mage_ai/api/resources/CommandCenterItemResource.py +29 -0
- mage_ai/api/resources/FileResource.py +15 -1
- mage_ai/api/resources/FolderResource.py +2 -1
- mage_ai/api/resources/GitBranchResource.py +183 -108
- mage_ai/api/resources/GitCustomBranchResource.py +9 -2
- mage_ai/api/resources/GitFileResource.py +26 -13
- mage_ai/api/resources/KernelResource.py +9 -1
- mage_ai/api/resources/LogResource.py +1 -1
- mage_ai/api/resources/OauthResource.py +4 -5
- mage_ai/api/resources/PipelineResource.py +71 -38
- mage_ai/api/resources/PipelineRunResource.py +7 -2
- mage_ai/api/resources/PullRequestResource.py +12 -3
- mage_ai/api/resources/SearchResultResource.py +4 -4
- mage_ai/api/resources/VersionControlBranchResource.py +85 -0
- mage_ai/api/resources/VersionControlFileResource.py +65 -0
- mage_ai/api/resources/VersionControlProjectResource.py +46 -0
- mage_ai/api/resources/VersionControlRemoteResource.py +64 -0
- mage_ai/authentication/oauth/constants.py +13 -16
- mage_ai/authentication/operation_history/models.py +11 -32
- mage_ai/authentication/operation_history/utils.py +14 -14
- mage_ai/authentication/permissions/constants.py +5 -0
- mage_ai/authentication/providers/active_directory.py +2 -2
- mage_ai/authentication/providers/bitbucket.py +2 -2
- mage_ai/authentication/providers/constants.py +6 -12
- mage_ai/authentication/providers/ghe.py +2 -2
- mage_ai/authentication/providers/google.py +2 -2
- mage_ai/authentication/providers/okta.py +2 -2
- mage_ai/cache/base.py +11 -3
- mage_ai/cache/block.py +116 -32
- mage_ai/cache/block_action_object/__init__.py +52 -43
- mage_ai/cache/constants.py +1 -0
- mage_ai/cache/file.py +114 -0
- mage_ai/cache/pipeline.py +34 -8
- mage_ai/cache/tag.py +51 -10
- mage_ai/cache/utils.py +44 -3
- mage_ai/cluster_manager/kubernetes/workload_manager.py +9 -1
- mage_ai/command_center/__init__.py +0 -0
- mage_ai/command_center/applications/__init__.py +0 -0
- mage_ai/command_center/applications/constants.py +96 -0
- mage_ai/command_center/applications/factory.py +54 -0
- mage_ai/command_center/blocks/__init__.py +0 -0
- mage_ai/command_center/blocks/factory.py +39 -0
- mage_ai/command_center/blocks/utils.py +127 -0
- mage_ai/command_center/constants.py +66 -0
- mage_ai/command_center/factory.py +161 -0
- mage_ai/command_center/files/__init__.py +0 -0
- mage_ai/command_center/files/constants.py +235 -0
- mage_ai/command_center/files/factory.py +86 -0
- mage_ai/command_center/models.py +442 -0
- mage_ai/command_center/pipeline_runs/__init__.py +0 -0
- mage_ai/command_center/pipeline_runs/utils.py +141 -0
- mage_ai/command_center/pipelines/__init__.py +0 -0
- mage_ai/command_center/pipelines/constants.py +118 -0
- mage_ai/command_center/pipelines/factory.py +132 -0
- mage_ai/command_center/pipelines/utils.py +120 -0
- mage_ai/command_center/service.py +45 -0
- mage_ai/command_center/settings.py +37 -0
- mage_ai/command_center/support/__init__.py +0 -0
- mage_ai/command_center/support/constants.py +46 -0
- mage_ai/command_center/triggers/__init__.py +0 -0
- mage_ai/command_center/triggers/factory.py +49 -0
- mage_ai/command_center/triggers/utils.py +463 -0
- mage_ai/command_center/utils.py +30 -0
- mage_ai/data_preparation/executors/azure_container_instance_executor.py +1 -1
- mage_ai/data_preparation/executors/block_executor.py +68 -19
- mage_ai/data_preparation/executors/ecs_block_executor.py +2 -2
- mage_ai/data_preparation/executors/executor_factory.py +2 -0
- mage_ai/data_preparation/executors/gcp_cloud_run_block_executor.py +1 -1
- mage_ai/data_preparation/executors/k8s_block_executor.py +2 -2
- mage_ai/data_preparation/executors/pyspark_block_executor.py +7 -1
- mage_ai/data_preparation/git/__init__.py +29 -11
- mage_ai/data_preparation/git/api.py +14 -13
- mage_ai/data_preparation/git/clients/base.py +4 -8
- mage_ai/data_preparation/git/clients/github.py +1 -0
- mage_ai/data_preparation/git/utils.py +5 -7
- mage_ai/data_preparation/models/block/__init__.py +556 -329
- mage_ai/data_preparation/models/block/content.py +111 -0
- mage_ai/data_preparation/models/block/data_integration/mixins.py +1 -0
- mage_ai/data_preparation/models/block/dbt/block.py +29 -19
- mage_ai/data_preparation/models/block/dbt/block_sql.py +50 -260
- mage_ai/data_preparation/models/block/dbt/block_yaml.py +74 -156
- mage_ai/data_preparation/models/block/dbt/dbt_adapter.py +22 -10
- mage_ai/data_preparation/models/block/dbt/profiles.py +19 -15
- mage_ai/data_preparation/models/block/dbt/project.py +3 -0
- mage_ai/data_preparation/models/block/dynamic/constants.py +0 -0
- mage_ai/data_preparation/models/block/dynamic/dynamic_child.py +507 -47
- mage_ai/data_preparation/models/block/dynamic/utils.py +432 -1
- mage_ai/data_preparation/models/block/platform/mixins.py +68 -44
- mage_ai/data_preparation/models/block/r/__init__.py +19 -9
- mage_ai/data_preparation/models/block/sql/__init__.py +34 -20
- mage_ai/data_preparation/models/block/sql/utils/shared.py +4 -1
- mage_ai/data_preparation/models/block/utils.py +176 -71
- mage_ai/data_preparation/models/constants.py +7 -0
- mage_ai/data_preparation/models/file.py +21 -2
- mage_ai/data_preparation/models/pipeline.py +20 -8
- mage_ai/data_preparation/models/project/__init__.py +12 -7
- mage_ai/data_preparation/models/project/constants.py +1 -0
- mage_ai/data_preparation/models/triggers/__init__.py +7 -0
- mage_ai/data_preparation/models/utils.py +20 -0
- mage_ai/data_preparation/models/variable.py +113 -15
- mage_ai/data_preparation/shared/utils.py +6 -3
- mage_ai/data_preparation/storage/base_storage.py +17 -0
- mage_ai/data_preparation/storage/gcs_storage.py +4 -0
- mage_ai/data_preparation/storage/local_storage.py +15 -0
- mage_ai/data_preparation/storage/s3_storage.py +4 -0
- mage_ai/data_preparation/templates/data_exporters/qdrant.py +0 -1
- mage_ai/data_preparation/templates/data_loaders/qdrant.py +2 -1
- mage_ai/data_preparation/variable_manager.py +1 -0
- mage_ai/io/base.py +4 -1
- mage_ai/io/bigquery.py +25 -16
- mage_ai/io/clickhouse.py +3 -0
- mage_ai/io/druid.py +3 -0
- mage_ai/io/mongodb.py +1 -1
- mage_ai/io/pinot.py +3 -0
- mage_ai/io/postgres.py +13 -0
- mage_ai/io/snowflake.py +4 -0
- mage_ai/io/spark.py +8 -3
- mage_ai/io/sql.py +6 -0
- mage_ai/orchestration/db/__init__.py +26 -19
- mage_ai/orchestration/db/cache.py +4 -3
- mage_ai/orchestration/db/models/schedules.py +72 -16
- mage_ai/orchestration/db/models/schedules_project_platform.py +2 -3
- mage_ai/orchestration/pipeline_scheduler_original.py +19 -11
- mage_ai/orchestration/pipeline_scheduler_project_platform.py +20 -11
- mage_ai/presenters/interactions/constants.py +1 -0
- mage_ai/presenters/interactions/models.py +4 -3
- mage_ai/presenters/pages/models/client_pages/pipeline_schedules.py +1 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +11 -11
- mage_ai/server/frontend_dist/_next/static/PPQxHOmWVJ0iQFzG2rc8m/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1235.c9ed47779baccc05.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/125-029194ff22eb33a5.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1557-4f7485c2e2228f77.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2474-8e702cea23ddd16d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2479-727fa69ee9be6fab.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/26-38bc9380422f3900.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2717-3e7ea8543b3825b7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3366-420721116ea5a665.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3449-a9c98239582cd6f0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3548-13563a1ff815f922.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3943-9e0a8ba0db34b35f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4371-ef23f95888d6cd11.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4632.a4171dbf46b31c7c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/523-be11ad59861d00ca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5457-d582b00545b4cb5e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5831-2abc4063e887a03e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/6085-692d2f784c0504f2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/635-1e8857c2b6dde289.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7022-0d52dd8868621fb0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7264-d05f4b7088533f6f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7361-b3d661ec743bfadf.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/737-cc6467310a130dd9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{4495-4f0340aa82e0c623.js → 7674-9ec4fe64b5bf64d5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8038-85d715c8c8394827.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8095-bdce03896ef9639a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8146-6bed4e7401e067e6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8192-0c0b91523a38c4ca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8432-f736d101fc6d9215.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8513-d207733b485c8d03.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/9264-e7e040a54d34360c.js → frontend_dist/_next/static/chunks/9264-7cd9cd0ba86ec5e4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9265-d2a1aaec75ec69b8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9440-54add041c392517f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9624-59b2f803f9c88cd6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9832-67896490f6e8a014.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/bd1a647f.fe5d87096be24a62.js → frontend_dist/_next/static/chunks/bd1a647f.04f7913662092327.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/404-7cabe357906f44f2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-a11bd2ebe11b3fd2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-ffca51945cd154ef.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-3ba957769292db80.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-45679fd18b3edd82.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-95735a218106aa99.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-cf98c2e4d20fd92c.js → global-data-products-81d6c7fd9a9cff38.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-eb4421d51fb7368f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-a8c712e20512fede.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-f1be1d4735ba6919.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-febe676687966276.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-70efe222130490b5.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-0914c36b3c8fd59f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{users-81e6e5319a59cd07.js → users-4f12e989e7809ef9.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-809d4c99b44991a1.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/oauth-0436d395963cd27a.js → frontend_dist/_next/static/chunks/pages/oauth-aa9079c8dbaea3a5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-4e30fb5b18383b71.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-5d31c3aace39182d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-85a80ee66f60a65c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-0bd74047e257e6d9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-80619dc504d0103b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-3cc8d74ff8525bfd.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-cdc379ff24ff8858.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-03396d6086003e16.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-d6d920758654f6d9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-27727bb87be506c3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-16aab67743651a0b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-e3ca1bedb660b252.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-9d58701fe7213727.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-0041fd76ee15e49f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-780be9a2da697915.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-db8bb970b1f2273f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-a3422b0ab1dbacd7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/[...slug]-987a1603f4201943.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks-3dc8bf89cab2722b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-43d3f2a5071b9537.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-c97b1a39b22c112a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-49efb66da67554ca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-be6aaec07c138656.js → [...slug]-5117d3555972484c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-ee1c19d4a192ae4d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-4dc5724486ee3396.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f380d293cff7592b.js → [...slug]-fa095aac732368c3.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-ddce04fae28bd7f6.js → roles-db6d71f8692a33e7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-99c6a263d2ab9553.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-213a43564fdfbe17.js → [...slug]-9d881ac0a3db9baa.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-bee414d57c4b55d7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-e7030e1a7a9e88e1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-312afc9a3f8d0a4f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates-e5300c340aa94c6b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-fa7ca0c86142d146.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-bd51b3918b39329e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-5158a9d98d2459e8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5ce099a7abb354ff.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{webpack-fea697dd168c6d0c.js → webpack-efa55343114c8128.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/css/d1e8e64d0b07af2f.css → frontend_dist/_next/static/css/b59541b123fd7191.css} +1 -1
- mage_ai/server/frontend_dist/block-layout.html +3 -3
- mage_ai/server/frontend_dist/compute.html +11 -11
- mage_ai/server/frontend_dist/files.html +11 -11
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +11 -11
- mage_ai/server/frontend_dist/global-data-products.html +11 -11
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +11 -11
- mage_ai/server/frontend_dist/global-hooks.html +11 -11
- mage_ai/server/frontend_dist/index.html +3 -3
- mage_ai/server/frontend_dist/manage/files.html +11 -11
- mage_ai/server/frontend_dist/manage/settings.html +11 -11
- mage_ai/server/frontend_dist/manage/users/[user].html +11 -11
- mage_ai/server/frontend_dist/manage/users/new.html +11 -11
- mage_ai/server/frontend_dist/manage/users.html +11 -11
- mage_ai/server/frontend_dist/manage.html +11 -11
- mage_ai/server/frontend_dist/oauth.html +8 -8
- mage_ai/server/frontend_dist/overview.html +11 -11
- mage_ai/server/frontend_dist/pipeline-runs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist/pipelines.html +11 -11
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +11 -11
- mage_ai/server/frontend_dist/platform/global-hooks.html +11 -11
- mage_ai/server/frontend_dist/settings/account/profile.html +11 -11
- mage_ai/server/frontend_dist/settings/platform/preferences.html +11 -11
- mage_ai/server/frontend_dist/settings/platform/settings.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/roles.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/users.html +11 -11
- mage_ai/server/frontend_dist/settings.html +3 -3
- mage_ai/server/frontend_dist/sign-in.html +41 -41
- mage_ai/server/frontend_dist/templates/[...slug].html +11 -11
- mage_ai/server/frontend_dist/templates.html +11 -11
- mage_ai/server/frontend_dist/terminal.html +11 -11
- mage_ai/server/frontend_dist/test.html +3 -5
- mage_ai/server/frontend_dist/triggers.html +11 -11
- mage_ai/server/frontend_dist/version-control.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/404.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1235.c9ed47779baccc05.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/125-029194ff22eb33a5.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-4f7485c2e2228f77.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2474-8e702cea23ddd16d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2479-727fa69ee9be6fab.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/26-38bc9380422f3900.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-3e7ea8543b3825b7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3366-420721116ea5a665.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3449-a9c98239582cd6f0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-13563a1ff815f922.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3943-9e0a8ba0db34b35f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4371-ef23f95888d6cd11.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4632.a4171dbf46b31c7c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/523-be11ad59861d00ca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-d582b00545b4cb5e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5831-2abc4063e887a03e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6085-692d2f784c0504f2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/635-1e8857c2b6dde289.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7022-0d52dd8868621fb0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7264-d05f4b7088533f6f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-b3d661ec743bfadf.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/737-cc6467310a130dd9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{4495-4f0340aa82e0c623.js → 7674-9ec4fe64b5bf64d5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8038-85d715c8c8394827.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8095-bdce03896ef9639a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-6bed4e7401e067e6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8192-0c0b91523a38c4ca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-f736d101fc6d9215.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8513-d207733b485c8d03.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/9264-e7e040a54d34360c.js → frontend_dist_base_path_template/_next/static/chunks/9264-7cd9cd0ba86ec5e4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9265-d2a1aaec75ec69b8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-54add041c392517f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-59b2f803f9c88cd6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9832-67896490f6e8a014.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/bd1a647f.fe5d87096be24a62.js → frontend_dist_base_path_template/_next/static/chunks/bd1a647f.04f7913662092327.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/404-7cabe357906f44f2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-a11bd2ebe11b3fd2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-ffca51945cd154ef.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-3ba957769292db80.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-45679fd18b3edd82.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-95735a218106aa99.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-cf98c2e4d20fd92c.js → global-data-products-81d6c7fd9a9cff38.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-eb4421d51fb7368f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-a8c712e20512fede.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-f1be1d4735ba6919.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-febe676687966276.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-70efe222130490b5.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-0914c36b3c8fd59f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{users-81e6e5319a59cd07.js → users-4f12e989e7809ef9.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-809d4c99b44991a1.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/oauth-0436d395963cd27a.js → frontend_dist_base_path_template/_next/static/chunks/pages/oauth-aa9079c8dbaea3a5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-4e30fb5b18383b71.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-5d31c3aace39182d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-85a80ee66f60a65c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-0bd74047e257e6d9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-80619dc504d0103b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-3cc8d74ff8525bfd.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-cdc379ff24ff8858.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-03396d6086003e16.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-d6d920758654f6d9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-27727bb87be506c3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-16aab67743651a0b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-e3ca1bedb660b252.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-9d58701fe7213727.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-0041fd76ee15e49f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-780be9a2da697915.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-db8bb970b1f2273f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-a3422b0ab1dbacd7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/[...slug]-987a1603f4201943.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-3dc8bf89cab2722b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-43d3f2a5071b9537.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-c97b1a39b22c112a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-49efb66da67554ca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-be6aaec07c138656.js → [...slug]-5117d3555972484c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-ee1c19d4a192ae4d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-4dc5724486ee3396.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f380d293cff7592b.js → [...slug]-fa095aac732368c3.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-ddce04fae28bd7f6.js → roles-db6d71f8692a33e7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-99c6a263d2ab9553.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-213a43564fdfbe17.js → [...slug]-9d881ac0a3db9baa.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-bee414d57c4b55d7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-e7030e1a7a9e88e1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-312afc9a3f8d0a4f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates-e5300c340aa94c6b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-fa7ca0c86142d146.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-bd51b3918b39329e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-5158a9d98d2459e8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5ce099a7abb354ff.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-d30cb09c85b4c4f0.js → webpack-bd35e1c7bd7b5a9a.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/css/d1e8e64d0b07af2f.css → frontend_dist_base_path_template/_next/static/css/b59541b123fd7191.css} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/do4WOsw7lNhouR0mtPTFi/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/compute.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/files.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/index.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/oauth.html +8 -8
- mage_ai/server/frontend_dist_base_path_template/overview.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +39 -39
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/templates.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/terminal.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/test.html +3 -5
- mage_ai/server/frontend_dist_base_path_template/triggers.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/version-control.html +11 -11
- mage_ai/server/logger.py +8 -2
- mage_ai/server/server.py +18 -1
- mage_ai/services/aws/ecs/config.py +3 -3
- mage_ai/services/aws/ecs/ecs.py +2 -2
- mage_ai/services/search/block_action_objects.py +59 -5
- mage_ai/settings/models/configuration_option.py +3 -1
- mage_ai/settings/platform/__init__.py +54 -18
- mage_ai/settings/repo.py +5 -4
- mage_ai/shared/custom_logger.py +213 -0
- mage_ai/shared/environments.py +4 -0
- mage_ai/shared/files.py +52 -1
- mage_ai/shared/models.py +2 -1
- mage_ai/shared/parsers.py +8 -1
- mage_ai/shared/path_fixer.py +62 -5
- mage_ai/shared/retry.py +4 -0
- mage_ai/shared/strings.py +4 -0
- mage_ai/tests/api/endpoints/test_blocks.py +101 -1
- mage_ai/tests/api/operations/base/test_base_with_user_permissions.py +4 -1
- mage_ai/tests/base_test.py +21 -2
- mage_ai/tests/cache/test_pipeline_cache.py +11 -8
- mage_ai/tests/data_preparation/executors/test_block_executor.py +55 -45
- mage_ai/tests/data_preparation/git/test_api.py +4 -4
- mage_ai/tests/data_preparation/models/block/dbt/test_block.py +75 -43
- mage_ai/tests/data_preparation/models/block/dbt/test_block_sql.py +329 -329
- mage_ai/tests/data_preparation/models/block/dbt/test_block_yaml.py +296 -296
- mage_ai/tests/data_preparation/models/block/dbt/test_dbt_adapter.py +2 -2
- mage_ai/tests/data_preparation/models/block/dbt/test_dbt_cli.py +4 -4
- mage_ai/tests/data_preparation/models/block/dbt/test_profiles.py +2 -2
- mage_ai/tests/data_preparation/models/block/dbt/test_project.py +2 -2
- mage_ai/tests/data_preparation/models/block/dbt/test_sources.py +2 -2
- mage_ai/tests/data_preparation/models/block/dynamic/test_dynamic_child_block_factory.py +477 -474
- mage_ai/tests/data_preparation/models/block/dynamic/test_dynamic_helpers.py +25 -24
- mage_ai/tests/data_preparation/models/block/platform/test_mixins.py +16 -25
- mage_ai/tests/data_preparation/models/block/test_utils.py +8 -8
- mage_ai/tests/data_preparation/models/test_block.py +6 -8
- mage_ai/tests/data_preparation/models/test_project.py +10 -5
- mage_ai/tests/data_preparation/models/test_variable.py +51 -4
- mage_ai/tests/orchestration/test_pipeline_scheduler_project_platform.py +1 -0
- mage_ai/version_control/__init__.py +0 -0
- mage_ai/version_control/models.py +288 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/METADATA +6 -6
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/RECORD +490 -476
- mage_ai/server/frontend_dist/_next/static/0XnQ0C0nTr1w0o9CGC7wQ/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1124-d8fc76201b83b376.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1154-2f262f7eb38ebaa1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1235.53172e14801844e5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1550-32333b36ac6b061b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1557-7cfe722a9b83b935.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1598-dd776e3a92e9cccd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1751-5adf859690505d7b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1952-b2197a87dd67d8e0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2056-0ea1faa46646a77e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2213-52267f1e9ef5751c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2474-352ae192b826d896.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2512-46141494a1b75897.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2717-accc279ae116b1b9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2852872c-15b31a7081e6a868.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2886-9e73e1f48f248741.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2920.86a65e5f26ff1795.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3437-6055fd5aa82880f6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3449-214fce1a0e623b47.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3494-23a9cc2cd649abac.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3745-3662911c364d917b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3763-70c7eb1fc203c903.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3943-a49377acc514e77f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4052-f89c85d2c8f51931.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4296-14eaf96d6479e673.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4804-1254a474f238d078.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5283-9df961e430a79bea.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-b373ebdf4d05d8e2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5499-bc2528f8e18f61a6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5810-e66141c1271bced6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5849-f30d8694e3318a81.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5896-7b8e36634d7d94eb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6043-728790621ca9014c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6050-e48b7f97e96bbcb6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6285-648f9a732e100b2f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6639-74eefed142e14ea6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6965-c613d1834c8ed92d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7022-ea92cb336bd1aab8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7361-06ef4c642a8fe8c4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7858-677c641010ac9160.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8125-b9d53e425b6ddc7e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8146-fb8f445644e573b0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8432-0ace6fb7bdbc6864.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/844-1e171f361e63b36d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9269-40e2101f56399dcc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9302-913007e2f801ad65.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9440-c51bf1e8f271cb25.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9624-89a4b20eb3b3c754.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/976-0a8c2c4d7acd957b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9775-c1142b1312e8f95d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/404-5ddd12931e0e3e41.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-ec5e62e8e5bb4e4c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-44d7291d8f29eb36.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-a6661a9c3647532a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-26b899d3adb4ed19.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-9bd164317e652311.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-c87d46dc53e35638.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-24785a5ed4eb340d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-2c5fd116ecfacb33.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-8c9285af31efa3fd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-ec7e0419a64ae3b2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-039e083cc068da54.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-8e4d4f6edc515265.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-b73185fdcb7a131c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-97b3335bf60f8b07.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-83de126136539668.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-50f45e96892cfb63.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-5fe0f1de6fd365f8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-306db9e11fa94d21.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-ebea4be0562b08e3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-f09d21d5c2661504.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-61e770f155ae22ef.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-d347a4614130e2ab.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-056c5e5080a3754f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-208fa8de91f152bc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-a32e02f46a816eb3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-8012388b15f0e0a5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-6714c72f90923cfb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-afc0525ef27fe1f2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-a91e7d86cd0540d9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/[...slug]-7c8e5a8908fe9c83.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks-be0684d1527587d8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-147660a34351147c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-ec5f01b683920ced.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-28aa4512c0e23ec5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-a2850b2e0a282d16.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-b1df80674dca4713.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-41abcd2241958dc8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-a2c5859f53b5e9e1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-1aea2a0c373bc6ae.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-e7485742708215d2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates-b4086d30a89d6801.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-3cd171f43f0a0df8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-6a22493285c47ba2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-ad20a31dde4fe59b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-267952b4c87927c7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/RC0Yenm06LvZI-RWFoT5C/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1124-d8fc76201b83b376.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1154-2f262f7eb38ebaa1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1235.53172e14801844e5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1550-32333b36ac6b061b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-7cfe722a9b83b935.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1598-dd776e3a92e9cccd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1751-5adf859690505d7b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-b2197a87dd67d8e0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2056-0ea1faa46646a77e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2213-52267f1e9ef5751c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2474-352ae192b826d896.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2512-46141494a1b75897.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-accc279ae116b1b9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2852872c-15b31a7081e6a868.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2886-9e73e1f48f248741.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2920.86a65e5f26ff1795.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-6055fd5aa82880f6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3449-214fce1a0e623b47.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3494-23a9cc2cd649abac.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3745-3662911c364d917b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3763-70c7eb1fc203c903.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3943-a49377acc514e77f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4052-f89c85d2c8f51931.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4296-14eaf96d6479e673.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4804-1254a474f238d078.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5283-9df961e430a79bea.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-b373ebdf4d05d8e2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-bc2528f8e18f61a6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-e66141c1271bced6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5849-f30d8694e3318a81.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5896-7b8e36634d7d94eb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6043-728790621ca9014c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6050-e48b7f97e96bbcb6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6285-648f9a732e100b2f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6639-74eefed142e14ea6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6965-c613d1834c8ed92d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7022-ea92cb336bd1aab8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-06ef4c642a8fe8c4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7858-677c641010ac9160.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8125-b9d53e425b6ddc7e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-fb8f445644e573b0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-0ace6fb7bdbc6864.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/844-1e171f361e63b36d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9269-40e2101f56399dcc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9302-913007e2f801ad65.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-c51bf1e8f271cb25.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-89a4b20eb3b3c754.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/976-0a8c2c4d7acd957b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9775-c1142b1312e8f95d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/404-5ddd12931e0e3e41.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-ec5e62e8e5bb4e4c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-44d7291d8f29eb36.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-a6661a9c3647532a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-26b899d3adb4ed19.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-9bd164317e652311.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-c87d46dc53e35638.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-24785a5ed4eb340d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-2c5fd116ecfacb33.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-8c9285af31efa3fd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-ec7e0419a64ae3b2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-039e083cc068da54.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-8e4d4f6edc515265.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-b73185fdcb7a131c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-97b3335bf60f8b07.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-83de126136539668.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-50f45e96892cfb63.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-5fe0f1de6fd365f8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-306db9e11fa94d21.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-ebea4be0562b08e3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-f09d21d5c2661504.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-61e770f155ae22ef.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-d347a4614130e2ab.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-056c5e5080a3754f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-208fa8de91f152bc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-a32e02f46a816eb3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-8012388b15f0e0a5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-6714c72f90923cfb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-afc0525ef27fe1f2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-a91e7d86cd0540d9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/[...slug]-7c8e5a8908fe9c83.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-be0684d1527587d8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-147660a34351147c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-ec5f01b683920ced.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-28aa4512c0e23ec5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-a2850b2e0a282d16.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-b1df80674dca4713.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-41abcd2241958dc8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-a2c5859f53b5e9e1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-1aea2a0c373bc6ae.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-e7485742708215d2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates-b4086d30a89d6801.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-3cd171f43f0a0df8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-6a22493285c47ba2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-ad20a31dde4fe59b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-267952b4c87927c7.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{0XnQ0C0nTr1w0o9CGC7wQ → PPQxHOmWVJ0iQFzG2rc8m}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{RC0Yenm06LvZI-RWFoT5C → do4WOsw7lNhouR0mtPTFi}/_ssgManifest.js +0 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551],{53779:function(e,n,t){"use strict";t.d(n,{C:function(){return f},X$:function(){return p},eD:function(){return d}});var i=t(25976),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=t(91437),s=6.25*l.iI,a=(l.iI,100*l.iI),d=i.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],r.n_,a,(function(e){return"\n box-shadow: ".concat((e.theme||o.Z).shadow.window,";\n background-color: ").concat((e.theme||o.Z).background.panel,";\n ")})),v=(0,i.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],s,l.iI,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).background.output,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],v,r.n_,r.n_,(function(e){return"\n border-bottom: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")})),f=i.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],l.iI,u.w5,(0,c.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*l.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*s,"px);\n ")}));i.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],v,r.n_,r.n_,(function(e){return"\n border-top: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")})),i.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*l.iI,2*l.iI,(function(e){return"\n border-bottom: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")}))},69616:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(82684),o=t(25976),r=t(47041),l=o.default.div.withConfig({displayName:"indexstyle__ScrollerStyle",componentId:"sc-16b7ntp-0"})([""," align-items:center;display:flex;flex-direction:row;height:100%;overflow:auto;"],(0,r.y$)()),u=t(28598);var c=function(e){var n=e.children,t=(e.widthOffset,(0,i.useRef)(null)),o=(0,i.useRef)(null),r=(0,i.useState)(null),c=(r[0],r[1]);return(0,i.useEffect)((function(){setTimeout((function(){var e,n,i,r;c({scroll:(null===t||void 0===t||null===(e=t.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width)||0,tabs:(null===o||void 0===o||null===(i=o.current)||void 0===i||null===(r=i.getBoundingClientRect())||void 0===r?void 0:r.width)||0})}),1)}),[]),(0,u.jsx)(l,{ref:t,children:(0,u.jsx)("div",{ref:o,style:{height:"100%"},children:n})})}},72226:function(e,n,t){"use strict";var i=t(82394),o=t(38276),r=t(75499),l=t(30160),u=t(17488),c=t(70515),s=t(28598);function a(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 d(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,i.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}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,a=e.setObjectAttributes;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{mb:1,px:c.cd,children:[(0,s.jsx)(l.ZP,{bold:!0,children:"Outdated after"}),(0,s.jsx)(l.ZP,{muted:!0,small:!0,children:"After the global data product successfully completes running, how long after that will the global data product be outdated?"})]}),(0,s.jsx)(r.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var o,r,c=e.uuid,v=null===n||void 0===n||null===(o=n.outdated_after)||void 0===o?void 0:o[c],p=null===t||void 0===t||null===(r=t.outdated_after)||void 0===r?void 0:r[c];return[(0,s.jsxs)(l.ZP,{default:!0,monospace:!0,children:[c," ",p&&(0,s.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",p,")"]})]},"label-".concat(c)),(0,s.jsx)(u.Z,{compact:!0,monospace:!0,onChange:function(e){return a((function(n){var t;return d(d({},n),{},{outdated_after:d(d({},null===n||void 0===n?void 0:n.outdated_after),{},(0,i.Z)({},c,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},placeholder:"Enter a number",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof v||null===v?"":v},"input-".concat(c))]}))})]})}},29644:function(e,n,t){"use strict";var i=t(82394),o=t(44085),r=t(38276),l=t(75499),u=t(30160),c=t(17488),s=t(70515),a=t(81728),d=t(86735),v=t(28598);function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function f(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,p=e.setObjectAttributes;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(r.Z,{mb:1,px:s.cd,children:[(0,v.jsxs)(u.ZP,{bold:!0,children:["Outdated starting at ",(0,v.jsx)(u.ZP,{inline:!0,muted:!0,children:"(optional)"})]}),(0,v.jsx)(u.ZP,{muted:!0,small:!0,children:"If enough time has passed since the last global data product has ran successfully and the global data product is determined to be outdated, then you can configure it to be outdated at a specific date or time."}),(0,v.jsx)("div",{style:{marginTop:4},children:(0,v.jsxs)(u.ZP,{muted:!0,small:!0,children:["For example, let\u2019s say the global data product is outdated after 12 hours. The last successful run was yesterday at 18:00. The global data product will be outdated today at 06:00. However, if the ",(0,v.jsx)(u.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Outdated starting at"})," has a value of 17 for ",(0,v.jsx)(u.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Hour of day"}),", then the global data product won\u2019t run again until today at 17:00."]})})]}),(0,v.jsx)(l.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"second_of_minute",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"minute_of_hour",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"hour_of_day",values:(0,d.w6)(24).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"day_of_week",values:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map((function(e,n){return{uuid:e,value:n}}))},{uuid:"day_of_month",values:(0,d.w6)(31).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"day_of_year",values:(0,d.w6)(365).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_month",values:(0,d.w6)(5).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_year",values:(0,d.w6)(52).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"month_of_year",values:["January","February","March","April","May","June","July","August","September","October","November","December"].map((function(e,n){return{uuid:e,value:n+1}}))}].map((function(e){var r,l,s,d=e.uuid,h=e.values,m=null===n||void 0===n||null===(r=n.outdated_starting_at)||void 0===r?void 0:r[d],g=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],b={compact:!0,key:"outdated-starting-at-input-".concat(d),monospace:!0,onChange:function(e){return p((function(n){var t;return f(f({},n),{},{outdated_starting_at:f(f({},null===n||void 0===n?void 0:n.outdated_starting_at),{},(0,i.Z)({},d,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},primary:!0,small:!0,value:"undefined"===typeof m||null===m?"":m};return s=h?(0,v.jsx)(o.Z,f(f({},b),{},{placeholder:"Select a value",children:h.map((function(e){var n=e.uuid,t=e.value;return(0,v.jsx)("option",{value:t,children:n},t)}))})):(0,v.jsx)(c.Z,f(f({},b),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,v.jsxs)(u.ZP,{default:!0,monospace:!0,children:[(0,a.vg)(d)," ",g&&(0,v.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"outdated-starting-at-label-".concat(d)),s]}))})]})}},46209:function(e,n,t){"use strict";var i=t(82394),o=t(12691),r=t.n(o),l=t(70652),u=t(48670),c=t(38276),s=t(75499),a=t(30160),d=t(17488),v=t(70515),p=t(28598);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.blocks,t=e.objectAttributes,o=e.originalAttributes,f=e.setObjectAttributes;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(c.Z,{mb:1,px:v.cd,children:[(0,p.jsx)(a.ZP,{bold:!0,children:"Block data to output"}),(0,p.jsx)(a.ZP,{muted:!0,small:!0,children:"The data output from the block(s) you select below will be the data product that is returned when a downstream entity is requesting data from this global data product."}),(0,p.jsx)("div",{style:{marginTop:4},children:(0,p.jsx)(a.ZP,{muted:!0,small:!0,children:"When requesting data from this global data product, the selected block(s) will return data from its most recent partition. You can override this by adding a value in the partitions setting. For example, if you set the partitions value to 5, then the selected block will return data from its 5 most recent partitions. If you set the partitions value to 0, then all the partitions will be returned."})})]}),(0,p.jsx)(s.Z,{columnFlex:[null,1,null],columns:[{label:function(){return""},uuid:"selected"},{uuid:"Block UUID"},{uuid:"Partitions"}],rows:null===n||void 0===n?void 0:n.map((function(e){var n,c=e.uuid,s=null===t||void 0===t?void 0:t.settings,v=null===s||void 0===s?void 0:s[c],m=null===v||void 0===v?void 0:v.partitions,g=null===o||void 0===o||null===(n=o.settings)||void 0===n?void 0:n[c],b=null===g||void 0===g?void 0:g.partitions,x=!!v||!!g;return[(0,p.jsx)(l.Z,{checked:x,onClick:function(){return function(e){f((function(n){var t=(null===n||void 0===n?void 0:n.settings)||{};return e?t[c]={}:null===t||void 0===t||delete t[c],h(h({},n),{},{settings:t})}))}(!x)}},"selected--".concat(c)),(0,p.jsxs)("div",{children:[(0,p.jsx)(r(),{as:"/pipelines/".concat(null===t||void 0===t?void 0:t.object_uuid,"/edit?block_uuid=").concat(c),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,p.jsx)(u.Z,{monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:c})})," ",b&&(0,p.jsxs)(a.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"block-uuid-".concat(c)),(0,p.jsx)(d.Z,{compact:!0,monospace:!0,onChange:function(e){return f((function(n){var t,o;return h(h({},n),{},{settings:h(h({},null===n||void 0===n?void 0:n.settings),{},(0,i.Z)({},c,h(h({},null===n||void 0===n||null===(t=n.settings)||void 0===t?void 0:t[c]),{},{partitions:0===(null===(o=e.target.value)||void 0===o?void 0:o.length)?null:Number(e.target.value)})))})}))},placeholder:"1",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof m||null===m?"":m},"input-".concat(c))]}))})]})}},67355:function(e,n,t){"use strict";var i=t(12691),o=t.n(i),r=t(82684),l=t(34376),u=t(8666),c=t(48670),s=t(38276),a=t(4190),d=t(75499),v=t(30160),p=t(35686),f=t(70515),h=t(95924),m=t(28598);n.Z=function(e){var n=e.globalDataProducts,t=e.onClickRow,i=(0,l.useRouter)(),g=p.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,b=(0,r.useMemo)((function(){return n||(null===g||void 0===g?void 0:g.global_data_products)||[]}),[g,n]);return g||n?g&&0===(null===b||void 0===b?void 0:b.length)?(0,m.jsx)(s.Z,{p:f.cd,children:(0,m.jsx)(v.ZP,{children:"There are currently no global data products registered."})}):(0,m.jsx)(d.Z,{columnFlex:[1,null,null],columns:[{uuid:"UUID"},{uuid:"Object type"},{uuid:"Object UUID"}],onClickRow:function(e){var n=null===b||void 0===b?void 0:b[e];n&&(t?null===t||void 0===t||t(n):i.push("/global-data-products/[...slug]","/global-data-products/".concat(null===n||void 0===n?void 0:n.uuid)))},rows:null===b||void 0===b?void 0:b.map((function(e){var n=e.object_type,t=e.object_uuid,r=e.uuid,l={as:null,href:null};return u.b.PIPELINE===n&&(l.as="/pipelines/".concat(t,"/edit"),l.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(v.ZP,{monospace:!0,children:r},"uuid"),(0,m.jsx)(v.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(o(),{as:null===l||void 0===l?void 0:l.as,href:(null===l||void 0===l?void 0:l.href)||"",passHref:!0,children:(0,m.jsx)(c.Z,{default:!0,monospace:!0,onClick:function(e){(0,h.j)(e),i.push(l.href,l.as)},preventDefault:!0,children:t})},"objectUUID")]})),uuid:"global-data-products"}):(0,m.jsx)(s.Z,{p:f.cd,children:(0,m.jsx)(a.Z,{})})}},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return a},cl:function(){return d},cv:function(){return v},dE:function(){return c},zG:function(){return s}});var i=t(25976),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=i.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],r.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).popup,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__DocsStyle",componentId:"sc-7a1uhf-1"})(["> div{overflow:initial;}> div img{max-width:80%;background:white;padding:1rem;max-height:20vh;}"]),a=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],u.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),v=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-4"})(["padding:","px;"," "," ",""],2*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).interactive.defaultBackground,";\n border-bottom: ").concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n ")}))},28795:function(e,n,t){"use strict";var i;t.d(n,{B:function(){return o},M:function(){return i}}),function(e){e.BACKFILLS="backfills",e.BLOCK_RUNS="block_runs",e.DASHBOARD="dashboard",e.EDIT="edit",e.MONITOR="monitor",e.PIPELINE_LOGS="pipeline_logs",e.PIPELINE_RUNS="pipeline_runs",e.RUNS="runs",e.SETTINGS="settings",e.SYNCS="syncs",e.TRIGGERS="triggers"}(i||(i={}));var o="cancel_all_running_pipeline_runs"},85010:function(e,n,t){"use strict";t.d(n,{H:function(){return u}});var i=t(57653),o=t(72473),r=t(28795),l=t(50178);function u(e,n,t){var u=(n||{}).uuid||t,c=[{Icon:o.Lightning,id:r.M.TRIGGERS,isSelected:function(){return r.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(u,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:o.Schedule,id:r.M.RUNS,isSelected:function(){return r.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(u,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:o.Logs,id:r.M.PIPELINE_LOGS,isSelected:function(){return r.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(u,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:o.Monitor,id:r.M.MONITOR,isSelected:function(){return r.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(u,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.PYTHON===(null===n||void 0===n?void 0:n.type)&&c.splice(2,0,{Icon:o.BackfillV2,id:r.M.BACKFILLS,isSelected:function(){return r.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(u,"/backfills"),href:"/pipelines/[pipeline]/backfills"}}),i.qL.INTEGRATION===(null===n||void 0===n?void 0:n.type)&&c.unshift({Icon:o.PipeIcon,id:r.M.SYNCS,isSelected:function(){return r.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(u,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),(0,l.Ct)()||(c.unshift({Icon:o.Code,disabled:!u,id:r.M.EDIT,isSelected:function(){return r.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(u,"/edit"),href:"/pipelines/[pipeline]/edit"}}),c.push({Icon:o.SettingsWithKnobs,id:r.M.SETTINGS,isSelected:function(){return r.M.SETTINGS===e},label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(u,"/settings"),href:"/pipelines/[pipeline]/settings"}})),c.unshift({Icon:o.NavDashboard,id:r.M.DASHBOARD,isSelected:function(){return r.M.DASHBOARD===e},label:function(){return"Dashboard"},linkProps:{as:"/pipelines/".concat(u,"/dashboard"),href:"/pipelines/[pipeline]/dashboard"}}),c}},8916:function(e,n,t){"use strict";t.d(n,{FS:function(){return s},JZ:function(){return v},Tt:function(){return d},e7:function(){return p},wx:function(){return a}});var i=t(75582),o=t(82394),r=t(83784),l=t(30229);function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e){return"string"===typeof e?e:JSON.stringify(e)}function a(e,n){var t,i;return null===e||void 0===e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(i=t.variables)||void 0===i?void 0:i.map((function(e){var n=e.value;return c(c({},e),{},{value:s(n)})}))}function d(e){var n;return null===(n=a(e,(function(e){return e.uuid===r.C})))||void 0===n?void 0:n.reduce((function(e,n){var t=n.uuid,i=n.value;return c(c({},e),{},(0,o.Z)({},t,i))}),{})}function v(e,n){return n===l.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===l.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function p(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),r=t[0],l=t[1],u=l;try{u=JSON.parse(l)}catch(s){}return c(c({},e),{},(0,o.Z)({},r,u))}),{}):e}},46568:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=(t(82684),t(33591)),l=t(28598),u=["children","fullHeight","gutter","style"];function c(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 s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(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,i=e.gutter,c=e.style,a=void 0===c?{}:c,d=(0,o.Z)(e,u),v=s({},a);return i&&(v.paddingLeft=i,v.paddingRight=v.paddingLeft),t&&(v.height="100%"),(0,l.jsx)(r.Col,s(s({},d),{},{style:v,children:n}))}},82682:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=t(82684),l=t(33591),u=t(28598),c=["children","fullHeight","gutter","justifyContent","style"];function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,s=e.justifyContent,d=e.style,v=void 0===d?{}:d,p=(0,o.Z)(e,c),f=a({},v);return i&&(f.marginLeft=-1*i,f.marginRight=f.marginLeft),t&&(f.height="100%"),(0,u.jsx)(l.Row,a(a({},p),{},{justifyContent:s,style:f,children:r.Children.map(n,(function(e,n){return e&&r.cloneElement(e,{gutter:i,key:n})}))}))}},68781:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return o}}),function(e){e.AZURE_CONTAINER_INSTANCE="azure_container_instance",e.ECS="ecs",e.GCP_CLOUD_RUN="gcp_cloud_run",e.K8S="k8s",e.LOCAL_PYTHON="local_python",e.PYSPARK="pyspark"}(i||(i={}));var o=[i.AZURE_CONTAINER_INSTANCE,i.ECS,i.GCP_CLOUD_RUN,i.K8S,i.LOCAL_PYTHON,i.PYSPARK]},8666:function(e,n,t){"use strict";var i;t.d(n,{b:function(){return i}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(i||(i={}))},14466:function(e,n,t){"use strict";t.d(n,{Ij:function(){return r},N_:function(){return h},SQ:function(){return l},TT:function(){return u},W6:function(){return v},XG:function(){return a},YB:function(){return s},i9:function(){return f},sw:function(){return c},t4:function(){return d}});var i,o,r,l,u,c,s,a,d,v,p=t(82394);!function(e){e.CREATE="create",e.DELETE="delete",e.DETAIL="detail",e.EXECUTE="execute",e.LIST="list",e.UPDATE="update",e.UPDATE_ANYWHERE="update_anywhere"}(o||(o={})),function(e){e.BREAK="break",e.CONTINUE="continue",e.RAISE="raise"}(r||(r={})),function(e){e.AFTER="after",e.BEFORE="before"}(l||(l={})),function(e){e.ERROR="error",e.META="meta",e.METADATA="metadata",e.PAYLOAD="payload",e.QUERY="query",e.RESOURCE="resource",e.RESOURCES="resources"}(u||(u={})),function(e){e.FAILURE="failure",e.SUCCESS="success"}(c||(c={})),function(e){e.AND="and",e.OR="or"}(s||(s={})),function(e){e.ERROR="error",e.HOOK="hook",e.META="meta",e.METADATA="metadata",e.OPERATION_RESOURCE="operation_resource",e.PAYLOAD="payload",e.QUERY="query",e.RESOURCE="resource",e.RESOURCES="resources",e.RESOURCE_ID="resource_id",e.RESOURCE_PARENT="resource_parent",e.RESOURCE_PARENT_ID="resource_parent_id",e.RESOURCE_PARENT_TYPE="resource_parent_type",e.USER="user"}(a||(a={})),function(e){e.BOOLEAN="BOOLEAN",e.DICTIONARY="DICTIONARY",e.FLOAT="FLOAT",e.INTEGER="INTEGER",e.LIST="LIST",e.STRING="STRING"}(d||(d={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_THAN_OR_EQUALS="GREATER_THAN_OR_EQUALS",e.INCLUDES="INCLUDES",e.LESS_THAN="LESS_THAN",e.LESS_THAN_OR_EQUALS="LESS_THAN_OR_EQUALS",e.NOT_EQUALS="NOT_EQUALS",e.NOT_INCLUDES="NOT_INCLUDES",e.NOT_PRESENT="NOT_PRESENT",e.PRESENT="PRESENT"}(v||(v={}));var f=[v.NOT_PRESENT,v.PRESENT],h=(i={},(0,p.Z)(i,v.EQUALS,"=="),(0,p.Z)(i,v.GREATER_THAN,">"),(0,p.Z)(i,v.GREATER_THAN_OR_EQUALS,">="),(0,p.Z)(i,v.INCLUDES,"includes"),(0,p.Z)(i,v.LESS_THAN,"<"),(0,p.Z)(i,v.LESS_THAN_OR_EQUALS,"<="),(0,p.Z)(i,v.NOT_EQUALS,"!="),(0,p.Z)(i,v.NOT_INCLUDES,"not includes"),(0,p.Z)(i,v.NOT_PRESENT,"is not present"),(0,p.Z)(i,v.PRESENT,"is present"),i)},83784:function(e,n,t){"use strict";t.d(n,{C:function(){return i}});var i="global"},11074:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(25976),o=t(44897),r=t(42631),l=i.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],r.n_,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),u=t(28598);var c=function(e){var n=e.children,t=e.fullWidth,i=void 0===t||t;return(0,u.jsx)(l,{fullWidth:i,children:n})}},96348:function(e,n,t){"use strict";t.d(n,{g:function(){return g},Z:function(){return b}});var i=t(82684),o=t(25976),r=t(44897),l=t(42631),u=t(47041),c=t(70515),s=1.5*c.iI,a=1.5*c.iI,d=o.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],l.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||r.Z).background.page,";\n border: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||r.Z).shadow.frame,";\n ")}),(function(e){return e.noBackground&&"\n background-color: transparent;\n "}),(function(e){return e.noBoxShadow&&"\n box-shadow: none;\n "})),v=o.default.div.withConfig({displayName:"indexstyle__RowContainerStyle",componentId:"sc-13p7y8j-1"})(["overflow:auto;border-bottom-left-radius:","px;border-bottom-right-radius:","px;"," "," "," ",""],l.n_,l.n_,u.w5,(function(e){return e.maxHeight>0&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),(function(e){return e.minHeight>0&&"\n min-height: ".concat(e.minHeight,"px;\n ")}),(function(e){return e.scrollable&&"\n margin-bottom: ".concat(c.iI,"px;\n overflow-y: auto;\n padding-top: ").concat(3,"px;\n padding-left: ").concat(3,"px;\n padding-right: ").concat(3,"px;\n ")})),p=o.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-13p7y8j-2"})(["border-top-left-radius:","px;border-top-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,s,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],a,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||r.Z).interactive.defaultBorder,";\n ")}),(function(e){return e.noHorizontalPadding&&"\n padding-left: 0;\n padding-right: 0;\n "}),(function(e){return e.condensed&&"\n padding-top: ".concat(9,"px;\n padding-bottom: ").concat(9,"px;\n ")}),(function(e){return e.secondary&&"\n background-color: ".concat((e.theme.background||r.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom: none;\n ")})),h=o.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,s,2*c.iI,(function(e){return"\n border-top: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")})),m=t(28598),g=f;var b=function(e){var n=e.alternating,t=e.children,o=e.footer,r=e.header,l=e.maxHeight,u=e.minHeight,c=e.noBackground,s=e.noBoxShadow,a=e.sameColorBorders,f=e.scrollable,g=e.width,b=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:c,noBoxShadow:s,width:g,children:[r&&(0,m.jsx)(p,{children:r}),(0,m.jsx)(v,{maxHeight:l,minHeight:u,scrollable:f,children:i.Children.map(b,(function(e,t){return e&&i.cloneElement(e,{last:t===b.length-1,sameColorBorders:a,secondary:n&&t%2===1})}))}),o&&(0,m.jsx)(h,{children:o})]})}},45990:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return kl}});var i=t(77837),o=t(21831),r=t(75582),l=t(82394),u=t(38860),c=t.n(u),s=t(92083),a=t.n(s),d=t(56085),v=t(25976),p=t(82684),f=t(69864),h=t(34376),m=t(65557),g=t(40761),b=t(44425),x=t(70652),j=t(39867),k=t(15338),Z=t(97618),y=t(55485),P=t(48670),C=t(38276),O=t(30160),w=t(70515),_=t(55283),S=t(28598);function I(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 E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?I(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):I(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var T=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,o=e.setHiddenBlocks,r=(0,p.useContext)(v.ThemeContext),u=(0,p.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),c=(0,p.useMemo)((function(){var e=[],n=[];return u.forEach((function(i){var o=i.uuid;null!==t&&void 0!==t&&t[o]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[u,t]),s=c.blocksHidden,a=c.blocksVisible,d=(0,p.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===a.length}),[u,a]),f=(0,p.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===s.length}),[u,s]),h=(0,p.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var o,r=n.current["".concat(t,"s/").concat(i,".py")];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(x.Z,{checked:f,label:"Show all",onClick:function(){return o((function(){return{}}))}}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(x.Z,{checked:d,label:"Hide all",onClick:function(){return o((function(){return u.reduce((function(e,n){var t=n.uuid;return E(E({},e),{},(0,l.Z)({},t,!0))}),{})}))}})]})}),(0,S.jsx)(k.Z,{medium:!0}),null===u||void 0===u?void 0:u.map((function(e){var n=e.uuid,i=(0,_.qn)(e.type,{blockColor:e.color,theme:r}).accent,u=!(null!==t&&void 0!==t&&t[n]);return(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){o((function(e){return E(E({},e),{},(0,l.Z)({},n,u))})),u||setTimeout((function(){return h(e)}),1)},preventDefault:!0,children:(0,S.jsx)(C.Z,{mt:1,px:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(C.Z,{pr:1,children:(0,S.jsx)(x.Z,{checked:u})}),(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:i,size:1.5*w.iI,square:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},M=t(60523),B=t(27277),D=t(17717),A=t(85854),R=t(75499),N=t(72473),L=t(86735);var F=function(e){var n=e.cacheItems,t=e.selectedLinks,i=(0,p.useMemo)((function(){var e;return null===t||void 0===t||null===(e=t.find((function(e){return e.uuid in b.GJ})))||void 0===e?void 0:e.uuid}),[t]),o=(0,p.useMemo)((function(){var e,i=null===t||void 0===t||null===(e=t.slice(0,2))||void 0===e?void 0:e.map((function(e){return e.uuid}));return null===n||void 0===n?void 0:n.find((function(e){var n,t=e.item;return null===i||void 0===i?void 0:i.includes(null===t||void 0===t||null===(n=t.project)||void 0===n?void 0:n.uuid)}))}),[n,t]);if(b.tf.DBT===i&&o){var l,u,c,s,a=null===o||void 0===o?void 0:o.item,d=a.models,v=a.profiles,f=a.project,h=(0,L.YC)(Object.entries((null===v||void 0===v||null===(l=v[null===f||void 0===f?void 0:f.profile])||void 0===l?void 0:l.outputs)||{}),(function(e){return e[0]})),m=(null===f||void 0===f?void 0:f["model-paths"])||[],g=(null===f||void 0===f||null===(u=f.file_path)||void 0===u?void 0:u.split(D.sep))||[],x=(null===g||void 0===g?void 0:g.length)||0;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Project"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(C.Z,{p:w.cd,children:null===g||void 0===g?void 0:g.map((function(e,n){var t=n===x-1,i=t?N.List:N.FolderOutline;return(0,S.jsx)(C.Z,{ml:2*n,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(i,{default:t,muted:!t}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:t,monospace:!0,muted:!t,small:!0,children:e})]})},e)}))}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,null],columns:[{label:function(){return"Detail"},uuid:"details"},{label:function(){return""},rightAligned:!0,uuid:"value"}],noHeader:!0,rows:[[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Name"}),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,small:!0,children:null===f||void 0===f?void 0:f.name})],[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Models paths"}),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,small:!0,children:null===m||void 0===m?void 0:m.join(", ")})],[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Models"}),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,small:!0,children:(null===d||void 0===d?void 0:d.length)||0})]]}),(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Profiles"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(C.Z,{p:w.cd,children:null===v||void 0===v||null===(c=v.file_path)||void 0===c||null===(s=c.split(D.sep))||void 0===s?void 0:s.map((function(e,n){var t=n===x-1,i=t?N.List:N.FolderOutline;return(0,S.jsx)(C.Z,{ml:2*n,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(i,{default:t,muted:!t}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:t,monospace:!0,muted:!t,small:!0,children:e})]})},e)}))}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,null],columns:[{uuid:"Targets"},{rightAligned:!0,uuid:"Type"}],rows:null===h||void 0===h?void 0:h.map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:t},"target-".concat(t)),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,small:!0,children:null===i||void 0===i?void 0:i.type},"type-".concat(null===i||void 0===i?void 0:i.type))]}))})]})}return(0,S.jsx)(S.Fragment,{})},U=t(44897),H=t(46684),W=v.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-183il08-0"})(["height:","px;",""],H.Mz,(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||U.Z.borders).medium,";\n ")})),G=t(81728);var K=function(e){var n,t=e.children,i=e.navigateBack,r=e.selectedLinks,l=e.selectedTab,u=(0,p.useMemo)((function(){var e=(0,o.Z)(r||[]);return e.reverse(),e}),[r]),c=(0,p.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)||0}),[u]);return(0,S.jsx)(W,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,children:[(0,S.jsx)(C.Z,{pl:w.cd}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[l&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return null===i||void 0===i?void 0:i()},preventDefault:!0,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(N.ArrowLeft,{muted:!0})})}),(0,S.jsx)(C.Z,{pr:1}),(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return null===i||void 0===i?void 0:i(c||1)},preventDefault:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(null===l||void 0===l?void 0:l.Icon)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(l.Icon,{}),(0,S.jsx)(C.Z,{mr:1})]}),(0,S.jsx)(O.ZP,{bold:!0,muted:!0,children:null!==l&&void 0!==l&&l.label?null===l||void 0===l||null===(n=l.label)||void 0===n?void 0:n.call(l):(0,G.vg)(null===l||void 0===l?void 0:l.uuid)})]})})]}),null===u||void 0===u?void 0:u.map((function(e,n){var t=e||{Icon:null,label:null,uuid:null},o=t.Icon,s=t.label,a=t.uuid;return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(l||n>=1)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.ChevronRight,{muted:!0}),(0,S.jsx)(C.Z,{mr:1})]}),(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return null===i||void 0===i?void 0:i(c-1-n)},preventDefault:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[o&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(o,{default:n>=1&&(null===u||void 0===u?void 0:u.length)>=3}),(0,S.jsx)(C.Z,{mr:1})]}),(0,S.jsx)(O.ZP,{bold:!0,muted:n!==c-1,noWrapping:!0,children:b.V4[a]||s?null===s||void 0===s?void 0:s({selectedLinks:r}):a})]})})]},a)}))]}),(l||(null===r||void 0===r?void 0:r.length)>=1)&&t&&(0,S.jsx)(C.Z,{mr:w.cd}),t,(0,S.jsx)(C.Z,{pr:w.cd})]})})},z=t(83905),q=t(80029),V=t(52479),Y=t(35686);var Q,X,J,$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.excludeDirPattern,e.excludePattern,e.pattern,Y.ZP.files.list()),t=n.data,i=n.mutate,o=(0,p.useMemo)((function(){return(null===t||void 0===t?void 0:t.files)||[]}),[t]);return{fetch:i,files:o}},ee=t(32929);!function(e){e.BLOCKS="blocks",e.FILES="files"}(X||(X={})),function(e){e.ALL_BLOCKS="all_blocks",e.ALL_BLOCKS_IN_TYPE="all_blocks_in_type"}(J||(J={}));var ne=[{Icon:N.TemplateShapes,label:function(){return"All blocks"},uuid:J.ALL_BLOCKS}].concat(null===ee.qy||void 0===ee.qy?void 0:ee.qy.filter((function(e){return e.uuid in b.GJ}))),te=(Q={},(0,l.Z)(Q,X.FILES,{Icon:N.FolderOutline,uuid:X.FILES}),(0,l.Z)(Q,X.BLOCKS,{Icon:N.BatchSquaresStacked,uuid:X.BLOCKS}),Q);function ie(e){var n,t,i=e.models,o=e.project,r=(null===o||void 0===o?void 0:o["model-paths"])||[],l=new RegExp(null===r||void 0===r||null===(n=r.map((function(e){return[null===o||void 0===o?void 0:o.uuid,e,""].join(D.sep)})))||void 0===n?void 0:n.join("|"));return(0,L.YC)(null===(t=i||[])||void 0===t?void 0:t.map((function(e){var n,t,i,r,u,c=e.replace(l,""),s=null===c||void 0===c?void 0:c.split(D.sep);(null===s||void 0===s?void 0:s.length)>=2?(i=null===s||void 0===s?void 0:s[(null===s||void 0===s?void 0:s.length)-1],r=null===s||void 0===s||null===(u=s.slice(0,(null===s||void 0===s?void 0:s.length)-1))||void 0===u?void 0:u.join(D.sep)):i=null===s||void 0===s?void 0:s[0];var a=null===(n=i)||void 0===n?void 0:n.split(".");return{directory:r,fileExtension:null===a||void 0===a?void 0:a[(null===a||void 0===a?void 0:a.length)-1],filePath:c,fullPath:e,name:null===a||void 0===a||null===(t=a.slice(0,(null===a||void 0===a?void 0:a.length)-1))||void 0===t?void 0:t.join("."),project:o}})),(function(e){return e.name}))}var oe=t(71953);function re(e){return null===e||void 0===e?void 0:e.map((function(e){var n=e.directory,t=e.fileExtension,i=e.filePath,o=e.name;return{Icon:oe.T[t],label:function(){return(0,S.jsx)(O.ZP,{monospace:!0,noWrapping:!0,children:o})},description:function(){return(0,S.jsx)(y.ZP,{flexDirection:"column",children:(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,noWrapping:!0,small:!0,children:n})})},uuid:i}}))}function le(e){var n;return[{Icon:N.FolderOutline,label:function(){return(0,G._6)("project",(null===e||void 0===e?void 0:e.length)||0)},uuid:J.ALL_BLOCKS_IN_TYPE}].concat(null===(n=(0,L.YC)(e||[],(function(e){var n,t=e.item;return null===t||void 0===t||null===(n=t.project)||void 0===n?void 0:n.name})))||void 0===n?void 0:n.map((function(e){var n=e.item,t=null===n||void 0===n?void 0:n.project;return{Icon:N.FolderOutline,label:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{selectedLinks:null},n=e.selectedLinks;return(0,S.jsx)(O.ZP,{default:(null===n||void 0===n?void 0:n.length)>=3,monospace:!0,noWrapping:!0,children:null===t||void 0===t?void 0:t.name})},description:function(){var e;return(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,noWrapping:!0,small:!0,children:(0,G._6)("model",(null===n||void 0===n||null===(e=n.models)||void 0===e?void 0:e.length)||0)}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,noWrapping:!0,small:!0,children:null===t||void 0===t?void 0:t.uuid})]})},uuid:null===t||void 0===t?void 0:t.uuid}})))}function ue(e,n){var t,i,o,r,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=(null===n||void 0===n?void 0:n.length)||0,c=null===n||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid,s=e;Array.isArray(e)||(s=[e]);var a=null===(i=s)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.uuid,d=J.ALL_BLOCKS===a,v=a in b.GJ,p=J.ALL_BLOCKS_IN_TYPE===a,f=l&&(null===l||void 0===l?void 0:l.find((function(e){return e.uuid===c}))),h=l&&(null===l||void 0===l?void 0:l.find((function(e){return e.uuid===a}))),m=null===n||void 0===n||null===(r=n.find((function(e){return e.uuid in b.GJ})))||void 0===r?void 0:r.uuid;if(0===u)return d?[]:s;if(1<=u){if(d)return[];if(v)return s}if(2<=u){var g;if(v)return s;if(p)return null===n||void 0===n?void 0:n.slice(u-1);if(f&&h)return s.concat(null===n||void 0===n?void 0:n.slice(u-1));if((null===(g=s)||void 0===g?void 0:g.length)>=2)return s.concat(null===n||void 0===n?void 0:n.slice(1))}return 3<=u&&b.tf.DBT===m?s.concat(null===n||void 0===n?void 0:n.slice(1)):s.concat(n||[])}function ce(e,n){var t=null===n||void 0===n?void 0:n.slice(null===e?1:e);null===t||void 0===t||t.length;return(null===t||void 0===t?void 0:t.length)>=1?t:null}function se(e,n){var t;return b.tf.DBT===(null===e||void 0===e||null===(t=e[0])||void 0===t?void 0:t.uuid)?null===n||void 0===n?void 0:n[0]:(null===e||void 0===e?void 0:e[0])||(null===n||void 0===n?void 0:n[0])}var ae=t(23780);var de=function(e){var n=e.cacheItems,t=e.selectedLinks,i=e.selectedTab,o=e.setSelectedLinks,l=(0,ae.VI)(null,{},[],{uuid:"FileBrowserNavigation"}),u=(0,r.Z)(l,1)[0],c=(0,p.useRef)(null),s=$(),a=s.fetch,d=s.files,v=(0,p.useMemo)((function(){var e,i=null===t||void 0===t||null===(e=t.slice(0,2))||void 0===e?void 0:e.map((function(e){return e.uuid}));return null===n||void 0===n?void 0:n.find((function(e){var n,t=e.item;return null===i||void 0===i?void 0:i.includes(null===t||void 0===t||null===(n=t.project)||void 0===n?void 0:n.uuid)}))}),[n,t]),f=(0,p.useMemo)((function(){var e,i;return null!==t&&void 0!==t&&t.find((function(e){var n=e.uuid;return b.tf.DBT===n}))?v&&(null===t||void 0===t?void 0:t.length)>=3?re(ie({models:null===v||void 0===v||null===(e=v.item)||void 0===e?void 0:e.models,project:null===v||void 0===v||null===(i=v.item)||void 0===i?void 0:i.project})):le(n):ne}),[n,v,t]);return(0,p.useMemo)((function(){var e;return null===t||void 0===t||null===(e=t.find((function(e){return e.uuid in b.GJ})))||void 0===e?void 0:e.uuid}),[t]),(0,S.jsxs)(S.Fragment,{children:[X.FILES===(null===i||void 0===i?void 0:i.uuid)&&(0,S.jsx)(V.Z,{fetchFiles:a,files:d,onClickFile:function(e){return console.log(e)},onClickFolder:function(e){return console.log(e,!0)},ref:c,showError:u}),X.BLOCKS===(null===i||void 0===i?void 0:i.uuid)&&(0,S.jsx)(q.Z,{navLinks:f||[],selectedLink:se(t,f),setSelectedLink:function(e){return o((function(t){return ue(e,t,n)}))}})]})},ve=t(90299);function pe(e,n){var t=e.selectedTab,i=e.setSelectedTab,o=[te[X.FILES],te[X.BLOCKS]];return(0,p.useEffect)((function(){i((function(e){return e||(null===o||void 0===o?void 0:o[0])}))}),[]),(0,S.jsx)(W,{ref:n,children:(0,S.jsx)(y.ZP,{alignItems:"flex-end",fullHeight:!0,children:(0,S.jsx)(ve.Z,{onClickTab:function(e){return null===i||void 0===i?void 0:i(e)},selectedTabUUID:null===t||void 0===t?void 0:t.uuid,tabs:o,underlineStyle:!0})})})}var fe,he=p.forwardRef(pe),me=t(32013),ge=t(98777),be=t(71180),xe=t(89083),je=t(24138),ke=t(4190),Ze=t(89706);!function(e){e.CODE="Compiled code",e.DATA="Sample data",e.LINEAGE="Lineage",e.OVERVIEW="Overview",e.PIPELINES="Pipelines and runs"}(fe||(fe={}));var ye=[{uuid:fe.OVERVIEW},{uuid:fe.DATA},{uuid:fe.LINEAGE},{uuid:fe.PIPELINES},{uuid:fe.CODE}],Pe=t(72619);var Ce=function(e){var n=e.cacheItem,t=e.cacheItems,i=e.mainContainerHeight,o=e.onClickAction,l=e.selectedLinks,u=e.setSelectedLinks,c=(0,p.useContext)(v.ThemeContext),s=(0,ae.VI)(null,{},[],{uuid:"BlockBrowser/BlockDetail"}),a=(0,r.Z)(s,1)[0],d=(0,p.useRef)(null),h=(0,p.useState)(null),m=h[0],g=h[1],x=(0,p.useState)(null),j=x[0],P=x[1],I=(0,p.useState)(null),E=I[0],T=I[1],M=(0,p.useMemo)((function(){var e,n;return null===E||void 0===E||null===(e=E.item)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.sample_data}),[E]),B=null===l||void 0===l?void 0:l[0],D=(0,p.useMemo)((function(){return null===n||void 0===n?void 0:n.item}),[n]),L=(0,p.useMemo)((function(){return ie({models:null===D||void 0===D?void 0:D.models,project:null===D||void 0===D?void 0:D.project})}),[D]),F=(0,p.useMemo)((function(){return null===L||void 0===L?void 0:L.find((function(e){return e.filePath===(null===B||void 0===B?void 0:B.uuid)}))}),[L,B]),U=Y.ZP.file_contents.detail(encodeURIComponent(null===F||void 0===F?void 0:F.fullPath)).data,H=(0,p.useMemo)((function(){return null===U||void 0===U?void 0:U.file_content}),[U]),W=(0,p.useMemo)((function(){var e;return{item_type:z.N.DBT,project_path:null===D||void 0===D||null===(e=D.project)||void 0===e?void 0:e.uuid}}),[D]),G=Y.ZP.cache_items.detail(encodeURIComponent(null===F||void 0===F?void 0:F.fullPath),W).data,K=(0,p.useMemo)((function(){return null===G||void 0===G?void 0:G.cache_item}),[G]),q=(0,p.useMemo)((function(){var e;return(null===K||void 0===K||null===(e=K.item)||void 0===e?void 0:e.upstream_blocks)||[]}),[K]),V=(0,p.useMemo)((function(){return null===q||void 0===q?void 0:q.filter((function(e){var n,t=e.configuration;return(null===t||void 0===t?void 0:t.file_path)!==(null===F||void 0===F?void 0:F.fullPath)&&(null===t||void 0===t||null===(n=t.file_source)||void 0===n?void 0:n.path)!==(null===F||void 0===F?void 0:F.fullPath)}))}),[F,q]);(0,p.useEffect)((function(){P((function(e){return e||(null===ye||void 0===ye?void 0:ye[0])}))}),[]);var Q,X,J,$,ee,ne,te,oe,le,ce,se,de,pe,he,me,ge,Ce,Oe,we,_e,Se,Ie,Ee,Te,Me,Be,De,Ae=(0,p.useMemo)((function(){var e,n;return{schema:null===D||void 0===D||null===(e=D.schema)||void 0===e?void 0:e.find((function(e){var t=e.models;return null===t||void 0===t?void 0:t.find((function(e){if((null===e||void 0===e?void 0:e.name)===(null===F||void 0===F?void 0:F.name))return n=e}))})),schemaDetails:n}}),[D,F]),Re=(0,f.Db)(Y.ZP.cache_items.useUpdate(encodeURIComponent(null===F||void 0===F?void 0:F.fullPath),W),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.cache_item;T(n)},onErrorCallback:function(e,n){return T(null),a({errors:n,response:e})}})}}),Ne=(0,r.Z)(Re,2),Le=Ne[0],Fe=Ne[1].isLoading;return(0,p.useEffect)((function(){setTimeout((function(){var e,n;return g(null===d||void 0===d||null===(e=d.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),1)}),[]),(0,p.useEffect)((function(){fe.DATA===(null===j||void 0===j?void 0:j.uuid)&&Le({cache_item:{}})}),[F,j,Le]),z.N.DBT===(null===n||void 0===n?void 0:n.item_type)?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{ref:d,children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",flex:1,children:[(0,S.jsx)(N.DBT,{size:2.5*w.iI}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{large:!0,monospace:!0,children:null===F||void 0===F?void 0:F.name}),(null===Ae||void 0===Ae||null===(Q=Ae.schemaDetails)||void 0===Q?void 0:Q.description)&&(0,S.jsx)("div",{style:{marginTop:2},children:(0,S.jsx)(O.ZP,{muted:!0,children:null===Ae||void 0===Ae||null===(X=Ae.schemaDetails)||void 0===X?void 0:X.description})})]})]}),o&&(0,S.jsx)(be.ZP,{backgroundColor:(0,_.qn)(b.tf.DBT,{theme:c}).accent,beforeIcon:(0,S.jsx)(N.AddBlock,{}),onClick:function(){return o({cacheItem:n,row:F})},children:"Add to pipeline as a block"})]})}),(0,S.jsx)(ve.Z,{large:!0,onClickTab:function(e){return null===P||void 0===P?void 0:P(e)},selectedTabUUID:null===j||void 0===j?void 0:j.uuid,tabs:ye,underlineStyle:!0}),(0,S.jsx)(k.Z,{light:!0})]}),fe.OVERVIEW===(null===j||void 0===j?void 0:j.uuid)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Info"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{label:function(){return"Info"},uuid:"details"},{label:function(){return""},uuid:"value"}],noHeader:!0,rows:[[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Model file"}),(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:null===F||void 0===F?void 0:F.filePath})],[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Directory"}),(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:null===F||void 0===F?void 0:F.directory})]].concat(null!==Ae&&void 0!==Ae&&null!==(J=Ae.schema)&&void 0!==J&&J.file_path?[[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Schema file"}),(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:null===Ae||void 0===Ae||null===($=Ae.schema)||void 0===$?void 0:$.file_path})]]:[])}),(null===Ae||void 0===Ae||null===(ee=Ae.schemaDetails)||void 0===ee||null===(ne=ee.columns)||void 0===ne?void 0:ne.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Schema"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{uuid:"Column"},{uuid:"Description"}],rows:null===Ae||void 0===Ae||null===(te=Ae.schemaDetails)||void 0===te||null===(oe=te.columns)||void 0===oe?void 0:oe.map((function(e){var n=e.description,t=e.name;return[(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:t},"name-".concat(t)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:n},"description-".concat(n))]}))})]}),(null===V||void 0===V?void 0:V.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Upstream model dependencies"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(R.Z,{columnFlex:[1,1,1,null],columns:[{uuid:"Name"},{uuid:"Model file"},{uuid:"Directory"},{rightAligned:!0,uuid:"Project"}],onClickRow:function(e){var n,i,o,r=null===V||void 0===V?void 0:V[e],l=null===r||void 0===r?void 0:r.configuration,c=null===t||void 0===t?void 0:t.find((function(e){var n;return e.uuid===(null===l||void 0===l||null===(n=l.file_source)||void 0===n?void 0:n.project_path)})),s=ie({models:[(null===l||void 0===l?void 0:l.file_path)||(null===l||void 0===l||null===(n=l.file_source)||void 0===n?void 0:n.path)],project:null===c||void 0===c||null===(i=c.item)||void 0===i?void 0:i.project}),a=null===(o=re([null===s||void 0===s?void 0:s[0]]))||void 0===o?void 0:o[0];return u((function(e){return ue(a,e,t)}))},rows:null===V||void 0===V?void 0:V.map((function(e){var n,t,i,o,r=e.configuration,l=e.uuid,u=null===(n=ie({models:[(null===r||void 0===r?void 0:r.file_path)||(null===r||void 0===r||null===(t=r.file_source)||void 0===t?void 0:t.path)],project:null===D||void 0===D?void 0:D.project}))||void 0===n?void 0:n[0];return[(0,S.jsx)(O.ZP,{monospace:!0,dbt:!0,small:!0,children:(null===u||void 0===u?void 0:u.name)||l},"model-".concat(l)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:(null===u||void 0===u?void 0:u.filePath)||(null===r||void 0===r?void 0:r.file_path)||(null===r||void 0===r||null===(i=r.file_source)||void 0===i?void 0:i.path)},"model-file-".concat(l)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:null===u||void 0===u?void 0:u.directory},"model-directory-".concat(l)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,rightAligned:!0,small:!0,children:null===r||void 0===r||null===(o=r.file_source)||void 0===o?void 0:o.project_path},"project-".concat(l))]}))})]}),(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Code"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{label:function(){return"Info"},uuid:"details"},{label:function(){return""},uuid:"value"}],noHeader:!0,rows:[[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"File"}),(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:null===F||void 0===F?void 0:F.fullPath})]]}),(0,S.jsx)(xe.Z,{autoHeight:!0,language:Ze.nB[null===F||void 0===F?void 0:F.fileExtension],padding:2*w.iI,readOnly:!0,value:null===H||void 0===H?void 0:H.content})]}),fe.LINEAGE===(null===j||void 0===j?void 0:j.uuid)&&(0,S.jsx)(S.Fragment,{children:(null===q||void 0===q?void 0:q.length)>=1&&(0,S.jsx)(je.ZP,{disabled:!0,enablePorts:!1,height:Math.max(i,50*w.iI),heightOffset:m,pannable:!0,pipeline:{blocks:q,uuid:null},zoomable:!0})}),fe.DATA===(null===j||void 0===j?void 0:j.uuid)&&(0,S.jsxs)(S.Fragment,{children:[Fe&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(ke.Z,{inverted:!0})}),!Fe&&!(null!==M&&void 0!==M&&null!==(le=M.rows)&&void 0!==le&&le.length)&&(0,S.jsxs)(C.Z,{p:w.cd,children:[!(null!==E&&void 0!==E&&null!==(ce=E.item)&&void 0!==ce&&null!==(se=ce.exception)&&void 0!==se&&se.length)&&(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{default:!0,children:"No sample data exists. Try running the model first."})}),(null===E||void 0===E||null===(de=E.item)||void 0===de||null===(pe=de.logs)||void 0===pe?void 0:pe.length)>=1&&(0,S.jsx)(C.Z,{mb:w.cd,children:null===E||void 0===E||null===(he=E.item)||void 0===he||null===(me=he.logs)||void 0===me||null===(ge=me.split("\n"))||void 0===ge?void 0:ge.map((function(e){return(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,pre:!0,children:e},e)}))}),(null===E||void 0===E||null===(Ce=E.item)||void 0===Ce||null===(Oe=Ce.exception)||void 0===Oe?void 0:Oe.length)>=1&&(0,S.jsx)(C.Z,{mb:w.cd,children:null===E||void 0===E||null===(we=E.item)||void 0===we||null===(_e=we.exception)||void 0===_e||null===(Se=_e.split("\n"))||void 0===Se?void 0:Se.map((function(e){return(0,S.jsx)(O.ZP,{monospace:!0,pre:!0,warning:!0,children:e},e)}))})]}),!Fe&&M&&(null===M||void 0===M||null===(Ie=M.rows)||void 0===Ie?void 0:Ie.length)>=1&&(0,S.jsx)(R.Z,{columnFlex:null===M||void 0===M||null===(Ee=M.columns)||void 0===Ee?void 0:Ee.map((function(){return null})),columns:null===M||void 0===M||null===(Te=M.columns)||void 0===Te?void 0:Te.map((function(e){return{uuid:e}})),rows:null===M||void 0===M||null===(Me=M.rows)||void 0===Me?void 0:Me.map((function(e){return null===e||void 0===e?void 0:e.map((function(e,n){return(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:String(e)===String(!1)?"false":String(e)===String(!0)?"true":e},"value-".concat(e,"-").concat(n))}))}))})]}),fe.PIPELINES===(null===j||void 0===j?void 0:j.uuid)&&(0,S.jsx)(S.Fragment,{}),fe.CODE===(null===j||void 0===j?void 0:j.uuid)&&(0,S.jsx)(S.Fragment,{children:(null===K||void 0===K||null===(Be=K.item)||void 0===Be?void 0:Be.content_compiled)&&(0,S.jsx)(xe.Z,{autoHeight:!0,language:Ze.nB[null===F||void 0===F?void 0:F.fileExtension],padding:2*w.iI,readOnly:!0,value:null===K||void 0===K||null===(De=K.item)||void 0===De?void 0:De.content_compiled})})]}):(0,S.jsx)("div",{})},Oe=t(95924);function we(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 _e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?we(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):we(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Se=function(e){var n=e.cacheItems,t=e.mainContainerHeight,i=e.onClickAction,o=e.refCacheItems,r=e.selectedItem,u=e.selectedLinks,c=e.setSelectedLinks,s=(0,p.useMemo)((function(){var e;return null===u||void 0===u||null===(e=u.find((function(e){return e.uuid in b.GJ})))||void 0===e?void 0:e.uuid}),[u]),a=(0,p.useMemo)((function(){return(0,L.YC)(n||[],(function(e){var n,t=e.item;return null===t||void 0===t||null===(n=t.project)||void 0===n?void 0:n.name})).filter((function(e){var n,t,i=e.item;return 1===(null===u||void 0===u?void 0:u.length)||(null===u||void 0===u||null===(n=u[0])||void 0===n?void 0:n.uuid)===(null===i||void 0===i||null===(t=i.project)||void 0===t?void 0:t.uuid)}))}),[n,u]),d=(0,p.useCallback)((function(e){var t=(null===e||void 0===e?void 0:e.item)||{models:[],project:null},r=ie({models:t.models,project:t.project});return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Models"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.PaginateArrowRight,{muted:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:!0,large:!0,monospace:!0,children:(null===r||void 0===r?void 0:r.length)||0})]})}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(R.Z,{buildRowProps:function(n){var t=null===r||void 0===r?void 0:r[n],i=(0,p.createRef)();return(null===e||void 0===e?void 0:e.uuid)in(null===o||void 0===o?void 0:o.current)||(o.current[null===e||void 0===e?void 0:e.uuid]={}),o.current[null===e||void 0===e?void 0:e.uuid][t.fullPath]=i,{rowProps:{id:t.fullPath,ref:i}}},columnFlex:[1,1,1,1],columns:[{uuid:"Name"},{uuid:"Directory"},{uuid:"File"},{label:function(){return""},rightAligned:!0,uuid:"Action"}],onClickRow:function(e){var t,i,o=null===r||void 0===r?void 0:r[e],l=null===(t=re([o]))||void 0===t?void 0:t[0],u=null===(i=le(n))||void 0===i?void 0:i.find((function(e){var n;return e.uuid===(null===o||void 0===o||null===(n=o.project)||void 0===n?void 0:n.uuid)}));return c((function(e){return ue([l,u],e,n)}))},rows:null===r||void 0===r?void 0:r.map((function(n){var t=n.directory,o=n.filePath,r=n.name;return[(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:r},"model-".concat(r)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:t},"model-".concat(t)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:o},"model-".concat(o)),(0,S.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(be.ZP,{compact:!0,onClick:function(t){return(0,Oe.j)(t),i({cacheItem:e,row:n})},secondary:!0,small:!0,children:"Add to pipeline"})})]}))})]})}),[n,i,c]),v=(0,p.useMemo)((function(){return(0,S.jsx)(me.Z,{noBorder:!0,noBoxShadow:!0,visibleMappingForced:null===n||void 0===n?void 0:n.reduce((function(e,n,t){return _e(_e({},e),{},(0,l.Z)({},String(t),!0))}),{}),children:null===n||void 0===n?void 0:n.map((function(e){var n,t=(null===e||void 0===e||null===(n=e.item)||void 0===n?void 0:n.project)||{name:null,uuid:null},i=t.name,r=t.uuid,l=(0,p.createRef)();return o.current[null===e||void 0===e?void 0:e.uuid]={cacheItem:l},(0,S.jsx)(ge.Z,{id:null===e||void 0===e?void 0:e.uuid,noBorderRadius:!0,noPaddingContent:!0,refContainer:l,title:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(N.FolderOutline,{size:2*w.iI}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{monospace:!0,children:i}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,small:!0,children:r})]})]}),titleXPadding:w.cd*w.iI,titleYPadding:w.cd*w.iI,children:d(e)},r)}))})}),[d,n]),f=(0,p.useMemo)((function(){return d(null===a||void 0===a?void 0:a[0])}),[a,d]),h=(0,p.useMemo)((function(){return(0,S.jsx)(Ce,{cacheItem:r,cacheItems:n,mainContainerHeight:t,onClickAction:i,selectedLinks:u,setSelectedLinks:c})}),[n,t,i,r,u,c]);return(0,S.jsx)(S.Fragment,{children:b.tf.DBT===s&&(0,S.jsx)(S.Fragment,{children:1===(null===u||void 0===u?void 0:u.length)?v:2===(null===u||void 0===u?void 0:u.length)?f:h})})},Ie=t(49130),Ee=t(17488),Te=t(62547),Me=t(42631),Be=t(47041),De=t(91437),Ae=8*w.iI,Re=v.default.div.withConfig({displayName:"indexstyle__AfterContentStyle",componentId:"sc-119v89s-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),Ne=v.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-119v89s-1"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),Le=v.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-119v89s-2"})(["border-radius:","px;position:relative;"," ",""],Me.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n background-color: ").concat((e.theme.background||U.Z.background).panel,";\n ")}),(function(e){return e.maxWidth&&"\n width: ".concat(e.maxWidth,"px;\n ")})),Fe=v.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-119v89s-3"})(["padding:","px;",""],w.cd*w.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")})),Ue=v.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-119v89s-4"})([""," "," ",""],(0,De.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||U.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||U.Z.background).codeTextarea,";\n ")})),He=v.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-119v89s-5"})(["position:absolute;"]),We=v.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-119v89s-6"})([""," overflow:auto;position:fixed;",""],Be.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")})),Ge=v.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-119v89s-7"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],Me.n_,w.cd*w.iI,1*w.iI,(function(e){return!e.warning&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(e){return!e.selected&&!e.warning&&"\n border: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||U.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||U.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||U.Z.borders).contrast,";\n ")})),Ke=v.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-119v89s-8"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),ze=t(38118),qe=t(39643),Ve=v.default.div.withConfig({displayName:"indexstyle__MainStyle",componentId:"sc-aj0zrh-0"})([".show{display:block;}tr.show{display:table-row;}.hide{display:none;}"]),Ye=t(53808),Qe=t(42041),Xe=t(44688),Je=t(19183);function $e(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 en(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$e(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var nn=function(e){var n,t=e.contained,i=e.defaultBlockType,o=e.focused,l=e.onClickAction,u=e.setFocused,c=(0,p.useRef)(null),s=(0,p.useRef)(null),a=(0,p.useRef)(null),d=(0,p.useRef)({}),v=(0,p.useRef)({}),f=(0,p.useRef)(null),h=(0,p.useMemo)((function(){return"dbt/Browser"}),[]),m=(0,p.useMemo)((function(){return"".concat(h,"width_after")}),[h]),g=(0,p.useMemo)((function(){return"".concat(h,"width_before")}),[h]),x=(0,Je.i)(),j=x.height,P=x.width,_=(0,p.useState)({height:null,width:null}),I=_[0],E=_[1];(0,p.useEffect)((function(){E({height:j-2*Ae,width:P-2*Ae})}),[j,P]);var T=(0,ae.VI)(null,{},[],{uuid:h}),M=((0,r.Z)(T,1)[0],(0,p.useState)(!1)),D=M[0],A=M[1],R=(0,p.useCallback)((function(e){u&&void 0!==typeof o?null===u||void 0===u||u(e):A(e)}),[o,u]),L=(0,p.useMemo)((function(){return"undefined"===typeof o?D:o}),[o,D]),U=(0,p.useState)(!0),W=U[0],G=U[1],q=(0,p.useState)((0,Ye.U2)(m,60*w.iI)),V=q[0],Q=q[1],J=(0,p.useState)(!1),$=J[0],ee=J[1],oe=(0,p.useState)(Math.max((0,Ye.U2)(g),40*w.iI)),ue=oe[0],se=oe[1],ve=(0,p.useState)(null),pe=ve[0],fe=ve[1],me=(0,p.useState)(!1),ge=me[0],be=me[1],xe=(0,p.useState)(null),je=xe[0],ke=xe[1],Ze=Y.ZP.cache_items.list({item_type:z.N.DBT}).data,ye=(0,p.useMemo)((function(){return(null===Ze||void 0===Ze?void 0:Ze.cache_items)||[]}),[Ze]),Pe=(0,p.useState)(null),Ce=Pe[0],we=Pe[1],_e=(0,p.useCallback)((function(e){we(e),f.current=e,v.current={},null===ye||void 0===ye||ye.forEach((function(e){if(z.N.DBT===(null===e||void 0===e?void 0:e.item_type)){var n,t,i,o,r,l=null===d||void 0===d||null===(n=d.current)||void 0===n?void 0:n[null===e||void 0===e?void 0:e.uuid],u=null===e||void 0===e||null===(t=e.item)||void 0===t||null===(i=t.models)||void 0===i?void 0:i.filter((function(e){var n,t,i,o,r=!(null!==(n=f.current)&&void 0!==n&&n.length)||(null===e||void 0===e||null===(t=e.toLowerCase())||void 0===t||null===(i=t.replaceAll("_"," "))||void 0===i||null===(o=i.replaceAll("-"," "))||void 0===o?void 0:o.includes(f.current));if(l){var u=null===l||void 0===l?void 0:l[e];if(null!==u&&void 0!==u&&u.current)if(r){var c,s,a,d=(null===(c=(null===u||void 0===u||null===(s=u.current)||void 0===s?void 0:s.className)||"")||void 0===c?void 0:c.split(" "))||[];u.current.className=null===d||void 0===d||null===(a=d.filter((function(e){return!["hide","show"].includes(e)})).concat("show"))||void 0===a?void 0:a.join(" ")}else{var v,p,h,m=(null===(v=(null===u||void 0===u||null===(p=u.current)||void 0===p?void 0:p.className)||"")||void 0===v?void 0:v.split(" "))||[];u.current.className=null===m||void 0===m||null===(h=m.filter((function(e){return!["hide","show"].includes(e)})).concat("hide"))||void 0===h?void 0:h.join(" ")}}return r}));if((null===u||void 0===u?void 0:u.length)>=1){if(v.current[e.uuid]=en(en({},e||{}),{},{item:en(en({},e.item||{}),{},{models:u})}),null!==l&&void 0!==l&&null!==(o=l.cacheItem)&&void 0!==o&&o.current){var c,s,a,p,h=(null===(c=(null===l||void 0===l||null===(s=l.cacheItem)||void 0===s||null===(a=s.current)||void 0===a?void 0:a.className)||"")||void 0===c?void 0:c.split(" "))||[];l.cacheItem.current.className=null===h||void 0===h||null===(p=h.filter((function(e){return!["hide","show"].includes(e)})).concat("show"))||void 0===p?void 0:p.join(" ")}}else if(null!==l&&void 0!==l&&null!==(r=l.cacheItem)&&void 0!==r&&r.current){var m,g,b,x,j=(null===(m=(null===l||void 0===l||null===(g=l.cacheItem)||void 0===g||null===(b=g.current)||void 0===b?void 0:b.className)||"")||void 0===m?void 0:m.split(" "))||[];l.cacheItem.current.className=null===j||void 0===j||null===(x=j.filter((function(e){return!["hide","show"].includes(e)})).concat("hide"))||void 0===x?void 0:x.join(" ")}}}))}),[ye]),Me=(0,p.useState)(null),Be=Me[0],De=Me[1],Re=(0,p.useState)(null),Ne=Re[0],Fe=Re[1],Ue=(0,p.useCallback)((function(e){De(e),_e(null),null!==a&&void 0!==a&&a.current&&(a.current.value="")}),[_e]),He=(0,p.useCallback)((function(e){Fe(e),_e(null),null!==a&&void 0!==a&&a.current&&(a.current.value="")}),[_e]),We=(0,p.useMemo)((function(){var e,n=null===Be||void 0===Be||null===(e=Be.slice(0,2))||void 0===e?void 0:e.map((function(e){return e.uuid}));return null===ye||void 0===ye?void 0:ye.find((function(e){var t,i=e.item;return null===n||void 0===n?void 0:n.includes(null===i||void 0===i||null===(t=i.project)||void 0===t?void 0:t.uuid)}))}),[ye,Be]);(0,p.useEffect)((function(){i&&(Fe(te[X.BLOCKS]),Ue([null===ne||void 0===ne?void 0:ne.find((function(e){return e.uuid===i}))]))}),[]),(0,p.useEffect)((function(){G(!We)}),[We]);var Ge=(0,p.useMemo)((function(){return(0,S.jsx)(F,{cacheItems:ye,selectedLinks:Be})}),[ye,Be]),Ke=(0,p.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;Ue((function(n){return ce(e,n)}))}),[Be,Ue,He]),$e=(0,p.useMemo)((function(){return(0,S.jsx)(Ve,{children:(0,S.jsx)(Se,{cacheItems:ye,mainContainerHeight:je,onClickAction:l,refCacheItems:d,selectedItem:We,selectedLinks:Be,setSelectedLinks:Ue})})}),[ye,je,l,We,Be,Ue]);(0,p.useEffect)((function(){setTimeout((function(){var e,n,t,i;fe(null===s||void 0===s||null===(e=s.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),ke(null===c||void 0===c||null===(t=c.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height)}),1)}),[]);var nn=(0,Xe.y)(),tn=nn.registerOnKeyDown,on=nn.unregisterOnKeyDown;(0,p.useEffect)((function(){return function(){return on(h)}}),[on,h]),null===tn||void 0===tn||tn(h,(function(e,n){var t,i;L&&(n[qe.vP]&&(R(!1),null===a||void 0===a||null===(t=a.current)||void 0===t||t.blur()));((0,Qe.y)([qe.zX,qe.A1],n)||(0,Qe.y)([qe.PQ,qe.A1],n))&&(e.preventDefault(),null===a||void 0===a||null===(i=a.current)||void 0===i||i.focus())}),[L,R]);var rn=(0,p.useMemo)((function(){var e=[];return null===ye||void 0===ye||ye.forEach((function(n){var t,i,o;null===(t=ie({models:(null===n||void 0===n||null===(i=n.item)||void 0===i?void 0:i.models)||[],project:null===n||void 0===n||null===(o=n.item)||void 0===o?void 0:o.project}))||void 0===t||t.forEach((function(t){var i,o,r,l,u,c,s={cacheItem:n,model:t};e.push({itemObject:s,searchQueries:[null===t||void 0===t?void 0:t.fullPath,null===t||void 0===t||null===(i=t.fullPath)||void 0===i||null===(o=i.toLowerCase())||void 0===o||null===(r=o.replaceAll("_"," "))||void 0===r?void 0:r.replaceAll("-"," "),null===t||void 0===t?void 0:t.name,null===t||void 0===t||null===(l=t.name)||void 0===l||null===(u=l.toLowerCase())||void 0===u||null===(c=u.replaceAll("_"," "))||void 0===c?void 0:c.replaceAll("-"," ")],value:null===t||void 0===t?void 0:t.fullPath})}))})),e}),[ye]);return(0,S.jsx)(Le,{maxWidth:t?null===I||void 0===I?void 0:I.width:null,children:(0,S.jsx)(Te.Z,{after:Ge,afterDividerContrast:!0,afterHeightOffset:0,afterHidden:W,afterInnerHeightMinus:pe,afterMousedownActive:$,afterWidth:V,before:(0,S.jsx)(de,{cacheItems:ye,selectedLinks:Be,selectedTab:Ne,setSelectedLinks:Ue}),beforeDividerContrast:!0,beforeHeader:(0,S.jsx)("div",{ref:s,children:(null===Be||void 0===Be?void 0:Be.length)>=1?(0,S.jsx)(K,{navigateBack:Ke,selectedLinks:Be,selectedTab:Ne}):(0,S.jsx)(he,{selectedTab:Ne,setSelectedTab:He})}),beforeHeightOffset:0,beforeContentHeightOffset:pe,beforeMousedownActive:ge,beforeWidth:ue,contained:!0,headerOffset:H.Mz,height:t?null===I||void 0===I?void 0:I.height:j,hideAfterCompletely:!We,inline:!0,mainContainerHeader:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(K,{navigateBack:Ke,selectedTab:(null===Be||void 0===Be?void 0:Be.length)>=2?null===Be||void 0===Be?void 0:Be[1]:null,children:(0,S.jsxs)(ze.eS,{children:[(0,S.jsx)(Ee.Z,{afterIcon:(0,S.jsx)(Ie.Z,{addPlusSignBetweenKeys:!0,disabled:!0,keyTextGroups:[[qe.RJ,qe.ZS]]}),afterIconClick:function(){var e;null===a||void 0===a||null===(e=a.current)||void 0===e||e.focus()},beforeIcon:(0,S.jsx)(N.Search,{}),compact:!0,fullWidth:!0,onBlur:function(){return setTimeout((function(){return R(!1)}),150)},onChange:function(e){return _e(e.target.value)},onFocus:function(){return R(!0)},placeholder:"Search a file...",primary:!0,small:!0,ref:a}),(0,S.jsx)(ze.rS,{maxHeight:100*w.iI,topOffset:null===a||void 0===a||null===(n=a.current)||void 0===n?void 0:n.getBoundingClientRect().height,children:(0,S.jsx)(B.Z,{itemGroups:[{items:L?rn:[],renderItem:function(e,n){var t=e.itemObject,i=(t.cacheItem,t.model),o=i.filePath,r=i.project,l=N.Database;return(0,S.jsx)(ze.gI,en(en({},n),{},{onClick:function(e){var t;(0,Oe.j)(e),null===n||void 0===n||null===(t=n.onClick)||void 0===t||t.call(n,e)},children:(0,S.jsxs)(Z.Z,{alignItems:"center",flex:1,justifyContent:"space-between",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(l,{default:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,overflowWrap:!0,small:!0,textOverflow:!0,children:o})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,overflowWrap:!0,small:!0,textOverflow:!0,children:null===r||void 0===r?void 0:r.name})]})]})}))}}],maxResults:12,onSelectItem:function(e){var n,t,i,o=e.itemObject,r=[],l=null===o||void 0===o?void 0:o.cacheItem;z.N.DBT===(null===l||void 0===l?void 0:l.item_type)&&(r.push(null===(t=re([null===o||void 0===o?void 0:o.model]))||void 0===t?void 0:t[0]),r.push(null===(i=le(ye))||void 0===i?void 0:i.find((function(e){var n,t;return e.uuid===(null===l||void 0===l||null===(n=l.item)||void 0===n||null===(t=n.project)||void 0===t?void 0:t.uuid)}))),r.push(null===ne||void 0===ne?void 0:ne.find((function(e){return e.uuid===b.tf.DBT}))));Ue(r),_e(null),R(!1),null===a||void 0===a||null===(n=a.current)||void 0===n||n.blur()},searchQuery:Ce,uuid:"".concat(h,"/AutocompleteDropdown")})})]})}),(0,S.jsx)(k.Z,{light:!0})]}),mainContainerRef:c,setAfterHidden:G,setAfterMousedownActive:ee,setAfterWidth:Q,setBeforeMousedownActive:be,setBeforeWidth:se,uuid:h,children:$e})})},tn=t(65701),on=t(1254);var rn=function(e){var n=e.size;return(0,S.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("path",{d:"M67.7193 2.36691C69.8656 1.52184 72.3078 2.0081 73.9667 3.61084L116.977 45.1646C119.018 47.1366 119.362 50.2841 117.794 52.65L92.5787 90.7113C92.1293 91.3897 91.5441 91.9675 90.8601 92.4083L51.1076 118.029C48.6859 119.589 45.4904 119.168 43.5558 117.033L3.02296 72.3013C1.48382 70.6027 1.07052 68.1652 1.96372 66.0542L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L67.7193 2.36691Z",fill:"url(#paint0_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M71.2431 0.979492L23.6155 19.9931C22.1646 20.5723 21.0034 21.7045 20.3877 23.1402L0.499023 69.5159L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L71.2431 0.979492Z",fill:"url(#paint1_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint3_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint4_linear_11972_15232)"}),(0,S.jsx)("path",{d:"M23.3591 24.6945L58.2913 58.6736L25.3897 22.7247C24.8455 22.13 23.9152 22.1095 23.3452 22.6795C22.7871 23.2375 22.7934 24.1442 23.3591 24.6945Z",fill:"url(#paint5_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M51.6694 46.395L73.0043 69.5215C73.6132 70.1816 74.5925 70.3441 75.382 69.9161L117.654 46.9975L75.6257 67.8209C74.8809 68.1899 73.9844 68.0497 73.3879 67.4708L51.6694 46.395Z",fill:"url(#paint6_radial_11972_15232)"}),(0,S.jsxs)("defs",{children:[(0,S.jsxs)("radialGradient",{id:"paint0_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16.9412 88.4412) rotate(18.02) scale(82.0367 81.4644)",children:[(0,S.jsx)("stop",{stopColor:"#FFDA19"}),(0,S.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,S.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,S.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,S.jsxs)("radialGradient",{id:"paint1_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.8711 10.2518) rotate(87.6364) scale(26.1711 27.0141)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint2_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(150.671 44.2502) rotate(128.639) scale(125.554 128.436)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint3_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(133.353 52.8357) rotate(144.647) scale(86.7385 72.7129)",children:[(0,S.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,S.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint5_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(25.2251 23.4978) rotate(48.3599) scale(35.5147 43.1672)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint6_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(76.5908 67.6516) rotate(104.629) scale(14.9575 79.0374)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},ln=t(18746),un=t(93369),cn=t(7267),sn=t(57653),an=t(44085),dn=t(4015),vn=t(13803),pn=t(72191),fn=t(2548);function hn(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 mn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?hn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gn=function(e){var n,t,i,o=e.block,l=e.defaultName,u=e.isReplacingBlock,c=e.isUpdatingBlock,s=e.onClose,a=e.onSave,d=e.pipeline,v=(0,ae.VI)(null,{},[],{uuid:"ConfigureBlock"}),h=(0,r.Z)(v,1)[0],m=null===(n=(null===o||void 0===o?void 0:o.pipelines)||[])||void 0===n?void 0:n.length,g=(0,p.useRef)(null),x=(0,p.useState)({color:(null===o||void 0===o?void 0:o.color)||null,language:(null===o||void 0===o||null===(t=o.defaults)||void 0===t?void 0:t.language)||(null===o||void 0===o?void 0:o.language),name:l,type:null===o||void 0===o?void 0:o.type}),j=x[0],k=x[1],P=(0,p.useCallback)((function(){a(mn(mn({},j),{},{name:(null===j||void 0===j?void 0:j.name)||l})),s()}),[j,l,s,a]);(0,p.useEffect)((function(){var e,n=function(e){e.stopPropagation(),"Escape"===e.key?s():"Enter"===e.key&&P()};return null===(e=document)||void 0===e||e.addEventListener("keydown",n),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("keydown",n)}}),[P,s]),(0,p.useEffect)((function(){var e;null===g||void 0===g||null===(e=g.current)||void 0===e||e.focus()}),[]);var _=(0,p.useMemo)((function(){return sn.qL.INTEGRATION===(null===d||void 0===d?void 0:d.type)}),[d]),I=(0,p.useMemo)((function(){return b.tf.CUSTOM===(null===o||void 0===o?void 0:o.type)}),[o]),E=(0,p.useMemo)((function(){return b.tf.MARKDOWN===(null===o||void 0===o?void 0:o.type)}),[o]),T=(0,p.useMemo)((function(){return null===o||void 0===o?void 0:o.block_action_object}),[o]),M=(0,p.useMemo)((function(){return fn.L.GENERATE_BLOCK===(null===T||void 0===T?void 0:T.object_type)}),[T]),B=(0,p.useMemo)((function(){return M&&(null===T||void 0===T?void 0:T.description)}),[T,M]),D=(0,p.useMemo)((function(){var e;return vn.I.DATA_INTEGRATION===(null===o||void 0===o||null===(e=o.config)||void 0===e?void 0:e.template_type)||!![vn.O.DESTINATIONS,vn.O.SOURCES].includes(null===T||void 0===T?void 0:T.language)}),[o,T]),A=(0,p.useState)(null),R=A[0],L=A[1],F=(0,f.Db)(Y.ZP.llms.useCreate(),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.llm,t=(null===n||void 0===n?void 0:n.response)||{},i=t.block_type,o=t.configuration,r=t.content,l=t.language;k((function(e){return mn(mn({},e),{},{block_action_object:null,configuration:o,content:r,language:l,type:i})})),L(n)},onErrorCallback:function(e,n){return h({errors:n,response:e})}})}}),U=(0,r.Z)(F,2),H=U[0],W=U[1].isLoading;(0,p.useEffect)((function(){M&&B&&!R&&H({llm:{request:{block_description:B},use_case:cn.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[H,B,M,R]);var K=(0,p.useMemo)((function(){var e,n;return null!==o&&void 0!==o&&null!==(e=o.config)&&void 0!==e&&e.custom_template?null===o||void 0===o||null===(n=o.config)||void 0===n?void 0:n.custom_template:[fn.L.CUSTOM_BLOCK_TEMPLATE,fn.L.MAGE_TEMPLATE].includes(null===T||void 0===T?void 0:T.object_type)?mn(mn({},T),{},{name:null===T||void 0===T?void 0:T.title}):void 0}),[o,T]),z=(0,p.useMemo)((function(){var e=(null===j||void 0===j?void 0:j.type)||(null===o||void 0===o?void 0:o.type);K&&(e=null===K||void 0===K?void 0:K.block_type);var n=b.V4[e];return _&&(b.tf.DATA_LOADER===e?n="Source":b.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[o,j,K,_]);return(0,S.jsxs)(dn.Nk,{width:M&&(null===j||void 0===j?void 0:j.content)&&80*w.iI,children:[(0,S.jsxs)(dn.I5,{children:[M&&W&&(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(O.ZP,{children:"Generating block using AI..."}),(0,S.jsx)(ke.Z,{inverted:!0})]}),M&&!W&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(N.AISparkle,{size:5*w.iI,warning:!0})}),!M&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(rn,{size:15*w.iI})})]}),M&&!W&&(0,S.jsx)(dn.gI,{children:(0,S.jsxs)(C.Z,{py:1,children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Block generated using AI"})}),(0,S.jsx)(O.ZP,{textOverflow:!0,children:B})]})}),K&&(0,S.jsx)(dn.gI,{children:(0,S.jsxs)(C.Z,{py:1,children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Template"})}),(0,S.jsx)(O.ZP,{textOverflow:!0,children:null===(i=(null===K||void 0===K?void 0:K.name)||(null===K||void 0===K?void 0:K.template_uuid))||void 0===i?void 0:i.slice(0,40)})]})}),b.tf.GLOBAL_DATA_PRODUCT!==(null===o||void 0===o?void 0:o.type)&&m>1&&(0,S.jsxs)(dn.gI,{children:[(0,S.jsx)(Z.Z,{flex:"1",children:(0,S.jsx)(N.AlertTriangle,{size:pn.l2,warning:!0})}),(0,S.jsx)(Z.Z,{flex:"6",children:(0,S.jsxs)(O.ZP,{bold:!0,warning:!0,children:[c&&"Renaming this block will affect ".concat(m," pipelines.")+" The renamed block may need to be re-added to the shared pipeline(s).",u&&"This will create a copy of the selected block and replace the existing one so it is no longer shared with any other pipelines."]})})]}),(0,S.jsxs)(dn.gI,{children:[(0,S.jsx)(O.ZP,{default:!0,children:"Name"}),(0,S.jsx)(Ee.Z,{alignRight:!0,fullWidth:!0,noBackground:!0,noBorder:!0,onChange:function(e){return k((function(n){return mn(mn({},n),{},{name:e.target.value})}))},paddingVertical:w.iI,placeholder:"Block name...",ref:g,value:(null===j||void 0===j?void 0:j.name)||""})]}),(0,S.jsxs)(dn.gI,{children:[(0,S.jsx)(O.ZP,{default:!0,children:"Type"}),(0,S.jsx)(C.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{muted:!0,children:z}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.Locked,{muted:!0})]})})]}),!E&&(I||K||(null===j||void 0===j?void 0:j.language))&&(0,S.jsxs)(dn.gI,{paddingVerticalAddition:3,children:[(0,S.jsx)(O.ZP,{default:!0,children:"Language"}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[[b.t6.PYTHON,b.t6.SQL,b.t6.R,b.t6.YAML].reduce((function(e,n){var t=(K?null===K||void 0===K?void 0:K.language:null===j||void 0===j?void 0:j.language)===n;return!(I&&!c&&!u||t||D&&b.t6.R!==n&&D&&b.t6.SQL!==n)||I&&b.t6.YAML===n||e.push((0,S.jsx)(C.Z,{ml:1,children:(0,S.jsx)(be.ZP,{borderColor:t?null:"transparent",compact:!0,default:!I&&!t&&!D,disabled:!I&&!t&&!D,noBackground:!0,notClickable:(!I||c||!D)&&t,onClick:K&&!D?null:function(){return k((function(e){return mn(mn({},e),{},{language:n})}))},selected:t,children:b.LE[n]})},n)),e}),[]),!I&&!D&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.Locked,{muted:!0})]}),(0,S.jsx)(C.Z,{mr:I||D?1:2})]})]}),(I||(null===K||void 0===K?void 0:K.color)||(null===j||void 0===j?void 0:j.color))&&(0,S.jsxs)(dn.gI,{children:[(0,S.jsx)(O.ZP,{default:!0,children:"Color"}),I&&(0,S.jsxs)(an.Z,{alignRight:!0,disabled:u,noBackground:!0,noBorder:!0,onChange:function(e){return k((function(n){return mn(mn({},n),{},{color:e.target.value})}))},value:K?(null===K||void 0===K?void 0:K.color)||"":(null===j||void 0===j?void 0:j.color)||"",children:[(0,S.jsx)("option",{value:""}),Object.values(b.Lq).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.kC)(e)},e)}))]}),!I&&(0,S.jsx)(C.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{muted:!0,children:(0,G.kC)((null===K||void 0===K?void 0:K.color)||(null===j||void 0===j?void 0:j.color)||"")}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.Locked,{muted:!0})]})})]}),M&&(null===j||void 0===j?void 0:j.content)&&(0,S.jsx)(dn.gI,{display:"block",children:(0,S.jsx)(C.Z,{pr:w.cd,py:1,children:(0,S.jsx)(tn.W,{backend:on.PD,children:(0,S.jsx)(ln.Z,{block:mn(mn({},j),{},{uuid:B}),defaultValue:null===j||void 0===j?void 0:j.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return k((function(n){return mn(mn({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},B)})})}),(0,S.jsx)(dn.$b,{children:(0,S.jsxs)(y.ZP,{fullWidth:!0,children:[(0,S.jsxs)(un.ZP,{bold:!0,centerText:!0,disabled:W,onClick:P,primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and\xa0",c?"update":u?"replace":"add"," block"]}),(0,S.jsx)(C.Z,{ml:1,children:(0,S.jsx)(be.ZP,{onClick:s,tabIndex:0,children:"Cancel"})})]})})]})},bn=t(54750),xn=t(4804),jn=t(99236),kn=t(29480),Zn=t(37443),yn=t(53405);function Pn(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 Cn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var On=function(e){var n=e.block,t=e.blockConfigString,i=e.blockContent,o=e.blockUpstreamBlocks,l=e.dataIntegrationConfiguration,u=e.onChangeCodeBlock,c=e.pipeline,s=e.savePipelineContent,a=e.setBlockConfigString,d=e.setBlockContent,v=e.setContent,h=e.setSelectedSubTab,m=e.showError,g=n||{},x=g.language,Z=g.type,_=g.uuid,I=(c||{}).uuid,E=(0,p.useState)(!1),T=E[0],M=E[1],B=(0,p.useMemo)((function(){return b.t6.YAML===x&&i?(0,xn.Qc)(i):{}}),[i,x]);(0,p.useEffect)((function(){B&&!t&&a((0,xn.Pz)(null===B||void 0===B?void 0:B.config))}),[t,B]);var D=(0,p.useState)(!1),R=D[0],L=D[1],F=(0,f.Db)(Y.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.integration_source;null!==n&&void 0!==n&&n.error_message?m({response:{error:{exception:null===n||void 0===n?void 0:n.error_message}}}):null!==n&&void 0!==n&&n.success&&L(!0)},onErrorCallback:function(e,n){return m({errors:n,response:e})}})}}),U=(0,r.Z)(F,2),H=U[0],W=U[1].isLoading,G=(0,p.useCallback)((function(){return s().then((function(){return H({integration_source:{action_type:"test_connection",block_uuid:_,pipeline_uuid:I}})}))}),[_,H,I,s]),K=(0,p.useMemo)((function(){if(b.t6.YAML===x)return(0,S.jsx)(kn.$W,{children:(0,S.jsx)(xe.Z,{autoHeight:!0,language:x,onChange:function(e){a(e);try{var n=(0,xn.Qc)(e),t=(0,xn.Pz)(Cn(Cn({},B),{},{config:n}));u(Z,_,t),v(t),M(!1)}catch(i){M(!0)}},tabSize:2,value:t||void 0,width:"100%"})});b.t6.PYTHON}),[t,i,B,x,Z,_,d,v]),z=(0,p.useMemo)((function(){return(0,yn.Wi)(o,l)}),[o,l]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.PlugAPI,{success:!0}),loading:W,onClick:function(){L(!1),G()},secondary:!0,compact:!0,children:"Test connection"}),R&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{success:!0,children:"Connection successful"})]})]})]})}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,large:!0,children:"Inputs from upstream blocks"}),0===(null===z||void 0===z?void 0:z.length)&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{muted:!0,children:["No inputs are selected. Toggle the upstream blocks in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return h(Zn.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null===z||void 0===z?void 0:z.length)>=1&&(0,S.jsx)(jn.Z,{inputsBlocks:z}),T&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(k.Z,{light:!0}),(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(A.Z,{danger:!0,level:5,children:"ERROR"})}),(0,S.jsxs)(O.ZP,{muted:!0,children:["The credentials configuration is formatted incorrectly for the language ",b.LE[x],". The formatting must be fixed before the credentials configuration can be saved."]})]})]}),K]})},wn=t(13126),_n=t(96348),Sn=t(26304),In=t(93859),En=t(66909),Tn=t(42122);var Mn=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.setSelectedSubTab,l=e.showError,u=e.stream,c=(0,p.useRef)(null),s=(0,p.useState)(null),a=s[0],d=s[1],v=(0,p.useState)(100),h=v[0],m=(v[1],(0,p.useState)(0)),g=m[0],b=m[1];(0,p.useEffect)((function(){var e,n;null!==c&&void 0!==c&&null!==(e=c.current)&&void 0!==e&&e.getBoundingClientRect().height&&b(null===c||void 0===c||null===(n=c.current)||void 0===n?void 0:n.getBoundingClientRect().height)}),[c]);var x=null===i||void 0===i?void 0:i.uuid,j=null===n||void 0===n?void 0:n.uuid,k=(0,p.useMemo)((function(){return{parentStreamID:(0,yn.Qu)(u),streamID:(0,yn.M$)(u)}}),[u]),Z=k.parentStreamID,y=k.streamID,_=(0,p.useMemo)((function(){return(0,Tn.Qr)((0,yn.WE)(u||{})||{},{idIsInObject:!0})}),[u]),I=Y.ZP.outputs.pipelines.detail(!a&&x,!a&&j,{parent_stream:Z,sample_count:h,stream:y},{revalidateOnFocus:!1}).data,E=(0,f.Db)(Y.ZP.outputs.useCreate(),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.output;d(n)},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),T=(0,r.Z)(E,2),M=T[0],B=T[1].isLoading,D=(0,p.useCallback)((function(){return M({output:{block_uuid:j,persist:1,pipeline_uuid:x,refresh:1,sample_count:h,streams:[{parent_stream:Z,stream:y}]}})}),[j,M,Z,x,h,y]),A=(0,p.useMemo)((function(){return a||(null===I||void 0===I?void 0:I.output)}),[I,a]),R=(0,p.useMemo)((function(){var e,n=(A||{}).outputs,t=void 0===n?[]:n;return null===t||void 0===t||null===(e=t.find((function(e){return e.uuid===y})))||void 0===e?void 0:e.data}),[A,y]),N=(0,p.useMemo)((function(){var e=R||{},n=e.sample_data,i=(e.type,n||{}),o=i.columns,r=i.rows;if(null!==o&&void 0!==o&&o.length&&null!==r&&void 0!==r&&r.length)return(0,S.jsx)(In.Z,{columnHeaderHeight:En.Eh,columns:o,height:t-g,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:r})}),[R,t,g]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,ref:c,children:_?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{default:!0,children:"Please select at least 1 column in the stream in order to fetch sample data."}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return o(Zn.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,S.jsx)(be.ZP,{compact:!0,loading:B,onClick:function(){return D()},primary:!0,children:R?"Refresh sample data":"Fetch sample data"})}),N]})},Bn=t(31882),Dn=t(69650),An=t(12468),Rn=t(61599),Nn=t(14466),Ln=v.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-wjbb3f-0"})(["border-radius:","px;"," ",""],Me.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return!e.noPadding&&"\n padding: ".concat(w.cd*w.iI,"px;\n ")}));function Fn(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 Un(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Hn=function(e){var n,t=e.block,i=(e.blocksMapping,e.onChangeBlock),u=e.setBlockAttributes,c=e.stream,s=(e.streamMapping,e.updateStreamsInCatalog),a=(0,p.useRef)(null),d=(0,p.useState)({}),v=d[0],f=d[1],h=c||{},m=h.auto_add_new_fields,g=h.bookmark_properties,x=h.bookmark_property_operators,j=h.destination_table,k=h.disable_column_type_check,P=h.key_properties,_=h.partition_keys,I=h.replication_method,E=h.run_in_parallel,T=h.unique_conflict_method,M=h.unique_constraints,B=(0,yn.M$)(c),D=(0,yn.WD)(c),A=(0,yn.Z5)(c),N=null===t||void 0===t||null===(n=t.metadata)||void 0===n?void 0:n.data_integration,F=(null===N||void 0===N?void 0:N.source)||(null===N||void 0===N?void 0:N.destination),U=(0,p.useCallback)((function(e){return s(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,s]),H=(0,p.useCallback)((function(e,n){U([Un(Un({},c),{},(0,l.Z)({},e,n))])}),[c,U]),W=(0,p.useMemo)((function(){var e,n=[],t={},i=[],l=(0,yn.RP)(c)||{};return null===(e=Object.entries(l||{}))||void 0===e||e.forEach((function(e){var o,l=(0,r.Z)(e,2),u=l[0],c=l[1],s=c.metadata,a=c.type;n.push(u),(!s||null===s||void 0===s||!s.metadata||null!==s&&void 0!==s&&null!==(o=s.metadata)&&void 0!==o&&o.selected)&&i.push(u);var d=Array.isArray(a)?a:[a];if((null===d||void 0===d?void 0:d.length)>=1){var v=d[(null===d||void 0===d?void 0:d.length)-1];null!==t&&void 0!==t&&t[v]||(t[v]=[]),t[v].push(u)}})),(0,S.jsx)(R.Z,{columnFlex:[1,1],rows:[[(0,S.jsx)(O.ZP,{children:"Number of columns selected"},"columns"),(0,S.jsxs)(O.ZP,{monospace:!0,rightAligned:!0,children:[null===i||void 0===i?void 0:i.length," ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",null===n||void 0===n?void 0:n.length]},"columns-value")]].concat((0,o.Z)((0,L.YC)(Object.entries(t),(function(e){return(0,r.Z)(e,1)[0]})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return[(0,S.jsxs)(O.ZP,{children:[(0,G.vg)(t)," columns"]},"columns-".concat(t)),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,children:null===i||void 0===i?void 0:i.length},"columns-value-".concat(t))]}))),(0,o.Z)([["Bookmarks",g,"bookmark_properties"],["Unique constraints",M,"unique_constraints"],["Key properties",P,"key_properties"],["Partition keys",_,"partition_keys"]].map((function(e){var n,t=(0,r.Z)(e,3),i=t[0],o=t[1],l=t[2];return[(0,S.jsx)(O.ZP,{children:i},i),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[!(null!==o&&void 0!==o&&o.length)&&(0,S.jsx)(O.ZP,{muted:!0,monospace:!0,children:"-"}),null===(n=(0,L.YC)(o||[],(function(e){return e})))||void 0===n?void 0:n.map((function(e){return(0,S.jsx)("div",{style:{marginLeft:w.iI/2},children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){return H(l,(0,L.Od)(o,(function(n){return n===e})))},xsmall:!0})},"".concat(i,"-value-").concat(e))}))]},"".concat(i,"-value"))]}))))})}),[g,P,_,c,M,H]),K=(0,p.useMemo)((function(){return D in v?null===v||void 0===v?void 0:v[D]:j}),[j,v,D]);return(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Output"}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{large:!0,children:"Destination table"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{label:(0,S.jsxs)(O.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:B}),". To change the table name, enter in a different value."]}),lightBackground:!0}),(0,S.jsx)(C.Z,{mr:w.cd})]}),(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(Ee.Z,{fullWidth:!0,monospace:!0,onChange:function(e){var n,t=null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value;f((function(e){return Un(Un({},e),{},(0,l.Z)({},D,t))})),clearTimeout(a.current),a.current=setTimeout((function(){return H("destination_table",t)}),300)},value:K||""})})]})})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Settings"}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{large:!0,children:"Replication method"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{label:(0,S.jsxs)(O.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.INCREMENTAL}),")?",Rn.th.POSTGRESQL===F&&(0,S.jsxs)(O.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(an.Z,{defaultColor:!0,onChange:function(e){return H("replication_method",e.target.value)},placeholder:"Select an option",value:I,children:Rn.jL.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))})]})}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{large:!0,children:"Unique conflict method"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{label:(0,S.jsxs)(O.ZP,{children:["If a new record has the same value as an existing record in the ",(0,G._6)("unique column",null===M||void 0===M?void 0:M.length),(null===M||void 0===M?void 0:M.length)>0&&(0,S.jsx)(S.Fragment,{children:"\xa0"}),null===M||void 0===M?void 0:M.sort().map((function(e,n){return(0,S.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===M||void 0===M?void 0:M.length)&&n===(null===M||void 0===M?void 0:M.length)-1?(0,S.jsx)(O.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(an.Z,{defaultColor:!0,onChange:function(e){return H("unique_conflict_method",e.target.value)},placeholder:"Select an option",value:T,children:Object.values(Rn.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))})]})})]})}),(null===N||void 0===N?void 0:N.sql)&&Rn._B.INCREMENTAL===I&&(null===g||void 0===g?void 0:g.length)>=1&&(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Bookmark property operators"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["By default, new records are compared to the bookmark property value using the operator greater than or equals (",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">="}),").",(0,S.jsx)("br",{}),"If the bookmark property is also a unique constraint, then the default operator is greater than (",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">"}),").",(0,S.jsx)("br",{}),"Change the operator that is used when determining which records to sync based on the bookmark value from the most recently completed sync."]})}),null===g||void 0===g?void 0:g.map((function(e){var n;return n=null!==x&&void 0!==x&&x[e]?null===x||void 0===x?void 0:x[e]:M&&null!==M&&void 0!==M&&M.includes(e)?Nn.W6.GREATER_THAN:Nn.W6.GREATER_THAN_OR_EQUALS,(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsxs)(O.ZP,{default:!0,monospace:!0,children:[(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:["{new_record}","."]}),e]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(an.Z,{compact:!0,defaultColor:!0,monospace:!0,onChange:function(n){return H("bookmark_property_operators",Un(Un({},x),{},(0,l.Z)({},e,n.target.value)))},value:n,children:[Nn.W6.EQUALS,Nn.W6.GREATER_THAN,Nn.W6.GREATER_THAN_OR_EQUALS,Nn.W6.LESS_THAN,Nn.W6.LESS_THAN_OR_EQUALS,Nn.W6.NOT_EQUALS].map((function(e){return(0,S.jsx)("option",{value:e,children:Nn.N_[e]},e)}))}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(O.ZP,{default:!0,monospace:!0,children:[(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:["{bookmark}","."]}),e]})]})},e)}))]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Options"}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Run streams in parallel"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."})})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Dn.Z,{checked:!!E,onCheck:function(e){return H("run_in_parallel",e(E))}})]})}),b.tf.DATA_EXPORTER===(null===t||void 0===t?void 0:t.type)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Dn.Z,{checked:!!m,onCheck:function(e){return H("auto_add_new_fields",e(m))}})]})}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"By default, the value for each column is validated according to the schema property for that column. If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped. Turn this toggle on if you want to disable this strict type checking."})})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Dn.Z,{checked:!!k,onCheck:function(e){return H("disable_column_type_check",e(k))}})]})})]})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{noPadding:!0,children:[(0,S.jsx)(C.Z,{pt:w.cd,px:w.cd,children:(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Summary"})}),(0,S.jsx)(C.Z,{mt:w.cd,pb:w.cd,children:W})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Other"}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{large:!0,children:"Select stream"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Dn.Z,{checked:!!A,onCheck:function(e){return U([(0,yn.XE)(c,{selected:e(A)})])}})]})}),(0,S.jsx)(C.Z,{mt:w.HN,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(be.ZP,{danger:!0,onClick:function(){window.confirm("Are you sure you want to remove stream ".concat(B," from block ").concat(null===t||void 0===t?void 0:t.uuid,"?"))&&u((function(e){var n,t=Un(Un({},e),{},{catalog:Un(Un({},null===e||void 0===e?void 0:e.catalog),{},{streams:(0,L.Od)(null===e||void 0===e||null===(n=e.catalog)||void 0===n?void 0:n.streams,(function(e){return(0,yn.WD)(e)===D}))})});return null===i||void 0===i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},Wn=t(11074),Gn=t(69632);function Kn(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 zn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qn=function(e){var n,t,i=e.block,o=(e.blocksMapping,e.highlightedColumnsMapping),u=e.onChangeBlock,c=e.setBlockAttributes,s=e.setHighlightedColumnsMapping,a=e.setSelectedSubTab,d=e.setStreamsMappingConflicts,v=e.showStreamConflicts,f=e.stream,h=e.streamMapping,m=e.streamsMappingConflicts,g=(0,p.useCallback)((function(e){c((function(n){var t=e(n);return null===u||void 0===u||u(t),t}))}),[u,c]),b=(0,p.useMemo)((function(){return(0,yn.RP)(f)||{}}),[f]),P=(0,p.useState)(null),_=P[0],I=P[1],E=(0,p.useState)(null),T=E[0],M=E[1],B=(0,p.useRef)(null),D=(0,p.useState)(null),F=D[0],U=D[1],H=(0,p.useCallback)((function(){U(null),I(null)}),[U,I]);(0,p.useEffect)((function(){var e;return null===(e=document)||void 0===e||e.addEventListener("click",H),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("click",H)}}),[H]);var W=(0,p.useMemo)((function(){var e=f.bookmark_properties,n=f.key_properties,t=f.partition_keys,i=(f.replication_method,f.unique_constraints);return{bookmarkPropertiesMapping:(0,L.HK)(e||[],(function(e){return e})),keyPropertiesMapping:(0,L.HK)(n||[],(function(e){return e})),partitionKeysMapping:(0,L.HK)(t||[],(function(e){return e})),uniqueConstraintsMapping:(0,L.HK)(i||[],(function(e){return e}))}}),[f]),G=W.bookmarkPropertiesMapping,K=W.keyPropertiesMapping,z=W.partitionKeysMapping,q=W.uniqueConstraintsMapping,V=(0,p.useMemo)((function(){var e,n;return null===(e=(0,L.YC)(Object.entries(b||{}),(function(e){return(0,r.Z)(e,1)[0]})))||void 0===e||null===(n=e.map)||void 0===n?void 0:n.call(e,(function(e){var n=(0,r.Z)(e,2);return{column:n[0],property:n[1]}}))}),[b]),Y=((0,p.useMemo)((function(){return(0,yn.MB)(f)}),[f]),(0,p.useMemo)((function(){return(0,yn.Nf)(f)}),[f])),Q=null===i||void 0===i||null===(n=i.metadata)||void 0===n||null===(t=n.data_integration)||void 0===t?void 0:t.destination,X=(0,p.useMemo)((function(){return!Rn.kB.includes(Q)}),[Q]),J=(0,p.useMemo)((function(){var e=[null,1,1],n=null===V||void 0===V?void 0:V.every((function(e){var n,t,i,o=e.property;return!(null!==o&&void 0!==o&&o.metadata)||!(null!==o&&void 0!==o&&null!==(n=o.metadata)&&void 0!==n&&n.metadata)||(null===o||void 0===o||null===(t=o.metadata)||void 0===t||null===(i=t.metadata)||void 0===i?void 0:i.selected)})),t=[{label:function(){return(0,S.jsx)(Dn.Z,{checked:n,compact:!0,onCheck:function(e){return function(e){var n=null===V||void 0===V?void 0:V.reduce((function(n,t){var i=t.column,o=(null===Y||void 0===Y?void 0:Y[i])||(0,yn.jC)(i);return n[i]=zn(zn({},o),{},{metadata:zn(zn({},null===o||void 0===o?void 0:o.metadata),e)}),n}),{});g((function(e){return(0,yn.$C)((0,yn.AP)(f,n),e)}))}({selected:e(n)})}})},uuid:"action"},{uuid:"Property"},{uuid:"Types"}];X&&(e.push.apply(e,[null,null]),t.push.apply(t,[{center:!0,uuid:"Unique"},{center:!0,uuid:"Key"}]));var i=f.replication_method;return Rn._B.INCREMENTAL===i&&(e.push(null),t.push({center:!0,uuid:"Bookmark"})),e.push(null),t.push({center:!0,uuid:"Partition"}),{columnFlex:e,columns:t}}),[V,g,f,Y,X]),$=J.columnFlex,ee=J.columns,ne=(0,p.useCallback)((function(e,n,t){var i,o=t||{},r=o.disableEdit,u=o.key,c=(0,yn.wx)(e,n),s=(null===c||void 0===c?void 0:c.typesDerived)||[];return(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[null===(i=s||[])||void 0===i?void 0:i.map((function(n){return(0,S.jsx)("div",{style:{paddingBottom:1,marginRight:2,paddingTop:1},children:(0,S.jsx)(Bn.Z,{label:n,onClick:r?null:function(t){(0,Oe.j)(t);var i=!(null===s||void 0===s||!s.includes(n))?(0,yn.VZ)([n],c):(0,yn.qx)([n],c),o={anyOf:null===i||void 0===i?void 0:i.anyOf,format:null===i||void 0===i?void 0:i.format,type:null===i||void 0===i?void 0:i.type};g((function(n){return(0,yn.$C)((0,yn.KN)(f,(0,l.Z)({},e,o)),n)}))},xsmall:!0})},"".concat(e,"-").concat(u||"types","-").concat(n))})),!r&&(0,S.jsx)(be.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Oe.j)(e),U({x:e.pageX,y:e.pageY}),I(c)},children:(0,S.jsx)(N.Edit,{default:!0})})]},"".concat(e,"-").concat(u||"types"))}),[g,U,I,f]),te=(0,p.useMemo)((function(){return null===V||void 0===V?void 0:V.map((function(e){var n,t=e.column,i=e.property,o=f.bookmark_properties,u=f.key_properties,c=f.partition_keys,s=f.replication_method,a=f.unique_constraints,d=(i.anyOf,i.format,i.metadata),v=(i.type,(0,yn.wx)(t,i)),p=(null===v||void 0===v||v.typesDerived,!d||!(null!==d&&void 0!==d&&d.metadata)||(null===d||void 0===d||null===(n=d.metadata)||void 0===n?void 0:n.selected)),h=null===q||void 0===q?void 0:q[t],m=null===G||void 0===G?void 0:G[t],b=null===K||void 0===K?void 0:K[t],j=null===z||void 0===z?void 0:z[t],k=[(0,S.jsx)("div",{style:{minHeight:22},children:(0,S.jsx)(Dn.Z,{checked:p,compact:!0,onCheck:function(e){g((function(n){return(0,yn.$C)((0,yn.AP)(f,(0,l.Z)({},t,zn(zn({},d),{},{metadata:zn(zn({},null===d||void 0===d?void 0:d.metadata),{},{selected:e(p)})}))),n)}))}})},"".concat(t,"-selected")),(0,S.jsx)(O.ZP,{monospace:!0,children:t},"".concat(t,"-column")),ne(t,v)];X&&k.push((0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:h,onClick:function(e){(0,Oe.j)(e),g((function(e){return(0,yn.$C)(zn(zn({},f),{},{unique_constraints:h?(0,L.Od)(a||[],(function(e){return e===t})):(0,L.Hl)(t,a||[])}),e)}))}})},"".concat(t,"-unique")));var Z=[];return X&&Z.push([b,"key_properties",u]),Rn._B.INCREMENTAL===s&&Z.push([m,"bookmark_properties",o]),Z.push([j,"partition_keys",c]),Z.forEach((function(e){var n=(0,r.Z)(e,3),i=n[0],o=n[1],u=n[2];k.push((0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:i,onClick:function(e){(0,Oe.j)(e),g((function(e){return(0,yn.$C)(zn(zn({},f),{},(0,l.Z)({},o,i?(0,L.Od)(u||[],(function(e){return e===t})):(0,L.Hl)(t,u||[]))),e)}))}})},"".concat(t,"-").concat(o)))})),k}))}),[G,K,z,ne,V,g,f,X,q]),ie=(0,p.useCallback)((function(e){var n=null===V||void 0===V?void 0:V[e];return zn(zn({},n),{},{highlighted:!(null===o||void 0===o||!o[null===n||void 0===n?void 0:n.column])})}),[o,V]),oe=(0,p.useMemo)((function(){var e;if(F&&_){var n=21*w.iI,t=(null===B||void 0===B||null===(e=B.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,o=t.width,r=F||{},u=r.x,c=void 0===u?0:u,s=r.y,a=void 0===s?0:s,d=c;c+n>=i+o&&(d=i+o-(n+w.iI)),d<0&&(d=0);var v=(null===b||void 0===b?void 0:b[null===_||void 0===_?void 0:_.uuid])||{},p=(0,yn.wx)(null===_||void 0===_?void 0:_.uuid,v||{}),h=p||{},m=h.typesDerived,k=void 0===m?[]:m,Z=h.uuid;return(0,S.jsx)("div",{onClick:Oe.j,style:{left:d,position:"fixed",top:a+w.iI/2,width:n,zIndex:100},children:(0,S.jsxs)(Wn.Z,{children:[(0,S.jsx)("div",{style:{position:"relative"},children:(0,S.jsx)(be.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Oe.j)(e),U(null),I(null)},style:{position:"absolute",right:-.5*w.iI,top:-.5*w.iI,zIndex:1},children:(0,S.jsx)(j.Z,{default:!0,size:2.5*w.iI,children:(0,S.jsx)(N.Close,{size:1.5*w.iI})})})}),(0,S.jsx)(C.Z,{p:w.cd,children:Rn.D5.map((function(e,n){var t=!(null===k||void 0===k||!k.includes(e));return(0,S.jsx)("div",{style:{marginTop:0===n?0:4},children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(x.Z,{checked:t,label:e,onClick:function(n){(0,Oe.j)(n);var i=t?(0,yn.VZ)([e],p):(0,yn.qx)([e],p),o={anyOf:null===i||void 0===i?void 0:i.anyOf,format:null===i||void 0===i?void 0:i.format,type:null===i||void 0===i?void 0:i.type};g((function(e){return(0,yn.$C)((0,yn.KN)(f,(0,l.Z)({},Z,o)),e)}))}})})},e)}))})]})})}}),[F,_,B,b,g,U,I,f]),re=(0,p.useMemo)((function(){return(0,yn.p$)(f,m,h)}),[f,h,m]),le=(0,p.useCallback)((function(e,n){var t,i=null===re||void 0===re?void 0:re.stream,o=null===i||void 0===i||null===(t=i.schema)||void 0===t?void 0:t.properties;M((function(t){var i=zn({},t);return null===e||void 0===e||e.forEach((function(e){n?i[e]=null===o||void 0===o?void 0:o[e]:e in i&&(null===i||void 0===i||delete i[e])})),i}))}),[re,M]),ue=(0,p.useCallback)((function(e){var n=e||{},t=n.column,i=n.property,o=n.currentProperty,r=!(null===T||void 0===T||!T[t]),l=[(0,S.jsx)(x.Z,{checked:r,onClick:function(e){(0,Oe.j)(e),le([t],!r)}},"".concat(t,"-accept")),(0,S.jsx)(O.ZP,{monospace:!0,children:t},"".concat(t,"-property")),ne(t,i,{disableEdit:!0})];return o?l.push(ne(t,o,{disableEdit:!0,key:"types-current"})):l.push((0,S.jsx)("div",{},"".concat(t,"-empty"))),l}),[ne,T,le]),ce=(0,p.useCallback)((function(e,n){var t=n||{},i=t.columnFlex,o=t.columns,r=(null===e||void 0===e?void 0:e.map((function(e){return e.column})))||[],l=null===r||void 0===r?void 0:r.every((function(e){return!(null===T||void 0===T||!T[e])}));return(0,S.jsx)(R.Z,{columnFlex:[null,1].concat(i||[]),columns:[{label:function(){return(0,S.jsx)(x.Z,{checked:l,onClick:function(e){(0,Oe.j)(e),le(r,!l)}})},uuid:"Accept change"},{uuid:"Property"}].concat(o||[]),highlightRowOnHover:!0,onClickRow:function(n){var t=null===e||void 0===e?void 0:e[n],i=null===t||void 0===t?void 0:t.column,o=!(null===T||void 0===T||!T[i]);le([i],!o)},rows:null===e||void 0===e?void 0:e.map(ue)})}),[ue,T,le]),se=(0,p.useMemo)((function(){var e,n;if(!re)return null;var t=re.newColumnSettings,i=re.newColumns,o=re.stream,l=null===o||void 0===o||null===(e=o.schema)||void 0===e?void 0:e.properties,u=null===(n=(0,L.YC)(i,(function(e){return e})))||void 0===n?void 0:n.map((function(e){return{column:e,property:null===l||void 0===l?void 0:l[e]}})),c=(0,L.YC)(Object.entries(t),(function(e){return(0,r.Z)(e,1)[0]})).map((function(e){var n=(0,r.Z)(e,2),t=n[0];n[1];return{column:t,property:null===l||void 0===l?void 0:l[t],currentProperty:null===b||void 0===b?void 0:b[t]}}));return(0,S.jsxs)(S.Fragment,{children:[(null===u||void 0===u?void 0:u.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,warning:!0,children:"New properties"})}),(0,S.jsx)(k.Z,{light:!0}),ce(u,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{label:function(){return""},uuid:"empty"}]})]}),(null===c||void 0===c?void 0:c.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,warning:!0,children:"Properties with new types"})}),(0,S.jsx)(k.Z,{light:!0}),ce(c,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{uuid:"Types (current)"}]})]})]})}),[re,ce,b]),ae=(0,p.useMemo)((function(){return(0,S.jsx)(R.Z,{columnFlex:$,columns:ee,highlightRowOnHover:!0,isSelectedRow:function(e){var n;return null===(n=ie(e))||void 0===n?void 0:n.highlighted},menu:oe,onClickRow:function(e){var n=ie(e),t=n.column,i=n.highlighted;s((function(e){return i?(0,Tn.gR)(e,[t]):zn(zn({},e),{},(0,l.Z)({},t,!0))}))},ref:B,rows:te,stickyHeader:!0})}),[$,ee,ie,B,oe,te,s]);return(0,S.jsxs)(S.Fragment,{children:[v&&se&&(0,S.jsxs)(C.Z,{my:w.cd,children:[(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(Gn.NJ,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(N.AlertTriangle,{size:2*w.iI,warning:!0})}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(O.ZP,{muted:!0,children:["The following properties are either new or have different types. Please review and either merge the changes or discard them.",(0,S.jsx)("br",{}),"Click the checkbox to include the updated property when merging changes."]})]})})}),se,(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.BranchAlt,{}),onClick:function(){g((function(e){var n;return(0,yn.$C)(zn(zn({},f),{},{schema:zn(zn({},null===f||void 0===f?void 0:f.schema),{},{properties:zn(zn({},null===f||void 0===f||null===(n=f.schema)||void 0===n?void 0:n.properties),T)})}),e)})),d({noParents:{},parents:{}}),a(Zn.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(be.ZP,{onClick:function(){d({noParents:{},parents:{}}),a(Zn.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!v&&ae,(0,S.jsx)(C.Z,{pb:w.HN})]})},Vn=["block","height","pipeline","selectedSubTab","showError","stream"];function Yn(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 Qn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Yn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Yn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xn=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.selectedSubTab,r=e.showError,l=e.stream,u=(0,Sn.Z)(e,Vn);return Zn.tw.OVERVIEW!==o&&o?Zn.tw.SETTINGS===o||Zn.tw.STREAM_CONFLICTS===o?(0,S.jsx)(qn,Qn(Qn({},u),{},{block:n,showStreamConflicts:Zn.tw.STREAM_CONFLICTS===o,stream:l})):Zn.tw.SAMPLE_DATA===o?(0,S.jsx)(Mn,{block:n,height:t,pipeline:i,showError:r,stream:l}):(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(Hn,Qn(Qn({},u),{},{block:n,stream:l}))},Jn={label:function(e){return"".concat((0,G._6)("stream",e,!0)," fetched")},uuid:"Recently fetched"},$n={label:function(e){return"".concat((0,G._6)("stream",e,!0)," from settings")},uuid:"From stream settings"},et=[Jn,$n];function nt(e,n){return null===n||void 0===n?void 0:n.filter((function(n){var t=new RegExp(e||"","i"),i=(0,yn.M$)(n);return!e||(null===i||void 0===i?void 0:i.match(t))||(null===i||void 0===i?void 0:i.replace("-"," ").match(t))||(null===i||void 0===i?void 0:i.replace("-","").match(t))||(null===i||void 0===i?void 0:i.replace("_"," ").match(t))||(null===i||void 0===i?void 0:i.replace("_","").match(t))||(null===i||void 0===i?void 0:i.replaceAll("-"," ").match(t))||(null===i||void 0===i?void 0:i.replaceAll("-","").match(t))||(null===i||void 0===i?void 0:i.replaceAll("_"," ").match(t))||(null===i||void 0===i?void 0:i.replaceAll("_","").match(t))}))}var tt=function(e){var n=e.block,t=e.blocksMapping,i=e.height,o=e.onChangeBlock,u=e.searchText,c=e.setSelectedMainNavigationTab,s=(e.setSelectedSubTab,e.setStreamsMappingConflicts),a=e.streamsFetched,d=e.updateStreamsInCatalog,v=e.width,f=(0,p.useMemo)((function(){return(0,yn.Uc)(n,{getAll:!0})}),[n]),h=(0,p.useMemo)((function(){return(0,yn.UA)(f)}),[f]),m=(0,p.useMemo)((function(){return(0,yn.UA)(a||[])}),[a]),g=(0,p.useCallback)((function(e){return(0,yn.ig)(e,m,h)}),[m,h]),b=(0,p.useCallback)((function(e){return(0,yn.p$)(e,m,h)}),[m,h]),x=(0,p.useCallback)((function(e){var n;return(n={},(0,l.Z)(n,Jn.uuid,m),(0,l.Z)(n,$n.uuid,h),n)[e]}),[h,m]),j=(0,p.useMemo)((function(){var e=[];return et.forEach((function(n,i){var o,l=n.label,c=n.uuid,s=x(c),a=[],d=Object.values((null===s||void 0===s?void 0:s.noParents)||{})||[],v=nt(u,d);(null===v||void 0===v?void 0:v.length)>=1&&a.push({streams:(0,L.YC)(v||[],yn.M$)}),null===(o=Object.entries((null===s||void 0===s?void 0:s.parents)||{}))||void 0===o||o.forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],o=n[1],l=nt(u,Object.values(o||{})||[]);(null===l||void 0===l?void 0:l.length)>=1&&a.push({block:null===t||void 0===t?void 0:t[i],streams:(0,L.YC)(l||[],yn.M$)})})),(null===a||void 0===a?void 0:a.length)>=1&&e.push({count:(0,L.Sm)((null===a||void 0===a?void 0:a.map((function(e){var n=e.streams;return(null===n||void 0===n?void 0:n.length)||0})))||[]),label:l,subgroups:a,uuid:c})})),e}),[x,u]),P=(0,p.useMemo)((function(){return(null===j||void 0===j?void 0:j.length)||0}),[j]);return(0,S.jsx)(S.Fragment,{children:null===j||void 0===j?void 0:j.map((function(e,n){var t=e.count,r=e.label,l=e.subgroups,u=e.uuid,a=Jn.uuid===u;return(0,S.jsx)(He,{style:{height:i,right:$n.uuid===u?null:0,width:v/P},children:(0,S.jsx)(We,{borderRight:P>=2&&!a,style:{height:i,width:v/P},children:(0,S.jsxs)(C.Z,{pt:w.cd,children:[(0,S.jsx)(C.Z,{px:w.Mq,children:(0,S.jsx)(A.Z,{level:4,children:r(t)})}),null===l||void 0===l?void 0:l.map((function(e,n){var t,i=e.block,r=e.streams;return(0,S.jsxs)(C.Z,{mt:i&&0===n?w.cd:1,children:[(0,S.jsx)(C.Z,{mb:i?w.cd:0,mt:i?0:w.cd,children:(0,S.jsx)(k.Z,{light:!0})}),i&&(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(O.ZP,{bold:!0,color:null===(t=(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}))||void 0===t?void 0:t.accent,default:!0,large:!0,monospace:!0,children:null===i||void 0===i?void 0:i.uuid})}),(0,S.jsx)(C.Z,{p:1,children:(0,S.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:null===r||void 0===r?void 0:r.map((function(e){var n=g(e),t=!!b(e),i=(0,yn.M$)(e),r=(0,yn.Qu)(e),l=!1;if(a){var u=(0,yn.zB)(e,x($n.uuid));u&&(l=(0,yn.Z5)(u))}else l=(0,yn.Z5)(e);var v=n&&t;return(0,S.jsx)(Ge,{onClick:a&&v?function(){return!1}:function(n){n.preventDefault(),d([(0,yn.XE)(e,{selected:!l})],(function(e){return null===o||void 0===o?void 0:o(e)}))},selected:l,warning:v&&a,children:(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(O.ZP,{monospace:!0,muted:!l,children:i})}),v&&a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{monospace:!0,warning:!0,children:"exists"})]}),v&&a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Z.Z,{alignItems:"center",style:{minHeight:3*w.iI},children:(0,S.jsx)(be.ZP,{compact:!0,onClick:function(){s((function(n){return(0,yn.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:Zn.tw.STREAM_CONFLICTS}}))},small:!0,warning:!0,children:"View differences"})})]}),(!v||!a)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:w.HN}),l&&(0,S.jsx)(N.Settings,{size:2*w.iI}),(0,S.jsx)(C.Z,{mr:l?1:3}),(0,S.jsx)(Z.Z,{alignItems:"center",style:{height:3*w.iI},children:(0,S.jsx)(Dn.Z,{checked:l,compact:!0,onCheck:function(n){return d([(0,yn.XE)(e,{selected:n(l)})],(function(e){return null===o||void 0===o?void 0:o(e)}))}})})]})]})},i)}))})})]},i?null===i||void 0===i?void 0:i.uuid:"no-subtitle-".concat(n))}))]})})},u)}))})};function it(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 ot(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?it(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):it(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var rt=function(e){var n=e.attributes,t=e.attributesMapping,i=e.columnFlex,o=e.rightAlignColumnForRowIndexes,r=e.rowGroupHeaders,u=e.rowsGroupedByIndex,c=e.setAttributesMapping,s=(0,p.useCallback)((function(e,n){var i,r=e.inputType,u=e.label,s=e.options,a=e.uuid,d=null===t||void 0===t?void 0:t[a],v=!(null===d||void 0===d||!d.selected),p=null===d||void 0===d?void 0:d.value;return Zn.oI.CHECKBOX===r?i=(0,S.jsx)(x.Z,{checked:!!p,onClick:function(e){v&&(0,Oe.j)(e),c((function(e){return ot(ot({},e),{},(0,l.Z)({},a,ot(ot({},null===e||void 0===e?void 0:e[a]),{},{value:!p})))}))}}):Zn.oI.SELECT===r?i=(0,S.jsxs)(an.Z,{compact:!0,fullWidth:!0,onChange:function(e){(0,Oe.j)(e),c((function(n){var t;return ot(ot({},n),{},(0,l.Z)({},a,ot(ot({},null===n||void 0===n?void 0:n[a]),{},{value:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})))}))},onClick:function(e){v&&(0,Oe.j)(e)},value:p,children:[(0,S.jsx)("option",{value:""}),null===s||void 0===s?void 0:s.map((function(e){var n=e.disabled,t=e.label,i=e.value;return(0,S.jsx)("option",{disabled:n,value:i,children:t?t():i},i)}))]}):Zn.oI.TOGGLE===r&&(i=(0,S.jsx)(Dn.Z,{checked:p,compact:!0,onCheck:function(e){c((function(n){return ot(ot({},n),{},(0,l.Z)({},a,ot(ot({},null===n||void 0===n?void 0:n[a]),{},{value:e(p)})))}))},pauseEvent:v})),[(0,S.jsx)(x.Z,{checked:v,onClick:function(e){(0,Oe.j)(e),c((function(e){return ot(ot({},e),{},(0,l.Z)({},a,ot(ot({},null===e||void 0===e?void 0:e[a]),{},{selected:!v})))}))}},"".concat(a,"-checkbox")),(0,S.jsx)(O.ZP,{muted:!v,children:u()},"".concat(a,"-name")),(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:null!==o&&void 0!==o&&o.includes(n)?"flex-end":"center",children:i},"".concat(a,"-value"))]}),[t,o,c]);return(0,p.useMemo)((function(){return(0,S.jsx)(R.Z,{columnFlex:i||[null,1,null],columns:[{uuid:"Use"},{uuid:"Attribute"},{uuid:"Value"}],groupsInline:!0,onClickRow:function(e){var i=null===n||void 0===n?void 0:n[e],o=null===i||void 0===i?void 0:i.uuid,r=null===t||void 0===t?void 0:t[o],u=!(null===r||void 0===r||!r.selected);c((function(e){return ot(ot({},e),{},(0,l.Z)({},o,ot(ot({},null===e||void 0===e?void 0:e[o]),{},{selected:!u})))}))},rowGroupHeaders:r,rowsGroupedByIndex:u,rows:n.map((function(e,n){return s(e,n)}))})}),[n,t,i,s])};var lt=function(e){var n=e.selectedStreamMapping,t=e.setSelectedStreamMapping,i=e.streamMapping,o=(0,p.useMemo)((function(){return(0,yn.th)(i)}),[i]),r=(0,p.useMemo)((function(){var e=[],t=[],i=[],r=[],l=0;return null===o||void 0===o||o.forEach((function(o){var u=o.groupHeader,c=o.streams;e.push(u);var s=[];null===c||void 0===c||c.forEach((function(e){r.push(e),s.push(l),l+=1;var i=(0,yn.WD)(e),o=(0,yn.M$)(e),u=!!(0,yn.zB)(e,n),c=[(0,S.jsx)(x.Z,{checked:u},"".concat(i,"-").concat(o,"-use")),(0,S.jsx)(O.ZP,{muted:!u,children:o},"".concat(i,"-").concat(o,"-stream"))];t.push(c)})),i.push(s)})),{rowGroupHeaders:e,rows:t,rowsGroupedByIndex:i,streamsArray:r}}),[n,o]),l=r.rowGroupHeaders,u=r.rows,c=r.rowsGroupedByIndex,s=r.streamsArray,a=(0,p.useMemo)((function(){var e,t;return(null===(e=Object.values((null===n||void 0===n?void 0:n.noParents)||{}))||void 0===e?void 0:e.length)+(0,L.Sm)(null===(t=Object.values((null===n||void 0===n?void 0:n.parents)||{}))||void 0===t?void 0:t.map((function(e){var n;return null===(n=Object.values(e||{}))||void 0===n?void 0:n.length})))}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsxs)(A.Z,{children:[(0,G._6)("stream",a||0)," chosen"]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})})]})}),(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{uuid:"Use"},{uuid:"Stream"}],groupsInline:!0,onClickRow:function(e){var i=null===s||void 0===s?void 0:s[e],o=!!(0,yn.zB)(i,n);t((function(e){return(0,yn.iN)(i,e,{remove:o})}))},rowGroupHeaders:l,rows:u,rowsGroupedByIndex:c,stickyHeader:!0})]})};var ut=function(e){var n=e.attributesMapping,t=e.selectedStreamMapping,i=e.setAttributesMapping,o=e.setSelectedStreamMapping,r=e.streamMapping,l=(0,p.useMemo)((function(){return(0,S.jsx)(rt,{attributes:[{label:function(){return"Replication method"},inputType:Zn.oI.SELECT,options:Rn.jL.map((function(e){return{label:function(){return(0,G.vg)(e)},value:e}})),uuid:yn.I1.REPLICATION_METHOD},{label:function(){return"Unique conflict method"},inputType:Zn.oI.SELECT,options:Object.values(Rn.MU).map((function(e){return{label:function(){return(0,G.vg)(e)},value:e}})),uuid:yn.I1.UNIQUE_CONFLICT_METHOD},{label:function(){return"Run stream in parallel"},inputType:Zn.oI.TOGGLE,uuid:yn.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:Zn.oI.TOGGLE,uuid:yn.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:Zn.oI.TOGGLE,uuid:yn.I1.DISABLE_COLUMN_TYPE_CHECK}],attributesMapping:n,columnFlex:[null,1,1],rightAlignColumnForRowIndexes:[2,3,4],setAttributesMapping:i})}),[n,i]),u=(0,p.useMemo)((function(){return(0,S.jsx)(lt,{selectedStreamMapping:t,setSelectedStreamMapping:o,streamMapping:r})}),[t,o,r]);return(0,S.jsxs)(Ke,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsx)(A.Z,{children:"Make changes to multiple streams"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the attributes below and change the values of those attributes for all the selected streams."})})]})}),l,u]})};function ct(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 st(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ct(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ct(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var at=function(e){var n,t,i=e.attributesMapping,u=e.block,c=e.highlightedColumnsMapping,s=e.selectedStreamMapping,a=e.setAttributesMapping,d=e.setHighlightedColumnsMapping,v=e.setSelectedStreamMapping,f=e.stream,h=e.streamMapping,m=(e.updateStreamsInCatalog,null===u||void 0===u||null===(n=u.metadata)||void 0===n||null===(t=n.data_integration)||void 0===t?void 0:t.destination),g=(0,p.useMemo)((function(){return!Rn.kB.includes(m)}),[m]);(0,p.useEffect)((function(){if(f&&!s){var e=(0,yn.M$)(f||{}),n=(0,yn.Qu)(f||{});n?v({noParents:{},parents:(0,l.Z)({},n,(0,l.Z)({},e,f))}):e&&v({noParents:(0,l.Z)({},e,f),parents:{}})}}),[s,v,f]);var b=(0,p.useMemo)((function(){return(null===f||void 0===f?void 0:f.replication_method)===Rn._B.INCREMENTAL}),[null===f||void 0===f?void 0:f.replication_method]),x=(0,p.useMemo)((function(){var e=[{label:function(){return"Include property when syncing"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.PROPERTY_SELECTED},{label:function(){return"Partition key"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.PARTITION_KEYS}].concat((0,o.Z)(Rn.D5.map((function(e){return{label:function(){return(0,G.vg)(e)},inputType:Zn.oI.CHECKBOX,uuid:e}}))));b&&e.splice(1,0,{label:function(){return"Bookmark property"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.BOOKMARK_PROPERTIES}),g&&e.splice(1,0,{label:function(){return"Unique constraint"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Key property"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.KEY_PROPERTIES});var n=2;b&&(n+=1),g&&(n+=2);var t=(0,L.m5)(n);return(0,S.jsx)(rt,{attributes:e,attributesMapping:i,rowGroupHeaders:["Options","Column types"],rowsGroupedByIndex:[t,null===Rn.D5||void 0===Rn.D5?void 0:Rn.D5.map((function(e,t){return t+n}))],setAttributesMapping:a})}),[i,a,g,b]),j=(0,p.useMemo)((function(){return(0,S.jsx)(lt,{selectedStreamMapping:s,setSelectedStreamMapping:v,streamMapping:h})}),[s,v,h]),k=(0,p.useMemo)((function(){var e,n=null===(e=Object.entries(c||{}))||void 0===e?void 0:e.reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);return(0,L.YC)(n,(function(e){return e}))}),[c]);return(0,S.jsxs)(Ke,{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)(A.Z,{children:[!(null!==k&&void 0!==k&&k.length)&&"Choose at least 1 property",(null===k||void 0===k?void 0:k.length)>=1&&"".concat((0,G._6)("property",(null===k||void 0===k?void 0:k.length)||0)," chosen")]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:[!(null!==k&&void 0!==k&&k.length)&&"Click 1 or more rows in the table to select which schema properties to apply bulk changes to.",(null===k||void 0===k?void 0:k.length)>=1&&(0,S.jsx)(S.Fragment,{children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})]})})]}),(null===k||void 0===k?void 0:k.length)>=1&&(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:null===k||void 0===k?void 0:k.map((function(e){return(0,S.jsx)("div",{style:{marginBottom:w.iI/2,marginRight:w.iI/2},children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){d((function(n){return!(null===n||void 0===n||!n[e])?(0,Tn.gR)(n,[e]):st(st({},n),{},(0,l.Z)({},e,!0))}))}})},"".concat(e,"-chip"))}))})})]}),x,j]})};function dt(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 vt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?dt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):dt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pt={compact:!0,small:!0};var ft=function(e){var n=e.block,t=e.blocksMapping,i=e.onChangeBlock,o=e.selectedStreamMapping,r=e.setSelectedMainNavigationTab,u=e.setSelectedStreamMapping,c=e.streamMapping,s=e.updateStreamsInCatalog,a=(0,p.useRef)(null),d=(0,p.useState)({}),v=d[0],f=d[1],h=(0,p.useCallback)((function(e){return s(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,s]),m=(n||{}).type,g=c||{},x=g.noParents,j=g.parents,k=(0,p.useMemo)((function(){return(0,Tn.Qr)(x||{})&&(0,Tn.Qr)(j||{})}),[x,j]),I=(0,p.useMemo)((function(){return(0,yn.th)(c)}),[c]),E=(0,p.useMemo)((function(){var e=[null,1,3,2,2,null],n=[{label:function(e){var n=e.groupIndex,t=((null===I||void 0===I?void 0:I[n])||{}).streams,i=t&&(null===t||void 0===t?void 0:t.every((function(e){return(0,yn.Z5)(e)})));return(0,S.jsx)(Dn.Z,{checked:i,compact:!0,disabled:!(null!==t&&void 0!==t&&t.length),onCheck:function(e){t&&h(null===t||void 0===t?void 0:t.map((function(n){return(0,yn.XE)(n,{selected:e(i)})})))}})},uuid:"action"},{uuid:"Stream"},{uuid:"Table"},{uuid:"Sync"},{uuid:"Unique conflict"},{center:b.tf.DATA_EXPORTER===m,rightAligned:b.tf.DATA_EXPORTER!==m,uuid:"Parallel"}];return b.tf.DATA_EXPORTER===m&&(e.push.apply(e,[null,null]),n.push.apply(n,[{center:!0,uuid:"Add columns"},{center:!0,uuid:"No strict check"}])),{columnFlex:e,columns:n}}),[m,I,h]),T=E.columnFlex,M=E.columns,B=(0,p.useMemo)((function(){var e=[],n=[],i=[],o=[],u=0;return null===I||void 0===I||I.forEach((function(c){var s=c.groupHeader,d=c.streams,g=s?null===t||void 0===t?void 0:t[s]:null;g?n.push((0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(O.ZP,{bold:!0,color:(0,_.qn)(null===g||void 0===g?void 0:g.type,{blockColor:null===g||void 0===g?void 0:g.color}).accent,monospace:!0,children:s})})):n.push(s);var x=[];null===d||void 0===d||d.forEach((function(n){e.push(n),x.push(u),u+=1;var t=(0,yn.WD)(n),o=(0,yn.Qu)(n),c=(0,yn.M$)(n),s=n.auto_add_new_fields,d=n.bookmark_properties,g=n.destination_table,j=n.disable_column_type_check,k=n.replication_method,w=n.run_in_parallel,_=n.unique_conflict_method,I=(0,yn.Z5)(n),E=t in v?null===v||void 0===v?void 0:v[t]:g,T=[(0,S.jsx)(Dn.Z,{checked:I,compact:!0,onCheck:function(e){h([(0,yn.XE)(n,{selected:e(I)})])}},"".concat(t,"-action")),(0,S.jsx)(P.Z,{bold:!0,monospace:!0,onClick:function(){r(c,o)},preventDefault:!0,sameColorAsText:!0,children:c},"".concat(t,"-name")),(0,S.jsx)(Ee.Z,{compact:!0,defaultColor:!E,monospace:!0,onChange:function(e){var i,o=null===e||void 0===e||null===(i=e.target)||void 0===i?void 0:i.value;f((function(e){return vt(vt({},e),{},(0,l.Z)({},t,o))})),clearTimeout(a.current),a.current=setTimeout((function(){return h([vt(vt({},n),{},{destination_table:o})])}),300)},onClick:Oe.j,placeholder:c,value:E||""},"".concat(t,"-destinationTable")),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(an.Z,vt(vt({},pt),{},{fullWidth:!0,onChange:function(e){var t;return h([vt(vt({},n),{},{replication_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Oe.j,placeholder:"Replication method",value:k,children:Rn.jL.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))}))}),Rn._B.INCREMENTAL===k&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),!(null!==d&&void 0!==d&&d.length)&&(0,S.jsx)(O.ZP,{danger:!0,xsmall:!0,children:"No bookmark properties set"}),(null===d||void 0===d?void 0:d.length)>=1&&(null===d||void 0===d?void 0:d.map((function(e,n){return(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,xsmall:!0,children:[n>=1&&", ",e]},e)})))]})]},"".concat(t,"-replicationMethod")),(0,p.createElement)(an.Z,vt(vt({},pt),{},{key:"".concat(t,"-uniqueConflictMethod"),onChange:function(e){var t;return h([vt(vt({},n),{},{unique_conflict_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Oe.j,placeholder:"Unique conflict method",value:_}),Object.values(Rn.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))),(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:b.tf.DATA_EXPORTER===m?"center":"flex-end",children:(0,S.jsx)(Dn.Z,{checked:!!w,compact:!0,onCheck:function(e){h([vt(vt({},n),{},{run_in_parallel:e(w)})])}})},"".concat(t,"-runInParallel"))];b.tf.DATA_EXPORTER===m&&T.push.apply(T,[(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Dn.Z,{checked:!!s,compact:!0,onCheck:function(e){h([vt(vt({},n),{},{auto_add_new_fields:e(s)})])}})},"".concat(t,"-autoAddNewFields")),(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Dn.Z,{checked:!!j,compact:!0,onCheck:function(e){h([vt(vt({},n),{},{disable_column_type_check:e(j)})])}})},"".concat(t,"-disableColumnTypeCheck"))]),i.push(T)})),o.push(x)})),{rowGroupHeaders:n,rows:i,rowsGroupedByIndex:o,streamsInRows:e}}),[m,t,v,f,r,I,a,h]),D=B.rowGroupHeaders,N=B.rows,L=B.rowsGroupedByIndex,F=B.streamsInRows;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(A.Z,{children:"Overview of streams"}),k&&(0,S.jsxs)(C.Z,{mt:1,children:[(0,S.jsx)(O.ZP,{default:!0,children:"Fetch and add at least 1 stream to the catalog in order to see an overview of all the configured stream."}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return r(Zn.uK.STREAMS)},preventDefault:!0,children:"Go and fetch Streams"})})]})]}),!k&&(0,S.jsx)(R.Z,{columnFlex:T,columns:M,isSelectedRow:function(e){var n=null===F||void 0===F?void 0:F[e];return!!(0,yn.zB)(n,o)},groupsInline:!0,onClickRow:function(e){var n=null===F||void 0===F?void 0:F[e],t=!!(0,yn.zB)(n,o);u((function(e){return(0,yn.iN)(n,e,{remove:t})}))},rowGroupHeaders:D,rows:N,rowsGroupedByIndex:L,stickyHeader:!0})]})};function ht(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 mt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ht(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ht(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gt=3*w.iI*2;var bt=function(e){var n=e.block,t=void 0===n?null:n,i=e.defaultMainNavigationTab,u=void 0===i?null:i,c=e.defaultMainNavigationTabSub,s=void 0===c?null:c,a=e.defaultSubTab,d=void 0===a?null:a,v=e.onChangeBlock,h=e.onChangeCodeBlock,m=e.onClose,g=e.onSaveBlock,I=e.pipeline,E=e.savePipelineContent,T=e.setContent,M=(0,p.useRef)(null),B=(0,p.useRef)(null),D=(0,p.useRef)(null),R=(0,p.useRef)(null),F=(0,p.useState)({}),U=F[0],H=F[1],W=(0,p.useState)(null),G=W[0],K=W[1],z=(0,p.useState)(!1),q=z[0],V=z[1],Q=(0,Je.i)(),X=Q.height,J=Q.width,$=I||{},ee=$.blocks,ne=$.uuid,te=t||{},ie=(te.catalog,te.content),oe=(te.language,te.type),re=te.uuid,le=(0,p.useMemo)((function(){return b.tf.DATA_LOADER===oe?vn.O.SOURCES:vn.O.DESTINATIONS}),[oe]),ue=(0,p.useState)(t||null),ce=ue[0],se=ue[1],de=ce||{},pe=(de.configuration,de.content),fe=de.metadata,he=(0,p.useMemo)((function(){return(null===fe||void 0===fe?void 0:fe.data_integration)||{}}),[fe]),me=he.destination,ge=he.name,xe=he.source,je=(0,p.useMemo)((function(){return me||xe||null}),[me,xe]),Ze=(0,p.useMemo)((function(){var e={include_block_catalog:!0,include_block_metadata:!0,include_documentation:!0};return je&&(e.data_integration_uuid=je),e}),[je]),ye=Y.ZP.blocks.pipelines.detail(ne,re,Ze,{},{key:"pipelines/".concat(ne,"/blocks/").concat(re,"/documentation")}).data,Ce=(0,p.useMemo)((function(){var e;return(null===ce||void 0===ce||null===(e=ce.configuration)||void 0===e?void 0:e.data_integration)||{}}),[ce]),Oe=(0,p.useCallback)((function(e){return se((function(n){var t,i=mt(mt({},n),{},{configuration:mt(mt({},null===n||void 0===n?void 0:n.configuration),{},{data_integration:e((null===n||void 0===n||null===(t=n.configuration)||void 0===t?void 0:t.data_integration)||{})})});return null===v||void 0===v||v(i),i}))}),[v,se]),we=(0,p.useCallback)((function(e){return Oe((function(n){return mt(mt({},n),{},{inputs:e((null===n||void 0===n?void 0:n.inputs)||{})})}))}),[Oe]),_e=(0,p.useCallback)((function(e,n){return se((function(t){var i=(null===t||void 0===t?void 0:t.catalog)||{streams:[]},r=(0,o.Z)((null===i||void 0===i?void 0:i.streams)||[]);null===e||void 0===e||e.forEach((function(e){var n=(0,yn.M$)(e),t=null===e||void 0===e?void 0:e.parent_stream,i=null===r||void 0===r?void 0:r.findIndex((function(e){var i=(0,yn.M$)(e),o=null===e||void 0===e?void 0:e.parent_stream;return n===i&&t===o})),o={};i>=0&&(o=null===r||void 0===r?void 0:r[i]);var l=mt(mt({},o),e);i>=0?r[i]=l:r.push(l)}));var l=mt(mt({},t),{},{catalog:mt(mt({},i),{},{streams:r})});return null===n||void 0===n||n(l),l}))}),[se]),Se=(0,p.useMemo)((function(){return null===ye||void 0===ye?void 0:ye.block}),[ye]);(0,p.useEffect)((function(){Se&&(ce&&(null===Se||void 0===Se?void 0:Se.uuid)===(null===ce||void 0===ce?void 0:ce.uuid)||se(Se))}),[ce,Se]);var Ie=(0,p.useMemo)((function(){return(0,L.HK)(ee||[],(function(e){return e.uuid}))}),[ee]),Me=(0,p.useMemo)((function(){var e;return null===ce||void 0===ce||null===(e=ce.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null===Ie||void 0===Ie?void 0:Ie[e]}))}),[ce,Ie]),Be=(0,p.useMemo)((function(){return null===Se||void 0===Se?void 0:Se.documentation}),[Se]),De=(0,p.useMemo)((function(){return(0,yn.Uc)(ce,{getAll:!0})}),[ce]),He=(0,p.useMemo)((function(){return(0,yn.UA)(De)}),[De]),We=(0,p.useMemo)((function(){return"DataIntegrationModal/".concat(re)}),[re]),Ge=(0,p.useMemo)((function(){return"block_layout_after_width_".concat(We)}),[We]),Ke=(0,p.useMemo)((function(){return"block_layout_before_width_".concat(We)}),[We]),ze=(0,ae.VI)(null,{},[],{uuid:We}),qe=(0,r.Z)(ze,1)[0],Ve=(0,p.useState)((0,Ye.U2)(Ge,60*w.iI)),Qe=Ve[0],Xe=Ve[1],$e=(0,p.useState)(!1),en=$e[0],nn=$e[1],tn=(0,p.useState)(Math.max((0,Ye.U2)(Ke),40*w.iI)),on=tn[0],rn=tn[1],ln=(0,p.useState)(!1),un=ln[0],cn=ln[1],sn=(0,p.useState)({}),an=sn[0],dn=sn[1],pn=(0,p.useState)({selectedMainNavigationTab:null,selectedMainNavigationTabSub:s,selectedSubTab:null}),fn=pn[0],hn=fn.selectedMainNavigationTab,mn=fn.selectedMainNavigationTabSub,gn=fn.selectedSubTab,xn=pn[1],jn=(0,p.useState)((0,yn.UA)([])),kn=jn[0],Pn=jn[1],Cn=(0,p.useMemo)((function(){if(!(0,Tn.Qr)(null===kn||void 0===kn?void 0:kn.noParents)||!(0,Tn.Qr)(null===kn||void 0===kn?void 0:kn.parents)){var e,n,t,i;if(hn)if(mn)e=null===kn||void 0===kn||null===(n=kn.parents)||void 0===n||null===(t=n[hn])||void 0===t?void 0:t[mn];else e=null===kn||void 0===kn||null===(i=kn.noParents)||void 0===i?void 0:i[hn];return(0,Zn.C0)({addStreamConflicts:!!e})}return(0,Zn.C0)()}),[hn,mn,kn]),Sn=(0,p.useCallback)((function(e){return e in Zn.Pf?Zn.Pf[e]:Cn}),[Cn]),In=(0,p.useCallback)((function(e){xn((function(n){return function(e,n){var t=e||{},i=t.selectedMainNavigationTab,o=t.selectedMainNavigationTabSub,r=t.selectedSubTab,l=n||{},u=l.selectedMainNavigationTab,c=l.selectedMainNavigationTabSub,s=i in Zn.Pf?Zn.Pf[i]:Cn,a=r;if(Zn.mU[i]||Zn.mU[u]){var d,v,p;if(a){if(Zn.mU[u]&&!Zn.mU[i]){var f;!a||null!==Cn&&void 0!==Cn&&Cn.includes(a)||Zn.tw.STREAM_CONFLICTS===a||(a=null===Cn||void 0===Cn||null===(f=Cn[0])||void 0===f?void 0:f.uuid)}}else a=null===s||void 0===s||null===(p=s[0])||void 0===p?void 0:p.uuid;i!==u&&dn({});var h=(0,yn.zB)({parent_stream:c,stream:u,tap_stream_id:u},He),m=(0,yn.zB)({parent_stream:o,stream:i,tap_stream_id:i},He),g=(0,L.jV)(Object.keys((null===h||void 0===h||null===(d=h.schema)||void 0===d?void 0:d.properties)||{}),Object.keys((null===m||void 0===m||null===(v=m.schema)||void 0===v?void 0:v.properties)||{}));dn((function(e){return mt({},(0,Tn.GL)(e,g||[]))}))}return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:o,selectedSubTab:a}}(e(n),n)}))}),[dn,He,Cn]);(0,p.useEffect)((function(){hn||In((function(e){var n,t,i=e.selectedSubTab;return{selectedMainNavigationTab:u||Zn.uK.CONFIGURATION,selectedMainNavigationTabSub:s,selectedSubTab:u?d||(null===(n=Sn(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,s,d,Sn,hn,In]);var En=(0,p.useMemo)((function(){return Sn(hn)}),[Sn,hn]),Mn=(0,p.useMemo)((function(){var e=[{Icon:N.SettingsWithKnobs,uuid:Zn.uK.CONFIGURATION},{Icon:N.Sun,uuid:Zn.uK.STREAMS},{Icon:N.Table,uuid:Zn.uK.OVERVIEW}].map((function(e){var n=e.Icon,t=e.uuid;return(0,S.jsx)(Ue,{selected:hn===t,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return In((function(){return{selectedMainNavigationTab:t}}))},preventDefault:!0,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{primaryLight:!0,size:4*w.iI,square:!0,children:(0,S.jsx)(n,{size:2*w.iI})}),(0,S.jsx)(C.Z,{mr:2}),(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:Zn.TD[t]})]})})})},t)})),n=(null===De||void 0===De?void 0:De.length)||0,t=[],i={};return null===De||void 0===De||De.forEach((function(e){var n=e.parent_stream;n?(null!==i&&void 0!==i&&i[n]||(i[n]=[]),i[n].push(e)):t.push(e)})),[{block:null,streams:t}].concat((0,o.Z)((0,L.YC)(Object.entries(i),(function(e){var n=(0,r.Z)(e,2),t=n[0];n[1];return t})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return{block:null===Ie||void 0===Ie?void 0:Ie[t],streams:i}})))).forEach((function(t){var i=t.block,o=t.streams;if(i){var r=null===i||void 0===i?void 0:i.uuid;e.push((0,S.jsx)(k.Z,{light:!0},"block-".concat(r,"-divider-top"))),e.push((0,S.jsx)(C.Z,{px:w.cd,py:1,children:(0,S.jsx)(O.ZP,{bold:!0,color:(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}).accent,monospace:!0,small:!0,children:r})},"block-".concat(r)))}null===o||void 0===o||o.forEach((function(t,i){var o=(0,yn.M$)(t),r=(0,yn.Qu)(t),l=(0,yn.WD)(t),u=(0,yn.Z5)(t),c=hn===o&&(!r||mn===r);e.push((0,S.jsx)(k.Z,{light:!0},"".concat(l,"-divider-top"))),e.push((0,S.jsx)(Ue,{selected:c,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){In((function(e){var n=e.selectedSubTab;return{selectedMainNavigationTab:o,selectedMainNavigationTabSub:r,selectedSubTab:n}}))},preventDefault:!0,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:u}),(0,S.jsx)(C.Z,{mr:2}),(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(O.ZP,{default:!u,monospace:!0,children:o})})]})})})},l)),i===n-1&&e.push((0,S.jsx)(k.Z,{light:!0},"".concat(l,"-divider-last")))}))})),e}),[Ie,hn,mn,In,De]),Bn=(0,p.useState)(null),An=Bn[0],Rn=Bn[1],Nn=(0,p.useMemo)((function(){return(0,yn.qf)(He,(0,yn.UA)(An||[]))}),[He,An]),Ln=(0,f.Db)(Y.ZP.integration_sources.useUpdate(ne),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.integration_source.streams;Rn(n)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),Fn=(0,r.Z)(Ln,2),Un=Fn[0],Hn=Fn[1].isLoading,Wn=(0,p.useCallback)((function(){return Un({integration_source:{block_uuid:re}})}),[re,Un]),Gn=(0,p.useState)(null),Kn=Gn[0],zn=Gn[1],qn=(0,p.useMemo)((function(){return(0,S.jsxs)("div",{ref:R,children:[(null===En||void 0===En?void 0:En.length)>=1&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(ve.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return In((function(e){return mt(mt({},e),{},{selectedSubTab:n})}))},regularSizeText:!0,selectedTabUUID:gn,tabs:En})}),!(null!==En&&void 0!==En&&En.length)&&Zn.uK.STREAMS===hn&&(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(Ee.Z,{beforeIcon:(0,S.jsx)(N.Search,{muted:!(null!==Kn&&void 0!==Kn&&Kn.length),size:2*w.iI}),fullWidth:!0,noBackground:!0,noBorder:!0,noBorderRadiusBottom:!0,noBorderRadiusTop:!0,onChange:function(e){var n;return zn(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},paddingHorizontal:w.iI*w.cd,paddingVertical:w.iI*w.cd,placeholder:"Type the name of the stream to filter...",value:Kn||""})}),(null===Kn||void 0===Kn?void 0:Kn.length)>=1&&(0,S.jsx)(be.ZP,{iconOnly:!0,noPadding:!0,noBackground:!0,noBorder:!0,onClick:function(){return zn(null)},children:(0,S.jsx)(N.Close,{default:!0,size:2*w.iI})}),!Nn&&(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.CubeWithArrowDown,{size:2*w.iI}),compact:!0,loading:Hn,onClick:function(){return Wn()},primary:!0,children:"Fetch streams"})})]}),(0,S.jsx)(k.Z,{light:!0})]})}),[Wn,Hn,Nn,R,Kn,hn,gn,zn,In,En]),Vn=(0,p.useMemo)((function(){return X-2*Ae}),[X]),Yn=(0,p.useMemo)((function(){return J-2*Ae}),[J]),Qn=(0,p.useState)(null),Jn=Qn[0],$n=Qn[1],et=(0,p.useState)(null),nt=et[0],it=et[1],ot=(0,p.useState)(null),rt=(ot[0],ot[1]),lt=(0,p.useState)(!1),ct=lt[0],st=lt[1];(0,p.useEffect)((function(){var e,n,t,i,o,r;(hn||gn)&&($n(null===R||void 0===R||null===(e=R.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),rt(null===B||void 0===B||null===(t=B.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height),it(null===D||void 0===D||null===(o=D.current)||void 0===o||null===(r=o.getBoundingClientRect())||void 0===r?void 0:r.height))}),[D,B,R,hn,gn]);var dt=(0,f.Db)(Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(ne),encodeURIComponent(re)),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){null===g||void 0===g||g(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),vt=(0,r.Z)(dt,2),pt=(vt[0],vt[1].isLoading,(0,p.useMemo)((function(){return hn&&![Zn.uK.CONFIGURATION,Zn.uK.OVERVIEW,Zn.uK.STREAMS,Zn.uK.SYNC].includes(hn)}),[hn])),ht=(0,p.useMemo)((function(){return pt&&Zn.tw.SETTINGS===gn}),[pt,gn]),bt=(0,p.useMemo)((function(){return Zn.uK.CONFIGURATION===hn&&Zn.tw.CREDENTIALS===gn}),[hn,gn]),xt=(0,p.useMemo)((function(){return Zn.uK.OVERVIEW===hn}),[hn]),jt=(0,p.useMemo)((function(){return!(bt||ht||xt&&(null===De||void 0===De?void 0:De.length)>=1)||ct}),[ct,bt,ht,xt,De]),kt=(0,p.useMemo)((function(){var e=(0,yn.zB)({parent_stream:mn,stream:hn,tap_stream_id:hn},He);if(e)return(0,S.jsx)(Xn,{block:ce,blocksMapping:Ie,height:Vn-Jn-2*w.iI,highlightedColumnsMapping:an,onChangeBlock:v,pipeline:I,selectedSubTab:gn,setBlockAttributes:se,setHighlightedColumnsMapping:dn,setSelectedSubTab:function(e){return In((function(n){return mt(mt({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Pn,showError:qe,stream:e,streamMapping:He,streamsMappingConflicts:kn,updateStreamsInCatalog:_e})}),[ce,Ie,Jn,Vn,an,v,I,hn,mn,gn,se,dn,In,Pn,qe,He,kn,_e]),Zt=(0,p.useState)(null),yt=Zt[0],Pt=Zt[1];(0,p.useEffect)((function(){"undefined"!==typeof yt&&null!==yt||Pt("undefined"!==typeof ie&&null!==ie?ie:pe)}),[pe,ie,yt,Pt]);var Ct=(0,p.useState)(null),Ot=Ct[0],wt=Ct[1],_t=(0,p.useMemo)((function(){return(0,S.jsx)(On,{block:ce,blockConfigString:Ot,blockContent:yt,blockUpstreamBlocks:Me,dataIntegrationConfiguration:Ce,onChangeCodeBlock:h,pipeline:I,savePipelineContent:E,setBlockConfigString:wt,setBlockContent:Pt,setContent:T,setSelectedSubTab:function(e){return In((function(n){return mt(mt({},n),{},{selectedSubTab:e})}))},showError:qe})}),[ce,Ot,yt,Me,Ce,h,I,E,wt,Pt,T,In,qe]),St=(0,p.useMemo)((function(){if(Zn.uK.CONFIGURATION===hn){if(Zn.tw.UPSTREAM_BLOCK_SETTINGS===gn){var e=null===Me||void 0===Me?void 0:Me.map((function(e){var n,t,i=e.uuid,o=null===Ce||void 0===Ce||null===(n=Ce.inputs)||void 0===n?void 0:n[i],r=(null===o||void 0===o?void 0:o.streams)||[],u=!!o,c=null===Ie||void 0===Ie?void 0:Ie[i],s=(null===c||void 0===c?void 0:c.catalog)?null===(t=(0,yn.Uc)(c))||void 0===t?void 0:t.map((function(e){var n=e.stream,t=e.tap_stream_id;return n||t})):[i],a=1===(null===s||void 0===s?void 0:s.length)&&(null===s||void 0===s?void 0:s.includes(i));return(0,S.jsxs)("div",{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(O.ZP,{bold:!0,large:!0,monospace:!0,muted:!u,children:i})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Dn.Z,{checked:u,compact:!0,onCheck:function(e){we((function(n){return e(u)?mt(mt({},n),{},(0,l.Z)({},i,{})):(0,Tn.gR)(n,[i])}))}})]}),u&&(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(_n.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Use catalog as an input"}),(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:"If checked, then this block\u2019s catalog will be included as part of the input argument(s) for the current block."})]}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null===o||void 0===o?void 0:o.catalog,onClick:function(){return we((function(e){var n;return mt(mt({},e),{},(0,l.Z)({},i,mt(mt({},null===e||void 0===e?void 0:e[i]),{},{catalog:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.catalog)})))}))}})]}))}),a&&(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Use the block\u2019s output data as an input"}),(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:"Include this block\u2019s output data as an input."})]}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null===r||void 0===r?void 0:r.includes(i),monospace:!0,onClick:function(){return we((function(e){return mt(mt({},e),{},(0,l.Z)({},i,mt(mt({},null===e||void 0===e?void 0:e[i]),{},{streams:null!==r&&void 0!==r&&r.includes(i)?(0,L.Od)(r,(function(e){return e===i})):r.concat(i)})))}))},small:!0})]}))}),!a&&(0,S.jsxs)(_n.g,{noBorder:!0,children:[(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Select which stream\u2019s data to use as an input"}),(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["Only the output data from the selected streams will be used as an input.",(0,S.jsx)("br",{}),"If none are selected, then no output data from any stream from this block will be used as in input.",(0,S.jsx)("br",{}),"If you don\u2019t see a stream here, then the upstream block may have unselected the stream in its stream settings."]})]}),(0,S.jsx)(C.Z,{mr:3})]})),null===s||void 0===s?void 0:s.map((function(e){var n=null===r||void 0===r?void 0:r.includes(e);return(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:e})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:n,onClick:function(){return we((function(t){return mt(mt({},t),{},(0,l.Z)({},i,mt(mt({},null===t||void 0===t?void 0:t[i]),{},{streams:n?(0,L.Od)(r,(function(n){return n===e})):r.concat(e)})))}))},small:!0})]}))},e)}))]}),(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Only use this block\u2019s output data as an input"}),(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["If checked, then this block\u2019s output data is only used as inputs.",b.tf.DATA_EXPORTER===oe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("br",{}),"The block\u2019s output data won\u2019t be ingested when running a sync, regardless if it\u2019s enabled in the settings."]})]})]}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:!(null===o||void 0===o||!o.input_only),onClick:function(){return we((function(e){var n;return mt(mt({},e),{},(0,l.Z)({},i,mt(mt({},null===e||void 0===e?void 0:e[i]),{},{input_only:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.input_only)})))}))}})]}))})]})})]}),(0,S.jsx)(k.Z,{light:!0})]},i)}));return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(A.Z,{children:"Inputs"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Choose which upstream block to use as inputs when interpolating data into ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:re}),"\u2019s (current block) credentials (aka config) and decorated functions."]})}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["If ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:re})," (current block) doesn\u2019t require the data from an upstream block to interpolate or as arguments for decorated functions, don\u2019t toggle them on because it\u2019ll save time and data by not loading unnecessary data as inputs."]})}),vn.O.DESTINATIONS===le&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Upstream blocks can still be selected to have its data ingested. This is toggled and configured in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return In((function(){return{selectedMainNavigationTab:Zn.uK.STREAMS}}))},preventDefault:!0,primary:!0,children:"Streams"})," section."]})})]}),(0,S.jsx)(k.Z,{light:!0}),e]})}}else{if(Zn.uK.STREAMS===hn&&Nn)return(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(A.Z,{children:"Fetch streams to start set up"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Add streams and configure them by first fetching the available streams from ",je,"."]})})]}),(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.CubeWithArrowDown,{size:2*w.iI}),large:!0,loading:Hn,onClick:function(){return Wn()},primary:!0,children:"Fetch streams"})]});if(Zn.uK.SYNC===hn)return(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(O.ZP,{children:"Coming soon"})});if(Zn.uK.OVERVIEW===hn)return(0,S.jsx)(ft,{block:ce,blocksMapping:Ie,onChangeBlock:v,selectedStreamMapping:G,setSelectedMainNavigationTab:function(e){return In((function(n){return{selectedMainNavigationTab:e}}))},setSelectedStreamMapping:K,streamMapping:He,updateStreamsInCatalog:_e})}}),[ce,oe,re,Me,Ie,Ce,le,je,Wn,Hn,Nn,v,hn,G,gn,we,In,K,He,_e]),It=(0,p.useMemo)((function(){return bt?(0,S.jsx)(O.ZP,{bold:!0,children:"Documentation"}):ht?(0,S.jsx)(O.ZP,{bold:!0,children:"Bulk edit stream properties"}):xt?(0,S.jsx)(O.ZP,{bold:!0,children:"Bulk edit streams"}):void 0}),[bt,ht,xt]),Et=(0,p.useMemo)((function(){if(ht||xt)return(0,S.jsx)(Ne,{ref:D,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(x.Z,{checked:q,label:"Clear selection and values after applying changes",onClick:function(){return V((function(e){return!e}))}})}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};ht?e=(0,yn.Kq)(G,an,U):xt&&(e=(0,yn.bX)(G,U)),_e((0,yn.eH)(e),(function(e){return null===v||void 0===v?void 0:v(e)})),q&&(H({}),dn({}),K(null))},primary:!0,children:"Apply bulk changes"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(be.ZP,{fullWidth:!0,onClick:function(){H({}),dn({}),K(null)},secondary:!0,children:"Clear"})]})]})})}),[U,q,an,ht,xt,v,D,G,H,dn,K,_e]),Tt=(0,p.useMemo)((function(){if(bt)return(0,S.jsx)(Re,{children:(0,S.jsxs)(C.Z,{p:w.cd,children:[!ye&&(0,S.jsx)(ke.Z,{}),Be&&(0,S.jsx)(wn.Z,{children:Be.replace(/\<br \/\>/g,"\n\n")})]})});if(ht){var e=(0,yn.zB)({parent_stream:mn,stream:hn,tap_stream_id:hn},He);return(0,S.jsx)(at,{attributesMapping:U,block:ce,blocksMapping:Ie,highlightedColumnsMapping:an,selectedStreamMapping:G,setAttributesMapping:H,setHighlightedColumnsMapping:dn,setSelectedStreamMapping:K,stream:e,streamMapping:He,updateStreamsInCatalog:_e})}return xt?(0,S.jsx)(ut,{attributesMapping:U,selectedStreamMapping:G,setAttributesMapping:H,setSelectedStreamMapping:K,streamMapping:He}):void 0}),[U,ce,Ie,ye,Be,an,bt,ht,xt,hn,mn,G,He,_e]),Mt=(0,p.useMemo)((function(){var e=[{label:function(){return re}}];return ge&&e.push({bold:!hn,label:function(){return ge}}),hn&&e.push({bold:!0,label:function(){return Zn.TD[hn]||hn}}),(0,S.jsx)(bn.Z,{breadcrumbs:e,noMarginLeft:!0})}),[re,ge,hn]),Bt=(0,p.useMemo)((function(){return(X-Vn-gt)/2}),[Vn,X]),Dt=(0,p.useMemo)((function(){return(0,S.jsx)(tt,{block:ce,blocksMapping:Ie,height:Vn-Jn,onChangeBlock:v,searchText:Kn,setSelectedMainNavigationTab:In,setSelectedSubTab:function(e){return In((function(n){return mt(mt({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Pn,streamsFetched:An,updateStreamsInCatalog:_e,width:Yn-(on+(jt?0:Qe))})}),[jt,Qe,on,ce,Ie,Jn,Vn,v,Kn,In,Pn,An,_e,Yn]);return(0,S.jsxs)(Le,{maxWidth:Yn,children:[(0,S.jsx)(Fe,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{children:Mt}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(P.Z,{href:"https://docs.mage.ai",inline:!0,noOutline:!0,openNewWindow:!0,children:(0,S.jsx)(N.DocumentIcon,{default:!0,size:2*w.iI})}),(0,S.jsx)(C.Z,{mr:2}),m&&(0,S.jsx)(be.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){null===m||void 0===m||m()},children:(0,S.jsx)(N.Close,{default:!0,size:2*w.iI})})]})]})}),(0,S.jsxs)(Te.Z,{after:Tt,afterFooter:Et,afterFooterBottomOffset:Bt,afterHeader:(0,S.jsx)(C.Z,{px:1,ref:B,children:It}),afterHeaderOffset:0,afterHeightOffset:0,afterHidden:jt,afterInnerHeightMinus:48+(Et&&nt||0),afterMousedownActive:en,afterWidth:Qe,before:Mn,beforeHeightOffset:0,beforeMousedownActive:un,beforeWidth:on,contained:!0,headerOffset:Jn,height:Vn,hideAfterCompletely:!Tt||xt&&!(null!==De&&void 0!==De&&De.length),inline:!0,mainContainerHeader:qn,mainContainerRef:M,setAfterHidden:st,setAfterMousedownActive:nn,setAfterWidth:Xe,setBeforeMousedownActive:cn,setBeforeWidth:rn,uuid:We,children:[pt&&kt,!pt&&St,Zn.uK.CONFIGURATION===hn&&Zn.tw.CREDENTIALS===gn&&_t,Zn.uK.STREAMS===hn&&!Nn&&Dt]})]})},xt=t(50724),jt=t(70374),kt=t(72098);var Zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.pipelineType,t=e.refreshInterval,i=void 0===t?5e3:t,o=e.revalidateOnFocus,r=Y.ZP.kernels.list({},{refreshInterval:i,revalidateOnFocus:o}),l=r.data,u=r.mutate,c=(0,p.useMemo)((function(){var e=null===l||void 0===l?void 0:l.kernels;return(null===e||void 0===e?void 0:e.find((function(e){return e.name===sn.a_[n]})))||(null===e||void 0===e?void 0:e[0])}),[null===l||void 0===l?void 0:l.kernels,n]);return{fetch:u,kernel:c}},yt=t(77417),Pt=t(26419),Ct=t(58325);function Ot(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 wt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ot(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ot(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _t=1.5*w.iI;var St=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,o=e.executePipeline,r=e.interruptKernel,u=e.isPipelineExecuting,c=e.pipeline,s=e.restartKernel,a=e.savePipelineContent,d=e.scrollTogether,v=(e.setActiveSidekickView,e.setMessages),f=e.setScrollTogether,h=e.setSideBySideEnabled,m=e.sideBySideEnabled,g=e.updatePipelineMetadata,b=(0,p.useState)(null),x=b[0],j=b[1],k=(0,p.useRef)(null),Z=(0,p.useRef)(null),P=(0,p.useRef)(null),w=(0,p.useRef)(null),_=(0,p.useRef)(null),I=Zt({pipelineType:null===c||void 0===c?void 0:c.type}).kernel,E=(0,yt.Z)(),T=E.featureEnabled,M=E.featureUUIDs,B=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,G.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,G.Y6)(),type:sn.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,Ct.V5)()?qe.RJ:qe.hE,qe.SS]],label:function(){return"Save pipeline"},onClick:function(){return a()},uuid:"save_pipeline"}],D=(0,p.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[qe.kA],[qe.kA]],onClick:function(){return r()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[qe.t_[qe.OC]],[qe.t_[qe.OC]]],onClick:function(){return s()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return v((function(e){return Object.keys(e).reduce((function(e,n){return wt(wt({},e),{},(0,l.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return u?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):(null===c||void 0===c?void 0:c.type)===sn.qL.STREAMING&&e.push({label:function(){return"Execute pipeline"},onClick:function(){return o()},uuid:"Execute pipeline"}),e}),[n,o,r,u,null===c||void 0===c?void 0:c.type,s,v]),A=(0,p.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===c||void 0===c?void 0:c.uuid,"/settings"),href:"/pipelines/[pipeline]/settings"},uuid:"Pipeline settings"},{label:function(){return"Browse custom templates"},linkProps:{href:"/templates"},uuid:"browse_custom_templates"},{label:function(){return"Create custom templates"},linkProps:{href:"/templates?new=1"},uuid:"create_custom_templates"}]}),[c]),R=(0,p.useMemo)((function(){return[{label:function(){return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(N.LayoutStacked,{success:!m}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{noWrapping:!0,children:"Show output below block"})]})},onClick:function(){h(!1)},uuid:"Show output below block"},{label:function(){return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(N.LayoutSplit,{success:m}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{noWrapping:!0,children:"Show output next to code (beta)"})]})},onClick:function(){h(!0)},uuid:"Show output next to code"},{disabled:!m,label:function(){return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[d?(0,S.jsx)(N.Check,{}):(0,S.jsx)("div",{style:{width:_t}}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{disabled:!m,noWrapping:!0,children:"Scroll output alongside code (beta)"})]})},onClick:function(){return f(!d)},uuid:"Scroll output alongside code"}]}),[d,f,h,m]),L=(0,p.useMemo)((function(){var e=[{label:function(){return"Open compute management"},linkProps:{href:"/compute"},uuid:"Open compute management"}];return kt.U.PYTHON3===(null===I||void 0===I?void 0:I.name)?e.push({label:function(){return"Switch to PySpark kernel"},onClick:function(){return null===g||void 0===g?void 0:g(null===c||void 0===c?void 0:c.name,sn.fj[kt.U.PYSPARK])},uuid:"Switch to PySpark kernel"}):kt.U.PYSPARK===(null===I||void 0===I?void 0:I.name)&&e.push({label:function(){return"Switch to Python kernel"},onClick:function(){return null===g||void 0===g?void 0:g(null===c||void 0===c?void 0:c.name,sn.fj[kt.U.PYTHON3])},uuid:"Switch to Python kernel"}),e}),[I,c,g]),F="FileHeaderMenu/index",U=(0,Xe.y)(),H=U.registerOnKeyDown,W=U.unregisterOnKeyDown;return(0,p.useEffect)((function(){return function(){W(F)}}),[W,F]),H(F,(function(e,n,t){null!==x&&(n[qe.QK]?j((function(e){return 0===e?2:e-1})):n[qe.DY]&&j((function(e){return 2===e?0:e+1})))}),[x,j]),(0,S.jsx)(xt.Z,{onClickOutside:function(){return j(null)},open:!0,style:{position:"relative"},children:(0,S.jsxs)(y.ZP,{children:[(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(be.ZP,wt(wt({},Pt.a),{},{noBackground:0!==x,onClick:function(){return j((function(e){return 0===e?null:0}))},onMouseEnter:function(){return j((function(e){return null!==e?0:null}))},ref:k,children:(0,S.jsx)(O.ZP,{children:"File"})})),(0,S.jsx)(jt.Z,{items:B,onClickCallback:function(){return j(null)},open:0===x,parentRef:k,uuid:"FileHeaderMenu/file_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(be.ZP,wt(wt({},Pt.a),{},{noBackground:2!==x,onClick:function(){return j((function(e){return 2===e?null:2}))},onMouseEnter:function(){return j((function(e){return null!==e?2:null}))},ref:P,children:(0,S.jsx)(O.ZP,{children:"Edit"})})),(0,S.jsx)(jt.Z,{items:A,onClickCallback:function(){return j(null)},open:2===x,parentRef:P,uuid:"FileHeaderMenu/edit_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(be.ZP,wt(wt({},Pt.a),{},{noBackground:1!==x,onClick:function(){return j((function(e){return 1===e?null:1}))},onMouseEnter:function(){return j((function(e){return null!==e?1:null}))},ref:Z,children:(0,S.jsx)(O.ZP,{children:"Run"})})),(0,S.jsx)(jt.Z,{items:D,onClickCallback:function(){return j(null)},open:1===x,parentRef:Z,uuid:"FileHeaderMenu/run_items"})]}),sn.qL.INTEGRATION!==(null===c||void 0===c?void 0:c.type)&&(null===T||void 0===T?void 0:T(M.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(be.ZP,wt(wt({},Pt.a),{},{noBackground:3!==x,onClick:function(){return j((function(e){return 3===e?null:3}))},onMouseEnter:function(){return j((function(e){return null!==e?3:null}))},ref:w,children:(0,S.jsx)(O.ZP,{children:"View"})})),(0,S.jsx)(jt.Z,{items:R,onClickCallback:function(){return j(null)},open:3===x,parentRef:w,uuid:"FileHeaderMenu/viewItems"})]}),(null===T||void 0===T?void 0:T(M.COMPUTE_MANAGEMENT))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(be.ZP,wt(wt({},Pt.a),{},{noBackground:4!==x,onClick:function(){return j((function(e){return 4===e?null:4}))},onMouseEnter:function(){return j((function(e){return null!==e?4:null}))},ref:_,children:(0,S.jsx)(O.ZP,{children:"Compute"})})),(0,S.jsx)(jt.Z,{items:L,onClickCallback:function(){return j(null)},open:4===x,parentRef:_,uuid:"FileHeaderMenu/viewItems"})]}),t]})})},It=t(69616),Et=t(67355),Tt=t(70613),Mt=t(21764),Bt=t(28071),Dt=t(65956),At=t(23657),Rt=t(8970),Nt=v.default.div.withConfig({displayName:"indexstyle__MenuStyle",componentId:"sc-1bixraz-0"})(["",";border-radius:","px;max-height:","px;min-width:","px;overflow:auto;position:absolute;right:0;",""],Be.w5,Me.n_,60*w.iI,70*w.iI,(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border: 1px solid ").concat((e.theme.interactive||U.Z.interactive).defaultBorder,";\n ")}));function Lt(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 Ft(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Lt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Lt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ut=2*w.iI,Ht={default:!0,monospace:!0,small:!0};var Wt,Gt,Kt=function(){var e=(0,p.useRef)(null),n=(0,ae.VI)(null,{},[],{uuid:"ClusterSelection"}),t=(0,r.Z)(n,1)[0],i=(0,p.useState)(!1),o=i[0],l=i[1],u=(0,At.Z)({clustersRefreshInterval:5e3,includeAllStates:o}),c=(u.activeCluster,u.clusters),s=u.clustersLoading,a=u.computeService,d=u.fetchComputeClusters,v=(0,p.useState)(null),h=v[0],m=v[1],g=(0,f.Db)(Y.ZP.compute_clusters.compute_services.useCreate(null===a||void 0===a?void 0:a.uuid),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return t({errors:n,response:e})}})}}),b=(0,r.Z)(g,2),x=b[0],j=b[1].isLoading,Z=(0,f.Db)((function(e){return Y.ZP.compute_clusters.compute_services.useUpdate(null===a||void 0===a?void 0:a.uuid,null===e||void 0===e?void 0:e.id)({compute_cluster:(0,Tn.GL)(e,["active"])})}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){d(),m(null)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,o=n.message,r=n.type;Mt.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Mt.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),P=(0,r.Z)(Z,2),_=P[0],I=P[1].isLoading,E=(0,p.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)||0}),[c]),T=(0,p.useMemo)((function(){return(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.WorkspacesUsersIcon,{size:Ut}),compact:E>=1,loading:j,onClick:function(){return x()},primary:!0,small:E>=1,children:"Launch cluster"})}),[E,x,j]),M=(0,p.useMemo)((function(){var n,t,i,o,r=h||{message:null,x:0,y:0},l=r.message,u=r.x,c=r.y,s=(0,S.jsx)(O.ZP,{default:!0,small:!0,children:l});return(0,S.jsx)("div",{ref:e,style:{hidden:!h,left:u-((null===e||void 0===e||null===(n=e.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.width)||0),maxWidth:30*w.iI,position:"fixed",top:c-((null===e||void 0===e||null===(i=e.current)||void 0===i||null===(o=i.getBoundingClientRect())||void 0===o?void 0:o.height)||0),zIndex:9999},children:(0,S.jsx)(Dt.Z,{dark:!0,noPadding:!0,children:(0,S.jsxs)(C.Z,{p:1,children:[I&&(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ke.Z,{inverted:!0,small:!0}),(0,S.jsx)(C.Z,{mr:1}),s]}),!I&&s]})})})}),[I,h,m]);return(0,S.jsxs)(S.Fragment,{children:[M,(0,S.jsxs)(Nt,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:s?"Clusters":(0,G._6)("cluster",E,!0)}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Dn.Z,{checked:o,compact:!0,onCheck:function(e){return l(e(o))}}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:o,muted:!o,small:!0,children:"Include terminated clusters"})]})]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,small:!0,children:[E>=1&&"Click a cluster to activate and use it for compute.",!E&&"Launch a new cluster to use for compute."]})}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.ExpandOpenUpRight,{default:!0}),default:!0,linkProps:{href:"/compute",as:"/compute?tab=".concat(Rt.uK.CLUSTERS)},noBackground:!0,noBold:!0,noBorder:!0,target:"_blank",noPadding:!0,openNewWindow:!0,small:!0,children:"Open compute mangement"})})})]}),(0,S.jsx)(C.Z,{mr:w.cd}),E>=1&&(0,S.jsx)(y.ZP,{flexDirection:"column",children:T})]})}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(xt.Z,{onClickOutside:function(){I||m(null)},open:!0,children:(0,S.jsx)(R.Z,{columnFlex:[null,null,null],columns:[{uuid:"ID"},{uuid:"State"},{label:function(){return""},rightAligned:!0,uuid:"Active"}],onClickRow:function(e,n){var t;if(!I){var i,o=null===c||void 0===c?void 0:c[e],r=null===o||void 0===o||null===(t=o.status)||void 0===t?void 0:t.state;null!==o&&void 0!==o&&o.active?i="Cluster ".concat(null===o||void 0===o?void 0:o.id," is already active."):[Bt.X.RUNNING,Bt.X.WAITING].includes(r)?(i="Activating cluster ".concat(null===o||void 0===o?void 0:o.id,"."),_(Ft(Ft({},o),{},{active:!0}))):i="\n Cluster ".concat(null===o||void 0===o?void 0:o.id," must be in a\n ").concat((0,G.vg)(Bt.X.WAITING)," or\n ").concat((0,G.vg)(Bt.X.RUNNING),"\n state to be activated and used for compute.\n "),m({message:i,x:n.clientX,y:n.clientY})}},rows:null===c||void 0===c?void 0:c.map((function(e){var n=e.active,t=e.id,i=e.status,o=null===i||void 0===i?void 0:i.state;return[(0,p.createElement)(O.ZP,Ft(Ft({},Ht),{},{key:"id"}),t),(0,S.jsx)(O.ZP,Ft(Ft({},Ht),{},{danger:[Bt.X.TERMINATED_WITH_ERRORS].includes(o),default:[Bt.X.STARTING].includes(o),muted:[Bt.X.TERMINATED].includes(o),success:[Bt.X.RUNNING,Bt.X.WAITING].includes(o),warning:[Bt.X.TERMINATING].includes(o),children:null!==i&&void 0!==i&&i.state?(0,G.vg)(null===i||void 0===i?void 0:i.state):null===i||void 0===i?void 0:i.state})),(0,S.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(N.PowerOnOffButton,{muted:!n,size:Ut,success:n})},"active")]})),stickyHeader:!0,uuid:"ClusterSelection"})}),!s&&0===E&&(0,S.jsx)(C.Z,{p:w.cd,children:T}),s&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(ke.Z,{inverted:!0,small:!0})})]})]})};!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(Wt||(Wt={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(Gt||(Gt={}));var zt,qt=t(89308),Vt=t(89515),Yt=t(78688),Qt=t(98464);!function(e){e.EMR="emr"}(zt||(zt={}));var Xt=t(26032),Jt=t(74260),$t=t(89538);function ei(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 ni(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ei(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ei(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ti=function(e){var n=e.children,t=e.isBusy,i=e.pipeline,l=(e.restartKernel,e.savePipelineContent,e.setErrors),u=e.setRunningBlocks,c=e.updatePipelineMetadata,s=(0,h.useRouter)(),a=Zt({pipelineType:null===i||void 0===i?void 0:i.type}).kernel,d=(0,yt.Z)(),m=(d.featureEnabled,d.featureUUIDs,d.sparkEnabled),g=(0,At.Z)({clustersRefreshInterval:5e3,computeServiceRefreshInterval:5e3,connectionsRefreshInterval:5e3,pauseFetch:!m}),b=g.activeCluster,x=g.clusters,k=(g.clustersLoading,g.computeService),_=g.computeServiceUUIDs,I=g.connections,E=g.connectionsLoading,T=g.fetchAll,M=g.fetchComputeClusters,B=(g.setupComplete,(0,p.useContext)(v.ThemeContext)),D=a||{},A=D.alive,R=D.usage,F=(0,p.useState)(zt.EMR),H=F[0],W=(F[1],(0,p.useState)(!1)),K=W[0],z=W[1],q=(0,p.useState)(!1),V=q[0],Q=q[1],X=(0,p.useState)(!1),J=X[0],$=X[1],ee=(0,p.useState)(!1),ne=ee[0],te=ee[1],ie=(0,p.useRef)(null),oe=Y.ZP.clusters.detail(H,{},{revalidateOnFocus:!1}),re=oe.data,le=oe.mutate,ue=(0,p.useMemo)((function(){var e;return(null===re||void 0===re||null===(e=re.cluster)||void 0===e?void 0:e.clusters)||[]}),[re]),ce=(0,p.useMemo)((function(){return(0,L.sE)(ue,(function(e){return e.is_active}))}),[ue]),se=(0,f.Db)(Y.ZP.clusters.useUpdate(H),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){le()},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),ae=(0,r.Z)(se,1)[0],de=Y.ZP.spark_applications.list({},{},{pauseFetch:!m}).data,ve=(0,p.useMemo)((function(){return null===de||void 0===de?void 0:de.spark_applications}),[de]),pe="KernelStatus",fe=(0,Xe.y)(),he=(fe.registerOnKeyDown,fe.unregisterOnKeyDown);(0,p.useEffect)((function(){return function(){he(pe)}}),[he,pe]);var me=(0,p.useMemo)((function(){return null===R||void 0===R?void 0:R.pid}),[null===R||void 0===R?void 0:R.pid]),ge=(0,Qt.Z)(me),be=(0,$t.dd)((function(){return(0,S.jsx)(Vt.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:Ze,onClick:function(){(0,Ye.t8)(Ye.DU,1),Ze()},subtitle:"You may need to refresh your page to continue using the notebook. Unexpected kernel restarts may be caused by your kernel running out of memory.",title:"The kernel has restarted",width:34*w.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),xe=(0,r.Z)(be,2),je=xe[0],Ze=xe[1];(0,p.useEffect)((function(){var e=(0,Ye.U2)(Ye.DU,0);me!==ge&&t&&!e&&(je(),u([]))}),[t,me,ge,u,je]);var ye=(0,p.useMemo)((function(){return[sn.qL.PYTHON,sn.qL.PYSPARK].includes(null===i||void 0===i?void 0:i.type)}),[i]),Ce=(0,p.useMemo)((function(){return(0,S.jsx)(j.Z,{color:t?(B||U.Z).borders.info:A?(B||U.Z).borders.success:(B||U.Z).borders.danger,size:w.iI})}),[A,t,B]),we=(0,f.Db)((function(e){return Y.ZP.compute_clusters.compute_services.useUpdate(null===k||void 0===k?void 0:k.uuid,null===e||void 0===e?void 0:e.id)({compute_cluster:(0,Tn.GL)(e,["active"])})}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){M()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,o=n.message,r=n.type;Mt.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Mt.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),_e=(0,r.Z)(we,2),Se=_e[0],Ie=(_e[1].isLoading,(0,p.useMemo)((function(){if(!m||!ye||_.AWS_EMR!==(null===k||void 0===k?void 0:k.uuid)||sn.qL.PYSPARK!==(null===i||void 0===i?void 0:i.type))return null;var e=null===I||void 0===I?void 0:I.find((function(e){var n=e.uuid;return Jt.IK.OBSERVABILITY===n}));if(!e)return null;var n=e.name,t=e.state,o=e.status_calculated,r=e.uuid,l=[Xt.i.ACTIVE].includes(t),u=([Xt.i.INACTIVE].includes(t),[Jt.br.COMPLETED].includes(o)),c={muted:!0,warning:!1},a=n||r;u&&(l?(a="Observability enabled",c.muted=!1):a="SSH tunnel not connected");var d=(0,S.jsx)(xt.Z,{onClickOutside:function(e){(0,Oe.j)(e),te(!1)},open:ne,children:(0,S.jsx)(Nt,{children:(0,S.jsx)(qt.Z,{actionsOnly:u,computeService:k,computeConnections:[e],contained:!1,hideDetails:!0,fetchAll:T,onClickStep:function(e){s.push("/compute?tab=".concat(e))},small:!0})})}),v=(0,S.jsx)(N.PowerOnOffButton,{danger:[Jt.br.ERROR].includes(o),muted:[Jt.br.INCOMPLETE].includes(o),success:u&&l});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(un.ZP,ni(ni({beforeElement:v,blackBorder:!0,compact:!0,inline:!0,noHover:E,onClick:function(e){(0,Oe.j)(e),ne||te(!0),$(!1)},uuid:"Pipeline/ComputeConnectionStatus"},c),{},{children:a})),d]})}),[ne,k,I,E,T,i,$,te,ye])),Ee=(0,p.useMemo)((function(){if(!m||!ye)return null;var e,n,t,o;if(_.AWS_EMR===(null===k||void 0===k?void 0:k.uuid)){var r,l=null===k||void 0===k||null===(r=k.setup_steps)||void 0===r?void 0:r.find((function(e){var n=e.uuid;return Jt.IK.SETUP===n})),u=null===l||void 0===l?void 0:l.status_calculated;if(sn.qL.PYSPARK!==(null===i||void 0===i?void 0:i.type))return null;if(b){var c,a=null===b||void 0===b||null===(c=b.status)||void 0===c?void 0:c.state;t=(0,S.jsxs)(O.ZP,{monospace:!0,children:[null===b||void 0===b?void 0:b.id," ",a&&![Bt.X.RUNNING,Bt.X.WAITING].includes(a)&&(0,G.J3)(a)]}),o=(0,S.jsx)(N.PowerOnOffButton,{danger:[Bt.X.TERMINATED_WITH_ERRORS].includes(a),default:[Bt.X.STARTING].includes(a),muted:[Bt.X.TERMINATED].includes(a),success:[Bt.X.RUNNING,Bt.X.WAITING].includes(a),warning:[Bt.X.TERMINATING].includes(a)})}else u?(t=null!==x&&void 0!==x&&x.length?"Select a compute cluster":"Launch a new cluster",o=(0,S.jsx)(N.PowerOnOffButton,{warning:!0})):(e=(0,S.jsx)(xt.Z,{onClickOutside:function(e){(0,Oe.j)(e),$(!1)},open:J,children:(0,S.jsx)(Nt,{children:(0,S.jsx)(Yt.Z,{contained:!1,onClickStep:function(e){s.push("/compute?tab=".concat(e))},setupSteps:null===k||void 0===k?void 0:k.setup_steps,small:!0})})}),n=function(e){(0,Oe.j)(e),J||$(!0),te(!1)},t="Compute setup incomplete",o=(0,S.jsx)(N.AlertTriangle,{danger:!0}));(b||u)&&(e=(0,S.jsx)(xt.Z,{onClickOutside:function(e){(0,Oe.j)(e),$(!1)},open:J,children:(0,S.jsx)(Kt,{})}),n=function(e){(0,Oe.j)(e),J||$(!0),te(!1),te(!1)})}else if(_.STANDALONE_CLUSTER===(null===k||void 0===k?void 0:k.uuid))if(de)if(null!==ve&&void 0!==ve&&ve.length){if((null===ve||void 0===ve?void 0:ve.length)>=1){var d,v,p=null===ve||void 0===ve?void 0:ve[0];t=[null===p||void 0===p?void 0:p.name,null===p||void 0===p||null===(d=p.attempts)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.app_spark_version].filter((function(e){return e})).join(" "),o=(0,S.jsx)(N.PowerOnOffButton,{success:!0})}}else n=function(){return s.push("/compute")},t="Compute unavailable",o=(0,S.jsx)(N.PowerOnOffButton,{danger:!0});else t="Loading compute",o=(0,S.jsx)(ke.Z,{inverted:!0,small:!0});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(un.ZP,ni(ni({beforeElement:o,blackBorder:!0,compact:!0,inline:!0,noHover:!de||(null===ve||void 0===ve?void 0:ve.length)>=1,onClick:n,uuid:"Pipeline/ComputeStatus"},{muted:!1,warning:!1}),{},{children:t})),e]})}),[b,J,x,k,_,de,i,s,$,te,ve,m,ye]),Te=(0,p.useMemo)((function(){return(0,S.jsx)("div",{ref:ie,style:{position:"relative"},children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(null===i||void 0===i?void 0:i.type)===sn.qL.PYSPARK&&!m&&(0,S.jsxs)(C.Z,{mr:w.cd,children:[(0,S.jsxs)(P.Z,{muted:!!ce,onClick:function(){return z(!0)},preventDefault:!0,sameColorAsText:!ce,underline:!ce,children:[ce&&ce.id,!ce&&"Select cluster"]}),(0,S.jsx)(xt.Z,{disableEscape:!0,onClickOutside:function(){return z(!1)},open:K,children:(0,S.jsx)(jt.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,o.Z)(ue.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,S.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(O.ZP,{muted:!t&&Gt.WAITING!==i,children:n})}),t&&(0,S.jsx)(N.Check,{size:2*w.iI,success:!0}),!t&&(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||Gt.WAITING!==i?null:function(){return ae({cluster:{id:n}})},uuid:n}})))),onClickCallback:function(){return z(!1)},open:K,parentRef:ie,uuid:"KernelStatus/select_cluster",width:40*w.iI})})]}),(0,S.jsx)(un.ZP,{beforeElement:Ce,blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Q(!0)},uuid:"Pipeline/KernelStatus/kernel",children:sn.RH[(null===i||void 0===i?void 0:i.type)||sn.qL.PYTHON]}),(0,S.jsx)(xt.Z,{disableEscape:!0,onClickOutside:function(){return Q(!1)},open:V,children:(0,S.jsx)(jt.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,o.Z)(Object.keys(sn.a_).filter((function(e){return(null===i||void 0===i?void 0:i.type)!=e})).map((function(e){return{label:function(){return sn.RH[e]||e},onClick:function(){return c(null===i||void 0===i?void 0:i.name,e)},uuid:e}})))),onClickCallback:function(){return Q(!1)},open:V,parentRef:ie,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*w.iI})})]})})}),[A,ue,t,i,ce,z,Q,K,V,Ce,B,Se,ae,c]);return(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:n}),(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(Z.Z,{alignItems:"center",children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[Te,Ie&&(0,S.jsx)(C.Z,{ml:1,children:Ie}),Ee&&(0,S.jsx)(C.Z,{ml:1,children:Ee})]})})})]})},ii=t(48339),oi=t(12691),ri=t.n(oi),li=t(65976),ui=t(46510),ci=t(92709),si=v.default.div.withConfig({displayName:"indexstyle__ScrollbarContainerStyle",componentId:"sc-174iy66-0"})(["position:fixed;"," "," "," ",""],(function(e){return"\n border-radius: ".concat(Me.n_,"px;\n background: ").concat((e.theme.background||U.Z.background).scrollbarTrack,";\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Be.nn,"px;\n ")}),(function(e){return"undefined"!==typeof e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return"undefined"!==typeof e.left&&"\n left: ".concat(e.left,"px;\n ")})),ai=v.default.div.withConfig({displayName:"indexstyle__ScrollCursorStyle",componentId:"sc-174iy66-1"})(["position:fixed;z-index:3;"," "," "," "," ",""],(function(e){return"\n border-radius: ".concat(Me.TR,"px;\n background: ").concat((e.theme.background||U.Z.background).scrollbarThumb,";\n\n &:hover {\n background: ").concat((e.theme.background||U.Z.background).scrollbarThumbHover,";\n }\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Be.nn,"px;\n ")}),(function(e){return(null===e||void 0===e?void 0:e.selected)&&"\n background: ".concat((e.theme.background||U.Z.background).scrollbarThumbHover,";\n ")}),(function(e){return"undefined"!==typeof e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return"undefined"!==typeof e.top&&"\n top: ".concat(e.top,"px;\n ")})),di=t(74052),vi=t(61709);function pi(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 fi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var hi=function(e){var n,t,i=e.blocks,r=e.columnIndex,l=e.columns,u=e.disabled,c=e.eventNameRefsMapping,s=e.invisible,a=e.mainContainerRect,d=e.rightAligned,v=e.scrollTogether,f=e.setCursorHeight,h=(0,p.useRef)(null),m=(0,p.useRef)(null),g=((0,p.useMemo)((function(){return null===i||void 0===i?void 0:i.map((function(e){return e.uuid}))}),[i]),(0,p.useState)(null)),b=g[0],x=g[1],j=(0,p.useState)(null),k=j[0],Z=j[1],y=(0,p.useState)(null),P=(y[0],y[1]),C=(0,p.useState)(null),O=C[0],w=C[1],_=a||{},I=_.height,E=_.width,T=_.x,M=_.y,B=(0,p.useMemo)((function(){return(0,L.Sm)(b||[])}),[b]),D=(0,p.useCallback)((function(){return B>I?I*(I/B):0}),[I,B]),A=(0,p.useMemo)((function(){return D()}),[D]);(0,p.useMemo)((function(){f(A)}),[A,f]);var R=(0,p.useCallback)((function(e){if(A){var n,t,i=null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y;e<=i?e=i:e+A>=M+I&&(e=M+I-A),null!==h&&void 0!==h&&h.current&&(h.current.style.top="".concat(e,"px"))}}),[A,I,h,M]),N=(0,p.useCallback)((function(){if(!u){var e=new CustomEvent(ci.m$,{detail:{columnScrolling:r,refCursor:h,refCursorContainer:m,refsMappings:Object.values(c||{})}});window.dispatchEvent(e)}}),[r,u,c]);(0,p.useEffect)((function(){P(!0)}),[]);var F=(0,p.useCallback)((function(e){var n,t,i=e.blockIndex,o=e.heights,r=e.y,l=null===m||void 0===m||null===(n=m.current)||void 0===n?void 0:n.getBoundingClientRect(),u=null===h||void 0===h||null===(t=h.current)||void 0===t?void 0:t.getBoundingClientRect(),c=(0,L.Sm)((null===o||void 0===o?void 0:o.slice(0,i))||[]),s=(0,L.Sm)(o||[])||0,a=(0,vi.IT)(o,s,I);return(c-(r-(null===l||void 0===l?void 0:l.y)))/s/(1-a)*((null===l||void 0===l?void 0:l.height)-(null===u||void 0===u?void 0:u.height))+(null===l||void 0===l?void 0:l.y)}),[]),U=(0,p.useCallback)((function(){var e=Object.values(c||{}),n=null===i||void 0===i?void 0:i.map((function(n){var t=(0,di.zv)(n);return Math.max.apply(Math,(0,o.Z)(e.map((function(e){var n,i,o,r=null===e||void 0===e||null===(n=e.current)||void 0===n?void 0:n[t];return(null===r||void 0===r||null===(i=r.current)||void 0===i||null===(o=i.getBoundingClientRect())||void 0===o?void 0:o.height)||0}))))}));if(null!==n&&void 0!==n&&n.every((function(e){return"undefined"!==typeof e&&!isNaN(e)}))){if(x(n),k){var t=F(fi(fi({},k),{},{heights:n}));R(t)}N()}}),[i,F,r,N,c,k,x]);(0,p.useEffect)((function(){var e;return null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.addEventListener(e,U)})),function(){var e;null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.removeEventListener(e,U)}))}}),[c,U]);var H=(0,p.useCallback)((function(){N(),U()}),[N,U]);(0,p.useEffect)((function(){return window.addEventListener(ci.Qj,H),function(){window.removeEventListener(ci.Qj,H)}}),[H]),(0,p.useEffect)((function(){var e=function(e){var n,t,o=e.detail.block,r=null===i||void 0===i?void 0:i.findIndex((function(e){return e.uuid===(null===o||void 0===o?void 0:o.uuid)})),l=F({blockIndex:r,heights:b,y:null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y});R(l),N()};return window.addEventListener(ci.Em,e),function(){window.removeEventListener(ci.Em,e)}}),[i,F,N,b,R]),(0,p.useEffect)((function(){u||U()}),[u,v,U]),(0,p.useEffect)((function(){var e=function(e){var n=e.detail;if(r===(null===n||void 0===n?void 0:n.columnIndex)){var t=F(fi(fi({},n),{},{heights:b}));R(t),N(),null!==n&&void 0!==n&&n.lockScroll&&Z(n)}};return window.addEventListener(ci.Wf,e),function(){window.removeEventListener(ci.Wf,e)}}),[r,I,b,Z,R,F,M]);var W=(0,p.useCallback)((function(e){var n=e.pageX,t=e.pageY;if(n>=T&&n<=T+E&&t>=M&&t<=M+I){var i=E/l;if(v||n>=T+i*r&&n<T+i*(r+1)){var o,u=null===h||void 0===h||null===(o=h.current)||void 0===o?void 0:o.getBoundingClientRect(),c=((null===u||void 0===u?void 0:u.y)||0)+((null===e||void 0===e?void 0:e.deltaY)||0);R(c),N(),Z(null)}}}),[r,l,N,I,v,R,E,T,M]),G=(0,p.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(O||null!=n){var t;e&&(null===e||void 0===e||e.preventDefault());if(null===n){var i,o=null===O||void 0===O?void 0:O.scrollTop,r=null===O||void 0===O||null===(i=O.event)||void 0===i?void 0:i.clientY;t=o+((null===e||void 0===e?void 0:e.clientY)-r)}else t=n;R(t),N(),Z(null)}}),[N,O,R]);return(0,p.useEffect)((function(){var e,n;R(null===h||void 0===h||null===(e=h.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.y)}),[I,R]),(0,p.useEffect)((function(){var e=function(){w(null)};return A&&(window.addEventListener("mousemove",G),window.addEventListener("wheel",W),window.addEventListener("mouseup",e)),function(){window.removeEventListener("mousemove",G),window.removeEventListener("wheel",W),window.removeEventListener("mouseup",e)}}),[A,G,W]),(0,S.jsx)(si,{height:I,invisible:s,left:d?T+E-Be.nn:void 0,ref:m,children:(0,S.jsx)(ai,{height:A,invisible:s,onMouseDown:function(e){var n,t;return w({event:e,scrollTop:null===h||void 0===h||null===(n=h.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})},ref:h,selected:!!O,top:null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})})},mi=t(53779);var gi=function(e){var n=e.blocks,t=e.children,i=(e.dbtModelName,e.onClose),o=(e.setDbtModelName,(0,p.useState)(!1)),r=(o[0],o[1],(0,p.useState)(null));return r[0],r[1],(0,p.useMemo)((function(){return(0,L.HK)(n,(function(e){return e.configuration.file_path}))}),[n]),(0,S.jsxs)(mi.eD,{children:[(0,S.jsxs)(mi.X$,{children:[(0,S.jsx)(Z.Z,{alignItems:"center",children:(0,S.jsx)(O.ZP,{disableWordBreak:!0,monospace:!0,children:"Select dbt model or snapshot file"})}),(0,S.jsx)(be.ZP,{iconOnly:!0,onClick:i,children:(0,S.jsx)(N.Close,{muted:!0})})]}),(0,S.jsx)(mi.C,{children:t})]})},bi=t(39457);function xi(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 ji(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ki="4px",Zi={lightBackground:!0,muted:!0,relativePosition:!0},yi=[Rn.Zj.BIGQUERY,Rn.Zj.DELTA_LAKE_S3];var Pi=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,o=e.isLoadingUpdateDestinationBlockState,u=e.loadSampleData,c=e.source,s=e.stream,a=e.streams,d=e.updateAllStreams,v=e.updateDestinationBlockState,f=e.updateMetadataForColumns,h=e.updateSchemaProperty,m=e.updateStream,g=(0,p.useRef)(null),b=s.bookmark_properties,j=s.destination_table,k=void 0===j?"":j,P=s.key_properties,_=s.metadata,I=s.partition_keys,E=s.replication_method,T=s.run_in_parallel,M=s.schema.properties,B=s.tap_stream_id,D=s.unique_constraints,N=s.unique_conflict_method,F=(0,p.useState)(k),U=F[0],H=F[1],W=(0,p.useState)(!1),K=W[0],z=W[1],q=(0,p.useState)(null),V=q[0],Y=q[1],Q=(0,p.useState)(!!t),X=Q[0],J=Q[1],$=(0,p.useState)((0,l.Z)({},B,n||{})),ee=$[0],ne=$[1],te=(0,Qt.Z)(B);(0,p.useEffect)((function(){te!==B&&(H(k),Y(null))}),[k,E,B,te,N]),(0,p.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[B];(null===b||void 0===b?void 0:b.length)>0&&((0,Tn.Qr)(e)||!(0,Tn.Xy)(n,e))&&ne((function(e){return ji(ji({},e),{},(0,l.Z)({},B,n))}))}),[null===b||void 0===b?void 0:b.length,n,B]);var ie=(0,p.useMemo)((function(){return(0,L.HK)(_,(function(e){return e.breadcrumb.join("/")}))}),[_]),oe=(0,p.useMemo)((function(){var e;return null===(e=(0,L.sE)(_,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[_]),re=(0,p.useMemo)((function(){return oe[Rn.fe.KEY_PROPERTIES]||[]}),[oe]),le=(0,p.useMemo)((function(){return oe[Rn.fe.REPLICATION_KEYS]||[]}),[oe]),ue=yi.includes(t),ce=a.length>1,se=(0,p.useCallback)((function(e){var n=ji({},null===ee||void 0===ee?void 0:ee[B]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return ji(ji({},e),{},(0,l.Z)({},B,ji({},n)))})),v({block:{bookmark_values:n,destination_table:U,tap_stream_id:B}})}),[ee,U,B,v]),ae=(0,p.useMemo)((function(){var e=[],n=[],i=(0,L.mr)(Object.entries(M)).map((function(i,o){var l=(0,r.Z)(i,2),u=l[0],c=l[1],s=c.anyOf,a=void 0===s?[]:s,v=c.format,p=c.type,g=void 0===p?[]:p,j=new Set(Array.isArray(g)?g:[g]),k=new Set(j);a.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){j.add(e),k.add(e)})):(j.add(t),k.add(t),n&&k.add(n))}));var _=Array.from(j);v&&k.add(v);var E=(ie["properties/".concat(u)]||{}).metadata,T=(E.inclusion,E.selected);e.push(T),n.push(u);var M=Rn.D5.reduce((function(e,n){return _.indexOf(n)>=0||Rn.Xv===String(n)&&Rn.zS.DATE_TIME===v||Rn.zS.UUID===String(n)&&Rn.zS.UUID===v?e:e.concat((0,S.jsx)("option",{value:n,children:n},n))}),[]),A=_.findIndex((function(e){return e===Rn.RL.STRING})),R=[(0,S.jsx)(x.Z,{checked:T,onClick:function(){f(B,[u],{selected:!T})}},"".concat(B,"/").concat(u,"/selected")),(0,S.jsx)(O.ZP,{children:u},"".concat(B,"/").concat(u,"/name")),(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:_.map((function(e,n){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{border:!0,label:v&&Rn.RL.STRING===e&&A===n?Rn.eL[v]:e,onClick:function(){var n={format:v,type:_.filter((function(n){return n!==e}))};Rn.zS.DATE_TIME!==v&&Rn.zS.UUID!==v||Rn.RL.STRING!==e||(n.format=null),h(B,u,n)},small:!0})},"".concat(B,"/").concat(u,"/").concat(e,"/").concat(n,"/chip"))}))})}),M.length>=1&&(0,S.jsxs)(an.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:v,type:_};Rn.Xv===String(n)?(t.format=Rn.zS.DATE_TIME,t.type.push(Rn.RL.STRING)):Rn.zS.UUID===String(n)?(t.format=Rn.zS.UUID,t.type.push(Rn.RL.STRING)):t.type.push(n),h(B,u,t)},primary:!0,small:!0,value:"",width:10*w.iI,children:[(0,S.jsx)("option",{value:""}),M]})]},"".concat(B,"/").concat(u,"/type")),(0,S.jsx)(x.Z,{checked:!(null===D||void 0===D||!D.includes(u)),disabled:re.length>=1&&!re.includes(u),onClick:re.length>=1&&!re.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(u)?e.unique_constraints=(0,L.Od)(e.unique_constraints,(function(e){return u===e})):e.unique_constraints=[u].concat(e.unique_constraints||[]),e}))}},"".concat(B,"/").concat(u,"/unique")),(0,S.jsx)(x.Z,{checked:!(null===b||void 0===b||!b.includes(u)),disabled:le.length>=1&&!le.includes(u),onClick:le.length>=1&&!le.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(u)?(se(u),e.bookmark_properties=(0,L.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),e}))}},"".concat(B,"/").concat(u,"/bookmark")),(0,S.jsx)(x.Z,{checked:!(null===P||void 0===P||!P.includes(u)),onClick:function(){return m(B,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(u)?e.key_properties=(0,L.Od)(e.key_properties,(function(e){return u===e})):e.key_properties=[u].concat(e.key_properties||[]),e}))}},"".concat(B,"/").concat(u,"/key_property"))];if(ue){var N=t!==Rn.Zj.DELTA_LAKE_S3,F=N&&(re.includes(u)||!k.has(Rn.zS.DATE_TIME));R.push((0,S.jsx)(x.Z,{checked:!(null===I||void 0===I||!I.includes(u)),disabled:F,onClick:F?null:function(){return m(B,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(u)?e.partition_keys=(0,L.Od)(e.partition_keys,(function(e){return u===e})):N&&1===(null===(t=e.partition_keys)||void 0===t?void 0:t.length)?e.partition_keys=[u]:e.partition_keys=[u].concat(e.partition_keys||[]);return e}))}},"".concat(B,"/").concat(u,"/partition_key")))}if(ce){var U=V===o;R.push((0,S.jsx)(be.ZP,{compact:!0,disabled:U,onClick:function(){Y(o),setTimeout((function(){return Y(null)}),2e3),d((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==B&&null!==e&&void 0!==e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[u]){var i,o,r,l,c,s,a,d,p;e.schema.properties[u]={format:v||null,type:_};var f=null===(i=(0,L.sE)((null===e||void 0===e?void 0:e.metadata)||[],(function(e){return 0===e.breadcrumb.length})))||void 0===i?void 0:i.metadata,h=f[Rn.fe.REPLICATION_KEYS]||[],m=f[Rn.fe.KEY_PROPERTIES]||[];null===D||void 0===D||!D.includes(u)||null!==e&&void 0!==e&&null!==(o=e.unique_constraints)&&void 0!==o&&o.includes(u)||!m.includes(u)?null!==D&&void 0!==D&&D.includes(u)||null===e||void 0===e||null===(r=e.unique_constraints)||void 0===r||!r.includes(u)||(e.unique_constraints=(0,L.Od)(e.unique_constraints,(function(e){return u===e}))):e.unique_constraints=[u].concat(e.unique_constraints||[]),null===b||void 0===b||!b.includes(u)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(u)||!h.includes(u)&&0!==h.length?null!==b&&void 0!==b&&b.includes(u)||null===e||void 0===e||null===(c=e.bookmark_properties)||void 0===c||!c.includes(u)||(e.bookmark_properties=(0,L.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),null===P||void 0===P||!P.includes(u)||null!==e&&void 0!==e&&null!==(s=e.key_properties)&&void 0!==s&&s.includes(u)?null!==P&&void 0!==P&&P.includes(u)||null===e||void 0===e||null===(a=e.key_properties)||void 0===a||!a.includes(u)||(e.key_properties=(0,L.Od)(e.key_properties,(function(e){return u===e}))):e.key_properties=[u].concat(e.key_properties||[]),null===I||void 0===I||!I.includes(u)||null!==e&&void 0!==e&&null!==(d=e.partition_keys)&&void 0!==d&&d.includes(u)?null!==I&&void 0!==I&&I.includes(u)||null===e||void 0===e||null===(p=e.partition_keys)||void 0===p||!p.includes(u)||(e.partition_keys=(0,L.Od)(e.partition_keys,(function(e){return u===e}))):e.partition_keys=[u].concat(e.partition_keys||[])}return ji({},e)}))},pill:!0,secondary:!0,children:(0,S.jsx)(O.ZP,{success:U,children:U?"Applied!":"Apply"})}))}return R})),o=e.every((function(e){return e})),l=[null,2,1,null,null,null],u=[{label:function(){return(0,S.jsx)(x.Z,{checked:o,onClick:function(){f(B,n,{selected:!o})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to avoid adding duplicate records",uuid:"Unique"},{tooltipMessage:"Used to keep track of sync progress and incrementally sync new records (e.g. a column indicating when a record was last updated)",tooltipWidth:305,uuid:"Bookmark"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to create primary key for destination table",uuid:"Key prop"}];return ue&&(l.push(null),u.push({uuid:"Partition key"})),ce&&(l.push(null),u.push({tooltipMessage:"This will apply this individual feature's schema settings to all selected streams that have the same feature. Unique features must be valid key properties in other streams. Bookmark features must be valid replication keys in other streams.",uuid:"All streams"})),(0,S.jsx)(kn.cl,{children:(0,S.jsx)(R.Z,{alignTop:!0,columnFlex:l,columns:u,rows:i,stickyHeader:!0})})}),[b,t,ce,V,P,ie,I,M,se,ue,B,D,d,f,h,m,re,le]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,S.jsx)(A.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:B})," schema"]}),(0,S.jsx)(C.Z,{mb:3,children:(0,S.jsx)(Dt.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{children:"Destination table name"}),(0,S.jsx)(C.Z,{ml:ki}),(0,S.jsx)(An.Z,ji(ji({},Zi),{},{label:(0,S.jsxs)(O.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:B}),". To change the table name, enter in a different value."]})})),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(Ee.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;H(n),clearTimeout(g.current),g.current=setTimeout((function(){m(B,(function(e){return ji(ji({},e),{},{destination_table:n})}))}),300)},value:U||"",width:45*w.iI})]})})}),(0,S.jsx)(C.Z,{mb:3,children:(0,S.jsx)(Dt.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{children:"Replication method"}),(0,S.jsx)(C.Z,{ml:ki}),(0,S.jsx)(An.Z,ji(ji({},Zi),{},{label:(0,S.jsxs)(O.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.INCREMENTAL}),")?",c===Rn.th.POSTGRESQL&&(0,S.jsxs)(O.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]})})),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsxs)(an.Z,{compact:!0,onChange:function(e){m(B,(function(n){return ji(ji({},n),{},{replication_method:e.target.value})}))},primary:!0,value:E,children:[(0,S.jsx)("option",{value:""}),Object.values(Rn._B).filter((function(e){return c===Rn.th.POSTGRESQL||e!==Rn._B.LOG_BASED})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))]}),(0,S.jsx)(C.Z,{ml:3}),(0,S.jsx)(O.ZP,{children:"Unique conflict method"}),(0,S.jsx)(C.Z,{ml:ki}),(0,S.jsx)(An.Z,ji(ji({},Zi),{},{label:(0,S.jsxs)(O.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,G._6)("unique column",null===D||void 0===D?void 0:D.length),(null===D||void 0===D?void 0:D.length)>0&&(0,S.jsx)(S.Fragment,{children:"\xa0"}),null===D||void 0===D?void 0:D.sort().map((function(e,n){return(0,S.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===D||void 0===D?void 0:D.length)&&n===(null===D||void 0===D?void 0:D.length)-1?(0,S.jsx)(O.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]})})),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsxs)(an.Z,{compact:!0,inputWidth:11*w.iI,onChange:function(e){m(B,(function(n){return ji(ji({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:N,children:[(0,S.jsx)("option",{value:""}),(0,S.jsx)("option",{value:Rn.MU.IGNORE,children:Rn.MU.IGNORE}),(0,S.jsx)("option",{value:Rn.MU.UPDATE,children:Rn.MU.UPDATE})]})]}),ce&&(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{default:!0,children:"All streams"}),(0,S.jsx)(C.Z,{ml:ki}),(0,S.jsx)(An.Z,ji(ji({},Zi),{},{appearBefore:!0,label:(0,S.jsx)(O.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."})})),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(be.ZP,{compact:!0,disabled:K,onClick:function(){z(!0),setTimeout((function(){return z(!1)}),2e3),d((function(e){return ji(ji({},e),{},{replication_method:E,unique_conflict_method:N})}))},pill:!0,secondary:!0,children:(0,S.jsx)(O.ZP,{bold:!K,success:K,children:K?"Applied!":"Apply"})})]})]})})}),(0,S.jsx)(Dt.Z,{headerTitle:"Features",noPadding:!0,children:ae}),(0,S.jsx)(C.Z,{mt:2,children:(0,S.jsx)(be.ZP,{loading:i,onClick:function(){return u(B)},primary:!0,small:!0,children:"Load sample data"})}),(0,S.jsxs)(C.Z,{mt:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,S.jsx)(C.Z,{mb:5,children:(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,S.jsx)(O.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(Dn.Z,{checked:T,onCheck:function(){return m(B,(function(e){return e.run_in_parallel=!T,e}))}},"".concat(B,"/run_in_parallel"))]})}),Rn._B.INCREMENTAL===E&&(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,S.jsx)(O.ZP,{default:!0,children:"After each integration pipeline run, the last record that was successfully synchronized will be used as the bookmark. The properties listed below will be extracted from the last record and used as the bookmark. On the next run, the synchronization will start from the bookmarked record."})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==b&&void 0!==b&&b.length)&&(0,S.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===b||void 0===b?void 0:b.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){se(e),m(B,(function(n){return ji(ji({},n),{},{bookmark_properties:(0,L.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===b||void 0===b?void 0:b.length)>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{my:2,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(C.Z,{mr:2,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),!t&&(0,S.jsx)(O.ZP,{default:!0,children:'In order to overwrite the bookmark values for the next sync, you must first select a destination. Then you will be able to edit the bookmark property values in the table below. Click the "Save" button to save your changes.'}),t&&(0,S.jsx)(O.ZP,{default:!0,children:'This will temporarily overwrite the bookmark value for the next pipeline run. After editing any bookmark values below, you must click the "Save" button in the table header in order to persist and save your changes.'})]}),(0,S.jsx)(Dn.Z,{checked:X,disabled:!t,onCheck:function(){return J((function(e){return!e}))}})]})}),X&&!!t&&(0,S.jsx)(Dt.Z,{header:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,S.jsx)(be.ZP,{compact:!0,loading:o,onClick:function(){v({block:{bookmark_values:(null===ee||void 0===ee?void 0:ee[B])||{},destination_table:U,tap_stream_id:B}})},pill:!0,primary:!0,children:"Save"})]}),headerPaddingVertical:w.iI,noPadding:!0,overflowVisible:!0,children:(0,S.jsx)(R.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Feature"},{uuid:"Current bookmark value"}],rows:b.map((function(e){var n;return[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,children:e},e),(0,S.jsx)(Ee.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return ji(ji({},t),{},(0,l.Z)({},B,ji(ji({},t[B]),{},(0,l.Z)({},e,n.target.value||null))))}))},paddingHorizontal:0,placeholder:"Enter value (optional)",value:null===ee||void 0===ee||null===(n=ee[B])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),ce&&(null===b||void 0===b?void 0:b.length)>0&&(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Valid replication keys"}),(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"If a stream's schema specifies its valid replication keys and a feature is not a valid replication key, that feature will not be set as a bookmark property when applying the feature (from a different stream) as a bookmark to all streams.\xa0"}),le.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"These are the valid replication keys for this stream:"}),"\xa0",(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,small:!0,children:[le.join(", "),"."]})]}),0===le.length&&(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"This stream did not specify any valid replication keys, so all features can be used as bookmark properties."})]}),(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,S.jsx)(O.ZP,{default:!0,children:"Multiple records (e.g. 2 or more) with the same values in the columns listed below will be considered duplicates."})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==D&&void 0!==D&&D.length)&&(0,S.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===D||void 0===D?void 0:D.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){m(B,(function(n){return ji(ji({},n),{},{unique_constraints:(0,L.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,S.jsx)(O.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==P&&void 0!==P&&P.length)&&(0,S.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===P||void 0===P?void 0:P.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){m(B,(function(n){return ji(ji({},n),{},{key_properties:(0,L.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ue&&(0,S.jsxs)(C.Z,{mb:3,children:[(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,S.jsx)(O.ZP,{default:!0,children:"One datetime column can be used to partition the table. (Note: Partition keys currently only work with BigQuery destinations. Support for other destinations is WIP.)"})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==I&&void 0!==I&&I.length)&&(0,S.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===I||void 0===I?void 0:I.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){m(B,(function(n){return ji(ji({},n),{},{partition_keys:(0,L.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Ci=["catalog","pipeline","setErrors","setSelectedStream"];function Oi(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 wi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Oi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Oi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _i,Si=function(e){var n,t=e.catalog,i=e.pipeline,o=e.setErrors,l=e.setSelectedStream,u=(0,Sn.Z)(e,Ci),c=(0,p.useState)(null),s=c[0],a=c[1],d=(0,p.useMemo)((function(){return(null===t||void 0===t?void 0:t.streams)||[]}),[t]),v=(0,p.useMemo)((function(){return(0,L.YC)(d,"stream").map((function(e){return{uuid:e.stream}}))}),[d]),h=(0,p.useMemo)((function(){return(0,L.HK)(d,(function(e){return e.stream}))}),[d]),m=(0,p.useMemo)((function(){return h[null===s||void 0===s?void 0:s.uuid]}),[s,h]),g=(0,p.useMemo)((function(){return(0,L.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return b.tf.DATA_EXPORTER===n}))}),[null===i||void 0===i?void 0:i.blocks]),x=m||{},j=x.destination_table,k=x.tap_stream_id,Z=!(!k||!j),y=Y.ZP.blocks.pipelines.detail(Z?null===i||void 0===i?void 0:i.uuid:null,Z?null===g||void 0===g?void 0:g.uuid:null,{destination_table:j,state_stream:k}),P=y.data,w=y.mutate,_=null===P||void 0===P||null===(n=P.block)||void 0===n?void 0:n.bookmarks,I=(0,f.Db)(Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===i||void 0===i?void 0:i.uuid),encodeURIComponent(null===g||void 0===g?void 0:g.uuid),{query:{update_state:!0}}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){null===w||void 0===w||w()},onErrorCallback:function(e,n){return null===o||void 0===o?void 0:o({errors:n,response:e})}})}}),E=(0,r.Z)(I,2),T=E[0],M=E[1].isLoading;(0,p.useEffect)((function(){v.length>0&&(s&&(0,L.sE)(v,(function(e){var n=e.uuid;return s.uuid===n}))||a(v[0]))}),[s,a,v]);var B=(0,p.useMemo)((function(){var e=[{uuid:"Stream"},{uuid:"Columns Selected"},{uuid:"Replication Method"},{uuid:"Destination Table"},{uuid:"Bookmark Props"},{uuid:"Key Props"},{uuid:"Unique Constraints"},{uuid:"Unique Conflict Method"},{uuid:"Partition Keys"}];return(0,S.jsx)(kn.cl,{children:(0,S.jsx)(R.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:d.map((function(e){var n=e.replication_method,t=e.destination_table,i=e.bookmark_properties,o=e.key_properties,r=e.metadata,l=e.unique_constraints,u=e.unique_conflict_method,c=e.partition_keys,s=e.tap_stream_id,a=r.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,o=(null===t||void 0===t?void 0:t.length)>0,r=i&&o?1:0,l=o?1:0;return{selectedCount:e.selectedCount+r,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,S.jsx)(O.ZP,{children:"".concat(a.selectedCount," of ").concat(a.totalCount," total")},"".concat(s,"_col_selected")),v=[s,n,t,i,o,l,u,c].map((function(e,n){return(0,S.jsx)(O.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(s,"_cell_").concat(n))}));return v.slice(0,1).concat(d).concat(v.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[d]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ve.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){a(e),l(e.uuid)},selectedTabUUID:null===s||void 0===s?void 0:s.uuid,tabs:v}),m&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(kn.dE,{children:(0,S.jsx)(Pi,wi(wi({},u),{},{bookmarkValues:_,isLoadingUpdateDestinationBlockState:M,stream:m,streams:d,updateDestinationBlockState:T}))})}),d.length>=1&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(kn.dE,{children:[(0,S.jsx)(A.Z,{level:4,children:"Streams Summary"}),(0,S.jsx)(C.Z,{mt:1}),B]})})]})},Ii=t(46732);function Ei(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function Ti(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 Mi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ti(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ti(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.ALL="All",e.SELECTED="Selected",e.NOT_SELECTED="Not selected"}(_i||(_i={}));var Bi=45*w.iI,Di=Bi-4*w.iI;var Ai=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,o=e.streams,r=(0,L.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),u=(0,p.useMemo)((function(){var e=new Set(o.map((function(e){return e.stream})));return Object.values(r).filter((function(n){var t=n.stream;return!e.has(t)})).map((function(e){return Mi(Mi({},e),{},{isMissingStream:!0})}))}),[r,o]),c=Mi({},r);u.forEach((function(e){var n=e.stream;delete c[n]}));var s=(0,p.useState)(c),a=s[0],d=s[1],v=(0,p.useState)(null),f=v[0],h=v[1],m=(0,p.useState)(!1),g=m[0],b=m[1],j=(0,p.useState)(_i.ALL),Z=j[0],P=j[1],_=(0,p.useRef)(null),I=Ei(a),E=(0,p.useMemo)((function(){var e=o;return e=e.filter((function(e){var n=e.tap_stream_id;return Z===_i.SELECTED?I.includes(n):Z!==_i.NOT_SELECTED||!I.includes(n)})),f?e.filter((function(e){var n=e.tap_stream_id;return null===n||void 0===n?void 0:n.toLowerCase().includes(null===f||void 0===f?void 0:f.toLowerCase())})):e}),[Z,f,I,o]),T=(0,p.useMemo)((function(){return o.every((function(e){var n=e.stream;return!!a[n]}))}),[a,o]);return(0,S.jsxs)(Wn.Z,{children:[(0,S.jsx)(kn.cv,{rounded:!0,children:(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,S.jsx)(kn.cv,{padding:1.25*w.iI,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(Ee.Z,{beforeIcon:(0,S.jsx)(N.Search,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return h(e.target.value)},placeholder:"Search",value:f}),(0,S.jsx)(C.Z,{pr:1,children:(0,S.jsx)(Ii.Z,{items:[{label:function(){return _i.ALL},onClick:function(){return P(_i.ALL)},uuid:"all_streams"},{label:function(){return _i.SELECTED},onClick:function(){return P(_i.SELECTED)},uuid:"selected"},{label:function(){return _i.NOT_SELECTED},onClick:function(){return P(_i.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return b(!1)},onClickOutside:function(){return b(!1)},open:g,parentRef:_,uuid:"SelectStreams/filter",children:(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.Filter,{}),noBackground:!0,onClick:function(){return b((function(e){return!e}))},ref:_,children:(0,S.jsx)(O.ZP,{children:Z})})})})]})}),(0,S.jsx)(kn.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(Bi,"px"),children:(0,S.jsx)(R.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,S.jsx)(x.Z,{checked:T,onClick:function(){var e=(0,L.HK)(o||[],(function(e){return e.stream}));d(T?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:E.concat(u).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!a[t];return[(0,S.jsx)(x.Z,{checked:i,disabled:!i&&n,onClick:function(){d((function(n){return Mi(Mi({},n),{},(0,l.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,S.jsxs)(O.ZP,{danger:n,title:t,width:Bi-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,S.jsx)(k.Z,{medium:!0}),(0,S.jsxs)(C.Z,{p:2,children:[(null===I||void 0===I?void 0:I.length)>50&&(0,S.jsx)(C.Z,{pb:2,children:(0,S.jsxs)(O.ZP,{danger:!0,maxWidth:Di,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,S.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===o||void 0===o?void 0:o.length)&&(0,S.jsx)(C.Z,{pb:2,children:(0,S.jsx)(O.ZP,{bold:!0,maxWidth:Di,warning:!0,whiteSpaceNormal:!0,children:"If you can successfully connect to the data source but no streams are displayed, check if the user has proper database/schema permissions."})}),(0,S.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(be.ZP,{loading:t,onClick:function(){return i(a)},primary:!0,children:"Confirm ".concat(Ei(a).length," streams")})})]})]})};function Ri(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 Ni(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ri(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ri(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Li=function(e){var n=e.api,t=e.block,i=e.blockContent,o=e.onChangeCodeBlock,u=e.pipeline,c=(0,p.useState)(null),s=c[0],a=c[1];(0,p.useEffect)((function(){i&&!s&&a((0,xn.Pz)(null===i||void 0===i?void 0:i.config))}),[s,i]);var d=(0,p.useState)(null),v=d[0],h=d[1],m=(0,p.useState)(),g=m[0],x=m[1],j=(0,f.Db)(Y.ZP[n].useCreate(),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var t,i,o=(0,G.C5)(n);h(null===e||void 0===e||null===(t=e[o])||void 0===t?void 0:t.success),x(null===e||void 0===e||null===(i=e[o])||void 0===i?void 0:i.error_message)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),k=(0,r.Z)(j,2),Z=k[0],P=k[1].isLoading;return t?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(kn.$W,{children:(0,S.jsx)(xe.Z,{autoHeight:!0,language:b.t6.YAML,onChange:function(e){a(e),o(t.type,t.uuid,(0,xn.Pz)(Ni(Ni({},i),{},{config:(0,xn.Qc)(e)})))},tabSize:2,value:s||void 0,width:"100%"})}),(0,S.jsxs)(C.Z,{mt:1,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{onClick:function(){Z((0,l.Z)({},(0,G.C5)(n),{action_type:"test_connection",config:s,pipeline_uuid:u.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,S.jsx)(C.Z,{ml:1,children:P?(0,S.jsx)(ke.Z,{color:"white",small:!0}):(0,S.jsxs)(S.Fragment,{children:[v&&(0,S.jsx)(O.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===v&&(0,S.jsx)(O.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),g&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{small:!0,warning:!0,children:g})})]})]}):null},Fi=t(85385);function Ui(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 Hi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ui(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ui(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wi=function(e){var n,t,i,o=e.addNewBlockAtIndex,l=e.blocks,u=e.codeBlocks,c=e.fetchFileTree,s=e.fetchPipeline,a=e.fetchSampleData,d=e.globalVariables,v=e.onChangeCodeBlock,h=e.openSidekickView,m=e.pipeline,g=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,k=e.setOutputBlocks,Z=e.setSelectedBlock,_=e.setSelectedOutputBlock,I=e.setSelectedStream,E=(0,p.useState)(!0),T=E[0],M=E[1],B=(0,p.useState)(!0),D=B[0],F=B[1],U=(0,p.useState)(!0),H=U[0],W=U[1],G=(0,p.useState)(""),K=G[0],z=G[1],q=Y.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,V=(0,p.useMemo)((function(){return(null===q||void 0===q?void 0:q.integration_sources)||[]}),[q]),Q=(0,p.useMemo)((function(){return(0,L.HK)(V,(function(e){return e.uuid}))}),[V]),X=Y.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,J=(0,p.useMemo)((function(){return(null===X||void 0===X?void 0:X.integration_destinations)||[]}),[X]),$=(0,p.useMemo)((function(){return(0,L.HK)(J,(function(e){return e.uuid}))}),[J]),ee=(0,p.useMemo)((function(){return(0,L.sE)(l,(function(e){var n=e.type;return b.tf.DATA_LOADER===n}))}),[l]),ne=(0,p.useMemo)((function(){return ee?(0,xn.Qc)(ee.content):{}}),[ee]);(0,p.useEffect)((function(){var e;null!==ne&&void 0!==ne&&ne.source&&z(null===(e=Q[ne.source])||void 0===e?void 0:e.docs)}),[Q,ne]);var te=(0,p.useMemo)((function(){return(0,S.jsx)(Li,{api:"integration_sources",block:ee,blockContent:ne,onChangeCodeBlock:v,pipeline:m})}),[ee,ne,v,m]),ie=(0,p.useMemo)((function(){return(0,L.sE)(l,(function(e){var n=e.type;return b.tf.DATA_EXPORTER===n}))}),[l]),oe=(0,p.useMemo)((function(){return ie?(0,xn.Qc)(ie.content):{}}),[ie]),re=(0,p.useMemo)((function(){return(0,S.jsx)(Li,{api:"integration_destinations",block:ie,blockContent:oe,onChangeCodeBlock:v,pipeline:m})}),[ie,oe,v,m]),le=(0,p.useMemo)((function(){return(0,L.sE)(l,(function(e){var n=e.type;return b.tf.TRANSFORMER===n}))}),[l]),ue=(0,p.useMemo)((function(){var e;return(0,Tn.Qr)(null===ne||void 0===ne?void 0:ne.catalog)?null===m||void 0===m||null===(e=m.data_integration)||void 0===e?void 0:e.catalog:null===ne||void 0===ne?void 0:ne.catalog}),[ne,null===m||void 0===m||null===(n=m.data_integration)||void 0===n?void 0:n.catalog]),ce=((null===ue||void 0===ue?void 0:ue.streams)||[]).every((function(e){return e.auto_add_new_fields})),se=((null===ue||void 0===ue?void 0:ue.streams)||[]).every((function(e){return e.disable_column_type_check})),ae=(0,Qt.Z)(ue);(0,p.useEffect)((function(){!ae&&ue&&(k((function(){return _(ee),[ee]})),j((function(e){var n;return e||(null===ue||void 0===ue||null===(n=ue.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[ue]);var de=(0,p.useState)(),ve=de[0],pe=de[1],fe=(0,f.Db)(Y.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];k((function(){return _(ee),[ee]})),t.length>0&&I(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),h(Fi.cH.DATA),a()}else pe(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),he=(0,r.Z)(fe,2),xe=he[0],je=he[1].isLoading,Ze=(0,f.Db)(Y.ZP.integration_sources.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,o=((null===ue||void 0===ue?void 0:ue.streams)||[]).filter((function(e){var n=e.tap_stream_id;return t.includes(n)})),r=o.map((function(e){return e.tap_stream_id})),l=i.filter((function(e){var n=e.tap_stream_id;return t.includes(n)&&!r.includes(n)}));l.forEach((function(e){e.metadata.forEach((function(n,t){var i=n.metadata;if(Rn.ks.UNSUPPORTED!==i.inclusion){var o;if(e.replication_method||(e.replication_method=Rn._B.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=Rn.MU.UPDATE),!e.destination_table)e.destination_table=null===e||void 0===e||null===(o=e.tap_stream_id)||void 0===o?void 0:o.replace(/\W+/g,"_");e.metadata[t]=Hi(Hi({},n),{},{metadata:Hi(Hi({},i),{},{selected:!0})})}}))}));var u={streams:o.concat(l)};j(He.map((function(e){return e.tap_stream_id})));var a=null===ne||void 0===ne?void 0:ne.catalog;(0,Tn.Qr)(a)||v(ee.type,ee.uuid,(0,xn.Pz)(Hi(Hi({},ne),{},{catalog:{}})));var d={pipeline:Hi(Hi({},m),{},{data_integration:Hi(Hi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:u})})};g(d).then((function(){s(),c()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),ye=(0,r.Z)(Ze,2),Ce=ye[0],Oe=ye[1].isLoading,we=(0,p.useState)(null),_e=we[0],Se=we[1],Ie=(0,f.Db)(Y.ZP.integration_source_streams.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){Se(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Ee=(0,r.Z)(Ie,2),Te=Ee[0],Me=Ee[1].isLoading,Be=(0,p.useCallback)((function(e,n){var t=function(e,n){var t,i=[];return e.streams.forEach((function(e){e.tap_stream_id===n?t=e:i.push(e)})),{stream:t,streams:i}}(ue,e),i=t.stream,o=t.streams,r=Hi(Hi({},ue),{},{streams:o.concat(n(i))}),l=null===ne||void 0===ne?void 0:ne.catalog;(0,Tn.Qr)(l)||v(ee.type,ee.uuid,(0,xn.Pz)(Hi(Hi({},ne),{},{catalog:{}})));var u={pipeline:Hi(Hi({},m),{},{data_integration:Hi(Hi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:r})})};g(u).then((function(){return s()}))}),[ue,ee,ne,s,v,m,g]),De=(0,p.useCallback)((function(e){if(null!==ue&&void 0!==ue&&ue.streams){var n=Hi(Hi({},ue),{},{streams:ue.streams.map((function(n){return e(n)}))}),t=null===ne||void 0===ne?void 0:ne.catalog;(0,Tn.Qr)(t)||v(ee.type,ee.uuid,(0,xn.Pz)(Hi(Hi({},ne),{},{catalog:{}})));var i={pipeline:Hi(Hi({},m),{},{data_integration:Hi(Hi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return s()}))}}),[ue,ee,ne,s,v,m,g]),Ae=(0,p.useCallback)((function(e,n,t){Be(e,(function(e){return e.schema.properties[n]=t,e}))}),[Be]),Re=(0,p.useCallback)((function(e,n,t){Be(e,(function(e){var i=e.metadata;return n.forEach((function(n){var o=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(o>=0){var r=i[o].metadata;e.metadata[o].metadata=Hi(Hi({},r),t)}})),e}))}),[Be]),Ne=(0,f.Db)(Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===m||void 0===m?void 0:m.uuid),encodeURIComponent(null===ie||void 0===ie?void 0:ie.uuid)),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){null===s||void 0===s||s()},onErrorCallback:function(e,n){return null===x||void 0===x?void 0:x({errors:n,response:e})}})}}),Le=(0,r.Z)(Ne,1)[0],Fe=(0,p.useMemo)((function(){var e=[];return null===d||void 0===d||d.forEach((function(n){var t=n.variables;return null===t||void 0===t?void 0:t.forEach((function(n){var t=n.uuid,i=n.value,o="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,S.jsx)(O.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,S.jsx)(O.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,S.jsx)(O.ZP,{monospace:!0,children:o},"variable-uuid-".concat(t,"-{value}-code")),(0,S.jsx)(bi.Z,{copiedText:o,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,S.jsx)(R.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[d]),Ue=(0,p.useCallback)((function(e){return(0,S.jsxs)(C.Z,{mt:2,children:[(0,S.jsxs)(O.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,S.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,S.jsx)("br",{}),"For more information, check out the ",(0,S.jsx)(P.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,S.jsx)(C.Z,{mt:1,children:Fe})]})}),[Fe]),He=(0,p.useMemo)((function(){return(null===_e||void 0===_e?void 0:_e.streams)||[]}),[_e]),We=(0,$t.dd)((function(){return(0,S.jsx)(Ai,{catalog:ue,isLoading:Oe,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)Ce({integration_source:{streams:n}}),ze();else{var t=null===ne||void 0===ne?void 0:ne.catalog;(0,Tn.Qr)(t)||v(ee.type,ee.uuid,(0,xn.Pz)(Hi(Hi({},ne),{},{catalog:{}}))),g({pipeline:Hi(Hi({},m),{},{data_integration:Hi(Hi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:null})})}).then((function(){return s()})),ze()}},streams:He})}),{},[ue,ee,ne,s,Oe,v,g,He],{background:!0,uuid:"select_streams"}),Ge=(0,r.Z)(We,2),Ke=Ge[0],ze=Ge[1];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[D&&(0,S.jsx)(N.ChevronUp,{size:1.5*w.iI}),!D&&(0,S.jsx)(N.ChevronDown,{size:1.5*w.iI})]})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{children:"Source"}),!D&&(0,S.jsxs)(A.Z,{default:!0,inline:!0,children:["\xa0",null===(t=Q[null===ne||void 0===ne?void 0:ne.source])||void 0===t?void 0:t.name]})]})]})}),D&&(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsxs)(kn.dE,{children:[(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===V||void 0===V?void 0:V.length)>0?(0,S.jsxs)(an.Z,{onChange:function(e){var n,t,i,r=e.target.value;if(r){z(null===(n=Q[r])||void 0===n?void 0:n.docs);var l=null===(t=Q[r])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;l&&Object.keys(l).forEach((function(e){l[e]=l[e]||null})),ee?v(ee.type,ee.uuid,(0,xn.Pz)(Hi(Hi({},ne),{},{catalog:{},config:l,source:r}))):o({content:(0,xn.Pz)({config:l,source:r}),language:b.t6.YAML,type:b.tf.DATA_LOADER},0,Z),Se(null),g().then((function(){s()}))}},primary:!0,value:null===ne||void 0===ne?void 0:ne.source,children:[(0,S.jsx)("option",{value:""}),V.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ke.Z,{inverted:!0}),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(A.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ee&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===ne||void 0===ne?void 0:ne.source)&&K&&(0,S.jsxs)(C.Z,{mb:2,children:[(0,S.jsx)(me.Z,{children:(0,S.jsx)(ge.Z,{title:"Documentation: ".concat(ne.source),children:(0,S.jsx)(kn.zG,{children:(0,S.jsx)(wn.Z,{children:K.replace(/\<br \/\>/g,"\n\n")})})})}),Ue("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),te]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,S.jsx)(be.ZP,{loading:Me,onClick:function(){g().then((function(){Te().then((function(){return Ke()})),s()}))},primary:!0,small:!0,children:"View and select streams"})]}),ve&&(0,S.jsx)(O.ZP,{warning:!0,children:ve})]})]}),Oe&&(0,S.jsx)(C.Z,{p:2,children:(0,S.jsx)(ke.Z,{})}),!Oe&&(0,S.jsx)(C.Z,{mt:3,children:(0,S.jsx)(Si,{catalog:ue,destination:null===oe||void 0===oe?void 0:oe.destination,isLoadingLoadSampleData:je,loadSampleData:function(e){return xe({integration_source:{action_type:"sample_data",pipeline_uuid:null===m||void 0===m?void 0:m.uuid,streams:[e]}})},pipeline:m,setErrors:x,setSelectedStream:I,source:null===ne||void 0===ne?void 0:ne.source,updateAllStreams:De,updateMetadataForColumns:Re,updateSchemaProperty:Ae,updateStream:Be})})]}),(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{disabled:!ee,iconOnly:!0,onClick:function(){return W((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[H&&ee&&(0,S.jsx)(N.ChevronUp,{size:1.5*w.iI}),(!H||!ee)&&(0,S.jsx)(N.ChevronDown,{disabled:!ee,size:1.5*w.iI})]})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(A.Z,{children:"Transformers"})})]})}),H&&ee&&(0,S.jsx)(C.Z,{mb:5,children:(0,S.jsxs)(kn.dE,{children:[u.length>0&&(0,S.jsx)(C.Z,{mb:1,children:u.map((function(e,n){return(0,S.jsx)(C.Z,{mb:1,children:e},n)}))}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(ui.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ee&&i.push(ee.uuid),o(Hi(Hi({},e),{},{configuration:t,content:n,upstream_blocks:i}),l.length-1,(function(e){ie&&(Le({block:Hi(Hi({},ie),{},{upstream_blocks:[e.uuid]})}),Z(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!le,hideTransformerDataSources:!0,pipeline:m})})]})}),(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{disabled:!ee,iconOnly:!0,onClick:function(){return M((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[T&&ee&&(0,S.jsx)(N.ChevronUp,{size:1.5*w.iI}),(!T||!ee)&&(0,S.jsx)(N.ChevronDown,{disabled:!ee,size:1.5*w.iI})]})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{children:"Destination"}),!T&&(0,S.jsxs)(A.Z,{default:!0,inline:!0,children:["\xa0",null===(i=$[null===oe||void 0===oe?void 0:oe.destination])||void 0===i?void 0:i.name]})]})]})}),T&&ee&&(0,S.jsxs)(kn.dE,{children:[(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===J||void 0===J?void 0:J.length)>0?(0,S.jsxs)(an.Z,{onChange:function(e){var n=e.target.value;if(n){if(ie)v(ie.type,ie.uuid,(0,xn.Pz)(Hi(Hi({},oe),{},{destination:n})));else{var t,i,r=null===(t=$[n])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;r&&(Object.keys(r).forEach((function(e){r[e]=r[e]||null})),r.hasOwnProperty("table")&&delete r.table);var u=[];if((null===l||void 0===l?void 0:l.length)>=2){var c=l.find((function(e){var n=e.uuid;return(null===ee||void 0===ee?void 0:ee.uuid)!==n}));c&&u.push(c.uuid)}else ee&&u.push(ee.uuid);o({content:(0,xn.Pz)({config:r,destination:n}),language:b.t6.YAML,type:b.tf.DATA_EXPORTER,upstream_blocks:u},1,Z)}g().then((function(){s()}))}},primary:!0,value:null===oe||void 0===oe?void 0:oe.destination,children:[(0,S.jsx)("option",{value:""}),J.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ke.Z,{inverted:!0}),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(A.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),ie&&(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===oe||void 0===oe?void 0:oe.destination)&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(C.Z,{mb:2,children:[(0,S.jsxs)(O.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,S.jsxs)(P.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(oe.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[oe.destination," documentation"]}),".",(0,S.jsx)("br",{}),(0,S.jsx)("br",{}),"If your configuration contains a key named ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,S.jsx)("br",{}),"The table that\u2019s created in this destination will have a name corresponding to the stream\u2019s unique name (by default) or the value you entered under the input field labeled ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Ue("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),re,(0,S.jsx)(C.Z,{mt:3,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(C.Z,{mr:2,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(O.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})]}),(0,S.jsx)(Dn.Z,{checked:!!ce,disabled:!(null!==ue&&void 0!==ue&&ue.streams),onCheck:function(){return De((function(e){return Hi(Hi({},e),{},{auto_add_new_fields:!ce})}))}})]})}),(0,S.jsx)(C.Z,{mt:3,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(C.Z,{mr:2,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsxs)(O.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,S.jsx)("br",{}),"If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped.",(0,S.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,S.jsx)(Dn.Z,{checked:!!se,disabled:!(null!==ue&&void 0!==ue&&ue.streams),onCheck:function(){return De((function(e){return Hi(Hi({},e),{},{disable_column_type_check:!se})}))}})]})})]})]})]})},Gi=t(82359),Ki=t(68192),zi=t(19698),qi=t(97133),Vi=t(35058),Yi=t(68791),Qi=t(38399),Xi=t(33834);function Ji(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 $i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ji(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ji(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var eo=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.afterHidden,u=e.allBlocks,c=e.allowCodeBlockShortcuts,s=e.anyInputFocused,a=e.autocompleteItems,d=e.beforeHidden,v=e.blockInteractionsMapping,h=e.blockRefs,m=e.blocks,g=void 0===m?[]:m,x=e.blocksThatNeedToRefresh,j=e.dataProviders,k=e.deleteBlock,Z=e.disableShortcuts,y=e.fetchFileTree,I=e.fetchPipeline,E=e.fetchSampleData,T=(e.files,e.globalDataProducts),M=e.globalVariables,B=e.hiddenBlocks,D=e.interactionsMapping,A=e.interruptKernel,R=e.mainContainerRef,N=e.mainContainerWidth,F=e.messages,U=e.onChangeCallbackBlock,H=e.onChangeCodeBlock,W=e.openSidekickView,G=e.pipeline,K=e.pipelineContentTouched,z=e.restartKernel,q=e.runBlock,V=e.runningBlocks,Q=void 0===V?[]:V,X=e.savePipelineContent,J=e.scrollTogether,$=e.selectedBlock,ee=e.setAnyInputFocused,ne=e.setDisableShortcuts,te=e.setEditingBlock,ie=e.setErrors,oe=e.setHiddenBlocks,re=e.setIntegrationStreams,le=e.setOutputBlocks,ue=e.setPipelineContentTouched,ce=e.setSelectedBlock,se=e.setSelectedOutputBlock,ae=e.setSelectedStream,de=e.setTextareaFocused,ve=e.setScrollTogether,pe=e.setSideBySideEnabled,fe=e.showBrowseTemplates,he=e.showBlockBrowserModal,me=e.showConfigureProjectModal,ge=e.showDataIntegrationModal,be=e.showGlobalDataProducts,xe=e.showUpdateBlockModal,je=e.sideBySideEnabled,ke=e.textareaFocused,Ze=e.widgets,ye=(0,yt.Z)(),Ce=ye.featureEnabled,Oe=ye.featureUUIDs,we=ye.project,_e=(0,zi.Z)().status,Se=(0,p.useRef)(null),Ie=(0,p.useRef)(null),Ee=(0,p.useRef)({}),Te=(0,p.useState)(!1),Me=Te[0],Be=Te[1],De=(0,p.useState)(!1),Ae=De[0],Re=De[1],Ne=(0,p.useState)(!1),Le=Ne[0],Fe=Ne[1],Ue=(0,p.useState)(!0),He=Ue[0],We=Ue[1],Ge=(0,p.useState)(!1),Ke=Ge[0],ze=Ge[1],Ve=(0,p.useState)(null),Ye=Ve[0],$e=Ve[1],en=(0,p.useState)(null),nn=en[0],rn=en[1],un=(0,p.useState)(!1),cn=un[0],an=un[1],dn=(0,p.useState)(""),vn=dn[0],pn=dn[1],fn=(0,p.useState)({height:null,width:null,x:null,y:null}),hn=fn[0],mn=fn[1],gn=(0,p.useMemo)((function(){return sn.qL.INTEGRATION===(null===G||void 0===G?void 0:G.type)}),[G]),bn=(0,p.useMemo)((function(){return sn.qL.STREAMING===(null===G||void 0===G?void 0:G.type)}),[G]),xn=(0,p.useMemo)((function(){return g.filter((function(e){var n=e.type;return!gn||b.tf.TRANSFORMER===n}))}),[g,gn]),jn=(0,p.useState)({}),kn=(jn[0],jn[1]),Zn=(0,Je.i)(),yn=Zn.height,Pn=Zn.width;(0,p.useEffect)((function(){var e;null!==R&&void 0!==R&&R.current&&mn(null===R||void 0===R||null===(e=R.current)||void 0===e?void 0:e.getBoundingClientRect())}),[i,d,R,N,mn,yn,Pn]);var Cn=(0,p.useMemo)((function(){return Q.reduce((function(e,n,t){return $i($i({},e),{},(0,l.Z)({},n.uuid,$i($i({},n),{},{priority:t})))}),{})}),[Q]),On=(0,p.useState)(null),wn=On[0],_n=On[1],Sn=(0,p.useMemo)((function(){return(0,S.jsx)(hi,{blocks:xn,columnIndex:0,columns:2,disabled:J,eventNameRefsMapping:(0,l.Z)({},ci.$e,h),invisible:!(null!==g&&void 0!==g&&g.length)||!wn||J,mainContainerRect:hn,scrollTogether:J,setCursorHeight:_n})}),[h,xn,wn,hn,J,_n]),In=(0,p.useState)(null),En=In[0],Mn=In[1],Bn=(0,p.useMemo)((function(){return(0,S.jsx)(hi,{blocks:xn,columnIndex:1,columns:2,disabled:J,eventNameRefsMapping:(0,l.Z)({},ci.tK,Ee),invisible:!(null!==g&&void 0!==g&&g.length)||!En||J,mainContainerRect:hn,rightAligned:!0,scrollTogether:J,setCursorHeight:Mn})}),[Ee,xn,En,hn,J,Mn]),Dn=(0,p.useState)(null),An=Dn[0],Rn=Dn[1],Nn=(0,p.useMemo)((function(){var e;return(0,S.jsx)(hi,{blocks:xn,columnIndex:2,columns:1,disabled:!J,eventNameRefsMapping:(e={},(0,l.Z)(e,ci.tK,Ee),(0,l.Z)(e,ci.$e,h),e),invisible:!(null!==g&&void 0!==g&&g.length)||!An||!J,mainContainerRect:hn,rightAligned:!0,scrollTogether:J,setCursorHeight:Rn})}),[Ee,h,xn,An,hn,J,Rn]),Ln=(0,Qt.Z)($),Fn=(0,p.useMemo)((function(){return g.length}),[g]),Un=(0,p.useMemo)((function(){return sn.qL.PYTHON===(null===G||void 0===G?void 0:G.type)&&(null===Ce||void 0===Ce?void 0:Ce(null===Oe||void 0===Oe?void 0:Oe.ADD_NEW_BLOCK_V2))}),[Ce,Oe,G]),Hn=Y.ZP.block_templates.list({show_all:!!Un},{revalidateOnFocus:!1}).data,Wn=(0,p.useMemo)((function(){return(null===Hn||void 0===Hn?void 0:Hn.block_templates)||[]}),[Hn]),Gn=(0,p.useCallback)((function(e,t){var i=g[g.length-1],o=null,r=e.configuration||{},l=i?(0,vi.eY)(i,e):[];i&&([b.tf.DATA_LOADER,b.tf.TRANSFORMER].includes(i.type)&&b.tf.SCRATCHPAD===e.type&&(o="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(G.uuid,"', '").concat(i.uuid,"', 'output_0')\n")),b.t6.SQL===i.language&&(r=$i($i({},(0,Tn.GL)(i.configuration,[Vi.cH,Vi.Sv,Vi.sc,Vi.BD,Vi.nq])),r))),b.t6.SQL===e.language&&(o=(0,Qi.SF)(o)),o=(0,Qi.X7)(e,o);var u=null!==t?t:Fn;n($i($i({},e),{},{configuration:r,content:o,upstream_blocks:l}),u,ce),de(!0)}),[n,g,Fn,G,ce,de]),Kn="PipelineDetail/index",zn=(0,Xe.y)(),qn=zn.disableGlobalKeyboardShortcuts,Vn=zn.registerOnKeyDown,Yn=zn.unregisterOnKeyDown;(0,p.useEffect)((function(){return function(){Yn(Kn)}}),[Yn,Kn]),Vn(Kn,(function(e,n,t){if(K&&(0,Qe.y)([qe.zX,qe.hS],n)){e.preventDefault();"undefined"!==typeof location&&window.confirm("You have changes that are unsaved. Click cancel and save your changes before reloading page.")&&location.reload()}if(!Z&&!qn)if((0,Qe.y)([qe.zX,qe.Um],n)||(0,Qe.y)([qe.PQ,qe.Um],n))e.preventDefault(),X();else if((0,Qe.y)([qe.zH],n)||(0,Qe.y)([qe.Fv],n)){if($&&!e.repeat&&!(0,Xi.cK)(e)){var i=g.findIndex((function(e){var n=e.uuid;return $.uuid===n}));if(-1!==i){var o=(0,Qe.y)([qe.zH],n)?i:i+1;Gn({type:b.tf.SCRATCHPAD},o)}}}else if(ke)n[qe.vP]?de(!1):K||qe.Z1.find((function(e){return n[e]}))||ue(!0);else if(!gn){var r;if(Un&&((0,Qe.y)([qe.zX,qe.A1],n)||(0,Qe.y)([qe.PQ,qe.A1],n)))e.preventDefault(),Re(!0),null===Ie||void 0===Ie||null===(r=Ie.current)||void 0===r||r.focus();else if(Un&&Ae&&(0,Qe.y)([qe.vP],n)){var l;e.preventDefault(),Re(!1),null===Ie||void 0===Ie||null===(l=Ie.current)||void 0===l||l.blur()}else if($){var u=g.findIndex((function(e){var n=e.uuid;return $.uuid===n}));if(n[qe.vP])ce(null);else if(t[0]===qe.xD&&t[1]===qe.xD)A();else if(t[0]===qe.l1&&t[1]===qe.l1&&-1!==u)k($).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){u===g.length-1?ce(g[u-1]):g.length>=0?ce(g[u+1]):ce(null)}),100)}));else if(n[qe.Bu]&&u>=1){var c=g[u-1];if(c){var a,d;ce(c);var v="".concat(c.type,"s/").concat(c.uuid,".py");null===(a=h.current[v])||void 0===a||null===(d=a.current)||void 0===d||d.scrollIntoView()}}else if(n[qe.kD]&&u<=Fn-2){var p=g[u+1];if(p){var f,m;ce(p);var x="".concat(p.type,"s/").concat(p.uuid,".py");null===(f=h.current[x])||void 0===f||null===(m=f.current)||void 0===m||m.scrollIntoView()}}else(0,Qe.y)([qe.Uq],n)&&de(!0)}else Ln&&n[qe.Uq]&&ce(Ln);s||t[0]!==qe.OC||t[1]!==qe.OC||z()}}),[n,s,h.current,g,Ae,A,gn,Fn,K,z,X,Ie,$,Ln,ue,ce,de,ke,Un]),(0,p.useEffect)((function(){var e=setInterval((function(){K&&X()}),1e4);return function(){clearInterval(e)}}),[K,X]),(0,p.useEffect)((function(){setTimeout((function(){return Fe(!0)}),2*qi.zn)}),[G]);var Qn=(0,f.Db)(Y.ZP.pipelines.useUpdate(encodeURIComponent(null===G||void 0===G?void 0:G.uuid)),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){null===I||void 0===I||I()},onErrorCallback:function(e,n){return null===ie||void 0===ie?void 0:ie({errors:n,response:e})}})}}),Xn=(0,r.Z)(Qn,2),Jn=Xn[0],$n=(Xn[1].isLoading,(0,f.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===G||void 0===G?void 0:G.uuid),encodeURIComponent(null===n||void 0===n?void 0:n.uuid))({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){I()},onErrorCallback:function(e,n){return null===ie||void 0===ie?void 0:ie({errors:n,response:e})}})}})),et=(0,r.Z)($n,1)[0],nt=(0,p.useCallback)((function(e){Be(!0),rn(e),ne(!0)}),[Be,ne,rn]),tt=(0,p.useCallback)((function(){Be(!1),an(!1),pn(""),ne(!1)}),[ne]),it=(0,p.useCallback)((function(e,n){var t,i;g.forEach((function(o,r){var l=o.uuid;t>=0&&i>=0||(l===e.uuid?t=r:l===n.uuid&&(i=r))}));var o=(0,L.oM)(g,i);return o=(0,L.Hk)(n,Math.max(t,0),o),X({pipeline:{blocks:o,uuid:null===G||void 0===G?void 0:G.uuid}})}),[g,G,X]),ot=(0,p.useMemo)((function(){return G&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ui.Z,{addNewBlock:Gn,blockIdx:Fn,blockTemplates:Wn,focusedAddNewBlockSearch:Ae,hideCustom:gn||bn,hideDataExporter:gn,hideDataLoader:gn,hideDbt:gn||bn,hideScratchpad:gn,hideSensor:gn,onClickAddSingleDBTModel:nt,pipeline:G,project:we,searchTextInputRef:Ie,setCreatingNewDBTModel:an,setFocusedAddNewBlockSearch:Re,showBlockBrowserModal:he,showBrowseTemplates:fe,showConfigureProjectModal:me,showGlobalDataProducts:be}),!Un&&!gn&&!bn&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,S.jsx)("br",{}),"Turn on the feature named ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:Gi.d.ADD_NEW_BLOCK_V2})," in your ",(0,S.jsx)(ri(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,S.jsx)(P.Z,{muted:!0,underline:!0,children:(0,S.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[Gn,Wn,Ae,gn,bn,Fn,nt,G,we,Ie,Re,he,fe,me,be,Un]);(0,p.useEffect)((function(){var e,n=function(){var e,n,t,i=((null===R||void 0===R||null===(e=R.current)||void 0===e||null===(n=e.getBoundingClientRect)||void 0===n?void 0:n.call(e))||{}).y;null===(t=Object.values((null===h||void 0===h?void 0:h.current)||{}))||void 0===t||t.forEach((function(e){var n,t,o,r;((null===e||void 0===e||null===(n=e.current)||void 0===n||null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n))||{}).y<=i?null!==e&&void 0!==e&&e.current&&(e.current.className=(0,Yi.b)((0,Yi.x)((null===e||void 0===e||null===(o=e.current)||void 0===o?void 0:o.className)||"",["enable-border-radius"]),["disable-border-radius"])):null!==e&&void 0!==e&&e.current&&(e.current.className=(0,Yi.b)((0,Yi.x)((null===e||void 0===e||null===(r=e.current)||void 0===r?void 0:r.className)||"",["disable-border-radius"]),["enable-border-radius"]))}))};return null===R||void 0===R||null===(e=R.current)||void 0===e||e.addEventListener("scroll",n),function(){var e;null===R||void 0===R||null===(e=R.current)||void 0===e||e.removeEventListener("scroll",n)}}),[]);var rt=(0,p.useRef)({}),lt=(0,p.useMemo)((function(){var e=[],i=(null===xn||void 0===xn?void 0:xn.length)||0;return xn.forEach((function(r,s){var d,f,m,P=s===i-1,C=r.type,O=r.uuid,w=(null===$||void 0===$?void 0:$.uuid)===O,E=Cn[O],M=E?0===E.priority?ii.uF.BUSY:ii.uF.QUEUED:ii.uF.IDLE,L=(0,di.zv)({type:C,uuid:O});(d=Ee.current)[L]||(d[L]=(0,p.createRef)()),(f=h.current)[L]||(f[L]=(0,p.createRef)());var K,z,V=(0,di.zv)({type:C,uuid:(null===r||void 0===r?void 0:r.replicated_block)||O});null!==r&&void 0!==r&&r.replicated_block&&((K=rt.current)[V]||(K[V]=(0,l.Z)({},O,{})),(z=rt.current[V])[O]||(z[O]=(0,p.createRef)()));var Y=C===b.tf.MARKDOWN,ne=C===b.tf.TRANSFORMER,re=!(null===B||void 0===B||!B[O]),ue=s===Fn-1||gn,ae=Ee.current[L],ye=h.current[L],Pe=O,Ce=null===x||void 0===x||null===(m=x[C])||void 0===m?void 0:m[O];Ce&&(Pe="".concat(Pe,":").concat(Ce));e.push((0,S.jsx)(ln.Z,{addNewBlock:function(e,t){de(!0);return n(e,je?s:s+1,(function(e){if(1===(null===t||void 0===t?void 0:t.length)){var n,i,r=null===(n=t[0])||void 0===n?void 0:n.uuid,l=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];et({block:{uuid:r},upstreamBlocks:[e.uuid].concat((0,o.Z)(l))})}null===ce||void 0===ce||ce(e)}))},addNewBlockMenuOpenIdx:Ye,addWidget:t,allBlocks:u,allowCodeBlockShortcuts:c,autocompleteItems:a,block:r,blockIdx:s,blockInteractions:null===v||void 0===v?void 0:v[O],blockOutputRef:ae,blockRefs:h,blockTemplates:Wn,blocks:g,codeEditorMappingRef:rt,containerRef:Se,cursorHeight1:wn,cursorHeight2:En,cursorHeight3:An,dataProviders:j,defaultValue:r.content,deleteBlock:function(e){k(e),ee(!1)},disableShortcuts:Z,executionState:M,fetchFileTree:y,fetchPipeline:I,globalDataProducts:T,hideRunButton:bn||Y||gn&&ne,interactionsMapping:D,interruptKernel:A,isHidden:re,mainContainerRect:hn,mainContainerRef:R,mainContainerWidth:N,messages:F[O],noDivider:ue,onCallbackChange:function(e){return U(C,O,e)},onChange:function(e){return H(C,O,e)},onClickAddSingleDBTModel:nt,onDrop:it,onMountCallback:function(e){null!==r&&void 0!==r&&r.replicated_block&&(rt.current[V][O]=e)},openSidekickView:W,pipeline:G,project:we,ref:ye,runBlock:q,runningBlocks:Q,savePipelineContent:X,scrollTogether:J,selected:w,setAddNewBlockMenuOpenIdx:$e,setAnyInputFocused:ee,setCreatingNewDBTModel:an,setEditingBlock:te,setErrors:ie,setHiddenBlocks:oe,setMountedBlocks:kn,setOutputBlocks:le,setSelected:function(e){return ce(!0===e?r:null)},setSelectedBlock:ce,setSelectedOutputBlock:se,setTextareaFocused:de,setScrollTogether:ve,setSideBySideEnabled:pe,showBlockBrowserModal:he,showBrowseTemplates:fe,showConfigureProjectModal:me,showDataIntegrationModal:ge,showGlobalDataProducts:be,showUpdateBlockModal:xe,sideBySideEnabled:je,textareaFocused:w&&ke,updatePipeline:Jn,widgets:Ze,windowWidth:Pn,children:je&&P&&(0,S.jsx)("div",{style:{paddingBottom:_.WC,paddingTop:_.WC},children:ot})},Pe))})),e}),[n,Ye,ot,t,u,c,a,v,Ee,h,Wn,g,xn,x,Se,wn,En,An,j,k,Z,y,I,T,B,D,A,gn,bn,hn,R,N,F,Fn,U,H,nt,it,W,G,we,q,Q,Cn,X,J,$,$e,ee,te,ie,oe,kn,le,ce,se,de,ve,pe,he,fe,me,ge,be,xe,je,ke,et,Jn,Ze,Pn]),ut=(0,p.useMemo)((function(){return(0,S.jsx)(Wi,{addNewBlockAtIndex:n,blocks:g,codeBlocks:lt,fetchFileTree:y,fetchPipeline:I,fetchSampleData:E,globalVariables:M,onChangeCodeBlock:H,openSidekickView:W,pipeline:G,savePipelineContent:X,setErrors:ie,setIntegrationStreams:re,setOutputBlocks:le,setSelectedBlock:ce,setSelectedOutputBlock:se,setSelectedStream:ae})}),[n,g,lt,y,I,E,M,H,W,G,X,ie,re,le,ce,se,ae]),ct=(0,p.useCallback)((function(e){var t="undefined"===typeof nn||null===nn;n((0,di.J8)({blockIndex:nn,blocks:g,filePath:e,isNewBlock:cn,name:vn,repoPathRelativeRoot:null===_e||void 0===_e?void 0:_e.repo_path_relative_root}),(t?Fn:nn+1)-(je?1:0),ce),tt(),de(!0)}),[n,g,tt,cn,vn,nn,Fn,ce,de,je,_e]);(0,p.useEffect)((function(){Ke&&we&&setTimeout((function(){return We(!1)}),qi.zn)}),[Ke,we]);var st=(0,p.useCallback)((function(e,n,t){return ct(t)}),[ct]),at=(0,p.useCallback)((function(e,n){n||ct(e)}),[ct]),dt=(0,Ki.Z)({disableContextMenu:!0,onOpenFile:at,onSelectBlockFile:st,query:{pattern:encodeURIComponent("\\.sql$")},uuid:"FileSelectorPopup/dbt"}).browser;return(0,S.jsxs)(tn.W,{backend:on.PD,children:[(0,S.jsx)(qi.lO,{ref:Se,children:He&&(0,S.jsx)(li.Z,{classNames:"pipeline-detail",in:Le,onEntered:function(){return ze(!0)},timeout:1,children:(0,S.jsx)(qi.fm,{})})}),gn&&(0,S.jsx)(C.Z,{mt:1,px:w.cd,children:ut}),!je&&(0,S.jsx)(C.Z,{mt:1,px:w.cd,children:!gn&&(0,S.jsxs)(S.Fragment,{children:[lt,(0,S.jsx)(C.Z,{mt:w.cd,children:ot})]})}),je&&(0,S.jsxs)("div",{style:{position:"relative"},children:[Sn,lt,Bn,Nn,!(null!==g&&void 0!==g&&g.length)&&(0,S.jsx)(C.Z,{p:w.cd,children:ot})]}),Me&&(0,S.jsx)(xt.Z,{onClickOutside:tt,open:!0,children:(0,S.jsx)(gi,{blocks:g,dbtModelName:vn,onClose:tt,setDbtModelName:pn,children:dt})})]})},no=t(1402),to=t(31557),io=t(2842);function oo(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 ro(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?oo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var lo=function(e){var n=e.after,t=e.afterFooter,i=e.afterHeader,o=e.afterHeightOffset,l=e.afterHidden,u=e.afterInnerHeightMinus,c=e.afterNavigationItems,s=e.afterOverflow,a=e.afterSubheader,d=e.before,v=e.beforeHeader,f=e.beforeHeightOffset,h=e.beforeHidden,m=e.beforeNavigationItems,g=e.children,b=e.errors,x=e.footerOffset,j=e.headerOffset,k=e.mainContainerFooter,Z=e.mainContainerHeader,y=e.mainContainerRef,P=e.page,C=e.pipeline,O=e.setAfterHidden,w=e.setAfterWidthForChildren,_=e.setBeforeHidden,I=e.setErrors,E=e.setMainContainerWidth,T=(0,Je.i)().width,M=(0,p.useState)((0,Ye.U2)(Ye.L8,io.Zt)),B=M[0],D=M[1],A=(0,p.useState)((0,Ye.U2)(Ye.J3,io.ve)),R=A[0],N=A[1],L=(0,p.useState)(!1),F=L[0],U=L[1],H=(0,p.useState)(!1),W=H[0],K=H[1],z=l,q=O;if(!q){var V=(0,p.useState)(!!(0,Ye.U2)(Ye.zg)),Y=(0,r.Z)(V,2);z=Y[0],q=Y[1]}var Q=h,X=_;if(!X){var J=(0,p.useState)(!!(0,Ye.U2)(Ye.Uu)),$=(0,r.Z)(J,2);Q=$[0],X=$[1]}(0,p.useEffect)((function(){null===y||void 0===y||!y.current||F||W||null===E||void 0===E||E(y.current.getBoundingClientRect().width)}),[F,W,z,B,Q,R,y,E,T]),(0,p.useEffect)((function(){F||(null===w||void 0===w||w(B),(0,Ye.t8)(Ye.L8,B))}),[F,B,w]),(0,p.useEffect)((function(){W||(0,Ye.t8)(Ye.J3,R)}),[W,R]);var ee=(0,p.useMemo)((function(){var e=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return C&&(e.push.apply(e,[{bold:ci.b7!==P,label:function(){return null===C||void 0===C?void 0:C.uuid},linkProps:{as:"/pipelines/".concat(null===C||void 0===C?void 0:C.uuid),href:"/pipelines/[pipeline]"}}]),ci.b7===P&&e.push.apply(e,[{bold:!0,label:function(){return(0,G.kC)(P)}}])),(0,S.jsx)(to.Z,{breadcrumbs:e})}),[P,C]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Tt.Z,{title:null===C||void 0===C?void 0:C.name}),(0,S.jsx)(Te.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:o,afterHidden:z,afterInnerHeightMinus:u,afterMousedownActive:F,afterNavigationItems:c,afterOverflow:s,afterSubheader:a,afterWidth:B,before:d,beforeHeader:v,beforeHeightOffset:f,beforeHidden:Q,beforeMousedownActive:W,beforeNavigationItems:m,beforeWidth:R,footerOffset:x,header:ee,headerOffset:j,mainContainerFooter:k,mainContainerHeader:Z,mainContainerRef:y,navigationShowMore:!0,setAfterHidden:q,setAfterMousedownActive:U,setAfterWidth:D,setBeforeHidden:X,setBeforeMousedownActive:K,setBeforeWidth:N,children:g}),b&&(0,S.jsx)(xt.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return I(null)},children:(0,S.jsx)(no.Z,ro(ro({},b),{},{onClose:function(){return I(null)}}))})]})},uo=t(55729),co=t(93808),so=t(8666),ao=t(72226),vo=t(29644),po=t(46209),fo=t(46568),ho=t(82682),mo=t(4982),go=t(61896),bo=(w.iI,mo.O$,w.iI,go.dN,v.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],io.Wi,Be.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),v.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*w.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),v.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),xo=v.default.td.withConfig({displayName:"indexstyle__CellStyle",componentId:"sc-cr39lf-3"})(["display:flex;align-items:center;justify-content:space-between;border:1px solid #1C1C1C;height:100%;",""],(function(e){return!e.noPadding&&"\n padding: 0 ".concat(2*w.iI,"px;\n ")})),jo=t(31748),ko=t(79633);var Zo=function(e){var n=e.copyText,t=e.deleteVariable,i=e.disableKeyEdit,o=e.editStateInit,u=void 0!==o&&o,c=e.fetchVariables,s=e.focusKey,a=e.hideEdit,d=e.obfuscate,v=e.onEnterCallback,h=e.onEscapeCallback,m=e.pipelineUUID,g=e.updateVariable,b=e.variable||{},x=b.uuid,j=b.value,k=(0,p.useRef)(null),y=(0,p.useRef)(null),P=(0,p.useState)(!1),C=P[0],_=P[1],I=(0,p.useState)(x),E=I[0],T=I[1],M=(0,p.useState)(j),B=M[0],D=M[1],A=(0,p.useState)(u),R=A[0],L=A[1],F=(0,f.Db)(Y.ZP.variables.pipelines.useUpdate(m,x),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){L(!1),c()}})}}),U=(0,r.Z)(F,1)[0],H=(0,p.useCallback)((function(e){if("Enter"===e.key){var n=B;try{n=JSON.parse(B)}catch(t){}g?E&&B&&(null===g||void 0===g||g((0,l.Z)({},E,B)),L(!1)):U({variable:{name:E,value:n}}),(0,Xi.ez)(),null===v||void 0===v||v()}else"Escape"===e.key&&((0,Xi.ez)(),L(!1),null===h||void 0===h||h())}),[v,h,g,U,E,B]),W=(0,p.useCallback)((function(){(0,Xi.ez)(),t()}),[t]);(0,p.useEffect)((function(){var e,n;R&&(s?null===k||void 0===k||null===(e=k.current)||void 0===e||e.focus():null===y||void 0===y||null===(n=y.current)||void 0===n||n.focus())}),[R,s]);var G=n||"kwargs['".concat(x,"']");return(0,S.jsx)("div",{onMouseEnter:function(){return _(!0)},onMouseLeave:function(){return _(!1)},children:(0,S.jsxs)(ho.Z,{children:[(0,S.jsx)(fo.Z,{hiddenSmDown:!0,md:1,children:(0,S.jsx)(xo,{noPadding:!0,children:(0,S.jsx)(un.ZP,{backgroundColor:jo.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(G),Mt.Am.success("Successfully copied to clipboard.",{position:Mt.Am.POSITION.BOTTOM_RIGHT,toastId:x})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(x),withIcon:!0,children:(0,S.jsx)(N.Copy,{size:2.5*w.iI})})})}),(0,S.jsx)(fo.Z,{md:4,children:R&&!i?(0,S.jsx)(xo,{children:(0,S.jsx)(Ee.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){T(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"variable",ref:k,small:!0,value:E})}):(0,S.jsx)(xo,{children:(0,S.jsx)(O.ZP,{color:ko.Or,monospace:!0,small:!0,textOverflow:!0,children:x})})}),(0,S.jsx)(fo.Z,{md:7,children:R?(0,S.jsx)(xo,{children:(0,S.jsx)(Ee.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){D(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"enter value",ref:y,small:!0,value:B})}):(0,S.jsxs)(xo,{children:[d?(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:"********"}):(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:j}),(0,S.jsxs)(Z.Z,{children:[!a&&C&&(0,S.jsx)(un.ZP,{backgroundColor:jo.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){L(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(x),withIcon:!0,children:(0,S.jsx)(N.Edit,{size:2.5*w.iI})}),t&&C&&(0,S.jsx)(un.ZP,{backgroundColor:jo.qJ,borderless:!0,inline:!0,muted:!0,onClick:W,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(x),withIcon:!0,children:(0,S.jsx)(N.Trash,{size:2.5*w.iI})})]})]})})]})})},yo=v.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],Me.n_,1.5*w.iI,w.l4,(function(e){return"\n border: ".concat(Me.YF,"px ").concat(Me.M8," ").concat((e.theme||U.Z).interactive.defaultBorder,";\n ")})),Po=t(68781);function Co(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 Oo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Co(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Co(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var wo={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},_o={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},So=(0,vi.YW)();var Io=function(e){e.addNewBlockAtIndex;var n,t,i,o,l=e.block,u=(e.contentByBlockUUID,e.fetchFileTree),c=e.fetchPipeline,s=e.globalDataProducts,a=e.pipeline,d=e.setSelectedBlock,v=(e.showDataIntegrationModal,e.showUpdateBlockModal),h=(0,p.useRef)(null),m=(0,p.useRef)(null),g=(0,p.useMemo)((function(){return null===a||void 0===a?void 0:a.uuid}),[a]),k=(0,p.useMemo)((function(){return(null===a||void 0===a?void 0:a.retry_config)||{}}),[a]),_=(0,p.useMemo)((function(){return!(null!==a&&void 0!==a&&a.run_pipeline_in_one_process)&&[sn.qL.PYSPARK,sn.qL.PYTHON].includes(null===a||void 0===a?void 0:a.type)}),[a]),I=l.color,E=l.configuration,T=l.language,M=l.name,B=l.type,D=l.uuid,F=(0,p.useMemo)((function(){return b.tf.DBT===B}),[B]),U=null===a||void 0===a||null===(n=a.blocks)||void 0===n?void 0:n.findIndex((function(e){return e.uuid===D})),H=(0,p.useMemo)((function(){var e;return null===a||void 0===a||null===(e=a.blocks)||void 0===e?void 0:e[U]}),[U,null===a||void 0===a?void 0:a.blocks]),W=(0,ae.VI)(null,{},[],{uuid:"BlockSettings/index"}),K=(0,r.Z)(W,1)[0],z=(0,p.useMemo)((function(){return(0,L.HK)(s||[],(function(e){return e.uuid}))}),[s]),q=(0,p.useMemo)((function(){var e,n=null===E||void 0===E||null===(e=E.global_data_product)||void 0===e?void 0:e.uuid;if(n&&z)return null===z||void 0===z?void 0:z[n]}),[E,z]),V=Y.ZP.pipelines.detail(so.b.PIPELINE===(null===q||void 0===q?void 0:q.object_type)&&(null===q||void 0===q?void 0:q.object_uuid),{},{revalidateOnFocus:!1}).data,Q=(0,p.useMemo)((function(){return null===V||void 0===V?void 0:V.pipeline}),[V]),X=(0,p.useState)(null),J=X[0],$=X[1],ee=(0,p.useState)(!1),ne=ee[0],te=ee[1],ie=(0,p.useState)(!1),oe=ie[0],re=ie[1],le=(0,p.useState)(!1),ue=le[0],ce=le[1],se=(0,Qt.Z)(l);(0,p.useEffect)((function(){(null===se||void 0===se?void 0:se.uuid)!==(null===l||void 0===l?void 0:l.uuid)&&$(l)}),[l,se]);var de=(0,p.useMemo)((function(){return(null===J||void 0===J?void 0:J.retry_config)||{}}),[J]),ve=(0,p.useCallback)((function(e){te(!0),$(e)}),[]),pe=(0,p.useMemo)((function(){return(0,Tn.gR)((null===J||void 0===J?void 0:J.configuration)||E,["data_integration","file_path","file_source","global_data_product"])}),[null===J||void 0===J?void 0:J.configuration,E]),fe=(0,p.useCallback)((function(e){return ve((function(n){return Oo(Oo({},n),{},{configuration:Oo(Oo({},null===J||void 0===J?void 0:J.configuration),e)})}))}),[null===J||void 0===J?void 0:J.configuration,ve]),he=(0,p.useMemo)((function(){return null===J||void 0===J?void 0:J.executor_type}),[J]);(0,p.useEffect)((function(){oe||!he||Po.R.find((function(e){return e===he}))||re(!0)}),[oe,he]);var me=Y.ZP.blocks.pipelines.detail(g,encodeURIComponent(D),{_format:"with_settings",block_type:B}).data,ge=(0,p.useMemo)((function(){return(null===me||void 0===me?void 0:me.block)||{}}),[me]),xe=(0,p.useMemo)((function(){return null!==ge&&void 0!==ge&&ge.pipelines?null===ge||void 0===ge?void 0:ge.pipelines:[]}),[ge]),je=(null===xe||void 0===xe?void 0:xe.length)||1,Ze=(0,f.Db)(Y.ZP.blocks.pipelines.useUpdate(g,encodeURIComponent(D)),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){te(!1),u(),c(),null!==e&&void 0!==e&&e.block&&d(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return K({errors:n,response:e})}})}}),ye=(0,r.Z)(Ze,2),Ce=ye[0],Oe=ye[1].isLoading,we=((0,p.useCallback)((function(e){return Ce({block:e})}),[Ce]),(0,p.useMemo)((function(){return je>=1&&(0,S.jsx)(kn.cl,{children:(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Description"}],rows:xe.map((function(e){var n=e.pipeline,t=n.description,i=n.name,o=n.uuid;return[(null===a||void 0===a?void 0:a.uuid)===o?(0,S.jsxs)(O.ZP,{monospace:!0,muted:!0,children:[i||o," (current)"]},"name"):(0,S.jsx)(P.Z,{href:"/pipelines/".concat(o,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||o},"name"),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[xe,je,a])),_e=(0,p.useMemo)((function(){return k&&"undefined"!==typeof k&&!(0,Tn.Qr)(k)&&("undefined"!==typeof(null===k||void 0===k?void 0:k.delay)&&"undefined"===typeof(null===de||void 0===de?void 0:de.delay)||"undefined"!==typeof(null===k||void 0===k?void 0:k.exponential_backoff)&&"undefined"===typeof(null===de||void 0===de?void 0:de.exponential_backoff)||"undefined"!==typeof(null===k||void 0===k?void 0:k.max_delay)&&"undefined"===typeof(null===de||void 0===de?void 0:de.max_delay)||"undefined"!==typeof(null===k||void 0===k?void 0:k.retries)&&"undefined"===typeof(null===de||void 0===de?void 0:de.retries))}),[de,k]),Se=(0,p.useMemo)((function(){var e;return(null===J||void 0===J||null===(e=J.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[J]),Ie=(0,p.useCallback)((function(e){return ve((function(n){var t;return Oo(Oo({},n),{},{configuration:Oo(Oo({},null===J||void 0===J?void 0:J.configuration),{},{global_data_product:e(null===J||void 0===J||null===(t=J.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[J,ve]),Te=(0,p.useMemo)((function(){return(0,yn.jO)(l,a)}),[l,a]);return(0,p.useMemo)((function(){return Te&&(0,yn.Uc)(l)}),[l,Te]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:w.HN,pt:w.cd,children:[je>1&&(0,S.jsx)(C.Z,{mb:w.Mq,px:w.cd,children:(0,S.jsx)(yo,{children:(0,S.jsxs)(y.ZP,Oo(Oo({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{children:[(0,S.jsx)(N.DiamondShared,{fill:ko.$R,size:pn.l2}),(0,S.jsx)(C.Z,{pr:2}),(0,S.jsxs)(O.ZP,{bold:!0,large:!0,lineHeight:3*w.iI,warning:!0,children:["Shared by ",je," pipelines"]})]}),!F&&(null===a||void 0===a?void 0:a.type)!==sn.qL.INTEGRATION&&(0,S.jsx)(An.Z,{appearBefore:!0,block:!0,label:"Duplicates block so it is no longer shared with any other pipelines (detaches other pipeline associations)",lightBackground:!0,maxWidth:30*w.iI,size:null,children:(0,S.jsx)(be.ZP,Oo(Oo({},wo),{},{afterIcon:(0,S.jsx)(N.DiamondDetached,{size:pn.bL}),iconOnly:!1,onClick:function(){return v(Oo(Oo({},(0,Tn.gR)(H,["all_upstream_blocks_executed","callback_blocks","conditional_blocks","downstream_blocks","executor_config","executor_type","name","outputs","retry_config","status","tags","timeout"])),{},{detach:!0}),"".concat(M,"_copy"),!0)},padding:null,children:"Detach"}))})]}))})}),(0,S.jsx)(C.Z,{mb:w.HN,px:w.cd,children:(0,S.jsxs)(_n.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,Oo(Oo({},y.A0),{},{children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Name"})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(be.ZP,Oo(Oo({},wo),{},{afterIcon:F?null:(0,S.jsx)(N.Edit,{size:pn.bL}),disabled:F,onClick:function(){return v(l,M)},children:(0,S.jsx)(O.ZP,{bold:!0,children:M||""})}))]}))}),b.tf.CUSTOM===(null===l||void 0===l?void 0:l.type)?(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,Oo(Oo({},y.A0),{},{children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Color"})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(be.ZP,Oo(Oo({},wo),{},{afterIcon:(0,S.jsx)(j.Z,{color:I?So[I]:null,size:pn.bL,square:!0}),onClick:function(){return v(l,M)},outline:!1,children:(0,S.jsx)(O.ZP,{bold:!0,children:(0,G.kC)(I||"")})}))]}))}):null]})}),(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(A.Z,{level:5,children:"Executor type"}),(0,S.jsxs)(O.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/compute-resource#2-set-executor-type-and-customize-the-compute-resource-of-the-mage-executor",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(C.Z,{mt:1,children:[!oe&&(0,S.jsx)(an.Z,{label:"Executor type",onChange:function(e){return ve((function(n){return Oo(Oo({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:h,value:(null===J||void 0===J?void 0:J.executor_type)||"",children:Po.R.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}),oe&&(0,S.jsx)(Ee.Z,{label:"Executor type",monospace:!0,onChange:function(e){return ve((function(n){return Oo(Oo({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:m,setContentOnMount:!0,value:(null===J||void 0===J?void 0:J.executor_type)||""}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(P.Z,{muted:!0,onClick:function(){oe?(ve((function(e){return Oo(Oo({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===m||void 0===m||null===(e=m.current)||void 0===e?void 0:e.focus()}),1),re(!oe)},preventDefault:!0,small:!0,children:oe?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(A.Z,{level:5,children:"Retry configuration"}),(0,S.jsxs)(O.ZP,{muted:!0,children:[_e&&(0,S.jsxs)(S.Fragment,{children:["This block is currently using the retry configuration from the pipeline. You can override the pipeline\u2019s retry configuration for this block.",(0,S.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(C.Z,{mt:1,children:[(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(Ee.Z,{label:"Retries",monospace:!0,onChange:function(e){return ve((function(n){var t;return Oo(Oo({},n),{},{retry_config:Oo(Oo({},null===n||void 0===n?void 0:n.retry_config),{},{retries:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===k||void 0===k?void 0:k.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===de||void 0===de?void 0:de.retries)?null===de||void 0===de?void 0:de.retries:(null===k||void 0===k?void 0:k.retries)||""}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Ee.Z,{label:"Delay",monospace:!0,onChange:function(e){return ve((function(n){var t;return Oo(Oo({},n),{},{retry_config:Oo(Oo({},null===n||void 0===n?void 0:n.retry_config),{},{delay:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===k||void 0===k?void 0:k.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===de||void 0===de?void 0:de.delay)?null===de||void 0===de?void 0:de.delay:(null===k||void 0===k?void 0:k.delay)||""}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Ee.Z,{label:"Max delay",monospace:!0,onChange:function(e){return ve((function(n){var t;return Oo(Oo({},n),{},{retry_config:Oo(Oo({},null===n||void 0===n?void 0:n.retry_config),{},{max_delay:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===k||void 0===k?void 0:k.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===de||void 0===de?void 0:de.max_delay)?null===de||void 0===de?void 0:de.max_delay:(null===k||void 0===k?void 0:k.max_delay)||""})]}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(x.Z,{checked:"undefined"===typeof(null===de||void 0===de?void 0:de.exponential_backoff)&&"undefined"!==typeof(null===k||void 0===k?void 0:k.exponential_backoff)?!(null===k||void 0===k||!k.exponential_backoff):!(null===de||void 0===de||!de.exponential_backoff),label:"Exponential backoff",onClick:function(){return ve((function(e){var n;return Oo(Oo({},e),{},{retry_config:Oo(Oo({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===de||void 0===de?void 0:de.exponential_backoff)&&"undefined"!==typeof(null===k||void 0===k?void 0:k.exponential_backoff)?!(null!==k&&void 0!==k&&k.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),_&&(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(A.Z,{level:5,children:"Block run timeout"}),(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(Ee.Z,{label:"Time in seconds",monospace:!0,onChange:function(e){return ve((function(n){return Oo(Oo({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null===J||void 0===J?void 0:J.timeout)||""}),(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:"The block timeout will only be applied when the block is run through a trigger. If a block times out, the block run will be set to a failed state."})]}),F&&(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(A.Z,{level:5,children:"dbt settings"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(x.Z,{checked:!(null===J||void 0===J||null===(t=J.configuration)||void 0===t||null===(i=t.dbt)||void 0===i||!i.disable_tests),label:"Disable automatically running dbt tests",onClick:function(){return ve((function(e){var n,t,i;return Oo(Oo({},e),{},{configuration:Oo(Oo({},null===e||void 0===e?void 0:e.configuration),{},{dbt:Oo(Oo({},null===e||void 0===e||null===(n=e.configuration)||void 0===n?void 0:n.dbt),{},{disable_tests:!(null!==e&&void 0!==e&&null!==(t=e.configuration)&&void 0!==t&&null!==(i=t.dbt)&&void 0!==i&&i.disable_tests)})})})}))}})})]}),b.Lk.includes(B)&&b.t6.PYTHON===T&&(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{level:5,children:"Block variables"}),(0,S.jsx)(C.Z,{ml:2}),(0,S.jsx)(un.ZP,{Icon:N.Add,blackBorder:!0,halfPaddingBottom:!0,halfPaddingTop:!0,inline:!0,onClick:function(){return ce((function(e){return!e}))},smallIcon:!0,uuid:"Sidekick/BlockSettings/addNewBlockVariable",children:"New"})]}),(0,S.jsxs)(C.Z,{mb:w.cd,mt:1,children:[(0,S.jsxs)(O.ZP,{muted:!0,children:["Press",(0,S.jsx)(O.ZP,Oo(Oo({},_o),{},{children:" Enter"}))," or",(0,S.jsx)(O.ZP,Oo(Oo({},_o),{},{children:" Return"}))," on a row to add or update a variable. These variables are only accessible in this block\xa0",(0,S.jsxs)(O.ZP,Oo(Oo({},_o),{},{bold:!1,children:["(",D,")."]})),(0,S.jsxs)(O.ZP,{inline:!0,muted:!0,children:[" Refer to the",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/variables/block-variables",openNewWindow:!0,children:" documentation"})," for more details."]})]}),(0,S.jsxs)(O.ZP,{muted:!0,children:[(0,S.jsx)(O.ZP,{bold:!0,inline:!0,warning:!0,children:"Note: "}),"Click the",(0,S.jsx)(O.ZP,Oo(Oo({},_o),{},{children:" Update block settings"}))," button below to save changes. If you do not, any new or updated block variables will not be persisted."]})]}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[ue&&(0,S.jsx)(Zo,{editStateInit:!0,focusKey:!0,onEnterCallback:function(){return ce(!1)},onEscapeCallback:function(){return ce(!1)},updateVariable:fe},"new_block_variable"),null===(o=Object.entries(pe))||void 0===o?void 0:o.map((function(e){var n=e[0];return(0,S.jsx)(Zo,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=Oo({},null===J||void 0===J?void 0:J.configuration);delete e[n],ve((function(n){return Oo(Oo({},n),{},{configuration:Oo({},e)})}))},disableKeyEdit:!0,updateVariable:fe,variable:{uuid:n,value:e[1]}},n)}))]})]}),b.tf.GLOBAL_DATA_PRODUCT===B&&(0,S.jsxs)(C.Z,{mb:w.HN,children:[(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Override global data product settings"})}),(0,S.jsx)(C.Z,{mt:w.Mq,children:(0,S.jsx)(ao.Z,{objectAttributes:Se,originalAttributes:q,setObjectAttributes:Ie})}),(0,S.jsx)(C.Z,{mt:w.Mq,children:(0,S.jsx)(vo.Z,{objectAttributes:Se,originalAttributes:q,setObjectAttributes:Ie})}),(0,S.jsx)(C.Z,{mt:w.Mq,children:(0,S.jsx)(po.Z,{blocks:null===Q||void 0===Q?void 0:Q.blocks,objectAttributes:Se,originalAttributes:q,setObjectAttributes:Ie})})]}),(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(be.ZP,{disabled:!ne,loading:Oe,onClick:function(){return Ce({block:{configuration:null===J||void 0===J?void 0:J.configuration,executor_type:null===J||void 0===J?void 0:J.executor_type,retry_config:de,timeout:null===J||void 0===J?void 0:J.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,S.jsxs)(C.Z,{mb:w.HN,children:[!me&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(ke.Z,{inverted:!0})}),me&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)(A.Z,{level:5,children:["Pipelines using this block (",je,")"]}),(0,S.jsx)(O.ZP,{default:!0,children:"A shared block is available to and reused by multiple pipelines. It enables you to write code once and have it easily accessible anywhere in the workspace. As a result, any code changes will affect all pipelines sharing the block."})]}),we]})]})]})},Eo=t(4006),To=t(50450),Mo=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function Bo(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 Do(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Bo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ao=v.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*w.iI),Ro=v.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var No=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,o=e.description,r=e.disableWordBreak,l=e.fullWidth,u=e.inputValue,c=e.inputWidth,s=e.invertedTheme,a=e.label,d=e.labelColor,v=e.menuOpen,f=void 0!==v&&v,h=e.monospace,m=e.muted,g=e.onClick,b=e.notRequired,x=e.selectedTextProps,j=e.small,k=e.stacked,w=e.suffixValue,_=e.tooltipProps,I=e.value,E=(0,Sn.Z)(e,Mo),T=(0,p.useRef)(null),M=(0,p.useState)(!1),B=M[0],D=M[1],A=(0,p.useState)(!1),R=A[0],N=A[1],L=a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{bold:t,color:d,inverted:s,lineHeight:20,monospace:h,muted:m,small:j,children:a}),_&&(0,S.jsx)(C.Z,{ml:1,children:(0,S.jsx)(An.Z,Do({muted:!0},_))})]}),F=(0,S.jsxs)(Z.Z,{flex:l?"1":"none",children:[I&&(0,S.jsx)(P.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){g(),T.current&&T.current.focus(),D(!0)},preventDefault:!0,sameColorAsText:m||!(null!==x&&void 0!==x&&x.primary)&&!(null!==x&&void 0!==x&&x.danger)&&!(null!==x&&void 0!==x&&x.warning),underline:null===x||void 0===x?void 0:x.underline,warning:null===x||void 0===x?void 0:x.warning,children:(0,S.jsx)(O.ZP,Do(Do({inverted:s,muted:m},x),{},{disableWordBreak:r,monospace:h,small:j,width:c,children:I}))}),(0,S.jsx)(Ee.Z,Do(Do({},E),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:s,monospace:h,onBlur:function(e){D(!1),E.onBlur&&E.onBlur(e),R||N(!0)},onFocus:function(e){D(!0),E.onFocus&&E.onFocus(e)},ref:T,small:j,value:u,visible:!I}))]}),U=o&&(0,S.jsx)(Ro,{children:(0,S.jsx)(O.ZP,{dangerouslySetInnerHTML:{__html:o},monospace:h,muted:!0,small:j})}),H=(0,p.useMemo)((function(){return(0,S.jsx)(O.ZP,{default:!0,small:j,children:w})}),[j,w]);return(0,S.jsxs)(S.Fragment,{children:[k&&(0,S.jsxs)(S.Fragment,{children:[L&&(0,S.jsxs)(Ao,{children:[(0,S.jsx)(y.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,S.jsxs)(y.ZP,{fullWidth:l,children:[F,w&&H]})]}),!k&&(0,S.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,S.jsxs)(S.Fragment,{children:[L,(0,S.jsx)(C.Z,{ml:1})]}),F,w&&H]}),R&&!B&&!I&&!f&&!b&&(0,S.jsx)(O.ZP,{danger:!0,small:j,children:"This field is required."})]})},Lo=t(10305),Fo=t(84820),Uo=t(85108),Ho=t(97301);function Wo(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 Go(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Ko(e,n){var t,i,o,u,c=e.autocompleteItems,s=e.block,a=e.blockRefs,d=e.blocks,h=e.deleteWidget,m=e.executionState,g=e.fetchPipeline,x=e.fetchFileTree,j=e.messages,k=void 0===j?[]:j,I=e.onChangeContent,E=e.pipeline,T=e.runBlock,M=e.runningBlocks,B=e.savePipelineContent,D=e.selected,A=e.setAnyInputFocused,R=e.setErrors,F=e.setSelectedBlock,H=e.setTextareaFocused,W=e.textareaFocused,K=e.updateWidget,z=e.width,q=(0,p.useRef)(null),V=(0,p.useContext)(v.ThemeContext),Q=Y.ZP.blocks.pipelines.detail(null===E||void 0===E?void 0:E.uuid,null===s||void 0===s?void 0:s.upstream_blocks[0]).data,X=(null===Q||void 0===Q||null===(t=Q.block)||void 0===t?void 0:t.outputs)||(null===s||void 0===s?void 0:s.outputs)||[],J=(0,p.useState)(null),$=J[0],ee=J[1],ne=(0,p.useState)(null===(i=s.configuration)||void 0===i?void 0:i.chart_type),te=ne[0],ie=ne[1],oe=(0,p.useState)(s.configuration),re=oe[0],le=oe[1],ue=(0,p.useState)(s.content),ce=ue[0],se=ue[1],ae=(0,p.useState)(!te||0===X.length),de=ae[0],ve=ae[1],pe=(0,p.useState)(!1),fe=pe[0],he=pe[1],me=(0,p.useState)(null),ge=me[0],be=me[1],je=(0,p.useState)(null===s||void 0===s?void 0:s.upstream_blocks),Ze=je[0],ye=je[1],Ce=(0,p.useState)((null===X||void 0===X?void 0:X.length)||0),Oe=Ce[0],we=Ce[1],_e=(0,p.useState)(s.uuid),Se=_e[0],Ie=_e[1],Te=Uo.G8[te],Me=Uo.x8[te],Be=(0,p.useMemo)((function(){return null===d||void 0===d?void 0:d.filter((function(e){var n=e.type;return[b.tf.DATA_LOADER,b.tf.TRANSFORMER].includes(n)}))}),[d]),De=(0,p.useMemo)((function(){return(0,L.HK)(Be,(function(e){return e.uuid}))}),[Be]),Ae=!!M.find((function(e){return e.uuid===s.uuid}))||(null===k||void 0===k?void 0:k.length)>=1&&m!==ii.uF.IDLE,Re=(0,p.useMemo)((function(){return null===k||void 0===k?void 0:k.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[k]),Ne=!!Re.find((function(e){return e.error})),Le=Re.length>=1,Fe=(0,p.useMemo)((function(){return{blockType:s.type,hasError:Ne,selected:D}}),[s.type,Ne,D]);if(null!==Re&&void 0!==Re&&Re.length){var Ue,He,We=Re.length-1;u=null===Re||void 0===Re||null===(Ue=Re[We])||void 0===Ue||null===(He=Ue.data)||void 0===He?void 0:He[0]}u?(u=(u=u.slice(1,u.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,G.Pb)(u)&&(o=JSON.parse(u))):(null===X||void 0===X?void 0:X.length)>=1&&(o={},X.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,r=n.variable_uuid;ii.Gi.TEXT===i&&(0,G.Pb)(t)&&(o[r]=JSON.parse(t))})));var Ge=(0,p.useCallback)((function(e){var n=Go(Go(Go({},s),e),{},{configuration:Go(Go({},s.configuration),e.configuration)});B().then((function(){T({block:n,code:ce,ignoreAlreadyRunning:!0,runUpstream:!!Ze.find((function(e){var n;return![b.DA.EXECUTED,b.DA.UPDATED].includes(null===(n=De[e])||void 0===n?void 0:n.status)}))})})),we((function(e){return e+1}))}),[s,De,ce,T,B,we,Ze]),Ke=(0,p.useCallback)((function(e){se(e),I(e)}),[I,se]),ze=(0,p.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;le((function(n){return Go(Go({},n),e)}));var i=Go(Go({},s),{},{configuration:Go(Go(Go({},re),e),{},{chart_type:te})});K(i),Oe&&t&&Ge(i)}),[s,te,re,Oe,Ge,le,K]);(0,p.useEffect)((function(){ee({python:(0,Fo.Z)({autocompleteItems:c,block:s,blocks:d,pipeline:E})})}),[c,s,d,E]);var Ve=(0,p.useMemo)((function(){return(0,S.jsx)(xe.Z,{autoHeight:!0,autocompleteProviders:$,onChange:Ke,selected:D,setSelected:function(e){return F(!0===e?s:null)},setTextareaFocused:H,showLineNumbers:!1,textareaFocused:W||Vi.oV.TABLE===te&&!de,value:ce,width:"100%"})}),[$,s,te,ce,de,D,F,H,W,Ke]),Ye=(0,p.useMemo)((function(){return(Ne||Le)&&(0,S.jsx)(To.Z,Go(Go({},Fe),{},{block:s,contained:!1,hideExtraInfo:!0,isInProgress:Ae,messages:Re,selected:D}))}),[s,Fe,Ne,Le,Ae,Re,D]),Qe=(0,Qt.Z)(de),Je=(0,Qt.Z)(z);(0,p.useEffect)((function(){var e,n=null===q||void 0===q||null===(e=q.current)||void 0===e?void 0:e.getBoundingClientRect();Qe!==de||Je!==z?(be(0),setTimeout((function(){var e,n,t=null===q||void 0===q||null===(e=q.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&be(t)}),100)):n&&be(n.width)}),[de,Qe,q,be,z,Je]);var $e=(0,p.useMemo)((function(){var e=[];return Ze.forEach((function(n,t){var i=De[n],o=(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:V}).accent;e.push((0,S.jsxs)(C.Z,{ml:2,children:[(0,S.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(P.Z,{color:o,inline:!0,onClick:function(){var e,n,t=null===a||void 0===a||null===(e=a.current)||void 0===e?void 0:e["".concat(null===i||void 0===i?void 0:i.type,"s/").concat(null===i||void 0===i?void 0:i.uuid,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,S.jsx)(O.ZP,{color:o,monospace:!0,small:!0,children:n})})]},n))})),e}),[a,De,V,Ze]),en=(0,p.useMemo)((function(){var e,n=[],t=null===Te||void 0===Te||null===(e=Te.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return Vi.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=re[e];if(t){var i,o,r=null===(i=Uo.SR[te])||void 0===i||null===(o=i[e])||void 0===o?void 0:o.call(i);n.push((0,S.jsxs)(C.Z,{ml:2,children:[(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(O.ZP,{default:!0,inline:!0,small:!0,children:r})]})]},t))}})),n}),[te,re,Te]),nn=(0,Qt.Z)(te),tn=(0,Qt.Z)(Ze);(0,p.useEffect)((function(){if((!nn&&te&&null!==Ze&&void 0!==Ze&&Ze.length||(null===tn||void 0===tn||!tn.length)&&(null===Ze||void 0===Ze?void 0:Ze.length)>=1&&te)&&!ce&&(0,Tn.Qr)(re)&&Me){var e=Go(Go({},s),{},{upstream_blocks:Ze});Me.configuration&&ze(Me.configuration(e)),Me.content&&Ke(Me.content(e))}}),[s,te,nn,re,ce,Me,ze,Ke,Ze,tn]);var on=(0,p.useMemo)((function(){return re[Vi.v8]||1}),[re]),rn=(0,p.useMemo)((function(){return Object.entries(Te||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0],o=t[1];return Go(Go({},e),{},(0,l.Z)({},i,o.map((function(e){var n,t=e.autoRun,i=e.label,o=e.monospace,r=e.options,u=e.settings,c=void 0===u?{}:u,a=e.type,d=e.uuid,v={fullWidth:!0,key:d,label:(0,G.kC)(i()),monospace:o,onBlur:function(){return F(s)},onChange:function(e){return ze((0,l.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return F(s)},value:(null===re||void 0===re?void 0:re[d])||""},p=(null!==Q&&void 0!==Q&&Q.block?[Q.block]:[]).reduce((function(e,n){var t=n.outputs;return t?e.concat(t.reduce((function(e,n){var t=n.sample_data;return null!==t&&void 0!==t&&t.columns?e.concat(t.columns):e}),[])):e}),[]);if(Uo.VR.COLUMNS===a){var f=re[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(!c.maxValues||f.length<c.maxValues)&&(0,S.jsx)(an.Z,Go(Go({},v),{},{onChange:function(e){var n=re[d]||[],i=e.target.value;n.includes(i)?n=(0,L.Od)(n,(function(e){return e===i})):n.push(i),ze((0,l.Z)({},d,n),{autoRun:t})},value:null,children:(0,L.YC)(p.filter((function(e){return!f.includes(e)})),(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),f.map((function(e){return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){ze((0,l.Z)({},d,(0,L.Od)(f,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(Uo.VR.METRICS===a){var h=re[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{bold:!0,children:"Metrics"}),(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,S.jsxs)(Lo.Z,{onChange:function(e,n){var i=n.resetValues,o=n.setValues;2===e.filter((function(e){return!!e})).length&&(h.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||(ze((0,l.Z)({},d,h.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),o([null,null]),i()))},children:[(0,S.jsx)(an.Z,Go(Go({},v),{},{label:"aggregation",children:(0,L.YC)(Vi.bn,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),(0,S.jsx)(an.Z,Go(Go({},v),{},{label:"column",children:(0,L.YC)(p,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}))]}),h.map((function(e){var n=e.aggregation,i=e.column;return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(Bn.Z,{label:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){ze((0,l.Z)({},d,(0,L.Od)(h,(function(e){var t=e.aggregation,o=e.column;return n===t&&i===o}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=r?(0,S.jsx)(an.Z,Go(Go({},v),{},{children:r.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})):(0,S.jsx)(Ee.Z,Go(Go({},v),{},{type:a}));return(0,S.jsx)(C.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[s,re,Te,Q,F,ze]),ln=rn.code,cn=rn.noCode,sn=(0,f.Db)(Y.ZP.widgets.pipelines.useUpdate(null===E||void 0===E?void 0:E.uuid,s.uuid),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){he(!1),g(),x()},onErrorCallback:function(e,n){return null===R||void 0===R?void 0:R({errors:n,response:e})}})}}),dn=(0,r.Z)(sn,1)[0],vn="ChartBlock/".concat(s.uuid),pn=(0,Xe.y)(),fn=pn.registerOnKeyDown,hn=pn.unregisterOnKeyDown;return(0,p.useEffect)((function(){return function(){hn(vn)}}),[hn,vn]),fn(vn,(function(e,n,t){fe&&String(t[0])===String(qe.Uq)&&String(t[1])!==String(qe.zX)&&dn({widget:Go(Go({},s),{},{name:Se})})}),[s,fe,Se,dn]),(0,S.jsx)(fo.Z,{sm:12,md:12*on,children:(0,S.jsxs)(Ho.pM,{ref:n,children:[(0,S.jsx)(C.Z,{mt:1,pt:1,px:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{flex:1,style:{position:"relative"},children:[(0,S.jsx)(No,{bold:!1,fullWidth:!0,inputValue:Se,notRequired:!0,onBlur:function(){return setTimeout((function(){return he(!1)}),300)},onChange:function(e){Ie(e.target.value),e.preventDefault()},onClick:function(){A(!0),he(!0)},onFocus:function(){A(!0),he(!0)},small:!0,stacked:!0,value:!fe&&s.uuid}),fe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(P.Z,{noWrapping:!0,onClick:function(){return dn({widget:Go(Go({},s),{},{name:Se})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(an.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Go(Go({},s),{},{upstream_blocks:n});K(t),Ge(t),ye(n)},placeholder:"Source block",small:!0,value:(null===Ze||void 0===Ze?void 0:Ze[0])||"",children:null===Be||void 0===Be?void 0:Be.map((function(e){var n=e.uuid;return(0,S.jsx)("option",{value:n,children:n},n)}))}),(0,S.jsx)(C.Z,{mr:1}),!Ae&&(0,S.jsx)(An.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,S.jsx)(un.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Ge(s)},uuid:"ChartBlock/run/".concat(s.uuid),children:(0,S.jsx)(N.PlayButtonFilled,{size:2*w.iI})})}),ii.uF.QUEUED===m&&(0,S.jsx)(ke.Z,{color:(V||U.Z).content.active,small:!0,type:"cylon"}),ii.uF.BUSY===m&&(0,S.jsx)(ke.Z,{color:(V||U.Z).content.active,small:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,S.jsx)(un.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return ve((function(e){return!e}))},selected:de,uuid:"ChartBlock/edit/".concat(s.uuid),children:(0,S.jsx)(N.Edit,{size:2*w.iI})})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,S.jsx)(un.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return h(s)},uuid:"ChartBlock/delete/".concat(s.uuid),children:(0,S.jsx)(N.Trash,{size:2*w.iI})})})]})]})}),(0,S.jsx)(C.Z,{mt:1}),(0,S.jsxs)(y.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{flex:6,ref:q,children:o&&!(0,Tn.Qr)(o)&&(0,S.jsx)(C.Z,{pb:3,children:(0,S.jsx)(Eo.Z,{block:Go(Go({},s),{},{configuration:Go(Go({},s.configuration),re)}),data:o,width:ge})})}),de&&(0,S.jsx)(Ho.Tb,{children:(0,S.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(an.Z,{onChange:function(e){var n=e.target.value,t=Go(Go({},s),{},{configuration:Go(Go({},re),{},{chart_type:n})});K(t),Ge(t),ie(n)},placeholder:"Select chart type",value:te,children:Vi.CK.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.kC)(e)},e)}))})}),(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(an.Z,{onChange:function(e){return ze((0,l.Z)({},Vi.v8,e.target.value))},placeholder:"Chart width",value:(null===re||void 0===re?void 0:re[Vi.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return(0,S.jsx)("option",{value:i,children:t},t)}))})}),cn]})})]}),de&&!(null===ln||void 0===ln||!ln.length)&&b.t6.SQL!==s.language&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{my:1,px:1,children:[(0,S.jsx)(O.ZP,{bold:!0,children:"Custom chart code"}),(0,S.jsxs)(O.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,S.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,S.jsxs)(Ho.T7,{children:[Ze.length>=1&&(0,S.jsxs)(Ho.y9,{children:[(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",$e]}),(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",en]})]}),Ve]})]}),Ye&&(0,S.jsx)(C.Z,{px:1,children:Ye})]})})}var zo=p.forwardRef(Ko),qo=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function Vo(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 Yo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Vo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Vo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Qo=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,o=e.deleteWidget,r=e.messages,u=e.onChangeChartBlock,c=e.runBlock,s=e.runningBlocks,a=e.savePipelineContent,d=e.selectedBlock,v=e.setAnyInputFocused,f=e.setErrors,h=e.setSelectedBlock,m=e.setTextareaFocused,g=e.textareaFocused,b=e.updateWidget,x=e.widgets,j=e.width,k=(0,Sn.Z)(e,qo),Z=(0,p.useMemo)((function(){return s.reduce((function(e,n,t){return Yo(Yo({},e),{},(0,l.Z)({},n.uuid,Yo(Yo({},n),{},{priority:t})))}),{})}),[s]);return(0,S.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(ho.Z,{fullHeight:!0,style:{marginLeft:.5*w.iI,marginRight:.5*w.iI},children:null===x||void 0===x?void 0:x.map((function(e){var l=e.uuid,x=Z[l],y=x?0===x.priority?ii.uF.BUSY:ii.uF.QUEUED:ii.uF.IDLE;return i.current[l]=(0,p.createRef)(),(0,p.createElement)(zo,Yo(Yo({},k),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:o,executionState:y,key:l,messages:r[l],onChangeContent:function(e){return u(l,e)},ref:i.current[l],runBlock:c,runningBlocks:s,savePipelineContent:a,selected:(null===d||void 0===d?void 0:d.uuid)===l,setAnyInputFocused:v,setErrors:f,setSelectedBlock:h,setTextareaFocused:m,textareaFocused:g,updateWidget:b,width:j}))}))}),(0,S.jsx)("div",{style:{height:"80vh"}})]})},Xo=v.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),Jo=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,o=void 0===i?"0 0 358 305":i;return(0,S.jsxs)(Xo,{height:t*(305/358),viewBox:o,width:t,children:[(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M290 47H66c-3.866 0-7 3.134-7 7v200c0 3.866 3.134 7 7 7h224c3.866 0 7-3.134 7-7V54c0-3.866-3.134-7-7-7zM66 46c-4.4183 0-8 3.5817-8 8v200c0 4.418 3.5817 8 8 8h224c4.418 0 8-3.582 8-8V54c0-4.4183-3.582-8-8-8H66z",fill:"#000"}),(0,S.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,S.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,S.jsx)("rect",{x:"209.651",y:"17.1125",width:"1.0163",height:"14.2284",rx:".5082",transform:"rotate(24.933 209.651 17.1125)",fill:"#2AB2FE"}),(0,S.jsx)("path",{fill:"#2AB2FE",d:"M207.788 23.5313l35.4813 16.4949-.4285.9215-35.4812-16.4948zM247.033 31.9316c.946-2.0359 3.364-2.9191 5.4-1.9726l31.795 14.7811-11.383 24.4836-31.794-14.7811c-2.036-.9465-2.92-3.3642-1.973-5.4002l7.955-17.1108z"}),(0,S.jsx)("path",{d:"M284.228 44.7401l31.795 14.7811c2.036.9465 2.919 3.3642 1.972 5.4001l-7.954 17.1109c-.947 2.0359-3.365 2.9191-5.401 1.9726l-31.795-14.7811 11.383-24.4836z",fill:"#0093E4"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M352.959 83.7347a.5082.5082 0 00-.675.2466l-2.571 5.5296-35.481-16.4949-.428.9216 35.481 16.4949-2.571 5.5295a.5081.5081 0 00.247.675.5082.5082 0 00.675-.2466l5.57-11.9806a.5083.5083 0 00-.247-.6751z",fill:"#2AB2FE"}),(0,S.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("path",{d:"M337.354 256.065a38.3848 38.3848 0 01-10.816 21.271 38.3722 38.3722 0 01-21.293 10.768 38.3787 38.3787 0 01-23.542-3.895 38.3764 38.3764 0 01-16.691-17.054l17.208-8.494a19.1932 19.1932 0 0020.117 10.475 19.189 19.189 0 0010.647-5.385c2.886-2.88 4.78-6.605 5.407-10.635l18.963 2.949z",fill:"#FF3C3C"}),(0,S.jsx)("path",{d:"M294.876 288.277a38.3849 38.3849 0 01-21.64-10.056 38.3818 38.3818 0 01-11.516-20.899 38.3896 38.3896 0 013.06-23.666 38.386 38.386 0 0116.453-17.283l9.098 16.897a19.1904 19.1904 0 00-9.757 20.474 19.1937 19.1937 0 005.758 10.45 19.194 19.194 0 0010.82 5.028l-2.276 19.055z",fill:"#2ECDF7"}),(0,S.jsx)("path",{d:"M275.892 219.85a38.3804 38.3804 0 0145.342-1.268 38.3803 38.3803 0 0114.45 18.989 38.3873 38.3873 0 01.436 23.858l-18.346-5.631a19.1827 19.1827 0 00-.218-11.929 19.1907 19.1907 0 00-7.225-9.495 19.1875 19.1875 0 00-11.439-3.39 19.192 19.192 0 00-11.232 4.024l-11.768-15.158z",fill:"#885EFF"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M259.206 102.57c.241.135.327.439.193.68l-39.314 70.576c-.613 1.1-1.962 1.565-3.124 1.093-3.766-1.53-13.762-5.285-26.356-7.597-12.6-2.314-27.762-3.177-41.881 1.037-16.112 4.81-27.78 14.07-35.424 22.135-3.822 4.032-6.635 7.763-8.491 10.483-.928 1.36-1.616 2.467-2.072 3.232-.228.383-.397.68-.509.881-.057.1-.098.177-.126.227l-.03.057-.008.014-.001.003a.5008.5008 0 01-.676.21.5005.5005 0 01-.209-.676l.442.233-.442-.233.001-.001.002-.005.009-.016.033-.062c.03-.055.073-.135.132-.239.116-.208.29-.513.523-.904.465-.782 1.165-1.906 2.105-3.285 1.881-2.756 4.727-6.53 8.591-10.607 7.727-8.153 19.539-17.532 35.864-22.405 14.331-4.278 29.668-3.391 42.347-1.063 12.685 2.329 22.748 6.109 26.552 7.654.699.284 1.51.002 1.875-.653l39.313-70.575a.5008.5008 0 01.681-.194z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M221.651 176.111c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM157.778 166.428c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM106.428 204.191c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.8726-1.734-3.8726-3.873 0-2.139 1.7336-3.873 3.8726-3.873s3.873 1.734 3.873 3.873zM262.35 104.459c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M8.5523 214.855c-.3562-1.045.2025-2.181 1.248-2.538l13.7251-4.677c1.0456-.356 2.1819.203 2.5382 1.248l29.6737 87.084-17.5112 5.967-29.6738-87.084z",fill:"#4776FF"}),(0,S.jsx)("path",{d:"M45.0935 264.735c-.3562-1.045.2025-2.182 1.2481-2.538l13.725-4.677c1.0455-.356 2.1819.203 2.5382 1.248l10.6438 31.237-17.5112 5.967-10.6439-31.237z",fill:"#FFCC19"}),(0,S.jsx)("path",{d:"M54.4607 234.868c-.3563-1.046.2025-2.182 1.248-2.538l13.7251-4.677c1.0455-.356 2.1819.202 2.5382 1.248l18.7879 55.137-17.5113 5.967-18.7879-55.137z",fill:"#4776FF"})]})};var $o,er=function(e){var n=e.blocksInNotebook;return e.extensionOption,(0,p.useMemo)((function(){return(null===n||void 0===n?void 0:n.filter((function(e){var n=e.type;return b.tf.DBT===n})))||[]}),[n]),(0,S.jsx)(S.Fragment,{})};function nr(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 tr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}($o||($o={}));var ir=function(e){var n,t,i=e.block,o=e.blockActionDescription,r=e.blocks,l=e.inputPlaceholder,u=e.loading,c=e.onClickTag,s=e.runBlockAndTrack,a=e.supportedUpstreamBlockLanguages,d=e.supportedUpstreamBlockTypes,f=e.updateBlock,h=(0,p.useContext)(v.ThemeContext),m=(0,p.useState)(""),g=m[0],b=m[1],P=(0,p.useState)(!1),I=P[0],E=P[1],T=(0,p.useState)(null),M=T[0],B=T[1],D=(0,p.useMemo)((function(){return(0,L.HK)(r,(function(e){return e.uuid}))}),[r]);(0,p.useEffect)((function(){M||B((0,L.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,M]);var A=(0,p.useMemo)((function(){return(null===r||void 0===r?void 0:r.filter((function(e){var n=e.name,t=e.type,i=e.uuid;return((null===n||void 0===n?void 0:n.toLowerCase().includes(null===g||void 0===g?void 0:g.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===g||void 0===g?void 0:g.toLowerCase())))&&(null===d||void 0===d?void 0:d.includes(t))})))||[]}),[g,r,d]),R=(0,p.useMemo)((function(){var e=[];return null===A||void 0===A||A.forEach((function(n,t){var i=n.color,o=n.language,r=n.type,l=n.uuid,u=(0,_.qn)(r,{blockColor:i,theme:h}).accent;t>=1&&e.push((0,S.jsx)(k.Z,{light:!0},"divider-".concat(l)));var c=!(null===M||void 0===M||!M[l]),s=null!==a&&"undefined"!==typeof a&&!(null!==a&&void 0!==a&&a.includes(o));e.push((0,S.jsx)(C.Z,{px:2,py:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:u,size:1.5*w.iI,square:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{monospace:!0,muted:s,small:!0,children:l})]}),s&&(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[o," support coming soon"]}),!s&&(0,S.jsx)(x.Z,{checked:!s&&c,disabled:s,onClick:function(){B((function(e){var n=tr({},e);return c?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[A,h,M]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(xt.Z,{onClickOutside:function(){return E(!1)},open:!0,children:[(0,S.jsx)(Ee.Z,{beforeIcon:(0,S.jsx)(N.Search,{}),borderless:!0,compact:!0,onChange:function(e){return b(e.target.value)},onClick:function(e){(0,Oe.j)(e),E(!0)},onFocus:function(e){(0,Oe.j)(e),E(!0)},placeholder:l,small:!0,value:g}),I&&(0,S.jsxs)(S.Fragment,{children:[R,(0,S.jsx)(C.Z,{p:1,children:(0,S.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(be.ZP,{compact:!0,loading:u,onClick:function(){return f({block:i,upstream_blocks:Object.keys(M)}).then((function(){return E(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!I&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,S.jsxs)(C.Z,{pb:1,pr:1,children:[o&&(0,S.jsx)(C.Z,{mt:1,pl:1,children:(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:o})}),(0,S.jsx)(y.ZP,{alignItems:"center",children:null===i||void 0===i||null===(t=i.upstream_blocks)||void 0===t?void 0:t.map((function(e){var n=null===D||void 0===D?void 0:D[e];if(!n)return(0,S.jsx)("div",{},e);var t=n.color,o=n.type,r=(0,_.qn)(o,{blockColor:t,theme:h}).accentLight;return(0,S.jsx)(C.Z,{ml:1,mt:1,children:(0,S.jsx)(be.ZP,{backgroundColor:r,compact:!0,disabled:!s,onClick:function(e){(0,Oe.j)(e),c?c(n):null===s||void 0===s||s({block:tr(tr({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},or=t(75634);function rr(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 lr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?rr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ur=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,o=e.blocks,u=e.blocksInNotebook,c=e.deleteBlock,s=e.extensionOption,a=e.fetchFileTree,d=e.fetchPipeline,v=e.interruptKernel,h=e.messages,m=e.onChangeCallbackBlock,g=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,k=e.runningBlocks,Z=e.savePipelineContent,y=e.selectedBlock,_=e.setAnyInputFocused,I=e.setErrors,E=e.setSelectedBlock,T=e.setTextareaFocused,M=e.showBrowseTemplates,B=e.textareaFocused,D=(0,p.useRef)(null),A=(0,p.useState)(!1),R=A[0],F=A[1],U=(s||{}).uuid,H=(x||{}).extensions,W=(0,p.useMemo)((function(){return(null===s||void 0===s?void 0:s.templates)||[]}),[s]),G=(0,p.useMemo)((function(){return null===H||void 0===H?void 0:H[U]}),[U,H]),K=(0,p.useMemo)((function(){return(null===G||void 0===G?void 0:G.blocks)||[]}),[G]),z=(0,p.useMemo)((function(){return(0,L.HK)(K,(function(e){return e.uuid}))}),[K]),q=(0,p.useMemo)((function(){return U===(null===y||void 0===y?void 0:y.extension_uuid)&&z[null===y||void 0===y?void 0:y.uuid]}),[z,U,y]),V=(0,p.useMemo)((function(){return k.reduce((function(e,n,t){return lr(lr({},e),{},(0,l.Z)({},n.uuid,lr(lr({},n),{},{priority:t})))}),{})}),[k]),Q=(0,f.Db)((function(e){var n=e.block,t=e.upstream_blocks;return Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===x||void 0===x?void 0:x.uuid),encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{extension_uuid:null===n||void 0===n?void 0:n.extension_uuid}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return null===I||void 0===I?void 0:I({errors:n,response:e})}})}}),X=(0,r.Z)(Q,2),J=X[0],$=X[1].isLoading,ee=(0,p.useMemo)((function(){return K.map((function(e,n){var r=lr(lr({},e),{},{extension_uuid:U}),l=r.type,s=r.uuid,f=(null===y||void 0===y?void 0:y.uuid)===s,P=V[s],O=P?0===P.priority?ii.uF.BUSY:ii.uF.QUEUED:ii.uF.IDLE,M="".concat(l,"s/").concat(s,".py");return i.current[M]=(0,p.createRef)(),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(ln.Z,{allBlocks:o,autocompleteItems:t,block:r,blockIdx:n,blockRefs:i,blocks:o,defaultValue:r.content,deleteBlock:function(e){c(lr(lr({},e),{},{extension_uuid:U})),_(!1)},executionState:O,extraContent:(0,S.jsx)(ir,{block:r,blockActionDescription:"Click a block name to run expectations on it.",blocks:u,inputPlaceholder:"Select blocks to run expectations on",loading:$,supportedUpstreamBlockLanguages:[b.t6.PYTHON],supportedUpstreamBlockTypes:[b.tf.DATA_EXPORTER,b.tf.DATA_LOADER,b.tf.DBT,b.tf.TRANSFORMER],updateBlock:J}),fetchFileTree:a,fetchPipeline:d,hideRunButton:!0,interruptKernel:v,messages:h[s],noDivider:!0,onCallbackChange:function(e){return m(l,s,e)},onChange:function(e){return g(l,s,e)},pipeline:x,ref:i.current[M],runBlock:j,runningBlocks:k,savePipelineContent:Z,selected:f,setAnyInputFocused:_,setErrors:I,setSelected:function(e){return E(!0===e?r:null)},setTextareaFocused:T,textareaFocused:f&&B})},s)}))}),[t,i,o,u,c,K,U,a,d,v,$,h,m,g,x,j,k,V,Z,y,_,I,E,T,B,J]),ne="Extensions/GreatExpectations/index",te=(0,Xe.y)(),ie=te.disableGlobalKeyboardShortcuts,oe=te.registerOnKeyDown,re=te.unregisterOnKeyDown;return(0,p.useEffect)((function(){return function(){re(ne)}}),[re,ne]),oe(ne,(function(e,n){!ie&&q&&((0,Qe.y)([qe.zX,qe.Um],n)||(0,Qe.y)([qe.PQ,qe.Um],n))&&(e.preventDefault(),Z())}),[q,Z]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(O.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["When a block in your pipeline runs, it\u2019ll run any tests you define in its code. All associated extension blocks will also run during that phase. Learn more about the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,S.jsx)(P.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),ee,(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(xt.Z,{onClickOutside:function(){return F(!1)},open:!0,children:(0,S.jsx)(Ii.Z,{disableKeyboardShortcuts:!0,items:null===W||void 0===W?void 0:W.map((function(e){var t=e.description,i=e.name,o=e.path;return{label:function(){return i},onClick:function(){return n({config:{template_path:o},extension_uuid:U,type:b.tf.EXTENSION},(null===K||void 0===K?void 0:K.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,Qi.hr)((function(e){return n(lr(lr({},e),{},{extension_uuid:U,type:b.tf.EXTENSION}),(null===K||void 0===K?void 0:K.length)||0)}),b.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:M})),onClickCallback:function(){return F(!1)},open:R,parentRef:D,uuid:"Extension",children:(0,S.jsx)(un.ZP,{beforeElement:(0,S.jsx)(or.Wx,{teal:!0,children:(0,S.jsx)(N.Add,{size:or.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),F(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},cr=t(15610),sr=t(69419),ar=["pipeline"];function dr(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 vr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?dr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):dr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pr=function(e){var n=e.pipeline,t=(0,Sn.Z)(e,ar),i=(0,h.useRouter)(),o=Y.ZP.extension_options.list().data,r=(0,p.useMemo)((function(){return(null===o||void 0===o?void 0:o.extension_options)||[]}),[o]),l=(0,p.useMemo)((function(){return(0,L.HK)(r,(function(e){return e.uuid}))}),[r]),u=(0,p.useState)(null),c=u[0],s=u[1],a=(0,p.useMemo)((function(){return l[c]}),[l,c]),d=(0,p.useMemo)((function(){return vr(vr({},t),{},{pipeline:n})}),[n,t]);(0,p.useEffect)((function(){var e;s(null===(e=(0,sr.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var v=(0,p.useMemo)((function(){return n?($o.GREAT_EXPECTATIONS===c?e=ur:$o.DBT===c&&(e=er),e?(0,S.jsx)(e,vr(vr({},d),{},{extensionOption:a})):void 0):null;var e}),[a,n,c,d]);return(0,S.jsx)(tn.W,{backend:on.PD,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[!c&&(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!o&&!c&&(0,S.jsx)(ke.Z,{}),v,!c&&(null===r||void 0===r?void 0:r.map((function(e,n){var t=e.description,o=e.name,r=e.uuid;return(0,S.jsx)(C.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,cr.u)({extension:r},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(Dt.Z,{dark:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(Wn.Z,{fullWidth:!1,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)("img",{alt:o,height:3*w.iI,src:"".concat(i.basePath,"/images/extensions/").concat(r,"/logo.png"),width:3*w.iI})})})}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,children:o}),(0,S.jsx)(O.ZP,{default:!0,small:!0,children:t})]})]}),(0,S.jsx)(N.ChevronRight,{})]})})})},r)})))]})})},fr=t(28385),hr=t(9134),mr=t(83784),gr=t(30229),br=t(8916);var xr=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,o=e.setErrorMessages,l=e.variables,u=e.width,c=(0,p.useState)(!1),s=c[0],a=c[1],d=(0,p.useState)(),v=d[0],h=d[1],m=(0,p.useState)(),g=m[0],x=m[1],j=null===t||void 0===t?void 0:t.uuid,k=(0,f.Db)(Y.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,Pe.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;o((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),Z=(0,r.Z)(k,1)[0],_=(0,f.Db)((function(e){return Y.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),I=(0,r.Z)(_,1)[0],E=(0,p.useCallback)((function(e){if("Enter"===e.key){var t=g;try{t=JSON.parse(g)}catch(i){}Z({variable:{name:v,value:t}}).then((function(){n(),h(null),x(null)})),(0,Xi.ez)(),a(!1)}else"Escape"===e.key&&((0,Xi.ez)(),a(!1))}),[Z,n,v,g]),T=(0,p.useMemo)((function(){return u-4*w.iI}),[u]),M=(0,p.useMemo)((function(){return(0,br.wx)(l,(function(e){return e.uuid===mr.C}))}),[l]),B=(0,p.useMemo)((function(){return(0,br.wx)(l,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,l]),D=(0,p.useMemo)((function(){return(0,S.jsxs)(bo,{width:T,children:[s&&(0,S.jsxs)(ho.Z,{children:[(0,S.jsx)(fo.Z,{md:1,children:(0,S.jsx)(xo,{noPadding:!0,children:(0,S.jsx)(un.ZP,{backgroundColor:jo.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(v),Mt.Am.success("Successfully copied to clipboard.",{position:Mt.Am.POSITION.BOTTOM_RIGHT,toastId:v})},uuid:"Sidekick/GlobalVariables/".concat(v),withIcon:!0,children:(0,S.jsx)(N.Copy,{size:2.5*w.iI})})})}),(0,S.jsx)(fo.Z,{md:4,children:(0,S.jsx)(xo,{children:(0,S.jsx)(Ee.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){h(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"variable",small:!0,value:v})})}),(0,S.jsx)(fo.Z,{md:7,children:(0,S.jsx)(xo,{children:(0,S.jsx)(Ee.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"enter value",small:!0,value:g})})})]}),null===M||void 0===M?void 0:M.map((function(e){return(0,S.jsx)(Zo,{deleteVariable:function(){return I(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[I,M,v,g,j,h,x,a,s,T]),R=(0,p.useMemo)((function(){return(0,S.jsx)(bo,{width:T,children:null===B||void 0===B?void 0:B.map((function(e){return(0,S.jsx)(Zo,{copyText:(n=e.uuid,"from mage_ai.data_preparation.variable_manager import (\n get_variable,\n)\n\n".concat(function(e,n,t){return"\n".concat(t," = get_variable('").concat(e,"', '").concat(n,"', '").concat(t,"')\n")}(j,null===i||void 0===i?void 0:i.uuid,n))),hideEdit:!0,pipelineUUID:j,variable:e},e.uuid);var n}))})}),[B,i,T]);return(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,S.jsx)(C.Z,{ml:2}),(0,S.jsx)(un.ZP,{Icon:N.Add,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,S.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:D}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments (Python), interpolated variables (SQL), or vector elements (R). To load a global variable, use the following syntax:"})}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{bold:!0,large:!0,children:["For Python (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(hr.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{bold:!0,large:!0,children:["For SQL (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(hr.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{bold:!0,large:!0,children:["For R (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(hr.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(A.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,S.jsx)(C.Z,{mb:w.cd}),(0,S.jsx)(O.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(gr.Xm).map((function(e,n){var t;return(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{large:!0,monospace:!0,children:(0,G.vg)(null===(t=gr.Z4[e])||void 0===t?void 0:t.call(gr.Z4))})}),(0,br.JZ)([],e).map((function(n,t){return(0,S.jsx)(Zo,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),B&&B.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{my:2,children:(0,S.jsx)(A.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,S.jsx)(C.Z,{mb:2,children:R}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(O.ZP,{children:["Output variables can be used in any ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:b.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(hr.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.variable_manager import (\n get_variable,\n )\n\n\n df = get_variable(\n 'pipeline_uuid',\n 'block_uuid',\n 'variable_name',\n )\n"})})]})]})},jr=t(89565),kr=t.n(jr),Zr=t(88494),yr=v.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Be.y$)()),Pr=v.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],Be.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return!e.height&&"\n max-height: ".concat(e.maxHeight||300,"px;\n ")}));function Cr(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 Or(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Cr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var wr=function(e){var n=e.cancelPipeline,t=e.checkIfPipelineRunning,i=e.executePipeline,o=e.isPipelineExecuting,r=e.pipelineExecutionHidden,l=e.pipelineMessages,u=e.setPipelineExecutionHidden,c=(0,p.useMemo)((function(){return(null===l||void 0===l?void 0:l.length)||0}),[l]),s=(0,p.useMemo)((function(){return c>100?l.slice(-100):l}),[c,l]),a=(0,p.useCallback)((function(){(0,Xi.ez)(),i()}),[i]),d=(0,p.useCallback)((function(){(0,Xi.ez)(),n()}),[n]),v=(0,p.useCallback)((function(){var e=!r;u(e),(0,Ye.t8)(Ye.Q9,e)}),[r,u]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(yr,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{children:[(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.PlayButton,{inverted:!0,size:2*w.iI}),compact:o,disabled:o,loading:o,onClick:a,success:!0,children:(0,S.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,S.jsx)(C.Z,{ml:1}),o&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.Close,{inverted:!0,size:2*w.iI}),onClick:d,success:!0,children:(0,S.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,S.jsx)(C.Z,{ml:1})]}),(0,S.jsx)(be.ZP,{onClick:t,secondary:!0,children:(0,S.jsx)(O.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(O.ZP,{children:"Hide"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Dn.Z,{checked:r,onCheck:v})]})]})}),!r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(Pr,{noScrollbarTrackBackground:!0,children:(0,S.jsx)(Zr.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:s.map((function(e,n){var t=e.data,i=e.type,o=[],r=(o=(o=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return o.map((function(e,t){var o,l={first:0===n&&0===t,last:n===c-1&&t===r-1};return ii.jU.includes(i)?o=(0,S.jsx)(Zr.T5,Or(Or({},l),{},{children:(0,S.jsx)(O.ZP,{monospace:!0,preWrap:!0,children:(0,S.jsx)(kr(),{children:e})})})):i===ii.Gi.IMAGE_PNG&&(o=(0,S.jsx)("div",{style:{backgroundColor:"white"},children:(0,S.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,S.jsx)("div",{children:o},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},_r=t(81769),Sr=(w.iI,v.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-1qjqori-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),v.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1qjqori-1"})([""," border-style:solid;border-width:1px;position:relative;"," "," "," "," "," "," ",""],_.Kf,(function(e){return!e.noBorderRadiusTop&&"\n border-top-left-radius: ".concat(Me.n_,"px;\n border-top-right-radius: ").concat(Me.n_,"px;\n ")}),(function(e){return e.noBorderRadiusTop&&"\n border-top: none !important;\n "}),(function(e){return!e.noBorderRadiusBottom&&"\n border-bottom-left-radius: ".concat(Me.n_,"px;\n border-bottom-right-radius: ").concat(Me.n_,"px;\n ")}),(function(e){return e.noBorderRadiusBottom&&"\n border-bottom: none !important;\n "}),(function(e){return!e.noBackground&&"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")}),(function(e){return!e.borderColor&&"\n border-color: ".concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return e.borderColor&&"\n border-color: ".concat(e.borderColor,";\n ")}))),Ir=(v.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-1qjqori-2"})(["padding:","px;",""],w.cd*w.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")})),v.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-1qjqori-3"})([""," "," ",""],(0,De.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||U.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||U.Z.background).codeTextarea,";\n ")})),v.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-1qjqori-4"})(["position:absolute;"]),v.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-1qjqori-5"})([""," overflow:auto;position:fixed;",""],Be.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")})),v.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-1qjqori-6"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],Me.n_,w.cd*w.iI,1*w.iI,(function(e){return!e.warning&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(e){return!e.selected&&!e.warning&&"\n border: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||U.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||U.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||U.Z.borders).contrast,";\n ")})),v.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-1qjqori-7"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),v.default.div.withConfig({displayName:"indexstyle__ButtonContainerStyle",componentId:"sc-1qjqori-8"})(["bottom:0;position:fixed;z-index:1;"," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border-left: 1px solid ").concat((e.theme.borders||U.Z.borders).light,";\n border-right: 1px solid ").concat((e.theme.borders||U.Z.borders).light,";\n border-top: 1px solid ").concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),Er=t(19452);function Tr(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 Mr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Tr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Tr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Br=function(e){var n,t,i,o,l=e.index,u=e.permission,c=e.setPermissions,s=e.updatePermission;return(0,S.jsx)(Sr,{children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"flex-start",flexDirection:"row",children:[(0,S.jsx)(be.ZP,{iconOnly:!0,onClick:function(){return c((function(e){return(0,L.oM)(e,l)}))},children:(0,S.jsx)(N.Close,{})}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",flexDirection:"row",children:[(0,S.jsx)(A.Z,{level:5,children:"Triggers"}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,onClick:function(e){(0,Oe.j)(e),s(Mr(Mr({},u),{},{triggers:((null===u||void 0===u?void 0:u.triggers)||[]).concat({schedule_interval:"",schedule_type:"",uuid:""})}))},secondary:!0,small:!0,children:"Add trigger"})})]}),(null===u||void 0===u||null===(n=u.triggers)||void 0===n?void 0:n.length)>=1&&(0,S.jsx)(C.Z,{mt:w.cd,children:null===u||void 0===u||null===(t=u.triggers)||void 0===t?void 0:t.map((function(e,n){var t=e.schedule_interval,i=e.schedule_type,o=e.uuid;return(0,S.jsx)(C.Z,{mt:n>=1?1:0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(e){(0,Oe.j)(e);var t=(0,L.oM)((null===u||void 0===u?void 0:u.triggers)||[],n);s(Mr(Mr({},u),{},{triggers:t}))},children:(0,S.jsx)(N.Close,{})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(an.Z,{compact:!0,onChange:function(e){var t,i=e.target.value,o=Mr({},u),r=Mr({},null===o||void 0===o||null===(t=o.triggers)||void 0===t?void 0:t[n]);r.schedule_type=i,o.triggers[n]=r,s(o)},placeholder:"Type",small:!0,value:i,children:Object.entries(gr.Z4).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return(0,S.jsx)("option",{value:t,children:(0,G.kC)(i())},t)}))}),(gr.Xm.TIME===i||!i)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(an.Z,{compact:!0,monospace:!0,onChange:function(e){var t,i=e.target.value,o=Mr({},u),r=Mr({},null===o||void 0===o||null===(t=o.triggers)||void 0===t?void 0:t[n]);r.schedule_interval=i,o.triggers[n]=r,s(o)},placeholder:"Interval",small:!0,value:t,children:gr.Wb.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})]})]})},"permission-trigger-".concat(l,"-").concat(n,"-").concat(o))}))})]}),(0,S.jsx)(C.Z,{mr:w.Mq}),(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",flexDirection:"row",children:[(0,S.jsx)(A.Z,{level:5,children:"Roles"}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,onClick:function(e){(0,Oe.j)(e),s(Mr(Mr({},u),{},{roles:((null===u||void 0===u?void 0:u.roles)||[]).concat({role:"",uuid:""})}))},secondary:!0,small:!0,children:"Add role"})})]}),(null===u||void 0===u||null===(i=u.roles)||void 0===i?void 0:i.length)>=1&&(0,S.jsx)(C.Z,{mt:w.cd,children:null===u||void 0===u||null===(o=u.roles)||void 0===o?void 0:o.map((function(e,n){var t=e.role,i=e.uuid;return(0,S.jsx)(C.Z,{mt:n>=1?1:0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(e){(0,Oe.j)(e);var t=(0,L.oM)((null===u||void 0===u?void 0:u.roles)||[],n);s(Mr(Mr({},u),{},{roles:t}))},children:(0,S.jsx)(N.Close,{})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(an.Z,{compact:!0,monospace:!0,onChange:function(e){var t,i=e.target.value,o=Mr({},u),r=Mr({},null===o||void 0===o||null===(t=o.roles)||void 0===t?void 0:t[n]);r.role=i,o.roles[n]=r,s(o)},placeholder:"Role",small:!0,value:t,children:Er.Z3.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})]})},"permission-role-".concat(l,"-").concat(n,"-").concat(i))}))})]})]})})})},Dr=t(35576),Ar=t(3917);function Rr(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 Nr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Rr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Rr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Lr=function(e){var n,t,i=e.blockInteractionsMapping,r=e.containerWidth,u=e.createInteraction,c=e.interactions,s=e.interactionsMapping,a=e.isLoadingCreateInteraction,d=e.isLoadingUpdatePipelineInteraction,v=e.permissions,f=e.pipeline,h=e.pipelineInteraction,m=e.refAfterFooter,g=e.savePipelineInteraction,x=e.selectedBlock,j=e.setBlockInteractionsMapping,P=e.setInteractionsMapping,_=e.setPermissions,I=e.setSelectedBlock,E=e.updatePipelineInteraction,T=(0,p.useRef)(null),M=(0,p.useRef)(null),B=(0,p.useRef)(null),D=(0,p.useState)(null),R=D[0],F=D[1],U=(0,p.useState)(null),H=U[0],W=U[1],G=(0,p.useState)(!1),K=G[0],z=G[1],q=(0,p.useState)(null),V=q[0],Y=q[1],Q=(0,p.useState)(!1),X=Q[0],J=Q[1],$=(0,p.useState)(null),ee=($[0],$[1]),ne=(0,p.useState)(null),te=ne[0],ie=ne[1],oe=(0,p.useState)(null),re=oe[0],le=oe[1],ue=(0,p.useMemo)((function(){return"undefined"!==typeof i?i:re}),[i,re]),ce=(0,p.useMemo)((function(){return"undefined"!==typeof s?s:te}),[s,te]),se=(0,p.useCallback)((function(e,n){return null!==n&&void 0!==n&&n.initialBootstrap||z(!0),"undefined"!==typeof j?j(e):le(e)}),[j,le,z]),ae=(0,p.useCallback)((function(e,n){return null!==n&&void 0!==n&&n.initialBootstrap||z(!0),"undefined"!==typeof P?P(e):ie(e)}),[P,ie,z]),de=(0,p.useState)(null),ve=de[0],pe=de[1],fe=(0,p.useCallback)((function(e,n,t,i){return se((function(r){var u=(0,o.Z)((null===r||void 0===r?void 0:r[e])||[]);return null!==i&&void 0!==i&&i.remove?u=(0,L.oM)(u,n):u[n]=Nr(Nr({},u[n]),t),Nr(Nr({},r),{},(0,l.Z)({},e,u))}))}),[se]),he=(0,p.useCallback)((function(e,n){W(Number(new Date)),null!==n&&void 0!==n&&n.initialBootstrap||z(!0),"undefined"!==typeof _?_(e):pe(e)}),[W,_,pe,z]),xe=(0,p.useMemo)((function(){var e;return null===(e="undefined"!==typeof v?v:ve)||void 0===e?void 0:e.map((function(e,n){var t=e.roles,i=e.triggers;return{roles:null===t||void 0===t?void 0:t.map((function(e,t){return{role:"string"===typeof e?e:null===e||void 0===e?void 0:e.role,uuid:"".concat(n,"-").concat(H,"-").concat(t)}})),triggers:null===i||void 0===i?void 0:i.map((function(e,t){return Nr(Nr({},e),{},{uuid:"".concat(n,"-").concat(H,"-").concat(t)})})),uuid:"".concat(n,"-").concat(H)}}))}),[H,v,ve]),je=(0,p.useCallback)((function(){F(Number(new Date)),z(!1)}),[F,z]),ke=(0,p.useCallback)((function(){g?null===g||void 0===g||g().then((function(){return je()})):null===E||void 0===E||E(Nr(Nr({},h),{},{blocks:ue,interactions:ce,permissions:null===xe||void 0===xe?void 0:xe.map((function(e){var n=e.roles,t=e.triggers;return{roles:null===n||void 0===n?void 0:n.map((function(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.role})),triggers:null===t||void 0===t?void 0:t.map((function(e){return{schedule_interval:e.schedule_interval,schedule_type:e.schedule_type}}))}}))})).then((function(){return je()}))}),[ue,ce,xe,h,je,g,E]),Ze=(0,p.useMemo)((function(){return(null===f||void 0===f?void 0:f.blocks)||[]}),[f]),ye=(0,p.useMemo)((function(){return null===Ze||void 0===Ze?void 0:Ze.reduce((function(e,n,t){return Nr(Nr({},e),{},(0,l.Z)({},String(t),!0))}),{})}),[Ze]);(0,p.useEffect)((function(){"undefined"===typeof s&&!ce&&(null===c||void 0===c?void 0:c.length)>=1&&ae((0,L.HK)(c||[],(function(e){return e.uuid})),{initialBootstrap:!0})}),[c,ce,s,ae]),(0,p.useEffect)((function(){"undefined"===typeof i&&!ue&&null!==h&&void 0!==h&&h.blocks&&se(null===h||void 0===h?void 0:h.blocks,{initialBootstrap:!0})}),[ue,i,h,se]),(0,p.useEffect)((function(){!xe&&null!==h&&void 0!==h&&h.permissions&&he(null===h||void 0===h?void 0:h.permissions,{initialBootstrap:!0})}),[xe,h,he]);var Pe=(0,p.useMemo)((function(){var e=[],n=(null===Ze||void 0===Ze?void 0:Ze.length)||0;return null===Ze||void 0===Ze||Ze.map((function(t,i){var o=(t||{uuid:null}).uuid,l=(null===ue||void 0===ue?void 0:ue[o])||[],u=(null===l||void 0===l?void 0:l.length)>=1,c=(0,S.jsxs)(be.ZP,{beforeIcon:u?(0,S.jsx)(N.Edit,{}):(0,S.jsx)(N.Add,{}),compact:!0,onClick:function(e){(0,Oe.j)(e),I(t)},primary:!u,secondary:u,small:!0,children:[u&&"Edit interactions",!u&&"Add interactions"]});e.push((0,S.jsx)(ge.Z,{first:0==i,noBorderRadius:i>=1,noPaddingContent:!0,titleXPadding:w.cd*w.iI,titleYPadding:1.5*w.iI,title:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(C.Z,{mr:w.cd,py:1,children:(0,S.jsx)(O.ZP,{large:!0,monospace:!0,children:o})}),u&&(0,S.jsx)(y.ZP,{alignItems:"center",children:c})]}),children:(0,S.jsx)(Sr,{noBackground:!0,noBorderRadiusBottom:i<n-1,noBorderRadiusTop:!0,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[!u&&c,null===l||void 0===l?void 0:l.map((function(e,n){return(0,S.jsx)(C.Z,{mt:n>=1?w.HN:0,children:(0,S.jsx)(_r.Z,{blockInteraction:e,containerWidth:r,containerRef:T,interaction:null===ce||void 0===ce?void 0:ce[null===e||void 0===e?void 0:e.uuid],setInteractionsMapping:ae,showVariableUUID:!0})},"".concat(null===e||void 0===e?void 0:e.uuid,"-").concat(n))}))]})})},o))})),e}),[Ze,T,r,ce,se,ae,I]),Ce=(0,p.useMemo)((function(){return(null===Ze||void 0===Ze?void 0:Ze.length)>=1&&(0,S.jsx)(me.Z,{noBackground:!0,noBorder:!0,noBoxShadow:!0,visibleMapping:ye,children:Pe})}),[Ze,Pe,ye]),we=(0,p.useMemo)((function(){return(null===ue||void 0===ue?void 0:ue[null===x||void 0===x?void 0:x.uuid])||[]}),[ue,x]),_e=(0,p.useMemo)((function(){var e=[],n={};return null===we||void 0===we||we.forEach((function(t){var i=t.uuid,o=null===ce||void 0===ce?void 0:ce[i],r=null===o||void 0===o?void 0:o.variables;Object.keys(r||{}).forEach((function(t){null!==n&&void 0!==n&&n[t]||(e.push(t),n[t]=!0)}))})),e}),[ce,we]),Se=(0,p.useMemo)((function(){var e=(null===we||void 0===we?void 0:we.length)>=1;return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[!X&&(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:e,onClick:function(e){(0,Oe.j)(e),J(!0),setTimeout((function(){var e;return null===M||void 0===M||null===(e=M.current)||void 0===e?void 0:e.focus()}),1)},primary:!0,small:e,children:"Create new set of interactions"})}),X&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Ee.Z,{compact:!0,monospace:!0,onChange:function(e){(0,Oe.j)(e),Y(e.target.value)},onClick:function(e){return(0,Oe.j)(e)},ref:M,small:!0,value:V||""}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(be.ZP,{compact:e,loading:a,onClick:function(e){(0,Oe.j)(e),u({block_uuid:null===x||void 0===x?void 0:x.uuid,inputs:{},layout:[],uuid:"".concat(V,".").concat(b.t6.YAML),variables:{}}).then((function(e){var n=e.data.interaction,t=null===n||void 0===n?void 0:n.uuid;fe(null===x||void 0===x?void 0:x.uuid,(null===we||void 0===we?void 0:we.length)||0,{uuid:t}),ae((function(e){return Nr(Nr({},e),{},(0,l.Z)({},t,n))})),setTimeout((function(){var e;null===B||void 0===B||null===(e=B.current)||void 0===e||e.scrollIntoView()}),ge.e+100)})),J(!1),ee(V),Y(null)},primary:!0,small:e,children:"Save interaction"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(be.ZP,{compact:e,onClick:function(e){(0,Oe.j)(e),J(!1),Y(null)},secondary:!0,small:e,children:"Cancel"})]})]})}),[x,we,X,a,V,ae,J,ee,Y,fe]);return(0,S.jsxs)(C.Z,{p:w.cd,style:{position:"relative"},children:[(0,S.jsxs)(C.Z,{pb:w.cd,ref:T,children:[!x&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(A.Z,{children:"Blocks with interactions"})}),Ce,(0,S.jsxs)(C.Z,{mb:w.cd,mt:w.HN,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{children:"Permissions"}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,onClick:function(){return he((function(e){return e.concat([{roles:[],triggers:[]}])}))},secondary:!0,small:!0,children:"Add permission"})})]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Add permissions to allow specific user roles the ability to trigger this pipeline using the interactions for this pipeline."})})]}),null===xe||void 0===xe?void 0:xe.map((function(e,n){return(0,S.jsx)(C.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(Br,{index:n,permission:e,setPermissions:he,updatePermission:function(e){var t=(0,o.Z)(xe);t[n]=e,he(t)}})},"permission-".concat(n))}))]}),x&&(0,S.jsxs)(C.Z,{mb:w.Mq,children:[(0,S.jsxs)(C.Z,{mb:w.Mq,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(C.Z,{mr:w.cd,py:1,children:(0,S.jsx)(A.Z,{children:"Block interactions"})}),(null===we||void 0===we?void 0:we.length)>=1&&Se]}),(0,S.jsx)(O.ZP,{default:!0,children:"A block can have multiple sets of interactions associated with it."})]}),!(null!==we&&void 0!==we&&we.length)&&Se,(null===_e||void 0===_e?void 0:_e.length)>=1&&(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Variables"}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Z.Z,{alignItems:"center",flex:1,children:null===_e||void 0===_e?void 0:_e.map((function(e,n){return(0,S.jsx)(C.Z,{mr:1,children:(0,S.jsxs)(O.ZP,{default:!0,monospace:!0,children:[e,(null===_e||void 0===_e?void 0:_e.length)>=2&&n<(null===_e||void 0===_e?void 0:_e.length)-1&&(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:","})]})},e)}))})]})]}),null===we||void 0===we?void 0:we.map((function(e,n){var t,i=e||{description:null,name:null},o=i.description,l=i.name,u=null===x||void 0===x?void 0:x.uuid,c=null===e||void 0===e?void 0:e.uuid,s=null===ce||void 0===ce?void 0:ce[c];return(0,S.jsxs)("div",{children:[n>=1&&(0,S.jsx)(C.Z,{my:w.HN,children:(0,S.jsx)(k.Z,{light:!0})}),(0,S.jsx)(_r.Z,{blockInteraction:e,containerRef:T,containerWidth:r,interaction:s,isEditing:!0,removeBlockInteraction:function(){return fe(u,n,e,{remove:!0})},setInteractionsMapping:ae,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)(y.ZP,{alignItems:"flex-start",children:[(0,S.jsxs)(C.Z,{mb:1,style:{width:20*w.iI},children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Label"}),(0,S.jsxs)(O.ZP,{muted:!0,children:["Add a label for this",(0,S.jsx)("br",{}),"set of interactions."]})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(Ee.Z,{fullWidth:!0,onChange:function(e){return fe(u,n,{name:e.target.value})},value:l||""})})]}),(0,S.jsx)(C.Z,{mb:w.cd}),(0,S.jsxs)(y.ZP,{alignItems:"flex-start",children:[(0,S.jsxs)(C.Z,{mb:1,style:{width:20*w.iI},children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Description"}),(0,S.jsxs)(O.ZP,{muted:!0,children:["Describe how these",(0,S.jsx)("br",{}),"interactions are used."]})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(Dr.Z,{fullWidth:!0,onChange:function(e){return fe(u,n,{description:e.target.value})},rows:Math.max(3,Math.min(12,null===o||void 0===o||null===(t=o.split("\n"))||void 0===t?void 0:t.length)),value:o||""})})]})]})}),(0,S.jsx)("div",{ref:n===(null===we||void 0===we?void 0:we.length)-1?B:null})]},"".concat(null===e||void 0===e?void 0:e.uuid,"-").concat(n))}))]}),(0,S.jsx)(Ir,{ref:m,width:(null===T||void 0===T||null===(n=T.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.width)||null,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(be.ZP,{beforeIcon:(0,S.jsx)(N.Save,{}),loading:d,onClick:function(){return ke()},primary:K,secondary:!K,children:"Save changes for all interactions"}),(0,S.jsx)(C.Z,{mr:w.cd}),K&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(N.AlertTriangle,{warning:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{warning:!0,children:"You have unsaved interaction changes"})]}),!K&&R&&(0,S.jsxs)(O.ZP,{muted:!0,children:["Interactions last saved at ",(0,Ar.JX)(Number(R)/1e3)]})]})})})]})};var Fr=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,o=e.setErrorMessages,l=e.width,u=(0,p.useState)(!1),c=u[0],s=u[1],a=(0,p.useState)(),d=a[0],v=a[1],h=(0,p.useState)(),m=h[0],g=h[1],b=(0,p.useMemo)((function(){return l-w.cd*w.iI*2}),[l]),x=(0,f.Db)(Y.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,Pe.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;o((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),j=(0,r.Z)(x,1)[0],k=(0,f.Db)((function(e){return Y.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),Z=(0,r.Z)(k,1)[0],P=(0,p.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:d,value:m}}).then((function(){n(),v(null),g(null)})),(0,Xi.ez)(),s(!1)):"Escape"===e.key&&((0,Xi.ez)(),s(!1))}),[j,n,d,m]),_=(0,p.useCallback)((function(e){(0,Xi.ez)(),Z(e)}),[Z]);return(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{level:4,monospace:!0,children:"Secrets"}),(0,S.jsx)(C.Z,{ml:2}),(0,S.jsx)(un.ZP,{Icon:N.Add,blackBorder:!0,inline:!0,onClick:function(){return s((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(O.ZP,{children:[(0,S.jsx)(O.ZP,{inline:!0,warning:!0,children:"WARNING:"})," the encryption key is stored in a file on your machine. If you need more secure encryption, we recommend using a secrets manager."]})}),c&&(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,S.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(bo,{width:b,children:[c&&(0,S.jsxs)(ho.Z,{children:[(0,S.jsx)(fo.Z,{md:1,children:(0,S.jsx)(xo,{noPadding:!0,children:(0,S.jsx)(un.ZP,{backgroundColor:jo.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(d,") }}")),Mt.Am.success("Successfully copied to clipboard.",{position:Mt.Am.POSITION.BOTTOM_RIGHT,toastId:d})},uuid:"Sidekick/Secrets/".concat(d),withIcon:!0,children:(0,S.jsx)(N.Copy,{size:2.5*w.iI})})})}),(0,S.jsx)(fo.Z,{md:4,children:(0,S.jsx)(xo,{children:(0,S.jsx)(Ee.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){v(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret name",small:!0,value:d})})}),(0,S.jsx)(fo.Z,{md:7,children:(0,S.jsx)(xo,{children:(0,S.jsx)(Ee.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){g(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret value",small:!0,value:m})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,S.jsx)(Zo,{copyText:e.name,deleteVariable:function(){return _(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{children:"Secrets are not editable, they can only be created and deleted. Secrets are shared across the project, and can be used in configuration fields. To reference a secret, use the following templating syntax:"})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(hr.Z,{language:"yaml",maxWidth:b,small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n "})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(hr.Z,{language:"python",maxWidth:b,small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n "})})]})},Ur=t(28026),Hr=t(68899),Wr=t(15752),Gr=t(91835);function Kr(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 zr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qr=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,o=e.autocompleteItems,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.deleteBlock,d=e.displayBlockName,v=e.fetchFileTree,h=e.fetchPipeline,m=e.interruptKernel,g=e.messages,x=(e.onChangeCallbackBlock,e.onChangeCodeBlock),j=e.onSelectBlockFile,k=e.pipeline,Z=e.runBlock,y=e.runningBlocks,_=e.savePipelineContent,I=e.selectedBlock,E=e.setAnyInputFocused,T=e.setErrors,M=e.setHiddenBlocks,B=e.setSelectedBlock,D=e.setTextareaFocused,A=e.showBrowseTemplates,R=e.showUpdateBlockModal,F=e.textareaFocused,U=(0,p.useRef)(null),H=(0,p.useState)(!1),W=H[0],K=H[1],z=(0,sr.iV)().block_uuid;(0,p.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null===z||void 0===z||null===(n=z.split(":"))||void 0===n?void 0:n[0])===t}));e&&(I&&(null===e||void 0===e?void 0:e.uuid)===(null===I||void 0===I?void 0:I.uuid)||(M((function(n){return zr(zr({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[z,c,j,I,M]);var q=(k||{}).type,V=(0,p.useMemo)((function(){return(0,L.HK)(t||[],(function(e){return e.uuid}))}),[t]),Q=Y.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,X=(0,p.useMemo)((function(){return(null===Q||void 0===Q?void 0:Q.block_templates)||[]}),[Q]),J=(0,p.useCallback)((function(e){return n(e,(null===V||void 0===V?void 0:V.length)||0)}),[n,V]),$=(0,p.useMemo)((function(){return(0,Qi.oM)(X,J)}),[J,X]),ee=(0,p.useMemo)((function(){return(0,Qi.hr)(J,i,q,{blockTemplatesByBlockType:$,languages:[b.t6.PYTHON],showBrowseTemplates:A})}),[J,i,$,q]),ne=(0,p.useMemo)((function(){return null===V||void 0===V?void 0:V[null===I||void 0===I?void 0:I.uuid]}),[V,I]),te=(0,p.useMemo)((function(){return y.reduce((function(e,n,t){return zr(zr({},e),{},(0,l.Z)({},n.uuid,zr(zr({},n),{},{priority:t})))}),{})}),[y]),ie=(0,f.Db)((function(e){var n=e.block,t=e.upstream_blocks;return Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===k||void 0===k?void 0:k.uuid),encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{block_type:null===n||void 0===n?void 0:n.type}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){h()},onErrorCallback:function(e,n){return null===T||void 0===T?void 0:T({errors:n,response:e})}})}}),oe=(0,r.Z)(ie,2),re=oe[0],le=oe[1].isLoading,ue=(0,p.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e,n){var t=e.type,i=e.uuid,r=(null===I||void 0===I?void 0:I.uuid)===i,f=te[i],P=f?0===f.priority?ii.uF.BUSY:ii.uF.QUEUED:ii.uF.IDLE,O="".concat(t,"s/").concat(i,".py");return u.current[O]=(0,p.createRef)(),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(ln.Z,{allBlocks:c,autocompleteItems:o,block:e,blockIdx:n,blockRefs:u,blocks:c,defaultValue:e.content,deleteBlock:function(e){a(zr({},e)),E(!1)},executionState:P,extraContent:(0,S.jsx)(ir,{block:e,blocks:s,inputPlaceholder:"Select blocks to add ".concat((0,G._6)(d,null)," to"),loading:le,onClickTag:function(e){M((function(n){return zr(zr({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[b.tf.CUSTOM,b.tf.DATA_EXPORTER,b.tf.DATA_LOADER,b.tf.DBT,b.tf.SCRATCHPAD,b.tf.SENSOR,b.tf.TRANSFORMER],updateBlock:re}),fetchFileTree:v,fetchPipeline:h,hideRunButton:!0,interruptKernel:m,messages:g[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:k,ref:u.current[O],runBlock:Z,runningBlocks:y,savePipelineContent:_,showUpdateBlockModal:R,selected:r,setAnyInputFocused:E,setErrors:T,setSelected:function(n){return B(!0===n?e:null)},setTextareaFocused:D,textareaFocused:r&&F})},i)}))}),[t,o,u,c,s,a,d,v,h,m,le,g,x,j,k,Z,y,te,_,I,E,T,M,B,D,R,F,re]),ce="".concat(d,"/index"),se=(0,Xe.y)(),ae=se.disableGlobalKeyboardShortcuts,de=se.registerOnKeyDown,ve=se.unregisterOnKeyDown;return(0,p.useEffect)((function(){return function(){ve(ce)}}),[ve,ce]),de(ce,(function(e,n){!ae&&ne&&((0,Qe.y)([qe.zX,qe.Um],n)||(0,Qe.y)([qe.PQ,qe.Um],n))&&(e.preventDefault(),_())}),[ne,_]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{default:!0,children:["Run 1 or more ",(0,G.wX)(d)," block functions whenever another block succeeds or fails."]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,G.wX)((0,G._6)(d,null)),"/overview"),openNewWindow:!0,children:(0,G.wX)((0,G._6)(d,null))}),"."]})})]}),ue,(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(xt.Z,{onClickOutside:function(){return K(!1)},open:!0,children:(0,S.jsx)(Ii.Z,{disableKeyboardShortcuts:!0,items:ee,onClickCallback:function(){return K(!1)},open:W,parentRef:U,uuid:d,children:(0,S.jsxs)(un.ZP,{beforeElement:(0,S.jsx)(or.Wx,{rose:i===b.tf.CALLBACK,children:(0,S.jsx)(N.Add,{size:or.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),K(!0)},uuid:"AddNewBlocks/".concat(d),children:[(0,G.kC)(d)," block"]})})})})]})},Vr=t(26084);function Yr(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 Qr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Yr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Yr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xr=[{Icon:N.Callback,name:"Callbacks",uuid:Vr.Q.CALLBACK},{Icon:N.Conditional,name:"Conditionals",uuid:Vr.Q.CONDITIONAL}];var Jr=function(e){var n=(0,Gr.Z)({},e),t=(0,h.useRouter)(),i=(0,p.useState)(null),o=i[0],r=i[1];(0,p.useEffect)((function(){var e;r(null===(e=(0,sr.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,p.useMemo)((function(){var e,t;if(Vr.Q.CALLBACK===o)e={addOnBlockType:b.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(Vr.Q.CONDITIONAL===o){var i;e={addOnBlockType:b.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,S.jsx)(qr,Qr(Qr({},e),n))}),[n,o]);return(0,S.jsx)(tn.W,{backend:on.PD,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[l,!o&&(null===Xr||void 0===Xr?void 0:Xr.map((function(e,n){var t=e.name,i=e.uuid,o=e.Icon;return(0,S.jsx)(C.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,cr.u)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(Dt.Z,{dark:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(Wn.Z,{fullWidth:!1,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(o,{fill:"#885EFF",size:2*w.iI})})})}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Z.Z,{flexDirection:"column",children:(0,S.jsx)(O.ZP,{bold:!0,children:t})})]}),(0,S.jsx)(N.ChevronRight,{})]})})})},i)})))]})})};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 el(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,l.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 nl=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,o=e.autocompleteItems,r=e.blockInteractionsMapping,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.cancelPipeline,d=e.chartRefs,v=e.checkIfPipelineRunning,f=e.containerHeightOffset,h=e.contentByBlockUUID,g=e.createInteraction,b=e.deleteBlock,x=e.deleteWidget,j=e.editingBlock,k=e.executePipeline,Z=e.fetchFileTree,P=e.fetchPipeline,_=e.fetchSecrets,I=e.fetchVariables,E=e.globalDataProducts,T=e.globalVariables,M=e.insights,B=e.interactions,D=e.interactionsMapping,A=e.interruptKernel,R=e.isLoadingCreateInteraction,F=e.isLoadingUpdatePipelineInteraction,U=e.isPipelineExecuting,H=e.lastTerminalMessage,W=e.messages,G=e.metadata,K=e.onChangeCallbackBlock,z=e.onChangeChartBlock,q=e.onChangeCodeBlock,V=e.onSelectBlockFile,Y=e.onUpdateFileSuccess,Q=e.permissions,X=e.pipeline,J=e.pipelineInteraction,$=e.pipelineMessages,ee=e.project,ne=e.refAfterFooter,te=e.runBlock,ie=e.runningBlocks,oe=e.sampleData,re=e.savePipelineContent,le=e.savePipelineInteraction,ue=e.secrets,ce=e.selectedBlock,se=e.selectedFilePath,ae=e.sendTerminalMessage,de=e.setActiveSidekickView,ve=e.setAllowCodeBlockShortcuts,pe=e.setAnyInputFocused,fe=e.setBlockInteractionsMapping,he=e.setDisableShortcuts,me=e.setEditingBlock,ge=e.setErrors,xe=e.setHiddenBlocks,ke=e.setInteractionsMapping,Ze=e.setPermissions,ye=e.setSelectedBlock,Pe=e.setTextareaFocused,Ce=e.showBrowseTemplates,Oe=e.showDataIntegrationModal,we=e.showUpdateBlockModal,_e=e.sideBySideEnabled,Se=e.statistics,Ie=e.textareaFocused,Ee=e.treeRef,Te=e.updatePipelineInteraction,Me=e.updateWidget,De=e.widgets,Ae=(0,Je.i)().height,Re=io.uX,Ne=(0,p.useState)([]),Le=Ne[0],Fe=Ne[1],Ue=(0,p.useState)(!!(0,Ye.U2)(Ye.Q9)),He=Ue[0],We=Ue[1],Ge=(0,p.useMemo)((function(){return i-(Hr.k1+1)}),[i]),Ke=(0,p.useMemo)((function(){var e;return!(null===ee||void 0===ee||null===(e=ee.features)||void 0===e||!e[Gi.d.INTERACTIONS])}),[null===ee||void 0===ee?void 0:ee.features]),ze=((null===j||void 0===j?void 0:j.upstreamBlocks)||{}).block,qe=((null===oe||void 0===oe?void 0:oe.columns)||[]).slice(0,100),Ve=(0,p.useMemo)((function(){return(null===oe||void 0===oe?void 0:oe.rows)||[]}),[oe]),Qe=(0,p.useMemo)((function(){return(null===G||void 0===G?void 0:G.column_types)||{}}),[G]),Xe=(0,p.useMemo)((function(){return(null===M||void 0===M?void 0:M[1])||{}}),[M]),$e=(0,p.useMemo)((function(){return(0,L.HK)((null===M||void 0===M?void 0:M[0])||[],(function(e){return e.feature.uuid}))}),[M]),en=!!oe,nn=(0,p.useMemo)((function(){return sn.qL.INTEGRATION===(null===X||void 0===X?void 0:X.type)}),[X]),tn=sn.qL.STREAMING!==(null===X||void 0===X?void 0:X.type)?-70:He?-16:300,on=(0,p.useCallback)((0,mo.Fk)({columnTypes:Qe,columns:qe,insightsByFeatureUUID:$e,insightsOverview:Xe,noColumnLinks:!0,statistics:Se}),[Qe,qe,$e,Xe,Se]),rn=(0,p.useMemo)((function(){return(0,S.jsx)(xr,{blocks:c,fetchVariables:I,pipeline:X,selectedBlock:ce,setErrorMessages:Fe,variables:T,width:Ge})}),[Ge,c,I,T,X,ce]),ln=(0,p.useMemo)((function(){return(0,S.jsx)(fr.Z,{onActionCallback:Y,pipeline:X,selectedBlock:ce,selectedFilePath:se,setErrors:ge,width:Ge>Be.nn?Ge-Be.nn:Ge})}),[Ge,Y,X,ce,se,ge]),un=(0,p.useMemo)((function(){return(0,S.jsx)(Fr,{fetchSecrets:_,pipelineUUID:null===X||void 0===X?void 0:X.uuid,secrets:ue,setErrorMessages:Fe,width:Ge})}),[Ge,_,X,ue]),cn=(0,p.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:o,blockRefs:u,blocks:c,blocksInNotebook:s,deleteBlock:b,fetchFileTree:Z,fetchPipeline:P,interruptKernel:A,messages:W,onChangeCallbackBlock:K,onChangeCodeBlock:q,onSelectBlockFile:V,pipeline:X,runBlock:te,runningBlocks:ie,savePipelineContent:re,selectedBlock:ce,setAnyInputFocused:pe,setErrors:ge,setHiddenBlocks:xe,setSelectedBlock:ye,setTextareaFocused:Pe,showBrowseTemplates:Ce,showUpdateBlockModal:we,textareaFocused:Ie}}),[t,o,u,c,s,b,Z,P,A,W,K,q,V,X,te,ie,re,ce,pe,ge,xe,ye,Pe,Ce,we,Ie]),an=(0,p.useMemo)((function(){return qe.length>0&&(0,S.jsx)(In.Z,{columnHeaderHeight:(0,Tn.Qr)(Qe)&&(0,Tn.Qr)($e)&&(0,Tn.Qr)(Xe)?0:En.Eh,columns:qe,height:Ae-Re-io.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:on,rows:Ve,width:Ge})}),[Ge,Qe,qe,Re,Ae,$e,Xe,on,Ve]),dn=(0,p.useMemo)((function(){return De.length>0&&(0,S.jsx)(Qo,{autocompleteItems:o,blockRefs:u,blocks:c,chartRefs:d,deleteWidget:x,fetchFileTree:Z,fetchPipeline:P,messages:W,onChangeChartBlock:z,pipeline:X,runBlock:te,runningBlocks:ie,savePipelineContent:re,selectedBlock:ce,setAnyInputFocused:pe,setErrors:ge,setSelectedBlock:ye,setTextareaFocused:Pe,textareaFocused:Ie,updateWidget:Me,widgets:De,width:Ge})}),[Ge,o,u,c,d,x,Z,P,W,z,X,te,ie,re,ce,pe,ge,ye,Pe,Ie,Me,De]),vn=(0,p.useMemo)((function(){return(0,S.jsx)("div",{style:{height:"100%",position:"relative",width:Ge},children:(0,S.jsx)(Ur.Z,{lastMessage:H,onFocus:function(){return ye(null)},sendMessage:ae,width:Ge})})}),[Ge,H,ae,ye]),pn=(0,p.useMemo)((function(){return(0,S.jsx)(pr,el({},cn))}),[cn]),fn=(0,p.useMemo)((function(){return(0,S.jsx)(Jr,el({},cn))}),[cn]),hn=(0,p.useMemo)((function(){return X&&ce&&(0,S.jsx)(Io,{addNewBlockAtIndex:t,block:ce,contentByBlockUUID:h,fetchFileTree:Z,fetchPipeline:P,globalDataProducts:E,pipeline:X,setSelectedBlock:ye,showDataIntegrationModal:Oe,showUpdateBlockModal:we})}),[t,h,Z,P,E,X,ce,ye,Oe,we]);return(0,S.jsxs)(S.Fragment,{children:[(null===Le||void 0===Le?void 0:Le.length)>=1&&(0,S.jsxs)(C.Z,{mb:3,mt:2,mx:2,children:[(0,S.jsxs)(y.ZP,{justifyContent:"space-between",children:[(0,S.jsx)(O.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,S.jsx)(be.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return Fe([])},transparent:!0,children:(0,S.jsx)(N.Close,{muted:!0})})]}),null===Le||void 0===Le?void 0:Le.map((function(e){return(0,S.jsx)(C.Z,{pb:1,children:(0,S.jsx)(O.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,S.jsxs)(En.t0,{fullWidth:!0,heightOffset:Fi.cH.TERMINAL===n||n===Fi.cH.TREE?0:f||Be.nn,onBlur:function(){se||he(!1),null===ve||void 0===ve||ve(!1)},onFocus:function(){he(!0),n===Fi.cH.TREE&&(null===ve||void 0===ve||ve(!0))},overflowHidden:n===Fi.cH.TREE,tabIndex:0,children:[n===Fi.cH.TREE&&(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(null===X||void 0===X?void 0:X.uuid),children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(je.ZP,{addNewBlockAtIndex:t,blockRefs:u,blocks:c,contentByBlockUUID:h,contextMenuEnabled:!0,deleteBlock:b,dragEnabled:!0,editingBlock:j,enablePorts:!nn,fetchPipeline:P,height:Ae-(Re-Be.nn)-tn,messages:W,onClickNode:function(e){var n=e.block.uuid;return xe((function(e){var t=!(null===e||void 0===e||!e[n]);return t?el(el({},e),{},(0,l.Z)({},n,!t)):e}))},pipeline:X,runBlock:te,runningBlocks:ie,selectedBlock:ce,setActiveSidekickView:de,setEditingBlock:me,setErrors:ge,setSelectedBlock:function(e){ye(e),_e&&(0,Wr.F)(e)},showUpdateBlockModal:we,treeRef:Ee}),!ze&&sn.qL.STREAMING===(null===X||void 0===X?void 0:X.type)&&(0,S.jsx)(C.Z,{p:1,children:(0,S.jsx)(wr,{cancelPipeline:a,checkIfPipelineRunning:v,executePipeline:k,isPipelineExecuting:U,pipelineExecutionHidden:He,pipelineMessages:$,setPipelineExecutionHidden:We})})]})}),n===Fi.cH.DATA&&an,Fi.cH.SECRETS===n&&un,Fi.cH.VARIABLES===n&&rn,Fi.cH.FILE_VERSIONS===n&&(0,S.jsx)(m.Z,{uuid:"FileVersions/".concat(se?decodeURIComponent(se):""),children:ln}),nn||ce&&en||!ce&&en&&n===Fi.cH.DATA?null:Fi.du.includes(n)&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:Fi.fp,verticalHeightOffset:Re,width:Ge,children:(0,S.jsx)(O.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:ce?!en&&"No data or insights available":"Select a block for insights"})}),Fi.cH.CHARTS===n&&(De.length>0?dn:(0,S.jsxs)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:Fi.fp,verticalHeightOffset:Re,width:Ge,children:[(0,S.jsx)(C.Z,{px:1,children:(0,S.jsx)(y.ZP,{flexDirection:"row",children:(0,S.jsxs)(O.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,S.jsx)(N.Charts,{size:1.5*w.iI}),"\xa0in",(0,S.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,S.jsx)(C.Z,{mt:w.cd,px:1,children:(0,S.jsx)(Jo,{size:40*w.iI})})]})),Fi.cH.TERMINAL===n&&vn,Fi.cH.EXTENSIONS===n&&pn,Fi.cH.ADDON_BLOCKS===n&&fn,Fi.cH.BLOCK_SETTINGS===n&&(ce?hn:(0,S.jsx)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:Fi.fp,verticalHeightOffset:Re,width:Ge,children:(0,S.jsx)(C.Z,{px:1,children:(0,S.jsx)(y.ZP,{flexDirection:"row",children:(0,S.jsxs)(O.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,S.jsx)(N.SettingsWithKnobs,{size:1.5*w.iI}),"\xa0",(0,S.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})})),Fi.cH.INTERACTIONS===n&&Ke&&(0,S.jsx)(Lr,{blockInteractionsMapping:r,containerWidth:Ge,createInteraction:function(e){return g({interaction:e})},interactions:B,interactionsMapping:D,isLoadingCreateInteraction:R,isLoadingUpdatePipelineInteraction:F,permissions:Q,pipeline:X,pipelineInteraction:J,refAfterFooter:ne,savePipelineInteraction:le,selectedBlock:ce,setBlockInteractionsMapping:fe,setInteractionsMapping:ke,setPermissions:Ze,setSelectedBlock:ye,updatePipelineInteraction:function(e){return Te({pipeline_interaction:e})}})]})]})};var tl=function(e){var n,t=e.activeView,i=e.pipeline,o=e.project,r=e.secrets,l=e.selectedBlock,u=e.setSelectedBlock,c=e.variables,s=null===i||void 0===i?void 0:i.uuid,a=(0,sr.iV)(),d=(0,br.wx)(c,(function(e){return e.uuid===mr.C})),v=(0,Fi.Qq)({project:o})[t],f=(null===v||void 0===v||null===(n=v.buildLabel)||void 0===n?void 0:n.call(v,{pipeline:i,secrets:r,variables:d}))||(null===v||void 0===v?void 0:v.label);Fi.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(f=(0,S.jsxs)(S.Fragment,{children:["Block settings for ",(0,S.jsx)(O.ZP,{bold:!0,color:(0,_.qn)(null===l||void 0===l?void 0:l.type).accent,inline:!0,monospace:!0,children:null===l||void 0===l?void 0:l.uuid})]}));var h=(0,S.jsx)(O.ZP,{bold:!0,children:f}),m=Fi.cH.EXTENSIONS===t&&(null===a||void 0===a?void 0:a.extension),g=Y.ZP.extension_options.list({},{},{pauseFetch:!m}).data,b=(0,p.useMemo)((function(){return(null===g||void 0===g?void 0:g.extension_options)||[]}),[g]),x=(0,p.useMemo)((function(){return(0,L.HK)(b,(function(e){return e.uuid}))}),[b]),j=Fi.cH.ADDON_BLOCKS===t&&(null===a||void 0===a?void 0:a.addon);if(Fi.cH.INTERACTIONS===t){var k=[];null!==l&&void 0!==l&&l.uuid?k.push.apply(k,[{label:function(){return"All interactions"},monospace:!1,onClick:function(){return u(null)}},{bold:!0,label:function(){return null===l||void 0===l?void 0:l.uuid},monospace:!0}]):k.push({bold:!0,label:function(){return"Interactions"},monospace:!1}),h=(0,S.jsx)(bn.Z,{breadcrumbs:k,noMarginLeft:!0})}else{if(!t)return(0,S.jsx)("div",{});if(m){var Z=x[null===a||void 0===a?void 0:a.extension];h=(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(ri(),{as:"/pipelines/".concat(s,"/edit?").concat(Fi.uM,"=").concat(Fi.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:f})}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,S.jsx)(O.ZP,{bold:!0,children:null===Z||void 0===Z?void 0:Z.name})]})}else j&&(h=(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(ri(),{as:"/pipelines/".concat(s,"/edit?").concat(Fi.uM,"=").concat(Fi.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:f})}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,S.jsx)(O.ZP,{bold:!0,children:(0,G.vg)(null===a||void 0===a?void 0:a.addon)})]}))}return(0,S.jsx)(io.ym,{children:h})},il=t(16756),ol=v.default.div.withConfig({displayName:"indexstyle__StatusFooterStyle",componentId:"sc-tixdln-0"})(["bottom:0;position:fixed;z-index:2;"," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).header,";\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),rl=1.25*w.iI;function ll(e,n){var t=e.pipelineType,i=e.pipelineContentTouched,o=(e.pipelineLastSaved,e.saveStatus),r=e.width,l=Zt({pipelineType:t}).kernel||{},u=(l.alive,l.usage),c=(0,p.useMemo)((function(){if(null!==u&&void 0!==u&&u.kernel_memory){var e=u.kernel_memory,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))).concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}return null}),[null===u||void 0===u?void 0:u.kernel_memory]),s=(0,p.useMemo)((function(){return"undefined"!==typeof(null===u||void 0===u?void 0:u.kernel_cpu)?(0,G.QV)(null===u||void 0===u?void 0:u.kernel_cpu,3):null}),[u]);return(0,S.jsxs)(ol,{ref:n,width:r,children:[(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(C.Z,{px:w.cd,py:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[u&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[null!==s&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(N.Lightning,{muted:!0,size:rl}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(O.ZP,{monospace:!0,muted:!0,small:!0,children:["CPU: ",(0,S.jsxs)(O.ZP,{inline:!0,danger:s>=90,muted:s<50,small:!0,warning:s>=50&&s<90,children:[s,"%"]})]})]}),null!==s&&null!==c&&(0,S.jsxs)(C.Z,{mx:w.cd,children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,small:!0,children:"/"})]}),null!==c&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(N.HexagonAll,{muted:!0,size:rl}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(O.ZP,{monospace:!0,muted:!0,small:!0,children:["Memory: ",c]})]}),(0,S.jsx)(C.Z,{mx:w.cd})]})}),(0,S.jsx)(An.Z,{appearAbove:!0,appearBefore:!0,block:!0,description:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,S.jsx)(il.Z,{inline:!0,keyText:(0,Ct.V5)()?qe.RJ:qe.hE}),"\xa0",(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,S.jsx)(il.Z,{inline:!0,keyText:qe.SS}),"\xa0",(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,S.jsx)("br",{})]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Or, go to ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[i&&(0,S.jsx)(N.AlertTriangle,{size:rl,warning:!0}),!i&&(0,S.jsx)(N.File,{size:rl,muted:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,small:!0,warning:i,children:o})]})})]})})]})}var ul=p.forwardRef(ll),cl=t(87432),sl=t(65044),al=t(78419),dl=t(11498),vl=t(28795),pl=t(85010);function fl(e){var n=e.activeView,t=e.pipeline,i=e.project,o=e.secrets,r=e.setActiveSidekickView,l=e.variables,u=(0,br.wx)(l,(function(e){return e.uuid===mr.C}));return(0,Fi.j5)({pipeline:t,project:i}).map((function(e){var i=e.buildLabel,l=e.key,c=e.label;return{Icon:Fi.Z7[l],id:l,isSelected:function(){return n===l},label:function(){return(null===i||void 0===i?void 0:i({pipeline:t,secrets:o,variables:u}))||c},onClick:function(){return r(l,!0)}}}))}var hl=t(53005),ml=t(4383),gl=t(70320);function bl(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 xl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bl(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function jl(e){var n,t,i,u,c,s,x,j,k,Z,P,O,_,I,E,B,D,A,R,F,W=e.page,K=e.pipeline,z=(0,p.useRef)(null),q=(0,p.useRef)(null),V=(0,d.ZP)((0,ml.Ib)("terminal"),{shouldReconnect:function(){return!0}}),Q=V.lastMessage,X=V.sendMessage,J=Zt({refreshInterval:null,revalidateOnFocus:!1}).fetch,$=(0,yt.Z)(),ne=$.featureEnabled,te=$.featureUUIDs,ie=$.fetchProjects,oe=$.project,re=$.sparkEnabled,le=(0,zi.Z)().status,ue=(0,p.useContext)(v.ThemeContext),ce=(0,h.useRouter)(),se=(0,Je.i)().height,de=ce.query.pipeline,pe=K.uuid||de,fe=(0,p.useState)(!0),he=fe[0],me=fe[1],xe=(0,p.useState)(!1),je=xe[0],ke=xe[1],ye=(0,p.useState)(null),Ce=ye[0],Oe=ye[1],we=(0,p.useState)(null),_e=we[0],Se=we[1],Ie=(0,p.useState)(null),Ee=Ie[0],Te=Ie[1],Me=(0,p.useState)(null),Be=Me[0],De=Me[1],Ae=(0,p.useState)(!1),Re=Ae[0],Ne=Ae[1],Le=(0,p.useState)(!1),Fe=Le[0],Ue=Le[1],He=(0,p.useState)(!1),We=He[0],Ge=He[1],Ke=(0,p.useState)(!1),ze=Ke[0],qe=Ke[1],Ve=(0,p.useState)(!0),Qe=Ve[0],Xe=Ve[1],$e=(0,p.useState)(!1),en=$e[0],tn=$e[1],on=(0,p.useState)({upstreamBlocks:null}),rn=on[0],ln=on[1],cn=(0,p.useState)([]),an=cn[0],dn=cn[1],vn=(0,p.useState)(null),pn=vn[0],hn=vn[1],mn=(0,p.useState)(null),bn=mn[0],xn=mn[1],jn=(0,p.useCallback)((function(e){hn(e),e&&We&&Ge(!1),xn(null)}),[We]),kn=(0,p.useState)(!!(0,Ye.U2)(Ye.zg)),Zn=kn[0],yn=kn[1],Pn=(0,p.useState)(!!(0,Ye.U2)(Ye.Uu)),Cn=Pn[0],On=Pn[1],wn=((0,p.useMemo)((function(){var e;return(0,gl.hY)(null===oe||void 0===oe||null===(e=oe.features)||void 0===e?void 0:e[Gi.d.LOCAL_TIMEZONE])}),[null===oe||void 0===oe?void 0:oe.features]),(0,p.useMemo)((function(){var e;return!(null===oe||void 0===oe||null===(e=oe.features)||void 0===e||!e[Gi.d.INTERACTIONS])}),[null===oe||void 0===oe?void 0:oe.features])),_n="".concat(al.H8,"_").concat(pe),Sn=(0,Ye.U2)(_n),In=(0,p.useState)((0,L.sE)(ci.NR,(function(e){return e.uuid===Sn}))||ci.NR[0]),En=In[0],Mn=In[1],Bn=(0,p.useCallback)((function(e){Mn(e),(0,Ye.t8)(_n,null===e||void 0===e?void 0:e.uuid)}),[_n,Mn]),Dn="".concat(al.g6,"_").concat(pe),An=(0,p.useState)({}),Rn=An[0],Nn=An[1],Ln=(0,p.useRef)(null),Fn=Y.ZP.statuses.list({},{revalidateOnFocus:!1}).data,Un=(0,p.useMemo)((function(){var e,n;return null===Fn||void 0===Fn||null===(e=Fn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[Fn]),Hn=(0,p.useMemo)((function(){var e,n;return null===Fn||void 0===Fn||null===(e=Fn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[Fn]),Wn=(0,p.useState)({}),Gn=Wn[0],Kn=Wn[1],zn=(0,p.useState)([]),qn=zn[0],Vn=zn[1],Yn=(0,Qt.Z)(pe),Qn=Y.ZP.pipelines.detail(pe,xl({include_block_pipelines:!0,includes_outputs:(0,Tn.Qr)(Gn)||"undefined"===typeof F||null===F||"undefined"===typeof(null===(n=F)||void 0===n?void 0:n.blocks)||null===(null===(t=F)||void 0===t?void 0:t.blocks)||!(null===(i=F)||void 0===i||null===(u=i.blocks)||void 0===u||!u.find((function(e){return"undefined"===typeof e.ouputs})))},Qe?{includes_outputs_spark:!0}:{}),{refreshInterval:null,revalidateOnFocus:!1},{key:"/pipelines/".concat(pe,"/edit")}),Xn=Qn.data,Jn=Qn.mutate,$n=Y.ZP.pipeline_interactions.detail(wn&&pe,{},{revalidateOnFocus:!1}),et=$n.data,nt=$n.mutate,tt=Y.ZP.interactions.pipeline_interactions.list(wn&&pe,{},{revalidateOnFocus:!1}),it=tt.data,ot=tt.mutate,rt=(0,p.useMemo)((function(){return(null===et||void 0===et?void 0:et.pipeline_interaction)||{}}),[et]),lt=(0,p.useMemo)((function(){return(null===it||void 0===it?void 0:it.interactions)||{}}),[it]),ut=(0,f.Db)(Y.ZP.pipeline_interactions.useUpdate(pe),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){nt()}})}}),ct=(0,r.Z)(ut,2),st=ct[0],at=ct[1].isLoading,dt=(0,f.Db)(Y.ZP.interactions.pipeline_interactions.useCreate(pe),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){ot(),nt()}})}}),vt=(0,r.Z)(dt,2),pt=vt[0],ft=vt[1].isLoading;F=(0,p.useMemo)((function(){return null===Xn||void 0===Xn?void 0:Xn.pipeline}),[Xn]);var ht=(0,p.useMemo)((function(){var e;return sn.qL.INTEGRATION===(null===(e=F)||void 0===e?void 0:e.type)}),[F]);(0,p.useEffect)((function(){F&&Qe&&re&&Xe(!1)}),[Qe,F,Xe,re]);var mt=(0,p.useState)((0,Ye.U2)(al.iL,!1)),gt=mt[0],xt=mt[1],jt=(0,p.useMemo)((function(){return!ht&&(null===ne||void 0===ne?void 0:ne(null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&>}),[ne,te,ht,gt]),kt=(0,p.useState)((0,Ye.U2)(al.qj,!1)),Pt=kt[0],Ct=kt[1],Ot=(0,p.useMemo)((function(){return(null===ne||void 0===ne?void 0:ne(null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&Pt}),[ne,te,Pt]),wt=(0,p.useCallback)((function(e){Ct(e),(0,Ye.t8)(al.qj,"function"===typeof e?e():e)}),[Ct]),_t=(0,p.useCallback)((function(e){var n="function"===typeof e?e():e;xt(e),(0,Ye.t8)(al.iL,n),n||wt(e)}),[wt,xt]),Mt=(0,p.useCallback)((function(){var e=new CustomEvent(ci.$e,{detail:{}});window.dispatchEvent(e)}),[]),Bt=(0,p.useCallback)((function(){var e=new CustomEvent(ci.tK,{detail:{}});window.dispatchEvent(e)}),[]),At=(0,p.useCallback)((function(e){Nn((function(n){var t=e(n);return(0,Ye.t8)(Dn,JSON.stringify(t)),t})),jt&&(clearTimeout(q.current),q.current=setTimeout((function(){Bt(),Mt()}),ge.e+1))}),[Mt,Bt,Dn,Nn,jt]);(0,p.useEffect)((function(){var e=(0,Ye.U2)(Dn);e&&(0,G.Pb)(e)&&Nn(JSON.parse(e))}),[Dn,Nn]);var Rt=(0,p.useState)(null),Nt=Rt[0],Lt=Rt[1],Ft=(0,p.useState)(a()().utc().unix()),Ut=Ft[0],Ht=Ft[1],Wt=(0,p.useState)(!1),Gt=Wt[0],Kt=Wt[1],zt=(0,$t.dd)((function(){return(0,S.jsx)(Vt.Z,{centerOnScreen:!0,neutral:!0,onClick:Xt,subtitle:"Please refresh your page to have the most up-to-date data before making any changes.",title:"Your pipeline may be stale.",width:34*w.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),qt=(0,r.Z)(zt,2),Yt=qt[0],Xt=qt[1];(0,p.useEffect)((function(){var e;null!==Xn&&void 0!==Xn&&null!==(e=Xn.pipeline)&&void 0!==e&&e.updated_at&&Nt!==a()().utc().unix()&&Lt(a()(Xn.pipeline.updated_at).unix()),Nt&&Nt>Ut&&Yt()}),[null===Xn||void 0===Xn||null===(c=Xn.pipeline)||void 0===c?void 0:c.updated_at,Nt,Ut]);var Jt=(0,sr.iV)(),ei=Jt[Fi.uM],ni=Jt.block_uuid;(0,p.useMemo)((function(){var e=Jt["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Jt]);function oi(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2?arguments[2]:void 0,i=(0,l.Z)({},Fi.uM,e);null!==t&&void 0!==t&&t.addon&&(i.addon=null===t||void 0===t?void 0:t.addon),null!==t&&void 0!==t&&t.blockUUID&&(i.block_uuid=null===t||void 0===t?void 0:t.blockUUID),null!==t&&void 0!==t&&t.extension&&(i.extension=null===t||void 0===t?void 0:t.extension),me(!0),(0,cr.u)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}(0,p.useEffect)((function(){ei||oi(Fi.cH.TREE,!1)}),[ei]);var ri=(0,p.useCallback)((function(e,n,t){yn(!1),setTimeout((function(){return oi(e,n,t)}),1)}),[]),li=(0,p.useRef)({}),ui=(0,p.useRef)({}),si=(0,p.useRef)(null),ai=(0,p.useRef)({}),vi=(0,p.useRef)({}),pi=(0,p.useRef)({}),fi=(0,p.useState)({}),hi=fi[0],mi=fi[1],gi=(0,p.useCallback)((function(e,n,t){var i=ai.current||{};ai.current=xl(xl({},i),{},(0,l.Z)({},e,xl(xl({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[ai]),bi=(0,p.useCallback)((function(e,n,t){var i=vi.current||{};vi.current=xl(xl({},i),{},(0,l.Z)({},e,xl(xl({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[]),xi=(0,p.useCallback)((function(e,n,t){gi(e,n,t),Kt(!0)}),[gi,Kt]),ji=(0,p.useCallback)((function(e,n,t){bi(e,n,t),Gt||Kt(!0)}),[Gt,bi,Kt]),ki=(0,p.useCallback)((function(e){pi.current=xl(xl({},pi.current),e)}),[pi]),Zi=(0,p.useCallback)((function(e,n){ki((0,l.Z)({},e,n)),Kt(!0)}),[ki,Kt]),yi=(0,p.useState)(null),Pi=yi[0],Ci=yi[1],Oi=Y.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,wi=null===Oi||void 0===Oi?void 0:Oi.data_providers,_i=Y.ZP.variables.pipelines.list(pe,{global_only:!0},{revalidateOnFocus:!1}),Si=_i.data,Ii=_i.mutate,Ei=null===Si||void 0===Si?void 0:Si.variables,Ti=Y.ZP.secrets.list({},{revalidateOnFocus:!1}),Mi=Ti.data,Bi=Ti.mutate,Di=null===Mi||void 0===Mi?void 0:Mi.secrets,Ai=(0,p.useState)([]),Ri=Ai[0],Ni=Ai[1],Li=(0,p.useState)([]),Ui=Li[0],Hi=Li[1],Wi=(0,p.useRef)({}),Vi=(0,p.useCallback)((function(e){var n;Kt(!0);var t=Wi.current[e.uuid]||{},i=t.upstream_blocks;(null===e||void 0===e||null===(n=e.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(i=e.upstream_blocks),Wi.current[e.uuid]=xl(xl(xl({},t),e),{},{configuration:xl(xl({},t.configuration),e.configuration),upstream_blocks:i})}),[Kt,Wi]),Yi=(0,p.useCallback)((function(e,n,t){xn({block:{type:n,uuid:e},file:{path:t}})}),[]),Qi=(0,di.Dp)(pe),Xi=(0,di.Q9)(Qi,Ri),Ji=(0,p.useState)(Xi),$i=Ji[0],no=Ji[1],to=(0,p.useState)(),io=to[0],oo=to[1],ro=(0,p.useState)(),co=ro[0],so=ro[1],ao=(0,p.useState)(null),vo=ao[0],po=ao[1],fo=(0,Qt.Z)($i);(0,p.useCallback)((function(){ln({upstreamBlocks:{block:null,values:[]}}),Kn({}),Kt(!1),dn([]),jn(null)}),[]);(0,p.useEffect)((function(){pe!==Yn&&(ai.current={},vi.current={})}),[pe,Yn]);var ho=Y.ZP.block_outputs.detail(!Zn&&(null===vo||void 0===vo?void 0:vo.type)!==b.tf.SCRATCHPAD&&(null===vo||void 0===vo?void 0:vo.type)!==b.tf.CHART&&null!==vo&&void 0!==vo&&vo.uuid?encodeURIComponent(null===vo||void 0===vo?void 0:vo.uuid):null,{pipeline_uuid:pe}),mo=ho.data,go=ho.mutate,bo=(0,p.useMemo)((function(){return null===mo||void 0===mo?void 0:mo.block_output}),[mo]),xo=(0,p.useMemo)((function(){var e,n,t;return ht?null===(e=(0,L.sE)(null===bo||void 0===bo?void 0:bo.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,G.kE)(co))})))||void 0===e?void 0:e.sample_data:null===bo||void 0===bo||null===(n=bo.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[bo,ht,co]),jo=Y.ZP.blocks.pipelines.analyses.detail(Zn?null:pe,(null===vo||void 0===vo?void 0:vo.type)!==b.tf.SCRATCHPAD&&(null===vo||void 0===vo?void 0:vo.type)!==b.tf.CHART&&(null===vo||void 0===vo?void 0:vo.uuid)&&encodeURIComponent(null===vo||void 0===vo?void 0:vo.uuid)),ko=jo.data,Zo=jo.mutate,yo=(null===ko||void 0===ko||null===(s=ko.analyses)||void 0===s?void 0:s[0])||{},Po=yo.insights,Co=void 0===Po?{}:Po,Oo=yo.metadata,wo=void 0===Oo?{}:Oo,_o=yo.statistics,So=void 0===_o?{}:_o;(0,p.useEffect)((function(){0===an.length&&(Zo(),go(),Ii())}),[Zo,go,Ii,an]),(0,p.useEffect)((function(){if(0===$i.length)po(null);else if((null===fo||void 0===fo?void 0:fo.length)!==(null===$i||void 0===$i?void 0:$i.length)&&(null===$i||void 0===$i?void 0:$i.length)<(null===fo||void 0===fo?void 0:fo.length)){var e=fo.findIndex((function(e){return e.uuid===(null===vo||void 0===vo?void 0:vo.uuid)})),n=fo.length-1===e?e-1:e+1;po(fo[Math.max(0,n)])}}),[$i,fo,null===vo||void 0===vo?void 0:vo.uuid]),(0,p.useEffect)((function(){var e;null!==(e=rn.upstreamBlocks)&&void 0!==e&&e.block&&(yn(!1),oi(Fi.cH.TREE))}),[rn.upstreamBlocks]);var Io,Eo=Y.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),To=Eo.data,Mo=Eo.mutate,Bo=null===To||void 0===To?void 0:To.autocomplete_items,Do=(0,f.Db)((function(e){var n=e.uuid;return Y.ZP.widgets.pipelines.useDelete(pe,n)()}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.widget.uuid;Hi((function(e){return(0,L.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),Jn(),Go()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Se({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&Kn((function(e){return xl(xl({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:ii.Gi.TEXT_PLAIN}}))))}))}})}}),Ao=(0,r.Z)(Do,1)[0],Ro=(0,p.useCallback)((function(e,n){var t,i=e||{},o=i.content,r=i.path;if(t=null!==n&&void 0!==n&&n.blockUUID?null===Ri||void 0===Ri?void 0:Ri.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.blockUUID)})):(0,hl.IO)(r,Ri)){var u=t,c=u.type,s=u.uuid;ji(c,s,o),Ni((function(e){var n=null===e||void 0===e?void 0:e.findIndex((function(e){var n=e.type,t=e.uuid;return n===c&&t===s}));return n>=0&&(e[n].content=o),e})),mi((function(e){return xl(xl({},e),{},(0,l.Z)({},c,xl(xl({},null===e||void 0===e?void 0:e[c]),{},(0,l.Z)({},s,Number(new Date)))))})),Jn()}}),[Ri,Jn,ji]),No=(0,p.useCallback)((function(e,n,t){Io(e,Ri.length,n,e.name,t)}),[Io]),Lo=(0,p.useCallback)((function(e,n){n||(oi(Fi.cH.FILES),yn(!1),me(!1),jn(null))}),[]),Fo=(0,p.useCallback)((function(){jn(null)}),[]),Uo=(0,Ki.Z)({addNewBlock:No,blocks:Ri,deleteWidget:Ao,fetchAutocompleteItems:Mo,fetchPipeline:Jn,fetchVariables:Ii,onOpenFile:Lo,onSelectFile:Fo,onSelectBlockFile:Yi,onUpdateFileSuccess:Ro,openSidekickView:ri,pipeline:F,sendTerminalMessage:X,setDisableShortcuts:Ge,setSelectedBlock:jn,showHiddenFilesSetting:!0,uuid:pe,widgets:Ui}),Ho=Uo.browser,Wo=Uo.controller,Go=Uo.fetchFiles,Ko=(Uo.filePaths,Uo.files),zo=(Uo.filesTouched,Uo.menu,Uo.openFile),qo=Uo.selectedFilePath,Vo=Uo.tabs,Yo=(Uo.versions,Uo.versionsVisible,(0,f.Db)(Y.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.pipeline.uuid;ce.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),Go()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}})),Qo=(0,r.Z)(Yo,1)[0],Xo=(0,f.Db)(Y.ZP.pipelines.useUpdate(pe,{update_content:!0}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){Kt(!1),Jn().then((function(e){var n,t,i,o=e.pipeline,r=null===(n=F)||void 0===n||null===(t=n.blocks)||void 0===t?void 0:t.map((function(e){return e.uuid})),l=null===o||void 0===o||null===(i=o.blocks)||void 0===i?void 0:i.map((function(e){return e.uuid}));!(0,L.fS)(r||[],l||[])&&jt&&setTimeout((function(){(0,Wr.h)()}),1)}))},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),Jo=(0,r.Z)(Xo,2),$o=Jo[0],er=Jo[1].isLoading,nr=(0,p.useState)({}),tr=nr[0],ir=nr[1],or=(0,p.useCallback)((function(e,n){var t,i=e||{},o=i.block,l=i.pipeline,u=void 0===l?{extensions:{}}:l,c=(n||{}).contentOnly;if(!(Nt&&Nt>Ut)){var s=(0,Ar.Tz)();Ht(a()().utc().unix());var d={},v={},p={},f={};((null===u||void 0===u?void 0:u.blocks)||Ri).forEach((function(e){var n,t,i,l=e.extension_uuid,u=e.type,s=e.uuid,a=null===(n=vi.current[u])||void 0===n?void 0:n[s];"undefined"===typeof a&&(a=e.content);var h=null===(t=ai.current[u])||void 0===t?void 0:t[s];"undefined"===typeof h&&(h=e.callback_content);var m=null,g=null===(i=Gn[s])||void 0===i?void 0:i.filter((function(e){return!!e})),x=null===g||void 0===g?void 0:g.find((function(e){return e.error}));if(g&&(!re||null===an||void 0===an||!an.length)){var j=[],k=0;g.forEach((function(n){var t=n.data,i=n.type;(b.tf.SCRATCHPAD===e.type||x||"table"!==i&&null!==tr&&void 0!==tr&&tr[null===e||void 0===e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(sl.Lz)?e:e.concat(n)}),[]),i===ii.Gi.TEXT_PLAIN&&(k+=(null===t||void 0===t?void 0:t.length)||0)),(!Hn||k<Hn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var Z=xl(xl({},e),{},{callback_content:h,content:a});null===m?delete Z.outputs:Z.outputs=m,(null===o||void 0===o?void 0:o.uuid)===s&&Object.entries(o).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];"object"===typeof i&&!Array.isArray(i)&&i?Object.entries(i).forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],o=n[1];Z[t]||(Z[t]={}),Z[t][i]=o})):Z[t]=i})),c?v[Z.uuid]={callback_content:Z.callback_content,content:Z.content,outputs:Z.outputs,uuid:Z.uuid}:[b.tf.EXTENSION].includes(u)?(d[l]||(d[l]=[]),d[l].push(Z)):b.tf.CALLBACK===u?p[Z.uuid]=Z:b.tf.CONDITIONAL===u?f[Z.uuid]=Z:v[Z.uuid]=Z}));var h=xl(xl({},null===(t=F)||void 0===t?void 0:t.extensions),null===u||void 0===u?void 0:u.extensions);Object.entries(d).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];h[t]||(h[t]={}),h[t].blocks=i}));var m=[],g=[],x=[];return((null===u||void 0===u?void 0:u.blocks)||Ri).forEach((function(e){var n=e.uuid,t=v[n],i=p[n],o=f[n];"undefined"!==typeof t?m.push(t):"undefined"!==typeof i?g.push(i):"undefined"!==typeof o&&x.push(o)})),ir({}),$o({pipeline:xl(xl(xl({},F),u),{},{blocks:m,callbacks:g,conditionals:x,extensions:h,updated_at:s,widgets:Ui.map((function(e){var n,t,i=pi.current[e.uuid],o=Wi.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var r=null===(n=Gn[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===r||void 0===r?void 0:r.find((function(e){return e.error}));if(r){var u=[];r.forEach((function(n){var t=n.data,i=n.type;(b.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(sl.Lz)?e:e.concat(n)}),[])),u.push(n))})),t=u.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}return xl(xl(xl({},e),o),{},{configuration:xl(xl({},e.configuration),o.configuration),content:i,outputs:t})}))})})}Yt()}),[Ri,Hn,Gn,tr,F,Nt,Ut,an,re,$o,Ui]),rr=(0,p.useMemo)((function(){return(0,di.Rz)(F,{displayRelative:!0,isPipelineUpdating:er,pipelineContentTouched:Gt,pipelineLastSaved:Nt})}),[er,F,Gt,Nt]),lr=(0,$t.dd)((function(e){var n,t,i=e||{block:null,contentByBlockUUID:null},o=i.block,r=i.contentByBlockUUID,l=o||{type:null,uuid:null},u=l.type,c=l.uuid,s=xl({},o);r&&(s.content=null===r||void 0===r||null===(n=r.current)||void 0===n||null===(t=n[u])||void 0===t?void 0:t[c]);return(0,S.jsx)(ae.BC,{children:(0,S.jsx)(bt,xl(xl({},e),{},{block:s,onChangeCodeBlock:ji,onClose:dr,pipeline:F,savePipelineContent:or}))})}),{},[ji,F,or],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat(pe)}),ur=(0,r.Z)(lr,2),ar=ur[0],dr=ur[1];(0,p.useEffect)((function(){if(bn){var e,n=(null===bn||void 0===bn?void 0:bn.block)||{type:null,uuid:null},t=n.type,i=n.uuid,o=Ri.find((function(e){var n=e.type,o=e.uuid;return n===t&&o===i}));if(o){if(jn(o),null!==li&&void 0!==li&&li.current){var r,l=li.current[(0,di.zv)(o)];null===l||void 0===l||null===(r=l.current)||void 0===r||r.scrollIntoView()}}else if(t===b.tf.CHART){var u=Ui.find((function(e){return e.uuid===i}));if(u&&(jn(u),null!==ui&&void 0!==ui&&ui.current)){var c,s=ui.current[u.uuid];null===s||void 0===s||null===(c=s.current)||void 0===c||c.scrollIntoView()}}else if(null!==bn&&void 0!==bn&&null!==(e=bn.file)&&void 0!==e&&e.path){var a;zo(null===bn||void 0===bn||null===(a=bn.file)||void 0===a?void 0:a.path)}}}),[Ri,bn,Ui]),(0,p.useEffect)((function(){var e,n,t=Xn,i=[],o=null===(e=F)||void 0===e?void 0:e.variables_dir,r=null===(n=F)||void 0===n?void 0:n.remote_variables_dir;null!==Xn&&void 0!==Xn&&Xn.hasOwnProperty("error")?"undefined"!==pe?i=[{label:"Check pipeline configuration file for any issues",onClick:function(){zo("pipelines/".concat(pe,"/").concat(Ze.dT.METADATA_YAML)),Se(null)}}]:t.error.displayMessage="There may be an issue with your pipeline\u2019s configuration file. Please check to make sure it is valid. It can be found at /pipelines/[pipeline_uuid]/metadata.yaml.":null!==Oi&&void 0!==Oi&&Oi.hasOwnProperty("error")?t=Oi:(null!==o&&void 0!==o&&o.includes("None")||null!==r&&void 0!==r&&r.includes("None"))&&(t={error:{displayMessage:"The variables_dir (".concat(o,") or remote_variables_dir (").concat(r,")")+" might be configured incorrectly. Please make sure those properties have values interpolated correctly in your project\u2019s metadata.yaml config file."}},i=[{label:"Check project configuration",onClick:function(){zo("".concat(Ze.dT.METADATA_YAML)),Te(null)}}]),(0,Pe.bB)(t,Te,i)}),[Xn,Oi,zo,null===(x=F)||void 0===x?void 0:x.remote_variables_dir,null===(j=F)||void 0===j?void 0:j.variables_dir,pe]);var vr=(0,p.useMemo)((function(){var e=[],n=[];return Ri.forEach((function(t){b.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[Ri]),pr=vr.blocksInNotebook,fr=vr.blocksInSidekick,hr=(0,p.useCallback)((function(e,n){return or({pipeline:{name:e,type:n}}).then((function(e){var t,i;if(null!==e&&void 0!==e&&null!==(t=e.data)&&void 0!==t&&t.pipeline){var o,r=e.data.pipeline.uuid;if(pe!==r)window.location.href="".concat(ce.basePath,"/pipelines/").concat(r,"/edit");else Go(),n!==(null===(o=F)||void 0===o?void 0:o.type)&&Jn(),(0,di.k1)(pr,pe,r),(0,di.k1)(fr,pe,r)}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&Se((function(e){return xl(xl({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){zo("pipelines/".concat(pe,"/").concat(Ze.dT.METADATA_YAML)),Se(null)}}]})}))}))}),[pr,fr,Go,Jn,zo,null===(k=F)||void 0===k?void 0:k.type,pe,ce,or]),mr=(0,p.useState)(null),gr=mr[0],br=mr[1],xr=(0,p.useState)(null),jr=xr[0],kr=xr[1],Zr=(0,p.useState)(null),yr=Zr[0],Pr=Zr[1],Cr=(0,p.useCallback)((function(e){return st({pipeline_interaction:xl(xl({},rt),{},{blocks:null!==e&&void 0!==e&&e.blockInteractionsMapping?null===e||void 0===e?void 0:e.blockInteractionsMapping:jr,interactions:gr,permissions:null===yr||void 0===yr?void 0:yr.map((function(e){var n=e.roles,t=e.triggers;return{roles:null===n||void 0===n?void 0:n.map((function(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.role})),triggers:null===t||void 0===t?void 0:t.map((function(e){return{schedule_interval:e.schedule_interval,schedule_type:e.schedule_type}}))}}))})})}),[jr,gr,yr,rt,st]),Or=(0,f.Db)((function(e){var n=e.extension_uuid,t=e.force,i=e.type,o=e.uuid,r={};return i&&(r.block_type=i),n&&(r.extension_uuid=n),"undefined"!==typeof t&&(r.force=t),Y.ZP.blocks.pipelines.useDelete(pe,encodeURIComponent(o),r)()}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;if(Ni((function(e){return(0,L.oM)(e,e.findIndex((function(e){var n=e.type,o=e.uuid;return t===n&&i===o})))})),Jn(),jn(null),wn){var o=xl({},jr);delete o[i],Cr({blockInteractionsMapping:o}).then((function(e){var n=e.pipeline_interaction;return kr(null===n||void 0===n?void 0:n.blocks)}))}},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Se({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&Kn((function(e){return xl(xl({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:ii.Gi.TEXT_PLAIN}}))))}))}})}}),wr=(0,r.Z)(Or,1)[0],_r=(0,$t.dd)((function(e){return(0,S.jsx)(Vt.Z,{centerOnScreen:!0,neutral:!0,onCancel:Er,onClick:function(){return Mr(e)},subtitle:"Deleting this block is dangerous. Your block may have downstream dependencies that depend on this block. You can delete this block anyway and remove it as a dependency from downstream blocks.",title:"Your block has dependencies",width:34*w.iI})})),Sr=(0,r.Z)(_r,2),Ir=Sr[0],Er=Sr[1],Tr=(0,f.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,o="".concat(t,"/").concat(i);return n&&Ze.JD[n]&&(o="".concat(o,".").concat(Ze.JD[n].toLowerCase())),Y.ZP.blocks.useDelete(encodeURIComponent(o))()}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){Mo(),Jn()},onErrorCallback:function(e,n){Ir(),Se({displayMessage:e.exception,errors:n,response:e})}})}}),Mr=(0,r.Z)(Tr,1)[0],Br=(0,f.Db)(Y.ZP.kernels.useUpdate("__auto_detect"),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){return J()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),Dr=(0,r.Z)(Br,1)[0],Rr=(0,p.useCallback)((function(){return Dr({kernel:{action_type:"restart"}})}),[Dr]),Nr=(0,p.useCallback)((function(){Dr({kernel:{action_type:"interrupt"}}),dn([])}),[Dr]),Lr=(0,f.Db)(Y.ZP.blocks.pipelines.useCreate(pe)),Fr=(0,r.Z)(Lr,1)[0];Io=(0,p.useCallback)((function(e,n,t){var i,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,G.Y6)(),c=arguments.length>4?arguments[4]:void 0;e.converted_from_type&&e.converted_from_uuid&&(i=null===(l=vi.current[e.converted_from_type])||void 0===l?void 0:l[e.converted_from_uuid]);var s=e.language,a=e.type;if(ht){var d,v=(0,L.HK)((null===(d=F)||void 0===d?void 0:d.blocks)||[],(function(e){return e.type})),p=v[b.tf.DATA_EXPORTER],f=v[b.tf.DATA_LOADER],h=v[b.tf.TRANSFORMER];if(b.tf.DATA_LOADER===a){if(b.t6.YAML!==s)return void Se({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(b.t6.YAML," and not ").concat(s,".")});var m;if(f)return void Se({displayMessage:"Pipeline ".concat(null===(m=F)||void 0===m?void 0:m.uuid," already has a source: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}else if(b.tf.TRANSFORMER===a){var g;if(h)return void Se({displayMessage:"Pipeline ".concat(null===(g=F)||void 0===g?void 0:g.uuid," already has a transformer: ").concat(null===h||void 0===h?void 0:h.uuid,".")})}else if(b.tf.DATA_EXPORTER===a){if(b.t6.YAML!==s)return void Se({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(b.t6.YAML," and not ").concat(s,".")});var x;if(p)return void Se({displayMessage:"Pipeline ".concat(null===(x=F)||void 0===x?void 0:x.uuid," already has a destination: ").concat(null===p||void 0===p?void 0:p.uuid,".")})}}var j=function(){return Fr({block:xl({content:i,name:u,priority:n,require_unique_name:!0},e)}).then((function(n){(0,Pe.wD)(n,{callback:function(){var e,i,l=n.data.block;(null===t||void 0===t||t(l),jt&&null!==ne&&void 0!==ne&&ne(null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)&&(0,cl.eM)())?null===(e=window)||void 0===e||null===(i=e.location)||void 0===i||i.reload():(null!==c&&void 0!==c&&c.disableFetchingFiles||Go(),Jn().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;Ni((function(e){var n=(0,o.Z)(t);Object.entries(i||{}).forEach((function(e){var t=(0,r.Z)(e,2),i=t[0],l=t[1].blocks;l&&n.push.apply(n,(0,o.Z)(l.map((function(e){return xl(xl({},e),{},{extension_uuid:i})}))))}));var l=(0,L.HK)(e,(function(e){return e.uuid})),u=[];return n.forEach((function(e){var n=l[e.uuid];n?u.push(n):u.push(e)})),u}))})))},onErrorCallback:function(n,t){var i,o=null===n||void 0===n||null===(i=n.error)||void 0===i?void 0:i.exception,r=(0,hl.u$)(xl(xl({},e),{},{name:u}));o&&r&&o.startsWith(ci.LR)?Se((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){zo(r),Se(null)}}],response:n}})):Se({errors:t,response:n})}})}))};return jt&&null!==ne&&void 0!==ne&&ne(null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)?or().then((function(){return j()})):j()}),[Fr,ne,null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW,Go,Jn,ht,zo,F,or,jt]);var Ur=(0,$t.dd)((function(e){var n=e.block,t=e.idx,i=e.isReplacingBlock,o=void 0!==i&&i,r=e.isUpdatingBlock,l=void 0!==r&&r,u=e.name,c=void 0===u?(0,G.Y6)():u,s=e.onCreateCallback;return(0,S.jsx)(ae.BC,{children:(0,S.jsx)(gn,{block:n,defaultName:c,isReplacingBlock:o,isUpdatingBlock:l,onClose:Kr,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l||o){var i,r=n.detach||!1;or({block:{color:(null===e||void 0===e?void 0:e.color)||null,detach:r,name:null===e||void 0===e?void 0:e.name,uuid:n.uuid},pipeline:{blocks:(null===(i=F)||void 0===i?void 0:i.blocks)||[]}}).then((function(){jn(null),Kr()}))}else Io(xl(xl({},n),(0,Tn.gR)(e,["name"])),t,s,null===e||void 0===e?void 0:e.name).then((function(){return Kr()}))},pipeline:F})})}),{},[Io,F],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),Hr=(0,r.Z)(Ur,2),Gr=Hr[0],Kr=Hr[1],zr=(0,$t.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,o=e.onSaveSuccess;return(0,S.jsx)(ae.BC,{children:(0,S.jsx)(uo.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),Yr()},onSaveSuccess:function(e){ie(),Yr(),null===o||void 0===o||o(e)}})})}),{},[ie],{background:!0,uuid:"configure_project"}),qr=(0,r.Z)(zr,2),Vr=qr[0],Yr=qr[1],Qr=(0,f.Db)(Y.ZP.widgets.pipelines.useCreate(pe)),Xr=(0,r.Z)(Qr,1)[0],Jr=(0,p.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,G.Y6)();return Xr({widget:xl({name:i,priority:n,type:b.tf.CHART},e)}).then((function(e){return(0,Pe.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),Go(),Jn(),oi(Fi.cH.CHARTS),De(n)},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}))}),[Go,Jn,Xr]);(0,p.useEffect)((function(){if(Be){var e,n=null===(e=ui.current[Be.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),De(null))}}),[Be,De]),(0,p.useEffect)((function(){Yn!==pe&&(Ni([]),Hi([]),no([]),Vn([]))}),[pe,Yn]),(0,p.useEffect)((function(){var e,n;if("undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.blocks)||"undefined"!==typeof(null===(n=F)||void 0===n?void 0:n.extensions)){var t,i,l,u,c,s,a,d,v=[];if("undefined"!==typeof(null===(t=F)||void 0===t?void 0:t.blocks))v.push.apply(v,(0,o.Z)(null===(c=F)||void 0===c?void 0:c.blocks));if("undefined"!==typeof(null===(i=F)||void 0===i?void 0:i.callbacks))v.push.apply(v,(0,o.Z)(null===(s=F)||void 0===s?void 0:s.callbacks));if("undefined"!==typeof(null===(l=F)||void 0===l?void 0:l.conditionals))v.push.apply(v,(0,o.Z)(null===(a=F)||void 0===a?void 0:a.conditionals));if("undefined"!==typeof(null===(u=F)||void 0===u?void 0:u.extensions))Object.entries((null===(d=F)||void 0===d?void 0:d.extensions)||{}).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1].blocks;i&&v.push.apply(v,(0,o.Z)(i.map((function(e){return xl(xl({},e),{},{extension_uuid:t})}))))}));Ni(v)}}),[null===(Z=F)||void 0===Z?void 0:Z.blocks,null===(P=F)||void 0===P?void 0:P.callbacks,null===(O=F)||void 0===O?void 0:O.conditionals,null===(_=F)||void 0===_?void 0:_.extensions]),(0,p.useEffect)((function(){var e;"undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.widgets)&&Hi(F.widgets)}),[null===(I=F)||void 0===I?void 0:I.widgets]),(0,p.useEffect)((function(){(null===Xi||void 0===Xi?void 0:Xi.length)>0&&0===(null===$i||void 0===$i?void 0:$i.length)&&(no(Xi),po(Xi[0]))}),[$i,Xi]);var $r=(0,Qt.Z)(Ri);(0,p.useEffect)((function(){var e;if(!je&&("undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.blocks)&&(!Ri.length||!(0,L.fS)(null===$r||void 0===$r?void 0:$r.map((function(e){return e.uuid})).sort(),null===Ri||void 0===Ri?void 0:Ri.map((function(e){return e.uuid})).sort())||(0,Tn.Qr)(Gn)))){var n=(0,di.Rt)(F.blocks),t=n.content,i=n.messages;vi.current=t,(0,Tn.Qr)(i)||Kn((function(e){return xl(xl({},i),e)})),ke(!0)}}),[Ri,$r,je,Gn,null===(E=F)||void 0===E?void 0:E.blocks,ke,Kn]),(0,p.useEffect)((function(){var e;if(!Ui.length&&"undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.widgets)){var n=(0,di.Rt)(F.widgets),t=n.content,i=n.messages;pi.current=t,Kn((function(e){return xl(xl({},i),e)}))}}),[null===(B=F)||void 0===B?void 0:B.widgets,Kn,Ui]),(0,p.useEffect)((function(){if(ni&&!pn){var e=Ri.find((function(e){var n,t=e.uuid;return(null===ni||void 0===ni||null===(n=ni.split(":"))||void 0===n?void 0:n[0])===t}));e&&(At((function(n){return xl(xl({},n),{},(0,l.Z)({},e.uuid,!1))})),Yi(e.uuid,e.type,null))}else(null===$r||void 0===$r?void 0:$r.length)!==(null===Ri||void 0===Ri?void 0:Ri.length)&&pn&&(At((function(e){return xl(xl({},e),{},(0,l.Z)({},pn.uuid,!1))})),Yi(pn.uuid,pn.type,null))}),[ni,Ri,null===$r||void 0===$r?void 0:$r.length,Yi,pn,At]);var el=(0,p.useMemo)((function(){return new g.Z}),[]),il=(0,p.useMemo)((function(){return{api_key:dl.lG,token:el.decodedToken.token}}),[el]),ol=(0,d.ZP)((0,ml.Ib)(),{onClose:function(){return(0,cl.eM)((function(){return console.log("socketUrlPublish closed")}))},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.block_type,i=n.execution_state,r=n.msg_type,u=n.pipeline_uuid,c=n.uuid;if(!c&&!u)return;var s=Ri.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==r?Kn((function(e){var t=e[c]||[];return xl(xl({},e),{},(0,l.Z)({},c,t.concat(n)))})):(Vn((function(e){return[].concat((0,o.Z)(e),[n])})),ii.uF.IDLE===i&&(dn([]),Jn(),c||tn(!1))),ii.uF.BUSY===i?dn((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!s?e:e.concat(s)})):ii.uF.IDLE===i&&dn((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),Un||Kt(!0)}},onOpen:function(){return(0,cl.eM)((function(){return console.log("socketUrlPublish opened")}))},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return(0,cl.eM)((function(){return console.log("Attempting to reconnect...")})),!0}}).sendMessage,rl=(0,p.useCallback)((function(){or().then((function(){tn(!0),Vn([]),ol(JSON.stringify(xl(xl({},il),{},{execute_pipeline:!0,pipeline_uuid:pe})))}))}),[pe,or,ol,il]),ll=(0,p.useCallback)((function(){ol(JSON.stringify(xl(xl({},il),{},{cancel_pipeline:!0,pipeline_uuid:pe})))}),[pe,ol,il]),bl=(0,p.useCallback)((function(){ol(JSON.stringify(xl(xl({},il),{},{cancel_pipeline:!0,pipeline_uuid:pe,skip_publish_message:!0})))}),[pe,ol,il]),jl=(0,p.useCallback)((function(){ol(JSON.stringify(xl(xl({},il),{},{check_if_pipeline_running:!0,pipeline_uuid:pe})))}),[pe,ol,il]);(0,p.useEffect)((function(){var e;return window.addEventListener("pagehide",bl),null===ce||void 0===ce||null===(e=ce.events)||void 0===e||e.on("routeChangeStart",bl),function(){var e;null===ce||void 0===ce||null===(e=ce.events)||void 0===e||e.off("routeChangeStart",bl),window.removeEventListener("pagehide",bl)}}),[bl,null===ce||void 0===ce?void 0:ce.events]);var kl=(0,p.useCallback)((function(e,n){var t=e.block,i=e.code,o=e.ignoreAlreadyRunning,r=e.runDownstream,u=void 0!==r&&r,c=e.runIncompleteUpstream,s=void 0!==c&&c,a=e.runSettings,d=void 0===a?{}:a,v=e.runTests,p=void 0!==v&&v,f=e.runUpstream,h=e.variables,m=t.extension_uuid,g=t.upstream_blocks,b=t.uuid;if(!an.find((function(e){var n=e.uuid;return b===n}))||o){var x,j,k="".concat(al.vF,"_").concat(null===(x=F)||void 0===x?void 0:x.uuid);ol(JSON.stringify(xl(xl({},il),{},{code:i,extension_uuid:m,output_messages_to_logs:!!(0,Ye.U2)(k),pipeline_uuid:null===(j=F)||void 0===j?void 0:j.uuid,run_downstream:u,run_incomplete_upstream:s,run_settings:d,run_tests:p,run_upstream:f,type:t.type,upstream_blocks:g,uuid:b,variables:h}))),Kn((function(e){return delete e[b],e})),Ne(!1),dn((function(e){return e.find((function(e){var n=e.uuid;return b===n}))?e:e.concat(t)})),ir((function(e){return xl(xl({},e),{},(0,l.Z)({},null===t||void 0===t?void 0:t.uuid,!0))}))}null!==n&&void 0!==n&&n.skipUpdating||Jn()}),[Jn,F,an,ol,Kn,dn,Ne,il]),Zl=(0,p.useCallback)((function(e,n){var t,i=e.block;return Un||null!==n&&void 0!==n&&n.skipUpdating?kl(e,n):null===(t=or({block:{outputs:[],uuid:i.uuid}},{contentOnly:!0}))||void 0===t?void 0:t.then((function(){return kl(e)}))}),[Un,kl,or]),yl=(0,$t.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,S.jsx)(ae.BC,{children:(0,S.jsx)(M.Z,{contained:!0,defaultLinkUUID:i,onClickCustomTemplate:function(e){t({config:{custom_template:e,custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid}}),Ol()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[ee.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),Pl=(0,r.Z)(yl,2),Cl=Pl[0],Ol=Pl[1],wl=Y.ZP.global_data_products.list({},{revalidateOnFocus:!1}).data,_l=(0,p.useMemo)((function(){return(null===wl||void 0===wl?void 0:wl.global_data_products)||[]}),[wl]),Sl=(0,$t.dd)((function(e){var n=e.addNewBlock;return(0,S.jsx)(ae.BC,{children:(0,S.jsx)(Dt.Z,{children:(0,S.jsx)(Et.Z,{globalDataProducts:_l,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:b.tf.GLOBAL_DATA_PRODUCT}),Tl()}})})})}),{},[_l],{background:!0,uuid:"global_data_products"}),Il=(0,r.Z)(Sl,2),El=Il[0],Tl=Il[1],Ml=(0,p.useRef)(null),Bl=(0,p.useState)(null),Dl=Bl[0],Al=Bl[1],Rl=(0,p.useMemo)((function(){return Fi.cH.INTERACTIONS===ei}),[ei]);(0,p.useEffect)((function(){var e,n;ei&&null!==Ml&&void 0!==Ml&&Ml.current&&Al(null===Ml||void 0===Ml||null===(e=Ml.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[ei,Zn,se,wn,Ml]),(0,p.useEffect)((function(){!gr&&(null===lt||void 0===lt?void 0:lt.length)>=1&&br((0,L.HK)(lt||[],(function(e){return e.uuid})))}),[lt,gr,br]),(0,p.useEffect)((function(){!jr&&null!==rt&&void 0!==rt&&rt.blocks&&kr(null===rt||void 0===rt?void 0:rt.blocks)}),[jr,rt,kr]);var Nl=(0,p.useMemo)((function(){return(0,S.jsx)(nl,{activeView:ei,addNewBlockAtIndex:function(e,n,t,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(){return Gr({block:e,idx:n,isReplacingBlock:o,name:i,onCreateCallback:t})}))},afterWidth:Ce,autocompleteItems:Bo,blockInteractionsMapping:jr,blockRefs:li,blocks:Ri,blocksInNotebook:pr,cancelPipeline:ll,chartRefs:ui,checkIfPipelineRunning:jl,containerHeightOffset:Rl?Dl+1:null,contentByBlockUUID:vi,createInteraction:pt,deleteBlock:wr,deleteWidget:Ao,editingBlock:rn,executePipeline:rl,fetchFiles:Go,fetchPipeline:Jn,fetchSecrets:Bi,fetchVariables:Ii,globalDataProducts:_l,globalVariables:Ei,insights:Co,interactions:lt,interactionsMapping:gr,interruptKernel:Nr,isLoadingCreateInteraction:ft,isLoadingUpdatePipelineInteraction:at,isPipelineExecuting:en,isPipelineUpdating:er,lastTerminalMessage:Q,messages:Gn,metadata:wo,onChangeCallbackBlock:xi,onChangeChartBlock:Zi,onChangeCodeBlock:ji,onSelectBlockFile:Yi,onUpdateFileSuccess:Ro,permissions:yr,pipeline:F,pipelineInteraction:rt,pipelineMessages:qn,project:oe,refAfterFooter:Ml,runBlock:Zl,runningBlocks:an,sampleData:xo,savePipelineContent:or,savePipelineInteraction:Cr,secrets:Di,selectedBlock:pn,selectedFilePath:qo,sendTerminalMessage:X,setActiveSidekickView:oi,setAllowCodeBlockShortcuts:qe,setAnyInputFocused:Ue,setBlockInteractionsMapping:kr,setDisableShortcuts:Ge,setEditingBlock:ln,setErrors:Se,setHiddenBlocks:At,setInteractionsMapping:br,setPermissions:Pr,setSelectedBlock:jn,setTextareaFocused:Ne,showBrowseTemplates:Cl,showDataIntegrationModal:ar,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,G.Y6)(),t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(){return Gr({block:e,isReplacingBlock:t,isUpdatingBlock:!t,name:n})}))},sideBySideEnabled:jt,statistics:So,textareaFocused:Re,treeRef:si,updatePipelineInteraction:st,updatePipelineMetadata:hr,updateWidget:Vi,widgets:Ui})}),[ei,Dl,Ce,Bo,jr,li,Ri,pr,ll,jl,vi,pt,wr,Ao,rn,rl,Go,Jn,Bi,Ii,_l,Ei,Co,lt,gr,Nr,ft,at,en,er,Rl,Q,Gn,wo,xi,Zi,ji,Yi,Ro,yr,F,rt,qn,oe,Ml,Zl,an,xo,or,Cr,Di,pn,qo,X,Ue,kr,ln,Se,At,br,Pr,Ne,Gr,Cl,ar,jt,So,Re,st,hr,Vi,Ui]),Ll=(0,p.useMemo)((function(){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{style:{height:he?null:0,opacity:he?null:0,visibility:he?null:"hidden"},children:Nl}),(0,S.jsx)("div",{style:{height:he?0:null,opacity:he?0:null,visibility:he?"hidden":null},children:Wo})]})}),[Wo,he,Nl]),Fl=(0,p.useMemo)((function(){return he?(0,S.jsx)(tl,{activeView:ei,pipeline:F,project:oe,secrets:Di,selectedBlock:pn,setSelectedBlock:jn,variables:Ei}):(0,S.jsx)(It.Z,{children:Vo})}),[ei,Vo,Ei,F,oe,Di,pn,jn]),Ul=(0,$t.dd)((function(e){var n=e.blockIndex;return(0,S.jsx)(ae.BC,{children:(0,S.jsx)(nn,{contained:!0,defaultBlockType:b.tf.DBT,onClickAction:function(e){var t;Io((0,di.J8)({blockIndex:n,blocks:Ri,filePath:null===e||void 0===e||null===(t=e.row)||void 0===t?void 0:t.fullPath,repoPathRelativeRoot:null===le||void 0===le?void 0:le.repo_path_relative_root}),("undefined"===typeof n||null===n?null===Ri||void 0===Ri?void 0:Ri.length:n+1)-(jt?1:0),(function(e){jn(e),Gl()}))}})})}),{},[Io,jt,le],{background:!0,disableClickOutside:!1,disableCloseButton:!1,disableEscape:!0,uuid:"BlockBrowser/".concat(pe)}),Hl=(0,r.Z)(Ul,2),Wl=Hl[0],Gl=Hl[1],Kl=(0,p.useCallback)((function(e,n,t,i){return new Promise((function(){var o;fn.L.BLOCK_FILE!==(null===e||void 0===e||null===(o=e.block_action_object)||void 0===o?void 0:o.object_type)&&(b.tf.DBT!==(null===e||void 0===e?void 0:e.type)||b.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?Gr({block:e,idx:n,name:i,onCreateCallback:t}):Io(e,n,t,i)}))}),[Io,Gr]),zl=(0,p.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,G.Y6)();return new Promise((function(){return Gr({block:e,isUpdatingBlock:!0,name:n})}))}),[Gr]),ql=(0,p.useCallback)((function(e,n){var t=n.onCreateCallback;return Jr(e,Ui.length,t)}),[Jr,Ui]),Vl=(0,p.useMemo)((function(){return(0,S.jsx)(eo,{addNewBlockAtIndex:Kl,addWidget:ql,afterHidden:Zn,allBlocks:Ri,allowCodeBlockShortcuts:ze,anyInputFocused:Fe,autocompleteItems:Bo,beforeHidden:Cn,blockInteractionsMapping:jr,blockRefs:li,blocks:pr,blocksThatNeedToRefresh:hi,dataProviders:wi,deleteBlock:wr,disableShortcuts:We,fetchFiles:Go,fetchPipeline:Jn,fetchSampleData:go,files:Ko,globalDataProducts:_l,globalVariables:Ei,hiddenBlocks:Rn,interactionsMapping:gr,interruptKernel:Nr,mainContainerRef:Ln,mainContainerWidth:Pi,messages:Gn,onChangeCallbackBlock:xi,onChangeCodeBlock:ji,openSidekickView:ri,pipeline:F,pipelineContentTouched:Gt,restartKernel:Rr,runBlock:Zl,runningBlocks:an,savePipelineContent:or,scrollTogether:Ot,selectedBlock:pn,setAnyInputFocused:Ue,setDisableShortcuts:Ge,setEditingBlock:ln,setErrors:Se,setHiddenBlocks:At,setIntegrationStreams:oo,setOutputBlocks:no,setPipelineContentTouched:Kt,setSelectedBlock:jn,setSelectedOutputBlock:po,setSelectedStream:so,setSideBySideEnabled:_t,setScrollTogether:wt,setTextareaFocused:Ne,showBlockBrowserModal:Wl,showBrowseTemplates:Cl,showConfigureProjectModal:Vr,showDataIntegrationModal:ar,showGlobalDataProducts:El,showUpdateBlockModal:zl,sideBySideEnabled:jt,textareaFocused:Re,widgets:Ui})}),[Kl,ql,Zn,ze,Fe,Bo,Cn,li,jr,Ri,pr,hi,wi,wr,We,Go,Jn,go,Ko,_l,Ei,Rn,gr,Nr,Ln,Pi,Gn,xi,ji,ri,F,Gt,Rr,Zl,an,or,Ot,pn,Ue,ln,Se,At,Kt,jn,Ne,_t,wt,Wl,Cl,Vr,ar,El,zl,jt,Re,Ui]),Yl=(0,p.useMemo)((function(){if(W===ci.b7)return(0,S.jsx)(St,{cancelPipeline:ll,createPipeline:Qo,executePipeline:rl,interruptKernel:Nr,isPipelineExecuting:en,pipeline:F,restartKernel:Rr,savePipelineContent:or,scrollTogether:Ot,setActiveSidekickView:oi,setMessages:Kn,setScrollTogether:wt,setSideBySideEnabled:_t,sideBySideEnabled:jt,updatePipelineMetadata:hr})}),[ll,Qo,rl,Nr,en,W,F,Rr,or,Ot,qo,Kn,wt,_t,jt,hr]),Ql=(0,p.useCallback)((function(e){e.widthOffset;if(W===ci.b7)return(0,S.jsx)(qi.rK,{relativePosition:!0,children:(0,S.jsxs)(ti,{isBusy:an.length>=1,pipeline:F,restartKernel:Rr,savePipelineContent:or,setErrors:Se,setRunningBlocks:dn,updatePipelineMetadata:hr,children:[(0,S.jsx)(C.Z,{pr:1}),Yl]})})}),[Yl,Vo,W,F,Rr,an,or,Se,hr]),Xl=(0,p.useMemo)((function(){var e;if(W===ci.b7)return(0,S.jsx)(ul,{pipelineType:null===(e=F)||void 0===e?void 0:e.type,pipelineContentTouched:Gt,pipelineLastSaved:Nt,ref:z,saveStatus:rr,width:Pi})}),[Pi,W,F,Gt,Nt,rr]),Jl=(0,p.useMemo)((function(){var e;return null===io||void 0===io||null===(e=io.filter((function(e){return(0,L.sE)(null===bo||void 0===bo?void 0:bo.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,G.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,S.jsx)(C.Z,{pl:1,children:(0,S.jsx)(un.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return so(e)},selected:co===e,uuid:e,children:e})},e)}))}),[bo,io,co]),$l=(0,p.useMemo)((function(){return(0,S.jsx)(T,{blockRefs:li,hiddenBlocks:Rn,pipeline:F,setHiddenBlocks:At})}),[li,Rn,F,At]),eu=(0,p.useMemo)((function(){return ci.Jf.uuid===(null===En||void 0===En?void 0:En.uuid)?Ho:ci.IY.uuid===(null===En||void 0===En?void 0:En.uuid)?$l:null}),[$l,Ho,En]),nu=(0,p.useMemo)((function(){return(0,S.jsx)(C.Z,{px:1,children:(0,S.jsx)(ve.Z,{noPadding:!0,onClickTab:function(e){Bn(e)},selectedTabUUID:null===En||void 0===En?void 0:En.uuid,tabs:ci.NR,underlineColor:(ue||U.Z).accent.purple,underlineStyle:!0})})}),[Bn,En,ue]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Tt.Z,{title:null===(D=F)||void 0===D?void 0:D.name}),(0,S.jsxs)(lo,{after:Ll,afterHeader:Fl,afterHeightOffset:H.Mz,afterHidden:Zn,afterInnerHeightMinus:Dl,afterNavigationItems:fl({activeView:ei,pipeline:F,project:oe,secrets:Di,setActiveSidekickView:oi,variables:Ei}),afterOverflow:Fi.cH.DATA===ei?"hidden":null,afterSubheader:(null===$i||void 0===$i?void 0:$i.length)>0&&ei===Fi.cH.DATA&&(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!ht&&$i.map((function(e){var n=e.uuid,t=(null===vo||void 0===vo?void 0:vo.uuid)===n;return(0,S.jsx)(C.Z,{pl:1,children:(0,S.jsx)(un.ZP,{afterElement:t?(0,S.jsx)(be.ZP,{basic:!0,highlightOnHover:!0,onClick:function(){(0,di.h8)(pe,e.uuid),no((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,S.jsx)(N.Close,{muted:!0,size:1.25*w.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return po(e)},selected:t,uuid:n,children:n})},n)})),ht&&Jl]}),before:eu,beforeHeader:nu,beforeHeightOffset:H.Mz,beforeHidden:Cn,beforeNavigationItems:(0,pl.H)(vl.M.EDIT,F),errors:Ee||_e,footerOffset:null===z||void 0===z||null===(A=z.current)||void 0===A||null===(R=A.getBoundingClientRect())||void 0===R?void 0:R.height,mainContainerFooter:Xl,mainContainerHeader:Ql,mainContainerRef:Ln,page:W,pipeline:F,setAfterHidden:yn,setAfterWidthForChildren:Oe,setBeforeHidden:On,setErrors:Ee?Te:Se,setMainContainerWidth:Ci,children:[(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(pe),children:Vl}),(0,S.jsx)(C.Z,{pb:jt?0:Math.max(Math.floor(se*(2/3)/w.iI),0)})]})]})}jl.getInitialProps=function(){var e=(0,i.Z)(c().mark((function e(n){var t,i,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,i=ci.b7,o={page:i,pipeline:{uuid:t}},e.abrupt("return",o);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var kl=(0,co.Z)(jl)},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(45990)}])}},function(e){e.O(0,[9774,3662,6085,125,2714,9161,2631,7011,4783,1557,8038,2479,9264,8095,3449,635,523,8192,3548,9265,3366,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|