mage-ai 0.9.12__py3-none-any.whl → 0.9.14__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/generator.py +1 -1
- mage_ai/ai/generator_cmds.py +1 -1
- mage_ai/ai/llm_pipeline_wizard.py +31 -17
- mage_ai/api/policies/BlockPolicy.py +1 -0
- mage_ai/api/policies/PipelineRunPolicy.py +1 -0
- mage_ai/api/policies/PipelineSchedulePolicy.py +12 -0
- mage_ai/api/policies/TagPolicy.py +18 -0
- mage_ai/api/presenters/BlockRunPresenter.py +4 -1
- mage_ai/api/presenters/PipelineRunPresenter.py +2 -0
- mage_ai/api/presenters/PipelineSchedulePresenter.py +9 -2
- mage_ai/api/presenters/TagPresenter.py +3 -0
- mage_ai/api/resources/BackfillResource.py +6 -3
- mage_ai/api/resources/BlockResource.py +2 -0
- mage_ai/api/resources/BlockRunResource.py +18 -12
- mage_ai/api/resources/DatabaseResource.py +23 -0
- mage_ai/api/resources/GitBranchResource.py +8 -1
- mage_ai/api/resources/GlobalDataProductResource.py +5 -2
- mage_ai/api/resources/PipelineResource.py +30 -14
- mage_ai/api/resources/PipelineScheduleResource.py +157 -1
- mage_ai/api/resources/SearchResultResource.py +1 -0
- mage_ai/api/resources/TagResource.py +16 -3
- mage_ai/data_integrations/sources/constants.py +1 -0
- mage_ai/data_preparation/git/__init__.py +18 -0
- mage_ai/data_preparation/models/block/__init__.py +34 -11
- mage_ai/data_preparation/models/block/dbt/utils/__init__.py +37 -10
- mage_ai/data_preparation/models/block/integration/__init__.py +1 -1
- mage_ai/data_preparation/models/block/sql/__init__.py +44 -2
- mage_ai/data_preparation/models/custom_templates/utils.py +14 -4
- mage_ai/data_preparation/models/global_data_product/__init__.py +8 -0
- mage_ai/data_preparation/models/pipeline.py +4 -0
- mage_ai/data_preparation/models/variable.py +5 -2
- mage_ai/data_preparation/repo_manager.py +28 -16
- mage_ai/io/clickhouse.py +9 -6
- mage_ai/io/redshift.py +9 -10
- mage_ai/io/utils.py +3 -1
- mage_ai/orchestration/db/migrations/README.md +39 -2
- mage_ai/orchestration/db/migrations/env.py +1 -0
- mage_ai/orchestration/db/migrations/versions/386bcfebd48d_create_tag_and_tagassociation_tables.py +59 -0
- mage_ai/orchestration/db/models/schedules.py +29 -2
- mage_ai/orchestration/db/models/tags.py +57 -0
- mage_ai/orchestration/pipeline_scheduler.py +7 -7
- mage_ai/orchestration/triggers/global_data_product.py +41 -40
- mage_ai/orchestration/triggers/utils.py +11 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/404.html.html +2 -2
- mage_ai/server/frontend_dist/_next/static/CNjkRIWPaAu1yJUmIaX_q/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1005-a2f0e3ee378ef02b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1424-fca78f21a81a7183.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1484-87d4d4a698ac63dc.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2485-39885e5335888821.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2786-f71862671f66d948.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3391-6f0a0a5c254cd7f2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3881-131cf690e54c23a3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/437-331193bd9b2fe777.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/4822-045cc7cdd7c95163.js → frontend_dist/_next/static/chunks/4822-ee62acb1927c8150.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/547-bd961ea93f3eb98b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/6299-fcb702d0f3d3291b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/6422-0cdd6e596dcd43b6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{6786-77c7e36678abb2c6.js → 6786-55e1bca3c897d5ee.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7496-7e4dd11e3f3b8e79.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7722-76c724a66240561b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7815-8b68b0eb665fcd2d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8190-d38ed1133030797d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8952-9d6fa18fa9378989.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9605-9332e1686c46da7d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-9dae6fa5126cf001.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-2dc2a0dfc0ff620d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-6d3d53624debede6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products-2756fe6d9decae4a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-6577159a0af52a78.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-6815a3ece7dc1678.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-7f790238fe70d9ab.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-33c7f2550add0719.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-07e4a3a674e83578.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-b8b4bed1e8e50068.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-54cb4936accdd2d9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-d331e98ad103b13e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-d87d0c21758a2d7c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-68e1b861ef4fc0d7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-9fa0c4ce1c921a41.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-d5ef19ca1f9931de.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-4a2671811a153411.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-8872a6e00280f58c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-484581ae34a1c596.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-ce11db27e4af7869.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-624a2d7cbe6303b4.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-1169f4eecf752033.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-d2224a447987fa69.js → frontend_dist/_next/static/chunks/pages/settings/account/profile-c3ff06a12baa40a2.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-60b4398d7ae00206.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-dd827816bf4a7908.js → frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-05b53444f0e7449b.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-097aa0bef1e34cdb.js → frontend_dist/_next/static/chunks/pages/sign-in-a5e9561a6c0d2e38.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/{[...slug]-78a07e7fe8973811.js → [...slug]-c21b269750441494.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/templates-19df643f52679d5a.js → frontend_dist/_next/static/chunks/pages/templates-ce2a29d477a6ce94.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-71bbb30dd9b57f80.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-1dc780d52fbd1573.js +1 -0
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +11 -11
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +3 -3
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1005-a2f0e3ee378ef02b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1424-fca78f21a81a7183.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1484-87d4d4a698ac63dc.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2485-39885e5335888821.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2786-f71862671f66d948.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3391-6f0a0a5c254cd7f2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3881-131cf690e54c23a3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/437-331193bd9b2fe777.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/4822-045cc7cdd7c95163.js → frontend_dist_base_path_template/_next/static/chunks/4822-ee62acb1927c8150.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/547-bd961ea93f3eb98b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6299-fcb702d0f3d3291b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6422-0cdd6e596dcd43b6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{6786-77c7e36678abb2c6.js → 6786-55e1bca3c897d5ee.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7496-7e4dd11e3f3b8e79.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7722-76c724a66240561b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7815-8b68b0eb665fcd2d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8190-d38ed1133030797d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8952-9d6fa18fa9378989.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9605-9332e1686c46da7d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-9dae6fa5126cf001.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-2dc2a0dfc0ff620d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-6d3d53624debede6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products-2756fe6d9decae4a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-6577159a0af52a78.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-6815a3ece7dc1678.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-7f790238fe70d9ab.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-33c7f2550add0719.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-07e4a3a674e83578.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-b8b4bed1e8e50068.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-54cb4936accdd2d9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-d331e98ad103b13e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-d87d0c21758a2d7c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-68e1b861ef4fc0d7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-9fa0c4ce1c921a41.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-d5ef19ca1f9931de.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-4a2671811a153411.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-8872a6e00280f58c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-484581ae34a1c596.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-ce11db27e4af7869.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-624a2d7cbe6303b4.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-1169f4eecf752033.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/account/profile-d2224a447987fa69.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-c3ff06a12baa40a2.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-60b4398d7ae00206.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-dd827816bf4a7908.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-05b53444f0e7449b.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/sign-in-097aa0bef1e34cdb.js → frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-a5e9561a6c0d2e38.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/{[...slug]-78a07e7fe8973811.js → [...slug]-c21b269750441494.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/templates-19df643f52679d5a.js → frontend_dist_base_path_template/_next/static/chunks/pages/templates-ce2a29d477a6ce94.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-71bbb30dd9b57f80.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-1dc780d52fbd1573.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/yJvL-3bfsNF3WCStZ10Dm/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/test.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
- mage_ai/server/server.py +53 -27
- mage_ai/services/spark/spark.py +75 -2
- mage_ai/streaming/constants.py +1 -0
- mage_ai/streaming/sources/kafka.py +17 -9
- mage_ai/tests/data_preparation/models/custom_templates/__init__.py +0 -0
- mage_ai/tests/data_preparation/models/custom_templates/test_utils.py +36 -0
- mage_ai/tests/data_preparation/models/test_block.py +48 -0
- mage_ai/tests/data_preparation/test_repo_manager.py +19 -1
- mage_ai/tests/server/test_server.py +20 -2
- mage_ai/tests/services/spark/__init__.py +0 -0
- mage_ai/tests/services/spark/test_spark.py +52 -0
- {mage_ai-0.9.12.dist-info → mage_ai-0.9.14.dist-info}/METADATA +1 -1
- {mage_ai-0.9.12.dist-info → mage_ai-0.9.14.dist-info}/RECORD +245 -233
- mage_ai/server/frontend_dist/_next/static/RdDEYzOW6lfmOEilKsz4V/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1005-2f8ef0e28c917767.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1424-a2cd1bfc708a323b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1484-a07f74ae5c40141c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2485-b569baad92049d6b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2786-acce6ea0d9b4898e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3654-14ee3eacc42b118a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3881-0eb04f7f7a244347.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/437-d43ccff3a064a528.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/547-4ad2cdae967055b6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6299-cf188c1b7a1bc33c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7496-ab1be388ae09d362.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7722-a74e6f977993e75e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7815-fbd99c8f259d9e8b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8952-98e54b14c1af492f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-74805cf1296fd50f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-bcdaa82adcca891d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-abdbda772d94c386.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products-01f8ef10e87ec236.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-950fbcb72961eb3c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-c6fd44191c812edf.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-6e46ed84cf3f4e9d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-1d52bba72442c53f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-8c33956a28fb4fa8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-b28d151c32c2a469.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1708e5576cd26d1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-0f3468d52020dcbf.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-489d02937d5f4695.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-544475d8e841638f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e117a99f334b6022.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-f1ef481c7beb8aef.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-ab52e3174c3dcf64.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-3e290f7d76c68b3f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-1ac4dc91ec394c6d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-4753de69f7e366c5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cf285c43759e9b2a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-3f86e7f1c8d63beb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-b2354688508b0755.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-cacb24e3632cfdfc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5a6e3a62fef551f1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/4dbzHNz2XwS_s6Z0qsIGO/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1005-2f8ef0e28c917767.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1424-a2cd1bfc708a323b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1484-a07f74ae5c40141c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2485-b569baad92049d6b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2786-acce6ea0d9b4898e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3654-14ee3eacc42b118a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3881-0eb04f7f7a244347.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/437-d43ccff3a064a528.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/547-4ad2cdae967055b6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6299-cf188c1b7a1bc33c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7496-ab1be388ae09d362.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7722-a74e6f977993e75e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7815-fbd99c8f259d9e8b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8952-98e54b14c1af492f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-74805cf1296fd50f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-bcdaa82adcca891d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-abdbda772d94c386.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products-01f8ef10e87ec236.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-950fbcb72961eb3c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-c6fd44191c812edf.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-6e46ed84cf3f4e9d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-1d52bba72442c53f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-8c33956a28fb4fa8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-b28d151c32c2a469.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1708e5576cd26d1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-0f3468d52020dcbf.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-489d02937d5f4695.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-544475d8e841638f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e117a99f334b6022.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-f1ef481c7beb8aef.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-ab52e3174c3dcf64.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-3e290f7d76c68b3f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-1ac4dc91ec394c6d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-4753de69f7e366c5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cf285c43759e9b2a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-3f86e7f1c8d63beb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-b2354688508b0755.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-cacb24e3632cfdfc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5a6e3a62fef551f1.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{RdDEYzOW6lfmOEilKsz4V → CNjkRIWPaAu1yJUmIaX_q}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist/_next/static/{RdDEYzOW6lfmOEilKsz4V → CNjkRIWPaAu1yJUmIaX_q}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{4dbzHNz2XwS_s6Z0qsIGO → yJvL-3bfsNF3WCStZ10Dm}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{4dbzHNz2XwS_s6Z0qsIGO → yJvL-3bfsNF3WCStZ10Dm}/_ssgManifest.js +0 -0
- {mage_ai-0.9.12.dist-info → mage_ai-0.9.14.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.12.dist-info → mage_ai-0.9.14.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.12.dist-info → mage_ai-0.9.14.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.12.dist-info → mage_ai-0.9.14.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551],{48591:function(e,n,t){"use strict";var i=t(21831),r=t(75582),o=t(82684),l=t(37958);n.Z=function(e){var n=e.children,t=e.uuid,c=e.uuids,u=void 0===c?[]:c,a=(0,l.j)("apiReloads"),s=(0,r.Z)(a,1)[0],d=(0,i.Z)(u);t&&d.push(t);var p=d.map((function(e){return String(s[e])||"-"})).join("_");return o.cloneElement(n,{key:p})}},91207:function(e,n,t){"use strict";t.d(n,{Z:function(){return R}});var i=t(82394),r=t(75582),o=t(17717),l=t(82684),c=t(37958),u=t(83455),a=t(35490),s=t(86422),d=t(60328),p=t(38626),f=t(93461),v=t(67971),h=t(28598),m=p.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),b=p.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),g=function(e){var n=e.children,t=e.divider,i=l.Children.toArray(n).length;return(0,h.jsx)(m,{children:(0,h.jsx)(v.Z,{children:l.Children.map(n,(function(e,n){return e&&(0,h.jsxs)(f.Z,{children:[n>=1&&t&&(0,h.jsx)(b,{}),l.cloneElement(e,{borderRadiusLeft:i>=2&&0===n,borderRadiusRight:i>=2&&n===i-1,halfPaddingLeft:i>=2&&0!==n,halfPaddingRight:i>=2&&n!==i-1,noBorder:i>=2&&n>0&&n<i-1,noBorderRight:i>=2&&n!==i-1})]},"button-group-child-".concat(n))}))})})},x=t(57722),j=t(73828),y=t(11135),k=t(98781),Z=t(86673),O=t(82531),P=t(16115),w=t(94353),C=t(60701),_=t(55512),S=t(24224),E=t(32821),I=t(90211),T=t(96510),D=t(51504),A=t(41150);function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function B(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?M(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):M(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var R=function(e){var n=e.active,t=e.addNewBlock,p=e.disableRefreshWarning,f=e.fetchPipeline,m=e.fetchVariables,b=e.filePath,M=e.hideHeaderButtons,R=e.onContentChange,N=e.openSidekickView,L=e.pipeline,F=e.saveFile,U=e.selectedFilePath,H=e.sendTerminalMessage,z=e.setDisableShortcuts,V=e.setErrors,W=e.setFilesTouched,G=e.setSelectedBlock,K=(0,c.j)("apiReloads"),Y=(0,r.Z)(K,2)[1],q=(0,l.useState)(null),Q=q[0],J=q[1],X=(0,l.useState)(!1),$=X[0],ee=(X[1],(0,l.useRef)(null)),ne=(0,l.useMemo)((function(){return new a.Z}),[]),te=(0,l.useMemo)((function(){return{api_key:w.l,token:ne.decodedToken.token}}),[ne]),ie=O.ZP.statuses.list().data,re=(0,l.useMemo)((function(){var e,n;return null===ie||void 0===ie||null===(e=ie.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[ie]),oe=O.ZP.file_contents.detail(b).data;(0,l.useEffect)((function(){null!==oe&&void 0!==oe&&oe.file_content&&J(oe.file_content)}),[oe]);var le=(0,l.useState)(null===Q||void 0===Q?void 0:Q.content),ce=le[0],ue=le[1],ae=(0,l.useCallback)((function(e){ue(e),R&&(null===R||void 0===R||R(e))}),[R]),se=(0,l.useState)(!1),de=se[0],pe=se[1];(0,l.useEffect)((function(){n&&z&&(null===z||void 0===z||z(!0))}),[n,z]),(0,l.useEffect)((function(){var e;U&&(null===ee||void 0===ee||null===(e=ee.current)||void 0===e||e.scrollIntoView())}),[U]);var fe=(0,u.Db)(O.ZP.file_contents.useUpdate((null===Q||void 0===Q?void 0:Q.path)&&encodeURIComponent(null===Q||void 0===Q?void 0:Q.path)),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){Y((function(e){return B(B({},e),{},(0,i.Z)({},"FileVersions/".concat(null===Q||void 0===Q?void 0:Q.path),Number(new Date)))}))},onErrorCallback:function(e,n){return null===V||void 0===V?void 0:V({errors:n,response:e})}})}}),ve=(0,r.Z)(fe,1)[0],he=(0,l.useCallback)((function(e,n){if(F)return F(e,n);ve({file_content:B(B({},n),{},{content:e})}).then((function(){decodeURIComponent(b).split(o.sep).pop()===j.dT.METADATA_YAML&&m&&(null===m||void 0===m||m())})),W((function(e){return B(B({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),pe(!1)}),[m,b,F,W,ve]),me=(0,l.useMemo)((function(){return(0,_.lU)()}),[]),be=(0,l.useMemo)((function(){var e,n,t,i;return null===(null===Q||void 0===Q||null===(e=Q.path)||void 0===e?void 0:e.match(me))?j.Lu.TXT:null===Q||void 0===Q||null===(n=Q.path)||void 0===n||null===(t=n.match(me))||void 0===t||null===(i=t[0])||void 0===i?void 0:i.split(".")[1]}),[me,Q]),ge=(0,l.useMemo)((function(){if(null!==Q&&void 0!==Q&&Q.path)return(0,h.jsx)(x.Z,{autoHeight:!0,language:j.nB[be],onChange:function(e){ae(e),W((function(e){return B(B({},e),{},(0,i.Z)({},null===Q||void 0===Q?void 0:Q.path,!0))})),pe(!0)},onSave:function(e){he(e,Q)},selected:!0,textareaFocused:!0,value:(0,I.Pb)(null===Q||void 0===Q?void 0:Q.content)?JSON.stringify(JSON.parse(null===Q||void 0===Q?void 0:Q.content),null,2):null===Q||void 0===Q?void 0:Q.content,width:"100%"})}),[Q,be,he,ae,W]),xe=null!==L&&void 0!==L&&L.blocks?(0,S.sE)(null===L||void 0===L?void 0:L.blocks,(function(e){var n=e.type;return s.tf.DATA_EXPORTER===n})):null,je=(0,u.Db)(O.ZP.blocks.pipelines.useUpdate(null===L||void 0===L?void 0:L.uuid,null===xe||void 0===xe?void 0:xe.uuid),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){null===f||void 0===f||f()}})}}),ye=(0,r.Z)(je,1)[0],ke=t&&L&&(be===j.Lu.PY||be===j.Lu.SQL||(be===j.Lu.YAML||be===j.Lu.R)&&(0,E.V3)(Q,null===Q||void 0===Q?void 0:Q.path))&&(0,_.ck)(Q.path.split(o.sep))!==s.tf.SCRATCHPAD&&(0,E.lr)(Q)&&(0,h.jsx)(d.Z,{onClick:function(){var e=(null===L||void 0===L?void 0:L.type)===k.qL.INTEGRATION,n=(0,_.TU)(Q,re,L);t(n,(function(n){e&&xe&&ye({block:B(B({},xe),{},{upstream_blocks:[n.uuid]})}),null===G||void 0===G||G(n)}))},primary:!0,children:"Add to current pipeline"}),Ze=H&&(0,h.jsx)(Z.Z,{m:2,children:(0,h.jsx)(y.ZP,{disabled:!re,inline:!0,loading:$,onClick:function(){null===N||void 0===N||N(C.cH.TERMINAL),null===H||void 0===H||H(JSON.stringify(B(B({},te),{},{command:["stdin","pip install -r ".concat(re,"/requirements.txt\r")]})))},title:re?"Pip install packages from your saved requirements.txt file (\u2318+S to save).":"Please use right panel terminal to install packages.",uuid:"FileEditor/InstallPackages",children:"Install packages"})}),Oe="FileEditor/".concat(null===Q||void 0===Q?void 0:Q.path),Pe=(0,A.y)(),we=Pe.registerOnKeyDown,Ce=Pe.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){Ce(Oe)}}),[Ce,Oe]),we(Oe,(function(e,t){if(n&&!p)if((0,D.y)([P.zX,P.Um],t)||(0,D.y)([P.PQ,P.Um],t))e.preventDefault(),he(ce,Q);else if(de&&(0,D.y)([P.zX,P.hS],t)){e.preventDefault();var i="".concat(Q.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[n,ce,p,Q,he,de]),(0,h.jsxs)("div",{ref:ee,children:[!M&&(0,h.jsx)(Z.Z,{p:2,children:(0,h.jsxs)(v.Z,{justifyContent:"space-between",children:[(0,h.jsxs)(g,{children:[ke,(0,h.jsx)(d.Z,{disabled:!ce,onClick:function(e){e.preventDefault(),he(ce,Q)},title:ce?null:"No changes have been made to this file.",children:"Save file content"})]}),N&&(0,h.jsx)(g,{children:(0,h.jsx)(d.Z,{compact:!0,onClick:function(){N(C.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),ge,b===j.dT.REQS_TXT&&Ze]})}},23351:function(e,n,t){"use strict";var i=t(82394),r=t(75582),o=t(17717),l=t(37958),c=t(82684),u=t(83455),a=t(60328),s=t(57722),d=t(73828),p=t(93461),f=t(67971),v=t(87372),h=t(86673),m=t(54283),b=t(87815),g=t(19711),x=t(82531),j=t(49125),y=t(55512),k=t(42305),Z=t(90211),O=t(96510),P=t(66653),w=t(24224),C=t(28598);function _(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?_(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.onActionCallback,t=e.selectedBlock,_=e.selectedFilePath,E=e.setErrors,I=e.width,T=(0,l.j)("apiReloads"),D=(0,r.Z)(T,2)[1],A=x.ZP.file_versions.files.list(_&&encodeURIComponent(_)),M=A.data,B=A.mutate,R=(0,c.useMemo)((function(){return(null===M||void 0===M?void 0:M.file_versions)||[]}),[M]),N=(0,c.useState)(null),L=N[0],F=N[1],U=(0,c.useMemo)((function(){return null===R||void 0===R?void 0:R[L]}),[L,R]),H=x.ZP.file_contents.detail(U?encodeURIComponent(U.path):null).data,z=(0,c.useMemo)((function(){return null===H||void 0===H?void 0:H.file_content}),[H]),V=(0,c.useMemo)((function(){return(0,y.lU)()}),[]),W=(0,c.useMemo)((function(){var e,n,t;return null===_||void 0===_||null===(e=_.match(V))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[_,V]),G=(0,u.Db)(x.ZP.file_contents.useUpdate(_&&encodeURIComponent(_)),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(e){var t;_&&B();var r=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(r);if(r){var c=r.split(o.sep);if("pipelines"===c[0]){var u=c.slice(1,c.length-1).join(o.sep);l="PipelineDetail/".concat(u)}}D((function(e){return S(S({},e),{},(0,i.Z)({},l,Number(new Date)))})),F((function(e){return e+1})),null===n||void 0===n||n(e)},onErrorCallback:function(e,n){return E({errors:n,response:e})}})}}),K=(0,r.Z)(G,2),Y=K[0],q=K[1].isLoading,Q=(0,c.useMemo)((function(){var e=R.map((function(e){var n=e.name,t=e.path;return[(0,C.jsxs)(f.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(p.Z,{flex:1,children:[(0,C.jsx)(g.ZP,{default:!0,monospace:!0,children:(0,k.JX)(n,{withSeconds:!0})}),(0,C.jsx)(h.Z,{px:2*j.cd,children:(0,C.jsx)(g.ZP,{monospace:!0,children:n})})]}),U&&(null===U||void 0===U?void 0:U.path)===t&&(0,C.jsx)(a.Z,{compact:!0,loading:q,onClick:function(e){(0,P.j)(e),Y({file_content:{version:n}})},small:!0,children:"Replace with this version"})]},n)]}));if(U){var n=(0,C.jsx)(h.Z,{p:j.cd,children:(0,C.jsx)(m.Z,{},"spinner")});if(z&&(null===z||void 0===z?void 0:z.path)===(null===U||void 0===U?void 0:U.path)){var t=z.content,i=void 0===t?"":t;n=(0,C.jsx)(s.Z,{autoHeight:!0,language:d.nB[W],padding:!0,readOnly:!0,value:(0,Z.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:I})}e=(0,w.Hk)([n],L+1,e)}return e}),[z,W,R,q,U,L,Y,I]);return(0,C.jsxs)("div",{style:{width:I},children:[(0,C.jsxs)(h.Z,{p:j.cd,children:[(0,C.jsx)(v.Z,{level:5,children:"File versions"}),(0,C.jsx)(g.ZP,{inline:!0,monospace:!0,children:_?decodeURIComponent(_):null===t||void 0===t?void 0:t.uuid})]}),(0,C.jsx)(b.Z,{buildRowProps:function(e){if(U&&L+1===e)return{renderCell:function(e){return e},renderRow:function(e){return e}}},columnFlex:[1],columns:[{uuid:"Version"}],isSelectedRow:function(e){var n;return(null===(n=R[e])||void 0===n?void 0:n.name)===(null===U||void 0===U?void 0:U.name)},onClickRow:function(e){U?e===L?F(null):e<L?F(e):e>L+1&&F(e-1):F(e)},rows:Q})]})}},83766:function(e,n,t){"use strict";var i=t(82394),r=t(86673),o=t(87815),l=t(19711),c=t(82944),u=t(49125),a=t(28598);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,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.objectAttributes,t=e.originalAttributes,s=e.setObjectAttributes;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(r.Z,{mb:1,px:u.cd,children:[(0,a.jsx)(l.ZP,{bold:!0,children:"Outdated after"}),(0,a.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,a.jsx)(o.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var r,o,u=e.uuid,p=null===n||void 0===n||null===(r=n.outdated_after)||void 0===r?void 0:r[u],f=null===t||void 0===t||null===(o=t.outdated_after)||void 0===o?void 0:o[u];return[(0,a.jsxs)(l.ZP,{default:!0,monospace:!0,children:[u," ",f&&(0,a.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(u)),(0,a.jsx)(c.Z,{compact:!0,monospace:!0,onChange:function(e){return s((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)({},u,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 p||null===p?"":p},"input-".concat(u))]}))})]})}},31682:function(e,n,t){"use strict";var i=t(82394),r=t(55378),o=t(86673),l=t(87815),c=t(19711),u=t(82944),a=t(49125),s=t(90211),d=t(24224),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 v(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.objectAttributes,t=e.originalAttributes,f=e.setObjectAttributes;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(o.Z,{mb:1,px:a.cd,children:[(0,p.jsxs)(c.ZP,{bold:!0,children:["Outdated starting at ",(0,p.jsx)(c.ZP,{inline:!0,muted:!0,children:"(optional)"})]}),(0,p.jsx)(c.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,p.jsx)("div",{style:{marginTop:4},children:(0,p.jsxs)(c.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,p.jsx)(c.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Outdated starting at"})," has a value of 17 for ",(0,p.jsx)(c.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,p.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 o,l,a,d=e.uuid,h=e.values,m=null===n||void 0===n||null===(o=n.outdated_starting_at)||void 0===o?void 0:o[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 f((function(n){var t;return v(v({},n),{},{outdated_starting_at:v(v({},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 a=h?(0,p.jsx)(r.Z,v(v({},g),{},{placeholder:"Select a value",children:h.map((function(e){var n=e.uuid,t=e.value;return(0,p.jsx)("option",{value:t,children:n},t)}))})):(0,p.jsx)(u.Z,v(v({},g),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,p.jsxs)(c.ZP,{default:!0,monospace:!0,children:[(0,s.vg)(d)," ",b&&(0,p.jsxs)(c.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"outdated-starting-at-label-".concat(d)),a]}))})]})}},21978:function(e,n,t){"use strict";var i=t(82394),r=t(12691),o=t.n(r),l=t(38341),c=t(10919),u=t(86673),a=t(87815),s=t(19711),d=t(82944),p=t(49125),f=t(28598);function v(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?v(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(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,r=e.originalAttributes,v=e.setObjectAttributes;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(u.Z,{mb:1,px:p.cd,children:[(0,f.jsx)(s.ZP,{bold:!0,children:"Block data to output"}),(0,f.jsx)(s.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,f.jsx)("div",{style:{marginTop:4},children:(0,f.jsx)(s.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,f.jsx)(a.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,u=e.uuid,a=null===t||void 0===t?void 0:t.settings,p=null===a||void 0===a?void 0:a[u],m=null===p||void 0===p?void 0:p.partitions,b=null===r||void 0===r||null===(n=r.settings)||void 0===n?void 0:n[u],g=null===b||void 0===b?void 0:b.partitions,x=!!p||!!b;return[(0,f.jsx)(l.Z,{checked:x,onClick:function(){return function(e){v((function(n){var t=null===n||void 0===n?void 0:n.settings;return e?t[u]={}:null===t||void 0===t||delete t[u],h(h({},n),{},{settings:t})}))}(!x)}},"selected--".concat(u)),(0,f.jsxs)("div",{children:[(0,f.jsx)(o(),{as:"/pipelines/".concat(null===t||void 0===t?void 0:t.object_uuid,"/edit?block_uuid=").concat(u),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,f.jsx)(c.Z,{monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:u})})," ",g&&(0,f.jsxs)(s.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"block-uuid-".concat(u)),(0,f.jsx)(d.Z,{compact:!0,monospace:!0,onChange:function(e){return v((function(n){var t,r;return h(h({},n),{},{settings:h(h({},null===n||void 0===n?void 0:n.settings),{},(0,i.Z)({},u,h(h({},null===n||void 0===n||null===(t=n.settings)||void 0===t?void 0:t[u]),{},{partitions:0===(null===(r=e.target.value)||void 0===r?void 0:r.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(u))]}))})]})}},65232:function(e,n,t){"use strict";var i=t(12691),r=t.n(i),o=t(82684),l=t(34376),c=t(30119),u=t(10919),a=t(86673),s=t(54283),d=t(87815),p=t(19711),f=t(82531),v=t(49125),h=t(66653),m=t(28598);n.Z=function(e){var n=e.globalDataProducts,t=e.onClickRow,i=(0,l.useRouter)(),b=f.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,g=(0,o.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)(a.Z,{p:v.cd,children:(0,m.jsx)(p.ZP,{children:"There are currently no global data products registered."})}):(0,m.jsx)(d.Z,{columnFlex:[1,null,null],columns:[{uuid:"UUID"},{uuid:"Object type"},{uuid:"Object UUID"}],onClickRow:function(e){var n=null===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?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,o=e.uuid,l={as:null,href:null};return c.b.PIPELINE===n&&(l.as="/pipelines/".concat(t,"/edit"),l.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(p.ZP,{monospace:!0,children:o},"uuid"),(0,m.jsx)(p.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(r(),{as:null===l||void 0===l?void 0:l.as,href:null===l||void 0===l?void 0:l.href,passHref:!0,children:(0,m.jsx)(u.Z,{default:!0,monospace:!0,onClick:function(e){(0,h.j)(e),i.push(l.href,l.as)},preventDefault:!0,children:t})},"objectUUID")]})),uuid:"global-data-products"}):(0,m.jsx)(a.Z,{p:v.cd,children:(0,m.jsx)(s.Z,{})})}},85307:function(e,n,t){"use strict";t.d(n,{$W:function(){return a},cl:function(){return s},cv:function(){return d},dE:function(){return u}});var i=t(38626),r=t(23831),o=t(73942),l=t(49125),c=t(37391),u=i.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],o.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).popup,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-1"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeTextarea,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-2"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],c.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 ")})),d=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-3"})(["padding:","px;"," "," ",""],2*l.iI,(function(e){return"\n background-color: ".concat((e.theme||r.Z).interactive.defaultBackground,";\n border-bottom: ").concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||r.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(o.n_,"px;\n border-top-right-radius: ").concat(o.n_,"px;\n ")}))},38488:function(e,n,t){"use strict";t.d(n,{Z:function(){return P}});var i=t(82394),r=t(26304),o=t(82684),l=t(38626),c=t(16634),u=t(67971),a=t(10919),s=t(86673),d=t(19711),p=t(46261),f=t(23831),v=t(22341),h=t(28347),m=t(49125),b=t(33766),g=t(66653),x=t(28598);var j=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,r=e.isLast,l=e.onClickTab,j=e.onClickTabClose,y=e.renderTabTitle,k=e.savePipelineContent,Z=e.selected,O=e.themeContext,P=(0,o.useState)(!1),w=P[0],C=P[1];return(0,x.jsx)(u.Z,{flexDirection:"column",fullHeight:!0,onClick:function(e){e.preventDefault(),Z||(l?l(n):(null===k||void 0===k||k(),(0,b.u7)({file_path:encodeURIComponent(n)})))},onMouseEnter:function(){return C(!0)},onMouseLeave:function(){return C(!1)},children:(0,x.jsx)(h.Gb,{last:r,selected:Z,children:(0,x.jsxs)(u.Z,{alignItems:"center",fullHeight:!0,children:[(0,x.jsx)(p.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,x.jsxs)(u.Z,{alignItems:"center",fullHeight:!0,children:[!i[n]&&(0,x.jsx)(v.iU,{muted:!Z,size:1.5*m.iI}),i[n]&&(0,x.jsx)(p.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,x.jsx)("div",{style:{padding:1},children:(0,x.jsx)(c.Z,{borderColor:(O||f.Z).borders.danger,size:1.25*m.iI})})}),(0,x.jsx)(s.Z,{mr:1}),(0,x.jsx)(d.ZP,{muted:!Z,children:y?y(n):n})]})}),(0,x.jsx)(s.Z,{mr:2}),(0,x.jsx)(p.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,x.jsxs)(a.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(e){(0,g.j)(e),null===j||void 0===j||j(n)},preventDefault:!0,children:[(w||Z)&&(0,x.jsx)(v.x8,{muted:!Z,size:1.25*m.iI}),!w&&!Z&&(0,x.jsx)("div",{style:{width:1.25*m.iI}})]})})]})})})},y=t(24224),k=["filePaths","isSelectedFilePath","onClickTabClose","selectedFilePath"];function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var P=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTabClose,c=e.selectedFilePath,a=(0,r.Z)(e,k),s=(0,o.useContext)(l.ThemeContext),d=(0,o.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),p=(0,o.useMemo)((function(){return null===d||void 0===d?void 0:d.length}),[d]);return(0,x.jsx)(u.Z,{alignItems:"center",justifyContent:"flex-start",children:null===d||void 0===d?void 0:d.map((function(e,n){var r=t?t(e,c):c===encodeURIComponent(e);return(0,o.createElement)(j,O(O({},a),{},{filePath:e,isLast:n===p-1,key:e,onClickTabClose:function(e){if(i)i(e);else{var n=(0,y.Od)(d,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,b.u7)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})}},selected:r,themeContext:s}))}))})}},70543:function(e,n,t){"use strict";t.d(n,{IY:function(){return o},Jf:function(){return r},NR:function(){return l},b7:function(){return i}});var i="edit",r={uuid:"All files"},o={uuid:"Files in pipeline"},l=[r,o]},28347:function(e,n,t){"use strict";t.d(n,{Gb:function(){return p},fm:function(){return s},lO:function(){return a},rK:function(){return d},zn:function(){return u}});var i=t(38626),r=t(23831),o=t(82386),l=t(49125),c=t(37391),u=300,a=i.default.div.withConfig({displayName:"indexstyle__PipelineContainerStyle",componentId:"sc-1sv9513-0"})([".pipeline-detail-enter-active{opacity:1;transition:opacity ","ms linear;}.pipeline-detail-enter-done{opacity:0;transition:opacity ","ms linear;}"],u,u),s=i.default.div.withConfig({displayName:"indexstyle__OverlayStyle",componentId:"sc-1sv9513-1"})(["height:100vh;opacity:1;position:fixed;width:100vw;z-index:9999;",""],(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeArea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],o.Wi,o.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||r.Z.borders).medium,";\n ")}),(function(e){return e.relativePosition&&"\n position: relative;\n "}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(o.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,c.y$)()),p=i.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-right:1px solid transparent;height:100%;padding:","px ","px;"," "," ",""],l.iI,l.cd*l.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||r.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||r.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||r.Z.borders).light," !important;\n ")}))},59920:function(e,n,t){"use strict";var i;t.d(n,{M:function(){return i}}),function(e){e.BACKFILLS="backfills",e.BLOCK_RUNS="block_runs",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={}))},36405:function(e,n,t){"use strict";t.d(n,{H:function(){return c}});var i=t(98781),r=t(22341),o=t(59920),l=t(9736);function c(e,n,t){var c=(n||{}).uuid||t,u=[{Icon:r.Bf,id:o.M.TRIGGERS,isSelected:function(){return o.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(c,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:r.Pf,id:o.M.RUNS,isSelected:function(){return o.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(c,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:r.dE,id:o.M.BACKFILLS,isSelected:function(){return o.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(c,"/backfills"),href:"/pipelines/[pipeline]/backfills"}},{Icon:r.UL,id:o.M.PIPELINE_LOGS,isSelected:function(){return o.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(c,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:r.ug,id:o.M.MONITOR,isSelected:function(){return o.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(c,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.INTEGRATION===(null===n||void 0===n?void 0:n.type)&&u.unshift({Icon:r.Nt,id:o.M.SYNCS,isSelected:function(){return o.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(c,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),(0,l.Ct)()||(u.unshift({Icon:r.EK,disabled:!c,id:o.M.EDIT,isSelected:function(){return o.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(c,"/edit"),href:"/pipelines/[pipeline]/edit"}}),u.push({Icon:r.Zr,id:o.M.SETTINGS,isSelected:function(){return o.M.SETTINGS===e},label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(c,"/settings"),href:"/pipelines/[pipeline]/settings"}})),u}},58122:function(e,n,t){"use strict";t.d(n,{FS:function(){return u},JZ:function(){return s},e7:function(){return d},wx:function(){return a}});var i=t(75582),r=t(82394),o=t(93348);function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function u(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:u(n)})}))}function s(e,n){return n===o.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===o.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function d(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),o=t[0],l=t[1],u=l;try{u=JSON.parse(l)}catch(a){}return c(c({},e),{},(0,r.Z)({},o,u))}),{}):e}},68735:function(e,n,t){"use strict";var i=t(26304),r=t(21831),o=t(82394),l=t(82684),c=t(26226),u=t(38626),a=t(90948),s=t(84969),d=t(65743),p=t(85587),f=t(79487),v=t(52136),h=t(67778),m=t(29989),b=t(17066),g=t(84482),x=t(76771),j=t(98889),y=t(65376),k=t(61655),Z=t(97745),O=t(48072),P=t(10103),w=t(84181),C=t(24903),_=t(67971),S=t(19711),E=t(52359),I=t(23831),T=t(80906),D=t(73899),A=t(2005),M=t(31012),B=t(49125),R=t(24224),N=t(344),L=t(45739),F=t(28598),U=["areaBetweenLines","data","events","height","lineLegendNames","margin","width","xAxisLabel","xLabelFormat","yAxisLabel","yLabelFormat"];function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function z(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?H(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):H(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var V=z(z({},y.j),{},{backgroundColor:I.Z.background.muted,border:"none"}),W=(0,k.Z)((function(e){var n=e.areaBetweenLines,t=e.data,i=e.events,o=void 0!==i&&i,c=e.getX,k=e.getY,_=e.getYScaleValues,E=e.gridProps,U=void 0===E?{}:E,H=e.height,W=e.hideGridX,G=e.hideTooltip,K=e.increasedXTicks,Y=e.lineLegendNames,q=e.margin,Q=e.noCurve,J=e.numYTicks,X=e.renderXTooltipContent,$=e.renderYTooltipContent,ee=e.showTooltip,ne=e.thickStroke,te=e.tooltipData,ie=e.tooltipLeft,re=void 0===ie?0:ie,oe=e.tooltipTop,le=void 0===oe?[]:oe,ce=e.width,ue=e.xLabelFormat,ae=e.xLabelRotate,se=void 0===ae||ae,de=e.yLabelFormat,pe=(0,l.useContext)(u.ThemeContext),fe=c||function(e){return null===e||void 0===e?void 0:e.x},ve=k||function(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null===e||void 0===e||null===(n=e.y)||void 0===n?void 0:n[t]},he=I.Z.monotone.gray,me=I.Z.brand.wind200,be=I.Z.content.muted,ge=I.Z.monotone.gray,xe=t.map((function(e){return Number(fe(e))}));if(ce<10)return null;var je=ce-q.left-q.right,ye=H-q.top-q.bottom,ke=je/2,Ze=0===t.length?0:Math.max.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return(null===n||void 0===n?void 0:n.length)||0})))),Oe=(0,l.useMemo)((function(){return(0,w.Z)({domain:[Math.min.apply(Math,(0,r.Z)(xe)),Math.max.apply(Math,(0,r.Z)(xe))],range:[0,je]})}),[je,xe]),Pe=Math.min.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return Math.min.apply(Math,(0,r.Z)(_?_(n):n||[]))})))),we=Math.max.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return Math.max.apply(Math,(0,r.Z)(_?_(n):n||[]))})))),Ce=(0,l.useMemo)((function(){return(0,w.Z)({domain:[Pe,we],nice:!0,range:[ye,0]})}),[ye,we,Pe]),_e=ce>520?K?20:10:K?10:5,Se=(0,L.K)(pe),Ee=be,Ie=Se.map((function(e){return{stroke:e}})),Te=(0,C.Z)({domain:Y||[],range:Ie.map((function(e){return e.stroke}))}),De=(0,l.useCallback)((function(e){var n=((0,O.Z)(e)||{x:0}).x,i=Oe.invert(n-q.left),r=(0,R.ry)(xe,(function(e){return i>=e})),o=t[r-1],l=t[r],c=o;l&&(i-fe(o)>fe(l)-i?c=l:(c=o,r-=1));var u=(0,P.range)(0,Ze).map((function(e){return Ce(ve(c,e))})),a=u.some((function(e){return"undefined"===typeof e}));(ve(c)||_&&!a)&&ee({tooltipData:z(z({},c),{},{index:r}),tooltipLeft:n,tooltipTop:u})}),[t,fe,ve,_,q,ee,Oe,xe,Ce]),Ae={};return Q||(Ae.curve=Z.ZP),(0,F.jsxs)(F.Fragment,{children:[Y&&(0,F.jsx)("div",{style:{marginLeft:null===q||void 0===q?void 0:q.left},children:(0,F.jsx)(b.Z,{labelFormat:function(e){return e},scale:Te,children:function(e){return(0,F.jsx)("div",{style:{display:"flex",flexDirection:T.qs.ROW},children:e.map((function(e,n){return(0,F.jsxs)(g.Z,{margin:"0 5px",onClick:function(){o&&alert("clicked: ".concat(JSON.stringify(e)))},children:[(0,F.jsx)("svg",{height:15,width:15,children:(0,F.jsx)("rect",{fill:e.value,height:15,width:15})}),(0,F.jsx)(x.Z,{align:"left",margin:"0 0 0 4px",children:(0,F.jsx)(S.ZP,{small:!0,children:e.text})})]},"legend-quantile-".concat(n))}))})}})}),(0,F.jsxs)("svg",{height:H,width:ce,children:[!n&&(0,F.jsx)(d.Z,{fill:"transparent",height:H,onMouseLeave:function(){return G()},onMouseMove:De,onTouchMove:De,onTouchStart:De,rx:14,width:ce-(q.left+q.right),x:q.left,y:0}),(0,F.jsxs)(m.Z,{left:q.left,top:q.top,children:[!W&&(0,F.jsx)(v.Z,z({height:ye,pointerEvents:"none",scale:Oe,stroke:he,strokeDasharray:"3,3",strokeOpacity:.4,width:je},U)),(0,F.jsx)(h.Z,z({height:ye,pointerEvents:"none",scale:Ce,stroke:he,strokeDasharray:"3,3",strokeOpacity:.4,width:je},U)),(0,F.jsx)("line",{stroke:he,x1:je,x2:je,y1:0,y2:ye}),(0,F.jsx)(a.Z,{numTicks:_e,scale:Oe,stroke:Ee,tickFormat:function(e){return ue?ue(e):e},tickLabelProps:function(e){return{fill:be,fontFamily:A.ry,fontSize:M.J5,textAnchor:"middle",transform:se&&"rotate(-45, ".concat(Oe(e),", 0) translate(-32, 4)")}},tickStroke:Ee,top:ye}),(0,F.jsx)(s.Z,{hideTicks:!0,numTicks:J,scale:Ce,stroke:Ee,tickFormat:function(e){return de?de(e):(0,N.P5)(e)},tickLabelProps:function(e){return{dx:String(e).length>4?3:0,fill:be,fontFamily:A.ry,fontSize:M.J5,textAnchor:"end",transform:"translate(0,2.5)"}},tickStroke:Ee}),n&&n.map((function(e){var n=e[0],i=e[1];return(0,l.createElement)(j.Z,z(z({},Ae),{},{aboveAreaProps:{fill:I.Z.brand.earth400,fillOpacity:.3},belowAreaProps:{fill:me,fillOpacity:.2},clipAboveTo:0,clipBelowTo:ye,data:t,id:"".concat(Math.random()),key:"".concat(n,"-").concat(i),x:function(e){return Oe(fe(e))},y0:function(e){return Ce("undefined"===typeof i?Pe:ve(e,i))},y1:function(e){return Ce(ve(e,n))}}))})),(0,P.range)(0,Ze).map((function(e){return(0,l.createElement)(p.Z,z(z({},Ae),{},{data:t.filter((function(e){return void 0!=e.y})),key:e,pointerEvents:"none",strokeWidth:ne?2:1,x:function(e){return Oe(fe(e))},y:function(n){return Ce(n.y&&(e>=n.y.length?Pe:ve(n,e)))}},Ie[e]))}))]}),te&&(0,F.jsxs)("g",{children:[(0,F.jsx)(f.Z,{from:{x:re,y:q.top},pointerEvents:"none",stroke:D.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:re,y:ye+q.top}}),le.map((function(e,n){return(0,F.jsx)("circle",{cx:re,cy:e+1+q.top,fill:Ie[n].stroke,fillOpacity:.1,pointerEvents:"none",r:4,stroke:ge,strokeOpacity:.1,strokeWidth:1},n)})),le.map((function(e,n){return(0,F.jsx)("circle",{cx:re,cy:e+q.top,fill:Ie[n].stroke,pointerEvents:"none",r:4,stroke:Ie[n].stroke,strokeWidth:2},n)}))]})]}),te&&(0,F.jsxs)("div",{children:[le.map((function(e,n){var t=ve(te,n);return n>=1&&Math.abs(le[n-1]-e)<5*B.iI&&(e+=3*B.iI),(0,F.jsxs)(y.Z,{left:re>ke?re-(0,N.Vs)($,te,n)*B.iI:re+B.iI,style:V,top:e-2*B.iI,children:[$&&$(te,n),!$&&(0,F.jsxs)(S.ZP,{center:!0,small:!0,children:[t.toFixed?t.toFixed(3):t," ",null===Y||void 0===Y?void 0:Y[n]]})]},n)})),(0,F.jsxs)(y.Z,{left:re>ke?re-4*(0,N.Vs)(X,te):re,style:z(z({},V),{},{transform:"translateX(-65%)"}),top:ye+q.top,children:[X&&X(te),!X&&(0,F.jsx)(S.ZP,{center:!0,small:!0,children:fe(te).toFixed(3)})]})]})]})}));n.Z=function(e){var n=e.areaBetweenLines,t=e.data,r=(e.events,e.height),o=e.lineLegendNames,l=e.margin,u=void 0===l?{}:l,a=e.width,s=e.xAxisLabel,d=e.xLabelFormat,p=e.yAxisLabel,f=e.yLabelFormat,v=(0,i.Z)(e,U),h=z(z({},{bottom:3*B.iI,left:5*B.iI,right:3*B.iI,top:3*B.iI}),u);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{style:{display:"flex",height:r,marginBottom:B.iI,width:"100%"},children:[p&&(0,F.jsx)(_.Z,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,F.jsx)(E.Z,{children:(0,F.jsx)(S.ZP,{center:!0,muted:!0,small:!0,children:p})})}),(0,F.jsx)("div",{style:{height:r,width:"undefined"===typeof a?"100%":a},children:(0,F.jsx)(c.Z,{children:function(e){var i=e.width,r=e.height;return(0,F.jsx)(W,z(z({},v),{},{areaBetweenLines:n,data:t,height:r,lineLegendNames:o,margin:h,width:i,xLabelFormat:d,yLabelFormat:f}))}})})]}),s&&(0,F.jsx)("div",{style:{paddingLeft:p?36:0,paddingTop:4},children:(0,F.jsx)(S.ZP,{center:!0,muted:!0,small:!0,children:s})})]})}},21853:function(e,n,t){"use strict";t.d(n,{Z:function(){return S}});var i=t(82394),r=t(75582),o=t(82684),l=t(83455),c=t(60328),u=t(34744),a=t(93461),s=t(67971),d=t(87372),p=t(10919),f=t(29237),v=t(86673),h=t(19711),m=t(82944),b=t(70902),g=t(82531),x=t(38626),j=t(23831),y=t(73942),k=t(49125),Z=x.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],y.n_,k.cd*k.iI,(function(e){return"\n background-color: ".concat((e.theme.background||j.Z.background).codeArea,";\n ")})),O=t(96510),P=t(9728),w=t(28598);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 _(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}var S=function(e){var n=e.cancelButtonText,t=e.contained,x=e.header,j=e.onCancel,y=e.onSaveSuccess,C=(0,P.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),S=(0,r.Z)(C,1)[0],E=(0,o.useState)(null),I=E[0],T=E[1],D=g.ZP.projects.list(),A=D.data,M=D.mutate,B=(0,o.useMemo)((function(){var e;return null===A||void 0===A||null===(e=A.projects)||void 0===e?void 0:e[0]}),[A]),R=B||{},N=R.name,L=R.project_uuid;(0,o.useEffect)((function(){I||T(B)}),[B,I]);var F=(0,l.Db)(g.ZP.projects.useUpdate(N),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(e){var n=e.project;M(),T(n),y&&(null===y||void 0===y||y(n))},onErrorCallback:function(e,n){return S({errors:n,response:e})}})}}),U=(0,r.Z)(F,2),H=U[0],z=U[1].isLoading,V=(0,o.useCallback)((function(e){return H({project:e})}),[H]),W=(0,w.jsxs)(w.Fragment,{children:[x,(0,w.jsxs)(f.Z,{noPadding:!0,children:[(0,w.jsxs)(v.Z,{p:k.cd,children:[(0,w.jsx)(v.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Project name"})}),(0,w.jsx)(h.ZP,{default:!0,monospace:!0,children:N})]}),(0,w.jsx)(u.Z,{light:!0}),(0,w.jsxs)(v.Z,{p:k.cd,children:[(0,w.jsx)(v.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Project UUID"})}),(0,w.jsx)(h.ZP,{default:!!L,monospace:!0,muted:!L,children:L||"Not required"})]}),(0,w.jsx)(u.Z,{light:!0}),(0,w.jsx)(v.Z,{p:k.cd,children:(0,w.jsxs)(s.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(a.Z,{flexDirection:"column",children:[(0,w.jsx)(v.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Help improve Mage"})}),(0,w.jsxs)(h.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,w.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,w.jsx)(v.Z,{mr:k.cd}),(0,w.jsx)(b.Z,{checked:null===I||void 0===I?void 0:I.help_improve_mage,onCheck:function(){return T((function(e){return _(_({},e),{},{help_improve_mage:!(null!==I&&void 0!==I&&I.help_improve_mage)})}))}})]})})]}),(0,w.jsx)(v.Z,{mt:k.HN}),(0,w.jsx)(f.Z,{noPadding:!0,children:(0,w.jsxs)(v.Z,{p:k.cd,children:[(0,w.jsx)(v.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Features"})}),Object.entries((null===I||void 0===I?void 0:I.features)||{}).map((function(e){var n=(0,r.Z)(e,2),t=n[0],o=n[1];return(0,w.jsxs)(s.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(h.ZP,{default:!0,monospace:!0,children:t}),(0,w.jsx)(v.Z,{mr:k.cd}),(0,w.jsx)(b.Z,{checked:!!o,onCheck:function(){return T((function(e){return _(_({},e),{},{features:_(_({},null===I||void 0===I?void 0:I.features),{},(0,i.Z)({},t,!o))})}))}})]},t)}))]})}),(0,w.jsx)(v.Z,{mt:k.HN}),(0,w.jsx)(f.Z,{noPadding:!0,children:(0,w.jsxs)(v.Z,{p:k.cd,children:[(0,w.jsx)(v.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"OpenAI"})}),(0,w.jsx)(m.Z,{label:"API key",monospace:!0,onChange:function(e){return T((function(n){return _(_({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===I||void 0===I?void 0:I.openai_api_key)||""})]})}),(0,w.jsx)(v.Z,{mt:k.HN}),(0,w.jsxs)(s.Z,{alignItems:"center",children:[(0,w.jsx)(c.Z,{loading:z,onClick:function(){V({features:null===I||void 0===I?void 0:I.features,help_improve_mage:null===I||void 0===I?void 0:I.help_improve_mage,openai_api_key:null===I||void 0===I?void 0:I.openai_api_key})},primary:!0,children:"Save project settings"}),j&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(v.Z,{mr:k.cd}),(0,w.jsx)(c.Z,{onClick:j,secondary:!0,children:n||"Cancel"})]})]})]});return t?(0,w.jsx)(Z,{children:W}):W}},76096:function(e,n,t){"use strict";var i=t(82394),r=t(26304),o=(t(82684),t(33591)),l=t(28598),c=["children","fullHeight","gutter","style"];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 a(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,i.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}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,u=e.style,s=void 0===u?{}:u,d=(0,r.Z)(e,c),p=a({},s);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,l.jsx)(o.Col,a(a({},d),{},{style:p,children:n}))}},97361:function(e,n,t){"use strict";var i=t(82394),r=t(26304),o=t(82684),l=t(33591),c=t(28598),u=["children","fullHeight","gutter","justifyContent","style"];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 s(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.children,t=e.fullHeight,i=e.gutter,a=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,r.Z)(e,u),v=s({},p);return i&&(v.marginLeft=-1*i,v.marginRight=v.marginLeft),t&&(v.height="100%"),(0,c.jsx)(l.Row,s(s({},f),{},{justifyContent:a,style:v,children:o.Children.map(n,(function(e,n){return e&&o.cloneElement(e,{gutter:i,key:n})}))}))}},18221:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return r}}),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 r=[i.AZURE_CONTAINER_INSTANCE,i.ECS,i.GCP_CLOUD_RUN,i.K8S,i.LOCAL_PYTHON,i.PYSPARK]},30119: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={}))},93348:function(e,n,t){"use strict";t.d(n,{TR:function(){return d},U5:function(){return u},Xm:function(){return o},Z4:function(){return s},fq:function(){return c},kJ:function(){return a}});var i,r,o,l=t(82394);!function(e){e.API="api",e.EVENT="event",e.TIME="time"}(o||(o={}));var c,u,a,s=(i={},(0,l.Z)(i,o.API,(function(){return"API"})),(0,l.Z)(i,o.EVENT,(function(){return"event"})),(0,l.Z)(i,o.TIME,(function(){return"schedule"})),i);!function(e){e.ACTIVE="active",e.INACTIVE="inactive"}(c||(c={})),function(e){e.ONCE="@once",e.HOURLY="@hourly",e.DAILY="@daily",e.WEEKLY="@weekly",e.MONTHLY="@monthly"}(u||(u={})),function(e){e.CREATED_AT="created_at",e.NAME="name",e.PIPELINE="pipeline_uuid",e.STATUS="status",e.TYPE="schedule_type"}(a||(a={}));var d=(r={},(0,l.Z)(r,a.CREATED_AT,"Created at"),(0,l.Z)(r,a.NAME,"Name"),(0,l.Z)(r,a.PIPELINE,"Pipeline"),(0,l.Z)(r,a.STATUS,"Status"),(0,l.Z)(r,a.TYPE,"Type"),r)},52769:function(e,n,t){"use strict";t.d(n,{C:function(){return i}});var i="global"},65730:function(e,n,t){"use strict";var i,r=t(82394),o=(t(82684),t(64866)),l=t(21764),c=t(67971),u=t(10919),a=t(86673),s=t(19711),d=t(46261),p=t(22341),f=t(49125),v=t(28598);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.LEFT="left",e.RIGHT="right"}(i||(i={})),n.Z=function(e){var n,t=e.children,r=e.copiedText,h=e.iconPosition,b=void 0===h?i.LEFT:h,g=e.inverted,x=e.linkProps,j=e.linkText,y=e.monospace,k=e.muted,Z=e.small,O=e.toastMessage,P=e.withCopyIcon;return t?n=(0,v.jsx)("span",{children:t}):P&&(n=(0,v.jsx)(u.Z,m(m({href:"#",inline:!0,muted:k,preventDefault:!0,sameColorAsText:!0,small:Z},x),{},{children:(0,v.jsxs)(c.Z,{alignItems:"center",children:[b===i.LEFT&&(0,v.jsx)(a.Z,{mr:j?1:0,children:(0,v.jsx)(c.Z,{alignItems:"center",children:(0,v.jsx)(p.CK,{inverted:g,muted:k,size:2*f.iI})})}),j&&(0,v.jsx)(s.ZP,{inverted:g,monospace:y,muted:k,small:Z,children:j}),b===i.RIGHT&&(0,v.jsx)(a.Z,{ml:j?1:0,children:(0,v.jsx)(c.Z,{alignItems:"center",children:(0,v.jsx)(p.CK,{inverted:g,muted:k})})})]})}))),(0,v.jsx)(d.Z,{block:!0,label:"Copy",size:null,widthFitContent:!0,children:(0,v.jsx)(o.CopyToClipboard,{onCopy:function(){return l.Am.success(O||"Successfully copied to clipboard.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:r})},text:r,children:n})})}},18776:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(38626),r=t(23831),o=t(73942),l=i.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],o.n_,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),c=t(28598);var u=function(e){var n=e.children,t=e.fullWidth,i=void 0===t||t;return(0,c.jsx)(l,{fullWidth:i,children:n})}},72555:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return co}});var i=t(77837),r=t(21831),o=t(82394),l=t(75582),c=t(38860),u=t.n(c),a=t(56085),s=t(82684),d=t(83455),p=t(34376),f=t(48591),v=t(35490),h=t(86422),m=t(38626),b=t(38341),g=t(16634),x=t(34744),j=t(93461),y=t(67971),k=t(10919),Z=t(86673),O=t(19711),P=t(49125),w=t(44162),C=t(28598);function _(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?_(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var E=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,r=e.setHiddenBlocks,l=(0,s.useContext)(m.ThemeContext),c=(0,s.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),u=(0,s.useMemo)((function(){var e=[],n=[];return c.forEach((function(i){var r=i.uuid;null!==t&&void 0!==t&&t[r]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[c,t]),a=u.blocksHidden,d=u.blocksVisible,p=(0,s.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)>=1&&0===d.length}),[c,d]),f=(0,s.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)>=1&&0===a.length}),[c,a]),v=(0,s.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var r,o=n.current["".concat(t,"s/").concat(i,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}}),[n]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:f,label:"Show all",onClick:function(){return r((function(){return{}}))}})}),(0,C.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:p,label:"Hide all",onClick:function(){return r((function(){return c.reduce((function(e,n){var t=n.uuid;return S(S({},e),{},(0,o.Z)({},t,!0))}),{})}))}})})]})}),(0,C.jsx)(x.Z,{medium:!0}),null===c||void 0===c?void 0:c.map((function(e){var n=e.uuid,i=(0,w.qn)(e.type,{blockColor:e.color,theme:l}).accent,c=!(null!==t&&void 0!==t&&t[n]);return(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){r((function(e){return S(S({},e),{},(0,o.Z)({},n,c))})),c||setTimeout((function(){return v(e)}),1)},preventDefault:!0,children:(0,C.jsx)(Z.Z,{mt:1,px:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(Z.Z,{pr:1,children:(0,C.jsx)(b.Z,{checked:c})}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(g.Z,{color:i,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},I=t(2485),T=t(60328),D=t(32316),A=t(65701),M=t(1254);var B=function(e){var n=e.size;return(0,C.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,C.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,C.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,C.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,C.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,C.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,C.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,C.jsxs)("defs",{children:[(0,C.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,C.jsx)("stop",{stopColor:"#FFDA19"}),(0,C.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,C.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,C.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,C.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,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.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,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.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,C.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,C.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,C.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,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.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,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},R=t(89949),N=t(11135),L=t(33572),F=t(98781),U=t(55378),H=t(54283),z=t(82944),V=t(82531),W=t(22341),G=t(23831),K=t(73942),Y=m.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-h093u4-0"})([""," ",""],(function(e){return!e.width&&"\n width: ".concat(40*P.iI,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),q=m.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-h093u4-1"})(["padding:","px;",""],2.5*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-top-left-radius: ").concat(K.n_,"px;\n border-top-right-radius: ").concat(K.n_,"px;\n border-top: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n ")})),Q=m.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-h093u4-2"})(["align-items:center;justify-content:space-between;",""],(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-top: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n display: ").concat((null===e||void 0===e?void 0:e.display)||"flex",";\n padding-bottom: ").concat(1*P.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n padding-left: ").concat(P.cd*P.iI,"px;\n padding-top: ").concat(1*P.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n ")})),J=m.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-h093u4-3"})(["padding:","px ","px;",""],2.5*P.iI,2*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).panel,";\n border-bottom-left-radius: ").concat(K.n_,"px;\n border-bottom-right-radius: ").concat(K.n_,"px;\n border-bottom: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n ")})),X=t(72470),$=t(90211),ee=t(96510),ne=t(9728);function te(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 ie(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?te(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):te(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var re=function(e){var n,t=e.block,i=e.defaultName,r=e.onClose,o=e.onSave,c=e.pipeline,u=(0,ne.VI)(null,{},[],{uuid:"ConfigureBlock"}),a=(0,l.Z)(u,1)[0],p=(0,s.useRef)(null),f=(0,s.useState)({language:null===t||void 0===t?void 0:t.language,name:i,type:null===t||void 0===t?void 0:t.type}),v=f[0],m=f[1];(0,s.useEffect)((function(){var e;null===p||void 0===p||null===(e=p.current)||void 0===e||e.focus()}),[]);var b=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===c||void 0===c?void 0:c.type)}),[c]),g=(0,s.useMemo)((function(){return h.tf.CUSTOM===(null===t||void 0===t?void 0:t.type)}),[t]),x=(0,s.useMemo)((function(){return h.tf.MARKDOWN===(null===t||void 0===t?void 0:t.type)}),[t]),j=(0,s.useMemo)((function(){return null===t||void 0===t?void 0:t.block_action_object}),[t]),k=(0,s.useMemo)((function(){return X.L.GENERATE_BLOCK===(null===j||void 0===j?void 0:j.object_type)}),[j]),w=(0,s.useMemo)((function(){return k&&(null===j||void 0===j?void 0:j.description)}),[j,k]),_=(0,s.useState)(null),S=_[0],E=_[1],I=(0,d.Db)(V.ZP.llms.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.llm,t=(null===n||void 0===n?void 0:n.response)||{},i=t.block_type,r=t.configuration,o=t.content,l=t.language;m((function(e){return ie(ie({},e),{},{block_action_object:null,configuration:r,content:o,language:l,type:i})})),E(n)},onErrorCallback:function(e,n){return a({errors:n,response:e})}})}}),D=(0,l.Z)(I,2),G=D[0],K=D[1].isLoading;(0,s.useEffect)((function(){k&&w&&!S&&G({llm:{request:{block_description:w},use_case:L.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[G,w,k,S]);var te=(0,s.useMemo)((function(){var e,n;return null!==t&&void 0!==t&&null!==(e=t.config)&&void 0!==e&&e.custom_template?null===t||void 0===t||null===(n=t.config)||void 0===n?void 0:n.custom_template:[X.L.CUSTOM_BLOCK_TEMPLATE,X.L.MAGE_TEMPLATE].includes(null===j||void 0===j?void 0:j.object_type)?ie(ie({},j),{},{name:null===j||void 0===j?void 0:j.title}):void 0}),[t,j]),re=(0,s.useMemo)((function(){var e=(null===v||void 0===v?void 0:v.type)||(null===t||void 0===t?void 0:t.type);te&&(e=null===te||void 0===te?void 0:te.block_type);var n=h.V4[e];return b&&(h.tf.DATA_LOADER===e?n="Source":h.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[t,v,te,b]);return(0,C.jsxs)(Y,{width:k&&(null===v||void 0===v?void 0:v.content)&&80*P.iI,children:[(0,C.jsxs)(q,{children:[k&&K&&(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{children:"Generating block using AI..."}),(0,C.jsx)(H.Z,{inverted:!0})]}),k&&!K&&(0,C.jsx)(y.Z,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(W.xq,{size:5*P.iI,warning:!0})}),!k&&(0,C.jsx)(y.Z,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(B,{size:15*P.iI})})]}),k&&!K&&(0,C.jsx)(Q,{children:(0,C.jsxs)(Z.Z,{py:1,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(O.ZP,{default:!0,children:"Block generated using AI"})}),(0,C.jsx)(O.ZP,{textOverflow:!0,children:w})]})}),te&&(0,C.jsx)(Q,{children:(0,C.jsxs)(Z.Z,{py:1,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(O.ZP,{default:!0,children:"Template"})}),(0,C.jsx)(O.ZP,{textOverflow:!0,children:null===(n=(null===te||void 0===te?void 0:te.name)||(null===te||void 0===te?void 0:te.template_uuid))||void 0===n?void 0:n.slice(0,40)})]})}),(0,C.jsxs)(Q,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Name"}),(0,C.jsx)(z.Z,{alignRight:!0,noBackground:!0,noBorder:!0,onChange:function(e){return m((function(n){return ie(ie({},n),{},{name:e.target.value})}))},paddingVertical:P.iI,placeholder:"Block name...",ref:p,value:(null===v||void 0===v?void 0:v.name)||""})]}),(0,C.jsxs)(Q,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Type"}),(0,C.jsx)(Z.Z,{mr:P.cd,py:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{muted:!0,children:re}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(W.QM,{muted:!0})]})})]}),!x&&(g||te||(null===v||void 0===v?void 0:v.language))&&(0,C.jsxs)(Q,{paddingVerticalAddition:3,children:[(0,C.jsx)(O.ZP,{default:!0,children:"Language"}),(0,C.jsxs)(y.Z,{alignItems:"center",children:[[h.t6.PYTHON,h.t6.SQL,h.t6.R].reduce((function(e,n){var t=(te?null===te||void 0===te?void 0:te.language:null===v||void 0===v?void 0:v.language)===n;return g||t?(e.push((0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(T.Z,{borderColor:t?null:"transparent",compact:!0,default:!g&&!t,disabled:!g&&!t,noBackground:!0,onClick:te?null:function(){return m((function(e){return ie(ie({},e),{},{language:n})}))},selected:t,children:h.LE[n]})},n)),e):e}),[]),!g&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(W.QM,{muted:!0})]}),(0,C.jsx)(Z.Z,{mr:g?1:2})]})]}),(g||(null===te||void 0===te?void 0:te.color)||(null===v||void 0===v?void 0:v.color))&&(0,C.jsxs)(Q,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Color"}),g&&(0,C.jsxs)(U.Z,{alignRight:!0,noBackground:!0,noBorder:!0,onChange:function(e){return m((function(n){return ie(ie({},n),{},{color:e.target.value})}))},value:te?(null===te||void 0===te?void 0:te.color)||"":(null===v||void 0===v?void 0:v.color)||"",children:[(0,C.jsx)("option",{value:""}),Object.values(h.Lq).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,$.kC)(e)},e)}))]}),!g&&(0,C.jsx)(Z.Z,{mr:P.cd,py:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{muted:!0,children:(0,$.kC)((null===te||void 0===te?void 0:te.color)||(null===v||void 0===v?void 0:v.color)||"")}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(W.QM,{muted:!0})]})})]}),k&&(null===v||void 0===v?void 0:v.content)&&(0,C.jsx)(Q,{display:"block",children:(0,C.jsx)(Z.Z,{pr:P.cd,py:1,children:(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsx)(R.Z,{block:ie(ie({},v),{},{uuid:w}),defaultValue:null===v||void 0===v?void 0:v.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return m((function(n){return ie(ie({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},w)})})}),(0,C.jsx)(J,{children:(0,C.jsxs)(y.Z,{fullWidth:!0,children:[(0,C.jsx)(N.ZP,{bold:!0,centerText:!0,disabled:K,onClick:function(){return o(ie(ie({},v),{},{name:(null===v||void 0===v?void 0:v.name)||i}))},primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:"Save and add block"}),(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(T.Z,{onClick:r,tabIndex:0,children:"Cancel"})})]})})]})},oe=t(46299),le=t(91207),ce=t(47999),ue=t(62084),ae=t(16115),se=t(64318),de=t(54405),pe=t(41150);function fe(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 ve(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fe(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var he,me,be=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,r=e.executePipeline,l=e.interruptKernel,c=e.isPipelineExecuting,u=e.pipeline,a=e.restartKernel,d=e.savePipelineContent,p=(e.setActiveSidekickView,e.setMessages),f=(0,s.useState)(null),v=f[0],h=f[1],m=(0,s.useRef)(null),b=(0,s.useRef)(null),g=(0,s.useRef)(null),x=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,$.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,$.Y6)(),type:F.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,de.V5)()?ae.RJ:ae.hE,ae.SS]],label:function(){return"Save pipeline"},onClick:function(){return d()},uuid:"save_pipeline"}],j=(0,s.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[ae.kA],[ae.kA]],onClick:function(){return l()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[ae.t_[ae.OC]],[ae.t_[ae.OC]]],onClick:function(){return a()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return p((function(e){return Object.keys(e).reduce((function(e,n){return ve(ve({},e),{},(0,o.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return c?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):e.push({label:function(){return"Execute pipeline"},onClick:function(){return r()},uuid:"Execute pipeline"}),e}),[n,r,l,c,a,p]),k=(0,s.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===u||void 0===u?void 0:u.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"}]}),[u]),Z="FileHeaderMenu/index",P=(0,pe.y)(),w=P.registerOnKeyDown,_=P.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){_(Z)}}),[_,Z]),w(Z,(function(e,n,t){null!==v&&(n[ae.QK]?h((function(e){return 0===e?2:e-1})):n[ae.DY]&&h((function(e){return 2===e?0:e+1})))}),[v,h]),(0,C.jsx)(ce.Z,{onClickOutside:function(){return h(null)},open:!0,style:{position:"relative"},children:(0,C.jsxs)(y.Z,{children:[(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(se.u,{highlighted:0===v,onClick:function(){return h((function(e){return 0===e?null:0}))},onMouseEnter:function(){return h((function(e){return null!==e?0:null}))},ref:m,children:(0,C.jsx)(O.ZP,{children:"File"})}),(0,C.jsx)(ue.Z,{items:x,onClickCallback:function(){return h(null)},open:0===v,parentRef:m,uuid:"FileHeaderMenu/file_items"})]}),(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(se.u,{highlighted:1===v,onClick:function(){return h((function(e){return 1===e?null:1}))},onMouseEnter:function(){return h((function(e){return null!==e?1:null}))},ref:b,children:(0,C.jsx)(O.ZP,{children:"Run"})}),(0,C.jsx)(ue.Z,{items:j,onClickCallback:function(){return h(null)},open:1===v,parentRef:b,uuid:"FileHeaderMenu/run_items"})]}),(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(se.u,{highlighted:2===v,onClick:function(){return h((function(e){return 2===e?null:2}))},onMouseEnter:function(){return h((function(e){return null!==e?2:null}))},ref:g,children:(0,C.jsx)(O.ZP,{children:"Edit"})}),(0,C.jsx)(ue.Z,{items:k,onClickCallback:function(){return h(null)},open:2===v,parentRef:g,uuid:"FileHeaderMenu/edit_items"})]}),t]})})},ge=t(38488),xe=t(65232),je=t(57384);!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(he||(he={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(me||(me={}));var ye,ke=t(90686),Ze=t(62609),Oe=t(46261),Pe=t(66166);!function(e){e.EMR="emr"}(ye||(ye={}));var we=t(91427),Ce=t(28347),_e=t(42305),Se=t(24224),Ee=t(33766),Ie=t(99497);var Te=function(e){var n,t=e.children,i=(e.filePaths,e.filesTouched,e.isBusy),o=e.isPipelineUpdating,c=e.kernel,u=e.pipeline,a=e.pipelineContentTouched,p=e.pipelineLastSaved,f=(e.restartKernel,e.savePipelineContent,e.selectedFilePath),v=e.setErrors,h=e.setRunningBlocks,b=e.updatePipelineMetadata,x=(0,s.useContext)(m.ThemeContext),w=c||{},_=w.alive,S=w.usage,E=(0,s.useState)(!1),I=E[0],T=E[1],D=(0,s.useState)(""),A=D[0],M=D[1],B=(0,s.useState)(ye.EMR),R=B[0],L=(B[1],(0,s.useState)(!1)),U=L[0],H=L[1],z=(0,s.useState)(!1),K=z[0],Y=z[1],q=(0,s.useRef)(null),Q=V.ZP.clusters.detail(R,{},{revalidateOnFocus:!1}),J=Q.data,X=Q.mutate,$=(0,s.useMemo)((function(){var e;return(null===J||void 0===J||null===(e=J.cluster)||void 0===e?void 0:e.clusters)||[]}),[J]),ne=(0,s.useMemo)((function(){return(0,Se.sE)($,(function(e){return e.is_active}))}),[$]),te=(0,d.Db)(V.ZP.clusters.useUpdate(R),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){X()},onErrorCallback:function(e,n){return v({errors:n,response:e})}})}}),ie=(0,l.Z)(te,1)[0];(0,s.useEffect)((function(){null!==u&&void 0!==u&&u.uuid&&M(u.uuid)}),[null===u||void 0===u?void 0:u.uuid]),n=a?"Unsaved changes":o?"Saving changes...":p?"Last saved ".concat((0,_e.JX)(Number(p)/1e3)):"All changes saved";var re="KernelStatus",oe=(0,pe.y)(),le=oe.registerOnKeyDown,se=oe.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){se(re)}}),[se,re]),le(re,(function(e,n,t){I&&String(t[0])===String(ae.Uq)&&String(t[1])!==String(ae.zX)&&((null===u||void 0===u?void 0:u.uuid)===A?e.target.blur():(b(A),T(!1)))}),[I,A,T,b]);var fe=(0,s.useMemo)((function(){return null===S||void 0===S?void 0:S.pid}),[null===S||void 0===S?void 0:S.pid]),ve=(0,Pe.Z)(fe),he=(0,s.useMemo)((function(){if(null!==S&&void 0!==S&&S.kernel_memory){var e=S.kernel_memory,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))).concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}}),[null===S||void 0===S?void 0:S.kernel_memory]),be=(0,Ie.dd)((function(){return(0,C.jsx)(Ze.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:je,onClick:function(){(0,we.t8)(we.DU,1),je()},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*P.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),ge=(0,l.Z)(be,2),xe=ge[0],je=ge[1];(0,s.useEffect)((function(){var e=(0,we.U2)(we.DU,0);fe!==ve&&i&&!e&&(xe(),h([]))}),[i,fe,ve,h,xe]);var Te=(0,s.useMemo)((function(){return(0,C.jsx)("div",{ref:q,style:{position:"relative"},children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(null===u||void 0===u?void 0:u.type)===F.qL.PYSPARK&&(0,C.jsxs)(Z.Z,{mr:1,children:[(0,C.jsxs)(k.Z,{muted:!!ne,onClick:function(){return H(!0)},preventDefault:!0,sameColorAsText:!ne,underline:!ne,children:[ne&&ne.id,!ne&&"Select cluster"]}),(0,C.jsx)(ce.Z,{disableEscape:!0,onClickOutside:function(){return H(!1)},open:U,children:(0,C.jsx)(ue.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,r.Z)($.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,C.jsxs)(y.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(O.ZP,{muted:!t&&me.WAITING!==i,children:n})}),t&&(0,C.jsx)(W.Jr,{size:2*P.iI,success:!0}),!t&&(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||me.WAITING!==i?null:function(){return ie({cluster:{id:n,is_active:!0}})},uuid:n}})))),onClickCallback:function(){return H(!1)},open:U,parentRef:q,uuid:"KernelStatus/select_cluster",width:40*P.iI})})]}),(0,C.jsx)(N.ZP,{beforeElement:(0,C.jsx)(g.Z,{color:i?(x||G.Z).borders.info:_?(x||G.Z).borders.success:(x||G.Z).borders.danger,size:P.iI}),blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Y(!0)},uuid:"Pipeline/KernelStatus/kernel",children:(null===u||void 0===u?void 0:u.type)||F.qL.PYTHON}),(0,C.jsx)(ce.Z,{disableEscape:!0,onClickOutside:function(){return Y(!1)},open:K,children:(0,C.jsx)(ue.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,r.Z)(Object.keys(F.a_).filter((function(e){return(null===u||void 0===u?void 0:u.type)!=e})).map((function(e){return{label:function(){return e},onClick:function(){return b(null===u||void 0===u?void 0:u.name,e)},uuid:e}})))),onClickCallback:function(){return Y(!1)},open:K,parentRef:q,uuid:"KernelStatus/select_kernel",width:25*P.iI})})]})})}),[_,$,i,u,ne,H,Y,U,K,x,ie,b]);return(0,C.jsx)(Ce.rK,{relativePosition:!0,children:(0,C.jsxs)(y.Z,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,C.jsxs)(y.Z,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:[(0,C.jsxs)(Z.Z,{px:P.cd,children:[f&&(0,C.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:f?function(){return(0,Ee.u7)({file_path:null})}:null,preventDefault:!0,children:t}),!f&&(0,C.jsxs)(y.Z,{alignItems:"center",children:[t,I&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(k.Z,{onClick:function(){b(A),T(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]}),S&&(0,C.jsx)(Z.Z,{mr:P.cd,children:(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsxs)(O.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["CPU: ",null===S||void 0===S?void 0:S.kernel_cpu,"undefined"!==typeof(null===S||void 0===S?void 0:S.kernel_cpu)&&"%"]}),(0,C.jsxs)(O.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["Memory: ",he]})]})})]}),(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Oe.Z,{appearBefore:!0,block:!0,description:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,C.jsx)(ke.Z,{inline:!0,keyText:(0,de.V5)()?ae.RJ:ae.hE}),"\xa0",(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,C.jsx)(ke.Z,{inline:!0,keyText:ae.SS}),"\xa0",(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,C.jsx)("br",{})]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Or, go to ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,C.jsx)(O.ZP,{muted:!0,children:n})}),(0,C.jsx)(Z.Z,{ml:2}),Te]})})]})})},De=t(82635),Ae=t(29237),Me=t(17717),Be=t(12691),Re=t.n(Be),Ne=t(16910),Le=t(28317),Fe=t(25717),Ue=t(37391),He=t(90880),ze=6.25*P.iI,Ve=(P.iI,100*P.iI),We=m.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%);",""],K.n_,Ve,(function(e){return"\n box-shadow: ".concat((e.theme||G.Z).shadow.window,";\n background-color: ").concat((e.theme||G.Z).background.panel,";\n ")})),Ge=(0,m.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],ze,P.iI,P.cd*P.iI,(function(e){return"\n background-color: ".concat((e.theme||G.Z).background.output,";\n ")})),Ke=m.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],Ge,K.n_,K.n_,(function(e){return"\n border-bottom: ".concat(K.YF,"px ").concat(K.M8," ").concat((e.theme||G.Z).borders.medium,";\n ")})),Ye=m.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],P.iI,Ue.w5,(0,He.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*P.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*ze,"px);\n ")})),qe=m.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],Ge,K.n_,K.n_,(function(e){return"\n border-top: ".concat(K.YF,"px ").concat(K.M8," ").concat((e.theme||G.Z).borders.medium,";\n ")})),Qe=m.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*P.iI,2*P.iI,(function(e){return"\n border-bottom: ".concat(K.YF,"px ").concat(K.M8," ").concat((e.theme||G.Z).borders.medium,";\n ")}));function Je(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 Xe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Je(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Je(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $e=function(e){var n=e.blocks,t=e.creatingNewDBTModel,i=e.dbtModelName,r=e.files,o=e.onClose,l=e.onOpenFile,c=e.setDbtModelName,u=(0,s.useState)(!1),a=u[0],d=u[1],p=(0,s.useState)(null),f=p[0],v=p[1],m=(0,s.useMemo)((function(){var e,n,t=null===(e=(0,Se.sE)((null===r||void 0===r||null===(n=r[0])||void 0===n?void 0:n.children)||[],(function(e){return"dbt"===e.name})))||void 0===e?void 0:e.children,i=[];return null===t||void 0===t||t.forEach((function(e){var n=e.children,t=void 0===n?[]:n;t.length>=1&&i.push(Xe(Xe({},e),{},{children:t}))})),i}),[r]),b=(0,s.useMemo)((function(){return(0,Se.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,C.jsxs)(We,{children:[(0,C.jsxs)(Ke,{children:[(0,C.jsx)(j.Z,{alignItems:"center",children:(0,C.jsx)(O.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new dbt model":"Select dbt model or snapshot file"})}),(0,C.jsx)(T.Z,{iconOnly:!0,onClick:o,children:(0,C.jsx)(W.x8,{muted:!0})})]}),t&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Qe,{children:(0,C.jsx)(Fe.Z,{dynamicSizing:!0,inputValue:i,label:"Model name (cannot be changed):",labelColor:G.Z.accent.dbt,notRequired:!0,onBlur:function(){d(!1)},onChange:function(e){c(e.target.value),e.preventDefault()},onClick:function(){d(!0)},onFocus:function(){d(!0)},placeholder:"Enter name",required:!0,stacked:!0,suffixValue:".".concat(h.t6.SQL),value:!a&&i})}),(0,C.jsxs)(Qe,{children:[(0,C.jsx)(O.ZP,{bold:!0,color:G.Z.accent.dbt,children:"Select folder location:"}),(0,C.jsx)(O.ZP,{bold:!0,muted:!f,children:f?"dbt".concat(Me.sep).concat(f):"Choose folder below"})]})]}),(0,C.jsx)(Ye,{children:(0,C.jsx)(oe.Z,{allowSelectingFolders:t,disableContextMenu:!0,files:m,isFileDisabled:function(e,n){return t?!n||(null===n||void 0===n?void 0:n.some((function(e){return"models"===(null===e||void 0===e?void 0:e.name)}))):!!b[e]||!(null!==n&&void 0!==n&&n.length)&&!e.match(new RegExp(".".concat(h.t6.SQL,"$")))},openFile:l,selectFile:v,uncollapsed:!0,useRootFolder:!0})}),t&&(0,C.jsx)(qe,{children:(0,C.jsx)(T.Z,{backgroundColor:i&&f?G.Z.accent.dbt:G.Z.monotone.grey500,disabled:!i||!f,onClick:function(){return l(f)},padding:"6px 8px",children:"Create model"})})]})},en=t(73828),nn=t(10975),tn=t(14567),rn=t(18283),on=t(93005),ln=t(75968),cn=t(87323);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 an(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,o.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}function sn(e,n){var t,i=e.block,r=e.blocks,o=e.onClick,c=e.onDrop,u=i.type,a=(0,nn.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:i,type:on.vT}}),[i]),d=(0,l.Z)(a,3),p=d[0],f=d[1],v=(d[2],(0,tn.L)((function(){return{accept:on.vT,drop:function(e){return null===c||void 0===c?void 0:c(i,e)}}}),[i])),b=(0,l.Z)(v,2)[1],x=(0,s.useContext)(m.ThemeContext),_=(0,w.qn)(u,{blockColor:i.color,theme:x}).accent,S=(0,cn.cU)([i],r)[0],E=S.dynamic,I=S.dynamicUpstreamBlock,T=S.reduceOutput,D=S.reduceOutputUpstreamBlock,A=(0,s.useMemo)((function(){return(0,ln._o)({block:i,dynamic:E,dynamicUpstreamBlock:I,reduceOutput:T,reduceOutputUpstreamBlock:D})}),[i,E,I,T,D]).borderColorShareProps,M=(0,s.useMemo)((function(){return h.tf.DBT===(null===i||void 0===i?void 0:i.type)}),[i]);return(0,C.jsx)(Z.Z,{pb:1,ref:b,children:(0,C.jsx)(w.PY,an(an({},an(an({},A),p)),{},{ref:f,children:(0,C.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:function(){return o()},preventDefault:!0,ref:n,children:(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",flex:1,children:[(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(rn.Z,{monospace:!0,children:h.dO[i.language]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(g.Z,{color:_,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{color:_,monospace:!0,children:null===(t=M?h.tf.DBT:h.V4[i.type])||void 0===t?void 0:t.toUpperCase()})]}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsx)(W.iU,{size:1.5*P.iI}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:null===i||void 0===i?void 0:i.uuid})]}),(0,C.jsx)(Oe.Z,{appearAbove:!0,appearBefore:!0,block:!0,label:"Show ".concat(null===i||void 0===i?void 0:i.uuid," block"),size:2*P.iI,widthFitContent:!0,children:(0,C.jsx)(W.Db,{muted:!0,size:2*P.iI})})]})})})}))})}var dn,pn,fn,vn,hn=s.forwardRef(sn),mn=t(4804),bn=t(65730),gn=t(87372);!function(e){e.FULL_TABLE="FULL_TABLE",e.INCREMENTAL="INCREMENTAL",e.LOG_BASED="LOG_BASED"}(pn||(pn={})),function(e){e.IGNORE="IGNORE",e.UPDATE="UPDATE"}(fn||(fn={})),function(e){e.DATE_TIME="date-time",e.UUID="uuid"}(vn||(vn={}));var xn,jn="datetime",yn=(dn={},(0,o.Z)(dn,vn.DATE_TIME,jn),(0,o.Z)(dn,vn.UUID,vn.UUID),dn);!function(e){e.ARRAY="array",e.BOOLEAN="boolean",e.INTEGER="integer",e.NULL="null",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(xn||(xn={}));var kn,Zn,On,Pn,wn,Cn=[xn.ARRAY,xn.BOOLEAN,jn,xn.INTEGER,xn.NULL,xn.NUMBER,xn.OBJECT,xn.STRING,vn.UUID];!function(e){e.PROPERTIES="properties"}(kn||(kn={})),function(e){e.AUTOMATIC="automatic",e.AVAILABLE="available",e.UNSUPPORTED="unsupported"}(Zn||(Zn={})),function(e){e.FORCED_REPLICATION_METHOD="forced-replication-method",e.KEY_PROPERTIES="table-key-properties",e.REPLICATION_KEYS="valid-replication-keys",e.SCHEMA_NAME="schema-name"}(On||(On={})),function(e){e.AMPLITUDE="amplitude",e.BIGQUERY="bigquery",e.CHARGEBEE="chargebee",e.GOOGLE_ADS="google_ads",e.GOOGLE_SEARCH_CONSOLE="google_search_console",e.GOOGLE_SHEETS="google_sheets",e.INTERCOM="intercom",e.MYSQL="mysql",e.PIPEDRIVE="pipedrive",e.POSTGRESQL="postgresql",e.REDSHIFT="redshift",e.SALESFORCE="salesforce",e.STRIPE="stripe"}(Pn||(Pn={})),function(e){e.BIGQUERY="bigquery",e.DELTA_LAKE_S3="delta_lake_s3",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.SNOWFLAKE="snowflake"}(wn||(wn={}));var _n=t(26304),Sn=t(79891),En=t(87815),In=t(70902),Tn=t(85307),Dn=t(7715);function An(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?An(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):An(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Bn="4px",Rn=[wn.BIGQUERY,wn.DELTA_LAKE_S3];var Nn=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,r=e.isLoadingUpdateDestinationBlockState,c=e.loadSampleData,u=e.source,a=e.stream,d=e.streams,p=e.updateAllStreams,f=e.updateDestinationBlockState,v=e.updateMetadataForColumns,h=e.updateSchemaProperty,m=e.updateStream,g=(0,s.useRef)(null),x=a.bookmark_properties,k=a.destination_table,w=void 0===k?"":k,_=a.key_properties,S=a.metadata,E=a.partition_keys,I=a.replication_method,D=a.run_in_parallel,A=a.schema.properties,M=a.tap_stream_id,B=a.unique_constraints,R=a.unique_conflict_method,N=(0,s.useState)(w),L=N[0],F=N[1],H=(0,s.useState)(!1),V=H[0],W=H[1],G=(0,s.useState)(null),K=G[0],Y=G[1],q=(0,s.useState)(!1),Q=q[0],J=q[1],X=(0,s.useState)((0,o.Z)({},M,n||{})),ee=X[0],ne=X[1],te=(0,Pe.Z)(M);(0,s.useEffect)((function(){te!==M&&(F(w),Y(null))}),[w,I,M,te,R]),(0,s.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[M];(null===x||void 0===x?void 0:x.length)>0&&((0,Dn.Qr)(e)||!(0,Dn.Xy)(n,e))&&ne((function(e){return Mn(Mn({},e),{},(0,o.Z)({},M,n))}))}),[null===x||void 0===x?void 0:x.length,ee,n,M]);var ie=(0,s.useMemo)((function(){return(0,Se.HK)(S,(function(e){return e.breadcrumb.join("/")}))}),[S]),re=(0,s.useMemo)((function(){var e;return null===(e=(0,Se.sE)(S,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[S]),oe=(0,s.useMemo)((function(){return re[On.KEY_PROPERTIES]||[]}),[re]),le=(0,s.useMemo)((function(){return re[On.REPLICATION_KEYS]||[]}),[re]),ce=Rn.includes(t),ue=d.length>1,ae=(0,s.useCallback)((function(e){var n=Mn({},null===ee||void 0===ee?void 0:ee[M]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return Mn(Mn({},e),{},(0,o.Z)({},M,Mn({},n)))})),f({block:{bookmark_values:n,destination_table:L,tap_stream_id:M}})}),[ee,L,M,f]),se=(0,s.useMemo)((function(){var e=[],n=[],i=(0,Se.mr)(Object.entries(A)).map((function(i,r){var o=(0,l.Z)(i,2),c=o[0],u=o[1],a=u.anyOf,s=void 0===a?[]:a,d=u.format,f=u.type,g=void 0===f?[]:f,k=new Set(Array.isArray(g)?g:[g]),w=new Set(k);s.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){k.add(e),w.add(e)})):(k.add(t),w.add(t),n&&w.add(n))}));var S=Array.from(k);d&&w.add(d);var I=(ie["properties/".concat(c)]||{}).metadata,D=(I.inclusion,I.selected);e.push(D),n.push(c);var A=Cn.reduce((function(e,n){return S.indexOf(n)>=0||jn===String(n)&&vn.DATE_TIME===d||vn.UUID===String(n)&&vn.UUID===d?e:e.concat((0,C.jsx)("option",{value:n,children:n},n))}),[]),R=S.findIndex((function(e){return e===xn.STRING})),N=[(0,C.jsx)(b.Z,{checked:D,onClick:function(){v(M,[c],{selected:!D})}},"".concat(M,"/").concat(c,"/selected")),(0,C.jsx)(O.ZP,{children:c},"".concat(M,"/").concat(c,"/name")),(0,C.jsxs)(y.Z,{children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(y.Z,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:S.map((function(e,n){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Sn.Z,{border:!0,label:d&&xn.STRING===e&&R===n?yn[d]:e,onClick:function(){var n={format:d,type:S.filter((function(n){return n!==e}))};vn.DATE_TIME!==d&&vn.UUID!==d||xn.STRING!==e||(n.format=null),h(M,c,n)},small:!0})},"".concat(M,"/").concat(c,"/").concat(e,"/").concat(n,"/chip"))}))})}),A.length>=1&&(0,C.jsxs)(U.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:d,type:S};jn===String(n)?(t.format=vn.DATE_TIME,t.type.push(xn.STRING)):vn.UUID===String(n)?(t.format=vn.UUID,t.type.push(xn.STRING)):t.type.push(n),h(M,c,t)},primary:!0,small:!0,value:"",width:10*P.iI,children:[(0,C.jsx)("option",{value:""}),A]})]},"".concat(M,"/").concat(c,"/type")),(0,C.jsx)(b.Z,{checked:!(null===B||void 0===B||!B.includes(c)),disabled:oe.length>=1&&!oe.includes(c),onClick:oe.length>=1&&!oe.includes(c)?null:function(){return m(M,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(c)?e.unique_constraints=(0,Se.Od)(e.unique_constraints,(function(e){return c===e})):e.unique_constraints=[c].concat(e.unique_constraints||[]),e}))}},"".concat(M,"/").concat(c,"/unique")),(0,C.jsx)(b.Z,{checked:!(null===x||void 0===x||!x.includes(c)),disabled:le.length>=1&&!le.includes(c),onClick:le.length>=1&&!le.includes(c)?null:function(){return m(M,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(c)?(ae(c),e.bookmark_properties=(0,Se.Od)(e.bookmark_properties,(function(e){return c===e}))):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),e}))}},"".concat(M,"/").concat(c,"/bookmark")),(0,C.jsx)(b.Z,{checked:!(null===_||void 0===_||!_.includes(c)),onClick:function(){return m(M,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(c)?e.key_properties=(0,Se.Od)(e.key_properties,(function(e){return c===e})):e.key_properties=[c].concat(e.key_properties||[]),e}))}},"".concat(M,"/").concat(c,"/key_property"))];if(ce){var L=t!==wn.DELTA_LAKE_S3,F=L&&(oe.includes(c)||!w.has(vn.DATE_TIME));N.push((0,C.jsx)(b.Z,{checked:!(null===E||void 0===E||!E.includes(c)),disabled:F,onClick:F?null:function(){return m(M,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(c)?e.partition_keys=(0,Se.Od)(e.partition_keys,(function(e){return c===e})):L&&1===(null===(t=e.partition_keys)||void 0===t?void 0:t.length)?e.partition_keys=[c]:e.partition_keys=[c].concat(e.partition_keys||[]);return e}))}},"".concat(M,"/").concat(c,"/partition_key")))}if(ue){var H=K===r;N.push((0,C.jsx)(T.Z,{compact:!0,disabled:H,onClick:function(){Y(r),setTimeout((function(){return Y(null)}),2e3),p((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==M&&null!==e&&void 0!==e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[c]){var i,r,o,l,u,a,s,p,f;e.schema.properties[c]={format:d||null,type:S};var v=null===(i=(0,Se.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=v[On.REPLICATION_KEYS]||[],m=v[On.KEY_PROPERTIES]||[];null===B||void 0===B||!B.includes(c)||null!==e&&void 0!==e&&null!==(r=e.unique_constraints)&&void 0!==r&&r.includes(c)||!m.includes(c)?null!==B&&void 0!==B&&B.includes(c)||null===e||void 0===e||null===(o=e.unique_constraints)||void 0===o||!o.includes(c)||(e.unique_constraints=(0,Se.Od)(e.unique_constraints,(function(e){return c===e}))):e.unique_constraints=[c].concat(e.unique_constraints||[]),null===x||void 0===x||!x.includes(c)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(c)||!h.includes(c)?null!==x&&void 0!==x&&x.includes(c)||null===e||void 0===e||null===(u=e.bookmark_properties)||void 0===u||!u.includes(c)||(e.bookmark_properties=(0,Se.Od)(e.bookmark_properties,(function(e){return c===e}))):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),null===_||void 0===_||!_.includes(c)||null!==e&&void 0!==e&&null!==(a=e.key_properties)&&void 0!==a&&a.includes(c)?null!==_&&void 0!==_&&_.includes(c)||null===e||void 0===e||null===(s=e.key_properties)||void 0===s||!s.includes(c)||(e.key_properties=(0,Se.Od)(e.key_properties,(function(e){return c===e}))):e.key_properties=[c].concat(e.key_properties||[]),null===E||void 0===E||!E.includes(c)||null!==e&&void 0!==e&&null!==(p=e.partition_keys)&&void 0!==p&&p.includes(c)?null!==E&&void 0!==E&&E.includes(c)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(c)||(e.partition_keys=(0,Se.Od)(e.partition_keys,(function(e){return c===e}))):e.partition_keys=[c].concat(e.partition_keys||[])}return Mn({},e)}))},pill:!0,secondary:!0,children:(0,C.jsx)(O.ZP,{success:H,children:H?"Applied!":"Apply"})}))}return N})),r=e.every((function(e){return e})),o=[null,2,1,null,null,null],c=[{label:function(){return(0,C.jsx)(b.Z,{checked:r,onClick:function(){v(M,n,{selected:!r})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{uuid:"Unique"},{uuid:"Bookmark"},{uuid:"Key prop"}];return ce&&(o.push(null),c.push({uuid:"Partition key"})),ue&&(o.push(null),c.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,C.jsx)(Tn.cl,{children:(0,C.jsx)(En.Z,{alignTop:!0,columnFlex:o,columns:c,rows:i,stickyHeader:!0})})}),[x,t,ue,K,_,ie,E,A,ae,ce,M,B,p,v,h,m,oe,le]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(gn.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,C.jsx)(gn.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:M})," schema"]}),(0,C.jsx)(Z.Z,{mb:3,children:(0,C.jsx)(Ae.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{children:"Destination table name"}),(0,C.jsx)(Z.Z,{ml:Bn}),(0,C.jsx)(Oe.Z,{label:(0,C.jsxs)(O.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:M}),". To change the table name, enter in a different value."]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(z.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;F(n),clearTimeout(g.current),g.current=setTimeout((function(){m(M,(function(e){return Mn(Mn({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*P.iI})]})})}),(0,C.jsx)(Z.Z,{mb:3,children:(0,C.jsx)(Ae.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{children:"Replication method"}),(0,C.jsx)(Z.Z,{ml:Bn}),(0,C.jsx)(Oe.Z,{label:(0,C.jsxs)(O.ZP,{children:["Do you want to synchronize the entire stream (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:pn.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:pn.INCREMENTAL}),")?",u===Pn.POSTGRESQL&&(0,C.jsxs)(O.ZP,{children:["Log-based incremental replication (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:pn.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsxs)(U.Z,{compact:!0,onChange:function(e){m(M,(function(n){return Mn(Mn({},n),{},{replication_method:e.target.value})}))},primary:!0,value:I,children:[(0,C.jsx)("option",{value:""}),Object.values(pn).filter((function(e){return u===Pn.POSTGRESQL||e!==pn.LOG_BASED})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))]}),(0,C.jsx)(Z.Z,{ml:3}),(0,C.jsx)(O.ZP,{children:"Unique conflict method"}),(0,C.jsx)(Z.Z,{ml:Bn}),(0,C.jsx)(Oe.Z,{label:(0,C.jsxs)(O.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,$._6)("column",null===B||void 0===B?void 0:B.length),(null===B||void 0===B?void 0:B.length)>0&&(0,C.jsx)(C.Fragment,{children:"\xa0"}),null===B||void 0===B?void 0:B.sort().map((function(e,n){return(0,C.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===B||void 0===B?void 0:B.length)&&n===(null===B||void 0===B?void 0:B.length)-1?(0,C.jsx)(O.ZP,{inline:!0,children:" and "},e):n>=1&&(0,C.jsx)(C.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:fn.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:fn.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsxs)(U.Z,{compact:!0,inputWidth:11*P.iI,onChange:function(e){m(M,(function(n){return Mn(Mn({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:R,children:[(0,C.jsx)("option",{value:""}),(0,C.jsx)("option",{value:fn.IGNORE,children:fn.IGNORE}),(0,C.jsx)("option",{value:fn.UPDATE,children:fn.UPDATE})]})]}),ue&&(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{default:!0,children:"All streams"}),(0,C.jsx)(Z.Z,{ml:Bn}),(0,C.jsx)(Oe.Z,{appearBefore:!0,label:(0,C.jsx)(O.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(T.Z,{compact:!0,disabled:V,onClick:function(){W(!0),setTimeout((function(){return W(!1)}),2e3),p((function(e){return Mn(Mn({},e),{},{replication_method:I,unique_conflict_method:R})}))},pill:!0,secondary:!0,children:(0,C.jsx)(O.ZP,{bold:!V,success:V,children:V?"Applied!":"Apply"})})]})]})})}),(0,C.jsx)(Ae.Z,{headerTitle:"Features",noPadding:!0,children:se}),(0,C.jsx)(Z.Z,{mt:2,children:(0,C.jsx)(T.Z,{loading:i,onClick:function(){return c(M)},primary:!0,small:!0,children:"Load sample data"})}),(0,C.jsxs)(Z.Z,{mt:5,children:[(0,C.jsx)(gn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,C.jsx)(Z.Z,{mb:5,children:(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,C.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,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(In.Z,{checked:D,onCheck:function(){return m(M,(function(e){return e.run_in_parallel=!D,e}))}},"".concat(M,"/run_in_parallel"))]})}),pn.INCREMENTAL===I&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,C.jsxs)(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.",(0,C.jsx)("br",{}),"On the next run, the synchronization will start after the bookmarked record."]})]}),(0,C.jsxs)(y.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==x&&void 0!==x&&x.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===x||void 0===x?void 0:x.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Sn.Z,{label:e,onClick:function(){ae(e),m(M,(function(n){return Mn(Mn({},n),{},{bookmark_properties:(0,Se.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===x||void 0===x?void 0:x.length)>0&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{my:2,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),(0,C.jsx)(O.ZP,{default:!0,children:'In order to override the bookmark values for the next sync, you must first select a destination. Then click the toggle to edit the values for the bookmark properties in the table below. Click the "Save" button to save your changes.'})]}),(0,C.jsx)(In.Z,{checked:Q,disabled:!t,onCheck:function(){return J((function(e){return!e}))}})]})}),Q&&!!t&&(0,C.jsx)(Ae.Z,{header:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,C.jsx)(T.Z,{compact:!0,loading:r,onClick:function(){f({block:{bookmark_values:(null===ee||void 0===ee?void 0:ee[M])||{},destination_table:L,tap_stream_id:M}})},pill:!0,secondary:!0,children:"Save"})]}),headerPaddingVertical:P.iI,noPadding:!0,overflowVisible:!0,children:(0,C.jsx)(En.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Bookmark property"},{uuid:"Value"}],rows:x.map((function(e){var n;return[(0,C.jsx)(O.ZP,{default:!0,monospace:!0,children:e},e),(0,C.jsx)(z.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return Mn(Mn({},t),{},(0,o.Z)({},M,Mn(Mn({},t[M]),{},(0,o.Z)({},e,n.target.value))))}))},paddingHorizontal:0,placeholder:"Enter value",value:null===ee||void 0===ee||null===(n=ee[M])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,C.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,C.jsxs)(y.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==B&&void 0!==B&&B.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===B||void 0===B?void 0:B.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Sn.Z,{label:e,onClick:function(){m(M,(function(n){return Mn(Mn({},n),{},{unique_constraints:(0,Se.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,C.jsx)(O.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,C.jsxs)(y.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==_&&void 0!==_&&_.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===_||void 0===_?void 0:_.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Sn.Z,{label:e,onClick:function(){m(M,(function(n){return Mn(Mn({},n),{},{key_properties:(0,Se.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ce&&(0,C.jsxs)(Z.Z,{mb:3,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,C.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,C.jsxs)(y.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==E&&void 0!==E&&E.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===E||void 0===E?void 0:E.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Sn.Z,{label:e,onClick:function(){m(M,(function(n){return Mn(Mn({},n),{},{partition_keys:(0,Se.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Ln=["catalog","pipeline","setErrors","setSelectedStream"];function Fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Un(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Hn,zn=function(e){var n,t=e.catalog,i=e.pipeline,r=e.setErrors,o=e.setSelectedStream,c=(0,_n.Z)(e,Ln),u=(0,s.useState)(null),a=u[0],p=u[1],f=(0,s.useMemo)((function(){return(null===t||void 0===t?void 0:t.streams)||[]}),[t]),v=(0,s.useMemo)((function(){return(0,Se.YC)(f,"stream").map((function(e){return{uuid:e.stream}}))}),[f]),m=(0,s.useMemo)((function(){return(0,Se.HK)(f,(function(e){return e.stream}))}),[f]),b=(0,s.useMemo)((function(){return m[null===a||void 0===a?void 0:a.uuid]}),[a,m]),g=(0,s.useMemo)((function(){return(0,Se.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n}))}),[null===i||void 0===i?void 0:i.blocks]),x=b||{},j=x.destination_table,y=x.tap_stream_id,k=!(!y||!j),P=V.ZP.blocks.pipelines.detail(k?null===i||void 0===i?void 0:i.uuid:null,k?null===g||void 0===g?void 0:g.uuid:null,{destination_table:j,state_stream:y}),w=P.data,_=P.mutate,S=null===w||void 0===w||null===(n=w.block)||void 0===n?void 0:n.bookmarks,E=(0,d.Db)(V.ZP.blocks.pipelines.useUpdate(null===i||void 0===i?void 0:i.uuid,null===g||void 0===g?void 0:g.uuid,{query:{update_state:!0}}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){null===_||void 0===_||_()},onErrorCallback:function(e,n){return null===r||void 0===r?void 0:r({errors:n,response:e})}})}}),I=(0,l.Z)(E,2),T=I[0],A=I[1].isLoading;(0,s.useEffect)((function(){v.length>0&&(a&&(0,Se.sE)(v,(function(e){var n=e.uuid;return a.uuid===n}))||p(v[0]))}),[a,p,v]);var M=(0,s.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,C.jsx)(Tn.cl,{children:(0,C.jsx)(En.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:f.map((function(e){var n=e.replication_method,t=e.destination_table,i=e.bookmark_properties,r=e.key_properties,o=e.metadata,l=e.unique_constraints,c=e.unique_conflict_method,u=e.partition_keys,a=e.tap_stream_id,s=o.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,r=(null===t||void 0===t?void 0:t.length)>0,o=i&&r?1:0,l=r?1:0;return{selectedCount:e.selectedCount+o,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,C.jsx)(O.ZP,{children:"".concat(s.selectedCount," of ").concat(s.totalCount," total")},"".concat(a,"_col_selected")),p=[a,n,t,i,r,l,c,u].map((function(e,n){return(0,C.jsx)(O.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(a,"_cell_").concat(n))}));return p.slice(0,1).concat(d).concat(p.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[f]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(D.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){p(e),o(e.uuid)},selectedTabUUID:null===a||void 0===a?void 0:a.uuid,tabs:v}),b&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(Tn.dE,{children:(0,C.jsx)(Nn,Un(Un({},c),{},{bookmarkValues:S,isLoadingUpdateDestinationBlockState:A,stream:b,streams:f,updateDestinationBlockState:T}))})}),f.length>=1&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(Tn.dE,{children:[(0,C.jsx)(gn.Z,{level:4,children:"Streams Summary"}),(0,C.jsx)(Z.Z,{mt:1}),M]})})]})},Vn=t(30264),Wn=t(18776);function Gn(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.ALL="All",e.SELECTED="Selected",e.NOT_SELECTED="Not selected"}(Hn||(Hn={}));var qn=45*P.iI,Qn=qn-4*P.iI;var Jn=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,r=e.streams,l=(0,Se.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),c=(0,s.useMemo)((function(){var e=new Set(r.map((function(e){return e.stream})));return Object.values(l).filter((function(n){var t=n.stream;return!e.has(t)})).map((function(e){return Yn(Yn({},e),{},{isMissingStream:!0})}))}),[l,r]),u=Yn({},l);c.forEach((function(e){var n=e.stream;delete u[n]}));var a=(0,s.useState)(u),d=a[0],p=a[1],f=(0,s.useState)(null),v=f[0],h=f[1],m=(0,s.useState)(!1),g=m[0],j=m[1],k=(0,s.useState)(Hn.ALL),w=k[0],_=k[1],S=(0,s.useRef)(null),E=Gn(d),I=(0,s.useMemo)((function(){var e=r;return e=e.filter((function(e){var n=e.tap_stream_id;return w===Hn.SELECTED?E.includes(n):w!==Hn.NOT_SELECTED||!E.includes(n)})),v?e.filter((function(e){var n=e.tap_stream_id;return null===n||void 0===n?void 0:n.toLowerCase().includes(null===v||void 0===v?void 0:v.toLowerCase())})):e}),[w,v,E,r]),D=(0,s.useMemo)((function(){return r.every((function(e){var n=e.stream;return!!d[n]}))}),[d,r]);return(0,C.jsxs)(Wn.Z,{children:[(0,C.jsx)(Tn.cv,{rounded:!0,children:(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,C.jsx)(Tn.cv,{padding:1.25*P.iI,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(z.Z,{beforeIcon:(0,C.jsx)(W.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return h(e.target.value)},placeholder:"Search",value:v}),(0,C.jsx)(Z.Z,{pr:1,children:(0,C.jsx)(Vn.Z,{items:[{label:function(){return Hn.ALL},onClick:function(){return _(Hn.ALL)},uuid:"all_streams"},{label:function(){return Hn.SELECTED},onClick:function(){return _(Hn.SELECTED)},uuid:"selected"},{label:function(){return Hn.NOT_SELECTED},onClick:function(){return _(Hn.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return j(!1)},onClickOutside:function(){return j(!1)},open:g,parentRef:S,uuid:"SelectStreams/filter",children:(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(W.wn,{}),noBackground:!0,onClick:function(){return j((function(e){return!e}))},ref:S,children:(0,C.jsx)(O.ZP,{children:w})})})})]})}),(0,C.jsx)(Tn.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(qn,"px"),children:(0,C.jsx)(En.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,C.jsx)(b.Z,{checked:D,onClick:function(){var e=(0,Se.HK)(r||[],(function(e){return e.stream}));p(D?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:I.concat(c).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!d[t];return[(0,C.jsx)(b.Z,{checked:i,disabled:!i&&n,onClick:function(){p((function(n){return Yn(Yn({},n),{},(0,o.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,C.jsxs)(O.ZP,{danger:n,title:t,width:qn-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,C.jsx)(x.Z,{medium:!0}),(0,C.jsxs)(Z.Z,{p:2,children:[(null===E||void 0===E?void 0:E.length)>50&&(0,C.jsx)(Z.Z,{pb:2,children:(0,C.jsxs)(O.ZP,{danger:!0,maxWidth:Qn,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,C.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===r||void 0===r?void 0:r.length)&&(0,C.jsx)(Z.Z,{pb:2,children:(0,C.jsx)(O.ZP,{bold:!0,maxWidth:Qn,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,C.jsx)(y.Z,{justifyContent:"flex-end",children:(0,C.jsx)(T.Z,{loading:t,onClick:function(){return i(d)},primary:!0,children:"Confirm ".concat(Gn(d).length," streams")})})]})]})},Xn=t(57722);function $n(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 et(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$n(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$n(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var nt=function(e){var n=e.api,t=e.block,i=e.blockContent,r=e.onChangeCodeBlock,c=e.pipeline,u=(0,s.useState)(null),a=u[0],p=u[1];(0,s.useEffect)((function(){i&&!a&&p((0,mn.Pz)(null===i||void 0===i?void 0:i.config))}),[a,i]);var f=(0,s.useState)(null),v=f[0],m=f[1],b=(0,s.useState)(),g=b[0],x=b[1],j=(0,d.Db)(V.ZP[n].useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var t,i,r=(0,$.C5)(n);m(null===e||void 0===e||null===(t=e[r])||void 0===t?void 0:t.success),x(null===e||void 0===e||null===(i=e[r])||void 0===i?void 0:i.error_message)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),k=(0,l.Z)(j,2),P=k[0],w=k[1].isLoading;return t?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Tn.$W,{children:(0,C.jsx)(Xn.Z,{autoHeight:!0,language:h.t6.YAML,onChange:function(e){p(e),r(t.type,t.uuid,(0,mn.Pz)(et(et({},i),{},{config:(0,mn.Qc)(e)})))},tabSize:2,value:a||void 0,width:"100%"})}),(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(T.Z,{onClick:function(){P((0,o.Z)({},(0,$.C5)(n),{action_type:"test_connection",config:a,pipeline_uuid:c.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,C.jsx)(Z.Z,{ml:1,children:w?(0,C.jsx)(H.Z,{color:"white",small:!0}):(0,C.jsxs)(C.Fragment,{children:[v&&(0,C.jsx)(O.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===v&&(0,C.jsx)(O.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),g&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(O.ZP,{small:!0,warning:!0,children:g})})]})]}):null},tt=t(60701);function it(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function rt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?it(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):it(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ot=function(e){var n,t,i,r=e.addNewBlockAtIndex,o=e.blocks,c=e.codeBlocks,u=e.fetchFileTree,a=e.fetchPipeline,p=e.fetchSampleData,f=e.globalVariables,v=e.onChangeCodeBlock,m=e.openSidekickView,b=e.pipeline,g=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,w=e.setOutputBlocks,_=e.setSelectedBlock,S=e.setSelectedOutputBlock,E=e.setSelectedStream,I=(0,s.useState)(!0),D=I[0],A=I[1],M=(0,s.useState)(!0),B=M[0],R=M[1],N=(0,s.useState)(!0),L=N[0],F=N[1],z=V.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,G=(0,s.useMemo)((function(){return(null===z||void 0===z?void 0:z.integration_sources)||[]}),[z]),K=(0,s.useMemo)((function(){return(0,Se.HK)(G,(function(e){return e.uuid}))}),[G]),Y=V.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,q=(0,s.useMemo)((function(){return(null===Y||void 0===Y?void 0:Y.integration_destinations)||[]}),[Y]),Q=(0,s.useMemo)((function(){return(0,Se.HK)(q,(function(e){return e.uuid}))}),[q]),J=(0,s.useMemo)((function(){return(0,Se.sE)(o,(function(e){var n=e.type;return h.tf.DATA_LOADER===n}))}),[o]),X=(0,s.useMemo)((function(){return J?(0,mn.Qc)(J.content):{}}),[J]),$=(0,s.useMemo)((function(){return(0,C.jsx)(nt,{api:"integration_sources",block:J,blockContent:X,onChangeCodeBlock:v,pipeline:b})}),[J,X,v,b]),ne=(0,s.useMemo)((function(){return(0,Se.sE)(o,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n}))}),[o]),te=(0,s.useMemo)((function(){return ne?(0,mn.Qc)(ne.content):{}}),[ne]),ie=(0,s.useMemo)((function(){return(0,C.jsx)(nt,{api:"integration_destinations",block:ne,blockContent:te,onChangeCodeBlock:v,pipeline:b})}),[ne,te,v,b]),re=(0,s.useMemo)((function(){return(0,Se.sE)(o,(function(e){var n=e.type;return h.tf.TRANSFORMER===n}))}),[o]),oe=(0,s.useMemo)((function(){var e;return(0,Dn.Qr)(null===X||void 0===X?void 0:X.catalog)?null===b||void 0===b||null===(e=b.data_integration)||void 0===e?void 0:e.catalog:null===X||void 0===X?void 0:X.catalog}),[X,null===b||void 0===b||null===(n=b.data_integration)||void 0===n?void 0:n.catalog]),le=((null===oe||void 0===oe?void 0:oe.streams)||[]).every((function(e){return e.auto_add_new_fields})),ce=((null===oe||void 0===oe?void 0:oe.streams)||[]).every((function(e){return e.disable_column_type_check})),ue=(0,Pe.Z)(oe);(0,s.useEffect)((function(){!ue&&oe&&(w((function(){return S(J),[J]})),j((function(e){var n;return e||(null===oe||void 0===oe||null===(n=oe.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[oe]);var ae=(0,s.useState)(),se=ae[0],de=ae[1],pe=(0,d.Db)(V.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];w((function(){return S(J),[J]})),t.length>0&&E(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),m(tt.cH.DATA),p()}else de(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),fe=(0,l.Z)(pe,2),ve=fe[0],he=fe[1].isLoading,me=(0,d.Db)(V.ZP.integration_sources.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,r=((null===oe||void 0===oe?void 0:oe.streams)||[]).filter((function(e){var n=e.tap_stream_id;return t.includes(n)})),o=r.map((function(e){return e.tap_stream_id})),l=i.filter((function(e){var n=e.tap_stream_id;return t.includes(n)&&!o.includes(n)}));l.forEach((function(e){e.metadata.forEach((function(n,t){var i=n.metadata;if(Zn.UNSUPPORTED!==i.inclusion){var r;if(e.replication_method||(e.replication_method=pn.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=fn.UPDATE),!e.destination_table)e.destination_table=null===e||void 0===e||null===(r=e.tap_stream_id)||void 0===r?void 0:r.replace(/\W+/g,"_");e.metadata[t]=rt(rt({},n),{},{metadata:rt(rt({},i),{},{selected:!0})})}}))}));var c={streams:r.concat(l)};j(Ne.map((function(e){return e.tap_stream_id})));var s=null===X||void 0===X?void 0:X.catalog;(0,Dn.Qr)(s)||v(J.type,J.uuid,(0,mn.Pz)(rt(rt({},X),{},{catalog:{}})));var d={pipeline:rt(rt({},b),{},{data_integration:rt(rt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:c})})};g(d).then((function(){a(),u()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),be=(0,l.Z)(me,2),ge=be[0],xe=be[1].isLoading,je=(0,s.useState)(null),ye=je[0],ke=je[1],Ze=(0,d.Db)(V.ZP.integration_source_streams.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){ke(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Oe=(0,l.Z)(Ze,2),we=Oe[0],Ce=Oe[1].isLoading,_e=(0,s.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}}(oe,e),i=t.stream,r=t.streams,o=rt(rt({},oe),{},{streams:r.concat(n(i))}),l=null===X||void 0===X?void 0:X.catalog;(0,Dn.Qr)(l)||v(J.type,J.uuid,(0,mn.Pz)(rt(rt({},X),{},{catalog:{}})));var c={pipeline:rt(rt({},b),{},{data_integration:rt(rt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:o})})};g(c).then((function(){return a()}))}),[oe,J,X,a,v,b,g]),Ee=(0,s.useCallback)((function(e){if(null!==oe&&void 0!==oe&&oe.streams){var n=rt(rt({},oe),{},{streams:oe.streams.map((function(n){return e(n)}))}),t=null===X||void 0===X?void 0:X.catalog;(0,Dn.Qr)(t)||v(J.type,J.uuid,(0,mn.Pz)(rt(rt({},X),{},{catalog:{}})));var i={pipeline:rt(rt({},b),{},{data_integration:rt(rt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return a()}))}}),[oe,J,X,a,v,b,g]),Te=(0,s.useCallback)((function(e,n,t){_e(e,(function(e){return e.schema.properties[n]=t,e}))}),[_e]),De=(0,s.useCallback)((function(e,n,t){_e(e,(function(e){var i=e.metadata;return n.forEach((function(n){var r=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(r>=0){var o=i[r].metadata;e.metadata[r].metadata=rt(rt({},o),t)}})),e}))}),[_e]),Ae=(0,d.Db)(V.ZP.blocks.pipelines.useUpdate(null===b||void 0===b?void 0:b.uuid,null===ne||void 0===ne?void 0:ne.uuid),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){null===a||void 0===a||a()},onErrorCallback:function(e,n){return null===x||void 0===x?void 0:x({errors:n,response:e})}})}}),Me=(0,l.Z)(Ae,1)[0],Be=(0,s.useMemo)((function(){var e=[];return null===f||void 0===f||f.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,r="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,C.jsx)(O.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,C.jsx)(O.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,C.jsx)(O.ZP,{monospace:!0,children:r},"variable-uuid-".concat(t,"-{value}-code")),(0,C.jsx)(bn.Z,{copiedText:r,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,C.jsx)(En.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[f]),Re=(0,s.useCallback)((function(e){return(0,C.jsxs)(Z.Z,{mt:2,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,C.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,C.jsx)("br",{}),"For more information, check out the ",(0,C.jsx)(k.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,C.jsx)(Z.Z,{mt:1,children:Be})]})}),[Be]),Ne=(0,s.useMemo)((function(){return(null===ye||void 0===ye?void 0:ye.streams)||[]}),[ye]),Fe=(0,Ie.dd)((function(){return(0,C.jsx)(Jn,{catalog:oe,isLoading:xe,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)ge({integration_source:{streams:n}}),ze();else{var t=null===X||void 0===X?void 0:X.catalog;(0,Dn.Qr)(t)||v(J.type,J.uuid,(0,mn.Pz)(rt(rt({},X),{},{catalog:{}}))),g({pipeline:rt(rt({},b),{},{data_integration:rt(rt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:null})})}).then((function(){return a()})),ze()}},streams:Ne})}),{},[oe,J,X,a,xe,v,g,Ne],{background:!0,uuid:"select_streams"}),Ue=(0,l.Z)(Fe,2),He=Ue[0],ze=Ue[1];return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(T.Z,{iconOnly:!0,onClick:function(){return R((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[B&&(0,C.jsx)(W.Kh,{size:1.5*P.iI}),!B&&(0,C.jsx)(W._M,{size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(gn.Z,{children:"Source"}),!B&&(0,C.jsxs)(gn.Z,{default:!0,inline:!0,children:["\xa0",null===(t=K[null===X||void 0===X?void 0:X.source])||void 0===t?void 0:t.name]})]})]})}),B&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Tn.dE,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(gn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===G||void 0===G?void 0:G.length)>0?(0,C.jsxs)(U.Z,{onChange:function(e){var n,t,i=e.target.value;if(i){var o=null===(n=K[i])||void 0===n||null===(t=n.templates)||void 0===t?void 0:t.config;o&&Object.keys(o).forEach((function(e){o[e]=o[e]||null})),J?v(J.type,J.uuid,(0,mn.Pz)(rt(rt({},X),{},{catalog:{},config:o,source:i}))):r({content:(0,mn.Pz)({config:o,source:i}),language:h.t6.YAML,type:h.tf.DATA_LOADER},0,_),ke(null),g().then((function(){a()}))}},primary:!0,value:null===X||void 0===X?void 0:X.source,children:[(0,C.jsx)("option",{value:""}),G.map((function(e){var n=e.name,t=e.uuid;return(0,C.jsx)("option",{value:t,children:n},t)}))]}):(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(H.Z,{inverted:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(gn.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),J&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(gn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===X||void 0===X?void 0:X.source)&&(0,C.jsxs)(Z.Z,{mb:2,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["For more information on how to configure this source, read the ",(0,C.jsxs)(k.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/sources/".concat(X.source,"/README.md"),openNewWindow:!0,primary:!0,children:[X.source," documentation"]})]}),Re("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),$]}),(0,C.jsxs)("div",{children:[(0,C.jsx)(gn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,C.jsx)(T.Z,{loading:Ce,onClick:function(){g().then((function(){we().then((function(){return He()})),a()}))},primary:!0,small:!0,children:"View and select streams"})]}),se&&(0,C.jsx)(O.ZP,{warning:!0,children:se})]})]}),xe&&(0,C.jsx)(Z.Z,{p:2,children:(0,C.jsx)(H.Z,{})}),!xe&&(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsx)(zn,{catalog:oe,destination:null===te||void 0===te?void 0:te.destination,isLoadingLoadSampleData:he,loadSampleData:function(e){return ve({integration_source:{action_type:"sample_data",pipeline_uuid:null===b||void 0===b?void 0:b.uuid,streams:[e]}})},pipeline:b,setErrors:x,setSelectedStream:E,source:null===X||void 0===X?void 0:X.source,updateAllStreams:Ee,updateMetadataForColumns:De,updateSchemaProperty:Te,updateStream:_e})})]}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(T.Z,{disabled:!J,iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[L&&J&&(0,C.jsx)(W.Kh,{size:1.5*P.iI}),(!L||!J)&&(0,C.jsx)(W._M,{disabled:!J,size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(y.Z,{alignItems:"center",children:(0,C.jsx)(gn.Z,{children:"Transformers"})})]})}),L&&J&&(0,C.jsx)(Z.Z,{mb:5,children:(0,C.jsxs)(Tn.dE,{children:[c.length>0&&(0,C.jsx)(Z.Z,{mb:1,children:c.map((function(e,n){return(0,C.jsx)(Z.Z,{mb:1,children:e},n)}))}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(Le.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return J&&i.push(J.uuid),r(rt(rt({},e),{},{configuration:t,content:n,upstream_blocks:i}),o.length-1,(function(e){ne&&(Me({block:rt(rt({},ne),{},{upstream_blocks:[e.uuid]})}),_(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!re,hideTransformerDataSources:!0,pipeline:b})})]})}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(T.Z,{disabled:!J,iconOnly:!0,onClick:function(){return A((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[D&&J&&(0,C.jsx)(W.Kh,{size:1.5*P.iI}),(!D||!J)&&(0,C.jsx)(W._M,{disabled:!J,size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(gn.Z,{children:"Destination"}),!D&&(0,C.jsxs)(gn.Z,{default:!0,inline:!0,children:["\xa0",null===(i=Q[null===te||void 0===te?void 0:te.destination])||void 0===i?void 0:i.name]})]})]})}),D&&J&&(0,C.jsxs)(Tn.dE,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(gn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===q||void 0===q?void 0:q.length)>0?(0,C.jsxs)(U.Z,{onChange:function(e){var n=e.target.value;if(n){if(ne)v(ne.type,ne.uuid,(0,mn.Pz)(rt(rt({},te),{},{destination:n})));else{var t,i,l=null===(t=Q[n])||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})),l.hasOwnProperty("table")&&delete l.table);var c=[];if((null===o||void 0===o?void 0:o.length)>=2){var u=o.find((function(e){var n=e.uuid;return(null===J||void 0===J?void 0:J.uuid)!==n}));u&&c.push(u.uuid)}else J&&c.push(J.uuid);r({content:(0,mn.Pz)({config:l,destination:n}),language:h.t6.YAML,type:h.tf.DATA_EXPORTER,upstream_blocks:c},1,_)}g().then((function(){a()}))}},primary:!0,value:null===te||void 0===te?void 0:te.destination,children:[(0,C.jsx)("option",{value:""}),q.map((function(e){var n=e.name,t=e.uuid;return(0,C.jsx)("option",{value:t,children:n},t)}))]}):(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(H.Z,{inverted:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(gn.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),ne&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(gn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===te||void 0===te?void 0:te.destination)&&(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)(Z.Z,{mb:2,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,C.jsxs)(k.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(te.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[te.destination," documentation"]}),".",(0,C.jsx)("br",{}),(0,C.jsx)("br",{}),"If your configuration contains a key named ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,C.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,C.jsx)(O.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Re("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),ie,(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,C.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,C.jsx)(In.Z,{checked:!!le,disabled:!(null!==oe&&void 0!==oe&&oe.streams),onCheck:function(){return Ee((function(e){return rt(rt({},e),{},{auto_add_new_fields:!le})}))}})]})}),(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,C.jsxs)(O.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,C.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,C.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,C.jsx)(In.Z,{checked:!!ce,disabled:!(null!==oe&&void 0!==oe&&oe.streams),onCheck:function(){return Ee((function(e){return rt(rt({},e),{},{disable_column_type_check:!ce})}))}})]})})]})]})]})},lt=t(46336),ct=t(42451),ut=t(84212),at=t(51504);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 dt(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,o.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 pt=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.allBlocks,c=e.allowCodeBlockShortcuts,u=e.anyInputFocused,a=e.autocompleteItems,p=e.blockRefs,f=e.blocks,v=void 0===f?[]:f,m=e.dataProviders,b=e.deleteBlock,g=e.disableShortcuts,x=e.fetchFileTree,j=e.fetchPipeline,y=e.fetchSampleData,w=e.files,_=e.globalDataProducts,S=e.globalVariables,E=e.hiddenBlocks,I=e.interruptKernel,T=e.mainContainerRef,D=e.mainContainerWidth,B=e.messages,N=e.onChangeCallbackBlock,L=e.onChangeCodeBlock,U=e.openSidekickView,H=e.pipeline,z=e.pipelineContentTouched,W=e.project,G=e.restartKernel,K=e.runBlock,Y=e.runningBlocks,q=void 0===Y?[]:Y,Q=e.savePipelineContent,J=e.selectedBlock,X=e.setAnyInputFocused,ne=e.setDisableShortcuts,te=e.setEditingBlock,ie=e.setErrors,re=e.setIntegrationStreams,oe=e.setHiddenBlocks,le=e.setOutputBlocks,ue=e.setPipelineContentTouched,se=e.setSelectedBlock,de=e.setSelectedOutputBlock,fe=e.setSelectedStream,ve=e.setTextareaFocused,he=e.showBrowseTemplates,me=e.showConfigureProjectModal,be=e.showGlobalDataProducts,ge=e.textareaFocused,xe=e.widgets,je=(0,s.useRef)(null),ye=(0,s.useState)(!1),ke=ye[0],Ze=ye[1],Oe=(0,s.useState)(!1),we=Oe[0],_e=Oe[1],Ee=(0,s.useState)(!1),Ie=Ee[0],Te=Ee[1],Ae=(0,s.useState)(!0),Be=Ae[0],Fe=Ae[1],Ue=(0,s.useState)(null),He=Ue[0],ze=Ue[1],Ve=(0,s.useState)(null),We=Ve[0],Ge=Ve[1],Ke=(0,s.useState)(!1),Ye=Ke[0],qe=Ke[1],Qe=(0,s.useState)(""),Je=Qe[0],Xe=Qe[1],nn=(0,s.useMemo)((function(){return q.reduce((function(e,n,t){return dt(dt({},e),{},(0,o.Z)({},n.uuid,dt(dt({},n),{},{priority:t})))}),{})}),[q]),tn=(0,Pe.Z)(J),rn=(0,s.useMemo)((function(){return v.length}),[v]),on=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===H||void 0===H?void 0:H.type)}),[H]),cn=(0,s.useMemo)((function(){return F.qL.STREAMING===(null===H||void 0===H?void 0:H.type)}),[H]),un=(0,s.useMemo)((function(){var e;return F.qL.PYTHON===(null===H||void 0===H?void 0:H.type)&&(null===W||void 0===W||null===(e=W.features)||void 0===e?void 0:e[lt.d.ADD_NEW_BLOCK_V2])}),[H,W]),an=V.ZP.block_templates.list({show_all:!!un},{revalidateOnFocus:!1}).data,sn=(0,s.useMemo)((function(){return(null===an||void 0===an?void 0:an.block_templates)||[]}),[an]),dn="PipelineDetail/index",pn=(0,pe.y)(),fn=pn.disableGlobalKeyboardShortcuts,vn=pn.registerOnKeyDown,mn=pn.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){mn(dn)}}),[mn,dn]),vn(dn,(function(e,n,t){if(z&&(0,at.y)([ae.zX,ae.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(!g&&!fn)if((0,at.y)([ae.zX,ae.Um],n)||(0,at.y)([ae.PQ,ae.Um],n))e.preventDefault(),Q();else if(ge)n[ae.vP]?ve(!1):z||ae.Z1.find((function(e){return n[e]}))||ue(!0);else if(!on){var i;if(un&&((0,at.y)([ae.zX,ae.A1],n)||(0,at.y)([ae.PQ,ae.A1],n)))e.preventDefault(),_e(!0),null===je||void 0===je||null===(i=je.current)||void 0===i||i.focus();else if(un&&we&&(0,at.y)([ae.vP],n)){var r;e.preventDefault(),_e(!1),null===je||void 0===je||null===(r=je.current)||void 0===r||r.blur()}else if(J){var o=v.findIndex((function(e){var n=e.uuid;return J.uuid===n}));if(n[ae.vP])se(null);else if(t[0]===ae.xD&&t[1]===ae.xD)I();else if(t[0]===ae.l1&&t[1]===ae.l1&&-1!==o)b(J).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){o===v.length-1?se(v[o-1]):v.length>=0?se(v[o+1]):se(null)}),100)}));else if(n[ae.Bu]&&o>=1){var l=v[o-1];if(l){var c,a;se(l);var s="".concat(l.type,"s/").concat(l.uuid,".py");null===(c=p.current[s])||void 0===c||null===(a=c.current)||void 0===a||a.scrollIntoView()}}else if(n[ae.kD]&&o<=rn-2){var d=v[o+1];if(d){var f,h;se(d);var m="".concat(d.type,"s/").concat(d.uuid,".py");null===(f=p.current[m])||void 0===f||null===(h=f.current)||void 0===h||h.scrollIntoView()}}else(0,at.y)([ae.Uq],n)&&ve(!0)}else tn&&n[ae.Uq]&&se(tn);u||t[0]!==ae.OC||t[1]!==ae.OC||G()}}),[n,u,p.current,v,we,I,on,rn,z,G,Q,je,J,tn,ue,se,ve,ge,un]),(0,s.useEffect)((function(){var e=setInterval((function(){z&&Q()}),1e4);return function(){clearInterval(e)}}),[z,Q]),(0,s.useEffect)((function(){setTimeout((function(){return Te(!0)}),2*Ce.zn)}),[H]);var bn=(0,d.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return V.ZP.blocks.pipelines.useUpdate(null===H||void 0===H?void 0:H.uuid,null===n||void 0===n?void 0:n.uuid)({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){j()},onErrorCallback:function(e,n){return null===ie||void 0===ie?void 0:ie({errors:n,response:e})}})}}),gn=(0,l.Z)(bn,1)[0],xn=(0,s.useCallback)((function(e){Ze(!0),Ge(e),ne(!0)}),[Ze,ne,Ge]),jn=(0,s.useCallback)((function(){Ze(!1),qe(!1),Xe(""),ne(!1)}),[ne]),yn=(0,s.useCallback)((function(e,n){var t,i;v.forEach((function(r,o){var l=r.uuid;t>=0&&i>=0||(l===e.uuid?t=o:l===n.uuid&&(i=o))}));var r=(0,Se.oM)(v,i);return r=(0,Se.Hk)(n,Math.max(t,0),r),Q({pipeline:{blocks:r,uuid:null===H||void 0===H?void 0:H.uuid}})}),[v,H,Q]),kn=(0,s.useMemo)((function(){var e=[];return v.filter((function(e){var n=e.type;return!on||h.tf.TRANSFORMER===n})).forEach((function(l,u){var d,f=l.type,y=l.uuid,k=(null===J||void 0===J?void 0:J.uuid)===y,Z=nn[y],O=Z?0===Z.priority?De.uF.BUSY:De.uF.QUEUED:De.uF.IDLE,P="".concat(f,"s/").concat(y,".py");p.current[P]=(0,s.createRef)();var w=f===h.tf.MARKDOWN,S=f===h.tf.TRANSFORMER,A=!(null===E||void 0===E||!E[y]),M=u===rn-1||on,F=p.current[P];d=A?(0,C.jsx)(hn,{block:l,blocks:v,onClick:function(){return oe((function(e){return dt(dt({},e),{},(0,o.Z)({},y,!A))}))},onDrop:yn,ref:F},y):(0,C.jsx)(R.Z,{addNewBlock:function(e,t){ve(!0);return n(e,u+1,(function(e){if(1===(null===t||void 0===t?void 0:t.length)){var n,i,o=null===(n=t[0])||void 0===n?void 0:n.uuid,l=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];gn({block:{uuid:o},upstreamBlocks:[e.uuid].concat((0,r.Z)(l))})}null===se||void 0===se||se(e)}))},addNewBlockMenuOpenIdx:He,addWidget:t,allBlocks:i,allowCodeBlockShortcuts:c,autocompleteItems:a,block:l,blockIdx:u,blockRefs:p,blockTemplates:sn,blocks:v,dataProviders:m,defaultValue:l.content,deleteBlock:function(e){b(e),X(!1)},disableShortcuts:g,executionState:O,fetchFileTree:x,fetchPipeline:j,globalDataProducts:_,hideRunButton:cn||w||on&&S,interruptKernel:I,mainContainerRef:T,mainContainerWidth:D,messages:B[y],noDivider:M,onCallbackChange:function(e){return N(f,y,e)},onChange:function(e){return L(f,y,e)},onClickAddSingleDBTModel:xn,onDrop:yn,openSidekickView:U,pipeline:H,project:W,ref:F,runBlock:K,runningBlocks:q,savePipelineContent:Q,selected:k,setAddNewBlockMenuOpenIdx:ze,setAnyInputFocused:X,setCreatingNewDBTModel:qe,setEditingBlock:te,setErrors:ie,setOutputBlocks:le,setSelected:function(e){return se(!0===e?l:null)},setSelectedBlock:se,setSelectedOutputBlock:de,setTextareaFocused:ve,showBrowseTemplates:he,showConfigureProjectModal:me,showGlobalDataProducts:be,textareaFocused:k&&ge,widgets:xe},y),e.push(d)})),e}),[n,He,t,i,c,a,p,sn,v,m,b,g,x,j,_,E,I,on,cn,T,D,B,rn,N,L,xn,yn,U,H,W,K,q,nn,Q,J,ze,X,te,ie,oe,le,se,de,ve,he,me,be,ge,gn,xe]),Zn=(0,s.useMemo)((function(){return(0,C.jsx)(ot,{addNewBlockAtIndex:n,blocks:v,codeBlocks:kn,fetchFileTree:x,fetchPipeline:j,fetchSampleData:y,globalVariables:S,onChangeCodeBlock:L,openSidekickView:U,pipeline:H,savePipelineContent:Q,setErrors:ie,setIntegrationStreams:re,setOutputBlocks:le,setSelectedBlock:se,setSelectedOutputBlock:de,setSelectedStream:fe})}),[n,v,kn,x,j,y,S,L,U,H,Q,ie,re,le,se,de,fe]),On=(0,s.useMemo)((function(){return H&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Le.Z,{addNewBlock:function(e){var t=v[v.length-1],i=null,r=e.configuration||{},o=t?(0,ln.eY)(t,e):[];t&&([h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(t.type)&&h.tf.SCRATCHPAD===e.type&&(i="from mage_ai.data_preparation.variable_manager import get_variable\n\n\n df = get_variable('".concat(H.uuid,"', '").concat(t.uuid,"', 'output_0')\n ")),h.t6.SQL===t.language&&(r=dt(dt({},(0,Dn.GL)(t.configuration,[ct.cH,ct.Sv,ct.sc,ct.BD,ct.nq])),r))),h.t6.SQL===e.language&&(i=(0,ut.SF)(i)),i=(0,ut.X7)(e,i),n(dt(dt({},e),{},{configuration:r,content:i,upstream_blocks:o}),rn,se),ve(!0)},blockTemplates:sn,focusedAddNewBlockSearch:we,hideCustom:on||cn,hideDataExporter:on,hideDataLoader:on,hideDbt:on||cn,hideScratchpad:on,hideSensor:on,onClickAddSingleDBTModel:xn,pipeline:H,project:W,searchTextInputRef:je,setCreatingNewDBTModel:qe,setFocusedAddNewBlockSearch:_e,showBrowseTemplates:he,showConfigureProjectModal:me,showGlobalDataProducts:be}),!un&&!on&&!cn&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,C.jsx)("br",{}),"Turn on the feature named ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:lt.d.ADD_NEW_BLOCK_V2})," in your ",(0,C.jsx)(Re(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,C.jsx)(k.Z,{muted:!0,underline:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[n,sn,v,we,on,cn,rn,xn,H,W,je,_e,se,ve,he,me,be,un]);return(0,C.jsxs)(A.W,{backend:M.PD,children:[(0,C.jsx)(Ce.lO,{children:Be&&(0,C.jsx)(Ne.Z,{classNames:"pipeline-detail",in:Ie,onEntered:function(){return setTimeout((function(){return Fe(!1)}),Ce.zn)},timeout:1,children:(0,C.jsx)(Ce.fm,{})})}),(0,C.jsxs)(Z.Z,{mt:1,px:P.cd,children:[on&&Zn,!on&&(0,C.jsxs)(C.Fragment,{children:[kn,(0,C.jsx)(Z.Z,{mt:P.cd,children:On})]}),ke&&(0,C.jsx)(ce.Z,{onClickOutside:jn,open:!0,children:(0,C.jsx)($e,{blocks:v,creatingNewDBTModel:Ye,dbtModelName:Je,files:w,onClose:jn,onOpenFile:function(e){var t=e;if(Ye){var i=(0,$.RA)(Je||(0,$.Y6)()),r=".".concat(en.Lu.SQL);i.endsWith(r)&&(i=i.slice(0,-4)),t="".concat(e).concat(Me.sep).concat(i,".").concat(en.Lu.SQL)}var o={configuration:{file_path:t,limit:R.z},language:h.t6.SQL,name:(0,$.wE)(t),type:h.tf.DBT};Ye&&(o.content="--Docs: https://docs.mage.ai/dbt/sources\n");var l="undefined"===typeof We||null===We,c=v[l?v.length-1:We],u=c?(0,ln.eY)(c,o):[];n(dt(dt({},o),{},{upstream_blocks:u}),l?rn:We+1,se),jn(),ve(!0)},setDbtModelName:Xe})})]})]})},ft=t(49894),vt=t(41424),ht=t(32063),mt=t(82386),bt=t(70543),gt=t(24141);function xt(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 jt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var yt=function(e){var n=e.after,t=e.afterHeader,i=e.afterHeightOffset,r=e.afterHidden,o=e.afterNavigationItems,c=e.afterOverflow,u=e.afterSubheader,a=e.before,d=e.beforeHeader,p=e.beforeHeightOffset,f=e.beforeNavigationItems,v=e.children,h=e.errors,m=e.headerOffset,b=e.mainContainerHeader,g=e.mainContainerRef,x=e.page,j=e.pipeline,y=e.setAfterHidden,k=e.setAfterWidthForChildren,Z=e.setErrors,O=e.setMainContainerWidth,P=(0,gt.i)().width,w=(0,s.useState)((0,we.U2)(we.L8,mt.Zt)),_=w[0],S=w[1],E=(0,s.useState)((0,we.U2)(we.J3,mt.ve)),I=E[0],T=E[1],D=(0,s.useState)(!!(0,we.U2)(we.Uu)),A=D[0],M=D[1],B=(0,s.useState)(!1),R=B[0],N=B[1],L=(0,s.useState)(!1),F=L[0],U=L[1],H=r,z=y;if(!z){var W=(0,s.useState)(!!(0,we.U2)(we.zg)),G=(0,l.Z)(W,2);H=G[0],z=G[1]}(0,s.useEffect)((function(){null===g||void 0===g||!g.current||R||F||null===O||void 0===O||O(g.current.getBoundingClientRect().width)}),[R,F,H,_,A,I,g,O,P]),(0,s.useEffect)((function(){R||(null===k||void 0===k||k(_),(0,we.t8)(we.L8,_))}),[R,_,k]),(0,s.useEffect)((function(){F||(0,we.t8)(we.J3,I)}),[F,I]);var K=V.ZP.projects.list({},{revalidateOnFocus:!1}).data,Y=null===K||void 0===K?void 0:K.projects,q=(0,s.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return j&&(n.push.apply(n,[{bold:bt.b7!==x,label:function(){return null===j||void 0===j?void 0:j.uuid},linkProps:{as:"/pipelines/".concat(null===j||void 0===j?void 0:j.uuid),href:"/pipelines/[pipeline]"}}]),bt.b7===x&&n.push.apply(n,[{bold:!0,label:function(){return(0,$.kC)(x)}}])),(0,C.jsx)(vt.Z,{breadcrumbs:n,project:null===Y||void 0===Y?void 0:Y[0],version:null===Y||void 0===Y||null===(e=Y[0])||void 0===e?void 0:e.version})}),[x,j,Y]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(je.Z,{title:null===j||void 0===j?void 0:j.name}),(0,C.jsx)(ht.Z,{after:n,afterHeader:t,afterHeightOffset:i,afterHidden:H,afterMousedownActive:R,afterNavigationItems:o,afterOverflow:c,afterSubheader:u,afterWidth:_,before:a,beforeHeader:d,beforeHeightOffset:p,beforeHidden:A,beforeMousedownActive:F,beforeNavigationItems:f,beforeWidth:I,header:q,headerOffset:m,mainContainerHeader:b,mainContainerRef:g,navigationShowMore:!0,setAfterHidden:z,setAfterMousedownActive:N,setAfterWidth:S,setBeforeHidden:M,setBeforeMousedownActive:U,setBeforeWidth:T,children:v}),h&&(0,C.jsx)(ce.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return Z(null)},children:(0,C.jsx)(ft.Z,jt(jt({},h),{},{onClose:function(){return Z(null)}}))})]})},kt=t(21853),Zt=t(41788),Ot=t(30119),Pt=t(83766),wt=t(31682),Ct=t(21978),_t=t(18221);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 Et(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,o.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 It=function(e){var n=e.block,t=e.fetchFileTree,i=e.fetchPipeline,r=e.globalDataProducts,o=e.pipeline,c=e.setSelectedBlock,u=(0,s.useRef)(null),a=(0,s.useRef)(null),p=(0,s.useMemo)((function(){return null===o||void 0===o?void 0:o.uuid}),[o]),f=(0,s.useMemo)((function(){return(null===o||void 0===o?void 0:o.retry_config)||{}}),[o]),v=n.configuration,m=n.type,g=n.uuid,x=(0,ne.VI)(null,{},[],{uuid:"BlockSettings/index"}),j=(0,l.Z)(x,1)[0],w=(0,s.useMemo)((function(){return(0,Se.HK)(r||[],(function(e){return e.uuid}))}),[r]),_=(0,s.useMemo)((function(){var e,n=null===v||void 0===v||null===(e=v.global_data_product)||void 0===e?void 0:e.uuid;if(n&&w)return null===w||void 0===w?void 0:w[n]}),[v,w]),S=V.ZP.pipelines.detail(Ot.b.PIPELINE===(null===_||void 0===_?void 0:_.object_type)&&(null===_||void 0===_?void 0:_.object_uuid)).data,E=(0,s.useMemo)((function(){return null===S||void 0===S?void 0:S.pipeline}),[S]),I=(0,s.useState)(null),D=I[0],A=I[1],M=(0,s.useState)(!1),B=M[0],R=M[1],N=(0,s.useState)(!1),L=N[0],F=N[1],W=(0,Pe.Z)(n);(0,s.useEffect)((function(){(null===W||void 0===W?void 0:W.uuid)!==(null===n||void 0===n?void 0:n.uuid)&&A(n)}),[n,W]);var G=(0,s.useMemo)((function(){return(null===D||void 0===D?void 0:D.retry_config)||{}}),[D]),K=(0,s.useCallback)((function(e){R(!0),A(e)}),[]),Y=(0,s.useMemo)((function(){return null===D||void 0===D?void 0:D.executor_type}),[D]);(0,s.useEffect)((function(){L||!Y||_t.R.find((function(e){return e===Y}))||F(!0)}),[L,Y]);var q=V.ZP.blocks.pipelines.detail(p,encodeURIComponent(g),{_format:"with_settings",block_type:m}).data,Q=(0,s.useMemo)((function(){return(null===q||void 0===q?void 0:q.block)||{}}),[q]),J=(0,s.useMemo)((function(){return null!==Q&&void 0!==Q&&Q.pipelines?Object.values(null===Q||void 0===Q?void 0:Q.pipelines):[]}),[Q]),X=(0,d.Db)(V.ZP.blocks.pipelines.useUpdate(p,g),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){R(!1),t(),i(),null!==e&&void 0!==e&&e.block&&c(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return j({errors:n,response:e})}})}}),te=(0,l.Z)(X,2),ie=te[0],re=te[1].isLoading,oe=(0,s.useMemo)((function(){return(null===J||void 0===J?void 0:J.length)>=1&&(0,C.jsx)(En.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Description"}],rows:J.map((function(e){var n=e.pipeline,t=n.description,i=n.name,r=n.uuid;return[(null===o||void 0===o?void 0:o.uuid)===r?(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:i||r},"name"):(0,C.jsx)(k.Z,{href:"/pipelines/".concat(r,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||r},"name"),(0,C.jsx)(O.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})}),[J,o]),le=(0,s.useMemo)((function(){return f&&"undefined"!==typeof f&&!(0,Dn.Qr)(f)&&("undefined"!==typeof(null===f||void 0===f?void 0:f.delay)&&"undefined"===typeof(null===G||void 0===G?void 0:G.delay)||"undefined"!==typeof(null===f||void 0===f?void 0:f.exponential_backoff)&&"undefined"===typeof(null===G||void 0===G?void 0:G.exponential_backoff)||"undefined"!==typeof(null===f||void 0===f?void 0:f.max_delay)&&"undefined"===typeof(null===G||void 0===G?void 0:G.max_delay)||"undefined"!==typeof(null===f||void 0===f?void 0:f.retries)&&"undefined"===typeof(null===G||void 0===G?void 0:G.retries))}),[G,f]),ce=(0,s.useMemo)((function(){var e;return(null===D||void 0===D||null===(e=D.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[D]),ue=(0,s.useCallback)((function(e){return K((function(n){var t;return Et(Et({},n),{},{configuration:Et(Et({},null===D||void 0===D?void 0:D.configuration),{},{global_data_product:e(null===D||void 0===D||null===(t=D.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[D,K]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:P.HN,children:(0,C.jsxs)(Z.Z,{py:P.cd,children:[(0,C.jsxs)(Z.Z,{mb:P.HN,px:P.cd,children:[(0,C.jsx)(z.Z,{label:"Name",onChange:function(e){return K((function(n){return Et(Et({},n),{},{name:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===D||void 0===D?void 0:D.name)||""}),h.tf.CUSTOM===(null===n||void 0===n?void 0:n.type)&&(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(U.Z,{label:"Color",onChange:function(e){return K((function(n){return Et(Et({},n),{},{color:e.target.value})}))},primary:!0,value:(null===D||void 0===D?void 0:D.color)||"",children:Object.values(h.Lq).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,$.kC)(e)},e)}))})})]}),(0,C.jsxs)(Z.Z,{mb:P.HN,px:P.cd,children:[(0,C.jsx)(gn.Z,{children:"Executor type"}),(0,C.jsxs)(O.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,C.jsx)(k.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,C.jsxs)(Z.Z,{mt:1,children:[!L&&(0,C.jsx)(U.Z,{label:"Executor type",onChange:function(e){return K((function(n){return Et(Et({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:u,value:(null===D||void 0===D?void 0:D.executor_type)||"",children:_t.R.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))}),L&&(0,C.jsx)(z.Z,{label:"Executor type",monospace:!0,onChange:function(e){return K((function(n){return Et(Et({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:a,setContentOnMount:!0,value:(null===D||void 0===D?void 0:D.executor_type)||""}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(k.Z,{muted:!0,onClick:function(){L?(K((function(e){return Et(Et({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===u||void 0===u||null===(e=u.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===a||void 0===a||null===(e=a.current)||void 0===e?void 0:e.focus()}),1),F(!L)},preventDefault:!0,small:!0,children:L?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,C.jsxs)(Z.Z,{mb:P.HN,px:P.cd,children:[(0,C.jsx)(gn.Z,{children:"Retry configuration"}),(0,C.jsxs)(O.ZP,{muted:!0,children:[le&&(0,C.jsxs)(C.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,C.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsxs)(y.Z,{children:[(0,C.jsx)(z.Z,{label:"Retries",monospace:!0,onChange:function(e){return K((function(n){var t;return Et(Et({},n),{},{retry_config:Et(Et({},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===f||void 0===f?void 0:f.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===G||void 0===G?void 0:G.retries)?null===G||void 0===G?void 0:G.retries:(null===f||void 0===f?void 0:f.retries)||""}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(z.Z,{label:"Delay",monospace:!0,onChange:function(e){return K((function(n){var t;return Et(Et({},n),{},{retry_config:Et(Et({},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===f||void 0===f?void 0:f.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===G||void 0===G?void 0:G.delay)?null===G||void 0===G?void 0:G.delay:(null===f||void 0===f?void 0:f.delay)||""}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(z.Z,{label:"Max delay",monospace:!0,onChange:function(e){return K((function(n){var t;return Et(Et({},n),{},{retry_config:Et(Et({},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===f||void 0===f?void 0:f.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===G||void 0===G?void 0:G.max_delay)?null===G||void 0===G?void 0:G.max_delay:(null===f||void 0===f?void 0:f.max_delay)||""})]}),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(b.Z,{checked:"undefined"===typeof(null===G||void 0===G?void 0:G.exponential_backoff)&&"undefined"!==typeof(null===f||void 0===f?void 0:f.exponential_backoff)?!(null===f||void 0===f||!f.exponential_backoff):!(null===G||void 0===G||!G.exponential_backoff),label:"Exponential backoff",onClick:function(){return K((function(e){var n;return Et(Et({},e),{},{retry_config:Et(Et({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===G||void 0===G?void 0:G.exponential_backoff)&&"undefined"!==typeof(null===f||void 0===f?void 0:f.exponential_backoff)?!(null!==f&&void 0!==f&&f.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),h.tf.GLOBAL_DATA_PRODUCT===m&&(0,C.jsxs)(Z.Z,{mb:P.HN,children:[(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsx)(gn.Z,{children:"Override global data product settings"})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(Pt.Z,{objectAttributes:ce,originalAttributes:_,setObjectAttributes:ue})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(wt.Z,{objectAttributes:ce,originalAttributes:_,setObjectAttributes:ue})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(Ct.Z,{blocks:null===E||void 0===E?void 0:E.blocks,objectAttributes:ce,originalAttributes:_,setObjectAttributes:ue})})]}),(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsx)(T.Z,{disabled:!B,loading:re,onClick:function(){return ie({block:{color:null===D||void 0===D?void 0:D.color,configuration:null===D||void 0===D?void 0:D.configuration,executor_type:null===D||void 0===D?void 0:D.executor_type,name:null===D||void 0===D?void 0:D.name,retry_config:G}})},primary:!0,children:"Update block settings"})})]})}),(0,C.jsxs)(Z.Z,{mb:P.HN,children:[!q&&(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(H.Z,{inverted:!0})}),q&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsx)(gn.Z,{children:"Pipelines"}),(0,C.jsx)(O.ZP,{default:!0,children:"Here are all the pipelines that are using this block."})]}),oe]})]})]})},Tt=t(92083),Dt=t.n(Tt),At=t(26226),Mt=t(84969),Bt=t(90948),Rt=t(65743),Nt=t(39048),Lt=t(79487),Ft=t(29989),Ut=t(61655),Ht=t(16853),zt=t(65376),Vt=t(52359),Wt=t(2005),Gt=t(48072),Kt=t(24903),Yt=t(98677),qt=t(84181),Qt=t(73899),Jt=t(31012);function Xt(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 $t(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Xt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ei={bottom:P.iI*(3+P.cd),left:P.iI*P.cd,right:P.iI*P.cd,top:P.iI*P.cd};function ni(e,n){return Math.max.apply(Math,(0,r.Z)(e.map(n)))}function ti(e){var n=e.data,t=e.height,i=e.keyForYData,o=e.large,l=e.margin,c=void 0===l?{}:l,u=e.orientationVertical,a=void 0!==u&&u,d=e.showTooltip,p=e.width,f=e.yLabelFormat,v=(0,s.useContext)(m.ThemeContext),h=(0,s.useCallback)((function(e){return e[i]}),[i]),b=f;b||(b=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var g=o?Jt.iD:Jt.J5,x=$t($t({},ei),c),j=n.slice(Math.max(0,n.length-50)),y=(0,s.useMemo)((function(){return Object.keys((null===j||void 0===j?void 0:j[0])||{}).filter((function(e){return e!==i}))}),[j,i]),k=(0,Kt.Z)({domain:y,range:[Qt.a$,Qt.Ej,Qt.hM,Qt.ZA,Qt.$R,Qt.X_,Qt.er,Qt.hl,Qt.nQ]}),Z=(0,s.useMemo)((function(){return j.map(h)}),[j,h]),O=(0,Yt.Z)({domain:Z,padding:.1}),P=(0,Yt.Z)({domain:y,padding:.1}),w=(0,qt.Z)({domain:[0,ni(j,(function(e){return ni(y,(function(n){return Number(e[n])}))}))]}),C={active:(null===v||void 0===v?void 0:v.content.default)||G.Z.content.default,backgroundPrimary:(null===v||void 0===v?void 0:v.chart.backgroundPrimary)||G.Z.chart.backgroundPrimary,backgroundSecondary:(null===v||void 0===v?void 0:v.chart.backgroundSecondary)||G.Z.chart.backgroundSecondary,muted:(null===v||void 0===v?void 0:v.content.muted)||G.Z.content.muted,primary:(null===v||void 0===v?void 0:v.chart.primary)||G.Z.chart.primary,tooltipBackground:(null===v||void 0===v?void 0:v.background.navigation)||G.Z.background.navigation},_=Z;a&&(_=j.reduce((function(e,n){return e.concat(y.map((function(e){var t=n[e];return(0,$.HW)(t)?parseInt(String(t)):t})))}),[]));var S=Math.min(Math.max.apply(Math,(0,r.Z)(_.map((function(e){return String(e).length})))),20);x.left+=7*S;var E=p-(x.left+x.right),I=t-(x.top+x.bottom);a?(O.rangeRound([0,E]),w.rangeRound([I,0])):(O.rangeRound([I,0]),w.rangeRound([0,E])),P.rangeRound([0,O.bandwidth()]);var T=j.map(h).length,D=0;a||(D=O(_[T-1]));var A=(0,s.useCallback)((function(e){var n=(0,Gt.Z)(e)||{x:0,y:0},t=n.x,i=n.y,r=t-x.left,o=i-x.top,l=0;l=a?(r-D/2)/(E-D):1-(o-D/2)/(I-D);var c=Math.floor(l*T),u=j[c];"undefined"===typeof u&&(u=j[c-1]),a?r>D&&r<E+x.left-D&&d({tooltipData:u,tooltipLeft:t,tooltipTop:i}):o>D&&o<I-D&&d({tooltipData:u,tooltipLeft:t,tooltipTop:i})}),[j,T,x.left,x.top,a,d,D,E,I]);return{colorScale:k,colors:C,data:j,fontSize:g,handleTooltip:A,margin:x,tempScale:w,tickValues:_,xKeys:y,xMax:E,y1Scale:P,yLabelFormat:b,yMax:I,yScale:O,ySerialize:h}}var ii=["height","width","xAxisLabel","yAxisLabel"];function ri(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function oi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ri(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ri(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var li=3*P.iI,ci=(P.iI,P.iI,P.iI,(0,Ut.Z)((function(e){var n=e.data,t=e.height,i=e.hideTooltip,r=e.keyForYData,o=void 0===r?"__y":r,c=e.large,u=e.margin,a=void 0===u?{}:u,s=e.renderNoDataText,d=e.renderTooltipContent,p=e.showTooltip,f=e.tooltipData,v=e.tooltipLeft,h=e.tooltipOpen,m=e.tooltipTop,b=e.width,g=e.xAxisLabel,x=e.xNumTicks,j=e.yLabelFormat,y=ti({data:n,height:t,keyForYData:o,large:c,margin:a,showTooltip:p,width:b,yLabelFormat:j}),k=y.colorScale,Z=y.colors,P=y.data,w=y.fontSize,_=y.handleTooltip,S=y.margin,E=y.tempScale,I=y.tickValues,T=y.xKeys,D=y.xMax,A=y.y1Scale,M=y.yLabelFormat,B=y.yMax,R=y.yScale,N=y.ySerialize,L=[],F=Math.floor((null===I||void 0===I?void 0:I.length)/Math.floor(t/li));return null===I||void 0===I||I.forEach((function(e,n){n%F===0&&L.push(e)})),b<10?null:(0,C.jsxs)("div",{children:[(0,C.jsxs)("svg",{height:t,width:b,children:[s&&!(null!==P&&void 0!==P&&P.length)&&(0,C.jsx)("text",{fill:Z.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:Wt.ry,fontSize:w,x:"50%",y:"50%",children:s()}),(0,C.jsx)(Rt.Z,{fill:"transparent",height:t-(S.top+S.bottom),onMouseLeave:function(){return i()},onMouseMove:_,onTouchMove:_,onTouchStart:_,rx:14,width:b-(S.left+S.right),x:S.left,y:S.top}),(null===P||void 0===P?void 0:P.length)&&(0,C.jsxs)(Ft.Z,{left:S.left,top:S.top,children:[(0,C.jsx)(Nt.Z,{color:k,data:P,keys:T,width:D,xScale:E,y0:N,y0Scale:R,y1Scale:A,children:function(e){return e.map((function(e){return(0,C.jsx)(Ft.Z,{top:e.y0,children:e.bars.map((function(n){return(0,C.jsx)("g",{children:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("rect",{fill:n.color,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})})},"".concat(e.index,"-").concat(n.index,"-").concat(n.key))}))},"bar-group-horizontal-".concat(e.index,"-").concat(e.y0))}))}}),(0,C.jsx)(Mt.Z,{hideTicks:!0,scale:R,stroke:Z.muted,tickFormat:function(e){return M(e)},tickLabelProps:function(){return{fill:Z.active,fontFamily:Wt.ry,fontSize:w,style:{width:"10px"},textAnchor:"end"}},tickStroke:Z.muted,tickValues:L,top:2}),(0,C.jsx)(Bt.Z,{label:g,labelProps:{fill:Z.muted,fontFamily:Wt.ry,fontSize:w,textAnchor:"middle"},numTicks:x,scale:E,stroke:Z.muted,tickLabelProps:function(){return{fill:Z.active,fontFamily:Wt.ry,fontSize:w,textAnchor:"middle"}},tickStroke:Z.muted,top:B})]}),f&&(0,C.jsx)("g",{children:(0,C.jsx)(Lt.Z,{from:{x:S.left,y:m},pointerEvents:"none",stroke:Z.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:D+S.left,y:m}})})]}),h&&f&&(0,C.jsxs)(Ht.Z,{left:v,style:oi(oi({},zt.j),{},{backgroundColor:Z.tooltipBackground}),top:m,children:[d&&d(f),!d&&Object.entries(f).map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];if(o!==t){var r=i;return(0,$.HW)(r)&&String(r).split(".").length>=2&&(r=r.toFixed(4)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[t,": ",r]},t)}}))]})]})})));var ui=function(e){var n,t=e.height,i=e.width,r=e.xAxisLabel,o=e.yAxisLabel,l=(0,_n.Z)(e,ii);return n="undefined"===typeof i?"100%":o?0===i?i:i-28:i,(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{style:{display:"flex",height:t,marginBottom:r?P.iI:null,width:"100%"},children:[o&&(0,C.jsx)(y.Z,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,C.jsx)(Vt.Z,{children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:o})})}),(0,C.jsx)("div",{style:{height:t,width:n},children:(0,C.jsx)(At.Z,{children:function(e){var n=e.width,t=e.height;return(0,C.jsx)(ci,oi(oi({},l),{},{height:t,width:n}))}})})]}),r&&(0,C.jsx)("div",{style:{paddingLeft:o?36:0,paddingTop:4},children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:r})})]})},ai=t(95422),si=["keyForYData"],di=["height","width","xAxisLabel","yAxisLabel"];function pi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function fi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var vi=6*P.iI,hi=(0,Ut.Z)((function(e){var n=e.keyForYData,t=void 0===n?"__y":n,i=(0,_n.Z)(e,si),r=i.height,o=i.hideTooltip,c=i.renderNoDataText,u=i.renderTooltipContent,a=i.tooltipData,s=i.tooltipLeft,d=i.tooltipOpen,p=i.tooltipTop,f=i.width,v=i.xLabelFormat,h=i.xNumTicks,m=i.yNumTicks,b=ti(fi(fi({},i),{},{keyForYData:t,orientationVertical:!0})),g=b.colorScale,x=b.colors,j=b.data,y=b.fontSize,k=b.handleTooltip,Z=b.margin,P=b.tempScale,w=(b.tickValues,b.xKeys),_=(b.xMax,b.y1Scale),S=b.yLabelFormat,E=b.yMax,I=b.yScale,T=b.ySerialize,D=Math.min(h,f/vi);return f<10?null:(0,C.jsxs)("div",{children:[(0,C.jsxs)("svg",{height:r,width:f,children:[c&&!(null!==j&&void 0!==j&&j.length)&&(0,C.jsx)("text",{fill:x.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:Wt.ry,fontSize:y,x:"50%",y:"50%",children:c()}),(null===j||void 0===j?void 0:j.length)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Rt.Z,{fill:"transparent",height:r-(Z.top+Z.bottom),onMouseLeave:function(){return o()},onMouseMove:k,onTouchMove:k,onTouchStart:k,rx:14,width:f-(Z.left+Z.right),x:Z.left,y:2*Z.top}),(0,C.jsxs)(Ft.Z,{top:Z.top,children:[(0,C.jsx)(ai.Z,{color:g,data:j,height:E,keys:w,x0:T,x0Scale:I,x1Scale:_,yScale:P,children:function(e){return e.map((function(e){return(0,C.jsx)(Ft.Z,{left:e.x0+Z.left,top:Z.top,children:e.bars.map((function(n){return(0,C.jsx)("g",{children:(0,C.jsx)("rect",{fill:n.color,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})},"".concat(e.index,"-").concat(n.index,"-").concat(n.key))}))},"bar-group-horizontal-".concat(e.index,"-").concat(e.x0))}))}}),(0,C.jsx)(Mt.Z,{left:Z.left,numTicks:m,scale:P,stroke:x.muted,tickFormat:function(e){return S(e)},tickLabelProps:function(){return{fill:x.active,fontFamily:Wt.ry,fontSize:y,textAnchor:"end",transform:"translate(-2,2.5)"}},tickStroke:x.muted,top:Z.top}),(0,C.jsx)(Bt.Z,{hideTicks:!0,left:Z.left,numTicks:D,scale:I,stroke:x.muted,tickFormat:v,tickLabelProps:function(){return{fill:x.active,fontFamily:Wt.ry,fontSize:y,textAnchor:"middle"}},tickStroke:x.muted,top:E+Z.top})]})]}),a&&(0,C.jsx)("g",{children:(0,C.jsx)(Lt.Z,{from:{x:s,y:2*Z.top},pointerEvents:"none",stroke:x.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:s,y:E+2*Z.top}})})]}),d&&a&&(0,C.jsxs)(Ht.Z,{left:s,style:fi(fi({},zt.j),{},{backgroundColor:x.tooltipBackground}),top:p,children:[u&&u(a),!u&&Object.entries(a).map((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];if(t!==i){var o=r;return(0,$.HW)(o)&&String(o).split(".").length>=2&&(o=o.toFixed(4)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[i,": ",o]},i)}})),(0,C.jsx)("br",{}),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[v&&v(T(a)),!v&&T(a)]})]})]})}));var mi=function(e){var n=e.height,t=e.width,i=e.xAxisLabel,r=e.yAxisLabel,o=(0,_n.Z)(e,di);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{style:{display:"flex",height:n,marginBottom:i?P.iI:null,width:"100%"},children:[r&&(0,C.jsx)(y.Z,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,C.jsx)(Vt.Z,{children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:r})})}),(0,C.jsx)("div",{style:{height:n,width:r?0===t?t:t-28:t},children:(0,C.jsx)(At.Z,{children:function(e){var n=e.height,t=e.width;return(0,C.jsx)(hi,fi(fi({},o),{},{height:n,width:t}))}})})]}),i&&(0,C.jsx)("div",{style:{paddingLeft:r?36:0,paddingTop:4},children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:i})})]})},bi=t(62976),gi=t(66872),xi=t(68735),ji=t(320),yi=40*P.iI,ki=m.default.div.withConfig({displayName:"indexstyle__ChartBlockStyle",componentId:"sc-1c3ufnj-0"})(["border-radius:","px;margin-left:","px;margin-right:","px;margin-top:","px;",""],K.n_,.5*P.iI,.5*P.iI,1*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).codeArea,";\n ")})),Zi=m.default.div.withConfig({displayName:"indexstyle__ConfigurationOptionsStyle",componentId:"sc-1c3ufnj-1"})(["flex:4;padding-left:","px;padding-right:","px;"],1*P.iI,1*P.iI),Oi=m.default.div.withConfig({displayName:"indexstyle__CodeStyle",componentId:"sc-1c3ufnj-2"})(["padding-top:","px;",""],P.iI/2,(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).codeTextarea,";\n ")})),Pi=m.default.div.withConfig({displayName:"indexstyle__CodeHelperStyle",componentId:"sc-1c3ufnj-3"})(["margin-bottom:","px;padding-bottom:","px;padding-left:","px;",""],P.cd*P.iI,P.iI,P.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||G.Z.borders).medium,";\n ")}));function wi(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 Ci(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?wi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):wi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _i=function(e){var n,t=e.block,i=e.data,r=e.width,c=t.configuration,u=void 0===c?{}:c,a=u||{},s=a.chart_style,d=a.chart_type,p=a.y_sort_order,f=u[ct.JJ]||yi,v=(null===u||void 0===u||null===(n=u[ct.bE])||void 0===n?void 0:n.map((function(e){return(0,ct.c0)(e)})))||[],h=_e.n1,m=u[ct.Yg];if([ct.aE.HOUR,ct.aE.MINUTE,ct.aE.SECOND].includes(m)&&(h=_e.OC),ct.oV.BAR_CHART===d||ct.oV.TIME_SERIES_BAR_CHART===d){var b=i.x,g=i.y,x=ct.oV.TIME_SERIES_BAR_CHART===d;if(b&&g&&Array.isArray(b)&&Array.isArray(g)){var j,y=null===(j=u[ct.eN])||void 0===j?void 0:j.join(", "),k=null===v||void 0===v?void 0:v.join(", ");v.length||v.push(ct.rj);var Z=v[0],w=b.map((function(e,n){return Ci({__y:e},v.reduce((function(e,t,i){var r,l=null===g||void 0===g||null===(r=g[i])||void 0===r?void 0:r[n];return"undefined"===typeof l?e:Ci(Ci({},e),{},(0,o.Z)({},t,l))}),{}))}));ct.MP.ASCENDING===p?w=(0,Se.YC)(w,(function(e){return e[Z]}),{ascending:!1}):ct.MP.DESCENDING===p&&(w=(0,Se.YC)(w,(function(e){return e[Z]}),{ascending:!0}));var _={data:w,height:f,renderNoDataText:function(){return"No data matching query"},width:r,xNumTicks:3};return ct.JT.HORIZONTAL===s?(0,C.jsx)(ui,Ci(Ci({},_),{},{xAxisLabel:k||u[ct.rj],yAxisLabel:y||u[ct.a3]})):(0,C.jsx)(mi,Ci(Ci({},_),{},{xAxisLabel:y,xLabelFormat:function(e){return x?Dt()(1e3*e).format(_e.n1):e},xNumTicks:w.length,yAxisLabel:k,yNumTicks:5}))}}else if(ct.oV.HISTOGRAM===d){var S,E=i.x,I=i.y,T=null===(S=u[ct.eN])||void 0===S?void 0:S.join(", ");if(E&&I&&Array.isArray(E))return(0,C.jsx)(gi.Z,{data:E.map((function(e,n){var t,i=e.max,r=e.min;return[i,null===I||void 0===I||null===(t=I[n])||void 0===t?void 0:t.value,r]})),height:f,width:r,large:!0,margin:{left:5*P.iI,right:1*P.iI,top:3*P.iI},noPadding:!0,renderTooltipContent:function(e){var n=(0,l.Z)(e,3),t=n[0],i=n[1],r=n[2];return(0,C.jsxs)(O.ZP,{inverted:!0,monospace:!0,small:!0,children:["Count : ",i,(0,C.jsx)("br",{}),"Bucket: ",r,"-",t]})},showAxisLabels:!0,showYAxisLabels:!0,showZeroes:!0,sortData:function(e){return(0,Se.YC)(e,"[0]")},xAxisLabel:T||u[ct.a3],yAxisLabel:T?"count(".concat(T,")"):u[ct.rj]})}else if(ct.oV.LINE_CHART===d||ct.oV.TIME_SERIES_LINE_CHART===d){var D=i.x,A=i.y,M=ct.oV.TIME_SERIES_LINE_CHART===d;if(D&&A&&Array.isArray(D)&&Array.isArray(A)&&Array.isArray(null===A||void 0===A?void 0:A[0])){var B,R=v;u[ct.e]&&(R=u[ct.e].split(",").map((function(e){return e.trim()})));var N=D.map((function(e,n){return{x:e,y:(0,Se.w6)(A.length).map((function(e,t){var i=A[t][n];return"undefined"===typeof i||null===i?0:i}))}})),L=null===(B=u[ct.eN])||void 0===B?void 0:B.join(", "),F=v.join(", ");return(0,C.jsx)(xi.Z,{data:N,height:f,lineLegendNames:R,margin:{bottom:8*P.iI,left:5*P.iI},noCurve:!0,renderXTooltipContent:function(e){e.index;var n=e.x,t=u[ct.a3],i=n;return u[ct.eN]&&(t=u[ct.eN].map(String).join(", ")),M&&(i=Dt()(1e3*n).format(h)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[t,": ",i]})},renderYTooltipContent:function(e,n){var t=e.y;return(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[R&&R[n]&&"".concat(R[n],": "),t&&(0,$.x6)((0,$.QV)(t[n],4))]})},width:r?r-3*P.iI:r,xAxisLabel:L||String(u[ct.a3]),xLabelFormat:function(e){return M?Dt()(1e3*e).format(_e.n1):e},yAxisLabel:F||String(u[ct.rj]),yLabelFormat:function(e){return e}})}}else if(ct.oV.PIE_CHART===d){var U,H=i[String(u[ct.a3])],z=null===(U=u[ct.eN])||void 0===U?void 0:U.join(", ");if(H)return(0,C.jsx)(ji.Z,{data:Object.entries(H),getX:function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return"".concat(t," (").concat((0,$.x6)(i),")")},getY:function(e){return(0,l.Z)(e,2)[1]},height:f,width:r,xAxisLabel:z||String(u[ct.a3])})}else if(ct.oV.TABLE===d){var V=i.index,W=i.x,G=i.y;return Array.isArray(W)&&Array.isArray(G)&&Array.isArray(G[0])&&(0,C.jsx)(bi.Z,{columns:W,index:V,height:u[ct.JJ]?null:f,maxHeight:u[ct.JJ]?f:null,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,rows:G,width:r})}return(0,C.jsx)("div",{})},Si=t(65051),Ei=t(76096);var Ii=function(e){var n=e.children,t=e.onChange,i=(0,s.useState)(s.Children.map(n,(function(){return null}))),r=i[0],o=i[1],l=(0,s.useState)(0),c=l[0],u=l[1];return(0,C.jsx)(y.Z,{children:s.Children.map(n,(function(e,n){return(0,C.jsx)(Z.Z,{ml:n>=1?1:0,style:{display:"flex",flex:1},children:s.cloneElement(e,{onChange:function(e){o((function(i){return i[n]=e.target.value,t(i,{resetValues:function(){return u((function(e){return e+1}))},setValues:o}),i}))},value:r[n]})},"multi-select-child-".concat(n,"-").concat(c))}))})},Ti=t(59582),Di=t(78759);function Ai(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Mi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ai(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ai(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Bi(e,n){var t,i,r,c,u=e.autocompleteItems,a=e.block,p=e.blockRefs,f=e.blocks,v=e.deleteWidget,b=e.executionState,g=e.fetchPipeline,x=e.fetchFileTree,_=e.messages,S=void 0===_?[]:_,E=e.onChangeContent,I=e.pipeline,T=e.runBlock,D=e.runningBlocks,A=e.savePipelineContent,M=e.selected,B=e.setAnyInputFocused,R=e.setErrors,L=e.setSelectedBlock,F=e.setTextareaFocused,K=e.textareaFocused,Y=e.updateWidget,q=e.width,Q=(0,s.useRef)(null),J=(0,s.useContext)(m.ThemeContext),X=V.ZP.blocks.pipelines.detail(null===I||void 0===I?void 0:I.uuid,null===a||void 0===a?void 0:a.upstream_blocks[0]).data,ne=(null===X||void 0===X||null===(t=X.block)||void 0===t?void 0:t.outputs)||(null===a||void 0===a?void 0:a.outputs)||[],te=(0,s.useState)(null),ie=te[0],re=te[1],oe=(0,s.useState)(null===(i=a.configuration)||void 0===i?void 0:i.chart_type),le=oe[0],ce=oe[1],ue=(0,s.useState)(a.configuration),se=ue[0],de=ue[1],fe=(0,s.useState)(a.content),ve=fe[0],he=fe[1],me=(0,s.useState)(!le||0===ne.length),be=me[0],ge=me[1],xe=(0,s.useState)(!1),je=xe[0],ye=xe[1],ke=(0,s.useState)(null),Ze=ke[0],we=ke[1],Ce=(0,s.useState)(null===a||void 0===a?void 0:a.upstream_blocks),_e=Ce[0],Ee=Ce[1],Ie=(0,s.useState)((null===ne||void 0===ne?void 0:ne.length)||0),Te=Ie[0],Ae=Ie[1],Me=(0,s.useState)(a.uuid),Be=Me[0],Re=Me[1],Ne=Di.G8[le],Le=Di.x8[le],Ue=(0,s.useMemo)((function(){return null===f||void 0===f?void 0:f.filter((function(e){var n=e.type;return[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(n)}))}),[f]),He=(0,s.useMemo)((function(){return(0,Se.HK)(Ue,(function(e){return e.uuid}))}),[Ue]),ze=!!D.find((function(e){return e.uuid===a.uuid}))||(null===S||void 0===S?void 0:S.length)>=1&&b!==De.uF.IDLE,Ve=(0,s.useMemo)((function(){return null===S||void 0===S?void 0:S.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[S]),We=!!Ve.find((function(e){return e.error})),Ge=Ve.length>=1,Ke=(0,s.useMemo)((function(){return{blockType:a.type,hasError:We,selected:M}}),[a.type,We,M]);if(null!==Ve&&void 0!==Ve&&Ve.length){var Ye,qe,Qe=Ve.length-1;c=null===Ve||void 0===Ve||null===(Ye=Ve[Qe])||void 0===Ye||null===(qe=Ye.data)||void 0===qe?void 0:qe[0]}c?(c=(c=c.slice(1,c.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,$.Pb)(c)&&(r=JSON.parse(c))):(null===ne||void 0===ne?void 0:ne.length)>=1&&(r={},ne.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,o=n.variable_uuid;De.Gi.TEXT===i&&(0,$.Pb)(t)&&(r[o]=JSON.parse(t))})));var Je=(0,s.useCallback)((function(e){var n=Mi(Mi(Mi({},a),e),{},{configuration:Mi(Mi({},a.configuration),e.configuration)});A().then((function(){T({block:n,code:ve,ignoreAlreadyRunning:!0,runUpstream:!!_e.find((function(e){var n;return![h.DA.EXECUTED,h.DA.UPDATED].includes(null===(n=He[e])||void 0===n?void 0:n.status)}))})})),Ae((function(e){return e+1}))}),[a,He,ve,Ae,_e]),Xe=(0,s.useCallback)((function(e){he(e),E(e)}),[E,he]),$e=(0,s.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;de((function(n){return Mi(Mi({},n),e)}));var i=Mi(Mi({},a),{},{configuration:Mi(Mi(Mi({},se),e),{},{chart_type:le})});Y(i),Te&&t&&Je(i)}),[a,le,se,Te,Je,de,Y]);(0,s.useEffect)((function(){re({python:(0,Ti.Z)({autocompleteItems:u,block:a,blocks:f,pipeline:I})})}),[u,a,f,I]);var en=(0,s.useMemo)((function(){return(0,C.jsx)(Xn.Z,{autoHeight:!0,autocompleteProviders:ie,onChange:Xe,selected:M,setSelected:function(e){return L(!0===e?a:null)},setTextareaFocused:F,showLineNumbers:!1,textareaFocused:K||ct.oV.TABLE===le&&!be,value:ve,width:"100%"})}),[ie,a,le,ve,be,M,L,F,K,Xe]),nn=(0,s.useMemo)((function(){return(We||Ge)&&(0,C.jsx)(Si.Z,Mi(Mi({},Ke),{},{block:a,contained:!1,hideExtraInfo:!0,isInProgress:ze,messages:Ve,selected:M}))}),[a,Ke,We,Ge,ze,Ve,M]),tn=(0,Pe.Z)(be),rn=(0,Pe.Z)(q);(0,s.useEffect)((function(){var e,n=null===Q||void 0===Q||null===(e=Q.current)||void 0===e?void 0:e.getBoundingClientRect();tn!==be||rn!==q?(we(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&&we(t)}),100)):n&&we(n.width)}),[be,tn,Q,we,q,rn]);var on=(0,s.useMemo)((function(){var e=[];return _e.forEach((function(n,t){var i=He[n],r=(0,w.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:J}).accent;e.push((0,C.jsxs)(Z.Z,{ml:2,children:[(0,C.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,C.jsx)(k.Z,{color:r,inline:!0,onClick:function(){var e,n,t=null===p||void 0===p||null===(e=p.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,C.jsx)(O.ZP,{color:r,monospace:!0,small:!0,children:n})})]},n))})),e}),[p,He,J,_e]),ln=(0,s.useMemo)((function(){var e,n=[],t=null===Ne||void 0===Ne||null===(e=Ne.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return ct.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=se[e];if(t){var i,r,o=null===(i=Di.SR[le])||void 0===i||null===(r=i[e])||void 0===r?void 0:r.call(i);n.push((0,C.jsxs)(Z.Z,{ml:2,children:[(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",o&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,C.jsx)(O.ZP,{default:!0,inline:!0,small:!0,children:o})]})]},t))}})),n}),[le,se,Ne]),cn=(0,Pe.Z)(le),un=(0,Pe.Z)(_e);(0,s.useEffect)((function(){if((!cn&&le&&null!==_e&&void 0!==_e&&_e.length||(null===un||void 0===un||!un.length)&&(null===_e||void 0===_e?void 0:_e.length)>=1&&le)&&!ve&&(0,Dn.Qr)(se)&&Le){var e=Mi(Mi({},a),{},{upstream_blocks:_e});Le.configuration&&$e(Le.configuration(e)),Le.content&&Xe(Le.content(e))}}),[a,le,cn,se,ve,Le,$e,Xe,_e,un]);var an=(0,s.useMemo)((function(){return se[ct.v8]||1}),[se]),sn=(0,s.useMemo)((function(){return Object.entries(Ne||{}).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0],r=t[1];return Mi(Mi({},e),{},(0,o.Z)({},i,r.map((function(e){var n,t=e.autoRun,i=e.label,r=e.monospace,l=e.options,c=e.settings,u=void 0===c?{}:c,s=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,$.kC)(i()),monospace:r,onBlur:function(){return L(a)},onChange:function(e){return $e((0,o.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return L(a)},value:(null===se||void 0===se?void 0:se[d])||""},f=(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=n.sample_data;return null!==t&&void 0!==t&&t.columns?e.concat(t.columns):e}),[])):e}),[]);if(Di.VR.COLUMNS===s){var v=se[d]||[];n=(0,C.jsxs)(C.Fragment,{children:[(!u.maxValues||v.length<u.maxValues)&&(0,C.jsx)(U.Z,Mi(Mi({},p),{},{onChange:function(e){var n=se[d]||[],i=e.target.value;n.includes(i)?n=(0,Se.Od)(n,(function(e){return e===i})):n.push(i),$e((0,o.Z)({},d,n),{autoRun:t})},value:null,children:(0,Se.YC)(f.filter((function(e){return!v.includes(e)})),(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})),v.map((function(e){return(0,C.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,C.jsx)(Sn.Z,{label:e,onClick:function(){$e((0,o.Z)({},d,(0,Se.Od)(v,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(Di.VR.METRICS===s){var h=se[d]||[];n=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Metrics"}),(0,C.jsx)(O.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,C.jsxs)(Ii,{onChange:function(e,n){var i=n.resetValues,r=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]}))||($e((0,o.Z)({},d,h.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),r([null,null]),i()))},children:[(0,C.jsx)(U.Z,Mi(Mi({},p),{},{label:"aggregation",children:(0,Se.YC)(ct.bn,(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})),(0,C.jsx)(U.Z,Mi(Mi({},p),{},{label:"column",children:(0,Se.YC)(f,(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))}))]}),h.map((function(e){var n=e.aggregation,i=e.column;return(0,C.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,C.jsx)(Sn.Z,{label:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(O.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){$e((0,o.Z)({},d,(0,Se.Od)(h,(function(e){var t=e.aggregation,r=e.column;return n===t&&i===r}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=l?(0,C.jsx)(U.Z,Mi(Mi({},p),{},{children:l.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})):(0,C.jsx)(z.Z,Mi(Mi({},p),{},{type:s}));return(0,C.jsx)(Z.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[a,se,Ne,X,L,$e]),dn=sn.code,pn=sn.noCode,fn=(0,d.Db)(V.ZP.widgets.pipelines.useUpdate(null===I||void 0===I?void 0:I.uuid,a.uuid),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){ye(!1),g(),x()},onErrorCallback:function(e,n){return null===R||void 0===R?void 0:R({errors:n,response:e})}})}}),vn=(0,l.Z)(fn,1)[0],hn="ChartBlock/".concat(a.uuid),mn=(0,pe.y)(),bn=mn.registerOnKeyDown,gn=mn.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){gn(hn)}}),[gn,hn]),bn(hn,(function(e,n,t){je&&String(t[0])===String(ae.Uq)&&String(t[1])!==String(ae.zX)&&vn({widget:Mi(Mi({},a),{},{name:Be})})}),[a,je,Be,vn]),(0,C.jsx)(Ei.Z,{sm:12,md:12*an,children:(0,C.jsxs)(ki,{ref:n,children:[(0,C.jsx)(Z.Z,{mt:1,pt:1,px:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{flex:1,style:{position:"relative"},children:[(0,C.jsx)(Fe.Z,{bold:!1,fullWidth:!0,inputValue:Be,notRequired:!0,onBlur:function(){return setTimeout((function(){return ye(!1)}),300)},onChange:function(e){Re(e.target.value),e.preventDefault()},onClick:function(){B(!0),ye(!0)},onFocus:function(){B(!0),ye(!0)},small:!0,stacked:!0,value:!je&&a.uuid}),je&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(k.Z,{noWrapping:!0,onClick:function(){return vn({widget:Mi(Mi({},a),{},{name:Be})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(U.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Mi(Mi({},a),{},{upstream_blocks:n});Y(t),Je(t),Ee(n)},placeholder:"Source block",small:!0,value:(null===_e||void 0===_e?void 0:_e[0])||"",children:null===Ue||void 0===Ue?void 0:Ue.map((function(e){var n=e.uuid;return(0,C.jsx)("option",{value:n,children:n},n)}))}),(0,C.jsx)(Z.Z,{mr:1}),!ze&&(0,C.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Je(a)},uuid:"ChartBlock/run/".concat(a.uuid),children:(0,C.jsx)(W.Py,{size:2*P.iI})})}),De.uF.QUEUED===b&&(0,C.jsx)(H.Z,{color:(J||G.Z).content.active,small:!0,type:"cylon"}),De.uF.BUSY===b&&(0,C.jsx)(H.Z,{color:(J||G.Z).content.active,small:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return ge((function(e){return!e}))},selected:be,uuid:"ChartBlock/edit/".concat(a.uuid),children:(0,C.jsx)(W.I8,{size:2*P.iI})})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return v(a)},uuid:"ChartBlock/delete/".concat(a.uuid),children:(0,C.jsx)(W.rF,{size:2*P.iI})})})]})]})}),(0,C.jsx)(Z.Z,{mt:1}),(0,C.jsxs)(y.Z,{fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:6,ref:Q,children:r&&!(0,Dn.Qr)(r)&&(0,C.jsx)(Z.Z,{pb:3,children:(0,C.jsx)(_i,{block:Mi(Mi({},a),{},{configuration:Mi(Mi({},a.configuration),se)}),data:r,width:Ze})})}),be&&(0,C.jsx)(Zi,{children:(0,C.jsxs)(y.Z,{flexDirection:"column",fullWidth:!0,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(U.Z,{onChange:function(e){var n=e.target.value,t=Mi(Mi({},a),{},{configuration:Mi(Mi({},se),{},{chart_type:n})});Y(t),Je(t),ce(n)},placeholder:"Select chart type",value:le,children:ct.CK.map((function(e){return(0,C.jsx)("option",{value:e,children:(0,$.kC)(e)},e)}))})}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(U.Z,{onChange:function(e){return $e((0,o.Z)({},ct.v8,e.target.value))},placeholder:"Chart width",value:(null===se||void 0===se?void 0:se[ct.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return(0,C.jsx)("option",{value:i,children:t},t)}))})}),pn]})})]}),be&&!(null===dn||void 0===dn||!dn.length)&&h.t6.SQL!==a.language&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{my:1,px:1,children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Custom chart code"}),(0,C.jsxs)(O.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,C.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,C.jsxs)(Oi,{children:[_e.length>=1&&(0,C.jsxs)(Pi,{children:[(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",on]}),(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",ln]})]}),en]})]}),nn&&(0,C.jsx)(Z.Z,{px:1,children:nn})]})})}var Ri=s.forwardRef(Bi),Ni=t(97361),Li=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];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 Ui(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,o.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 Hi=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,r=e.deleteWidget,l=e.messages,c=e.onChangeChartBlock,u=e.runBlock,a=e.runningBlocks,d=e.savePipelineContent,p=e.selectedBlock,f=e.setAnyInputFocused,v=e.setErrors,h=e.setSelectedBlock,m=e.setTextareaFocused,b=e.textareaFocused,g=e.updateWidget,x=e.widgets,j=e.width,k=(0,_n.Z)(e,Li),Z=(0,s.useMemo)((function(){return a.reduce((function(e,n,t){return Ui(Ui({},e),{},(0,o.Z)({},n.uuid,Ui(Ui({},n),{},{priority:t})))}),{})}),[a]);return(0,C.jsxs)(y.Z,{flexDirection:"column",fullWidth:!0,children:[(0,C.jsx)(Ni.Z,{fullHeight:!0,style:{marginLeft:.5*P.iI,marginRight:.5*P.iI},children:null===x||void 0===x?void 0:x.map((function(e){var o=e.uuid,x=Z[o],y=x?0===x.priority?De.uF.BUSY:De.uF.QUEUED:De.uF.IDLE;return i.current[o]=(0,s.createRef)(),(0,s.createElement)(Ri,Ui(Ui({},k),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:r,executionState:y,key:o,messages:l[o],onChangeContent:function(e){return c(o,e)},ref:i.current[o],runBlock:u,runningBlocks:a,savePipelineContent:d,selected:(null===p||void 0===p?void 0:p.uuid)===o,setAnyInputFocused:f,setErrors:v,setSelectedBlock:h,setTextareaFocused:m,textareaFocused:b,updateWidget:g,width:j}))}))}),(0,C.jsx)("div",{style:{height:"80vh"}})]})},zi=t(48952),Vi=m.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),Wi=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,r=void 0===i?"0 0 358 305":i;return(0,C.jsxs)(Vi,{height:t*(305/358),viewBox:r,width:t,children:[(0,C.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,C.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,C.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,C.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,C.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,C.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,C.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,C.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,C.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,C.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,C.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,C.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,C.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,C.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,C.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,C.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 Gi,Ki=function(e){var n=e.blocksInNotebook;return e.extensionOption,(0,s.useMemo)((function(){return(null===n||void 0===n?void 0:n.filter((function(e){var n=e.type;return h.tf.DBT===n})))||[]}),[n]),(0,C.jsx)(C.Fragment,{})};!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}(Gi||(Gi={}));var Yi=t(66653);function qi(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 Qi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ji=function(e){var n,t,i=e.block,r=e.blockActionDescription,o=e.blocks,l=e.inputPlaceholder,c=e.loading,u=e.onClickTag,a=e.runBlockAndTrack,d=e.supportedUpstreamBlockLanguages,p=e.supportedUpstreamBlockTypes,f=e.updateBlock,v=(0,s.useContext)(m.ThemeContext),h=(0,s.useState)(""),k=h[0],_=h[1],S=(0,s.useState)(!1),E=S[0],I=S[1],D=(0,s.useState)(null),A=D[0],M=D[1],B=(0,s.useMemo)((function(){return(0,Se.HK)(o,(function(e){return e.uuid}))}),[o]);(0,s.useEffect)((function(){A||M((0,Se.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,A]);var R=(0,s.useMemo)((function(){return(null===o||void 0===o?void 0:o.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===k||void 0===k?void 0:k.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===k||void 0===k?void 0:k.toLowerCase())))&&(null===p||void 0===p?void 0:p.includes(t))})))||[]}),[k,o,p]),N=(0,s.useMemo)((function(){var e=[];return null===R||void 0===R||R.forEach((function(n,t){var i=n.color,r=n.language,o=n.type,l=n.uuid,c=(0,w.qn)(o,{blockColor:i,theme:v}).accent;t>=1&&e.push((0,C.jsx)(x.Z,{light:!0},"divider-".concat(l)));var u=!(null===A||void 0===A||!A[l]),a=null!==d&&"undefined"!==typeof d&&!(null!==d&&void 0!==d&&d.includes(r));e.push((0,C.jsx)(Z.Z,{px:2,py:1,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(g.Z,{color:c,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{monospace:!0,muted:a,small:!0,children:l})]}),a&&(0,C.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[r," support coming soon"]}),!a&&(0,C.jsx)(b.Z,{checked:!a&&u,disabled:a,onClick:function(){M((function(e){var n=Qi({},e);return u?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[R,v,A]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(ce.Z,{onClickOutside:function(){return I(!1)},open:!0,children:[(0,C.jsx)(z.Z,{beforeIcon:(0,C.jsx)(W.HN,{}),borderless:!0,compact:!0,onChange:function(e){return _(e.target.value)},onClick:function(e){(0,Yi.j)(e),I(!0)},onFocus:function(e){(0,Yi.j)(e),I(!0)},placeholder:l,small:!0,value:k}),E&&(0,C.jsxs)(C.Fragment,{children:[N,(0,C.jsx)(Z.Z,{mx:1,children:(0,C.jsx)(y.Z,{justifyContent:"flex-end",children:(0,C.jsx)(T.Z,{compact:!0,loading:c,onClick:function(){return f({block:i,upstream_blocks:Object.keys(A)}).then((function(){return I(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!E&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,C.jsxs)(Z.Z,{pb:1,pr:1,children:[r&&(0,C.jsx)(Z.Z,{mt:1,pl:1,children:(0,C.jsx)(O.ZP,{muted:!0,small:!0,children:r})}),(0,C.jsx)(y.Z,{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===B||void 0===B?void 0:B[e];if(!n)return(0,C.jsx)("div",{},e);var t=n.color,r=n.type,o=(0,w.qn)(r,{blockColor:t,theme:v}).accentLight;return(0,C.jsx)(Z.Z,{ml:1,mt:1,children:(0,C.jsx)(T.Z,{backgroundColor:o,compact:!0,disabled:!a,onClick:function(e){(0,Yi.j)(e),u?u(n):null===a||void 0===a||a({block:Qi(Qi({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},Xi=t(19140);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 er(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,o.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 nr=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,r=e.blocks,c=e.blocksInNotebook,u=e.deleteBlock,a=e.extensionOption,p=e.fetchFileTree,f=e.fetchPipeline,v=e.interruptKernel,m=e.messages,b=e.onChangeCallbackBlock,g=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,y=e.runningBlocks,w=e.savePipelineContent,_=e.selectedBlock,S=e.setAnyInputFocused,E=e.setErrors,I=e.setSelectedBlock,T=e.setTextareaFocused,D=e.showBrowseTemplates,A=e.textareaFocused,M=(0,s.useRef)(null),B=(0,s.useState)(!1),L=B[0],F=B[1],U=(a||{}).uuid,H=(x||{}).extensions,z=(0,s.useMemo)((function(){return(null===a||void 0===a?void 0:a.templates)||[]}),[a]),G=(0,s.useMemo)((function(){return null===H||void 0===H?void 0:H[U]}),[U,H]),K=(0,s.useMemo)((function(){return(null===G||void 0===G?void 0:G.blocks)||[]}),[G]),Y=(0,s.useMemo)((function(){return(0,Se.HK)(K,(function(e){return e.uuid}))}),[K]),q=(0,s.useMemo)((function(){return U===(null===_||void 0===_?void 0:_.extension_uuid)&&Y[null===_||void 0===_?void 0:_.uuid]}),[Y,U,_]),Q=(0,s.useMemo)((function(){return y.reduce((function(e,n,t){return er(er({},e),{},(0,o.Z)({},n.uuid,er(er({},n),{},{priority:t})))}),{})}),[y]),J=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return V.ZP.blocks.pipelines.useUpdate(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,ee.wD)(e,{callback:function(){f()},onErrorCallback:function(e,n){return null===E||void 0===E?void 0:E({errors:n,response:e})}})}}),X=(0,l.Z)(J,2),$=X[0],ne=X[1].isLoading,te=(0,s.useMemo)((function(){return K.map((function(e,n){var o=er(er({},e),{},{extension_uuid:U}),l=o.type,a=o.uuid,d=(null===_||void 0===_?void 0:_.uuid)===a,k=Q[a],O=k?0===k.priority?De.uF.BUSY:De.uF.QUEUED:De.uF.IDLE,D="".concat(l,"s/").concat(a,".py");return i.current[D]=(0,s.createRef)(),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(R.Z,{allBlocks:r,autocompleteItems:t,block:o,blockIdx:n,blockRefs:i,blocks:r,defaultValue:o.content,deleteBlock:function(e){u(er(er({},e),{},{extension_uuid:U})),S(!1)},executionState:O,extraContent:(0,C.jsx)(Ji,{block:o,blockActionDescription:"Click a block name to run expectations on it.",blocks:c,inputPlaceholder:"Select blocks to run expectations on",loading:ne,supportedUpstreamBlockLanguages:[h.t6.PYTHON],supportedUpstreamBlockTypes:[h.tf.DATA_EXPORTER,h.tf.DATA_LOADER,h.tf.DBT,h.tf.TRANSFORMER],updateBlock:$}),fetchFileTree:p,fetchPipeline:f,hideRunButton:!0,interruptKernel:v,messages:m[a],noDivider:!0,onCallbackChange:function(e){return b(l,a,e)},onChange:function(e){return g(l,a,e)},pipeline:x,ref:i.current[D],runBlock:j,runningBlocks:y,savePipelineContent:w,selected:d,setAnyInputFocused:S,setErrors:E,setSelected:function(e){return I(!0===e?o:null)},setTextareaFocused:T,textareaFocused:d&&A})},a)}))}),[t,i,r,c,u,K,U,p,f,v,ne,m,b,g,x,j,y,Q,w,_,S,E,I,T,A,$]),ie="Extensions/GreatExpectations/index",re=(0,pe.y)(),oe=re.disableGlobalKeyboardShortcuts,le=re.registerOnKeyDown,ue=re.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){ue(ie)}}),[ue,ie]),le(ie,(function(e,n){!oe&&q&&((0,at.y)([ae.zX,ae.Um],n)||(0,at.y)([ae.PQ,ae.Um],n))&&(e.preventDefault(),w())}),[q,w]),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(O.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.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,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,C.jsx)(k.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),te,(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(ce.Z,{onClickOutside:function(){return F(!1)},open:!0,children:(0,C.jsx)(Vn.Z,{disableKeyboardShortcuts:!0,items:null===z||void 0===z?void 0:z.map((function(e){var t=e.description,i=e.name,r=e.path;return{label:function(){return i},onClick:function(){return n({config:{template_path:r},extension_uuid:U,type:h.tf.EXTENSION},(null===K||void 0===K?void 0:K.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,ut.hr)((function(e){return n(er(er({},e),{},{extension_uuid:U,type:h.tf.EXTENSION}),(null===K||void 0===K?void 0:K.length)||0)}),h.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:D})),onClickCallback:function(){return F(!1)},open:L,parentRef:M,uuid:"Extension",children:(0,C.jsx)(N.ZP,{beforeElement:(0,C.jsx)(Xi.Wx,{teal:!0,children:(0,C.jsx)(W.mm,{size:Xi.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),F(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},tr=t(59e3),ir=["pipeline"];function rr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function or(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?rr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var lr=function(e){var n=e.pipeline,t=(0,_n.Z)(e,ir),i=(0,p.useRouter)(),r=V.ZP.extension_options.list().data,o=(0,s.useMemo)((function(){return(null===r||void 0===r?void 0:r.extension_options)||[]}),[r]),l=(0,s.useMemo)((function(){return(0,Se.HK)(o,(function(e){return e.uuid}))}),[o]),c=(0,s.useState)(null),u=c[0],a=c[1],d=(0,s.useMemo)((function(){return l[u]}),[l,u]),f=(0,s.useMemo)((function(){return or(or({},t),{},{pipeline:n})}),[n,t]);(0,s.useEffect)((function(){var e;a(null===(e=(0,tr.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var v=(0,s.useMemo)((function(){return n?(Gi.GREAT_EXPECTATIONS===u?e=nr:Gi.DBT===u&&(e=Ki),e?(0,C.jsx)(e,or(or({},f),{},{extensionOption:d})):void 0):null;var e}),[d,n,u,f]);return(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsxs)(Z.Z,{p:P.cd,children:[!u&&(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!r&&!u&&(0,C.jsx)(H.Z,{}),v,!u&&(null===o||void 0===o?void 0:o.map((function(e,n){var t=e.description,r=e.name,o=e.uuid;return(0,C.jsx)(Z.Z,{mt:n>=1?P.cd:0,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Ee.u7)({extension:o},{pushHistory:!0})},preventDefault:!0,children:(0,C.jsx)(Ae.Z,{dark:!0,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Wn.Z,{fullWidth:!1,children:(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(y.Z,{alignItems:"center",children:(0,C.jsx)("img",{alt:r,height:3*P.iI,src:"".concat(i.basePath,"/images/extensions/").concat(o,"/logo.png"),width:3*P.iI})})})}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(O.ZP,{bold:!0,children:r}),(0,C.jsx)(O.ZP,{default:!0,small:!0,children:t})]})]}),(0,C.jsx)(W._Q,{})]})})})},o)})))]})})},cr=t(23351),ur=t(21764),ar=t(22673),sr=t(52769),dr=t(9468),pr=(P.iI,dr.O$,P.iI,Jt.dN,m.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],mt.Wi,Ue.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),m.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*P.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),m.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),fr=m.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*P.iI,"px;\n ")})),vr=t(19963);var hr=function(e){var n=e.copyText,t=e.deleteVariable,i=e.fetchVariables,r=e.hideEdit,o=e.obfuscate,c=e.pipelineUUID,u=e.variable,a=u.uuid,p=(u.type,u.value),f=(0,s.useRef)(null),v=(0,s.useState)(!1),h=v[0],m=v[1],b=(0,s.useState)(a),g=b[0],x=b[1],y=(0,s.useState)(p),k=y[0],Z=y[1],w=(0,s.useState)(!1),_=w[0],S=w[1],E=(0,d.Db)(V.ZP.variables.pipelines.useUpdate(c,a),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){S(!1),i()}})}}),I=(0,l.Z)(E,1)[0],T=(0,s.useCallback)((function(e){if("Enter"===e.key){var n=k;try{n=JSON.parse(k)}catch(t){}I({variable:{name:g,value:n}})}else"Escape"===e.key&&S(!1)}),[g,k]);(0,s.useEffect)((function(){var e;_&&(null===f||void 0===f||null===(e=f.current)||void 0===e||e.focus())}),[_,f]);var D=n||"kwargs['".concat(a,"']");return(0,C.jsx)("div",{onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},children:(0,C.jsxs)(Ni.Z,{children:[(0,C.jsx)(Ei.Z,{md:1,hiddenSmDown:!0,children:(0,C.jsx)(fr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:vr.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(D),ur.Am.success("Successfully copied to clipboard.",{position:ur.Am.POSITION.BOTTOM_RIGHT,toastId:a})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(a),withIcon:!0,children:(0,C.jsx)(W.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Ei.Z,{md:4,children:_?(0,C.jsx)(fr,{children:(0,C.jsx)(z.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:T,paddingHorizontal:0,placeholder:"variable",small:!0,value:g})}):(0,C.jsx)(fr,{children:(0,C.jsx)(O.ZP,{color:Qt.Or,monospace:!0,small:!0,textOverflow:!0,children:a})})}),(0,C.jsx)(Ei.Z,{md:7,children:_?(0,C.jsx)(fr,{children:(0,C.jsx)(z.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){Z(e.target.value),e.preventDefault()},onKeyDown:T,paddingHorizontal:0,placeholder:"enter value",ref:f,small:!0,value:k})}):(0,C.jsxs)(fr,{children:[o?(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:"********"}):(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:p}),(0,C.jsxs)(j.Z,{children:[!r&&h&&(0,C.jsx)(N.ZP,{backgroundColor:vr.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){S(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(a),withIcon:!0,children:(0,C.jsx)(W.I8,{size:2.5*P.iI})}),t&&h&&(0,C.jsx)(N.ZP,{backgroundColor:vr.qJ,borderless:!0,inline:!0,muted:!0,onClick:t,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(a),withIcon:!0,children:(0,C.jsx)(W.rF,{size:2.5*P.iI})})]})]})})]})})},mr=t(93348),br=t(58122);var gr=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,r=e.setErrorMessages,o=e.variables,c=e.width,u=(0,s.useState)(!1),a=u[0],p=u[1],f=(0,s.useState)(),v=f[0],m=f[1],b=(0,s.useState)(),g=b[0],x=b[1],j=null===t||void 0===t?void 0:t.uuid,w=(0,d.Db)(V.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,ee.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;r((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),_=(0,l.Z)(w,1)[0],S=(0,d.Db)((function(e){return V.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),E=(0,l.Z)(S,1)[0],I=(0,s.useCallback)((function(e){if("Enter"===e.key){var t=g;try{t=JSON.parse(g)}catch(i){}_({variable:{name:v,value:t}}).then((function(){n(),m(null),x(null)})),p(!1)}else"Escape"===e.key&&p(!1)}),[_,n,v,g]),T=(0,s.useMemo)((function(){return c-4*P.iI}),[c]),D=(0,s.useMemo)((function(){return(0,br.wx)(o,(function(e){return e.uuid===sr.C}))}),[o]),A=(0,s.useMemo)((function(){return(0,br.wx)(o,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,o]),M=(0,s.useMemo)((function(){return(0,C.jsxs)(pr,{width:T,children:[a&&(0,C.jsxs)(Ni.Z,{children:[(0,C.jsx)(Ei.Z,{md:1,children:(0,C.jsx)(fr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:vr.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(v),ur.Am.success("Successfully copied to clipboard.",{position:ur.Am.POSITION.BOTTOM_RIGHT,toastId:v})},uuid:"Sidekick/GlobalVariables/".concat(v),withIcon:!0,children:(0,C.jsx)(W.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Ei.Z,{md:4,children:(0,C.jsx)(fr,{children:(0,C.jsx)(z.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){m(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"variable",small:!0,value:v})})}),(0,C.jsx)(Ei.Z,{md:7,children:(0,C.jsx)(fr,{children:(0,C.jsx)(z.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"enter value",small:!0,value:g})})})]}),null===D||void 0===D?void 0:D.map((function(e){return(0,C.jsx)(hr,{deleteVariable:function(){return E(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[E,D,v,g,j,m,x,p,a,T]),B=(0,s.useMemo)((function(){return(0,C.jsx)(pr,{width:T,children:null===A||void 0===A?void 0:A.map((function(e){return(0,C.jsx)(hr,{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}))})}),[A,i,T]);return(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(gn.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:W.mm,blackBorder:!0,inline:!0,onClick:function(){return p((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:M}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.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,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For Python (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(ar.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For SQL (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(ar.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For R (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(ar.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(gn.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,C.jsx)(Z.Z,{mb:P.cd}),(0,C.jsx)(O.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(mr.Xm).map((function(e,n){var t;return(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{large:!0,monospace:!0,children:(0,$.vg)(null===(t=mr.Z4[e])||void 0===t?void 0:t.call(mr.Z4))})}),(0,br.JZ)([],e).map((function(n,t){return(0,C.jsx)(hr,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),A&&A.length>0&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{my:2,children:(0,C.jsx)(gn.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,C.jsx)(Z.Z,{mb:2,children:B}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{children:["Output variables can be used in any ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:h.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(ar.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"})})]})]})},xr=t(89565),jr=t.n(xr),yr=t(22782),kr=m.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Ue.y$)()),Zr=m.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],Ue.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return!e.height&&"\n max-height: ".concat(e.maxHeight||300,"px;\n ")}));function 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 Pr(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,o.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}var wr=function(e){var n=e.cancelPipeline,t=e.checkIfPipelineRunning,i=e.executePipeline,r=e.isPipelineExecuting,o=e.pipelineExecutionHidden,l=e.pipelineMessages,c=e.setPipelineExecutionHidden,u=(0,s.useMemo)((function(){return(null===l||void 0===l?void 0:l.length)||0}),[l]),a=(0,s.useMemo)((function(){return u>100?l.slice(-100):l}),[u,l]),d=(0,s.useCallback)((function(){var e=!o;c(e),(0,we.t8)(we.Q9,e)}),[o,c]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(kr,{children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(W.JM,{inverted:!0,size:2*P.iI}),compact:r,disabled:r,loading:r,onClick:i,success:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,C.jsx)(Z.Z,{ml:1}),r&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(W.x8,{inverted:!0,size:2*P.iI}),onClick:n,success:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,C.jsx)(Z.Z,{ml:1})]}),(0,C.jsx)(T.Z,{onClick:t,secondary:!0,children:(0,C.jsx)(O.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(O.ZP,{children:"Hide"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(In.Z,{checked:o,onCheck:d})]})]})}),!o&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(Zr,{noScrollbarTrackBackground:!0,children:(0,C.jsx)(yr.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:a.map((function(e,n){var t=e.data,i=e.type,r=[],o=(r=(r=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return r.map((function(e,t){var r,l={first:0===n&&0===t,last:n===u-1&&t===o-1};return De.jU.includes(i)?r=(0,C.jsx)(yr.T5,Pr(Pr({},l),{},{children:(0,C.jsx)(O.ZP,{monospace:!0,preWrap:!0,children:(0,C.jsx)(jr(),{children:e})})})):i===De.Gi.IMAGE_PNG&&(r=(0,C.jsx)("div",{style:{backgroundColor:"white"},children:(0,C.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,C.jsx)("div",{children:r},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})};var Cr=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,r=e.setErrorMessages,o=e.width,c=(0,s.useState)(!1),u=c[0],a=c[1],p=(0,s.useState)(),f=p[0],v=p[1],h=(0,s.useState)(),m=h[0],b=h[1],g=(0,s.useMemo)((function(){return o-P.cd*P.iI*2}),[o]),x=(0,d.Db)(V.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;r((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),j=(0,l.Z)(x,1)[0],k=(0,d.Db)((function(e){return V.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),w=(0,l.Z)(k,1)[0],_=(0,s.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:f,value:m}}).then((function(){n(),v(null),b(null)})),a(!1)):"Escape"===e.key&&a(!1)}),[j,n,f,m]);return(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(y.Z,{alignItems:"center",children:[(0,C.jsx)(gn.Z,{level:4,monospace:!0,children:"Secrets"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:W.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{children:[(0,C.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."]})}),u&&(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(pr,{width:g,children:[u&&(0,C.jsxs)(Ni.Z,{children:[(0,C.jsx)(Ei.Z,{md:1,children:(0,C.jsx)(fr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:vr.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(f,") }}")),ur.Am.success("Successfully copied to clipboard.",{position:ur.Am.POSITION.BOTTOM_RIGHT,toastId:f})},uuid:"Sidekick/Secrets/".concat(f),withIcon:!0,children:(0,C.jsx)(W.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Ei.Z,{md:4,children:(0,C.jsx)(fr,{children:(0,C.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){v(e.target.value),e.preventDefault()},onKeyDown:_,paddingHorizontal:0,placeholder:"secret name",small:!0,value:f})})}),(0,C.jsx)(Ei.Z,{md:7,children:(0,C.jsx)(fr,{children:(0,C.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){b(e.target.value),e.preventDefault()},onKeyDown:_,paddingHorizontal:0,placeholder:"secret value",small:!0,value:m})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,C.jsx)(hr,{copyText:e.name,deleteVariable:function(){return w(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.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,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(ar.Z,{language:"yaml",small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n ",maxWidth:g})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(ar.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n ",maxWidth:g})})]})},_r=t(33699),Sr=t(72454),Er=t(64155),Ir=t(91835);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 Dr(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,o.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 Ar=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,r=e.autocompleteItems,c=e.blockRefs,u=e.blocks,a=e.blocksInNotebook,p=e.deleteBlock,f=e.displayBlockName,v=e.fetchFileTree,m=e.fetchPipeline,b=e.interruptKernel,g=e.messages,x=(e.onChangeCallbackBlock,e.onChangeCodeBlock),j=e.onSelectBlockFile,y=e.pipeline,w=e.runBlock,_=e.runningBlocks,S=e.savePipelineContent,E=e.selectedBlock,I=e.setAnyInputFocused,T=e.setErrors,D=e.setHiddenBlocks,A=e.setSelectedBlock,M=e.setTextareaFocused,B=e.showBrowseTemplates,L=e.textareaFocused,F=(0,s.useRef)(null),U=(0,s.useState)(!1),H=U[0],z=U[1],G=(0,tr.iV)().block_uuid;(0,s.useEffect)((function(){var e=u.find((function(e){var n,t=e.uuid;return(null===G||void 0===G||null===(n=G.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)||(D((function(n){return Dr(Dr({},n),{},(0,o.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[G,u,j,E,D]);var K=(y||{}).type,Y=(0,s.useMemo)((function(){return(0,Se.HK)(t||[],(function(e){return e.uuid}))}),[t]),q=V.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,Q=(0,s.useMemo)((function(){return(null===q||void 0===q?void 0:q.block_templates)||[]}),[q]),J=(0,s.useCallback)((function(e){return n(e,(null===Y||void 0===Y?void 0:Y.length)||0)}),[n,Y]),X=(0,s.useMemo)((function(){return(0,ut.oM)(Q,J)}),[J,Q]),ne=(0,s.useMemo)((function(){return(0,ut.hr)(J,i,K,{blockTemplatesByBlockType:X,languages:[h.t6.PYTHON],showBrowseTemplates:B})}),[J,i,X,K]),te=(0,s.useMemo)((function(){return null===Y||void 0===Y?void 0:Y[null===E||void 0===E?void 0:E.uuid]}),[Y,E]),ie=(0,s.useMemo)((function(){return _.reduce((function(e,n,t){return Dr(Dr({},e),{},(0,o.Z)({},n.uuid,Dr(Dr({},n),{},{priority:t})))}),{})}),[_]),re=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return V.ZP.blocks.pipelines.useUpdate(null===y||void 0===y?void 0:y.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,ee.wD)(e,{callback:function(){m()},onErrorCallback:function(e,n){return null===T||void 0===T?void 0:T({errors:n,response:e})}})}}),oe=(0,l.Z)(re,2),le=oe[0],ue=oe[1].isLoading,se=(0,s.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e,n){var t=e.type,i=e.uuid,l=(null===E||void 0===E?void 0:E.uuid)===i,d=ie[i],k=d?0===d.priority?De.uF.BUSY:De.uF.QUEUED:De.uF.IDLE,O="".concat(t,"s/").concat(i,".py");return c.current[O]=(0,s.createRef)(),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(R.Z,{allBlocks:u,autocompleteItems:r,block:e,blockIdx:n,blockRefs:c,blocks:u,defaultValue:e.content,deleteBlock:function(e){p(Dr({},e)),I(!1)},executionState:k,extraContent:(0,C.jsx)(Ji,{block:e,blocks:a,inputPlaceholder:"Select blocks to add ".concat((0,$._6)(f,null)," to"),loading:ue,onClickTag:function(e){D((function(n){return Dr(Dr({},n),{},(0,o.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[h.tf.CUSTOM,h.tf.DATA_EXPORTER,h.tf.DATA_LOADER,h.tf.DBT,h.tf.SCRATCHPAD,h.tf.SENSOR,h.tf.TRANSFORMER],updateBlock:le}),fetchFileTree:v,fetchPipeline:m,hideRunButton:!0,interruptKernel:b,messages:g[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:y,ref:c.current[O],runBlock:w,runningBlocks:_,savePipelineContent:S,selected:l,setAnyInputFocused:I,setErrors:T,setSelected:function(n){return A(!0===n?e:null)},setTextareaFocused:M,textareaFocused:l&&L})},i)}))}),[t,r,c,u,a,p,f,v,m,b,ue,g,x,j,y,w,_,ie,S,E,I,T,D,A,M,L,le]),de="".concat(f,"/index"),fe=(0,pe.y)(),ve=fe.disableGlobalKeyboardShortcuts,he=fe.registerOnKeyDown,me=fe.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){me(de)}}),[me,de]),he(de,(function(e,n){!ve&&te&&((0,at.y)([ae.zX,ae.Um],n)||(0,at.y)([ae.PQ,ae.Um],n))&&(e.preventDefault(),S())}),[te,S]),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Run 1 or more ",(0,$.wX)(f)," block functions whenever another block succeeds or fails."]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Learn more about ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,$.wX)((0,$._6)(f,null)),"/overview"),openNewWindow:!0,children:(0,$.wX)((0,$._6)(f,null))}),"."]})})]}),se,(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(ce.Z,{onClickOutside:function(){return z(!1)},open:!0,children:(0,C.jsx)(Vn.Z,{disableKeyboardShortcuts:!0,items:ne,onClickCallback:function(){return z(!1)},open:H,parentRef:F,uuid:f,children:(0,C.jsxs)(N.ZP,{beforeElement:(0,C.jsx)(Xi.Wx,{rose:i===h.tf.CALLBACK,children:(0,C.jsx)(W.mm,{size:Xi.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),z(!0)},uuid:"AddNewBlocks/".concat(f),children:[(0,$.kC)(f)," block"]})})})})]})},Mr=t(45419);function Br(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?Br(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Br(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Nr=[{Icon:W.AQ,name:"Callbacks",uuid:Mr.Q.CALLBACK},{Icon:W.hW,name:"Conditionals",uuid:Mr.Q.CONDITIONAL}];var Lr=function(e){var n=(0,Ir.Z)({},e),t=(0,p.useRouter)(),i=(0,s.useState)(null),r=i[0],o=i[1];(0,s.useEffect)((function(){var e;o(null===(e=(0,tr.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,s.useMemo)((function(){var e,t;if(Mr.Q.CALLBACK===r)e={addOnBlockType:h.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(Mr.Q.CONDITIONAL===r){var i;e={addOnBlockType:h.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,C.jsx)(Ar,Rr(Rr({},e),n))}),[n,r]);return(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsxs)(Z.Z,{p:P.cd,children:[l,!r&&(null===Nr||void 0===Nr?void 0:Nr.map((function(e,n){var t=e.name,i=e.uuid,r=e.Icon;return(0,C.jsx)(Z.Z,{mt:n>=1?P.cd:0,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Ee.u7)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,C.jsx)(Ae.Z,{dark:!0,children:(0,C.jsxs)(y.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Wn.Z,{fullWidth:!1,children:(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(y.Z,{alignItems:"center",children:(0,C.jsx)(r,{fill:"#885EFF",size:2*P.iI})})})}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsx)(j.Z,{flexDirection:"column",children:(0,C.jsx)(O.ZP,{bold:!0,children:t})})]}),(0,C.jsx)(W._Q,{})]})})})},i)})))]})})};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 Ur(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,o.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 Hr=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,r=e.autocompleteItems,l=e.blockRefs,c=e.blocks,u=e.blocksInNotebook,a=e.cancelPipeline,d=e.chartRefs,p=e.checkIfPipelineRunning,v=e.deleteBlock,h=e.deleteWidget,m=e.editingBlock,b=e.executePipeline,g=e.fetchFileTree,x=e.fetchPipeline,j=e.fetchSecrets,k=e.fetchVariables,w=e.globalDataProducts,_=e.globalVariables,S=e.insights,E=e.interruptKernel,I=e.isPipelineExecuting,D=e.lastTerminalMessage,A=e.messages,M=e.metadata,B=e.onChangeCallbackBlock,R=e.onChangeChartBlock,N=e.onChangeCodeBlock,L=e.onSelectBlockFile,U=e.pipeline,H=e.pipelineMessages,z=e.runBlock,V=e.runningBlocks,G=e.sampleData,K=e.savePipelineContent,Y=e.secrets,q=e.selectedBlock,Q=e.selectedFilePath,J=e.sendTerminalMessage,X=e.setAllowCodeBlockShortcuts,$=e.setAnyInputFocused,ee=e.setDepGraphZoom,ne=e.setDisableShortcuts,te=e.setEditingBlock,ie=e.setErrors,re=e.setHiddenBlocks,oe=e.setSelectedBlock,le=e.setTextareaFocused,ce=e.showBrowseTemplates,ue=e.statistics,ae=e.textareaFocused,se=e.treeRef,de=e.updateWidget,pe=e.widgets,fe=(0,gt.i)().height,ve=mt.uX,he=(0,s.useState)([]),me=he[0],be=he[1],ge=(0,s.useState)(!!(0,we.U2)(we.Q9)),xe=ge[0],je=ge[1],ye=(0,s.useMemo)((function(){return i-(Sr.k1+1)}),[i]),ke=((null===m||void 0===m?void 0:m.upstreamBlocks)||{}).block,Ze=((null===G||void 0===G?void 0:G.columns)||[]).slice(0,100),Oe=(0,s.useMemo)((function(){return(null===G||void 0===G?void 0:G.rows)||[]}),[G]),Pe=(0,s.useMemo)((function(){return(null===M||void 0===M?void 0:M.column_types)||{}}),[M]),Ce=(0,s.useMemo)((function(){return(null===S||void 0===S?void 0:S[1])||{}}),[S]),_e=(0,s.useMemo)((function(){return(0,Se.HK)((null===S||void 0===S?void 0:S[0])||[],(function(e){return e.feature.uuid}))}),[S]),Ee=!!G,Ie=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===U||void 0===U?void 0:U.type)}),[U]),Te=F.qL.STREAMING!==(null===U||void 0===U?void 0:U.type)?-70:xe?-16:300,De=(0,s.useCallback)((0,dr.Fk)({columnTypes:Pe,columns:Ze,insightsByFeatureUUID:_e,insightsOverview:Ce,noColumnLinks:!0,statistics:ue}),[Pe,Ze,_e,Ce,ue]),Ae=(0,s.useMemo)((function(){return(0,C.jsx)(gr,{blocks:c,fetchVariables:k,pipeline:U,selectedBlock:q,setErrorMessages:be,variables:_,width:ye})}),[ye,c,k,_,U,q]),Me=(0,s.useMemo)((function(){return(0,C.jsx)(cr.Z,{selectedBlock:q,selectedFilePath:Q,setErrors:ie,width:ye>Ue.nn?ye-Ue.nn:ye})}),[ye,q,Q,ie]),Be=(0,s.useMemo)((function(){return(0,C.jsx)(Cr,{fetchSecrets:j,pipelineUUID:null===U||void 0===U?void 0:U.uuid,secrets:Y,setErrorMessages:be,width:ye})}),[ye,j,U,Y]),Re=(0,s.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:r,blockRefs:l,blocks:c,blocksInNotebook:u,deleteBlock:v,fetchFileTree:g,fetchPipeline:x,interruptKernel:E,messages:A,onChangeCallbackBlock:B,onChangeCodeBlock:N,onSelectBlockFile:L,pipeline:U,runBlock:z,runningBlocks:V,savePipelineContent:K,selectedBlock:q,setAnyInputFocused:$,setErrors:ie,setHiddenBlocks:re,setSelectedBlock:oe,setTextareaFocused:le,showBrowseTemplates:ce,textareaFocused:ae}}),[t,r,l,c,u,v,g,x,E,A,B,N,L,U,z,V,K,q,$,ie,re,oe,le,ce,ae]),Ne=(0,s.useMemo)((function(){return Ze.length>0&&(0,C.jsx)(bi.Z,{columnHeaderHeight:(0,Dn.Qr)(Pe)&&(0,Dn.Qr)(_e)&&(0,Dn.Qr)(Ce)?0:Er.Eh,columns:Ze,height:fe-ve-mt.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:De,rows:Oe,width:ye})}),[ye,Pe,Ze,ve,fe,_e,Ce,De,Oe]),Le=(0,s.useMemo)((function(){return pe.length>0&&(0,C.jsx)(Hi,{autocompleteItems:r,blockRefs:l,blocks:c,chartRefs:d,deleteWidget:h,fetchFileTree:g,fetchPipeline:x,messages:A,onChangeChartBlock:R,pipeline:U,runBlock:z,runningBlocks:V,savePipelineContent:K,selectedBlock:q,setAnyInputFocused:$,setErrors:ie,setSelectedBlock:oe,setTextareaFocused:le,textareaFocused:ae,updateWidget:de,widgets:pe,width:ye})}),[ye,r,l,c,d,h,g,x,A,R,U,z,V,K,q,$,ie,oe,le,ae,de,pe]),Fe=(0,s.useMemo)((function(){return(0,C.jsx)("div",{style:{height:"100%",position:"relative",width:ye},children:(0,C.jsx)(_r.Z,{lastMessage:D,onFocus:function(){return oe(null)},sendMessage:J,width:ye})})}),[ye,D,J,oe]),He=(0,s.useMemo)((function(){return(0,C.jsx)(lr,Ur({},Re))}),[Re]),ze=(0,s.useMemo)((function(){return(0,C.jsx)(Lr,Ur({},Re))}),[Re]),Ve=(0,s.useMemo)((function(){return U&&q&&(0,C.jsx)(It,{block:q,fetchFileTree:g,fetchPipeline:x,globalDataProducts:w,pipeline:U,setSelectedBlock:oe})}),[g,x,w,U,q,oe]);return(0,C.jsxs)(C.Fragment,{children:[(null===me||void 0===me?void 0:me.length)>=1&&(0,C.jsxs)(Z.Z,{mb:3,mt:2,mx:2,children:[(0,C.jsxs)(y.Z,{justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,C.jsx)(T.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return be([])},transparent:!0,children:(0,C.jsx)(W.x8,{muted:!0})})]}),null===me||void 0===me?void 0:me.map((function(e){return(0,C.jsx)(Z.Z,{pb:1,children:(0,C.jsx)(O.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,C.jsxs)(Er.t0,{fullWidth:!0,heightOffset:tt.cH.TERMINAL===n||n===tt.cH.TREE?0:Ue.nn,onBlur:function(){Q||ne(!1),null===X||void 0===X||X(!1)},onFocus:function(){ne(!0),n===tt.cH.TREE&&(null===X||void 0===X||X(!0))},overflowHidden:n===tt.cH.TREE,children:[n===tt.cH.TREE&&(0,C.jsx)(f.Z,{uuid:"PipelineDetail/".concat(null===U||void 0===U?void 0:U.uuid),children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(zi.Z,{blockRefs:l,blocks:c,editingBlock:m,enablePorts:!Ie,fetchPipeline:x,height:fe-(ve-Ue.nn)-Te,messages:A,onClickNode:function(e){var n=e.block.uuid;return re((function(e){var t=!(null===e||void 0===e||!e[n]);return t?Ur(Ur({},e),{},(0,o.Z)({},n,!t)):e}))},pipeline:U,runningBlocks:V,selectedBlock:q,setEditingBlock:te,setErrors:ie,setSelectedBlock:oe,setZoom:ee,treeRef:se}),!ke&&F.qL.STREAMING===(null===U||void 0===U?void 0:U.type)&&(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsx)(wr,{cancelPipeline:a,checkIfPipelineRunning:p,executePipeline:b,isPipelineExecuting:I,pipelineExecutionHidden:xe,pipelineMessages:H,setPipelineExecutionHidden:je})})]})}),n===tt.cH.DATA&&Ne,tt.cH.SECRETS===n&&Be,tt.cH.VARIABLES===n&&Ae,tt.cH.FILE_VERSIONS===n&&(0,C.jsx)(f.Z,{uuid:"FileVersions/".concat(Q?decodeURIComponent(Q):""),children:Me}),Ie||q&&Ee||!q&&Ee&&n===tt.cH.DATA?null:tt.du.includes(n)&&(0,C.jsx)(y.Z,{alignItems:"center",justifyContent:"center",verticalHeight:tt.fp,verticalHeightOffset:ve,width:ye,children:(0,C.jsx)(O.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:q?!Ee&&"No data or insights available":"Select a block for insights"})}),tt.cH.CHARTS===n&&(pe.length>0?Le:(0,C.jsxs)(y.Z,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:tt.fp,verticalHeightOffset:ve,width:ye,children:[(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(y.Z,{flexDirection:"row",children:(0,C.jsxs)(O.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,C.jsx)(W.GQ,{size:1.5*P.iI}),"\xa0in",(0,C.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,C.jsx)(Z.Z,{mt:P.cd,px:1,children:(0,C.jsx)(Wi,{size:40*P.iI})})]})),tt.cH.TERMINAL===n&&Fe,tt.cH.EXTENSIONS===n&&He,tt.cH.ADDON_BLOCKS===n&&ze,tt.cH.BLOCK_SETTINGS===n&&(q?Ve:(0,C.jsx)(y.Z,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:tt.fp,verticalHeightOffset:ve,width:ye,children:(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(y.Z,{flexDirection:"row",children:(0,C.jsxs)(O.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,C.jsx)(W.JG,{size:1.5*P.iI}),"\xa0",(0,C.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})}))]})]})},zr=t(35438);function Vr(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 Wr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Vr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Vr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Gr=function(e){var n,t=e.activeView,i=e.depGraphZoom,r=e.pipeline,o=e.secrets,l=e.selectedBlock,c=e.treeRef,u=e.variables,a=null===r||void 0===r?void 0:r.uuid,d=(0,tr.iV)(),p=(0,br.wx)(u,(function(e){return e.uuid===sr.C})),f=tt.Qq[t],v=(null===f||void 0===f||null===(n=f.buildLabel)||void 0===n?void 0:n.call(f,{pipeline:r,secrets:o,variables:p}))||(null===f||void 0===f?void 0:f.label);tt.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(v=(0,C.jsxs)(C.Fragment,{children:["Block settings for ",(0,C.jsx)(O.ZP,{bold:!0,color:(0,w.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,C.jsx)(O.ZP,{bold:!0,children:v}),m=tt.cH.EXTENSIONS===t&&(null===d||void 0===d?void 0:d.extension),b=V.ZP.extension_options.list({},{},{pauseFetch:!m}).data,g=(0,s.useMemo)((function(){return(null===b||void 0===b?void 0:b.extension_options)||[]}),[b]),x=(0,s.useMemo)((function(){return(0,Se.HK)(g,(function(e){return e.uuid}))}),[g]),P=tt.cH.ADDON_BLOCKS===t&&(null===d||void 0===d?void 0:d.addon);if(!t)return(0,C.jsx)("div",{});if(c&&tt.cH.TREE===t)h=(0,C.jsxs)(y.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[h,(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(T.Z,Wr(Wr({},zr.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.zoomIn)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Zoom in"})})),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,Wr(Wr({},zr.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.zoomOut)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Zoom out"})})),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Oe.Z,{appearAbove:!0,appearBefore:!0,default:!0,label:"Shortcut: Double-click canvas",lightBackground:!0,size:null,widthFitContent:!0,children:(0,C.jsx)(T.Z,Wr(Wr({},zr.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.fitCanvas)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Reset"})}))}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(O.ZP,{bold:!0,children:[null===i||void 0===i?void 0:i.toFixed(2),"x"]})]})]});else if(m){var _=x[null===d||void 0===d?void 0:d.extension];h=(0,C.jsxs)(y.Z,{children:[(0,C.jsx)(Re(),{as:"/pipelines/".concat(a,"/edit?").concat(tt.uM,"=").concat(tt.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,C.jsx)(k.Z,{default:!0,children:v})}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,C.jsx)(O.ZP,{bold:!0,children:null===_||void 0===_?void 0:_.name})]})}else P&&(h=(0,C.jsxs)(y.Z,{children:[(0,C.jsx)(Re(),{as:"/pipelines/".concat(a,"/edit?").concat(tt.uM,"=").concat(tt.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,C.jsx)(k.Z,{default:!0,children:v})}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,C.jsx)(O.ZP,{bold:!0,children:(0,$.vg)(null===d||void 0===d?void 0:d.addon)})]}));return(0,C.jsx)(mt.ym,{children:h})},Kr=t(35033),Yr=t(11366),qr=t(3055),Qr=t(27337),Jr=t(94353),Xr=t(59920),$r=t(36405);function eo(e){var n=e.activeView,t=e.pipeline,i=e.secrets,r=e.setActiveSidekickView,o=e.variables,l=(0,br.wx)(o,(function(e){return e.uuid===sr.C}));return tt.j5.map((function(e){var o=e.buildLabel,c=e.key,u=e.label;return{Icon:tt.Z7[c],id:c,isSelected:function(){return n===c},label:function(){return(null===o||void 0===o?void 0:o({pipeline:t,secrets:i,variables:l}))||u},onClick:function(){return r(c,!0)}}}))}var no=t(43482),to=t(32821),io=t(28799);function ro(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function oo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ro(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ro(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function lo(e){var n,t,i=e.page,c=e.pipeline,u=(0,p.useRouter)(),m=(0,gt.i)().height,b=u.query.pipeline,g=c.uuid||b,x=(0,s.useState)(!!(0,we.U2)(we.zg)),j=x[0],k=x[1],O=(0,s.useState)(null),w=O[0],_=O[1],S=(0,s.useState)(null),A=S[0],M=S[1],B=(0,s.useState)(null),R=B[0],L=B[1],U=(0,s.useState)(null),H=U[0],z=U[1],G=(0,s.useState)(null),K=G[0],Y=G[1],q=(0,s.useState)([]),Q=q[0],J=q[1],te=(0,s.useState)({}),ie=te[0],ce=te[1],ue=(0,s.useState)(!1),ae=ue[0],se=ue[1],de=(0,s.useState)(!1),pe=de[0],fe=de[1],ve=(0,s.useState)(!1),he=ve[0],me=ve[1],ye=(0,s.useState)(!1),ke=ye[0],Oe=ye[1],Me=(0,s.useState)(1),Be=Me[0],Re=Me[1],Ne=V.ZP.projects.list(),Le=Ne.data,Fe=Ne.mutate,Ue=(0,s.useMemo)((function(){var e;return null===Le||void 0===Le||null===(e=Le.projects)||void 0===e?void 0:e[0]}),[Le]),He="".concat(Yr.H8,"_").concat(g),ze=(0,we.U2)(He),Ve=(0,s.useState)((0,Se.sE)(bt.NR,(function(e){return e.uuid===ze}))||bt.NR[0]),We=Ve[0],Ge=Ve[1],Ke=(0,s.useCallback)((function(e){Ge(e),(0,we.t8)(He,null===e||void 0===e?void 0:e.uuid)}),[He,Ge]),Ye="".concat(Yr.g6,"_").concat(g),qe=(0,s.useState)({}),Qe=qe[0],Je=qe[1],Xe=(0,s.useCallback)((function(e){Je((function(n){var t=e(n);return(0,we.t8)(Ye,JSON.stringify(t)),t}))}),[Ye,Je]);(0,s.useEffect)((function(){var e=(0,we.U2)(Ye);e&&(0,$.Pb)(e)&&Je(JSON.parse(e))}),[Ye,Je]);var $e=(0,s.useRef)(null),nn=V.ZP.statuses.list({},{revalidateOnFocus:!1}).data,tn=(0,s.useMemo)((function(){var e,n;return null===nn||void 0===nn||null===(e=nn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[nn]),rn=(0,s.useMemo)((function(){var e,n;return null===nn||void 0===nn||null===(e=nn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[nn]),on=(0,s.useState)({}),ln=on[0],cn=on[1],un=(0,s.useState)([]),an=un[0],sn=un[1],dn=V.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),pn=dn.data,fn=dn.mutate,vn=null===pn||void 0===pn?void 0:pn.kernels,hn=(null===vn||void 0===vn?void 0:vn.find((function(e){return e.name===F.a_[null===On||void 0===On?void 0:On.type]})))||(null===vn||void 0===vn?void 0:vn[0]),mn=(0,Pe.Z)(g),bn=V.ZP.pipelines.detail(g,{include_block_pipelines:!0,includes_outputs:(0,Dn.Qr)(ln)},{refreshInterval:6e4}),gn=bn.data,xn=bn.mutate,jn=V.ZP.files.list(),yn=jn.data,kn=jn.mutate,Zn=(0,s.useMemo)((function(){return(null===yn||void 0===yn?void 0:yn.files)||[]}),[yn]),On=null===gn||void 0===gn?void 0:gn.pipeline,Pn=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===On||void 0===On?void 0:On.type)}),[On]),wn=(0,s.useState)(null),Cn=wn[0],_n=wn[1],Sn=(0,s.useState)((0,_e.Tz)({dateObj:!0})),En=Sn[0],In=Sn[1],Tn=(0,s.useState)(!1),An=Tn[0],Mn=Tn[1],Bn=(0,Ie.dd)((function(){return(0,C.jsx)(Ze.Z,{centerOnScreen:!0,neutral:!0,onClick:Ln,subtitle:"Please refresh your page to have the most up-to-date data before making any changes.",title:"Your pipeline may be stale.",width:34*P.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),Rn=(0,l.Z)(Bn,2),Nn=Rn[0],Ln=Rn[1];(0,s.useEffect)((function(){var e,n;null!==gn&&void 0!==gn&&null!==(e=gn.pipeline)&&void 0!==e&&e.updated_at&&(null===Cn||void 0===Cn?void 0:Cn.toISOString())!==new Date(null===gn||void 0===gn||null===(n=gn.pipeline)||void 0===n?void 0:n.updated_at).toISOString()&&_n(new Date(gn.pipeline.updated_at)),Cn&&Number(Cn)>Number(En)&&Nn()}),[null===gn||void 0===gn||null===(n=gn.pipeline)||void 0===n?void 0:n.updated_at,Cn,En,Nn]);var Fn=(0,tr.iV)(),Un=Fn[tt.uM],Hn=Fn.block_uuid,zn=Fn.file_path,Vn=(0,s.useMemo)((function(){var e=Fn["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Fn]),Wn=(0,s.useCallback)((function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2?arguments[2]:void 0,i=(0,o.Z)({},tt.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),(0,Ee.u7)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,s.useEffect)((function(){Un||Wn(tt.cH.TREE,!1)}),[Un,Wn]);var Gn=(0,s.useCallback)((function(e,n,t){k(!1),setTimeout((function(){return Wn(e,n,t)}),1)}),[Wn]),Kn=(0,s.useRef)({}),Yn=(0,s.useRef)({}),qn=(0,s.useRef)(null),Qn=(0,s.useRef)({}),Jn=(0,s.useRef)({}),Xn=(0,s.useRef)({}),$n=(0,s.useCallback)((function(e,n,t){var i=Qn.current||{};Qn.current=oo(oo({},i),{},(0,o.Z)({},e,oo(oo({},i[e]||{}),{},(0,o.Z)({},n,t))))}),[Qn]),et=(0,s.useCallback)((function(e,n,t){var i=Jn.current||{};Jn.current=oo(oo({},i),{},(0,o.Z)({},e,oo(oo({},i[e]||{}),{},(0,o.Z)({},n,t))))}),[Jn]),nt=(0,s.useCallback)((function(e,n,t){$n(e,n,t),Mn(!0)}),[$n,Mn]),it=(0,s.useCallback)((function(e,n,t){et(e,n,t),Mn(!0)}),[et,Mn]),rt=(0,s.useCallback)((function(e){Xn.current=oo(oo({},Xn.current),e)}),[Xn]),ot=(0,s.useCallback)((function(e,n){rt((0,o.Z)({},e,n)),Mn(!0)}),[rt,Mn]),lt=(0,s.useState)(null),ct=lt[0],ut=lt[1],at=V.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,st=null===at||void 0===at?void 0:at.data_providers;(0,s.useEffect)((function(){var e=gn;null!==gn&&void 0!==gn&&gn.hasOwnProperty("error")||null===at||void 0===at||!at.hasOwnProperty("error")||(e=at),(0,ee.bB)(e,L)}),[gn,at]);var dt=V.ZP.variables.pipelines.list(g,{global_only:!0},{revalidateOnFocus:!1}),ft=dt.data,vt=dt.mutate,ht=null===ft||void 0===ft?void 0:ft.variables,mt=V.ZP.secrets.list({},{revalidateOnFocus:!1}),xt=mt.data,jt=mt.mutate,Zt=null===xt||void 0===xt?void 0:xt.secrets,Ot=(0,s.useState)([]),Pt=Ot[0],wt=Ot[1],Ct=(0,s.useState)([]),_t=Ct[0],St=Ct[1],Et=(0,s.useRef)({}),It=(0,s.useCallback)((function(e){var n;Mn(!0);var t=Et.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),Et.current[e.uuid]=oo(oo(oo({},t),e),{},{configuration:oo(oo({},t.configuration),e.configuration),upstream_blocks:i})}),[Mn,Et]),Tt=(0,s.useState)(!1),Dt=Tt[0],At=Tt[1],Mt=(0,s.useState)({upstreamBlocks:null}),Bt=Mt[0],Rt=Mt[1],Nt=(0,s.useState)([]),Lt=Nt[0],Ft=Nt[1],Ut=(0,s.useState)(null),Ht=Ut[0],zt=Ut[1],Vt=(0,no.Dp)(g),Wt=(0,no.Q9)(Vt,Pt),Gt=(0,s.useState)(Wt),Kt=Gt[0],Yt=Gt[1],qt=(0,s.useState)(),Qt=qt[0],Jt=qt[1],Xt=(0,s.useState)(),$t=Xt[0],ei=Xt[1],ni=(0,s.useState)(null),ti=ni[0],ii=ni[1],ri=(0,Pe.Z)(Kt),oi=(0,s.useCallback)((function(){Rt({upstreamBlocks:{block:null,values:[]}}),cn({}),Mn(!1),Ft([]),zt(null)}),[]);(0,s.useEffect)((function(){g!==mn&&(Qn.current={},Jn.current={})}),[g,mn]);var li=V.ZP.block_outputs.detail(!j&&(null===ti||void 0===ti?void 0:ti.type)!==h.tf.SCRATCHPAD&&(null===ti||void 0===ti?void 0:ti.type)!==h.tf.CHART&&null!==ti&&void 0!==ti&&ti.uuid?encodeURIComponent(null===ti||void 0===ti?void 0:ti.uuid):null,{pipeline_uuid:g}),ci=li.data,ui=li.mutate,ai=(0,s.useMemo)((function(){return null===ci||void 0===ci?void 0:ci.block_output}),[ci]),si=(0,s.useMemo)((function(){var e,n,t;return Pn?null===(e=(0,Se.sE)(null===ai||void 0===ai?void 0:ai.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,$.kE)($t))})))||void 0===e?void 0:e.sample_data:null===ai||void 0===ai||null===(n=ai.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[ai,Pn,$t]),di=V.ZP.blocks.pipelines.analyses.detail(j?null:g,(null===ti||void 0===ti?void 0:ti.type)!==h.tf.SCRATCHPAD&&(null===ti||void 0===ti?void 0:ti.type)!==h.tf.CHART&&(null===ti||void 0===ti?void 0:ti.uuid)&&encodeURIComponent(null===ti||void 0===ti?void 0:ti.uuid)),pi=di.data,fi=di.mutate,vi=(null===pi||void 0===pi||null===(t=pi.analyses)||void 0===t?void 0:t[0])||{},hi=vi.insights,mi=void 0===hi?{}:hi,bi=vi.metadata,gi=void 0===bi?{}:bi,xi=vi.statistics,ji=void 0===xi?{}:xi;(0,s.useEffect)((function(){0===Lt.length&&(fi(),ui(),vt())}),[fi,ui,vt,Lt]),(0,s.useEffect)((function(){if(0===Kt.length)ii(null);else if((null===ri||void 0===ri?void 0:ri.length)!==(null===Kt||void 0===Kt?void 0:Kt.length)&&(null===Kt||void 0===Kt?void 0:Kt.length)<(null===ri||void 0===ri?void 0:ri.length)){var e=ri.findIndex((function(e){return e.uuid===(null===ti||void 0===ti?void 0:ti.uuid)})),n=ri.length-1===e?e-1:e+1;ii(ri[Math.max(0,n)])}}),[Kt,ri,null===ti||void 0===ti?void 0:ti.uuid]),(0,s.useEffect)((function(){var e;null!==(e=Bt.upstreamBlocks)&&void 0!==e&&e.block&&(k(!1),Wn(tt.cH.TREE))}),[Bt.upstreamBlocks,Wn]);var yi=V.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),ki=yi.data,Zi=yi.mutate,Oi=null===ki||void 0===ki?void 0:ki.autocomplete_items;(0,s.useEffect)((function(){zn||me(!1),Y(zn)}),[zn]),(0,s.useEffect)((function(){(0,Se.fS)(Vn,Q)||J(Vn)}),[Vn,Q]);var Pi=(0,d.Db)(V.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.pipeline.uuid;u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),kn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),wi=(0,l.Z)(Pi,1)[0],Ci=(0,d.Db)(V.ZP.pipelines.useUpdate(g,{update_content:!0}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){Mn(!1),xn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),_i=(0,l.Z)(Ci,2),Si=_i[0],Ei=_i[1].isLoading,Ii=(0,s.useCallback)((function(e,n){var t=e||{},i=t.block,r=t.pipeline,o=void 0===r?{extensions:{}}:r,c=(n||{}).contentOnly;if(!(Cn&&Number(Cn)>Number(En))){var u=(0,_e.Tz)({dateObj:!0}),a=(0,_e.Tz)();In(u);var s={},d={},p={},f={};Pt.forEach((function(e){var n,t,r,o=e.extension_uuid,u=e.type,a=e.uuid,v=null===(n=Jn.current[u])||void 0===n?void 0:n[a];"undefined"===typeof v&&(v=e.content);var m,b=null===(t=Qn.current[u])||void 0===t?void 0:t[a];"undefined"===typeof b&&(b=e.callback_content);var g=null===(r=ln[a])||void 0===r?void 0:r.filter((function(e){return!!e})),x=null===g||void 0===g?void 0:g.find((function(e){return e.error}));if(g){var j=[],y=0;g.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||x||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(Kr.Lz)?e:e.concat(n)}),[]),i===De.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!rn||y<rn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"".concat(a,"_").concat(n)}}))}var k=oo(oo({},e),{},{callback_content:b,content:v,outputs:m});(null===i||void 0===i?void 0:i.uuid)===a&&Object.entries(i).forEach((function(e){var n=(0,l.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,l.Z)(e,2),i=n[0],r=n[1];k[t]||(k[t]={}),k[t][i]=r})):k[t]=i})),c?d[k.uuid]={callback_content:k.callback_content,content:k.content,outputs:k.outputs,uuid:k.uuid}:[h.tf.EXTENSION].includes(u)?(s[o]||(s[o]=[]),s[o].push(k)):h.tf.CALLBACK===u?p[k.uuid]=k:h.tf.CONDITIONAL===u?f[k.uuid]=k:d[k.uuid]=k}));var v=oo(oo({},null===On||void 0===On?void 0:On.extensions),null===o||void 0===o?void 0:o.extensions);Object.entries(s).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];v[t]||(v[t]={}),v[t].blocks=i}));var m=[],b=[],g=[];return((null===o||void 0===o?void 0:o.blocks)||Pt).forEach((function(e){var n=e.uuid,t=d[n],i=p[n],r=f[n];"undefined"!==typeof t?m.push(t):"undefined"!==typeof i?b.push(i):"undefined"!==typeof r&&g.push(r)})),Si({pipeline:oo(oo(oo({},On),o),{},{blocks:m,callbacks:b,conditionals:g,extensions:v,updated_at:a,widgets:_t.map((function(e){var n,t,i=Xn.current[e.uuid],r=Et.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var o=null===(n=ln[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===o||void 0===o?void 0:o.find((function(e){return e.error}));if(o){var c=[];o.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(Kr.Lz)?e:e.concat(n)}),[])),c.push(n))})),t=c.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}return oo(oo(oo({},e),r),{},{configuration:oo(oo({},e.configuration),r.configuration),content:i,outputs:t})}))})})}Nn()}),[Pt,rn,ln,On,Cn,En,Nn,Si,_t]),Ti=(0,s.useCallback)((function(e){Ii();var n=encodeURIComponent(e),t=(0,tr.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n);var i=(0,to.IO)(e,Pt);if(i){if(zt(i),null!==Kn&&void 0!==Kn&&Kn.current){var r,o=Kn.current["".concat(i.type,"s/").concat(i.uuid,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}}else(0,Ee.u7)({file_path:n,"file_paths[]":t})}),[Kn,Pt,Ii]),Di=(0,s.useMemo)((function(){var e=[],n=[];return Pt.forEach((function(t){h.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[Pt]),Ai=Di.blocksInNotebook,Mi=Di.blocksInSidekick,Bi=(0,s.useCallback)((function(e,n){return Ii({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 r=e.data.pipeline.uuid;g!==r?window.location.href="".concat(u.basePath,"/pipelines/").concat(r,"/edit"):(kn(),n!==(null===On||void 0===On?void 0:On.type)&&xn(),(0,no.k1)(Ai,g,r),(0,no.k1)(Mi,g,r))}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&M((function(e){return oo(oo({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){Ti("pipelines/".concat(g,"/").concat(en.dT.METADATA_YAML)),M(null)}}]})}))}))}),[Ai,Mi,kn,xn,Ti,null===On||void 0===On?void 0:On.type,g,u,Ii]),Ri=(0,d.Db)((function(e){var n=e.type,t=e.extension_uuid,i=e.uuid,r={};return n&&(r.block_type=n),t&&(r.extension_uuid=t),V.ZP.blocks.pipelines.useDelete(g,encodeURIComponent(i),r)()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;wt((function(e){return(0,Se.oM)(e,e.findIndex((function(e){var n=e.type,r=e.uuid;return t===n&&i===r})))})),xn(),zt(null),t===h.tf.SCRATCHPAD&&kn()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;M({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&cn((function(e){return oo(oo({},e),{},(0,o.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:De.Gi.TEXT_PLAIN}}))))}))}})}}),Ni=(0,l.Z)(Ri,1)[0],Li=(0,d.Db)((function(e){var n=e.uuid;return V.ZP.widgets.pipelines.useDelete(g,n)()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.widget.uuid;St((function(e){return(0,Se.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),xn(),kn()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;M({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&cn((function(e){return oo(oo({},e),{},(0,o.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:De.Gi.TEXT_PLAIN}}))))}))}})}}),Fi=(0,l.Z)(Li,1)[0],Ui=(0,Ie.dd)((function(e){return(0,C.jsx)(Ze.Z,{centerOnScreen:!0,neutral:!0,onCancel:Vi,onClick:function(){return Gi(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*P.iI})})),Hi=(0,l.Z)(Ui,2),zi=Hi[0],Vi=Hi[1],Wi=(0,d.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,r="".concat(t,"/").concat(i);return n&&en.JD[n]&&(r="".concat(r,".").concat(en.JD[n].toLowerCase())),V.ZP.blocks.useDelete(encodeURIComponent(r))()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){Zi(),xn(),kn()},onErrorCallback:function(e,n){zi(),M({displayMessage:e.exception,errors:n,response:e})}})}}),Gi=(0,l.Z)(Wi,1)[0],Ki=(0,d.Db)(V.ZP.kernels.useUpdate(null===hn||void 0===hn?void 0:hn.id),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){return fn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),Yi=(0,l.Z)(Ki,1)[0],qi=(0,s.useCallback)((function(){return Yi({kernel:{action_type:"restart"}})}),[Yi]),Qi=(0,s.useCallback)((function(){Yi({kernel:{action_type:"interrupt"}}),Ft([])}),[Yi]),Ji=(0,d.Db)(V.ZP.blocks.pipelines.useCreate(g)),Xi=(0,l.Z)(Ji,1)[0],$i=(0,s.useCallback)((function(e,n,t){var i,o,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,$.Y6)();e.converted_from_type&&e.converted_from_uuid&&(i=null===(o=Jn.current[e.converted_from_type])||void 0===o?void 0:o[e.converted_from_uuid]);var u=e.language,a=e.type;if(Pn){var s=(0,Se.HK)((null===On||void 0===On?void 0:On.blocks)||[],(function(e){return e.type})),d=s[h.tf.DATA_EXPORTER],p=s[h.tf.DATA_LOADER],f=s[h.tf.TRANSFORMER];if(h.tf.DATA_LOADER===a){if(h.t6.YAML!==u)return void M({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(u,".")});if(p)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a source: ").concat(null===p||void 0===p?void 0:p.uuid,".")})}else if(h.tf.TRANSFORMER===a){if(f)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a transformer: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}else if(h.tf.DATA_EXPORTER===a){if(h.t6.YAML!==u)return void M({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(u,".")});if(d)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a destination: ").concat(null===d||void 0===d?void 0:d.uuid,".")})}}return Xi({block:oo({content:i,name:c,priority:n},e)}).then((function(e){(0,ee.wD)(e,{callback:function(){var n=e.data.block;null===t||void 0===t||t(n),kn(),xn().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;return wt((function(e){var n=(0,r.Z)(t);Object.entries(i||{}).forEach((function(e){var t=(0,l.Z)(e,2),i=t[0],o=t[1].blocks;o&&n.push.apply(n,(0,r.Z)(o.map((function(e){return oo(oo({},e),{},{extension_uuid:i})}))))}));var o=(0,Se.HK)(e,(function(e){return e.uuid})),c=[];return n.forEach((function(e){var n=o[e.uuid];n?c.push(n):c.push(e)})),c}))}))},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}))}),[Xi,kn,xn,Pn,wt,M,On]),er=(0,Ie.dd)((function(e){var n=e.block,t=e.idx,i=e.name,r=void 0===i?(0,$.Y6)():i,o=e.onCreateCallback;return(0,C.jsx)(ne.BC,{children:(0,C.jsx)(re,{block:n,defaultName:r,onClose:rr,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return $i(oo(oo({},n),(0,Dn.gR)(e,["name"])),t,o,null===e||void 0===e?void 0:e.name).then((function(){return rr()}))},pipeline:On})})}),{},[$i,On],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),nr=(0,l.Z)(er,2),ir=nr[0],rr=nr[1],or=(0,Ie.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,r=e.onSaveSuccess;return(0,C.jsx)(ne.BC,{children:(0,C.jsx)(kt.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),ur()},onSaveSuccess:function(e){Fe(),ur(),null===r||void 0===r||r(e)}})})}),{},[Fe],{background:!0,uuid:"configure_project"}),lr=(0,l.Z)(or,2),cr=lr[0],ur=lr[1],ar=(0,d.Db)(V.ZP.widgets.pipelines.useCreate(g)),sr=(0,l.Z)(ar,1)[0],dr=(0,s.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,$.Y6)();return sr({widget:oo({name:i,priority:n,type:h.tf.CHART},e)}).then((function(e){return(0,ee.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),kn(),xn(),Wn(tt.cH.CHARTS),z(n)},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}))}),[kn,xn,sr,Wn]);(0,s.useEffect)((function(){if(H){var e,n=null===(e=Yn.current[H.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),z(null))}}),[H,z]),(0,s.useEffect)((function(){mn!==g&&(wt([]),St([]),Yt([]),sn([]))}),[g,mn]),(0,s.useEffect)((function(){if("undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)||"undefined"!==typeof(null===On||void 0===On?void 0:On.extensions)){var e=[];"undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.blocks)),"undefined"!==typeof(null===On||void 0===On?void 0:On.callbacks)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.callbacks)),"undefined"!==typeof(null===On||void 0===On?void 0:On.conditionals)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.conditionals)),"undefined"!==typeof(null===On||void 0===On?void 0:On.extensions)&&Object.entries((null===On||void 0===On?void 0:On.extensions)||{}).forEach((function(n){var t=(0,l.Z)(n,2),i=t[0],o=t[1].blocks;o&&e.push.apply(e,(0,r.Z)(o.map((function(e){return oo(oo({},e),{},{extension_uuid:i})}))))})),wt(e)}}),[null===On||void 0===On?void 0:On.blocks,null===On||void 0===On?void 0:On.callbacks,null===On||void 0===On?void 0:On.conditionals,null===On||void 0===On?void 0:On.extensions]),(0,s.useEffect)((function(){"undefined"!==typeof(null===On||void 0===On?void 0:On.widgets)&&St(On.widgets)}),[null===On||void 0===On?void 0:On.widgets]),(0,s.useEffect)((function(){(null===Wt||void 0===Wt?void 0:Wt.length)>0&&0===(null===Kt||void 0===Kt?void 0:Kt.length)&&(Yt(Wt),ii(Wt[0]))}),[Kt,Wt]);var pr=(0,Pe.Z)(Pt);(0,s.useEffect)((function(){if("undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)&&(!Pt.length||!(0,Se.fS)(null===pr||void 0===pr?void 0:pr.map((function(e){return e.uuid})).sort(),null===Pt||void 0===Pt?void 0:Pt.map((function(e){return e.uuid})).sort()))){var e=(0,no.Rt)(On.blocks),n=e.content,t=e.messages;Jn.current=n,cn((function(e){return oo(oo({},t),e)}))}}),[Pt,pr,null===On||void 0===On?void 0:On.blocks,cn]),(0,s.useEffect)((function(){if(!_t.length&&"undefined"!==typeof(null===On||void 0===On?void 0:On.widgets)){var e=(0,no.Rt)(On.widgets),n=e.content,t=e.messages;Xn.current=n,cn((function(e){return oo(oo({},t),e)}))}}),[null===On||void 0===On?void 0:On.widgets,cn,_t]);var fr=(0,s.useCallback)((function(e,n,t){var i=Pt.find((function(t){var i=t.type,r=t.uuid;return i===n&&r===e}));if(i){if(zt(i),null!==Kn&&void 0!==Kn&&Kn.current){var r,o=Kn.current["".concat(i.type,"s/").concat(i.uuid,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}(0,Ee.u7)({block_uuid:null,file_path:null,"file_paths[]":[]})}else if(n===h.tf.CHART){var l=_t.find((function(n){return n.uuid===e}));if(l&&(zt(l),null!==Yn&&void 0!==Yn&&Yn.current)){var c,u=Yn.current[l.uuid];null===u||void 0===u||null===(c=u.current)||void 0===c||c.scrollIntoView()}}else t&&Ti(t)}),[Pt,Ti,_t]);(0,s.useEffect)((function(){if(Hn&&!Ht){var e=Pt.find((function(e){var n,t=e.uuid;return(null===Hn||void 0===Hn||null===(n=Hn.split(":"))||void 0===n?void 0:n[0])===t}));e&&(Xe((function(n){return oo(oo({},n),{},(0,o.Z)({},e.uuid,!1))})),fr(e.uuid,e.type,null))}else(null===pr||void 0===pr?void 0:pr.length)!==(null===Pt||void 0===Pt?void 0:Pt.length)&&Ht&&(Xe((function(e){return oo(oo({},e),{},(0,o.Z)({},Ht.uuid,!1))})),fr(Ht.uuid,Ht.type,null))}),[Hn,Pt,null===pr||void 0===pr?void 0:pr.length,fr,Ht,Xe]);var vr=(0,s.useMemo)((function(){return new v.Z}),[]),hr=(0,s.useMemo)((function(){return{api_key:Jr.l,token:vr.decodedToken.token}}),[vr]),mr=(0,a.ZP)((0,io.Ib)(),{onClose: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,l=n.msg_type,c=n.pipeline_uuid,u=n.uuid;if(!u&&!c)return;var a=Pt.find((function(e){var n=e.type,i=e.uuid;return t===n&&u===i}));"stream_pipeline"!==l?cn((function(e){var t=e[u]||[];return oo(oo({},e),{},(0,o.Z)({},u,t.concat(n)))})):(sn((function(e){return[].concat((0,r.Z)(e),[n])})),De.uF.IDLE===i&&(Ft([]),xn(),u||At(!1))),De.uF.BUSY===i?Ft((function(e){return e.find((function(e){var n=e.uuid;return u===n}))||!a?e:e.concat(a)})):De.uF.IDLE===i&&Ft((function(e){return e.filter((function(e){var n=e.uuid;return u!==n}))})),tn||Mn(!0)}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,br=(0,s.useCallback)((function(){Ii().then((function(){At(!0),sn([]),mr(JSON.stringify(oo(oo({},hr),{},{execute_pipeline:!0,pipeline_uuid:g})))}))}),[g,Ii,mr,hr]),gr=(0,s.useCallback)((function(){mr(JSON.stringify(oo(oo({},hr),{},{cancel_pipeline:!0,pipeline_uuid:g})))}),[g,mr,hr]),xr=(0,s.useCallback)((function(){mr(JSON.stringify(oo(oo({},hr),{},{cancel_pipeline:!0,pipeline_uuid:g,skip_publish_message:!0})))}),[g,mr,hr]),jr=(0,s.useCallback)((function(){mr(JSON.stringify(oo(oo({},hr),{},{check_if_pipeline_running:!0,pipeline_uuid:g})))}),[g,mr,hr]);(0,s.useEffect)((function(){var e;return window.addEventListener("pagehide",xr),null===u||void 0===u||null===(e=u.events)||void 0===e||e.on("routeChangeStart",xr),function(){var e;null===u||void 0===u||null===(e=u.events)||void 0===e||e.off("routeChangeStart",xr),window.removeEventListener("pagehide",xr)}}),[xr,null===u||void 0===u?void 0:u.events]);var yr=(0,s.useCallback)((function(e){var n=e.block,t=e.code,i=e.ignoreAlreadyRunning,r=e.runDownstream,o=void 0!==r&&r,l=e.runIncompleteUpstream,c=void 0!==l&&l,u=e.runSettings,a=void 0===u?{}:u,s=e.runTests,d=void 0!==s&&s,p=e.runUpstream,f=n.extension_uuid,v=n.upstream_blocks,h=n.uuid;if(!Lt.find((function(e){var n=e.uuid;return h===n}))||i){var m="".concat(Yr.vF,"_").concat(null===On||void 0===On?void 0:On.uuid);mr(JSON.stringify(oo(oo({},hr),{},{code:t,extension_uuid:f,output_messages_to_logs:!!(0,we.U2)(m),pipeline_uuid:null===On||void 0===On?void 0:On.uuid,run_downstream:o,run_incomplete_upstream:c,run_settings:a,run_tests:d,run_upstream:p,type:n.type,upstream_blocks:v,uuid:h}))),cn((function(e){return delete e[h],e})),se(!1),Ft((function(e){return e.find((function(e){var n=e.uuid;return h===n}))?e:e.concat(n)}))}xn()}),[xn,On,Lt,mr,cn,Ft,se,hr]),kr=(0,s.useCallback)((function(e){var n=e.block;return tn?yr(e):Ii({block:{outputs:[],uuid:n.uuid}},{contentOnly:!0}).then((function(){return yr(e)}))}),[tn,yr,Ii]),Zr=(0,a.ZP)((0,io.Ib)("terminal"),{queryParams:hr,shouldReconnect:function(){return!0}}),Or=Zr.lastMessage,Pr=Zr.sendMessage,wr=(0,Ie.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,C.jsx)(ne.BC,{children:(0,C.jsx)(I.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}}),Sr()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[Qr.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),Cr=(0,l.Z)(wr,2),_r=Cr[0],Sr=Cr[1],Er=V.ZP.global_data_products.list().data,Ir=(0,s.useMemo)((function(){return(null===Er||void 0===Er?void 0:Er.global_data_products)||[]}),[Er]),Tr=(0,Ie.dd)((function(e){var n=e.addNewBlock;return(0,C.jsx)(ne.BC,{children:(0,C.jsx)(Ae.Z,{children:(0,C.jsx)(xe.Z,{globalDataProducts:Ir,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:h.tf.GLOBAL_DATA_PRODUCT}),Mr()}})})})}),{},[Ir],{background:!0,uuid:"global_data_products"}),Dr=(0,l.Z)(Tr,2),Ar=Dr[0],Mr=Dr[1],Br=(0,s.useMemo)((function(){return(0,C.jsx)(Hr,{activeView:Un,addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){return ir({block:e,idx:n,name:i,onCreateCallback:t})}))},afterWidth:w,autocompleteItems:Oi,blockRefs:Kn,blocks:Pt,blocksInNotebook:Ai,cancelPipeline:gr,chartRefs:Yn,checkIfPipelineRunning:jr,deleteBlock:Ni,deleteWidget:Fi,editingBlock:Bt,executePipeline:br,fetchFileTree:kn,fetchPipeline:xn,fetchSecrets:jt,fetchVariables:vt,globalDataProducts:Ir,globalVariables:ht,insights:mi,interruptKernel:Qi,isPipelineExecuting:Dt,isPipelineUpdating:Ei,lastTerminalMessage:Or,messages:ln,metadata:gi,onChangeCallbackBlock:nt,onChangeChartBlock:ot,onChangeCodeBlock:it,onSelectBlockFile:fr,pipeline:On,pipelineMessages:an,runBlock:kr,runningBlocks:Lt,sampleData:si,savePipelineContent:Ii,secrets:Zt,selectedBlock:Ht,selectedFilePath:K,sendTerminalMessage:Pr,setActiveSidekickView:Wn,setAllowCodeBlockShortcuts:Oe,setAnyInputFocused:fe,setDepGraphZoom:Re,setDisableShortcuts:me,setEditingBlock:Rt,setErrors:M,setHiddenBlocks:Xe,setSelectedBlock:zt,setTextareaFocused:se,showBrowseTemplates:_r,statistics:ji,textareaFocused:ae,treeRef:qn,updatePipelineMetadata:Bi,updateWidget:It,widgets:_t})}),[Un,w,Oi,Kn,Pt,Ai,gr,jr,Ni,Fi,Bt,br,kn,xn,jt,vt,Ir,ht,mi,Qi,Dt,Ei,Or,ln,gi,nt,ot,it,fr,On,an,kr,Lt,si,Ii,Zt,Ht,K,Pr,Wn,fe,Rt,M,Xe,se,ir,_r,ji,ae,Bi,It,_t]),Rr=(0,s.useMemo)((function(){return(0,C.jsx)(pt,{addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){var r;X.L.BLOCK_FILE!==(null===e||void 0===e||null===(r=e.block_action_object)||void 0===r?void 0:r.object_type)&&(h.tf.DBT!==(null===e||void 0===e?void 0:e.type)||h.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?ir({block:e,idx:n,name:i,onCreateCallback:t}):$i(e,n,t,i)}))},addWidget:function(e,n){var t=n.onCreateCallback;return dr(e,_t.length,t)},allBlocks:Pt,allowCodeBlockShortcuts:ke,anyInputFocused:pe,autocompleteItems:Oi,blockRefs:Kn,blocks:Ai,dataProviders:st,deleteBlock:Ni,disableShortcuts:he,fetchFileTree:kn,fetchPipeline:xn,fetchSampleData:ui,files:Zn,globalDataProducts:Ir,globalVariables:ht,hiddenBlocks:Qe,interruptKernel:Qi,mainContainerRef:$e,mainContainerWidth:ct,messages:ln,onChangeCallbackBlock:nt,onChangeCodeBlock:it,openSidekickView:Gn,pipeline:On,pipelineContentTouched:An,project:Ue,restartKernel:qi,runBlock:kr,runningBlocks:Lt,savePipelineContent:Ii,selectedBlock:Ht,setAnyInputFocused:fe,setDisableShortcuts:me,setEditingBlock:Rt,setErrors:M,setHiddenBlocks:Xe,setIntegrationStreams:Jt,setOutputBlocks:Yt,setPipelineContentTouched:Mn,setSelectedBlock:zt,setSelectedOutputBlock:ii,setSelectedStream:ei,setTextareaFocused:se,showBrowseTemplates:_r,showConfigureProjectModal:cr,showGlobalDataProducts:Ar,textareaFocused:ae,widgets:_t})}),[$i,dr,ke,pe,Oi,Kn,Pt,Ai,st,Ni,he,kn,xn,ui,Zn,Ir,ht,Qe,Qi,$e,ct,ln,nt,it,Gn,On,An,Ue,qi,kr,Lt,Ii,Ht,fe,Rt,M,Xe,Mn,zt,se,ir,_r,cr,Ar,ae,_t]),Nr=(0,s.useMemo)((function(){if(i===bt.b7)return(0,C.jsx)(be,{cancelPipeline:gr,createPipeline:wi,executePipeline:br,interruptKernel:Qi,isPipelineExecuting:Dt,pipeline:On,restartKernel:qi,savePipelineContent:Ii,setActiveSidekickView:Wn,setMessages:cn,children:K&&(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(y.Z,{alignItems:"center",fullHeight:!0,children:(0,C.jsx)(T.Z,{compact:!0,onClick:function(){return Y(null)},small:!0,children:"View pipeline"})})})})}),[gr,wi,br,Qi,Dt,i,On,qi,Ii,K,Wn,cn,Y]),Lr=(0,s.useMemo)((function(){if(i===bt.b7)return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Te,{filePaths:Q,filesTouched:ie,isBusy:Lt.length>=1,isPipelineUpdating:Ei,kernel:hn,pipeline:On,pipelineContentTouched:An,pipelineLastSaved:Cn,restartKernel:qi,savePipelineContent:Ii,selectedFilePath:K,setErrors:M,setRunningBlocks:Ft,updatePipelineMetadata:Bi,children:Nr}),(null===Q||void 0===Q?void 0:Q.length)>0&&(0,C.jsx)(Ce.rK,{relativePosition:!0,secondary:!0,children:(0,C.jsx)(ge.Z,{filePaths:Q,filesTouched:ie,savePipelineContent:Ii,selectedFilePath:K})})]})}),[Nr,ie,Ei,hn,i,On,An,Cn,qi,Lt,Ii,K,Q,M,Bi]),Fr=(0,s.useMemo)((function(){var e;return null===Qt||void 0===Qt||null===(e=Qt.filter((function(e){return(0,Se.sE)(null===ai||void 0===ai?void 0:ai.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,$.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,C.jsx)(Z.Z,{pl:1,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return ei(e)},selected:$t===e,uuid:e,children:e})},e)}))}),[ai,Qt,$t]),Ur=(0,s.useRef)(null),zr=(0,s.useMemo)((function(){return(0,C.jsx)(oe.Z,{addNewBlock:function(e,n){$i(e,Pt.length,n,e.name),(null===Vn||void 0===Vn?void 0:Vn.length)>=1&&u.push("/pipelines/".concat(g,"/edit"))},blocks:Pt,deleteWidget:Fi,fetchAutocompleteItems:Zi,fetchFileTree:kn,fetchPipeline:xn,files:Zn,onSelectBlockFile:fr,openFile:Ti,openPipeline:function(e){oi(),u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:Gn,pipeline:On,ref:Ur,setErrors:M,setSelectedBlock:zt,widgets:_t})}),[$i,Pt,Fi,Zi,kn,xn,null===Vn||void 0===Vn?void 0:Vn.length,Zn,fr,Ti,Gn,On,g,oi,u,M,zt,_t]),Vr=(0,s.useMemo)((function(){return(0,C.jsx)(E,{blockRefs:Kn,hiddenBlocks:Qe,pipeline:On,setHiddenBlocks:Xe})}),[Kn,Qe,On,Xe]),Wr=(0,s.useMemo)((function(){return bt.Jf.uuid===(null===We||void 0===We?void 0:We.uuid)?zr:bt.IY.uuid===(null===We||void 0===We?void 0:We.uuid)?Vr:null}),[zr,Vr,We]),ro=(0,s.useMemo)((function(){return(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(D.Z,{noPadding:!0,onClickTab:function(e){Ke(e)},selectedTabUUID:null===We||void 0===We?void 0:We.uuid,small:!0,tabs:bt.NR})})}),[Ke,We]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(je.Z,{title:null===On||void 0===On?void 0:On.name}),(0,C.jsxs)(yt,{after:Br,afterHeader:(0,C.jsx)(Gr,{activeView:Un,depGraphZoom:Be,pipeline:On,secrets:Zt,selectedBlock:Ht,treeRef:qn,variables:ht}),afterHeightOffset:qr.Mz,afterHidden:j,afterNavigationItems:eo({activeView:Un,pipeline:On,secrets:Zt,setActiveSidekickView:Wn,variables:ht}),afterOverflow:tt.cH.DATA===Un?"hidden":null,afterSubheader:(null===Kt||void 0===Kt?void 0:Kt.length)>0&&Un===tt.cH.DATA&&(0,C.jsxs)(y.Z,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!Pn&&Kt.map((function(e){var n=e.uuid,t=(null===ti||void 0===ti?void 0:ti.uuid)===n;return(0,C.jsx)(Z.Z,{pl:1,children:(0,C.jsx)(N.ZP,{afterElement:t?(0,C.jsx)(T.Z,{basic:!0,highlightOnHover:!0,onClick:function(){(0,no.h8)(g,e.uuid),Yt((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,C.jsx)(W.x8,{muted:!0,size:1.25*P.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return ii(e)},selected:t,uuid:n,children:n})},n)})),Pn&&Fr]}),before:Wr,beforeHeader:ro,beforeHeightOffset:qr.Mz,beforeNavigationItems:(0,$r.H)(Xr.M.EDIT,On),errors:R||A,headerOffset:(null===Q||void 0===Q?void 0:Q.length)>0?36:0,mainContainerHeader:Lr,mainContainerRef:$e,page:i,pipeline:On,setAfterHidden:k,setAfterWidthForChildren:_,setErrors:R?L:M,setMainContainerWidth:ut,children:[(0,C.jsx)("div",{style:{height:K?0:null,opacity:K?0:null,visibility:K?"hidden":null},children:(0,C.jsx)(f.Z,{uuid:"PipelineDetail/".concat(g),children:Rr})}),null===Vn||void 0===Vn?void 0:Vn.map((function(e){return(0,C.jsx)("div",{style:{display:K===e?null:"none"},children:(0,C.jsx)(f.Z,{uuid:"FileEditor/".concat(decodeURIComponent(e)),children:(0,C.jsx)(le.Z,{active:K===e,addNewBlock:function(e,n){$i(e,Pt.length,n,e.name),u.push("/pipelines/".concat(g,"/edit"))},fetchPipeline:xn,fetchVariables:vt,filePath:e,openSidekickView:Gn,pipeline:On,selectedFilePath:K,sendTerminalMessage:Pr,setDisableShortcuts:me,setErrors:M,setFilesTouched:ce,setSelectedBlock:zt})})},e)})),(0,C.jsx)(Z.Z,{pb:zn?0:Math.max(Math.floor(m*(2/3)/P.iI),0)})]})]})}lo.getInitialProps=function(){var e=(0,i.Z)(u().mark((function e(n){var t,i,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,i=bt.b7,r={page:i,pipeline:{uuid:t}},e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var co=(0,Zt.Z)(lo)},37958:function(e,n,t){"use strict";t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},42305:function(e,n,t){"use strict";t.d(n,{A5:function(){return x},AY:function(){return j},BP:function(){return g},JX:function(){return b},OC:function(){return d},Pc:function(){return y},Ro:function(){return k},Tz:function(){return m},Y_:function(){return O},d$:function(){return h},jV:function(){return Z},lJ:function(){return P},n1:function(){return f},s8:function(){return a},vk:function(){return o},yD:function(){return s}});var i,r,o,l=t(82394),c=t(92083),u=t.n(c);!function(e){e.TODAY="today",e.WEEK="week",e.MONTH="month"}(o||(o={}));var a=(i={},(0,l.Z)(i,o.TODAY,"today"),(0,l.Z)(i,o.WEEK,"last 7 days"),(0,l.Z)(i,o.MONTH,"last 30 days"),i),s=(r={},(0,l.Z)(r,o.TODAY,0),(0,l.Z)(r,o.WEEK,6),(0,l.Z)(r,o.MONTH,29),r),d="YYYY-MM-DD HH:mm:ss",p="YYYY-MM-DD HH:mm",f="YYYY-MM-DD",v="MMMM D, YYYY";function h(e,n){var t=n.dayAgo,i=n.includeSeconds,r=n.utcFormat,o=u()(e),l=p;return r&&(o=o.utc()),t&&(o=o.subtract(1,"days")),i&&(l=d),o.format(l)}function m(e){var n=h((new Date).toISOString(),{includeSeconds:!0,utcFormat:!0});return null!==e&&void 0!==e&&e.dateObj?new Date(n):n}function b(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u().unix(e).format(null!==n&&void 0!==n&&n.withSeconds?d:p)}function g(e,n,t){return u()(e).utc().hours(+n).minutes(+t).format()}function x(e){return u()(e).unix()}function j(e,n,t,i){var r="".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t);return i?"".concat(r,":").concat(i):r}function y(e){var n=u().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function k(e,n){var t=u().utc(),i=u().utc();null!==n&&void 0!==n&&n.localTime&&(t=u()().local(),i=u()().local());var r=(t=t.subtract(e,"days")).format(v),o=i.format(v);return null!==n&&void 0!==n&&n.endDateOnly?o:"".concat(r," - ").concat(o)}function Z(e,n){var t=null!==n&&void 0!==n&&n.localTime?u()().local():u().utc();if(e===o.WEEK){var i=s[o.WEEK];t=t.subtract(i,"days")}else if(e===o.MONTH){var r=s[o.MONTH];t=t.subtract(r,"days")}return null!==n&&void 0!==n&&n.isoString?t.startOf("day").toISOString():t.startOf("day").format(d)}function O(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:90,n=new Date,t=[],i=0;i<e;i++)t.unshift(n.toISOString().split("T")[0]),n.setDate(n.getDate()-1);return t}function P(e){return e.padStart(2,"0")}},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(72555)}])}},function(e){e.O(0,[3662,844,9902,426,1774,8792,8789,4259,5896,7849,9055,2714,7011,5872,2991,1424,1005,7815,3654,8952,7722,4822,1484,2485,6299,437,9774,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|