mage-ai 0.9.69__py3-none-any.whl → 0.9.71__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/ai/utils/xgboost.py +222 -0
- mage_ai/api/errors.py +37 -25
- mage_ai/api/operations/base.py +13 -1
- mage_ai/api/parsers/PipelineScheduleParser.py +1 -1
- mage_ai/api/policies/BackfillPolicy.py +1 -0
- mage_ai/api/policies/BlockOutputPolicy.py +40 -17
- mage_ai/api/policies/GlobalDataProductPolicy.py +91 -41
- mage_ai/api/policies/KernelPolicy.py +55 -32
- mage_ai/api/policies/KernelProcessPolicy.py +56 -0
- mage_ai/api/policies/OutputPolicy.py +73 -41
- mage_ai/api/policies/PipelinePolicy.py +206 -137
- mage_ai/api/policies/WorkspacePolicy.py +1 -0
- mage_ai/api/presenters/BackfillPresenter.py +1 -0
- mage_ai/api/presenters/BlockLayoutItemPresenter.py +9 -7
- mage_ai/api/presenters/BlockPresenter.py +1 -1
- mage_ai/api/presenters/GlobalDataProductPresenter.py +6 -1
- mage_ai/api/presenters/KernelPresenter.py +5 -26
- mage_ai/api/presenters/KernelProcessPresenter.py +28 -0
- mage_ai/api/presenters/PipelinePresenter.py +18 -5
- mage_ai/api/presenters/StatusPresenter.py +2 -0
- mage_ai/api/presenters/SyncPresenter.py +25 -0
- mage_ai/api/resources/AutocompleteItemResource.py +1 -1
- mage_ai/api/resources/BlockLayoutItemResource.py +90 -44
- mage_ai/api/resources/BlockOutputResource.py +42 -9
- mage_ai/api/resources/BlockResource.py +4 -3
- mage_ai/api/resources/BlockRunResource.py +27 -22
- mage_ai/api/resources/ClusterResource.py +4 -1
- mage_ai/api/resources/CustomTemplateResource.py +34 -14
- mage_ai/api/resources/DataProviderResource.py +1 -1
- mage_ai/api/resources/ExecutionStateResource.py +3 -1
- mage_ai/api/resources/FileContentResource.py +8 -2
- mage_ai/api/resources/FileResource.py +10 -4
- mage_ai/api/resources/FileVersionResource.py +3 -1
- mage_ai/api/resources/GitBranchResource.py +101 -31
- mage_ai/api/resources/GitCustomBranchResource.py +29 -1
- mage_ai/api/resources/GlobalDataProductResource.py +44 -7
- mage_ai/api/resources/GlobalHookResource.py +4 -1
- mage_ai/api/resources/IntegrationDestinationResource.py +6 -2
- mage_ai/api/resources/IntegrationSourceResource.py +8 -4
- mage_ai/api/resources/IntegrationSourceStreamResource.py +6 -2
- mage_ai/api/resources/KernelProcessResource.py +44 -0
- mage_ai/api/resources/KernelResource.py +25 -3
- mage_ai/api/resources/OauthResource.py +1 -1
- mage_ai/api/resources/OutputResource.py +33 -11
- mage_ai/api/resources/PageBlockLayoutResource.py +34 -23
- mage_ai/api/resources/PipelineInteractionResource.py +31 -15
- mage_ai/api/resources/PipelineResource.py +258 -125
- mage_ai/api/resources/PipelineRunResource.py +52 -7
- mage_ai/api/resources/PipelineScheduleResource.py +11 -2
- mage_ai/api/resources/PipelineTriggerResource.py +6 -1
- mage_ai/api/resources/ProjectResource.py +18 -7
- mage_ai/api/resources/PullRequestResource.py +6 -4
- mage_ai/api/resources/SecretResource.py +1 -1
- mage_ai/api/resources/SeedResource.py +8 -1
- mage_ai/api/resources/StatusResource.py +21 -6
- mage_ai/api/resources/SyncResource.py +6 -8
- mage_ai/api/resources/VariableResource.py +46 -26
- mage_ai/api/resources/VersionControlProjectResource.py +9 -2
- mage_ai/api/resources/WidgetResource.py +1 -1
- mage_ai/api/resources/WorkspaceResource.py +6 -5
- mage_ai/api/views.py +47 -40
- mage_ai/authentication/permissions/seed.py +16 -2
- mage_ai/authentication/providers/oidc.py +21 -1
- mage_ai/autocomplete/utils.py +13 -9
- mage_ai/cache/base.py +1 -1
- mage_ai/cache/block.py +18 -12
- mage_ai/cache/block_action_object/__init__.py +33 -5
- mage_ai/cache/file.py +22 -19
- mage_ai/cache/pipeline.py +18 -12
- mage_ai/cli/main.py +1 -0
- mage_ai/cluster_manager/aws/emr_cluster_manager.py +9 -5
- mage_ai/cluster_manager/config.py +2 -2
- mage_ai/cluster_manager/kubernetes/workload_manager.py +52 -1
- mage_ai/cluster_manager/manage.py +1 -1
- mage_ai/cluster_manager/workspace/base.py +7 -1
- mage_ai/cluster_manager/workspace/kubernetes.py +22 -1
- mage_ai/command_center/applications/factory.py +10 -7
- mage_ai/command_center/applications/utils.py +2 -2
- mage_ai/command_center/files/factory.py +17 -15
- mage_ai/command_center/presenters/text.py +1 -1
- mage_ai/command_center/utils.py +25 -13
- mage_ai/data/__init__.py +0 -0
- mage_ai/data/constants.py +45 -0
- mage_ai/data/models/__init__.py +0 -0
- mage_ai/data/models/base.py +119 -0
- mage_ai/data/models/constants.py +1 -0
- mage_ai/data/models/generator.py +115 -0
- mage_ai/data/models/manager.py +168 -0
- mage_ai/data/models/pyarrow/__init__.py +0 -0
- mage_ai/data/models/pyarrow/record_batch.py +55 -0
- mage_ai/data/models/pyarrow/shared.py +21 -0
- mage_ai/data/models/pyarrow/table.py +8 -0
- mage_ai/data/models/reader.py +103 -0
- mage_ai/data/models/utils.py +59 -0
- mage_ai/data/models/writer.py +91 -0
- mage_ai/data/tabular/__init__.py +0 -0
- mage_ai/data/tabular/constants.py +23 -0
- mage_ai/data/tabular/mocks.py +19 -0
- mage_ai/data/tabular/models.py +126 -0
- mage_ai/data/tabular/reader.py +602 -0
- mage_ai/data/tabular/utils.py +102 -0
- mage_ai/data/tabular/writer.py +266 -0
- mage_ai/data/variables/__init__.py +0 -0
- mage_ai/data/variables/wrapper.py +54 -0
- mage_ai/data_cleaner/analysis/charts.py +61 -39
- mage_ai/data_cleaner/column_types/column_type_detector.py +53 -31
- mage_ai/data_cleaner/estimators/encoders.py +5 -2
- mage_ai/data_integrations/utils/scheduler.py +16 -11
- mage_ai/data_preparation/decorators.py +1 -0
- mage_ai/data_preparation/executors/block_executor.py +237 -155
- mage_ai/data_preparation/executors/k8s_block_executor.py +30 -7
- mage_ai/data_preparation/executors/k8s_pipeline_executor.py +30 -7
- mage_ai/data_preparation/executors/streaming_pipeline_executor.py +2 -2
- mage_ai/data_preparation/git/__init__.py +77 -29
- mage_ai/data_preparation/git/api.py +69 -8
- mage_ai/data_preparation/git/utils.py +64 -34
- mage_ai/data_preparation/logging/logger_manager.py +4 -3
- mage_ai/data_preparation/models/block/__init__.py +1562 -879
- mage_ai/data_preparation/models/block/data_integration/mixins.py +4 -3
- mage_ai/data_preparation/models/block/dynamic/__init__.py +17 -6
- mage_ai/data_preparation/models/block/dynamic/child.py +41 -102
- mage_ai/data_preparation/models/block/dynamic/constants.py +1 -0
- mage_ai/data_preparation/models/block/dynamic/counter.py +296 -0
- mage_ai/data_preparation/models/block/dynamic/data.py +16 -0
- mage_ai/data_preparation/models/block/dynamic/factory.py +163 -0
- mage_ai/data_preparation/models/block/dynamic/models.py +19 -0
- mage_ai/data_preparation/models/block/dynamic/shared.py +92 -0
- mage_ai/data_preparation/models/block/dynamic/utils.py +295 -167
- mage_ai/data_preparation/models/block/dynamic/variables.py +384 -144
- mage_ai/data_preparation/models/block/dynamic/wrappers.py +77 -0
- mage_ai/data_preparation/models/block/extension/utils.py +10 -1
- mage_ai/data_preparation/models/block/global_data_product/__init__.py +35 -3
- mage_ai/data_preparation/models/block/integration/__init__.py +6 -2
- mage_ai/data_preparation/models/block/outputs.py +722 -0
- mage_ai/data_preparation/models/block/platform/mixins.py +7 -8
- mage_ai/data_preparation/models/block/r/__init__.py +56 -38
- mage_ai/data_preparation/models/block/remote/__init__.py +0 -0
- mage_ai/data_preparation/models/block/remote/models.py +58 -0
- mage_ai/data_preparation/models/block/settings/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/dynamic/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/dynamic/constants.py +7 -0
- mage_ai/data_preparation/models/block/settings/dynamic/mixins.py +118 -0
- mage_ai/data_preparation/models/block/settings/dynamic/models.py +31 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/mixins.py +20 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/models.py +46 -0
- mage_ai/data_preparation/models/block/settings/variables/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/variables/mixins.py +74 -0
- mage_ai/data_preparation/models/block/settings/variables/models.py +49 -0
- mage_ai/data_preparation/models/block/spark/mixins.py +2 -1
- mage_ai/data_preparation/models/block/sql/__init__.py +30 -5
- mage_ai/data_preparation/models/block/sql/utils/shared.py +21 -3
- mage_ai/data_preparation/models/block/utils.py +164 -69
- mage_ai/data_preparation/models/constants.py +21 -14
- mage_ai/data_preparation/models/custom_templates/custom_block_template.py +18 -13
- mage_ai/data_preparation/models/custom_templates/custom_pipeline_template.py +33 -16
- mage_ai/data_preparation/models/custom_templates/utils.py +1 -1
- mage_ai/data_preparation/models/file.py +41 -28
- mage_ai/data_preparation/models/global_data_product/__init__.py +100 -58
- mage_ai/data_preparation/models/global_hooks/models.py +1 -0
- mage_ai/data_preparation/models/interfaces.py +29 -0
- mage_ai/data_preparation/models/pipeline.py +374 -185
- mage_ai/data_preparation/models/pipelines/integration_pipeline.py +1 -2
- mage_ai/data_preparation/models/pipelines/seed.py +1 -1
- mage_ai/data_preparation/models/project/__init__.py +66 -18
- mage_ai/data_preparation/models/project/constants.py +2 -0
- mage_ai/data_preparation/models/triggers/__init__.py +124 -26
- mage_ai/data_preparation/models/utils.py +467 -17
- mage_ai/data_preparation/models/variable.py +1028 -137
- mage_ai/data_preparation/models/variables/__init__.py +0 -0
- mage_ai/data_preparation/models/variables/cache.py +149 -0
- mage_ai/data_preparation/models/variables/constants.py +72 -0
- mage_ai/data_preparation/models/variables/summarizer.py +336 -0
- mage_ai/data_preparation/models/variables/utils.py +77 -0
- mage_ai/data_preparation/models/widget/__init__.py +63 -41
- mage_ai/data_preparation/models/widget/charts.py +40 -27
- mage_ai/data_preparation/models/widget/constants.py +2 -0
- mage_ai/data_preparation/models/widget/utils.py +3 -3
- mage_ai/data_preparation/preferences.py +3 -3
- mage_ai/data_preparation/repo_manager.py +55 -21
- mage_ai/data_preparation/storage/base_storage.py +2 -2
- mage_ai/data_preparation/storage/gcs_storage.py +7 -4
- mage_ai/data_preparation/storage/local_storage.py +18 -9
- mage_ai/data_preparation/storage/s3_storage.py +5 -2
- mage_ai/data_preparation/templates/data_exporters/streaming/oracledb.yaml +8 -0
- mage_ai/data_preparation/variable_manager.py +281 -76
- mage_ai/io/base.py +3 -2
- mage_ai/io/bigquery.py +1 -0
- mage_ai/io/redshift.py +7 -5
- mage_ai/kernels/__init__.py +0 -0
- mage_ai/kernels/models.py +188 -0
- mage_ai/kernels/utils.py +169 -0
- mage_ai/orchestration/concurrency.py +6 -2
- mage_ai/orchestration/db/__init__.py +1 -0
- mage_ai/orchestration/db/migrations/versions/0227396a216c_add_userproject_table.py +38 -0
- mage_ai/orchestration/db/migrations/versions/42a14d6143f1_update_token_column_type.py +54 -0
- mage_ai/orchestration/db/models/dynamic/__init__.py +0 -0
- mage_ai/orchestration/db/models/dynamic/controller.py +67 -0
- mage_ai/orchestration/db/models/oauth.py +12 -18
- mage_ai/orchestration/db/models/projects.py +10 -0
- mage_ai/orchestration/db/models/schedules.py +225 -187
- mage_ai/orchestration/db/models/schedules_project_platform.py +18 -12
- mage_ai/orchestration/db/models/utils.py +46 -5
- mage_ai/orchestration/metrics/pipeline_run.py +8 -9
- mage_ai/orchestration/notification/sender.py +38 -15
- mage_ai/orchestration/pipeline_scheduler_original.py +64 -33
- mage_ai/orchestration/pipeline_scheduler_project_platform.py +1 -1
- mage_ai/orchestration/run_status_checker.py +11 -4
- mage_ai/orchestration/triggers/api.py +41 -2
- mage_ai/orchestration/triggers/global_data_product.py +9 -4
- mage_ai/orchestration/triggers/utils.py +10 -1
- mage_ai/orchestration/utils/resources.py +3 -0
- mage_ai/presenters/charts/data_sources/base.py +4 -2
- mage_ai/presenters/charts/data_sources/block.py +15 -9
- mage_ai/presenters/charts/data_sources/chart_code.py +8 -5
- mage_ai/presenters/charts/data_sources/constants.py +1 -0
- mage_ai/presenters/charts/data_sources/system_metrics.py +22 -0
- mage_ai/presenters/interactions/models.py +11 -7
- mage_ai/presenters/pages/loaders/pipelines.py +5 -3
- mage_ai/presenters/pages/models/page_components/pipeline_schedules.py +3 -1
- mage_ai/presenters/utils.py +2 -0
- mage_ai/server/api/blocks.py +2 -1
- mage_ai/server/api/downloads.py +9 -2
- mage_ai/server/api/runs.py +151 -0
- mage_ai/server/api/triggers.py +3 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +8 -8
- mage_ai/server/frontend_dist/_next/static/UZLabyPgcxtZvp0O0EUUS/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1376-22de38b4ad008d8a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1557-25a7d985d5564fd3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1668-30b4619b9534519b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1799-c42db95a015689ee.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2996-2108b53b9d371d8d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{3763-61b542dafdbf5754.js → 3763-40780c6d1e4b261d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3782-129dd2a2448a2e36.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3958-bcdfa414ccfa1eb2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4168-97fd1578d1a38315.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4982-fa5a238b139fbdd2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5699-176f445e1313f001.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7162-7dd03f0f605de721.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7779-68d2b72a90c5f925.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7966-5446a8e43711e2f9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8023-6c2f172f48dcb99b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8095-c351b8a735d73e0c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{main-77fe248a6fbd12d8.js → main-b99d4e30a88d9dc7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-9fe2d9d07c94e968.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{block-layout-14f952f66964022f.js → block-layout-7f4b735c67115df5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-e7d48e6b0c3068ac.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products-b943f31f050fc3a4.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{overview-597b74828bf105db.js → overview-9f1ac4ec003884f3.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-3edc6270c5b0e962.js → frontend_dist/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7e737f6fc7e83e9b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-d94488e3f2eeef36.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-cc641a7fa8473796.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-a5c0362763a21fa8.js → block-runs-284309877f3c5a5a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-26250e5335194ade.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-7acc7afc00df17c2.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-5f4c8128b2413fd8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-4ebfc8e400315dda.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-e5e0150a256aadb3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/{profile-3f0df3decc856ee9.js → profile-3ae43c932537b254.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-b603d7fe4b175256.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-c2e9ef989c8bfa73.js → frontend_dist/_next/static/chunks/pages/settings/platform/settings-319ddbabc239e91b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-47b64ced27c24985.js → [...slug]-5c360f72e4498855.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-e5a4d3d815cec25d.js → permissions-fb29fa6c2bd90bb0.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-3b76fa959ffa09d3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-379e1ee292504842.js → [...slug]-3b787b42f1093b1f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles-0b83fbdd39e85f5b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-a1e6950974d643a8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-2af9afbe727d88aa.js → [...slug]-0aa019d87db8b0b8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-a4db8710f703c729.js → users-88c694d19207f2ec.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{triggers-9cba3211434a8966.js → triggers-a599c6ac89be8c8d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-31d0d50f7f30462b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{webpack-d079359c241db804.js → webpack-ac7fdc472bedf682.js} +1 -1
- mage_ai/server/frontend_dist/block-layout.html +3 -3
- mage_ai/server/frontend_dist/compute.html +6 -6
- mage_ai/server/frontend_dist/files.html +6 -6
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +6 -6
- mage_ai/server/frontend_dist/global-data-products.html +6 -6
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist/global-hooks.html +6 -6
- mage_ai/server/frontend_dist/index.html +3 -3
- mage_ai/server/frontend_dist/manage/files.html +6 -6
- mage_ai/server/frontend_dist/manage/settings.html +6 -6
- mage_ai/server/frontend_dist/manage/users/[user].html +6 -6
- mage_ai/server/frontend_dist/manage/users/new.html +6 -6
- mage_ai/server/frontend_dist/manage/users.html +6 -6
- mage_ai/server/frontend_dist/manage.html +6 -6
- mage_ai/server/frontend_dist/oauth.html +5 -5
- mage_ai/server/frontend_dist/overview.html +6 -6
- mage_ai/server/frontend_dist/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist/pipelines.html +6 -6
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist/platform/global-hooks.html +6 -6
- mage_ai/server/frontend_dist/settings/account/profile.html +6 -6
- mage_ai/server/frontend_dist/settings/platform/preferences.html +6 -6
- mage_ai/server/frontend_dist/settings/platform/settings.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/roles.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/users.html +6 -6
- mage_ai/server/frontend_dist/settings.html +3 -3
- mage_ai/server/frontend_dist/sign-in.html +15 -15
- mage_ai/server/frontend_dist/templates/[...slug].html +6 -6
- mage_ai/server/frontend_dist/templates.html +6 -6
- mage_ai/server/frontend_dist/terminal.html +6 -6
- mage_ai/server/frontend_dist/test.html +3 -3
- mage_ai/server/frontend_dist/triggers.html +6 -6
- mage_ai/server/frontend_dist/version-control.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/404.html +8 -8
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1376-22de38b4ad008d8a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-25a7d985d5564fd3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1668-30b4619b9534519b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1799-c42db95a015689ee.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2996-2108b53b9d371d8d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3763-61b542dafdbf5754.js → 3763-40780c6d1e4b261d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-129dd2a2448a2e36.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3958-bcdfa414ccfa1eb2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4168-97fd1578d1a38315.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4982-fa5a238b139fbdd2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5699-176f445e1313f001.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7162-7dd03f0f605de721.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7779-68d2b72a90c5f925.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-5446a8e43711e2f9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8023-6c2f172f48dcb99b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8095-c351b8a735d73e0c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{main-70b78159c2bb3fe1.js → main-384298e9133cec76.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-13a578bce3b7f30c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{block-layout-14f952f66964022f.js → block-layout-7f4b735c67115df5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-e7d48e6b0c3068ac.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products-b943f31f050fc3a4.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{overview-597b74828bf105db.js → overview-9f1ac4ec003884f3.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipeline-runs-3edc6270c5b0e962.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7e737f6fc7e83e9b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-d94488e3f2eeef36.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-cc641a7fa8473796.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-a5c0362763a21fa8.js → block-runs-284309877f3c5a5a.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-26250e5335194ade.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-7acc7afc00df17c2.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-5f4c8128b2413fd8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-4ebfc8e400315dda.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-e5e0150a256aadb3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/{profile-3f0df3decc856ee9.js → profile-3ae43c932537b254.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-b603d7fe4b175256.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/platform/settings-c2e9ef989c8bfa73.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-319ddbabc239e91b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-47b64ced27c24985.js → [...slug]-5c360f72e4498855.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-e5a4d3d815cec25d.js → permissions-fb29fa6c2bd90bb0.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-3b76fa959ffa09d3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-379e1ee292504842.js → [...slug]-3b787b42f1093b1f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles-0b83fbdd39e85f5b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-a1e6950974d643a8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-2af9afbe727d88aa.js → [...slug]-0aa019d87db8b0b8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-a4db8710f703c729.js → users-88c694d19207f2ec.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{triggers-9cba3211434a8966.js → triggers-a599c6ac89be8c8d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-31d0d50f7f30462b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-68c003fb6a175cd7.js → webpack-481689d9989710cd.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/kcptwoOU-JJJg6Vwpkfmx/_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 +6 -6
- mage_ai/server/frontend_dist_base_path_template/files.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/index.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/oauth.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/overview.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +6 -6
- 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 +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +15 -15
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/templates.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/terminal.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/test.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/triggers.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/version-control.html +6 -6
- mage_ai/server/kernel_output_parser.py +4 -1
- mage_ai/server/scheduler_manager.py +12 -1
- mage_ai/server/server.py +69 -42
- mage_ai/server/utils/custom_output.py +284 -0
- mage_ai/server/utils/execute_custom_code.py +245 -0
- mage_ai/server/utils/output_display.py +123 -289
- mage_ai/server/websocket_server.py +116 -69
- mage_ai/services/aws/ecs/ecs.py +1 -0
- mage_ai/services/k8s/config.py +27 -4
- mage_ai/services/k8s/job_manager.py +6 -1
- mage_ai/services/k8s/utils.py +97 -0
- mage_ai/services/ssh/aws/emr/utils.py +8 -8
- mage_ai/settings/keys/auth.py +1 -0
- mage_ai/settings/platform/__init__.py +159 -38
- mage_ai/settings/platform/constants.py +5 -0
- mage_ai/settings/platform/utils.py +53 -10
- mage_ai/settings/repo.py +26 -12
- mage_ai/settings/server.py +128 -37
- mage_ai/shared/array.py +24 -1
- mage_ai/shared/complex.py +45 -0
- mage_ai/shared/config.py +2 -1
- mage_ai/shared/custom_logger.py +11 -0
- mage_ai/shared/dates.py +10 -6
- mage_ai/shared/files.py +63 -8
- mage_ai/shared/hash.py +33 -9
- mage_ai/shared/io.py +9 -5
- mage_ai/shared/models.py +82 -24
- mage_ai/shared/outputs.py +87 -0
- mage_ai/shared/parsers.py +144 -13
- mage_ai/shared/path_fixer.py +11 -7
- mage_ai/shared/singletons/__init__.py +0 -0
- mage_ai/shared/singletons/base.py +47 -0
- mage_ai/shared/singletons/memory.py +38 -0
- mage_ai/shared/strings.py +34 -1
- mage_ai/shared/yaml.py +24 -0
- mage_ai/streaming/sinks/oracledb.py +57 -0
- mage_ai/streaming/sinks/sink_factory.py +4 -0
- mage_ai/system/__init__.py +0 -0
- mage_ai/system/constants.py +14 -0
- mage_ai/system/memory/__init__.py +0 -0
- mage_ai/system/memory/constants.py +1 -0
- mage_ai/system/memory/manager.py +174 -0
- mage_ai/system/memory/presenters.py +158 -0
- mage_ai/system/memory/process.py +216 -0
- mage_ai/system/memory/samples.py +13 -0
- mage_ai/system/memory/utils.py +656 -0
- mage_ai/system/memory/wrappers.py +177 -0
- mage_ai/system/models.py +58 -0
- mage_ai/system/storage/__init__.py +0 -0
- mage_ai/system/storage/utils.py +29 -0
- mage_ai/tests/api/endpoints/mixins.py +2 -2
- mage_ai/tests/api/endpoints/test_blocks.py +2 -1
- mage_ai/tests/api/endpoints/test_custom_designs.py +4 -4
- mage_ai/tests/api/endpoints/test_pipeline_runs.py +2 -2
- mage_ai/tests/api/endpoints/test_projects.py +2 -1
- mage_ai/tests/api/operations/base/mixins.py +1 -1
- mage_ai/tests/api/operations/base/test_base.py +27 -27
- mage_ai/tests/api/operations/base/test_base_with_user_authentication.py +27 -27
- mage_ai/tests/api/operations/base/test_base_with_user_permissions.py +23 -23
- mage_ai/tests/api/operations/test_syncs.py +6 -4
- mage_ai/tests/api/resources/test_pipeline_resource.py +11 -4
- mage_ai/tests/authentication/oauth/test_utils.py +1 -1
- mage_ai/tests/authentication/providers/test_oidc.py +59 -0
- mage_ai/tests/base_test.py +2 -2
- mage_ai/tests/data/__init__.py +0 -0
- mage_ai/tests/data/models/__init__.py +0 -0
- mage_ai/tests/data_preparation/executors/test_block_executor.py +23 -16
- mage_ai/tests/data_preparation/git/test_git.py +4 -1
- mage_ai/tests/data_preparation/models/block/dynamic/test_combos.py +305 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_counter.py +212 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_factory.py +360 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_variables.py +332 -0
- mage_ai/tests/data_preparation/models/block/hook/test_hook_block.py +2 -2
- mage_ai/tests/data_preparation/models/block/platform/test_mixins.py +1 -1
- mage_ai/tests/data_preparation/models/block/sql/utils/test_shared.py +26 -1
- mage_ai/tests/data_preparation/models/block/test_global_data_product.py +5 -2
- mage_ai/tests/data_preparation/models/custom_templates/test_utils.py +5 -4
- mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +3 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_predicates.py +9 -3
- mage_ai/tests/data_preparation/models/test_block.py +115 -120
- mage_ai/tests/data_preparation/models/test_blocks_helper.py +114 -0
- mage_ai/tests/data_preparation/models/test_global_data_product.py +41 -24
- mage_ai/tests/data_preparation/models/test_pipeline.py +9 -6
- mage_ai/tests/data_preparation/models/test_project.py +4 -1
- mage_ai/tests/data_preparation/models/test_utils.py +80 -0
- mage_ai/tests/data_preparation/models/test_variable.py +242 -69
- mage_ai/tests/data_preparation/models/variables/__init__.py +0 -0
- mage_ai/tests/data_preparation/models/variables/test_summarizer.py +481 -0
- mage_ai/tests/data_preparation/storage/shared/__init__.py +0 -0
- mage_ai/tests/data_preparation/test_repo_manager.py +6 -7
- mage_ai/tests/data_preparation/test_variable_manager.py +57 -48
- mage_ai/tests/factory.py +64 -43
- mage_ai/tests/orchestration/db/models/test_schedules.py +3 -3
- mage_ai/tests/orchestration/db/models/test_schedules_dynamic_blocks.py +279 -0
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +1 -0
- mage_ai/tests/orchestration/triggers/test_global_data_product.py +141 -138
- mage_ai/tests/orchestration/triggers/test_utils.py +3 -2
- mage_ai/tests/server/test_server.py +19 -0
- mage_ai/tests/services/k8s/test_job_manager.py +27 -6
- mage_ai/tests/streaming/sinks/test_oracledb.py +38 -0
- mage_ai/tests/test_shared.py +61 -0
- mage_ai/usage_statistics/logger.py +7 -2
- mage_ai/utils/code.py +33 -19
- mage_ai/version_control/branch/utils.py +2 -1
- mage_ai/version_control/models.py +3 -2
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/METADATA +6 -3
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/RECORD +555 -454
- mage_ai/data_preparation/models/global_data_product/constants.py +0 -6
- mage_ai/server/frontend_dist/_next/static/_krrrgup_C-dPOpX36S8I/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1557-df144fbd8b2208c3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2631-b9f9bea3f1cf906d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3782-ef4cd4f0b52072d0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4783-422429203610c318.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5699-6d708c6b2153ea08.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/635-0d6b7c8804bcd2dc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7022-0d52dd8868621fb0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7361-8a23dd8360593e7a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8095-bdce03896ef9639a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8146-6bed4e7401e067e6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9265-d2a1aaec75ec69b8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9440-4069842b90d4b801.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9832-67896490f6e8a014.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-d9c89527266296f7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-591abd392dc50ed4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products-78e8e88f2a757a18.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-95ffcd3e2b27e567.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1dd1ed71d26c10d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-1ed9045b2f1dfd65.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1417ad1c821d720a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-59aca25a5b1d3998.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles-36fa165a48af586b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-8b793b3b696a2cd3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/KLL5mirre9d7_ZeEpaw3s/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-df144fbd8b2208c3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2631-b9f9bea3f1cf906d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-ef4cd4f0b52072d0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4783-422429203610c318.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5699-6d708c6b2153ea08.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/635-0d6b7c8804bcd2dc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7022-0d52dd8868621fb0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-8a23dd8360593e7a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8095-bdce03896ef9639a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-6bed4e7401e067e6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9265-d2a1aaec75ec69b8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-4069842b90d4b801.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9832-67896490f6e8a014.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-d9c89527266296f7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-591abd392dc50ed4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products-78e8e88f2a757a18.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-95ffcd3e2b27e567.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1dd1ed71d26c10d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-1ed9045b2f1dfd65.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1417ad1c821d720a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-59aca25a5b1d3998.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles-36fa165a48af586b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-8b793b3b696a2cd3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
- mage_ai/shared/memory.py +0 -90
- mage_ai/tests/data_preparation/models/block/dynamic/test_dynamic_helpers.py +0 -48
- /mage_ai/{tests/data_preparation/shared → ai/utils}/__init__.py +0 -0
- /mage_ai/server/frontend_dist/_next/static/{_krrrgup_C-dPOpX36S8I → UZLabyPgcxtZvp0O0EUUS}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{KLL5mirre9d7_ZeEpaw3s → kcptwoOU-JJJg6Vwpkfmx}/_ssgManifest.js +0 -0
- /mage_ai/tests/data_preparation/{shared → storage/shared}/test_secrets.py +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.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=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 ")}))},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],b=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],g={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({},g),{},{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({},g),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,v.jsxs)(u.ZP,{default:!0,monospace:!0,children:[(0,a.vg)(d)," ",b&&(0,v.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"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,b=null===o||void 0===o||null===(n=o.settings)||void 0===n?void 0:n[c],g=null===b||void 0===b?void 0:b.partitions,x=!!v||!!b;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})})," ",g&&(0,p.jsxs)(a.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"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)(),b=p.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,g=(0,r.useMemo)((function(){return n||(null===b||void 0===b?void 0:b.global_data_products)||[]}),[b,n]);return b||n?b&&0===(null===g||void 0===g?void 0:g.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:[null,null,null,null],columns:[{uuid:"UUID"},{uuid:"Object type"},{uuid:"Object UUID"},{uuid:"Project"}],onClickRow:function(e){var n=null===g||void 0===g?void 0:g[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&&n.project?"/"+(null===n||void 0===n?void 0:n.project):"","/").concat(null===n||void 0===n?void 0:n.uuid)))},rows:null===g||void 0===g?void 0:g.map((function(e){var n=e.object_type,t=e.object_uuid,r=e.project,l=e.uuid,s={as:null,href:null};return u.b.PIPELINE===n&&(s.as="/pipelines/".concat(t,"/edit"),s.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(v.ZP,{monospace:!0,children:l},"uuid"),(0,m.jsx)(v.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(o(),{as:null===s||void 0===s?void 0:s.as,href:(null===s||void 0===s?void 0:s.href)||"",passHref:!0,children:(0,m.jsx)(c.Z,{default:!0,monospace:!0,onClick:function(e){(0,h.j)(e),i.push(s.href,s.as)},preventDefault:!0,children:t})},"objectUUID"),(0,m.jsx)(v.ZP,{default:!0,monospace:!0,children:r},"project")]})),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"}}),c.unshift({Icon:o.Code,disabled:!u,id:r.M.EDIT,isSelected:function(){return r.M.EDIT===e},label:function(){return(0,l.Ct)()?"View pipeline":"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}},79264:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(82684),l=t(21764),u=t(46568),c=t(97618),s=t(68562),a=t(82682),d=t(30160),v=t(17488),p=t(36300),f=t(72473),h=t(31748),m=t(79633),b=t(70515),g=t(72619),x=t(33834),j=t(69864),k=t(35686),Z=t(28598);n.Z=function(e){var n=e.copyText,t=e.deleteVariable,y=e.disableKeyEdit,P=e.editStateInit,C=void 0!==P&&P,O=e.fetchVariables,w=e.focusKey,_=e.hideEdit,S=e.obfuscate,I=e.onEnterCallback,E=e.onEscapeCallback,T=e.pipelineUUID,M=e.updateVariable,B=e.variable||{},D=B.uuid,A=B.value,R=(0,r.useRef)(null),N=(0,r.useRef)(null),L=(0,r.useState)(!1),F=L[0],U=L[1],H=(0,r.useState)(D),W=H[0],G=H[1],K=(0,r.useState)(A),z=K[0],q=K[1],V=(0,r.useState)(C),Y=V[0],X=V[1],Q=(0,j.Db)(k.ZP.variables.pipelines.useUpdate(T,D),{onSuccess:function(e){return(0,g.wD)(e,{callback:function(){X(!1),O()}})}}),J=(0,o.Z)(Q,1)[0],$=(0,r.useCallback)((function(e){if("Enter"===e.key){var n=z;try{n=JSON.parse(z)}catch(t){}M?W&&z&&(null===M||void 0===M||M((0,i.Z)({},W,z)),X(!1)):J({variable:{name:W,value:n}}),(0,x.ez)(),null===I||void 0===I||I()}else"Escape"===e.key&&((0,x.ez)(),X(!1),null===E||void 0===E||E())}),[I,E,M,J,W,z]),ee=(0,r.useCallback)((function(){(0,x.ez)(),t()}),[t]);(0,r.useEffect)((function(){var e,n;Y&&(w?null===R||void 0===R||null===(e=R.current)||void 0===e||e.focus():null===N||void 0===N||null===(n=N.current)||void 0===n||n.focus())}),[Y,w]);var ne=n||"kwargs['".concat(D,"']");return(0,Z.jsx)("div",{onMouseEnter:function(){return U(!0)},onMouseLeave:function(){return U(!1)},children:(0,Z.jsxs)(a.Z,{children:[(0,Z.jsx)(u.Z,{hiddenSmDown:!0,md:1,children:(0,Z.jsx)(p.qZ,{noPadding:!0,children:(0,Z.jsx)(s.ZP,{backgroundColor:h.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(ne),l.Am.success("Successfully copied to clipboard.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:D})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(D),withIcon:!0,children:(0,Z.jsx)(f.Copy,{size:2.5*b.iI})})})}),(0,Z.jsx)(u.Z,{md:S?9:4,children:Y&&!y?(0,Z.jsx)(p.qZ,{children:(0,Z.jsx)(v.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){G(e.target.value),e.preventDefault()},onKeyDown:$,paddingHorizontal:0,placeholder:"variable",ref:R,small:!0,value:W})}):(0,Z.jsx)(p.qZ,{children:(0,Z.jsx)(d.ZP,{color:m.Or,monospace:!0,small:!0,title:D,children:D})})}),(0,Z.jsx)(u.Z,{md:S?2:7,children:Y?(0,Z.jsx)(p.qZ,{children:(0,Z.jsx)(v.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){q(e.target.value),e.preventDefault()},onKeyDown:$,paddingHorizontal:0,placeholder:"enter value",ref:N,small:!0,value:z})}):(0,Z.jsxs)(p.qZ,{children:[S?(0,Z.jsx)(d.ZP,{monospace:!0,small:!0,children:F?"*":"*******"}):(0,Z.jsx)(d.ZP,{monospace:!0,small:!0,title:A.toString(),children:A.toString()}),(0,Z.jsxs)(c.Z,{children:[!_&&F&&(0,Z.jsx)(s.ZP,{backgroundColor:h.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){X(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(D),withIcon:!0,children:(0,Z.jsx)(f.Edit,{size:2.5*b.iI})}),t&&F&&(0,Z.jsx)(s.ZP,{backgroundColor:h.qJ,borderless:!0,inline:!0,muted:!0,onClick:ee,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(D),withIcon:!0,children:(0,Z.jsx)(f.Trash,{size:2.5*b.iI})})]})]})})]})})}},36300:function(e,n,t){"use strict";t.d(n,{kA:function(){return s},qZ:function(){return a}});var i=t(25976),o=t(2842),r=t(4982),l=t(61896),u=t(47041),c=t(70515),s=(c.iI,r.O$,c.iI,l.dN,i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],o.Wi,u.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),i.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),a=i.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*c.iI,"px;\n ")}))},66909:function(e,n,t){"use strict";t.d(n,{Eh:function(){return s},t0:function(){return a}});var i=t(25976),o=t(2842),r=t(4982),l=t(61896),u=t(47041),c=t(70515),s=(c.iI,r.O$+3*c.iI+l.dN),a=i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-15ofupc-0"})([""," overflow:auto;position:absolute;width:100%;"," ",""],u.w5,(function(e){return"\n height: calc(100vh - ".concat(o.uX,"px - ").concat(e.heightOffset,"px);\n ")}),(function(e){return e.overflowHidden&&"\n overflow: hidden;\n "}));i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-15ofupc-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}))},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"},9134:function(e,n,t){"use strict";var i=t(82684),o=t(21124),r=t(68432),l=t(25976),u=t(65292),c=t(44897),s=t(95363),a=t(70515),d=t(28598);n.Z=function(e){var n=e.language,t=e.maxWidth,v=e.showLineNumbers,p=e.small,f=e.source,h=e.wrapLines,m=(0,i.useContext)(l.ThemeContext);function b(e){var i=e.value;return(0,d.jsx)(r.Z,{customStyle:{backgroundColor:(m.background||c.Z.background).popup,border:"none",borderRadius:"none",boxShadow:"none",fontFamily:s.Vp,fontSize:p?12:14,marginBottom:0,marginTop:0,maxWidth:t,paddingBottom:2*a.iI,paddingTop:2*a.iI},language:n,lineNumberStyle:{color:(m.content||c.Z.content).muted},showLineNumbers:v,style:u._4,useInlineStyles:!0,wrapLines:h,children:i})}return(0,d.jsx)(o.D,{components:{code:function(e){var n=e.children;return(0,d.jsx)(b,{value:n})}},children:f})}},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 b},Z:function(){return g}});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),b=f;var g=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,b=e.width,g=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:c,noBoxShadow:s,width:b,children:[r&&(0,m.jsx)(p,{children:r}),(0,m.jsx)(v,{maxHeight:l,minHeight:u,scrollable:f,children:i.Children.map(g,(function(e,t){return e&&i.cloneElement(e,{last:t===g.length-1,sameColorBorders:a,secondary:n&&t%2===1})}))}),o&&(0,m.jsx)(h,{children:o})]})}},10946:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Ol}});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),b=t(40761),g=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.jsxs)(C.Z,{p:1,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(x.Z,{checked:f,onClick:function(){return o((function(){return{}}))}}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{noWrapping:!0,children:"Show all"})]}),(0,S.jsx)(C.Z,{mb:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(x.Z,{checked:d,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)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{noWrapping:!0,children:"Hide all"})]})]}),(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 g.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(g.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"])||[],b=(null===f||void 0===f||null===(u=f.file_path)||void 0===u?void 0:u.split(D.sep))||[],x=(null===b||void 0===b?void 0:b.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===b||void 0===b?void 0:b.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:g.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(78650),Y=t(35686);var X,Q,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"}(Q||(Q={})),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 g.GJ}))),te=(X={},(0,l.Z)(X,Q.FILES,{Icon:N.FolderOutline,uuid:Q.FILES}),(0,l.Z)(X,Q.BLOCKS,{Icon:N.BatchSquaresStacked,uuid:Q.BLOCKS}),X);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 g.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 g.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 b;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===(b=s)||void 0===b?void 0:b.length)>=2)return s.concat(null===n||void 0===n?void 0:n.slice(1))}return 3<=u&&g.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 g.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 g.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 g.GJ})))||void 0===e?void 0:e.uuid}),[t]),(0,S.jsxs)(S.Fragment,{children:[Q.FILES===(null===i||void 0===i?void 0:i.uuid)&&(0,S.jsx)(V.Z,{fetchFiles:a,files:d,onClickFile:function(e,n){return console.log(e)},onClickFolder:function(e,n){return console.log(e,!0)},ref:c,showError:u,uuid:"FileBrowserNavigation"}),Q.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[Q.FILES],te[Q.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),be=t(98777),ge=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],b=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 X,Q,J,$,ee,ne,te,oe,le,ce,se,de,pe,he,me,be,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 b(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===(X=Ae.schemaDetails)||void 0===X?void 0:X.description)&&(0,S.jsx)("div",{style:{marginTop:2},children:(0,S.jsx)(O.ZP,{muted:!0,children:null===Ae||void 0===Ae||null===(Q=Ae.schemaDetails)||void 0===Q?void 0:Q.description})})]})]}),o&&(0,S.jsx)(ge.ZP,{backgroundColor:(0,_.qn)(g.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===(be=me.split("\n"))||void 0===be?void 0:be.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 g.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)(ge.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)(be.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:g.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),Xe=t(42041),Qe=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]),b=(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],X=q[1],J=(0,p.useState)(!1),$=J[0],ee=J[1],oe=(0,p.useState)(Math.max((0,Ye.U2)(b),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),be=me[0],ge=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,b,g,x,j=(null===(m=(null===l||void 0===l||null===(b=l.cacheItem)||void 0===b||null===(g=b.current)||void 0===g?void 0:g.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[Q.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,Qe.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,Xe.y)([qe.zX,qe.A1],n)||(0,Xe.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}),beforeContentHeightOffset:pe,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,beforeMousedownActive:be,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,ref:a,small:!0}),(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===g.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:X,setBeforeMousedownActive:ge,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(30352),un=t(68562),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 bn=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,b=(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.useMemo)((function(){return!(null===j||void 0===j||!j.name)&&(0,G.ps)((null===j||void 0===j?void 0:j.name)||"")}),[null===j||void 0===j?void 0:j.name]),_=(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){if(e.stopPropagation(),e.key===qe.KW)s();else if(e.key===qe.tt){var n=e.target.innerText;n.startsWith("Save and")||"Cancel"===n||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===b||void 0===b||null===(e=b.current)||void 0===e||e.focus()}),[]);var I=(0,p.useMemo)((function(){return sn.qL.INTEGRATION===(null===d||void 0===d?void 0:d.type)}),[d]),E=(0,p.useMemo)((function(){return g.tf.CUSTOM===(null===o||void 0===o?void 0:o.type)}),[o]),T=(0,p.useMemo)((function(){return g.tf.MARKDOWN===(null===o||void 0===o?void 0:o.type)}),[o]),M=(0,p.useMemo)((function(){return null===o||void 0===o?void 0:o.block_action_object}),[o]),B=(0,p.useMemo)((function(){return fn.L.GENERATE_BLOCK===(null===M||void 0===M?void 0:M.object_type)}),[M]),D=(0,p.useMemo)((function(){return B&&(null===M||void 0===M?void 0:M.description)}),[M,B]),A=(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===M||void 0===M?void 0:M.language)}),[o,M]),R=(0,p.useState)(null),L=R[0],F=R[1],U=(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.code,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})})),F(n)},onErrorCallback:function(e,n){return h({errors:n,response:e})}})}}),H=(0,r.Z)(U,2),W=H[0],K=H[1].isLoading;(0,p.useEffect)((function(){B&&D&&!L&&W({llm:{request:{block_description:D,block_type:g.tf.TRANSFORMER,code_language:g.t6.PYTHON},use_case:cn.z.GENERATE_CODE}})}),[W,D,B,L]);var z=(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===M||void 0===M?void 0:M.object_type)?mn(mn({},M),{},{name:null===M||void 0===M?void 0:M.title}):void 0}),[o,M]),q=(0,p.useMemo)((function(){var e=(null===j||void 0===j?void 0:j.type)||(null===o||void 0===o?void 0:o.type);z&&(e=null===z||void 0===z?void 0:z.block_type);var n=g.V4[e];return I&&(g.tf.DATA_LOADER===e?n="Source":g.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[o,j,z,I]);return(0,S.jsxs)(dn.Nk,{width:B&&(null===j||void 0===j?void 0:j.content)&&80*w.iI,children:[(0,S.jsxs)(dn.I5,{children:[B&&K&&(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})]}),B&&!K&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(N.AISparkle,{size:5*w.iI,warning:!0})}),!B&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(rn,{size:15*w.iI})})]}),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:"Block generated using AI"})}),(0,S.jsx)(O.ZP,{textOverflow:!0,children:D})]})}),z&&(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===z||void 0===z?void 0:z.name)||(null===z||void 0===z?void 0:z.template_uuid))||void 0===i?void 0:i.slice(0,40)})]})}),g.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,{columnFlex:!0,children:[(0,S.jsxs)(y.ZP,mn(mn({},y.A0),{},{fullWidth:!0,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:b,value:(null===j||void 0===j?void 0:j.name)||""})]})),P&&(0,S.jsx)(O.ZP,{bold:!0,warning:!0,children:"Note: Numbers are not allowed as the first character of a block 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:q}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.Locked,{muted:!0})]})})]}),!T&&(E||z||(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:[[g.t6.PYTHON,g.t6.SQL,g.t6.R,g.t6.YAML].reduce((function(e,n){var t=(z?null===z||void 0===z?void 0:z.language:null===j||void 0===j?void 0:j.language)===n;return!(E&&!c&&!u||t||A&&g.t6.R!==n&&A&&g.t6.SQL!==n)||E&&g.t6.YAML===n||e.push((0,S.jsx)(C.Z,{ml:1,children:(0,S.jsx)(ge.ZP,{borderColor:t?null:"transparent",compact:!0,default:!E&&!t&&!A,disabled:!E&&!t&&!A,noBackground:!0,notClickable:(!E||c||!A)&&t,onClick:z&&!A?null:function(){return k((function(e){return mn(mn({},e),{},{language:n})}))},selected:t,children:g.LE[n]})},n)),e}),[]),!E&&!A&&(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:E||A?1:2})]})]}),(E||(null===z||void 0===z?void 0:z.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"}),E&&(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:z?(null===z||void 0===z?void 0:z.color)||"":(null===j||void 0===j?void 0:j.color)||"",children:[(0,S.jsx)("option",{value:""}),Object.values(g.Lq).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.kC)(e)},e)}))]}),!E&&(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===z||void 0===z?void 0:z.color)||(null===j||void 0===j?void 0:j.color)||"")}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.Locked,{muted:!0})]})})]}),B&&(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:D}),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},D)})})}),(0,S.jsx)(dn.$b,{children:(0,S.jsxs)(y.ZP,{fullWidth:!0,children:[(0,S.jsxs)(un.ZP,{bold:!0,centerText:!0,disabled:K||P,onClick:_,primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and\xa0",c?"update":u?"replace":"add"]}),(0,S.jsx)(C.Z,{ml:1,children:(0,S.jsx)(ge.ZP,{onClick:s,tabIndex:0,children:"Cancel"})})]})})]})},gn=t(54750),xn=t(4804),jn=t(99236),kn=t(98464),Zn=t(29480),yn=t(37443),Pn=t(53405);function Cn(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 On(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Cn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Cn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var wn=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,b=n||{},x=b.language,Z=b.type,_=b.uuid,I=(c||{}).uuid,E=(0,p.useState)(!1),T=E[0],M=E[1],B=(0,p.useMemo)((function(){return g.t6.YAML===x&&i?(0,xn.Qc)(i):{}}),[i,x]),D=(0,kn.Z)(t);(0,p.useEffect)((function(){!B||t||D||a((0,xn.Pz)(null===B||void 0===B?void 0:B.config))}),[t,D,B,a]);var R=(0,p.useState)(!1),L=R[0],F=R[1],U=(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&&F(!0)},onErrorCallback:function(e,n){return m({errors:n,response:e})}})}}),H=(0,r.Z)(U,2),W=H[0],G=H[1].isLoading,K=(0,p.useCallback)((function(){return s().then((function(){return W({integration_source:{action_type:"test_connection",block_uuid:_,pipeline_uuid:I}})}))}),[_,W,I,s]),z=(0,p.useMemo)((function(){if(g.t6.YAML===x)return(0,S.jsx)(Zn.$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)(On(On({},B),{},{config:n}));u(Z,_,t),v(t),M(!1)}catch(i){M(!0)}},tabSize:2,value:t||void 0,width:"100%"})});g.t6.PYTHON}),[t,i,B,x,Z,_,d,v]),q=(0,p.useMemo)((function(){return(0,Pn.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)(ge.ZP,{beforeIcon:(0,S.jsx)(N.PlugAPI,{success:!0}),loading:G,onClick:function(){F(!1),K()},secondary:!0,compact:!0,children:"Test connection"}),L&&(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===q||void 0===q?void 0:q.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(yn.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null===q||void 0===q?void 0:q.length)>=1&&(0,S.jsx)(jn.Z,{inputsBlocks:q}),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 ",g.LE[x],". The formatting must be fixed before the credentials configuration can be saved."]})]})]}),z]})},_n=t(34995),Sn=t(96348),In=t(26304),En=t(93859),Tn=t(66909),Mn=t(42122);var Bn=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)),b=m[0],g=m[1];(0,p.useEffect)((function(){var e,n;null!==c&&void 0!==c&&null!==(e=c.current)&&void 0!==e&&e.getBoundingClientRect().height&&g(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,Pn.Qu)(u),streamID:(0,Pn.M$)(u)}}),[u]),Z=k.parentStreamID,y=k.streamID,_=(0,p.useMemo)((function(){return(0,Mn.Qr)((0,Pn.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)(En.Z,{columnHeaderHeight:Tn.Eh,columns:o,height:t-b,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:r})}),[R,t,b]);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(yn.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,S.jsx)(ge.ZP,{compact:!0,loading:B,onClick:function(){return D()},primary:!0,children:R?"Refresh sample data":"Fetch sample data"})}),N]})},Dn=t(31882),An=t(69650),Rn=t(12468),Nn=t(61599),Ln=t(14466),Fn=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 Un(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 Hn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Un(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wn=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,b=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,Pn.M$)(c),D=(0,Pn.WD)(c),A=(0,Pn.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([Hn(Hn({},c),{},(0,l.Z)({},e,n))])}),[c,U]),W=(0,p.useMemo)((function(){var e,n=[],t={},i=[],l=(0,Pn.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",b,"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)(Dn.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"))]}))))})}),[b,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)(Fn,{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)(Rn.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 Hn(Hn({},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)(Fn,{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)(Rn.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:Nn._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Nn._B.INCREMENTAL}),")?",Nn.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:Nn._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:Nn.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)(Rn.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:Nn.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:Nn.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(Nn.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)&&Nn._B.INCREMENTAL===I&&(null===b||void 0===b?void 0:b.length)>=1&&(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Fn,{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===b||void 0===b?void 0:b.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)?Ln.W6.GREATER_THAN:Ln.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",Hn(Hn({},x),{},(0,l.Z)({},e,n.target.value)))},value:n,children:[Ln.W6.EQUALS,Ln.W6.GREATER_THAN,Ln.W6.GREATER_THAN_OR_EQUALS,Ln.W6.LESS_THAN,Ln.W6.LESS_THAN_OR_EQUALS,Ln.W6.NOT_EQUALS].map((function(e){return(0,S.jsx)("option",{value:e,children:Ln.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)(Fn,{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)(An.Z,{checked:!!E,onCheck:function(e){return H("run_in_parallel",e(E))}})]})}),g.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)(An.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)(An.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)(Fn,{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)(Fn,{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)(An.Z,{checked:!!A,onCheck:function(e){return U([(0,Pn.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)(ge.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=Hn(Hn({},e),{},{catalog:Hn(Hn({},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,Pn.WD)(e)===D}))})});return null===i||void 0===i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},Gn=t(11074),Kn=t(69632);function zn(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?zn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Vn=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,b=(0,p.useCallback)((function(e){c((function(n){var t=e(n);return null===u||void 0===u||u(t),t}))}),[u,c]),g=(0,p.useMemo)((function(){return(0,Pn.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(g||{}),(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]}}))}),[g]),Y=((0,p.useMemo)((function(){return(0,Pn.MB)(f)}),[f]),(0,p.useMemo)((function(){return(0,Pn.Nf)(f)}),[f])),X=null===i||void 0===i||null===(n=i.metadata)||void 0===n||null===(t=n.data_integration)||void 0===t?void 0:t.destination,Q=(0,p.useMemo)((function(){return!Nn.kB.includes(X)}),[X]),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)(An.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,Pn.jC)(i);return n[i]=qn(qn({},o),{},{metadata:qn(qn({},null===o||void 0===o?void 0:o.metadata),e)}),n}),{});b((function(e){return(0,Pn.$C)((0,Pn.AP)(f,n),e)}))}({selected:e(n)})}})},uuid:"action"},{uuid:"Property"},{uuid:"Types"}];Q&&(e.push.apply(e,[null,null]),t.push.apply(t,[{center:!0,uuid:"Unique"},{center:!0,uuid:"Key"}]));var i=f.replication_method;return Nn._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,b,f,Y,Q]),$=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,Pn.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)(Dn.Z,{label:n,onClick:r?null:function(t){(0,Oe.j)(t);var i=!(null===s||void 0===s||!s.includes(n))?(0,Pn.VZ)([n],c):(0,Pn.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};b((function(n){return(0,Pn.$C)((0,Pn.KN)(f,(0,l.Z)({},e,o)),n)}))},xsmall:!0})},"".concat(e,"-").concat(u||"types","-").concat(n))})),!r&&(0,S.jsx)(ge.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"))}),[b,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,Pn.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],g=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)(An.Z,{checked:p,compact:!0,onCheck:function(e){b((function(n){return(0,Pn.$C)((0,Pn.AP)(f,(0,l.Z)({},t,qn(qn({},d),{},{metadata:qn(qn({},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)];Q&&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),b((function(e){return(0,Pn.$C)(qn(qn({},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 Q&&Z.push([g,"key_properties",u]),Nn._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),b((function(e){return(0,Pn.$C)(qn(qn({},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,b,f,Q,q]),ie=(0,p.useCallback)((function(e){var n=null===V||void 0===V?void 0:V[e];return qn(qn({},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===g||void 0===g?void 0:g[null===_||void 0===_?void 0:_.uuid])||{},p=(0,Pn.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)(Gn.Z,{children:[(0,S.jsx)("div",{style:{position:"relative"},children:(0,S.jsx)(ge.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:Nn.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,Pn.VZ)([e],p):(0,Pn.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};b((function(e){return(0,Pn.$C)((0,Pn.KN)(f,(0,l.Z)({},Z,o)),e)}))}})})},e)}))})]})})}}),[F,_,B,g,b,U,I,f]),re=(0,p.useMemo)((function(){return(0,Pn.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=qn({},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===g||void 0===g?void 0:g[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,g]),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,Mn.gR)(e,[t]):qn(qn({},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)(Kn.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)(ge.ZP,{beforeIcon:(0,S.jsx)(N.BranchAlt,{}),onClick:function(){b((function(e){var n;return(0,Pn.$C)(qn(qn({},f),{},{schema:qn(qn({},null===f||void 0===f?void 0:f.schema),{},{properties:qn(qn({},null===f||void 0===f||null===(n=f.schema)||void 0===n?void 0:n.properties),T)})}),e)})),d({noParents:{},parents:{}}),a(yn.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(ge.ZP,{onClick:function(){d({noParents:{},parents:{}}),a(yn.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!v&&ae,(0,S.jsx)(C.Z,{pb:w.HN})]})},Yn=["block","height","pipeline","selectedSubTab","showError","stream"];function Xn(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?Xn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Jn=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.selectedSubTab,r=e.showError,l=e.stream,u=(0,In.Z)(e,Yn);return yn.tw.OVERVIEW!==o&&o?yn.tw.SETTINGS===o||yn.tw.STREAM_CONFLICTS===o?(0,S.jsx)(Vn,Qn(Qn({},u),{},{block:n,showStreamConflicts:yn.tw.STREAM_CONFLICTS===o,stream:l})):yn.tw.SAMPLE_DATA===o?(0,S.jsx)(Bn,{block:n,height:t,pipeline:i,showError:r,stream:l}):(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(Wn,Qn(Qn({},u),{},{block:n,stream:l}))},$n={label:function(e){return"".concat((0,G._6)("stream",e,!0)," fetched")},uuid:"Recently fetched"},et={label:function(e){return"".concat((0,G._6)("stream",e,!0)," from settings")},uuid:"From stream settings"},nt=[$n,et];function tt(e,n){return null===n||void 0===n?void 0:n.filter((function(n){var t=new RegExp(e||"","i"),i=(0,Pn.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 it=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,Pn.Uc)(n,{getAll:!0})}),[n]),h=(0,p.useMemo)((function(){return(0,Pn.UA)(f)}),[f]),m=(0,p.useMemo)((function(){return(0,Pn.UA)(a||[])}),[a]),b=(0,p.useCallback)((function(e){return(0,Pn.ig)(e,m,h)}),[m,h]),g=(0,p.useCallback)((function(e){return(0,Pn.p$)(e,m,h)}),[m,h]),x=(0,p.useCallback)((function(e){var n;return(n={},(0,l.Z)(n,$n.uuid,m),(0,l.Z)(n,et.uuid,h),n)[e]}),[h,m]),j=(0,p.useMemo)((function(){var e=[];return nt.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=tt(u,d);(null===v||void 0===v?void 0:v.length)>=1&&a.push({streams:(0,L.YC)(v||[],Pn.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=tt(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||[],Pn.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=$n.uuid===u;return(0,S.jsx)(He,{style:{height:i,right:et.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=b(e),t=!!g(e),i=(0,Pn.M$)(e),r=(0,Pn.Qu)(e),l=!1;if(a){var u=(0,Pn.zB)(e,x(et.uuid));u&&(l=(0,Pn.Z5)(u))}else l=(0,Pn.Z5)(e);var v=n&&t;return(0,S.jsx)(Ge,{onClick:a&&v?function(){return!1}:function(n){n.preventDefault(),d([(0,Pn.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)(ge.ZP,{compact:!0,onClick:function(){s((function(n){return(0,Pn.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:yn.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)(An.Z,{checked:l,compact:!0,onCheck:function(n){return d([(0,Pn.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 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 rt(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 lt=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 yn.oI.CHECKBOX===r?i=(0,S.jsx)(x.Z,{checked:!!p,onClick:function(e){v&&(0,Oe.j)(e),c((function(e){return rt(rt({},e),{},(0,l.Z)({},a,rt(rt({},null===e||void 0===e?void 0:e[a]),{},{value:!p})))}))}}):yn.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 rt(rt({},n),{},(0,l.Z)({},a,rt(rt({},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)}))]}):yn.oI.TOGGLE===r&&(i=(0,S.jsx)(An.Z,{checked:p,compact:!0,onCheck:function(e){c((function(n){return rt(rt({},n),{},(0,l.Z)({},a,rt(rt({},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 rt(rt({},e),{},(0,l.Z)({},a,rt(rt({},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 rt(rt({},e),{},(0,l.Z)({},o,rt(rt({},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 ut=function(e){var n=e.selectedStreamMapping,t=e.setSelectedStreamMapping,i=e.streamMapping,o=(0,p.useMemo)((function(){return(0,Pn.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,Pn.WD)(e),o=(0,Pn.M$)(e),u=!!(0,Pn.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,Pn.zB)(i,n);t((function(e){return(0,Pn.iN)(i,e,{remove:o})}))},rowGroupHeaders:l,rows:u,rowsGroupedByIndex:c,stickyHeader:!0})]})};var ct=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)(lt,{attributes:[{label:function(){return"Replication method"},inputType:yn.oI.SELECT,options:Nn.jL.map((function(e){return{label:function(){return(0,G.vg)(e)},value:e}})),uuid:Pn.I1.REPLICATION_METHOD},{label:function(){return"Unique conflict method"},inputType:yn.oI.SELECT,options:Object.values(Nn.MU).map((function(e){return{label:function(){return(0,G.vg)(e)},value:e}})),uuid:Pn.I1.UNIQUE_CONFLICT_METHOD},{label:function(){return"Run stream in parallel"},inputType:yn.oI.TOGGLE,uuid:Pn.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:yn.oI.TOGGLE,uuid:Pn.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:yn.oI.TOGGLE,uuid:Pn.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)(ut,{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 st(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 at(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?st(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):st(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var dt=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),b=(0,p.useMemo)((function(){return!Nn.kB.includes(m)}),[m]);(0,p.useEffect)((function(){if(f&&!s){var e=(0,Pn.M$)(f||{}),n=(0,Pn.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 g=(0,p.useMemo)((function(){return(null===f||void 0===f?void 0:f.replication_method)===Nn._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:yn.oI.CHECKBOX,uuid:Pn.I1.PROPERTY_SELECTED},{label:function(){return"Partition key"},inputType:yn.oI.CHECKBOX,uuid:Pn.I1.PARTITION_KEYS}].concat((0,o.Z)(Nn.D5.map((function(e){return{label:function(){return(0,G.vg)(e)},inputType:yn.oI.CHECKBOX,uuid:e}}))));g&&e.splice(1,0,{label:function(){return"Bookmark property"},inputType:yn.oI.CHECKBOX,uuid:Pn.I1.BOOKMARK_PROPERTIES}),b&&e.splice(1,0,{label:function(){return"Unique constraint"},inputType:yn.oI.CHECKBOX,uuid:Pn.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Key property"},inputType:yn.oI.CHECKBOX,uuid:Pn.I1.KEY_PROPERTIES});var n=2;g&&(n+=1),b&&(n+=2);var t=(0,L.m5)(n);return(0,S.jsx)(lt,{attributes:e,attributesMapping:i,rowGroupHeaders:["Options","Column types"],rowsGroupedByIndex:[t,null===Nn.D5||void 0===Nn.D5?void 0:Nn.D5.map((function(e,t){return t+n}))],setAttributesMapping:a})}),[i,a,b,g]),j=(0,p.useMemo)((function(){return(0,S.jsx)(ut,{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)(Dn.Z,{label:e,onClick:function(){d((function(n){return!(null===n||void 0===n||!n[e])?(0,Mn.gR)(n,[e]):at(at({},n),{},(0,l.Z)({},e,!0))}))}})},"".concat(e,"-chip"))}))})})]}),x,j]})};function vt(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 pt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ft={compact:!0,small:!0};var ht=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,b=c||{},x=b.noParents,j=b.parents,k=(0,p.useMemo)((function(){return(0,Mn.Qr)(x||{})&&(0,Mn.Qr)(j||{})}),[x,j]),I=(0,p.useMemo)((function(){return(0,Pn.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,Pn.Z5)(e)})));return(0,S.jsx)(An.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,Pn.XE)(n,{selected:e(i)})})))}})},uuid:"action"},{uuid:"Stream"},{uuid:"Table"},{uuid:"Sync"},{uuid:"Unique conflict"},{center:g.tf.DATA_EXPORTER===m,rightAligned:g.tf.DATA_EXPORTER!==m,uuid:"Parallel"}];return g.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,b=s?null===t||void 0===t?void 0:t[s]:null;b?n.push((0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(O.ZP,{bold:!0,color:(0,_.qn)(null===b||void 0===b?void 0:b.type,{blockColor:null===b||void 0===b?void 0:b.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,Pn.WD)(n),o=(0,Pn.Qu)(n),c=(0,Pn.M$)(n),s=n.auto_add_new_fields,d=n.bookmark_properties,b=n.destination_table,j=n.disable_column_type_check,k=n.replication_method,w=n.run_in_parallel,_=n.unique_conflict_method,I=(0,Pn.Z5)(n),E=t in v?null===v||void 0===v?void 0:v[t]:b,T=[(0,S.jsx)(An.Z,{checked:I,compact:!0,onCheck:function(e){h([(0,Pn.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 pt(pt({},e),{},(0,l.Z)({},t,o))})),clearTimeout(a.current),a.current=setTimeout((function(){return h([pt(pt({},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,pt(pt({},ft),{},{fullWidth:!0,onChange:function(e){var t;return h([pt(pt({},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:Nn.jL.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))}))}),Nn._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,pt(pt({},ft),{},{key:"".concat(t,"-uniqueConflictMethod"),onChange:function(e){var t;return h([pt(pt({},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(Nn.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:g.tf.DATA_EXPORTER===m?"center":"flex-end",children:(0,S.jsx)(An.Z,{checked:!!w,compact:!0,onCheck:function(e){h([pt(pt({},n),{},{run_in_parallel:e(w)})])}})},"".concat(t,"-runInParallel"))];g.tf.DATA_EXPORTER===m&&T.push.apply(T,[(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(An.Z,{checked:!!s,compact:!0,onCheck:function(e){h([pt(pt({},n),{},{auto_add_new_fields:e(s)})])}})},"".concat(t,"-autoAddNewFields")),(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(An.Z,{checked:!!j,compact:!0,onCheck:function(e){h([pt(pt({},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(yn.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,Pn.zB)(n,o)},groupsInline:!0,onClickRow:function(e){var n=null===F||void 0===F?void 0:F[e],t=!!(0,Pn.zB)(n,o);u((function(e){return(0,Pn.iN)(n,e,{remove:t})}))},rowGroupHeaders:D,rows:N,rowsGroupedByIndex:L,stickyHeader:!0})]})};function mt(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 bt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gt=3*w.iI*2;var xt=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,b=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],X=(0,Je.i)(),Q=X.height,J=X.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 g.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,be=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=bt(bt({},n),{},{configuration:bt(bt({},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 bt(bt({},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,Pn.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,Pn.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=bt(bt({},o),e);i>=0?r[i]=l:r.push(l)}));var l=bt(bt({},t),{},{catalog:bt(bt({},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,Pn.Uc)(ce,{getAll:!0})}),[ce]),He=(0,p.useMemo)((function(){return(0,Pn.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)),Xe=Ve[0],Qe=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,bn=fn.selectedSubTab,xn=pn[1],jn=(0,p.useState)((0,Pn.UA)([])),kn=jn[0],Zn=jn[1],Cn=(0,p.useMemo)((function(){if(!(0,Mn.Qr)(null===kn||void 0===kn?void 0:kn.noParents)||!(0,Mn.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,yn.C0)({addStreamConflicts:!!e})}return(0,yn.C0)()}),[hn,mn,kn]),On=(0,p.useCallback)((function(e){return e in yn.Pf?yn.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 yn.Pf?yn.Pf[i]:Cn,a=r;if(yn.mU[i]||yn.mU[u]){var d,v,p;if(a){if(yn.mU[u]&&!yn.mU[i]){var f;!a||null!==Cn&&void 0!==Cn&&Cn.includes(a)||yn.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,Pn.zB)({parent_stream:c,stream:u,tap_stream_id:u},He),m=(0,Pn.zB)({parent_stream:o,stream:i,tap_stream_id:i},He),b=(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 bt({},(0,Mn.GL)(e,b||[]))}))}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||yn.uK.CONFIGURATION,selectedMainNavigationTabSub:s,selectedSubTab:u?d||(null===(n=On(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,s,d,On,hn,In]);var En=(0,p.useMemo)((function(){return On(hn)}),[On,hn]),Tn=(0,p.useMemo)((function(){var e=[{Icon:N.SettingsWithKnobs,uuid:yn.uK.CONFIGURATION},{Icon:N.Sun,uuid:yn.uK.STREAMS},{Icon:N.Table,uuid:yn.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:yn.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,Pn.M$)(t),r=(0,Pn.Qu)(t),l=(0,Pn.WD)(t),u=(0,Pn.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),Dn=Bn[0],Rn=Bn[1],Nn=(0,p.useMemo)((function(){return(0,Pn.qf)(He,(0,Pn.UA)(Dn||[]))}),[He,Dn]),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 bt(bt({},e),{},{selectedSubTab:n})}))},regularSizeText:!0,selectedTabUUID:bn,tabs:En})}),!(null!==En&&void 0!==En&&En.length)&&yn.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)(ge.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)(ge.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,bn,zn,In,En]),Vn=(0,p.useMemo)((function(){return Q-2*Ae}),[Q]),Yn=(0,p.useMemo)((function(){return J-2*Ae}),[J]),Xn=(0,p.useState)(null),Qn=Xn[0],$n=Xn[1],et=(0,p.useState)(null),nt=et[0],tt=et[1],ot=(0,p.useState)(null),rt=(ot[0],ot[1]),lt=(0,p.useState)(!1),ut=lt[0],st=lt[1];(0,p.useEffect)((function(){var e,n,t,i,o,r;(hn||bn)&&($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),tt(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,bn]);var at=(0,f.Db)(Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(ne),encodeURIComponent(re)),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){null===b||void 0===b||b(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),vt=(0,r.Z)(at,2),pt=(vt[0],vt[1].isLoading,(0,p.useMemo)((function(){return hn&&![yn.uK.CONFIGURATION,yn.uK.OVERVIEW,yn.uK.STREAMS,yn.uK.SYNC].includes(hn)}),[hn])),ft=(0,p.useMemo)((function(){return pt&&yn.tw.SETTINGS===bn}),[pt,bn]),mt=(0,p.useMemo)((function(){return yn.uK.CONFIGURATION===hn&&yn.tw.CREDENTIALS===bn}),[hn,bn]),xt=(0,p.useMemo)((function(){return yn.uK.OVERVIEW===hn}),[hn]),jt=(0,p.useMemo)((function(){return!(mt||ft||xt&&(null===De||void 0===De?void 0:De.length)>=1)||ut}),[ut,mt,ft,xt,De]),kt=(0,p.useMemo)((function(){var e=(0,Pn.zB)({parent_stream:mn,stream:hn,tap_stream_id:hn},He);if(e)return(0,S.jsx)(Jn,{block:ce,blocksMapping:Ie,height:Vn-Qn-2*w.iI,highlightedColumnsMapping:an,onChangeBlock:v,pipeline:I,selectedSubTab:bn,setBlockAttributes:se,setHighlightedColumnsMapping:dn,setSelectedSubTab:function(e){return In((function(n){return bt(bt({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Zn,showError:qe,stream:e,streamMapping:He,streamsMappingConflicts:kn,updateStreamsInCatalog:_e})}),[ce,Ie,Qn,Vn,an,v,I,hn,mn,bn,se,dn,In,Zn,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)(wn,{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 bt(bt({},n),{},{selectedSubTab:e})}))},showError:qe})}),[ce,Ot,yt,Me,Ce,h,I,E,wt,Pt,T,In,qe]),St=(0,p.useMemo)((function(){if(yn.uK.CONFIGURATION===hn){if(yn.tw.UPSTREAM_BLOCK_SETTINGS===bn){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,Pn.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)(An.Z,{checked:u,compact:!0,onCheck:function(e){we((function(n){return e(u)?bt(bt({},n),{},(0,l.Z)({},i,{})):(0,Mn.gR)(n,[i])}))}})]}),u&&(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(Sn.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(Sn.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,bt(bt({},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 bt(bt({},e),{},(0,l.Z)({},i,bt(bt({},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)(Sn.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,bt(bt({},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 bt(bt({},e),{},(0,l.Z)({},i,bt(bt({},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)(Sn.g,{noBorder:!0,children:[(0,S.jsxs)(y.ZP,bt(bt({},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,bt(bt({},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 bt(bt({},t),{},(0,l.Z)({},i,bt(bt({},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)(Sn.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,bt(bt({},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.",g.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 bt(bt({},e),{},(0,l.Z)({},i,bt(bt({},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:yn.uK.STREAMS}}))},preventDefault:!0,primary:!0,children:"Streams"})," section."]})})]}),(0,S.jsx)(k.Z,{light:!0}),e]})}}else{if(yn.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)(ge.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(yn.uK.SYNC===hn)return(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(O.ZP,{children:"Coming soon"})});if(yn.uK.OVERVIEW===hn)return(0,S.jsx)(ht,{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,bn,we,In,K,He,_e]),It=(0,p.useMemo)((function(){return mt?(0,S.jsx)(O.ZP,{bold:!0,children:"Documentation"}):ft?(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}),[mt,ft,xt]),Et=(0,p.useMemo)((function(){if(ft||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)(ge.ZP,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};ft?e=(0,Pn.Kq)(G,an,U):xt&&(e=(0,Pn.bX)(G,U)),_e((0,Pn.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)(ge.ZP,{fullWidth:!0,onClick:function(){H({}),dn({}),K(null)},secondary:!0,children:"Clear"})]})]})})}),[U,q,an,ft,xt,v,D,G,H,dn,K,_e]),Tt=(0,p.useMemo)((function(){if(mt)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)(_n.Z,{children:Be.replace(/\<br \/\>/g,"\n\n")})]})});if(ft){var e=(0,Pn.zB)({parent_stream:mn,stream:hn,tap_stream_id:hn},He);return(0,S.jsx)(dt,{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)(ct,{attributesMapping:U,selectedStreamMapping:G,setAttributesMapping:H,setSelectedStreamMapping:K,streamMapping:He}):void 0}),[U,ce,Ie,ye,Be,an,mt,ft,xt,hn,mn,G,He,_e]),Mt=(0,p.useMemo)((function(){var e=[{label:function(){return re}}];return be&&e.push({bold:!hn,label:function(){return be}}),hn&&e.push({bold:!0,label:function(){return yn.TD[hn]||hn}}),(0,S.jsx)(gn.Z,{breadcrumbs:e,noMarginLeft:!0})}),[re,be,hn]),Bt=(0,p.useMemo)((function(){return(Q-Vn-gt)/2}),[Vn,Q]),Dt=(0,p.useMemo)((function(){return(0,S.jsx)(it,{block:ce,blocksMapping:Ie,height:Vn-Qn,onChangeBlock:v,searchText:Kn,setSelectedMainNavigationTab:In,setSelectedSubTab:function(e){return In((function(n){return bt(bt({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Zn,streamsFetched:Dn,updateStreamsInCatalog:_e,width:Yn-(on+(jt?0:Xe))})}),[jt,Xe,on,ce,Ie,Qn,Vn,v,Kn,In,Zn,Dn,_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)(ge.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:Xe,before:Tn,beforeHeightOffset:0,beforeMousedownActive:un,beforeWidth:on,contained:!0,headerOffset:Qn,height:Vn,hideAfterCompletely:!Tt||xt&&!(null!==De&&void 0!==De&&De.length),inline:!0,mainContainerHeader:qn,mainContainerRef:M,setAfterHidden:st,setAfterMousedownActive:nn,setAfterWidth:Qe,setBeforeMousedownActive:cn,setBeforeWidth:rn,uuid:We,children:[pt&&kt,!pt&&St,yn.uK.CONFIGURATION===hn&&yn.tw.CREDENTIALS===bn&&_t,yn.uK.STREAMS===hn&&!Nn&&Dt]})]})},jt=t(50724),kt=(0,S.jsx)("div",{style:{width:pn.gt}});var Zt=function(e){var n=e.beforeIcon,t=e.checked,i=e.label,o=e.muted;return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[n||(t?(0,S.jsx)(N.Check,{}):kt),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{disabled:o,noWrapping:!0,children:i})]})},yt=t(70374),Pt=t(38907),Ct=t(77417),Ot=t(72098),wt=t(26419),_t=t(58325);function St(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 It(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?St(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):St(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Et=function(e){var n=e.cancelPipeline,t=e.children,i=(e.collapseAllBlockOutputs,e.createPipeline),o=e.disableAutosave,r=e.executePipeline,u=e.hideOutputOnExecution,c=e.interruptKernel,s=e.isPipelineExecuting,a=e.pipeline,d=e.restartKernel,v=e.savePipelineContent,f=e.scrollTogether,h=e.setMessages,m=e.setScrollTogether,b=e.setSideBySideEnabled,g=e.sideBySideEnabled,x=e.toggleDisableAutosave,j=e.toggleHideOutputOnExecution,k=e.updatePipelineMetadata,Z=(0,p.useState)(null),P=Z[0],C=Z[1],w=(0,p.useRef)(null),_=(0,p.useRef)(null),I=(0,p.useRef)(null),E=(0,p.useRef)(null),T=(0,p.useRef)(null),M=(0,Pt.Z)({pipelineType:null===a||void 0===a?void 0:a.type}).kernel,B=(0,Ct.Z)(),D=B.featureEnabled,A=B.featureUUIDs,R=[{beforeIcon:kt,label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,G.Y6)()}})},uuid:"new_standard_pipeline"},{beforeIcon:kt,label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,G.Y6)(),type:sn.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{beforeIcon:kt,keyTextGroups:[[(0,_t.V5)()?qe.RJ:qe.hE,qe.SS]],label:function(){return"Save pipeline"},onClick:function(){return v()},uuid:"save_pipeline"},{beforeIcon:o?(0,S.jsx)(N.Check,{}):kt,label:function(){return"Disable autosave"},onClick:x,uuid:"Disable_autosave"}],L=(0,p.useMemo)((function(){var e=[{keyTextGroups:[[qe.kA],[qe.kA]],label:function(){return"Interrupt kernel"},onClick:function(){return c()},uuid:"Interrupt kernel"},{keyTextGroups:[[qe.t_[qe.OC]],[qe.t_[qe.OC]]],label:function(){return"Restart kernel"},onClick:function(){return d()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return h((function(e){return Object.keys(e).reduce((function(e,n){return It(It({},e),{},(0,l.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return s?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):(null===a||void 0===a?void 0:a.type)===sn.qL.STREAMING&&e.push({label:function(){return"Execute pipeline"},onClick:function(){return r()},uuid:"Execute pipeline"}),e}),[n,r,c,s,null===a||void 0===a?void 0:a.type,d,h]),F=(0,p.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===a||void 0===a?void 0:a.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"}]}),[a]),U=(0,p.useMemo)((function(){return[{label:function(){return(0,S.jsx)(Zt,{checked:u,label:"Hide output on execution"})},onClick:j,uuid:"Hide output on execution"},{label:function(){return(0,S.jsx)(Zt,{beforeIcon:(0,S.jsx)(N.LayoutStacked,{success:!g}),label:"Show output below block"})},onClick:function(){b(!1)},uuid:"Show output below block"},{label:function(){return(0,S.jsx)(Zt,{beforeIcon:(0,S.jsx)(N.LayoutSplit,{success:g}),label:"Show output next to code (beta)"})},onClick:function(){b(!0)},uuid:"Show output next to code"},{disabled:!g,label:function(){return(0,S.jsx)(Zt,{checked:f,label:"Scroll output alongside code (beta)",muted:!g})},onClick:function(){return m(!f)},uuid:"Scroll output alongside code"}]}),[u,f,m,b,g,j]),H=(0,p.useMemo)((function(){var e=[{label:function(){return"Open compute management"},linkProps:{href:"/compute"},uuid:"Open compute management"}];return Ot.U.PYTHON3===(null===M||void 0===M?void 0:M.name)?e.push({label:function(){return"Switch to PySpark kernel"},onClick:function(){return null===k||void 0===k?void 0:k(null===a||void 0===a?void 0:a.name,sn.fj[Ot.U.PYSPARK])},uuid:"Switch to PySpark kernel"}):Ot.U.PYSPARK===(null===M||void 0===M?void 0:M.name)&&e.push({label:function(){return"Switch to Python kernel"},onClick:function(){return null===k||void 0===k?void 0:k(null===a||void 0===a?void 0:a.name,sn.fj[Ot.U.PYTHON3])},uuid:"Switch to Python kernel"}),e}),[M,a,k]),W="FileHeaderMenu/index",K=(0,Qe.y)(),z=K.registerOnKeyDown,q=K.unregisterOnKeyDown;return(0,p.useEffect)((function(){return function(){q(W)}}),[q,W]),z(W,(function(e,n,t){null!==P&&(n[qe.QK]?C((function(e){return 0===e?2:e-1})):n[qe.DY]&&C((function(e){return 2===e?0:e+1})))}),[P,C]),(0,S.jsx)(jt.Z,{onClickOutside:function(){return C(null)},open:!0,style:{position:"relative"},children:(0,S.jsxs)(y.ZP,{children:[(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,It(It({},wt.a),{},{noBackground:0!==P,onClick:function(){return C((function(e){return 0===e?null:0}))},onMouseEnter:function(){return C((function(e){return null!==e?0:null}))},ref:w,children:(0,S.jsx)(O.ZP,{children:"File"})})),(0,S.jsx)(yt.Z,{items:R,onClickCallback:function(){return C(null)},open:0===P,parentRef:w,uuid:"FileHeaderMenu/file_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,It(It({},wt.a),{},{noBackground:2!==P,onClick:function(){return C((function(e){return 2===e?null:2}))},onMouseEnter:function(){return C((function(e){return null!==e?2:null}))},ref:I,children:(0,S.jsx)(O.ZP,{children:"Edit"})})),(0,S.jsx)(yt.Z,{items:F,onClickCallback:function(){return C(null)},open:2===P,parentRef:I,uuid:"FileHeaderMenu/edit_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,It(It({},wt.a),{},{noBackground:1!==P,onClick:function(){return C((function(e){return 1===e?null:1}))},onMouseEnter:function(){return C((function(e){return null!==e?1:null}))},ref:_,children:(0,S.jsx)(O.ZP,{children:"Run"})})),(0,S.jsx)(yt.Z,{items:L,onClickCallback:function(){return C(null)},open:1===P,parentRef:_,uuid:"FileHeaderMenu/run_items"})]}),sn.qL.INTEGRATION!==(null===a||void 0===a?void 0:a.type)&&(null===D||void 0===D?void 0:D(A.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,It(It({},wt.a),{},{noBackground:3!==P,onClick:function(){return C((function(e){return 3===e?null:3}))},onMouseEnter:function(){return C((function(e){return null!==e?3:null}))},ref:E,children:(0,S.jsx)(O.ZP,{children:"View"})})),(0,S.jsx)(yt.Z,{items:U,onClickCallback:function(){return C(null)},open:3===P,parentRef:E,uuid:"FileHeaderMenu/viewItems"})]}),(null===D||void 0===D?void 0:D(A.COMPUTE_MANAGEMENT))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,It(It({},wt.a),{},{noBackground:4!==P,onClick:function(){return C((function(e){return 4===e?null:4}))},onMouseEnter:function(){return C((function(e){return null!==e?4:null}))},ref:T,children:(0,S.jsx)(O.ZP,{children:"Compute"})})),(0,S.jsx)(yt.Z,{items:H,onClickCallback:function(){return C(null)},open:4===P,parentRef:T,uuid:"FileHeaderMenu/viewItems"})]}),t]})})},Tt=t(69616),Mt=t(67355),Bt=t(70613),Dt=t(21764),At=t(28071),Rt=t(65956),Nt=t(23657),Lt=t(8970),Ft=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 Ut(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 Ht(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ut(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ut(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wt=2*w.iI,Gt={default:!0,monospace:!0,small:!0};var Kt,zt,qt=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,Nt.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],b=(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})}})}}),g=(0,r.Z)(b,2),x=g[0],j=g[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,Mn.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;Dt.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Dt.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)(ge.ZP,{beforeIcon:(0,S.jsx)(N.WorkspacesUsersIcon,{size:Wt}),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)(Rt.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)(Ft,{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)(An.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)(ge.ZP,{beforeIcon:(0,S.jsx)(N.ExpandOpenUpRight,{default:!0}),default:!0,linkProps:{href:"/compute",as:"/compute?tab=".concat(Lt.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)(jt.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."):[At.X.RUNNING,At.X.WAITING].includes(r)?(i="Activating cluster ".concat(null===o||void 0===o?void 0:o.id,"."),_(Ht(Ht({},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)(At.X.WAITING)," or\n ").concat((0,G.vg)(At.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,Ht(Ht({},Gt),{},{key:"id"}),t),(0,S.jsx)(O.ZP,Ht(Ht({},Gt),{},{danger:[At.X.TERMINATED_WITH_ERRORS].includes(o),default:[At.X.STARTING].includes(o),muted:[At.X.TERMINATED].includes(o),success:[At.X.RUNNING,At.X.WAITING].includes(o),warning:[At.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:Wt,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"}(Kt||(Kt={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(zt||(zt={}));var Vt,Yt=t(89308),Xt=t(89515),Qt=t(78688);!function(e){e.EMR="emr"}(Vt||(Vt={}));var Jt=t(26032),$t=t(74260),ei=t(89538);function ni(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 ti(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ni(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ni(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ii=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=(0,Pt.Z)({pipelineType:null===i||void 0===i?void 0:i.type}).kernel,d=(0,Ct.Z)(),m=(d.featureEnabled,d.featureUUIDs,d.sparkEnabled),b=(0,Nt.Z)({clustersRefreshInterval:5e3,computeServiceRefreshInterval:5e3,connectionsRefreshInterval:5e3,pauseFetch:!m}),g=b.activeCluster,x=b.clusters,k=(b.clustersLoading,b.computeService),_=b.computeServiceUUIDs,I=b.connections,E=b.connectionsLoading,T=b.fetchAll,M=b.fetchComputeClusters,B=(b.setupComplete,(0,p.useContext)(v.ThemeContext)),D=a||{},A=D.alive,R=D.usage,F=(0,p.useState)(Vt.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],X=q[1],Q=(0,p.useState)(!1),J=Q[0],$=Q[1],ee=(0,p.useState)(!1),ne=ee[0],te=ee[1],ie=(0,p.useRef)(null),oe=Y.ZP.clusters.detail(m?H:null,{},{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,Qe.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]),be=(0,kn.Z)(me),ge=(0,ei.dd)((function(){return(0,S.jsx)(Xt.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)(ge,2),je=xe[0],Ze=xe[1];(0,p.useEffect)((function(){var e=(0,Ye.U2)(Ye.DU,0);me!==be&&t&&!e&&(je(),u([]))}),[t,me,be,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,Mn.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;Dt.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Dt.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 $t.IK.OBSERVABILITY===n}));if(!e)return null;var n=e.name,t=e.state,o=e.status_calculated,r=e.uuid,l=[Jt.i.ACTIVE].includes(t),u=([Jt.i.INACTIVE].includes(t),[$t.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)(jt.Z,{onClickOutside:function(e){(0,Oe.j)(e),te(!1)},open:ne,children:(0,S.jsx)(Ft,{children:(0,S.jsx)(Yt.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:[$t.br.ERROR].includes(o),muted:[$t.br.INCOMPLETE].includes(o),success:u&&l});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(un.ZP,ti(ti({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 $t.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(g){var c,a=null===g||void 0===g||null===(c=g.status)||void 0===c?void 0:c.state;t=(0,S.jsxs)(O.ZP,{monospace:!0,children:[null===g||void 0===g?void 0:g.id," ",a&&![At.X.RUNNING,At.X.WAITING].includes(a)&&(0,G.J3)(a)]}),o=(0,S.jsx)(N.PowerOnOffButton,{danger:[At.X.TERMINATED_WITH_ERRORS].includes(a),default:[At.X.STARTING].includes(a),muted:[At.X.TERMINATED].includes(a),success:[At.X.RUNNING,At.X.WAITING].includes(a),warning:[At.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)(jt.Z,{onClickOutside:function(e){(0,Oe.j)(e),$(!1)},open:J,children:(0,S.jsx)(Ft,{children:(0,S.jsx)(Qt.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}));(g||u)&&(e=(0,S.jsx)(jt.Z,{onClickOutside:function(e){(0,Oe.j)(e),$(!1)},open:J,children:(0,S.jsx)(qt,{})}),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,ti(ti({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]})}),[g,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)(jt.Z,{disableEscape:!0,onClickOutside:function(){return z(!1)},open:K,children:(0,S.jsx)(yt.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&&zt.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||zt.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 X(!0)},uuid:"Pipeline/KernelStatus/kernel",children:sn.RH[(null===i||void 0===i?void 0:i.type)||sn.qL.PYTHON]}),(0,S.jsx)(jt.Z,{disableEscape:!0,onClickOutside:function(){return X(!1)},open:V,children:(0,S.jsx)(yt.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 X(!1)},open:V,parentRef:ie,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*w.iI})})]})})}),[A,ue,t,i,ce,z,X,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})]})})})]})},oi=t(48339),ri=t(12691),li=t.n(ri),ui=t(65976),ci=t(46510),si=t(92709),ai=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 ")})),di=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 ")})),vi=t(74052),pi=t(61709);function fi(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?fi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mi,bi,gi,xi=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),b=((0,p.useMemo)((function(){return null===i||void 0===i?void 0:i.map((function(e){return e.uuid}))}),[i]),(0,p.useState)(null)),g=b[0],x=b[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)(g||[])}),[g]),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(si.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,pi.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,vi.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(hi(hi({},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(si.Qj,H),function(){window.removeEventListener(si.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:g,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(si.Em,e),function(){window.removeEventListener(si.Em,e)}}),[i,F,N,g,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(hi(hi({},n),{},{heights:g}));R(t),N(),null!==n&&void 0!==n&&n.lockScroll&&Z(n)}};return window.addEventListener(si.Wf,e),function(){window.removeEventListener(si.Wf,e)}}),[r,I,g,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)(ai,{height:I,invisible:s,left:d?T+E-Be.nn:void 0,ref:m,children:(0,S.jsx)(di,{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})})};!function(e){e.DBT="dbt"}(mi||(mi={})),function(e){e.PROFILES="profiles",e.PROJECTS="projects",e.TARGETS="targets"}(bi||(bi={})),function(e){e.Block="Block"}(gi||(gi={}));var ji=t(68804),ki=t(29314),Zi=t(93528),yi=t(53779);var Pi=function(e){var n=e.onClose,t=e.onOpenFile,i=e.onSelectBlockFile,o=(0,Zi.ZP)({disableContextMenu:!0,onOpenFile:t,onSelectBlockFile:i,query:{pattern:encodeURIComponent("\\.sql$")},uuid:"FileSelectorPopup/dbt"}).browser;return(0,S.jsxs)(yi.eD,{children:[(0,S.jsxs)(yi.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)(ge.ZP,{iconOnly:!0,onClick:n,children:(0,S.jsx)(N.Close,{muted:!0})})]}),(0,S.jsx)(yi.C,{children:o})]})},Ci=t(39457);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="4px",Si={lightBackground:!0,muted:!0,relativePosition:!0},Ii=[Nn.Zj.BIGQUERY,Nn.Zj.DELTA_LAKE_S3];var Ei=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,b=(0,p.useRef)(null),g=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],X=(0,p.useState)(!!t),Q=X[0],J=X[1],$=(0,p.useState)((0,l.Z)({},B,n||{})),ee=$[0],ne=$[1],te=(0,kn.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===g||void 0===g?void 0:g.length)>0&&((0,Mn.Qr)(e)||!(0,Mn.Xy)(n,e))&&ne((function(e){return wi(wi({},e),{},(0,l.Z)({},B,n))}))}),[null===g||void 0===g?void 0:g.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[Nn.fe.KEY_PROPERTIES]||[]}),[oe]),le=(0,p.useMemo)((function(){return oe[Nn.fe.REPLICATION_KEYS]||[]}),[oe]),ue=Ii.includes(t),ce=a.length>1,se=(0,p.useCallback)((function(e){var n=wi({},null===ee||void 0===ee?void 0:ee[B]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return wi(wi({},e),{},(0,l.Z)({},B,wi({},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,b=void 0===p?[]:p,j=new Set(Array.isArray(b)?b:[b]),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=Nn.D5.reduce((function(e,n){return _.indexOf(n)>=0||Nn.Xv===String(n)&&Nn.zS.DATE_TIME===v||Nn.zS.UUID===String(n)&&Nn.zS.UUID===v?e:e.concat((0,S.jsx)("option",{value:n,children:n},n))}),[]),A=_.findIndex((function(e){return e===Nn.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)(Dn.Z,{border:!0,label:v&&Nn.RL.STRING===e&&A===n?Nn.eL[v]:e,onClick:function(){var n={format:v,type:_.filter((function(n){return n!==e}))};Nn.zS.DATE_TIME!==v&&Nn.zS.UUID!==v||Nn.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:_};Nn.Xv===String(n)?(t.format=Nn.zS.DATE_TIME,t.type.push(Nn.RL.STRING)):Nn.zS.UUID===String(n)?(t.format=Nn.zS.UUID,t.type.push(Nn.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===g||void 0===g||!g.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!==Nn.Zj.DELTA_LAKE_S3,F=N&&(re.includes(u)||!k.has(Nn.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)(ge.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[Nn.fe.REPLICATION_KEYS]||[],m=f[Nn.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===g||void 0===g||!g.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!==g&&void 0!==g&&g.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 wi({},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)(Zn.cl,{children:(0,S.jsx)(R.Z,{alignTop:!0,columnFlex:l,columns:u,rows:i,stickyHeader:!0})})}),[g,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)(Rt.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:_i}),(0,S.jsx)(Rn.Z,wi(wi({},Si),{},{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(b.current),b.current=setTimeout((function(){m(B,(function(e){return wi(wi({},e),{},{destination_table:n})}))}),300)},value:U||"",width:45*w.iI})]})})}),(0,S.jsx)(C.Z,{mb:3,children:(0,S.jsx)(Rt.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:_i}),(0,S.jsx)(Rn.Z,wi(wi({},Si),{},{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:Nn._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Nn._B.INCREMENTAL}),")?",c===Nn.th.POSTGRESQL&&(0,S.jsxs)(O.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Nn._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 wi(wi({},n),{},{replication_method:e.target.value})}))},primary:!0,value:E,children:[(0,S.jsx)("option",{value:""}),Object.values(Nn._B).filter((function(e){return c===Nn.th.POSTGRESQL||e!==Nn._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:_i}),(0,S.jsx)(Rn.Z,wi(wi({},Si),{},{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:Nn.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:Nn.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 wi(wi({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:N,children:[(0,S.jsx)("option",{value:""}),(0,S.jsx)("option",{value:Nn.MU.IGNORE,children:Nn.MU.IGNORE}),(0,S.jsx)("option",{value:Nn.MU.UPDATE,children:Nn.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:_i}),(0,S.jsx)(Rn.Z,wi(wi({},Si),{},{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)(ge.ZP,{compact:!0,disabled:K,onClick:function(){z(!0),setTimeout((function(){return z(!1)}),2e3),d((function(e){return wi(wi({},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)(Rt.Z,{headerTitle:"Features",noPadding:!0,children:ae}),(0,S.jsx)(C.Z,{mt:2,children:(0,S.jsx)(ge.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)(An.Z,{checked:T,onCheck:function(){return m(B,(function(e){return e.run_in_parallel=!T,e}))}},"".concat(B,"/run_in_parallel"))]})}),Nn._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!==g&&void 0!==g&&g.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===g||void 0===g?void 0:g.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Dn.Z,{label:e,onClick:function(){se(e),m(B,(function(n){return wi(wi({},n),{},{bookmark_properties:(0,L.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===g||void 0===g?void 0:g.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)(An.Z,{checked:Q,disabled:!t,onCheck:function(){return J((function(e){return!e}))}})]})}),Q&&!!t&&(0,S.jsx)(Rt.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)(ge.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:g.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 wi(wi({},t),{},(0,l.Z)({},B,wi(wi({},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===g||void 0===g?void 0:g.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)(Dn.Z,{label:e,onClick:function(){m(B,(function(n){return wi(wi({},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)(Dn.Z,{label:e,onClick:function(){m(B,(function(n){return wi(wi({},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)(Dn.Z,{label:e,onClick:function(){m(B,(function(n){return wi(wi({},n),{},{partition_keys:(0,L.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Ti=["catalog","pipeline","setErrors","setSelectedStream"];function Mi(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 Bi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Mi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Mi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Di,Ai=function(e){var n,t=e.catalog,i=e.pipeline,o=e.setErrors,l=e.setSelectedStream,u=(0,In.Z)(e,Ti),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]),b=(0,p.useMemo)((function(){return(0,L.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return g.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===b||void 0===b?void 0:b.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===b||void 0===b?void 0:b.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)(Zn.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,showScrollbar:!0,tabs:v}),m&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(Zn.dE,{children:(0,S.jsx)(Ei,Bi(Bi({},u),{},{bookmarkValues:_,isLoadingUpdateDestinationBlockState:M,stream:m,streams:d,updateDestinationBlockState:T}))})}),d.length>=1&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(Zn.dE,{children:[(0,S.jsx)(A.Z,{level:4,children:"Streams Summary"}),(0,S.jsx)(C.Z,{mt:1}),B]})})]})},Ri=t(46732);function Ni(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function Li(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?Li(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Li(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"}(Di||(Di={}));var Ui=45*w.iI,Hi=Ui-4*w.iI;var Wi=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 Fi(Fi({},e),{},{isMissingStream:!0})}))}),[r,o]),c=Fi({},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),b=m[0],g=m[1],j=(0,p.useState)(Di.ALL),Z=j[0],P=j[1],_=(0,p.useRef)(null),I=Ni(a),E=(0,p.useMemo)((function(){var e=o;return e=e.filter((function(e){var n=e.tap_stream_id;return Z===Di.SELECTED?I.includes(n):Z!==Di.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)(Gn.Z,{children:[(0,S.jsx)(Zn.cv,{rounded:!0,children:(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,S.jsx)(Zn.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)(Ri.Z,{items:[{label:function(){return Di.ALL},onClick:function(){return P(Di.ALL)},uuid:"all_streams"},{label:function(){return Di.SELECTED},onClick:function(){return P(Di.SELECTED)},uuid:"selected"},{label:function(){return Di.NOT_SELECTED},onClick:function(){return P(Di.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return g(!1)},onClickOutside:function(){return g(!1)},open:b,parentRef:_,uuid:"SelectStreams/filter",children:(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Filter,{}),noBackground:!0,onClick:function(){return g((function(e){return!e}))},ref:_,children:(0,S.jsx)(O.ZP,{children:Z})})})})]})}),(0,S.jsx)(Zn.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(Ui,"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 Fi(Fi({},n),{},(0,l.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,S.jsxs)(O.ZP,{danger:n,title:t,width:Ui-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:Hi,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:Hi,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)(ge.ZP,{loading:t,onClick:function(){return i(a)},primary:!0,children:"Confirm ".concat(Ni(a).length," streams")})})]})]})};function Gi(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 Ki(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Gi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Gi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var zi=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],d=(0,kn.Z)(s);(0,p.useEffect)((function(){!i||s||d||a((0,xn.Pz)(null===i||void 0===i?void 0:i.config))}),[s,d,i]);var v=(0,p.useState)(null),h=v[0],m=v[1],b=(0,p.useState)(),x=b[0],j=b[1],k=(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);m(null===e||void 0===e||null===(t=e[o])||void 0===t?void 0:t.success),j(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)}})}}),Z=(0,r.Z)(k,2),P=Z[0],w=Z[1].isLoading;return t?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Zn.$W,{children:(0,S.jsx)(xe.Z,{autoHeight:!0,language:g.t6.YAML,onChange:function(e){a(e),o(t.type,t.uuid,(0,xn.Pz)(Ki(Ki({},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)(ge.ZP,{onClick:function(){P((0,l.Z)({},(0,G.C5)(n),{action_type:"test_connection",config:s,pipeline_uuid:u.uuid})),j(null)},small:!0,success:!0,children:"Test connection"}),(0,S.jsx)(C.Z,{ml:1,children:w?(0,S.jsx)(ke.Z,{color:"white",small:!0}):(0,S.jsxs)(S.Fragment,{children:[h&&(0,S.jsx)(O.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===h&&(0,S.jsx)(O.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),x&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{small:!0,warning:!0,children:x})})]})]}):null},qi=t(85385);function Vi(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 Yi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Vi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Vi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xi=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,b=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]),X=(0,p.useMemo)((function(){return(0,L.HK)(V,(function(e){return e.uuid}))}),[V]),Q=Y.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,J=(0,p.useMemo)((function(){return(null===Q||void 0===Q?void 0:Q.integration_destinations)||[]}),[Q]),$=(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 g.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=X[ne.source])||void 0===e?void 0:e.docs)}),[X,ne]);var te=(0,p.useMemo)((function(){return(0,S.jsx)(zi,{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 g.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)(zi,{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 g.tf.TRANSFORMER===n}))}),[l]),ue=(0,p.useMemo)((function(){var e;return(0,Mn.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,kn.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(qi.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(Nn.ks.UNSUPPORTED!==i.inclusion){var o;if(e.replication_method||(e.replication_method=Nn._B.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=Nn.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]=Yi(Yi({},n),{},{metadata:Yi(Yi({},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,Mn.Qr)(a)||v(ee.type,ee.uuid,(0,xn.Pz)(Yi(Yi({},ne),{},{catalog:{}})));var d={pipeline:Yi(Yi({},m),{},{data_integration:Yi(Yi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:u})})};b(d).then((function(){s(),null===c||void 0===c||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=Yi(Yi({},ue),{},{streams:o.concat(n(i))}),l=null===ne||void 0===ne?void 0:ne.catalog;(0,Mn.Qr)(l)||v(ee.type,ee.uuid,(0,xn.Pz)(Yi(Yi({},ne),{},{catalog:{}})));var u={pipeline:Yi(Yi({},m),{},{data_integration:Yi(Yi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:r})})};b(u).then((function(){return s()}))}),[ue,ee,ne,s,v,m,b]),De=(0,p.useCallback)((function(e){if(null!==ue&&void 0!==ue&&ue.streams){var n=Yi(Yi({},ue),{},{streams:ue.streams.map((function(n){return e(n)}))}),t=null===ne||void 0===ne?void 0:ne.catalog;(0,Mn.Qr)(t)||v(ee.type,ee.uuid,(0,xn.Pz)(Yi(Yi({},ne),{},{catalog:{}})));var i={pipeline:Yi(Yi({},m),{},{data_integration:Yi(Yi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:n})})};b(i).then((function(){return s()}))}}),[ue,ee,ne,s,v,m,b]),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=Yi(Yi({},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)(Ci.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,ei.dd)((function(){return(0,S.jsx)(Wi,{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,Mn.Qr)(t)||v(ee.type,ee.uuid,(0,xn.Pz)(Yi(Yi({},ne),{},{catalog:{}}))),b({pipeline:Yi(Yi({},m),{},{data_integration:Yi(Yi({},(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,b,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)(ge.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=X[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)(Zn.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=X[r])||void 0===n?void 0:n.docs);var l=null===(t=X[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)(Yi(Yi({},ne),{},{catalog:{},config:l,source:r}))):o({content:(0,xn.Pz)({config:l,source:r}),language:g.t6.YAML,type:g.tf.DATA_LOADER},0,Z),Se(null),b().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)(be.Z,{title:"Documentation: ".concat(ne.source),children:(0,S.jsx)(Zn.zG,{children:(0,S.jsx)(_n.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)(ge.ZP,{loading:Me,onClick:function(){b().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)(Ai,{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)(ge.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)(Zn.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)(ci.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ee&&i.push(ee.uuid),o(Yi(Yi({},e),{},{configuration:t,content:n,upstream_blocks:i}),l.length-1,(function(e){ie&&(Le({block:Yi(Yi({},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)(ge.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)(Zn.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)(Yi(Yi({},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:g.t6.YAML,type:g.tf.DATA_EXPORTER,upstream_blocks:u},1,Z)}b().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)(An.Z,{checked:!!ce,disabled:!(null!==ue&&void 0!==ue&&ue.streams),onCheck:function(){return De((function(e){return Yi(Yi({},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)(An.Z,{checked:!!se,disabled:!(null!==ue&&void 0!==ue&&ue.streams),onCheck:function(){return De((function(e){return Yi(Yi({},e),{},{disable_column_type_check:!se})}))}})]})})]})]})]})},Qi=t(16682),Ji=t(82359),$i=t(59457),eo=t(19698),no=t(97133),to=t(35058),io=t(316),oo=t(38399),ro=t(33834);function lo(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 uo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?lo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var co=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,b=void 0===m?[]:m,x=e.blocksThatNeedToRefresh,j=e.dataProviders,k=e.deleteBlock,Z=e.disableAutosave,y=e.disableShortcuts,I=e.fetchFileTree,E=e.fetchPipeline,T=e.fetchSampleData,M=(e.files,e.globalDataProducts),B=e.globalVariables,D=e.hideOutputOnExecution,A=e.hiddenBlocks,R=e.interactionsMapping,N=e.interruptKernel,F=e.mainContainerRef,U=e.mainContainerWidth,H=e.messages,W=e.onChangeCallbackBlock,G=e.onChangeCodeBlock,K=e.openSidekickView,z=e.pipeline,q=e.pipelineContentTouched,V=e.restartKernel,X=e.runBlock,Q=e.runningBlocks,J=void 0===Q?[]:Q,$=e.savePipelineContent,ee=e.scrollTogether,ne=e.selectedBlock,te=e.setAnyInputFocused,ie=e.setDisableShortcuts,oe=e.setEditingBlock,re=e.setErrors,le=e.setHiddenBlocks,ue=e.setIntegrationStreams,ce=e.setOutputBlocks,se=e.setPipelineContentTouched,ae=e.setSelectedBlock,de=e.setSelectedOutputBlock,ve=e.setSelectedStream,pe=e.setTextareaFocused,fe=e.setScrollTogether,he=e.setSideBySideEnabled,me=e.showBrowseTemplates,be=e.showBlockBrowserModal,ge=e.showConfigureProjectModal,xe=e.showDataIntegrationModal,je=e.showGlobalDataProducts,ke=e.showUpdateBlockModal,Ze=e.sideBySideEnabled,ye=e.textareaFocused,Ce=e.widgets,Oe=(0,Ct.Z)(),we=Oe.featureEnabled,_e=Oe.featureUUIDs,Se=Oe.project,Ie=(0,eo.Z)().status,Ee=(0,p.useRef)(null),Te=(0,p.useRef)(null),Me=(0,p.useRef)({}),Be=(0,p.useRef)(null),De=(0,p.useRef)(null),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)(!0),ze=Ke[0],Ve=Ke[1],Ye=(0,p.useState)(!1),$e=Ye[0],en=Ye[1],nn=(0,p.useState)(null),rn=nn[0],un=nn[1],cn=(0,p.useState)(null),an=cn[0],dn=cn[1],vn=(0,p.useState)(!1),pn=vn[0],fn=vn[1],hn=(0,p.useState)(""),mn=hn[0],bn=hn[1],gn=(0,p.useState)({height:null,width:null,x:null,y:null}),xn=gn[0],jn=gn[1],Zn=(0,p.useMemo)((function(){return sn.qL.INTEGRATION===(null===z||void 0===z?void 0:z.type)}),[z]),yn=(0,p.useMemo)((function(){return sn.qL.STREAMING===(null===z||void 0===z?void 0:z.type)}),[z]),Pn=(0,p.useMemo)((function(){return null===b||void 0===b?void 0:b.some((function(e){var n=e.type;return g.tf.DBT===n}))}),[b]),Cn=(0,p.useMemo)((function(){return b.filter((function(e){var n=e.type;return!Zn||g.tf.TRANSFORMER===n}))}),[b,Zn]),On=(0,p.useState)({}),wn=(On[0],On[1]),_n=(0,Je.i)(),Sn=_n.height,In=_n.width;(0,p.useEffect)((function(){var e;null!==F&&void 0!==F&&F.current&&jn(null===F||void 0===F||null===(e=F.current)||void 0===e?void 0:e.getBoundingClientRect())}),[i,d,F,U,jn,Sn,In]);var En=(0,p.useMemo)((function(){return J.reduce((function(e,n,t){return uo(uo({},e),{},(0,l.Z)({},n.uuid,uo(uo({},n),{},{priority:t})))}),{})}),[J]),Tn=(0,p.useState)(null),Bn=Tn[0],Dn=Tn[1],An=(0,p.useMemo)((function(){return(0,S.jsx)(xi,{blocks:Cn,columnIndex:0,columns:2,disabled:ee,eventNameRefsMapping:(0,l.Z)({},si.$e,h),invisible:!(null!==b&&void 0!==b&&b.length)||!Bn||ee,mainContainerRect:xn,scrollTogether:ee,setCursorHeight:Dn})}),[null===b||void 0===b?void 0:b.length,h,Cn,Bn,xn,ee,Dn]),Rn=(0,p.useState)(null),Nn=Rn[0],Ln=Rn[1],Fn=(0,p.useMemo)((function(){return(0,S.jsx)(xi,{blocks:Cn,columnIndex:1,columns:2,disabled:ee,eventNameRefsMapping:(0,l.Z)({},si.tK,Me),invisible:!(null!==b&&void 0!==b&&b.length)||!Nn||ee,mainContainerRect:xn,rightAligned:!0,scrollTogether:ee,setCursorHeight:Ln})}),[null===b||void 0===b?void 0:b.length,Me,Cn,Nn,xn,ee,Ln]),Un=(0,p.useState)(null),Hn=Un[0],Wn=Un[1],Gn=(0,p.useMemo)((function(){var e;return(0,S.jsx)(xi,{blocks:Cn,columnIndex:2,columns:1,disabled:!ee,eventNameRefsMapping:(e={},(0,l.Z)(e,si.tK,Me),(0,l.Z)(e,si.$e,h),e),invisible:!(null!==b&&void 0!==b&&b.length)||!Hn||!ee,mainContainerRect:xn,rightAligned:!0,scrollTogether:ee,setCursorHeight:Wn})}),[Me,h,Cn,Hn,xn,ee,Wn,null===b||void 0===b?void 0:b.length]),Kn=(0,kn.Z)(ne),zn=(0,p.useMemo)((function(){return b.length}),[b]),qn=(0,p.useMemo)((function(){return sn.qL.PYTHON===(null===z||void 0===z?void 0:z.type)&&(null===we||void 0===we?void 0:we(null===_e||void 0===_e?void 0:_e.ADD_NEW_BLOCK_V2))}),[we,_e,z]),Vn=(0,$i.Z)(Y.ZP.block_templates.list,{show_all:!!qn},{revalidateOnFocus:!1},{delay:3e3}).data,Yn=(0,p.useMemo)((function(){return(null===Vn||void 0===Vn?void 0:Vn.block_templates)||[]}),[Vn]),Xn=Y.ZP.configuration_options.pipelines.list(Pn?null===z||void 0===z?void 0:z.uuid:null,{configuration_type:mi.DBT,option_type:bi.PROJECTS,resource_type:gi.Block},{revalidateOnFocus:!1}).data,Qn=(0,p.useMemo)((function(){return null===Xn||void 0===Xn?void 0:Xn.configuration_options}),[Xn]),Jn=(0,p.useCallback)((function(e,t){var i=b[b.length-1],o=null,r=e.configuration||{},l=i?(0,pi.eY)(i,e):[];i&&([g.tf.DATA_LOADER,g.tf.TRANSFORMER].includes(i.type)&&g.tf.SCRATCHPAD===e.type&&(o="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(z.uuid,"', '").concat(i.uuid,"', 'output_0')\n")),g.t6.SQL===i.language&&(r=uo(uo({},(0,Mn.GL)(i.configuration,[to.cH,to.Sv,to.sc,to.BD,to.nq])),r))),g.t6.SQL===e.language&&(o=(0,oo.SF)(o)),o=(0,oo.X7)(e,o);var u=null!==t?t:zn;n(uo(uo({},e),{},{configuration:r,content:o,upstream_blocks:l}),u,ae),pe(!0)}),[n,b,zn,z,ae,pe]);(0,p.useEffect)((function(){var e=function(e){var n=e.detail;De.current=null===n||void 0===n?void 0:n.state},n=function(){Be.current=(0,ki.FV)({activeOnly:!0})};return window.addEventListener(ji.Yj,n),window.addEventListener(ji.Mt,e),function(){window.removeEventListener(ji.Yj,n),window.removeEventListener(ji.Mt,e)}}),[]);var $n="PipelineDetail/index",et=(0,Qe.y)(),nt=et.disableGlobalKeyboardShortcuts,tt=et.registerOnKeyDown,it=et.unregisterOnKeyDown;(0,p.useEffect)((function(){return function(){it($n)}}),[it,$n]),tt($n,(function(e,n,t){var i;if(!(Qi.WH.OPEN===(null===De||void 0===De?void 0:De.current)||(null===Be||void 0===Be||null===(i=Be.current)||void 0===i?void 0:i.length)>=1)){if(q&&(0,Xe.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(!ye&&!ne&&!Zn&&qn){var o,r;if((0,Xe.y)([qe.zX,qe.A1],n)||(0,Xe.y)([qe.PQ,qe.A1],n))return e.preventDefault(),Ue(!0),void(null===Te||void 0===Te||null===(o=Te.current)||void 0===o||o.focus());if(Fe&&(0,Xe.y)([qe.vP],n))return e.preventDefault(),Ue(!1),void(null===Te||void 0===Te||null===(r=Te.current)||void 0===r||r.blur())}if(ye||ne||!y&&!nt)if((0,Xe.y)([qe.zX,qe.Um],n)||(0,Xe.y)([qe.PQ,qe.Um],n))e.preventDefault(),$();else if((0,Xe.y)([qe.zH],n)||(0,Xe.y)([qe.Fv],n)){if(ne&&!e.repeat&&!(0,ro.cK)(e)){var l=b.findIndex((function(e){var n=e.uuid;return ne.uuid===n}));if(-1!==l){var u=(0,Xe.y)([qe.zH],n)?l:l+1;Jn({type:g.tf.SCRATCHPAD},u)}}}else if(ye)n[qe.vP]?pe(!1):q||qe.Z1.find((function(e){return n[e]}))||se(!0);else if(!Zn){if(ne){var c=b.findIndex((function(e){var n=e.uuid;return ne.uuid===n}));if(n[qe.vP])ae(null);else if(t[0]===qe.xD&&t[1]===qe.xD)N();else if(t[0]===qe.l1&&t[1]===qe.l1&&-1!==c)k(ne).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){c===b.length-1?ae(b[c-1]):b.length>=0?ae(b[c+1]):ae(null)}),100)}));else if(n[qe.Bu]&&c>=1){var a=b[c-1];if(a){var d,v;ae(a);var p="".concat(a.type,"s/").concat(a.uuid,".py");null===(d=h.current[p])||void 0===d||null===(v=d.current)||void 0===v||v.scrollIntoView()}}else if(n[qe.kD]&&c<=zn-2){var f=b[c+1];if(f){var m,x;ae(f);var j="".concat(f.type,"s/").concat(f.uuid,".py");null===(m=h.current[j])||void 0===m||null===(x=m.current)||void 0===x||x.scrollIntoView()}}else(0,Xe.y)([qe.Uq],n)&&pe(!0)}else Kn&&n[qe.Uq]&&ae(Kn);s||t[0]!==qe.OC||t[1]!==qe.OC||V()}}}),[n,s,h.current,b,Fe,N,Zn,zn,q,V,$,Te,ne,Kn,se,ae,pe,ye,qn]),(0,p.useEffect)((function(){var e=setInterval((function(){q&&!Z&&$()}),1e4);return function(){clearInterval(e)}}),[Z,q,$]),(0,p.useEffect)((function(){setTimeout((function(){return Ge(!0)}),2*no.zn)}),[z]);var ot=(0,f.Db)(Y.ZP.pipelines.useUpdate(encodeURIComponent(null===z||void 0===z?void 0:z.uuid)),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){null===E||void 0===E||E()},onErrorCallback:function(e,n){return null===re||void 0===re?void 0:re({errors:n,response:e})}})}}),rt=(0,r.Z)(ot,2),lt=rt[0],ut=(rt[1].isLoading,(0,f.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===z||void 0===z?void 0:z.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(){E()},onErrorCallback:function(e,n){return null===re||void 0===re?void 0:re({errors:n,response:e})}})}})),ct=(0,r.Z)(ut,1)[0],st=(0,p.useCallback)((function(e){Ne(!0),dn(e),ie(!0)}),[Ne,ie,dn]),at=(0,p.useCallback)((function(){Ne(!1),fn(!1),bn(""),ie(!1)}),[ie]),dt=(0,p.useCallback)((function(e,n){var t,i;b.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)(b,i);return o=(0,L.Hk)(n,Math.max(t,0),o),$({pipeline:{blocks:o,uuid:null===z||void 0===z?void 0:z.uuid}})}),[b,z,$]),vt=(0,p.useMemo)((function(){return z&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ci.Z,{addNewBlock:Jn,blockIdx:zn,blockTemplates:Yn,focusedAddNewBlockSearch:Fe,hideCustom:Zn||yn,hideDataExporter:Zn,hideDataLoader:Zn,hideDbt:Zn||yn,hideScratchpad:Zn,hideSensor:Zn,onClickAddSingleDBTModel:st,pipeline:z,project:Se,searchTextInputRef:Te,setCreatingNewDBTModel:fn,setFocusedAddNewBlockSearch:Ue,showBlockBrowserModal:be,showBrowseTemplates:me,showConfigureProjectModal:ge,showGlobalDataProducts:je}),!qn&&!Zn&&!yn&&(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:Ji.d.ADD_NEW_BLOCK_V2})," ","in your"," ",(0,S.jsx)(li(),{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"})})}),"."]})})]})}),[Jn,Yn,Fe,Zn,yn,zn,st,z,Se,Te,Ue,be,me,ge,je,qn]);(0,p.useEffect)((function(){var e,n=function(){var e,n,t,i=((null===F||void 0===F||null===(e=F.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,io.bS)((0,io.xi)((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,io.bS)((0,io.xi)((null===e||void 0===e||null===(r=e.current)||void 0===r?void 0:r.className)||"",["disable-border-radius"]),["enable-border-radius"]))}))};null===F||void 0===F||null===(e=F.current)||void 0===e||e.addEventListener("scroll",n);var t=null===F||void 0===F?void 0:F.current;return function(){null===t||void 0===t||t.removeEventListener("scroll",n)}}),[h,F]);var pt=(0,p.useRef)({}),ft=(0,p.useMemo)((function(){var e=[],i=(null===Cn||void 0===Cn?void 0:Cn.length)||0;return Cn.forEach((function(r,s){var d,f,m,Z=s===i-1,P=r.type,C=r.uuid,O=(null===ne||void 0===ne?void 0:ne.uuid)===C,w=En[C],T=w?0===w.priority?oi.uF.BUSY:oi.uF.QUEUED:oi.uF.IDLE,B=(0,vi.zv)({type:P,uuid:C});(d=Me.current)[B]||(d[B]=(0,p.createRef)()),(f=h.current)[B]||(f[B]=(0,p.createRef)());var L,q,V=(0,vi.zv)({type:P,uuid:(null===r||void 0===r?void 0:r.replicated_block)||C});null!==r&&void 0!==r&&r.replicated_block&&((L=pt.current)[V]||(L[V]=(0,l.Z)({},C,{})),(q=pt.current[V])[C]||(q[C]=(0,p.createRef)()));var Y=P===g.tf.MARKDOWN,Q=P===g.tf.TRANSFORMER,ie=!(null===A||void 0===A||!A[C]),ue=s===zn-1||Zn,se=Me.current[B],ve=h.current[B],Pe=C,Oe=null===x||void 0===x||null===(m=x[P])||void 0===m?void 0:m[C];Oe&&(Pe="".concat(Pe,":").concat(Oe));e.push((0,S.jsx)(ln.Z,{addNewBlock:function(e,t){pe(!0);return n(e,Ze?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)||[];ct({block:{uuid:r},upstreamBlocks:[e.uuid].concat((0,o.Z)(l))})}null===ae||void 0===ae||ae(e)}))},addNewBlockMenuOpenIdx:rn,addWidget:t,allBlocks:u,allowCodeBlockShortcuts:c,autocompleteItems:a,block:r,blockIdx:s,blockInteractions:null===v||void 0===v?void 0:v[C],blockOutputRef:se,blockRefs:h,blockTemplates:Yn,blocks:b,codeEditorMappingRef:pt,containerRef:Ee,cursorHeight1:Bn,cursorHeight2:Nn,cursorHeight3:Hn,dataProviders:j,dbtConfigurationOptions:Qn,defaultValue:r.content,deleteBlock:function(e){k(e),te(!1)},disableShortcuts:y,executionState:T,fetchFileTree:I,fetchPipeline:E,globalDataProducts:M,hideOutputOnExecution:D,hideRunButton:yn||Y||Zn&&Q,interactionsMapping:R,interruptKernel:N,isHidden:ie,mainContainerRect:xn,mainContainerRef:F,mainContainerWidth:U,messages:H[C],noDivider:ue,onCallbackChange:function(e){return W(P,C,e)},onChange:function(e){return G(P,C,e)},onClickAddSingleDBTModel:st,onDrop:dt,onMountCallback:function(e){null!==r&&void 0!==r&&r.replicated_block&&(pt.current[V][C]=e)},openSidekickView:K,pipeline:z,project:Se,ref:ve,runBlock:X,runningBlocks:J,savePipelineContent:$,scrollTogether:ee,selected:O,setAddNewBlockMenuOpenIdx:un,setAnyInputFocused:te,setCreatingNewDBTModel:fn,setEditingBlock:oe,setErrors:re,setHiddenBlocks:le,setMountedBlocks:wn,setOutputBlocks:ce,setScrollTogether:fe,setSelected:function(e){return ae(!0===e?r:null)},setSelectedBlock:ae,setSelectedOutputBlock:de,setSideBySideEnabled:he,setTextareaFocused:pe,showBlockBrowserModal:be,showBrowseTemplates:me,showConfigureProjectModal:ge,showDataIntegrationModal:xe,showGlobalDataProducts:je,showUpdateBlockModal:ke,sideBySideEnabled:Ze,textareaFocused:O&&ye,updatePipeline:lt,widgets:Ce,windowWidth:In,children:Ze&&Z&&(0,S.jsx)("div",{style:{paddingBottom:_.WC,paddingTop:_.WC},children:vt})},Pe))})),e}),[n,rn,vt,t,u,c,a,v,Me,h,Yn,b,Cn,x,Ee,Bn,Nn,Hn,j,Qn,k,y,I,E,M,D,A,R,N,Zn,yn,xn,F,U,H,zn,W,G,st,dt,K,z,Se,X,J,En,$,ee,ne,un,te,oe,re,le,wn,ce,ae,de,pe,fe,he,be,me,ge,xe,je,ke,Ze,ye,ct,lt,Ce,In]),ht=(0,p.useMemo)((function(){return(0,S.jsx)(Xi,{addNewBlockAtIndex:n,blocks:b,codeBlocks:ft,fetchFileTree:I,fetchPipeline:E,fetchSampleData:T,globalVariables:B,onChangeCodeBlock:G,openSidekickView:K,pipeline:z,savePipelineContent:$,setErrors:re,setIntegrationStreams:ue,setOutputBlocks:ce,setSelectedBlock:ae,setSelectedOutputBlock:de,setSelectedStream:ve})}),[n,b,ft,I,E,T,B,G,K,z,$,re,ue,ce,ae,de,ve]),mt=(0,p.useCallback)((function(e){var t="undefined"===typeof an||null===an;n((0,vi.J8)({blockIndex:an,blocks:b,filePath:e,isNewBlock:pn,name:mn,repoPathRelativeRoot:null===Ie||void 0===Ie?void 0:Ie.repo_path_relative_root}),(t?zn:an+1)-(Ze?1:0),ae),at(),pe(!0)}),[n,b,at,pn,mn,an,zn,ae,pe,Ze,Ie]);(0,p.useEffect)((function(){$e&&Se&&setTimeout((function(){return Ve(!1)}),no.zn)}),[$e,Se]);var bt=(0,p.useCallback)((function(e,n,t){mt(t)}),[mt]);return(0,p.useCallback)((function(e,n){n||mt(e)}),[mt]),(0,S.jsxs)(tn.W,{backend:on.PD,children:[(0,S.jsx)(no.lO,{ref:Ee,children:ze&&(0,S.jsx)(ui.Z,{classNames:"pipeline-detail",in:We,onEntered:function(){return en(!0)},timeout:1,children:(0,S.jsx)(no.fm,{})})}),Zn&&(0,S.jsx)(C.Z,{mt:1,px:w.cd,children:ht}),!Ze&&(0,S.jsx)(C.Z,{mt:1,px:w.cd,children:!Zn&&(0,S.jsxs)(S.Fragment,{children:[ft,(0,S.jsx)(C.Z,{mt:w.cd,children:vt})]})}),Ze&&(0,S.jsxs)("div",{style:{position:"relative"},children:[An,ft,Fn,Gn,!(null!==b&&void 0!==b&&b.length)&&(0,S.jsx)(C.Z,{p:w.cd,children:vt})]}),Re&&(0,S.jsx)(jt.Z,{onClickOutside:at,open:!0,children:(0,S.jsx)(Pi,{onClose:at,onSelectBlockFile:bt})})]})},so=t(1402),ao=t(31557),vo=t(2842);function po(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 fo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?po(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):po(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ho=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.beforeDraggableTopOffset,f=e.beforeHeader,h=e.beforeHeightOffset,m=e.beforeHidden,b=e.beforeNavigationItems,g=e.children,x=e.errors,j=e.footerOffset,k=e.headerOffset,Z=e.mainContainerFooter,y=e.mainContainerHeader,P=e.mainContainerRef,C=e.page,O=e.pipeline,w=e.setAfterHidden,_=e.setAfterWidthForChildren,I=e.setBeforeHidden,E=e.setErrors,T=e.setMainContainerWidth,M=(0,Je.i)().width,B=(0,p.useState)((0,Ye.U2)(Ye.L8,vo.Zt)),D=B[0],A=B[1],R=(0,p.useState)((0,Ye.U2)(Ye.J3,vo.ve)),N=R[0],L=R[1],F=(0,p.useState)(!1),U=F[0],H=F[1],W=(0,p.useState)(!1),K=W[0],z=W[1],q=l,V=w;if(!V){var Y=(0,p.useState)(!!(0,Ye.U2)(Ye.zg)),X=(0,r.Z)(Y,2);q=X[0],V=X[1]}var Q=m,J=I;if(!J){var $=(0,p.useState)(!!(0,Ye.U2)(Ye.Uu)),ee=(0,r.Z)($,2);Q=ee[0],J=ee[1]}(0,p.useEffect)((function(){null===P||void 0===P||!P.current||U||K||null===T||void 0===T||T(P.current.getBoundingClientRect().width)}),[U,K,q,D,Q,N,P,T,M]),(0,p.useEffect)((function(){U||(null===_||void 0===_||_(D),(0,Ye.t8)(Ye.L8,D))}),[U,D,_]),(0,p.useEffect)((function(){K||(0,Ye.t8)(Ye.J3,N)}),[K,N]);var ne=(0,p.useMemo)((function(){var e=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return O&&(e.push.apply(e,[{bold:si.b7!==C,label:function(){return null===O||void 0===O?void 0:O.uuid},linkProps:{as:"/pipelines/".concat(null===O||void 0===O?void 0:O.uuid),href:"/pipelines/[pipeline]"}}]),si.b7===C&&e.push.apply(e,[{bold:!0,label:function(){return(0,G.kC)(C)}}])),(0,S.jsx)(ao.Z,{breadcrumbs:e})}),[C,O]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Bt.Z,{title:null===O||void 0===O?void 0:O.name}),(0,S.jsx)(Te.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:o,afterHidden:q,afterInnerHeightMinus:u,afterMousedownActive:U,afterNavigationItems:c,afterOverflow:s,afterSubheader:a,afterWidth:D,before:d,beforeDraggableTopOffset:v,beforeHeader:f,beforeHeightOffset:h,beforeHidden:Q,beforeMousedownActive:K,beforeNavigationItems:b,beforeWidth:N,footerOffset:j,header:ne,headerOffset:k,mainContainerFooter:Z,mainContainerHeader:y,mainContainerRef:P,navigationShowMore:!0,setAfterHidden:V,setAfterMousedownActive:H,setAfterWidth:A,setBeforeHidden:J,setBeforeMousedownActive:z,setBeforeWidth:L,subtractTopFromBeforeDraggableHeight:!0,children:g}),x&&(0,S.jsx)(jt.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return E(null)},children:(0,S.jsx)(so.Z,fo(fo({},x),{},{onClose:function(){return E(null)}}))})]})},mo=t(55729),bo=t(93808),go=t(8666),xo=t(72226),jo=t(29644),ko=t(46209),Zo=t(79264),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),Co=t(79633);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 wo(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 _o={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},So={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},Io=(0,pi.YW)();var Eo=function(e){e.addNewBlockAtIndex;var n,t,i,o,l,u=e.block,c=(e.contentByBlockUUID,e.fetchFileTree),s=e.fetchPipeline,a=e.globalDataProducts,d=e.pipeline,v=e.project,h=e.setSelectedBlock,m=(e.showDataIntegrationModal,e.showUpdateBlockModal),b=(0,p.useRef)(null),k=(0,p.useRef)(null),_=(0,p.useMemo)((function(){return null===d||void 0===d?void 0:d.uuid}),[d]),I=(0,p.useMemo)((function(){return(null===d||void 0===d?void 0:d.retry_config)||{}}),[d]),E=(0,p.useMemo)((function(){return!(null!==d&&void 0!==d&&d.run_pipeline_in_one_process)&&[sn.qL.PYSPARK,sn.qL.PYTHON].includes(null===d||void 0===d?void 0:d.type)}),[d]),T=u.color,M=u.configuration,B=u.language,D=u.name,F=u.type,U=u.uuid,H=(0,p.useMemo)((function(){return g.tf.DBT===F}),[F]),W=null===d||void 0===d||null===(n=d.blocks)||void 0===n?void 0:n.findIndex((function(e){return e.uuid===U})),K=(0,p.useMemo)((function(){var e;return null===d||void 0===d||null===(e=d.blocks)||void 0===e?void 0:e[W]}),[W,null===d||void 0===d?void 0:d.blocks]),z=(0,ae.VI)(null,{},[],{uuid:"BlockSettings/index"}),q=(0,r.Z)(z,1)[0],V=(0,p.useMemo)((function(){return(0,L.HK)(a||[],(function(e){return e.uuid}))}),[a]),X=(0,p.useMemo)((function(){var e,n=null===M||void 0===M||null===(e=M.global_data_product)||void 0===e?void 0:e.uuid;if(n&&V)return null===V||void 0===V?void 0:V[n]}),[M,V]),Q=Y.ZP.pipelines.detail(go.b.PIPELINE===(null===X||void 0===X?void 0:X.object_type)&&(null===X||void 0===X?void 0:X.object_uuid),{},{revalidateOnFocus:!1}).data,J=(0,p.useMemo)((function(){return null===Q||void 0===Q?void 0:Q.pipeline}),[Q]),$=(0,p.useState)(null),ee=$[0],ne=$[1],te=(0,p.useState)(!1),ie=te[0],oe=te[1],re=(0,p.useState)(!1),le=re[0],ue=re[1],ce=(0,p.useState)(!1),se=ce[0],de=ce[1],ve=(0,kn.Z)(u);(0,p.useEffect)((function(){(null===ve||void 0===ve?void 0:ve.uuid)!==(null===u||void 0===u?void 0:u.uuid)&&ne(u)}),[u,ve]);var pe=(0,p.useMemo)((function(){return(null===ee||void 0===ee?void 0:ee.retry_config)||{}}),[ee]),fe=(0,p.useCallback)((function(e){oe(!0),ne(e)}),[]),he=(0,p.useMemo)((function(){return(0,Mn.gR)((null===ee||void 0===ee?void 0:ee.configuration)||M,["data_integration","file_path","file_source","global_data_product"])}),[null===ee||void 0===ee?void 0:ee.configuration,M]),me=(0,p.useCallback)((function(e){return fe((function(n){return wo(wo({},n),{},{configuration:wo(wo({},null===ee||void 0===ee?void 0:ee.configuration),e)})}))}),[null===ee||void 0===ee?void 0:ee.configuration,fe]),be=(0,p.useMemo)((function(){return null===ee||void 0===ee?void 0:ee.executor_type}),[ee]);(0,p.useEffect)((function(){le||!be||Po.R.find((function(e){return e===be}))||ue(!0)}),[le,be]);var xe=Y.ZP.blocks.pipelines.detail(_,encodeURIComponent(U),{_format:"with_settings",block_type:F}).data,je=(0,p.useMemo)((function(){return(null===xe||void 0===xe?void 0:xe.block)||{}}),[xe]),Ze=(0,p.useMemo)((function(){return null!==je&&void 0!==je&&je.pipelines?null===je||void 0===je?void 0:je.pipelines:[]}),[je]),ye=(null===Ze||void 0===Ze?void 0:Ze.length)||1,Ce=(0,f.Db)(Y.ZP.blocks.pipelines.useUpdate(_,encodeURIComponent(U)),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){oe(!1),null===c||void 0===c||c(),s(),null!==e&&void 0!==e&&e.block&&h(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return q({errors:n,response:e})}})}}),Oe=(0,r.Z)(Ce,2),we=Oe[0],_e=Oe[1].isLoading,Se=((0,p.useCallback)((function(e){return we({block:e})}),[we]),(0,p.useMemo)((function(){return ye>=1&&(0,S.jsx)(Zn.cl,{children:(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Project path"}],rows:Ze.map((function(e){var n,t,i=e.pipeline,o=i.name,r=i.repo_path,l=i.uuid,u=!(null===v||void 0===v||!v.settings),c=(null===d||void 0===d?void 0:d.uuid)===l&&(!u||(null===v||void 0===v||null===(n=v.settings)||void 0===n?void 0:n.path)===r);return[c||u&&(null===v||void 0===v||null===(t=v.settings)||void 0===t?void 0:t.path)!==r?(0,S.jsxs)(O.ZP,{monospace:!0,muted:!0,children:[o||l,c&&" (current)"]},"name"):(0,S.jsx)(P.Z,{href:"/pipelines/".concat(l,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:o||l},"name"),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,children:r||"-"},"project_path")]})),uuid:"git-branch-blockPipelines"})})}),[Ze,ye,d,null===v||void 0===v?void 0:v.settings])),Ie=(0,p.useMemo)((function(){return I&&"undefined"!==typeof I&&!(0,Mn.Qr)(I)&&("undefined"!==typeof(null===I||void 0===I?void 0:I.delay)&&"undefined"===typeof(null===pe||void 0===pe?void 0:pe.delay)||"undefined"!==typeof(null===I||void 0===I?void 0:I.exponential_backoff)&&"undefined"===typeof(null===pe||void 0===pe?void 0:pe.exponential_backoff)||"undefined"!==typeof(null===I||void 0===I?void 0:I.max_delay)&&"undefined"===typeof(null===pe||void 0===pe?void 0:pe.max_delay)||"undefined"!==typeof(null===I||void 0===I?void 0:I.retries)&&"undefined"===typeof(null===pe||void 0===pe?void 0:pe.retries))}),[pe,I]),Te=(0,p.useMemo)((function(){var e;return(null===ee||void 0===ee||null===(e=ee.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[ee]),Me=(0,p.useCallback)((function(e){return fe((function(n){var t;return wo(wo({},n),{},{configuration:wo(wo({},null===ee||void 0===ee?void 0:ee.configuration),{},{global_data_product:e(null===ee||void 0===ee||null===(t=ee.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[ee,fe]),Be=(0,p.useMemo)((function(){return(0,Pn.jO)(u,d)}),[u,d]);return(0,p.useMemo)((function(){return Be&&(0,Pn.Uc)(u)}),[u,Be]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:w.HN,pt:w.cd,children:[ye>1&&(0,S.jsx)(C.Z,{mb:w.Mq,px:w.cd,children:(0,S.jsx)(yo,{children:(0,S.jsxs)(y.ZP,wo(wo({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{children:[(0,S.jsx)(N.DiamondShared,{fill:Co.$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 ",ye," pipelines"]})]}),!H&&(null===d||void 0===d?void 0:d.type)!==sn.qL.INTEGRATION&&(0,S.jsx)(Rn.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)(ge.ZP,wo(wo({},_o),{},{afterIcon:(0,S.jsx)(N.DiamondDetached,{size:pn.bL}),iconOnly:!1,onClick:function(){return m(wo(wo({},(0,Mn.gR)(K,["all_upstream_blocks_executed","callback_blocks","conditional_blocks","downstream_blocks","executor_config","executor_type","name","outputs","retry_config","status","tags","timeout"])),{},{detach:!0}),"".concat(D,"_copy"),!0)},padding:null,children:"Detach"}))})]}))})}),(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsxs)(Sn.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(Sn.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,wo(wo({},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)(ge.ZP,wo(wo({},_o),{},{afterIcon:H?null:(0,S.jsx)(N.Edit,{size:pn.bL}),disabled:H,onClick:function(){return m(u,D)},children:(0,S.jsx)(O.ZP,{bold:!0,children:D||""})}))]}))}),g.tf.CUSTOM===(null===u||void 0===u?void 0:u.type)?(0,S.jsx)(Sn.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,wo(wo({},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)(ge.ZP,wo(wo({},_o),{},{afterIcon:(0,S.jsx)(j.Z,{color:T?Io[T]:null,size:pn.bL,square:!0}),onClick:function(){return m(u,D)},outline:!1,children:(0,S.jsx)(O.ZP,{bold:!0,children:(0,G.kC)(T||"")})}))]}))}):null]}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(x.Z,{checked:!(null===ee||void 0===ee||null===(t=ee.configuration)||void 0===t||!t.disable_output_preview),label:"Disable output preview",onClick:function(){return fe((function(e){var n;return wo(wo({},e),{},{configuration:wo(wo({},null===e||void 0===e?void 0:e.configuration),{},{disable_output_preview:!(null!==e&&void 0!==e&&null!==(n=e.configuration)&&void 0!==n&&n.disable_output_preview)})})}))}})})]}),(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:[!le&&(0,S.jsx)(an.Z,{label:"Executor type",onChange:function(e){return fe((function(n){return wo(wo({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:b,value:(null===ee||void 0===ee?void 0:ee.executor_type)||"",children:Po.R.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}),le&&(0,S.jsx)(Ee.Z,{label:"Executor type",monospace:!0,onChange:function(e){return fe((function(n){return wo(wo({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:k,setContentOnMount:!0,value:(null===ee||void 0===ee?void 0:ee.executor_type)||""}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(P.Z,{muted:!0,onClick:function(){le?(fe((function(e){return wo(wo({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===b||void 0===b||null===(e=b.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===k||void 0===k||null===(e=k.current)||void 0===e?void 0:e.focus()}),1),ue(!le)},preventDefault:!0,small:!0,children:le?"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:[Ie&&(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 fe((function(n){var t;return wo(wo({},n),{},{retry_config:wo(wo({},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===I||void 0===I?void 0:I.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===pe||void 0===pe?void 0:pe.retries)?null===pe||void 0===pe?void 0:pe.retries:(null===I||void 0===I?void 0:I.retries)||""}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Ee.Z,{label:"Delay",monospace:!0,onChange:function(e){return fe((function(n){var t;return wo(wo({},n),{},{retry_config:wo(wo({},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===I||void 0===I?void 0:I.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===pe||void 0===pe?void 0:pe.delay)?null===pe||void 0===pe?void 0:pe.delay:(null===I||void 0===I?void 0:I.delay)||""}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Ee.Z,{label:"Max delay",monospace:!0,onChange:function(e){return fe((function(n){var t;return wo(wo({},n),{},{retry_config:wo(wo({},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===I||void 0===I?void 0:I.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===pe||void 0===pe?void 0:pe.max_delay)?null===pe||void 0===pe?void 0:pe.max_delay:(null===I||void 0===I?void 0:I.max_delay)||""})]}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(x.Z,{checked:"undefined"===typeof(null===pe||void 0===pe?void 0:pe.exponential_backoff)&&"undefined"!==typeof(null===I||void 0===I?void 0:I.exponential_backoff)?!(null===I||void 0===I||!I.exponential_backoff):!(null===pe||void 0===pe||!pe.exponential_backoff),label:"Exponential backoff",onClick:function(){return fe((function(e){var n;return wo(wo({},e),{},{retry_config:wo(wo({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===pe||void 0===pe?void 0:pe.exponential_backoff)&&"undefined"!==typeof(null===I||void 0===I?void 0:I.exponential_backoff)?!(null!==I&&void 0!==I&&I.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),E&&(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 fe((function(n){return wo(wo({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null===ee||void 0===ee?void 0:ee.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."})]}),H&&(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===ee||void 0===ee||null===(i=ee.configuration)||void 0===i||null===(o=i.dbt)||void 0===o||!o.disable_tests),label:"Disable automatically running dbt tests",onClick:function(){return fe((function(e){var n,t,i;return wo(wo({},e),{},{configuration:wo(wo({},null===e||void 0===e?void 0:e.configuration),{},{dbt:wo(wo({},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)})})})}))}})})]}),g.Lk.includes(F)&&g.t6.PYTHON===B&&(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 de((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,wo(wo({},So),{},{children:" Enter"}))," or",(0,S.jsx)(O.ZP,wo(wo({},So),{},{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,wo(wo({},So),{},{bold:!1,children:["(",U,")."]})),(0,S.jsxs)(O.ZP,{inline:!0,muted:!0,children:[" ","Refer to the",(0,S.jsxs)(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.jsxs)(O.ZP,{bold:!0,inline:!0,warning:!0,children:["Note:"," "]}),"Click the",(0,S.jsx)(O.ZP,wo(wo({},So),{},{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:[se&&(0,S.jsx)(Zo.Z,{editStateInit:!0,focusKey:!0,onEnterCallback:function(){return de(!1)},onEscapeCallback:function(){return de(!1)},updateVariable:me},"new_block_variable"),null===(l=Object.entries(he))||void 0===l?void 0:l.map((function(e){var n=e[0];return(0,S.jsx)(Zo.Z,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=wo({},null===ee||void 0===ee?void 0:ee.configuration);delete e[n],fe((function(n){return wo(wo({},n),{},{configuration:wo({},e)})}))},disableKeyEdit:!0,updateVariable:me,variable:{uuid:n,value:e[1]}},n)}))]})]}),g.tf.GLOBAL_DATA_PRODUCT===F&&(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)(xo.Z,{objectAttributes:Te,originalAttributes:X,setObjectAttributes:Me})}),(0,S.jsx)(C.Z,{mt:w.Mq,children:(0,S.jsx)(jo.Z,{objectAttributes:Te,originalAttributes:X,setObjectAttributes:Me})}),(0,S.jsx)(C.Z,{mt:w.Mq,children:(0,S.jsx)(ko.Z,{blocks:null===J||void 0===J?void 0:J.blocks,objectAttributes:Te,originalAttributes:X,setObjectAttributes:Me})})]}),(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(ge.ZP,{disabled:!ie,loading:_e,onClick:function(){return we({block:{configuration:null===ee||void 0===ee?void 0:ee.configuration,executor_type:null===ee||void 0===ee?void 0:ee.executor_type,retry_config:pe,timeout:null===ee||void 0===ee?void 0:ee.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,S.jsxs)(C.Z,{mb:w.HN,children:[!xe&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(ke.Z,{inverted:!0})}),xe&&(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 (",ye,")"]}),(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."})]}),Se]})]})]})},To=t(24496),Mo=t(50450),Bo=t(46568),Do=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function Ao(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?Ao(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ao(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var No=v.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*w.iI),Lo=v.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var Fo=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,b=e.onClick,g=e.notRequired,x=e.selectedTextProps,j=e.small,k=e.stacked,w=e.suffixValue,_=e.tooltipProps,I=e.value,E=(0,In.Z)(e,Do),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)(Rn.Z,Ro({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(){b(),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,Ro(Ro({inverted:s,muted:m},x),{},{disableWordBreak:r,monospace:h,small:j,title:c?I:null,width:c,children:I}))}),(0,S.jsx)(Ee.Z,Ro(Ro({},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)(Lo,{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)(No,{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&&!g&&(0,S.jsx)(O.ZP,{danger:!0,small:j,children:"This field is required."})]})},Uo=t(10305),Ho=t(84820),Wo=t(85108),Go=t(97301);function Ko(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 zo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ko(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ko(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function qo(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,b=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),X=Y.ZP.blocks.pipelines.detail(encodeURIComponent(null===E||void 0===E?void 0:E.uuid),encodeURIComponent(null===s||void 0===s?void 0:s.upstream_blocks[0])).data,Q=(null===X||void 0===X||null===(t=X.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===Q.length),de=ae[0],ve=ae[1],pe=(0,p.useState)(!1),fe=pe[0],he=pe[1],me=(0,p.useState)(null),be=me[0],ge=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===Q||void 0===Q?void 0:Q.length)||0),Oe=Ce[0],we=Ce[1],_e=(0,p.useState)(s.uuid),Se=_e[0],Ie=_e[1],Te=Wo.G8[te],Me=Wo.x8[te],Be=(0,p.useMemo)((function(){return null===d||void 0===d?void 0:d.filter((function(e){var n=e.type;return!g.vn.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!==oi.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]),Ue=(0,p.useMemo)((function(){var e,n;if(null!==Re&&void 0!==Re&&Re.length){var t,i,o,r,l,u=Re.length-1;n=(null===Re||void 0===Re||null===(t=Re[u])||void 0===t||null===(i=t.data)||void 0===i?void 0:i[0])||(null===Re||void 0===Re||null===(o=Re[u])||void 0===o||null===(r=o.data)||void 0===r||null===(l=r.data)||void 0===l?void 0:l[0])}return n?(n=(n=n.slice(1,n.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,G.Pb)(n)&&(e=JSON.parse(n))):(null===Q||void 0===Q?void 0:Q.length)>=1&&(e={},Q.forEach((function(n){var t=n||{},i=t.text_data,o=t.type,r=t.variable_uuid;oi.Gi.TEXT===o&&(0,G.Pb)(i)&&(e[r]=JSON.parse(i))}))),e}),[Re,Q]),He=(0,p.useCallback)((function(e){var n=zo(zo(zo({},s),e),{},{configuration:zo(zo({},s.configuration),e.configuration)});B().then((function(){T({block:n,code:ce,ignoreAlreadyRunning:!0,runUpstream:!!Ze.find((function(e){var n;return![g.DA.EXECUTED,g.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]),We=(0,p.useCallback)((function(e){se(e),I(e)}),[I,se]),Ge=(0,p.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;le((function(n){return zo(zo({},n),e)}));var i=zo(zo({},s),{},{configuration:zo(zo(zo({},re),e),{},{chart_type:te})});K(i),Oe&&t&&He(i)}),[s,te,re,Oe,He,le,K]);(0,p.useEffect)((function(){ee({python:(0,Ho.Z)({autocompleteItems:c,block:s,blocks:d,pipeline:E})})}),[c,s,d,E]);var Ke=(0,p.useMemo)((function(){return(0,S.jsx)(xe.Z,{autoHeight:!0,autocompleteProviders:$,onChange:We,selected:D,setSelected:function(e){return F(!0===e?s:null)},setTextareaFocused:H,showLineNumbers:!1,textareaFocused:W||to.oV.TABLE===te&&!de,value:ce,width:"100%"})}),[$,s,te,ce,de,D,F,H,W,We]),ze=(0,p.useMemo)((function(){return(Ne||Le)&&(0,S.jsx)(Mo.Z,zo(zo({},Fe),{},{block:s,contained:!1,hideExtraInfo:!0,isInProgress:Ae,messages:Re,selected:D}))}),[s,Fe,Ne,Le,Ae,Re,D]),Ve=(0,p.useMemo)((function(){return re[to.v8]||1}),[re]),Ye=(0,kn.Z)(de),Xe=(0,kn.Z)(z),Je=(0,kn.Z)(null===re||void 0===re?void 0:re[to.v8]);(0,p.useEffect)((function(){var e,n=null===q||void 0===q||null===(e=q.current)||void 0===e?void 0:e.getBoundingClientRect();Ye!==de||Xe!==z||Je!==Ve?(ge(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&&ge(t)}),100)):n&&ge(n.width)}),[de,Ye,q,ge,z,Xe,Ve,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 to.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=Wo.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,kn.Z)(te),tn=(0,kn.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,Mn.Qr)(re)&&Me){var e=zo(zo({},s),{},{upstream_blocks:Ze});Me.configuration&&Ge(Me.configuration(e)),Me.content&&We(Me.content(e))}}),[s,te,nn,re,ce,Me,Ge,We,Ze,tn]);var on=(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 zo(zo({},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 Ge((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!==X&&void 0!==X&&X.block?[X.block]:[]).reduce((function(e,n){var t=n.outputs;return t?e.concat(t.reduce((function(e,n){var t,i=n.sample_data;return null!==i&&void 0!==i&&i.columns?e.concat(null===i||void 0===i||null===(t=i.columns)||void 0===t?void 0:t.filter((function(n){return!e.includes(n)}))):e}),[])):e}),[]);if(Wo.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,zo(zo({},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),Ge((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)(Dn.Z,{label:e,onClick:function(){Ge((0,l.Z)({},d,(0,L.Od)(f,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(Wo.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)(Uo.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]}))||(Ge((0,l.Z)({},d,h.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),o([null,null]),i()))},children:[(0,S.jsx)(an.Z,zo(zo({},v),{},{label:"aggregation",children:(0,L.YC)(to.bn,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),(0,S.jsx)(an.Z,zo(zo({},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)(Dn.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(){Ge((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,zo(zo({},v),{},{children:r.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})):(0,S.jsx)(Ee.Z,zo(zo({},v),{},{type:a}));return(0,S.jsx)(C.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[s,re,Te,X,F,Ge]),rn=on.code,ln=on.noCode,cn=(0,f.Db)(Y.ZP.widgets.pipelines.useUpdate(encodeURIComponent(null===E||void 0===E?void 0:E.uuid),encodeURIComponent(s.uuid)),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){he(!1),b(),null===x||void 0===x||x()},onErrorCallback:function(e,n){return null===R||void 0===R?void 0:R({errors:n,response:e})}})}}),sn=(0,r.Z)(cn,1)[0],dn="ChartBlock/".concat(s.uuid),vn=(0,Qe.y)(),pn=vn.registerOnKeyDown,fn=vn.unregisterOnKeyDown;return(0,p.useEffect)((function(){return function(){fn(dn)}}),[fn,dn]),pn(dn,(function(e,n,t){fe&&String(t[0])===String(qe.Uq)&&String(t[1])!==String(qe.zX)&&sn({widget:zo(zo({},s),{},{name:Se})})}),[s,fe,Se,sn]),(0,S.jsx)(Bo.Z,{md:12*Ve,sm:12,children:(0,S.jsxs)(Go.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)(Fo,{bold:!1,fullWidth:!0,inputValue:Se,inputWidth:(null===n||void 0===n||null===(o=n.current)||void 0===o||null===(u=o.getBoundingClientRect())||void 0===u?void 0:u.width)<265?7*w.iI:null,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 sn({widget:zo(zo({},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=zo(zo({},s),{},{upstream_blocks:n});K(t),He(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)(Rn.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 He(s)},uuid:"ChartBlock/run/".concat(s.uuid),children:(0,S.jsx)(N.PlayButtonFilled,{size:2*w.iI})})}),oi.uF.QUEUED===m&&(0,S.jsx)(ke.Z,{color:(V||U.Z).content.active,small:!0,type:"cylon"}),oi.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)(Rn.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)(Rn.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:Ue&&!(0,Mn.Qr)(Ue)&&(0,S.jsx)(C.Z,{pb:3,children:(0,S.jsx)(To.Z,{block:zo(zo({},s),{},{configuration:zo(zo({},s.configuration),re)}),data:Ue,width:be})})}),de&&(0,S.jsx)(Go.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=zo(zo({},s),{},{configuration:zo(zo({},re),{},{chart_type:n})});K(t),He(t),ie(n)},placeholder:"Select chart type",value:te,children:to.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 Ge((0,l.Z)({},to.v8,e.target.value))},placeholder:"Chart width",value:(null===re||void 0===re?void 0:re[to.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)}))})}),ln]})})]}),de&&!(null===rn||void 0===rn||!rn.length)&&g.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)(Go.T7,{children:[Ze.length>=1&&(0,S.jsxs)(Go.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]})]}),Ke]})]}),ze&&(0,S.jsx)(C.Z,{px:1,children:ze})]})})}var Vo=p.forwardRef(qo),Yo=t(82682),Xo=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function Qo(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 Jo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $o=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,b=e.textareaFocused,g=e.updateWidget,x=e.widgets,j=e.width,k=(0,In.Z)(e,Xo),Z=(0,p.useMemo)((function(){return s.reduce((function(e,n,t){return Jo(Jo({},e),{},(0,l.Z)({},n.uuid,Jo(Jo({},n),{},{priority:t})))}),{})}),[s]);return(0,S.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(Yo.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?oi.uF.BUSY:oi.uF.QUEUED:oi.uF.IDLE;return i.current[l]=(0,p.createRef)(),(0,p.createElement)(Vo,Jo(Jo({},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:b,updateWidget:g,width:j}))}))}),(0,S.jsx)("div",{style:{height:"80vh"}})]})},er=v.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),nr=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)(er,{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 tr,ir=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 g.tf.DBT===n})))||[]}),[n]),(0,S.jsx)(S.Fragment,{})};function or(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 rr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?or(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):or(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"}(tr||(tr={}));var lr=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)(""),b=m[0],g=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===b||void 0===b?void 0:b.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===b||void 0===b?void 0:b.toLowerCase())))&&(null===d||void 0===d?void 0:d.includes(t))})))||[]}),[b,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=rr({},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)(jt.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 g(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:b}),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)(ge.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)(ge.ZP,{backgroundColor:r,compact:!0,disabled:!s,onClick:function(e){(0,Oe.j)(e),c?c(n):null===s||void 0===s||s({block:rr(rr({},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)}))})]})]})},ur=t(75634);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 sr(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 ar=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,b=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 sr(sr({},e),{},(0,l.Z)({},n.uuid,sr(sr({},n),{},{priority:t})))}),{})}),[k]),X=(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})}})}}),Q=(0,r.Z)(X,2),J=Q[0],$=Q[1].isLoading,ee=(0,p.useMemo)((function(){return K.map((function(e,n){var r=sr(sr({},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?oi.uF.BUSY:oi.uF.QUEUED:oi.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(sr(sr({},e),{},{extension_uuid:U})),_(!1)},executionState:O,extraContent:(0,S.jsx)(lr,{block:r,blockActionDescription:"Click a block name to run expectations on it.",blocks:u,inputPlaceholder:"Select blocks to run expectations on",loading:$,supportedUpstreamBlockLanguages:[g.t6.PYTHON],supportedUpstreamBlockTypes:[g.tf.DATA_EXPORTER,g.tf.DATA_LOADER,g.tf.DBT,g.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 b(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,b,x,j,k,V,Z,y,_,I,E,T,B,J]),ne="Extensions/GreatExpectations/index",te=(0,Qe.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,Xe.y)([qe.zX,qe.Um],n)||(0,Xe.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)(jt.Z,{onClickOutside:function(){return F(!1)},open:!0,children:(0,S.jsx)(Ri.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:g.tf.EXTENSION},(null===K||void 0===K?void 0:K.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,oo.hr)((function(e){return n(sr(sr({},e),{},{extension_uuid:U,type:g.tf.EXTENSION}),(null===K||void 0===K?void 0:K.length)||0)}),g.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)(ur.Wx,{teal:!0,children:(0,S.jsx)(N.Add,{size:ur.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),F(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},dr=t(15610),vr=t(69419),pr=["pipeline"];function fr(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 hr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mr=function(e){var n=e.pipeline,t=(0,In.Z)(e,pr),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 hr(hr({},t),{},{pipeline:n})}),[n,t]);(0,p.useEffect)((function(){var e;s(null===(e=(0,vr.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var v=(0,p.useMemo)((function(){return n?(tr.GREAT_EXPECTATIONS===c?e=ar:tr.DBT===c&&(e=ir),e?(0,S.jsx)(e,hr(hr({},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,dr.u)({extension:r},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(Rt.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)(Gn.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)})))]})})},br=t(28385),gr=t(9134),xr=t(83784),jr=t(36300),kr=t(31748),Zr=t(30229),yr=t(8916);var Pr=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)(),b=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=b;try{t=JSON.parse(b)}catch(i){}Z({variable:{name:v,value:t}}).then((function(){n(),h(null),x(null)})),(0,ro.ez)(),a(!1)}else"Escape"===e.key&&((0,ro.ez)(),a(!1))}),[Z,n,v,b]),T=(0,p.useMemo)((function(){return u-4*w.iI}),[u]),M=(0,p.useMemo)((function(){return(0,yr.wx)(l,(function(e){return e.uuid===xr.C}))}),[l]),B=(0,p.useMemo)((function(){return(0,yr.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)(jr.kA,{width:T,children:[s&&(0,S.jsxs)(Yo.Z,{children:[(0,S.jsx)(Bo.Z,{md:1,children:(0,S.jsx)(jr.qZ,{noPadding:!0,children:(0,S.jsx)(un.ZP,{backgroundColor:kr.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(v),Dt.Am.success("Successfully copied to clipboard.",{position:Dt.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)(Bo.Z,{md:4,children:(0,S.jsx)(jr.qZ,{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)(Bo.Z,{md:7,children:(0,S.jsx)(jr.qZ,{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:b})})})]}),null===M||void 0===M?void 0:M.map((function(e){return(0,S.jsx)(Zo.Z,{deleteVariable:function(){return I(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[I,M,v,b,j,h,x,a,s,T]),R=(0,p.useMemo)((function(){return(0,S.jsx)(jr.kA,{width:T,children:null===B||void 0===B?void 0:B.map((function(e){return(0,S.jsx)(Zo.Z,{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)(gr.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)(gr.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)(gr.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(Zr.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=Zr.Z4[e])||void 0===t?void 0:t.call(Zr.Z4))})}),(0,yr.JZ)([],e).map((function(n,t){return(0,S.jsx)(Zo.Z,{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:g.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)(gr.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"})})]})]})},Cr=t(89565),Or=t.n(Cr),wr=t(88494),_r=v.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Be.y$)()),Sr=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 ")})),Ir=t(60071),Er=t.n(Ir);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=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,ro.ez)(),i()}),[i]),d=(0,p.useCallback)((function(){(0,ro.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)(_r,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{children:[(0,S.jsx)(ge.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)(ge.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)(ge.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)(An.Z,{checked:r,onCheck:v})]})]})}),!r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(Sr,{noScrollbarTrackBackground:!0,children:(0,S.jsx)(wr.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 oi.jU.includes(i)?o=(0,S.jsx)(wr.T5,Mr(Mr({},l),{},{children:(0,S.jsx)(O.ZP,{monospace:!0,preWrap:!0,children:(0,S.jsx)(Or(),{children:e})})})):i===oi.Gi.IMAGE_PNG&&(o=(0,S.jsx)("div",{style:{backgroundColor:"white"},children:(0,S.jsx)(Er(),{alt:"Image ".concat(n," from code output"),layout:"responsive",src:"data:image/png;base64, ".concat(e)})})),(0,S.jsx)("div",{children:o},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},Dr=t(81769),Ar=(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 ")}))),Rr=(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 ")}))),Nr=t(19452);function Lr(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 Fr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Lr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ur=function(e){var n,t,i,o,l=e.index,u=e.permission,c=e.setPermissions,s=e.updatePermission;return(0,S.jsx)(Ar,{children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"flex-start",flexDirection:"row",children:[(0,S.jsx)(ge.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)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,onClick:function(e){(0,Oe.j)(e),s(Fr(Fr({},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)(ge.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(Fr(Fr({},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=Fr({},u),r=Fr({},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(Zr.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)}))}),(Zr.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=Fr({},u),r=Fr({},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:Zr.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)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,onClick:function(e){(0,Oe.j)(e),s(Fr(Fr({},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)(ge.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(Fr(Fr({},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=Fr({},u),r=Fr({},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:Nr.Z3.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})]})},"permission-role-".concat(l,"-").concat(n,"-").concat(i))}))})]})]})})})},Hr=t(35576),Wr=t(3917);function Gr(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 Kr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Gr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var zr=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,b=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],X=(0,p.useState)(!1),Q=X[0],J=X[1],$=(0,p.useState)(null),ee=($[0],$[1]),ne=!i,te=(0,p.useState)(null),ie=te[0],oe=te[1],re=(0,p.useState)(null),le=re[0],ue=re[1],ce=(0,p.useMemo)((function(){return"undefined"!==typeof i?i:le}),[i,le]),se=(0,p.useMemo)((function(){return"undefined"!==typeof s?s:ie}),[s,ie]),ae=(0,p.useCallback)((function(e,n){return null!==n&&void 0!==n&&n.initialBootstrap||z(!0),"undefined"!==typeof j?j(e):ue(e)}),[j,ue,z]),de=(0,p.useCallback)((function(e,n){return null!==n&&void 0!==n&&n.initialBootstrap||z(!0),"undefined"!==typeof P?P(e):oe(e)}),[P,oe,z]),ve=(0,p.useState)(null),pe=ve[0],fe=ve[1],he=(0,p.useCallback)((function(e,n,t,i){return ae((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]=Kr(Kr({},u[n]),t),Kr(Kr({},r),{},(0,l.Z)({},e,u))}))}),[ae]),xe=(0,p.useCallback)((function(e,n){W(Number(new Date)),null!==n&&void 0!==n&&n.initialBootstrap||z(!0),"undefined"!==typeof _?_(e):fe(e)}),[W,_,fe,z]),je=(0,p.useMemo)((function(){var e;return null===(e="undefined"!==typeof v?v:pe)||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 Kr(Kr({},e),{},{uuid:"".concat(n,"-").concat(H,"-").concat(t)})})),uuid:"".concat(n,"-").concat(H)}}))}),[H,v,pe]),ke=(0,p.useCallback)((function(){F(Number(new Date)),z(!1)}),[F,z]),Ze=(0,p.useCallback)((function(){b?null===b||void 0===b||b().then((function(){return ke()})):null===E||void 0===E||E(Kr(Kr({},h),{},{blocks:ce,interactions:se,permissions:null===je||void 0===je?void 0:je.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 ke()}))}),[ce,se,je,h,ke,b,E]),ye=(0,p.useMemo)((function(){return(null===f||void 0===f?void 0:f.blocks)||[]}),[f]),Pe=(0,p.useMemo)((function(){return null===ye||void 0===ye?void 0:ye.reduce((function(e,n,t){return Kr(Kr({},e),{},(0,l.Z)({},String(t),!0))}),{})}),[ye]);(0,p.useEffect)((function(){"undefined"===typeof s&&!se&&(null===c||void 0===c?void 0:c.length)>=1&&de((0,L.HK)(c||[],(function(e){return e.uuid})),{initialBootstrap:!0})}),[c,se,s,de]),(0,p.useEffect)((function(){"undefined"===typeof i&&!ce&&null!==h&&void 0!==h&&h.blocks&&ae(null===h||void 0===h?void 0:h.blocks,{initialBootstrap:!0})}),[ce,i,h,ae]),(0,p.useEffect)((function(){!je&&null!==h&&void 0!==h&&h.permissions&&xe(null===h||void 0===h?void 0:h.permissions,{initialBootstrap:!0})}),[je,h,xe]);var Ce=(0,p.useMemo)((function(){var e=[],n=(null===ye||void 0===ye?void 0:ye.length)||0;return null===ye||void 0===ye||ye.map((function(t,i){var o=(t||{uuid:null}).uuid,l=(null===ce||void 0===ce?void 0:ce[o])||[],u=(null===l||void 0===l?void 0:l.length)>=1,c=(0,S.jsxs)(ge.ZP,{beforeIcon:u?(0,S.jsx)(N.Edit,{}):(0,S.jsx)(N.Add,{}),compact:!0,disabled:ne,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)(be.Z,{first:0==i,noBorderRadius:i>=1,noPaddingContent:!0,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})]}),titleXPadding:w.cd*w.iI,titleYPadding:1.5*w.iI,children:(0,S.jsx)(Ar,{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)(Dr.Z,{blockInteraction:e,containerRef:T,containerWidth:r,interaction:null===se||void 0===se?void 0:se[null===e||void 0===e?void 0:e.uuid],setInteractionsMapping:de,showVariableUUID:!0})},"".concat(null===e||void 0===e?void 0:e.uuid,"-").concat(n))}))]})})},o))})),e}),[ce,ye,T,r,se,ne,de,I]),we=(0,p.useMemo)((function(){return(null===ye||void 0===ye?void 0:ye.length)>=1&&(0,S.jsx)(me.Z,{noBackground:!0,noBorder:!0,noBoxShadow:!0,visibleMapping:Pe,children:Ce})}),[ye,Ce,Pe]),_e=(0,p.useMemo)((function(){return(null===ce||void 0===ce?void 0:ce[null===x||void 0===x?void 0:x.uuid])||[]}),[ce,x]),Se=(0,p.useMemo)((function(){var e=[],n={};return null===_e||void 0===_e||_e.forEach((function(t){var i=t.uuid,o=null===se||void 0===se?void 0:se[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}),[se,_e]),Ie=(0,p.useMemo)((function(){var e=(null===_e||void 0===_e?void 0:_e.length)>=1;return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[!Q&&(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(ge.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"})}),Q&&(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)(ge.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(g.t6.YAML),variables:{}}).then((function(e){var n=e.data;if(null===n||void 0===n||!n.error){var t=null===n||void 0===n?void 0:n.interaction,i=null===t||void 0===t?void 0:t.uuid;he(null===x||void 0===x?void 0:x.uuid,(null===_e||void 0===_e?void 0:_e.length)||0,{uuid:i}),de((function(e){return Kr(Kr({},e),{},(0,l.Z)({},i,t))})),setTimeout((function(){var e;null===B||void 0===B||null===(e=B.current)||void 0===e||e.scrollIntoView()}),be.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)(ge.ZP,{compact:e,onClick:function(e){(0,Oe.j)(e),J(!1),Y(null)},secondary:!0,small:e,children:"Cancel"})]})]})}),[u,x,_e,Q,a,V,de,J,ee,Y,he]);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"})}),we,(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)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,disabled:ne,onClick:function(){return xe((function(e){return null===e||void 0===e?void 0: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===je||void 0===je?void 0:je.map((function(e,n){return(0,S.jsx)(C.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(Ur,{index:n,permission:e,setPermissions:xe,updatePermission:function(e){var t=(0,o.Z)(je);t[n]=e,xe(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===_e||void 0===_e?void 0:_e.length)>=1&&Ie]}),(0,S.jsx)(O.ZP,{default:!0,children:"A block can have multiple sets of interactions associated with it."})]}),!(null!==_e&&void 0!==_e&&_e.length)&&Ie,(null===Se||void 0===Se?void 0:Se.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===Se||void 0===Se?void 0:Se.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===Se||void 0===Se?void 0:Se.length)>=2&&n<(null===Se||void 0===Se?void 0:Se.length)-1&&(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:","})]})},e)}))})]})]}),null===_e||void 0===_e?void 0:_e.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===se||void 0===se?void 0:se[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)(Dr.Z,{blockInteraction:e,containerRef:T,containerWidth:r,interaction:s,isEditing:!0,removeBlockInteraction:function(){return he(u,n,e,{remove:!0})},setInteractionsMapping:de,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 he(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)(Hr.Z,{fullWidth:!0,onChange:function(e){return he(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===_e||void 0===_e?void 0:_e.length)-1?B:null})]},"".concat(null===e||void 0===e?void 0:e.uuid,"-").concat(n))}))]}),(0,S.jsx)(Rr,{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)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Save,{}),disabled:ne,loading:d,onClick:function(){return Ze()},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,Wr.JX)(Number(R)/1e3)]})]})})})]})};var qr=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],b=h[1],g=(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),b(null)})),(0,ro.ez)(),s(!1)):"Escape"===e.key&&((0,ro.ez)(),s(!1))}),[j,n,d,m]),_=(0,p.useCallback)((function(e){(0,ro.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)(jr.kA,{width:g,children:[c&&(0,S.jsxs)(Yo.Z,{children:[(0,S.jsx)(Bo.Z,{md:1,children:(0,S.jsx)(jr.qZ,{noPadding:!0,children:(0,S.jsx)(un.ZP,{backgroundColor:kr.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(d,") }}")),Dt.Am.success("Successfully copied to clipboard.",{position:Dt.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)(Bo.Z,{md:5,children:(0,S.jsx)(jr.qZ,{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)(Bo.Z,{md:6,children:(0,S.jsx)(jr.qZ,{children:(0,S.jsx)(Ee.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){b(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.Z,{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)(gr.Z,{language:"yaml",maxWidth:g,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)(gr.Z,{language:"python",maxWidth:g,small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n "})})]})},Vr=t(28026),Yr=t(68899),Xr=t(4982),Qr=t(15752),Jr=t(91835);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.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,o=e.autocompleteItems,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.deleteBlock,d=e.description,v=e.displayBlockName,h=e.fetchFileTree,m=e.fetchPipeline,b=e.interruptKernel,x=e.messages,j=(e.onChangeCallbackBlock,e.onChangeCodeBlock),k=e.onSelectBlockFile,Z=e.pipeline,y=e.runBlock,_=e.runningBlocks,I=e.savePipelineContent,E=e.selectedBlock,T=e.setAnyInputFocused,M=e.setErrors,B=e.setHiddenBlocks,D=e.setSelectedBlock,A=e.setTextareaFocused,R=e.showBrowseTemplates,F=e.showUpdateBlockModal,U=e.textareaFocused,H=(0,p.useRef)(null),W=(0,p.useState)(!1),K=W[0],z=W[1],q=(0,vr.iV)().block_uuid;(0,p.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null===q||void 0===q||null===(n=q.split(":"))||void 0===n?void 0:n[0])===t}));e&&(E&&(null===e||void 0===e?void 0:e.uuid)===(null===E||void 0===E?void 0:E.uuid)||(B((function(n){return el(el({},n),{},(0,l.Z)({},e.uuid,!1))})),k(e.uuid,e.type,null)))}),[q,c,k,E,B]);var V=(Z||{}).type,X=(0,p.useMemo)((function(){return(0,L.HK)(t||[],(function(e){return e.uuid}))}),[t]),Q=Y.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,J=(0,p.useMemo)((function(){return(null===Q||void 0===Q?void 0:Q.block_templates)||[]}),[Q]),$=(0,p.useCallback)((function(e){return n(e,(null===X||void 0===X?void 0:X.length)||0)}),[n,X]),ee=(0,p.useMemo)((function(){return(0,oo.oM)(J,$)}),[$,J]),ne=(0,p.useMemo)((function(){return(0,oo.hr)($,i,V,{blockTemplatesByBlockType:ee,languages:[g.t6.PYTHON],showBrowseTemplates:R})}),[$,i,ee,V]),te=(0,p.useMemo)((function(){return null===X||void 0===X?void 0:X[null===E||void 0===E?void 0:E.uuid]}),[X,E]),ie=(0,p.useMemo)((function(){return _.reduce((function(e,n,t){return el(el({},e),{},(0,l.Z)({},n.uuid,el(el({},n),{},{priority:t})))}),{})}),[_]),oe=(0,f.Db)((function(e){var n=e.block,t=e.upstream_blocks;return Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===Z||void 0===Z?void 0:Z.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(){m()},onErrorCallback:function(e,n){return null===M||void 0===M?void 0:M({errors:n,response:e})}})}}),re=(0,r.Z)(oe,2),le=re[0],ue=re[1].isLoading,ce=(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===E||void 0===E?void 0:E.uuid)===i,d=ie[i],f=d?0===d.priority?oi.uF.BUSY:oi.uF.QUEUED:oi.uF.IDLE,P="".concat(t,"s/").concat(i,".py");return u.current[P]=(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(el({},e)),T(!1)},executionState:f,extraContent:(0,S.jsx)(lr,{block:e,blocks:s,inputPlaceholder:"Select blocks to add ".concat((0,G._6)(v,null)," to"),loading:ue,onClickTag:function(e){B((function(n){return el(el({},n),{},(0,l.Z)({},e.uuid,!1))})),k(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[g.tf.CUSTOM,g.tf.DATA_EXPORTER,g.tf.DATA_LOADER,g.tf.DBT,g.tf.SCRATCHPAD,g.tf.SENSOR,g.tf.TRANSFORMER],updateBlock:le}),fetchFileTree:h,fetchPipeline:m,hideRunButton:!0,interruptKernel:b,messages:x[i],noDivider:!0,onChange:function(e){return j(t,i,e)},pipeline:Z,ref:u.current[P],runBlock:y,runningBlocks:_,savePipelineContent:I,showUpdateBlockModal:F,selected:r,setAnyInputFocused:T,setErrors:M,setSelected:function(n){return D(!0===n?e:null)},setTextareaFocused:A,textareaFocused:r&&U})},i)}))}),[t,o,u,c,s,a,v,h,m,b,ue,x,j,k,Z,y,_,ie,I,E,T,M,B,D,A,F,U,le]),se="".concat(v,"/index"),ae=(0,Qe.y)(),de=ae.disableGlobalKeyboardShortcuts,ve=ae.registerOnKeyDown,pe=ae.unregisterOnKeyDown;return(0,p.useEffect)((function(){return function(){pe(se)}}),[pe,se]),ve(se,(function(e,n){!de&&te&&((0,Xe.y)([qe.zX,qe.Um],n)||(0,Xe.y)([qe.PQ,qe.Um],n))&&(e.preventDefault(),I())}),[te,I]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(O.ZP,{default:!0,children:d}),(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)(v,null)),"/overview"),openNewWindow:!0,children:(0,G.wX)((0,G._6)(v,null))}),"."]})})]}),ce,(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(jt.Z,{onClickOutside:function(){return z(!1)},open:!0,children:(0,S.jsx)(Ri.Z,{disableKeyboardShortcuts:!0,items:ne,onClickCallback:function(){return z(!1)},open:K,parentRef:H,uuid:v,children:(0,S.jsxs)(un.ZP,{beforeElement:(0,S.jsx)(ur.Wx,{rose:i===g.tf.CALLBACK,children:(0,S.jsx)(N.Add,{size:ur.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),z(!0)},uuid:"AddNewBlocks/".concat(v),children:[(0,G.kC)(v)," block"]})})})})]})},tl=t(26084);function il(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 ol(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?il(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):il(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var rl=[{Icon:N.Callback,name:"Callbacks",uuid:tl.Q.CALLBACK},{Icon:N.Conditional,name:"Conditionals",uuid:tl.Q.CONDITIONAL}];var ll=function(e){var n=(0,Jr.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,vr.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,p.useMemo)((function(){var e,t;if(tl.Q.CALLBACK===o)e={addOnBlockType:g.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,description:"Run 1 or more callback blocks whenever the main block succeeds or fails.",displayBlockName:"callback"};else if(tl.Q.CONDITIONAL===o){var i;e={addOnBlockType:g.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,description:"Run 1 or more conditional blocks to determine whether or not the main block should be run.",displayBlockName:"conditional"}}if(e)return(0,S.jsx)(nl,ol(ol({},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===rl||void 0===rl?void 0:rl.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,dr.u)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(Rt.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)(Gn.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 ul(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 cl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ul(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ul(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var sl=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,b=e.createInteraction,g=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,X=e.permissions,Q=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,be=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=vo.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-(Yr.k1+1)}),[i]),Ke=(0,p.useMemo)((function(){var e;return!(null===ee||void 0===ee||null===(e=ee.features)||void 0===e||!e[Ji.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]),Xe=(0,p.useMemo)((function(){return(null===G||void 0===G?void 0:G.column_types)||{}}),[G]),Qe=(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===Q||void 0===Q?void 0:Q.type)}),[Q]),tn=sn.qL.STREAMING!==(null===Q||void 0===Q?void 0:Q.type)?-70:He?-16:300,on=(0,p.useCallback)((0,Xr.Fk)({columnTypes:Xe,columns:qe,insightsByFeatureUUID:$e,insightsOverview:Qe,noColumnLinks:!0,statistics:Se}),[Xe,qe,$e,Qe,Se]),rn=(0,p.useMemo)((function(){return(0,S.jsx)(Pr,{blocks:c,fetchVariables:I,pipeline:Q,selectedBlock:ce,setErrorMessages:Fe,variables:T,width:Ge})}),[Ge,c,I,T,Q,ce]),ln=(0,p.useMemo)((function(){return(0,S.jsx)(br.Z,{onActionCallback:Y,pipeline:Q,selectedBlock:ce,selectedFilePath:se,setErrors:be,width:Ge>Be.nn?Ge-Be.nn:Ge})}),[Ge,Y,Q,ce,se,be]),un=(0,p.useMemo)((function(){return(0,S.jsx)(qr,{fetchSecrets:_,pipelineUUID:null===Q||void 0===Q?void 0:Q.uuid,secrets:ue,setErrorMessages:Fe,width:Ge})}),[Ge,_,Q,ue]),cn=(0,p.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:o,blockRefs:u,blocks:c,blocksInNotebook:s,deleteBlock:g,fetchFileTree:Z,fetchPipeline:P,interruptKernel:A,messages:W,onChangeCallbackBlock:K,onChangeCodeBlock:q,onSelectBlockFile:V,pipeline:Q,runBlock:te,runningBlocks:ie,savePipelineContent:re,selectedBlock:ce,setAnyInputFocused:pe,setErrors:be,setHiddenBlocks:xe,setSelectedBlock:ye,setTextareaFocused:Pe,showBrowseTemplates:Ce,showUpdateBlockModal:we,textareaFocused:Ie}}),[t,o,u,c,s,g,Z,P,A,W,K,q,V,Q,te,ie,re,ce,pe,be,xe,ye,Pe,Ce,we,Ie]),an=(0,p.useMemo)((function(){return qe.length>0&&(0,S.jsx)(En.Z,{columnHeaderHeight:(0,Mn.Qr)(Xe)&&(0,Mn.Qr)($e)&&(0,Mn.Qr)(Qe)?0:Tn.Eh,columns:qe,height:Ae-Re-vo.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:on,rows:Ve,width:Ge})}),[Ge,Xe,qe,Re,Ae,$e,Qe,on,Ve]),dn=(0,p.useMemo)((function(){return De.length>0&&(0,S.jsx)($o,{autocompleteItems:o,blockRefs:u,blocks:c,chartRefs:d,deleteWidget:x,fetchFileTree:Z,fetchPipeline:P,messages:W,onChangeChartBlock:z,pipeline:Q,runBlock:te,runningBlocks:ie,savePipelineContent:re,selectedBlock:ce,setAnyInputFocused:pe,setErrors:be,setSelectedBlock:ye,setTextareaFocused:Pe,textareaFocused:Ie,updateWidget:Me,widgets:De,width:Ge})}),[Ge,o,u,c,d,x,Z,P,W,z,Q,te,ie,re,ce,pe,be,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)(Vr.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)(mr,cl({},cn))}),[cn]),fn=(0,p.useMemo)((function(){return(0,S.jsx)(ll,cl({},cn))}),[cn]),hn=(0,p.useMemo)((function(){return Q&&ce&&(0,S.jsx)(Eo,{addNewBlockAtIndex:t,block:ce,contentByBlockUUID:h,fetchFileTree:Z,fetchPipeline:P,globalDataProducts:E,pipeline:Q,project:ee,setSelectedBlock:ye,showDataIntegrationModal:Oe,showUpdateBlockModal:we})}),[t,h,Z,P,E,Q,ee,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)(ge.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)(Tn.t0,{fullWidth:!0,heightOffset:qi.cH.TERMINAL===n||n===qi.cH.TREE?0:f||Be.nn,onBlur:function(){se||he(!1),null===ve||void 0===ve||ve(!1)},onFocus:function(){he(!0),n===qi.cH.TREE&&(null===ve||void 0===ve||ve(!0))},overflowHidden:n===qi.cH.TREE,tabIndex:0,children:[n===qi.cH.TREE&&(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(null===Q||void 0===Q?void 0:Q.uuid),children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(je.ZP,{addNewBlockAtIndex:t,blockRefs:u,blocks:c,contentByBlockUUID:h,contextMenuEnabled:!0,deleteBlock:g,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?cl(cl({},e),{},(0,l.Z)({},n,!t)):e}))},pipeline:Q,runBlock:te,runningBlocks:ie,selectedBlock:ce,setActiveSidekickView:de,setEditingBlock:me,setErrors:be,setSelectedBlock:function(e){ye(e),_e&&(0,Qr.F)(e)},showUpdateBlockModal:we,treeRef:Ee}),!ze&&sn.qL.STREAMING===(null===Q||void 0===Q?void 0:Q.type)&&(0,S.jsx)(C.Z,{p:1,children:(0,S.jsx)(Br,{cancelPipeline:a,checkIfPipelineRunning:v,executePipeline:k,isPipelineExecuting:U,pipelineExecutionHidden:He,pipelineMessages:$,setPipelineExecutionHidden:We})})]})}),n===qi.cH.DATA&&an,qi.cH.SECRETS===n&&un,qi.cH.VARIABLES===n&&rn,qi.cH.FILE_VERSIONS===n&&(0,S.jsx)(m.Z,{uuid:"FileVersions/".concat(se?decodeURIComponent(se):""),children:ln}),nn||ce&&en||!ce&&en&&n===qi.cH.DATA?null:qi.du.includes(n)&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:qi.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"})}),qi.cH.CHARTS===n&&(De.length>0?dn:(0,S.jsxs)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:qi.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)(nr,{size:40*w.iI})})]})),qi.cH.TERMINAL===n&&vn,qi.cH.EXTENSIONS===n&&pn,qi.cH.ADDON_BLOCKS===n&&fn,qi.cH.BLOCK_SETTINGS===n&&(ce?hn:(0,S.jsx)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:qi.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)."]})})})})),qi.cH.INTERACTIONS===n&&Ke&&(0,S.jsx)(zr,{blockInteractionsMapping:r,containerWidth:Ge,createInteraction:function(e){return b({interaction:e})},interactions:B,interactionsMapping:D,isLoadingCreateInteraction:R,isLoadingUpdatePipelineInteraction:F,permissions:X,pipeline:Q,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 al=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,vr.iV)(),d=(0,yr.wx)(c,(function(e){return e.uuid===xr.C})),v=(0,qi.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);qi.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=qi.cH.EXTENSIONS===t&&(null===a||void 0===a?void 0:a.extension),b=Y.ZP.extension_options.list({},{},{pauseFetch:!m}).data,g=(0,p.useMemo)((function(){return(null===b||void 0===b?void 0:b.extension_options)||[]}),[b]),x=(0,p.useMemo)((function(){return(0,L.HK)(g,(function(e){return e.uuid}))}),[g]),j=qi.cH.ADDON_BLOCKS===t&&(null===a||void 0===a?void 0:a.addon);if(qi.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)(gn.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)(li(),{as:"/pipelines/".concat(s,"/edit?").concat(qi.uM,"=").concat(qi.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)(li(),{as:"/pipelines/".concat(s,"/edit?").concat(qi.uM,"=").concat(qi.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)(vo.ym,{children:h})},dl=t(27597),vl=t(54277),pl=t(87432),fl=t(65044),hl=t(78419),ml=t(11498),bl=t(28795),gl=t(85010);function xl(e){var n=e.activeView,t=e.pipeline,i=e.project,o=e.secrets,r=e.setActiveSidekickView,l=e.variables,u=(0,yr.wx)(l,(function(e){return e.uuid===xr.C}));return(0,qi.j5)({pipeline:t,project:i}).map((function(e){var i=e.buildLabel,l=e.key,c=e.label;return{Icon:qi.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 jl=t(53005),kl=t(4383),Zl=t(70320);function yl(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 Pl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?yl(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Cl(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,kl.Ib)("terminal"),{shouldReconnect:function(){return!0}}),X=V.lastMessage,Q=V.sendMessage,J=(0,Pt.Z)({refreshInterval:null,revalidateOnFocus:!1}).fetch,$=(0,Ct.Z)(),ne=$.featureEnabled,te=$.featureUUIDs,ie=$.fetchProjects,oe=$.project,re=$.sparkEnabled,le=(0,eo.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),Xe=Ve[0],Qe=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),gn=mn[0],xn=mn[1],jn=(0,vr.iV)(),Zn=jn[qi.uM],yn=jn.block_uuid,Pn=(0,p.useCallback)((function(e){var n;hn(e),e&&We&&Ge(!1),xn(null),yn&&(null===yn||void 0===yn||null===(n=yn.split(":"))||void 0===n?void 0:n[0])!==(null===e||void 0===e?void 0:e.uuid)&&(0,dr.u)({block_uuid:null})}),[yn,We]),Cn=(0,p.useState)(!!(0,Ye.U2)(Ye.zg)),On=Cn[0],wn=Cn[1],_n=(0,p.useState)(!!(0,Ye.U2)(Ye.Uu)),Sn=_n[0],In=_n[1],En=((0,p.useMemo)((function(){var e;return(0,Zl.hY)(null===oe||void 0===oe||null===(e=oe.features)||void 0===e?void 0:e[Ji.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[Ji.d.INTERACTIONS])}),[null===oe||void 0===oe?void 0:oe.features])),Tn="".concat(hl.H8,"_").concat(pe),Bn=(0,Ye.U2)(Tn),Dn=(0,p.useState)((0,L.sE)(si.NR,(function(e){return e.uuid===Bn}))||si.NR[0]),An=Dn[0],Rn=Dn[1],Nn=(0,p.useCallback)((function(e){Rn(e),(0,Ye.t8)(Tn,null===e||void 0===e?void 0:e.uuid)}),[Tn,Rn]),Ln="".concat(hl.g6,"_").concat(pe),Fn=(0,p.useState)({}),Un=Fn[0],Hn=Fn[1],Wn=(0,p.useRef)(null),Gn=(0,p.useMemo)((function(){return null===le||void 0===le?void 0:le.disable_pipeline_edit_access}),[le]),Kn=(0,p.useMemo)((function(){return null===le||void 0===le?void 0:le.max_print_output_lines}),[le]),zn=(0,p.useState)({}),qn=zn[0],Vn=zn[1],Yn=(0,p.useState)([]),Xn=Yn[0],Qn=Yn[1],Jn=(0,kn.Z)(pe),$n=Y.ZP.pipelines.detail(pe,Pl({include_block_pipelines:!0,includes_outputs:(0,Mn.Qr)(qn)||"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})))},Xe?{includes_outputs_spark:!0}:{}),{refreshInterval:null,revalidateOnFocus:!1},{key:"/pipelines/".concat(pe,"/edit")}),et=$n.data,nt=$n.mutate,tt=(0,$i.Z)(Y.ZP.pipeline_interactions.detail,pe,{},{revalidateOnFocus:!1},{condition:function(){return En},delay:3e3}),it=tt.data,ot=tt.mutate,rt=(0,$i.Z)(Y.ZP.interactions.pipeline_interactions.list,pe,{},{revalidateOnFocus:!1},{condition:function(){return En},delay:3e3}),lt=rt.data,ut=rt.mutate,ct=(0,p.useMemo)((function(){return(null===it||void 0===it?void 0:it.pipeline_interaction)||{}}),[it]),st=(0,p.useMemo)((function(){return(null===lt||void 0===lt?void 0:lt.interactions)||[]}),[lt]),at=(0,f.Db)(Y.ZP.pipeline_interactions.useUpdate(pe),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){ot()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),dt=(0,r.Z)(at,2),vt=dt[0],pt=dt[1].isLoading,ft=(0,f.Db)(Y.ZP.interactions.pipeline_interactions.useCreate(pe),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){ut(),ot()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),ht=(0,r.Z)(ft,2),mt=ht[0],bt=ht[1].isLoading;F=(0,p.useMemo)((function(){return null===et||void 0===et?void 0:et.pipeline}),[et]);var gt=(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&&Xe&&re&&Qe(!1)}),[Xe,F,Qe,re]);var jt=(0,p.useState)((0,Ye.U2)(hl.iL,!1)),kt=jt[0],Zt=jt[1],yt=(0,p.useMemo)((function(){return!gt&&(null===ne||void 0===ne?void 0:ne(null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&kt}),[ne,te,gt,kt]),Ot=(0,p.useState)((0,Ye.U2)(hl.qj,!1)),wt=Ot[0],_t=Ot[1],St=(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))&&wt}),[ne,te,wt]),It=(0,p.useCallback)((function(e){_t(e),(0,Ye.t8)(hl.qj,"function"===typeof e?e():e)}),[_t]),Dt=(0,p.useCallback)((function(e){var n="function"===typeof e?e():e;Zt(e),(0,Ye.t8)(hl.iL,n),n||It(e)}),[It,Zt]),At=(0,p.useState)((0,Ye.U2)(hl.MS,!1)),Nt=At[0],Lt=At[1],Ft=(0,p.useCallback)((function(){var e=!Nt;Lt(e),(0,Ye.t8)(hl.MS,e)}),[Nt]),Ut=(0,p.useState)((0,Ye.U2)(hl.ls,!1)),Ht=Ut[0],Wt=Ut[1],Gt=(0,p.useCallback)((function(){var e=!Ht;Wt(e),(0,Ye.t8)(hl.ls,e)}),[Ht]),Kt=(0,p.useCallback)((function(){var e=new CustomEvent(si.$e,{detail:{}});window.dispatchEvent(e)}),[]),zt=(0,p.useCallback)((function(){var e=new CustomEvent(si.tK,{detail:{}});window.dispatchEvent(e)}),[]),qt=(0,p.useCallback)((function(e){Hn((function(n){var t=e(n);return(0,Ye.t8)(Ln,JSON.stringify(t)),t})),yt&&(clearTimeout(q.current),q.current=setTimeout((function(){zt(),Kt()}),be.e+1))}),[Kt,zt,Ln,Hn,yt]);(0,p.useEffect)((function(){var e=(0,Ye.U2)(Ln);e&&(0,G.Pb)(e)&&Hn(JSON.parse(e))}),[Ln,Hn]);var Vt=(0,p.useState)(null),Yt=Vt[0],Qt=Vt[1],Jt=(0,p.useState)(!1),$t=Jt[0],ni=Jt[1],ti=(0,p.useState)(!1),ri=ti[0],li=ti[1],ui=(0,ei.dd)((function(){return(0,S.jsx)(Xt.Z,{centerOnScreen:!0,neutral:!0,onClick:di,subtitle:"This pipeline may be open on another tab. Saving changes here could overwrite any changes made to this pipeline on a separate tab. Proceed with caution.",title:"Your pipeline may be stale.",width:34*w.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),ci=(0,r.Z)(ui,2),ai=ci[0],di=ci[1];function pi(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2?arguments[2]:void 0,i=(0,l.Z)({},qi.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,dr.u)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}(0,p.useEffect)((function(){var e=new BroadcastChannel("".concat(pe,"_pipeline_editor_tabs"));return e.addEventListener("message",(function(e){"new_tab_same_page_opened"===e.data&&li(!0)})),e.postMessage("new_tab_same_page_opened"),function(){e.close()}}),[]),(0,p.useEffect)((function(){ri&&(ai(),li(!1))}),[ri,ai]),(0,p.useEffect)((function(){var e;null!==et&&void 0!==et&&null!==(e=et.pipeline)&&void 0!==e&&e.updated_at&&Yt!==a()().utc().unix()&&Qt(a()(et.pipeline.updated_at).unix())}),[null===et||void 0===et||null===(c=et.pipeline)||void 0===c?void 0:c.updated_at,Yt]),(0,p.useEffect)((function(){Zn||pi(qi.cH.TREE,!1)}),[Zn]);var fi=(0,p.useCallback)((function(e,n,t){wn(!1),setTimeout((function(){return pi(e,n,t)}),1)}),[]),hi=(0,p.useRef)({}),mi=(0,p.useRef)({}),bi=(0,p.useRef)(null),gi=(0,p.useRef)({}),xi=(0,p.useRef)({}),ji=(0,p.useRef)({}),ki=(0,p.useState)({}),yi=ki[0],Pi=ki[1],Ci=(0,p.useCallback)((function(e,n,t){var i=gi.current||{};gi.current=Pl(Pl({},i),{},(0,l.Z)({},e,Pl(Pl({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[gi]),Oi=(0,p.useCallback)((function(e,n,t){var i=xi.current||{};xi.current=Pl(Pl({},i),{},(0,l.Z)({},e,Pl(Pl({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[]),wi=(0,p.useCallback)((function(e,n,t){Ci(e,n,t),ni(!0)}),[Ci,ni]),_i=(0,p.useCallback)((function(e,n,t){Oi(e,n,t),$t||ni(!0)}),[$t,Oi,ni]),Si=(0,p.useCallback)((function(e){ji.current=Pl(Pl({},ji.current),e)}),[ji]),Ii=(0,p.useCallback)((function(e,n){Si((0,l.Z)({},e,n)),ni(!0)}),[Si,ni]),Ei=(0,p.useState)(null),Ti=Ei[0],Mi=Ei[1],Bi=(0,p.useState)([]),Di=Bi[0],Ai=Bi[1],Ri=(0,p.useState)([]),Ni=Ri[0],Li=Ri[1],Fi=(0,$i.Z)(Y.ZP.data_providers.list,{},{revalidateOnFocus:!1},{delay:1e3,condition:(null===Di||void 0===Di?void 0:Di.length)>=1}).data,Ui=null===Fi||void 0===Fi?void 0:Fi.data_providers,Hi=(0,$i.Z)(Y.ZP.variables.pipelines.list,pe,{global_only:!0},{revalidateOnFocus:!1},{delay:qi.cH.VARIABLES===Zn?0:1e4}),Wi=Hi.data,Gi=Hi.mutate,Ki=null===Wi||void 0===Wi?void 0:Wi.variables,zi=(0,$i.Z)(Y.ZP.secrets.list,{},{revalidateOnFocus:!1},{delay:qi.cH.SECRETS===Zn?0:1e4}),Vi=zi.data,Yi=zi.mutate,Xi=null===Vi||void 0===Vi?void 0:Vi.secrets,to=(0,p.useRef)({}),io=(0,p.useCallback)((function(e){var n;ni(!0);var t=to.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),to.current[e.uuid]=Pl(Pl(Pl({},t),e),{},{configuration:Pl(Pl({},t.configuration),e.configuration),upstream_blocks:i})}),[ni,to]),oo=(0,p.useCallback)((function(e,n,t){xn({block:{type:n,uuid:e},file:{path:t}})}),[]),ro=(0,vi.Dp)(pe),lo=(0,vi.Q9)(ro,Di),uo=(0,p.useState)(lo),so=uo[0],ao=uo[1],po=(0,p.useState)(),fo=po[0],bo=po[1],go=(0,p.useState)(),xo=go[0],jo=go[1],ko=(0,p.useState)(null),Zo=ko[0],yo=ko[1],Po=(0,kn.Z)(so);(0,p.useCallback)((function(){ln({upstreamBlocks:{block:null,values:[]}}),Vn({}),ni(!1),dn([]),Pn(null)}),[]);(0,p.useEffect)((function(){pe!==Jn&&(gi.current={},xi.current={})}),[pe,Jn]);var Co=Y.ZP.block_outputs.detail(!On&&(null===Zo||void 0===Zo?void 0:Zo.type)!==g.tf.SCRATCHPAD&&(null===Zo||void 0===Zo?void 0:Zo.type)!==g.tf.CHART&&null!==Zo&&void 0!==Zo&&Zo.uuid?encodeURIComponent(null===Zo||void 0===Zo?void 0:Zo.uuid):null,{pipeline_uuid:pe}),Oo=Co.data,wo=Co.mutate,_o=(0,p.useMemo)((function(){return null===Oo||void 0===Oo?void 0:Oo.block_output}),[Oo]),So=(0,p.useMemo)((function(){var e,n,t;return gt?null===(e=(0,L.sE)(null===_o||void 0===_o?void 0:_o.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,G.kE)(xo))})))||void 0===e?void 0:e.sample_data:null===_o||void 0===_o||null===(n=_o.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[_o,gt,xo]),Io=Y.ZP.blocks.pipelines.analyses.detail(On?null:pe,(null===Zo||void 0===Zo?void 0:Zo.type)!==g.tf.SCRATCHPAD&&(null===Zo||void 0===Zo?void 0:Zo.type)!==g.tf.CHART&&(null===Zo||void 0===Zo?void 0:Zo.uuid)&&encodeURIComponent(null===Zo||void 0===Zo?void 0:Zo.uuid)),Eo=Io.data,To=Io.mutate,Mo=(null===Eo||void 0===Eo||null===(s=Eo.analyses)||void 0===s?void 0:s[0])||{},Bo=Mo.insights,Do=void 0===Bo?{}:Bo,Ao=Mo.metadata,Ro=void 0===Ao?{}:Ao,No=Mo.statistics,Lo=void 0===No?{}:No;(0,p.useEffect)((function(){0===an.length&&(To(),wo(),Gi())}),[To,wo,Gi,an]),(0,p.useEffect)((function(){if(0===so.length)yo(null);else if((null===Po||void 0===Po?void 0:Po.length)!==(null===so||void 0===so?void 0:so.length)&&(null===so||void 0===so?void 0:so.length)<(null===Po||void 0===Po?void 0:Po.length)){var e=Po.findIndex((function(e){return e.uuid===(null===Zo||void 0===Zo?void 0:Zo.uuid)})),n=Po.length-1===e?e-1:e+1;yo(Po[Math.max(0,n)])}}),[so,Po,null===Zo||void 0===Zo?void 0:Zo.uuid]),(0,p.useEffect)((function(){var e;null!==(e=rn.upstreamBlocks)&&void 0!==e&&e.block&&(wn(!1),pi(qi.cH.TREE))}),[rn.upstreamBlocks]);var Fo,Uo=(0,$i.Z)(Y.ZP.autocomplete_items.list,{},{refreshInterval:!1,revalidateOnFocus:!1},{condition:(null===Di||void 0===Di?void 0:Di.length)>=1,delay:1e3}),Ho=Uo.data,Wo=Uo.mutate,Go=null===Ho||void 0===Ho?void 0:Ho.autocomplete_items,Ko=(0,f.Db)((function(e){var n=e.uuid;return Y.ZP.widgets.pipelines.useDelete(encodeURIComponent(pe),encodeURIComponent(n))()}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(e){var n=e.widget.uuid;Li((function(e){return(0,L.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),nt(),tr()},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&&Vn((function(e){return Pl(Pl({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:oi.Gi.TEXT_PLAIN}}))))}))}})}}),zo=(0,r.Z)(Ko,1)[0],qo=(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===Di||void 0===Di?void 0:Di.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.blockUUID)})):(0,jl.IO)(r,Di)){var u=t,c=u.type,s=u.uuid;_i(c,s,o),Ai((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})),Pi((function(e){return Pl(Pl({},e),{},(0,l.Z)({},c,Pl(Pl({},null===e||void 0===e?void 0:e[c]),{},(0,l.Z)({},s,Number(new Date)))))})),nt()}}),[Di,nt,_i]),Vo=(0,p.useCallback)((function(e,n,t){Fo(e,Di.length,n,e.name,t)}),[Fo,Di.length]),Yo=(0,vl.Z)(),Xo=Yo.renderApplications,Qo=Yo.startApplication,Jo=(0,p.useCallback)((function(e,n){n||(Qo(null,null,Qi.X9.ArcaneLibrary),Pn(null))}),[]),$o=(0,p.useCallback)((function(){Pn(null)}),[]),er=(0,Zi.ZP)({addNewBlock:Vo,blocks:Di,delayFetch:Sn?7e3:1e3,deleteWidget:zo,fetchAutocompleteItems:Wo,fetchPipeline:nt,fetchVariables:Gi,onOpenFile:Jo,onSelectBlockFile:oo,onSelectFile:$o,onUpdateFileSuccess:qo,openSidekickView:fi,pipeline:F,query:{include_pipeline_count:!0},sendTerminalMessage:Q,setDisableShortcuts:Ge,setSelectedBlock:Pn,showHiddenFilesSetting:!0,uuid:pe,widgets:Ni}),nr=er.browser,tr=(er.controller,er.fetchFiles),ir=(er.filePaths,er.files),or=(er.filesTouched,er.menu,er.openFile),rr=er.search,lr=er.selectedFilePath,ur=er.tabs,cr=(er.versions,er.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")),tr()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}})),sr=(0,r.Z)(cr,1)[0],ar=(0,f.Db)(Y.ZP.pipelines.useUpdate(pe,{update_content:!0}),{onSuccess:function(e){return(0,Pe.wD)(e,{callback:function(){ni(!1),nt().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||[])&&yt&&setTimeout((function(){(0,Qr.h)()}),1)}))},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),pr=(0,r.Z)(ar,2),fr=pr[0],hr=pr[1].isLoading,mr=(0,p.useState)({}),br=mr[0],gr=mr[1],xr=(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,s={},a={},d={},v={};((null===u||void 0===u?void 0:u.blocks)||Di).forEach((function(e){var n,t,i,l=e.extension_uuid,u=e.type,p=e.uuid,f=null===(n=xi.current[u])||void 0===n?void 0:n[p];"undefined"===typeof f&&(f=e.content);var h=null===(t=gi.current[u])||void 0===t?void 0:t[p];"undefined"===typeof h&&(h=e.callback_content);var m=null,b=null===(i=qn[p])||void 0===i?void 0:i.filter((function(e){return!!e})),x=null===b||void 0===b?void 0:b.find((function(e){return e.error}));if(b&&(!re||null===an||void 0===an||!an.length)){var j=[],k=0;b.forEach((function(n){var t=n.data,i=n.type;(g.tf.SCRATCHPAD===e.type||x||"table"!==i&&null!==br&&void 0!==br&&br[null===e||void 0===e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(fl.Lz)?e:e.concat(n)}),[]),i===oi.Gi.TEXT_PLAIN&&(k+=(null===t||void 0===t?void 0:t.length)||0)),(!Kn||k<Kn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var Z=Pl(Pl({},e),{},{callback_content:h,content:f});null===m?delete Z.outputs:Z.outputs=m,(null===o||void 0===o?void 0:o.uuid)===p&&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?a[Z.uuid]={callback_content:Z.callback_content,content:Z.content,outputs:Z.outputs,uuid:Z.uuid}:[g.tf.EXTENSION].includes(u)?(s[l]||(s[l]=[]),s[l].push(Z)):g.tf.CALLBACK===u?d[Z.uuid]=Z:g.tf.CONDITIONAL===u?v[Z.uuid]=Z:a[Z.uuid]=Z}));var p=Pl(Pl({},null===(t=F)||void 0===t?void 0:t.extensions),null===u||void 0===u?void 0:u.extensions);Object.entries(s).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];p[t]||(p[t]={}),p[t].blocks=i}));var f=[],h=[],m=[];((null===u||void 0===u?void 0:u.blocks)||Di).forEach((function(e){var n=e.uuid,t=a[n],i=d[n],o=v[n];"undefined"!==typeof t?f.push(t):"undefined"!==typeof i?h.push(i):"undefined"!==typeof o&&m.push(o)})),gr({});var b=Pl(Pl(Pl({},F),u),{},{blocks:f,callbacks:h,conditionals:m,extensions:p,widgets:Ni.map((function(e){var n,t,i=ji.current[e.uuid],o=to.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var r=null===(n=qn[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;(g.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(fl.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 Pl(Pl(Pl({},e),o),{},{configuration:Pl(Pl({},e.configuration),o.configuration),content:i,outputs:t})}))});return delete b.updated_at,fr({pipeline:b})}),[Di,Kn,qn,br,F,an,re,fr,Ni]),jr=(0,p.useMemo)((function(){return(0,vi.Rz)(F,{displayRelative:!0,isPipelineUpdating:hr,pipelineContentTouched:$t,pipelineLastSaved:Yt})}),[hr,F,$t,Yt]),kr=(0,ei.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=Pl({},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)(xt,Pl(Pl({},e),{},{block:s,onChangeCodeBlock:_i,onClose:Pr,pipeline:F,savePipelineContent:xr}))})}),{},[_i,F,xr],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat(pe)}),Zr=(0,r.Z)(kr,2),yr=Zr[0],Pr=Zr[1];(0,p.useEffect)((function(){if(gn){var e,n=(null===gn||void 0===gn?void 0:gn.block)||{type:null,uuid:null},t=n.type,i=n.uuid,o=Di.find((function(e){var n=e.type,o=e.uuid;return n===t&&o===i}));if(o){if(Pn(o),null!==hi&&void 0!==hi&&hi.current){var r,l=hi.current[(0,vi.zv)(o)];null===l||void 0===l||null===(r=l.current)||void 0===r||r.scrollIntoView()}}else if(t===g.tf.CHART){var u=Ni.find((function(e){return e.uuid===i}));if(u&&(Pn(u),null!==mi&&void 0!==mi&&mi.current)){var c,s=mi.current[u.uuid];null===s||void 0===s||null===(c=s.current)||void 0===c||c.scrollIntoView()}}else if(null!==gn&&void 0!==gn&&null!==(e=gn.file)&&void 0!==e&&e.path){var a;or(null===gn||void 0===gn||null===(a=gn.file)||void 0===a?void 0:a.path)}}}),[Di,or,gn,Pn,Ni]),(0,p.useEffect)((function(){var e,n,t=et,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!==et&&void 0!==et&&et.hasOwnProperty("error")?"undefined"!==pe?i=[{label:"Check pipeline configuration file for any issues",onClick:function(){or("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!==Fi&&void 0!==Fi&&Fi.hasOwnProperty("error")?t=Fi:(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(){or("".concat(Ze.dT.METADATA_YAML)),Te(null)}}]),(0,Pe.bB)(t,Te,i)}),[et,Fi,or,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 Cr=(0,p.useMemo)((function(){var e=[],n=[];return Di.forEach((function(t){g.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[Di]),Or=Cr.blocksInNotebook,wr=Cr.blocksInSidekick,_r=(0,p.useCallback)((function(e,n){return xr({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 tr(),n!==(null===(o=F)||void 0===o?void 0:o.type)&&nt(),(0,vi.k1)(Or,pe,r),(0,vi.k1)(wr,pe,r)}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&Se((function(e){return Pl(Pl({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){or("pipelines/".concat(pe,"/").concat(Ze.dT.METADATA_YAML)),Se(null)}}]})}))}))}),[Or,wr,tr,nt,or,null===(k=F)||void 0===k?void 0:k.type,pe,ce,xr]),Sr=(0,p.useState)(null),Ir=Sr[0],Er=Sr[1],Tr=(0,p.useState)(null),Mr=Tr[0],Br=Tr[1],Dr=(0,p.useState)(null),Ar=Dr[0],Rr=Dr[1],Nr=(0,p.useCallback)((function(e){return vt({pipeline_interaction:Pl(Pl({},ct),{},{blocks:null!==e&&void 0!==e&&e.blockInteractionsMapping?null===e||void 0===e?void 0:e.blockInteractionsMapping:Mr,interactions:Ir,permissions:null===Ar||void 0===Ar?void 0:Ar.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}}))}}))})})}),[Mr,Ir,Ar,ct,vt]),Lr=(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(encodeURIComponent(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(Ai((function(e){return(0,L.oM)(e,e.findIndex((function(e){var n=e.type,o=e.uuid;return t===n&&i===o})))})),nt(),Pn(null),En){var o=Pl({},Mr);delete o[i],Nr({blockInteractionsMapping:o}).then((function(e){var n=e.pipeline_interaction;return Br(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&&Vn((function(e){return Pl(Pl({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:oi.Gi.TEXT_PLAIN}}))))}))}})}}),Fr=(0,r.Z)(Lr,1)[0],Ur=(0,ei.dd)((function(e){return(0,S.jsx)(Xt.Z,{centerOnScreen:!0,neutral:!0,onCancel:Gr,onClick:function(){return zr(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})})),Hr=(0,r.Z)(Ur,2),Wr=Hr[0],Gr=Hr[1],Kr=(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(){Wo(),nt()},onErrorCallback:function(e,n){Wr(),Se({displayMessage:e.exception,errors:n,response:e})}})}}),zr=(0,r.Z)(Kr,1)[0],qr=(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})}})}}),Vr=(0,r.Z)(qr,1)[0],Yr=(0,p.useCallback)((function(){return Vr({kernel:{action_type:"restart"}})}),[Vr]),Xr=(0,p.useCallback)((function(){Vr({kernel:{action_type:"interrupt"}}),dn([])}),[Vr]),Jr=(0,f.Db)(Y.ZP.blocks.pipelines.useCreate(pe)),$r=(0,r.Z)(Jr,1)[0];Fo=(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=xi.current[e.converted_from_type])||void 0===l?void 0:l[e.converted_from_uuid]);var s=e.language,a=e.type;if(gt){var d,v=(0,L.HK)((null===(d=F)||void 0===d?void 0:d.blocks)||[],(function(e){return e.type})),p=v[g.tf.DATA_EXPORTER],f=v[g.tf.DATA_LOADER],h=v[g.tf.TRANSFORMER];if(g.tf.DATA_LOADER===a){if(g.t6.YAML!==s)return void Se({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(g.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(g.tf.TRANSFORMER===a){var b;if(h)return void Se({displayMessage:"Pipeline ".concat(null===(b=F)||void 0===b?void 0:b.uuid," already has a transformer: ").concat(null===h||void 0===h?void 0:h.uuid,".")})}else if(g.tf.DATA_EXPORTER===a){if(g.t6.YAML!==s)return void Se({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(g.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 $r({block:Pl({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),yt&&null!==ne&&void 0!==ne&&ne(null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)&&(0,pl.eM)())?null===(e=window)||void 0===e||null===(i=e.location)||void 0===i||i.reload():(null!==c&&void 0!==c&&c.disableFetchingFiles||tr(),nt().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;Ai((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 Pl(Pl({},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,jl.u$)(Pl(Pl({},e),{},{name:u}));o&&r&&o.startsWith(si.LR)?Se((function(){return{errors:t,links:[{label:"View existing block file contents.",onClick:function(){or(r),Se(null)}}],response:n}})):Se({errors:t,response:n})}})}))};return yt&&null!==ne&&void 0!==ne&&ne(null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)?xr().then((function(){return j()})):j()}),[$r,ne,null===te||void 0===te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW,tr,nt,gt,or,F,xr,yt]);var el=(0,ei.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)(bn,{block:n,defaultName:c,isReplacingBlock:o,isUpdatingBlock:l,onClose:il,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l||o){var i,r=n.detach||!1;xr({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(){Pn(null),il()}))}else Fo(Pl(Pl({},n),(0,Mn.gR)(e,["name"])),t,s,null===e||void 0===e?void 0:e.name).then((function(){return il()}))},pipeline:F})})}),{},[Fo,F],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),nl=(0,r.Z)(el,2),tl=nl[0],il=nl[1],ol=(0,ei.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)(mo.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),ul()},onSaveSuccess:function(e){ie(),ul(),null===o||void 0===o||o(e)}})})}),{},[ie],{background:!0,uuid:"configure_project"}),rl=(0,r.Z)(ol,2),ll=rl[0],ul=rl[1],cl=(0,f.Db)(Y.ZP.widgets.pipelines.useCreate(pe)),yl=(0,r.Z)(cl,1)[0],Cl=(0,p.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,G.Y6)();return yl({widget:Pl({name:i,priority:n,type:g.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),tr(),nt(),pi(qi.cH.CHARTS),De(n)},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}))}),[tr,nt,yl]);(0,p.useEffect)((function(){if(Be){var e,n=null===(e=mi.current[Be.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),De(null))}}),[Be,De]),(0,p.useEffect)((function(){Jn!==pe&&(Ai([]),Li([]),ao([]),Qn([]))}),[pe,Jn]),(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 Pl(Pl({},e),{},{extension_uuid:t})}))))}));Ai(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)&&Li(F.widgets)}),[null===(I=F)||void 0===I?void 0:I.widgets]),(0,p.useEffect)((function(){(null===lo||void 0===lo?void 0:lo.length)>0&&0===(null===so||void 0===so?void 0:so.length)&&(ao(lo),yo(lo[0]))}),[so,lo]);var Ol=(0,kn.Z)(Di);(0,p.useEffect)((function(){var e;if(!je&&("undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.blocks)&&(!Di.length||!(0,L.fS)(null===Ol||void 0===Ol?void 0:Ol.map((function(e){return e.uuid})).sort(),null===Di||void 0===Di?void 0:Di.map((function(e){return e.uuid})).sort())||(0,Mn.Qr)(qn)))){var n=(0,vi.Rt)(F.blocks),t=n.content,i=n.messages;xi.current=t,(0,Mn.Qr)(i)||Vn((function(e){return Pl(Pl({},i),e)})),ke(!0)}}),[Di,Ol,je,qn,null===(E=F)||void 0===E?void 0:E.blocks,ke,Vn]),(0,p.useEffect)((function(){var e;if(!Ni.length&&"undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.widgets)){var n=(0,vi.Rt)(F.widgets),t=n.content,i=n.messages;ji.current=t,Vn((function(e){return Pl(Pl({},i),e)}))}}),[null===(B=F)||void 0===B?void 0:B.widgets,Vn,Ni]),(0,p.useEffect)((function(){if(yn&&!pn){var e=Di.find((function(e){var n,t=e.uuid;return(null===yn||void 0===yn||null===(n=yn.split(":"))||void 0===n?void 0:n[0])===t}));e&&(qt((function(n){return Pl(Pl({},n),{},(0,l.Z)({},e.uuid,!1))})),oo(e.uuid,e.type,null))}else(null===Ol||void 0===Ol?void 0:Ol.length)!==(null===Di||void 0===Di?void 0:Di.length)&&pn&&(qt((function(e){return Pl(Pl({},e),{},(0,l.Z)({},pn.uuid,!1))})),oo(pn.uuid,pn.type,null))}),[yn,Di,null===Ol||void 0===Ol?void 0:Ol.length,oo,pn,qt]);var wl=(0,p.useMemo)((function(){return new b.Z}),[]),_l=(0,p.useMemo)((function(){return{api_key:ml.lG,token:wl.decodedToken.token}}),[wl]),Sl=(0,d.ZP)((0,kl.Ib)(),{onClose:function(){return(0,pl.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=Di.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==r?Vn((function(e){var t=e[c]||[];return Pl(Pl({},e),{},(0,l.Z)({},c,t.concat(n)))})):(Qn((function(e){return[].concat((0,o.Z)(e),[n])})),oi.uF.IDLE===i&&(dn([]),nt(),c||tn(!1))),oi.uF.BUSY===i?dn((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!s?e:e.concat(s)})):oi.uF.IDLE===i&&dn((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),Gn||ni(!0)}},onOpen:function(){return(0,pl.eM)((function(){return console.log("socketUrlPublish opened")}))},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return(0,pl.eM)((function(){return console.log("Attempting to reconnect...")})),!0}}).sendMessage,Il=(0,p.useCallback)((function(){xr().then((function(){tn(!0),Qn([]),Sl(JSON.stringify(Pl(Pl({},_l),{},{execute_pipeline:!0,pipeline_uuid:pe})))}))}),[pe,xr,Sl,_l]),El=(0,p.useCallback)((function(){Sl(JSON.stringify(Pl(Pl({},_l),{},{cancel_pipeline:!0,pipeline_uuid:pe})))}),[pe,Sl,_l]),Tl=(0,p.useCallback)((function(){Sl(JSON.stringify(Pl(Pl({},_l),{},{cancel_pipeline:!0,pipeline_uuid:pe,skip_publish_message:!0})))}),[pe,Sl,_l]),Ml=(0,p.useCallback)((function(){Sl(JSON.stringify(Pl(Pl({},_l),{},{check_if_pipeline_running:!0,pipeline_uuid:pe})))}),[pe,Sl,_l]);(0,p.useEffect)((function(){var e;return window.addEventListener("pagehide",Tl),null===ce||void 0===ce||null===(e=ce.events)||void 0===e||e.on("routeChangeStart",Tl),function(){var e;null===ce||void 0===ce||null===(e=ce.events)||void 0===e||e.off("routeChangeStart",Tl),window.removeEventListener("pagehide",Tl)}}),[Tl,null===ce||void 0===ce?void 0:ce.events]);var Bl=(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,b=t.upstream_blocks,g=t.uuid;if(!an.find((function(e){var n=e.uuid;return g===n}))||o){var x,j,k="".concat(hl.vF,"_").concat(null===(x=F)||void 0===x?void 0:x.uuid);Sl(JSON.stringify(Pl(Pl({},_l),{},{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:b,uuid:g,variables:h}))),Vn((function(e){return delete e[g],e})),Ne(!1),dn((function(e){return e.find((function(e){var n=e.uuid;return g===n}))?e:e.concat(t)})),gr((function(e){return Pl(Pl({},e),{},(0,l.Z)({},null===t||void 0===t?void 0:t.uuid,!0))}))}null!==n&&void 0!==n&&n.skipUpdating||nt()}),[nt,F,an,Sl,Vn,dn,Ne,_l]),Dl=(0,p.useCallback)((function(e,n){var t,i=e.block;return Gn||null!==n&&void 0!==n&&n.skipUpdating?Bl(e,n):null===(t=xr({block:{outputs:[],uuid:i.uuid}},{contentOnly:!0}))||void 0===t?void 0:t.then((function(){return Bl(e)}))}),[Gn,Bl,xr]),Al=(0,ei.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}}),Ll()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[ee.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),Rl=(0,r.Z)(Al,2),Nl=Rl[0],Ll=Rl[1],Fl=(0,$i.Z)(Y.ZP.global_data_products.list,{},{revalidateOnFocus:!1},{delay:(null===Di||void 0===Di?void 0:Di.length)>=1?3e3:1e4}).data,Ul=(0,p.useMemo)((function(){return(null===Fl||void 0===Fl?void 0:Fl.global_data_products)||[]}),[Fl]),Hl=(0,ei.dd)((function(e){var n=e.addNewBlock;return(0,S.jsx)(ae.BC,{children:(0,S.jsx)(Rt.Z,{children:(0,S.jsx)(Mt.Z,{globalDataProducts:Ul,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:g.tf.GLOBAL_DATA_PRODUCT}),Kl()}})})})}),{},[Ul],{background:!0,uuid:"global_data_products"}),Wl=(0,r.Z)(Hl,2),Gl=Wl[0],Kl=Wl[1],zl=(0,p.useRef)(null),ql=(0,p.useState)(null),Vl=ql[0],Yl=ql[1],Xl=(0,p.useMemo)((function(){return qi.cH.INTERACTIONS===Zn}),[Zn]);(0,p.useEffect)((function(){var e,n;Zn&&null!==zl&&void 0!==zl&&zl.current&&Yl(null===zl||void 0===zl||null===(e=zl.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[Zn,On,se,En,zl]),(0,p.useEffect)((function(){!Ir&&(null===st||void 0===st?void 0:st.length)>=1&&Er((0,L.HK)(st||[],(function(e){return e.uuid})))}),[st,Ir,Er]),(0,p.useEffect)((function(){!Mr&&null!==ct&&void 0!==ct&&ct.blocks&&Br(null===ct||void 0===ct?void 0:ct.blocks)}),[Mr,ct,Br]);var Ql=(0,p.useMemo)((function(){return(0,S.jsx)(sl,{activeView:Zn,addNewBlockAtIndex:function(e,n,t,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(){return tl({block:e,idx:n,isReplacingBlock:o,name:i,onCreateCallback:t})}))},afterWidth:Ce,autocompleteItems:Go,blockInteractionsMapping:Mr,blockRefs:hi,blocks:Di,blocksInNotebook:Or,cancelPipeline:El,chartRefs:mi,checkIfPipelineRunning:Ml,containerHeightOffset:Xl?Vl+1:null,contentByBlockUUID:xi,createInteraction:mt,deleteBlock:Fr,deleteWidget:zo,editingBlock:rn,executePipeline:Il,fetchFileTree:tr,fetchPipeline:nt,fetchSecrets:Yi,fetchVariables:Gi,globalDataProducts:Ul,globalVariables:Ki,insights:Do,interactions:st,interactionsMapping:Ir,interruptKernel:Xr,isLoadingCreateInteraction:bt,isLoadingUpdatePipelineInteraction:pt,isPipelineExecuting:en,isPipelineUpdating:hr,lastTerminalMessage:X,messages:qn,metadata:Ro,onChangeCallbackBlock:wi,onChangeChartBlock:Ii,onChangeCodeBlock:_i,onSelectBlockFile:oo,onUpdateFileSuccess:qo,permissions:Ar,pipeline:F,pipelineInteraction:ct,pipelineMessages:Xn,project:oe,refAfterFooter:zl,runBlock:Dl,runningBlocks:an,sampleData:So,savePipelineContent:xr,savePipelineInteraction:Nr,secrets:Xi,selectedBlock:pn,selectedFilePath:lr,sendTerminalMessage:Q,setActiveSidekickView:pi,setAllowCodeBlockShortcuts:qe,setAnyInputFocused:Ue,setBlockInteractionsMapping:Br,setDisableShortcuts:Ge,setEditingBlock:ln,setErrors:Se,setHiddenBlocks:qt,setInteractionsMapping:Er,setPermissions:Rr,setSelectedBlock:Pn,setTextareaFocused:Ne,showBrowseTemplates:Nl,showDataIntegrationModal:yr,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 tl({block:e,isReplacingBlock:t,isUpdatingBlock:!t,name:n})}))},sideBySideEnabled:yt,statistics:Lo,textareaFocused:Re,treeRef:bi,updatePipelineInteraction:vt,updatePipelineMetadata:_r,updateWidget:io,widgets:Ni})}),[Zn,Vl,Ce,Go,Mr,hi,Di,Or,El,Ml,xi,mt,Fr,zo,rn,Il,tr,nt,Yi,Gi,Ul,Ki,Do,st,Ir,Xr,bt,pt,en,hr,Xl,X,qn,Ro,wi,Ii,_i,oo,qo,Ar,F,ct,Xn,oe,zl,Dl,an,So,xr,Nr,Xi,pn,lr,Q,Ue,Br,ln,Se,qt,Er,Rr,Pn,Ne,tl,Nl,yr,yt,Lo,Re,vt,_r,io,Ni]),Jl=(0,p.useMemo)((function(){return he?(0,S.jsx)(al,{activeView:Zn,pipeline:F,project:oe,secrets:Xi,selectedBlock:pn,setSelectedBlock:Pn,variables:Ki}):(0,S.jsx)(Tt.Z,{children:ur})}),[Zn,ur,Ki,he,F,oe,Xi,pn,Pn]),$l=(0,ei.dd)((function(e){var n=e.blockIndex;return(0,S.jsx)(ae.BC,{children:(0,S.jsx)(nn,{contained:!0,defaultBlockType:g.tf.DBT,onClickAction:function(e){var t;Fo((0,vi.J8)({blockIndex:n,blocks:Di,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===Di||void 0===Di?void 0:Di.length:n+1)-(yt?1:0),(function(e){Pn(e),tu()}))}})})}),{},[Fo,yt,le],{background:!0,disableClickOutside:!1,disableCloseButton:!1,disableEscape:!0,uuid:"BlockBrowser/".concat(pe)}),eu=(0,r.Z)($l,2),nu=eu[0],tu=eu[1],iu=(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)&&(g.tf.DBT!==(null===e||void 0===e?void 0:e.type)||g.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?tl({block:e,idx:n,name:i,onCreateCallback:t}):Fo(e,n,t,i)}))}),[Fo,tl]),ou=(0,p.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,G.Y6)();return new Promise((function(){return tl({block:e,isUpdatingBlock:!0,name:n})}))}),[tl]),ru=(0,p.useCallback)((function(e,n){var t=n.onCreateCallback;return Cl(e,Ni.length,t)}),[Cl,Ni]),lu=(0,p.useMemo)((function(){return(0,S.jsx)(co,{addNewBlockAtIndex:iu,addWidget:ru,afterHidden:On,allBlocks:Di,allowCodeBlockShortcuts:ze,anyInputFocused:Fe,autocompleteItems:Go,beforeHidden:Sn,blockInteractionsMapping:Mr,blockRefs:hi,blocks:Or,blocksThatNeedToRefresh:yi,dataProviders:Ui,deleteBlock:Fr,disableAutosave:Ht,disableShortcuts:We,fetchFileTree:tr,fetchPipeline:nt,fetchSampleData:wo,files:ir,globalDataProducts:Ul,globalVariables:Ki,hiddenBlocks:Un,hideOutputOnExecution:Nt,interactionsMapping:Ir,interruptKernel:Xr,mainContainerRef:Wn,mainContainerWidth:Ti,messages:qn,onChangeCallbackBlock:wi,onChangeCodeBlock:_i,openSidekickView:fi,pipeline:F,pipelineContentTouched:$t,restartKernel:Yr,runBlock:Dl,runningBlocks:an,savePipelineContent:xr,scrollTogether:St,selectedBlock:pn,setAnyInputFocused:Ue,setDisableShortcuts:Ge,setEditingBlock:ln,setErrors:Se,setHiddenBlocks:qt,setIntegrationStreams:bo,setOutputBlocks:ao,setPipelineContentTouched:ni,setScrollTogether:It,setSelectedBlock:Pn,setSelectedOutputBlock:yo,setSelectedStream:jo,setSideBySideEnabled:Dt,setTextareaFocused:Ne,showBlockBrowserModal:nu,showBrowseTemplates:Nl,showConfigureProjectModal:ll,showDataIntegrationModal:yr,showGlobalDataProducts:Gl,showUpdateBlockModal:ou,sideBySideEnabled:yt,textareaFocused:Re,widgets:Ni})}),[iu,ru,On,ze,Fe,Go,Sn,hi,Mr,Di,Or,yi,Ui,Fr,Ht,We,tr,nt,wo,ir,Ul,Ki,Nt,Un,Ir,Xr,Wn,Ti,qn,wi,_i,fi,F,$t,Yr,Dl,an,xr,St,pn,Ue,ln,Se,qt,ni,Pn,Ne,Dt,It,nu,Nl,ll,yr,Gl,ou,yt,Re,Ni]),uu=(0,p.useMemo)((function(){if(W===si.b7)return(0,S.jsx)(Et,{cancelPipeline:El,createPipeline:sr,disableAutosave:Ht,executePipeline:Il,hideOutputOnExecution:Nt,interruptKernel:Xr,isPipelineExecuting:en,pipeline:F,restartKernel:Yr,savePipelineContent:xr,scrollTogether:St,setMessages:Vn,setScrollTogether:It,setSideBySideEnabled:Dt,sideBySideEnabled:yt,toggleDisableAutosave:Gt,toggleHideOutputOnExecution:Ft,updatePipelineMetadata:_r})}),[El,sr,Ht,Il,Nt,Xr,en,W,F,Yr,xr,St,Vn,It,Dt,yt,Gt,Ft,_r]),cu=(0,p.useCallback)((function(e){e.widthOffset;if(W===si.b7)return(0,S.jsx)(no.rK,{relativePosition:!0,children:(0,S.jsxs)(ii,{isBusy:an.length>=1,pipeline:F,restartKernel:Yr,savePipelineContent:xr,setErrors:Se,setRunningBlocks:dn,updatePipelineMetadata:_r,children:[(0,S.jsx)(C.Z,{pr:1}),uu]})})}),[uu,W,F,Yr,an,xr,Se,_r]),su=(0,p.useMemo)((function(){var e;if(W===si.b7)return(0,S.jsx)(dl.Z,{pipelineContentTouched:$t,pipelineLastSaved:Yt,pipelineType:null===(e=F)||void 0===e?void 0:e.type,ref:z,saveStatus:jr,width:Ti})}),[Ti,W,F,$t,Yt,jr]),au=(0,p.useMemo)((function(){var e;return null===fo||void 0===fo||null===(e=fo.filter((function(e){return(0,L.sE)(null===_o||void 0===_o?void 0:_o.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 jo(e)},selected:xo===e,uuid:e,children:e})},e)}))}),[_o,fo,xo]),du=(0,p.useMemo)((function(){return(0,S.jsx)(T,{blockRefs:hi,hiddenBlocks:Un,pipeline:F,setHiddenBlocks:qt})}),[hi,Un,F,qt]),vu=(0,p.useMemo)((function(){return si.Jf.uuid===(null===An||void 0===An?void 0:An.uuid)?(0,S.jsxs)(S.Fragment,{children:[rr,nr]}):si.IY.uuid===(null===An||void 0===An?void 0:An.uuid)?du:null}),[du,nr,rr,An]),pu=(0,p.useMemo)((function(){return(0,S.jsx)(C.Z,{px:1,children:(0,S.jsx)(ve.Z,{noPadding:!0,onClickTab:function(e){Nn(e)},selectedTabUUID:null===An||void 0===An?void 0:An.uuid,tabs:si.NR,underlineColor:(ue||U.Z).accent.purple,underlineStyle:!0})})}),[Nn,An,ue]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Bt.Z,{title:null===(D=F)||void 0===D?void 0:D.name}),(0,S.jsxs)(ho,{after:Ql,afterHeader:Jl,afterHeightOffset:H.Mz-1,afterHidden:On,afterInnerHeightMinus:qi.cH.INTERACTIONS===Zn?Vl:null,afterNavigationItems:xl({activeView:Zn,pipeline:F,project:oe,secrets:Xi,setActiveSidekickView:pi,variables:Ki}),afterOverflow:qi.cH.DATA===Zn?"hidden":null,afterSubheader:(null===so||void 0===so?void 0:so.length)>0&&Zn===qi.cH.DATA&&(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!gt&&so.map((function(e){var n=e.uuid,t=(null===Zo||void 0===Zo?void 0:Zo.uuid)===n;return(0,S.jsx)(C.Z,{pl:1,children:(0,S.jsx)(un.ZP,{afterElement:t?(0,S.jsx)(ge.ZP,{basic:!0,highlightOnHover:!0,onClick:function(){(0,vi.h8)(pe,e.uuid),ao((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 yo(e)},selected:t,uuid:n,children:n})},n)})),gt&&au]}),before:vu,beforeDraggableTopOffset:H.Mz+vo.Wi,beforeHeader:pu,beforeHeightOffset:H.Mz,beforeHidden:Sn,beforeNavigationItems:(0,gl.H)(bl.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:su,mainContainerHeader:cu,mainContainerRef:Wn,page:W,pipeline:F,setAfterHidden:wn,setAfterWidthForChildren:Oe,setBeforeHidden:In,setErrors:Ee?Te:Se,setMainContainerWidth:Mi,children:[(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(pe),children:lu}),(0,S.jsx)(C.Z,{pb:yt?0:Math.max(Math.floor(se*(2/3)/w.iI),0)})]}),!oe||null!==ne&&void 0!==ne&&ne(null===te||void 0===te?void 0:te.COMMAND_CENTER)?null:Xo()]})}Cl.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=si.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 Ol=(0,bo.Z)(Cl)},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(10946)}])}},function(e){e.O(0,[9774,3662,125,1799,2714,9161,7162,2996,1557,8095,4241,4168,8023,523,4982,3548,3366,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|