mage-ai 0.9.44__py3-none-any.whl → 0.9.46__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mage-ai might be problematic. Click here for more details.

Files changed (540) hide show
  1. mage_ai/api/constants.py +2 -0
  2. mage_ai/api/operations/base.py +208 -12
  3. mage_ai/api/policies/BasePolicy.py +3 -3
  4. mage_ai/api/policies/ComputeClusterPolicy.py +96 -0
  5. mage_ai/api/policies/ComputeConnectionPolicy.py +74 -0
  6. mage_ai/api/policies/ComputeServicePolicy.py +50 -0
  7. mage_ai/api/policies/DownloadPolicy.py +29 -0
  8. mage_ai/api/policies/GitCustomBranchPolicy.py +1 -0
  9. mage_ai/api/policies/GlobalHookPolicy.py +126 -0
  10. mage_ai/api/policies/OauthPolicy.py +56 -7
  11. mage_ai/api/policies/ProjectPolicy.py +1 -0
  12. mage_ai/api/policies/RolePolicy.py +12 -1
  13. mage_ai/api/presenters/ComputeClusterPresenter.py +19 -0
  14. mage_ai/api/presenters/ComputeConnectionPresenter.py +26 -0
  15. mage_ai/api/presenters/ComputeServicePresenter.py +15 -0
  16. mage_ai/api/presenters/DownloadPresenter.py +13 -0
  17. mage_ai/api/presenters/GlobalHookPresenter.py +74 -0
  18. mage_ai/api/presenters/OauthPresenter.py +1 -0
  19. mage_ai/api/presenters/PipelinePresenter.py +1 -0
  20. mage_ai/api/presenters/ProjectPresenter.py +1 -0
  21. mage_ai/api/presenters/SparkApplicationPresenter.py +2 -0
  22. mage_ai/api/presenters/WorkspacePresenter.py +22 -22
  23. mage_ai/api/resources/AsyncBaseResource.py +39 -0
  24. mage_ai/api/resources/BackfillResource.py +1 -0
  25. mage_ai/api/resources/BlockResource.py +57 -0
  26. mage_ai/api/resources/ClusterResource.py +1 -1
  27. mage_ai/api/resources/ComputeClusterResource.py +109 -0
  28. mage_ai/api/resources/ComputeConnectionResource.py +103 -0
  29. mage_ai/api/resources/ComputeServiceResource.py +35 -0
  30. mage_ai/api/resources/DownloadResource.py +56 -0
  31. mage_ai/api/resources/ExecutionStateResource.py +1 -1
  32. mage_ai/api/resources/GitBranchResource.py +35 -29
  33. mage_ai/api/resources/GitCustomBranchResource.py +9 -0
  34. mage_ai/api/resources/GlobalHookResource.py +192 -0
  35. mage_ai/api/resources/KernelResource.py +10 -0
  36. mage_ai/api/resources/OauthResource.py +60 -98
  37. mage_ai/api/resources/PipelineResource.py +4 -4
  38. mage_ai/api/resources/PipelineScheduleResource.py +37 -16
  39. mage_ai/api/resources/ProjectResource.py +5 -3
  40. mage_ai/api/resources/SessionResource.py +24 -9
  41. mage_ai/api/resources/SparkApplicationResource.py +5 -5
  42. mage_ai/api/resources/SparkEnvironmentResource.py +1 -2
  43. mage_ai/api/resources/SparkExecutorResource.py +1 -2
  44. mage_ai/api/resources/SparkJobResource.py +3 -6
  45. mage_ai/api/resources/SparkSqlResource.py +6 -11
  46. mage_ai/api/resources/SparkStageAttemptResource.py +2 -3
  47. mage_ai/api/resources/SparkStageAttemptTaskResource.py +1 -2
  48. mage_ai/api/resources/SparkStageAttemptTaskSummaryResource.py +1 -2
  49. mage_ai/api/resources/SparkStageResource.py +3 -6
  50. mage_ai/api/resources/SparkThreadResource.py +1 -2
  51. mage_ai/api/resources/UserResource.py +32 -31
  52. mage_ai/api/resources/mixins/spark.py +25 -4
  53. mage_ai/authentication/oauth/constants.py +4 -0
  54. mage_ai/authentication/oauth2.py +1 -3
  55. mage_ai/authentication/permissions/constants.py +4 -0
  56. mage_ai/authentication/providers/__init__.py +0 -0
  57. mage_ai/authentication/providers/active_directory.py +136 -0
  58. mage_ai/authentication/providers/constants.py +17 -0
  59. mage_ai/authentication/providers/ghe.py +81 -0
  60. mage_ai/authentication/providers/google.py +86 -0
  61. mage_ai/authentication/providers/oauth.py +60 -0
  62. mage_ai/authentication/providers/okta.py +101 -0
  63. mage_ai/authentication/providers/sso.py +20 -0
  64. mage_ai/authentication/providers/utils.py +12 -0
  65. mage_ai/cluster_manager/aws/emr_cluster_manager.py +2 -1
  66. mage_ai/cluster_manager/workspace/base.py +7 -3
  67. mage_ai/data_integrations/destinations/constants.py +2 -0
  68. mage_ai/data_preparation/executors/block_executor.py +3 -0
  69. mage_ai/data_preparation/executors/pipeline_executor.py +9 -0
  70. mage_ai/data_preparation/git/__init__.py +3 -3
  71. mage_ai/data_preparation/git/api.py +69 -35
  72. mage_ai/data_preparation/models/block/__init__.py +95 -60
  73. mage_ai/data_preparation/models/block/data_integration/data.py +1 -1
  74. mage_ai/data_preparation/models/block/dbt/block_sql.py +95 -1
  75. mage_ai/data_preparation/models/block/dbt/utils.py +6 -0
  76. mage_ai/data_preparation/models/block/spark/mixins.py +82 -34
  77. mage_ai/data_preparation/models/download/__init__.py +8 -0
  78. mage_ai/data_preparation/models/global_hooks/__init__.py +0 -0
  79. mage_ai/data_preparation/models/global_hooks/constants.py +44 -0
  80. mage_ai/data_preparation/models/global_hooks/models.py +928 -0
  81. mage_ai/data_preparation/models/global_hooks/utils.py +21 -0
  82. mage_ai/data_preparation/models/pipeline.py +82 -6
  83. mage_ai/data_preparation/models/pipelines/models.py +16 -0
  84. mage_ai/data_preparation/models/project/__init__.py +6 -0
  85. mage_ai/data_preparation/models/project/constants.py +1 -0
  86. mage_ai/data_preparation/models/project/models.py +12 -0
  87. mage_ai/data_preparation/repo_manager.py +23 -1
  88. mage_ai/data_preparation/templates/callbacks/base.jinja +4 -0
  89. mage_ai/data_preparation/templates/data_exporters/streaming/kafka.yaml +1 -0
  90. mage_ai/data_preparation/templates/data_loaders/streaming/activemq.yaml +6 -0
  91. mage_ai/data_preparation/templates/data_loaders/streaming/kafka.yaml +1 -0
  92. mage_ai/data_preparation/templates/data_loaders/streaming/nats.yaml +20 -0
  93. mage_ai/data_preparation/templates/repo/io_config.yaml +2 -2
  94. mage_ai/io/duckdb.py +0 -1
  95. mage_ai/orchestration/concurrency.py +8 -1
  96. mage_ai/orchestration/db/models/schedules.py +23 -2
  97. mage_ai/orchestration/pipeline_scheduler.py +168 -105
  98. mage_ai/orchestration/queue/process_queue.py +9 -1
  99. mage_ai/orchestration/triggers/api.py +11 -3
  100. mage_ai/orchestration/triggers/constants.py +1 -0
  101. mage_ai/orchestration/triggers/utils.py +23 -0
  102. mage_ai/server/active_kernel.py +37 -4
  103. mage_ai/server/api/downloads.py +76 -1
  104. mage_ai/server/api/triggers.py +1 -0
  105. mage_ai/server/constants.py +1 -1
  106. mage_ai/server/frontend_dist/404.html +2 -2
  107. mage_ai/server/frontend_dist/_next/static/9jB4XPuz6BzxBcG9VNao5/_buildManifest.js +1 -0
  108. mage_ai/server/frontend_dist/_next/static/chunks/1749-9a6276b2918fdae1.js +1 -0
  109. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7519-8c29bbb92e03cc77.js → frontend_dist/_next/static/chunks/1845-5ce774d5ab81ed57.js} +1 -1
  110. mage_ai/server/frontend_dist/_next/static/chunks/1952-ac7722e8b1ab88fe.js +1 -0
  111. mage_ai/server/frontend_dist/_next/static/chunks/3419-f8d518d024e7b5c8.js +1 -0
  112. mage_ai/server/frontend_dist/_next/static/chunks/4267-fd4d8049e83178de.js +1 -0
  113. mage_ai/server/frontend_dist/_next/static/chunks/4366-93e09e5a4a7e182c.js +1 -0
  114. mage_ai/server/frontend_dist/_next/static/chunks/5457-949640f4037bf12f.js +1 -0
  115. mage_ai/server/frontend_dist/_next/static/chunks/5499-76cf8f023c6b0985.js +1 -0
  116. mage_ai/server/frontend_dist/_next/static/chunks/553-7f7919e14392ca67.js +1 -0
  117. mage_ai/server/frontend_dist/_next/static/chunks/5638-a65610405a70961c.js +1 -0
  118. mage_ai/server/frontend_dist/_next/static/chunks/5810-12eadc488265d55b.js +1 -0
  119. mage_ai/server/frontend_dist/_next/static/chunks/5820-28adeabb5cda2b96.js +1 -0
  120. mage_ai/server/frontend_dist/_next/static/chunks/595-0d174b1f9fbfce4f.js +1 -0
  121. mage_ai/server/frontend_dist/_next/static/chunks/600-705fe234320ec5de.js +1 -0
  122. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3122-f27de34d0b5426af.js → frontend_dist/_next/static/chunks/6285-e9b45335bfb9ccaf.js} +1 -1
  123. mage_ai/server/frontend_dist/_next/static/chunks/6333-bc1b433b428a9095.js +1 -0
  124. mage_ai/server/frontend_dist/_next/static/chunks/{5397-b5f2e477acc6bd6b.js → 6965-c613d1834c8ed92d.js} +1 -1
  125. mage_ai/server/frontend_dist/_next/static/chunks/{7022-18fde36eb46e1d65.js → 7022-070ec0144a4d029c.js} +1 -1
  126. mage_ai/server/frontend_dist/_next/static/chunks/722-a1584445357a276c.js +1 -0
  127. mage_ai/server/frontend_dist/_next/static/chunks/{7858-c83d25349d0e980f.js → 7858-d9df72e95e438284.js} +1 -1
  128. mage_ai/server/frontend_dist/_next/static/chunks/8264-0d582a6ca33c3dfa.js +1 -0
  129. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3684-cbda680fd8927d07.js → frontend_dist/_next/static/chunks/8432-f191e39f9b5893f2.js} +1 -1
  130. mage_ai/server/frontend_dist/_next/static/chunks/90-a7308bae028d7001.js +1 -0
  131. mage_ai/server/frontend_dist/_next/static/chunks/9264-1d4f0327d42fed91.js +1 -0
  132. mage_ai/server/frontend_dist/_next/static/chunks/9618-2c5045255ac5a6e7.js +1 -0
  133. mage_ai/server/frontend_dist/_next/static/chunks/{976-27c4eed1c9b20c44.js → 976-18c98af60b76f1a7.js} +1 -1
  134. mage_ai/server/frontend_dist/_next/static/chunks/framework-22b71764bf44ede4.js +1 -0
  135. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +1 -0
  136. mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-a24cb24b6f08bbc9.js +1 -0
  137. mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-419775ca1293b354.js +1 -0
  138. mage_ai/server/frontend_dist/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +1 -0
  139. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-3f6fc312f67ff72e.js → [...slug]-cfd68e760ae00958.js} +1 -1
  140. mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-f4cd03036c3e8723.js → global-data-products-c3b79ef31007f95b.js} +1 -1
  141. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +1 -0
  142. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +1 -0
  143. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-449a022f2f0f2d94.js +1 -0
  144. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-60845f0b59142f32.js +1 -0
  145. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1d9b298fdceabbf1.js → frontend_dist/_next/static/chunks/pages/manage/users/[user]-9384c5f1efa2ac18.js} +1 -1
  146. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-abd8571907664fdf.js +1 -0
  147. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{users-a7c970122a10afdc.js → users-28a930b148d99766.js} +1 -1
  148. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-f83deb790548693b.js +1 -0
  149. mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-8bb62c4f6a511c43.js +1 -0
  150. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-f0c40645f385f23f.js +1 -0
  151. mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipeline-runs-c79819d6826e5416.js → pipeline-runs-b35d37bfba8fbccc.js} +1 -1
  152. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +1 -0
  153. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +1 -0
  154. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-571c0962333b92f0.js +1 -0
  155. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +1 -0
  156. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-a52d2d3e0c2978f4.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-ef680455ae54ccbe.js} +1 -1
  157. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-ddddcddd2f74b4f6.js +1 -0
  158. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-4a238307feddb522.js +1 -0
  159. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js +1 -0
  160. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-4977276c8f84b5f4.js → [run]-0691711636fa95c7.js} +1 -1
  161. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-ce717786f31e8f04.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d20b2cd08907afd.js} +1 -1
  162. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +1 -0
  163. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-b75bf17498e87354.js +1 -0
  164. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +1 -0
  165. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +1 -0
  166. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/{[pipeline]-35fe7762cb83a733.js → [pipeline]-02c843b9c8418bb5.js} +1 -1
  167. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +1 -0
  168. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +1 -0
  169. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-d6a62284c7c99cb3.js → [...slug]-b78b1be5b9ed84b9.js} +1 -1
  170. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-b1389695f758c32b.js → permissions-37b78a436eeab258.js} +1 -1
  171. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +1 -0
  172. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-0bdb66265286ab22.js → [...slug]-db05a80d18c168e5.js} +1 -1
  173. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-e04e18fc295ca76a.js → roles-f55c77e4f46c8d33.js} +1 -1
  174. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-2a1f8737561fdd94.js +1 -0
  175. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-0267358c91122109.js → [...slug]-e3bf6e5d8bb250c4.js} +1 -1
  176. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-50fed18bb9b8d142.js → users-20f0a050a42a015d.js} +1 -1
  177. mage_ai/server/frontend_dist/_next/static/chunks/pages/{settings-56f83205752b1323.js → settings-0f0121db7f5ff93d.js} +1 -1
  178. mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-99e2748e3c1d57a3.js +1 -0
  179. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-9370551ffa462144.js → frontend_dist/_next/static/chunks/pages/templates/[...slug]-f44ccd1499ffd23a.js} +1 -1
  180. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/templates-3cff90df13a1a755.js → frontend_dist/_next/static/chunks/pages/templates-1bfaa1c50e844813.js} +1 -1
  181. mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-ed121e305169cf1c.js +1 -0
  182. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-9ae68758102cc843.js +1 -0
  183. mage_ai/server/frontend_dist/_next/static/chunks/pages/{triggers-ffaab4c013e62ba1.js → triggers-572d82d6eb7a5d43.js} +1 -1
  184. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +1 -0
  185. mage_ai/server/frontend_dist/block-layout.html +2 -2
  186. mage_ai/server/frontend_dist/compute.html +5 -5
  187. mage_ai/server/frontend_dist/files.html +5 -5
  188. mage_ai/server/frontend_dist/global-data-products/[...slug].html +5 -5
  189. mage_ai/server/frontend_dist/global-data-products.html +5 -5
  190. mage_ai/server/frontend_dist/global-hooks/[...slug].html +24 -0
  191. mage_ai/server/frontend_dist/global-hooks.html +24 -0
  192. mage_ai/server/frontend_dist/index.html +2 -2
  193. mage_ai/server/frontend_dist/manage/files.html +5 -5
  194. mage_ai/server/frontend_dist/manage/settings.html +5 -5
  195. mage_ai/server/frontend_dist/manage/users/[user].html +5 -5
  196. mage_ai/server/frontend_dist/manage/users/new.html +5 -5
  197. mage_ai/server/frontend_dist/manage/users.html +5 -5
  198. mage_ai/server/frontend_dist/manage.html +5 -5
  199. mage_ai/server/frontend_dist/oauth.html +4 -4
  200. mage_ai/server/frontend_dist/overview.html +5 -5
  201. mage_ai/server/frontend_dist/pipeline-runs.html +5 -5
  202. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +5 -5
  203. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +5 -5
  204. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +5 -5
  205. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  206. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +5 -5
  207. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +5 -5
  208. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
  209. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +5 -5
  210. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +5 -5
  211. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +5 -5
  212. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +5 -5
  213. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +5 -5
  214. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +5 -5
  215. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +5 -5
  216. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  217. mage_ai/server/frontend_dist/pipelines.html +5 -5
  218. mage_ai/server/frontend_dist/settings/account/profile.html +5 -5
  219. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +5 -5
  220. mage_ai/server/frontend_dist/settings/workspace/permissions.html +5 -5
  221. mage_ai/server/frontend_dist/settings/workspace/preferences.html +5 -5
  222. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +5 -5
  223. mage_ai/server/frontend_dist/settings/workspace/roles.html +5 -5
  224. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +5 -5
  225. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +5 -5
  226. mage_ai/server/frontend_dist/settings/workspace/users.html +5 -5
  227. mage_ai/server/frontend_dist/settings.html +2 -2
  228. mage_ai/server/frontend_dist/sign-in.html +17 -17
  229. mage_ai/server/frontend_dist/templates/[...slug].html +5 -5
  230. mage_ai/server/frontend_dist/templates.html +5 -5
  231. mage_ai/server/frontend_dist/terminal.html +5 -5
  232. mage_ai/server/frontend_dist/test.html +15 -15
  233. mage_ai/server/frontend_dist/triggers.html +5 -5
  234. mage_ai/server/frontend_dist/version-control.html +5 -5
  235. mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
  236. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1749-9a6276b2918fdae1.js +1 -0
  237. mage_ai/server/{frontend_dist/_next/static/chunks/7519-8c29bbb92e03cc77.js → frontend_dist_base_path_template/_next/static/chunks/1845-5ce774d5ab81ed57.js} +1 -1
  238. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-ac7722e8b1ab88fe.js +1 -0
  239. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3419-f8d518d024e7b5c8.js +1 -0
  240. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-fd4d8049e83178de.js +1 -0
  241. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4366-93e09e5a4a7e182c.js +1 -0
  242. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-949640f4037bf12f.js +1 -0
  243. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-76cf8f023c6b0985.js +1 -0
  244. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/553-7f7919e14392ca67.js +1 -0
  245. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5638-a65610405a70961c.js +1 -0
  246. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-12eadc488265d55b.js +1 -0
  247. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5820-28adeabb5cda2b96.js +1 -0
  248. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/595-0d174b1f9fbfce4f.js +1 -0
  249. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/600-705fe234320ec5de.js +1 -0
  250. mage_ai/server/{frontend_dist/_next/static/chunks/3122-f27de34d0b5426af.js → frontend_dist_base_path_template/_next/static/chunks/6285-e9b45335bfb9ccaf.js} +1 -1
  251. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-bc1b433b428a9095.js +1 -0
  252. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5397-b5f2e477acc6bd6b.js → 6965-c613d1834c8ed92d.js} +1 -1
  253. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7022-18fde36eb46e1d65.js → 7022-070ec0144a4d029c.js} +1 -1
  254. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-a1584445357a276c.js +1 -0
  255. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7858-c83d25349d0e980f.js → 7858-d9df72e95e438284.js} +1 -1
  256. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-0d582a6ca33c3dfa.js +1 -0
  257. mage_ai/server/{frontend_dist/_next/static/chunks/3684-cbda680fd8927d07.js → frontend_dist_base_path_template/_next/static/chunks/8432-f191e39f9b5893f2.js} +1 -1
  258. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/90-a7308bae028d7001.js +1 -0
  259. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-1d4f0327d42fed91.js +1 -0
  260. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9618-2c5045255ac5a6e7.js +1 -0
  261. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{976-27c4eed1c9b20c44.js → 976-18c98af60b76f1a7.js} +1 -1
  262. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/framework-22b71764bf44ede4.js +1 -0
  263. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +1 -0
  264. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-a24cb24b6f08bbc9.js +1 -0
  265. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-419775ca1293b354.js +1 -0
  266. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +1 -0
  267. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-3f6fc312f67ff72e.js → [...slug]-cfd68e760ae00958.js} +1 -1
  268. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-f4cd03036c3e8723.js → global-data-products-c3b79ef31007f95b.js} +1 -1
  269. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +1 -0
  270. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +1 -0
  271. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-449a022f2f0f2d94.js +1 -0
  272. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-60845f0b59142f32.js +1 -0
  273. mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage/users/[user]-1d9b298fdceabbf1.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-9384c5f1efa2ac18.js} +1 -1
  274. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-abd8571907664fdf.js +1 -0
  275. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{users-a7c970122a10afdc.js → users-28a930b148d99766.js} +1 -1
  276. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-f83deb790548693b.js +1 -0
  277. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-8bb62c4f6a511c43.js +1 -0
  278. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-f0c40645f385f23f.js +1 -0
  279. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{pipeline-runs-c79819d6826e5416.js → pipeline-runs-b35d37bfba8fbccc.js} +1 -1
  280. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +1 -0
  281. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +1 -0
  282. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-571c0962333b92f0.js +1 -0
  283. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +1 -0
  284. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-a52d2d3e0c2978f4.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-ef680455ae54ccbe.js} +1 -1
  285. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-ddddcddd2f74b4f6.js +1 -0
  286. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-4a238307feddb522.js +1 -0
  287. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js +1 -0
  288. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-4977276c8f84b5f4.js → [run]-0691711636fa95c7.js} +1 -1
  289. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-ce717786f31e8f04.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d20b2cd08907afd.js} +1 -1
  290. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +1 -0
  291. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-b75bf17498e87354.js +1 -0
  292. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +1 -0
  293. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +1 -0
  294. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/{[pipeline]-35fe7762cb83a733.js → [pipeline]-02c843b9c8418bb5.js} +1 -1
  295. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +1 -0
  296. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +1 -0
  297. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-d6a62284c7c99cb3.js → [...slug]-b78b1be5b9ed84b9.js} +1 -1
  298. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-b1389695f758c32b.js → permissions-37b78a436eeab258.js} +1 -1
  299. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +1 -0
  300. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-0bdb66265286ab22.js → [...slug]-db05a80d18c168e5.js} +1 -1
  301. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-e04e18fc295ca76a.js → roles-f55c77e4f46c8d33.js} +1 -1
  302. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-2a1f8737561fdd94.js +1 -0
  303. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-0267358c91122109.js → [...slug]-e3bf6e5d8bb250c4.js} +1 -1
  304. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-50fed18bb9b8d142.js → users-20f0a050a42a015d.js} +1 -1
  305. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{settings-56f83205752b1323.js → settings-0f0121db7f5ff93d.js} +1 -1
  306. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-99e2748e3c1d57a3.js +1 -0
  307. mage_ai/server/{frontend_dist/_next/static/chunks/pages/templates/[...slug]-9370551ffa462144.js → frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-f44ccd1499ffd23a.js} +1 -1
  308. mage_ai/server/{frontend_dist/_next/static/chunks/pages/templates-3cff90df13a1a755.js → frontend_dist_base_path_template/_next/static/chunks/pages/templates-1bfaa1c50e844813.js} +1 -1
  309. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-ed121e305169cf1c.js +1 -0
  310. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-9ae68758102cc843.js +1 -0
  311. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{triggers-ffaab4c013e62ba1.js → triggers-572d82d6eb7a5d43.js} +1 -1
  312. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +1 -0
  313. mage_ai/server/frontend_dist_base_path_template/_next/static/uPDjJYpJMst1q6psbRyte/_buildManifest.js +1 -0
  314. mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
  315. mage_ai/server/frontend_dist_base_path_template/compute.html +2 -2
  316. mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
  317. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
  318. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
  319. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +24 -0
  320. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +24 -0
  321. mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
  322. mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
  323. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
  324. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
  325. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
  326. mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
  327. mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
  328. mage_ai/server/frontend_dist_base_path_template/oauth.html +3 -3
  329. mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
  330. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
  331. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  332. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
  333. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
  334. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
  335. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
  336. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  337. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  338. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
  339. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
  340. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
  341. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
  342. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
  343. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  344. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
  345. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
  346. mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
  347. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
  348. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
  349. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
  350. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
  351. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
  352. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
  353. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
  354. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
  355. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
  356. mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
  357. mage_ai/server/frontend_dist_base_path_template/sign-in.html +9 -9
  358. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
  359. mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
  360. mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
  361. mage_ai/server/frontend_dist_base_path_template/test.html +14 -14
  362. mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
  363. mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
  364. mage_ai/server/server.py +43 -15
  365. mage_ai/server/utils/output_display.py +6 -0
  366. mage_ai/server/websocket_server.py +14 -0
  367. mage_ai/services/aws/ecs/config.py +11 -8
  368. mage_ai/services/aws/emr/config.py +1 -0
  369. mage_ai/services/aws/emr/constants.py +1 -0
  370. mage_ai/services/aws/emr/emr.py +20 -7
  371. mage_ai/services/compute/__init__.py +0 -0
  372. mage_ai/services/compute/aws/__init__.py +0 -0
  373. mage_ai/services/compute/aws/constants.py +21 -0
  374. mage_ai/services/compute/aws/models.py +459 -0
  375. mage_ai/services/compute/aws/steps.py +482 -0
  376. mage_ai/services/compute/constants.py +27 -0
  377. mage_ai/services/compute/models.py +212 -0
  378. mage_ai/services/k8s/job_manager.py +3 -0
  379. mage_ai/services/spark/api/aws_emr.py +38 -0
  380. mage_ai/services/spark/api/base.py +7 -4
  381. mage_ai/services/spark/api/constants.py +4 -0
  382. mage_ai/services/spark/api/local.py +25 -24
  383. mage_ai/services/spark/api/service.py +15 -5
  384. mage_ai/services/spark/constants.py +1 -1
  385. mage_ai/services/spark/models/applications.py +45 -3
  386. mage_ai/services/spark/models/base.py +3 -19
  387. mage_ai/services/spark/models/environments.py +16 -11
  388. mage_ai/services/spark/models/executors.py +2 -2
  389. mage_ai/services/spark/models/sqls.py +46 -15
  390. mage_ai/services/spark/models/stages.py +55 -32
  391. mage_ai/services/spark/models/threads.py +2 -2
  392. mage_ai/services/spark/utils.py +22 -6
  393. mage_ai/services/ssh/__init__.py +0 -0
  394. mage_ai/services/ssh/aws/__init__.py +0 -0
  395. mage_ai/services/ssh/aws/emr/__init__.py +0 -0
  396. mage_ai/services/ssh/aws/emr/constants.py +10 -0
  397. mage_ai/services/ssh/aws/emr/models.py +326 -0
  398. mage_ai/services/ssh/aws/emr/utils.py +151 -0
  399. mage_ai/settings/__init__.py +16 -1
  400. mage_ai/settings/secret_generation.py +7 -0
  401. mage_ai/settings/sso.py +20 -0
  402. mage_ai/shared/hash.py +17 -1
  403. mage_ai/shared/models.py +253 -0
  404. mage_ai/streaming/constants.py +2 -0
  405. mage_ai/streaming/sources/activemq.py +89 -0
  406. mage_ai/streaming/sources/nats_js.py +182 -0
  407. mage_ai/streaming/sources/source_factory.py +8 -0
  408. mage_ai/tests/ai/test_ai_functions.py +53 -8
  409. mage_ai/tests/api/endpoints/test_oauths.py +33 -0
  410. mage_ai/tests/api/endpoints/test_projects.py +1 -0
  411. mage_ai/tests/api/endpoints/test_workspaces.py +55 -0
  412. mage_ai/tests/api/operations/test_base.py +7 -5
  413. mage_ai/tests/api/operations/test_operations.py +0 -1
  414. mage_ai/tests/api/operations/test_operations_with_hooks.py +577 -0
  415. mage_ai/tests/api/operations/test_syncs.py +0 -1
  416. mage_ai/tests/api/operations/test_users.py +13 -2
  417. mage_ai/tests/data_preparation/executors/test_block_executor.py +1 -0
  418. mage_ai/tests/data_preparation/models/global_hooks/__init__.py +0 -0
  419. mage_ai/tests/data_preparation/models/global_hooks/test_global_hooks.py +575 -0
  420. mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +760 -0
  421. mage_ai/tests/data_preparation/models/global_hooks/test_utils.py +33 -0
  422. mage_ai/tests/data_preparation/models/test_pipeline.py +5 -0
  423. mage_ai/tests/data_preparation/test_repo_manager.py +11 -0
  424. mage_ai/tests/data_preparation/test_templates.py +1 -0
  425. mage_ai/tests/factory.py +132 -10
  426. mage_ai/tests/orchestration/queue/test_process_queue.py +15 -2
  427. mage_ai/tests/orchestration/test_pipeline_scheduler.py +447 -79
  428. mage_ai/tests/services/aws/ecs/__init__.py +0 -0
  429. mage_ai/tests/services/aws/ecs/test_config.py +144 -0
  430. mage_ai/tests/services/k8s/test_job_manager.py +22 -1
  431. mage_ai/tests/shared/mixins.py +291 -0
  432. mage_ai/tests/shared/test_hash.py +17 -1
  433. mage_ai/tests/streaming/sources/test_activemq.py +32 -0
  434. mage_ai/tests/streaming/sources/test_nats_js.py +32 -0
  435. mage_ai/tests/streaming/sources/test_source_factory.py +26 -1
  436. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/METADATA +28 -66
  437. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/RECORD +443 -364
  438. mage_ai/authentication/oauth/active_directory.py +0 -17
  439. mage_ai/server/frontend_dist/_next/static/RPXiX8RpZ7oO-yeaEtV2c/_buildManifest.js +0 -1
  440. mage_ai/server/frontend_dist/_next/static/chunks/1125-91d3ce33140ef041.js +0 -1
  441. mage_ai/server/frontend_dist/_next/static/chunks/1749-607014ecf28268bf.js +0 -1
  442. mage_ai/server/frontend_dist/_next/static/chunks/1952-573c7fc7ad84da6e.js +0 -1
  443. mage_ai/server/frontend_dist/_next/static/chunks/3004-231cad9039ae5dcb.js +0 -1
  444. mage_ai/server/frontend_dist/_next/static/chunks/3419-0873e170ef7d6303.js +0 -1
  445. mage_ai/server/frontend_dist/_next/static/chunks/3932-0ceca9599d6e6d00.js +0 -1
  446. mage_ai/server/frontend_dist/_next/static/chunks/4267-335766a915ee2fa9.js +0 -1
  447. mage_ai/server/frontend_dist/_next/static/chunks/5457-8be2e0a3fe0ba64b.js +0 -1
  448. mage_ai/server/frontend_dist/_next/static/chunks/5499-bca977f466e259e1.js +0 -1
  449. mage_ai/server/frontend_dist/_next/static/chunks/553-edf533e634e85192.js +0 -1
  450. mage_ai/server/frontend_dist/_next/static/chunks/5810-37c6091b29a1fe53.js +0 -1
  451. mage_ai/server/frontend_dist/_next/static/chunks/600-0733eb84f0a0a9e0.js +0 -1
  452. mage_ai/server/frontend_dist/_next/static/chunks/6333-53b6ebbef95a3691.js +0 -1
  453. mage_ai/server/frontend_dist/_next/static/chunks/722-3fff38a9019369fe.js +0 -1
  454. mage_ai/server/frontend_dist/_next/static/chunks/8224-39a93ee1058b6069.js +0 -1
  455. mage_ai/server/frontend_dist/_next/static/chunks/8264-6ef8fdb195694807.js +0 -1
  456. mage_ai/server/frontend_dist/_next/static/chunks/9264-1b5c4b071ed544c3.js +0 -1
  457. mage_ai/server/frontend_dist/_next/static/chunks/framework-7c365855dab1bf41.js +0 -1
  458. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-a4a660fa14cf05a9.js +0 -1
  459. mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-c465c14d48392b11.js +0 -1
  460. mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-b1f8d5a7a9a30f2d.js +0 -1
  461. mage_ai/server/frontend_dist/_next/static/chunks/pages/files-93c094bad0f299fb.js +0 -1
  462. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-891e5bd5935f7473.js +0 -1
  463. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-d2e4ee4e68d36807.js +0 -1
  464. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-4a49126fcfe8ced0.js +0 -1
  465. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-5f8c5d0bc6ad1113.js +0 -1
  466. mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-09467512a85c96ed.js +0 -1
  467. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-31bde04718d0d3a8.js +0 -1
  468. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-96718f95103d7844.js +0 -1
  469. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a9266d353f288e8c.js +0 -1
  470. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-b5c29c852262312e.js +0 -1
  471. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-5d525454ff7aeb3f.js +0 -1
  472. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-883f4ae9a4a264c0.js +0 -1
  473. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-c65be964e6398cb7.js +0 -1
  474. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-1f5b4a974bd39740.js +0 -1
  475. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-074c32397d341de9.js +0 -1
  476. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-50f5d8706ed0bc73.js +0 -1
  477. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-e151c1552fcb67bd.js +0 -1
  478. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cc36f0f8c73fee4b.js +0 -1
  479. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-8336c4326f1e7d96.js +0 -1
  480. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-01dd679e4a21e0d9.js +0 -1
  481. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-4d9051c073a9b2ff.js +0 -1
  482. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-88d41c33b8fcb300.js +0 -1
  483. mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-d859e07561eb9010.js +0 -1
  484. mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-578d862f3e56e6e6.js +0 -1
  485. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-1c0588d685b909b9.js +0 -1
  486. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-e284cf1535d93798.js +0 -1
  487. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1125-91d3ce33140ef041.js +0 -1
  488. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1749-607014ecf28268bf.js +0 -1
  489. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-573c7fc7ad84da6e.js +0 -1
  490. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3004-231cad9039ae5dcb.js +0 -1
  491. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3419-0873e170ef7d6303.js +0 -1
  492. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3932-0ceca9599d6e6d00.js +0 -1
  493. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-335766a915ee2fa9.js +0 -1
  494. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-8be2e0a3fe0ba64b.js +0 -1
  495. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-bca977f466e259e1.js +0 -1
  496. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/553-edf533e634e85192.js +0 -1
  497. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-37c6091b29a1fe53.js +0 -1
  498. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/600-0733eb84f0a0a9e0.js +0 -1
  499. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-53b6ebbef95a3691.js +0 -1
  500. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-3fff38a9019369fe.js +0 -1
  501. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8224-39a93ee1058b6069.js +0 -1
  502. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-6ef8fdb195694807.js +0 -1
  503. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-1b5c4b071ed544c3.js +0 -1
  504. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/framework-7c365855dab1bf41.js +0 -1
  505. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-a4a660fa14cf05a9.js +0 -1
  506. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-c465c14d48392b11.js +0 -1
  507. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-b1f8d5a7a9a30f2d.js +0 -1
  508. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-93c094bad0f299fb.js +0 -1
  509. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-891e5bd5935f7473.js +0 -1
  510. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-d2e4ee4e68d36807.js +0 -1
  511. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-4a49126fcfe8ced0.js +0 -1
  512. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-5f8c5d0bc6ad1113.js +0 -1
  513. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-09467512a85c96ed.js +0 -1
  514. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-31bde04718d0d3a8.js +0 -1
  515. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-96718f95103d7844.js +0 -1
  516. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a9266d353f288e8c.js +0 -1
  517. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-b5c29c852262312e.js +0 -1
  518. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-5d525454ff7aeb3f.js +0 -1
  519. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-883f4ae9a4a264c0.js +0 -1
  520. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-c65be964e6398cb7.js +0 -1
  521. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-1f5b4a974bd39740.js +0 -1
  522. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-074c32397d341de9.js +0 -1
  523. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-50f5d8706ed0bc73.js +0 -1
  524. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-e151c1552fcb67bd.js +0 -1
  525. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cc36f0f8c73fee4b.js +0 -1
  526. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-8336c4326f1e7d96.js +0 -1
  527. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-01dd679e4a21e0d9.js +0 -1
  528. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-4d9051c073a9b2ff.js +0 -1
  529. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-88d41c33b8fcb300.js +0 -1
  530. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-d859e07561eb9010.js +0 -1
  531. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-578d862f3e56e6e6.js +0 -1
  532. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-1c0588d685b909b9.js +0 -1
  533. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-e284cf1535d93798.js +0 -1
  534. mage_ai/server/frontend_dist_base_path_template/_next/static/rNR5JgSxO3eA2BWGa_i7U/_buildManifest.js +0 -1
  535. /mage_ai/server/frontend_dist/_next/static/{RPXiX8RpZ7oO-yeaEtV2c → 9jB4XPuz6BzxBcG9VNao5}/_ssgManifest.js +0 -0
  536. /mage_ai/server/frontend_dist_base_path_template/_next/static/{rNR5JgSxO3eA2BWGa_i7U → uPDjJYpJMst1q6psbRyte}/_ssgManifest.js +0 -0
  537. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/LICENSE +0 -0
  538. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/WHEEL +0 -0
  539. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/entry_points.txt +0 -0
  540. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551,5810,1125],{7432:function(e,n,t){var i={"./Active4D.json":[266,266],"./All Hallows Eve.json":[4450,4450],"./Amy.json":[88849,8849],"./Birds of Paradise.json":[78097,8097],"./Blackboard.json":[88018,6115],"./Brilliance Black.json":[73835,3835],"./Brilliance Dull.json":[6507,6507],"./Chrome DevTools.json":[22508,2508],"./Clouds Midnight.json":[49566,9566],"./Clouds.json":[57951,7951],"./Cobalt.json":[80826,826],"./Cobalt2.json":[98256,8256],"./Dawn.json":[76958,6958],"./Dominion Day.json":[89307,9307],"./Dracula.json":[33453,3453],"./Dreamweaver.json":[19363,9363],"./Eiffel.json":[82481,2481],"./Espresso Libre.json":[44776,4776],"./GitHub Dark.json":[792,792],"./GitHub Light.json":[61450,1450],"./GitHub.json":[10739,739],"./IDLE.json":[67947,7947],"./Katzenmilch.json":[81240,1240],"./Kuroir Theme.json":[4388,4388],"./LAZY.json":[25164,5164],"./MagicWB (Amiga).json":[76443,6443],"./Merbivore Soft.json":[99361,9361],"./Merbivore.json":[86042,6042],"./Monokai Bright.json":[14883,4883],"./Monokai.json":[34454,4454],"./Night Owl.json":[60261,261],"./Nord.json":[59785,9785],"./Oceanic Next.json":[58920,8920],"./Pastels on Dark.json":[38901,8901],"./Slush and Poppies.json":[26434,6434],"./Solarized-dark.json":[36116,6116],"./Solarized-light.json":[5008,5008],"./SpaceCadet.json":[20440,440],"./Sunburst.json":[68018,8018],"./Textmate (Mac Classic).json":[15824,5824],"./Tomorrow-Night-Blue.json":[81150,1150],"./Tomorrow-Night-Bright.json":[8762,8762],"./Tomorrow-Night-Eighties.json":[82545,2545],"./Tomorrow-Night.json":[99855,9855],"./Tomorrow.json":[34092,4092],"./Twilight.json":[93898,3898],"./Upstream Sunburst.json":[98807,8807],"./Vibrant Ink.json":[89927,9927],"./Xcode_default.json":[64042,4042],"./Zenburnesque.json":[33467,3467],"./iPlastic.json":[88277,8277],"./idleFingers.json":[5104,5104],"./krTheme.json":[9633,9633],"./monoindustrial.json":[15729,5729],"./themelist.json":[79437,9437]};function o(e){if(!t.o(i,e))return Promise.resolve().then((function(){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}));var n=i[e],o=n[0];return t.e(n[1]).then((function(){return t.t(o,19)}))}o.keys=function(){return Object.keys(i)},o.id=7432,e.exports=o},65557:function(e,n,t){"use strict";var i=t(21831),o=t(75582),r=t(82684),l=t(80329);n.Z=function(e){var n=e.children,t=e.uuid,u=e.uuids,c=void 0===u?[]:u,a=(0,l.j)("apiReloads"),s=(0,o.Z)(a,1)[0],d=(0,i.Z)(c);t&&d.push(t);var p=d.map((function(e){return String(s[e])||"-"})).join("_");return r.cloneElement(n,{key:p})}},89209:function(e,n,t){"use strict";t.d(n,{M4:function(){return d},S0:function(){return a},S_:function(){return c},Yn:function(){return p},rW:function(){return s}});var i=t(82394),o=t(21831),r=t(75582);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 u(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,i.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 c(e,n){return Object.entries(n).map((function(n){var t=(0,r.Z)(n,2),i=t[0],o=t[1];return e.languages.registerCompletionItemProvider(i,{provideCompletionItems:o(e)})}))}function a(e){var n=function(e){var n="[\\w.]+",t=["import ".concat(n," as ").concat(n),"import ".concat(n),"from ".concat(n," import ").concat(n," as ").concat(n),"from ".concat(n," import ").concat(n)],i=new RegExp("(".concat(t.join("|"),")"),"g");return(0,o.Z)(e.matchAll(i)).map((function(e){return e[1]}))}(e),t="[\\w.]+",r=["from ".concat(t," import ").concat(t," as (").concat(t,")"),"from ".concat(t," import (").concat(t,")"),"import ".concat(t," as (").concat(t,")"),"import (".concat(t,")")],l=new RegExp("(".concat(r.join("|"),")"));return n.reduce((function(e,n){var t=n.match(l);if(!t)return e;var r=(0,o.Z)(t),c=r[2],a=r[3],s=r[4],d=r[5],p=c||a||s||d;return u(u({},e),{},(0,i.Z)({},p,n))}),{})}function s(e,n){var t=e;n&&(t=t.split(" as ".concat(n))[0]);var i="[\\w.]+",l=["from ".concat(i," import (").concat(i,")"),"import (".concat(i,")")],u=new RegExp("(".concat(l.join("|"),")"),"g"),c=(0,o.Z)(t.matchAll(u))[0];if(c){var a=(0,r.Z)(c,4),s=a[2],d=a[3];return s||d}}function d(e,n){return function(e,n){return e.split("\n")[n.startLineNumber-1]}(e,n).slice(0,n.startColumn-1)}function p(e){var n=new RegExp("([\\w_]+)[ ]*=[ ]*([\\w_]+)","g");return(0,o.Z)(e.matchAll(n)).map((function(e){return{assignmentValue:e[2],variableName:e[1]}}))}},89678:function(e,n,t){"use strict";t.d(n,{Ep:function(){return u},KT:function(){return s},Nk:function(){return a},aU:function(){return c}});var i=t(38626),o=t(44897),r=t(95363),l=t(70515),u=2,c=21,a=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-w2hta3-0"})(["font-family:",";"," ",""],r.ry,(function(e){return e.padding&&"\n padding-top: ".concat(2*l.iI,"px;\n background-color: ").concat((e.theme.background||o.Z.background).codeTextarea,";\n ")}),(function(e){return e.hideDuplicateMenuItems&&'\n /*\n * The (n + 10) assumes a specific number of items in the block editor context\n * menu. This includes "Run selected block", "Change All Occurrences", "Cut",\n * "Copy", "Paste", "Command Palette", and 3 dividers. The 10th item from the\n * bottom and higher are hidden to avoid duplicate shortcut items in the\n * context menu.\n */\n .monaco-menu li.action-item:nth-last-child(n + 10) {\n display: none;\n }\n '})),s=i.default.div.withConfig({displayName:"indexstyle__PlaceholderStyle",componentId:"sc-w2hta3-1"})(["padding-left:67px;position:absolute;z-index:1;"])},75810:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var i=t(85202),o=t(66639),r=t(82684),l=t(44425),u=t(30160),c=t(98464),a=t(95363),s=t(61896),d=t(89678),p=t(89209);function f(e,n,t){t.forEach((function(e){n.addAction(e)}))}var v=t(75582),h={"all-hallows-eve":"All Hallows Eve","birds-of-paradise":"Birds of Paradise","brilliance-black":"Brilliance Black","brilliance-dull":"Brilliance Dull","chrome-devtools":"Chrome DevTools","clouds-midnight":"Clouds Midnight","espresso-libre":"Espresso Libre","kuroir-theme":"Kuroir Theme","magicwb--amiga-":"MagicWB (Amiga)","merbivore-soft":"Merbivore Soft","monokai-bright":"Monokai Bright","night-owl":"Night Owl","oceanic-next":"Oceanic Next","pastels-on-dark":"Pastels on Dark","slush-and-poppies":"Slush and Poppies","solarized-dark":"Solarized-dark","solarized-light":"Solarized-light","textmate--mac-classic-":"Textmate (Mac Classic)","tomorrow-night":"Tomorrow-Night","tomorrow-night-blue":"Tomorrow-Night-Blue","tomorrow-night-bright":"Tomorrow-Night-Bright","tomorrow-night-eighties":"Tomorrow-Night-Eighties","upstream-sunburst":"Upstream Sunburst","vibrant-ink":"Vibrant Ink","xcode-default":"Xcode_default",active4d:"Active4D",amy:"Amy",blackboard:"Blackboard",clouds:"Clouds",cobalt:"Cobalt",dawn:"Dawn",dreamweaver:"Dreamweaver",eiffel:"Eiffel",github:"GitHub",idle:"IDLE",idlefingers:"idleFingers",iplastic:"iPlastic",katzenmilch:"Katzenmilch",krtheme:"krTheme",lazy:"LAZY",merbivore:"Merbivore",monoindustrial:"monoindustrial",monokai:"Monokai",spacecadet:"SpaceCadet",sunburst:"Sunburst",tomorrow:"Tomorrow",twilight:"Twilight",zenburnesque:"Zenburnesque"};var m=t(37529),b=t(28598);o._m.config({paths:{vs:"/monaco-editor/min/vs"}});var g=function(e){var n=e.autocompleteProviders,g=e.autoHeight,x=e.autoSave,j=e.block,y=e.fontSize,k=void 0===y?s.i3:y,Z=e.height,P=e.language,O=e.onChange,C=e.onContentSizeChangeCallback,w=e.onDidChangeCursorPosition,_=e.onMountCallback,S=e.onSave,I=e.padding,E=e.placeholder,T=e.readOnly,M=e.selected,D=(e.setSelected,e.setTextareaFocused),B=e.shortcuts,R=e.showLineNumbers,A=void 0===R||R,N=e.tabSize,L=void 0===N?4:N,F=e.textareaFocused,U=e.theme,H=void 0===U?"twilight":U,z=e.value,W=e.width,K=void 0===W?"100%":W,G=(0,r.useRef)(null),V=(0,r.useRef)(null),q=(0,r.useRef)(null),Y=(0,r.useState)([]),Q=Y[0],X=Y[1],J=(0,r.useState)(null),$=J[0],ee=J[1],ne=(0,r.useState)(!1),te=ne[0],ie=ne[1],oe=(0,r.useState)(null),re=oe[0],le=oe[1],ue=(0,r.useCallback)((function(e){le((function(n){return n!==H&&function(e){return new Promise((function(n){Promise.all([o._m.init(),t(7432)("./".concat(h[e],".json"))]).then((function(t){var i=(0,v.Z)(t,2),o=i[0],r=i[1];r.colors["editor.background"]="#000000",r.colors["editor.foreground"]="#FFFFFF",o.editor.defineTheme(e,r),n(!0)})).catch((function(){n(!1)}))}))}(H).then((function(n){if(n)return e.editor.setTheme(H),H})),n}))}),[H]),ce=(0,r.useCallback)((function(e){e.languages.typescript.javascriptDefaults.setEagerModelSync(!0),ee(e),ue(e)}),[ue]),ae=(0,r.useCallback)((function(e,n){G.current=e,V.current=n;var t=[];null===B||void 0===B||B.forEach((function(i){t.push(i(n,e))})),S&&t.push((0,m.e)(n,(function(){S(e.getValue())}))),f(0,e,t),e.getModel().updateOptions({tabSize:L}),g&&!Z&&(e._domElement.style.height="".concat(((z||"").split("\n").length+d.Ep)*d.aU,"px")),e.onDidFocusEditorWidget((function(){null===D||void 0===D||D(!0)})),e.onDidContentSizeChange((function(n){var t=n.contentHeight,i=n.contentHeightChanged;g&&i&&(e._domElement.style.height="".concat(t+2*d.aU,"px")),C&&(null===C||void 0===C||C())})),M&&F&&setTimeout((function(){e.focus()}),1),w&&e.onDidChangeCursorPosition((function(n){var t=n.position.lineNumber,i=e._domElement.getBoundingClientRect(),o=i.height,r=i.top,l=e.getTopForLineNumber(t);w({editorRect:{height:Number(o),top:Number(r)},position:{lineNumberTop:l}})})),ie(!0),null===_||void 0===_||_()}),[g,Z,C,w,_,S,M,ie,D,B,L,F,z]);(0,r.useEffect)((function(){var e;return x&&S&&(e=setInterval((function(){S(G.current.getValue())}),5e3)),function(){x&&e&&clearInterval(e)}}),[x,G,S]);var se=(0,c.Z)(M),de=(0,c.Z)(F);return(0,r.useEffect)((function(){null!==G&&void 0!==G&&G.current&&(M&&F?setTimeout((function(){G.current.focus()}),1):i.findDOMNode(G.current._domElement).getElementsByClassName("inputarea")[0].blur())}),[G,M,se,F,de]),(0,r.useEffect)((function(){if(null!==V&&void 0!==V&&V.current&&null!==G&&void 0!==G&&G.current){var e=[];null===B||void 0===B||B.forEach((function(n){e.push(n(null===V||void 0===V?void 0:V.current,null===G||void 0===G?void 0:G.current))})),f(null===V||void 0===V||V.current,null===G||void 0===G?void 0:G.current,e)}}),[null===j||void 0===j?void 0:j.downstream_blocks,null===j||void 0===j?void 0:j.upstream_blocks]),(0,r.useEffect)((function(){return function(){Q.map((function(e){return e.dispose()}))}}),[Q]),(0,r.useEffect)((function(){$&&n&&(0===Q.length&&F||!de&&F?X((0,p.S_)($,n)):de&&!F&&Q.map((function(e){return e.dispose()})))}),[n,Q,$,F,de]),(0,b.jsxs)(d.Nk,{hideDuplicateMenuItems:!0,padding:I,style:{display:te?null:"none"},children:[E&&!(null!==z&&void 0!==z&&z.length)&&(0,b.jsx)(d.KT,{children:(0,b.jsx)(u.ZP,{monospace:!0,muted:!0,children:E})}),(0,b.jsx)(o.ZP,{beforeMount:ce,height:Z,language:P||"python",onChange:function(e){null===O||void 0===O||O(e)},onMount:ae,options:{domReadOnly:T,fontFamily:a.Vp,fontLigatures:!0,fontSize:k,hideCursorInOverviewRuler:!0,lineNumbers:A?"on":"off",minimap:{enabled:!1},overviewRulerBorder:!1,readOnly:T,renderLineHighlightOnlyWhenFocus:!0,scrollBeyondLastLine:!1,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"},useShadowDOM:!1,wordBasedSuggestions:!1,wordWrap:(null===j||void 0===j?void 0:j.type)===l.tf.MARKDOWN?"on":"off"},theme:re||"vs-dark",value:z,width:K}),(0,b.jsx)("div",{ref:q})]})}},37529:function(e,n,t){"use strict";function i(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"saveCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],label:"Save",precondition:null,run:function(e){n()}}}function o(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"executeCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Enter],label:"Run selected block",precondition:null,run:function(){return n()}}}t.d(n,{Q:function(){return o},e:function(){return i}})},60523:function(e,n,t){"use strict";var i=t(21831),o=t(82394),r=t(82684),l=t(38626),u=t(34376),c=t(54750),a=t(71180),s=t(90299),d=t(44898),p=t(55485),f=t(88328),v=t(38276),h=t(4190),m=t(48381),b=t(5755),g=t(30160),x=t(35686),j=t(72473),y=t(84649),k=t(32929),Z=t(15610),P=t(19183),O=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 w(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,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):C(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n,t=e.contained,o=e.defaultLinkUUID,C=e.defaultTab,_=e.objectType,S=e.onClickCustomTemplate,I=e.pipelineUUID,E=e.showAddingNewTemplates,T=e.showBreadcrumbs,M=e.tabs,D=(0,u.useRouter)(),B=(0,r.useContext)(l.ThemeContext),R=(0,P.i)(),A=R.height,N=R.width,L=(0,r.useMemo)((function(){return M||k.dP}),[M]),F=(0,r.useState)(E||!1),U=F[0],H=F[1],z=(0,r.useState)(o?k.qy.find((function(e){return e.uuid===o})):k.qy[0]),W=z[0],K=z[1],G=(0,r.useState)(C?L.find((function(e){return e.uuid===(null===C||void 0===C?void 0:C.uuid)})):L[0]),V=G[0],q=G[1],Y=(0,r.useState)(null),Q=Y[0],X=Y[1],J=x.ZP.custom_templates.list({object_type:d.Z},{},{pauseFetch:k.n9.uuid!==(null===V||void 0===V?void 0:V.uuid)}),$=J.data,ee=J.mutate,ne=(0,r.useMemo)((function(){var e=(null===$||void 0===$?void 0:$.custom_templates)||[];return null!==W&&void 0!==W&&W.filterTemplates?null===W||void 0===W?void 0:W.filterTemplates(e):e}),[$,W]),te=x.ZP.custom_templates.list({object_type:d.R},{},{pauseFetch:k.A2.uuid!==(null===V||void 0===V?void 0:V.uuid)}),ie=te.data,oe=te.mutate,re=(0,r.useMemo)((function(){var e=(null===ie||void 0===ie?void 0:ie.custom_templates)||[];return null!==W&&void 0!==W&&W.filterTemplates?null===W||void 0===W?void 0:W.filterTemplates(e):e}),[ie,W]),le=(0,r.useMemo)((function(){return k.qy.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,o=e.selectedIconProps,r=e.uuid,l=(null===W||void 0===W?void 0:W.uuid)===r,u=w({size:y.ZG},l&&o?o:{});return(0,O.jsx)(y.wj,{onClick:function(){return K(e)},selected:l,children:(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(y.ze,{backgroundColor:l&&i?i(B):null,children:n?(0,O.jsx)(n,w({},u)):(0,O.jsx)(j.pd,w({},u))}),(0,O.jsx)(g.ZP,{bold:!0,large:!0,children:t?t():r})]})},r)}))}),[W,B]),ue=(0,r.useMemo)((function(){return k.hS.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,o=e.selectedIconProps,r=e.uuid,l=(null===W||void 0===W?void 0:W.uuid)===r,u=w({size:y.ZG},l&&o?o:{});return(0,O.jsx)(y.wj,{onClick:function(){return K(e)},selected:l,children:(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(y.ze,{backgroundColor:l&&i?i(B):null,children:n?(0,O.jsx)(n,w({},u)):(0,O.jsx)(j.pd,w({},u))}),(0,O.jsx)(g.ZP,{bold:!0,large:!0,children:t?t():r})]})},r)}))}),[W,B]),ce=(0,r.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.description,t=e.name,o=e.tags,r=e.template_uuid,l=e.user,u=[];return null!==o&&void 0!==o&&o.length?u.push.apply(u,(0,i.Z)(o)):null!==l&&void 0!==l&&l.username&&u.push(null===l||void 0===l?void 0:l.username),(0,O.jsxs)(y.UE,{onClick:function(){S?S(e):D.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(r)))},children:[(0,O.jsx)(y.Tj,{children:(0,O.jsx)(g.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||r})}),(0,O.jsx)(y.SL,{children:(0,O.jsx)(g.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,O.jsx)(y.EN,{children:(null===u||void 0===u?void 0:u.length)>=1&&(0,O.jsx)(m.Z,{tags:null===u||void 0===u?void 0:u.map((function(e){return{uuid:e}}))})})]},r)}))}),[ne,S,D]),ae=(0,r.useMemo)((function(){return null===re||void 0===re?void 0:re.map((function(e){var n=e.description,t=e.name,o=e.tags,r=e.template_uuid,l=e.user,u=[];return null!==o&&void 0!==o&&o.length?u.push.apply(u,(0,i.Z)(o)):null!==l&&void 0!==l&&l.username&&u.push(null===l||void 0===l?void 0:l.username),(0,O.jsxs)(y.UE,{onClick:function(){S?S(e):D.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(r),"?object_type=").concat(d.R))},children:[(0,O.jsx)(y.Tj,{children:(0,O.jsx)(g.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||r})}),(0,O.jsx)(y.SL,{children:(0,O.jsx)(g.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,O.jsx)(y.EN,{children:(null===u||void 0===u?void 0:u.length)>=1&&(0,O.jsx)(m.Z,{tags:null===u||void 0===u?void 0:u.map((function(e){return{uuid:e}}))})})]},r)}))}),[re,S,D]),se=(0,r.useMemo)((function(){if(!T)return null;var e=[];return U?e.push.apply(e,[{label:function(){return"Templates"},onClick:function(){H(!1)}},{bold:!0,label:function(){return"New custom template"}}]):e.push({label:function(){return"Templates"}}),(0,O.jsx)(y.FX,{children:(0,O.jsx)(c.Z,{breadcrumbs:e})})}),[U,T]),de=(0,r.useMemo)((function(){return T?36:0}),[T]),pe=(0,r.useMemo)((function(){return A-de}),[A,de]);if(U)return n=d.R===_&&I?(0,O.jsx)(f.Z,{onMutateSuccess:oe,pipelineUUID:I,templateAttributes:W&&(null===W||void 0===W?void 0:W.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{pipeline_type:null===W||void 0===W?void 0:W.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}):(0,O.jsx)(b.Z,{contained:t,heightOffset:de,onCreateCustomTemplate:t?function(e){X(e)}:null,onMutateSuccess:ee,templateAttributes:W&&(null===W||void 0===W?void 0:W.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{block_type:null===W||void 0===W?void 0:W.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}),t?(0,O.jsxs)(O.Fragment,{children:[T&&se,(0,O.jsx)(y.Rd,{height:pe,width:N,children:n})]}):n;var fe=(0,O.jsxs)(y.Nk,{children:[(0,O.jsxs)(y.bC,{height:t?pe:null,children:[(0,O.jsx)(y.Yf,{children:(0,O.jsx)(s.Z,{noPadding:!0,onClickTab:function(e){t?q(e):(0,Z.u7)({object_type:k.A2.uuid===e.uuid?d.R:d.Z})},selectedTabUUID:null===V||void 0===V?void 0:V.uuid,tabs:L})}),(0,O.jsxs)(y.wl,{contained:t,heightOffset:de,children:[k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&le,k.A2.uuid===(null===V||void 0===V?void 0:V.uuid)&&ue]})]}),(0,O.jsxs)(y.w5,{children:[k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsx)(y.HS,{children:(0,O.jsx)(a.ZP,{beforeIcon:(0,O.jsx)(j.mm,{size:y.ZG}),onClick:function(){H(!0)},primary:!0,children:"New block template"})}),k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsxs)(O.Fragment,{children:[!$&&(0,O.jsx)(v.Z,{p:2,children:(0,O.jsx)(h.Z,{inverted:!0})}),$&&!(null!==ce&&void 0!==ce&&ce.length)&&(0,O.jsxs)(v.Z,{p:2,children:[(0,O.jsx)(g.ZP,{children:"There are currently no templates matching your search."}),(0,O.jsx)("br",{}),(0,O.jsx)(g.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ce||void 0===ce?void 0:ce.length)>=1&&(0,O.jsx)(y.n8,{children:ce})]}),k.A2.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsxs)(O.Fragment,{children:[!ie&&(0,O.jsx)(v.Z,{p:2,children:(0,O.jsx)(h.Z,{inverted:!0})}),ie&&!(null!==ae&&void 0!==ae&&ae.length)&&(0,O.jsxs)(v.Z,{p:2,children:[(0,O.jsx)(g.ZP,{children:"There are currently no templates matching your search."}),(0,O.jsx)("br",{}),(0,O.jsx)(g.ZP,{children:'Add a new template by right-clicking a pipeline row from the Pipelines page and selecting "Create template".'})]}),(null===ae||void 0===ae?void 0:ae.length)>=1&&(0,O.jsx)(y.n8,{children:ae})]})]})]});return t?(0,O.jsxs)(O.Fragment,{children:[T&&se,(0,O.jsx)(y.Rd,{height:pe,width:N,children:fe})]}):fe}},33065:function(e,n,t){"use strict";t.d(n,{HE:function(){return b},I5:function(){return f},N0:function(){return m},Nk:function(){return p},Tr:function(){return d},UF:function(){return a},YI:function(){return g},bC:function(){return v},cL:function(){return h},yh:function(){return s}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=t(91437),a=8*l.iI,s=i.default.div.withConfig({displayName:"indexstyle__AfterContentStyle",componentId:"sc-119v89s-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-119v89s-1"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-119v89s-2"})(["border-radius:","px;position:relative;"," ",""],r.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||o.Z.borders).light,";\n background-color: ").concat((e.theme.background||o.Z.background).panel,";\n ")}),(function(e){return e.maxWidth&&"\n width: ".concat(e.maxWidth,"px;\n ")})),f=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-119v89s-3"})(["padding:","px;",""],l.cd*l.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||o.Z.borders).light,";\n ")})),v=i.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-119v89s-4"})([""," "," ",""],(0,c.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||o.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")})),h=i.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-119v89s-5"})(["position:absolute;"]),m=i.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-119v89s-6"})([""," overflow:auto;position:fixed;",""],u.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||o.Z.borders).light,";\n ")})),b=i.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-119v89s-7"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],r.n_,l.cd*l.iI,1*l.iI,(function(e){return!e.warning&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(e){return!e.selected&&!e.warning&&"\n border: 1px solid ".concat((e.theme.borders||o.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||o.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||o.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||o.Z.borders).contrast,";\n ")})),g=i.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-119v89s-8"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n ")}))},29618:function(e,n,t){"use strict";t.d(n,{Z:function(){return A}});var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(80329),c=t(69864),a=t(40761),s=t(44425),d=t(71180),p=t(38626),f=t(97618),v=t(55485),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.ZP,{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(75810),j=t(89706),y=t(93369),k=t(57653),Z=t(38276),P=t(35686),O=t(39643),C=t(11498),w=t(85385),_=t(68669),S=t(86735),I=t(53005),E=t(81728),T=t(72619),M=t(42041),D=t(44688);function B(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 R(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?B(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var A=function(e){var n=e.active,t=e.addNewBlock,p=e.disableRefreshWarning,f=e.fetchPipeline,m=e.fetchVariables,b=e.filePath,B=e.hideHeaderButtons,A=e.onContentChange,N=e.onUpdateFileSuccess,L=e.openSidekickView,F=e.pipeline,U=e.saveFile,H=e.selectedFilePath,z=e.sendTerminalMessage,W=e.setDisableShortcuts,K=e.setErrors,G=e.setFilesTouched,V=e.setSelectedBlock,q=(0,u.j)("apiReloads"),Y=(0,o.Z)(q,2)[1],Q=(0,l.useState)(null),X=Q[0],J=Q[1],$=(0,l.useState)(!1),ee=$[0],ne=($[1],(0,l.useRef)(null)),te=(0,l.useMemo)((function(){return new a.Z}),[]),ie=(0,l.useMemo)((function(){return{api_key:C.l,token:te.decodedToken.token}}),[te]),oe=P.ZP.statuses.list().data,re=(0,l.useMemo)((function(){var e,n;return null===oe||void 0===oe||null===(e=oe.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[oe]),le=P.ZP.file_contents.detail(b).data;(0,l.useEffect)((function(){null!==le&&void 0!==le&&le.file_content?J(le.file_content):null!==le&&void 0!==le&&le.error&&(0,T.h$)(le,{onErrorCallback:function(e,n){return K({errors:n,response:e})}})}),[le,K]);var ue=(0,l.useState)(null===X||void 0===X?void 0:X.content),ce=ue[0],ae=ue[1],se=(0,l.useCallback)((function(e){ae(e),A&&(null===A||void 0===A||A(e))}),[A]),de=(0,l.useState)(!1),pe=de[0],fe=de[1];(0,l.useEffect)((function(){n&&W&&(null===W||void 0===W||W(!0))}),[n,W]),(0,l.useEffect)((function(){var e;H&&(null===ne||void 0===ne||null===(e=ne.current)||void 0===e||e.scrollIntoView())}),[H]);var ve=(0,c.Db)(P.ZP.file_contents.useUpdate((null===X||void 0===X?void 0:X.path)&&encodeURIComponent(null===X||void 0===X?void 0:X.path)),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(e){var n=e.file_content;Y((function(e){return R(R({},e),{},(0,i.Z)({},"FileVersions/".concat(null===X||void 0===X?void 0:X.path),Number(new Date)))})),N&&(null===N||void 0===N||N(n))},onErrorCallback:function(e,n){return null===K||void 0===K?void 0:K({errors:n,response:e})}})}}),he=(0,o.Z)(ve,1)[0],me=(0,l.useCallback)((function(e,n){if(U)return U(e,n);he({file_content:R(R({},n),{},{content:e})}).then((function(){decodeURIComponent(b).split(r.sep).pop()===j.dT.METADATA_YAML&&m&&(null===m||void 0===m||m())})),G((function(e){return R(R({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),fe(!1)}),[m,b,U,G,he]),be=(0,l.useMemo)((function(){return(0,_.lU)()}),[]),ge=(0,l.useMemo)((function(){var e,n,t,i;return null===(null===X||void 0===X||null===(e=X.path)||void 0===e?void 0:e.match(be))?j.Lu.TXT:null===X||void 0===X||null===(n=X.path)||void 0===n||null===(t=n.match(be))||void 0===t||null===(i=t[0])||void 0===i?void 0:i.split(".")[1]}),[be,X]),xe=(0,l.useMemo)((function(){if(null!==X&&void 0!==X&&X.path)return(0,h.jsx)(x.Z,{autoHeight:!0,language:j.nB[ge],onChange:function(e){se(e),G((function(e){return R(R({},e),{},(0,i.Z)({},null===X||void 0===X?void 0:X.path,!0))})),fe(!0)},onSave:function(e){me(e,X)},selected:!0,textareaFocused:!0,value:(0,E.Pb)(null===X||void 0===X?void 0:X.content)?JSON.stringify(JSON.parse(null===X||void 0===X?void 0:X.content),null,2):null===X||void 0===X?void 0:X.content,width:"100%"})}),[X,ge,me,se,G]),je=null!==F&&void 0!==F&&F.blocks?(0,S.sE)(null===F||void 0===F?void 0:F.blocks,(function(e){var n=e.type;return s.tf.DATA_EXPORTER===n})):null,ye=(0,c.Db)(P.ZP.blocks.pipelines.useUpdate(null===F||void 0===F?void 0:F.uuid,null===je||void 0===je?void 0:je.uuid),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){null===f||void 0===f||f()}})}}),ke=(0,o.Z)(ye,1)[0],Ze=t&&F&&(ge===j.Lu.PY||ge===j.Lu.SQL||(ge===j.Lu.YAML||ge===j.Lu.R)&&(0,I.V3)(X,null===X||void 0===X?void 0:X.path))&&(0,_.ck)(X.path.split(r.sep))!==s.tf.SCRATCHPAD&&(0,I.lr)(X)&&(0,h.jsx)(d.ZP,{onClick:function(){var e=(null===F||void 0===F?void 0:F.type)===k.qL.INTEGRATION,n=(0,_.TU)(X,re,F);t(n,(function(n){e&&je&&ke({block:R(R({},je),{},{upstream_blocks:[n.uuid]})}),null===V||void 0===V||V(n)}))},primary:!0,children:"Add to current pipeline"}),Pe=z&&(0,h.jsx)(Z.Z,{m:2,children:(0,h.jsx)(y.ZP,{disabled:!re,inline:!0,loading:ee,onClick:function(){null===L||void 0===L||L(w.cH.TERMINAL),null===z||void 0===z||z(JSON.stringify(R(R({},ie),{},{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===X||void 0===X?void 0:X.path),Ce=(0,D.y)(),we=Ce.registerOnKeyDown,_e=Ce.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){_e(Oe)}}),[_e,Oe]),we(Oe,(function(e,t){if(n&&!p)if((0,M.y)([O.zX,O.Um],t)||(0,M.y)([O.PQ,O.Um],t))e.preventDefault(),me(ce,X);else if(pe&&(0,M.y)([O.zX,O.hS],t)){e.preventDefault();var i="".concat(X.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,X,me,pe]),(0,h.jsxs)("div",{ref:ne,children:[!B&&(0,h.jsx)(Z.Z,{p:2,children:(0,h.jsxs)(v.ZP,{justifyContent:"space-between",children:[(0,h.jsxs)(g,{children:[Ze,(0,h.jsx)(d.ZP,{disabled:!ce,onClick:function(e){e.preventDefault(),me(ce,X)},title:ce?null:"No changes have been made to this file.",children:"Save file content"})]}),L&&(0,h.jsx)(g,{children:(0,h.jsx)(d.ZP,{compact:!0,onClick:function(){L(w.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),xe,b===j.dT.REQS_TXT&&Pe]})}},53779:function(e,n,t){"use strict";t.d(n,{C:function(){return v},X$:function(){return f},eD:function(){return d},iW:function(){return h},nF:function(){return m}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=t(91437),a=6.25*l.iI,s=(l.iI,100*l.iI),d=i.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],r.n_,s,(function(e){return"\n box-shadow: ".concat((e.theme||o.Z).shadow.window,";\n background-color: ").concat((e.theme||o.Z).background.panel,";\n ")})),p=(0,i.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],a,l.iI,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).background.output,";\n ")})),f=i.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],p,r.n_,r.n_,(function(e){return"\n border-bottom: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")})),v=i.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],l.iI,u.w5,(0,c.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*l.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*a,"px);\n ")})),h=i.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],p,r.n_,r.n_,(function(e){return"\n border-top: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")})),m=i.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*l.iI,2*l.iI,(function(e){return"\n border-bottom: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")}))},28385:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(80329),c=t(69864),a=t(71180),s=t(75810),d=t(89706),p=t(97618),f=t(55485),v=t(85854),h=t(38276),m=t(4190),b=t(75499),g=t(30160),x=t(35686),j=t(70515),y=t(68669),k=t(3917),Z=t(81728),P=t(72619),O=t(3314),C=t(86735),w=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.pipeline,_=e.selectedBlock,I=e.selectedFilePath,E=e.setErrors,T=e.width,M=(0,u.j)("apiReloads"),D=(0,o.Z)(M,2)[1],B=(0,l.useMemo)((function(){return I?encodeURIComponent(I):_?encodeURIComponent("".concat(null===_||void 0===_?void 0:_.type,"/").concat(null===_||void 0===_?void 0:_.uuid)):null}),[_,I]),R=x.ZP.file_versions.files.list(B,{block_uuid:null===_||void 0===_?void 0:_.uuid,pipeline_uuid:null===t||void 0===t?void 0:t.uuid}),A=R.data,N=R.mutate,L=(0,l.useMemo)((function(){return(null===A||void 0===A?void 0:A.file_versions)||[]}),[A]),F=(0,l.useState)(null),U=F[0],H=F[1],z=(0,l.useMemo)((function(){return null===L||void 0===L?void 0:L[U]}),[U,L]),W=x.ZP.file_contents.detail(z?encodeURIComponent(z.path):null).data,K=(0,l.useMemo)((function(){return null===W||void 0===W?void 0:W.file_content}),[W]),G=(0,l.useMemo)((function(){return(0,y.lU)()}),[]),V=(0,l.useMemo)((function(){var e,n,t;return null===I||void 0===I||null===(e=I.match(G))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[I,G]),q=(0,c.Db)(x.ZP.file_contents.useUpdate(B),{onSuccess:function(e){return(0,P.wD)(e,{callback:function(e){var t;I&&N();var o=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(o);if(o){var u=o.split(r.sep);if("pipelines"===u[0]){var c=u.slice(1,u.length-1).join(r.sep);l="PipelineDetail/".concat(c)}}D((function(e){return S(S({},e),{},(0,i.Z)({},l,Number(new Date)))})),H((function(e){return e+1})),null===n||void 0===n||n(null===e||void 0===e?void 0:e.file_content,{blockUUID:null===_||void 0===_?void 0:_.uuid})},onErrorCallback:function(e,n){return E({errors:n,response:e})}})}}),Y=(0,o.Z)(q,2),Q=Y[0],X=Y[1].isLoading,J=(0,l.useCallback)((function(e){var n=S({},e);return I||(n.block_uuid=null===_||void 0===_?void 0:_.uuid,n.pipeline_uuid=null===t||void 0===t?void 0:t.uuid),Q({file_content:n})}),[t,_,I,Q]),$=(0,l.useMemo)((function(){var e=L.map((function(e){var n=e.name,t=e.path;return[(0,w.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(p.Z,{flex:1,children:[(0,w.jsx)(g.ZP,{default:!0,monospace:!0,children:(0,k.JX)(n,{withSeconds:!0})}),(0,w.jsx)(h.Z,{px:2*j.cd,children:(0,w.jsx)(g.ZP,{monospace:!0,children:n})})]}),z&&(null===z||void 0===z?void 0:z.path)===t&&(0,w.jsx)(a.ZP,{compact:!0,loading:X,onClick:function(e){(0,O.j)(e),J({version:n})},small:!0,children:"Replace with this version"})]},n)]}));if(z){var n=(0,w.jsx)(h.Z,{p:j.cd,children:(0,w.jsx)(m.Z,{},"spinner")});if(K&&(null===K||void 0===K?void 0:K.path)===(null===z||void 0===z?void 0:z.path)){var t=K.content,i=void 0===t?"":t;n=(0,w.jsx)(s.Z,{autoHeight:!0,language:d.nB[V],padding:!0,readOnly:!0,value:(0,Z.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:T})}e=(0,C.Hk)([n],U+1,e)}return e}),[K,V,L,X,z,U,J,T]);return(0,w.jsxs)("div",{style:{width:T},children:[(0,w.jsxs)(h.Z,{p:j.cd,children:[(0,w.jsx)(v.Z,{level:5,children:"File versions"}),(0,w.jsx)(g.ZP,{inline:!0,monospace:!0,children:I?decodeURIComponent(I):null===_||void 0===_?void 0:_.uuid})]}),(0,w.jsx)(b.Z,{buildRowProps:function(e){if(z&&U+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=L[e])||void 0===n?void 0:n.name)===(null===z||void 0===z?void 0:z.name)},onClickRow:function(e){z?e===U?H(null):e<U?H(e):e>U+1&&H(e-1):H(e)},rows:$})]})}},72226:function(e,n,t){"use strict";var i=t(82394),o=t(38276),r=t(75499),l=t(30160),u=t(17488),c=t(70515),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)(o.Z,{mb:1,px:c.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)(r.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var o,r,c=e.uuid,p=null===n||void 0===n||null===(o=n.outdated_after)||void 0===o?void 0:o[c],f=null===t||void 0===t||null===(r=t.outdated_after)||void 0===r?void 0:r[c];return[(0,a.jsxs)(l.ZP,{default:!0,monospace:!0,children:[c," ",f&&(0,a.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(c)),(0,a.jsx)(u.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)({},c,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},placeholder:"Enter a number",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof p||null===p?"":p},"input-".concat(c))]}))})]})}},29644:function(e,n,t){"use strict";var i=t(82394),o=t(44085),r=t(38276),l=t(75499),u=t(30160),c=t(17488),a=t(70515),s=t(81728),d=t(86735),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)(r.Z,{mb:1,px:a.cd,children:[(0,p.jsxs)(u.ZP,{bold:!0,children:["Outdated starting at ",(0,p.jsx)(u.ZP,{inline:!0,muted:!0,children:"(optional)"})]}),(0,p.jsx)(u.ZP,{muted:!0,small:!0,children:"If enough time has passed since the last global data product has ran successfully and the global data product is determined to be outdated, then you can configure it to be outdated at a specific date or time."}),(0,p.jsx)("div",{style:{marginTop:4},children:(0,p.jsxs)(u.ZP,{muted:!0,small:!0,children:["For example, let\u2019s say the global data product is outdated after 12 hours. The last successful run was yesterday at 18:00. The global data product will be outdated today at 06:00. However, if the ",(0,p.jsx)(u.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Outdated starting at"})," has a value of 17 for ",(0,p.jsx)(u.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Hour of day"}),", then the global data product won\u2019t run again until today at 17:00."]})})]}),(0,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 r,l,a,d=e.uuid,h=e.values,m=null===n||void 0===n||null===(r=n.outdated_starting_at)||void 0===r?void 0:r[d],b=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],g={compact:!0,key:"outdated-starting-at-input-".concat(d),monospace:!0,onChange:function(e){return 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)(o.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)(c.Z,v(v({},g),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,p.jsxs)(u.ZP,{default:!0,monospace:!0,children:[(0,s.vg)(d)," ",b&&(0,p.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"outdated-starting-at-label-".concat(d)),a]}))})]})}},46209:function(e,n,t){"use strict";var i=t(82394),o=t(12691),r=t.n(o),l=t(70652),u=t(48670),c=t(38276),a=t(75499),s=t(30160),d=t(17488),p=t(70515),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,o=e.originalAttributes,v=e.setObjectAttributes;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(c.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,c=e.uuid,a=null===t||void 0===t?void 0:t.settings,p=null===a||void 0===a?void 0:a[c],m=null===p||void 0===p?void 0:p.partitions,b=null===o||void 0===o||null===(n=o.settings)||void 0===n?void 0:n[c],g=null===b||void 0===b?void 0:b.partitions,x=!!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[c]={}:null===t||void 0===t||delete t[c],h(h({},n),{},{settings:t})}))}(!x)}},"selected--".concat(c)),(0,f.jsxs)("div",{children:[(0,f.jsx)(r(),{as:"/pipelines/".concat(null===t||void 0===t?void 0:t.object_uuid,"/edit?block_uuid=").concat(c),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,f.jsx)(u.Z,{monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:c})})," ",g&&(0,f.jsxs)(s.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"block-uuid-".concat(c)),(0,f.jsx)(d.Z,{compact:!0,monospace:!0,onChange:function(e){return v((function(n){var t,o;return h(h({},n),{},{settings:h(h({},null===n||void 0===n?void 0:n.settings),{},(0,i.Z)({},c,h(h({},null===n||void 0===n||null===(t=n.settings)||void 0===t?void 0:t[c]),{},{partitions:0===(null===(o=e.target.value)||void 0===o?void 0:o.length)?null:Number(e.target.value)})))})}))},placeholder:"1",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof m||null===m?"":m},"input-".concat(c))]}))})]})}},67355:function(e,n,t){"use strict";var i=t(12691),o=t.n(i),r=t(82684),l=t(34376),u=t(8666),c=t(48670),a=t(38276),s=t(4190),d=t(75499),p=t(30160),f=t(35686),v=t(70515),h=t(3314),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,r.useMemo)((function(){return n||(null===b||void 0===b?void 0:b.global_data_products)||[]}),[b,n]);return b||n?b&&0===(null===g||void 0===g?void 0:g.length)?(0,m.jsx)(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,r=e.uuid,l={as:null,href:null};return u.b.PIPELINE===n&&(l.as="/pipelines/".concat(t,"/edit"),l.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(p.ZP,{monospace:!0,children:r},"uuid"),(0,m.jsx)(p.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(o(),{as:null===l||void 0===l?void 0:l.as,href:(null===l||void 0===l?void 0:l.href)||"",passHref:!0,children:(0,m.jsx)(c.Z,{default:!0,monospace:!0,onClick:function(e){(0,h.j)(e),i.push(l.href,l.as)},preventDefault:!0,children:t})},"objectUUID")]})),uuid:"global-data-products"}):(0,m.jsx)(a.Z,{p:v.cd,children:(0,m.jsx)(s.Z,{})})}},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return s},cl:function(){return d},cv:function(){return p},dE:function(){return c},zG:function(){return a}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=i.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],r.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).popup,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__DocsStyle",componentId:"sc-7a1uhf-1"})(["> div{overflow:initial;}> div img{max-width:80%;background:white;padding:1rem;max-height:20vh;}"]),s=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],u.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-4"})(["padding:","px;"," "," ",""],2*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).interactive.defaultBackground,";\n border-bottom: ").concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n ")}))},4015:function(e,n,t){"use strict";t.d(n,{$b:function(){return s},I5:function(){return c},Nk:function(){return u},gI:function(){return a}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-h093u4-0"})([""," ",""],(function(e){return!e.width&&"\n width: ".concat(40*l.iI,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),c=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-h093u4-1"})(["padding:","px;",""],2.5*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top-left-radius: ").concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")})),a=i.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||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n display: ").concat((null===e||void 0===e?void 0:e.display)||"flex",";\n padding-bottom: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n padding-left: ").concat(l.cd*l.iI,"px;\n padding-top: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-h093u4-3"})(["padding:","px ","px;",""],2.5*l.iI,2*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom-left-radius: ").concat(r.n_,"px;\n border-bottom-right-radius: ").concat(r.n_,"px;\n border-bottom: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")}))},90758:function(e,n,t){"use strict";t.d(n,{Z:function(){return O}});var i=t(82394),o=t(26304),r=t(82684),l=t(38626),u=t(39867),c=t(55485),a=t(48670),s=t(38276),d=t(30160),p=t(12468),f=t(44897),v=t(72473),h=t(97133),m=t(70515),b=t(15610),g=t(3314),x=t(28598);var j=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,o=e.isLast,l=e.onClickTab,j=e.onClickTabClose,y=e.renderTabTitle,k=e.savePipelineContent,Z=e.selected,P=e.themeContext,O=(0,r.useState)(!1),C=O[0],w=O[1];return(0,x.jsx)(c.ZP,{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 w(!0)},onMouseLeave:function(){return w(!1)},children:(0,x.jsx)(h.Gb,{last:o,selected:Z,children:(0,x.jsxs)(c.ZP,{alignItems:"center",fullHeight:!0,children:[(0,x.jsx)(p.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,x.jsxs)(c.ZP,{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)(u.Z,{borderColor:(P||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:[(C||Z)&&(0,x.jsx)(v.x8,{muted:!Z,size:1.25*m.iI}),!C&&!Z&&(0,x.jsx)("div",{style:{width:1.25*m.iI}})]})})]})})})},y=t(86735),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 P(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 O=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTabClose,u=e.selectedFilePath,a=(0,o.Z)(e,k),s=(0,r.useContext)(l.ThemeContext),d=(0,r.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),p=(0,r.useMemo)((function(){return null===d||void 0===d?void 0:d.length}),[d]);return(0,x.jsx)(c.ZP,{alignItems:"center",justifyContent:"flex-start",children:null===d||void 0===d?void 0:d.map((function(e,n){var o=t?t(e,u):u===encodeURIComponent(e);return(0,r.createElement)(j,P(P({},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:o,themeContext:s}))}))})}},97133:function(e,n,t){"use strict";t.d(n,{Gb:function(){return p},TZ:function(){return f},fm:function(){return s},lO:function(){return a},rK:function(){return d},zn:function(){return c}});var i=t(38626),o=t(44897),r=t(2842),l=t(70515),u=t(47041),c=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;}"],c,c),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||o.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;"," "," "," ",""],r.Wi,r.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||o.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(r.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,u.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||o.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||o.Z.borders).light," !important;\n ")})),f=i.default.div.withConfig({displayName:"indexstyle__HeaderViewOptionsStyle",componentId:"sc-1sv9513-4"})(["left:50%;position:absolute;transform:translateX(-50%);"])},28795:function(e,n,t){"use strict";var i;t.d(n,{B:function(){return o},M:function(){return i}}),function(e){e.BACKFILLS="backfills",e.BLOCK_RUNS="block_runs",e.DASHBOARD="dashboard",e.EDIT="edit",e.MONITOR="monitor",e.PIPELINE_LOGS="pipeline_logs",e.PIPELINE_RUNS="pipeline_runs",e.RUNS="runs",e.SETTINGS="settings",e.SYNCS="syncs",e.TRIGGERS="triggers"}(i||(i={}));var o="cancel_all_running_pipeline_runs"},85010:function(e,n,t){"use strict";t.d(n,{H:function(){return u}});var i=t(57653),o=t(72473),r=t(28795),l=t(50178);function u(e,n,t){var u=(n||{}).uuid||t,c=[{Icon:o.Bf,id:r.M.TRIGGERS,isSelected:function(){return r.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(u,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:o.Pf,id:r.M.RUNS,isSelected:function(){return r.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(u,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:o.dE,id:r.M.BACKFILLS,isSelected:function(){return r.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(u,"/backfills"),href:"/pipelines/[pipeline]/backfills"}},{Icon:o.UL,id:r.M.PIPELINE_LOGS,isSelected:function(){return r.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(u,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:o.ug,id:r.M.MONITOR,isSelected:function(){return r.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(u,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.INTEGRATION===(null===n||void 0===n?void 0:n.type)&&c.unshift({Icon:o.Nt,id:r.M.SYNCS,isSelected:function(){return r.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(u,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),(0,l.Ct)()||(c.unshift({Icon:o.EK,disabled:!u,id:r.M.EDIT,isSelected:function(){return r.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(u,"/edit"),href:"/pipelines/[pipeline]/edit"}}),c.push({Icon:o.Zr,id:r.M.SETTINGS,isSelected:function(){return r.M.SETTINGS===e},label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(u,"/settings"),href:"/pipelines/[pipeline]/settings"}})),c.unshift({Icon:o.G6,id:r.M.DASHBOARD,isSelected:function(){return r.M.DASHBOARD===e},label:function(){return"Dashboard"},linkProps:{as:"/pipelines/".concat(u,"/dashboard"),href:"/pipelines/[pipeline]/dashboard"}}),c}},66909:function(e,n,t){"use strict";t.d(n,{Eh:function(){return a},t0:function(){return s}});var i=t(38626),o=t(2842),r=t(17679),l=t(61896),u=t(47041),c=t(70515),a=(c.iI,r.O$+3*c.iI+l.dN),s=i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-15ofupc-0"})([""," overflow:auto;position:absolute;width:100%;"," ",""],u.w5,(function(e){return"\n height: calc(100vh - ".concat(o.uX,"px - ").concat(e.heightOffset,"px);\n ")}),(function(e){return e.overflowHidden&&"\n overflow: hidden;\n "}));i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-15ofupc-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}))},8916:function(e,n,t){"use strict";t.d(n,{FS:function(){return c},JZ:function(){return s},e7:function(){return d},wx:function(){return a}});var i=t(75582),o=t(82394),r=t(30229);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 u(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,o.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 c(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 u(u({},e),{},{value:c(n)})}))}function s(e,n){return n===r.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===r.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),r=t[0],l=t[1],c=l;try{c=JSON.parse(l)}catch(a){}return u(u({},e),{},(0,o.Z)({},r,c))}),{}):e}},48381:function(e,n,t){"use strict";var i=t(82684),o=t(31882),r=t(55485),l=t(30160),u=t(86735),c=t(28598);n.Z=function(e){var n=e.onClickTag,t=e.tags,a=void 0===t?[]:t,s=(0,i.useMemo)((function(){return(null===a||void 0===a?void 0:a.length)||0}),[a]),d=(0,i.useMemo)((function(){return(0,u.YC)(a||[],"uuid")}),[a]);return(0,c.jsx)(r.ZP,{alignItems:"center",flexWrap:"wrap",children:null===d||void 0===d?void 0:d.reduce((function(e,t){return e.push((0,c.jsx)("div",{style:{marginBottom:2,marginRight:s>=2?4:0,marginTop:2},children:(0,c.jsx)(o.Z,{onClick:n?function(){return n(t)}:null,small:!0,children:(0,c.jsx)(l.ZP,{children:t.uuid})})},"tag-".concat(t.uuid))),e}),[])})}},17679:function(e,n,t){"use strict";t.d(n,{O$:function(){return re},Fk:function(){return le}});var i=t(75582),o=t(12691),r=t.n(o),l=t(26304),u=t(21831),c=t(82394),a=t(82684),s=t(26226),d=t(84969),p=t(90948),f=t(65743),v=t(28108),h=t(79487),m=t(29989),b=t(38626),g=t(61655),x=t(16853),j=t(65376),y=t(48072),k=t(24903),Z=t(84181),P=t(98677),O=t(30160),C=t(70987),w=t(79633),_=t(61896),S=t(70515),I=t(95363),E=t(28598),T=["height","width"];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 D(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,c.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 B={bottom:5*S.iI,left:3*S.iI,right:20*S.iI,top:0},R=function(e){return e.x},A=function(e){return e.y},N=(0,g.Z)((function(e){var n=e.data,t=e.height,i=e.hideTooltip,o=e.large,r=e.margin,l=void 0===r?{}:r,c=e.renderTooltipContent,s=e.showTooltip,g=e.tooltipData,S=e.tooltipLeft,T=e.tooltipOpen,M=e.tooltipTop,N=e.width,L=e.xAxisLabel,F=e.xNumTicks,U=e.yLabelFormat,H=e.ySerialize,z=U;z||(z=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var W=o?_.iD:_.J5,K=(0,a.useContext)(b.ThemeContext),G=D(D({},B),l),V=n.slice(Math.max(0,n.length-50)),q=Object.keys(V[0]||[]).filter((function(e){return"x"===e})),Y=(0,k.Z)({domain:q,range:[w.hM]}),Q=(0,Z.Z)({domain:[0,Math.max.apply(Math,(0,u.Z)(V.map(R)))],nice:!0}),X=(0,P.Z)({domain:V.map(A),padding:.35}),J={active:(null===K||void 0===K?void 0:K.content.default)||C.Z.content.default,backgroundPrimary:(null===K||void 0===K?void 0:K.chart.backgroundPrimary)||C.Z.chart.backgroundPrimary,backgroundSecondary:(null===K||void 0===K?void 0:K.chart.backgroundSecondary)||C.Z.chart.backgroundSecondary,muted:(null===K||void 0===K?void 0:K.content.muted)||C.Z.content.muted,primary:(null===K||void 0===K?void 0:K.chart.primary)||C.Z.chart.primary,tooltipBackground:(null===K||void 0===K?void 0:K.background.navigation)||C.Z.background.navigation},$=V.map(H),ee=Math.min(Math.max.apply(Math,(0,u.Z)($.map((function(e){return String(e).length})))),20);6*ee>2*G.right?G.right+=5.5*ee:6*ee>=G.right&&(G.right+=3.75*ee);var ne=N-G.left-G.right,te=t-G.top-G.bottom;G.left+=7*ee,Q.rangeRound([0,ne]),X.rangeRound([te,0]);var ie=V.map(R).length,oe=X($[ie-1]),re=(0,a.useCallback)((function(e){var n=(0,y.Z)(e)||{x:0,y:0},t=n.x,i=n.y,o=1-(i-oe/2)/(te-oe),r=Math.floor(o*ie),l=V[r];"undefined"===typeof l&&(l=V[r-1]),i>oe&&i<te-oe&&s({tooltipData:l,tooltipLeft:t,tooltipTop:i+G.top})}),[V,ie,G.top,s,oe,te]);return N<10?null:(0,E.jsxs)("div",{children:[(0,E.jsxs)("svg",{height:t,width:N,children:[(0,E.jsx)(f.Z,{fill:"transparent",height:t-(G.top+G.bottom),onMouseLeave:function(){return i()},onMouseMove:re,onTouchMove:re,onTouchStart:re,rx:14,width:N-G.left,x:G.left,y:0}),(0,E.jsxs)(m.Z,{left:G.left,top:G.top,children:[(0,E.jsx)(v.Z,{color:Y,data:V,height:te,keys:q,pointerEvents:"none",xScale:Q,y:H,yScale:X,children:function(e){return e.map((function(e){return e.bars.map((function(n){return(0,E.jsx)("g",{children:(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("rect",{fill:J.backgroundPrimary,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})})},"barstack-horizontal-".concat(e.index,"-").concat(n.index))}))}))}}),(0,E.jsx)(d.Z,{hideTicks:!0,scale:X,stroke:J.muted,tickFormat:function(e){return z(e)},tickLabelProps:function(){return{fill:J.active,fontFamily:I.ry,fontSize:W,style:{width:"10px"},textAnchor:"end"}},tickStroke:J.muted,tickValues:$,top:2}),(0,E.jsx)(p.Z,{label:L,labelProps:{fill:J.muted,fontFamily:I.ry,fontSize:W,textAnchor:"middle"},numTicks:F,scale:Q,stroke:J.muted,tickLabelProps:function(){return{fill:J.active,fontFamily:I.ry,fontSize:W,textAnchor:"middle"}},tickStroke:J.muted,top:te})]}),g&&(0,E.jsx)("g",{children:(0,E.jsx)(h.Z,{from:{x:G.left,y:M},pointerEvents:"none",stroke:w.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:ne+G.left,y:M}})})]}),T&&g&&(0,E.jsx)(x.Z,{left:S,style:D(D({},j.j),{},{backgroundColor:J.tooltipBackground}),top:M,children:(0,E.jsxs)(O.ZP,{black:!0,small:!0,children:[null===c||void 0===c?void 0:c(g),!c&&R(g).toFixed(4)]})})]})}));var L,F,U,H,z=function(e){var n=e.height,t=e.width,i=(0,l.Z)(e,T);return(0,E.jsx)("div",{style:{height:n,width:"undefined"===typeof t?"100%":t},children:(0,E.jsx)(s.Z,{children:function(e){var n=e.width,t=e.height;return(0,E.jsx)(N,D(D({},i),{},{height:t,width:n}))}})})},W=t(97618),K=t(52729),G=t(48670),V=t(87862),q=t(89370),Y=t(86735),Q=(Y.Qj,Y.tS,Y.tS,Y.tS,Y.tS,Y.Qj,Y.Qj,Y.Qj,Y.tS,Y.tS,L={},(0,c.Z)(L,q.RL.EMAIL,"domain_distribution"),(0,c.Z)(L,q.RL.TEXT,"word_distribution"),(0,c.Z)(L,q.RL.LIST,"element_distribution"),(0,c.Z)(L,"default","value_counts"),L),X=[].concat((0,u.Z)(q.P_),[q.RL.TEXT,q.RL.EMAIL,q.RL.LIST]),J=(F={},(0,c.Z)(F,q.RL.EMAIL,"Domain distribution"),(0,c.Z)(F,q.RL.TEXT,"Word distribution"),(0,c.Z)(F,q.RL.LIST,"Element distribution"),(0,c.Z)(F,"default","Distribution of values"),t(31353));!function(e){e.RANGE="range"}(U||(U={})),function(e){e.BAR_HORIZONTAL="bar_horizontal",e.LINE_CHART="line_chart",e.HISTOGRAM="histogram"}(H||(H={}));var $=t(48888),ee=t(92083),ne=t.n(ee),te=t(81728);function ie(e,n){var t,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i||{},r=o.calculateAnomaly,l=o.feature,c=o.getYValue,a=e.x,s=e.x_metadata,d=s.label,p=s.label_type,f=e.y,v=(null===f||void 0===f?void 0:f.map((function(e){return null===c||void 0===c?void 0:c(e)})))||[],h=Math.max.apply(Math,(0,u.Z)(v)),m=Math.max.apply(Math,(0,u.Z)(v)),b=(0,Y.Sm)(v),g=(0,Y.IN)(v),x=b/Math.max(1,v.length),j=n[d]||l,y=null===j||void 0===j?void 0:j.columnType,k=q.RL.DATETIME===y,Z=[],P=[],O=a.length,C=a.map((function(e,n){var i,o,l,u,c=e.label,a=e.max,s=e.min,d=f[n];if(U.RANGE===p)if(t||(t=a-s),u=q.RL.NUMBER===y&&t<=O)i=Number(s);else if(i=t/2+s,k){var j="M/D/YYYY",C="M/D/YYYY",w="M/D/YYYY";t<=1?(j=t<=.1?"H:mm:ss.SSS":"H:mm:ss",C="H:mm:ss.SSS",w="H:mm:ss.SSS"):t<=60?(j="H:mm",C="H:mm:ss",w="H:mm:ss"):t<=3600?(j="H:mm",C="M/D/YYYY H:mm",w="H:mm"):t<=86400&&(C="M/D/YYYY H:mm",w="M/D/YYYY H:mm"),i=ne().unix(i).format(j),o=ne().unix(s).format(C),l=ne().unix(a).format(w)}else i=(0,te.QV)(i);else i=c;var _=n>=1?f[n-1]:null,S=!1;r&&(S=r({x:e,y:d,yPrevious:_,yValues:v,yValuesAverage:x,yValuesMax:h,yValuesMin:m,yValuesStandardDeviation:g,yValuesSum:b}));var I={hideRange:u,isUnusual:S,x:e,xLabel:i,xLabelMax:l,xLabelMin:o,y:d};return S&&(u?P.push(I):Z.push(I)),I}));return{distribution:{data:C,featureUUID:d},rangedWithUnusualDistribution:(0,Y.YC)(Z,(function(e){var n=e.y;return c(n)}),{ascending:!1}),unusualDistribution:(0,Y.YC)(P,(function(e){var n=e.y;return c(n)}),{ascending:!1})}}var oe=t(40489);var re=12*S.iI;function le(e){var n=e.columnTypes,t=e.columns,o=e.insightsByFeatureUUID,l=e.insightsOverview,u=e.noColumnLinks,c=void 0!==u&&u,a=e.statistics;return function(e,u,s){var d=s.width,p=t[u],f=n[p],v=J.T5[f],h=(o[p]||{}).charts,m=l.time_series,b=t.filter((function(e){return n[e]===q.RL.DATETIME})),g=null===m||void 0===m?void 0:m.map((function(e){return ie(e,{},{feature:{columnType:f,uuid:p}}).distribution})),x={};null===g||void 0===g||g.forEach((function(e,n){var t=e.data;x[b[n]]=(0,E.jsx)(K.Z,{data:t.map((function(e){var n=e.x,t=e.xLabel,i=e.xLabelMax,o=e.xLabelMin;return[t,e.y.count,o,i,n.min,n.max]})),height:re,large:!0,margin:{bottom:0,left:0,right:0,top:0},renderTooltipContent:function(e){var n=(0,i.Z)(e,4),t=n[1],o=n[2],r=n[3];return(0,E.jsxs)("p",{children:["Rows: ",t,(0,E.jsx)("br",{}),"Start: ",o,(0,E.jsx)("br",{}),"End: ",r]})},sortData:function(e){return(0,Y.YC)(e,"[4]")}},p)}));var j,y=null===h||void 0===h?void 0:h.find((function(e){var n=e.type;return H.HISTOGRAM===n})),k=(y?ie(y,{},{feature:{columnType:f,uuid:p},getYValue:function(e){return e.value}}):{}).distribution,Z=void 0===k?null:k,P=Q[f]||Q.default,C=null===a||void 0===a?void 0:a["".concat(p,"/").concat(P)],w=Object.entries(C||{}).map((function(e){var n=(0,i.Z)(e,2),t=n[0];return{x:n[1],y:t}})),_=q.RL.TRUE_OR_FALSE===f;if(q.RL.DATETIME===f)j=x[p];else if(Z&&!_)j=(0,E.jsx)(K.Z,{data:Z.data.map((function(e){var n=e.hideRange,t=e.isUnusual,i=e.x;return[e.xLabel,e.y.value,i.min,i.max,t,n]})),height:re,margin:{bottom:0,left:0,right:0,top:0},renderTooltipContent:function(e){var n=(0,i.Z)(e,6),t=n[1],o=n[2],r=n[3],l=n[5];return(0,E.jsxs)("p",{children:[l&&(0,E.jsxs)(E.Fragment,{children:["Rows: ",t,(0,E.jsx)("br",{}),"Value: ",o]}),!l&&(0,E.jsxs)(E.Fragment,{children:["Rows: ",t,(0,E.jsx)("br",{}),"Range: ",o," - ",r]})]})},sortData:function(e){return(0,Y.YC)(e,"[2]")},width:d-2*S.iI});else if(X.includes(f)){var I=(0,Y.YC)((0,Y.YC)(w,"x",{ascending:!1}).slice(0,5),"x");j=(0,E.jsx)(z,{data:I,height:re,margin:{bottom:0,left:0,right:20,top:0},renderTooltipContent:function(e){var n=e.x,t=e.y;return"".concat(t," appears ").concat((0,te.x6)(n)," times")},xNumTicks:2,ySerialize:function(e){return e.y}})}else _&&C&&(j=(0,E.jsx)(V.Z,{data:Object.entries(C),getX:function(e){var n=(0,i.Z)(e,2),t=n[0],o=n[1];return"".concat(t," (").concat((0,te.x6)(o),")")},getY:function(e){return(0,i.Z)(e,2)[1]},height:re}));return(0,E.jsxs)("div",{style:{padding:S.iI},children:[(0,E.jsxs)("div",{style:{alignItems:"center",display:"flex",marginBottom:S.iI},children:[v&&(0,E.jsx)(W.Z,{title:q.Rp[f],children:(0,E.jsx)(v,{size:2*S.iI})}),(0,E.jsx)("div",{style:{marginLeft:.5*S.iI,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:d-4.5*S.iI},children:c?(0,E.jsx)(O.ZP,{bold:!0,default:!0,title:t[u],children:t[u]}):(0,E.jsx)(r(),{as:(0,oe.o_)($.oE,u),href:"/datasets/[...slug]",passHref:!0,children:(0,E.jsx)(G.Z,{bold:!0,monospace:!0,secondary:!0,small:!0,title:t[u],children:t[u]})})})]}),j,!j&&(0,E.jsx)("div",{style:{height:re}})]})}}},55729:function(e,n,t){"use strict";t.d(n,{Z:function(){return B}});var i=t(82394),o=t(75582),r=t(82684),l=t(69864),u=t(71180),c=t(15338),a=t(97618),s=t(55485),d=t(85854),p=t(48670),f=t(65956),v=t(82359),h=t(38276),m=t(30160),b=t(17488),g=t(69650),x=t(12468),j=t(35686),y=t(38626),k=t(44897),Z=t(42631),P=t(70515),O=y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],Z.n_,P.cd*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||k.Z.background).codeArea,";\n ")})),C=t(72473),w=t(72191),_=t(81728),S=t(72619),I=t(70320),E=t(23780),T=t(28598);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 D(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 B=function(e){var n=e.cancelButtonText,t=e.contained,y=e.header,k=e.onCancel,Z=e.onSaveSuccess,M=(0,E.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),B=(0,o.Z)(M,1)[0],R=(0,r.useState)(null),A=R[0],N=R[1],L=(0,r.useState)(!1),F=L[0],U=L[1],H=j.ZP.projects.list(),z=H.data,W=H.mutate,K=(0,r.useMemo)((function(){var e;return null===z||void 0===z||null===(e=z.projects)||void 0===e?void 0:e[0]}),[z]),G=K||{},V=G.name,q=G.openai_api_key,Y=G.project_uuid,Q=(0,r.useMemo)((function(){return"demo.mage.ai"===window.location.hostname}),[]);(0,r.useEffect)((function(){A||N(K)}),[K,A]);var X=(0,l.Db)(j.ZP.projects.useUpdate(V),{onSuccess:function(e){return(0,S.wD)(e,{callback:function(e){var n,t=e.project;W(),N(t),U(!1),(0,I.h)(null===t||void 0===t||null===(n=t.features)||void 0===n?void 0:n[v.d.LOCAL_TIMEZONE]),Z&&(null===Z||void 0===Z||Z(t))},onErrorCallback:function(e,n){return B({errors:n,response:e})}})}}),J=(0,o.Z)(X,2),$=J[0],ee=J[1].isLoading,ne=(0,r.useCallback)((function(e){return $({project:e})}),[$]),te=(0,T.jsxs)(T.Fragment,{children:[y,(0,T.jsxs)(f.Z,{noPadding:!0,children:[(0,T.jsxs)(h.Z,{p:P.cd,children:[(0,T.jsx)(h.Z,{mb:1,children:(0,T.jsx)(d.Z,{level:5,children:"Project name"})}),(0,T.jsx)(m.ZP,{default:!0,monospace:!0,children:V})]}),(0,T.jsx)(c.Z,{light:!0}),(0,T.jsxs)(h.Z,{p:P.cd,children:[(0,T.jsx)(h.Z,{mb:1,children:(0,T.jsx)(d.Z,{level:5,children:"Project UUID"})}),(0,T.jsx)(m.ZP,{default:!!Y,monospace:!0,muted:!Y,children:Y||"Not required"})]}),(0,T.jsx)(c.Z,{light:!0}),(0,T.jsx)(h.Z,{p:P.cd,children:(0,T.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,T.jsxs)(a.Z,{flexDirection:"column",children:[(0,T.jsx)(h.Z,{mb:1,children:(0,T.jsx)(d.Z,{level:5,children:"Help improve Mage"})}),(0,T.jsxs)(m.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,T.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,T.jsx)(h.Z,{mr:P.cd}),(0,T.jsx)(g.Z,{compact:!0,checked:null===A||void 0===A?void 0:A.help_improve_mage,onCheck:function(){return N((function(e){return D(D({},e),{},{help_improve_mage:!(null!==A&&void 0!==A&&A.help_improve_mage)})}))}})]})})]}),(0,T.jsx)(h.Z,{mt:P.HN}),(0,T.jsx)(f.Z,{noPadding:!0,overflowVisible:!0,children:(0,T.jsxs)(h.Z,{p:P.cd,children:[(0,T.jsx)(h.Z,{mb:1,children:(0,T.jsx)(d.Z,{level:5,children:"Features"})}),Object.entries((null===A||void 0===A?void 0:A.features)||{}).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],l=t[1];return(0,T.jsx)(h.Z,{mt:0===n?0:1,children:(0,T.jsxs)(s.ZP,{alignItems:"center",children:[(0,T.jsx)(g.Z,{checked:!!l,compact:!0,onCheck:function(){return N((function(e){return D(D({},e),{},{features:D(D({},null===A||void 0===A?void 0:A.features),{},(0,i.Z)({},r,!l))})}))}}),(0,T.jsx)(h.Z,{mr:P.cd}),(0,T.jsxs)(a.Z,{children:[(0,T.jsx)(m.ZP,{default:!l,monospace:!0,children:(0,_.vg)(r)}),r===v.d.LOCAL_TIMEZONE&&(0,T.jsx)(h.Z,{ml:1,children:(0,T.jsx)(x.Z,{block:!0,description:"Display dates in local timezone. Please note that certain pages (e.g. Monitor page) or components (e.g. Pipeline run bar charts) may still be in UTC time. Dates in local time will have a timezone offset in the timestamp (e.g. -07:00).",lightBackground:!0,muted:!0,size:w._k})})]})]})},r)}))]})}),(0,T.jsx)(h.Z,{mt:P.HN}),(0,T.jsx)(f.Z,{noPadding:!0,children:(0,T.jsxs)(h.Z,{p:P.cd,children:[(0,T.jsx)(h.Z,{mb:1,children:(0,T.jsx)(d.Z,{level:5,children:"OpenAI"})}),q&&!F?(0,T.jsxs)(s.ZP,D(D({},s.A0),{},{children:[(0,T.jsx)(m.ZP,{default:!0,monospace:!0,children:"API key: ********"}),(0,T.jsx)(u.ZP,{iconOnly:!0,onClick:function(){return U(!0)},secondary:!0,title:"Edit",children:(0,T.jsx)(C.I8,{size:w.bL})})]})):(0,T.jsx)(b.Z,{disabled:Q,label:Q?"Entering API key is disabled on demo":"API key",monospace:!0,onChange:function(e){return N((function(n){return D(D({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===A||void 0===A?void 0:A.openai_api_key)||""})]})}),(0,T.jsx)(h.Z,{mt:P.HN}),(0,T.jsxs)(s.ZP,{alignItems:"center",children:[(0,T.jsx)(u.ZP,{loading:ee,onClick:function(){ne({features:null===A||void 0===A?void 0:A.features,help_improve_mage:null===A||void 0===A?void 0:A.help_improve_mage,openai_api_key:null===A||void 0===A?void 0:A.openai_api_key})},primary:!0,children:"Save project settings"}),k&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(h.Z,{mr:P.cd}),(0,T.jsx)(u.ZP,{onClick:k,secondary:!0,children:n||"Cancel"})]})]})]});return t?(0,T.jsx)(O,{children:te}):te}},46568:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=(t(82684),t(33591)),l=t(28598),u=["children","fullHeight","gutter","style"];function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,c=e.style,s=void 0===c?{}:c,d=(0,o.Z)(e,u),p=a({},s);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,l.jsx)(r.Col,a(a({},d),{},{style:p,children:n}))}},82682:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=t(82684),l=t(33591),u=t(28598),c=["children","fullHeight","gutter","justifyContent","style"];function 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,o.Z)(e,c),v=s({},p);return i&&(v.marginLeft=-1*i,v.marginRight=v.marginLeft),t&&(v.height="100%"),(0,u.jsx)(l.Row,s(s({},f),{},{justifyContent:a,style:v,children:r.Children.map(n,(function(e,n){return e&&r.cloneElement(e,{gutter:i,key:n})}))}))}},68781:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return o}}),function(e){e.AZURE_CONTAINER_INSTANCE="azure_container_instance",e.ECS="ecs",e.GCP_CLOUD_RUN="gcp_cloud_run",e.K8S="k8s",e.LOCAL_PYTHON="local_python",e.PYSPARK="pyspark"}(i||(i={}));var o=[i.AZURE_CONTAINER_INSTANCE,i.ECS,i.GCP_CLOUD_RUN,i.K8S,i.LOCAL_PYTHON,i.PYSPARK]},8666:function(e,n,t){"use strict";var i;t.d(n,{b:function(){return i}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(i||(i={}))},83784:function(e,n,t){"use strict";t.d(n,{C:function(){return i}});var i="global"},9134:function(e,n,t){"use strict";var i=t(82684),o=t(21124),r=t(68432),l=t(38626),u=t(65292),c=t(44897),a=t(95363),s=t(70515),d=t(28598);n.Z=function(e){var n=e.language,t=e.maxWidth,p=e.showLineNumbers,f=e.small,v=e.source,h=e.wrapLines,m=(0,i.useContext)(l.ThemeContext);function b(e){var i=e.value;return(0,d.jsx)(r.Z,{customStyle:{backgroundColor:(m.background||c.Z.background).popup,border:"none",borderRadius:"none",boxShadow:"none",fontFamily:a.Vp,fontSize:f?12:14,marginBottom:0,marginTop:0,maxWidth:t,paddingBottom:2*s.iI,paddingTop:2*s.iI},language:n,lineNumberStyle:{color:(m.content||c.Z.content).muted},showLineNumbers:p,style:u._4,useInlineStyles:!0,wrapLines:h,children:i})}return(0,d.jsx)(o.D,{components:{code:function(e){var n=e.children;return(0,d.jsx)(b,{value:n})}},children:v})}},39457:function(e,n,t){"use strict";var i,o=t(82394),r=(t(82684),t(64866)),l=t(21764),u=t(55485),c=t(48670),a=t(38276),s=t(30160),d=t(12468),p=t(72473),f=t(70515),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,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}!function(e){e.LEFT="left",e.RIGHT="right"}(i||(i={})),n.Z=function(e){var n,t=e.children,o=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,P=e.toastMessage,O=e.withCopyIcon;return t?n=(0,v.jsx)("span",{children:t}):O&&(n=(0,v.jsx)(c.Z,m(m({href:"#",inline:!0,muted:k,preventDefault:!0,sameColorAsText:!0,small:Z},x),{},{children:(0,v.jsxs)(u.ZP,{alignItems:"center",children:[b===i.LEFT&&(0,v.jsx)(a.Z,{mr:j?1:0,children:(0,v.jsx)(u.ZP,{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)(u.ZP,{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)(r.CopyToClipboard,{onCopy:function(){return l.Am.success(P||"Successfully copied to clipboard.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:o})},text:o,children:n})})}},11074:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(38626),o=t(44897),r=t(42631),l=i.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],r.n_,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),u=t(28598);var c=function(e){var n=e.children,t=e.fullWidth,i=void 0===t||t;return(0,u.jsx)(l,{fullWidth:i,children:n})}},96348:function(e,n,t){"use strict";t.d(n,{g:function(){return b},Z:function(){return g}});var i=t(82684),o=t(38626),r=t(44897),l=t(42631),u=t(47041),c=t(70515),a=1.5*c.iI,s=1.5*c.iI,d=o.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],l.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||r.Z).background.page,";\n border: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||r.Z).shadow.frame,";\n ")}),(function(e){return e.noBackground&&"\n background-color: transparent;\n "}),(function(e){return e.noBoxShadow&&"\n box-shadow: none;\n "})),p=o.default.div.withConfig({displayName:"indexstyle__RowContainerStyle",componentId:"sc-13p7y8j-1"})(["overflow:auto;border-bottom-left-radius:","px;border-bottom-right-radius:","px;"," "," "," ",""],l.n_,l.n_,u.w5,(function(e){return e.maxHeight>0&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),(function(e){return e.minHeight>0&&"\n min-height: ".concat(e.minHeight,"px;\n ")}),(function(e){return e.scrollable&&"\n margin-bottom: ".concat(c.iI,"px;\n overflow-y: auto;\n padding-top: ").concat(3,"px;\n padding-left: ").concat(3,"px;\n padding-right: ").concat(3,"px;\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-13p7y8j-2"})(["border-top-left-radius:","px;border-top-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n ")})),v=o.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],s,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||r.Z).interactive.defaultBorder,";\n ")}),(function(e){return e.noHorizontalPadding&&"\n padding-left: 0;\n padding-right: 0;\n "}),(function(e){return e.condensed&&"\n padding-top: ".concat(9,"px;\n padding-bottom: ").concat(9,"px;\n ")}),(function(e){return e.secondary&&"\n background-color: ".concat((e.theme.background||r.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom: none;\n ")})),h=o.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*c.iI,(function(e){return"\n border-top: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")})),m=t(28598),b=v;var g=function(e){var n=e.alternating,t=e.children,o=e.footer,r=e.header,l=e.maxHeight,u=e.minHeight,c=e.noBackground,a=e.noBoxShadow,s=e.sameColorBorders,v=e.scrollable,b=e.width,g=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:c,noBoxShadow:a,width:b,children:[r&&(0,m.jsx)(f,{children:r}),(0,m.jsx)(p,{maxHeight:l,minHeight:u,scrollable:v,children:i.Children.map(g,(function(e,t){return e&&i.cloneElement(e,{last:t===g.length-1,sameColorBorders:s,secondary:n&&t%2===1})}))}),o&&(0,m.jsx)(h,{children:o})]})}},58623:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return or}});var i=t(77837),o=t(21831),r=t(75582),l=t(82394),u=t(38860),c=t.n(u),a=t(56085),s=t(82684),d=t(69864),p=t(34376),f=t(65557),v=t(40761),h=t(44425),m=t(38626),b=t(70652),g=t(39867),x=t(15338),j=t(97618),y=t(55485),k=t(48670),Z=t(38276),P=t(30160),O=t(70515),C=t(55283),w=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,l.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 I=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,o=e.setHiddenBlocks,r=(0,s.useContext)(m.ThemeContext),u=(0,s.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),c=(0,s.useMemo)((function(){var e=[],n=[];return u.forEach((function(i){var o=i.uuid;null!==t&&void 0!==t&&t[o]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[u,t]),a=c.blocksHidden,d=c.blocksVisible,p=(0,s.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===d.length}),[u,d]),f=(0,s.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===a.length}),[u,a]),v=(0,s.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var o,r=n.current["".concat(t,"s/").concat(i,".py")];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}}),[n]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{p:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,w.jsx)(b.Z,{checked:f,label:"Show all",onClick:function(){return o((function(){return{}}))}})}),(0,w.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,w.jsx)(b.Z,{checked:p,label:"Hide all",onClick:function(){return o((function(){return u.reduce((function(e,n){var t=n.uuid;return S(S({},e),{},(0,l.Z)({},t,!0))}),{})}))}})})]})}),(0,w.jsx)(x.Z,{medium:!0}),null===u||void 0===u?void 0:u.map((function(e){var n=e.uuid,i=(0,C.qn)(e.type,{blockColor:e.color,theme:r}).accent,u=!(null!==t&&void 0!==t&&t[n]);return(0,w.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){o((function(e){return S(S({},e),{},(0,l.Z)({},n,u))})),u||setTimeout((function(){return v(e)}),1)},preventDefault:!0,children:(0,w.jsx)(Z.Z,{mt:1,px:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(Z.Z,{pr:1,children:(0,w.jsx)(b.Z,{checked:u})}),(0,w.jsxs)(j.Z,{alignItems:"center",children:[(0,w.jsx)(g.Z,{color:i,size:1.5*O.iI,square:!0}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(P.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},E=t(60523),T=t(71180),M=t(90299),D=t(65701),B=t(1254);var R=function(e){var n=e.size;return(0,w.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,w.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,w.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,w.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,w.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,w.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,w.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,w.jsxs)("defs",{children:[(0,w.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,w.jsx)("stop",{stopColor:"#FFDA19"}),(0,w.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,w.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,w.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,w.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,w.jsx)("stop",{stopColor:"white"}),(0,w.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,w.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,w.jsx)("stop",{stopColor:"white"}),(0,w.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,w.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,w.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,w.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,w.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,w.jsx)("stop",{stopColor:"white"}),(0,w.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,w.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,w.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,w.jsx)("stop",{stopColor:"white"}),(0,w.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,w.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,w.jsx)("stop",{stopColor:"white"}),(0,w.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},A=t(39791),N=t(93369),L=t(7267),F=t(57653),U=t(44085),H=t(4190),z=t(17488),W=t(35686),K=t(72473),G=t(4015),V=t(13803),q=t(72191),Y=t(2548),Q=t(81728),X=t(72619),J=t(23780);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 ee(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,l.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 ne=function(e){var n,t,i=e.block,o=e.defaultName,l=e.isReplacingBlock,u=e.isUpdatingBlock,c=e.onClose,a=e.onSave,p=e.pipeline,f=(0,J.VI)(null,{},[],{uuid:"ConfigureBlock"}),v=(0,r.Z)(f,1)[0],m=Object.keys((null===i||void 0===i?void 0:i.pipelines)||{}).length,b=(0,s.useRef)(null),g=(0,s.useState)({color:(null===i||void 0===i?void 0:i.color)||null,language:(null===i||void 0===i||null===(n=i.defaults)||void 0===n?void 0:n.language)||(null===i||void 0===i?void 0:i.language),name:o,type:null===i||void 0===i?void 0:i.type}),x=g[0],k=g[1],C=(0,s.useCallback)((function(){a(ee(ee({},x),{},{name:(null===x||void 0===x?void 0:x.name)||o}))}),[x,o,a]);(0,s.useEffect)((function(){var e,n=function(e){e.stopPropagation(),"Escape"===e.key?c():"Enter"===e.key&&C()};return null===(e=document)||void 0===e||e.addEventListener("keydown",n),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("keydown",n)}}),[C,c]),(0,s.useEffect)((function(){var e;null===b||void 0===b||null===(e=b.current)||void 0===e||e.focus()}),[]);var _=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===p||void 0===p?void 0:p.type)}),[p]),S=(0,s.useMemo)((function(){return h.tf.CUSTOM===(null===i||void 0===i?void 0:i.type)}),[i]),I=(0,s.useMemo)((function(){return h.tf.MARKDOWN===(null===i||void 0===i?void 0:i.type)}),[i]),E=(0,s.useMemo)((function(){return null===i||void 0===i?void 0:i.block_action_object}),[i]),M=(0,s.useMemo)((function(){return Y.L.GENERATE_BLOCK===(null===E||void 0===E?void 0:E.object_type)}),[E]),$=(0,s.useMemo)((function(){return M&&(null===E||void 0===E?void 0:E.description)}),[E,M]),ne=(0,s.useMemo)((function(){var e;return V.I.DATA_INTEGRATION===(null===i||void 0===i||null===(e=i.config)||void 0===e?void 0:e.template_type)||!![V.O.DESTINATIONS,V.O.SOURCES].includes(null===E||void 0===E?void 0:E.language)}),[i,E]),te=(0,s.useState)(null),ie=te[0],oe=te[1],re=(0,d.Db)(W.ZP.llms.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.llm,t=(null===n||void 0===n?void 0:n.response)||{},i=t.block_type,o=t.configuration,r=t.content,l=t.language;k((function(e){return ee(ee({},e),{},{block_action_object:null,configuration:o,content:r,language:l,type:i})})),oe(n)},onErrorCallback:function(e,n){return v({errors:n,response:e})}})}}),le=(0,r.Z)(re,2),ue=le[0],ce=le[1].isLoading;(0,s.useEffect)((function(){M&&$&&!ie&&ue({llm:{request:{block_description:$},use_case:L.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[ue,$,M,ie]);var ae=(0,s.useMemo)((function(){var e,n;return null!==i&&void 0!==i&&null!==(e=i.config)&&void 0!==e&&e.custom_template?null===i||void 0===i||null===(n=i.config)||void 0===n?void 0:n.custom_template:[Y.L.CUSTOM_BLOCK_TEMPLATE,Y.L.MAGE_TEMPLATE].includes(null===E||void 0===E?void 0:E.object_type)?ee(ee({},E),{},{name:null===E||void 0===E?void 0:E.title}):void 0}),[i,E]),se=(0,s.useMemo)((function(){var e=(null===x||void 0===x?void 0:x.type)||(null===i||void 0===i?void 0:i.type);ae&&(e=null===ae||void 0===ae?void 0:ae.block_type);var n=h.V4[e];return _&&(h.tf.DATA_LOADER===e?n="Source":h.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[i,x,ae,_]);return(0,w.jsxs)(G.Nk,{width:M&&(null===x||void 0===x?void 0:x.content)&&80*O.iI,children:[(0,w.jsxs)(G.I5,{children:[M&&ce&&(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(P.ZP,{children:"Generating block using AI..."}),(0,w.jsx)(H.Z,{inverted:!0})]}),M&&!ce&&(0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,w.jsx)(K.xq,{size:5*O.iI,warning:!0})}),!M&&(0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,w.jsx)(R,{size:15*O.iI})})]}),M&&!ce&&(0,w.jsx)(G.gI,{children:(0,w.jsxs)(Z.Z,{py:1,children:[(0,w.jsx)(Z.Z,{mb:1,children:(0,w.jsx)(P.ZP,{default:!0,children:"Block generated using AI"})}),(0,w.jsx)(P.ZP,{textOverflow:!0,children:$})]})}),ae&&(0,w.jsx)(G.gI,{children:(0,w.jsxs)(Z.Z,{py:1,children:[(0,w.jsx)(Z.Z,{mb:1,children:(0,w.jsx)(P.ZP,{default:!0,children:"Template"})}),(0,w.jsx)(P.ZP,{textOverflow:!0,children:null===(t=(null===ae||void 0===ae?void 0:ae.name)||(null===ae||void 0===ae?void 0:ae.template_uuid))||void 0===t?void 0:t.slice(0,40)})]})}),h.tf.GLOBAL_DATA_PRODUCT!==(null===i||void 0===i?void 0:i.type)&&m>1&&(0,w.jsxs)(G.gI,{children:[(0,w.jsx)(j.Z,{flex:"1",children:(0,w.jsx)(K.uy,{size:q.l2,warning:!0})}),(0,w.jsx)(j.Z,{flex:"6",children:(0,w.jsxs)(P.ZP,{bold:!0,warning:!0,children:[u&&"Renaming this block will affect ".concat(m," pipelines.")+" The renamed block may need to be re-added to the shared pipeline(s).",l&&"This will create a copy of the selected block and replace the existing one so it is no longer shared with any other pipelines."]})})]}),(0,w.jsxs)(G.gI,{children:[(0,w.jsx)(P.ZP,{default:!0,children:"Name"}),(0,w.jsx)(z.Z,{alignRight:!0,fullWidth:!0,noBackground:!0,noBorder:!0,onChange:function(e){return k((function(n){return ee(ee({},n),{},{name:e.target.value})}))},paddingVertical:O.iI,placeholder:"Block name...",ref:b,value:(null===x||void 0===x?void 0:x.name)||""})]}),(0,w.jsxs)(G.gI,{children:[(0,w.jsx)(P.ZP,{default:!0,children:"Type"}),(0,w.jsx)(Z.Z,{mr:O.cd,py:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{muted:!0,children:se}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(K.QM,{muted:!0})]})})]}),!I&&(S||ae||(null===x||void 0===x?void 0:x.language))&&(0,w.jsxs)(G.gI,{paddingVerticalAddition:3,children:[(0,w.jsx)(P.ZP,{default:!0,children:"Language"}),(0,w.jsxs)(y.ZP,{alignItems:"center",children:[[h.t6.PYTHON,h.t6.SQL,h.t6.R,h.t6.YAML].reduce((function(e,n){var t=(ae?null===ae||void 0===ae?void 0:ae.language:null===x||void 0===x?void 0:x.language)===n;return!(S&&!u&&!l||t||ne&&h.t6.R!==n&&ne&&h.t6.SQL!==n)||S&&h.t6.YAML===n||e.push((0,w.jsx)(Z.Z,{ml:1,children:(0,w.jsx)(T.ZP,{borderColor:t?null:"transparent",compact:!0,default:!S&&!t&&!ne,disabled:!S&&!t&&!ne,noBackground:!0,notClickable:(!S||u||!ne)&&t,onClick:ae&&!ne?null:function(){return k((function(e){return ee(ee({},e),{},{language:n})}))},selected:t,children:h.LE[n]})},n)),e}),[]),!S&&!ne&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(K.QM,{muted:!0})]}),(0,w.jsx)(Z.Z,{mr:S||ne?1:2})]})]}),(S||(null===ae||void 0===ae?void 0:ae.color)||(null===x||void 0===x?void 0:x.color))&&(0,w.jsxs)(G.gI,{children:[(0,w.jsx)(P.ZP,{default:!0,children:"Color"}),S&&(0,w.jsxs)(U.Z,{alignRight:!0,disabled:l,noBackground:!0,noBorder:!0,onChange:function(e){return k((function(n){return ee(ee({},n),{},{color:e.target.value})}))},value:ae?(null===ae||void 0===ae?void 0:ae.color)||"":(null===x||void 0===x?void 0:x.color)||"",children:[(0,w.jsx)("option",{value:""}),Object.values(h.Lq).map((function(e){return(0,w.jsx)("option",{value:e,children:(0,Q.kC)(e)},e)}))]}),!S&&(0,w.jsx)(Z.Z,{mr:O.cd,py:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{muted:!0,children:(0,Q.kC)((null===ae||void 0===ae?void 0:ae.color)||(null===x||void 0===x?void 0:x.color)||"")}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(K.QM,{muted:!0})]})})]}),M&&(null===x||void 0===x?void 0:x.content)&&(0,w.jsx)(G.gI,{display:"block",children:(0,w.jsx)(Z.Z,{pr:O.cd,py:1,children:(0,w.jsx)(D.W,{backend:B.PD,children:(0,w.jsx)(A.Z,{block:ee(ee({},x),{},{uuid:$}),defaultValue:null===x||void 0===x?void 0:x.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return k((function(n){return ee(ee({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},$)})})}),(0,w.jsx)(G.$b,{children:(0,w.jsxs)(y.ZP,{fullWidth:!0,children:[(0,w.jsxs)(N.ZP,{bold:!0,centerText:!0,disabled:ce,onClick:C,primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and\xa0",u?"update":l?"replace":"add"," block"]}),(0,w.jsx)(Z.Z,{ml:1,children:(0,w.jsx)(T.ZP,{onClick:c,tabIndex:0,children:"Cancel"})})]})})]})},te=t(54750),ie=t(4804),oe=t(75810),re=t(85854),le=t(99236),ue=t(29480),ce=t(37443),ae=t(53405);function se(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 de(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pe=function(e){var n=e.block,t=e.blockConfigString,i=e.blockContent,o=e.blockUpstreamBlocks,l=e.dataIntegrationConfiguration,u=e.onChangeCodeBlock,c=e.pipeline,a=e.savePipelineContent,p=e.setBlockConfigString,f=e.setBlockContent,v=e.setContent,m=e.setSelectedSubTab,b=e.showError,j=n||{},C=j.language,_=j.type,S=j.uuid,I=(c||{}).uuid,E=(0,s.useState)(!1),M=E[0],D=E[1],B=(0,s.useMemo)((function(){return h.t6.YAML===C&&i?(0,ie.Qc)(i):{}}),[i,C]);(0,s.useEffect)((function(){B&&!t&&p((0,ie.Pz)(null===B||void 0===B?void 0:B.config))}),[t,B]);var R=(0,s.useState)(!1),A=R[0],N=R[1],L=(0,d.Db)(W.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.integration_source;null!==n&&void 0!==n&&n.error_message?b({response:{error:{exception:null===n||void 0===n?void 0:n.error_message}}}):null!==n&&void 0!==n&&n.success&&N(!0)},onErrorCallback:function(e,n){return b({errors:n,response:e})}})}}),F=(0,r.Z)(L,2),U=F[0],H=F[1].isLoading,z=(0,s.useCallback)((function(){return a().then((function(){return U({integration_source:{action_type:"test_connection",block_uuid:S,pipeline_uuid:I}})}))}),[S,U,I,a]),G=(0,s.useMemo)((function(){if(h.t6.YAML===C)return(0,w.jsx)(ue.$W,{children:(0,w.jsx)(oe.Z,{autoHeight:!0,language:C,onChange:function(e){p(e);try{var n=(0,ie.Qc)(e),t=(0,ie.Pz)(de(de({},B),{},{config:n}));u(_,S,t),v(t),D(!1)}catch(i){D(!0)}},tabSize:2,value:t||void 0,width:"100%"})});h.t6.PYTHON}),[t,i,B,C,_,S,f,v]),V=(0,s.useMemo)((function(){return(0,ae.Wi)(o,l)}),[o,l]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(T.ZP,{beforeIcon:(0,w.jsx)(K.Ae,{success:!0}),loading:H,onClick:function(){N(!1),z()},secondary:!0,compact:!0,children:"Test connection"}),A&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(g.Z,{size:1*O.iI,success:!0}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(P.ZP,{success:!0,children:"Connection successful"})]})]})]})}),(0,w.jsx)(x.Z,{light:!0}),(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsx)(P.ZP,{bold:!0,default:!0,large:!0,children:"Inputs from upstream blocks"}),0===(null===V||void 0===V?void 0:V.length)&&(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{muted:!0,children:["No inputs are selected. Toggle the upstream blocks in the ",(0,w.jsx)(k.Z,{bold:!0,onClick:function(){return m(ce.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null===V||void 0===V?void 0:V.length)>=1&&(0,w.jsx)(le.Z,{inputsBlocks:V}),M&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(x.Z,{light:!0}),(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsx)(Z.Z,{mb:1,children:(0,w.jsx)(re.Z,{danger:!0,level:5,children:"ERROR"})}),(0,w.jsxs)(P.ZP,{muted:!0,children:["The credentials configuration is formatted incorrectly for the language ",h.LE[C],". The formatting must be fixed before the credentials configuration can be saved."]})]})]}),G]})},fe=t(56747),ve=t(96348),he=t(26304),me=t(93859),be=t(66909),ge=t(42122);var xe=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.setSelectedSubTab,l=e.showError,u=e.stream,c=(0,s.useRef)(null),a=(0,s.useState)(null),p=a[0],f=a[1],v=(0,s.useState)(100),h=v[0],m=(v[1],(0,s.useState)(0)),b=m[0],g=m[1];(0,s.useEffect)((function(){var e,n;null!==c&&void 0!==c&&null!==(e=c.current)&&void 0!==e&&e.getBoundingClientRect().height&&g(null===c||void 0===c||null===(n=c.current)||void 0===n?void 0:n.getBoundingClientRect().height)}),[c]);var x=null===i||void 0===i?void 0:i.uuid,j=null===n||void 0===n?void 0:n.uuid,y=(0,s.useMemo)((function(){return{parentStreamID:(0,ae.Qu)(u),streamID:(0,ae.M$)(u)}}),[u]),C=y.parentStreamID,_=y.streamID,S=(0,s.useMemo)((function(){return(0,ge.Qr)((0,ae.WE)(u||{})||{},{idIsInObject:!0})}),[u]),I=W.ZP.outputs.pipelines.detail(!p&&x,!p&&j,{parent_stream:C,sample_count:h,stream:_},{revalidateOnFocus:!1}).data,E=(0,d.Db)(W.ZP.outputs.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.output;f(n)},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),M=(0,r.Z)(E,2),D=M[0],B=M[1].isLoading,R=(0,s.useCallback)((function(){return D({output:{block_uuid:j,persist:1,pipeline_uuid:x,refresh:1,sample_count:h,streams:[{parent_stream:C,stream:_}]}})}),[j,D,C,x,h,_]),A=(0,s.useMemo)((function(){return p||(null===I||void 0===I?void 0:I.output)}),[I,p]),N=(0,s.useMemo)((function(){var e,n=(A||{}).outputs,t=void 0===n?[]:n;return null===t||void 0===t||null===(e=t.find((function(e){return e.uuid===_})))||void 0===e?void 0:e.data}),[A,_]),L=(0,s.useMemo)((function(){var e=N||{},n=e.sample_data,i=(e.type,n||{}),o=i.columns,r=i.rows;if(null!==o&&void 0!==o&&o.length&&null!==r&&void 0!==r&&r.length)return(0,w.jsx)(me.Z,{columnHeaderHeight:be.Eh,columns:o,height:t-b,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:r})}),[N,t,b]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{p:O.cd,ref:c,children:S?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(P.ZP,{default:!0,children:"Please select at least 1 column in the stream in order to fetch sample data."}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(k.Z,{bold:!0,onClick:function(){return o(ce.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,w.jsx)(T.ZP,{compact:!0,loading:B,onClick:function(){return R()},primary:!0,children:N?"Refresh sample data":"Fetch sample data"})}),L]})},je=t(31882),ye=t(75499),ke=t(69650),Ze=t(12468),Pe=t(61599),Oe=t(44897),Ce=t(42631),we=m.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-wjbb3f-0"})(["border-radius:","px;"," ",""],Ce.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||Oe.Z.borders).light,";\n ")}),(function(e){return!e.noPadding&&"\n padding: ".concat(O.cd*O.iI,"px;\n ")})),_e=t(86735);function Se(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?Se(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ee=function(e){var n,t=e.block,i=(e.blocksMapping,e.onChangeBlock),u=e.setBlockAttributes,c=e.stream,a=(e.streamMapping,e.updateStreamsInCatalog),d=(0,s.useRef)(null),p=(0,s.useState)({}),f=p[0],v=p[1],m=c||{},b=m.auto_add_new_fields,g=m.bookmark_properties,x=m.destination_table,k=m.disable_column_type_check,C=m.key_properties,_=m.partition_keys,S=m.replication_method,I=m.run_in_parallel,E=m.unique_conflict_method,M=m.unique_constraints,D=(0,ae.M$)(c),B=(0,ae.WD)(c),R=(0,ae.Z5)(c),A=null===t||void 0===t||null===(n=t.metadata)||void 0===n?void 0:n.data_integration,N=(null===A||void 0===A?void 0:A.source)||(null===A||void 0===A?void 0:A.destination),L=(0,s.useCallback)((function(e){return a(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,a]),F=(0,s.useCallback)((function(e,n){L([Ie(Ie({},c),{},(0,l.Z)({},e,n))])}),[c,L]),H=(0,s.useMemo)((function(){var e,n=[],t={},i=[],l=(0,ae.RP)(c)||{};return null===(e=Object.entries(l||{}))||void 0===e||e.forEach((function(e){var o,l=(0,r.Z)(e,2),u=l[0],c=l[1],a=c.metadata,s=c.type;n.push(u),(!a||null===a||void 0===a||!a.metadata||null!==a&&void 0!==a&&null!==(o=a.metadata)&&void 0!==o&&o.selected)&&i.push(u);var d=Array.isArray(s)?s:[s];if((null===d||void 0===d?void 0:d.length)>=1){var p=d[(null===d||void 0===d?void 0:d.length)-1];null!==t&&void 0!==t&&t[p]||(t[p]=[]),t[p].push(u)}})),(0,w.jsx)(ye.Z,{columnFlex:[1,1],rows:[[(0,w.jsx)(P.ZP,{children:"Number of columns selected"},"columns"),(0,w.jsxs)(P.ZP,{monospace:!0,rightAligned:!0,children:[null===i||void 0===i?void 0:i.length," ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",null===n||void 0===n?void 0:n.length]},"columns-value")]].concat((0,o.Z)((0,_e.YC)(Object.entries(t),(function(e){return(0,r.Z)(e,1)[0]})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return[(0,w.jsxs)(P.ZP,{children:[(0,Q.vg)(t)," columns"]},"columns-".concat(t)),(0,w.jsx)(P.ZP,{monospace:!0,rightAligned:!0,children:null===i||void 0===i?void 0:i.length},"columns-value-".concat(t))]}))),(0,o.Z)([["Bookmarks",g,"bookmark_properties"],["Unique constraints",M,"unique_constraints"],["Key properties",C,"key_properties"],["Partition keys",_,"partition_keys"]].map((function(e){var n,t=(0,r.Z)(e,3),i=t[0],o=t[1],l=t[2];return[(0,w.jsx)(P.ZP,{children:i},i),(0,w.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[!(null!==o&&void 0!==o&&o.length)&&(0,w.jsx)(P.ZP,{muted:!0,monospace:!0,children:"-"}),null===(n=(0,_e.YC)(o||[],(function(e){return e})))||void 0===n?void 0:n.map((function(e){return(0,w.jsx)("div",{style:{marginLeft:O.iI/2},children:(0,w.jsx)(je.Z,{label:e,onClick:function(){return F(l,(0,_e.Od)(o,(function(n){return n===e})))},xsmall:!0})},"".concat(i,"-value-").concat(e))}))]},"".concat(i,"-value"))]}))))})}),[g,C,_,c,M,F]),W=(0,s.useMemo)((function(){return B in f?null===f||void 0===f?void 0:f[B]:x}),[x,f,B]);return(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(we,{children:[(0,w.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Output"}),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{large:!0,children:"Destination table"}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(Ze.Z,{label:(0,w.jsxs)(P.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:D}),". To change the table name, enter in a different value."]}),lightBackground:!0}),(0,w.jsx)(Z.Z,{mr:O.cd})]}),(0,w.jsx)(j.Z,{flex:1,children:(0,w.jsx)(z.Z,{fullWidth:!0,monospace:!0,onChange:function(e){var n,t=null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value;v((function(e){return Ie(Ie({},e),{},(0,l.Z)({},B,t))})),clearTimeout(d.current),d.current=setTimeout((function(){return F("destination_table",t)}),300)},value:W||""})})]})})]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(we,{children:[(0,w.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Settings"}),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{large:!0,children:"Replication method"}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(Ze.Z,{label:(0,w.jsxs)(P.ZP,{children:["Do you want to synchronize the entire stream (",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.INCREMENTAL}),")?",Pe.th.POSTGRESQL===N&&(0,w.jsxs)(P.ZP,{children:["Log-based incremental replication (",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0}),(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsx)(U.Z,{defaultColor:!0,onChange:function(e){return F("replication_method",e.target.value)},placeholder:"Select an option",value:S,children:Object.values(Pe._B).map((function(e){return(0,w.jsxs)("option",{disabled:Pe._B.FULL_TABLE!==e,value:e,children:[Pe._B.FULL_TABLE!==e&&"[COMING SOON] ",(0,Q.vg)(e)]},e)}))})]})}),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{large:!0,children:"Unique conflict method"}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(Ze.Z,{label:(0,w.jsxs)(P.ZP,{children:["If a new record has the same value as an existing record in the ",(0,Q._6)("unique column",null===M||void 0===M?void 0:M.length),(null===M||void 0===M?void 0:M.length)>0&&(0,w.jsx)(w.Fragment,{children:"\xa0"}),null===M||void 0===M?void 0:M.sort().map((function(e,n){return(0,w.jsxs)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===M||void 0===M?void 0:M.length)&&n===(null===M||void 0===M?void 0:M.length)-1?(0,w.jsx)(P.ZP,{inline:!0,children:" and "},e):n>=1&&(0,w.jsx)(w.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0}),(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsx)(U.Z,{defaultColor:!0,onChange:function(e){return F("unique_conflict_method",e.target.value)},placeholder:"Select an option",value:E,children:Object.values(Pe.MU).map((function(e){return(0,w.jsx)("option",{value:e,children:(0,Q.vg)(e)},e)}))})]})})]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(we,{children:[(0,w.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Options"}),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Run streams in parallel"}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(P.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."})})]}),(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsx)(ke.Z,{checked:!!I,onCheck:function(e){return F("run_in_parallel",e(I))}})]})}),h.tf.DATA_EXPORTER===(null===t||void 0===t?void 0:t.type)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(P.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,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsx)(ke.Z,{checked:!!b,onCheck:function(e){return F("auto_add_new_fields",e(b))}})]})}),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(P.ZP,{default:!0,children:"By default, the value for each column is validated according to the schema property for that column. If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped. Turn this toggle on if you want to disable this strict type checking."})})]}),(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsx)(ke.Z,{checked:!!k,onCheck:function(e){return F("disable_column_type_check",e(k))}})]})})]})]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(we,{noPadding:!0,children:[(0,w.jsx)(Z.Z,{pt:O.cd,px:O.cd,children:(0,w.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Summary"})}),(0,w.jsx)(Z.Z,{mt:O.cd,pb:O.cd,children:H})]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(we,{children:[(0,w.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Other"}),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{large:!0,children:"Select stream"}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(ke.Z,{checked:!!R,onCheck:function(e){return L([(0,ae.XE)(c,{selected:e(R)})])}})]})}),(0,w.jsx)(Z.Z,{mt:O.HN,children:(0,w.jsx)(y.ZP,{alignItems:"center",children:(0,w.jsx)(T.ZP,{danger:!0,onClick:function(){window.confirm("Are you sure you want to remove stream ".concat(D," from block ").concat(null===t||void 0===t?void 0:t.uuid,"?"))&&u((function(e){var n,t=Ie(Ie({},e),{},{catalog:Ie(Ie({},null===e||void 0===e?void 0:e.catalog),{},{streams:(0,_e.Od)(null===e||void 0===e||null===(n=e.catalog)||void 0===n?void 0:n.streams,(function(e){return(0,ae.WD)(e)===B}))})});return null===i||void 0===i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},Te=t(11074),Me=t(69632),De=t(3314);function Be(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 Re(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Be(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Be(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ae=function(e){e.block,e.blocksMapping;var n=e.highlightedColumnsMapping,t=e.onChangeBlock,i=e.setBlockAttributes,o=e.setHighlightedColumnsMapping,u=e.setSelectedSubTab,c=e.setStreamsMappingConflicts,a=e.showStreamConflicts,d=e.stream,p=e.streamMapping,f=e.streamsMappingConflicts,v=(0,s.useCallback)((function(e){i((function(n){var i=e(n);return null===t||void 0===t||t(i),i}))}),[t,i]),h=(0,s.useMemo)((function(){return(0,ae.RP)(d)||{}}),[d]),m=(0,s.useState)(null),k=m[0],C=m[1],_=(0,s.useState)(null),S=_[0],I=_[1],E=(0,s.useRef)(null),M=(0,s.useState)(null),D=M[0],B=M[1],R=(0,s.useCallback)((function(){B(null),C(null)}),[B,C]);(0,s.useEffect)((function(){var e;return null===(e=document)||void 0===e||e.addEventListener("click",R),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("click",R)}}),[R]);var A=(0,s.useMemo)((function(){var e=d.bookmark_properties,n=d.key_properties,t=d.partition_keys,i=(d.replication_method,d.unique_constraints);return{bookmarkPropertiesMapping:(0,_e.HK)(e||[],(function(e){return e})),keyPropertiesMapping:(0,_e.HK)(n||[],(function(e){return e})),partitionKeysMapping:(0,_e.HK)(t||[],(function(e){return e})),uniqueConstraintsMapping:(0,_e.HK)(i||[],(function(e){return e}))}}),[d]),N=A.bookmarkPropertiesMapping,L=A.keyPropertiesMapping,F=A.partitionKeysMapping,U=A.uniqueConstraintsMapping,H=(0,s.useMemo)((function(){var e,n;return null===(e=(0,_e.YC)(Object.entries(h||{}),(function(e){return(0,r.Z)(e,1)[0]})))||void 0===e||null===(n=e.map)||void 0===n?void 0:n.call(e,(function(e){var n=(0,r.Z)(e,2);return{column:n[0],property:n[1]}}))}),[h]),z=((0,s.useMemo)((function(){return(0,ae.MB)(d)}),[d]),(0,s.useMemo)((function(){return(0,ae.Nf)(d)}),[d])),W=(0,s.useMemo)((function(){var e=[null,1,1,null],n=null===H||void 0===H?void 0:H.every((function(e){var n,t,i,o=e.property;return!(null!==o&&void 0!==o&&o.metadata)||!(null!==o&&void 0!==o&&null!==(n=o.metadata)&&void 0!==n&&n.metadata)||(null===o||void 0===o||null===(t=o.metadata)||void 0===t||null===(i=t.metadata)||void 0===i?void 0:i.selected)})),t=[{label:function(){return(0,w.jsx)(ke.Z,{checked:n,compact:!0,onCheck:function(e){return function(e){var n=null===H||void 0===H?void 0:H.reduce((function(n,t){var i=t.column,o=(null===z||void 0===z?void 0:z[i])||(0,ae.jC)(i);return n[i]=Re(Re({},o),{},{metadata:Re(Re({},null===o||void 0===o?void 0:o.metadata),e)}),n}),{});v((function(e){return(0,ae.$C)((0,ae.AP)(d,n),e)}))}({selected:e(n)})}})},uuid:"action"},{uuid:"Property"},{uuid:"Types"},{center:!0,uuid:"Unique"}],i=d.replication_method;return Pe._B.INCREMENTAL===i&&(e.push(null),t.push({center:!0,uuid:"Bookmark"})),e.push.apply(e,[null,null]),t.push.apply(t,[{center:!0,uuid:"Key"},{center:!0,uuid:"Partition"}]),{columnFlex:e,columns:t}}),[H,v,d,z]),G=W.columnFlex,V=W.columns,q=(0,s.useCallback)((function(e,n,t){var i,o=t||{},r=o.disableEdit,u=o.key,c=(0,ae.wx)(e,n),a=(null===c||void 0===c?void 0:c.typesDerived)||[];return(0,w.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[null===(i=a||[])||void 0===i?void 0:i.map((function(n){return(0,w.jsx)("div",{style:{paddingBottom:1,marginRight:2,paddingTop:1},children:(0,w.jsx)(je.Z,{label:n,onClick:r?null:function(t){(0,De.j)(t);var i=!(null===a||void 0===a||!a.includes(n))?(0,ae.VZ)([n],c):(0,ae.qx)([n],c),o={anyOf:null===i||void 0===i?void 0:i.anyOf,format:null===i||void 0===i?void 0:i.format,type:null===i||void 0===i?void 0:i.type};v((function(n){return(0,ae.$C)((0,ae.KN)(d,(0,l.Z)({},e,o)),n)}))},xsmall:!0})},"".concat(e,"-").concat(u||"types","-").concat(n))})),!r&&(0,w.jsx)(T.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,De.j)(e),B({x:e.pageX,y:e.pageY}),C(c)},children:(0,w.jsx)(K.I8,{default:!0})})]},"".concat(e,"-").concat(u||"types"))}),[v,B,C,d,ae.$C]),Y=(0,s.useMemo)((function(){return null===H||void 0===H?void 0:H.map((function(e){var n,t=e.column,i=e.property,o=d.bookmark_properties,u=d.key_properties,c=d.partition_keys,a=d.replication_method,s=d.unique_constraints,p=(i.anyOf,i.format,i.metadata),f=(i.type,(0,ae.wx)(t,i)),h=(null===f||void 0===f||f.typesDerived,!p||!(null!==p&&void 0!==p&&p.metadata)||(null===p||void 0===p||null===(n=p.metadata)||void 0===n?void 0:n.selected)),m=null===U||void 0===U?void 0:U[t],g=null===N||void 0===N?void 0:N[t],x=null===L||void 0===L?void 0:L[t],j=null===F||void 0===F?void 0:F[t],k=[(0,w.jsx)("div",{style:{minHeight:22},children:(0,w.jsx)(ke.Z,{checked:h,compact:!0,onCheck:function(e){v((function(n){return(0,ae.$C)((0,ae.AP)(d,(0,l.Z)({},t,Re(Re({},p),{},{metadata:Re(Re({},null===p||void 0===p?void 0:p.metadata),{},{selected:e(h)})}))),n)}))}})},"".concat(t,"-selected")),(0,w.jsx)(P.ZP,{monospace:!0,children:t},"".concat(t,"-column")),q(t,f),(0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,w.jsx)(b.Z,{checked:m,onClick:function(e){(0,De.j)(e),v((function(e){return(0,ae.$C)(Re(Re({},d),{},{unique_constraints:m?(0,_e.Od)(s||[],(function(e){return e===t})):(0,_e.Hl)(t,s||[])}),e)}))}})},"".concat(t,"-unique"))],Z=[];return Pe._B.INCREMENTAL===a&&Z.push([g,"bookmark_properties",o]),Z.push.apply(Z,[[x,"key_properties",u],[j,"partition_keys",c]]),Z.forEach((function(e){var n=(0,r.Z)(e,3),i=n[0],o=n[1],u=n[2];k.push((0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,w.jsx)(b.Z,{checked:i,onClick:function(e){(0,De.j)(e),v((function(e){return(0,ae.$C)(Re(Re({},d),{},(0,l.Z)({},o,i?(0,_e.Od)(u||[],(function(e){return e===t})):(0,_e.Hl)(t,u||[]))),e)}))}})},"".concat(t,"-").concat(o)))})),k}))}),[N,L,F,q,h,H,v,B,C,d,U]),Q=(0,s.useCallback)((function(e){var t=null===H||void 0===H?void 0:H[e];return Re(Re({},t),{},{highlighted:!(null===n||void 0===n||!n[null===t||void 0===t?void 0:t.column])})}),[n,H]),X=(0,s.useMemo)((function(){var e;if(D&&k){var n=21*O.iI,t=(null===E||void 0===E||null===(e=E.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,o=t.width,r=D||{},u=r.x,c=void 0===u?0:u,a=r.y,s=void 0===a?0:a,p=c;c+n>=i+o&&(p=i+o-(n+O.iI)),p<0&&(p=0);var f=(null===h||void 0===h?void 0:h[null===k||void 0===k?void 0:k.uuid])||{},m=(0,ae.wx)(null===k||void 0===k?void 0:k.uuid,f||{}),x=m||{},j=x.typesDerived,P=void 0===j?[]:j,_=x.uuid;return(0,w.jsx)("div",{onClick:De.j,style:{left:p,position:"fixed",top:s+O.iI/2,width:n,zIndex:100},children:(0,w.jsxs)(Te.Z,{children:[(0,w.jsx)("div",{style:{position:"relative"},children:(0,w.jsx)(T.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,De.j)(e),B(null),C(null)},style:{position:"absolute",right:-.5*O.iI,top:-.5*O.iI,zIndex:1},children:(0,w.jsx)(g.Z,{default:!0,size:2.5*O.iI,children:(0,w.jsx)(K.x8,{size:1.5*O.iI})})})}),(0,w.jsx)(Z.Z,{p:O.cd,children:Pe.D5.map((function(e,n){var t=!(null===P||void 0===P||!P.includes(e));return(0,w.jsx)("div",{style:{marginTop:0===n?0:4},children:(0,w.jsx)(y.ZP,{alignItems:"center",children:(0,w.jsx)(b.Z,{checked:t,label:e,onClick:function(n){(0,De.j)(n);var i=t?(0,ae.VZ)([e],m):(0,ae.qx)([e],m),o={anyOf:null===i||void 0===i?void 0:i.anyOf,format:null===i||void 0===i?void 0:i.format,type:null===i||void 0===i?void 0:i.type};v((function(e){return(0,ae.$C)((0,ae.KN)(d,(0,l.Z)({},_,o)),e)}))}})})},e)}))})]})})}}),[D,k,E,h,v,B,C,d]),J=(0,s.useMemo)((function(){return(0,ae.p$)(d,f,p)}),[d,p,f]),$=(0,s.useCallback)((function(e,n){var t,i=null===J||void 0===J?void 0:J.stream,o=null===i||void 0===i||null===(t=i.schema)||void 0===t?void 0:t.properties;I((function(t){var i=Re({},t);return null===e||void 0===e||e.forEach((function(e){n?i[e]=null===o||void 0===o?void 0:o[e]:e in i&&(null===i||void 0===i||delete i[e])})),i}))}),[J,I]),ee=(0,s.useCallback)((function(e){var n=e||{},t=n.column,i=n.property,o=n.currentProperty,r=!(null===S||void 0===S||!S[t]),l=[(0,w.jsx)(b.Z,{checked:r,onClick:function(e){(0,De.j)(e),$([t],!r)}},"".concat(t,"-accept")),(0,w.jsx)(P.ZP,{monospace:!0,children:t},"".concat(t,"-property")),q(t,i,{disableEdit:!0})];return o?l.push(q(t,o,{disableEdit:!0,key:"types-current"})):l.push((0,w.jsx)("div",{},"".concat(t,"-empty"))),l}),[q,S,I,$]),ne=(0,s.useCallback)((function(e,n){var t=n||{},i=t.columnFlex,o=t.columns,r=(null===e||void 0===e?void 0:e.map((function(e){return e.column})))||[],l=null===r||void 0===r?void 0:r.every((function(e){return!(null===S||void 0===S||!S[e])}));return(0,w.jsx)(ye.Z,{columnFlex:[null,1].concat(i||[]),columns:[{label:function(){return(0,w.jsx)(b.Z,{checked:l,onClick:function(e){(0,De.j)(e),$(r,!l)}})},uuid:"Accept change"},{uuid:"Property"}].concat(o||[]),highlightRowOnHover:!0,onClickRow:function(n){var t=null===e||void 0===e?void 0:e[n],i=null===t||void 0===t?void 0:t.column,o=!(null===S||void 0===S||!S[i]);$([i],!o)},rows:null===e||void 0===e?void 0:e.map(ee)})}),[ee,S,$]),te=(0,s.useMemo)((function(){var e,n;if(!J)return null;var t=J.newColumnSettings,i=J.newColumns,o=J.stream,l=null===o||void 0===o||null===(e=o.schema)||void 0===e?void 0:e.properties,u=null===(n=(0,_e.YC)(i,(function(e){return e})))||void 0===n?void 0:n.map((function(e){return{column:e,property:null===l||void 0===l?void 0:l[e]}})),c=(0,_e.YC)(Object.entries(t),(function(e){return(0,r.Z)(e,1)[0]})).map((function(e){var n=(0,r.Z)(e,2),t=n[0];n[1];return{column:t,property:null===l||void 0===l?void 0:l[t],currentProperty:null===h||void 0===h?void 0:h[t]}}));return(0,w.jsxs)(w.Fragment,{children:[(null===u||void 0===u?void 0:u.length)>=1&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsx)(re.Z,{level:5,warning:!0,children:"New properties"})}),(0,w.jsx)(x.Z,{light:!0}),ne(u,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{label:function(){return""},uuid:"empty"}]})]}),(null===c||void 0===c?void 0:c.length)>=1&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsx)(re.Z,{level:5,warning:!0,children:"Properties with new types"})}),(0,w.jsx)(x.Z,{light:!0}),ne(c,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{uuid:"Types (current)"}]})]})]})}),[J,ne,h,d]),ie=(0,s.useMemo)((function(){return(0,w.jsx)(ye.Z,{columnFlex:G,columns:V,highlightRowOnHover:!0,isSelectedRow:function(e){var n;return null===(n=Q(e))||void 0===n?void 0:n.highlighted},menu:X,onClickRow:function(e){var n=Q(e),t=n.column,i=n.highlighted;o((function(e){return i?(0,ge.gR)(e,[t]):Re(Re({},e),{},(0,l.Z)({},t,!0))}))},ref:E,rows:Y,stickyHeader:!0})}),[G,V,Q,E,X,Y,o]);return(0,w.jsxs)(w.Fragment,{children:[a&&te&&(0,w.jsxs)(Z.Z,{my:O.cd,children:[(0,w.jsx)(Z.Z,{px:O.cd,children:(0,w.jsx)(Me.NJ,{children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(j.Z,{children:(0,w.jsx)(K.uy,{size:2*O.iI,warning:!0})}),(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsxs)(P.ZP,{muted:!0,children:["The following properties are either new or have different types. Please review and either merge the changes or discard them.",(0,w.jsx)("br",{}),"Click the checkbox to include the updated property when merging changes."]})]})})}),te,(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsxs)(y.ZP,{children:[(0,w.jsx)(T.ZP,{beforeIcon:(0,w.jsx)(K.Pt,{}),onClick:function(){v((function(e){var n;return(0,ae.$C)(Re(Re({},d),{},{schema:Re(Re({},null===d||void 0===d?void 0:d.schema),{},{properties:Re(Re({},null===d||void 0===d||null===(n=d.schema)||void 0===n?void 0:n.properties),S)})}),e)})),c({noParents:{},parents:{}}),u(ce.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(T.ZP,{onClick:function(){c({noParents:{},parents:{}}),u(ce.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!a&&ie,(0,w.jsx)(Z.Z,{pb:O.HN})]})},Ne=["block","height","pipeline","selectedSubTab","showError","stream"];function Le(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 Fe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Le(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Le(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ue=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.selectedSubTab,r=e.showError,l=e.stream,u=(0,he.Z)(e,Ne);return ce.tw.OVERVIEW!==o&&o?ce.tw.SETTINGS===o||ce.tw.STREAM_CONFLICTS===o?(0,w.jsx)(Ae,Fe(Fe({},u),{},{block:n,showStreamConflicts:ce.tw.STREAM_CONFLICTS===o,stream:l})):ce.tw.SAMPLE_DATA===o?(0,w.jsx)(xe,{block:n,height:t,pipeline:i,showError:r,stream:l}):(0,w.jsx)(w.Fragment,{}):(0,w.jsx)(Ee,Fe(Fe({},u),{},{block:n,stream:l}))},He=t(33065),ze={label:function(e){return"".concat((0,Q._6)("stream",e,!0)," fetched")},uuid:"Recently fetched"},We={label:function(e){return"".concat((0,Q._6)("stream",e,!0)," from settings")},uuid:"From stream settings"},Ke=[ze,We];function Ge(e,n){return null===n||void 0===n?void 0:n.filter((function(n){var t=new RegExp(e||"","i"),i=(0,ae.M$)(n);return!e||(null===i||void 0===i?void 0:i.match(t))||(null===i||void 0===i?void 0:i.replace("-"," ").match(t))||(null===i||void 0===i?void 0:i.replace("-","").match(t))||(null===i||void 0===i?void 0:i.replace("_"," ").match(t))||(null===i||void 0===i?void 0:i.replace("_","").match(t))||(null===i||void 0===i?void 0:i.replaceAll("-"," ").match(t))||(null===i||void 0===i?void 0:i.replaceAll("-","").match(t))||(null===i||void 0===i?void 0:i.replaceAll("_"," ").match(t))||(null===i||void 0===i?void 0:i.replaceAll("_","").match(t))}))}var Ve=function(e){var n=e.block,t=e.blocksMapping,i=e.height,o=e.onChangeBlock,u=e.searchText,c=e.setSelectedMainNavigationTab,a=(e.setSelectedSubTab,e.setStreamsMappingConflicts),d=e.streamsFetched,p=e.updateStreamsInCatalog,f=e.width,v=(0,s.useMemo)((function(){return(0,ae.Uc)(n,{getAll:!0})}),[n]),h=(0,s.useMemo)((function(){return(0,ae.UA)(v)}),[v]),m=(0,s.useMemo)((function(){return(0,ae.UA)(d||[])}),[d]),b=(0,s.useCallback)((function(e){return(0,ae.ig)(e,m,h)}),[m,h]),g=(0,s.useCallback)((function(e){return(0,ae.p$)(e,m,h)}),[m,h]),k=(0,s.useCallback)((function(e){var n;return(n={},(0,l.Z)(n,ze.uuid,m),(0,l.Z)(n,We.uuid,h),n)[e]}),[h,m]),_=(0,s.useMemo)((function(){var e=[];return Ke.forEach((function(n,i){var o,l=n.label,c=n.uuid,a=k(c),s=[],d=Object.values((null===a||void 0===a?void 0:a.noParents)||{})||[],p=Ge(u,d);(null===p||void 0===p?void 0:p.length)>=1&&s.push({streams:(0,_e.YC)(p||[],ae.M$)}),null===(o=Object.entries((null===a||void 0===a?void 0:a.parents)||{}))||void 0===o||o.forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],o=n[1],l=Ge(u,Object.values(o||{})||[]);(null===l||void 0===l?void 0:l.length)>=1&&s.push({block:null===t||void 0===t?void 0:t[i],streams:(0,_e.YC)(l||[],ae.M$)})})),(null===s||void 0===s?void 0:s.length)>=1&&e.push({count:(0,_e.Sm)((null===s||void 0===s?void 0:s.map((function(e){var n=e.streams;return(null===n||void 0===n?void 0:n.length)||0})))||[]),label:l,subgroups:s,uuid:c})})),e}),[k,u]),S=(0,s.useMemo)((function(){return(null===_||void 0===_?void 0:_.length)||0}),[_]);return(0,w.jsx)(w.Fragment,{children:null===_||void 0===_?void 0:_.map((function(e,n){var t=e.count,r=e.label,l=e.subgroups,u=e.uuid,s=ze.uuid===u;return(0,w.jsx)(He.cL,{style:{height:i,right:We.uuid===u?null:0,width:f/S},children:(0,w.jsx)(He.N0,{borderRight:S>=2&&!s,style:{height:i,width:f/S},children:(0,w.jsxs)(Z.Z,{pt:O.cd,children:[(0,w.jsx)(Z.Z,{px:O.Mq,children:(0,w.jsx)(re.Z,{level:4,children:r(t)})}),null===l||void 0===l?void 0:l.map((function(e,n){var t,i=e.block,r=e.streams;return(0,w.jsxs)(Z.Z,{mt:i&&0===n?O.cd:1,children:[(0,w.jsx)(Z.Z,{mb:i?O.cd:0,mt:i?0:O.cd,children:(0,w.jsx)(x.Z,{light:!0})}),i&&(0,w.jsx)(Z.Z,{px:O.cd,children:(0,w.jsx)(P.ZP,{bold:!0,color:null===(t=(0,C.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}))||void 0===t?void 0:t.accent,default:!0,large:!0,monospace:!0,children:null===i||void 0===i?void 0:i.uuid})}),(0,w.jsx)(Z.Z,{p:1,children:(0,w.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:null===r||void 0===r?void 0:r.map((function(e){var n=b(e),t=!!g(e),i=(0,ae.M$)(e),r=(0,ae.Qu)(e),l=!1;if(s){var u=(0,ae.zB)(e,k(We.uuid));u&&(l=(0,ae.Z5)(u))}else l=(0,ae.Z5)(e);var d=n&&t;return(0,w.jsx)(He.HE,{onClick:s&&d?function(){return!1}:function(n){n.preventDefault(),p([(0,ae.XE)(e,{selected:!l})],(function(e){return null===o||void 0===o?void 0:o(e)}))},selected:l,warning:d&&s,children:(0,w.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,w.jsx)(j.Z,{flex:1,children:(0,w.jsx)(P.ZP,{monospace:!0,muted:!l,children:i})}),d&&s&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(P.ZP,{monospace:!0,warning:!0,children:"exists"})]}),d&&s&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(j.Z,{alignItems:"center",style:{minHeight:3*O.iI},children:(0,w.jsx)(T.ZP,{compact:!0,onClick:function(){a((function(n){return(0,ae.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:ce.tw.STREAM_CONFLICTS}}))},small:!0,warning:!0,children:"View differences"})})]}),(!d||!s)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{mr:O.HN}),l&&(0,w.jsx)(K.Zr,{size:2*O.iI}),(0,w.jsx)(Z.Z,{mr:l?1:3}),(0,w.jsx)(j.Z,{alignItems:"center",style:{height:3*O.iI},children:(0,w.jsx)(ke.Z,{checked:l,compact:!0,onCheck:function(n){return p([(0,ae.XE)(e,{selected:n(l)})],(function(e){return null===o||void 0===o?void 0:o(e)}))}})})]})]})},i)}))})})]},i?null===i||void 0===i?void 0:i.uuid:"no-subtitle-".concat(n))}))]})})},u)}))})};function qe(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 Ye(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qe(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Qe=function(e){var n=e.attributes,t=e.attributesMapping,i=e.columnFlex,o=e.rightAlignColumnForRowIndexes,r=e.rowGroupHeaders,u=e.rowsGroupedByIndex,c=e.setAttributesMapping,a=(0,s.useCallback)((function(e,n){var i,r=e.inputType,u=e.label,a=e.options,s=e.uuid,d=null===t||void 0===t?void 0:t[s],p=!(null===d||void 0===d||!d.selected),f=null===d||void 0===d?void 0:d.value;return ce.oI.CHECKBOX===r?i=(0,w.jsx)(b.Z,{checked:!!f,onClick:function(e){p&&(0,De.j)(e),c((function(e){return Ye(Ye({},e),{},(0,l.Z)({},s,Ye(Ye({},null===e||void 0===e?void 0:e[s]),{},{value:!f})))}))}}):ce.oI.SELECT===r?i=(0,w.jsxs)(U.Z,{compact:!0,fullWidth:!0,onChange:function(e){(0,De.j)(e),c((function(n){var t;return Ye(Ye({},n),{},(0,l.Z)({},s,Ye(Ye({},null===n||void 0===n?void 0:n[s]),{},{value:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})))}))},onClick:function(e){p&&(0,De.j)(e)},value:f,children:[(0,w.jsx)("option",{value:""}),null===a||void 0===a?void 0:a.map((function(e){var n=e.disabled,t=e.label,i=e.value;return(0,w.jsx)("option",{disabled:n,value:i,children:t?t():i},i)}))]}):ce.oI.TOGGLE===r&&(i=(0,w.jsx)(ke.Z,{checked:f,compact:!0,onCheck:function(e){c((function(n){return Ye(Ye({},n),{},(0,l.Z)({},s,Ye(Ye({},null===n||void 0===n?void 0:n[s]),{},{value:e(f)})))}))},pauseEvent:p})),[(0,w.jsx)(b.Z,{checked:p,onClick:function(e){(0,De.j)(e),c((function(e){return Ye(Ye({},e),{},(0,l.Z)({},s,Ye(Ye({},null===e||void 0===e?void 0:e[s]),{},{selected:!p})))}))}},"".concat(s,"-checkbox")),(0,w.jsx)(P.ZP,{muted:!p,children:u()},"".concat(s,"-name")),(0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:null!==o&&void 0!==o&&o.includes(n)?"flex-end":"center",children:i},"".concat(s,"-value"))]}),[t,o,c]);return(0,s.useMemo)((function(){return(0,w.jsx)(ye.Z,{columnFlex:i||[null,1,null],columns:[{uuid:"Use"},{uuid:"Attribute"},{uuid:"Value"}],groupsInline:!0,onClickRow:function(e){var i=null===n||void 0===n?void 0:n[e],o=null===i||void 0===i?void 0:i.uuid,r=null===t||void 0===t?void 0:t[o],u=!(null===r||void 0===r||!r.selected);c((function(e){return Ye(Ye({},e),{},(0,l.Z)({},o,Ye(Ye({},null===e||void 0===e?void 0:e[o]),{},{selected:!u})))}))},rowGroupHeaders:r,rowsGroupedByIndex:u,rows:n.map((function(e,n){return a(e,n)}))})}),[n,t,i,a])};var Xe=function(e){var n=e.selectedStreamMapping,t=e.setSelectedStreamMapping,i=e.streamMapping,o=(0,s.useMemo)((function(){return(0,ae.th)(i)}),[i]),r=(0,s.useMemo)((function(){var e=[],t=[],i=[],r=[],l=0;return null===o||void 0===o||o.forEach((function(o){var u=o.groupHeader,c=o.streams;e.push(u);var a=[];null===c||void 0===c||c.forEach((function(e){r.push(e),a.push(l),l+=1;var i=(0,ae.WD)(e),o=(0,ae.M$)(e),u=!!(0,ae.zB)(e,n),c=[(0,w.jsx)(b.Z,{checked:u},"".concat(i,"-").concat(o,"-use")),(0,w.jsx)(P.ZP,{muted:!u,children:o},"".concat(i,"-").concat(o,"-stream"))];t.push(c)})),i.push(a)})),{rowGroupHeaders:e,rows:t,rowsGroupedByIndex:i,streamsArray:r}}),[n,o]),l=r.rowGroupHeaders,u=r.rows,c=r.rowsGroupedByIndex,a=r.streamsArray,d=(0,s.useMemo)((function(){var e,t;return(null===(e=Object.values((null===n||void 0===n?void 0:n.noParents)||{}))||void 0===e?void 0:e.length)+(0,_e.Sm)(null===(t=Object.values((null===n||void 0===n?void 0:n.parents)||{}))||void 0===t?void 0:t.map((function(e){var n;return null===(n=Object.values(e||{}))||void 0===n?void 0:n.length})))}),[n]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsxs)("div",{children:[(0,w.jsxs)(re.Z,{children:[(0,Q._6)("stream",d||0)," chosen"]}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(P.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})})]})}),(0,w.jsx)(ye.Z,{columnFlex:[null,1],columns:[{uuid:"Use"},{uuid:"Stream"}],groupsInline:!0,onClickRow:function(e){var i=null===a||void 0===a?void 0:a[e],o=!!(0,ae.zB)(i,n);t((function(e){return(0,ae.iN)(i,e,{remove:o})}))},rowGroupHeaders:l,rows:u,rowsGroupedByIndex:c,stickyHeader:!0})]})};var Je=function(e){var n=e.attributesMapping,t=e.selectedStreamMapping,i=e.setAttributesMapping,o=e.setSelectedStreamMapping,r=e.streamMapping,l=(0,s.useMemo)((function(){return(0,w.jsx)(Qe,{attributes:[{label:function(){return"Replication method"},inputType:ce.oI.SELECT,options:Object.values(Pe._B).map((function(e){return{disabled:Pe._B.FULL_TABLE!==e,label:function(){var n=(0,Q.vg)(e);return Pe._B.FULL_TABLE!==e?"[COMING SOON] ".concat(n):n},value:e}})),uuid:ae.I1.REPLICATION_METHOD},{label:function(){return"Unique conflict method"},inputType:ce.oI.SELECT,options:Object.values(Pe.MU).map((function(e){return{label:function(){return(0,Q.vg)(e)},value:e}})),uuid:ae.I1.UNIQUE_CONFLICT_METHOD},{label:function(){return"Run stream in parallel"},inputType:ce.oI.TOGGLE,uuid:ae.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:ce.oI.TOGGLE,uuid:ae.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:ce.oI.TOGGLE,uuid:ae.I1.DISABLE_COLUMN_TYPE_CHECK}],attributesMapping:n,columnFlex:[null,1,1],rightAlignColumnForRowIndexes:[2,3,4],setAttributesMapping:i})}),[n,i]),u=(0,s.useMemo)((function(){return(0,w.jsx)(Xe,{selectedStreamMapping:t,setSelectedStreamMapping:o,streamMapping:r})}),[t,o,r]);return(0,w.jsxs)(He.YI,{children:[(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsxs)("div",{children:[(0,w.jsx)(re.Z,{children:"Make changes to multiple streams"}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(P.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the attributes below and change the values of those attributes for all the selected streams."})})]})}),l,u]})};function $e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function en(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$e(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var nn=function(e){var n=e.attributesMapping,t=e.highlightedColumnsMapping,i=e.selectedStreamMapping,u=e.setAttributesMapping,c=e.setHighlightedColumnsMapping,a=e.setSelectedStreamMapping,d=e.stream,p=e.streamMapping;e.updateStreamsInCatalog,(0,s.useEffect)((function(){if(d&&!i){var e=(0,ae.M$)(d||{}),n=(0,ae.Qu)(d||{});n?a({noParents:{},parents:(0,l.Z)({},n,(0,l.Z)({},e,d))}):e&&a({noParents:(0,l.Z)({},e,d),parents:{}})}}),[i,a,d]);var f=(0,s.useMemo)((function(){return(0,w.jsx)(Qe,{attributes:[{label:function(){return"Include property when syncing"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.PROPERTY_SELECTED},{label:function(){return"Unique constraint"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Bookmark property"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.BOOKMARK_PROPERTIES},{label:function(){return"Key property"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.KEY_PROPERTIES},{label:function(){return"Partition key"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.PARTITION_KEYS}].concat((0,o.Z)(Pe.D5.map((function(e){return{label:function(){return(0,Q.vg)(e)},inputType:ce.oI.CHECKBOX,uuid:e}})))),attributesMapping:n,rowGroupHeaders:["Options","Column types"],rowsGroupedByIndex:[[0,1,2,3],null===Pe.D5||void 0===Pe.D5?void 0:Pe.D5.map((function(e,n){return n+4}))],setAttributesMapping:u})}),[n,u]),v=(0,s.useMemo)((function(){return(0,w.jsx)(Xe,{selectedStreamMapping:i,setSelectedStreamMapping:a,streamMapping:p})}),[i,a,p]),h=(0,s.useMemo)((function(){var e,n=null===(e=Object.entries(t||{}))||void 0===e?void 0:e.reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);return(0,_e.YC)(n,(function(e){return e}))}),[t]);return(0,w.jsxs)(He.YI,{children:[(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsxs)("div",{children:[(0,w.jsxs)(re.Z,{children:[!(null!==h&&void 0!==h&&h.length)&&"Choose at least 1 property",(null===h||void 0===h?void 0:h.length)>=1&&"".concat((0,Q._6)("property",(null===h||void 0===h?void 0:h.length)||0)," chosen")]}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:[!(null!==h&&void 0!==h&&h.length)&&"Click 1 or more rows in the table to select which schema properties to apply bulk changes to.",(null===h||void 0===h?void 0:h.length)>=1&&(0,w.jsx)(w.Fragment,{children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})]})})]}),(null===h||void 0===h?void 0:h.length)>=1&&(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:null===h||void 0===h?void 0:h.map((function(e){return(0,w.jsx)("div",{style:{marginBottom:O.iI/2,marginRight:O.iI/2},children:(0,w.jsx)(je.Z,{label:e,onClick:function(){c((function(n){return!(null===n||void 0===n||!n[e])?(0,ge.gR)(n,[e]):en(en({},n),{},(0,l.Z)({},e,!0))}))}})},"".concat(e,"-chip"))}))})})]}),f,v]})};function tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function on(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var rn={compact:!0,small:!0};var ln=function(e){var n=e.block,t=e.blocksMapping,i=e.onChangeBlock,o=e.selectedStreamMapping,r=e.setSelectedMainNavigationTab,u=e.setSelectedStreamMapping,c=e.streamMapping,a=e.updateStreamsInCatalog,d=(0,s.useRef)(null),p=(0,s.useState)({}),f=p[0],v=p[1],m=(0,s.useCallback)((function(e){return a(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,a]),b=(n||{}).type,g=c||{},x=g.noParents,j=g.parents,_=(0,s.useMemo)((function(){return(0,ge.Qr)(x||{})&&(0,ge.Qr)(j||{})}),[x,j]),S=(0,s.useMemo)((function(){return(0,ae.th)(c)}),[c]),I=(0,s.useMemo)((function(){var e=[null,1,3,2,2,null],n=[{label:function(e){var n=e.groupIndex,t=((null===S||void 0===S?void 0:S[n])||{}).streams,i=t&&(null===t||void 0===t?void 0:t.every((function(e){return(0,ae.Z5)(e)})));return(0,w.jsx)(ke.Z,{checked:i,compact:!0,disabled:!(null!==t&&void 0!==t&&t.length),onCheck:function(e){t&&m(null===t||void 0===t?void 0:t.map((function(n){return(0,ae.XE)(n,{selected:e(i)})})))}})},uuid:"action"},{uuid:"Stream"},{uuid:"Table"},{uuid:"Sync"},{uuid:"Unique conflict"},{center:!0,uuid:"Parallel"}];return h.tf.DATA_EXPORTER===b&&(e.push.apply(e,[null,null]),n.push.apply(n,[{center:!0,uuid:"Add columns"},{center:!0,uuid:"No strict check"}])),{columnFlex:e,columns:n}}),[b,S,m]),E=I.columnFlex,T=I.columns,M=(0,s.useMemo)((function(){var e=[],n=[],i=[],o=[],u=0;return null===S||void 0===S||S.forEach((function(c){var a=c.groupHeader,p=c.streams,g=a?null===t||void 0===t?void 0:t[a]:null;g?n.push((0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsx)(P.ZP,{bold:!0,color:(0,C.qn)(null===g||void 0===g?void 0:g.type,{blockColor:null===g||void 0===g?void 0:g.color}).accent,monospace:!0,children:a})})):n.push(a);var x=[];null===p||void 0===p||p.forEach((function(n){e.push(n),x.push(u),u+=1;var t=(0,ae.WD)(n),o=(0,ae.Qu)(n),c=(0,ae.M$)(n),a=n.auto_add_new_fields,p=n.destination_table,g=n.disable_column_type_check,j=n.replication_method,Z=n.run_in_parallel,P=n.unique_conflict_method,O=(0,ae.Z5)(n),C=t in f?null===f||void 0===f?void 0:f[t]:p,_=[(0,w.jsx)(ke.Z,{checked:O,compact:!0,onCheck:function(e){m([(0,ae.XE)(n,{selected:e(O)})])}},"".concat(t,"-action")),(0,w.jsx)(k.Z,{bold:!0,monospace:!0,onClick:function(){r(c,o)},preventDefault:!0,sameColorAsText:!0,children:c},"".concat(t,"-name")),(0,w.jsx)(z.Z,{compact:!0,defaultColor:!C,monospace:!0,onChange:function(e){var i,o=null===e||void 0===e||null===(i=e.target)||void 0===i?void 0:i.value;v((function(e){return on(on({},e),{},(0,l.Z)({},t,o))})),clearTimeout(d.current),d.current=setTimeout((function(){return m([on(on({},n),{},{destination_table:o})])}),300)},onClick:De.j,placeholder:c,value:C||""},"".concat(t,"-destinationTable")),(0,s.createElement)(U.Z,on(on({},rn),{},{key:"".concat(t,"-replicationMethod"),onChange:function(e){var t;return m([on(on({},n),{},{replication_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:De.j,placeholder:"Replication method",value:j}),Object.values(Pe._B).map((function(e){return(0,w.jsxs)("option",{disabled:Pe._B.FULL_TABLE!==e,value:e,children:[Pe._B.FULL_TABLE!==e&&"[COMING SOON] ",(0,Q.vg)(e)]},e)}))),(0,s.createElement)(U.Z,on(on({},rn),{},{key:"".concat(t,"-uniqueConflictMethod"),onChange:function(e){var t;return m([on(on({},n),{},{unique_conflict_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:De.j,placeholder:"Unique conflict method",value:P}),Object.values(Pe.MU).map((function(e){return(0,w.jsx)("option",{value:e,children:(0,Q.vg)(e)},e)}))),(0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,w.jsx)(ke.Z,{checked:!!Z,compact:!0,onCheck:function(e){m([on(on({},n),{},{run_in_parallel:e(Z)})])}})},"".concat(t,"-runInParallel"))];h.tf.DATA_EXPORTER===b&&_.push.apply(_,[(0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,w.jsx)(ke.Z,{checked:!!a,compact:!0,onCheck:function(e){m([on(on({},n),{},{auto_add_new_fields:e(a)})])}})},"".concat(t,"-autoAddNewFields")),(0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,w.jsx)(ke.Z,{checked:!!g,compact:!0,onCheck:function(e){m([on(on({},n),{},{disable_column_type_check:e(g)})])}})},"".concat(t,"-disableColumnTypeCheck"))]),i.push(_)})),o.push(x)})),{rowGroupHeaders:n,rows:i,rowsGroupedByIndex:o,streamsInRows:e}}),[b,t,f,v,r,S,d,m]),D=M.rowGroupHeaders,B=M.rows,R=M.rowsGroupedByIndex,A=M.streamsInRows;return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsx)(re.Z,{children:"Overview of streams"}),_&&(0,w.jsxs)(Z.Z,{mt:1,children:[(0,w.jsx)(P.ZP,{default:!0,children:"Fetch and add at least 1 stream to the catalog in order to see an overview of all the configured stream."}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(k.Z,{bold:!0,onClick:function(){return r(ce.uK.STREAMS)},preventDefault:!0,children:"Go and fetch Streams"})})]})]}),!_&&(0,w.jsx)(ye.Z,{columnFlex:E,columns:T,isSelectedRow:function(e){var n=null===A||void 0===A?void 0:A[e];return!!(0,ae.zB)(n,o)},groupsInline:!0,onClickRow:function(e){var n=null===A||void 0===A?void 0:A[e],t=!!(0,ae.zB)(n,o);u((function(e){return(0,ae.iN)(n,e,{remove:t})}))},rowGroupHeaders:D,rows:B,rowsGroupedByIndex:R,stickyHeader:!0})]})},un=t(62547),cn=t(53808),an=t(19183);function sn(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 dn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pn=3*O.iI*2;var fn=function(e){var n=e.block,t=void 0===n?null:n,i=e.defaultMainNavigationTab,u=void 0===i?null:i,c=e.defaultMainNavigationTabSub,a=void 0===c?null:c,p=e.defaultSubTab,f=void 0===p?null:p,v=e.onChangeBlock,m=e.onChangeCodeBlock,_=e.onClose,S=e.onSaveBlock,I=e.pipeline,E=e.savePipelineContent,D=e.setContent,B=(0,s.useRef)(null),R=(0,s.useRef)(null),A=(0,s.useRef)(null),N=(0,s.useRef)(null),L=(0,s.useState)({}),F=L[0],U=L[1],G=(0,s.useState)(null),q=G[0],Y=G[1],Q=(0,s.useState)(!1),$=Q[0],ee=Q[1],ne=(0,an.i)(),ie=ne.height,oe=ne.width,le=I||{},ue=le.blocks,se=le.uuid,de=t||{},he=(de.catalog,de.content),me=de.language,be=de.type,xe=de.uuid,je=(0,s.useMemo)((function(){return h.tf.DATA_LOADER===be?V.O.SOURCES:V.O.DESTINATIONS}),[be]),ye=(0,s.useState)(t||null),Ze=ye[0],Pe=ye[1],Oe=Ze||{},Ce=(Oe.configuration,Oe.content),we=Oe.metadata,Se=(0,s.useMemo)((function(){return(null===we||void 0===we?void 0:we.data_integration)||{}}),[we]),Ie=Se.destination,Ee=Se.name,Te=Se.source,Me=(0,s.useMemo)((function(){return Ie||Te||null}),[Ie,Te]),De=(0,s.useMemo)((function(){var e={include_block_catalog:!0,include_block_metadata:!0,include_documentation:!0};return Me&&(e.data_integration_uuid=Me),e}),[je,Me]),Be=W.ZP.blocks.pipelines.detail(se,xe,De,{},{key:"pipelines/".concat(se,"/blocks/").concat(xe,"/documentation")}).data,Re=(0,s.useMemo)((function(){var e;return(null===Ze||void 0===Ze||null===(e=Ze.configuration)||void 0===e?void 0:e.data_integration)||{}}),[Ze]),Ae=(0,s.useCallback)((function(e){return Pe((function(n){var t,i=dn(dn({},n),{},{configuration:dn(dn({},null===n||void 0===n?void 0:n.configuration),{},{data_integration:e((null===n||void 0===n||null===(t=n.configuration)||void 0===t?void 0:t.data_integration)||{})})});return null===v||void 0===v||v(i),i}))}),[v,Pe]),Ne=(0,s.useCallback)((function(e){return Ae((function(n){return dn(dn({},n),{},{inputs:e((null===n||void 0===n?void 0:n.inputs)||{})})}))}),[Ae]),Le=(0,s.useCallback)((function(e,n){return Pe((function(t){var i=(null===t||void 0===t?void 0:t.catalog)||{streams:[]},r=(0,o.Z)((null===i||void 0===i?void 0:i.streams)||[]);null===e||void 0===e||e.forEach((function(e){var n=(0,ae.M$)(e),t=null===e||void 0===e?void 0:e.parent_stream,i=null===r||void 0===r?void 0:r.findIndex((function(e){var i=(0,ae.M$)(e),o=null===e||void 0===e?void 0:e.parent_stream;return n===i&&t===o})),o={};i>=0&&(o=null===r||void 0===r?void 0:r[i]);var l=dn(dn({},o),e);i>=0?r[i]=l:r.push(l)}));var l=dn(dn({},t),{},{catalog:dn(dn({},i),{},{streams:r})});return null===n||void 0===n||n(l),l}))}),[Pe]),Fe=(0,s.useMemo)((function(){return null===Be||void 0===Be?void 0:Be.block}),[Be]);(0,s.useEffect)((function(){Fe&&(Ze&&(null===Fe||void 0===Fe?void 0:Fe.uuid)===(null===Ze||void 0===Ze?void 0:Ze.uuid)||Pe(Fe))}),[Ze,Fe]);var ze=(0,s.useMemo)((function(){return(0,_e.HK)(ue||[],(function(e){return e.uuid}))}),[ue]),We=(0,s.useMemo)((function(){var e;return null===Ze||void 0===Ze||null===(e=Ze.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null===ze||void 0===ze?void 0:ze[e]}))}),[Ze,ze]),Ke=(0,s.useMemo)((function(){return null===Fe||void 0===Fe?void 0:Fe.documentation}),[Fe]),Ge=(0,s.useMemo)((function(){return(0,ae.Uc)(Ze,{getAll:!0})}),[Ze]),qe=(0,s.useMemo)((function(){return(0,ae.UA)(Ge)}),[Ge]),Ye=(0,s.useMemo)((function(){return"DataIntegrationModal/".concat(xe)}),xe),Qe=(0,s.useMemo)((function(){return"block_layout_after_width_".concat(Ye)}),[Ye]),Xe=(0,s.useMemo)((function(){return"block_layout_before_width_".concat(Ye)}),[Ye]),$e=(0,J.VI)(null,{},[],{uuid:Ye}),en=(0,r.Z)($e,1)[0],tn=(0,s.useState)((0,cn.U2)(Qe,60*O.iI)),on=tn[0],rn=tn[1],sn=(0,s.useState)(!1),fn=sn[0],vn=sn[1],hn=(0,s.useState)(Math.max((0,cn.U2)(Xe),40*O.iI)),mn=hn[0],bn=hn[1],gn=(0,s.useState)(!1),xn=gn[0],jn=gn[1],yn=(0,s.useState)({}),kn=yn[0],Zn=yn[1],Pn=(0,s.useState)({selectedMainNavigationTab:null,selectedMainNavigationTabSub:a,selectedSubTab:null}),On=Pn[0],Cn=On.selectedMainNavigationTab,wn=On.selectedMainNavigationTabSub,_n=On.selectedSubTab,Sn=Pn[1],In=(0,s.useState)((0,ae.UA)([])),En=In[0],Tn=In[1],Mn=(0,s.useMemo)((function(){if(!(0,ge.Qr)(null===En||void 0===En?void 0:En.noParents)||!(0,ge.Qr)(null===En||void 0===En?void 0:En.parents)){var e,n,t,i;if(Cn)if(wn)e=null===En||void 0===En||null===(n=En.parents)||void 0===n||null===(t=n[Cn])||void 0===t?void 0:t[wn];else e=null===En||void 0===En||null===(i=En.noParents)||void 0===i?void 0:i[Cn];return(0,ce.C0)({addStreamConflicts:!!e})}return(0,ce.C0)()}),[Cn,wn,En]),Dn=(0,s.useCallback)((function(e){return e in ce.Pf?ce.Pf[e]:Mn}),[Mn]),Bn=(0,s.useCallback)((function(e){Sn((function(n){return function(e,n){var t=e||{},i=t.selectedMainNavigationTab,o=t.selectedMainNavigationTabSub,r=t.selectedSubTab,l=n||{},u=l.selectedMainNavigationTab,c=l.selectedMainNavigationTabSub,a=i in ce.Pf?ce.Pf[i]:Mn,s=r;if(ce.mU[i]||ce.mU[u]){var d,p,f;if(s){if(ce.mU[u]&&!ce.mU[i]){var v;!s||null!==Mn&&void 0!==Mn&&Mn.includes(s)||ce.tw.STREAM_CONFLICTS===s||(s=null===Mn||void 0===Mn||null===(v=Mn[0])||void 0===v?void 0:v.uuid)}}else s=null===a||void 0===a||null===(f=a[0])||void 0===f?void 0:f.uuid;i!==u&&Zn({});var h=(0,ae.zB)({parent_stream:c,stream:u,tap_stream_id:u},qe),m=(0,ae.zB)({parent_stream:o,stream:i,tap_stream_id:i},qe),b=(0,_e.jV)(Object.keys((null===h||void 0===h||null===(d=h.schema)||void 0===d?void 0:d.properties)||{}),Object.keys((null===m||void 0===m||null===(p=m.schema)||void 0===p?void 0:p.properties)||{}));Zn((function(e){return dn({},(0,ge.GL)(e,b||[]))}))}return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:o,selectedSubTab:s}}(e(n),n)}))}),[wn,Zn,qe,Mn]);(0,s.useEffect)((function(){Cn||Bn((function(e){var n,t,i=e.selectedSubTab;return{selectedMainNavigationTab:u||ce.uK.CONFIGURATION,selectedMainNavigationTabSub:a,selectedSubTab:u?f||(null===(n=Dn(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,a,f,Cn,Bn]);var Rn=(0,s.useMemo)((function(){return Dn(Cn)}),[Dn,Cn]),An=(0,s.useMemo)((function(){var e=[{Icon:K.JG,uuid:ce.uK.CONFIGURATION},{Icon:K.kO,uuid:ce.uK.STREAMS},{Icon:K.iA,uuid:ce.uK.OVERVIEW}].map((function(e){var n=e.Icon,t=e.uuid;return(0,w.jsx)(He.bC,{selected:Cn===t,children:(0,w.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return Bn((function(){return{selectedMainNavigationTab:t}}))},preventDefault:!0,children:(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(g.Z,{primaryLight:!0,size:4*O.iI,square:!0,children:(0,w.jsx)(n,{size:2*O.iI})}),(0,w.jsx)(Z.Z,{mr:2}),(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:ce.TD[t]})]})})})},t)})),n=(null===Ge||void 0===Ge?void 0:Ge.length)||0,t=[],i={};return null===Ge||void 0===Ge||Ge.forEach((function(e){var n=e.parent_stream;n?(null!==i&&void 0!==i&&i[n]||(i[n]=[]),i[n].push(e)):t.push(e)})),[{block:null,streams:t}].concat((0,o.Z)((0,_e.YC)(Object.entries(i),(function(e){var n=(0,r.Z)(e,2),t=n[0];n[1];return t})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return{block:null===ze||void 0===ze?void 0:ze[t],streams:i}})))).forEach((function(t){var i=t.block,o=t.streams;if(i){var r=null===i||void 0===i?void 0:i.uuid;e.push((0,w.jsx)(x.Z,{light:!0},"block-".concat(r,"-divider-top"))),e.push((0,w.jsx)(Z.Z,{px:O.cd,py:1,children:(0,w.jsx)(P.ZP,{bold:!0,color:(0,C.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}).accent,monospace:!0,small:!0,children:r})},"block-".concat(r)))}null===o||void 0===o||o.forEach((function(t,i){var o=(0,ae.M$)(t),r=(0,ae.Qu)(t),l=(0,ae.WD)(t),u=(0,ae.Z5)(t),c=Cn===o&&(!r||wn===r);e.push((0,w.jsx)(x.Z,{light:!0},"".concat(l,"-divider-top"))),e.push((0,w.jsx)(He.bC,{selected:c,children:(0,w.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){Bn((function(e){var n=e.selectedSubTab;return{selectedMainNavigationTab:o,selectedMainNavigationTabSub:r,selectedSubTab:n}}))},preventDefault:!0,children:(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(g.Z,{size:1*O.iI,success:u}),(0,w.jsx)(Z.Z,{mr:2}),(0,w.jsx)(j.Z,{flex:1,children:(0,w.jsx)(P.ZP,{default:!u,monospace:!0,children:o})})]})})})},l)),i===n-1&&e.push((0,w.jsx)(x.Z,{light:!0},"".concat(l,"-divider-last")))}))})),e}),[ze,Cn,wn,Bn,Ge]),Nn=(0,s.useState)(null),Ln=Nn[0],Fn=Nn[1],Un=(0,s.useMemo)((function(){return(0,ae.qf)(qe,(0,ae.UA)(Ln||[]))}),[qe,Ln]),Hn=(0,d.Db)(W.ZP.integration_sources.useUpdate(se),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.integration_source.streams;Fn(n)},onErrorCallback:function(e,n){return en({errors:n,response:e})}})}}),zn=(0,r.Z)(Hn,2),Wn=zn[0],Kn=zn[1].isLoading,Gn=(0,s.useCallback)((function(){return Wn({integration_source:{block_uuid:xe}})}),[xe,Wn]),Vn=(0,s.useState)(null),qn=Vn[0],Yn=Vn[1],Qn=(0,s.useMemo)((function(){return(0,w.jsxs)("div",{ref:N,children:[(null===Rn||void 0===Rn?void 0:Rn.length)>=1&&(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsx)(M.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return Bn((function(e){return dn(dn({},e),{},{selectedSubTab:n})}))},regularSizeText:!0,selectedTabUUID:_n,tabs:Rn})}),!(null!==Rn&&void 0!==Rn&&Rn.length)&&ce.uK.STREAMS===Cn&&(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(j.Z,{flex:1,children:(0,w.jsx)(z.Z,{beforeIcon:(0,w.jsx)(K.HN,{muted:!(null!==qn&&void 0!==qn&&qn.length),size:2*O.iI}),fullWidth:!0,noBackground:!0,noBorder:!0,noBorderRadiusBottom:!0,noBorderRadiusTop:!0,onChange:function(e){var n;return Yn(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},paddingHorizontal:O.iI*O.cd,paddingVertical:O.iI*O.cd,placeholder:"Type the name of the stream to filter...",value:qn||""})}),(null===qn||void 0===qn?void 0:qn.length)>=1&&(0,w.jsx)(T.ZP,{iconOnly:!0,noPadding:!0,noBackground:!0,noBorder:!0,onClick:function(){return Yn(null)},children:(0,w.jsx)(K.x8,{default:!0,size:2*O.iI})}),!Un&&(0,w.jsx)(Z.Z,{px:O.cd,children:(0,w.jsx)(T.ZP,{beforeIcon:(0,w.jsx)(K.rH,{size:2*O.iI}),compact:!0,loading:Kn,onClick:function(){return Gn()},primary:!0,children:"Fetch streams"})})]}),(0,w.jsx)(x.Z,{light:!0})]})}),[xe,Gn,Kn,Un,N,qn,Cn,_n,Yn,Rn]),Xn=(0,s.useMemo)((function(){return ie-2*He.UF}),[ie]),Jn=(0,s.useMemo)((function(){return oe-2*He.UF}),[oe]),$n=(0,s.useState)(null),et=$n[0],nt=$n[1],tt=(0,s.useState)(null),it=tt[0],ot=tt[1],rt=(0,s.useState)(null),lt=(rt[0],rt[1]),ut=(0,s.useState)(!1),ct=ut[0],at=ut[1];(0,s.useEffect)((function(){var e,n,t,i,o,r;(Cn||_n)&&(nt(null===N||void 0===N||null===(e=N.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),lt(null===R||void 0===R||null===(t=R.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height),ot(null===A||void 0===A||null===(o=A.current)||void 0===o||null===(r=o.getBoundingClientRect())||void 0===r?void 0:r.height))}),[A,R,N,Cn,_n]);var st=(0,d.Db)(W.ZP.blocks.pipelines.useUpdate(se,encodeURIComponent(xe)),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){null===S||void 0===S||S(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return en({errors:n,response:e})}})}}),dt=(0,r.Z)(st,2),pt=(dt[0],dt[1].isLoading,(0,s.useMemo)((function(){return Cn&&![ce.uK.CONFIGURATION,ce.uK.OVERVIEW,ce.uK.STREAMS,ce.uK.SYNC].includes(Cn)}),[Cn])),ft=(0,s.useMemo)((function(){return pt&&ce.tw.SETTINGS===_n}),[pt,_n]),vt=(0,s.useMemo)((function(){return ce.uK.CONFIGURATION===Cn&&ce.tw.CREDENTIALS===_n}),[Cn,_n]),ht=(0,s.useMemo)((function(){return ce.uK.OVERVIEW===Cn}),[Cn]),mt=(0,s.useMemo)((function(){return!(vt||ft||ht&&(null===Ge||void 0===Ge?void 0:Ge.length)>=1)||ct}),[ct,vt,ft,ht,Cn,_n,Ge]),bt=(0,s.useMemo)((function(){var e=(0,ae.zB)({parent_stream:wn,stream:Cn,tap_stream_id:Cn},qe);if(e)return(0,w.jsx)(Ue,{block:Ze,blocksMapping:ze,height:Xn-et-2*O.iI,highlightedColumnsMapping:kn,onChangeBlock:v,pipeline:I,selectedSubTab:_n,setBlockAttributes:Pe,setHighlightedColumnsMapping:Zn,setSelectedSubTab:function(e){return Bn((function(n){return dn(dn({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Tn,showError:en,stream:e,streamMapping:qe,streamsMappingConflicts:En,updateStreamsInCatalog:Le})}),[Ze,ze,et,Xn,kn,v,I,Cn,wn,_n,Pe,Zn,Bn,Tn,en,qe,En,Le]),gt=(0,s.useState)(null),xt=gt[0],jt=gt[1];(0,s.useEffect)((function(){"undefined"!==typeof xt&&null!==xt||jt("undefined"!==typeof he&&null!==he?he:Ce)}),[Ce,he,xt,jt]);var yt=(0,s.useState)(null),kt=yt[0],Zt=yt[1],Pt=(0,s.useMemo)((function(){return(0,w.jsx)(pe,{block:Ze,blockConfigString:kt,blockContent:xt,blockUpstreamBlocks:We,dataIntegrationConfiguration:Re,onChangeCodeBlock:m,pipeline:I,savePipelineContent:E,setBlockConfigString:Zt,setBlockContent:jt,setContent:D,setSelectedSubTab:function(e){return Bn((function(n){return dn(dn({},n),{},{selectedSubTab:e})}))},showError:en})}),[Ze,kt,xt,We,Re,m,I,E,Zt,jt,D,Bn,en]),Ot=(0,s.useMemo)((function(){if(ce.uK.CONFIGURATION===Cn){if(ce.tw.UPSTREAM_BLOCK_SETTINGS===_n){var e=null===We||void 0===We?void 0:We.map((function(e){var n,t,i=e.uuid,o=null===Re||void 0===Re||null===(n=Re.inputs)||void 0===n?void 0:n[i],r=(null===o||void 0===o?void 0:o.streams)||[],u=!!o,c=null===ze||void 0===ze?void 0:ze[i],a=(null===c||void 0===c?void 0:c.catalog)?null===(t=(0,ae.Uc)(c))||void 0===t?void 0:t.map((function(e){var n=e.stream,t=e.tap_stream_id;return n||t})):[i],s=1===(null===a||void 0===a?void 0:a.length)&&(null===a||void 0===a?void 0:a.includes(i));return(0,w.jsxs)("div",{children:[(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(j.Z,{children:(0,w.jsx)(P.ZP,{bold:!0,large:!0,monospace:!0,muted:!u,children:i})}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(ke.Z,{checked:u,compact:!0,onCheck:function(e){Ne((function(n){return e(u)?dn(dn({},n),{},(0,l.Z)({},i,{})):(0,ge.gR)(n,[i])}))}})]}),u&&(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsxs)(ve.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,w.jsx)(ve.g,{noBorder:!0,children:(0,w.jsxs)(y.ZP,dn(dn({},y.A0),{},{children:[(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsx)(P.ZP,{bold:!0,default:!0,children:"Use catalog as an input"}),(0,w.jsx)(P.ZP,{muted:!0,small:!0,children:"If checked, then this block\u2019s catalog will be included as part of the input argument(s) for the current block."})]}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(b.Z,{checked:null===o||void 0===o?void 0:o.catalog,onClick:function(){return Ne((function(e){var n;return dn(dn({},e),{},(0,l.Z)({},i,dn(dn({},null===e||void 0===e?void 0:e[i]),{},{catalog:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.catalog)})))}))}})]}))}),s&&(0,w.jsx)(ve.g,{noBorder:!0,children:(0,w.jsxs)(y.ZP,dn(dn({},y.A0),{},{children:[(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsx)(P.ZP,{bold:!0,default:!0,children:"Use the block\u2019s output data as an input"}),(0,w.jsx)(P.ZP,{muted:!0,small:!0,children:"Include this block\u2019s output data as an input."})]}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(b.Z,{checked:null===r||void 0===r?void 0:r.includes(i),monospace:!0,onClick:function(){return Ne((function(e){return dn(dn({},e),{},(0,l.Z)({},i,dn(dn({},null===e||void 0===e?void 0:e[i]),{},{streams:null!==r&&void 0!==r&&r.includes(i)?(0,_e.Od)(r,(function(e){return e===i})):r.concat(i)})))}))},small:!0})]}))}),!s&&(0,w.jsxs)(ve.g,{noBorder:!0,children:[(0,w.jsxs)(y.ZP,dn(dn({},y.A0),{},{children:[(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsx)(P.ZP,{bold:!0,default:!0,children:"Select which stream\u2019s data to use as an input"}),(0,w.jsxs)(P.ZP,{muted:!0,small:!0,children:["Only the output data from the selected streams will be used as an input.",(0,w.jsx)("br",{}),"If none are selected, then no output data from any stream from this block will be used as in input.",(0,w.jsx)("br",{}),"If you don\u2019t see a stream here, then the upstream block may have unselected the stream in its stream settings."]})]}),(0,w.jsx)(Z.Z,{mr:3})]})),null===a||void 0===a?void 0:a.map((function(e){var n=null===r||void 0===r?void 0:r.includes(e);return(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(y.ZP,dn(dn({},y.A0),{},{children:[(0,w.jsx)(j.Z,{children:(0,w.jsx)(P.ZP,{default:!0,monospace:!0,small:!0,children:e})}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(b.Z,{checked:n,onClick:function(){return Ne((function(t){return dn(dn({},t),{},(0,l.Z)({},i,dn(dn({},null===t||void 0===t?void 0:t[i]),{},{streams:n?(0,_e.Od)(r,(function(n){return n===e})):r.concat(e)})))}))},small:!0})]}))},e)}))]}),(0,w.jsx)(ve.g,{noBorder:!0,children:(0,w.jsxs)(y.ZP,dn(dn({},y.A0),{},{children:[(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsx)(P.ZP,{bold:!0,default:!0,children:"Only use this block\u2019s output data as an input"}),(0,w.jsxs)(P.ZP,{muted:!0,small:!0,children:["If checked, then this block\u2019s output data is only used as inputs.",h.tf.DATA_EXPORTER===be&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("br",{}),"The block\u2019s output data won\u2019t be ingested when running a sync, regardless if it\u2019s enabled in the settings."]})]})]}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(b.Z,{checked:!(null===o||void 0===o||!o.input_only),onClick:function(){return Ne((function(e){var n;return dn(dn({},e),{},(0,l.Z)({},i,dn(dn({},null===e||void 0===e?void 0:e[i]),{},{input_only:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.input_only)})))}))}})]}))})]})})]}),(0,w.jsx)(x.Z,{light:!0})]},i)}));return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsx)(re.Z,{children:"Inputs"}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:["Choose which upstream block to use as inputs when interpolating data into ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,children:xe}),"\u2019s (current block) credentials (aka config) and decorated functions."]})}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:["If ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,children:xe})," (current block) doesn\u2019t require the data from an upstream block to interpolate or as arguments for decorated functions, don\u2019t toggle them on because it\u2019ll save time and data by not loading unnecessary data as inputs."]})}),V.O.DESTINATIONS===je&&(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:["Upstream blocks can still be selected to have its data ingested. This is toggled and configured in the ",(0,w.jsx)(k.Z,{bold:!0,primary:!0,preventDefault:!0,onClick:function(){return Bn((function(){return{selectedMainNavigationTab:ce.uK.STREAMS}}))},children:"Streams"})," section."]})})]}),(0,w.jsx)(x.Z,{light:!0}),e]})}}else{if(ce.uK.STREAMS===Cn&&Un)return(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsx)(re.Z,{children:"Fetch streams to start set up"}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:["Add streams and configure them by first fetching the available streams from ",Me,"."]})})]}),(0,w.jsx)(T.ZP,{beforeIcon:(0,w.jsx)(K.rH,{size:2*O.iI}),large:!0,loading:Kn,onClick:function(){return Gn()},primary:!0,children:"Fetch streams"})]});if(ce.uK.SYNC===Cn)return(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsx)(P.ZP,{children:"Coming soon"})});if(ce.uK.OVERVIEW===Cn)return(0,w.jsx)(ln,{block:Ze,blocksMapping:ze,onChangeBlock:v,selectedStreamMapping:q,setSelectedMainNavigationTab:function(e){return Bn((function(n){return{selectedMainNavigationTab:e}}))},setSelectedStreamMapping:Y,streamMapping:qe,updateStreamsInCatalog:Le})}}),[Ze,me,be,xe,We,ze,Re,je,Me,Gn,Kn,Un,v,se,Cn,wn,q,_n,Ne,Bn,Y,qe,Le]),Ct=(0,s.useMemo)((function(){return vt?(0,w.jsx)(P.ZP,{bold:!0,children:"Documentation"}):ft?(0,w.jsx)(P.ZP,{bold:!0,children:"Bulk edit stream properties"}):ht?(0,w.jsx)(P.ZP,{bold:!0,children:"Bulk edit streams"}):void 0}),[vt,ft,ht]),wt=(0,s.useMemo)((function(){if(ft||ht)return(0,w.jsx)(He.Tr,{ref:A,children:(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(b.Z,{checked:$,label:"Clear selection and values after applying changes",onClick:function(){return ee((function(e){return!e}))}})}),(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(T.ZP,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};ft?e=(0,ae.Kq)(q,kn,F):ht&&(e=(0,ae.bX)(q,F)),Le((0,ae.eH)(e),(function(e){return null===v||void 0===v?void 0:v(e)})),$&&(U({}),Zn({}),Y(null))},primary:!0,children:"Apply bulk changes"}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(T.ZP,{fullWidth:!0,onClick:function(){U({}),Zn({}),Y(null)},secondary:!0,children:"Clear"})]})]})})}),[F,$,kn,ft,ht,v,A,q,U,Zn,Y]),_t=(0,s.useMemo)((function(){if(vt)return(0,w.jsx)(He.yh,{children:(0,w.jsxs)(Z.Z,{p:O.cd,children:[!Be&&(0,w.jsx)(H.Z,{}),Ke&&(0,w.jsx)(fe.Z,{children:Ke.replace(/\<br \/\>/g,"\n\n")})]})});if(ft){var e=(0,ae.zB)({parent_stream:wn,stream:Cn,tap_stream_id:Cn},qe);return(0,w.jsx)(nn,{attributesMapping:F,block:Ze,blocksMapping:ze,highlightedColumnsMapping:kn,selectedStreamMapping:q,setAttributesMapping:U,setHighlightedColumnsMapping:Zn,setSelectedStreamMapping:Y,stream:e,streamMapping:qe,updateStreamsInCatalog:Le})}return ht?(0,w.jsx)(Je,{attributesMapping:F,selectedStreamMapping:q,setAttributesMapping:U,setSelectedStreamMapping:Y,streamMapping:qe}):void 0}),[F,Ze,ze,Be,Ke,kn,vt,ft,ht,q,U,Zn,Y,qe,Le]),St=(0,s.useMemo)((function(){var e=[{label:function(){return xe}}];return Ee&&e.push({bold:!Cn,label:function(){return Ee}}),Cn&&e.push({bold:!0,label:function(){return ce.TD[Cn]||Cn}}),(0,w.jsx)(te.Z,{breadcrumbs:e,noMarginLeft:!0})}),[xe,Ee,Cn]),It=(0,s.useMemo)((function(){return(ie-Xn-pn)/2}),[Xn,ie]),Et=(0,s.useMemo)((function(){return(0,w.jsx)(Ve,{block:Ze,blocksMapping:ze,height:Xn-et,onChangeBlock:v,searchText:qn,setSelectedMainNavigationTab:Bn,setSelectedSubTab:function(e){return Bn((function(n){return dn(dn({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Tn,streamsFetched:Ln,updateStreamsInCatalog:Le,width:Jn-(mn+(mt?0:on))})}),[mt,on,mn,Ze,ze,et,Xn,v,qn,Bn,Tn,Ln,Le,Jn]);return(0,w.jsxs)(He.Nk,{maxWidth:Jn,children:[(0,w.jsx)(He.I5,{children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(j.Z,{children:St}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(k.Z,{href:"https://docs.mage.ai",inline:!0,noOutline:!0,openNewWindow:!0,children:(0,w.jsx)(K.$l,{default:!0,size:2*O.iI})}),(0,w.jsx)(Z.Z,{mr:2}),_&&(0,w.jsx)(T.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){null===_||void 0===_||_()},children:(0,w.jsx)(K.x8,{default:!0,size:2*O.iI})})]})]})}),(0,w.jsxs)(un.Z,{after:_t,afterFooter:wt,afterFooterBottomOffset:It,afterHeader:(0,w.jsx)(Z.Z,{ref:R,px:1,children:Ct}),afterHeightOffset:0,afterHeaderOffset:0,afterHidden:mt,afterInnerHeightMinus:48+(wt&&it||0),afterMousedownActive:fn,afterWidth:on,before:An,beforeHeightOffset:0,beforeMousedownActive:xn,beforeWidth:mn,contained:!0,headerOffset:et,height:Xn,hideAfterCompletely:!_t||ht&&!(null!==Ge&&void 0!==Ge&&Ge.length),inline:!0,mainContainerHeader:Qn,mainContainerRef:B,setAfterHidden:at,setAfterMousedownActive:vn,setAfterWidth:rn,setBeforeMousedownActive:jn,setBeforeWidth:bn,uuid:Ye,children:[pt&&bt,!pt&&Ot,ce.uK.CONFIGURATION===Cn&&ce.tw.CREDENTIALS===_n&&Pt,ce.uK.STREAMS===Cn&&!Un&&Et]})]})},vn=t(10553),hn=t(29618),mn=t(50724),bn=t(70374),gn=t(72098),xn=t(77497),jn=t(39643),yn=t(87848),kn=t(58325),Zn=t(44688);function Pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function On(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Cn=1.5*O.iI;var wn,_n,Sn=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,o=e.executePipeline,r=e.interruptKernel,u=e.isPipelineExecuting,c=e.kernel,a=e.pipeline,d=e.restartKernel,p=e.savePipelineContent,f=e.scrollTogether,v=(e.setActiveSidekickView,e.setMessages),h=e.setScrollTogether,m=e.setSideBySideEnabled,b=e.sideBySideEnabled,g=e.updatePipelineMetadata,x=(0,s.useState)(null),j=x[0],k=x[1],O=(0,s.useRef)(null),C=(0,s.useRef)(null),_=(0,s.useRef)(null),S=(0,s.useRef)(null),I=(0,s.useRef)(null),E=(0,xn.Z)(),T=E.featureEnabled,M=E.featureUUIDs,D=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,Q.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,Q.Y6)(),type:F.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,kn.V5)()?jn.RJ:jn.hE,jn.SS]],label:function(){return"Save pipeline"},onClick:function(){return p()},uuid:"save_pipeline"}],B=(0,s.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[jn.kA],[jn.kA]],onClick:function(){return r()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[jn.t_[jn.OC]],[jn.t_[jn.OC]]],onClick:function(){return d()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return v((function(e){return Object.keys(e).reduce((function(e,n){return On(On({},e),{},(0,l.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return u?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):(null===a||void 0===a?void 0:a.type)===F.qL.STREAMING&&e.push({label:function(){return"Execute pipeline"},onClick:function(){return o()},uuid:"Execute pipeline"}),e}),[n,o,r,u,null===a||void 0===a?void 0:a.type,d,v]),R=(0,s.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===a||void 0===a?void 0:a.uuid,"/settings"),href:"/pipelines/[pipeline]/settings"},uuid:"Pipeline settings"},{label:function(){return"Browse custom templates"},linkProps:{href:"/templates"},uuid:"browse_custom_templates"},{label:function(){return"Create custom templates"},linkProps:{href:"/templates?new=1"},uuid:"create_custom_templates"}]}),[a]),A=(0,s.useMemo)((function(){return[{label:function(){return(0,w.jsxs)(y.ZP,{alignItems:"center",children:[b?(0,w.jsx)(K.Jr,{}):(0,w.jsx)("div",{style:{width:Cn}}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(P.ZP,{noWrapping:!0,children:"Show output next to code (beta)"})]})},onClick:function(){m(!b)},uuid:"Show output next to code"},{disabled:!b,label:function(){return(0,w.jsxs)(y.ZP,{alignItems:"center",children:[f?(0,w.jsx)(K.Jr,{}):(0,w.jsx)("div",{style:{width:Cn}}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(P.ZP,{disabled:!b,noWrapping:!0,children:"Scroll output alongside code (beta)"})]})},onClick:function(){return h(!f)},uuid:"Scroll output alongside code"}]}),[f,h,m,b]),N=(0,s.useMemo)((function(){var e=[{label:function(){return"Open compute management"},linkProps:{href:"/compute"},uuid:"Open compute management"}];return gn.U.PYTHON3===(null===c||void 0===c?void 0:c.name)?e.push({label:function(){return"Switch to PySpark kernel"},onClick:function(){return null===g||void 0===g?void 0:g(null===a||void 0===a?void 0:a.name,F.fj[gn.U.PYSPARK])},uuid:"Switch to PySpark kernel"}):gn.U.PYSPARK===(null===c||void 0===c?void 0:c.name)&&e.push({label:function(){return"Switch to Python kernel"},onClick:function(){return null===g||void 0===g?void 0:g(null===a||void 0===a?void 0:a.name,F.fj[gn.U.PYTHON3])},uuid:"Switch to Python kernel"}),e}),[c,a,g]),L="FileHeaderMenu/index",U=(0,Zn.y)(),H=U.registerOnKeyDown,z=U.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){z(L)}}),[z,L]),H(L,(function(e,n,t){null!==j&&(n[jn.QK]?k((function(e){return 0===e?2:e-1})):n[jn.DY]&&k((function(e){return 2===e?0:e+1})))}),[j,k]),(0,w.jsx)(mn.Z,{onClickOutside:function(){return k(null)},open:!0,style:{position:"relative"},children:(0,w.jsxs)(y.ZP,{children:[(0,w.jsxs)("div",{style:{position:"relative"},children:[(0,w.jsx)(yn.u,{highlighted:0===j,onClick:function(){return k((function(e){return 0===e?null:0}))},onMouseEnter:function(){return k((function(e){return null!==e?0:null}))},ref:O,children:(0,w.jsx)(P.ZP,{children:"File"})}),(0,w.jsx)(bn.Z,{items:D,onClickCallback:function(){return k(null)},open:0===j,parentRef:O,uuid:"FileHeaderMenu/file_items"})]}),(0,w.jsxs)("div",{style:{position:"relative"},children:[(0,w.jsx)(yn.u,{highlighted:1===j,onClick:function(){return k((function(e){return 1===e?null:1}))},onMouseEnter:function(){return k((function(e){return null!==e?1:null}))},ref:C,children:(0,w.jsx)(P.ZP,{children:"Run"})}),(0,w.jsx)(bn.Z,{items:B,onClickCallback:function(){return k(null)},open:1===j,parentRef:C,uuid:"FileHeaderMenu/run_items"})]}),(0,w.jsxs)("div",{style:{position:"relative"},children:[(0,w.jsx)(yn.u,{highlighted:2===j,onClick:function(){return k((function(e){return 2===e?null:2}))},onMouseEnter:function(){return k((function(e){return null!==e?2:null}))},ref:_,children:(0,w.jsx)(P.ZP,{children:"Edit"})}),(0,w.jsx)(bn.Z,{items:R,onClickCallback:function(){return k(null)},open:2===j,parentRef:_,uuid:"FileHeaderMenu/edit_items"})]}),F.qL.INTEGRATION!==(null===a||void 0===a?void 0:a.type)&&(null===T||void 0===T?void 0:T(M.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&(0,w.jsxs)("div",{style:{position:"relative"},children:[(0,w.jsx)(yn.u,{highlighted:3===j,onClick:function(){return k((function(e){return 3===e?null:3}))},onMouseEnter:function(){return k((function(e){return null!==e?3:null}))},ref:S,children:(0,w.jsx)(P.ZP,{children:"View"})}),(0,w.jsx)(bn.Z,{items:A,onClickCallback:function(){return k(null)},open:3===j,parentRef:S,uuid:"FileHeaderMenu/viewItems"})]}),(null===T||void 0===T?void 0:T(M.COMPUTE_MANAGEMENT))&&(0,w.jsxs)("div",{style:{position:"relative"},children:[(0,w.jsx)(yn.u,{highlighted:4===j,onClick:function(){return k((function(e){return 4===e?null:4}))},onMouseEnter:function(){return k((function(e){return null!==e?4:null}))},ref:I,children:(0,w.jsx)(P.ZP,{children:"Compute"})}),(0,w.jsx)(bn.Z,{items:N,onClickCallback:function(){return k(null)},open:4===j,parentRef:I,uuid:"FileHeaderMenu/viewItems"})]}),t]})})},In=t(90758),En=t(89706),Tn=t(67355),Mn=t(70613);!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(wn||(wn={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(_n||(_n={}));var Dn,Bn=t(16756),Rn=t(89515),An=t(98464);!function(e){e.EMR="emr"}(Dn||(Dn={}));var Nn=t(97133),Ln=t(15610),Fn=t(89538);var Un=function(e){var n=e.children,t=(e.filePaths,e.filesTouched,e.isBusy),i=e.kernel,l=e.pipeline,u=(e.restartKernel,e.savePipelineContent,e.saveStatus),c=e.selectedFilePath,a=e.setErrors,f=e.setRunningBlocks,v=e.setSideBySideEnabled,h=e.sideBySideEnabled,b=e.updatePipelineMetadata,x=(0,p.useRouter)(),C=(0,xn.Z)(),_=C.featureEnabled,S=C.featureUUIDs,I=null===_||void 0===_?void 0:_(S.COMPUTE_MANAGEMENT),E=(0,s.useContext)(m.ThemeContext),M=i||{},D=M.alive,B=M.usage,R=(0,s.useState)(!1),A=R[0],L=R[1],U=(0,s.useState)(""),z=U[0],G=U[1],V=(0,s.useState)(Dn.EMR),q=V[0],Y=(V[1],(0,s.useState)(!1)),J=Y[0],$=Y[1],ee=(0,s.useState)(!1),ne=ee[0],te=ee[1],ie=(0,s.useRef)(null),oe=W.ZP.clusters.detail(q,{},{revalidateOnFocus:!1}),re=oe.data,le=oe.mutate,ue=(0,s.useMemo)((function(){var e;return(null===re||void 0===re||null===(e=re.cluster)||void 0===e?void 0:e.clusters)||[]}),[re]),ce=(0,s.useMemo)((function(){return(0,_e.sE)(ue,(function(e){return e.is_active}))}),[ue]),ae=(0,d.Db)(W.ZP.clusters.useUpdate(q),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){le()},onErrorCallback:function(e,n){return a({errors:n,response:e})}})}}),se=(0,r.Z)(ae,1)[0],de=W.ZP.spark_applications.list({},{},{pauseFetch:!I}).data,pe=(0,s.useMemo)((function(){return null===de||void 0===de?void 0:de.spark_applications}),[de]);(0,s.useEffect)((function(){null!==l&&void 0!==l&&l.uuid&&G(l.uuid)}),[null===l||void 0===l?void 0:l.uuid]);var fe="KernelStatus",ve=(0,Zn.y)(),he=ve.registerOnKeyDown,me=ve.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){me(fe)}}),[me,fe]),he(fe,(function(e,n,t){A&&String(t[0])===String(jn.Uq)&&String(t[1])!==String(jn.zX)&&((null===l||void 0===l?void 0:l.uuid)===z?e.target.blur():(b(z),L(!1)))}),[A,z,L,b]);var be=(0,s.useMemo)((function(){return null===B||void 0===B?void 0:B.pid}),[null===B||void 0===B?void 0:B.pid]),ge=(0,An.Z)(be),xe=(0,s.useMemo)((function(){if(null!==B&&void 0!==B&&B.kernel_memory){var e=B.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===B||void 0===B?void 0:B.kernel_memory]),je=(0,Fn.dd)((function(){return(0,w.jsx)(Rn.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:Pe,onClick:function(){(0,cn.t8)(cn.DU,1),Pe()},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*O.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),ye=(0,r.Z)(je,2),ke=ye[0],Pe=ye[1];(0,s.useEffect)((function(){var e=(0,cn.U2)(cn.DU,0);be!==ge&&t&&!e&&(ke(),f([]))}),[t,be,ge,f,ke]);var Ce=(0,s.useMemo)((function(){return[F.qL.PYTHON,F.qL.PYSPARK].includes(null===l||void 0===l?void 0:l.type)}),[l]),we=(0,s.useMemo)((function(){return(0,w.jsx)(g.Z,{color:t?(E||Oe.Z).borders.info:D?(E||Oe.Z).borders.success:(E||Oe.Z).borders.danger,size:O.iI})}),[D,t,E]),Se=(0,s.useMemo)((function(){if(I&&Ce){if(!de)return"Loading compute";if(null===pe||void 0===pe||!pe.length)return"Compute unavailable";if((null===pe||void 0===pe?void 0:pe.length)>=1){var e,n,t=null===pe||void 0===pe?void 0:pe[0];return[null===t||void 0===t?void 0:t.name,null===t||void 0===t||null===(e=t.attempts)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.app_spark_version].filter((function(e){return e})).join(" ")}}}),[I,de,l,pe,Ce]),Ie=(0,s.useMemo)((function(){return I&&Ce?(de?null!==pe&&void 0!==pe&&pe.length||(e=(0,w.jsx)(K.Fs,{danger:!0})):e=(0,w.jsx)(H.Z,{inverted:!0,small:!0}),(0,w.jsx)(N.ZP,{beforeElement:e,blackBorder:!0,compact:!0,inline:!0,noHover:!de||(null===pe||void 0===pe?void 0:pe.length)>=1,onClick:!de||null!==pe&&void 0!==pe&&pe.length?null:function(){return x.push("/compute")},uuid:"Pipeline/KernelStatus/kernel",children:Se})):null;var e}),[I,de,Se,x,pe,Ce]),Ee=(0,s.useMemo)((function(){return(0,w.jsx)("div",{ref:ie,style:{position:"relative"},children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(null===l||void 0===l?void 0:l.type)===F.qL.PYSPARK&&(0,w.jsxs)(Z.Z,{mr:O.cd,children:[(0,w.jsxs)(k.Z,{muted:!!ce,onClick:function(){return $(!0)},preventDefault:!0,sameColorAsText:!ce,underline:!ce,children:[ce&&ce.id,!ce&&"Select cluster"]}),(0,w.jsx)(mn.Z,{disableEscape:!0,onClickOutside:function(){return $(!1)},open:J,children:(0,w.jsx)(bn.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,o.Z)(ue.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,w.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,w.jsx)(j.Z,{flex:1,children:(0,w.jsx)(P.ZP,{muted:!t&&_n.WAITING!==i,children:n})}),t&&(0,w.jsx)(K.Jr,{size:2*O.iI,success:!0}),!t&&(0,w.jsx)(P.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||_n.WAITING!==i?null:function(){return se({cluster:{id:n}})},uuid:n}})))),onClickCallback:function(){return $(!1)},open:J,parentRef:ie,uuid:"KernelStatus/select_cluster",width:40*O.iI})})]}),(0,w.jsx)(N.ZP,{beforeElement:we,blackBorder:!0,compact:!0,inline:!0,onClick:function(){return te(!0)},uuid:"Pipeline/KernelStatus/kernel",children:F.RH[(null===l||void 0===l?void 0:l.type)||F.qL.PYTHON]}),(0,w.jsx)(mn.Z,{disableEscape:!0,onClickOutside:function(){return te(!1)},open:ne,children:(0,w.jsx)(bn.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,o.Z)(Object.keys(F.a_).filter((function(e){return(null===l||void 0===l?void 0:l.type)!=e})).map((function(e){return{label:function(){return F.RH[e]||e},onClick:function(){return b(null===l||void 0===l?void 0:l.name,e)},uuid:e}})))),onClickCallback:function(){return te(!1)},open:ne,parentRef:ie,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*O.iI})})]})})}),[D,ue,t,l,ce,$,te,J,ne,we,E,se,b]);return(0,w.jsx)(Nn.rK,{relativePosition:!0,children:(0,w.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,w.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:[(0,w.jsxs)(Z.Z,{px:O.cd,children:[c&&(0,w.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:c?function(){return(0,Ln.u7)({file_path:null})}:null,preventDefault:!0,children:n}),!c&&(0,w.jsxs)(y.ZP,{alignItems:"center",children:[n,A&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{ml:1}),(0,w.jsx)(k.Z,{onClick:function(){b(z),L(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]}),B&&(0,w.jsx)(Z.Z,{mr:O.cd,children:(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsxs)(P.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["CPU: ","undefined"!==typeof(null===B||void 0===B?void 0:B.kernel_cpu)&&(0,Q.QV)(null===B||void 0===B?void 0:B.kernel_cpu,3),"undefined"!==typeof(null===B||void 0===B?void 0:B.kernel_cpu)&&"%"]}),(0,w.jsxs)(P.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["Memory: ",xe]})]})})]}),F.qL.INTEGRATION!==(null===l||void 0===l?void 0:l.type)&&(null===_||void 0===_?void 0:_(S.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&(0,w.jsx)(Nn.TZ,{children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(Ze.Z,{block:!0,center:!0,description:(0,w.jsx)(P.ZP,{children:"Display the output of a block underneath the block\u2019s code."}),size:null,children:(0,w.jsx)(T.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return v(!1)},padding:"".concat(1*O.iI,"px"),children:(0,w.jsx)(K.vR,{muted:h,size:2*O.iI})})}),(0,w.jsx)(Ze.Z,{block:!0,center:!0,description:(0,w.jsx)(P.ZP,{children:"Display the output of a block on the right side of the block\u2019s code."}),size:null,children:(0,w.jsx)(T.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return v(!0)},padding:"".concat(1*O.iI,"px"),children:(0,w.jsx)(K.lx,{muted:!h,size:2*O.iI})})})]})}),(0,w.jsx)(Z.Z,{px:O.cd,children:(0,w.jsxs)(j.Z,{alignItems:"center",children:[(0,w.jsx)(Ze.Z,{appearBefore:!0,block:!0,description:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,w.jsx)(Bn.Z,{inline:!0,keyText:(0,kn.V5)()?jn.RJ:jn.hE}),"\xa0",(0,w.jsx)(P.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,w.jsx)(Bn.Z,{inline:!0,keyText:jn.SS}),"\xa0",(0,w.jsx)(P.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,w.jsx)("br",{})]}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:["Or, go to ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,w.jsx)(P.ZP,{muted:!0,children:u})}),(0,w.jsx)(Z.Z,{ml:2}),(0,w.jsxs)(y.ZP,{alignItems:"center",children:[Ee,Ie&&(0,w.jsx)(Z.Z,{ml:1,children:Ie})]})]})})]})})},Hn=t(48339),zn=t(65956),Wn=t(17717),Kn=t(12691),Gn=t.n(Kn),Vn=t(65976),qn=t(57271),Yn=t(92709),Qn=t(47041),Xn=m.default.div.withConfig({displayName:"indexstyle__ScrollbarContainerStyle",componentId:"sc-174iy66-0"})(["position:fixed;"," "," "," ",""],(function(e){return"\n border-radius: ".concat(Ce.n_,"px;\n background: ").concat((e.theme.background||Oe.Z.background).scrollbarTrack,";\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Qn.nn,"px;\n ")}),(function(e){return"undefined"!==typeof e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return"undefined"!==typeof e.left&&"\n left: ".concat(e.left,"px;\n ")})),Jn=m.default.div.withConfig({displayName:"indexstyle__ScrollCursorStyle",componentId:"sc-174iy66-1"})(["position:fixed;z-index:3;"," "," "," "," ",""],(function(e){return"\n border-radius: ".concat(Ce.TR,"px;\n background: ").concat((e.theme.background||Oe.Z.background).scrollbarThumb,";\n\n &:hover {\n background: ").concat((e.theme.background||Oe.Z.background).scrollbarThumbHover,";\n }\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Qn.nn,"px;\n ")}),(function(e){return(null===e||void 0===e?void 0:e.selected)&&"\n background: ".concat((e.theme.background||Oe.Z.background).scrollbarThumbHover,";\n ")}),(function(e){return"undefined"!==typeof e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return"undefined"!==typeof e.top&&"\n top: ".concat(e.top,"px;\n ")})),$n=t(74052),et=t(61709);function nt(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 tt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var it=function(e){var n,t,i=e.blocks,r=e.columnIndex,l=e.columns,u=e.disabled,c=e.eventNameRefsMapping,a=e.invisible,d=e.mainContainerRect,p=e.rightAligned,f=e.scrollTogether,v=e.setCursorHeight,h=(0,s.useRef)(null),m=(0,s.useRef)(null),b=((0,s.useMemo)((function(){return null===i||void 0===i?void 0:i.map((function(e){return e.uuid}))}),[i]),(0,s.useState)(null)),g=b[0],x=b[1],j=(0,s.useState)(null),y=j[0],k=j[1],Z=(0,s.useState)(null),P=(Z[0],Z[1]),O=(0,s.useState)(null),C=O[0],_=O[1],S=d||{},I=S.height,E=S.width,T=S.x,M=S.y,D=(0,s.useMemo)((function(){return(0,_e.Sm)(g||[])}),[g]),B=(0,s.useCallback)((function(){return D>I?I*(I/D):0}),[I,D]),R=(0,s.useMemo)((function(){return B()}),[B]);(0,s.useMemo)((function(){v(R)}),[R,v]);var A=(0,s.useCallback)((function(e){if(R){var n,t,i=null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y;e<=i?e=i:e+R>=M+I&&(e=M+I-R),null!==h&&void 0!==h&&h.current&&(h.current.style.top="".concat(e,"px"))}}),[R,I,h,M]),N=(0,s.useCallback)((function(){if(!u){var e=new CustomEvent(Yn.m$,{detail:{columnScrolling:r,refCursor:h,refCursorContainer:m,refsMappings:Object.values(c||{})}});window.dispatchEvent(e)}}),[r,u,c]);(0,s.useEffect)((function(){P(!0)}),[]);var L=(0,s.useCallback)((function(e){var n,t,i=e.blockIndex,o=e.heights,r=e.y,l=null===m||void 0===m||null===(n=m.current)||void 0===n?void 0:n.getBoundingClientRect(),u=null===h||void 0===h||null===(t=h.current)||void 0===t?void 0:t.getBoundingClientRect(),c=(0,_e.Sm)((null===o||void 0===o?void 0:o.slice(0,i))||[]),a=(0,_e.Sm)(o||[])||0,s=(0,et.IT)(o,a,I);return(c-(r-(null===l||void 0===l?void 0:l.y)))/a/(1-s)*((null===l||void 0===l?void 0:l.height)-(null===u||void 0===u?void 0:u.height))+(null===l||void 0===l?void 0:l.y)}),[]),F=(0,s.useCallback)((function(){var e=Object.values(c||{}),n=null===i||void 0===i?void 0:i.map((function(n){var t=(0,$n.zv)(n);return Math.max.apply(Math,(0,o.Z)(e.map((function(e){var n,i,o,r=null===e||void 0===e||null===(n=e.current)||void 0===n?void 0:n[t];return(null===r||void 0===r||null===(i=r.current)||void 0===i||null===(o=i.getBoundingClientRect())||void 0===o?void 0:o.height)||0}))))}));if(null!==n&&void 0!==n&&n.every((function(e){return"undefined"!==typeof e&&!isNaN(e)}))){if(x(n),y){var t=L(tt(tt({},y),{},{heights:n}));A(t)}N()}}),[i,L,r,N,c,y,x]);(0,s.useEffect)((function(){var e;return null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.addEventListener(e,F)})),function(){var e;null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.removeEventListener(e,F)}))}}),[c,F]);var U=(0,s.useCallback)((function(){N(),F()}),[N,F]);(0,s.useEffect)((function(){return window.addEventListener(Yn.Qj,U),function(){window.removeEventListener(Yn.Qj,U)}}),[U]),(0,s.useEffect)((function(){var e=function(e){var n,t,o=e.detail.block,r=null===i||void 0===i?void 0:i.findIndex((function(e){return e.uuid===(null===o||void 0===o?void 0:o.uuid)})),l=L({blockIndex:r,heights:g,y:null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y});A(l),N()};return window.addEventListener(Yn.Em,e),function(){window.removeEventListener(Yn.Em,e)}}),[i,L,N,g,A]),(0,s.useEffect)((function(){u||F()}),[u,f,F]),(0,s.useEffect)((function(){var e=function(e){var n=e.detail;if(r===(null===n||void 0===n?void 0:n.columnIndex)){var t=L(tt(tt({},n),{},{heights:g}));A(t),N(),null!==n&&void 0!==n&&n.lockScroll&&k(n)}};return window.addEventListener(Yn.Wf,e),function(){window.removeEventListener(Yn.Wf,e)}}),[r,I,g,k,A,L,M]);var H=(0,s.useCallback)((function(e){var n=e.pageX,t=e.pageY;if(n>=T&&n<=T+E&&t>=M&&t<=M+I){var i=E/l;if(f||n>=T+i*r&&n<T+i*(r+1)){var o,u=null===h||void 0===h||null===(o=h.current)||void 0===o?void 0:o.getBoundingClientRect(),c=((null===u||void 0===u?void 0:u.y)||0)+((null===e||void 0===e?void 0:e.deltaY)||0);A(c),N(),k(null)}}}),[r,l,N,I,f,A,E,T,M]),z=(0,s.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(C||null!=n){var t;e&&(null===e||void 0===e||e.preventDefault());if(null===n){var i,o=null===C||void 0===C?void 0:C.scrollTop,r=null===C||void 0===C||null===(i=C.event)||void 0===i?void 0:i.clientY;t=o+((null===e||void 0===e?void 0:e.clientY)-r)}else t=n;A(t),N(),k(null)}}),[N,C,A]);return(0,s.useEffect)((function(){var e,n;A(null===h||void 0===h||null===(e=h.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.y)}),[I,A]),(0,s.useEffect)((function(){var e=function(){_(null)};return R&&(window.addEventListener("mousemove",z),window.addEventListener("wheel",H),window.addEventListener("mouseup",e)),function(){window.removeEventListener("mousemove",z),window.removeEventListener("wheel",H),window.removeEventListener("mouseup",e)}}),[R,z,H]),(0,w.jsx)(Xn,{height:I,invisible:a,left:p?T+E-Qn.nn:void 0,ref:m,children:(0,w.jsx)(Jn,{height:R,invisible:a,onMouseDown:function(e){var n,t;return _({event:e,scrollTop:null===h||void 0===h||null===(n=h.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})},ref:h,selected:!!C,top:null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})})},ot=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function rt(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 lt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?rt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ut=m.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*O.iI),ct=m.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var at=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,o=e.description,r=e.disableWordBreak,l=e.fullWidth,u=e.inputValue,c=e.inputWidth,a=e.invertedTheme,d=e.label,p=e.labelColor,f=e.menuOpen,v=void 0!==f&&f,h=e.monospace,m=e.muted,b=e.onClick,g=e.notRequired,x=e.selectedTextProps,O=e.small,C=e.stacked,_=e.suffixValue,S=e.tooltipProps,I=e.value,E=(0,he.Z)(e,ot),T=(0,s.useRef)(null),M=(0,s.useState)(!1),D=M[0],B=M[1],R=(0,s.useState)(!1),A=R[0],N=R[1],L=d&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(P.ZP,{bold:t,color:p,inverted:a,lineHeight:20,monospace:h,muted:m,small:O,children:d}),S&&(0,w.jsx)(Z.Z,{ml:1,children:(0,w.jsx)(Ze.Z,lt({muted:!0},S))})]}),F=(0,w.jsxs)(j.Z,{flex:l?"1":"none",children:[I&&(0,w.jsx)(k.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){b(),T.current&&T.current.focus(),B(!0)},preventDefault:!0,sameColorAsText:m||!(null!==x&&void 0!==x&&x.primary)&&!(null!==x&&void 0!==x&&x.danger)&&!(null!==x&&void 0!==x&&x.warning),underline:null===x||void 0===x?void 0:x.underline,warning:null===x||void 0===x?void 0:x.warning,children:(0,w.jsx)(P.ZP,lt(lt({inverted:a,muted:m},x),{},{disableWordBreak:r,monospace:h,small:O,width:c,children:I}))}),(0,w.jsx)(z.Z,lt(lt({},E),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:a,monospace:h,onBlur:function(e){B(!1),E.onBlur&&E.onBlur(e),A||N(!0)},onFocus:function(e){B(!0),E.onFocus&&E.onFocus(e)},ref:T,small:O,value:u,visible:!I}))]}),U=o&&(0,w.jsx)(ct,{children:(0,w.jsx)(P.ZP,{dangerouslySetInnerHTML:{__html:o},monospace:h,muted:!0,small:O})}),H=(0,s.useMemo)((function(){return(0,w.jsx)(P.ZP,{default:!0,small:O,children:_})}),[O,_]);return(0,w.jsxs)(w.Fragment,{children:[C&&(0,w.jsxs)(w.Fragment,{children:[L&&(0,w.jsxs)(ut,{children:[(0,w.jsx)(y.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,w.jsxs)(y.ZP,{fullWidth:l,children:[F,_&&H]})]}),!C&&(0,w.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,w.jsxs)(w.Fragment,{children:[L,(0,w.jsx)(Z.Z,{ml:1})]}),F,_&&H]}),A&&!D&&!I&&!v&&!g&&(0,w.jsx)(P.ZP,{danger:!0,small:O,children:"This field is required."})]})},st=t(53779);function dt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function pt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?dt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):dt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ft=function(e){var n=e.blocks,t=e.creatingNewDBTModel,i=e.dbtModelName,o=e.files,r=e.onClose,l=e.onOpenFile,u=e.setDbtModelName,c=(0,s.useState)(!1),a=c[0],d=c[1],p=(0,s.useState)(null),f=p[0],v=p[1],m=(0,s.useMemo)((function(){var e,n,t=null===(e=(0,_e.sE)((null===o||void 0===o||null===(n=o[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(pt(pt({},e),{},{children:t}))})),i}),[o]),b=(0,s.useMemo)((function(){return(0,_e.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,w.jsxs)(st.eD,{children:[(0,w.jsxs)(st.X$,{children:[(0,w.jsx)(j.Z,{alignItems:"center",children:(0,w.jsx)(P.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new dbt model":"Select dbt model or snapshot file"})}),(0,w.jsx)(T.ZP,{iconOnly:!0,onClick:r,children:(0,w.jsx)(K.x8,{muted:!0})})]}),t&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(st.nF,{children:(0,w.jsx)(at,{dynamicSizing:!0,inputValue:i,label:"Model name (cannot be changed):",labelColor:Oe.Z.accent.dbt,notRequired:!0,onBlur:function(){d(!1)},onChange:function(e){u(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,w.jsxs)(st.nF,{children:[(0,w.jsx)(P.ZP,{bold:!0,color:Oe.Z.accent.dbt,children:"Select folder location:"}),(0,w.jsx)(P.ZP,{bold:!0,muted:!f,children:f?"dbt".concat(Wn.sep).concat(f):"Choose folder below"})]})]}),(0,w.jsx)(st.C,{children:(0,w.jsx)(vn.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,w.jsx)(st.iW,{children:(0,w.jsx)(T.ZP,{backgroundColor:i&&f?Oe.Z.accent.dbt:Oe.Z.monotone.grey500,disabled:!i||!f,onClick:function(){return l(f)},padding:"6px 8px",children:"Create model"})})]})},vt=t(10975),ht=t(14567),mt=t(79757),bt=t(41429);function gt(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 xt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?gt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function jt(e,n){var t,i=e.block,o=e.blocks,l=e.onClick,u=e.onDrop,c=i.type,a=(0,vt.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:i,type:bt.vT}}),[i]),d=(0,r.Z)(a,3),p=d[0],f=d[1],v=(d[2],(0,ht.L)((function(){return{accept:bt.vT,drop:function(e){return null===u||void 0===u?void 0:u(i,e)}}}),[i])),b=(0,r.Z)(v,2)[1],x=(0,s.useContext)(m.ThemeContext),_=(0,C.qn)(c,{blockColor:i.color,theme:x}).accent,S=(0,ae.cU)([i],o)[0],I=S.dynamic,E=S.dynamicUpstreamBlock,T=S.reduceOutput,M=S.reduceOutputUpstreamBlock,D=(0,s.useMemo)((function(){return(0,et._o)({block:i,dynamic:I,dynamicUpstreamBlock:E,reduceOutput:T,reduceOutputUpstreamBlock:M})}),[i,I,E,T,M]).borderColorShareProps,B=(0,s.useMemo)((function(){return h.tf.DBT===(null===i||void 0===i?void 0:i.type)}),[i]);return(0,w.jsx)(Z.Z,{pb:1,ref:b,children:(0,w.jsx)(C.PY,xt(xt({},xt(xt({},D),p)),{},{ref:f,children:(0,w.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:function(){return l()},preventDefault:!0,ref:n,children:(0,w.jsx)(Z.Z,{p:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{alignItems:"center",flex:1,children:[(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(mt.Z,{monospace:!0,children:h.dO[i.language]}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(g.Z,{color:_,size:1.5*O.iI,square:!0}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(P.ZP,{color:_,monospace:!0,children:null===(t=B?h.tf.DBT:h.V4[i.type])||void 0===t?void 0:t.toUpperCase()})]}),(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsx)(K.iU,{size:1.5*O.iI}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(P.ZP,{monospace:!0,muted:!0,children:null===i||void 0===i?void 0:i.uuid})]}),(0,w.jsx)(Ze.Z,{appearAbove:!0,appearBefore:!0,block:!0,label:"Show ".concat(null===i||void 0===i?void 0:i.uuid," block"),size:2*O.iI,widthFitContent:!0,children:(0,w.jsx)(K.Db,{muted:!0,size:2*O.iI})})]})})})}))})}var yt=s.forwardRef(jt),kt=t(32013),Zt=t(98777),Pt=t(39457);function Ot(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ct(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ot(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ot(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var wt="4px",_t=[Pe.Zj.BIGQUERY,Pe.Zj.DELTA_LAKE_S3];var St=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,o=e.isLoadingUpdateDestinationBlockState,u=e.loadSampleData,c=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,C=void 0===k?"":k,_=a.key_properties,S=a.metadata,I=a.partition_keys,E=a.replication_method,M=a.run_in_parallel,D=a.schema.properties,B=a.tap_stream_id,R=a.unique_constraints,A=a.unique_conflict_method,N=(0,s.useState)(C),L=N[0],F=N[1],H=(0,s.useState)(!1),W=H[0],K=H[1],G=(0,s.useState)(null),V=G[0],q=G[1],Y=(0,s.useState)(!!t),X=Y[0],J=Y[1],$=(0,s.useState)((0,l.Z)({},B,n||{})),ee=$[0],ne=$[1],te=(0,An.Z)(B);(0,s.useEffect)((function(){te!==B&&(F(C),q(null))}),[C,E,B,te,A]),(0,s.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[B];(null===x||void 0===x?void 0:x.length)>0&&((0,ge.Qr)(e)||!(0,ge.Xy)(n,e))&&ne((function(e){return Ct(Ct({},e),{},(0,l.Z)({},B,n))}))}),[null===x||void 0===x?void 0:x.length,n,B]);var ie=(0,s.useMemo)((function(){return(0,_e.HK)(S,(function(e){return e.breadcrumb.join("/")}))}),[S]),oe=(0,s.useMemo)((function(){var e;return null===(e=(0,_e.sE)(S,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[S]),le=(0,s.useMemo)((function(){return oe[Pe.fe.KEY_PROPERTIES]||[]}),[oe]),ce=(0,s.useMemo)((function(){return oe[Pe.fe.REPLICATION_KEYS]||[]}),[oe]),ae=_t.includes(t),se=d.length>1,de=(0,s.useCallback)((function(e){var n=Ct({},null===ee||void 0===ee?void 0:ee[B]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return Ct(Ct({},e),{},(0,l.Z)({},B,Ct({},n)))})),f({block:{bookmark_values:n,destination_table:L,tap_stream_id:B}})}),[ee,L,B,f]),pe=(0,s.useMemo)((function(){var e=[],n=[],i=(0,_e.mr)(Object.entries(D)).map((function(i,o){var l=(0,r.Z)(i,2),u=l[0],c=l[1],a=c.anyOf,s=void 0===a?[]:a,d=c.format,f=c.type,g=void 0===f?[]:f,k=new Set(Array.isArray(g)?g:[g]),C=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),C.add(e)})):(k.add(t),C.add(t),n&&C.add(n))}));var S=Array.from(k);d&&C.add(d);var E=(ie["properties/".concat(u)]||{}).metadata,M=(E.inclusion,E.selected);e.push(M),n.push(u);var D=Pe.D5.reduce((function(e,n){return S.indexOf(n)>=0||Pe.Xv===String(n)&&Pe.zS.DATE_TIME===d||Pe.zS.UUID===String(n)&&Pe.zS.UUID===d?e:e.concat((0,w.jsx)("option",{value:n,children:n},n))}),[]),A=S.findIndex((function(e){return e===Pe.RL.STRING})),N=[(0,w.jsx)(b.Z,{checked:M,onClick:function(){v(B,[u],{selected:!M})}},"".concat(B,"/").concat(u,"/selected")),(0,w.jsx)(P.ZP,{children:u},"".concat(B,"/").concat(u,"/name")),(0,w.jsxs)(y.ZP,{children:[(0,w.jsx)(j.Z,{flex:1,children:(0,w.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:S.map((function(e,n){return(0,w.jsx)(Z.Z,{mb:1,mr:1,children:(0,w.jsx)(je.Z,{border:!0,label:d&&Pe.RL.STRING===e&&A===n?Pe.eL[d]:e,onClick:function(){var n={format:d,type:S.filter((function(n){return n!==e}))};Pe.zS.DATE_TIME!==d&&Pe.zS.UUID!==d||Pe.RL.STRING!==e||(n.format=null),h(B,u,n)},small:!0})},"".concat(B,"/").concat(u,"/").concat(e,"/").concat(n,"/chip"))}))})}),D.length>=1&&(0,w.jsxs)(U.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:d,type:S};Pe.Xv===String(n)?(t.format=Pe.zS.DATE_TIME,t.type.push(Pe.RL.STRING)):Pe.zS.UUID===String(n)?(t.format=Pe.zS.UUID,t.type.push(Pe.RL.STRING)):t.type.push(n),h(B,u,t)},primary:!0,small:!0,value:"",width:10*O.iI,children:[(0,w.jsx)("option",{value:""}),D]})]},"".concat(B,"/").concat(u,"/type")),(0,w.jsx)(b.Z,{checked:!(null===R||void 0===R||!R.includes(u)),disabled:le.length>=1&&!le.includes(u),onClick:le.length>=1&&!le.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(u)?e.unique_constraints=(0,_e.Od)(e.unique_constraints,(function(e){return u===e})):e.unique_constraints=[u].concat(e.unique_constraints||[]),e}))}},"".concat(B,"/").concat(u,"/unique")),(0,w.jsx)(b.Z,{checked:!(null===x||void 0===x||!x.includes(u)),disabled:ce.length>=1&&!ce.includes(u),onClick:ce.length>=1&&!ce.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(u)?(de(u),e.bookmark_properties=(0,_e.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),e}))}},"".concat(B,"/").concat(u,"/bookmark")),(0,w.jsx)(b.Z,{checked:!(null===_||void 0===_||!_.includes(u)),onClick:function(){return m(B,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(u)?e.key_properties=(0,_e.Od)(e.key_properties,(function(e){return u===e})):e.key_properties=[u].concat(e.key_properties||[]),e}))}},"".concat(B,"/").concat(u,"/key_property"))];if(ae){var L=t!==Pe.Zj.DELTA_LAKE_S3,F=L&&(le.includes(u)||!C.has(Pe.zS.DATE_TIME));N.push((0,w.jsx)(b.Z,{checked:!(null===I||void 0===I||!I.includes(u)),disabled:F,onClick:F?null:function(){return m(B,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(u)?e.partition_keys=(0,_e.Od)(e.partition_keys,(function(e){return u===e})):L&&1===(null===(t=e.partition_keys)||void 0===t?void 0:t.length)?e.partition_keys=[u]:e.partition_keys=[u].concat(e.partition_keys||[]);return e}))}},"".concat(B,"/").concat(u,"/partition_key")))}if(se){var H=V===o;N.push((0,w.jsx)(T.ZP,{compact:!0,disabled:H,onClick:function(){q(o),setTimeout((function(){return q(null)}),2e3),p((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==B&&null!==e&&void 0!==e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[u]){var i,o,r,l,c,a,s,p,f;e.schema.properties[u]={format:d||null,type:S};var v=null===(i=(0,_e.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[Pe.fe.REPLICATION_KEYS]||[],m=v[Pe.fe.KEY_PROPERTIES]||[];null===R||void 0===R||!R.includes(u)||null!==e&&void 0!==e&&null!==(o=e.unique_constraints)&&void 0!==o&&o.includes(u)||!m.includes(u)?null!==R&&void 0!==R&&R.includes(u)||null===e||void 0===e||null===(r=e.unique_constraints)||void 0===r||!r.includes(u)||(e.unique_constraints=(0,_e.Od)(e.unique_constraints,(function(e){return u===e}))):e.unique_constraints=[u].concat(e.unique_constraints||[]),null===x||void 0===x||!x.includes(u)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(u)||!h.includes(u)?null!==x&&void 0!==x&&x.includes(u)||null===e||void 0===e||null===(c=e.bookmark_properties)||void 0===c||!c.includes(u)||(e.bookmark_properties=(0,_e.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),null===_||void 0===_||!_.includes(u)||null!==e&&void 0!==e&&null!==(a=e.key_properties)&&void 0!==a&&a.includes(u)?null!==_&&void 0!==_&&_.includes(u)||null===e||void 0===e||null===(s=e.key_properties)||void 0===s||!s.includes(u)||(e.key_properties=(0,_e.Od)(e.key_properties,(function(e){return u===e}))):e.key_properties=[u].concat(e.key_properties||[]),null===I||void 0===I||!I.includes(u)||null!==e&&void 0!==e&&null!==(p=e.partition_keys)&&void 0!==p&&p.includes(u)?null!==I&&void 0!==I&&I.includes(u)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(u)||(e.partition_keys=(0,_e.Od)(e.partition_keys,(function(e){return u===e}))):e.partition_keys=[u].concat(e.partition_keys||[])}return Ct({},e)}))},pill:!0,secondary:!0,children:(0,w.jsx)(P.ZP,{success:H,children:H?"Applied!":"Apply"})}))}return N})),o=e.every((function(e){return e})),l=[null,2,1,null,null,null],u=[{label:function(){return(0,w.jsx)(b.Z,{checked:o,onClick:function(){v(B,n,{selected:!o})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to avoid adding duplicate records",uuid:"Unique"},{tooltipMessage:"Used to keep track of sync progress and incrementally sync new records (e.g. a column indicating when a record was last updated)",tooltipWidth:305,uuid:"Bookmark"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to create primary key for destination table",uuid:"Key prop"}];return ae&&(l.push(null),u.push({uuid:"Partition key"})),se&&(l.push(null),u.push({tooltipMessage:"This will apply this individual feature's schema settings to all selected streams that have the same feature. Unique features must be valid key properties in other streams. Bookmark features must be valid replication keys in other streams.",uuid:"All streams"})),(0,w.jsx)(ue.cl,{children:(0,w.jsx)(ye.Z,{alignTop:!0,columnFlex:l,columns:u,rows:i,stickyHeader:!0})})}),[x,t,se,V,_,ie,I,D,de,ae,B,R,p,v,h,m,le,ce]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,w.jsx)(re.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:B})," schema"]}),(0,w.jsx)(Z.Z,{mb:3,children:(0,w.jsx)(zn.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{children:"Destination table name"}),(0,w.jsx)(Z.Z,{ml:wt}),(0,w.jsx)(Ze.Z,{label:(0,w.jsxs)(P.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:B}),". To change the table name, enter in a different value."]}),lightBackground:!0,primary:!0}),(0,w.jsx)(Z.Z,{ml:1}),(0,w.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(B,(function(e){return Ct(Ct({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*O.iI})]})})}),(0,w.jsx)(Z.Z,{mb:3,children:(0,w.jsx)(zn.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{children:"Replication method"}),(0,w.jsx)(Z.Z,{ml:wt}),(0,w.jsx)(Ze.Z,{label:(0,w.jsxs)(P.ZP,{children:["Do you want to synchronize the entire stream (",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.INCREMENTAL}),")?",c===Pe.th.POSTGRESQL&&(0,w.jsxs)(P.ZP,{children:["Log-based incremental replication (",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0,primary:!0}),(0,w.jsx)(Z.Z,{ml:1}),(0,w.jsxs)(U.Z,{compact:!0,onChange:function(e){m(B,(function(n){return Ct(Ct({},n),{},{replication_method:e.target.value})}))},primary:!0,value:E,children:[(0,w.jsx)("option",{value:""}),Object.values(Pe._B).filter((function(e){return c===Pe.th.POSTGRESQL||e!==Pe._B.LOG_BASED})).map((function(e){return(0,w.jsx)("option",{value:e,children:e},e)}))]}),(0,w.jsx)(Z.Z,{ml:3}),(0,w.jsx)(P.ZP,{children:"Unique conflict method"}),(0,w.jsx)(Z.Z,{ml:wt}),(0,w.jsx)(Ze.Z,{label:(0,w.jsxs)(P.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,Q._6)("unique column",null===R||void 0===R?void 0:R.length),(null===R||void 0===R?void 0:R.length)>0&&(0,w.jsx)(w.Fragment,{children:"\xa0"}),null===R||void 0===R?void 0:R.sort().map((function(e,n){return(0,w.jsxs)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===R||void 0===R?void 0:R.length)&&n===(null===R||void 0===R?void 0:R.length)-1?(0,w.jsx)(P.ZP,{inline:!0,children:" and "},e):n>=1&&(0,w.jsx)(w.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0,primary:!0}),(0,w.jsx)(Z.Z,{ml:1}),(0,w.jsxs)(U.Z,{compact:!0,inputWidth:11*O.iI,onChange:function(e){m(B,(function(n){return Ct(Ct({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:A,children:[(0,w.jsx)("option",{value:""}),(0,w.jsx)("option",{value:Pe.MU.IGNORE,children:Pe.MU.IGNORE}),(0,w.jsx)("option",{value:Pe.MU.UPDATE,children:Pe.MU.UPDATE})]})]}),se&&(0,w.jsxs)(j.Z,{alignItems:"center",children:[(0,w.jsx)(P.ZP,{default:!0,children:"All streams"}),(0,w.jsx)(Z.Z,{ml:wt}),(0,w.jsx)(Ze.Z,{appearBefore:!0,label:(0,w.jsx)(P.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."}),lightBackground:!0,primary:!0}),(0,w.jsx)(Z.Z,{ml:1}),(0,w.jsx)(T.ZP,{compact:!0,disabled:W,onClick:function(){K(!0),setTimeout((function(){return K(!1)}),2e3),p((function(e){return Ct(Ct({},e),{},{replication_method:E,unique_conflict_method:A})}))},pill:!0,secondary:!0,children:(0,w.jsx)(P.ZP,{bold:!W,success:W,children:W?"Applied!":"Apply"})})]})]})})}),(0,w.jsx)(zn.Z,{headerTitle:"Features",noPadding:!0,children:pe}),(0,w.jsx)(Z.Z,{mt:2,children:(0,w.jsx)(T.ZP,{loading:i,onClick:function(){return u(B)},primary:!0,small:!0,children:"Load sample data"})}),(0,w.jsxs)(Z.Z,{mt:5,children:[(0,w.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,w.jsx)(Z.Z,{mb:5,children:(0,w.jsxs)(Z.Z,{mb:1,children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,w.jsx)(P.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,w.jsx)(Z.Z,{mb:1}),(0,w.jsx)(ke.Z,{checked:M,onCheck:function(){return m(B,(function(e){return e.run_in_parallel=!M,e}))}},"".concat(B,"/run_in_parallel"))]})}),Pe._B.INCREMENTAL===E&&(0,w.jsxs)(Z.Z,{mb:5,children:[(0,w.jsxs)(Z.Z,{mb:1,children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,w.jsx)(P.ZP,{default:!0,children:"After each integration pipeline run, the last record that was successfully synchronized will be used as the bookmark. The properties listed below will be extracted from the last record and used as the bookmark. On the next run, the synchronization will start from the bookmarked record."})]}),(0,w.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==x&&void 0!==x&&x.length)&&(0,w.jsxs)(P.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,w.jsx)(P.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,w.jsx)(Z.Z,{mb:1,mr:1,children:(0,w.jsx)(je.Z,{label:e,onClick:function(){de(e),m(B,(function(n){return Ct(Ct({},n),{},{bookmark_properties:(0,_e.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,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{my:2,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(Z.Z,{mr:2,children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),!t&&(0,w.jsx)(P.ZP,{default:!0,children:'In order to overwrite the bookmark values for the next sync, you must first select a destination. Then you will be able to edit the bookmark property values in the table below. Click the "Save" button to save your changes.'}),t&&(0,w.jsx)(P.ZP,{default:!0,children:'This will temporarily overwrite the bookmark value for the next pipeline run. After editing any bookmark values below, you must click the "Save" button in the table header in order to persist and save your changes.'})]}),(0,w.jsx)(ke.Z,{checked:X,disabled:!t,onCheck:function(){return J((function(e){return!e}))}})]})}),X&&!!t&&(0,w.jsx)(zn.Z,{header:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(P.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,w.jsx)(T.ZP,{compact:!0,loading:o,onClick:function(){f({block:{bookmark_values:(null===ee||void 0===ee?void 0:ee[B])||{},destination_table:L,tap_stream_id:B}})},pill:!0,primary:!0,children:"Save"})]}),headerPaddingVertical:O.iI,noPadding:!0,overflowVisible:!0,children:(0,w.jsx)(ye.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Feature"},{uuid:"Current bookmark value"}],rows:x.map((function(e){var n;return[(0,w.jsx)(P.ZP,{default:!0,monospace:!0,children:e},e),(0,w.jsx)(z.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return Ct(Ct({},t),{},(0,l.Z)({},B,Ct(Ct({},t[B]),{},(0,l.Z)({},e,n.target.value||null))))}))},paddingHorizontal:0,placeholder:"Enter value (optional)",value:null===ee||void 0===ee||null===(n=ee[B])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),(0,w.jsxs)(Z.Z,{mb:5,children:[(0,w.jsxs)(Z.Z,{mb:1,children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,w.jsx)(P.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,w.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==R&&void 0!==R&&R.length)&&(0,w.jsxs)(P.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===R||void 0===R?void 0:R.sort().map((function(e){return(0,w.jsx)(Z.Z,{mb:1,mr:1,children:(0,w.jsx)(je.Z,{label:e,onClick:function(){m(B,(function(n){return Ct(Ct({},n),{},{unique_constraints:(0,_e.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,w.jsxs)(Z.Z,{mb:5,children:[(0,w.jsxs)(Z.Z,{mb:1,children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,w.jsx)(P.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,w.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==_&&void 0!==_&&_.length)&&(0,w.jsxs)(P.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,w.jsx)(P.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,w.jsx)(Z.Z,{mb:1,mr:1,children:(0,w.jsx)(je.Z,{label:e,onClick:function(){m(B,(function(n){return Ct(Ct({},n),{},{key_properties:(0,_e.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ae&&(0,w.jsxs)(Z.Z,{mb:3,children:[(0,w.jsxs)(Z.Z,{mb:1,children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,w.jsx)(P.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,w.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==I&&void 0!==I&&I.length)&&(0,w.jsxs)(P.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===I||void 0===I?void 0:I.sort().map((function(e){return(0,w.jsx)(Z.Z,{mb:1,mr:1,children:(0,w.jsx)(je.Z,{label:e,onClick:function(){m(B,(function(n){return Ct(Ct({},n),{},{partition_keys:(0,_e.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},It=["catalog","pipeline","setErrors","setSelectedStream"];function Et(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 Tt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Et(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Et(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Mt,Dt=function(e){var n,t=e.catalog,i=e.pipeline,o=e.setErrors,l=e.setSelectedStream,u=(0,he.Z)(e,It),c=(0,s.useState)(null),a=c[0],p=c[1],f=(0,s.useMemo)((function(){return(null===t||void 0===t?void 0:t.streams)||[]}),[t]),v=(0,s.useMemo)((function(){return(0,_e.YC)(f,"stream").map((function(e){return{uuid:e.stream}}))}),[f]),m=(0,s.useMemo)((function(){return(0,_e.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,_e.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),O=W.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}),C=O.data,_=O.mutate,S=null===C||void 0===C||null===(n=C.block)||void 0===n?void 0:n.bookmarks,I=(0,d.Db)(W.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,X.wD)(e,{callback:function(){null===_||void 0===_||_()},onErrorCallback:function(e,n){return null===o||void 0===o?void 0:o({errors:n,response:e})}})}}),E=(0,r.Z)(I,2),T=E[0],D=E[1].isLoading;(0,s.useEffect)((function(){v.length>0&&(a&&(0,_e.sE)(v,(function(e){var n=e.uuid;return a.uuid===n}))||p(v[0]))}),[a,p,v]);var B=(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,w.jsx)(ue.cl,{children:(0,w.jsx)(ye.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,o=e.key_properties,r=e.metadata,l=e.unique_constraints,u=e.unique_conflict_method,c=e.partition_keys,a=e.tap_stream_id,s=r.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,o=(null===t||void 0===t?void 0:t.length)>0,r=i&&o?1:0,l=o?1:0;return{selectedCount:e.selectedCount+r,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,w.jsx)(P.ZP,{children:"".concat(s.selectedCount," of ").concat(s.totalCount," total")},"".concat(a,"_col_selected")),p=[a,n,t,i,o,l,u,c].map((function(e,n){return(0,w.jsx)(P.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,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(M.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){p(e),l(e.uuid)},selectedTabUUID:null===a||void 0===a?void 0:a.uuid,tabs:v}),b&&(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(ue.dE,{children:(0,w.jsx)(St,Tt(Tt({},u),{},{bookmarkValues:S,isLoadingUpdateDestinationBlockState:D,stream:b,streams:f,updateDestinationBlockState:T}))})}),f.length>=1&&(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(ue.dE,{children:[(0,w.jsx)(re.Z,{level:4,children:"Streams Summary"}),(0,w.jsx)(Z.Z,{mt:1}),B]})})]})},Bt=t(46732);function Rt(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function At(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 Nt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?At(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):At(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"}(Mt||(Mt={}));var Lt=45*O.iI,Ft=Lt-4*O.iI;var Ut=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,o=e.streams,r=(0,_e.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),u=(0,s.useMemo)((function(){var e=new Set(o.map((function(e){return e.stream})));return Object.values(r).filter((function(n){var t=n.stream;return!e.has(t)})).map((function(e){return Nt(Nt({},e),{},{isMissingStream:!0})}))}),[r,o]),c=Nt({},r);u.forEach((function(e){var n=e.stream;delete c[n]}));var a=(0,s.useState)(c),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)(Mt.ALL),C=k[0],_=k[1],S=(0,s.useRef)(null),I=Rt(d),E=(0,s.useMemo)((function(){var e=o;return e=e.filter((function(e){var n=e.tap_stream_id;return C===Mt.SELECTED?I.includes(n):C!==Mt.NOT_SELECTED||!I.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}),[C,v,I,o]),M=(0,s.useMemo)((function(){return o.every((function(e){var n=e.stream;return!!d[n]}))}),[d,o]);return(0,w.jsxs)(Te.Z,{children:[(0,w.jsx)(ue.cv,{rounded:!0,children:(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,w.jsx)(ue.cv,{padding:1.25*O.iI,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(z.Z,{beforeIcon:(0,w.jsx)(K.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return h(e.target.value)},placeholder:"Search",value:v}),(0,w.jsx)(Z.Z,{pr:1,children:(0,w.jsx)(Bt.Z,{items:[{label:function(){return Mt.ALL},onClick:function(){return _(Mt.ALL)},uuid:"all_streams"},{label:function(){return Mt.SELECTED},onClick:function(){return _(Mt.SELECTED)},uuid:"selected"},{label:function(){return Mt.NOT_SELECTED},onClick:function(){return _(Mt.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return j(!1)},onClickOutside:function(){return j(!1)},open:g,parentRef:S,uuid:"SelectStreams/filter",children:(0,w.jsx)(T.ZP,{beforeIcon:(0,w.jsx)(K.wn,{}),noBackground:!0,onClick:function(){return j((function(e){return!e}))},ref:S,children:(0,w.jsx)(P.ZP,{children:C})})})})]})}),(0,w.jsx)(ue.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(Lt,"px"),children:(0,w.jsx)(ye.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,w.jsx)(b.Z,{checked:M,onClick:function(){var e=(0,_e.HK)(o||[],(function(e){return e.stream}));p(M?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:E.concat(u).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!d[t];return[(0,w.jsx)(b.Z,{checked:i,disabled:!i&&n,onClick:function(){p((function(n){return Nt(Nt({},n),{},(0,l.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,w.jsxs)(P.ZP,{danger:n,title:t,width:Lt-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,w.jsx)(x.Z,{medium:!0}),(0,w.jsxs)(Z.Z,{p:2,children:[(null===I||void 0===I?void 0:I.length)>50&&(0,w.jsx)(Z.Z,{pb:2,children:(0,w.jsxs)(P.ZP,{danger:!0,maxWidth:Ft,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,w.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===o||void 0===o?void 0:o.length)&&(0,w.jsx)(Z.Z,{pb:2,children:(0,w.jsx)(P.ZP,{bold:!0,maxWidth:Ft,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,w.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,w.jsx)(T.ZP,{loading:t,onClick:function(){return i(d)},primary:!0,children:"Confirm ".concat(Rt(d).length," streams")})})]})]})};function Ht(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function zt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ht(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ht(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wt=function(e){var n=e.api,t=e.block,i=e.blockContent,o=e.onChangeCodeBlock,u=e.pipeline,c=(0,s.useState)(null),a=c[0],p=c[1];(0,s.useEffect)((function(){i&&!a&&p((0,ie.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)(W.ZP[n].useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var t,i,o=(0,Q.C5)(n);m(null===e||void 0===e||null===(t=e[o])||void 0===t?void 0:t.success),x(null===e||void 0===e||null===(i=e[o])||void 0===i?void 0:i.error_message)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),k=(0,r.Z)(j,2),O=k[0],C=k[1].isLoading;return t?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ue.$W,{children:(0,w.jsx)(oe.Z,{autoHeight:!0,language:h.t6.YAML,onChange:function(e){p(e),o(t.type,t.uuid,(0,ie.Pz)(zt(zt({},i),{},{config:(0,ie.Qc)(e)})))},tabSize:2,value:a||void 0,width:"100%"})}),(0,w.jsxs)(Z.Z,{mt:1,children:[(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(T.ZP,{onClick:function(){O((0,l.Z)({},(0,Q.C5)(n),{action_type:"test_connection",config:a,pipeline_uuid:u.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,w.jsx)(Z.Z,{ml:1,children:C?(0,w.jsx)(H.Z,{color:"white",small:!0}):(0,w.jsxs)(w.Fragment,{children:[v&&(0,w.jsx)(P.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===v&&(0,w.jsx)(P.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),g&&(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(P.ZP,{small:!0,warning:!0,children:g})})]})]}):null},Kt=t(85385);function Gt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Vt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Gt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Gt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qt=function(e){var n,t,i,o=e.addNewBlockAtIndex,l=e.blocks,u=e.codeBlocks,c=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,C=e.setOutputBlocks,_=e.setSelectedBlock,S=e.setSelectedOutputBlock,I=e.setSelectedStream,E=(0,s.useState)(!0),M=E[0],D=E[1],B=(0,s.useState)(!0),R=B[0],A=B[1],N=(0,s.useState)(!0),L=N[0],F=N[1],z=(0,s.useState)(""),G=z[0],V=z[1],q=W.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,Y=(0,s.useMemo)((function(){return(null===q||void 0===q?void 0:q.integration_sources)||[]}),[q]),Q=(0,s.useMemo)((function(){return(0,_e.HK)(Y,(function(e){return e.uuid}))}),[Y]),J=W.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,$=(0,s.useMemo)((function(){return(null===J||void 0===J?void 0:J.integration_destinations)||[]}),[J]),ee=(0,s.useMemo)((function(){return(0,_e.HK)($,(function(e){return e.uuid}))}),[$]),ne=(0,s.useMemo)((function(){return(0,_e.sE)(l,(function(e){var n=e.type;return h.tf.DATA_LOADER===n}))}),[l]),te=(0,s.useMemo)((function(){return ne?(0,ie.Qc)(ne.content):{}}),[ne]);(0,s.useEffect)((function(){var e;null!==te&&void 0!==te&&te.source&&V(null===(e=Q[te.source])||void 0===e?void 0:e.docs)}),[Q,te]);var oe=(0,s.useMemo)((function(){return(0,w.jsx)(Wt,{api:"integration_sources",block:ne,blockContent:te,onChangeCodeBlock:v,pipeline:b})}),[ne,te,v,b]),le=(0,s.useMemo)((function(){return(0,_e.sE)(l,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n}))}),[l]),ce=(0,s.useMemo)((function(){return le?(0,ie.Qc)(le.content):{}}),[le]),ae=(0,s.useMemo)((function(){return(0,w.jsx)(Wt,{api:"integration_destinations",block:le,blockContent:ce,onChangeCodeBlock:v,pipeline:b})}),[le,ce,v,b]),se=(0,s.useMemo)((function(){return(0,_e.sE)(l,(function(e){var n=e.type;return h.tf.TRANSFORMER===n}))}),[l]),de=(0,s.useMemo)((function(){var e;return(0,ge.Qr)(null===te||void 0===te?void 0:te.catalog)?null===b||void 0===b||null===(e=b.data_integration)||void 0===e?void 0:e.catalog:null===te||void 0===te?void 0:te.catalog}),[te,null===b||void 0===b||null===(n=b.data_integration)||void 0===n?void 0:n.catalog]),pe=((null===de||void 0===de?void 0:de.streams)||[]).every((function(e){return e.auto_add_new_fields})),ve=((null===de||void 0===de?void 0:de.streams)||[]).every((function(e){return e.disable_column_type_check})),he=(0,An.Z)(de);(0,s.useEffect)((function(){!he&&de&&(C((function(){return S(ne),[ne]})),j((function(e){var n;return e||(null===de||void 0===de||null===(n=de.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[de]);var me=(0,s.useState)(),be=me[0],xe=me[1],je=(0,d.Db)(W.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];C((function(){return S(ne),[ne]})),t.length>0&&I(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),m(Kt.cH.DATA),p()}else xe(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Ze=(0,r.Z)(je,2),Oe=Ze[0],Ce=Ze[1].isLoading,we=(0,d.Db)(W.ZP.integration_sources.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,o=((null===de||void 0===de?void 0:de.streams)||[]).filter((function(e){var n=e.tap_stream_id;return t.includes(n)})),r=o.map((function(e){return e.tap_stream_id})),l=i.filter((function(e){var n=e.tap_stream_id;return t.includes(n)&&!r.includes(n)}));l.forEach((function(e){e.metadata.forEach((function(n,t){var i=n.metadata;if(Pe.ks.UNSUPPORTED!==i.inclusion){var o;if(e.replication_method||(e.replication_method=Pe._B.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=Pe.MU.UPDATE),!e.destination_table)e.destination_table=null===e||void 0===e||null===(o=e.tap_stream_id)||void 0===o?void 0:o.replace(/\W+/g,"_");e.metadata[t]=Vt(Vt({},n),{},{metadata:Vt(Vt({},i),{},{selected:!0})})}}))}));var u={streams:o.concat(l)};j(Ve.map((function(e){return e.tap_stream_id})));var s=null===te||void 0===te?void 0:te.catalog;(0,ge.Qr)(s)||v(ne.type,ne.uuid,(0,ie.Pz)(Vt(Vt({},te),{},{catalog:{}})));var d={pipeline:Vt(Vt({},b),{},{data_integration:Vt(Vt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:u})})};g(d).then((function(){a(),c()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Se=(0,r.Z)(we,2),Ie=Se[0],Ee=Se[1].isLoading,Te=(0,s.useState)(null),Me=Te[0],De=Te[1],Be=(0,d.Db)(W.ZP.integration_source_streams.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){De(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Re=(0,r.Z)(Be,2),Ae=Re[0],Ne=Re[1].isLoading,Le=(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}}(de,e),i=t.stream,o=t.streams,r=Vt(Vt({},de),{},{streams:o.concat(n(i))}),l=null===te||void 0===te?void 0:te.catalog;(0,ge.Qr)(l)||v(ne.type,ne.uuid,(0,ie.Pz)(Vt(Vt({},te),{},{catalog:{}})));var u={pipeline:Vt(Vt({},b),{},{data_integration:Vt(Vt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:r})})};g(u).then((function(){return a()}))}),[de,ne,te,a,v,b,g]),Fe=(0,s.useCallback)((function(e){if(null!==de&&void 0!==de&&de.streams){var n=Vt(Vt({},de),{},{streams:de.streams.map((function(n){return e(n)}))}),t=null===te||void 0===te?void 0:te.catalog;(0,ge.Qr)(t)||v(ne.type,ne.uuid,(0,ie.Pz)(Vt(Vt({},te),{},{catalog:{}})));var i={pipeline:Vt(Vt({},b),{},{data_integration:Vt(Vt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return a()}))}}),[de,ne,te,a,v,b,g]),Ue=(0,s.useCallback)((function(e,n,t){Le(e,(function(e){return e.schema.properties[n]=t,e}))}),[Le]),He=(0,s.useCallback)((function(e,n,t){Le(e,(function(e){var i=e.metadata;return n.forEach((function(n){var o=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(o>=0){var r=i[o].metadata;e.metadata[o].metadata=Vt(Vt({},r),t)}})),e}))}),[Le]),ze=(0,d.Db)(W.ZP.blocks.pipelines.useUpdate(null===b||void 0===b?void 0:b.uuid,null===le||void 0===le?void 0:le.uuid),{onSuccess:function(e){return(0,X.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})}})}}),We=(0,r.Z)(ze,1)[0],Ke=(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,o="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,w.jsx)(P.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,w.jsx)(P.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,w.jsx)(P.ZP,{monospace:!0,children:o},"variable-uuid-".concat(t,"-{value}-code")),(0,w.jsx)(Pt.Z,{copiedText:o,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,w.jsx)(ye.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[f]),Ge=(0,s.useCallback)((function(e){return(0,w.jsxs)(Z.Z,{mt:2,children:[(0,w.jsxs)(P.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,w.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,w.jsx)("br",{}),"For more information, check out the ",(0,w.jsx)(k.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,w.jsx)(Z.Z,{mt:1,children:Ke})]})}),[Ke]),Ve=(0,s.useMemo)((function(){return(null===Me||void 0===Me?void 0:Me.streams)||[]}),[Me]),qe=(0,Fn.dd)((function(){return(0,w.jsx)(Ut,{catalog:de,isLoading:Ee,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)Ie({integration_source:{streams:n}}),Xe();else{var t=null===te||void 0===te?void 0:te.catalog;(0,ge.Qr)(t)||v(ne.type,ne.uuid,(0,ie.Pz)(Vt(Vt({},te),{},{catalog:{}}))),g({pipeline:Vt(Vt({},b),{},{data_integration:Vt(Vt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:null})})}).then((function(){return a()})),Xe()}},streams:Ve})}),{},[de,ne,te,a,Ee,v,g,Ve],{background:!0,uuid:"select_streams"}),Ye=(0,r.Z)(qe,2),Qe=Ye[0],Xe=Ye[1];return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{mb:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(T.ZP,{iconOnly:!0,onClick:function(){return A((function(e){return!e}))},children:(0,w.jsxs)(w.Fragment,{children:[R&&(0,w.jsx)(K.Kh,{size:1.5*O.iI}),!R&&(0,w.jsx)(K._M,{size:1.5*O.iI})]})}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(re.Z,{children:"Source"}),!R&&(0,w.jsxs)(re.Z,{default:!0,inline:!0,children:["\xa0",null===(t=Q[null===te||void 0===te?void 0:te.source])||void 0===t?void 0:t.name]})]})]})}),R&&(0,w.jsxs)(Z.Z,{mb:5,children:[(0,w.jsxs)(ue.dE,{children:[(0,w.jsxs)(Z.Z,{mb:5,children:[(0,w.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===Y||void 0===Y?void 0:Y.length)>0?(0,w.jsxs)(U.Z,{onChange:function(e){var n,t,i,r=e.target.value;if(r){V(null===(n=Q[r])||void 0===n?void 0:n.docs);var l=null===(t=Q[r])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;l&&Object.keys(l).forEach((function(e){l[e]=l[e]||null})),ne?v(ne.type,ne.uuid,(0,ie.Pz)(Vt(Vt({},te),{},{catalog:{},config:l,source:r}))):o({content:(0,ie.Pz)({config:l,source:r}),language:h.t6.YAML,type:h.tf.DATA_LOADER},0,_),De(null),g().then((function(){a()}))}},primary:!0,value:null===te||void 0===te?void 0:te.source,children:[(0,w.jsx)("option",{value:""}),Y.map((function(e){var n=e.name,t=e.uuid;return(0,w.jsx)("option",{value:t,children:n},t)}))]}):(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(H.Z,{inverted:!0}),(0,w.jsx)(Z.Z,{ml:1}),(0,w.jsx)(re.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ne&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(Z.Z,{mb:5,children:[(0,w.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===te||void 0===te?void 0:te.source)&&G&&(0,w.jsxs)(Z.Z,{mb:2,children:[(0,w.jsx)(kt.Z,{children:(0,w.jsx)(Zt.Z,{title:"Documentation: ".concat(te.source),children:(0,w.jsx)(ue.zG,{children:(0,w.jsx)(fe.Z,{children:G.replace(/\<br \/\>/g,"\n\n")})})})}),Ge("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),oe]}),(0,w.jsxs)("div",{children:[(0,w.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,w.jsx)(T.ZP,{loading:Ne,onClick:function(){g().then((function(){Ae().then((function(){return Qe()})),a()}))},primary:!0,small:!0,children:"View and select streams"})]}),be&&(0,w.jsx)(P.ZP,{warning:!0,children:be})]})]}),Ee&&(0,w.jsx)(Z.Z,{p:2,children:(0,w.jsx)(H.Z,{})}),!Ee&&(0,w.jsx)(Z.Z,{mt:3,children:(0,w.jsx)(Dt,{catalog:de,destination:null===ce||void 0===ce?void 0:ce.destination,isLoadingLoadSampleData:Ce,loadSampleData:function(e){return Oe({integration_source:{action_type:"sample_data",pipeline_uuid:null===b||void 0===b?void 0:b.uuid,streams:[e]}})},pipeline:b,setErrors:x,setSelectedStream:I,source:null===te||void 0===te?void 0:te.source,updateAllStreams:Fe,updateMetadataForColumns:He,updateSchemaProperty:Ue,updateStream:Le})})]}),(0,w.jsx)(Z.Z,{mb:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(T.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,w.jsxs)(w.Fragment,{children:[L&&ne&&(0,w.jsx)(K.Kh,{size:1.5*O.iI}),(!L||!ne)&&(0,w.jsx)(K._M,{disabled:!ne,size:1.5*O.iI})]})}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(y.ZP,{alignItems:"center",children:(0,w.jsx)(re.Z,{children:"Transformers"})})]})}),L&&ne&&(0,w.jsx)(Z.Z,{mb:5,children:(0,w.jsxs)(ue.dE,{children:[u.length>0&&(0,w.jsx)(Z.Z,{mb:1,children:u.map((function(e,n){return(0,w.jsx)(Z.Z,{mb:1,children:e},n)}))}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(qn.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ne&&i.push(ne.uuid),o(Vt(Vt({},e),{},{configuration:t,content:n,upstream_blocks:i}),l.length-1,(function(e){le&&(We({block:Vt(Vt({},le),{},{upstream_blocks:[e.uuid]})}),_(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!se,hideTransformerDataSources:!0,pipeline:b})})]})}),(0,w.jsx)(Z.Z,{mb:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(T.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return D((function(e){return!e}))},children:(0,w.jsxs)(w.Fragment,{children:[M&&ne&&(0,w.jsx)(K.Kh,{size:1.5*O.iI}),(!M||!ne)&&(0,w.jsx)(K._M,{disabled:!ne,size:1.5*O.iI})]})}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(re.Z,{children:"Destination"}),!M&&(0,w.jsxs)(re.Z,{default:!0,inline:!0,children:["\xa0",null===(i=ee[null===ce||void 0===ce?void 0:ce.destination])||void 0===i?void 0:i.name]})]})]})}),M&&ne&&(0,w.jsxs)(ue.dE,{children:[(0,w.jsxs)(Z.Z,{mb:5,children:[(0,w.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===$||void 0===$?void 0:$.length)>0?(0,w.jsxs)(U.Z,{onChange:function(e){var n=e.target.value;if(n){if(le)v(le.type,le.uuid,(0,ie.Pz)(Vt(Vt({},ce),{},{destination:n})));else{var t,i,r=null===(t=ee[n])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;r&&(Object.keys(r).forEach((function(e){r[e]=r[e]||null})),r.hasOwnProperty("table")&&delete r.table);var u=[];if((null===l||void 0===l?void 0:l.length)>=2){var c=l.find((function(e){var n=e.uuid;return(null===ne||void 0===ne?void 0:ne.uuid)!==n}));c&&u.push(c.uuid)}else ne&&u.push(ne.uuid);o({content:(0,ie.Pz)({config:r,destination:n}),language:h.t6.YAML,type:h.tf.DATA_EXPORTER,upstream_blocks:u},1,_)}g().then((function(){a()}))}},primary:!0,value:null===ce||void 0===ce?void 0:ce.destination,children:[(0,w.jsx)("option",{value:""}),$.map((function(e){var n=e.name,t=e.uuid;return(0,w.jsx)("option",{value:t,children:n},t)}))]}):(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(H.Z,{inverted:!0}),(0,w.jsx)(Z.Z,{ml:1}),(0,w.jsx)(re.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),le&&(0,w.jsxs)(Z.Z,{mb:5,children:[(0,w.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===ce||void 0===ce?void 0:ce.destination)&&(0,w.jsx)(w.Fragment,{children:(0,w.jsxs)(Z.Z,{mb:2,children:[(0,w.jsxs)(P.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,w.jsxs)(k.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(ce.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[ce.destination," documentation"]}),".",(0,w.jsx)("br",{}),(0,w.jsx)("br",{}),"If your configuration contains a key named ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,w.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,w.jsx)(P.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Ge("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),ae,(0,w.jsx)(Z.Z,{mt:3,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(Z.Z,{mr:2,children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,w.jsx)(P.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,w.jsx)(ke.Z,{checked:!!pe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return Vt(Vt({},e),{},{auto_add_new_fields:!pe})}))}})]})}),(0,w.jsx)(Z.Z,{mt:3,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(Z.Z,{mr:2,children:[(0,w.jsx)(P.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,w.jsxs)(P.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,w.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,w.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,w.jsx)(ke.Z,{checked:!!ve,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return Vt(Vt({},e),{},{disable_column_type_check:!ve})}))}})]})})]})]})]})},Yt=t(82359),Qt=t(35058),Xt=t(38399),Jt=t(33834),$t=t(42041);function ei(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ni(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ei(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ei(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ti=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.afterHidden,u=e.allBlocks,c=e.allowCodeBlockShortcuts,a=e.anyInputFocused,p=e.autocompleteItems,f=e.beforeHidden,v=e.blockInteractionsMapping,m=e.blockRefs,b=e.blocks,g=void 0===b?[]:b,x=e.blocksThatNeedToRefresh,j=e.dataProviders,y=e.deleteBlock,_=e.disableShortcuts,S=e.fetchFileTree,I=e.fetchPipeline,E=e.fetchSampleData,T=e.files,M=e.globalDataProducts,R=e.globalVariables,N=e.hiddenBlocks,L=e.interactionsMapping,U=e.interruptKernel,H=e.mainContainerRef,z=e.mainContainerWidth,K=e.messages,G=e.onChangeCallbackBlock,V=e.onChangeCodeBlock,q=e.openSidekickView,Y=e.pipeline,J=e.pipelineContentTouched,$=e.project,ee=e.restartKernel,ne=e.runBlock,te=e.runningBlocks,ie=void 0===te?[]:te,oe=e.savePipelineContent,re=e.scrollTogether,le=e.selectedBlock,ue=e.setAnyInputFocused,ce=e.setDisableShortcuts,ae=e.setEditingBlock,se=e.setErrors,de=e.setHiddenBlocks,pe=e.setIntegrationStreams,fe=e.setOutputBlocks,ve=e.setPipelineContentTouched,he=e.setSelectedBlock,me=e.setSelectedOutputBlock,be=e.setSelectedStream,xe=e.setTextareaFocused,je=e.showBrowseTemplates,ye=e.showConfigureProjectModal,ke=e.showDataIntegrationModal,Ze=e.showGlobalDataProducts,Pe=e.showUpdateBlockModal,Oe=e.sideBySideEnabled,Ce=e.textareaFocused,we=e.widgets,Se=(0,s.useRef)(null),Ie=(0,s.useRef)(null),Ee=(0,s.useRef)({}),Te=(0,s.useState)(!1),Me=Te[0],De=Te[1],Be=(0,s.useState)(!1),Re=Be[0],Ae=Be[1],Ne=(0,s.useState)(!1),Le=Ne[0],Fe=Ne[1],Ue=(0,s.useState)(!0),He=Ue[0],ze=Ue[1],We=(0,s.useState)(null),Ke=We[0],Ge=We[1],Ve=(0,s.useState)(null),qe=Ve[0],Ye=Ve[1],Qe=(0,s.useState)(!1),Xe=Qe[0],Je=Qe[1],$e=(0,s.useState)(""),en=$e[0],nn=$e[1],tn=(0,s.useState)({height:null,width:null,x:null,y:null}),on=tn[0],rn=tn[1],ln=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===Y||void 0===Y?void 0:Y.type)}),[Y]),un=(0,s.useMemo)((function(){return F.qL.STREAMING===(null===Y||void 0===Y?void 0:Y.type)}),[Y]),cn=(0,s.useMemo)((function(){return g.filter((function(e){var n=e.type;return!ln||h.tf.TRANSFORMER===n}))}),[g,ln]),sn=(0,s.useState)({}),dn=(sn[0],sn[1]),pn=(0,an.i)(),fn=pn.height,vn=pn.width;(0,s.useEffect)((function(){var e;null!==H&&void 0!==H&&H.current&&rn(null===H||void 0===H||null===(e=H.current)||void 0===e?void 0:e.getBoundingClientRect())}),[i,f,H,z,rn,fn,vn]);var hn=(0,s.useMemo)((function(){return ie.reduce((function(e,n,t){return ni(ni({},e),{},(0,l.Z)({},n.uuid,ni(ni({},n),{},{priority:t})))}),{})}),[ie]),bn=(0,s.useState)(null),gn=bn[0],xn=bn[1],yn=(0,s.useMemo)((function(){return(0,w.jsx)(it,{blocks:cn,columnIndex:0,columns:2,disabled:re,eventNameRefsMapping:(0,l.Z)({},Yn.$e,m),invisible:!(null!==g&&void 0!==g&&g.length)||!gn||re,mainContainerRect:on,scrollTogether:re,setCursorHeight:xn})}),[m,cn,gn,on,re,xn]),kn=(0,s.useState)(null),Pn=kn[0],On=kn[1],Cn=(0,s.useMemo)((function(){return(0,w.jsx)(it,{blocks:cn,columnIndex:1,columns:2,disabled:re,eventNameRefsMapping:(0,l.Z)({},Yn.tK,Ee),invisible:!(null!==g&&void 0!==g&&g.length)||!Pn||re,mainContainerRect:on,rightAligned:!0,scrollTogether:re,setCursorHeight:On})}),[Ee,cn,Pn,on,re,On]),wn=(0,s.useState)(null),_n=wn[0],Sn=wn[1],In=(0,s.useMemo)((function(){var e;return(0,w.jsx)(it,{blocks:cn,columnIndex:2,columns:1,disabled:!re,eventNameRefsMapping:(e={},(0,l.Z)(e,Yn.tK,Ee),(0,l.Z)(e,Yn.$e,m),e),invisible:!(null!==g&&void 0!==g&&g.length)||!_n||!re,mainContainerRect:on,rightAligned:!0,scrollTogether:re,setCursorHeight:Sn})}),[Ee,m,cn,_n,on,re,Sn]),Tn=(0,An.Z)(le),Mn=(0,s.useMemo)((function(){return g.length}),[g]),Dn=(0,s.useMemo)((function(){var e;return F.qL.PYTHON===(null===Y||void 0===Y?void 0:Y.type)&&(null===$||void 0===$||null===(e=$.features)||void 0===e?void 0:e[Yt.d.ADD_NEW_BLOCK_V2])}),[Y,$]),Bn=W.ZP.block_templates.list({show_all:!!Dn},{revalidateOnFocus:!1}).data,Rn=(0,s.useMemo)((function(){return(null===Bn||void 0===Bn?void 0:Bn.block_templates)||[]}),[Bn]),Ln=(0,s.useCallback)((function(e,t){var i=g[g.length-1],o=null,r=e.configuration||{},l=i?(0,et.eY)(i,e):[];i&&([h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(i.type)&&h.tf.SCRATCHPAD===e.type&&(o="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(Y.uuid,"', '").concat(i.uuid,"', 'output_0')\n")),h.t6.SQL===i.language&&(r=ni(ni({},(0,ge.GL)(i.configuration,[Qt.cH,Qt.Sv,Qt.sc,Qt.BD,Qt.nq])),r))),h.t6.SQL===e.language&&(o=(0,Xt.SF)(o)),o=(0,Xt.X7)(e,o);var u=null!==t?t:Mn;n(ni(ni({},e),{},{configuration:r,content:o,upstream_blocks:l}),u,he),xe(!0)}),[n,g,Mn,Y,he,xe]),Fn="PipelineDetail/index",Un=(0,Zn.y)(),zn=Un.disableGlobalKeyboardShortcuts,Kn=Un.registerOnKeyDown,Qn=Un.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){Qn(Fn)}}),[Qn,Fn]),Kn(Fn,(function(e,n,t){if(J&&(0,$t.y)([jn.zX,jn.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(!_&&!zn)if((0,$t.y)([jn.zX,jn.Um],n)||(0,$t.y)([jn.PQ,jn.Um],n))e.preventDefault(),oe();else if((0,$t.y)([jn.zH],n)||(0,$t.y)([jn.Fv],n)){if(le&&!e.repeat&&!(0,Jt.cK)(e)){var i=g.findIndex((function(e){var n=e.uuid;return le.uuid===n}));if(-1!==i){var o=(0,$t.y)([jn.zH],n)?i:i+1;Ln({type:h.tf.SCRATCHPAD},o)}}}else if(Ce)n[jn.vP]?xe(!1):J||jn.Z1.find((function(e){return n[e]}))||ve(!0);else if(!ln){var r;if(Dn&&((0,$t.y)([jn.zX,jn.A1],n)||(0,$t.y)([jn.PQ,jn.A1],n)))e.preventDefault(),Ae(!0),null===Ie||void 0===Ie||null===(r=Ie.current)||void 0===r||r.focus();else if(Dn&&Re&&(0,$t.y)([jn.vP],n)){var l;e.preventDefault(),Ae(!1),null===Ie||void 0===Ie||null===(l=Ie.current)||void 0===l||l.blur()}else if(le){var u=g.findIndex((function(e){var n=e.uuid;return le.uuid===n}));if(n[jn.vP])he(null);else if(t[0]===jn.xD&&t[1]===jn.xD)U();else if(t[0]===jn.l1&&t[1]===jn.l1&&-1!==u)y(le).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){u===g.length-1?he(g[u-1]):g.length>=0?he(g[u+1]):he(null)}),100)}));else if(n[jn.Bu]&&u>=1){var c=g[u-1];if(c){var s,d;he(c);var p="".concat(c.type,"s/").concat(c.uuid,".py");null===(s=m.current[p])||void 0===s||null===(d=s.current)||void 0===d||d.scrollIntoView()}}else if(n[jn.kD]&&u<=Mn-2){var f=g[u+1];if(f){var v,b;he(f);var x="".concat(f.type,"s/").concat(f.uuid,".py");null===(v=m.current[x])||void 0===v||null===(b=v.current)||void 0===b||b.scrollIntoView()}}else(0,$t.y)([jn.Uq],n)&&xe(!0)}else Tn&&n[jn.Uq]&&he(Tn);a||t[0]!==jn.OC||t[1]!==jn.OC||ee()}}),[n,a,m.current,g,Re,U,ln,Mn,J,ee,oe,Ie,le,Tn,ve,he,xe,Ce,Dn]),(0,s.useEffect)((function(){var e=setInterval((function(){J&&oe()}),1e4);return function(){clearInterval(e)}}),[J,oe]),(0,s.useEffect)((function(){setTimeout((function(){return Fe(!0)}),2*Nn.zn)}),[Y]);var Xn=(0,d.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return W.ZP.blocks.pipelines.useUpdate(null===Y||void 0===Y?void 0:Y.uuid,null===n||void 0===n?void 0:n.uuid)({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){I()},onErrorCallback:function(e,n){return null===se||void 0===se?void 0:se({errors:n,response:e})}})}}),Jn=(0,r.Z)(Xn,1)[0],nt=(0,s.useCallback)((function(e){De(!0),Ye(e),ce(!0)}),[De,ce,Ye]),tt=(0,s.useCallback)((function(){De(!1),Je(!1),nn(""),ce(!1)}),[ce]),ot=(0,s.useCallback)((function(e,n){var t,i;g.forEach((function(o,r){var l=o.uuid;t>=0&&i>=0||(l===e.uuid?t=r:l===n.uuid&&(i=r))}));var o=(0,_e.oM)(g,i);return o=(0,_e.Hk)(n,Math.max(t,0),o),oe({pipeline:{blocks:o,uuid:null===Y||void 0===Y?void 0:Y.uuid}})}),[g,Y,oe]),rt=(0,s.useMemo)((function(){return Y&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(qn.Z,{addNewBlock:Ln,blockTemplates:Rn,focusedAddNewBlockSearch:Re,hideCustom:ln||un,hideDataExporter:ln,hideDataLoader:ln,hideDbt:ln||un,hideScratchpad:ln,hideSensor:ln,onClickAddSingleDBTModel:nt,pipeline:Y,project:$,searchTextInputRef:Ie,setCreatingNewDBTModel:Je,setFocusedAddNewBlockSearch:Ae,showBrowseTemplates:je,showConfigureProjectModal:ye,showGlobalDataProducts:Ze}),!Dn&&!ln&&!un&&(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,w.jsx)("br",{}),"Turn on the feature named ",(0,w.jsx)(P.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:Yt.d.ADD_NEW_BLOCK_V2})," in your ",(0,w.jsx)(Gn(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,w.jsx)(k.Z,{muted:!0,underline:!0,children:(0,w.jsx)(P.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[Ln,Rn,Re,ln,un,nt,Y,$,Ie,Ae,je,ye,Ze,Dn]),lt=(0,s.useMemo)((function(){var e=[],i=(null===cn||void 0===cn?void 0:cn.length)||0;return cn.forEach((function(r,a){var d,f,b=a===i-1,k=r.type,Z=r.uuid,P=(null===le||void 0===le?void 0:le.uuid)===Z,O=hn[Z],E=O?0===O.priority?Hn.uF.BUSY:Hn.uF.QUEUED:Hn.uF.IDLE,T=(0,$n.zv)({type:k,uuid:Z});Ee.current[T]=(0,s.createRef)(),m.current[T]=(0,s.createRef)();var D=k===h.tf.MARKDOWN,B=k===h.tf.TRANSFORMER,R=!(null===N||void 0===N||!N[Z]),F=a===Mn-1||ln,W=Ee.current[T],Q=m.current[T],X=Z,J=null===x||void 0===x||null===(d=x[k])||void 0===d?void 0:d[Z];J&&(X="".concat(X,":").concat(J)),f=R?(0,w.jsx)(yt,{block:r,blocks:g,onClick:function(){return de((function(e){return ni(ni({},e),{},(0,l.Z)({},Z,!R))}))},onDrop:ot,ref:Q},X):(0,w.jsx)(A.Z,{addNewBlock:function(e,t){xe(!0);return n(e,Oe?a:a+1,(function(e){if(1===(null===t||void 0===t?void 0:t.length)){var n,i,r=null===(n=t[0])||void 0===n?void 0:n.uuid,l=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];Jn({block:{uuid:r},upstreamBlocks:[e.uuid].concat((0,o.Z)(l))})}null===he||void 0===he||he(e)}))},addNewBlockMenuOpenIdx:Ke,addWidget:t,allBlocks:u,allowCodeBlockShortcuts:c,autocompleteItems:p,block:r,blockIdx:a,blockInteractions:null===v||void 0===v?void 0:v[Z],blockOutputRef:W,blockRefs:m,blockTemplates:Rn,blocks:g,containerRef:Se,cursorHeight1:gn,cursorHeight2:Pn,cursorHeight3:_n,dataProviders:j,defaultValue:r.content,deleteBlock:function(e){y(e),ue(!1)},disableShortcuts:_,executionState:E,fetchFileTree:S,fetchPipeline:I,globalDataProducts:M,hideRunButton:un||D||ln&&B,interactionsMapping:L,interruptKernel:U,mainContainerRect:on,mainContainerRef:H,mainContainerWidth:z,messages:K[Z],noDivider:F,onCallbackChange:function(e){return G(k,Z,e)},onChange:function(e){return V(k,Z,e)},onClickAddSingleDBTModel:nt,onDrop:ot,openSidekickView:q,pipeline:Y,project:$,ref:Q,runBlock:ne,runningBlocks:ie,savePipelineContent:oe,scrollTogether:re,selected:P,setAddNewBlockMenuOpenIdx:Ge,setAnyInputFocused:ue,setCreatingNewDBTModel:Je,setEditingBlock:ae,setErrors:se,setMountedBlocks:dn,setOutputBlocks:fe,setSelected:function(e){return he(!0===e?r:null)},setSelectedBlock:he,setSelectedOutputBlock:me,setTextareaFocused:xe,showBrowseTemplates:je,showConfigureProjectModal:ye,showDataIntegrationModal:ke,showGlobalDataProducts:Ze,showUpdateBlockModal:Pe,sideBySideEnabled:Oe,textareaFocused:P&&Ce,widgets:we,windowWidth:vn,children:Oe&&b&&(0,w.jsx)("div",{style:{paddingBottom:C.WC,paddingTop:C.WC},children:rt})},X),e.push(f)})),e}),[n,Ke,rt,t,u,c,p,v,Ee,m,Rn,g,cn,x,Se,gn,Pn,_n,j,y,_,S,I,M,N,L,U,ln,un,on,H,z,K,Mn,G,V,nt,ot,q,Y,$,ne,ie,hn,oe,re,le,Ge,ue,ae,se,de,dn,fe,he,me,xe,je,ye,ke,Ze,Pe,Oe,Ce,Jn,we,vn]),ut=(0,s.useMemo)((function(){return(0,w.jsx)(qt,{addNewBlockAtIndex:n,blocks:g,codeBlocks:lt,fetchFileTree:S,fetchPipeline:I,fetchSampleData:E,globalVariables:R,onChangeCodeBlock:V,openSidekickView:q,pipeline:Y,savePipelineContent:oe,setErrors:se,setIntegrationStreams:pe,setOutputBlocks:fe,setSelectedBlock:he,setSelectedOutputBlock:me,setSelectedStream:be})}),[n,g,lt,S,I,E,R,V,q,Y,oe,se,pe,fe,he,me,be]);return(0,w.jsxs)(D.W,{backend:B.PD,children:[(0,w.jsx)(Nn.lO,{ref:Se,children:He&&(0,w.jsx)(Vn.Z,{classNames:"pipeline-detail",in:Le,onEntered:function(){return setTimeout((function(){return ze(!1)}),Nn.zn)},timeout:1,children:(0,w.jsx)(Nn.fm,{})})}),ln&&(0,w.jsx)(Z.Z,{mt:1,px:O.cd,children:ut}),!Oe&&(0,w.jsx)(Z.Z,{mt:1,px:O.cd,children:!ln&&(0,w.jsxs)(w.Fragment,{children:[lt,(0,w.jsx)(Z.Z,{mt:O.cd,children:rt})]})}),Oe&&(0,w.jsxs)("div",{style:{position:"relative"},children:[yn,lt,Cn,In,!(null!==g&&void 0!==g&&g.length)&&(0,w.jsx)(Z.Z,{p:O.cd,children:rt})]}),Me&&(0,w.jsx)(mn.Z,{onClickOutside:tt,open:!0,children:(0,w.jsx)(ft,{blocks:g,creatingNewDBTModel:Xe,dbtModelName:en,files:T,onClose:tt,onOpenFile:function(e){var t=e;if(Xe){var i=(0,Q.RA)(en||(0,Q.Y6)()),o=".".concat(En.Lu.SQL);i.endsWith(o)&&(i=i.slice(0,-4)),t="".concat(e).concat(Wn.sep).concat(i,".").concat(En.Lu.SQL)}var r={configuration:{file_path:t,limit:A.z},language:h.t6.SQL,name:(0,Q.wE)(t),type:h.tf.DBT};Xe&&(r.content="--Docs: https://docs.mage.ai/dbt/sources\n");var l="undefined"===typeof qe||null===qe,u=g[l?g.length-1:qe],c=u?(0,et.eY)(u,r):[];n(ni(ni({},r),{},{upstream_blocks:c}),(l?Mn:qe+1)-(Oe?1:0),he),tt(),xe(!0)},setDbtModelName:nn})})]})},ii=t(82555),oi=t(68487),ri=t(2842);function li(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ui(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?li(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):li(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ci=function(e){var n=e.after,t=e.afterFooter,i=e.afterHeader,o=e.afterHeightOffset,l=e.afterHidden,u=e.afterInnerHeightMinus,c=e.afterNavigationItems,a=e.afterOverflow,d=e.afterSubheader,p=e.before,f=e.beforeHeader,v=e.beforeHeightOffset,h=e.beforeHidden,m=e.beforeNavigationItems,b=e.children,g=e.errors,x=e.headerOffset,j=e.mainContainerHeader,y=e.mainContainerRef,k=e.page,Z=e.pipeline,P=e.setAfterHidden,O=e.setAfterWidthForChildren,C=e.setBeforeHidden,_=e.setErrors,S=e.setMainContainerWidth,I=(0,an.i)().width,E=(0,s.useState)((0,cn.U2)(cn.L8,ri.Zt)),T=E[0],M=E[1],D=(0,s.useState)((0,cn.U2)(cn.J3,ri.ve)),B=D[0],R=D[1],A=(0,s.useState)(!1),N=A[0],L=A[1],F=(0,s.useState)(!1),U=F[0],H=F[1],z=l,K=P;if(!K){var G=(0,s.useState)(!!(0,cn.U2)(cn.zg)),V=(0,r.Z)(G,2);z=V[0],K=V[1]}var q=h,Y=C;if(!Y){var X=(0,s.useState)(!!(0,cn.U2)(cn.Uu)),J=(0,r.Z)(X,2);q=J[0],Y=J[1]}(0,s.useEffect)((function(){null===y||void 0===y||!y.current||N||U||null===S||void 0===S||S(y.current.getBoundingClientRect().width)}),[N,U,z,T,q,B,y,S,I]),(0,s.useEffect)((function(){N||(null===O||void 0===O||O(T),(0,cn.t8)(cn.L8,T))}),[N,T,O]),(0,s.useEffect)((function(){U||(0,cn.t8)(cn.J3,B)}),[U,B]);var $=W.ZP.projects.list({},{revalidateOnFocus:!1}).data,ee=null===$||void 0===$?void 0:$.projects,ne=(0,s.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return Z&&(n.push.apply(n,[{bold:Yn.b7!==k,label:function(){return null===Z||void 0===Z?void 0:Z.uuid},linkProps:{as:"/pipelines/".concat(null===Z||void 0===Z?void 0:Z.uuid),href:"/pipelines/[pipeline]"}}]),Yn.b7===k&&n.push.apply(n,[{bold:!0,label:function(){return(0,Q.kC)(k)}}])),(0,w.jsx)(oi.Z,{breadcrumbs:n,project:null===ee||void 0===ee?void 0:ee[0],version:null===ee||void 0===ee||null===(e=ee[0])||void 0===e?void 0:e.version})}),[k,Z,ee]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Mn.Z,{title:null===Z||void 0===Z?void 0:Z.name}),(0,w.jsx)(un.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:o,afterHidden:z,afterInnerHeightMinus:u,afterMousedownActive:N,afterNavigationItems:c,afterOverflow:a,afterSubheader:d,afterWidth:T,before:p,beforeHeader:f,beforeHeightOffset:v,beforeHidden:q,beforeMousedownActive:U,beforeNavigationItems:m,beforeWidth:B,header:ne,headerOffset:x,mainContainerHeader:j,mainContainerRef:y,navigationShowMore:!0,setAfterHidden:K,setAfterMousedownActive:L,setAfterWidth:M,setBeforeHidden:Y,setBeforeMousedownActive:H,setBeforeWidth:R,children:b}),g&&(0,w.jsx)(mn.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return _(null)},children:(0,w.jsx)(ii.Z,ui(ui({},g),{},{onClose:function(){return _(null)}}))})]})},ai=t(55729),si=t(93808),di=t(8666),pi=t(72226),fi=t(29644),vi=t(46209),hi=t(21764),mi=t(46568),bi=t(82682),gi=t(17679),xi=t(61896),ji=(O.iI,gi.O$,O.iI,xi.dN,m.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],ri.Wi,Qn.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),m.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*O.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 ")}))),yi=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*O.iI,"px;\n ")})),ki=t(31748),Zi=t(79633);var Pi=function(e){var n=e.copyText,t=e.deleteVariable,i=e.disableKeyEdit,o=e.editStateInit,u=void 0!==o&&o,c=e.fetchVariables,a=e.focusKey,p=e.hideEdit,f=e.obfuscate,v=e.onEnterCallback,h=e.onEscapeCallback,m=e.pipelineUUID,b=e.updateVariable,g=e.variable||{},x=g.uuid,y=g.value,k=(0,s.useRef)(null),Z=(0,s.useRef)(null),C=(0,s.useState)(!1),_=C[0],S=C[1],I=(0,s.useState)(x),E=I[0],T=I[1],M=(0,s.useState)(y),D=M[0],B=M[1],R=(0,s.useState)(u),A=R[0],L=R[1],F=(0,d.Db)(W.ZP.variables.pipelines.useUpdate(m,x),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){L(!1),c()}})}}),U=(0,r.Z)(F,1)[0],H=(0,s.useCallback)((function(e){if("Enter"===e.key){var n=D;try{n=JSON.parse(D)}catch(t){}b?E&&D&&(null===b||void 0===b||b((0,l.Z)({},E,D)),L(!1)):U({variable:{name:E,value:n}}),(0,Jt.ez)(),null===v||void 0===v||v()}else"Escape"===e.key&&((0,Jt.ez)(),L(!1),null===h||void 0===h||h())}),[v,h,b,U,E,D]),G=(0,s.useCallback)((function(){(0,Jt.ez)(),t()}),[t]);(0,s.useEffect)((function(){var e,n;A&&(a?null===k||void 0===k||null===(e=k.current)||void 0===e||e.focus():null===Z||void 0===Z||null===(n=Z.current)||void 0===n||n.focus())}),[A,a]);var V=n||"kwargs['".concat(x,"']");return(0,w.jsx)("div",{onMouseEnter:function(){return S(!0)},onMouseLeave:function(){return S(!1)},children:(0,w.jsxs)(bi.Z,{children:[(0,w.jsx)(mi.Z,{hiddenSmDown:!0,md:1,children:(0,w.jsx)(yi,{noPadding:!0,children:(0,w.jsx)(N.ZP,{backgroundColor:ki.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(V),hi.Am.success("Successfully copied to clipboard.",{position:hi.Am.POSITION.BOTTOM_RIGHT,toastId:x})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(x),withIcon:!0,children:(0,w.jsx)(K.CK,{size:2.5*O.iI})})})}),(0,w.jsx)(mi.Z,{md:4,children:A&&!i?(0,w.jsx)(yi,{children:(0,w.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){T(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"variable",ref:k,small:!0,value:E})}):(0,w.jsx)(yi,{children:(0,w.jsx)(P.ZP,{color:Zi.Or,monospace:!0,small:!0,textOverflow:!0,children:x})})}),(0,w.jsx)(mi.Z,{md:7,children:A?(0,w.jsx)(yi,{children:(0,w.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){B(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"enter value",ref:Z,small:!0,value:D})}):(0,w.jsxs)(yi,{children:[f?(0,w.jsx)(P.ZP,{monospace:!0,small:!0,children:"********"}):(0,w.jsx)(P.ZP,{monospace:!0,small:!0,children:y}),(0,w.jsxs)(j.Z,{children:[!p&&_&&(0,w.jsx)(N.ZP,{backgroundColor:ki.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){L(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(x),withIcon:!0,children:(0,w.jsx)(K.I8,{size:2.5*O.iI})}),t&&_&&(0,w.jsx)(N.ZP,{backgroundColor:ki.qJ,borderless:!0,inline:!0,muted:!0,onClick:G,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(x),withIcon:!0,children:(0,w.jsx)(K.rF,{size:2.5*O.iI})})]})]})})]})})},Oi=m.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],Ce.n_,1.5*O.iI,O.l4,(function(e){return"\n border: ".concat(Ce.YF,"px ").concat(Ce.M8," ").concat((e.theme||Oe.Z).interactive.defaultBorder,";\n ")})),Ci=t(68781);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 _i(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,l.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 Si={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},Ii={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},Ei=(0,et.YW)();var Ti=function(e){e.addNewBlockAtIndex;var n,t,i,o,l=e.block,u=(e.contentByBlockUUID,e.fetchFileTree),c=e.fetchPipeline,a=e.globalDataProducts,p=e.pipeline,f=e.setSelectedBlock,v=(e.showDataIntegrationModal,e.showUpdateBlockModal),m=(0,s.useRef)(null),x=(0,s.useRef)(null),C=(0,s.useMemo)((function(){return null===p||void 0===p?void 0:p.uuid}),[p]),_=(0,s.useMemo)((function(){return(null===p||void 0===p?void 0:p.retry_config)||{}}),[p]),S=(0,s.useMemo)((function(){return!(null!==p&&void 0!==p&&p.run_pipeline_in_one_process)&&[F.qL.PYSPARK,F.qL.PYTHON].includes(null===p||void 0===p?void 0:p.type)}),[p]),I=l.color,E=l.configuration,M=l.language,D=l.name,B=l.type,R=l.uuid,A=(0,s.useMemo)((function(){return h.tf.DBT===B}),[B]),L=null===p||void 0===p||null===(n=p.blocks)||void 0===n?void 0:n.findIndex((function(e){return e.uuid===R})),G=(0,s.useMemo)((function(){var e;return null===p||void 0===p||null===(e=p.blocks)||void 0===e?void 0:e[L]}),[L,null===p||void 0===p?void 0:p.blocks]),V=(0,J.VI)(null,{},[],{uuid:"BlockSettings/index"}),Y=(0,r.Z)(V,1)[0],$=(0,s.useMemo)((function(){return(0,_e.HK)(a||[],(function(e){return e.uuid}))}),[a]),ee=(0,s.useMemo)((function(){var e,n=null===E||void 0===E||null===(e=E.global_data_product)||void 0===e?void 0:e.uuid;if(n&&$)return null===$||void 0===$?void 0:$[n]}),[E,$]),ne=W.ZP.pipelines.detail(di.b.PIPELINE===(null===ee||void 0===ee?void 0:ee.object_type)&&(null===ee||void 0===ee?void 0:ee.object_uuid)).data,te=(0,s.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.pipeline}),[ne]),ie=(0,s.useState)(null),oe=ie[0],le=ie[1],ce=(0,s.useState)(!1),se=ce[0],de=ce[1],pe=(0,s.useState)(!1),fe=pe[0],he=pe[1],me=(0,s.useState)(!1),be=me[0],xe=me[1],je=(0,An.Z)(l);(0,s.useEffect)((function(){(null===je||void 0===je?void 0:je.uuid)!==(null===l||void 0===l?void 0:l.uuid)&&le(l)}),[l,je]);var ke=(0,s.useMemo)((function(){return(null===oe||void 0===oe?void 0:oe.retry_config)||{}}),[oe]),Pe=(0,s.useCallback)((function(e){de(!0),le(e)}),[]),Oe=(0,s.useMemo)((function(){return(0,ge.gR)((null===oe||void 0===oe?void 0:oe.configuration)||E,["data_integration","file_path","global_data_product"])}),[null===oe||void 0===oe?void 0:oe.configuration,E]),Ce=(0,s.useCallback)((function(e){return Pe((function(n){return _i(_i({},n),{},{configuration:_i(_i({},null===oe||void 0===oe?void 0:oe.configuration),e)})}))}),[null===oe||void 0===oe?void 0:oe.configuration,Pe]),we=(0,s.useMemo)((function(){return null===oe||void 0===oe?void 0:oe.executor_type}),[oe]);(0,s.useEffect)((function(){fe||!we||Ci.R.find((function(e){return e===we}))||he(!0)}),[fe,we]);var Se=W.ZP.blocks.pipelines.detail(C,encodeURIComponent(R),{_format:"with_settings",block_type:B}).data,Ie=(0,s.useMemo)((function(){return(null===Se||void 0===Se?void 0:Se.block)||{}}),[Se]),Ee=(0,s.useMemo)((function(){return null!==Ie&&void 0!==Ie&&Ie.pipelines?Object.values(null===Ie||void 0===Ie?void 0:Ie.pipelines):[]}),[Ie]),Te=(null===Ee||void 0===Ee?void 0:Ee.length)||1,Me=(0,d.Db)(W.ZP.blocks.pipelines.useUpdate(C,encodeURIComponent(R)),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){de(!1),u(),c(),null!==e&&void 0!==e&&e.block&&f(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return Y({errors:n,response:e})}})}}),De=(0,r.Z)(Me,2),Be=De[0],Re=De[1].isLoading,Ae=((0,s.useCallback)((function(e){return Be({block:e})}),[Be]),(0,s.useMemo)((function(){return Te>=1&&(0,w.jsx)(ue.cl,{children:(0,w.jsx)(ye.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Description"}],rows:Ee.map((function(e){var n=e.pipeline,t=n.description,i=n.name,o=n.uuid;return[(null===p||void 0===p?void 0:p.uuid)===o?(0,w.jsxs)(P.ZP,{monospace:!0,muted:!0,children:[i||o," (current)"]},"name"):(0,w.jsx)(k.Z,{href:"/pipelines/".concat(o,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||o},"name"),(0,w.jsx)(P.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[Ee,Te,p])),Ne=(0,s.useMemo)((function(){return _&&"undefined"!==typeof _&&!(0,ge.Qr)(_)&&("undefined"!==typeof(null===_||void 0===_?void 0:_.delay)&&"undefined"===typeof(null===ke||void 0===ke?void 0:ke.delay)||"undefined"!==typeof(null===_||void 0===_?void 0:_.exponential_backoff)&&"undefined"===typeof(null===ke||void 0===ke?void 0:ke.exponential_backoff)||"undefined"!==typeof(null===_||void 0===_?void 0:_.max_delay)&&"undefined"===typeof(null===ke||void 0===ke?void 0:ke.max_delay)||"undefined"!==typeof(null===_||void 0===_?void 0:_.retries)&&"undefined"===typeof(null===ke||void 0===ke?void 0:ke.retries))}),[ke,_]),Le=(0,s.useMemo)((function(){var e;return(null===oe||void 0===oe||null===(e=oe.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[oe]),Fe=(0,s.useCallback)((function(e){return Pe((function(n){var t;return _i(_i({},n),{},{configuration:_i(_i({},null===oe||void 0===oe?void 0:oe.configuration),{},{global_data_product:e(null===oe||void 0===oe||null===(t=oe.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[oe,Pe]),Ue=(0,s.useMemo)((function(){return(0,ae.jO)(l,p)}),[l,p]);return(0,s.useMemo)((function(){return Ue&&(0,ae.Uc)(l)}),[l,Ue]),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(Z.Z,{mb:O.HN,pt:O.cd,children:[Te>1&&(0,w.jsx)(Z.Z,{mb:O.Mq,px:O.cd,children:(0,w.jsx)(Oi,{children:(0,w.jsxs)(y.ZP,_i(_i({},y.A0),{},{children:[(0,w.jsxs)(j.Z,{children:[(0,w.jsx)(K.BG,{fill:Zi.$R,size:q.l2}),(0,w.jsx)(Z.Z,{pr:2}),(0,w.jsxs)(P.ZP,{bold:!0,large:!0,lineHeight:3*O.iI,warning:!0,children:["Shared by ",Te," pipelines"]})]}),!A&&(null===p||void 0===p?void 0:p.type)!==F.qL.INTEGRATION&&(0,w.jsx)(Ze.Z,{appearBefore:!0,block:!0,label:"Duplicates block so it is no longer shared with any other pipelines (detaches other pipeline associations)",lightBackground:!0,maxWidth:30*O.iI,size:null,children:(0,w.jsx)(T.ZP,_i(_i({},Si),{},{afterIcon:(0,w.jsx)(K.L9,{size:q.bL}),iconOnly:!1,onClick:function(){return v(_i(_i({},(0,ge.gR)(G,["all_upstream_blocks_executed","callback_blocks","conditional_blocks","downstream_blocks","executor_config","executor_type","name","outputs","retry_config","status","tags","timeout"])),{},{detach:!0}),"".concat(D,"_copy"),!0)},padding:null,children:"Detach"}))})]}))})}),(0,w.jsx)(Z.Z,{mb:O.HN,px:O.cd,children:(0,w.jsxs)(ve.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,w.jsx)(ve.g,{noBorder:!0,children:(0,w.jsxs)(y.ZP,_i(_i({},y.A0),{},{children:[(0,w.jsx)(j.Z,{children:(0,w.jsx)(P.ZP,{bold:!0,default:!0,children:"Name"})}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(T.ZP,_i(_i({},Si),{},{afterIcon:A?null:(0,w.jsx)(K.I8,{size:q.bL}),disabled:A,onClick:function(){return v(l,D)},children:(0,w.jsx)(P.ZP,{bold:!0,children:D||""})}))]}))}),h.tf.CUSTOM===(null===l||void 0===l?void 0:l.type)?(0,w.jsx)(ve.g,{noBorder:!0,children:(0,w.jsxs)(y.ZP,_i(_i({},y.A0),{},{children:[(0,w.jsx)(j.Z,{children:(0,w.jsx)(P.ZP,{bold:!0,default:!0,children:"Color"})}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(T.ZP,_i(_i({},Si),{},{afterIcon:(0,w.jsx)(g.Z,{color:I?Ei[I]:null,size:q.bL,square:!0}),onClick:function(){return v(l,D)},outline:!1,children:(0,w.jsx)(P.ZP,{bold:!0,children:(0,Q.kC)(I||"")})}))]}))}):null]})}),(0,w.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,w.jsx)(re.Z,{level:5,children:"Executor type"}),(0,w.jsxs)(P.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,w.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,w.jsxs)(Z.Z,{mt:1,children:[!fe&&(0,w.jsx)(U.Z,{label:"Executor type",onChange:function(e){return Pe((function(n){return _i(_i({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:m,value:(null===oe||void 0===oe?void 0:oe.executor_type)||"",children:Ci.R.map((function(e){return(0,w.jsx)("option",{value:e,children:e},e)}))}),fe&&(0,w.jsx)(z.Z,{label:"Executor type",monospace:!0,onChange:function(e){return Pe((function(n){return _i(_i({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:x,setContentOnMount:!0,value:(null===oe||void 0===oe?void 0:oe.executor_type)||""}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(k.Z,{muted:!0,onClick:function(){fe?(Pe((function(e){return _i(_i({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===m||void 0===m||null===(e=m.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===x||void 0===x||null===(e=x.current)||void 0===e?void 0:e.focus()}),1),he(!fe)},preventDefault:!0,small:!0,children:fe?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,w.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,w.jsx)(re.Z,{level:5,children:"Retry configuration"}),(0,w.jsxs)(P.ZP,{muted:!0,children:[Ne&&(0,w.jsxs)(w.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,w.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,w.jsx)(k.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,w.jsxs)(Z.Z,{mt:1,children:[(0,w.jsxs)(y.ZP,{children:[(0,w.jsx)(z.Z,{label:"Retries",monospace:!0,onChange:function(e){return Pe((function(n){var t;return _i(_i({},n),{},{retry_config:_i(_i({},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===_||void 0===_?void 0:_.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ke||void 0===ke?void 0:ke.retries)?null===ke||void 0===ke?void 0:ke.retries:(null===_||void 0===_?void 0:_.retries)||""}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(z.Z,{label:"Delay",monospace:!0,onChange:function(e){return Pe((function(n){var t;return _i(_i({},n),{},{retry_config:_i(_i({},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===_||void 0===_?void 0:_.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ke||void 0===ke?void 0:ke.delay)?null===ke||void 0===ke?void 0:ke.delay:(null===_||void 0===_?void 0:_.delay)||""}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(z.Z,{label:"Max delay",monospace:!0,onChange:function(e){return Pe((function(n){var t;return _i(_i({},n),{},{retry_config:_i(_i({},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===_||void 0===_?void 0:_.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ke||void 0===ke?void 0:ke.max_delay)?null===ke||void 0===ke?void 0:ke.max_delay:(null===_||void 0===_?void 0:_.max_delay)||""})]}),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsx)(b.Z,{checked:"undefined"===typeof(null===ke||void 0===ke?void 0:ke.exponential_backoff)&&"undefined"!==typeof(null===_||void 0===_?void 0:_.exponential_backoff)?!(null===_||void 0===_||!_.exponential_backoff):!(null===ke||void 0===ke||!ke.exponential_backoff),label:"Exponential backoff",onClick:function(){return Pe((function(e){var n;return _i(_i({},e),{},{retry_config:_i(_i({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===ke||void 0===ke?void 0:ke.exponential_backoff)&&"undefined"!==typeof(null===_||void 0===_?void 0:_.exponential_backoff)?!(null!==_&&void 0!==_&&_.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),S&&(0,w.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,w.jsx)(re.Z,{level:5,children:"Block run timeout"}),(0,w.jsx)(Z.Z,{mb:1}),(0,w.jsx)(z.Z,{label:"Time in seconds",monospace:!0,onChange:function(e){return Pe((function(n){return _i(_i({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null===oe||void 0===oe?void 0:oe.timeout)||""}),(0,w.jsx)(Z.Z,{mb:1}),(0,w.jsx)(P.ZP,{muted:!0,small:!0,children:"The block timeout will only be applied when the block is run through a trigger. If a block times out, the block run will be set to a failed state."})]}),A&&(0,w.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,w.jsx)(re.Z,{level:5,children:"dbt settings"}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsx)(b.Z,{checked:!(null===oe||void 0===oe||null===(t=oe.configuration)||void 0===t||null===(i=t.dbt)||void 0===i||!i.disable_tests),label:"Disable automatically running dbt tests",onClick:function(){return Pe((function(e){var n,t,i;return _i(_i({},e),{},{configuration:_i(_i({},null===e||void 0===e?void 0:e.configuration),{},{dbt:_i(_i({},null===e||void 0===e||null===(n=e.configuration)||void 0===n?void 0:n.dbt),{},{disable_tests:!(null!==e&&void 0!==e&&null!==(t=e.configuration)&&void 0!==t&&null!==(i=t.dbt)&&void 0!==i&&i.disable_tests)})})})}))}})})]}),h.Lk.includes(B)&&h.t6.PYTHON===M&&(0,w.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(re.Z,{level:5,children:"Block variables"}),(0,w.jsx)(Z.Z,{ml:2}),(0,w.jsx)(N.ZP,{Icon:K.mm,blackBorder:!0,halfPaddingBottom:!0,halfPaddingTop:!0,inline:!0,onClick:function(){return xe((function(e){return!e}))},smallIcon:!0,uuid:"Sidekick/BlockSettings/addNewBlockVariable",children:"New"})]}),(0,w.jsxs)(Z.Z,{mb:O.cd,mt:1,children:[(0,w.jsxs)(P.ZP,{muted:!0,children:["Press",(0,w.jsx)(P.ZP,_i(_i({},Ii),{},{children:" Enter"}))," or",(0,w.jsx)(P.ZP,_i(_i({},Ii),{},{children:" Return"}))," on a row to add or update a variable. These variables are only accessible in this block\xa0",(0,w.jsxs)(P.ZP,_i(_i({},Ii),{},{bold:!1,children:["(",R,")."]})),(0,w.jsxs)(P.ZP,{inline:!0,muted:!0,children:[" Refer to the",(0,w.jsx)(k.Z,{href:"https://docs.mage.ai/development/variables/block-variables",openNewWindow:!0,children:" documentation"})," for more details."]})]}),(0,w.jsxs)(P.ZP,{muted:!0,children:[(0,w.jsx)(P.ZP,{bold:!0,inline:!0,warning:!0,children:"Note: "}),"Click the",(0,w.jsx)(P.ZP,_i(_i({},Ii),{},{children:" Update block settings"}))," button below to save changes. If you do not, any new or updated block variables will not be persisted."]})]}),(0,w.jsxs)(Z.Z,{mb:O.cd,children:[be&&(0,w.jsx)(Pi,{editStateInit:!0,focusKey:!0,onEnterCallback:function(){return xe(!1)},onEscapeCallback:function(){return xe(!1)},updateVariable:Ce},"new_block_variable"),null===(o=Object.entries(Oe))||void 0===o?void 0:o.map((function(e){var n=e[0];return(0,w.jsx)(Pi,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=_i({},null===oe||void 0===oe?void 0:oe.configuration);delete e[n],Pe((function(n){return _i(_i({},n),{},{configuration:_i({},e)})}))},disableKeyEdit:!0,updateVariable:Ce,variable:{uuid:n,value:e[1]}},n)}))]})]}),h.tf.GLOBAL_DATA_PRODUCT===B&&(0,w.jsxs)(Z.Z,{mb:O.HN,children:[(0,w.jsx)(Z.Z,{px:O.cd,children:(0,w.jsx)(re.Z,{level:5,children:"Override global data product settings"})}),(0,w.jsx)(Z.Z,{mt:O.Mq,children:(0,w.jsx)(pi.Z,{objectAttributes:Le,originalAttributes:ee,setObjectAttributes:Fe})}),(0,w.jsx)(Z.Z,{mt:O.Mq,children:(0,w.jsx)(fi.Z,{objectAttributes:Le,originalAttributes:ee,setObjectAttributes:Fe})}),(0,w.jsx)(Z.Z,{mt:O.Mq,children:(0,w.jsx)(vi.Z,{blocks:null===te||void 0===te?void 0:te.blocks,objectAttributes:Le,originalAttributes:ee,setObjectAttributes:Fe})})]}),(0,w.jsx)(Z.Z,{px:O.cd,children:(0,w.jsx)(T.ZP,{disabled:!se,loading:Re,onClick:function(){return Be({block:{configuration:null===oe||void 0===oe?void 0:oe.configuration,executor_type:null===oe||void 0===oe?void 0:oe.executor_type,retry_config:ke,timeout:null===oe||void 0===oe?void 0:oe.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,w.jsxs)(Z.Z,{mb:O.HN,children:[!Se&&(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsx)(H.Z,{inverted:!0})}),Se&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsxs)(re.Z,{level:5,children:["Pipelines using this block (",Te,")"]}),(0,w.jsx)(P.ZP,{default:!0,children:"A shared block is available to and reused by multiple pipelines. It enables you to write code once and have it easily accessible anywhere in the workspace. As a result, any code changes will affect all pipelines sharing the block."})]}),Ae]})]})]})},Mi=t(4006),Di=t(12869),Bi=t(10305),Ri=t(84820),Ai=t(85108),Ni=t(97301);function Li(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Fi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Li(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Li(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Ui(e,n){var t,i,o,u,c=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===_?[]:_,I=e.onChangeContent,E=e.pipeline,T=e.runBlock,M=e.runningBlocks,D=e.savePipelineContent,B=e.selected,R=e.setAnyInputFocused,A=e.setErrors,L=e.setSelectedBlock,F=e.setTextareaFocused,G=e.textareaFocused,V=e.updateWidget,q=e.width,Y=(0,s.useRef)(null),J=(0,s.useContext)(m.ThemeContext),$=W.ZP.blocks.pipelines.detail(null===E||void 0===E?void 0:E.uuid,null===a||void 0===a?void 0:a.upstream_blocks[0]).data,ee=(null===$||void 0===$||null===(t=$.block)||void 0===t?void 0:t.outputs)||(null===a||void 0===a?void 0:a.outputs)||[],ne=(0,s.useState)(null),te=ne[0],ie=ne[1],re=(0,s.useState)(null===(i=a.configuration)||void 0===i?void 0:i.chart_type),le=re[0],ue=re[1],ce=(0,s.useState)(a.configuration),ae=ce[0],se=ce[1],de=(0,s.useState)(a.content),pe=de[0],fe=de[1],ve=(0,s.useState)(!le||0===ee.length),he=ve[0],me=ve[1],be=(0,s.useState)(!1),xe=be[0],ye=be[1],ke=(0,s.useState)(null),Pe=ke[0],Ce=ke[1],we=(0,s.useState)(null===a||void 0===a?void 0:a.upstream_blocks),Se=we[0],Ie=we[1],Ee=(0,s.useState)((null===ee||void 0===ee?void 0:ee.length)||0),Te=Ee[0],Me=Ee[1],De=(0,s.useState)(a.uuid),Be=De[0],Re=De[1],Ae=Ai.G8[le],Ne=Ai.x8[le],Le=(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]),Fe=(0,s.useMemo)((function(){return(0,_e.HK)(Le,(function(e){return e.uuid}))}),[Le]),Ue=!!M.find((function(e){return e.uuid===a.uuid}))||(null===S||void 0===S?void 0:S.length)>=1&&b!==Hn.uF.IDLE,He=(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]),ze=!!He.find((function(e){return e.error})),We=He.length>=1,Ke=(0,s.useMemo)((function(){return{blockType:a.type,hasError:ze,selected:B}}),[a.type,ze,B]);if(null!==He&&void 0!==He&&He.length){var Ge,Ve,qe=He.length-1;u=null===He||void 0===He||null===(Ge=He[qe])||void 0===Ge||null===(Ve=Ge.data)||void 0===Ve?void 0:Ve[0]}u?(u=(u=u.slice(1,u.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,Q.Pb)(u)&&(o=JSON.parse(u))):(null===ee||void 0===ee?void 0:ee.length)>=1&&(o={},ee.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,r=n.variable_uuid;Hn.Gi.TEXT===i&&(0,Q.Pb)(t)&&(o[r]=JSON.parse(t))})));var Ye=(0,s.useCallback)((function(e){var n=Fi(Fi(Fi({},a),e),{},{configuration:Fi(Fi({},a.configuration),e.configuration)});D().then((function(){T({block:n,code:pe,ignoreAlreadyRunning:!0,runUpstream:!!Se.find((function(e){var n;return![h.DA.EXECUTED,h.DA.UPDATED].includes(null===(n=Fe[e])||void 0===n?void 0:n.status)}))})})),Me((function(e){return e+1}))}),[a,Fe,pe,T,D,Me,Se]),Qe=(0,s.useCallback)((function(e){fe(e),I(e)}),[I,fe]),Xe=(0,s.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;se((function(n){return Fi(Fi({},n),e)}));var i=Fi(Fi({},a),{},{configuration:Fi(Fi(Fi({},ae),e),{},{chart_type:le})});V(i),Te&&t&&Ye(i)}),[a,le,ae,Te,Ye,se,V]);(0,s.useEffect)((function(){ie({python:(0,Ri.Z)({autocompleteItems:c,block:a,blocks:f,pipeline:E})})}),[c,a,f,E]);var Je=(0,s.useMemo)((function(){return(0,w.jsx)(oe.Z,{autoHeight:!0,autocompleteProviders:te,onChange:Qe,selected:B,setSelected:function(e){return L(!0===e?a:null)},setTextareaFocused:F,showLineNumbers:!1,textareaFocused:G||Qt.oV.TABLE===le&&!he,value:pe,width:"100%"})}),[te,a,le,pe,he,B,L,F,G,Qe]),$e=(0,s.useMemo)((function(){return(ze||We)&&(0,w.jsx)(Di.Z,Fi(Fi({},Ke),{},{block:a,contained:!1,hideExtraInfo:!0,isInProgress:Ue,messages:He,selected:B}))}),[a,Ke,ze,We,Ue,He,B]),en=(0,An.Z)(he),nn=(0,An.Z)(q);(0,s.useEffect)((function(){var e,n=null===Y||void 0===Y||null===(e=Y.current)||void 0===e?void 0:e.getBoundingClientRect();en!==he||nn!==q?(Ce(0),setTimeout((function(){var e,n,t=null===Y||void 0===Y||null===(e=Y.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&Ce(t)}),100)):n&&Ce(n.width)}),[he,en,Y,Ce,q,nn]);var tn=(0,s.useMemo)((function(){var e=[];return Se.forEach((function(n,t){var i=Fe[n],o=(0,C.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,w.jsxs)(Z.Z,{ml:2,children:[(0,w.jsxs)(P.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,w.jsx)(k.Z,{color:o,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,w.jsx)(P.ZP,{color:o,monospace:!0,small:!0,children:n})})]},n))})),e}),[p,Fe,J,Se]),on=(0,s.useMemo)((function(){var e,n=[],t=null===Ae||void 0===Ae||null===(e=Ae.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return Qt.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=ae[e];if(t){var i,o,r=null===(i=Ai.SR[le])||void 0===i||null===(o=i[e])||void 0===o?void 0:o.call(i);n.push((0,w.jsxs)(Z.Z,{ml:2,children:[(0,w.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",r&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,w.jsx)(P.ZP,{default:!0,inline:!0,small:!0,children:r})]})]},t))}})),n}),[le,ae,Ae]),rn=(0,An.Z)(le),ln=(0,An.Z)(Se);(0,s.useEffect)((function(){if((!rn&&le&&null!==Se&&void 0!==Se&&Se.length||(null===ln||void 0===ln||!ln.length)&&(null===Se||void 0===Se?void 0:Se.length)>=1&&le)&&!pe&&(0,ge.Qr)(ae)&&Ne){var e=Fi(Fi({},a),{},{upstream_blocks:Se});Ne.configuration&&Xe(Ne.configuration(e)),Ne.content&&Qe(Ne.content(e))}}),[a,le,rn,ae,pe,Ne,Xe,Qe,Se,ln]);var un=(0,s.useMemo)((function(){return ae[Qt.v8]||1}),[ae]),cn=(0,s.useMemo)((function(){return Object.entries(Ae||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0],o=t[1];return Fi(Fi({},e),{},(0,l.Z)({},i,o.map((function(e){var n,t=e.autoRun,i=e.label,o=e.monospace,r=e.options,u=e.settings,c=void 0===u?{}:u,s=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,Q.kC)(i()),monospace:o,onBlur:function(){return L(a)},onChange:function(e){return Xe((0,l.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return L(a)},value:(null===ae||void 0===ae?void 0:ae[d])||""},f=(null!==$&&void 0!==$&&$.block?[$.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(Ai.VR.COLUMNS===s){var v=ae[d]||[];n=(0,w.jsxs)(w.Fragment,{children:[(!c.maxValues||v.length<c.maxValues)&&(0,w.jsx)(U.Z,Fi(Fi({},p),{},{onChange:function(e){var n=ae[d]||[],i=e.target.value;n.includes(i)?n=(0,_e.Od)(n,(function(e){return e===i})):n.push(i),Xe((0,l.Z)({},d,n),{autoRun:t})},value:null,children:(0,_e.YC)(f.filter((function(e){return!v.includes(e)})),(function(e){return e})).map((function(e){return(0,w.jsx)("option",{value:e,children:e},e)}))})),v.map((function(e){return(0,w.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,w.jsx)(je.Z,{label:e,onClick:function(){Xe((0,l.Z)({},d,(0,_e.Od)(v,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(Ai.VR.METRICS===s){var h=ae[d]||[];n=(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(P.ZP,{bold:!0,children:"Metrics"}),(0,w.jsx)(P.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,w.jsxs)(Bi.Z,{onChange:function(e,n){var i=n.resetValues,o=n.setValues;2===e.filter((function(e){return!!e})).length&&(h.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||(Xe((0,l.Z)({},d,h.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),o([null,null]),i()))},children:[(0,w.jsx)(U.Z,Fi(Fi({},p),{},{label:"aggregation",children:(0,_e.YC)(Qt.bn,(function(e){return e})).map((function(e){return(0,w.jsx)("option",{value:e,children:e},e)}))})),(0,w.jsx)(U.Z,Fi(Fi({},p),{},{label:"column",children:(0,_e.YC)(f,(function(e){return e})).map((function(e){return(0,w.jsx)("option",{value:e,children:e},e)}))}))]}),h.map((function(e){var n=e.aggregation,i=e.column;return(0,w.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,w.jsx)(je.Z,{label:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(P.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){Xe((0,l.Z)({},d,(0,_e.Od)(h,(function(e){var t=e.aggregation,o=e.column;return n===t&&i===o}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=r?(0,w.jsx)(U.Z,Fi(Fi({},p),{},{children:r.map((function(e){return(0,w.jsx)("option",{value:e,children:e},e)}))})):(0,w.jsx)(z.Z,Fi(Fi({},p),{},{type:s}));return(0,w.jsx)(Z.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[a,ae,Ae,$,L,Xe]),an=cn.code,sn=cn.noCode,dn=(0,d.Db)(W.ZP.widgets.pipelines.useUpdate(null===E||void 0===E?void 0:E.uuid,a.uuid),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){ye(!1),g(),x()},onErrorCallback:function(e,n){return null===A||void 0===A?void 0:A({errors:n,response:e})}})}}),pn=(0,r.Z)(dn,1)[0],fn="ChartBlock/".concat(a.uuid),vn=(0,Zn.y)(),hn=vn.registerOnKeyDown,mn=vn.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){mn(fn)}}),[mn,fn]),hn(fn,(function(e,n,t){xe&&String(t[0])===String(jn.Uq)&&String(t[1])!==String(jn.zX)&&pn({widget:Fi(Fi({},a),{},{name:Be})})}),[a,xe,Be,pn]),(0,w.jsx)(mi.Z,{sm:12,md:12*un,children:(0,w.jsxs)(Ni.pM,{ref:n,children:[(0,w.jsx)(Z.Z,{mt:1,pt:1,px:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{flex:1,style:{position:"relative"},children:[(0,w.jsx)(at,{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(){R(!0),ye(!0)},onFocus:function(){R(!0),ye(!0)},small:!0,stacked:!0,value:!xe&&a.uuid}),xe&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{ml:1}),(0,w.jsx)(k.Z,{noWrapping:!0,onClick:function(){return pn({widget:Fi(Fi({},a),{},{name:Be})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(U.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Fi(Fi({},a),{},{upstream_blocks:n});V(t),Ye(t),Ie(n)},placeholder:"Source block",small:!0,value:(null===Se||void 0===Se?void 0:Se[0])||"",children:null===Le||void 0===Le?void 0:Le.map((function(e){var n=e.uuid;return(0,w.jsx)("option",{value:n,children:n},n)}))}),(0,w.jsx)(Z.Z,{mr:1}),!Ue&&(0,w.jsx)(Ze.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,w.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Ye(a)},uuid:"ChartBlock/run/".concat(a.uuid),children:(0,w.jsx)(K.Py,{size:2*O.iI})})}),Hn.uF.QUEUED===b&&(0,w.jsx)(H.Z,{color:(J||Oe.Z).content.active,small:!0,type:"cylon"}),Hn.uF.BUSY===b&&(0,w.jsx)(H.Z,{color:(J||Oe.Z).content.active,small:!0}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(Ze.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,w.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return me((function(e){return!e}))},selected:he,uuid:"ChartBlock/edit/".concat(a.uuid),children:(0,w.jsx)(K.I8,{size:2*O.iI})})}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(Ze.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,w.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return v(a)},uuid:"ChartBlock/delete/".concat(a.uuid),children:(0,w.jsx)(K.rF,{size:2*O.iI})})})]})]})}),(0,w.jsx)(Z.Z,{mt:1}),(0,w.jsxs)(y.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,w.jsx)(j.Z,{flex:6,ref:Y,children:o&&!(0,ge.Qr)(o)&&(0,w.jsx)(Z.Z,{pb:3,children:(0,w.jsx)(Mi.Z,{block:Fi(Fi({},a),{},{configuration:Fi(Fi({},a.configuration),ae)}),data:o,width:Pe})})}),he&&(0,w.jsx)(Ni.Tb,{children:(0,w.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,w.jsx)(Z.Z,{mb:1,children:(0,w.jsx)(U.Z,{onChange:function(e){var n=e.target.value,t=Fi(Fi({},a),{},{configuration:Fi(Fi({},ae),{},{chart_type:n})});V(t),Ye(t),ue(n)},placeholder:"Select chart type",value:le,children:Qt.CK.map((function(e){return(0,w.jsx)("option",{value:e,children:(0,Q.kC)(e)},e)}))})}),(0,w.jsx)(Z.Z,{mb:1,children:(0,w.jsx)(U.Z,{onChange:function(e){return Xe((0,l.Z)({},Qt.v8,e.target.value))},placeholder:"Chart width",value:(null===ae||void 0===ae?void 0:ae[Qt.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return(0,w.jsx)("option",{value:i,children:t},t)}))})}),sn]})})]}),he&&!(null===an||void 0===an||!an.length)&&h.t6.SQL!==a.language&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(Z.Z,{my:1,px:1,children:[(0,w.jsx)(P.ZP,{bold:!0,children:"Custom chart code"}),(0,w.jsxs)(P.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,w.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,w.jsxs)(Ni.T7,{children:[Se.length>=1&&(0,w.jsxs)(Ni.y9,{children:[(0,w.jsxs)(P.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",tn]}),(0,w.jsxs)(P.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",on]})]}),Je]})]}),$e&&(0,w.jsx)(Z.Z,{px:1,children:$e})]})})}var Hi=s.forwardRef(Ui),zi=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];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 Ki(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,l.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 Gi=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,o=e.deleteWidget,r=e.messages,u=e.onChangeChartBlock,c=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,he.Z)(e,zi),Z=(0,s.useMemo)((function(){return a.reduce((function(e,n,t){return Ki(Ki({},e),{},(0,l.Z)({},n.uuid,Ki(Ki({},n),{},{priority:t})))}),{})}),[a]);return(0,w.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,w.jsx)(bi.Z,{fullHeight:!0,style:{marginLeft:.5*O.iI,marginRight:.5*O.iI},children:null===x||void 0===x?void 0:x.map((function(e){var l=e.uuid,x=Z[l],y=x?0===x.priority?Hn.uF.BUSY:Hn.uF.QUEUED:Hn.uF.IDLE;return i.current[l]=(0,s.createRef)(),(0,s.createElement)(Hi,Ki(Ki({},k),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:o,executionState:y,key:l,messages:r[l],onChangeContent:function(e){return u(l,e)},ref:i.current[l],runBlock:c,runningBlocks:a,savePipelineContent:d,selected:(null===p||void 0===p?void 0:p.uuid)===l,setAnyInputFocused:f,setErrors:v,setSelectedBlock:h,setTextareaFocused:m,textareaFocused:b,updateWidget:g,width:j}))}))}),(0,w.jsx)("div",{style:{height:"80vh"}})]})},Vi=t(24138),qi=m.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),Yi=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,o=void 0===i?"0 0 358 305":i;return(0,w.jsxs)(qi,{height:t*(305/358),viewBox:o,width:t,children:[(0,w.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,w.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,w.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,w.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,w.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,w.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,w.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,w.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,w.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,w.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,w.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,w.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,w.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,w.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,w.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,w.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,w.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,w.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,w.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 Qi,Xi=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,w.jsx)(w.Fragment,{})};function Ji(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function $i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ji(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ji(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}(Qi||(Qi={}));var eo=function(e){var n,t,i=e.block,o=e.blockActionDescription,r=e.blocks,l=e.inputPlaceholder,u=e.loading,c=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),I=S[0],E=S[1],M=(0,s.useState)(null),D=M[0],B=M[1],R=(0,s.useMemo)((function(){return(0,_e.HK)(r,(function(e){return e.uuid}))}),[r]);(0,s.useEffect)((function(){D||B((0,_e.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,D]);var A=(0,s.useMemo)((function(){return(null===r||void 0===r?void 0:r.filter((function(e){var n=e.name,t=e.type,i=e.uuid;return((null===n||void 0===n?void 0:n.toLowerCase().includes(null===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,r,p]),N=(0,s.useMemo)((function(){var e=[];return null===A||void 0===A||A.forEach((function(n,t){var i=n.color,o=n.language,r=n.type,l=n.uuid,u=(0,C.qn)(r,{blockColor:i,theme:v}).accent;t>=1&&e.push((0,w.jsx)(x.Z,{light:!0},"divider-".concat(l)));var c=!(null===D||void 0===D||!D[l]),a=null!==d&&"undefined"!==typeof d&&!(null!==d&&void 0!==d&&d.includes(o));e.push((0,w.jsx)(Z.Z,{px:2,py:1,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{alignItems:"center",children:[(0,w.jsx)(g.Z,{color:u,size:1.5*O.iI,square:!0}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(P.ZP,{monospace:!0,muted:a,small:!0,children:l})]}),a&&(0,w.jsxs)(P.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[o," support coming soon"]}),!a&&(0,w.jsx)(b.Z,{checked:!a&&c,disabled:a,onClick:function(){B((function(e){var n=$i({},e);return c?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[A,v,D]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(mn.Z,{onClickOutside:function(){return E(!1)},open:!0,children:[(0,w.jsx)(z.Z,{beforeIcon:(0,w.jsx)(K.HN,{}),borderless:!0,compact:!0,onChange:function(e){return _(e.target.value)},onClick:function(e){(0,De.j)(e),E(!0)},onFocus:function(e){(0,De.j)(e),E(!0)},placeholder:l,small:!0,value:k}),I&&(0,w.jsxs)(w.Fragment,{children:[N,(0,w.jsx)(Z.Z,{p:1,children:(0,w.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,w.jsx)(T.ZP,{compact:!0,loading:u,onClick:function(){return f({block:i,upstream_blocks:Object.keys(D)}).then((function(){return E(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!I&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,w.jsxs)(Z.Z,{pb:1,pr:1,children:[o&&(0,w.jsx)(Z.Z,{mt:1,pl:1,children:(0,w.jsx)(P.ZP,{muted:!0,small:!0,children:o})}),(0,w.jsx)(y.ZP,{alignItems:"center",children:null===i||void 0===i||null===(t=i.upstream_blocks)||void 0===t?void 0:t.map((function(e){var n=null===R||void 0===R?void 0:R[e];if(!n)return(0,w.jsx)("div",{},e);var t=n.color,o=n.type,r=(0,C.qn)(o,{blockColor:t,theme:v}).accentLight;return(0,w.jsx)(Z.Z,{ml:1,mt:1,children:(0,w.jsx)(T.ZP,{backgroundColor:r,compact:!0,disabled:!a,onClick:function(e){(0,De.j)(e),c?c(n):null===a||void 0===a||a({block:$i($i({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,w.jsx)(P.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},no=t(75634);function to(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 io(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?to(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):to(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var oo=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,o=e.blocks,u=e.blocksInNotebook,c=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,C=e.savePipelineContent,_=e.selectedBlock,S=e.setAnyInputFocused,I=e.setErrors,E=e.setSelectedBlock,T=e.setTextareaFocused,M=e.showBrowseTemplates,D=e.textareaFocused,B=(0,s.useRef)(null),R=(0,s.useState)(!1),L=R[0],F=R[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]),V=(0,s.useMemo)((function(){return(null===G||void 0===G?void 0:G.blocks)||[]}),[G]),q=(0,s.useMemo)((function(){return(0,_e.HK)(V,(function(e){return e.uuid}))}),[V]),Y=(0,s.useMemo)((function(){return U===(null===_||void 0===_?void 0:_.extension_uuid)&&q[null===_||void 0===_?void 0:_.uuid]}),[q,U,_]),Q=(0,s.useMemo)((function(){return y.reduce((function(e,n,t){return io(io({},e),{},(0,l.Z)({},n.uuid,io(io({},n),{},{priority:t})))}),{})}),[y]),J=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return W.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,X.wD)(e,{callback:function(){f()},onErrorCallback:function(e,n){return null===I||void 0===I?void 0:I({errors:n,response:e})}})}}),$=(0,r.Z)(J,2),ee=$[0],ne=$[1].isLoading,te=(0,s.useMemo)((function(){return V.map((function(e,n){var r=io(io({},e),{},{extension_uuid:U}),l=r.type,a=r.uuid,d=(null===_||void 0===_?void 0:_.uuid)===a,k=Q[a],P=k?0===k.priority?Hn.uF.BUSY:Hn.uF.QUEUED:Hn.uF.IDLE,M="".concat(l,"s/").concat(a,".py");return i.current[M]=(0,s.createRef)(),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsx)(A.Z,{allBlocks:o,autocompleteItems:t,block:r,blockIdx:n,blockRefs:i,blocks:o,defaultValue:r.content,deleteBlock:function(e){c(io(io({},e),{},{extension_uuid:U})),S(!1)},executionState:P,extraContent:(0,w.jsx)(eo,{block:r,blockActionDescription:"Click a block name to run expectations on it.",blocks:u,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:ee}),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[M],runBlock:j,runningBlocks:y,savePipelineContent:C,selected:d,setAnyInputFocused:S,setErrors:I,setSelected:function(e){return E(!0===e?r:null)},setTextareaFocused:T,textareaFocused:d&&D})},a)}))}),[t,i,o,u,c,V,U,p,f,v,ne,m,b,g,x,j,y,Q,C,_,S,I,E,T,D,ee]),ie="Extensions/GreatExpectations/index",oe=(0,Zn.y)(),re=oe.disableGlobalKeyboardShortcuts,le=oe.registerOnKeyDown,ue=oe.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){ue(ie)}}),[ue,ie]),le(ie,(function(e,n){!re&&Y&&((0,$t.y)([jn.zX,jn.Um],n)||(0,$t.y)([jn.PQ,jn.Um],n))&&(e.preventDefault(),C())}),[Y,C]),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsx)(P.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.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,w.jsx)(k.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,w.jsx)(k.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),te,(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsx)(mn.Z,{onClickOutside:function(){return F(!1)},open:!0,children:(0,w.jsx)(Bt.Z,{disableKeyboardShortcuts:!0,items:null===z||void 0===z?void 0:z.map((function(e){var t=e.description,i=e.name,o=e.path;return{label:function(){return i},onClick:function(){return n({config:{template_path:o},extension_uuid:U,type:h.tf.EXTENSION},(null===V||void 0===V?void 0:V.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,Xt.hr)((function(e){return n(io(io({},e),{},{extension_uuid:U,type:h.tf.EXTENSION}),(null===V||void 0===V?void 0:V.length)||0)}),h.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:M})),onClickCallback:function(){return F(!1)},open:L,parentRef:B,uuid:"Extension",children:(0,w.jsx)(N.ZP,{beforeElement:(0,w.jsx)(no.Wx,{teal:!0,children:(0,w.jsx)(K.mm,{size:no.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),F(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},ro=t(69419),lo=["pipeline"];function uo(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 co(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?uo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ao=function(e){var n=e.pipeline,t=(0,he.Z)(e,lo),i=(0,p.useRouter)(),o=W.ZP.extension_options.list().data,r=(0,s.useMemo)((function(){return(null===o||void 0===o?void 0:o.extension_options)||[]}),[o]),l=(0,s.useMemo)((function(){return(0,_e.HK)(r,(function(e){return e.uuid}))}),[r]),u=(0,s.useState)(null),c=u[0],a=u[1],d=(0,s.useMemo)((function(){return l[c]}),[l,c]),f=(0,s.useMemo)((function(){return co(co({},t),{},{pipeline:n})}),[n,t]);(0,s.useEffect)((function(){var e;a(null===(e=(0,ro.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var v=(0,s.useMemo)((function(){return n?(Qi.GREAT_EXPECTATIONS===c?e=oo:Qi.DBT===c&&(e=Xi),e?(0,w.jsx)(e,co(co({},f),{},{extensionOption:d})):void 0):null;var e}),[d,n,c,f]);return(0,w.jsx)(D.W,{backend:B.PD,children:(0,w.jsxs)(Z.Z,{p:O.cd,children:[!c&&(0,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsxs)(P.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,w.jsx)(k.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,w.jsx)(P.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!o&&!c&&(0,w.jsx)(H.Z,{}),v,!c&&(null===r||void 0===r?void 0:r.map((function(e,n){var t=e.description,o=e.name,r=e.uuid;return(0,w.jsx)(Z.Z,{mt:n>=1?O.cd:0,children:(0,w.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Ln.u7)({extension:r},{pushHistory:!0})},preventDefault:!0,children:(0,w.jsx)(zn.Z,{dark:!0,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{alignItems:"center",children:[(0,w.jsx)(Te.Z,{fullWidth:!1,children:(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsx)(y.ZP,{alignItems:"center",children:(0,w.jsx)("img",{alt:o,height:3*O.iI,src:"".concat(i.basePath,"/images/extensions/").concat(r,"/logo.png"),width:3*O.iI})})})}),(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsxs)(j.Z,{flexDirection:"column",children:[(0,w.jsx)(P.ZP,{bold:!0,children:o}),(0,w.jsx)(P.ZP,{default:!0,small:!0,children:t})]})]}),(0,w.jsx)(K._Q,{})]})})})},r)})))]})})},so=t(28385),po=t(9134),fo=t(83784),vo=t(30229),ho=t(8916);var mo=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,o=e.setErrorMessages,l=e.variables,u=e.width,c=(0,s.useState)(!1),a=c[0],p=c[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,C=(0,d.Db)(W.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,X.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;o((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),_=(0,r.Z)(C,1)[0],S=(0,d.Db)((function(e){return W.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),I=(0,r.Z)(S,1)[0],E=(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)})),(0,Jt.ez)(),p(!1)}else"Escape"===e.key&&((0,Jt.ez)(),p(!1))}),[_,n,v,g]),T=(0,s.useMemo)((function(){return u-4*O.iI}),[u]),M=(0,s.useMemo)((function(){return(0,ho.wx)(l,(function(e){return e.uuid===fo.C}))}),[l]),D=(0,s.useMemo)((function(){return(0,ho.wx)(l,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,l]),B=(0,s.useMemo)((function(){return(0,w.jsxs)(ji,{width:T,children:[a&&(0,w.jsxs)(bi.Z,{children:[(0,w.jsx)(mi.Z,{md:1,children:(0,w.jsx)(yi,{noPadding:!0,children:(0,w.jsx)(N.ZP,{backgroundColor:ki.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(v),hi.Am.success("Successfully copied to clipboard.",{position:hi.Am.POSITION.BOTTOM_RIGHT,toastId:v})},uuid:"Sidekick/GlobalVariables/".concat(v),withIcon:!0,children:(0,w.jsx)(K.CK,{size:2.5*O.iI})})})}),(0,w.jsx)(mi.Z,{md:4,children:(0,w.jsx)(yi,{children:(0,w.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){m(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"variable",small:!0,value:v})})}),(0,w.jsx)(mi.Z,{md:7,children:(0,w.jsx)(yi,{children:(0,w.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"enter value",small:!0,value:g})})})]}),null===M||void 0===M?void 0:M.map((function(e){return(0,w.jsx)(Pi,{deleteVariable:function(){return I(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[I,M,v,g,j,m,x,p,a,T]),R=(0,s.useMemo)((function(){return(0,w.jsx)(ji,{width:T,children:null===D||void 0===D?void 0:D.map((function(e){return(0,w.jsx)(Pi,{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}))})}),[D,i,T]);return(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(re.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,w.jsx)(Z.Z,{ml:2}),(0,w.jsx)(N.ZP,{Icon:K.mm,blackBorder:!0,inline:!0,onClick:function(){return p((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(P.ZP,{muted:!0,children:["Press ",(0,w.jsx)(P.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,w.jsx)(P.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:B}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(P.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,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsxs)(P.ZP,{bold:!0,large:!0,children:["For Python (",(0,w.jsx)(k.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,w.jsx)(po.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsxs)(P.ZP,{bold:!0,large:!0,children:["For SQL (",(0,w.jsx)(k.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,w.jsx)(po.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsxs)(P.ZP,{bold:!0,large:!0,children:["For R (",(0,w.jsx)(k.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,w.jsx)(po.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsx)(re.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,w.jsx)(Z.Z,{mb:O.cd}),(0,w.jsx)(P.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(vo.Xm).map((function(e,n){var t;return(0,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(P.ZP,{large:!0,monospace:!0,children:(0,Q.vg)(null===(t=vo.Z4[e])||void 0===t?void 0:t.call(vo.Z4))})}),(0,ho.JZ)([],e).map((function(n,t){return(0,w.jsx)(Pi,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),D&&D.length>0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{my:2,children:(0,w.jsx)(re.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,w.jsx)(Z.Z,{mb:2,children:R}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(P.ZP,{children:["Output variables can be used in any ",(0,w.jsx)(P.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,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(P.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(po.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"})})]})]})},bo=t(89565),go=t.n(bo),xo=t(88494),jo=m.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Qn.y$)()),yo=m.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],Qn.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 ko(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Zo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ko(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ko(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Po=function(e){var n=e.cancelPipeline,t=e.checkIfPipelineRunning,i=e.executePipeline,o=e.isPipelineExecuting,r=e.pipelineExecutionHidden,l=e.pipelineMessages,u=e.setPipelineExecutionHidden,c=(0,s.useMemo)((function(){return(null===l||void 0===l?void 0:l.length)||0}),[l]),a=(0,s.useMemo)((function(){return c>100?l.slice(-100):l}),[c,l]),d=(0,s.useCallback)((function(){(0,Jt.ez)(),i()}),[i]),p=(0,s.useCallback)((function(){(0,Jt.ez)(),n()}),[n]),f=(0,s.useCallback)((function(){var e=!r;u(e),(0,cn.t8)(cn.Q9,e)}),[r,u]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(jo,{children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{children:[(0,w.jsx)(T.ZP,{beforeIcon:(0,w.jsx)(K.JM,{inverted:!0,size:2*O.iI}),compact:o,disabled:o,loading:o,onClick:d,success:!0,children:(0,w.jsx)(P.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,w.jsx)(Z.Z,{ml:1}),o&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(T.ZP,{beforeIcon:(0,w.jsx)(K.x8,{inverted:!0,size:2*O.iI}),onClick:p,success:!0,children:(0,w.jsx)(P.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,w.jsx)(Z.Z,{ml:1})]}),(0,w.jsx)(T.ZP,{onClick:t,secondary:!0,children:(0,w.jsx)(P.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,w.jsxs)(j.Z,{alignItems:"center",children:[(0,w.jsx)(Z.Z,{ml:1}),(0,w.jsx)(P.ZP,{children:"Hide"}),(0,w.jsx)(Z.Z,{mr:1}),(0,w.jsx)(ke.Z,{checked:r,onCheck:f})]})]})}),!r&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z.Z,{mb:1}),(0,w.jsx)(yo,{noScrollbarTrackBackground:!0,children:(0,w.jsx)(xo.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:a.map((function(e,n){var t=e.data,i=e.type,o=[],r=(o=(o=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return o.map((function(e,t){var o,l={first:0===n&&0===t,last:n===c-1&&t===r-1};return Hn.jU.includes(i)?o=(0,w.jsx)(xo.T5,Zo(Zo({},l),{},{children:(0,w.jsx)(P.ZP,{monospace:!0,preWrap:!0,children:(0,w.jsx)(go(),{children:e})})})):i===Hn.Gi.IMAGE_PNG&&(o=(0,w.jsx)("div",{style:{backgroundColor:"white"},children:(0,w.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,w.jsx)("div",{children:o},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},Oo=t(91749);var Co=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,o=e.setErrorMessages,l=e.width,u=(0,s.useState)(!1),c=u[0],a=u[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 l-O.cd*O.iI*2}),[l]),x=(0,d.Db)(W.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;o((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),j=(0,r.Z)(x,1)[0],k=(0,d.Db)((function(e){return W.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),C=(0,r.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)})),(0,Jt.ez)(),a(!1)):"Escape"===e.key&&((0,Jt.ez)(),a(!1))}),[j,n,f,m]),S=(0,s.useCallback)((function(e){(0,Jt.ez)(),C(e)}),[C]);return(0,w.jsxs)(Z.Z,{p:O.cd,children:[(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(y.ZP,{alignItems:"center",children:[(0,w.jsx)(re.Z,{level:4,monospace:!0,children:"Secrets"}),(0,w.jsx)(Z.Z,{ml:2}),(0,w.jsx)(N.ZP,{Icon:K.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(P.ZP,{children:[(0,w.jsx)(P.ZP,{inline:!0,warning:!0,children:"WARNING:"})," the encryption key is stored in a file on your machine. If you need more secure encryption, we recommend using a secrets manager."]})}),c&&(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(P.ZP,{muted:!0,children:["Press ",(0,w.jsx)(P.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,w.jsx)(P.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsxs)(ji,{width:g,children:[c&&(0,w.jsxs)(bi.Z,{children:[(0,w.jsx)(mi.Z,{md:1,children:(0,w.jsx)(yi,{noPadding:!0,children:(0,w.jsx)(N.ZP,{backgroundColor:ki.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(f,") }}")),hi.Am.success("Successfully copied to clipboard.",{position:hi.Am.POSITION.BOTTOM_RIGHT,toastId:f})},uuid:"Sidekick/Secrets/".concat(f),withIcon:!0,children:(0,w.jsx)(K.CK,{size:2.5*O.iI})})})}),(0,w.jsx)(mi.Z,{md:4,children:(0,w.jsx)(yi,{children:(0,w.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,w.jsx)(mi.Z,{md:7,children:(0,w.jsx)(yi,{children:(0,w.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,w.jsx)(Pi,{copyText:e.name,deleteVariable:function(){return S(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(P.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,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(po.Z,{language:"yaml",maxWidth:g,small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n "})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(P.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,w.jsx)(Z.Z,{mb:O.cd,children:(0,w.jsx)(po.Z,{language:"python",maxWidth:g,small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n "})})]})},wo=t(28026),_o=t(68899),So=t(15752),Io=t(91835);function Eo(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 To(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Eo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Eo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Mo=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,o=e.autocompleteItems,u=e.blockRefs,c=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,C=e.runBlock,_=e.runningBlocks,S=e.savePipelineContent,I=e.selectedBlock,E=e.setAnyInputFocused,T=e.setErrors,M=e.setHiddenBlocks,D=e.setSelectedBlock,B=e.setTextareaFocused,R=e.showBrowseTemplates,L=e.showUpdateBlockModal,F=e.textareaFocused,U=(0,s.useRef)(null),H=(0,s.useState)(!1),z=H[0],G=H[1],V=(0,ro.iV)().block_uuid;(0,s.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null===V||void 0===V||null===(n=V.split(":"))||void 0===n?void 0:n[0])===t}));e&&(I&&(null===e||void 0===e?void 0:e.uuid)===(null===I||void 0===I?void 0:I.uuid)||(M((function(n){return To(To({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[V,c,j,I,M]);var q=(y||{}).type,Y=(0,s.useMemo)((function(){return(0,_e.HK)(t||[],(function(e){return e.uuid}))}),[t]),J=W.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,$=(0,s.useMemo)((function(){return(null===J||void 0===J?void 0:J.block_templates)||[]}),[J]),ee=(0,s.useCallback)((function(e){return n(e,(null===Y||void 0===Y?void 0:Y.length)||0)}),[n,Y]),ne=(0,s.useMemo)((function(){return(0,Xt.oM)($,ee)}),[ee,$]),te=(0,s.useMemo)((function(){return(0,Xt.hr)(ee,i,q,{blockTemplatesByBlockType:ne,languages:[h.t6.PYTHON],showBrowseTemplates:R})}),[ee,i,ne,q]),ie=(0,s.useMemo)((function(){return null===Y||void 0===Y?void 0:Y[null===I||void 0===I?void 0:I.uuid]}),[Y,I]),oe=(0,s.useMemo)((function(){return _.reduce((function(e,n,t){return To(To({},e),{},(0,l.Z)({},n.uuid,To(To({},n),{},{priority:t})))}),{})}),[_]),re=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return W.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,X.wD)(e,{callback:function(){m()},onErrorCallback:function(e,n){return null===T||void 0===T?void 0:T({errors:n,response:e})}})}}),le=(0,r.Z)(re,2),ue=le[0],ce=le[1].isLoading,ae=(0,s.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e,n){var t=e.type,i=e.uuid,r=(null===I||void 0===I?void 0:I.uuid)===i,d=oe[i],k=d?0===d.priority?Hn.uF.BUSY:Hn.uF.QUEUED:Hn.uF.IDLE,P="".concat(t,"s/").concat(i,".py");return u.current[P]=(0,s.createRef)(),(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsx)(A.Z,{allBlocks:c,autocompleteItems:o,block:e,blockIdx:n,blockRefs:u,blocks:c,defaultValue:e.content,deleteBlock:function(e){p(To({},e)),E(!1)},executionState:k,extraContent:(0,w.jsx)(eo,{block:e,blocks:a,inputPlaceholder:"Select blocks to add ".concat((0,Q._6)(f,null)," to"),loading:ce,onClickTag:function(e){M((function(n){return To(To({},n),{},(0,l.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:ue}),fetchFileTree:v,fetchPipeline:m,hideRunButton:!0,interruptKernel:b,messages:g[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:y,ref:u.current[P],runBlock:C,runningBlocks:_,savePipelineContent:S,showUpdateBlockModal:L,selected:r,setAnyInputFocused:E,setErrors:T,setSelected:function(n){return D(!0===n?e:null)},setTextareaFocused:B,textareaFocused:r&&F})},i)}))}),[t,o,u,c,a,p,f,v,m,b,ce,g,x,j,y,C,_,oe,S,I,E,T,M,D,B,L,F,ue]),se="".concat(f,"/index"),de=(0,Zn.y)(),pe=de.disableGlobalKeyboardShortcuts,fe=de.registerOnKeyDown,ve=de.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){ve(se)}}),[ve,se]),fe(se,(function(e,n){!pe&&ie&&((0,$t.y)([jn.zX,jn.Um],n)||(0,$t.y)([jn.PQ,jn.Um],n))&&(e.preventDefault(),S())}),[ie,S]),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(Z.Z,{mb:O.cd,children:[(0,w.jsxs)(P.ZP,{default:!0,children:["Run 1 or more ",(0,Q.wX)(f)," block functions whenever another block succeeds or fails."]}),(0,w.jsx)(Z.Z,{mt:1,children:(0,w.jsxs)(P.ZP,{default:!0,children:["Learn more about ",(0,w.jsx)(k.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,Q.wX)((0,Q._6)(f,null)),"/overview"),openNewWindow:!0,children:(0,Q.wX)((0,Q._6)(f,null))}),"."]})})]}),ae,(0,w.jsx)(Z.Z,{mt:O.cd,children:(0,w.jsx)(mn.Z,{onClickOutside:function(){return G(!1)},open:!0,children:(0,w.jsx)(Bt.Z,{disableKeyboardShortcuts:!0,items:te,onClickCallback:function(){return G(!1)},open:z,parentRef:U,uuid:f,children:(0,w.jsxs)(N.ZP,{beforeElement:(0,w.jsx)(no.Wx,{rose:i===h.tf.CALLBACK,children:(0,w.jsx)(K.mm,{size:no.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),G(!0)},uuid:"AddNewBlocks/".concat(f),children:[(0,Q.kC)(f)," block"]})})})})]})},Do=t(26084);function Bo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ro(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Bo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ao=[{Icon:K.AQ,name:"Callbacks",uuid:Do.Q.CALLBACK},{Icon:K.hW,name:"Conditionals",uuid:Do.Q.CONDITIONAL}];var No=function(e){var n=(0,Io.Z)({},e),t=(0,p.useRouter)(),i=(0,s.useState)(null),o=i[0],r=i[1];(0,s.useEffect)((function(){var e;r(null===(e=(0,ro.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,s.useMemo)((function(){var e,t;if(Do.Q.CALLBACK===o)e={addOnBlockType:h.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(Do.Q.CONDITIONAL===o){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,w.jsx)(Mo,Ro(Ro({},e),n))}),[n,o]);return(0,w.jsx)(D.W,{backend:B.PD,children:(0,w.jsxs)(Z.Z,{p:O.cd,children:[l,!o&&(null===Ao||void 0===Ao?void 0:Ao.map((function(e,n){var t=e.name,i=e.uuid,o=e.Icon;return(0,w.jsx)(Z.Z,{mt:n>=1?O.cd:0,children:(0,w.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Ln.u7)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,w.jsx)(zn.Z,{dark:!0,children:(0,w.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(j.Z,{alignItems:"center",children:[(0,w.jsx)(Te.Z,{fullWidth:!1,children:(0,w.jsx)(Z.Z,{p:O.cd,children:(0,w.jsx)(y.ZP,{alignItems:"center",children:(0,w.jsx)(o,{fill:"#885EFF",size:2*O.iI})})})}),(0,w.jsx)(Z.Z,{mr:O.cd}),(0,w.jsx)(j.Z,{flexDirection:"column",children:(0,w.jsx)(P.ZP,{bold:!0,children:t})})]}),(0,w.jsx)(K._Q,{})]})})})},i)})))]})})};function Lo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Fo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Lo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Lo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Uo=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,o=e.autocompleteItems,r=e.blockInteractionsMapping,u=e.blockRefs,c=e.blocks,a=e.blocksInNotebook,d=e.cancelPipeline,p=e.chartRefs,v=e.checkIfPipelineRunning,h=e.containerHeightOffset,m=e.contentByBlockUUID,b=e.createInteraction,g=e.deleteBlock,x=e.deleteWidget,j=e.editingBlock,k=e.executePipeline,C=e.fetchFileTree,_=e.fetchPipeline,S=e.fetchSecrets,I=e.fetchVariables,E=e.globalDataProducts,M=e.globalVariables,D=e.insights,B=e.interactions,R=e.interactionsMapping,A=e.interruptKernel,N=e.isLoadingCreateInteraction,L=e.isLoadingUpdatePipelineInteraction,U=e.isPipelineExecuting,H=e.lastTerminalMessage,z=e.messages,W=e.metadata,G=e.onChangeCallbackBlock,V=e.onChangeChartBlock,q=e.onChangeCodeBlock,Y=e.onSelectBlockFile,Q=e.onUpdateFileSuccess,X=e.permissions,J=e.pipeline,$=e.pipelineInteraction,ee=e.pipelineMessages,ne=e.project,te=e.refAfterFooter,ie=e.runBlock,oe=e.runningBlocks,re=e.sampleData,le=e.savePipelineContent,ue=e.savePipelineInteraction,ce=e.secrets,ae=e.selectedBlock,se=e.selectedFilePath,de=e.sendTerminalMessage,pe=e.setActiveSidekickView,fe=e.setAllowCodeBlockShortcuts,ve=e.setAnyInputFocused,he=e.setBlockInteractionsMapping,xe=e.setDisableShortcuts,je=e.setEditingBlock,ye=e.setErrors,ke=e.setHiddenBlocks,Ze=e.setInteractionsMapping,Pe=e.setPermissions,Oe=e.setSelectedBlock,Ce=e.setTextareaFocused,we=e.showBrowseTemplates,Se=e.showDataIntegrationModal,Ie=e.showUpdateBlockModal,Ee=e.sideBySideEnabled,Te=e.statistics,Me=e.textareaFocused,De=e.treeRef,Be=e.updatePipelineInteraction,Re=e.updateWidget,Ae=e.widgets,Ne=(0,an.i)().height,Le=ri.uX,Fe=(0,s.useState)([]),Ue=Fe[0],He=Fe[1],ze=(0,s.useState)(!!(0,cn.U2)(cn.Q9)),We=ze[0],Ke=ze[1],Ge=(0,s.useMemo)((function(){return i-(_o.k1+1)}),[i]),Ve=(0,s.useMemo)((function(){var e;return!(null===ne||void 0===ne||null===(e=ne.features)||void 0===e||!e[Yt.d.INTERACTIONS])}),[null===ne||void 0===ne?void 0:ne.features]),qe=((null===j||void 0===j?void 0:j.upstreamBlocks)||{}).block,Ye=((null===re||void 0===re?void 0:re.columns)||[]).slice(0,100),Qe=(0,s.useMemo)((function(){return(null===re||void 0===re?void 0:re.rows)||[]}),[re]),Xe=(0,s.useMemo)((function(){return(null===W||void 0===W?void 0:W.column_types)||{}}),[W]),Je=(0,s.useMemo)((function(){return(null===D||void 0===D?void 0:D[1])||{}}),[D]),$e=(0,s.useMemo)((function(){return(0,_e.HK)((null===D||void 0===D?void 0:D[0])||[],(function(e){return e.feature.uuid}))}),[D]),en=!!re,nn=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===J||void 0===J?void 0:J.type)}),[J]),tn=F.qL.STREAMING!==(null===J||void 0===J?void 0:J.type)?-70:We?-16:300,on=(0,s.useCallback)((0,gi.Fk)({columnTypes:Xe,columns:Ye,insightsByFeatureUUID:$e,insightsOverview:Je,noColumnLinks:!0,statistics:Te}),[Xe,Ye,$e,Je,Te]),rn=(0,s.useMemo)((function(){return(0,w.jsx)(mo,{blocks:c,fetchVariables:I,pipeline:J,selectedBlock:ae,setErrorMessages:He,variables:M,width:Ge})}),[Ge,c,I,M,J,ae]),ln=(0,s.useMemo)((function(){return(0,w.jsx)(so.Z,{onActionCallback:Q,pipeline:J,selectedBlock:ae,selectedFilePath:se,setErrors:ye,width:Ge>Qn.nn?Ge-Qn.nn:Ge})}),[Ge,Q,J,ae,se,ye]),un=(0,s.useMemo)((function(){return(0,w.jsx)(Co,{fetchSecrets:S,pipelineUUID:null===J||void 0===J?void 0:J.uuid,secrets:ce,setErrorMessages:He,width:Ge})}),[Ge,S,J,ce]),sn=(0,s.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:o,blockRefs:u,blocks:c,blocksInNotebook:a,deleteBlock:g,fetchFileTree:C,fetchPipeline:_,interruptKernel:A,messages:z,onChangeCallbackBlock:G,onChangeCodeBlock:q,onSelectBlockFile:Y,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:ae,setAnyInputFocused:ve,setErrors:ye,setHiddenBlocks:ke,setSelectedBlock:Oe,setTextareaFocused:Ce,showBrowseTemplates:we,showUpdateBlockModal:Ie,textareaFocused:Me}}),[t,o,u,c,a,g,C,_,A,z,G,q,Y,J,ie,oe,le,ae,ve,ye,ke,Oe,Ce,we,Ie,Me]),dn=(0,s.useMemo)((function(){return Ye.length>0&&(0,w.jsx)(me.Z,{columnHeaderHeight:(0,ge.Qr)(Xe)&&(0,ge.Qr)($e)&&(0,ge.Qr)(Je)?0:be.Eh,columns:Ye,height:Ne-Le-ri.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:on,rows:Qe,width:Ge})}),[Ge,Xe,Ye,Le,Ne,$e,Je,on,Qe]),pn=(0,s.useMemo)((function(){return Ae.length>0&&(0,w.jsx)(Gi,{autocompleteItems:o,blockRefs:u,blocks:c,chartRefs:p,deleteWidget:x,fetchFileTree:C,fetchPipeline:_,messages:z,onChangeChartBlock:V,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:ae,setAnyInputFocused:ve,setErrors:ye,setSelectedBlock:Oe,setTextareaFocused:Ce,textareaFocused:Me,updateWidget:Re,widgets:Ae,width:Ge})}),[Ge,o,u,c,p,x,C,_,z,V,J,ie,oe,le,ae,ve,ye,Oe,Ce,Me,Re,Ae]),fn=(0,s.useMemo)((function(){return(0,w.jsx)("div",{style:{height:"100%",position:"relative",width:Ge},children:(0,w.jsx)(wo.Z,{lastMessage:H,onFocus:function(){return Oe(null)},sendMessage:de,width:Ge})})}),[Ge,H,de,Oe]),vn=(0,s.useMemo)((function(){return(0,w.jsx)(ao,Fo({},sn))}),[sn]),hn=(0,s.useMemo)((function(){return(0,w.jsx)(No,Fo({},sn))}),[sn]),mn=(0,s.useMemo)((function(){return J&&ae&&(0,w.jsx)(Ti,{addNewBlockAtIndex:t,block:ae,contentByBlockUUID:m,fetchFileTree:C,fetchPipeline:_,globalDataProducts:E,pipeline:J,setSelectedBlock:Oe,showDataIntegrationModal:Se,showUpdateBlockModal:Ie})}),[t,m,C,_,E,J,ae,Oe,Se,Ie]);return(0,w.jsxs)(w.Fragment,{children:[(null===Ue||void 0===Ue?void 0:Ue.length)>=1&&(0,w.jsxs)(Z.Z,{mb:3,mt:2,mx:2,children:[(0,w.jsxs)(y.ZP,{justifyContent:"space-between",children:[(0,w.jsx)(P.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,w.jsx)(T.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return He([])},transparent:!0,children:(0,w.jsx)(K.x8,{muted:!0})})]}),null===Ue||void 0===Ue?void 0:Ue.map((function(e){return(0,w.jsx)(Z.Z,{pb:1,children:(0,w.jsx)(P.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,w.jsxs)(be.t0,{fullWidth:!0,heightOffset:Kt.cH.TERMINAL===n||n===Kt.cH.TREE?0:h||Qn.nn,onBlur:function(){se||xe(!1),null===fe||void 0===fe||fe(!1)},onFocus:function(){xe(!0),n===Kt.cH.TREE&&(null===fe||void 0===fe||fe(!0))},overflowHidden:n===Kt.cH.TREE,tabIndex:0,children:[n===Kt.cH.TREE&&(0,w.jsx)(f.Z,{uuid:"PipelineDetail/".concat(null===J||void 0===J?void 0:J.uuid),children:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Vi.ZP,{addNewBlockAtIndex:t,blockRefs:u,blocks:c,contentByBlockUUID:m,contextMenuEnabled:!0,deleteBlock:g,dragEnabled:!0,editingBlock:j,enablePorts:!nn,fetchPipeline:_,height:Ne-(Le-Qn.nn)-tn,messages:z,onClickNode:function(e){var n=e.block.uuid;return ke((function(e){var t=!(null===e||void 0===e||!e[n]);return t?Fo(Fo({},e),{},(0,l.Z)({},n,!t)):e}))},pipeline:J,runBlock:ie,runningBlocks:oe,selectedBlock:ae,setActiveSidekickView:pe,setEditingBlock:je,setErrors:ye,setSelectedBlock:function(e){Oe(e),Ee&&(0,So.F)(e)},showUpdateBlockModal:Ie,treeRef:De}),!qe&&F.qL.STREAMING===(null===J||void 0===J?void 0:J.type)&&(0,w.jsx)(Z.Z,{p:1,children:(0,w.jsx)(Po,{cancelPipeline:d,checkIfPipelineRunning:v,executePipeline:k,isPipelineExecuting:U,pipelineExecutionHidden:We,pipelineMessages:ee,setPipelineExecutionHidden:Ke})})]})}),n===Kt.cH.DATA&&dn,Kt.cH.SECRETS===n&&un,Kt.cH.VARIABLES===n&&rn,Kt.cH.FILE_VERSIONS===n&&(0,w.jsx)(f.Z,{uuid:"FileVersions/".concat(se?decodeURIComponent(se):""),children:ln}),nn||ae&&en||!ae&&en&&n===Kt.cH.DATA?null:Kt.du.includes(n)&&(0,w.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:Kt.fp,verticalHeightOffset:Le,width:Ge,children:(0,w.jsx)(P.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:ae?!en&&"No data or insights available":"Select a block for insights"})}),Kt.cH.CHARTS===n&&(Ae.length>0?pn:(0,w.jsxs)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:Kt.fp,verticalHeightOffset:Le,width:Ge,children:[(0,w.jsx)(Z.Z,{px:1,children:(0,w.jsx)(y.ZP,{flexDirection:"row",children:(0,w.jsxs)(P.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,w.jsx)(K.GQ,{size:1.5*O.iI}),"\xa0in",(0,w.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,w.jsx)(Z.Z,{mt:O.cd,px:1,children:(0,w.jsx)(Yi,{size:40*O.iI})})]})),Kt.cH.TERMINAL===n&&fn,Kt.cH.EXTENSIONS===n&&vn,Kt.cH.ADDON_BLOCKS===n&&hn,Kt.cH.BLOCK_SETTINGS===n&&(ae?mn:(0,w.jsx)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:Kt.fp,verticalHeightOffset:Le,width:Ge,children:(0,w.jsx)(Z.Z,{px:1,children:(0,w.jsx)(y.ZP,{flexDirection:"row",children:(0,w.jsxs)(P.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,w.jsx)(K.JG,{size:1.5*O.iI}),"\xa0",(0,w.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})})),Kt.cH.INTERACTIONS===n&&Ve&&(0,w.jsx)(Oo.Z,{blockInteractionsMapping:r,containerWidth:Ge,createInteraction:function(e){return b({interaction:e})},interactions:B,interactionsMapping:R,isLoadingCreateInteraction:N,isLoadingUpdatePipelineInteraction:L,permissions:X,pipeline:J,pipelineInteraction:$,refAfterFooter:te,savePipelineInteraction:ue,selectedBlock:ae,setBlockInteractionsMapping:he,setInteractionsMapping:Ze,setPermissions:Pe,setSelectedBlock:Oe,updatePipelineInteraction:function(e){return Be({pipeline_interaction:e})}})]})]})};var Ho=function(e){var n,t=e.activeView,i=e.pipeline,o=e.project,r=e.secrets,l=e.selectedBlock,u=e.setSelectedBlock,c=e.variables,a=null===i||void 0===i?void 0:i.uuid,d=(0,ro.iV)(),p=(0,ho.wx)(c,(function(e){return e.uuid===fo.C})),f=(0,Kt.Qq)({project:o})[t],v=(null===f||void 0===f||null===(n=f.buildLabel)||void 0===n?void 0:n.call(f,{pipeline:i,secrets:r,variables:p}))||(null===f||void 0===f?void 0:f.label);Kt.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(v=(0,w.jsxs)(w.Fragment,{children:["Block settings for ",(0,w.jsx)(P.ZP,{bold:!0,color:(0,C.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,w.jsx)(P.ZP,{bold:!0,children:v}),m=Kt.cH.EXTENSIONS===t&&(null===d||void 0===d?void 0:d.extension),b=W.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,_e.HK)(g,(function(e){return e.uuid}))}),[g]),j=Kt.cH.ADDON_BLOCKS===t&&(null===d||void 0===d?void 0:d.addon);if(Kt.cH.INTERACTIONS===t){var Z=[];null!==l&&void 0!==l&&l.uuid?Z.push.apply(Z,[{label:function(){return"All interactions"},monospace:!1,onClick:function(){return u(null)}},{bold:!0,label:function(){return null===l||void 0===l?void 0:l.uuid},monospace:!0}]):Z.push({bold:!0,label:function(){return"Interactions"},monospace:!1}),h=(0,w.jsx)(te.Z,{breadcrumbs:Z,noMarginLeft:!0})}else{if(!t)return(0,w.jsx)("div",{});if(m){var O=x[null===d||void 0===d?void 0:d.extension];h=(0,w.jsxs)(y.ZP,{children:[(0,w.jsx)(Gn(),{as:"/pipelines/".concat(a,"/edit?").concat(Kt.uM,"=").concat(Kt.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,w.jsx)(k.Z,{default:!0,children:v})}),(0,w.jsx)(P.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,w.jsx)(P.ZP,{bold:!0,children:null===O||void 0===O?void 0:O.name})]})}else j&&(h=(0,w.jsxs)(y.ZP,{children:[(0,w.jsx)(Gn(),{as:"/pipelines/".concat(a,"/edit?").concat(Kt.uM,"=").concat(Kt.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,w.jsx)(k.Z,{default:!0,children:v})}),(0,w.jsx)(P.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,w.jsx)(P.ZP,{bold:!0,children:(0,Q.vg)(null===d||void 0===d?void 0:d.addon)})]}))}return(0,w.jsx)(ri.ym,{children:h})},zo=t(65044),Wo=t(78419),Ko=t(46684),Go=t(32929),Vo=t(11498),qo=t(28795),Yo=t(85010);function Qo(e){var n=e.activeView,t=e.pipeline,i=e.project,o=e.secrets,r=e.setActiveSidekickView,l=e.variables,u=(0,ho.wx)(l,(function(e){return e.uuid===fo.C}));return(0,Kt.j5)({project:i}).map((function(e){var i=e.buildLabel,l=e.key,c=e.label;return{Icon:Kt.Z7[l],id:l,isSelected:function(){return n===l},label:function(){return(null===i||void 0===i?void 0:i({pipeline:t,secrets:o,variables:u}))||c},onClick:function(){return r(l,!0)}}}))}var Xo=t(53005),Jo=t(4383),$o=t(70320),er=t(3917);function nr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function tr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function ir(e){var n,t,i,u,c,m,b,g,x,j,k,P,C,_,S,D=e.page,B=e.pipeline,R=(0,xn.Z)(),A=R.featureEnabled,L=R.featureUUIDs,U=R.fetchProjects,H=R.project,z=R.sparkEnabled,G=(0,p.useRouter)(),V=(0,an.i)().height,q=G.query.pipeline,$=B.uuid||q,ee=(0,s.useState)(!!(0,cn.U2)(cn.zg)),te=ee[0],ie=ee[1],oe=(0,s.useState)(!!(0,cn.U2)(cn.Uu)),re=oe[0],le=oe[1],ue=(0,s.useState)(!1),ce=ue[0],ae=ue[1],se=(0,s.useState)(null),de=se[0],pe=se[1],fe=(0,s.useState)(null),ve=fe[0],he=fe[1],me=(0,s.useState)(null),be=me[0],xe=me[1],je=(0,s.useState)(null),ye=je[0],ke=je[1],Ze=(0,s.useState)(null),Pe=Ze[0],Oe=Ze[1],Ce=(0,s.useState)([]),we=Ce[0],Se=Ce[1],Ie=(0,s.useState)({}),Ee=Ie[0],Te=Ie[1],Me=(0,s.useState)(!1),De=Me[0],Be=Me[1],Re=(0,s.useState)(!1),Ae=Re[0],Ne=Re[1],Le=(0,s.useState)(!1),Fe=Le[0],Ue=Le[1],He=(0,s.useState)(!1),ze=He[0],We=He[1],Ke=(0,s.useState)(!0),Ge=Ke[0],Ve=Ke[1],qe=((0,s.useMemo)((function(){var e;return(0,$o.h)(null===H||void 0===H||null===(e=H.features)||void 0===e?void 0:e[Yt.d.LOCAL_TIMEZONE])}),[null===H||void 0===H?void 0:H.features]),(0,s.useMemo)((function(){var e;return!(null===H||void 0===H||null===(e=H.features)||void 0===e||!e[Yt.d.INTERACTIONS])}),[null===H||void 0===H?void 0:H.features])),Ye="".concat(Wo.H8,"_").concat($),Qe=(0,cn.U2)(Ye),Xe=(0,s.useState)((0,_e.sE)(Yn.NR,(function(e){return e.uuid===Qe}))||Yn.NR[0]),Je=Xe[0],$e=Xe[1],en=(0,s.useCallback)((function(e){$e(e),(0,cn.t8)(Ye,null===e||void 0===e?void 0:e.uuid)}),[Ye,$e]),nn="".concat(Wo.g6,"_").concat($),tn=(0,s.useState)({}),on=tn[0],rn=tn[1],ln=(0,s.useCallback)((function(e){rn((function(n){var t=e(n);return(0,cn.t8)(nn,JSON.stringify(t)),t}))}),[nn,rn]);(0,s.useEffect)((function(){var e=(0,cn.U2)(nn);e&&(0,Q.Pb)(e)&&rn(JSON.parse(e))}),[nn,rn]);var un,sn=(0,s.useRef)(null),dn=W.ZP.statuses.list({},{revalidateOnFocus:!1}).data,pn=(0,s.useMemo)((function(){var e,n;return null===dn||void 0===dn||null===(e=dn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[dn]),mn=(0,s.useMemo)((function(){var e,n;return null===dn||void 0===dn||null===(e=dn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[dn]),bn=(0,s.useState)({}),gn=bn[0],jn=bn[1],yn=(0,s.useState)([]),kn=yn[0],Zn=yn[1],Pn=(0,An.Z)($),On=W.ZP.pipelines.detail($,tr({include_block_pipelines:!0,includes_outputs:(0,ge.Qr)(gn)||"undefined"===typeof un||null===un||"undefined"===typeof(null===(n=un)||void 0===n?void 0:n.blocks)||null===(null===(t=un)||void 0===t?void 0:t.blocks)||!(null===(i=un)||void 0===i||null===(u=i.blocks)||void 0===u||!u.find((function(e){return"undefined"===typeof e.ouputs})))},Ge?{includes_outputs_spark:!0}:{}),{refreshInterval:6e4},{key:"/pipelines/".concat($,"/edit")}),Cn=On.data,wn=On.mutate,_n=W.ZP.pipeline_interactions.detail(qe&&$),Dn=_n.data,Bn=_n.mutate,Wn=W.ZP.interactions.pipeline_interactions.list(qe&&$),Kn=Wn.data,Gn=Wn.mutate,Vn=(0,s.useMemo)((function(){return(null===Dn||void 0===Dn?void 0:Dn.pipeline_interaction)||{}}),[Dn]),qn=(0,s.useMemo)((function(){return(null===Kn||void 0===Kn?void 0:Kn.interactions)||{}}),[Kn]),Qn=(0,d.Db)(W.ZP.pipeline_interactions.useUpdate($),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){Bn()}})}}),Xn=(0,r.Z)(Qn,2),Jn=Xn[0],et=Xn[1].isLoading,nt=(0,d.Db)(W.ZP.interactions.pipeline_interactions.useCreate($),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){Gn(),Bn()}})}}),tt=(0,r.Z)(nt,2),it=tt[0],ot=tt[1].isLoading,rt=W.ZP.files.list(),lt=rt.data,ut=rt.mutate,ct=(0,s.useMemo)((function(){return(null===lt||void 0===lt?void 0:lt.files)||[]}),[lt]);un=(0,s.useMemo)((function(){return null===Cn||void 0===Cn?void 0:Cn.pipeline}),[Cn]);var at=(0,s.useMemo)((function(){var e;return F.qL.INTEGRATION===(null===(e=un)||void 0===e?void 0:e.type)}),[un]);(0,s.useEffect)((function(){un&&Ge&&z&&Ve(!1)}),[Ge,un,Ve,z]);var st=(0,s.useState)((0,cn.U2)(Wo.iL,!1)),dt=st[0],pt=st[1],ft=(0,s.useMemo)((function(){return!at&&(null===A||void 0===A?void 0:A(null===L||void 0===L?void 0:L.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&dt}),[A,L,at,dt]),vt=(0,s.useState)((0,cn.U2)(Wo.qj,!1)),ht=vt[0],mt=vt[1],bt=(0,s.useMemo)((function(){return(null===A||void 0===A?void 0:A(null===L||void 0===L?void 0:L.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&ht}),[A,L,ht]),gt=(0,s.useCallback)((function(e){mt(e),(0,cn.t8)(Wo.qj,"function"===typeof e?e():e)}),[mt]),xt=(0,s.useCallback)((function(e){var n="function"===typeof e?e():e;pt(e),(0,cn.t8)(Wo.iL,n),n||gt(e)}),[gt,pt]),jt=W.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),yt=jt.data,kt=jt.mutate,Zt=(0,s.useMemo)((function(){var e=null===yt||void 0===yt?void 0:yt.kernels;return(null===e||void 0===e?void 0:e.find((function(e){var n;return e.name===F.a_[null===(n=un)||void 0===n?void 0:n.type]})))||(null===e||void 0===e?void 0:e[0])}),[yt,un]),Pt=(0,s.useState)(null),Ot=Pt[0],Ct=Pt[1],wt=(0,s.useState)((0,er.Tz)({dateObj:!0})),_t=wt[0],St=wt[1],It=(0,s.useState)(!1),Et=It[0],Tt=It[1],Mt=(0,Fn.dd)((function(){return(0,w.jsx)(Rn.Z,{centerOnScreen:!0,neutral:!0,onClick:Rt,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*O.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),Dt=(0,r.Z)(Mt,2),Bt=Dt[0],Rt=Dt[1];(0,s.useEffect)((function(){var e,n;null!==Cn&&void 0!==Cn&&null!==(e=Cn.pipeline)&&void 0!==e&&e.updated_at&&(null===Ot||void 0===Ot?void 0:Ot.toISOString())!==new Date(null===Cn||void 0===Cn||null===(n=Cn.pipeline)||void 0===n?void 0:n.updated_at).toISOString()&&Ct(new Date(Cn.pipeline.updated_at)),Ot&&Number(Ot)>Number(_t)&&Bt()}),[null===Cn||void 0===Cn||null===(c=Cn.pipeline)||void 0===c?void 0:c.updated_at,Ot,_t,Bt]);var At=(0,ro.iV)(),Nt=At[Kt.uM],Lt=At.block_uuid,Ft=At.file_path,Ut=(0,s.useMemo)((function(){var e=At["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[At]),Ht=(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,l.Z)({},Kt.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,Ln.u7)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,s.useEffect)((function(){Nt||Ht(Kt.cH.TREE,!1)}),[Nt,Ht]);var zt=(0,s.useCallback)((function(e,n,t){ie(!1),setTimeout((function(){return Ht(e,n,t)}),1)}),[Ht]),Wt=(0,s.useRef)({}),Gt=(0,s.useRef)({}),Vt=(0,s.useRef)(null),qt=(0,s.useRef)({}),Qt=(0,s.useRef)({}),Xt=(0,s.useRef)({}),Jt=(0,s.useState)({}),$t=Jt[0],ei=Jt[1],ni=(0,s.useCallback)((function(e,n,t){var i=qt.current||{};qt.current=tr(tr({},i),{},(0,l.Z)({},e,tr(tr({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[qt]),ii=(0,s.useCallback)((function(e,n,t){var i=Qt.current||{};Qt.current=tr(tr({},i),{},(0,l.Z)({},e,tr(tr({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[Qt]),oi=(0,s.useCallback)((function(e,n,t){ni(e,n,t),Tt(!0)}),[ni,Tt]),ri=(0,s.useCallback)((function(e,n,t){ii(e,n,t),Tt(!0)}),[ii,Tt]),li=(0,s.useCallback)((function(e){Xt.current=tr(tr({},Xt.current),e)}),[Xt]),ui=(0,s.useCallback)((function(e,n){li((0,l.Z)({},e,n)),Tt(!0)}),[li,Tt]),si=(0,s.useState)(null),di=si[0],pi=si[1],fi=W.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,vi=null===fi||void 0===fi?void 0:fi.data_providers;(0,s.useEffect)((function(){var e=Cn;null!==Cn&&void 0!==Cn&&Cn.hasOwnProperty("error")||null===fi||void 0===fi||!fi.hasOwnProperty("error")||(e=fi),(0,X.bB)(e,xe)}),[Cn,fi]);var hi=W.ZP.variables.pipelines.list($,{global_only:!0},{revalidateOnFocus:!1}),mi=hi.data,bi=hi.mutate,gi=null===mi||void 0===mi?void 0:mi.variables,xi=W.ZP.secrets.list({},{revalidateOnFocus:!1}),ji=xi.data,yi=xi.mutate,ki=null===ji||void 0===ji?void 0:ji.secrets,Zi=(0,s.useState)([]),Pi=Zi[0],Oi=Zi[1],Ci=(0,s.useState)([]),wi=Ci[0],_i=Ci[1],Si=(0,s.useRef)({}),Ii=(0,s.useCallback)((function(e){var n;Tt(!0);var t=Si.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),Si.current[e.uuid]=tr(tr(tr({},t),e),{},{configuration:tr(tr({},t.configuration),e.configuration),upstream_blocks:i})}),[Tt,Si]),Ei=(0,s.useState)(!1),Ti=Ei[0],Mi=Ei[1],Di=(0,s.useState)({upstreamBlocks:null}),Bi=Di[0],Ri=Di[1],Ai=(0,s.useState)([]),Ni=Ai[0],Li=Ai[1],Fi=(0,s.useState)(null),Ui=Fi[0],Hi=Fi[1],zi=(0,$n.Dp)($),Wi=(0,$n.Q9)(zi,Pi),Ki=(0,s.useState)(Wi),Gi=Ki[0],Vi=Ki[1],qi=(0,s.useState)(),Yi=qi[0],Qi=qi[1],Xi=(0,s.useState)(),Ji=Xi[0],$i=Xi[1],eo=(0,s.useState)(null),no=eo[0],to=eo[1],io=(0,An.Z)(Gi),oo=(0,s.useCallback)((function(){Ri({upstreamBlocks:{block:null,values:[]}}),jn({}),Tt(!1),Li([]),Hi(null)}),[]);(0,s.useEffect)((function(){$!==Pn&&(qt.current={},Qt.current={})}),[$,Pn]);var lo=W.ZP.block_outputs.detail(!te&&(null===no||void 0===no?void 0:no.type)!==h.tf.SCRATCHPAD&&(null===no||void 0===no?void 0:no.type)!==h.tf.CHART&&null!==no&&void 0!==no&&no.uuid?encodeURIComponent(null===no||void 0===no?void 0:no.uuid):null,{pipeline_uuid:$}),uo=lo.data,co=lo.mutate,ao=(0,s.useMemo)((function(){return null===uo||void 0===uo?void 0:uo.block_output}),[uo]),so=(0,s.useMemo)((function(){var e,n,t;return at?null===(e=(0,_e.sE)(null===ao||void 0===ao?void 0:ao.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,Q.kE)(Ji))})))||void 0===e?void 0:e.sample_data:null===ao||void 0===ao||null===(n=ao.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[ao,at,Ji]),po=W.ZP.blocks.pipelines.analyses.detail(te?null:$,(null===no||void 0===no?void 0:no.type)!==h.tf.SCRATCHPAD&&(null===no||void 0===no?void 0:no.type)!==h.tf.CHART&&(null===no||void 0===no?void 0:no.uuid)&&encodeURIComponent(null===no||void 0===no?void 0:no.uuid)),fo=po.data,vo=po.mutate,ho=(null===fo||void 0===fo||null===(m=fo.analyses)||void 0===m?void 0:m[0])||{},mo=ho.insights,bo=void 0===mo?{}:mo,go=ho.metadata,xo=void 0===go?{}:go,jo=ho.statistics,yo=void 0===jo?{}:jo;(0,s.useEffect)((function(){0===Ni.length&&(vo(),co(),bi())}),[vo,co,bi,Ni]),(0,s.useEffect)((function(){if(0===Gi.length)to(null);else if((null===io||void 0===io?void 0:io.length)!==(null===Gi||void 0===Gi?void 0:Gi.length)&&(null===Gi||void 0===Gi?void 0:Gi.length)<(null===io||void 0===io?void 0:io.length)){var e=io.findIndex((function(e){return e.uuid===(null===no||void 0===no?void 0:no.uuid)})),n=io.length-1===e?e-1:e+1;to(io[Math.max(0,n)])}}),[Gi,io,null===no||void 0===no?void 0:no.uuid]),(0,s.useEffect)((function(){var e;null!==(e=Bi.upstreamBlocks)&&void 0!==e&&e.block&&(ie(!1),Ht(Kt.cH.TREE))}),[Bi.upstreamBlocks,Ht]);var ko=W.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),Zo=ko.data,Po=ko.mutate,Oo=null===Zo||void 0===Zo?void 0:Zo.autocomplete_items;(0,s.useEffect)((function(){Ft||Ue(!1),Oe(Ft)}),[Ft]),(0,s.useEffect)((function(){(0,_e.fS)(Ut,we)||Se(Ut)}),[Ut,we]);var Co=(0,d.Db)(W.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.pipeline.uuid;G.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),ut()},onErrorCallback:function(e,n){return he({errors:n,response:e})}})}}),wo=(0,r.Z)(Co,1)[0],_o=(0,d.Db)(W.ZP.pipelines.useUpdate($,{update_content:!0}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){Tt(!1),wn().then((function(e){var n=e.pipeline;if(ft){var t,i,o,r=null===(t=un)||void 0===t||null===(i=t.blocks)||void 0===i?void 0:i.map((function(e){return e.uuid})),l=null===n||void 0===n||null===(o=n.blocks)||void 0===o?void 0:o.map((function(e){return e.uuid}));(0,_e.fS)(r||[],l||[])||setTimeout((function(){(0,So.h)()}),1)}})),ut()},onErrorCallback:function(e,n){return he({errors:n,response:e})}})}}),Io=(0,r.Z)(_o,2),Eo=Io[0],To=Io[1].isLoading,Mo=(0,s.useState)({}),Do=Mo[0],Bo=Mo[1],Ro=(0,s.useCallback)((function(e,n){var t,i=e||{},o=i.block,l=i.pipeline,u=void 0===l?{extensions:{}}:l,c=(n||{}).contentOnly;if(!(Ot&&Number(Ot)>Number(_t))){var a=(0,er.Tz)({dateObj:!0}),s=(0,er.Tz)();St(a);var d={},p={},f={},v={};((null===u||void 0===u?void 0:u.blocks)||Pi).forEach((function(e){var n,t,i,l=e.extension_uuid,u=e.type,a=e.uuid,s=null===(n=Qt.current[u])||void 0===n?void 0:n[a];"undefined"===typeof s&&(s=e.content);var m=null===(t=qt.current[u])||void 0===t?void 0:t[a];"undefined"===typeof m&&(m=e.callback_content);var b=null,g=null===(i=gn[a])||void 0===i?void 0:i.filter((function(e){return!!e})),x=null===g||void 0===g?void 0:g.find((function(e){return e.error}));if(g&&(!z||null===Ni||void 0===Ni||!Ni.length)){var j=[],y=0;g.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||x||"table"!==i&&null!==Do&&void 0!==Do&&Do[null===e||void 0===e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(zo.Lz)?e:e.concat(n)}),[]),i===Hn.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!mn||y<mn+5)&&j.push(n))})),b=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var k=tr(tr({},e),{},{callback_content:m,content:s});null===b?delete k.outputs:k.outputs=b,(null===o||void 0===o?void 0:o.uuid)===a&&Object.entries(o).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];"object"===typeof i&&!Array.isArray(i)&&i?Object.entries(i).forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],o=n[1];k[t]||(k[t]={}),k[t][i]=o})):k[t]=i})),c?p[k.uuid]={callback_content:k.callback_content,content:k.content,outputs:k.outputs,uuid:k.uuid}:[h.tf.EXTENSION].includes(u)?(d[l]||(d[l]=[]),d[l].push(k)):h.tf.CALLBACK===u?f[k.uuid]=k:h.tf.CONDITIONAL===u?v[k.uuid]=k:p[k.uuid]=k}));var m=tr(tr({},null===(t=un)||void 0===t?void 0:t.extensions),null===u||void 0===u?void 0:u.extensions);Object.entries(d).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];m[t]||(m[t]={}),m[t].blocks=i}));var b=[],g=[],x=[];return((null===u||void 0===u?void 0:u.blocks)||Pi).forEach((function(e){var n=e.uuid,t=p[n],i=f[n],o=v[n];"undefined"!==typeof t?b.push(t):"undefined"!==typeof i?g.push(i):"undefined"!==typeof o&&x.push(o)})),Bo({}),Eo({pipeline:tr(tr(tr({},un),u),{},{blocks:b,callbacks:g,conditionals:x,extensions:m,updated_at:s,widgets:wi.map((function(e){var n,t,i=Xt.current[e.uuid],o=Si.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var r=null===(n=gn[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===r||void 0===r?void 0:r.find((function(e){return e.error}));if(r){var u=[];r.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(zo.Lz)?e:e.concat(n)}),[])),u.push(n))})),t=u.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}return tr(tr(tr({},e),o),{},{configuration:tr(tr({},e.configuration),o.configuration),content:i,outputs:t})}))})})}Bt()}),[Pi,mn,gn,Do,un,Ot,_t,Ni,Bt,z,Eo,wi]),Ao=(0,s.useMemo)((function(){return(0,$n.Rz)(un,{isPipelineUpdating:To,pipelineContentTouched:Et,pipelineLastSaved:Ot})}),[To,un,Et,Ot]),No=(0,Fn.dd)((function(e){var n,t,i=e||{block:null,contentByBlockUUID:null},o=i.block,r=i.contentByBlockUUID,l=o||{type:null,uuid:null},u=l.type,c=l.uuid,a=tr({},o);r&&(a.content=null===r||void 0===r||null===(n=r.current)||void 0===n||null===(t=n[u])||void 0===t?void 0:t[c]);return(0,w.jsx)(J.BC,{children:(0,w.jsx)(fn,tr(tr({},e),{},{block:a,onChangeCodeBlock:ri,onClose:nr,pipeline:un,savePipelineContent:Ro}))})}),{},[ri,un,Ro],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat($)}),Lo=(0,r.Z)(No,2),Fo=Lo[0],nr=Lo[1],ir=(0,s.useCallback)((function(e){Ro();var n=encodeURIComponent(e),t=(0,ro.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n),(0,Ln.u7)({file_path:n,"file_paths[]":t})}),[Ro]),or=(0,s.useCallback)((function(e,n){var t,i=e||{},o=i.content,r=i.path;if(t=null!==n&&void 0!==n&&n.blockUUID?null===Pi||void 0===Pi?void 0:Pi.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.blockUUID)})):(0,Xo.IO)(r,Pi)){var u=t,c=u.type,a=u.uuid;ri(c,a,o),Oi((function(e){var n=null===e||void 0===e?void 0:e.findIndex((function(e){var n=e.type,t=e.uuid;return n===c&&t===a}));return n>=0&&(e[n].content=o),e})),ei((function(e){return tr(tr({},e),{},(0,l.Z)({},c,tr(tr({},null===e||void 0===e?void 0:e[c]),{},(0,l.Z)({},a,Number(new Date)))))})),wn()}}),[Pi,wn,ri]),rr=(0,s.useMemo)((function(){var e=[],n=[];return Pi.forEach((function(t){h.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[Pi]),lr=rr.blocksInNotebook,ur=rr.blocksInSidekick,cr=(0,s.useCallback)((function(e,n){return Ro({pipeline:{name:e,type:n}}).then((function(e){var t,i;if(null!==e&&void 0!==e&&null!==(t=e.data)&&void 0!==t&&t.pipeline){var o,r=e.data.pipeline.uuid;if($!==r)window.location.href="".concat(G.basePath,"/pipelines/").concat(r,"/edit");else ut(),n!==(null===(o=un)||void 0===o?void 0:o.type)&&wn(),(0,$n.k1)(lr,$,r),(0,$n.k1)(ur,$,r)}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&he((function(e){return tr(tr({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){ir("pipelines/".concat($,"/").concat(En.dT.METADATA_YAML)),he(null)}}]})}))}))}),[lr,ur,ut,wn,ir,null===(b=un)||void 0===b?void 0:b.type,$,G,Ro]),ar=(0,s.useState)(null),sr=ar[0],dr=ar[1],pr=(0,s.useState)(null),fr=pr[0],vr=pr[1],hr=(0,s.useState)(null),mr=hr[0],br=hr[1],gr=(0,s.useCallback)((function(e){return Jn({pipeline_interaction:tr(tr({},Vn),{},{blocks:null!==e&&void 0!==e&&e.blockInteractionsMapping?null===e||void 0===e?void 0:e.blockInteractionsMapping:fr,interactions:sr,permissions:null===mr||void 0===mr?void 0:mr.map((function(e){var n=e.roles,t=e.triggers;return{roles:null===n||void 0===n?void 0:n.map((function(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.role})),triggers:null===t||void 0===t?void 0:t.map((function(e){return{schedule_interval:e.schedule_interval,schedule_type:e.schedule_type}}))}}))})})}),[fr,sr,mr,Vn,Jn]),xr=(0,d.Db)((function(e){var n=e.extension_uuid,t=e.force,i=e.type,o=e.uuid,r={};return i&&(r.block_type=i),n&&(r.extension_uuid=n),"undefined"!==typeof t&&(r.force=t),W.ZP.blocks.pipelines.useDelete($,encodeURIComponent(o),r)()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;if(Oi((function(e){return(0,_e.oM)(e,e.findIndex((function(e){var n=e.type,o=e.uuid;return t===n&&i===o})))})),wn(),Hi(null),t===h.tf.SCRATCHPAD&&ut(),qe){var o=tr({},fr);delete o[i],gr({blockInteractionsMapping:o}).then((function(e){var n=e.pipeline_interaction;return vr(null===n||void 0===n?void 0:n.blocks)}))}},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;he({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&jn((function(e){return tr(tr({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Hn.Gi.TEXT_PLAIN}}))))}))}})}}),jr=(0,r.Z)(xr,1)[0],yr=(0,d.Db)((function(e){var n=e.uuid;return W.ZP.widgets.pipelines.useDelete($,n)()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.widget.uuid;_i((function(e){return(0,_e.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),wn(),ut()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;he({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&jn((function(e){return tr(tr({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Hn.Gi.TEXT_PLAIN}}))))}))}})}}),kr=(0,r.Z)(yr,1)[0],Zr=(0,Fn.dd)((function(e){return(0,w.jsx)(Rn.Z,{centerOnScreen:!0,neutral:!0,onCancel:Cr,onClick:function(){return _r(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*O.iI})})),Pr=(0,r.Z)(Zr,2),Or=Pr[0],Cr=Pr[1],wr=(0,d.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,o="".concat(t,"/").concat(i);return n&&En.JD[n]&&(o="".concat(o,".").concat(En.JD[n].toLowerCase())),W.ZP.blocks.useDelete(encodeURIComponent(o))()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){Po(),wn(),ut()},onErrorCallback:function(e,n){Or(),he({displayMessage:e.exception,errors:n,response:e})}})}}),_r=(0,r.Z)(wr,1)[0],Sr=(0,d.Db)(W.ZP.kernels.useUpdate(null===Zt||void 0===Zt?void 0:Zt.id),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){return kt()},onErrorCallback:function(e,n){return he({errors:n,response:e})}})}}),Ir=(0,r.Z)(Sr,1)[0],Er=(0,s.useCallback)((function(){return Ir({kernel:{action_type:"restart"}})}),[Ir]),Tr=(0,s.useCallback)((function(){Ir({kernel:{action_type:"interrupt"}}),Li([])}),[Ir]),Mr=(0,d.Db)(W.ZP.blocks.pipelines.useCreate($)),Dr=(0,r.Z)(Mr,1)[0],Br=(0,s.useCallback)((function(e,n,t){var i,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,Q.Y6)();e.converted_from_type&&e.converted_from_uuid&&(i=null===(l=Qt.current[e.converted_from_type])||void 0===l?void 0:l[e.converted_from_uuid]);var c=e.language,a=e.type;if(at){var s,d=(0,_e.HK)((null===(s=un)||void 0===s?void 0:s.blocks)||[],(function(e){return e.type})),p=d[h.tf.DATA_EXPORTER],f=d[h.tf.DATA_LOADER],v=d[h.tf.TRANSFORMER];if(h.tf.DATA_LOADER===a){if(h.t6.YAML!==c)return void he({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(c,".")});var m;if(f)return void he({displayMessage:"Pipeline ".concat(null===(m=un)||void 0===m?void 0:m.uuid," already has a source: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}else if(h.tf.TRANSFORMER===a){var b;if(v)return void he({displayMessage:"Pipeline ".concat(null===(b=un)||void 0===b?void 0:b.uuid," already has a transformer: ").concat(null===v||void 0===v?void 0:v.uuid,".")})}else if(h.tf.DATA_EXPORTER===a){if(h.t6.YAML!==c)return void he({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(c,".")});var g;if(p)return void he({displayMessage:"Pipeline ".concat(null===(g=un)||void 0===g?void 0:g.uuid," already has a destination: ").concat(null===p||void 0===p?void 0:p.uuid,".")})}}var x=function(){return Dr({block:tr({content:i,name:u,priority:n,require_unique_name:!0},e)}).then((function(n){(0,X.wD)(n,{callback:function(){var e,i,l=n.data.block;(null===t||void 0===t||t(l),ft&&null!==A&&void 0!==A&&A(null===L||void 0===L?void 0:L.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))?null===(e=window)||void 0===e||null===(i=e.location)||void 0===i||i.reload():(ut(),wn().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;Oi((function(e){var n=(0,o.Z)(t);Object.entries(i||{}).forEach((function(e){var t=(0,r.Z)(e,2),i=t[0],l=t[1].blocks;l&&n.push.apply(n,(0,o.Z)(l.map((function(e){return tr(tr({},e),{},{extension_uuid:i})}))))}));var l=(0,_e.HK)(e,(function(e){return e.uuid})),u=[];return n.forEach((function(e){var n=l[e.uuid];n?u.push(n):u.push(e)})),u}))})))},onErrorCallback:function(n,t){var i,o=null===n||void 0===n||null===(i=n.error)||void 0===i?void 0:i.exception,r=(0,Xo.u$)(tr(tr({},e),{},{name:u}));o&&r&&o.startsWith(Yn.LR)?he((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){ir(r),he(null)}}],response:n}})):he({errors:t,response:n})}})}))};return ft&&null!==A&&void 0!==A&&A(null===L||void 0===L?void 0:L.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)?Ro().then((function(){return x()})):x()}),[Dr,ut,wn,at,ir,un,Ro,Oi,he,ft]),Rr=(0,Fn.dd)((function(e){var n=e.block,t=e.idx,i=e.isReplacingBlock,o=void 0!==i&&i,r=e.isUpdatingBlock,l=void 0!==r&&r,u=e.name,c=void 0===u?(0,Q.Y6)():u,a=e.onCreateCallback;return(0,w.jsx)(J.BC,{children:(0,w.jsx)(ne,{block:n,defaultName:c,isReplacingBlock:o,isUpdatingBlock:l,onClose:Lr,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l||o){var i,r=n.detach||!1;Ro({block:{color:(null===e||void 0===e?void 0:e.color)||null,detach:r,name:null===e||void 0===e?void 0:e.name,uuid:n.uuid},pipeline:{blocks:(null===(i=un)||void 0===i?void 0:i.blocks)||[]}}).then((function(){Hi(null),Lr()}))}else Br(tr(tr({},n),(0,ge.gR)(e,["name"])),t,a,null===e||void 0===e?void 0:e.name).then((function(){return Lr()}))},pipeline:un})})}),{},[Br,un],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),Ar=(0,r.Z)(Rr,2),Nr=Ar[0],Lr=Ar[1],Fr=(0,Fn.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,o=e.onSaveSuccess;return(0,w.jsx)(J.BC,{children:(0,w.jsx)(ai.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),zr()},onSaveSuccess:function(e){U(),zr(),null===o||void 0===o||o(e)}})})}),{},[U],{background:!0,uuid:"configure_project"}),Ur=(0,r.Z)(Fr,2),Hr=Ur[0],zr=Ur[1],Wr=(0,d.Db)(W.ZP.widgets.pipelines.useCreate($)),Kr=(0,r.Z)(Wr,1)[0],Gr=(0,s.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,Q.Y6)();return Kr({widget:tr({name:i,priority:n,type:h.tf.CHART},e)}).then((function(e){return(0,X.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),ut(),wn(),Ht(Kt.cH.CHARTS),ke(n)},onErrorCallback:function(e,n){return he({errors:n,response:e})}})}))}),[ut,wn,Kr,Ht]);(0,s.useEffect)((function(){if(ye){var e,n=null===(e=Gt.current[ye.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),ke(null))}}),[ye,ke]),(0,s.useEffect)((function(){Pn!==$&&(Oi([]),_i([]),Vi([]),Zn([]))}),[$,Pn]),(0,s.useEffect)((function(){var e,n;if("undefined"!==typeof(null===(e=un)||void 0===e?void 0:e.blocks)||"undefined"!==typeof(null===(n=un)||void 0===n?void 0:n.extensions)){var t,i,l,u,c,a,s,d,p=[];if("undefined"!==typeof(null===(t=un)||void 0===t?void 0:t.blocks))p.push.apply(p,(0,o.Z)(null===(c=un)||void 0===c?void 0:c.blocks));if("undefined"!==typeof(null===(i=un)||void 0===i?void 0:i.callbacks))p.push.apply(p,(0,o.Z)(null===(a=un)||void 0===a?void 0:a.callbacks));if("undefined"!==typeof(null===(l=un)||void 0===l?void 0:l.conditionals))p.push.apply(p,(0,o.Z)(null===(s=un)||void 0===s?void 0:s.conditionals));if("undefined"!==typeof(null===(u=un)||void 0===u?void 0:u.extensions))Object.entries((null===(d=un)||void 0===d?void 0:d.extensions)||{}).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1].blocks;i&&p.push.apply(p,(0,o.Z)(i.map((function(e){return tr(tr({},e),{},{extension_uuid:t})}))))}));Oi(p)}}),[null===(g=un)||void 0===g?void 0:g.blocks,null===(x=un)||void 0===x?void 0:x.callbacks,null===(j=un)||void 0===j?void 0:j.conditionals,null===(k=un)||void 0===k?void 0:k.extensions]),(0,s.useEffect)((function(){var e;"undefined"!==typeof(null===(e=un)||void 0===e?void 0:e.widgets)&&_i(un.widgets)}),[null===(P=un)||void 0===P?void 0:P.widgets]),(0,s.useEffect)((function(){(null===Wi||void 0===Wi?void 0:Wi.length)>0&&0===(null===Gi||void 0===Gi?void 0:Gi.length)&&(Vi(Wi),to(Wi[0]))}),[Gi,Wi]);var Vr=(0,An.Z)(Pi);(0,s.useEffect)((function(){var e;if(!ce&&("undefined"!==typeof(null===(e=un)||void 0===e?void 0:e.blocks)&&(!Pi.length||!(0,_e.fS)(null===Vr||void 0===Vr?void 0:Vr.map((function(e){return e.uuid})).sort(),null===Pi||void 0===Pi?void 0:Pi.map((function(e){return e.uuid})).sort())||(0,ge.Qr)(gn)))){var n=(0,$n.Rt)(un.blocks),t=n.content,i=n.messages;Qt.current=t,(0,ge.Qr)(i)||jn((function(e){return tr(tr({},i),e)})),ae(!0)}}),[Pi,Vr,ce,gn,null===(C=un)||void 0===C?void 0:C.blocks,ae,jn]),(0,s.useEffect)((function(){var e;if(!wi.length&&"undefined"!==typeof(null===(e=un)||void 0===e?void 0:e.widgets)){var n=(0,$n.Rt)(un.widgets),t=n.content,i=n.messages;Xt.current=t,jn((function(e){return tr(tr({},i),e)}))}}),[null===(_=un)||void 0===_?void 0:_.widgets,jn,wi]);var qr=(0,s.useCallback)((function(e,n,t){var i=Pi.find((function(t){var i=t.type,o=t.uuid;return i===n&&o===e}));if(i){if(Hi(i),null!==Wt&&void 0!==Wt&&Wt.current){var o,r=Wt.current[(0,$n.zv)(i)];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}(0,Ln.u7)({block_uuid:null,file_path:null,"file_paths[]":[]})}else if(n===h.tf.CHART){var l=wi.find((function(n){return n.uuid===e}));if(l&&(Hi(l),null!==Gt&&void 0!==Gt&&Gt.current)){var u,c=Gt.current[l.uuid];null===c||void 0===c||null===(u=c.current)||void 0===u||u.scrollIntoView()}}else t&&ir(t)}),[Pi,ir,wi]);(0,s.useEffect)((function(){if(Lt&&!Ui){var e=Pi.find((function(e){var n,t=e.uuid;return(null===Lt||void 0===Lt||null===(n=Lt.split(":"))||void 0===n?void 0:n[0])===t}));e&&(ln((function(n){return tr(tr({},n),{},(0,l.Z)({},e.uuid,!1))})),qr(e.uuid,e.type,null))}else(null===Vr||void 0===Vr?void 0:Vr.length)!==(null===Pi||void 0===Pi?void 0:Pi.length)&&Ui&&(ln((function(e){return tr(tr({},e),{},(0,l.Z)({},Ui.uuid,!1))})),qr(Ui.uuid,Ui.type,null))}),[Lt,Pi,null===Vr||void 0===Vr?void 0:Vr.length,qr,Ui,ln]);var Yr=(0,s.useMemo)((function(){return new v.Z}),[]),Qr=(0,s.useMemo)((function(){return{api_key:Vo.l,token:Yr.decodedToken.token}}),[Yr]),Xr=(0,a.ZP)((0,Jo.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,r=n.msg_type,u=n.pipeline_uuid,c=n.uuid;if(!c&&!u)return;var a=Pi.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==r?jn((function(e){var t=e[c]||[];return tr(tr({},e),{},(0,l.Z)({},c,t.concat(n)))})):(Zn((function(e){return[].concat((0,o.Z)(e),[n])})),Hn.uF.IDLE===i&&(Li([]),wn(),c||Mi(!1))),Hn.uF.BUSY===i?Li((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!a?e:e.concat(a)})):Hn.uF.IDLE===i&&Li((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),pn||Tt(!0)}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,Jr=(0,s.useCallback)((function(){Ro().then((function(){Mi(!0),Zn([]),Xr(JSON.stringify(tr(tr({},Qr),{},{execute_pipeline:!0,pipeline_uuid:$})))}))}),[$,Ro,Xr,Qr]),$r=(0,s.useCallback)((function(){Xr(JSON.stringify(tr(tr({},Qr),{},{cancel_pipeline:!0,pipeline_uuid:$})))}),[$,Xr,Qr]),el=(0,s.useCallback)((function(){Xr(JSON.stringify(tr(tr({},Qr),{},{cancel_pipeline:!0,pipeline_uuid:$,skip_publish_message:!0})))}),[$,Xr,Qr]),nl=(0,s.useCallback)((function(){Xr(JSON.stringify(tr(tr({},Qr),{},{check_if_pipeline_running:!0,pipeline_uuid:$})))}),[$,Xr,Qr]);(0,s.useEffect)((function(){var e;return window.addEventListener("pagehide",el),null===G||void 0===G||null===(e=G.events)||void 0===e||e.on("routeChangeStart",el),function(){var e;null===G||void 0===G||null===(e=G.events)||void 0===e||e.off("routeChangeStart",el),window.removeEventListener("pagehide",el)}}),[el,null===G||void 0===G?void 0:G.events]);var tl=(0,s.useCallback)((function(e){var n=e.block,t=e.code,i=e.ignoreAlreadyRunning,o=e.runDownstream,r=void 0!==o&&o,u=e.runIncompleteUpstream,c=void 0!==u&&u,a=e.runSettings,s=void 0===a?{}:a,d=e.runTests,p=void 0!==d&&d,f=e.runUpstream,v=e.variables,h=n.extension_uuid,m=n.upstream_blocks,b=n.uuid;if(!Ni.find((function(e){var n=e.uuid;return b===n}))||i){var g,x,j="".concat(Wo.vF,"_").concat(null===(g=un)||void 0===g?void 0:g.uuid);Xr(JSON.stringify(tr(tr({},Qr),{},{code:t,extension_uuid:h,output_messages_to_logs:!!(0,cn.U2)(j),pipeline_uuid:null===(x=un)||void 0===x?void 0:x.uuid,run_downstream:r,run_incomplete_upstream:c,run_settings:s,run_tests:p,run_upstream:f,type:n.type,upstream_blocks:m,uuid:b,variables:v}))),jn((function(e){return delete e[b],e})),Be(!1),Li((function(e){return e.find((function(e){var n=e.uuid;return b===n}))?e:e.concat(n)})),Bo((function(e){return tr(tr({},e),{},(0,l.Z)({},null===n||void 0===n?void 0:n.uuid,!0))}))}wn()}),[wn,un,Ni,Xr,jn,Li,Be,Qr]),il=(0,s.useCallback)((function(e){var n,t=e.block;return pn?tl(e):null===(n=Ro({block:{outputs:[],uuid:t.uuid}},{contentOnly:!0}))||void 0===n?void 0:n.then((function(){return tl(e)}))}),[pn,tl,Ro]),ol=(0,a.ZP)((0,Jo.Ib)("terminal"),{shouldReconnect:function(){return!0}}),rl=ol.lastMessage,ll=ol.sendMessage,ul=(0,Fn.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,w.jsx)(J.BC,{children:(0,w.jsx)(E.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}}),sl()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[Go.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),cl=(0,r.Z)(ul,2),al=cl[0],sl=cl[1],dl=W.ZP.global_data_products.list().data,pl=(0,s.useMemo)((function(){return(null===dl||void 0===dl?void 0:dl.global_data_products)||[]}),[dl]),fl=(0,Fn.dd)((function(e){var n=e.addNewBlock;return(0,w.jsx)(J.BC,{children:(0,w.jsx)(zn.Z,{children:(0,w.jsx)(Tn.Z,{globalDataProducts:pl,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:h.tf.GLOBAL_DATA_PRODUCT}),ml()}})})})}),{},[pl],{background:!0,uuid:"global_data_products"}),vl=(0,r.Z)(fl,2),hl=vl[0],ml=vl[1],bl=(0,s.useRef)(null),gl=(0,s.useState)(null),xl=gl[0],jl=gl[1],yl=(0,s.useMemo)((function(){return Kt.cH.INTERACTIONS===Nt}),[Nt]);(0,s.useEffect)((function(){var e,n;Nt&&null!==bl&&void 0!==bl&&bl.current&&jl(null===bl||void 0===bl||null===(e=bl.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[Nt,te,V,qe,bl]),(0,s.useEffect)((function(){!sr&&(null===qn||void 0===qn?void 0:qn.length)>=1&&dr((0,_e.HK)(qn||[],(function(e){return e.uuid})))}),[qn,sr,dr]),(0,s.useEffect)((function(){!fr&&null!==Vn&&void 0!==Vn&&Vn.blocks&&vr(null===Vn||void 0===Vn?void 0:Vn.blocks)}),[fr,Vn,vr]);var kl=(0,s.useMemo)((function(){return(0,w.jsx)(Uo,{activeView:Nt,addNewBlockAtIndex:function(e,n,t,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(){return Nr({block:e,idx:n,isReplacingBlock:o,name:i,onCreateCallback:t})}))},afterWidth:de,autocompleteItems:Oo,blockInteractionsMapping:fr,blockRefs:Wt,blocks:Pi,blocksInNotebook:lr,cancelPipeline:$r,chartRefs:Gt,checkIfPipelineRunning:nl,containerHeightOffset:yl?xl+1:null,contentByBlockUUID:Qt,createInteraction:it,deleteBlock:jr,deleteWidget:kr,editingBlock:Bi,executePipeline:Jr,fetchFileTree:ut,fetchPipeline:wn,fetchSecrets:yi,fetchVariables:bi,globalDataProducts:pl,globalVariables:gi,insights:bo,interactions:qn,interactionsMapping:sr,interruptKernel:Tr,isLoadingCreateInteraction:ot,isLoadingUpdatePipelineInteraction:et,isPipelineExecuting:Ti,isPipelineUpdating:To,lastTerminalMessage:rl,messages:gn,metadata:xo,onChangeCallbackBlock:oi,onChangeChartBlock:ui,onChangeCodeBlock:ri,onSelectBlockFile:qr,onUpdateFileSuccess:or,permissions:mr,pipeline:un,pipelineInteraction:Vn,pipelineMessages:kn,project:H,refAfterFooter:bl,runBlock:il,runningBlocks:Ni,sampleData:so,savePipelineContent:Ro,savePipelineInteraction:gr,secrets:ki,selectedBlock:Ui,selectedFilePath:Pe,sendTerminalMessage:ll,setActiveSidekickView:Ht,setAllowCodeBlockShortcuts:We,setAnyInputFocused:Ne,setBlockInteractionsMapping:vr,setDisableShortcuts:Ue,setEditingBlock:Ri,setErrors:he,setHiddenBlocks:ln,setInteractionsMapping:dr,setPermissions:br,setSelectedBlock:Hi,setTextareaFocused:Be,showBrowseTemplates:al,showDataIntegrationModal:Fo,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Q.Y6)(),t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(){return Nr({block:e,isReplacingBlock:t,isUpdatingBlock:!t,name:n})}))},sideBySideEnabled:ft,statistics:yo,textareaFocused:De,treeRef:Vt,updatePipelineInteraction:Jn,updatePipelineMetadata:cr,updateWidget:Ii,widgets:wi})}),[Nt,xl,de,Oo,fr,Wt,Pi,lr,$r,nl,Qt,it,jr,kr,Bi,Jr,ut,wn,yi,bi,pl,gi,bo,qn,sr,Tr,ot,et,Ti,To,yl,rl,gn,xo,oi,ui,ri,qr,or,mr,un,Vn,kn,H,bl,il,Ni,so,Ro,gr,ki,Ui,Pe,ll,Ht,Ne,vr,Ri,he,ln,dr,br,Be,Nr,al,Fo,ft,yo,De,Jn,cr,Ii,wi]),Zl=(0,s.useMemo)((function(){return(0,w.jsx)(ti,{addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){var o;Y.L.BLOCK_FILE!==(null===e||void 0===e||null===(o=e.block_action_object)||void 0===o?void 0:o.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)?Nr({block:e,idx:n,name:i,onCreateCallback:t}):Br(e,n,t,i)}))},addWidget:function(e,n){var t=n.onCreateCallback;return Gr(e,wi.length,t)},afterHidden:te,allBlocks:Pi,allowCodeBlockShortcuts:ze,anyInputFocused:Ae,autocompleteItems:Oo,beforeHidden:re,blockInteractionsMapping:fr,blockRefs:Wt,blocks:lr,blocksThatNeedToRefresh:$t,dataProviders:vi,deleteBlock:jr,disableShortcuts:Fe,fetchFileTree:ut,fetchPipeline:wn,fetchSampleData:co,files:ct,globalDataProducts:pl,globalVariables:gi,hiddenBlocks:on,interactionsMapping:sr,interruptKernel:Tr,mainContainerRef:sn,mainContainerWidth:di,messages:gn,onChangeCallbackBlock:oi,onChangeCodeBlock:ri,openSidekickView:zt,pipeline:un,pipelineContentTouched:Et,project:H,restartKernel:Er,runBlock:il,runningBlocks:Ni,savePipelineContent:Ro,scrollTogether:bt,selectedBlock:Ui,setAnyInputFocused:Ne,setDisableShortcuts:Ue,setEditingBlock:Ri,setErrors:he,setHiddenBlocks:ln,setIntegrationStreams:Qi,setOutputBlocks:Vi,setPipelineContentTouched:Tt,setSelectedBlock:Hi,setSelectedOutputBlock:to,setSelectedStream:$i,setTextareaFocused:Be,showBrowseTemplates:al,showConfigureProjectModal:Hr,showDataIntegrationModal:Fo,showGlobalDataProducts:hl,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Q.Y6)();return new Promise((function(){return Nr({block:e,isUpdatingBlock:!0,name:n})}))},sideBySideEnabled:ft,textareaFocused:De,widgets:wi})}),[Br,Gr,te,ze,Ae,Oo,re,Wt,fr,Pi,lr,$t,vi,jr,Fe,ut,wn,co,ct,pl,gi,on,sr,Tr,sn,di,gn,oi,ri,zt,un,Et,H,Er,il,Ni,Ro,bt,Ui,Ne,Ri,he,ln,Tt,Hi,Be,Nr,al,Hr,Fo,hl,ft,De,wi]),Pl=(0,s.useMemo)((function(){if(D===Yn.b7)return(0,w.jsx)(Sn,{cancelPipeline:$r,createPipeline:wo,executePipeline:Jr,interruptKernel:Tr,isPipelineExecuting:Ti,kernel:Zt,pipeline:un,restartKernel:Er,savePipelineContent:Ro,scrollTogether:bt,setActiveSidekickView:Ht,setMessages:jn,setScrollTogether:gt,setSideBySideEnabled:xt,sideBySideEnabled:ft,updatePipelineMetadata:cr,children:Pe&&(0,w.jsx)(Z.Z,{ml:1,children:(0,w.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,children:(0,w.jsx)(T.ZP,{compact:!0,onClick:function(){return Oe(null)},small:!0,children:"View pipeline"})})})})}),[$r,wo,Jr,Tr,Ti,Zt,D,un,Er,Ro,bt,Pe,Ht,jn,gt,Oe,xt,ft,cr]),Ol=(0,s.useMemo)((function(){if(D===Yn.b7)return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Un,{filePaths:we,filesTouched:Ee,isBusy:Ni.length>=1,kernel:Zt,pipeline:un,restartKernel:Er,savePipelineContent:Ro,saveStatus:Ao,selectedFilePath:Pe,setErrors:he,setRunningBlocks:Li,setSideBySideEnabled:xt,sideBySideEnabled:ft,updatePipelineMetadata:cr,children:Pl}),(null===we||void 0===we?void 0:we.length)>0&&(0,w.jsx)(Nn.rK,{relativePosition:!0,secondary:!0,children:(0,w.jsx)(In.Z,{filePaths:we,filesTouched:Ee,savePipelineContent:Ro,selectedFilePath:Pe})})]})}),[Pl,Ee,Zt,D,un,Er,Ni,Ro,Ao,Pe,we,he,xt,ft,cr]),Cl=(0,s.useMemo)((function(){var e;return null===Yi||void 0===Yi||null===(e=Yi.filter((function(e){return(0,_e.sE)(null===ao||void 0===ao?void 0:ao.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,Q.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,w.jsx)(Z.Z,{pl:1,children:(0,w.jsx)(N.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return $i(e)},selected:Ji===e,uuid:e,children:e})},e)}))}),[ao,Yi,Ji]),wl=(0,s.useRef)(null),_l=(0,s.useMemo)((function(){return(0,w.jsx)(vn.Z,{addNewBlock:function(e,n){Br(e,Pi.length,n,e.name),(null===Ut||void 0===Ut?void 0:Ut.length)>=1&&G.push("/pipelines/".concat($,"/edit"))},blocks:Pi,deleteWidget:kr,fetchAutocompleteItems:Po,fetchFileTree:ut,fetchPipeline:wn,files:ct,onSelectBlockFile:qr,openFile:ir,openPipeline:function(e){oo(),G.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:zt,pipeline:un,ref:wl,setErrors:he,setSelectedBlock:Hi,widgets:wi})}),[Br,Pi,kr,Po,ut,wn,null===Ut||void 0===Ut?void 0:Ut.length,ct,qr,ir,zt,un,$,oo,G,he,Hi,wi]),Sl=(0,s.useMemo)((function(){return(0,w.jsx)(I,{blockRefs:Wt,hiddenBlocks:on,pipeline:un,setHiddenBlocks:ln})}),[Wt,on,un,ln]),Il=(0,s.useMemo)((function(){return Yn.Jf.uuid===(null===Je||void 0===Je?void 0:Je.uuid)?_l:Yn.IY.uuid===(null===Je||void 0===Je?void 0:Je.uuid)?Sl:null}),[_l,Sl,Je]),El=(0,s.useMemo)((function(){return(0,w.jsx)(Z.Z,{px:1,children:(0,w.jsx)(M.Z,{noPadding:!0,onClickTab:function(e){en(e)},selectedTabUUID:null===Je||void 0===Je?void 0:Je.uuid,small:!0,tabs:Yn.NR})})}),[en,Je]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Mn.Z,{title:null===(S=un)||void 0===S?void 0:S.name}),(0,w.jsxs)(ci,{after:kl,afterHeader:(0,w.jsx)(Ho,{activeView:Nt,pipeline:un,project:H,secrets:ki,selectedBlock:Ui,setSelectedBlock:Hi,variables:gi}),afterHeightOffset:Ko.Mz,afterHidden:te,afterInnerHeightMinus:xl,afterNavigationItems:Qo({activeView:Nt,pipeline:un,project:H,secrets:ki,setActiveSidekickView:Ht,variables:gi}),afterOverflow:Kt.cH.DATA===Nt?"hidden":null,afterSubheader:(null===Gi||void 0===Gi?void 0:Gi.length)>0&&Nt===Kt.cH.DATA&&(0,w.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!at&&Gi.map((function(e){var n=e.uuid,t=(null===no||void 0===no?void 0:no.uuid)===n;return(0,w.jsx)(Z.Z,{pl:1,children:(0,w.jsx)(N.ZP,{afterElement:t?(0,w.jsx)(T.ZP,{basic:!0,highlightOnHover:!0,onClick:function(){(0,$n.h8)($,e.uuid),Vi((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,w.jsx)(K.x8,{muted:!0,size:1.25*O.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return to(e)},selected:t,uuid:n,children:n})},n)})),at&&Cl]}),before:Il,beforeHeader:El,beforeHeightOffset:Ko.Mz,beforeHidden:re,beforeNavigationItems:(0,Yo.H)(qo.M.EDIT,un),errors:be||ve,headerOffset:(null===we||void 0===we?void 0:we.length)>0?36:0,mainContainerHeader:Ol,mainContainerRef:sn,page:D,pipeline:un,setAfterHidden:ie,setAfterWidthForChildren:pe,setBeforeHidden:le,setErrors:be?xe:he,setMainContainerWidth:pi,children:[(0,w.jsx)("div",{style:{height:Pe?0:null,opacity:Pe?0:null,visibility:Pe?"hidden":null},children:(0,w.jsx)(f.Z,{uuid:"PipelineDetail/".concat($),children:Zl})}),null===Ut||void 0===Ut?void 0:Ut.map((function(e){return(0,w.jsx)("div",{style:{display:Pe===e?null:"none"},children:(0,w.jsx)(f.Z,{uuid:"FileEditor/".concat(decodeURIComponent(e)),children:(0,w.jsx)(hn.Z,{active:Pe===e,addNewBlock:function(e,n){Br(tr(tr({},e),{},{require_unique_name:!1}),Pi.length,n,e.name),G.push("/pipelines/".concat($,"/edit"))},fetchPipeline:wn,fetchVariables:bi,filePath:e,onUpdateFileSuccess:or,openSidekickView:zt,pipeline:un,selectedFilePath:Pe,sendTerminalMessage:ll,setDisableShortcuts:Ue,setErrors:he,setFilesTouched:Te,setSelectedBlock:Hi})})},e)})),(0,w.jsx)(Z.Z,{pb:Ft?0:Math.max(Math.floor(V*(2/3)/O.iI),0)})]})]})}ir.getInitialProps=function(){var e=(0,i.Z)(c().mark((function e(n){var t,i,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,i=Yn.b7,o={page:i,pipeline:{uuid:t}},e.abrupt("return",o);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var or=(0,si.Z)(ir)},80329:function(e,n,t){"use strict";t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(58623)}])}},function(e){e.O(0,[2678,3662,1154,844,8224,6639,1124,341,1751,5896,2714,9161,1821,2631,7011,4783,6563,4267,600,8487,8264,7858,5499,3932,722,1769,1550,3004,9264,553,976,1749,9774,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);