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
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551,5810],{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,s=(0,l.j)("apiReloads"),a=(0,o.Z)(s,1)[0],d=(0,i.Z)(c);t&&d.push(t);var p=d.map((function(e){return String(a[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 s},S_:function(){return c},Yn:function(){return p},rW:function(){return a}});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 s(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],s=r[3],a=r[4],d=r[5],p=c||s||a||d;return u(u({},e),{},(0,i.Z)({},p,n))}),{})}function a(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 s=(0,r.Z)(c,4),a=s[2],d=s[3];return a||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 a},Nk:function(){return s},aU:function(){return c}});var i=t(38626),o=t(44897),r=t(95363),l=t(70515),u=2,c=21,s=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 '})),a=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 x}});var i=t(85202),o=t(66639),r=t(82684),l=t(4383),u=t(44425),c=t(30160),s=t(98464),a=t(95363),d=t(61896),p=t(89678),f=t(89209);function v(e,n,t){t.forEach((function(e){n.addAction(e)}))}var h=t(75582),m={"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 b=t(37529),g=t(28598);o._m.config({paths:{vs:"".concat((0,l.XF)(),"/monaco-editor/min/vs")}});var x=function(e){var n=e.autocompleteProviders,l=e.autoHeight,x=e.autoSave,j=e.block,y=e.fontSize,k=void 0===y?d.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,G=e.width,W=void 0===G?"100%":G,K=(0,r.useRef)(null),V=(0,r.useRef)(null),q=(0,r.useRef)(null),Y=(0,r.useState)([]),X=Y[0],Q=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(m[e],".json"))]).then((function(t){var i=(0,h.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]),se=(0,r.useCallback)((function(e,n){K.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,b.e)(n,(function(){S(e.getValue())}))),v(0,e,t),e.getModel().updateOptions({tabSize:L}),l&&!Z&&(e._domElement.style.height="".concat(((z||"").split("\n").length+p.Ep)*p.aU,"px")),e.onDidFocusEditorWidget((function(){null===D||void 0===D||D(!0)})),e.onDidContentSizeChange((function(n){var t=n.contentHeight,i=n.contentHeightChanged;l&&i&&(e._domElement.style.height="".concat(t+2*p.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===_||_()}),[l,Z,C,w,_,S,M,ie,D,B,L,F,z]);(0,r.useEffect)((function(){var e;return x&&S&&(e=setInterval((function(){S(K.current.getValue())}),5e3)),function(){x&&e&&clearInterval(e)}}),[x,K,S]);var ae=(0,s.Z)(M),de=(0,s.Z)(F);return(0,r.useEffect)((function(){null!==K&&void 0!==K&&K.current&&(M&&F?setTimeout((function(){K.current.focus()}),1):i.findDOMNode(K.current._domElement).getElementsByClassName("inputarea")[0].blur())}),[K,M,ae,F,de]),(0,r.useEffect)((function(){if(null!==V&&void 0!==V&&V.current&&null!==K&&void 0!==K&&K.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===K||void 0===K?void 0:K.current))})),v(null===V||void 0===V||V.current,null===K||void 0===K?void 0:K.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(){X.map((function(e){return e.dispose()}))}}),[X]),(0,r.useEffect)((function(){$&&n&&(0===X.length&&F||!de&&F?Q((0,f.S_)($,n)):de&&!F&&X.map((function(e){return e.dispose()})))}),[n,X,$,F,de]),(0,g.jsxs)(p.Nk,{hideDuplicateMenuItems:!0,padding:I,style:{display:te?null:"none"},children:[E&&!(null!==z&&void 0!==z&&z.length)&&(0,g.jsx)(p.KT,{children:(0,g.jsx)(c.ZP,{monospace:!0,muted:!0,children:E})}),(0,g.jsx)(o.ZP,{beforeMount:ce,height:Z,language:P||"python",onChange:function(e){null===O||void 0===O||O(e)},onMount:se,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)===u.tf.MARKDOWN?"on":"off"},theme:re||"vs-dark",value:z,width:W}),(0,g.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}})},78688:function(e,n,t){"use strict";var i=t(82394),o=t(82684),r=t(15338),l=t(77456),u=t(97618),c=t(55485),s=t(85854),a=t(65956),d=t(38276),p=t(30160),f=t(72473),v=t(70515),h=t(74778),m=t(74260),b=t(81728),g=t(28598);function x(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 j(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?x(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):x(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.contained,t=void 0===n||n,i=e.onClickStep,x=e.setupSteps,y=e.small,k=(0,o.useCallback)((function(e,n,o,x){var Z=e.name,P=e.description,O=e.group,C=e.error,w=e.required,_=e.status_calculated,S=e.steps,I=e.tab,E=e.uuid,T=(null===S||void 0===S?void 0:S.length)||0,M=x||{completedGroup:!1,level:0,numberEl:null},D=M.completedGroup,B=M.level,R=M.numberEl,A=0===B?2*v.iI:1.5*v.iI;if(O){var N=(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Z,{p:v.cd,children:(0,g.jsx)(c.ZP,{children:(0,g.jsxs)(u.Z,{flex:1,flexDirection:"column",children:[(0,g.jsxs)(c.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,g.jsx)(s.Z,{level:y?5:4,children:Z}),(0,g.jsx)(d.Z,{mr:v.cd}),m.br.COMPLETED===_&&(0,g.jsx)(f.Jr,{size:A,success:!0})]}),P&&(0,g.jsx)(d.Z,{mt:1,children:(0,g.jsx)(p.ZP,{default:!0,small:y,children:P})})]})})}),(0,g.jsx)(r.Z,{light:!0}),null===S||void 0===S?void 0:S.map((function(e,n){return k(e,n,T,{completedGroup:m.br.COMPLETED===_,level:0})}))]});return(0,g.jsxs)(d.Z,{mb:y?0:v.cd,children:[t&&(0,g.jsx)(a.Z,{noPadding:!0,children:N}),!t&&N]},E)}var L=m.br.COMPLETED===_,F=0===B?String(n+1):(0,b.bH)()[n].toLowerCase();var U=!!I&&i,H=(0,g.jsx)(d.Z,{pl:0===B?v.cd:0,children:(0,g.jsxs)(p.ZP,{large:!y,monospace:!0,muted:!0,children:[F,"."]})}),z={muted:L||D,strikethrough:L||D};return(0,g.jsx)(h.aw,{clickable:!!U,onClick:U?function(){return null===i||void 0===i?void 0:i(I)}:null,children:(0,g.jsxs)(d.Z,{py:0!==B||y?1:v.cd,children:[(0,g.jsxs)(c.ZP,{children:[R&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{style:{opacity:0},children:R}),(0,g.jsx)(d.Z,{mr:1})]}),H,(0,g.jsx)(d.Z,{mr:1}),(0,g.jsx)(u.Z,{flex:1,flexDirection:"column",children:(0,g.jsxs)(c.ZP,{flexDirection:"column",children:[(0,g.jsxs)(c.ZP,{alignItems:"center",children:[(0,g.jsxs)(u.Z,{flex:1,children:[0===B&&!y&&(0,g.jsx)(s.Z,j(j({level:5},z),{},{children:Z})),0===B&&y&&(0,g.jsx)(p.ZP,j(j({bold:!0,large:!0},z),{},{children:Z})),B>=1&&(0,g.jsx)(p.ZP,j(j({bold:!0,large:!y},z),{},{children:Z})),!w&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Z,{mr:1}),(0,g.jsx)(p.ZP,{muted:!0,uppercase:!0,xsmall:!0,children:"optional"})]})]}),(0,g.jsx)(d.Z,{mr:v.cd}),L&&(0,g.jsx)(f.Jr,{size:A,success:!0}),m.br.INCOMPLETE===_&&(0,g.jsx)(f.uy,{muted:!0,size:A}),m.br.ERROR===_&&(0,g.jsx)(f.uy,{danger:!0,size:A}),(0,g.jsx)(d.Z,{pr:v.cd*(_?1:2)})]}),P&&(0,g.jsx)(d.Z,{mt:1,pr:3*v.cd,children:(0,g.jsx)(p.ZP,j(j({default:!0},z),{},{small:y,children:P}))}),C&&(0,g.jsx)(l.Z,{error:C,small:!0,warning:!0})]})})]}),T>=1&&(0,g.jsx)(d.Z,{mt:1,children:null===S||void 0===S?void 0:S.map((function(e,n){return k(e,n,T,{completedGroup:D,level:1,numberEl:H})}))})]})},E)}),[t,i,y]),Z=[],P=(null===x||void 0===x?void 0:x.length)||0;return null===x||void 0===x||x.forEach((function(e,n){e.status;Z.push(k(e,n,P))})),t?(0,g.jsx)(d.Z,{p:v.cd,children:Z}):(0,g.jsx)(g.Fragment,{children:Z})}},89308:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(82684),l=t(69864),u=t(71180),c=t(26032),s=t(74260),a=t(15338),d=t(97618),p=t(55485),f=t(85854),v=t(65956),h=t(78688),m=t(38276),b=t(30160),g=t(35686),x=t(70515),j=t(72473),y=t(81728),k=t(10332),Z=t(72619),P=t(23780),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,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.actionsOnly,t=e.computeService,i=e.computeConnections,C=e.contained,_=void 0===C||C,S=e.fetchAll,I=e.hideDetails,E=e.onClickStep,T=e.small,M=(0,P.VI)(null,{},[],{uuid:"ConnectionSettings"}),D=(0,o.Z)(M,1)[0],B=(0,r.useState)(null),R=B[0],A=B[1],N=(0,r.useState)(null),L=N[0],F=N[1],U=(0,l.Db)((function(e){var n=e.action,i=e.uuid;return g.ZP.compute_connections.compute_services.useUpdate(null===t||void 0===t?void 0:t.uuid,i)({compute_connection:{action:n}})}),{onSuccess:function(e){return(0,Z.wD)(e,{callback:function(e){var n=e.compute_connection;null===S||void 0===S||S(),F(w(w({},R),{},{computeConnection:n}))},onErrorCallback:function(e,n){return D({errors:n,response:e})}})}}),H=(0,o.Z)(U,2),z=H[0],G=H[1].isLoading;return(0,r.useEffect)((function(){if(L){var e,n=null===i||void 0===i?void 0:i.find((function(e){var n,t=e.uuid;return(null===L||void 0===L||null===(n=L.computeConnection)||void 0===n?void 0:n.uuid)===t}));(null===n||void 0===n?void 0:n.state)!==(null===L||void 0===L||null===(e=L.computeConnection)||void 0===e?void 0:e.state)&&F(null)}}),[i,L,F]),(0,O.jsx)(m.Z,{py:_?x.cd:0,children:null===i||void 0===i?void 0:i.map((function(e,t){var i,r,l,g,Z=e.actions,P=e.attributes,C=e.connection,w=e.description,S=e.name,M=e.required,D=e.status_calculated,B=e.steps,N=e.uuid;!I&&!n&&P&&(null===(i=Object.keys(P||{}))||void 0===i?void 0:i.length)>=1&&(l=(0,k.s)(Object.entries(P||{}).map((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return[(0,y.vg)(t),i]})))),!I&&!n&&C&&(null===(r=Object.keys(C||{}))||void 0===r?void 0:r.length)>=1&&(g=(0,k.s)(Object.entries(C||{}).map((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return[(0,y.vg)(t),i]}))));var U=(0,O.jsxs)(O.Fragment,{children:[!n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(p.ZP,{children:(0,O.jsxs)(d.Z,{flex:1,flexDirection:"column",children:[(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(d.Z,{flex:1,children:(0,O.jsx)(f.Z,{level:T?5:4,children:S})}),(0,O.jsx)(m.Z,{mr:x.cd}),(0,O.jsx)(j.Fs,{danger:s.br.ERROR===D,muted:M&&s.br.INCOMPLETE===D,size:2*x.iI,success:!M||s.br.COMPLETED===D})]}),w&&(0,O.jsx)(m.Z,{mt:1,children:(0,O.jsx)(b.ZP,{default:!0,small:T,children:w})})]})})}),(null===B||void 0===B?void 0:B.length)>=1&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(h.Z,{contained:!1,onClickStep:E,setupSteps:B,small:T})]})]}),(l||g)&&(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsxs)(p.ZP,{children:[l&&(0,O.jsx)(v.Z,{noPadding:!0,children:(0,O.jsxs)(p.ZP,{flexDirection:"column",children:[(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(b.ZP,{bold:!0,large:!0,children:"Attributes"})}),(0,O.jsx)(a.Z,{light:!0}),l,(0,O.jsx)(m.Z,{mb:x.cd})]})}),l&&g&&(0,O.jsx)(m.Z,{pr:x.cd}),g&&(0,O.jsx)(v.Z,{noPadding:!0,children:(0,O.jsxs)(p.ZP,{flexDirection:"column",children:[(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(b.ZP,{bold:!0,large:!0,children:"Connection"})}),(0,O.jsx)(a.Z,{light:!0}),g,(0,O.jsx)(m.Z,{mb:x.cd})]})})]})}),(null===Z||void 0===Z?void 0:Z.length)>=1&&(0,O.jsxs)(O.Fragment,{children:[!n&&(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(p.ZP,{children:(0,O.jsx)(d.Z,{flex:1,flexDirection:"column",children:(0,O.jsx)(p.ZP,{alignItems:"center",children:(0,O.jsx)(d.Z,{flex:1,children:(0,O.jsx)(f.Z,{level:T?5:4,children:"Actions"})})})})})}),null===Z||void 0===Z?void 0:Z.map((function(e,t){var i,o=e.description,r=e.name,l=e.uuid,s=G&&(null===R||void 0===R?void 0:R.uuid)===N&&(null===R||void 0===R?void 0:R.actionUUID)===l||c.i.PENDING===(null===L||void 0===L||null===(i=L.computeConnection)||void 0===i?void 0:i.state);return(0,O.jsxs)("div",{children:[(!n||t>=1)&&(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(p.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,O.jsxs)(d.Z,{flex:1,flexDirection:"column",children:[(0,O.jsx)(b.ZP,{default:!0,large:!T,children:o}),(0,O.jsx)(m.Z,{mt:x.cd,children:(0,O.jsx)(u.ZP,{compact:T,danger:[c._.DELETE].includes(l),loading:s,onClick:function(){A({actionUUID:l,uuid:N}),F(null),z({action:l,uuid:N})},primary:[c._.CREATE,c._.UPDATE].includes(l),secondary:[c._.DESELECT].includes(l),small:T,children:r})})]})})})]},l)}))]})]});return(0,O.jsxs)(m.Z,{mt:t>=1?x.cd:0,px:_?x.cd:0,children:[_&&(0,O.jsx)(v.Z,{noPadding:!0,children:U}),!_&&U]},N)}))})}},77456:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(43695),l=t(30160),u=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 s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.danger,t=e.error,i=e.large,c=e.small,a=e.warning,d=t.message,p=t.variables,f=d;return p&&Object.entries(p||{}).forEach((function(e){var t=(0,o.Z)(e,2),d=t[0],p=t[1];f=f.replace("{{".concat(d,"}}"),(0,r.Dq)((0,u.jsx)(l.ZP,s(s({danger:n,inline:!0,large:i,muted:!n&&!a,small:c,warning:a},p||{}),{},{children:d}))))})),(0,u.jsx)(l.ZP,{danger:n,dangerouslySetInnerHTML:{__html:f},muted:!n&&!a,large:i,small:c,warning:a})}},74778:function(e,n,t){"use strict";t.d(n,{UE:function(){return c},aw:function(){return s},bC:function(){return a}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(91437),c=i.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-1b5e7g-0"})([""," border-radius:","px;padding:","px;"," ",""],(0,u.eR)(),r.D7,2.5*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||o.Z.borders).darkLight,";\n box-shadow: ").concat((e.theme.shadow||o.Z.shadow).frame,";\n ")}),(function(e){return!e.inline&&"\n height: ".concat(28*l.iI,"px;\n width: ").concat(40*l.iI,"px;\n margin: ").concat(l.cd/2*l.iI,"px;\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__SetupStepRowStyle",componentId:"sc-1b5e7g-1"})([""," ",""],(0,u.eR)(),(function(e){return e.clickable&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverOverlay,";\n cursor: pointer;\n }\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-1b5e7g-2"})([""," height:","px;padding-left:","px;padding-right:","px;"," ",""],(0,u.eR)(),7*l.iI,l.cd*l.iI,l.cd*l.iI,(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 ")}))},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),s=t(71180),a=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]),G=z[0],W=z[1],K=(0,r.useState)(C?L.find((function(e){return e.uuid===(null===C||void 0===C?void 0:C.uuid)})):L[0]),V=K[0],q=K[1],Y=(0,r.useState)(null),X=Y[0],Q=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!==G&&void 0!==G&&G.filterTemplates?null===G||void 0===G?void 0:G.filterTemplates(e):e}),[$,G]),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!==G&&void 0!==G&&G.filterTemplates?null===G||void 0===G?void 0:G.filterTemplates(e):e}),[ie,G]),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===G||void 0===G?void 0:G.uuid)===r,u=w({size:y.ZG},l&&o?o:{});return(0,O.jsx)(y.wj,{onClick:function(){return W(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)}))}),[G,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===G||void 0===G?void 0:G.uuid)===r,u=w({size:y.ZG},l&&o?o:{});return(0,O.jsx)(y.wj,{onClick:function(){return W(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)}))}),[G,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]),se=(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]),ae=(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:G&&(null===G||void 0===G?void 0:G.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{pipeline_type:null===G||void 0===G?void 0:G.uuid}:null,templateUUID:null===X||void 0===X?void 0:X.template_uuid}):(0,O.jsx)(b.Z,{contained:t,heightOffset:de,onCreateCustomTemplate:t?function(e){Q(e)}:null,onMutateSuccess:ee,templateAttributes:G&&(null===G||void 0===G?void 0:G.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{block_type:null===G||void 0===G?void 0:G.uuid}:null,templateUUID:null===X||void 0===X?void 0:X.template_uuid}),t?(0,O.jsxs)(O.Fragment,{children:[T&&ae,(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)(a.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)(s.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!==se&&void 0!==se&&se.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===se||void 0===se?void 0:se.length)>=1&&(0,O.jsx)(y.n8,{children:se})]})]})]});return t?(0,O.jsxs)(O.Fragment,{children:[T&&ae,(0,O.jsx)(y.Rd,{height:pe,width:N,children:fe})]}):fe}},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),s=t(40761),a=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,G=e.setDisableShortcuts,W=e.setErrors,K=e.setFilesTouched,V=e.setSelectedBlock,q=(0,u.j)("apiReloads"),Y=(0,o.Z)(q,2)[1],X=(0,l.useState)(null),Q=X[0],J=X[1],$=(0,l.useState)(!1),ee=$[0],ne=($[1],(0,l.useRef)(null)),te=(0,l.useMemo)((function(){return new s.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 W({errors:n,response:e})}})}),[le,W]);var ue=(0,l.useState)(null===Q||void 0===Q?void 0:Q.content),ce=ue[0],se=ue[1],ae=(0,l.useCallback)((function(e){se(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&&G&&(null===G||void 0===G||G(!0))}),[n,G]),(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===Q||void 0===Q?void 0:Q.path)&&encodeURIComponent(null===Q||void 0===Q?void 0:Q.path)),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(e){var n=e.file_content;Y((function(e){return R(R({},e),{},(0,i.Z)({},"FileVersions/".concat(null===Q||void 0===Q?void 0:Q.path),Number(new Date)))})),N&&(null===N||void 0===N||N(n))},onErrorCallback:function(e,n){return null===W||void 0===W?void 0:W({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())})),K((function(e){return R(R({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),fe(!1)}),[m,b,U,K,he]),be=(0,l.useMemo)((function(){return(0,_.lU)()}),[]),ge=(0,l.useMemo)((function(){var e,n,t,i;return null===(null===Q||void 0===Q||null===(e=Q.path)||void 0===e?void 0:e.match(be))?j.Lu.TXT:null===Q||void 0===Q||null===(n=Q.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,Q]),xe=(0,l.useMemo)((function(){if(null!==Q&&void 0!==Q&&Q.path)return(0,h.jsx)(x.Z,{autoHeight:!0,language:j.nB[ge],onChange:function(e){ae(e),K((function(e){return R(R({},e),{},(0,i.Z)({},null===Q||void 0===Q?void 0:Q.path,!0))})),fe(!0)},onSave:function(e){me(e,Q)},selected:!0,textareaFocused:!0,value:(0,E.Pb)(null===Q||void 0===Q?void 0:Q.content)?JSON.stringify(JSON.parse(null===Q||void 0===Q?void 0:Q.content),null,2):null===Q||void 0===Q?void 0:Q.content,width:"100%"})}),[Q,ge,me,ae,K]),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 a.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)(Q,null===Q||void 0===Q?void 0:Q.path))&&(0,_.ck)(Q.path.split(r.sep))!==a.tf.SCRATCHPAD&&(0,I.lr)(Q)&&(0,h.jsx)(d.ZP,{onClick:function(){var e=(null===F||void 0===F?void 0:F.type)===k.qL.INTEGRATION,n=(0,_.TU)(Q,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===Q||void 0===Q?void 0:Q.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,Q);else if(pe&&(0,M.y)([O.zX,O.hS],t)){e.preventDefault();var i="".concat(Q.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[n,ce,p,Q,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,Q)},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),s=6.25*l.iI,a=(l.iI,100*l.iI),d=i.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],r.n_,a,(function(e){return"\n box-shadow: ".concat((e.theme||o.Z).shadow.window,";\n background-color: ").concat((e.theme||o.Z).background.panel,";\n ")})),p=(0,i.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],s,l.iI,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).background.output,";\n ")})),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*s,"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),s=t(71180),a=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]),G=x.ZP.file_contents.detail(z?encodeURIComponent(z.path):null).data,W=(0,l.useMemo)((function(){return null===G||void 0===G?void 0:G.file_content}),[G]),K=(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(K))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[I,K]),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),X=Y[0],Q=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),X({file_content:n})}),[t,_,I,X]),$=(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)(s.ZP,{compact:!0,loading:Q,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(W&&(null===W||void 0===W?void 0:W.path)===(null===z||void 0===z?void 0:z.path)){var t=W.content,i=void 0===t?"":t;n=(0,w.jsx)(a.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}),[W,V,L,Q,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),s=t(28598);function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,a=e.setObjectAttributes;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{mb:1,px:c.cd,children:[(0,s.jsx)(l.ZP,{bold:!0,children:"Outdated after"}),(0,s.jsx)(l.ZP,{muted:!0,small:!0,children:"After the global data product successfully completes running, how long after that will the global data product be outdated?"})]}),(0,s.jsx)(r.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var o,r,c=e.uuid,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,s.jsxs)(l.ZP,{default:!0,monospace:!0,children:[c," ",f&&(0,s.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(c)),(0,s.jsx)(u.Z,{compact:!0,monospace:!0,onChange:function(e){return a((function(n){var t;return d(d({},n),{},{outdated_after:d(d({},null===n||void 0===n?void 0:n.outdated_after),{},(0,i.Z)({},c,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},placeholder:"Enter a number",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof 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),s=t(70515),a=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:s.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,s,d=e.uuid,h=e.values,m=null===n||void 0===n||null===(r=n.outdated_starting_at)||void 0===r?void 0:r[d],b=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],g={compact:!0,key:"outdated-starting-at-input-".concat(d),monospace:!0,onChange:function(e){return 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 s=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,a.vg)(d)," ",b&&(0,p.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"outdated-starting-at-label-".concat(d)),s]}))})]})}},46209:function(e,n,t){"use strict";var i=t(82394),o=t(12691),r=t.n(o),l=t(70652),u=t(48670),c=t(38276),s=t(75499),a=t(30160),d=t(17488),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)(a.ZP,{bold:!0,children:"Block data to output"}),(0,f.jsx)(a.ZP,{muted:!0,small:!0,children:"The data output from the block(s) you select below will be the data product that is returned when a downstream entity is requesting data from this global data product."}),(0,f.jsx)("div",{style:{marginTop:4},children:(0,f.jsx)(a.ZP,{muted:!0,small:!0,children:"When requesting data from this global data product, the selected block(s) will return data from its most recent partition. You can override this by adding a value in the partitions setting. For example, if you set the partitions value to 5, then the selected block will return data from its 5 most recent partitions. If you set the partitions value to 0, then all the partitions will be returned."})})]}),(0,f.jsx)(s.Z,{columnFlex:[null,1,null],columns:[{label:function(){return""},uuid:"selected"},{uuid:"Block UUID"},{uuid:"Partitions"}],rows:null===n||void 0===n?void 0:n.map((function(e){var n,c=e.uuid,s=null===t||void 0===t?void 0:t.settings,p=null===s||void 0===s?void 0:s[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)(a.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),s=t(38276),a=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)(s.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)(s.Z,{p:v.cd,children:(0,m.jsx)(a.Z,{})})}},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return a},cl:function(){return d},cv:function(){return p},dE:function(){return c},zG:function(){return s}});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 ")})),s=i.default.div.withConfig({displayName:"indexstyle__DocsStyle",componentId:"sc-7a1uhf-1"})(["> div{overflow:initial;}> div img{max-width:80%;background:white;padding:1rem;max-height:20vh;}"]),a=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],u.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),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 a},I5:function(){return c},Nk:function(){return u},gI:function(){return s}});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 ")})),s=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 ")})),a=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),s=t(48670),a=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)(a.Z,{mr:1}),(0,x.jsx)(d.ZP,{muted:!Z,children:y?y(n):n})]})}),(0,x.jsx)(a.Z,{mr:2}),(0,x.jsx)(p.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,x.jsxs)(s.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,s=(0,o.Z)(e,k),a=(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({},s),{},{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:a}))}))})}},97133:function(e,n,t){"use strict";t.d(n,{Gb:function(){return p},fm:function(){return a},lO:function(){return s},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,s=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),a=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 ")}));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.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.PYTHON===(null===n||void 0===n?void 0:n.type)&&c.splice(2,0,{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"}}),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 s},t0:function(){return a}});var i=t(38626),o=t(2842),r=t(17679),l=t(61896),u=t(47041),c=t(70515),s=(c.iI,r.O$+3*c.iI+l.dN),a=i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-15ofupc-0"})([""," overflow:auto;position:absolute;width:100%;"," ",""],u.w5,(function(e){return"\n height: calc(100vh - ".concat(o.uX,"px - ").concat(e.heightOffset,"px);\n ")}),(function(e){return e.overflowHidden&&"\n overflow: hidden;\n "}));i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-15ofupc-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}))},8916:function(e,n,t){"use strict";t.d(n,{FS:function(){return s},JZ:function(){return p},Tt:function(){return d},e7:function(){return f},wx:function(){return a}});var i=t(75582),o=t(82394),r=t(83784),l=t(30229);function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e){return"string"===typeof e?e:JSON.stringify(e)}function a(e,n){var t,i;return null===e||void 0===e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(i=t.variables)||void 0===i?void 0:i.map((function(e){var n=e.value;return c(c({},e),{},{value:s(n)})}))}function d(e){var n;return null===(n=a(e,(function(e){return e.uuid===r.C})))||void 0===n?void 0:n.reduce((function(e,n){var t=n.uuid,i=n.value;return c(c({},e),{},(0,o.Z)({},t,i))}),{})}function p(e,n){return n===l.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===l.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function f(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),r=t[0],l=t[1],u=l;try{u=JSON.parse(l)}catch(s){}return c(c({},e),{},(0,o.Z)({},r,u))}),{}):e}},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,s=void 0===t?[]:t,a=(0,i.useMemo)((function(){return(null===s||void 0===s?void 0:s.length)||0}),[s]),d=(0,i.useMemo)((function(){return(0,u.YC)(s||[],"uuid")}),[s]);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:a>=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),s=t(82684),a=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,a=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 G=o?_.iD:_.J5,W=(0,s.useContext)(b.ThemeContext),K=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]}),X=(0,Z.Z)({domain:[0,Math.max.apply(Math,(0,u.Z)(V.map(R)))],nice:!0}),Q=(0,P.Z)({domain:V.map(A),padding:.35}),J={active:(null===W||void 0===W?void 0:W.content.default)||C.Z.content.default,backgroundPrimary:(null===W||void 0===W?void 0:W.chart.backgroundPrimary)||C.Z.chart.backgroundPrimary,backgroundSecondary:(null===W||void 0===W?void 0:W.chart.backgroundSecondary)||C.Z.chart.backgroundSecondary,muted:(null===W||void 0===W?void 0:W.content.muted)||C.Z.content.muted,primary:(null===W||void 0===W?void 0:W.chart.primary)||C.Z.chart.primary,tooltipBackground:(null===W||void 0===W?void 0:W.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*K.right?K.right+=5.5*ee:6*ee>=K.right&&(K.right+=3.75*ee);var ne=N-K.left-K.right,te=t-K.top-K.bottom;K.left+=7*ee,X.rangeRound([0,ne]),Q.rangeRound([te,0]);var ie=V.map(R).length,oe=Q($[ie-1]),re=(0,s.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&&a({tooltipData:l,tooltipLeft:t,tooltipTop:i+K.top})}),[V,ie,K.top,a,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-(K.top+K.bottom),onMouseLeave:function(){return i()},onMouseMove:re,onTouchMove:re,onTouchStart:re,rx:14,width:N-K.left,x:K.left,y:0}),(0,E.jsxs)(m.Z,{left:K.left,top:K.top,children:[(0,E.jsx)(v.Z,{color:Y,data:V,height:te,keys:q,pointerEvents:"none",xScale:X,y:H,yScale:Q,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:Q,stroke:J.muted,tickFormat:function(e){return z(e)},tickLabelProps:function(){return{fill:J.active,fontFamily:I.ry,fontSize:G,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:G,textAnchor:"middle"},numTicks:F,scale:X,stroke:J.muted,tickLabelProps:function(){return{fill:J.active,fontFamily:I.ry,fontSize:G,textAnchor:"middle"}},tickStroke:J.muted,top:te})]}),g&&(0,E.jsx)("g",{children:(0,E.jsx)(h.Z,{from:{x:K.left,y:M},pointerEvents:"none",stroke:w.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:ne+K.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)(a.Z,{children:function(e){var n=e.width,t=e.height;return(0,E.jsx)(N,D(D({},i),{},{height:t,width:n}))}})})},G=t(97618),W=t(52729),K=t(48670),V=t(87862),q=t(89370),Y=t(86735),X=(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),Q=[].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,s=e.x,a=e.x_metadata,d=a.label,p=a.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=s.length,C=s.map((function(e,n){var i,o,l,u,c=e.label,s=e.max,a=e.min,d=f[n];if(U.RANGE===p)if(t||(t=s-a),u=q.RL.NUMBER===y&&t<=O)i=Number(a);else if(i=t/2+a,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(a).format(C),l=ne().unix(s).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,s=e.statistics;return function(e,u,a){var d=a.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)(W.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=X[f]||X.default,C=null===s||void 0===s?void 0:s["".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)(W.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(Q.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)(G.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)(K.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 R}});var i=t(82394),o=t(75582),r=t(82684),l=t(69864),u=t(71180),c=t(15338),s=t(97618),a=t(55485),d=t(85854),p=t(48670),f=t(65956),v=t(82359),h=t(57114),m=t(38276),b=t(30160),g=t(17488),x=t(69650),j=t(12468),y=t(35686),k=t(38626),Z=t(44897),P=t(42631),O=t(70515),C=k.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],P.n_,O.cd*O.iI,(function(e){return"\n background-color: ".concat((e.theme.background||Z.Z.background).codeArea,";\n ")})),w=t(72473),_=t(72191),S=t(81728),I=t(72619),E=t(70320),T=t(23780),M=t(28598);function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function B(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?D(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var R=function(e){var n,t,k,Z=e.cancelButtonText,P=e.contained,D=e.header,R=e.onCancel,A=e.onSaveSuccess,N=(0,T.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),L=(0,o.Z)(N,1)[0],F=(0,r.useState)(null),U=F[0],H=F[1],z=(0,r.useState)(!1),G=z[0],W=z[1],K=y.ZP.projects.list(),V=K.data,q=K.mutate,Y=(0,r.useMemo)((function(){var e;return null===V||void 0===V||null===(e=V.projects)||void 0===e?void 0:e[0]}),[V]),X=Y||{},Q=X.name,J=X.openai_api_key,$=X.project_uuid,ee=(0,r.useMemo)((function(){return"demo.mage.ai"===window.location.hostname}),[]);(0,r.useEffect)((function(){U||H(Y)}),[Y,U]);var ne=(0,l.Db)(y.ZP.projects.useUpdate(Q),{onSuccess:function(e){return(0,I.wD)(e,{callback:function(e){var n,t=e.project;q(),H(t),W(!1),(0,E.h)(null===t||void 0===t||null===(n=t.features)||void 0===n?void 0:n[v.d.LOCAL_TIMEZONE]),A&&(null===A||void 0===A||A(t))},onErrorCallback:function(e,n){return L({errors:n,response:e})}})}}),te=(0,o.Z)(ne,2),ie=te[0],oe=te[1].isLoading,re=(0,r.useCallback)((function(e){return ie({project:e})}),[ie]),le=(0,M.jsxs)(M.Fragment,{children:[D,(0,M.jsxs)(f.Z,{noPadding:!0,children:[(0,M.jsxs)(m.Z,{p:O.cd,children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"Project name"})}),(0,M.jsx)(b.ZP,{default:!0,monospace:!0,children:Q})]}),(0,M.jsx)(c.Z,{light:!0}),(0,M.jsxs)(m.Z,{p:O.cd,children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"Project UUID"})}),(0,M.jsx)(b.ZP,{default:!!$,monospace:!0,muted:!$,children:$||"Not required"})]}),(0,M.jsx)(c.Z,{light:!0}),(0,M.jsx)(m.Z,{p:O.cd,children:(0,M.jsxs)(a.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,M.jsxs)(s.Z,{flexDirection:"column",children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"Help improve Mage"})}),(0,M.jsxs)(b.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,M.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,M.jsx)(m.Z,{mr:O.cd}),(0,M.jsx)(x.Z,{compact:!0,checked:null===U||void 0===U?void 0:U.help_improve_mage,onCheck:function(){return H((function(e){return B(B({},e),{},{help_improve_mage:!(null!==U&&void 0!==U&&U.help_improve_mage)})}))}})]})})]}),(0,M.jsx)(m.Z,{mt:O.HN}),(0,M.jsx)(h.Z,{description:"Global settings that are applied to all pipelines in this project.",title:"Pipeline settings",children:(0,M.jsx)(h.S,{description:"Every time a trigger is created or updated in this pipeline, automatically persist it in code.",title:"Save triggers in code automatically",toggleSwitch:{checked:!(null===U||void 0===U||null===(n=U.pipelines)||void 0===n||null===(t=n.settings)||void 0===t||null===(k=t.triggers)||void 0===k||!k.save_in_code_automatically),onCheck:function(e){return H((function(n){var t,i,o,r,l,u;return B(B({},n),{},{pipelines:B(B({},null===n||void 0===n?void 0:n.pipelines),{},{settings:B(B({},null===n||void 0===n||null===(t=n.pipelines)||void 0===t?void 0:t.settings),{},{triggers:B(B({},null===n||void 0===n||null===(i=n.pipelines)||void 0===i||null===(o=i.settings)||void 0===o?void 0:o.triggers),{},{save_in_code_automatically:e(null===n||void 0===n||null===(r=n.pipelines)||void 0===r||null===(l=r.settings)||void 0===l||null===(u=l.triggers)||void 0===u?void 0:u.save_in_code_automatically)})})})})}))}}})}),(0,M.jsx)(m.Z,{mt:O.HN}),(0,M.jsx)(f.Z,{noPadding:!0,overflowVisible:!0,children:(0,M.jsxs)(m.Z,{p:O.cd,children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"Features"})}),Object.entries((null===U||void 0===U?void 0:U.features)||{}).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],l=t[1];return(0,M.jsx)(m.Z,{mt:0===n?0:1,children:(0,M.jsxs)(a.ZP,{alignItems:"center",children:[(0,M.jsx)(x.Z,{checked:!!l,compact:!0,onCheck:function(){return H((function(e){return B(B({},e),{},{features:B(B({},null===U||void 0===U?void 0:U.features),{},(0,i.Z)({},r,!l))})}))}}),(0,M.jsx)(m.Z,{mr:O.cd}),(0,M.jsxs)(s.Z,{children:[(0,M.jsx)(b.ZP,{default:!l,monospace:!0,children:(0,S.vg)(r)}),r===v.d.LOCAL_TIMEZONE&&(0,M.jsx)(m.Z,{ml:1,children:(0,M.jsx)(j.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:_._k})})]})]})},r)}))]})}),(0,M.jsx)(m.Z,{mt:O.HN}),(0,M.jsx)(f.Z,{noPadding:!0,children:(0,M.jsxs)(m.Z,{p:O.cd,children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"OpenAI"})}),J&&!G?(0,M.jsxs)(a.ZP,B(B({},a.A0),{},{children:[(0,M.jsx)(b.ZP,{default:!0,monospace:!0,children:"API key: ********"}),(0,M.jsx)(u.ZP,{iconOnly:!0,onClick:function(){return W(!0)},secondary:!0,title:"Edit",children:(0,M.jsx)(w.I8,{size:_.bL})})]})):(0,M.jsx)(g.Z,{disabled:ee,label:ee?"Entering API key is disabled on demo":"API key",monospace:!0,onChange:function(e){return H((function(n){return B(B({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===U||void 0===U?void 0:U.openai_api_key)||""})]})}),(0,M.jsx)(m.Z,{mt:O.HN}),(0,M.jsxs)(a.ZP,{alignItems:"center",children:[(0,M.jsx)(u.ZP,{loading:oe,onClick:function(){re({features:null===U||void 0===U?void 0:U.features,help_improve_mage:null===U||void 0===U?void 0:U.help_improve_mage,openai_api_key:null===U||void 0===U?void 0:U.openai_api_key,pipelines:null===U||void 0===U?void 0:U.pipelines})},primary:!0,children:"Save project settings"}),R&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(m.Z,{mr:O.cd}),(0,M.jsx)(u.ZP,{onClick:R,secondary:!0,children:Z||"Cancel"})]})]})]});return P?(0,M.jsx)(C,{children:le}):le}},46568:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=(t(82684),t(33591)),l=t(28598),u=["children","fullHeight","gutter","style"];function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,c=e.style,a=void 0===c?{}:c,d=(0,o.Z)(e,u),p=s({},a);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,l.jsx)(r.Col,s(s({},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 s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,s=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,o.Z)(e,c),v=a({},p);return i&&(v.marginLeft=-1*i,v.marginRight=v.marginLeft),t&&(v.height="100%"),(0,u.jsx)(l.Row,a(a({},f),{},{justifyContent:s,style:v,children:r.Children.map(n,(function(e,n){return e&&r.cloneElement(e,{gutter:i,key:n})}))}))}},57114:function(e,n,t){"use strict";t.d(n,{S:function(){return y},Z:function(){return k}});var i=t(82684),o=t(15338),r=t(97618),l=t(55485),u=t(85854),c=t(65956),s=t(82394),a=t(44085),d=t(38276),p=t(30160),f=t(17488),v=t(69650),h=t(72473),m=t(8193),b=t(70515),g=t(28598);function x(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 j(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?x(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):x(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var y=function(e){var n,t=e.children,i=e.description,o=e.invalid,u=e.selectInput,c=e.textInput,s=e.title,x=e.toggleSwitch,y=e.warning;return(0,g.jsx)(d.Z,{p:b.cd,children:(0,g.jsxs)(l.ZP,{alignItems:"center",children:[(0,g.jsxs)(l.ZP,{flexDirection:"column",children:[(0,g.jsxs)(p.ZP,{danger:o,default:!0,large:!0,warning:y,children:[s," ",o&&(0,g.jsx)(p.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),i&&"string"===typeof i&&(0,g.jsx)(p.ZP,{muted:!0,small:!0,children:i}),i&&"string"!==typeof i&&i]}),(0,g.jsx)(d.Z,{mr:b.cd}),(0,g.jsxs)(r.Z,{flex:1,justifyContent:"flex-end",children:[t,c&&(0,g.jsx)(f.Z,j({afterIcon:(0,g.jsx)(h.I8,{}),afterIconClick:function(e,n){var t;null===n||void 0===n||null===(t=n.current)||void 0===t||t.focus()},afterIconSize:m.Z,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,paddingHorizontal:0,paddingVertical:0,setContentOnMount:!0},c)),u&&(0,g.jsx)(a.Z,j(j({},u),{},{afterIcon:(0,g.jsx)(h._M,{}),afterIconSize:m.Z,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,paddingHorizontal:0,paddingVertical:0,setContentOnMount:!0,children:null===u||void 0===u||null===(n=u.options)||void 0===n?void 0:n.map((function(e){var n=e.label,t=e.value;return(0,g.jsx)("option",{value:t,children:n||t},t)}))})),x&&(0,g.jsx)(v.Z,{checked:!(null===x||void 0===x||!x.checked),compact:!0,onCheck:null===x||void 0===x?void 0:x.onCheck})]})]})})},k=function(e){var n=e.children,t=e.description,s=e.headerChildren,a=e.title;return(0,g.jsxs)(c.Z,{noPadding:!0,children:[(0,g.jsx)(d.Z,{p:b.cd,children:(0,g.jsxs)(l.ZP,{alignItems:"center",children:[(0,g.jsxs)(r.Z,{flex:1,flexDirection:"column",children:[(0,g.jsx)(u.Z,{level:4,children:a}),t&&"string"===typeof t&&(0,g.jsx)(d.Z,{mt:1,children:(0,g.jsx)(p.ZP,{muted:!0,children:t})}),t&&"string"!==typeof t&&t]}),s]})}),i.Children.map(n,(function(e,n){return(0,g.jsxs)("div",{children:[(0,g.jsx)(o.Z,{light:!0}),e]},"".concat(a,"-").concat(n))}))]})}},8193:function(e,n,t){"use strict";t.d(n,{N:function(){return c},Z:function(){return u}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=2*l.iI,c=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1ck7mzt-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).codeArea,";\n ")}))},28071:function(e,n,t){"use strict";var i;t.d(n,{X:function(){return i}}),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.RUNNING="RUNNING",e.STARTING="STARTING",e.TERMINATED="TERMINATED",e.TERMINATED_WITH_ERRORS="TERMINATED_WITH_ERRORS",e.TERMINATING="TERMINATING",e.WAITING="WAITING"}(i||(i={}))},26032:function(e,n,t){"use strict";var i,o;t.d(n,{_:function(){return i},i:function(){return o}}),function(e){e.CREATE="CREATE",e.DELETE="DELETE",e.DESELECT="DESELECT",e.UPDATE="UPDATE"}(i||(i={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE",e.PENDING="PENDING"}(o||(o={}))},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),s=t(95363),a=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:s.Vp,fontSize:f?12:14,marginBottom:0,marginTop:0,maxWidth:t,paddingBottom:2*a.iI,paddingTop:2*a.iI},language:n,lineNumberStyle:{color:(m.content||c.Z.content).muted},showLineNumbers: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),s=t(38276),a=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)(s.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)(a.ZP,{inverted:g,monospace:y,muted:k,small:Z,children:j}),b===i.RIGHT&&(0,v.jsx)(s.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),s=1.5*c.iI,a=1.5*c.iI,d=o.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],l.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||r.Z).background.page,";\n border: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||r.Z).shadow.frame,";\n ")}),(function(e){return e.noBackground&&"\n background-color: transparent;\n "}),(function(e){return e.noBoxShadow&&"\n box-shadow: none;\n "})),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_,s,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n ")})),v=o.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],a,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||r.Z).interactive.defaultBorder,";\n ")}),(function(e){return e.noHorizontalPadding&&"\n padding-left: 0;\n padding-right: 0;\n "}),(function(e){return e.condensed&&"\n padding-top: ".concat(9,"px;\n padding-bottom: ").concat(9,"px;\n ")}),(function(e){return e.secondary&&"\n background-color: ".concat((e.theme.background||r.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom: none;\n ")})),h=o.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,s,2*c.iI,(function(e){return"\n border-top: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")})),m=t(28598),b=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,s=e.noBoxShadow,a=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:s,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:a,secondary:n&&t%2===1})}))}),o&&(0,m.jsx)(h,{children:o})]})}},90299:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(82684),o=t(71180),r=t(55485),l=t(64888),u=t(38276),c=t(30160),s=t(8059),a=t(38626),d=t(44897),p=t(70515),f=t(47041),v=a.default.div.withConfig({displayName:"indexstyle__TabsContainerStyle",componentId:"sc-segf7l-0"})(["padding-left:","px;padding-right:","px;"," "," ",""],p.cd*p.iI,p.cd*p.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.allowScroll&&"\n overflow: auto;\n "}),f.w5),h=a.default.div.withConfig({displayName:"indexstyle__SelectedUnderlineStyle",componentId:"sc-segf7l-1"})(["border-radius:6px;height:","px;"," "," ",""],2,(function(e){return!e.selected&&"\n background-color: transparent;\n "}),(function(e){return e.selected&&!e.backgroundColor&&"\n background-color: ".concat((e.theme||d.Z).borders.darkLight,";\n ")}),(function(e){return e.selected&&e.backgroundColor&&"\n background-color: ".concat(e.backgroundColor,";\n ")})),m=t(3314),b=t(28598);function g(e,n){var t=e.allowScroll,a=e.compact,d=e.contained,f=e.noPadding,g=e.onClickTab,x=e.regularSizeText,j=e.selectedTabUUID,y=e.small,k=e.tabs,Z=e.underlineColor,P=e.underlineStyle,O=(0,i.useMemo)((function(){var e=k.length,n=[];return k.forEach((function(t,i){var d=t.Icon,f=t.IconSelected,v=t.label,k=t.uuid,O=k===j,C=O&&f||d,w=v?v():k,_=(0,b.jsxs)(r.ZP,{alignItems:"center",children:[C&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C,{default:!O,size:2*p.iI}),(0,b.jsx)(u.Z,{mr:1})]}),(0,b.jsx)(c.ZP,{bold:!0,default:!O,noWrapping:!0,small:!x,children:w})]});i>=1&&e>=2&&n.push((0,b.jsx)("div",{style:{marginLeft:(x?2:1.5)*p.iI}},"spacing-".concat(k))),O&&!P?n.push((0,b.jsx)(l.Z,{backgroundGradient:s.yr,backgroundPanel:!0,borderLess:!0,borderWidth:2,compact:a||y,onClick:function(e){(0,m.j)(e),g(t)},paddingUnitsHorizontal:1.75,paddingUnitsVertical:1.25,small:y,children:_},k)):n.push((0,b.jsxs)(r.ZP,{flexDirection:"column",style:{paddingLeft:2,paddingRight:2,paddingBottom:P?0:2,paddingTop:P?0:2},children:[(0,b.jsxs)(o.ZP,{borderLess:!0,compact:a||y,default:!0,noBackground:P,noPadding:P,onClick:function(e){(0,m.j)(e),g(t)},outline:!P,small:y,children:[!P&&_,P&&(0,b.jsx)("div",{style:{paddingBottom:(a||y?p.iI/2:p.iI)+2,paddingTop:(a||y?p.iI/2:p.iI)+2+2},children:_})]}),P&&(0,b.jsx)(h,{backgroundColor:Z,selected:O})]},"button-tab-".concat(k)))})),n}),[a,g,j,y,k,P]),C=(0,b.jsx)(r.ZP,{alignItems:"center",children:O});return d?C:(0,b.jsx)(v,{allowScroll:t,noPadding:f,ref:n,children:C})}var x=i.forwardRef(g)},98305:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return _r}});var i=t(77837),o=t(21831),r=t(75582),l=t(82394),u=t(38860),c=t.n(u),s=t(92083),a=t.n(s),d=t(56085),p=t(38626),f=t(82684),v=t(69864),h=t(34376),m=t(65557),b=t(40761),g=t(44425),x=t(70652),j=t(39867),y=t(15338),k=t(97618),Z=t(55485),P=t(48670),O=t(38276),C=t(30160),w=t(70515),_=t(55283),S=t(28598);function I(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?I(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):I(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var T=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,o=e.setHiddenBlocks,r=(0,f.useContext)(p.ThemeContext),u=(0,f.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),c=(0,f.useMemo)((function(){var e=[],n=[];return u.forEach((function(i){var o=i.uuid;null!==t&&void 0!==t&&t[o]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[u,t]),s=c.blocksHidden,a=c.blocksVisible,d=(0,f.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===a.length}),[u,a]),v=(0,f.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===s.length}),[u,s]),h=(0,f.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var o,r=n.current["".concat(t,"s/").concat(i,".py")];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(x.Z,{checked:v,label:"Show all",onClick:function(){return o((function(){return{}}))}}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(x.Z,{checked:d,label:"Hide all",onClick:function(){return o((function(){return u.reduce((function(e,n){var t=n.uuid;return E(E({},e),{},(0,l.Z)({},t,!0))}),{})}))}})]})}),(0,S.jsx)(y.Z,{medium:!0}),null===u||void 0===u?void 0:u.map((function(e){var n=e.uuid,i=(0,_.qn)(e.type,{blockColor:e.color,theme:r}).accent,u=!(null!==t&&void 0!==t&&t[n]);return(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){o((function(e){return E(E({},e),{},(0,l.Z)({},n,u))})),u||setTimeout((function(){return h(e)}),1)},preventDefault:!0,children:(0,S.jsx)(O.Z,{mt:1,px:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(O.Z,{pr:1,children:(0,S.jsx)(x.Z,{checked:u})}),(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:i,size:1.5*w.iI,square:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},M=t(60523),D=t(71180),B=t(90299),R=t(65701),A=t(1254);var N=function(e){var n=e.size;return(0,S.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("path",{d:"M67.7193 2.36691C69.8656 1.52184 72.3078 2.0081 73.9667 3.61084L116.977 45.1646C119.018 47.1366 119.362 50.2841 117.794 52.65L92.5787 90.7113C92.1293 91.3897 91.5441 91.9675 90.8601 92.4083L51.1076 118.029C48.6859 119.589 45.4904 119.168 43.5558 117.033L3.02296 72.3013C1.48382 70.6027 1.07052 68.1652 1.96372 66.0542L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L67.7193 2.36691Z",fill:"url(#paint0_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M71.2431 0.979492L23.6155 19.9931C22.1646 20.5723 21.0034 21.7045 20.3877 23.1402L0.499023 69.5159L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L71.2431 0.979492Z",fill:"url(#paint1_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint3_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint4_linear_11972_15232)"}),(0,S.jsx)("path",{d:"M23.3591 24.6945L58.2913 58.6736L25.3897 22.7247C24.8455 22.13 23.9152 22.1095 23.3452 22.6795C22.7871 23.2375 22.7934 24.1442 23.3591 24.6945Z",fill:"url(#paint5_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M51.6694 46.395L73.0043 69.5215C73.6132 70.1816 74.5925 70.3441 75.382 69.9161L117.654 46.9975L75.6257 67.8209C74.8809 68.1899 73.9844 68.0497 73.3879 67.4708L51.6694 46.395Z",fill:"url(#paint6_radial_11972_15232)"}),(0,S.jsxs)("defs",{children:[(0,S.jsxs)("radialGradient",{id:"paint0_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16.9412 88.4412) rotate(18.02) scale(82.0367 81.4644)",children:[(0,S.jsx)("stop",{stopColor:"#FFDA19"}),(0,S.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,S.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,S.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,S.jsxs)("radialGradient",{id:"paint1_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.8711 10.2518) rotate(87.6364) scale(26.1711 27.0141)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint2_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(150.671 44.2502) rotate(128.639) scale(125.554 128.436)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint3_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(133.353 52.8357) rotate(144.647) scale(86.7385 72.7129)",children:[(0,S.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,S.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint5_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(25.2251 23.4978) rotate(48.3599) scale(35.5147 43.1672)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint6_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(76.5908 67.6516) rotate(104.629) scale(14.9575 79.0374)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},L=t(9189),F=t(93369),U=t(7267),H=t(57653),z=t(44085),G=t(4190),W=t(17488),K=t(35686),V=t(72473),q=t(4015),Y=t(13803),X=t(72191),Q=t(2548),J=t(81728),$=t(72619),ee=t(23780);function ne(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 te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ne(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ne(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ie=function(e){var n,t,i=e.block,o=e.defaultName,l=e.isReplacingBlock,u=e.isUpdatingBlock,c=e.onClose,s=e.onSave,a=e.pipeline,d=(0,ee.VI)(null,{},[],{uuid:"ConfigureBlock"}),p=(0,r.Z)(d,1)[0],h=Object.keys((null===i||void 0===i?void 0:i.pipelines)||{}).length,m=(0,f.useRef)(null),b=(0,f.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=b[0],j=b[1],y=(0,f.useCallback)((function(){s(te(te({},x),{},{name:(null===x||void 0===x?void 0:x.name)||o}))}),[x,o,s]);(0,f.useEffect)((function(){var e,n=function(e){e.stopPropagation(),"Escape"===e.key?c():"Enter"===e.key&&y()};return null===(e=document)||void 0===e||e.addEventListener("keydown",n),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("keydown",n)}}),[y,c]),(0,f.useEffect)((function(){var e;null===m||void 0===m||null===(e=m.current)||void 0===e||e.focus()}),[]);var P=(0,f.useMemo)((function(){return H.qL.INTEGRATION===(null===a||void 0===a?void 0:a.type)}),[a]),_=(0,f.useMemo)((function(){return g.tf.CUSTOM===(null===i||void 0===i?void 0:i.type)}),[i]),I=(0,f.useMemo)((function(){return g.tf.MARKDOWN===(null===i||void 0===i?void 0:i.type)}),[i]),E=(0,f.useMemo)((function(){return null===i||void 0===i?void 0:i.block_action_object}),[i]),T=(0,f.useMemo)((function(){return Q.L.GENERATE_BLOCK===(null===E||void 0===E?void 0:E.object_type)}),[E]),M=(0,f.useMemo)((function(){return T&&(null===E||void 0===E?void 0:E.description)}),[E,T]),B=(0,f.useMemo)((function(){var e;return Y.I.DATA_INTEGRATION===(null===i||void 0===i||null===(e=i.config)||void 0===e?void 0:e.template_type)||!![Y.O.DESTINATIONS,Y.O.SOURCES].includes(null===E||void 0===E?void 0:E.language)}),[i,E]),ne=(0,f.useState)(null),ie=ne[0],oe=ne[1],re=(0,v.Db)(K.ZP.llms.useCreate(),{onSuccess:function(e){return(0,$.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;j((function(e){return te(te({},e),{},{block_action_object:null,configuration:o,content:r,language:l,type:i})})),oe(n)},onErrorCallback:function(e,n){return p({errors:n,response:e})}})}}),le=(0,r.Z)(re,2),ue=le[0],ce=le[1].isLoading;(0,f.useEffect)((function(){T&&M&&!ie&&ue({llm:{request:{block_description:M},use_case:U.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[ue,M,T,ie]);var se=(0,f.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:[Q.L.CUSTOM_BLOCK_TEMPLATE,Q.L.MAGE_TEMPLATE].includes(null===E||void 0===E?void 0:E.object_type)?te(te({},E),{},{name:null===E||void 0===E?void 0:E.title}):void 0}),[i,E]),ae=(0,f.useMemo)((function(){var e=(null===x||void 0===x?void 0:x.type)||(null===i||void 0===i?void 0:i.type);se&&(e=null===se||void 0===se?void 0:se.block_type);var n=g.V4[e];return P&&(g.tf.DATA_LOADER===e?n="Source":g.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[i,x,se,P]);return(0,S.jsxs)(q.Nk,{width:T&&(null===x||void 0===x?void 0:x.content)&&80*w.iI,children:[(0,S.jsxs)(q.I5,{children:[T&&ce&&(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{children:"Generating block using AI..."}),(0,S.jsx)(G.Z,{inverted:!0})]}),T&&!ce&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(V.xq,{size:5*w.iI,warning:!0})}),!T&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(N,{size:15*w.iI})})]}),T&&!ce&&(0,S.jsx)(q.gI,{children:(0,S.jsxs)(O.Z,{py:1,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Block generated using AI"})}),(0,S.jsx)(C.ZP,{textOverflow:!0,children:M})]})}),se&&(0,S.jsx)(q.gI,{children:(0,S.jsxs)(O.Z,{py:1,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Template"})}),(0,S.jsx)(C.ZP,{textOverflow:!0,children:null===(t=(null===se||void 0===se?void 0:se.name)||(null===se||void 0===se?void 0:se.template_uuid))||void 0===t?void 0:t.slice(0,40)})]})}),g.tf.GLOBAL_DATA_PRODUCT!==(null===i||void 0===i?void 0:i.type)&&h>1&&(0,S.jsxs)(q.gI,{children:[(0,S.jsx)(k.Z,{flex:"1",children:(0,S.jsx)(V.uy,{size:X.l2,warning:!0})}),(0,S.jsx)(k.Z,{flex:"6",children:(0,S.jsxs)(C.ZP,{bold:!0,warning:!0,children:[u&&"Renaming this block will affect ".concat(h," 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,S.jsxs)(q.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Name"}),(0,S.jsx)(W.Z,{alignRight:!0,fullWidth:!0,noBackground:!0,noBorder:!0,onChange:function(e){return j((function(n){return te(te({},n),{},{name:e.target.value})}))},paddingVertical:w.iI,placeholder:"Block name...",ref:m,value:(null===x||void 0===x?void 0:x.name)||""})]}),(0,S.jsxs)(q.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Type"}),(0,S.jsx)(O.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{muted:!0,children:ae}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(V.QM,{muted:!0})]})})]}),!I&&(_||se||(null===x||void 0===x?void 0:x.language))&&(0,S.jsxs)(q.gI,{paddingVerticalAddition:3,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Language"}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[[g.t6.PYTHON,g.t6.SQL,g.t6.R,g.t6.YAML].reduce((function(e,n){var t=(se?null===se||void 0===se?void 0:se.language:null===x||void 0===x?void 0:x.language)===n;return!(_&&!u&&!l||t||B&&g.t6.R!==n&&B&&g.t6.SQL!==n)||_&&g.t6.YAML===n||e.push((0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(D.ZP,{borderColor:t?null:"transparent",compact:!0,default:!_&&!t&&!B,disabled:!_&&!t&&!B,noBackground:!0,notClickable:(!_||u||!B)&&t,onClick:se&&!B?null:function(){return j((function(e){return te(te({},e),{},{language:n})}))},selected:t,children:g.LE[n]})},n)),e}),[]),!_&&!B&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(V.QM,{muted:!0})]}),(0,S.jsx)(O.Z,{mr:_||B?1:2})]})]}),(_||(null===se||void 0===se?void 0:se.color)||(null===x||void 0===x?void 0:x.color))&&(0,S.jsxs)(q.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Color"}),_&&(0,S.jsxs)(z.Z,{alignRight:!0,disabled:l,noBackground:!0,noBorder:!0,onChange:function(e){return j((function(n){return te(te({},n),{},{color:e.target.value})}))},value:se?(null===se||void 0===se?void 0:se.color)||"":(null===x||void 0===x?void 0:x.color)||"",children:[(0,S.jsx)("option",{value:""}),Object.values(g.Lq).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,J.kC)(e)},e)}))]}),!_&&(0,S.jsx)(O.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{muted:!0,children:(0,J.kC)((null===se||void 0===se?void 0:se.color)||(null===x||void 0===x?void 0:x.color)||"")}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(V.QM,{muted:!0})]})})]}),T&&(null===x||void 0===x?void 0:x.content)&&(0,S.jsx)(q.gI,{display:"block",children:(0,S.jsx)(O.Z,{pr:w.cd,py:1,children:(0,S.jsx)(R.W,{backend:A.PD,children:(0,S.jsx)(L.Z,{block:te(te({},x),{},{uuid:M}),defaultValue:null===x||void 0===x?void 0:x.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return j((function(n){return te(te({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},M)})})}),(0,S.jsx)(q.$b,{children:(0,S.jsxs)(Z.ZP,{fullWidth:!0,children:[(0,S.jsxs)(F.ZP,{bold:!0,centerText:!0,disabled:ce,onClick:y,primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and\xa0",u?"update":l?"replace":"add"," block"]}),(0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(D.ZP,{onClick:c,tabIndex:0,children:"Cancel"})})]})})]})},oe=t(54750),re=t(4804),le=t(75810),ue=t(85854),ce=t(99236),se=t(29480),ae=t(37443),de=t(53405);function pe(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?pe(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ve=function(e){var n=e.block,t=e.blockConfigString,i=e.blockContent,o=e.blockUpstreamBlocks,l=e.dataIntegrationConfiguration,u=e.onChangeCodeBlock,c=e.pipeline,s=e.savePipelineContent,a=e.setBlockConfigString,d=e.setBlockContent,p=e.setContent,h=e.setSelectedSubTab,m=e.showError,b=n||{},x=b.language,k=b.type,_=b.uuid,I=(c||{}).uuid,E=(0,f.useState)(!1),T=E[0],M=E[1],B=(0,f.useMemo)((function(){return g.t6.YAML===x&&i?(0,re.Qc)(i):{}}),[i,x]);(0,f.useEffect)((function(){B&&!t&&a((0,re.Pz)(null===B||void 0===B?void 0:B.config))}),[t,B]);var R=(0,f.useState)(!1),A=R[0],N=R[1],L=(0,v.Db)(K.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.integration_source;null!==n&&void 0!==n&&n.error_message?m({response:{error:{exception:null===n||void 0===n?void 0:n.error_message}}}):null!==n&&void 0!==n&&n.success&&N(!0)},onErrorCallback:function(e,n){return m({errors:n,response:e})}})}}),F=(0,r.Z)(L,2),U=F[0],H=F[1].isLoading,z=(0,f.useCallback)((function(){return s().then((function(){return U({integration_source:{action_type:"test_connection",block_uuid:_,pipeline_uuid:I}})}))}),[_,U,I,s]),G=(0,f.useMemo)((function(){if(g.t6.YAML===x)return(0,S.jsx)(se.$W,{children:(0,S.jsx)(le.Z,{autoHeight:!0,language:x,onChange:function(e){a(e);try{var n=(0,re.Qc)(e),t=(0,re.Pz)(fe(fe({},B),{},{config:n}));u(k,_,t),p(t),M(!1)}catch(i){M(!0)}},tabSize:2,value:t||void 0,width:"100%"})});g.t6.PYTHON}),[t,i,B,x,k,_,d,p]),W=(0,f.useMemo)((function(){return(0,de.Wi)(o,l)}),[o,l]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.Ae,{success:!0}),loading:H,onClick:function(){N(!1),z()},secondary:!0,compact:!0,children:"Test connection"}),A&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{success:!0,children:"Connection successful"})]})]})]})}),(0,S.jsx)(y.Z,{light:!0}),(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,large:!0,children:"Inputs from upstream blocks"}),0===(null===W||void 0===W?void 0:W.length)&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["No inputs are selected. Toggle the upstream blocks in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return h(ae.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null===W||void 0===W?void 0:W.length)>=1&&(0,S.jsx)(ce.Z,{inputsBlocks:W}),T&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(y.Z,{light:!0}),(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(ue.Z,{danger:!0,level:5,children:"ERROR"})}),(0,S.jsxs)(C.ZP,{muted:!0,children:["The credentials configuration is formatted incorrectly for the language ",g.LE[x],". The formatting must be fixed before the credentials configuration can be saved."]})]})]}),G]})},he=t(56747),me=t(96348),be=t(26304),ge=t(93859),xe=t(66909),je=t(42122);var ye=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.setSelectedSubTab,l=e.showError,u=e.stream,c=(0,f.useRef)(null),s=(0,f.useState)(null),a=s[0],d=s[1],p=(0,f.useState)(100),h=p[0],m=(p[1],(0,f.useState)(0)),b=m[0],g=m[1];(0,f.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,f.useMemo)((function(){return{parentStreamID:(0,de.Qu)(u),streamID:(0,de.M$)(u)}}),[u]),k=y.parentStreamID,Z=y.streamID,_=(0,f.useMemo)((function(){return(0,je.Qr)((0,de.WE)(u||{})||{},{idIsInObject:!0})}),[u]),I=K.ZP.outputs.pipelines.detail(!a&&x,!a&&j,{parent_stream:k,sample_count:h,stream:Z},{revalidateOnFocus:!1}).data,E=(0,v.Db)(K.ZP.outputs.useCreate(),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.output;d(n)},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),T=(0,r.Z)(E,2),M=T[0],B=T[1].isLoading,R=(0,f.useCallback)((function(){return M({output:{block_uuid:j,persist:1,pipeline_uuid:x,refresh:1,sample_count:h,streams:[{parent_stream:k,stream:Z}]}})}),[j,M,k,x,h,Z]),A=(0,f.useMemo)((function(){return a||(null===I||void 0===I?void 0:I.output)}),[I,a]),N=(0,f.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===Z})))||void 0===e?void 0:e.data}),[A,Z]),L=(0,f.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,S.jsx)(ge.Z,{columnHeaderHeight:xe.Eh,columns:o,height:t-b,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:r})}),[N,t,b]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,ref:c,children:_?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Please select at least 1 column in the stream in order to fetch sample data."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return o(ae.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,S.jsx)(D.ZP,{compact:!0,loading:B,onClick:function(){return R()},primary:!0,children:N?"Refresh sample data":"Fetch sample data"})}),L]})},ke=t(31882),Ze=t(75499),Pe=t(69650),Oe=t(12468),Ce=t(61599),we=t(44897),_e=t(42631),Se=p.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-wjbb3f-0"})(["border-radius:","px;"," ",""],_e.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||we.Z.borders).light,";\n ")}),(function(e){return!e.noPadding&&"\n padding: ".concat(w.cd*w.iI,"px;\n ")})),Ie=t(86735);function Ee(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 Te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Me=function(e){var n,t=e.block,i=(e.blocksMapping,e.onChangeBlock),u=e.setBlockAttributes,c=e.stream,s=(e.streamMapping,e.updateStreamsInCatalog),a=(0,f.useRef)(null),d=(0,f.useState)({}),p=d[0],v=d[1],h=c||{},m=h.auto_add_new_fields,b=h.bookmark_properties,x=h.destination_table,j=h.disable_column_type_check,y=h.key_properties,P=h.partition_keys,_=h.replication_method,I=h.run_in_parallel,E=h.unique_conflict_method,T=h.unique_constraints,M=(0,de.M$)(c),B=(0,de.WD)(c),R=(0,de.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,f.useCallback)((function(e){return s(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,s]),F=(0,f.useCallback)((function(e,n){L([Te(Te({},c),{},(0,l.Z)({},e,n))])}),[c,L]),U=(0,f.useMemo)((function(){var e,n=[],t={},i=[],l=(0,de.RP)(c)||{};return null===(e=Object.entries(l||{}))||void 0===e||e.forEach((function(e){var o,l=(0,r.Z)(e,2),u=l[0],c=l[1],s=c.metadata,a=c.type;n.push(u),(!s||null===s||void 0===s||!s.metadata||null!==s&&void 0!==s&&null!==(o=s.metadata)&&void 0!==o&&o.selected)&&i.push(u);var d=Array.isArray(a)?a:[a];if((null===d||void 0===d?void 0:d.length)>=1){var 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,S.jsx)(Ze.Z,{columnFlex:[1,1],rows:[[(0,S.jsx)(C.ZP,{children:"Number of columns selected"},"columns"),(0,S.jsxs)(C.ZP,{monospace:!0,rightAligned:!0,children:[null===i||void 0===i?void 0:i.length," ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",null===n||void 0===n?void 0:n.length]},"columns-value")]].concat((0,o.Z)((0,Ie.YC)(Object.entries(t),(function(e){return(0,r.Z)(e,1)[0]})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return[(0,S.jsxs)(C.ZP,{children:[(0,J.vg)(t)," columns"]},"columns-".concat(t)),(0,S.jsx)(C.ZP,{monospace:!0,rightAligned:!0,children:null===i||void 0===i?void 0:i.length},"columns-value-".concat(t))]}))),(0,o.Z)([["Bookmarks",b,"bookmark_properties"],["Unique constraints",T,"unique_constraints"],["Key properties",y,"key_properties"],["Partition keys",P,"partition_keys"]].map((function(e){var n,t=(0,r.Z)(e,3),i=t[0],o=t[1],l=t[2];return[(0,S.jsx)(C.ZP,{children:i},i),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[!(null!==o&&void 0!==o&&o.length)&&(0,S.jsx)(C.ZP,{muted:!0,monospace:!0,children:"-"}),null===(n=(0,Ie.YC)(o||[],(function(e){return e})))||void 0===n?void 0:n.map((function(e){return(0,S.jsx)("div",{style:{marginLeft:w.iI/2},children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){return F(l,(0,Ie.Od)(o,(function(n){return n===e})))},xsmall:!0})},"".concat(i,"-value-").concat(e))}))]},"".concat(i,"-value"))]}))))})}),[b,y,P,c,T,F]),H=(0,f.useMemo)((function(){return B in p?null===p||void 0===p?void 0:p[B]:x}),[x,p,B]);return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Se,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Output"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Destination table"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{label:(0,S.jsxs)(C.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:M}),". To change the table name, enter in a different value."]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd})]}),(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(W.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 Te(Te({},e),{},(0,l.Z)({},B,t))})),clearTimeout(a.current),a.current=setTimeout((function(){return F("destination_table",t)}),300)},value:H||""})})]})})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Se,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Settings"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Replication method"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{label:(0,S.jsxs)(C.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.INCREMENTAL}),")?",Ce.th.POSTGRESQL===N&&(0,S.jsxs)(C.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(z.Z,{defaultColor:!0,onChange:function(e){return F("replication_method",e.target.value)},placeholder:"Select an option",value:_,children:Object.values(Ce._B).map((function(e){return(0,S.jsxs)("option",{disabled:Ce._B.FULL_TABLE!==e,value:e,children:[Ce._B.FULL_TABLE!==e&&"[COMING SOON] ",(0,J.vg)(e)]},e)}))})]})}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Unique conflict method"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{label:(0,S.jsxs)(C.ZP,{children:["If a new record has the same value as an existing record in the ",(0,J._6)("unique column",null===T||void 0===T?void 0:T.length),(null===T||void 0===T?void 0:T.length)>0&&(0,S.jsx)(S.Fragment,{children:"\xa0"}),null===T||void 0===T?void 0:T.sort().map((function(e,n){return(0,S.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===T||void 0===T?void 0:T.length)&&n===(null===T||void 0===T?void 0:T.length)-1?(0,S.jsx)(C.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(z.Z,{defaultColor:!0,onChange:function(e){return F("unique_conflict_method",e.target.value)},placeholder:"Select an option",value:E,children:Object.values(Ce.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))})]})})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Se,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Options"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Run streams in parallel"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Pe.Z,{checked:!!I,onCheck:function(e){return F("run_in_parallel",e(I))}})]})}),g.tf.DATA_EXPORTER===(null===t||void 0===t?void 0:t.type)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Pe.Z,{checked:!!m,onCheck:function(e){return F("auto_add_new_fields",e(m))}})]})}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"By default, the value for each column is validated according to the schema property for that column. If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped. Turn this toggle on if you want to disable this strict type checking."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Pe.Z,{checked:!!j,onCheck:function(e){return F("disable_column_type_check",e(j))}})]})})]})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Se,{noPadding:!0,children:[(0,S.jsx)(O.Z,{pt:w.cd,px:w.cd,children:(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Summary"})}),(0,S.jsx)(O.Z,{mt:w.cd,pb:w.cd,children:U})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Se,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Other"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Select stream"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Pe.Z,{checked:!!R,onCheck:function(e){return L([(0,de.XE)(c,{selected:e(R)})])}})]})}),(0,S.jsx)(O.Z,{mt:w.HN,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(D.ZP,{danger:!0,onClick:function(){window.confirm("Are you sure you want to remove stream ".concat(M," from block ").concat(null===t||void 0===t?void 0:t.uuid,"?"))&&u((function(e){var n,t=Te(Te({},e),{},{catalog:Te(Te({},null===e||void 0===e?void 0:e.catalog),{},{streams:(0,Ie.Od)(null===e||void 0===e||null===(n=e.catalog)||void 0===n?void 0:n.streams,(function(e){return(0,de.WD)(e)===B}))})});return null===i||void 0===i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},De=t(11074),Be=t(69632),Re=t(3314);function Ae(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 Ne(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ae(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ae(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Le=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,s=e.showStreamConflicts,a=e.stream,d=e.streamMapping,p=e.streamsMappingConflicts,v=(0,f.useCallback)((function(e){i((function(n){var i=e(n);return null===t||void 0===t||t(i),i}))}),[t,i]),h=(0,f.useMemo)((function(){return(0,de.RP)(a)||{}}),[a]),m=(0,f.useState)(null),b=m[0],g=m[1],P=(0,f.useState)(null),_=P[0],I=P[1],E=(0,f.useRef)(null),T=(0,f.useState)(null),M=T[0],B=T[1],R=(0,f.useCallback)((function(){B(null),g(null)}),[B,g]);(0,f.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,f.useMemo)((function(){var e=a.bookmark_properties,n=a.key_properties,t=a.partition_keys,i=(a.replication_method,a.unique_constraints);return{bookmarkPropertiesMapping:(0,Ie.HK)(e||[],(function(e){return e})),keyPropertiesMapping:(0,Ie.HK)(n||[],(function(e){return e})),partitionKeysMapping:(0,Ie.HK)(t||[],(function(e){return e})),uniqueConstraintsMapping:(0,Ie.HK)(i||[],(function(e){return e}))}}),[a]),N=A.bookmarkPropertiesMapping,L=A.keyPropertiesMapping,F=A.partitionKeysMapping,U=A.uniqueConstraintsMapping,H=(0,f.useMemo)((function(){var e,n;return null===(e=(0,Ie.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,f.useMemo)((function(){return(0,de.MB)(a)}),[a]),(0,f.useMemo)((function(){return(0,de.Nf)(a)}),[a])),G=(0,f.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,S.jsx)(Pe.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,de.jC)(i);return n[i]=Ne(Ne({},o),{},{metadata:Ne(Ne({},null===o||void 0===o?void 0:o.metadata),e)}),n}),{});v((function(e){return(0,de.$C)((0,de.AP)(a,n),e)}))}({selected:e(n)})}})},uuid:"action"},{uuid:"Property"},{uuid:"Types"},{center:!0,uuid:"Unique"}],i=a.replication_method;return Ce._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,a,z]),W=G.columnFlex,K=G.columns,q=(0,f.useCallback)((function(e,n,t){var i,o=t||{},r=o.disableEdit,u=o.key,c=(0,de.wx)(e,n),s=(null===c||void 0===c?void 0:c.typesDerived)||[];return(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[null===(i=s||[])||void 0===i?void 0:i.map((function(n){return(0,S.jsx)("div",{style:{paddingBottom:1,marginRight:2,paddingTop:1},children:(0,S.jsx)(ke.Z,{label:n,onClick:r?null:function(t){(0,Re.j)(t);var i=!(null===s||void 0===s||!s.includes(n))?(0,de.VZ)([n],c):(0,de.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,de.$C)((0,de.KN)(a,(0,l.Z)({},e,o)),n)}))},xsmall:!0})},"".concat(e,"-").concat(u||"types","-").concat(n))})),!r&&(0,S.jsx)(D.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Re.j)(e),B({x:e.pageX,y:e.pageY}),g(c)},children:(0,S.jsx)(V.I8,{default:!0})})]},"".concat(e,"-").concat(u||"types"))}),[v,B,g,a,de.$C]),Y=(0,f.useMemo)((function(){return null===H||void 0===H?void 0:H.map((function(e){var n,t=e.column,i=e.property,o=a.bookmark_properties,u=a.key_properties,c=a.partition_keys,s=a.replication_method,d=a.unique_constraints,p=(i.anyOf,i.format,i.metadata),f=(i.type,(0,de.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],b=null===N||void 0===N?void 0:N[t],g=null===L||void 0===L?void 0:L[t],j=null===F||void 0===F?void 0:F[t],y=[(0,S.jsx)("div",{style:{minHeight:22},children:(0,S.jsx)(Pe.Z,{checked:h,compact:!0,onCheck:function(e){v((function(n){return(0,de.$C)((0,de.AP)(a,(0,l.Z)({},t,Ne(Ne({},p),{},{metadata:Ne(Ne({},null===p||void 0===p?void 0:p.metadata),{},{selected:e(h)})}))),n)}))}})},"".concat(t,"-selected")),(0,S.jsx)(C.ZP,{monospace:!0,children:t},"".concat(t,"-column")),q(t,f),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:m,onClick:function(e){(0,Re.j)(e),v((function(e){return(0,de.$C)(Ne(Ne({},a),{},{unique_constraints:m?(0,Ie.Od)(d||[],(function(e){return e===t})):(0,Ie.Hl)(t,d||[])}),e)}))}})},"".concat(t,"-unique"))],k=[];return Ce._B.INCREMENTAL===s&&k.push([b,"bookmark_properties",o]),k.push.apply(k,[[g,"key_properties",u],[j,"partition_keys",c]]),k.forEach((function(e){var n=(0,r.Z)(e,3),i=n[0],o=n[1],u=n[2];y.push((0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:i,onClick:function(e){(0,Re.j)(e),v((function(e){return(0,de.$C)(Ne(Ne({},a),{},(0,l.Z)({},o,i?(0,Ie.Od)(u||[],(function(e){return e===t})):(0,Ie.Hl)(t,u||[]))),e)}))}})},"".concat(t,"-").concat(o)))})),y}))}),[N,L,F,q,h,H,v,B,g,a,U]),X=(0,f.useCallback)((function(e){var t=null===H||void 0===H?void 0:H[e];return Ne(Ne({},t),{},{highlighted:!(null===n||void 0===n||!n[null===t||void 0===t?void 0:t.column])})}),[n,H]),Q=(0,f.useMemo)((function(){var e;if(M&&b){var n=21*w.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=M||{},u=r.x,c=void 0===u?0:u,s=r.y,d=void 0===s?0:s,p=c;c+n>=i+o&&(p=i+o-(n+w.iI)),p<0&&(p=0);var f=(null===h||void 0===h?void 0:h[null===b||void 0===b?void 0:b.uuid])||{},m=(0,de.wx)(null===b||void 0===b?void 0:b.uuid,f||{}),y=m||{},k=y.typesDerived,P=void 0===k?[]:k,C=y.uuid;return(0,S.jsx)("div",{onClick:Re.j,style:{left:p,position:"fixed",top:d+w.iI/2,width:n,zIndex:100},children:(0,S.jsxs)(De.Z,{children:[(0,S.jsx)("div",{style:{position:"relative"},children:(0,S.jsx)(D.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Re.j)(e),B(null),g(null)},style:{position:"absolute",right:-.5*w.iI,top:-.5*w.iI,zIndex:1},children:(0,S.jsx)(j.Z,{default:!0,size:2.5*w.iI,children:(0,S.jsx)(V.x8,{size:1.5*w.iI})})})}),(0,S.jsx)(O.Z,{p:w.cd,children:Ce.D5.map((function(e,n){var t=!(null===P||void 0===P||!P.includes(e));return(0,S.jsx)("div",{style:{marginTop:0===n?0:4},children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(x.Z,{checked:t,label:e,onClick:function(n){(0,Re.j)(n);var i=t?(0,de.VZ)([e],m):(0,de.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,de.$C)((0,de.KN)(a,(0,l.Z)({},C,o)),e)}))}})})},e)}))})]})})}}),[M,b,E,h,v,B,g,a]),J=(0,f.useMemo)((function(){return(0,de.p$)(a,p,d)}),[a,d,p]),$=(0,f.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=Ne({},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,f.useCallback)((function(e){var n=e||{},t=n.column,i=n.property,o=n.currentProperty,r=!(null===_||void 0===_||!_[t]),l=[(0,S.jsx)(x.Z,{checked:r,onClick:function(e){(0,Re.j)(e),$([t],!r)}},"".concat(t,"-accept")),(0,S.jsx)(C.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,S.jsx)("div",{},"".concat(t,"-empty"))),l}),[q,_,I,$]),ne=(0,f.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===_||void 0===_||!_[e])}));return(0,S.jsx)(Ze.Z,{columnFlex:[null,1].concat(i||[]),columns:[{label:function(){return(0,S.jsx)(x.Z,{checked:l,onClick:function(e){(0,Re.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===_||void 0===_||!_[i]);$([i],!o)},rows:null===e||void 0===e?void 0:e.map(ee)})}),[ee,_,$]),te=(0,f.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,Ie.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,Ie.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,S.jsxs)(S.Fragment,{children:[(null===u||void 0===u?void 0:u.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(ue.Z,{level:5,warning:!0,children:"New properties"})}),(0,S.jsx)(y.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,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(ue.Z,{level:5,warning:!0,children:"Properties with new types"})}),(0,S.jsx)(y.Z,{light:!0}),ne(c,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{uuid:"Types (current)"}]})]})]})}),[J,ne,h,a]),ie=(0,f.useMemo)((function(){return(0,S.jsx)(Ze.Z,{columnFlex:W,columns:K,highlightRowOnHover:!0,isSelectedRow:function(e){var n;return null===(n=X(e))||void 0===n?void 0:n.highlighted},menu:Q,onClickRow:function(e){var n=X(e),t=n.column,i=n.highlighted;o((function(e){return i?(0,je.gR)(e,[t]):Ne(Ne({},e),{},(0,l.Z)({},t,!0))}))},ref:E,rows:Y,stickyHeader:!0})}),[W,K,X,E,Q,Y,o]);return(0,S.jsxs)(S.Fragment,{children:[s&&te&&(0,S.jsxs)(O.Z,{my:w.cd,children:[(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(Be.NJ,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(V.uy,{size:2*w.iI,warning:!0})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(C.ZP,{muted:!0,children:["The following properties are either new or have different types. Please review and either merge the changes or discard them.",(0,S.jsx)("br",{}),"Click the checkbox to include the updated property when merging changes."]})]})})}),te,(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.Pt,{}),onClick:function(){v((function(e){var n;return(0,de.$C)(Ne(Ne({},a),{},{schema:Ne(Ne({},null===a||void 0===a?void 0:a.schema),{},{properties:Ne(Ne({},null===a||void 0===a||null===(n=a.schema)||void 0===n?void 0:n.properties),_)})}),e)})),c({noParents:{},parents:{}}),u(ae.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(D.ZP,{onClick:function(){c({noParents:{},parents:{}}),u(ae.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!s&&ie,(0,S.jsx)(O.Z,{pb:w.HN})]})},Fe=["block","height","pipeline","selectedSubTab","showError","stream"];function Ue(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 He(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ue(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ue(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ze=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.selectedSubTab,r=e.showError,l=e.stream,u=(0,be.Z)(e,Fe);return ae.tw.OVERVIEW!==o&&o?ae.tw.SETTINGS===o||ae.tw.STREAM_CONFLICTS===o?(0,S.jsx)(Le,He(He({},u),{},{block:n,showStreamConflicts:ae.tw.STREAM_CONFLICTS===o,stream:l})):ae.tw.SAMPLE_DATA===o?(0,S.jsx)(ye,{block:n,height:t,pipeline:i,showError:r,stream:l}):(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(Me,He(He({},u),{},{block:n,stream:l}))},Ge=t(47041),We=t(91437),Ke=8*w.iI,Ve=p.default.div.withConfig({displayName:"indexstyle__AfterContentStyle",componentId:"sc-119v89s-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||we.Z.background).panel,";\n ")})),qe=p.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-119v89s-1"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||we.Z.background).panel,";\n ")})),Ye=p.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-119v89s-2"})(["border-radius:","px;position:relative;"," ",""],_e.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||we.Z.borders).light,";\n background-color: ").concat((e.theme.background||we.Z.background).panel,";\n ")}),(function(e){return e.maxWidth&&"\n width: ".concat(e.maxWidth,"px;\n ")})),Xe=p.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-119v89s-3"})(["padding:","px;",""],w.cd*w.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||we.Z.borders).light,";\n ")})),Qe=p.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-119v89s-4"})([""," "," ",""],(0,We.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||we.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||we.Z.background).codeTextarea,";\n ")})),Je=p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-119v89s-5"})(["position:absolute;"]),$e=p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-119v89s-6"})([""," overflow:auto;position:fixed;",""],Ge.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||we.Z.borders).light,";\n ")})),en=p.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-119v89s-7"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],_e.n_,w.cd*w.iI,1*w.iI,(function(e){return!e.warning&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(e){return!e.selected&&!e.warning&&"\n border: 1px solid ".concat((e.theme.borders||we.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||we.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||we.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||we.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||we.Z.borders).contrast,";\n ")})),nn=p.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-119v89s-8"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||we.Z.background).panel,";\n ")})),tn={label:function(e){return"".concat((0,J._6)("stream",e,!0)," fetched")},uuid:"Recently fetched"},on={label:function(e){return"".concat((0,J._6)("stream",e,!0)," from settings")},uuid:"From stream settings"},rn=[tn,on];function ln(e,n){return null===n||void 0===n?void 0:n.filter((function(n){var t=new RegExp(e||"","i"),i=(0,de.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 un=function(e){var n=e.block,t=e.blocksMapping,i=e.height,o=e.onChangeBlock,u=e.searchText,c=e.setSelectedMainNavigationTab,s=(e.setSelectedSubTab,e.setStreamsMappingConflicts),a=e.streamsFetched,d=e.updateStreamsInCatalog,p=e.width,v=(0,f.useMemo)((function(){return(0,de.Uc)(n,{getAll:!0})}),[n]),h=(0,f.useMemo)((function(){return(0,de.UA)(v)}),[v]),m=(0,f.useMemo)((function(){return(0,de.UA)(a||[])}),[a]),b=(0,f.useCallback)((function(e){return(0,de.ig)(e,m,h)}),[m,h]),g=(0,f.useCallback)((function(e){return(0,de.p$)(e,m,h)}),[m,h]),x=(0,f.useCallback)((function(e){var n;return(n={},(0,l.Z)(n,tn.uuid,m),(0,l.Z)(n,on.uuid,h),n)[e]}),[h,m]),j=(0,f.useMemo)((function(){var e=[];return rn.forEach((function(n,i){var o,l=n.label,c=n.uuid,s=x(c),a=[],d=Object.values((null===s||void 0===s?void 0:s.noParents)||{})||[],p=ln(u,d);(null===p||void 0===p?void 0:p.length)>=1&&a.push({streams:(0,Ie.YC)(p||[],de.M$)}),null===(o=Object.entries((null===s||void 0===s?void 0:s.parents)||{}))||void 0===o||o.forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],o=n[1],l=ln(u,Object.values(o||{})||[]);(null===l||void 0===l?void 0:l.length)>=1&&a.push({block:null===t||void 0===t?void 0:t[i],streams:(0,Ie.YC)(l||[],de.M$)})})),(null===a||void 0===a?void 0:a.length)>=1&&e.push({count:(0,Ie.Sm)((null===a||void 0===a?void 0:a.map((function(e){var n=e.streams;return(null===n||void 0===n?void 0:n.length)||0})))||[]),label:l,subgroups:a,uuid:c})})),e}),[x,u]),P=(0,f.useMemo)((function(){return(null===j||void 0===j?void 0:j.length)||0}),[j]);return(0,S.jsx)(S.Fragment,{children:null===j||void 0===j?void 0:j.map((function(e,n){var t=e.count,r=e.label,l=e.subgroups,u=e.uuid,a=tn.uuid===u;return(0,S.jsx)(Je,{style:{height:i,right:on.uuid===u?null:0,width:p/P},children:(0,S.jsx)($e,{borderRight:P>=2&&!a,style:{height:i,width:p/P},children:(0,S.jsxs)(O.Z,{pt:w.cd,children:[(0,S.jsx)(O.Z,{px:w.Mq,children:(0,S.jsx)(ue.Z,{level:4,children:r(t)})}),null===l||void 0===l?void 0:l.map((function(e,n){var t,i=e.block,r=e.streams;return(0,S.jsxs)(O.Z,{mt:i&&0===n?w.cd:1,children:[(0,S.jsx)(O.Z,{mb:i?w.cd:0,mt:i?0:w.cd,children:(0,S.jsx)(y.Z,{light:!0})}),i&&(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(C.ZP,{bold:!0,color:null===(t=(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}))||void 0===t?void 0:t.accent,default:!0,large:!0,monospace:!0,children:null===i||void 0===i?void 0:i.uuid})}),(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(Z.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,de.M$)(e),r=(0,de.Qu)(e),l=!1;if(a){var u=(0,de.zB)(e,x(on.uuid));u&&(l=(0,de.Z5)(u))}else l=(0,de.Z5)(e);var p=n&&t;return(0,S.jsx)(en,{onClick:a&&p?function(){return!1}:function(n){n.preventDefault(),d([(0,de.XE)(e,{selected:!l})],(function(e){return null===o||void 0===o?void 0:o(e)}))},selected:l,warning:p&&a,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{monospace:!0,muted:!l,children:i})}),p&&a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,warning:!0,children:"exists"})]}),p&&a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(k.Z,{alignItems:"center",style:{minHeight:3*w.iI},children:(0,S.jsx)(D.ZP,{compact:!0,onClick:function(){s((function(n){return(0,de.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:ae.tw.STREAM_CONFLICTS}}))},small:!0,warning:!0,children:"View differences"})})]}),(!p||!a)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:w.HN}),l&&(0,S.jsx)(V.Zr,{size:2*w.iI}),(0,S.jsx)(O.Z,{mr:l?1:3}),(0,S.jsx)(k.Z,{alignItems:"center",style:{height:3*w.iI},children:(0,S.jsx)(Pe.Z,{checked:l,compact:!0,onCheck:function(n){return d([(0,de.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 cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function sn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?cn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var an=function(e){var n=e.attributes,t=e.attributesMapping,i=e.columnFlex,o=e.rightAlignColumnForRowIndexes,r=e.rowGroupHeaders,u=e.rowsGroupedByIndex,c=e.setAttributesMapping,s=(0,f.useCallback)((function(e,n){var i,r=e.inputType,u=e.label,s=e.options,a=e.uuid,d=null===t||void 0===t?void 0:t[a],p=!(null===d||void 0===d||!d.selected),f=null===d||void 0===d?void 0:d.value;return ae.oI.CHECKBOX===r?i=(0,S.jsx)(x.Z,{checked:!!f,onClick:function(e){p&&(0,Re.j)(e),c((function(e){return sn(sn({},e),{},(0,l.Z)({},a,sn(sn({},null===e||void 0===e?void 0:e[a]),{},{value:!f})))}))}}):ae.oI.SELECT===r?i=(0,S.jsxs)(z.Z,{compact:!0,fullWidth:!0,onChange:function(e){(0,Re.j)(e),c((function(n){var t;return sn(sn({},n),{},(0,l.Z)({},a,sn(sn({},null===n||void 0===n?void 0:n[a]),{},{value:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})))}))},onClick:function(e){p&&(0,Re.j)(e)},value:f,children:[(0,S.jsx)("option",{value:""}),null===s||void 0===s?void 0:s.map((function(e){var n=e.disabled,t=e.label,i=e.value;return(0,S.jsx)("option",{disabled:n,value:i,children:t?t():i},i)}))]}):ae.oI.TOGGLE===r&&(i=(0,S.jsx)(Pe.Z,{checked:f,compact:!0,onCheck:function(e){c((function(n){return sn(sn({},n),{},(0,l.Z)({},a,sn(sn({},null===n||void 0===n?void 0:n[a]),{},{value:e(f)})))}))},pauseEvent:p})),[(0,S.jsx)(x.Z,{checked:p,onClick:function(e){(0,Re.j)(e),c((function(e){return sn(sn({},e),{},(0,l.Z)({},a,sn(sn({},null===e||void 0===e?void 0:e[a]),{},{selected:!p})))}))}},"".concat(a,"-checkbox")),(0,S.jsx)(C.ZP,{muted:!p,children:u()},"".concat(a,"-name")),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:null!==o&&void 0!==o&&o.includes(n)?"flex-end":"center",children:i},"".concat(a,"-value"))]}),[t,o,c]);return(0,f.useMemo)((function(){return(0,S.jsx)(Ze.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 sn(sn({},e),{},(0,l.Z)({},o,sn(sn({},null===e||void 0===e?void 0:e[o]),{},{selected:!u})))}))},rowGroupHeaders:r,rowsGroupedByIndex:u,rows:n.map((function(e,n){return s(e,n)}))})}),[n,t,i,s])};var dn=function(e){var n=e.selectedStreamMapping,t=e.setSelectedStreamMapping,i=e.streamMapping,o=(0,f.useMemo)((function(){return(0,de.th)(i)}),[i]),r=(0,f.useMemo)((function(){var e=[],t=[],i=[],r=[],l=0;return null===o||void 0===o||o.forEach((function(o){var u=o.groupHeader,c=o.streams;e.push(u);var s=[];null===c||void 0===c||c.forEach((function(e){r.push(e),s.push(l),l+=1;var i=(0,de.WD)(e),o=(0,de.M$)(e),u=!!(0,de.zB)(e,n),c=[(0,S.jsx)(x.Z,{checked:u},"".concat(i,"-").concat(o,"-use")),(0,S.jsx)(C.ZP,{muted:!u,children:o},"".concat(i,"-").concat(o,"-stream"))];t.push(c)})),i.push(s)})),{rowGroupHeaders:e,rows:t,rowsGroupedByIndex:i,streamsArray:r}}),[n,o]),l=r.rowGroupHeaders,u=r.rows,c=r.rowsGroupedByIndex,s=r.streamsArray,a=(0,f.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,Ie.Sm)(null===(t=Object.values((null===n||void 0===n?void 0:n.parents)||{}))||void 0===t?void 0:t.map((function(e){var n;return null===(n=Object.values(e||{}))||void 0===n?void 0:n.length})))}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsxs)(ue.Z,{children:[(0,J._6)("stream",a||0)," chosen"]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})})]})}),(0,S.jsx)(Ze.Z,{columnFlex:[null,1],columns:[{uuid:"Use"},{uuid:"Stream"}],groupsInline:!0,onClickRow:function(e){var i=null===s||void 0===s?void 0:s[e],o=!!(0,de.zB)(i,n);t((function(e){return(0,de.iN)(i,e,{remove:o})}))},rowGroupHeaders:l,rows:u,rowsGroupedByIndex:c,stickyHeader:!0})]})};var pn=function(e){var n=e.attributesMapping,t=e.selectedStreamMapping,i=e.setAttributesMapping,o=e.setSelectedStreamMapping,r=e.streamMapping,l=(0,f.useMemo)((function(){return(0,S.jsx)(an,{attributes:[{label:function(){return"Replication method"},inputType:ae.oI.SELECT,options:Object.values(Ce._B).map((function(e){return{disabled:Ce._B.FULL_TABLE!==e,label:function(){var n=(0,J.vg)(e);return Ce._B.FULL_TABLE!==e?"[COMING SOON] ".concat(n):n},value:e}})),uuid:de.I1.REPLICATION_METHOD},{label:function(){return"Unique conflict method"},inputType:ae.oI.SELECT,options:Object.values(Ce.MU).map((function(e){return{label:function(){return(0,J.vg)(e)},value:e}})),uuid:de.I1.UNIQUE_CONFLICT_METHOD},{label:function(){return"Run stream in parallel"},inputType:ae.oI.TOGGLE,uuid:de.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:ae.oI.TOGGLE,uuid:de.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:ae.oI.TOGGLE,uuid:de.I1.DISABLE_COLUMN_TYPE_CHECK}],attributesMapping:n,columnFlex:[null,1,1],rightAlignColumnForRowIndexes:[2,3,4],setAttributesMapping:i})}),[n,i]),u=(0,f.useMemo)((function(){return(0,S.jsx)(dn,{selectedStreamMapping:t,setSelectedStreamMapping:o,streamMapping:r})}),[t,o,r]);return(0,S.jsxs)(nn,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsx)(ue.Z,{children:"Make changes to multiple streams"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.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 fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function vn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var hn=function(e){var n=e.attributesMapping,t=e.highlightedColumnsMapping,i=e.selectedStreamMapping,u=e.setAttributesMapping,c=e.setHighlightedColumnsMapping,s=e.setSelectedStreamMapping,a=e.stream,d=e.streamMapping;e.updateStreamsInCatalog,(0,f.useEffect)((function(){if(a&&!i){var e=(0,de.M$)(a||{}),n=(0,de.Qu)(a||{});n?s({noParents:{},parents:(0,l.Z)({},n,(0,l.Z)({},e,a))}):e&&s({noParents:(0,l.Z)({},e,a),parents:{}})}}),[i,s,a]);var p=(0,f.useMemo)((function(){return(0,S.jsx)(an,{attributes:[{label:function(){return"Include property when syncing"},inputType:ae.oI.CHECKBOX,uuid:de.I1.PROPERTY_SELECTED},{label:function(){return"Unique constraint"},inputType:ae.oI.CHECKBOX,uuid:de.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Bookmark property"},inputType:ae.oI.CHECKBOX,uuid:de.I1.BOOKMARK_PROPERTIES},{label:function(){return"Key property"},inputType:ae.oI.CHECKBOX,uuid:de.I1.KEY_PROPERTIES},{label:function(){return"Partition key"},inputType:ae.oI.CHECKBOX,uuid:de.I1.PARTITION_KEYS}].concat((0,o.Z)(Ce.D5.map((function(e){return{label:function(){return(0,J.vg)(e)},inputType:ae.oI.CHECKBOX,uuid:e}})))),attributesMapping:n,rowGroupHeaders:["Options","Column types"],rowsGroupedByIndex:[[0,1,2,3],null===Ce.D5||void 0===Ce.D5?void 0:Ce.D5.map((function(e,n){return n+4}))],setAttributesMapping:u})}),[n,u]),v=(0,f.useMemo)((function(){return(0,S.jsx)(dn,{selectedStreamMapping:i,setSelectedStreamMapping:s,streamMapping:d})}),[i,s,d]),h=(0,f.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,Ie.YC)(n,(function(e){return e}))}),[t]);return(0,S.jsxs)(nn,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)(ue.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,J._6)("property",(null===h||void 0===h?void 0:h.length)||0)," chosen")]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.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,S.jsx)(S.Fragment,{children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})]})})]}),(null===h||void 0===h?void 0:h.length)>=1&&(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:null===h||void 0===h?void 0:h.map((function(e){return(0,S.jsx)("div",{style:{marginBottom:w.iI/2,marginRight:w.iI/2},children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){c((function(n){return!(null===n||void 0===n||!n[e])?(0,je.gR)(n,[e]):vn(vn({},n),{},(0,l.Z)({},e,!0))}))}})},"".concat(e,"-chip"))}))})})]}),p,v]})};function mn(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 bn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gn={compact:!0,small:!0};var xn=function(e){var n=e.block,t=e.blocksMapping,i=e.onChangeBlock,o=e.selectedStreamMapping,r=e.setSelectedMainNavigationTab,u=e.setSelectedStreamMapping,c=e.streamMapping,s=e.updateStreamsInCatalog,a=(0,f.useRef)(null),d=(0,f.useState)({}),p=d[0],v=d[1],h=(0,f.useCallback)((function(e){return s(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,s]),m=(n||{}).type,b=c||{},x=b.noParents,j=b.parents,y=(0,f.useMemo)((function(){return(0,je.Qr)(x||{})&&(0,je.Qr)(j||{})}),[x,j]),k=(0,f.useMemo)((function(){return(0,de.th)(c)}),[c]),I=(0,f.useMemo)((function(){var e=[null,1,3,2,2,null],n=[{label:function(e){var n=e.groupIndex,t=((null===k||void 0===k?void 0:k[n])||{}).streams,i=t&&(null===t||void 0===t?void 0:t.every((function(e){return(0,de.Z5)(e)})));return(0,S.jsx)(Pe.Z,{checked:i,compact:!0,disabled:!(null!==t&&void 0!==t&&t.length),onCheck:function(e){t&&h(null===t||void 0===t?void 0:t.map((function(n){return(0,de.XE)(n,{selected:e(i)})})))}})},uuid:"action"},{uuid:"Stream"},{uuid:"Table"},{uuid:"Sync"},{uuid:"Unique conflict"},{center:!0,uuid:"Parallel"}];return g.tf.DATA_EXPORTER===m&&(e.push.apply(e,[null,null]),n.push.apply(n,[{center:!0,uuid:"Add columns"},{center:!0,uuid:"No strict check"}])),{columnFlex:e,columns:n}}),[m,k,h]),E=I.columnFlex,T=I.columns,M=(0,f.useMemo)((function(){var e=[],n=[],i=[],o=[],u=0;return null===k||void 0===k||k.forEach((function(c){var s=c.groupHeader,d=c.streams,b=s?null===t||void 0===t?void 0:t[s]:null;b?n.push((0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===b||void 0===b?void 0:b.type,{blockColor:null===b||void 0===b?void 0:b.color}).accent,monospace:!0,children:s})})):n.push(s);var x=[];null===d||void 0===d||d.forEach((function(n){e.push(n),x.push(u),u+=1;var t=(0,de.WD)(n),o=(0,de.Qu)(n),c=(0,de.M$)(n),s=n.auto_add_new_fields,d=n.destination_table,b=n.disable_column_type_check,j=n.replication_method,y=n.run_in_parallel,k=n.unique_conflict_method,O=(0,de.Z5)(n),C=t in p?null===p||void 0===p?void 0:p[t]:d,w=[(0,S.jsx)(Pe.Z,{checked:O,compact:!0,onCheck:function(e){h([(0,de.XE)(n,{selected:e(O)})])}},"".concat(t,"-action")),(0,S.jsx)(P.Z,{bold:!0,monospace:!0,onClick:function(){r(c,o)},preventDefault:!0,sameColorAsText:!0,children:c},"".concat(t,"-name")),(0,S.jsx)(W.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 bn(bn({},e),{},(0,l.Z)({},t,o))})),clearTimeout(a.current),a.current=setTimeout((function(){return h([bn(bn({},n),{},{destination_table:o})])}),300)},onClick:Re.j,placeholder:c,value:C||""},"".concat(t,"-destinationTable")),(0,f.createElement)(z.Z,bn(bn({},gn),{},{key:"".concat(t,"-replicationMethod"),onChange:function(e){var t;return h([bn(bn({},n),{},{replication_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Re.j,placeholder:"Replication method",value:j}),Object.values(Ce._B).map((function(e){return(0,S.jsxs)("option",{disabled:Ce._B.FULL_TABLE!==e,value:e,children:[Ce._B.FULL_TABLE!==e&&"[COMING SOON] ",(0,J.vg)(e)]},e)}))),(0,f.createElement)(z.Z,bn(bn({},gn),{},{key:"".concat(t,"-uniqueConflictMethod"),onChange:function(e){var t;return h([bn(bn({},n),{},{unique_conflict_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Re.j,placeholder:"Unique conflict method",value:k}),Object.values(Ce.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Pe.Z,{checked:!!y,compact:!0,onCheck:function(e){h([bn(bn({},n),{},{run_in_parallel:e(y)})])}})},"".concat(t,"-runInParallel"))];g.tf.DATA_EXPORTER===m&&w.push.apply(w,[(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Pe.Z,{checked:!!s,compact:!0,onCheck:function(e){h([bn(bn({},n),{},{auto_add_new_fields:e(s)})])}})},"".concat(t,"-autoAddNewFields")),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Pe.Z,{checked:!!b,compact:!0,onCheck:function(e){h([bn(bn({},n),{},{disable_column_type_check:e(b)})])}})},"".concat(t,"-disableColumnTypeCheck"))]),i.push(w)})),o.push(x)})),{rowGroupHeaders:n,rows:i,rowsGroupedByIndex:o,streamsInRows:e}}),[m,t,p,v,r,k,a,h]),D=M.rowGroupHeaders,B=M.rows,R=M.rowsGroupedByIndex,A=M.streamsInRows;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(ue.Z,{children:"Overview of streams"}),y&&(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Fetch and add at least 1 stream to the catalog in order to see an overview of all the configured stream."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return r(ae.uK.STREAMS)},preventDefault:!0,children:"Go and fetch Streams"})})]})]}),!y&&(0,S.jsx)(Ze.Z,{columnFlex:E,columns:T,isSelectedRow:function(e){var n=null===A||void 0===A?void 0:A[e];return!!(0,de.zB)(n,o)},groupsInline:!0,onClickRow:function(e){var n=null===A||void 0===A?void 0:A[e],t=!!(0,de.zB)(n,o);u((function(e){return(0,de.iN)(n,e,{remove:t})}))},rowGroupHeaders:D,rows:B,rowsGroupedByIndex:R,stickyHeader:!0})]})},jn=t(62547),yn=t(53808),kn=t(19183);function Zn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Pn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Zn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var On=3*w.iI*2;var Cn=function(e){var n=e.block,t=void 0===n?null:n,i=e.defaultMainNavigationTab,u=void 0===i?null:i,c=e.defaultMainNavigationTabSub,s=void 0===c?null:c,a=e.defaultSubTab,d=void 0===a?null:a,p=e.onChangeBlock,h=e.onChangeCodeBlock,m=e.onClose,b=e.onSaveBlock,I=e.pipeline,E=e.savePipelineContent,T=e.setContent,M=(0,f.useRef)(null),R=(0,f.useRef)(null),A=(0,f.useRef)(null),N=(0,f.useRef)(null),L=(0,f.useState)({}),F=L[0],U=L[1],H=(0,f.useState)(null),z=H[0],q=H[1],X=(0,f.useState)(!1),Q=X[0],J=X[1],ne=(0,kn.i)(),te=ne.height,ie=ne.width,re=I||{},le=re.blocks,ce=re.uuid,se=t||{},pe=(se.catalog,se.content),fe=se.language,be=se.type,ge=se.uuid,xe=(0,f.useMemo)((function(){return g.tf.DATA_LOADER===be?Y.O.SOURCES:Y.O.DESTINATIONS}),[be]),ye=(0,f.useState)(t||null),ke=ye[0],Ze=ye[1],Oe=ke||{},Ce=(Oe.configuration,Oe.content),we=Oe.metadata,_e=(0,f.useMemo)((function(){return(null===we||void 0===we?void 0:we.data_integration)||{}}),[we]),Se=_e.destination,Ee=_e.name,Te=_e.source,Me=(0,f.useMemo)((function(){return Se||Te||null}),[Se,Te]),De=(0,f.useMemo)((function(){var e={include_block_catalog:!0,include_block_metadata:!0,include_documentation:!0};return Me&&(e.data_integration_uuid=Me),e}),[xe,Me]),Be=K.ZP.blocks.pipelines.detail(ce,ge,De,{},{key:"pipelines/".concat(ce,"/blocks/").concat(ge,"/documentation")}).data,Re=(0,f.useMemo)((function(){var e;return(null===ke||void 0===ke||null===(e=ke.configuration)||void 0===e?void 0:e.data_integration)||{}}),[ke]),Ae=(0,f.useCallback)((function(e){return Ze((function(n){var t,i=Pn(Pn({},n),{},{configuration:Pn(Pn({},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===p||void 0===p||p(i),i}))}),[p,Ze]),Ne=(0,f.useCallback)((function(e){return Ae((function(n){return Pn(Pn({},n),{},{inputs:e((null===n||void 0===n?void 0:n.inputs)||{})})}))}),[Ae]),Le=(0,f.useCallback)((function(e,n){return Ze((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,de.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,de.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=Pn(Pn({},o),e);i>=0?r[i]=l:r.push(l)}));var l=Pn(Pn({},t),{},{catalog:Pn(Pn({},i),{},{streams:r})});return null===n||void 0===n||n(l),l}))}),[Ze]),Fe=(0,f.useMemo)((function(){return null===Be||void 0===Be?void 0:Be.block}),[Be]);(0,f.useEffect)((function(){Fe&&(ke&&(null===Fe||void 0===Fe?void 0:Fe.uuid)===(null===ke||void 0===ke?void 0:ke.uuid)||Ze(Fe))}),[ke,Fe]);var Ue=(0,f.useMemo)((function(){return(0,Ie.HK)(le||[],(function(e){return e.uuid}))}),[le]),He=(0,f.useMemo)((function(){var e;return null===ke||void 0===ke||null===(e=ke.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null===Ue||void 0===Ue?void 0:Ue[e]}))}),[ke,Ue]),Ge=(0,f.useMemo)((function(){return null===Fe||void 0===Fe?void 0:Fe.documentation}),[Fe]),We=(0,f.useMemo)((function(){return(0,de.Uc)(ke,{getAll:!0})}),[ke]),Je=(0,f.useMemo)((function(){return(0,de.UA)(We)}),[We]),$e=(0,f.useMemo)((function(){return"DataIntegrationModal/".concat(ge)}),ge),en=(0,f.useMemo)((function(){return"block_layout_after_width_".concat($e)}),[$e]),nn=(0,f.useMemo)((function(){return"block_layout_before_width_".concat($e)}),[$e]),tn=(0,ee.VI)(null,{},[],{uuid:$e}),on=(0,r.Z)(tn,1)[0],rn=(0,f.useState)((0,yn.U2)(en,60*w.iI)),ln=rn[0],cn=rn[1],sn=(0,f.useState)(!1),an=sn[0],dn=sn[1],fn=(0,f.useState)(Math.max((0,yn.U2)(nn),40*w.iI)),vn=fn[0],mn=fn[1],bn=(0,f.useState)(!1),gn=bn[0],Zn=bn[1],Cn=(0,f.useState)({}),wn=Cn[0],_n=Cn[1],Sn=(0,f.useState)({selectedMainNavigationTab:null,selectedMainNavigationTabSub:s,selectedSubTab:null}),In=Sn[0],En=In.selectedMainNavigationTab,Tn=In.selectedMainNavigationTabSub,Mn=In.selectedSubTab,Dn=Sn[1],Bn=(0,f.useState)((0,de.UA)([])),Rn=Bn[0],An=Bn[1],Nn=(0,f.useMemo)((function(){if(!(0,je.Qr)(null===Rn||void 0===Rn?void 0:Rn.noParents)||!(0,je.Qr)(null===Rn||void 0===Rn?void 0:Rn.parents)){var e,n,t,i;if(En)if(Tn)e=null===Rn||void 0===Rn||null===(n=Rn.parents)||void 0===n||null===(t=n[En])||void 0===t?void 0:t[Tn];else e=null===Rn||void 0===Rn||null===(i=Rn.noParents)||void 0===i?void 0:i[En];return(0,ae.C0)({addStreamConflicts:!!e})}return(0,ae.C0)()}),[En,Tn,Rn]),Ln=(0,f.useCallback)((function(e){return e in ae.Pf?ae.Pf[e]:Nn}),[Nn]),Fn=(0,f.useCallback)((function(e){Dn((function(n){return function(e,n){var t=e||{},i=t.selectedMainNavigationTab,o=t.selectedMainNavigationTabSub,r=t.selectedSubTab,l=n||{},u=l.selectedMainNavigationTab,c=l.selectedMainNavigationTabSub,s=i in ae.Pf?ae.Pf[i]:Nn,a=r;if(ae.mU[i]||ae.mU[u]){var d,p,f;if(a){if(ae.mU[u]&&!ae.mU[i]){var v;!a||null!==Nn&&void 0!==Nn&&Nn.includes(a)||ae.tw.STREAM_CONFLICTS===a||(a=null===Nn||void 0===Nn||null===(v=Nn[0])||void 0===v?void 0:v.uuid)}}else a=null===s||void 0===s||null===(f=s[0])||void 0===f?void 0:f.uuid;i!==u&&_n({});var h=(0,de.zB)({parent_stream:c,stream:u,tap_stream_id:u},Je),m=(0,de.zB)({parent_stream:o,stream:i,tap_stream_id:i},Je),b=(0,Ie.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)||{}));_n((function(e){return Pn({},(0,je.GL)(e,b||[]))}))}return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:o,selectedSubTab:a}}(e(n),n)}))}),[Tn,_n,Je,Nn]);(0,f.useEffect)((function(){En||Fn((function(e){var n,t,i=e.selectedSubTab;return{selectedMainNavigationTab:u||ae.uK.CONFIGURATION,selectedMainNavigationTabSub:s,selectedSubTab:u?d||(null===(n=Ln(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,s,d,En,Fn]);var Un=(0,f.useMemo)((function(){return Ln(En)}),[Ln,En]),Hn=(0,f.useMemo)((function(){var e=[{Icon:V.JG,uuid:ae.uK.CONFIGURATION},{Icon:V.kO,uuid:ae.uK.STREAMS},{Icon:V.iA,uuid:ae.uK.OVERVIEW}].map((function(e){var n=e.Icon,t=e.uuid;return(0,S.jsx)(Qe,{selected:En===t,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return Fn((function(){return{selectedMainNavigationTab:t}}))},preventDefault:!0,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{primaryLight:!0,size:4*w.iI,square:!0,children:(0,S.jsx)(n,{size:2*w.iI})}),(0,S.jsx)(O.Z,{mr:2}),(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:ae.TD[t]})]})})})},t)})),n=(null===We||void 0===We?void 0:We.length)||0,t=[],i={};return null===We||void 0===We||We.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,Ie.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===Ue||void 0===Ue?void 0:Ue[t],streams:i}})))).forEach((function(t){var i=t.block,o=t.streams;if(i){var r=null===i||void 0===i?void 0:i.uuid;e.push((0,S.jsx)(y.Z,{light:!0},"block-".concat(r,"-divider-top"))),e.push((0,S.jsx)(O.Z,{px:w.cd,py:1,children:(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}).accent,monospace:!0,small:!0,children:r})},"block-".concat(r)))}null===o||void 0===o||o.forEach((function(t,i){var o=(0,de.M$)(t),r=(0,de.Qu)(t),l=(0,de.WD)(t),u=(0,de.Z5)(t),c=En===o&&(!r||Tn===r);e.push((0,S.jsx)(y.Z,{light:!0},"".concat(l,"-divider-top"))),e.push((0,S.jsx)(Qe,{selected:c,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){Fn((function(e){var n=e.selectedSubTab;return{selectedMainNavigationTab:o,selectedMainNavigationTabSub:r,selectedSubTab:n}}))},preventDefault:!0,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:u}),(0,S.jsx)(O.Z,{mr:2}),(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{default:!u,monospace:!0,children:o})})]})})})},l)),i===n-1&&e.push((0,S.jsx)(y.Z,{light:!0},"".concat(l,"-divider-last")))}))})),e}),[Ue,En,Tn,Fn,We]),zn=(0,f.useState)(null),Gn=zn[0],Wn=zn[1],Kn=(0,f.useMemo)((function(){return(0,de.qf)(Je,(0,de.UA)(Gn||[]))}),[Je,Gn]),Vn=(0,v.Db)(K.ZP.integration_sources.useUpdate(ce),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.integration_source.streams;Wn(n)},onErrorCallback:function(e,n){return on({errors:n,response:e})}})}}),qn=(0,r.Z)(Vn,2),Yn=qn[0],Xn=qn[1].isLoading,Qn=(0,f.useCallback)((function(){return Yn({integration_source:{block_uuid:ge}})}),[ge,Yn]),Jn=(0,f.useState)(null),$n=Jn[0],et=Jn[1],nt=(0,f.useMemo)((function(){return(0,S.jsxs)("div",{ref:N,children:[(null===Un||void 0===Un?void 0:Un.length)>=1&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(B.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return Fn((function(e){return Pn(Pn({},e),{},{selectedSubTab:n})}))},regularSizeText:!0,selectedTabUUID:Mn,tabs:Un})}),!(null!==Un&&void 0!==Un&&Un.length)&&ae.uK.STREAMS===En&&(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(W.Z,{beforeIcon:(0,S.jsx)(V.HN,{muted:!(null!==$n&&void 0!==$n&&$n.length),size:2*w.iI}),fullWidth:!0,noBackground:!0,noBorder:!0,noBorderRadiusBottom:!0,noBorderRadiusTop:!0,onChange:function(e){var n;return et(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},paddingHorizontal:w.iI*w.cd,paddingVertical:w.iI*w.cd,placeholder:"Type the name of the stream to filter...",value:$n||""})}),(null===$n||void 0===$n?void 0:$n.length)>=1&&(0,S.jsx)(D.ZP,{iconOnly:!0,noPadding:!0,noBackground:!0,noBorder:!0,onClick:function(){return et(null)},children:(0,S.jsx)(V.x8,{default:!0,size:2*w.iI})}),!Kn&&(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.rH,{size:2*w.iI}),compact:!0,loading:Xn,onClick:function(){return Qn()},primary:!0,children:"Fetch streams"})})]}),(0,S.jsx)(y.Z,{light:!0})]})}),[ge,Qn,Xn,Kn,N,$n,En,Mn,et,Un]),tt=(0,f.useMemo)((function(){return te-2*Ke}),[te]),it=(0,f.useMemo)((function(){return ie-2*Ke}),[ie]),ot=(0,f.useState)(null),rt=ot[0],lt=ot[1],ut=(0,f.useState)(null),ct=ut[0],st=ut[1],at=(0,f.useState)(null),dt=(at[0],at[1]),pt=(0,f.useState)(!1),ft=pt[0],vt=pt[1];(0,f.useEffect)((function(){var e,n,t,i,o,r;(En||Mn)&&(lt(null===N||void 0===N||null===(e=N.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),dt(null===R||void 0===R||null===(t=R.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height),st(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,En,Mn]);var ht=(0,v.Db)(K.ZP.blocks.pipelines.useUpdate(ce,encodeURIComponent(ge)),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){null===b||void 0===b||b(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return on({errors:n,response:e})}})}}),mt=(0,r.Z)(ht,2),bt=(mt[0],mt[1].isLoading,(0,f.useMemo)((function(){return En&&![ae.uK.CONFIGURATION,ae.uK.OVERVIEW,ae.uK.STREAMS,ae.uK.SYNC].includes(En)}),[En])),gt=(0,f.useMemo)((function(){return bt&&ae.tw.SETTINGS===Mn}),[bt,Mn]),xt=(0,f.useMemo)((function(){return ae.uK.CONFIGURATION===En&&ae.tw.CREDENTIALS===Mn}),[En,Mn]),jt=(0,f.useMemo)((function(){return ae.uK.OVERVIEW===En}),[En]),yt=(0,f.useMemo)((function(){return!(xt||gt||jt&&(null===We||void 0===We?void 0:We.length)>=1)||ft}),[ft,xt,gt,jt,En,Mn,We]),kt=(0,f.useMemo)((function(){var e=(0,de.zB)({parent_stream:Tn,stream:En,tap_stream_id:En},Je);if(e)return(0,S.jsx)(ze,{block:ke,blocksMapping:Ue,height:tt-rt-2*w.iI,highlightedColumnsMapping:wn,onChangeBlock:p,pipeline:I,selectedSubTab:Mn,setBlockAttributes:Ze,setHighlightedColumnsMapping:_n,setSelectedSubTab:function(e){return Fn((function(n){return Pn(Pn({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:An,showError:on,stream:e,streamMapping:Je,streamsMappingConflicts:Rn,updateStreamsInCatalog:Le})}),[ke,Ue,rt,tt,wn,p,I,En,Tn,Mn,Ze,_n,Fn,An,on,Je,Rn,Le]),Zt=(0,f.useState)(null),Pt=Zt[0],Ot=Zt[1];(0,f.useEffect)((function(){"undefined"!==typeof Pt&&null!==Pt||Ot("undefined"!==typeof pe&&null!==pe?pe:Ce)}),[Ce,pe,Pt,Ot]);var Ct=(0,f.useState)(null),wt=Ct[0],_t=Ct[1],St=(0,f.useMemo)((function(){return(0,S.jsx)(ve,{block:ke,blockConfigString:wt,blockContent:Pt,blockUpstreamBlocks:He,dataIntegrationConfiguration:Re,onChangeCodeBlock:h,pipeline:I,savePipelineContent:E,setBlockConfigString:_t,setBlockContent:Ot,setContent:T,setSelectedSubTab:function(e){return Fn((function(n){return Pn(Pn({},n),{},{selectedSubTab:e})}))},showError:on})}),[ke,wt,Pt,He,Re,h,I,E,_t,Ot,T,Fn,on]),It=(0,f.useMemo)((function(){if(ae.uK.CONFIGURATION===En){if(ae.tw.UPSTREAM_BLOCK_SETTINGS===Mn){var e=null===He||void 0===He?void 0:He.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===Ue||void 0===Ue?void 0:Ue[i],s=(null===c||void 0===c?void 0:c.catalog)?null===(t=(0,de.Uc)(c))||void 0===t?void 0:t.map((function(e){var n=e.stream,t=e.tap_stream_id;return n||t})):[i],a=1===(null===s||void 0===s?void 0:s.length)&&(null===s||void 0===s?void 0:s.includes(i));return(0,S.jsxs)("div",{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,large:!0,monospace:!0,muted:!u,children:i})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Pe.Z,{checked:u,compact:!0,onCheck:function(e){Ne((function(n){return e(u)?Pn(Pn({},n),{},(0,l.Z)({},i,{})):(0,je.gR)(n,[i])}))}})]}),u&&(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(me.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,Pn(Pn({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Use catalog as an input"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"If checked, then this block\u2019s catalog will be included as part of the input argument(s) for the current block."})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null===o||void 0===o?void 0:o.catalog,onClick:function(){return Ne((function(e){var n;return Pn(Pn({},e),{},(0,l.Z)({},i,Pn(Pn({},null===e||void 0===e?void 0:e[i]),{},{catalog:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.catalog)})))}))}})]}))}),a&&(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,Pn(Pn({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Use the block\u2019s output data as an input"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"Include this block\u2019s output data as an input."})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null===r||void 0===r?void 0:r.includes(i),monospace:!0,onClick:function(){return Ne((function(e){return Pn(Pn({},e),{},(0,l.Z)({},i,Pn(Pn({},null===e||void 0===e?void 0:e[i]),{},{streams:null!==r&&void 0!==r&&r.includes(i)?(0,Ie.Od)(r,(function(e){return e===i})):r.concat(i)})))}))},small:!0})]}))}),!a&&(0,S.jsxs)(me.g,{noBorder:!0,children:[(0,S.jsxs)(Z.ZP,Pn(Pn({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Select which stream\u2019s data to use as an input"}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Only the output data from the selected streams will be used as an input.",(0,S.jsx)("br",{}),"If none are selected, then no output data from any stream from this block will be used as in input.",(0,S.jsx)("br",{}),"If you don\u2019t see a stream here, then the upstream block may have unselected the stream in its stream settings."]})]}),(0,S.jsx)(O.Z,{mr:3})]})),null===s||void 0===s?void 0:s.map((function(e){var n=null===r||void 0===r?void 0:r.includes(e);return(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(Z.ZP,Pn(Pn({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{default:!0,monospace:!0,small:!0,children:e})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:n,onClick:function(){return Ne((function(t){return Pn(Pn({},t),{},(0,l.Z)({},i,Pn(Pn({},null===t||void 0===t?void 0:t[i]),{},{streams:n?(0,Ie.Od)(r,(function(n){return n===e})):r.concat(e)})))}))},small:!0})]}))},e)}))]}),(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,Pn(Pn({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Only use this block\u2019s output data as an input"}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["If checked, then this block\u2019s output data is only used as inputs.",g.tf.DATA_EXPORTER===be&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("br",{}),"The block\u2019s output data won\u2019t be ingested when running a sync, regardless if it\u2019s enabled in the settings."]})]})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:!(null===o||void 0===o||!o.input_only),onClick:function(){return Ne((function(e){var n;return Pn(Pn({},e),{},(0,l.Z)({},i,Pn(Pn({},null===e||void 0===e?void 0:e[i]),{},{input_only:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.input_only)})))}))}})]}))})]})})]}),(0,S.jsx)(y.Z,{light:!0})]},i)}));return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(ue.Z,{children:"Inputs"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Choose which upstream block to use as inputs when interpolating data into ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:ge}),"\u2019s (current block) credentials (aka config) and decorated functions."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["If ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:ge})," (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."]})}),Y.O.DESTINATIONS===xe&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Upstream blocks can still be selected to have its data ingested. This is toggled and configured in the ",(0,S.jsx)(P.Z,{bold:!0,primary:!0,preventDefault:!0,onClick:function(){return Fn((function(){return{selectedMainNavigationTab:ae.uK.STREAMS}}))},children:"Streams"})," section."]})})]}),(0,S.jsx)(y.Z,{light:!0}),e]})}}else{if(ae.uK.STREAMS===En&&Kn)return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(ue.Z,{children:"Fetch streams to start set up"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Add streams and configure them by first fetching the available streams from ",Me,"."]})})]}),(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.rH,{size:2*w.iI}),large:!0,loading:Xn,onClick:function(){return Qn()},primary:!0,children:"Fetch streams"})]});if(ae.uK.SYNC===En)return(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(C.ZP,{children:"Coming soon"})});if(ae.uK.OVERVIEW===En)return(0,S.jsx)(xn,{block:ke,blocksMapping:Ue,onChangeBlock:p,selectedStreamMapping:z,setSelectedMainNavigationTab:function(e){return Fn((function(n){return{selectedMainNavigationTab:e}}))},setSelectedStreamMapping:q,streamMapping:Je,updateStreamsInCatalog:Le})}}),[ke,fe,be,ge,He,Ue,Re,xe,Me,Qn,Xn,Kn,p,ce,En,Tn,z,Mn,Ne,Fn,q,Je,Le]),Et=(0,f.useMemo)((function(){return xt?(0,S.jsx)(C.ZP,{bold:!0,children:"Documentation"}):gt?(0,S.jsx)(C.ZP,{bold:!0,children:"Bulk edit stream properties"}):jt?(0,S.jsx)(C.ZP,{bold:!0,children:"Bulk edit streams"}):void 0}),[xt,gt,jt]),Tt=(0,f.useMemo)((function(){if(gt||jt)return(0,S.jsx)(qe,{ref:A,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(x.Z,{checked:Q,label:"Clear selection and values after applying changes",onClick:function(){return J((function(e){return!e}))}})}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};gt?e=(0,de.Kq)(z,wn,F):jt&&(e=(0,de.bX)(z,F)),Le((0,de.eH)(e),(function(e){return null===p||void 0===p?void 0:p(e)})),Q&&(U({}),_n({}),q(null))},primary:!0,children:"Apply bulk changes"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(D.ZP,{fullWidth:!0,onClick:function(){U({}),_n({}),q(null)},secondary:!0,children:"Clear"})]})]})})}),[F,Q,wn,gt,jt,p,A,z,U,_n,q]),Mt=(0,f.useMemo)((function(){if(xt)return(0,S.jsx)(Ve,{children:(0,S.jsxs)(O.Z,{p:w.cd,children:[!Be&&(0,S.jsx)(G.Z,{}),Ge&&(0,S.jsx)(he.Z,{children:Ge.replace(/\<br \/\>/g,"\n\n")})]})});if(gt){var e=(0,de.zB)({parent_stream:Tn,stream:En,tap_stream_id:En},Je);return(0,S.jsx)(hn,{attributesMapping:F,block:ke,blocksMapping:Ue,highlightedColumnsMapping:wn,selectedStreamMapping:z,setAttributesMapping:U,setHighlightedColumnsMapping:_n,setSelectedStreamMapping:q,stream:e,streamMapping:Je,updateStreamsInCatalog:Le})}return jt?(0,S.jsx)(pn,{attributesMapping:F,selectedStreamMapping:z,setAttributesMapping:U,setSelectedStreamMapping:q,streamMapping:Je}):void 0}),[F,ke,Ue,Be,Ge,wn,xt,gt,jt,z,U,_n,q,Je,Le]),Dt=(0,f.useMemo)((function(){var e=[{label:function(){return ge}}];return Ee&&e.push({bold:!En,label:function(){return Ee}}),En&&e.push({bold:!0,label:function(){return ae.TD[En]||En}}),(0,S.jsx)(oe.Z,{breadcrumbs:e,noMarginLeft:!0})}),[ge,Ee,En]),Bt=(0,f.useMemo)((function(){return(te-tt-On)/2}),[tt,te]),Rt=(0,f.useMemo)((function(){return(0,S.jsx)(un,{block:ke,blocksMapping:Ue,height:tt-rt,onChangeBlock:p,searchText:$n,setSelectedMainNavigationTab:Fn,setSelectedSubTab:function(e){return Fn((function(n){return Pn(Pn({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:An,streamsFetched:Gn,updateStreamsInCatalog:Le,width:it-(vn+(yt?0:ln))})}),[yt,ln,vn,ke,Ue,rt,tt,p,$n,Fn,An,Gn,Le,it]);return(0,S.jsxs)(Ye,{maxWidth:it,children:[(0,S.jsx)(Xe,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{children:Dt}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(P.Z,{href:"https://docs.mage.ai",inline:!0,noOutline:!0,openNewWindow:!0,children:(0,S.jsx)(V.$l,{default:!0,size:2*w.iI})}),(0,S.jsx)(O.Z,{mr:2}),m&&(0,S.jsx)(D.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){null===m||void 0===m||m()},children:(0,S.jsx)(V.x8,{default:!0,size:2*w.iI})})]})]})}),(0,S.jsxs)(jn.Z,{after:Mt,afterFooter:Tt,afterFooterBottomOffset:Bt,afterHeader:(0,S.jsx)(O.Z,{ref:R,px:1,children:Et}),afterHeightOffset:0,afterHeaderOffset:0,afterHidden:yt,afterInnerHeightMinus:48+(Tt&&ct||0),afterMousedownActive:an,afterWidth:ln,before:Hn,beforeHeightOffset:0,beforeMousedownActive:gn,beforeWidth:vn,contained:!0,headerOffset:rt,height:tt,hideAfterCompletely:!Mt||jt&&!(null!==We&&void 0!==We&&We.length),inline:!0,mainContainerHeader:nt,mainContainerRef:M,setAfterHidden:vt,setAfterMousedownActive:dn,setAfterWidth:cn,setBeforeMousedownActive:Zn,setBeforeWidth:mn,uuid:$e,children:[bt&&kt,!bt&&It,ae.uK.CONFIGURATION===En&&ae.tw.CREDENTIALS===Mn&&St,ae.uK.STREAMS===En&&!Kn&&Rt]})]})},wn=t(10553),_n=t(29618),Sn=t(50724),In=t(70374),En=t(72098),Tn=t(77417),Mn=t(39643),Dn=t(87848),Bn=t(58325),Rn=t(44688);function An(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Nn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?An(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):An(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ln=1.5*w.iI;var Fn=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,o=e.executePipeline,r=e.interruptKernel,u=e.isPipelineExecuting,c=e.kernel,s=e.pipeline,a=e.restartKernel,d=e.savePipelineContent,p=e.scrollTogether,v=(e.setActiveSidekickView,e.setMessages),h=e.setScrollTogether,m=e.setSideBySideEnabled,b=e.sideBySideEnabled,g=e.updatePipelineMetadata,x=(0,f.useState)(null),j=x[0],y=x[1],k=(0,f.useRef)(null),P=(0,f.useRef)(null),w=(0,f.useRef)(null),_=(0,f.useRef)(null),I=(0,f.useRef)(null),E=(0,Tn.Z)(),T=E.featureEnabled,M=E.featureUUIDs,D=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,J.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,J.Y6)(),type:H.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,Bn.V5)()?Mn.RJ:Mn.hE,Mn.SS]],label:function(){return"Save pipeline"},onClick:function(){return d()},uuid:"save_pipeline"}],B=(0,f.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[Mn.kA],[Mn.kA]],onClick:function(){return r()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[Mn.t_[Mn.OC]],[Mn.t_[Mn.OC]]],onClick:function(){return a()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return v((function(e){return Object.keys(e).reduce((function(e,n){return Nn(Nn({},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===s||void 0===s?void 0:s.type)===H.qL.STREAMING&&e.push({label:function(){return"Execute pipeline"},onClick:function(){return o()},uuid:"Execute pipeline"}),e}),[n,o,r,u,null===s||void 0===s?void 0:s.type,a,v]),R=(0,f.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===s||void 0===s?void 0:s.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"}]}),[s]),A=(0,f.useMemo)((function(){return[{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(V.vR,{success:!b}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{noWrapping:!0,children:"Show output below block"})]})},onClick:function(){m(!1)},uuid:"Show output next to code"},{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(V.lx,{success:b}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{noWrapping:!0,children:"Show output next to code (beta)"})]})},onClick:function(){m(!0)},uuid:"Show output next to code"},{disabled:!b,label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[p?(0,S.jsx)(V.Jr,{}):(0,S.jsx)("div",{style:{width:Ln}}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{disabled:!b,noWrapping:!0,children:"Scroll output alongside code (beta)"})]})},onClick:function(){return h(!p)},uuid:"Scroll output alongside code"}]}),[p,h,m,b]),N=(0,f.useMemo)((function(){var e=[{label:function(){return"Open compute management"},linkProps:{href:"/compute"},uuid:"Open compute management"}];return En.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===s||void 0===s?void 0:s.name,H.fj[En.U.PYSPARK])},uuid:"Switch to PySpark kernel"}):En.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===s||void 0===s?void 0:s.name,H.fj[En.U.PYTHON3])},uuid:"Switch to Python kernel"}),e}),[c,s,g]),L="FileHeaderMenu/index",F=(0,Rn.y)(),U=F.registerOnKeyDown,z=F.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){z(L)}}),[z,L]),U(L,(function(e,n,t){null!==j&&(n[Mn.QK]?y((function(e){return 0===e?2:e-1})):n[Mn.DY]&&y((function(e){return 2===e?0:e+1})))}),[j,y]),(0,S.jsx)(Sn.Z,{onClickOutside:function(){return y(null)},open:!0,style:{position:"relative"},children:(0,S.jsxs)(Z.ZP,{children:[(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Dn.u,{highlighted:0===j,onClick:function(){return y((function(e){return 0===e?null:0}))},onMouseEnter:function(){return y((function(e){return null!==e?0:null}))},ref:k,children:(0,S.jsx)(C.ZP,{children:"File"})}),(0,S.jsx)(In.Z,{items:D,onClickCallback:function(){return y(null)},open:0===j,parentRef:k,uuid:"FileHeaderMenu/file_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Dn.u,{highlighted:1===j,onClick:function(){return y((function(e){return 1===e?null:1}))},onMouseEnter:function(){return y((function(e){return null!==e?1:null}))},ref:P,children:(0,S.jsx)(C.ZP,{children:"Run"})}),(0,S.jsx)(In.Z,{items:B,onClickCallback:function(){return y(null)},open:1===j,parentRef:P,uuid:"FileHeaderMenu/run_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Dn.u,{highlighted:2===j,onClick:function(){return y((function(e){return 2===e?null:2}))},onMouseEnter:function(){return y((function(e){return null!==e?2:null}))},ref:w,children:(0,S.jsx)(C.ZP,{children:"Edit"})}),(0,S.jsx)(In.Z,{items:R,onClickCallback:function(){return y(null)},open:2===j,parentRef:w,uuid:"FileHeaderMenu/edit_items"})]}),H.qL.INTEGRATION!==(null===s||void 0===s?void 0:s.type)&&(null===T||void 0===T?void 0:T(M.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Dn.u,{highlighted:3===j,onClick:function(){return y((function(e){return 3===e?null:3}))},onMouseEnter:function(){return y((function(e){return null!==e?3:null}))},ref:_,children:(0,S.jsx)(C.ZP,{children:"View"})}),(0,S.jsx)(In.Z,{items:A,onClickCallback:function(){return y(null)},open:3===j,parentRef:_,uuid:"FileHeaderMenu/viewItems"})]}),(null===T||void 0===T?void 0:T(M.COMPUTE_MANAGEMENT))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Dn.u,{highlighted:4===j,onClick:function(){return y((function(e){return 4===e?null:4}))},onMouseEnter:function(){return y((function(e){return null!==e?4:null}))},ref:I,children:(0,S.jsx)(C.ZP,{children:"Compute"})}),(0,S.jsx)(In.Z,{items:N,onClickCallback:function(){return y(null)},open:4===j,parentRef:I,uuid:"FileHeaderMenu/viewItems"})]}),t]})})},Un=t(90758),Hn=t(89706),zn=t(67355),Gn=t(70613),Wn=t(21764),Kn=t(28071),Vn=t(65956),qn=t(23657),Yn=t(8970),Xn=p.default.div.withConfig({displayName:"indexstyle__MenuStyle",componentId:"sc-1bixraz-0"})(["",";border-radius:","px;max-height:","px;min-width:","px;overflow:auto;position:absolute;right:0;",""],Ge.w5,_e.n_,60*w.iI,70*w.iI,(function(e){return"\n background-color: ".concat((e.theme.background||we.Z.background).panel,";\n border: 1px solid ").concat((e.theme.interactive||we.Z.interactive).defaultBorder,";\n ")}));function Qn(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 Jn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $n=2*w.iI,et={default:!0,monospace:!0,small:!0};var nt,tt,it=function(){var e=(0,f.useRef)(null),n=(0,ee.VI)(null,{},[],{uuid:"ClusterSelection"}),t=(0,r.Z)(n,1)[0],i=(0,f.useState)(!1),o=i[0],l=i[1],u=(0,qn.Z)({clustersRefreshInterval:5e3,includeAllStates:o}),c=(u.activeCluster,u.clusters),s=u.clustersLoading,a=u.computeService,d=u.fetchComputeClusters,p=(0,f.useState)(null),h=p[0],m=p[1],b=(0,v.Db)(K.ZP.compute_clusters.compute_services.useCreate(null===a||void 0===a?void 0:a.uuid),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return t({errors:n,response:e})}})}}),g=(0,r.Z)(b,2),x=g[0],j=g[1].isLoading,k=(0,v.Db)((function(e){return K.ZP.compute_clusters.compute_services.useUpdate(null===a||void 0===a?void 0:a.uuid,null===e||void 0===e?void 0:e.id)({compute_cluster:(0,je.GL)(e,["active"])})}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){d(),m(null)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,o=n.message,r=n.type;Wn.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Wn.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),P=(0,r.Z)(k,2),_=P[0],I=P[1].isLoading,E=(0,f.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)||0}),[c]),T=(0,f.useMemo)((function(){return(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.NO,{size:$n}),compact:E>=1,loading:j,onClick:function(){return x()},primary:!0,small:E>=1,children:"Launch cluster"})}),[E,x,j]),M=(0,f.useMemo)((function(){var n,t,i,o,r=h||{message:null,x:0,y:0},l=r.message,u=r.x,c=r.y,s=(0,S.jsx)(C.ZP,{default:!0,small:!0,children:l});return(0,S.jsx)("div",{ref:e,style:{hidden:!h,left:u-((null===e||void 0===e||null===(n=e.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.width)||0),maxWidth:30*w.iI,position:"fixed",top:c-((null===e||void 0===e||null===(i=e.current)||void 0===i||null===(o=i.getBoundingClientRect())||void 0===o?void 0:o.height)||0),zIndex:9999},children:(0,S.jsx)(Vn.Z,{dark:!0,noPadding:!0,children:(0,S.jsxs)(O.Z,{p:1,children:[I&&(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(G.Z,{inverted:!0,small:!0}),(0,S.jsx)(O.Z,{mr:1}),s]}),!I&&s]})})})}),[I,h,m]);return(0,S.jsxs)(S.Fragment,{children:[M,(0,S.jsxs)(Xn,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,S.jsxs)(Z.ZP,{flexDirection:"column",children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:s?"Clusters":(0,J._6)("cluster",E,!0)}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Pe.Z,{checked:o,compact:!0,onCheck:function(e){return l(e(o))}}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{default:o,muted:!o,small:!0,children:"Include terminated clusters"})]})]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,small:!0,children:[E>=1&&"Click a cluster to activate and use it for compute.",!E&&"Launch a new cluster to use for compute."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.AP,{default:!0}),default:!0,linkProps:{href:"/compute",as:"/compute?tab=".concat(Yn.uK.CLUSTERS)},noBackground:!0,noBold:!0,noBorder:!0,target:"_blank",noPadding:!0,openNewWindow:!0,small:!0,children:"Open compute mangement"})})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),E>=1&&(0,S.jsx)(Z.ZP,{flexDirection:"column",children:T})]})}),(0,S.jsx)(y.Z,{light:!0}),(0,S.jsx)(Sn.Z,{onClickOutside:function(){I||m(null)},open:!0,children:(0,S.jsx)(Ze.Z,{columnFlex:[null,null,null],columns:[{uuid:"ID"},{uuid:"State"},{label:function(){return""},rightAligned:!0,uuid:"Active"}],onClickRow:function(e,n){var t;if(!I){var i,o=null===c||void 0===c?void 0:c[e],r=null===o||void 0===o||null===(t=o.status)||void 0===t?void 0:t.state;null!==o&&void 0!==o&&o.active?i="Cluster ".concat(null===o||void 0===o?void 0:o.id," is already active."):[Kn.X.RUNNING,Kn.X.WAITING].includes(r)?(i="Activating cluster ".concat(null===o||void 0===o?void 0:o.id,"."),_(Jn(Jn({},o),{},{active:!0}))):i="\n Cluster ".concat(null===o||void 0===o?void 0:o.id," must be in a\n ").concat((0,J.vg)(Kn.X.WAITING)," or\n ").concat((0,J.vg)(Kn.X.RUNNING),"\n state to be activated and used for compute.\n "),m({message:i,x:n.clientX,y:n.clientY})}},rows:null===c||void 0===c?void 0:c.map((function(e){var n=e.active,t=e.id,i=e.status,o=null===i||void 0===i?void 0:i.state;return[(0,f.createElement)(C.ZP,Jn(Jn({},et),{},{key:"id"}),t),(0,S.jsx)(C.ZP,Jn(Jn({},et),{},{danger:[Kn.X.TERMINATED_WITH_ERRORS].includes(o),default:[Kn.X.STARTING].includes(o),muted:[Kn.X.TERMINATED].includes(o),success:[Kn.X.RUNNING,Kn.X.WAITING].includes(o),warning:[Kn.X.TERMINATING].includes(o),children:null!==i&&void 0!==i&&i.state?(0,J.vg)(null===i||void 0===i?void 0:i.state):null===i||void 0===i?void 0:i.state})),(0,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(V.Fs,{muted:!n,size:$n,success:n})},"active")]})),stickyHeader:!0,uuid:"ClusterSelection"})}),!s&&0===E&&(0,S.jsx)(O.Z,{p:w.cd,children:T}),s&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(G.Z,{inverted:!0,small:!0})})]})]})};!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(nt||(nt={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(tt||(tt={}));var ot,rt=t(89308),lt=t(89515),ut=t(78688),ct=t(98464);!function(e){e.EMR="emr"}(ot||(ot={}));var st=t(26032),at=t(97133),dt=t(74260),pt=t(15610),ft=t(89538);function vt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ht(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mt=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.selectedFilePath),c=e.setErrors,s=e.setRunningBlocks,a=e.updatePipelineMetadata,d=(0,h.useRouter)(),m=(0,Tn.Z)(),b=(m.featureEnabled,m.featureUUIDs,m.sparkEnabled),g=(0,qn.Z)({clustersRefreshInterval:5e3,computeServiceRefreshInterval:5e3,connectionsRefreshInterval:5e3}),x=g.activeCluster,y=g.clusters,_=(g.clustersLoading,g.computeService),I=g.computeServiceUUIDs,E=g.connections,T=g.connectionsLoading,M=g.fetchAll,D=g.fetchComputeClusters,B=(g.setupComplete,(0,f.useContext)(p.ThemeContext)),R=i||{},A=R.alive,N=R.usage,L=(0,f.useState)(!1),U=L[0],z=L[1],W=(0,f.useState)(""),q=W[0],Y=W[1],X=(0,f.useState)(ot.EMR),Q=X[0],ee=(X[1],(0,f.useState)(!1)),ne=ee[0],te=ee[1],ie=(0,f.useState)(!1),oe=ie[0],re=ie[1],le=(0,f.useState)(!1),ue=le[0],ce=le[1],se=(0,f.useState)(!1),ae=se[0],de=se[1],pe=(0,f.useRef)(null),fe=K.ZP.clusters.detail(Q,{},{revalidateOnFocus:!1}),ve=fe.data,he=fe.mutate,me=(0,f.useMemo)((function(){var e;return(null===ve||void 0===ve||null===(e=ve.cluster)||void 0===e?void 0:e.clusters)||[]}),[ve]),be=(0,f.useMemo)((function(){return(0,Ie.sE)(me,(function(e){return e.is_active}))}),[me]),ge=(0,v.Db)(K.ZP.clusters.useUpdate(Q),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){he()},onErrorCallback:function(e,n){return c({errors:n,response:e})}})}}),xe=(0,r.Z)(ge,1)[0],ye=K.ZP.spark_applications.list({},{},{pauseFetch:!b}).data,ke=(0,f.useMemo)((function(){return null===ye||void 0===ye?void 0:ye.spark_applications}),[ye]);(0,f.useEffect)((function(){null!==l&&void 0!==l&&l.uuid&&Y(l.uuid)}),[null===l||void 0===l?void 0:l.uuid]);var Ze="KernelStatus",Pe=(0,Rn.y)(),Oe=Pe.registerOnKeyDown,Ce=Pe.unregisterOnKeyDown;(0,f.useEffect)((function(){return function(){Ce(Ze)}}),[Ce,Ze]),Oe(Ze,(function(e,n,t){U&&String(t[0])===String(Mn.Uq)&&String(t[1])!==String(Mn.zX)&&((null===l||void 0===l?void 0:l.uuid)===q?e.target.blur():(a(q),z(!1)))}),[U,q,z,a]);var _e=(0,f.useMemo)((function(){return null===N||void 0===N?void 0:N.pid}),[null===N||void 0===N?void 0:N.pid]),Se=(0,ct.Z)(_e),Ee=(0,ft.dd)((function(){return(0,S.jsx)(lt.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:De,onClick:function(){(0,yn.t8)(yn.DU,1),De()},subtitle:"You may need to refresh your page to continue using the notebook. Unexpected kernel restarts may be caused by your kernel running out of memory.",title:"The kernel has restarted",width:34*w.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),Te=(0,r.Z)(Ee,2),Me=Te[0],De=Te[1];(0,f.useEffect)((function(){var e=(0,yn.U2)(yn.DU,0);_e!==Se&&t&&!e&&(Me(),s([]))}),[t,_e,Se,s,Me]);var Be=(0,f.useMemo)((function(){return[H.qL.PYTHON,H.qL.PYSPARK].includes(null===l||void 0===l?void 0:l.type)}),[l]),Ae=(0,f.useMemo)((function(){return(0,S.jsx)(j.Z,{color:t?(B||we.Z).borders.info:A?(B||we.Z).borders.success:(B||we.Z).borders.danger,size:w.iI})}),[A,t,B]),Ne=(0,v.Db)((function(e){return K.ZP.compute_clusters.compute_services.useUpdate(null===_||void 0===_?void 0:_.uuid,null===e||void 0===e?void 0:e.id)({compute_cluster:(0,je.GL)(e,["active"])})}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){D()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,o=n.message,r=n.type;Wn.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Wn.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),Le=(0,r.Z)(Ne,2),Fe=Le[0],Ue=(Le[1].isLoading,(0,f.useMemo)((function(){if(!b||!Be||I.AWS_EMR!==(null===_||void 0===_?void 0:_.uuid)||H.qL.PYSPARK!==(null===l||void 0===l?void 0:l.type))return null;var e=null===E||void 0===E?void 0:E.find((function(e){var n=e.uuid;return dt.IK.OBSERVABILITY===n}));if(!e)return null;var n=e.name,t=e.state,i=e.status_calculated,o=e.uuid,r=[st.i.ACTIVE].includes(t),u=([st.i.INACTIVE].includes(t),[dt.br.COMPLETED].includes(i)),c={muted:!0,warning:!1},s=n||o;u&&(r?(s="Observability enabled",c.muted=!1):s="SSH tunnel not connected");var a=(0,S.jsx)(Sn.Z,{onClickOutside:function(e){(0,Re.j)(e),de(!1)},open:ae,children:(0,S.jsx)(Xn,{children:(0,S.jsx)(rt.Z,{actionsOnly:u,computeService:_,computeConnections:[e],contained:!1,hideDetails:!0,fetchAll:M,onClickStep:function(e){d.push("/compute?tab=".concat(e))},small:!0})})}),p=(0,S.jsx)(V.Fs,{danger:[dt.br.ERROR].includes(i),muted:[dt.br.INCOMPLETE].includes(i),success:u&&r});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(F.ZP,ht(ht({beforeElement:p,blackBorder:!0,compact:!0,inline:!0,noHover:T,onClick:function(e){(0,Re.j)(e),ae||de(!0),ce(!1)},uuid:"Pipeline/ComputeConnectionStatus"},c),{},{children:s})),a]})}),[ae,_,E,T,M,l,ce,de,Be])),He=(0,f.useMemo)((function(){if(!b||!Be)return null;var e,n,t,i;if(I.AWS_EMR===(null===_||void 0===_?void 0:_.uuid)){var o,r=null===_||void 0===_||null===(o=_.setup_steps)||void 0===o?void 0:o.find((function(e){var n=e.uuid;return dt.IK.SETUP===n})),u=null===r||void 0===r?void 0:r.status_calculated;if(H.qL.PYSPARK!==(null===l||void 0===l?void 0:l.type))return null;if(x){var c,s=null===x||void 0===x||null===(c=x.status)||void 0===c?void 0:c.state;t=(0,S.jsxs)(C.ZP,{monospace:!0,children:[null===x||void 0===x?void 0:x.id," ",s&&![Kn.X.RUNNING,Kn.X.WAITING].includes(s)&&(0,J.J3)(s)]}),i=(0,S.jsx)(V.Fs,{danger:[Kn.X.TERMINATED_WITH_ERRORS].includes(s),default:[Kn.X.STARTING].includes(s),muted:[Kn.X.TERMINATED].includes(s),success:[Kn.X.RUNNING,Kn.X.WAITING].includes(s),warning:[Kn.X.TERMINATING].includes(s)})}else u?(t=null!==y&&void 0!==y&&y.length?"Select a compute cluster":"Launch a new cluster",i=(0,S.jsx)(V.Fs,{warning:!0})):(e=(0,S.jsx)(Sn.Z,{onClickOutside:function(e){(0,Re.j)(e),ce(!1)},open:ue,children:(0,S.jsx)(Xn,{children:(0,S.jsx)(ut.Z,{contained:!1,onClickStep:function(e){d.push("/compute?tab=".concat(e))},setupSteps:null===_||void 0===_?void 0:_.setup_steps,small:!0})})}),n=function(e){(0,Re.j)(e),ue||ce(!0),de(!1)},t="Compute setup incomplete",i=(0,S.jsx)(V.uy,{danger:!0}));(x||u)&&(e=(0,S.jsx)(Sn.Z,{onClickOutside:function(e){(0,Re.j)(e),ce(!1)},open:ue,children:(0,S.jsx)(it,{})}),n=function(e){(0,Re.j)(e),ue||ce(!0),de(!1),de(!1)})}else if(I.STANDALONE_CLUSTER===(null===_||void 0===_?void 0:_.uuid))if(ye)if(null!==ke&&void 0!==ke&&ke.length){if((null===ke||void 0===ke?void 0:ke.length)>=1){var a,p,f=null===ke||void 0===ke?void 0:ke[0];t=[null===f||void 0===f?void 0:f.name,null===f||void 0===f||null===(a=f.attempts)||void 0===a||null===(p=a[0])||void 0===p?void 0:p.app_spark_version].filter((function(e){return e})).join(" "),i=(0,S.jsx)(V.Fs,{success:!0})}}else n=function(){return d.push("/compute")},t="Compute unavailable",i=(0,S.jsx)(V.Fs,{danger:!0});else t="Loading compute",i=(0,S.jsx)(G.Z,{inverted:!0,small:!0});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(F.ZP,ht(ht({beforeElement:i,blackBorder:!0,compact:!0,inline:!0,noHover:!ye||(null===ke||void 0===ke?void 0:ke.length)>=1,onClick:n,uuid:"Pipeline/ComputeStatus"},{muted:!1,warning:!1}),{},{children:t})),e]})}),[x,ue,y,_,I,ye,l,d,ce,de,ke,b,Be]),ze=(0,f.useMemo)((function(){return(0,S.jsx)("div",{ref:pe,style:{position:"relative"},children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(null===l||void 0===l?void 0:l.type)===H.qL.PYSPARK&&!b&&(0,S.jsxs)(O.Z,{mr:w.cd,children:[(0,S.jsxs)(P.Z,{muted:!!be,onClick:function(){return te(!0)},preventDefault:!0,sameColorAsText:!be,underline:!be,children:[be&&be.id,!be&&"Select cluster"]}),(0,S.jsx)(Sn.Z,{disableEscape:!0,onClickOutside:function(){return te(!1)},open:ne,children:(0,S.jsx)(In.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,o.Z)(me.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{muted:!t&&tt.WAITING!==i,children:n})}),t&&(0,S.jsx)(V.Jr,{size:2*w.iI,success:!0}),!t&&(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||tt.WAITING!==i?null:function(){return xe({cluster:{id:n}})},uuid:n}})))),onClickCallback:function(){return te(!1)},open:ne,parentRef:pe,uuid:"KernelStatus/select_cluster",width:40*w.iI})})]}),(0,S.jsx)(F.ZP,{beforeElement:Ae,blackBorder:!0,compact:!0,inline:!0,onClick:function(){return re(!0)},uuid:"Pipeline/KernelStatus/kernel",children:H.RH[(null===l||void 0===l?void 0:l.type)||H.qL.PYTHON]}),(0,S.jsx)(Sn.Z,{disableEscape:!0,onClickOutside:function(){return re(!1)},open:oe,children:(0,S.jsx)(In.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,o.Z)(Object.keys(H.a_).filter((function(e){return(null===l||void 0===l?void 0:l.type)!=e})).map((function(e){return{label:function(){return H.RH[e]||e},onClick:function(){return a(null===l||void 0===l?void 0:l.name,e)},uuid:e}})))),onClickCallback:function(){return re(!1)},open:oe,parentRef:pe,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*w.iI})})]})})}),[A,me,t,l,be,te,re,ne,oe,Ae,B,Fe,xe,a]);return(0,S.jsx)(at.rK,{relativePosition:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:(0,S.jsxs)(O.Z,{px:w.cd,children:[u&&(0,S.jsx)(P.Z,{noHoverUnderline:!0,noOutline:!0,onClick:u?function(){return(0,pt.u7)({file_path:null})}:null,preventDefault:!0,children:n}),!u&&(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[n,U&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(P.Z,{onClick:function(){a(q),z(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]})}),(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(k.Z,{alignItems:"center",children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[ze,Ue&&(0,S.jsx)(O.Z,{ml:1,children:Ue}),He&&(0,S.jsx)(O.Z,{ml:1,children:He})]})})})]})})},bt=t(48339),gt=t(17717),xt=t(12691),jt=t.n(xt),yt=t(65976),kt=t(57271),Zt=t(92709),Pt=p.default.div.withConfig({displayName:"indexstyle__ScrollbarContainerStyle",componentId:"sc-174iy66-0"})(["position:fixed;"," "," "," ",""],(function(e){return"\n border-radius: ".concat(_e.n_,"px;\n background: ").concat((e.theme.background||we.Z.background).scrollbarTrack,";\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Ge.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 ")})),Ot=p.default.div.withConfig({displayName:"indexstyle__ScrollCursorStyle",componentId:"sc-174iy66-1"})(["position:fixed;z-index:3;"," "," "," "," ",""],(function(e){return"\n border-radius: ".concat(_e.TR,"px;\n background: ").concat((e.theme.background||we.Z.background).scrollbarThumb,";\n\n &:hover {\n background: ").concat((e.theme.background||we.Z.background).scrollbarThumbHover,";\n }\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Ge.nn,"px;\n ")}),(function(e){return(null===e||void 0===e?void 0:e.selected)&&"\n background: ".concat((e.theme.background||we.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 ")})),Ct=t(74052),wt=t(61709);function _t(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function St(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_t(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_t(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,s=e.invisible,a=e.mainContainerRect,d=e.rightAligned,p=e.scrollTogether,v=e.setCursorHeight,h=(0,f.useRef)(null),m=(0,f.useRef)(null),b=((0,f.useMemo)((function(){return null===i||void 0===i?void 0:i.map((function(e){return e.uuid}))}),[i]),(0,f.useState)(null)),g=b[0],x=b[1],j=(0,f.useState)(null),y=j[0],k=j[1],Z=(0,f.useState)(null),P=(Z[0],Z[1]),O=(0,f.useState)(null),C=O[0],w=O[1],_=a||{},I=_.height,E=_.width,T=_.x,M=_.y,D=(0,f.useMemo)((function(){return(0,Ie.Sm)(g||[])}),[g]),B=(0,f.useCallback)((function(){return D>I?I*(I/D):0}),[I,D]),R=(0,f.useMemo)((function(){return B()}),[B]);(0,f.useMemo)((function(){v(R)}),[R,v]);var A=(0,f.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,f.useCallback)((function(){if(!u){var e=new CustomEvent(Zt.m$,{detail:{columnScrolling:r,refCursor:h,refCursorContainer:m,refsMappings:Object.values(c||{})}});window.dispatchEvent(e)}}),[r,u,c]);(0,f.useEffect)((function(){P(!0)}),[]);var L=(0,f.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,Ie.Sm)((null===o||void 0===o?void 0:o.slice(0,i))||[]),s=(0,Ie.Sm)(o||[])||0,a=(0,wt.IT)(o,s,I);return(c-(r-(null===l||void 0===l?void 0:l.y)))/s/(1-a)*((null===l||void 0===l?void 0:l.height)-(null===u||void 0===u?void 0:u.height))+(null===l||void 0===l?void 0:l.y)}),[]),F=(0,f.useCallback)((function(){var e=Object.values(c||{}),n=null===i||void 0===i?void 0:i.map((function(n){var t=(0,Ct.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(St(St({},y),{},{heights:n}));A(t)}N()}}),[i,L,r,N,c,y,x]);(0,f.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,f.useCallback)((function(){N(),F()}),[N,F]);(0,f.useEffect)((function(){return window.addEventListener(Zt.Qj,U),function(){window.removeEventListener(Zt.Qj,U)}}),[U]),(0,f.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(Zt.Em,e),function(){window.removeEventListener(Zt.Em,e)}}),[i,L,N,g,A]),(0,f.useEffect)((function(){u||F()}),[u,p,F]),(0,f.useEffect)((function(){var e=function(e){var n=e.detail;if(r===(null===n||void 0===n?void 0:n.columnIndex)){var t=L(St(St({},n),{},{heights:g}));A(t),N(),null!==n&&void 0!==n&&n.lockScroll&&k(n)}};return window.addEventListener(Zt.Wf,e),function(){window.removeEventListener(Zt.Wf,e)}}),[r,I,g,k,A,L,M]);var H=(0,f.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(p||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,p,A,E,T,M]),z=(0,f.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,f.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,f.useEffect)((function(){var e=function(){w(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,S.jsx)(Pt,{height:I,invisible:s,left:d?T+E-Ge.nn:void 0,ref:m,children:(0,S.jsx)(Ot,{height:R,invisible:s,onMouseDown:function(e){var n,t;return w({event:e,scrollTop:null===h||void 0===h||null===(n=h.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})},ref:h,selected:!!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})})},Et=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function Tt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Mt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Tt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Tt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Dt=p.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*w.iI),Bt=p.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var Rt=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,o=e.description,r=e.disableWordBreak,l=e.fullWidth,u=e.inputValue,c=e.inputWidth,s=e.invertedTheme,a=e.label,d=e.labelColor,p=e.menuOpen,v=void 0!==p&&p,h=e.monospace,m=e.muted,b=e.onClick,g=e.notRequired,x=e.selectedTextProps,j=e.small,y=e.stacked,w=e.suffixValue,_=e.tooltipProps,I=e.value,E=(0,be.Z)(e,Et),T=(0,f.useRef)(null),M=(0,f.useState)(!1),D=M[0],B=M[1],R=(0,f.useState)(!1),A=R[0],N=R[1],L=a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{bold:t,color:d,inverted:s,lineHeight:20,monospace:h,muted:m,small:j,children:a}),_&&(0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(Oe.Z,Mt({muted:!0},_))})]}),F=(0,S.jsxs)(k.Z,{flex:l?"1":"none",children:[I&&(0,S.jsx)(P.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){b(),T.current&&T.current.focus(),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,S.jsx)(C.ZP,Mt(Mt({inverted:s,muted:m},x),{},{disableWordBreak:r,monospace:h,small:j,width:c,children:I}))}),(0,S.jsx)(W.Z,Mt(Mt({},E),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:s,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:j,value:u,visible:!I}))]}),U=o&&(0,S.jsx)(Bt,{children:(0,S.jsx)(C.ZP,{dangerouslySetInnerHTML:{__html:o},monospace:h,muted:!0,small:j})}),H=(0,f.useMemo)((function(){return(0,S.jsx)(C.ZP,{default:!0,small:j,children:w})}),[j,w]);return(0,S.jsxs)(S.Fragment,{children:[y&&(0,S.jsxs)(S.Fragment,{children:[L&&(0,S.jsxs)(Dt,{children:[(0,S.jsx)(Z.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,S.jsxs)(Z.ZP,{fullWidth:l,children:[F,w&&H]})]}),!y&&(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,S.jsxs)(S.Fragment,{children:[L,(0,S.jsx)(O.Z,{ml:1})]}),F,w&&H]}),A&&!D&&!I&&!v&&!g&&(0,S.jsx)(C.ZP,{danger:!0,small:j,children:"This field is required."})]})},At=t(53779);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 Lt(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 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,f.useState)(!1),s=c[0],a=c[1],d=(0,f.useState)(null),p=d[0],v=d[1],h=(0,f.useMemo)((function(){var e,n,t=null===(e=(0,Ie.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(Lt(Lt({},e),{},{children:t}))})),i}),[o]),m=(0,f.useMemo)((function(){return(0,Ie.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,S.jsxs)(At.eD,{children:[(0,S.jsxs)(At.X$,{children:[(0,S.jsx)(k.Z,{alignItems:"center",children:(0,S.jsx)(C.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new dbt model":"Select dbt model or snapshot file"})}),(0,S.jsx)(D.ZP,{iconOnly:!0,onClick:r,children:(0,S.jsx)(V.x8,{muted:!0})})]}),t&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(At.nF,{children:(0,S.jsx)(Rt,{dynamicSizing:!0,inputValue:i,label:"Model name (cannot be changed):",labelColor:we.Z.accent.dbt,notRequired:!0,onBlur:function(){a(!1)},onChange:function(e){u(e.target.value),e.preventDefault()},onClick:function(){a(!0)},onFocus:function(){a(!0)},placeholder:"Enter name",required:!0,stacked:!0,suffixValue:".".concat(g.t6.SQL),value:!s&&i})}),(0,S.jsxs)(At.nF,{children:[(0,S.jsx)(C.ZP,{bold:!0,color:we.Z.accent.dbt,children:"Select folder location:"}),(0,S.jsx)(C.ZP,{bold:!0,muted:!p,children:p?"dbt".concat(gt.sep).concat(p):"Choose folder below"})]})]}),(0,S.jsx)(At.C,{children:(0,S.jsx)(wn.Z,{allowSelectingFolders:t,disableContextMenu:!0,files:h,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)}))):!!m[e]||!(null!==n&&void 0!==n&&n.length)&&!e.match(new RegExp(".".concat(g.t6.SQL,"$")))},openFile:l,selectFile:v,uncollapsed:!0,useRootFolder:!0})}),t&&(0,S.jsx)(At.iW,{children:(0,S.jsx)(D.ZP,{backgroundColor:i&&p?we.Z.accent.dbt:we.Z.monotone.grey500,disabled:!i||!p,onClick:function(){return l(p)},padding:"6px 8px",children:"Create model"})})]})},Ut=t(32013),Ht=t(98777),zt=t(39457);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 Wt(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 Kt="4px",Vt={lightBackground:!0,muted:!0,relativePosition:!0},qt=[Ce.Zj.BIGQUERY,Ce.Zj.DELTA_LAKE_S3];var Yt=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,o=e.isLoadingUpdateDestinationBlockState,u=e.loadSampleData,c=e.source,s=e.stream,a=e.streams,d=e.updateAllStreams,p=e.updateDestinationBlockState,v=e.updateMetadataForColumns,h=e.updateSchemaProperty,m=e.updateStream,b=(0,f.useRef)(null),g=s.bookmark_properties,j=s.destination_table,y=void 0===j?"":j,P=s.key_properties,_=s.metadata,I=s.partition_keys,E=s.replication_method,T=s.run_in_parallel,M=s.schema.properties,B=s.tap_stream_id,R=s.unique_constraints,A=s.unique_conflict_method,N=(0,f.useState)(y),L=N[0],F=N[1],U=(0,f.useState)(!1),H=U[0],G=U[1],K=(0,f.useState)(null),V=K[0],q=K[1],Y=(0,f.useState)(!!t),X=Y[0],Q=Y[1],$=(0,f.useState)((0,l.Z)({},B,n||{})),ee=$[0],ne=$[1],te=(0,ct.Z)(B);(0,f.useEffect)((function(){te!==B&&(F(y),q(null))}),[y,E,B,te,A]),(0,f.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[B];(null===g||void 0===g?void 0:g.length)>0&&((0,je.Qr)(e)||!(0,je.Xy)(n,e))&&ne((function(e){return Wt(Wt({},e),{},(0,l.Z)({},B,n))}))}),[null===g||void 0===g?void 0:g.length,n,B]);var ie=(0,f.useMemo)((function(){return(0,Ie.HK)(_,(function(e){return e.breadcrumb.join("/")}))}),[_]),oe=(0,f.useMemo)((function(){var e;return null===(e=(0,Ie.sE)(_,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[_]),re=(0,f.useMemo)((function(){return oe[Ce.fe.KEY_PROPERTIES]||[]}),[oe]),le=(0,f.useMemo)((function(){return oe[Ce.fe.REPLICATION_KEYS]||[]}),[oe]),ce=qt.includes(t),ae=a.length>1,de=(0,f.useCallback)((function(e){var n=Wt({},null===ee||void 0===ee?void 0:ee[B]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return Wt(Wt({},e),{},(0,l.Z)({},B,Wt({},n)))})),p({block:{bookmark_values:n,destination_table:L,tap_stream_id:B}})}),[ee,L,B,p]),pe=(0,f.useMemo)((function(){var e=[],n=[],i=(0,Ie.mr)(Object.entries(M)).map((function(i,o){var l=(0,r.Z)(i,2),u=l[0],c=l[1],s=c.anyOf,a=void 0===s?[]:s,p=c.format,f=c.type,b=void 0===f?[]:f,j=new Set(Array.isArray(b)?b:[b]),y=new Set(j);a.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){j.add(e),y.add(e)})):(j.add(t),y.add(t),n&&y.add(n))}));var _=Array.from(j);p&&y.add(p);var E=(ie["properties/".concat(u)]||{}).metadata,T=(E.inclusion,E.selected);e.push(T),n.push(u);var M=Ce.D5.reduce((function(e,n){return _.indexOf(n)>=0||Ce.Xv===String(n)&&Ce.zS.DATE_TIME===p||Ce.zS.UUID===String(n)&&Ce.zS.UUID===p?e:e.concat((0,S.jsx)("option",{value:n,children:n},n))}),[]),A=_.findIndex((function(e){return e===Ce.RL.STRING})),N=[(0,S.jsx)(x.Z,{checked:T,onClick:function(){v(B,[u],{selected:!T})}},"".concat(B,"/").concat(u,"/selected")),(0,S.jsx)(C.ZP,{children:u},"".concat(B,"/").concat(u,"/name")),(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:_.map((function(e,n){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{border:!0,label:p&&Ce.RL.STRING===e&&A===n?Ce.eL[p]:e,onClick:function(){var n={format:p,type:_.filter((function(n){return n!==e}))};Ce.zS.DATE_TIME!==p&&Ce.zS.UUID!==p||Ce.RL.STRING!==e||(n.format=null),h(B,u,n)},small:!0})},"".concat(B,"/").concat(u,"/").concat(e,"/").concat(n,"/chip"))}))})}),M.length>=1&&(0,S.jsxs)(z.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:p,type:_};Ce.Xv===String(n)?(t.format=Ce.zS.DATE_TIME,t.type.push(Ce.RL.STRING)):Ce.zS.UUID===String(n)?(t.format=Ce.zS.UUID,t.type.push(Ce.RL.STRING)):t.type.push(n),h(B,u,t)},primary:!0,small:!0,value:"",width:10*w.iI,children:[(0,S.jsx)("option",{value:""}),M]})]},"".concat(B,"/").concat(u,"/type")),(0,S.jsx)(x.Z,{checked:!(null===R||void 0===R||!R.includes(u)),disabled:re.length>=1&&!re.includes(u),onClick:re.length>=1&&!re.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(u)?e.unique_constraints=(0,Ie.Od)(e.unique_constraints,(function(e){return u===e})):e.unique_constraints=[u].concat(e.unique_constraints||[]),e}))}},"".concat(B,"/").concat(u,"/unique")),(0,S.jsx)(x.Z,{checked:!(null===g||void 0===g||!g.includes(u)),disabled:le.length>=1&&!le.includes(u),onClick:le.length>=1&&!le.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(u)?(de(u),e.bookmark_properties=(0,Ie.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),e}))}},"".concat(B,"/").concat(u,"/bookmark")),(0,S.jsx)(x.Z,{checked:!(null===P||void 0===P||!P.includes(u)),onClick:function(){return m(B,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(u)?e.key_properties=(0,Ie.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(ce){var L=t!==Ce.Zj.DELTA_LAKE_S3,F=L&&(re.includes(u)||!y.has(Ce.zS.DATE_TIME));N.push((0,S.jsx)(x.Z,{checked:!(null===I||void 0===I||!I.includes(u)),disabled:F,onClick:F?null:function(){return m(B,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(u)?e.partition_keys=(0,Ie.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(ae){var U=V===o;N.push((0,S.jsx)(D.ZP,{compact:!0,disabled:U,onClick:function(){q(o),setTimeout((function(){return q(null)}),2e3),d((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==B&&null!==e&&void 0!==e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[u]){var i,o,r,l,c,s,a,d,f;e.schema.properties[u]={format:p||null,type:_};var v=null===(i=(0,Ie.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[Ce.fe.REPLICATION_KEYS]||[],m=v[Ce.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,Ie.Od)(e.unique_constraints,(function(e){return u===e}))):e.unique_constraints=[u].concat(e.unique_constraints||[]),null===g||void 0===g||!g.includes(u)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(u)||!h.includes(u)&&0!==h.length?null!==g&&void 0!==g&&g.includes(u)||null===e||void 0===e||null===(c=e.bookmark_properties)||void 0===c||!c.includes(u)||(e.bookmark_properties=(0,Ie.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),null===P||void 0===P||!P.includes(u)||null!==e&&void 0!==e&&null!==(s=e.key_properties)&&void 0!==s&&s.includes(u)?null!==P&&void 0!==P&&P.includes(u)||null===e||void 0===e||null===(a=e.key_properties)||void 0===a||!a.includes(u)||(e.key_properties=(0,Ie.Od)(e.key_properties,(function(e){return u===e}))):e.key_properties=[u].concat(e.key_properties||[]),null===I||void 0===I||!I.includes(u)||null!==e&&void 0!==e&&null!==(d=e.partition_keys)&&void 0!==d&&d.includes(u)?null!==I&&void 0!==I&&I.includes(u)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(u)||(e.partition_keys=(0,Ie.Od)(e.partition_keys,(function(e){return u===e}))):e.partition_keys=[u].concat(e.partition_keys||[])}return Wt({},e)}))},pill:!0,secondary:!0,children:(0,S.jsx)(C.ZP,{success:U,children:U?"Applied!":"Apply"})}))}return N})),o=e.every((function(e){return e})),l=[null,2,1,null,null,null],u=[{label:function(){return(0,S.jsx)(x.Z,{checked:o,onClick:function(){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 ce&&(l.push(null),u.push({uuid:"Partition key"})),ae&&(l.push(null),u.push({tooltipMessage:"This will apply this individual feature's schema settings to all selected streams that have the same feature. Unique features must be valid key properties in other streams. Bookmark features must be valid replication keys in other streams.",uuid:"All streams"})),(0,S.jsx)(se.cl,{children:(0,S.jsx)(Ze.Z,{alignTop:!0,columnFlex:l,columns:u,rows:i,stickyHeader:!0})})}),[g,t,ae,V,P,ie,I,M,de,ce,B,R,d,v,h,m,re,le]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,S.jsx)(ue.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:B})," schema"]}),(0,S.jsx)(O.Z,{mb:3,children:(0,S.jsx)(Vn.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{children:"Destination table name"}),(0,S.jsx)(O.Z,{ml:Kt}),(0,S.jsx)(Oe.Z,Wt(Wt({},Vt),{},{label:(0,S.jsxs)(C.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:B}),". To change the table name, enter in a different value."]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(W.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;F(n),clearTimeout(b.current),b.current=setTimeout((function(){m(B,(function(e){return Wt(Wt({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*w.iI})]})})}),(0,S.jsx)(O.Z,{mb:3,children:(0,S.jsx)(Vn.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{children:"Replication method"}),(0,S.jsx)(O.Z,{ml:Kt}),(0,S.jsx)(Oe.Z,Wt(Wt({},Vt),{},{label:(0,S.jsxs)(C.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.INCREMENTAL}),")?",c===Ce.th.POSTGRESQL&&(0,S.jsxs)(C.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsxs)(z.Z,{compact:!0,onChange:function(e){m(B,(function(n){return Wt(Wt({},n),{},{replication_method:e.target.value})}))},primary:!0,value:E,children:[(0,S.jsx)("option",{value:""}),Object.values(Ce._B).filter((function(e){return c===Ce.th.POSTGRESQL||e!==Ce._B.LOG_BASED})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))]}),(0,S.jsx)(O.Z,{ml:3}),(0,S.jsx)(C.ZP,{children:"Unique conflict method"}),(0,S.jsx)(O.Z,{ml:Kt}),(0,S.jsx)(Oe.Z,Wt(Wt({},Vt),{},{label:(0,S.jsxs)(C.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,J._6)("unique column",null===R||void 0===R?void 0:R.length),(null===R||void 0===R?void 0:R.length)>0&&(0,S.jsx)(S.Fragment,{children:"\xa0"}),null===R||void 0===R?void 0:R.sort().map((function(e,n){return(0,S.jsxs)(C.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,S.jsx)(C.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsxs)(z.Z,{compact:!0,inputWidth:11*w.iI,onChange:function(e){m(B,(function(n){return Wt(Wt({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:A,children:[(0,S.jsx)("option",{value:""}),(0,S.jsx)("option",{value:Ce.MU.IGNORE,children:Ce.MU.IGNORE}),(0,S.jsx)("option",{value:Ce.MU.UPDATE,children:Ce.MU.UPDATE})]})]}),ae&&(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{default:!0,children:"All streams"}),(0,S.jsx)(O.Z,{ml:Kt}),(0,S.jsx)(Oe.Z,Wt(Wt({},Vt),{},{appearBefore:!0,label:(0,S.jsx)(C.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(D.ZP,{compact:!0,disabled:H,onClick:function(){G(!0),setTimeout((function(){return G(!1)}),2e3),d((function(e){return Wt(Wt({},e),{},{replication_method:E,unique_conflict_method:A})}))},pill:!0,secondary:!0,children:(0,S.jsx)(C.ZP,{bold:!H,success:H,children:H?"Applied!":"Apply"})})]})]})})}),(0,S.jsx)(Vn.Z,{headerTitle:"Features",noPadding:!0,children:pe}),(0,S.jsx)(O.Z,{mt:2,children:(0,S.jsx)(D.ZP,{loading:i,onClick:function(){return u(B)},primary:!0,small:!0,children:"Load sample data"})}),(0,S.jsxs)(O.Z,{mt:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,S.jsx)(O.Z,{mb:5,children:(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,S.jsx)(C.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(Pe.Z,{checked:T,onCheck:function(){return m(B,(function(e){return e.run_in_parallel=!T,e}))}},"".concat(B,"/run_in_parallel"))]})}),Ce._B.INCREMENTAL===E&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,S.jsx)(C.ZP,{default:!0,children:"After each integration pipeline run, the last record that was successfully synchronized will be used as the bookmark. The properties listed below will be extracted from the last record and used as the bookmark. On the next run, the synchronization will start from the bookmarked record."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==g&&void 0!==g&&g.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===g||void 0===g?void 0:g.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){de(e),m(B,(function(n){return Wt(Wt({},n),{},{bookmark_properties:(0,Ie.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===g||void 0===g?void 0:g.length)>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{my:2,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),!t&&(0,S.jsx)(C.ZP,{default:!0,children:'In order to overwrite the bookmark values for the next sync, you must first select a destination. Then you will be able to edit the bookmark property values in the table below. Click the "Save" button to save your changes.'}),t&&(0,S.jsx)(C.ZP,{default:!0,children:'This will temporarily overwrite the bookmark value for the next pipeline run. After editing any bookmark values below, you must click the "Save" button in the table header in order to persist and save your changes.'})]}),(0,S.jsx)(Pe.Z,{checked:X,disabled:!t,onCheck:function(){return Q((function(e){return!e}))}})]})}),X&&!!t&&(0,S.jsx)(Vn.Z,{header:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,S.jsx)(D.ZP,{compact:!0,loading:o,onClick:function(){p({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:w.iI,noPadding:!0,overflowVisible:!0,children:(0,S.jsx)(Ze.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Feature"},{uuid:"Current bookmark value"}],rows:g.map((function(e){var n;return[(0,S.jsx)(C.ZP,{default:!0,monospace:!0,children:e},e),(0,S.jsx)(W.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return Wt(Wt({},t),{},(0,l.Z)({},B,Wt(Wt({},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"))]}))})})]})]}),ae&&(null===g||void 0===g?void 0:g.length)>0&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Valid replication keys"}),(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"If a stream's schema specifies its valid replication keys and a feature is not a valid replication key, that feature will not be set as a bookmark property when applying the feature (from a different stream) as a bookmark to all streams.\xa0"}),le.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"These are the valid replication keys for this stream:"}),"\xa0",(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,small:!0,children:[le.join(", "),"."]})]}),0===le.length&&(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"This stream did not specify any valid replication keys, so all features can be used as bookmark properties."})]}),(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,S.jsx)(C.ZP,{default:!0,children:"Multiple records (e.g. 2 or more) with the same values in the columns listed below will be considered duplicates."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==R&&void 0!==R&&R.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.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,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){m(B,(function(n){return Wt(Wt({},n),{},{unique_constraints:(0,Ie.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,S.jsx)(C.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==P&&void 0!==P&&P.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===P||void 0===P?void 0:P.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){m(B,(function(n){return Wt(Wt({},n),{},{key_properties:(0,Ie.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ce&&(0,S.jsxs)(O.Z,{mb:3,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,S.jsx)(C.ZP,{default:!0,children:"One datetime column can be used to partition the table. (Note: Partition keys currently only work with BigQuery destinations. Support for other destinations is WIP.)"})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==I&&void 0!==I&&I.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===I||void 0===I?void 0:I.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){m(B,(function(n){return Wt(Wt({},n),{},{partition_keys:(0,Ie.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Xt=["catalog","pipeline","setErrors","setSelectedStream"];function Qt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Jt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $t,ei=function(e){var n,t=e.catalog,i=e.pipeline,o=e.setErrors,l=e.setSelectedStream,u=(0,be.Z)(e,Xt),c=(0,f.useState)(null),s=c[0],a=c[1],d=(0,f.useMemo)((function(){return(null===t||void 0===t?void 0:t.streams)||[]}),[t]),p=(0,f.useMemo)((function(){return(0,Ie.YC)(d,"stream").map((function(e){return{uuid:e.stream}}))}),[d]),h=(0,f.useMemo)((function(){return(0,Ie.HK)(d,(function(e){return e.stream}))}),[d]),m=(0,f.useMemo)((function(){return h[null===s||void 0===s?void 0:s.uuid]}),[s,h]),b=(0,f.useMemo)((function(){return(0,Ie.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return g.tf.DATA_EXPORTER===n}))}),[null===i||void 0===i?void 0:i.blocks]),x=m||{},j=x.destination_table,y=x.tap_stream_id,k=!(!y||!j),Z=K.ZP.blocks.pipelines.detail(k?null===i||void 0===i?void 0:i.uuid:null,k?null===b||void 0===b?void 0:b.uuid:null,{destination_table:j,state_stream:y}),P=Z.data,w=Z.mutate,_=null===P||void 0===P||null===(n=P.block)||void 0===n?void 0:n.bookmarks,I=(0,v.Db)(K.ZP.blocks.pipelines.useUpdate(null===i||void 0===i?void 0:i.uuid,null===b||void 0===b?void 0:b.uuid,{query:{update_state:!0}}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){null===w||void 0===w||w()},onErrorCallback:function(e,n){return null===o||void 0===o?void 0:o({errors:n,response:e})}})}}),E=(0,r.Z)(I,2),T=E[0],M=E[1].isLoading;(0,f.useEffect)((function(){p.length>0&&(s&&(0,Ie.sE)(p,(function(e){var n=e.uuid;return s.uuid===n}))||a(p[0]))}),[s,a,p]);var D=(0,f.useMemo)((function(){var e=[{uuid:"Stream"},{uuid:"Columns Selected"},{uuid:"Replication Method"},{uuid:"Destination Table"},{uuid:"Bookmark Props"},{uuid:"Key Props"},{uuid:"Unique Constraints"},{uuid:"Unique Conflict Method"},{uuid:"Partition Keys"}];return(0,S.jsx)(se.cl,{children:(0,S.jsx)(Ze.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:d.map((function(e){var n=e.replication_method,t=e.destination_table,i=e.bookmark_properties,o=e.key_properties,r=e.metadata,l=e.unique_constraints,u=e.unique_conflict_method,c=e.partition_keys,s=e.tap_stream_id,a=r.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,o=(null===t||void 0===t?void 0:t.length)>0,r=i&&o?1:0,l=o?1:0;return{selectedCount:e.selectedCount+r,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,S.jsx)(C.ZP,{children:"".concat(a.selectedCount," of ").concat(a.totalCount," total")},"".concat(s,"_col_selected")),p=[s,n,t,i,o,l,u,c].map((function(e,n){return(0,S.jsx)(C.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(s,"_cell_").concat(n))}));return p.slice(0,1).concat(d).concat(p.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[d]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(B.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){a(e),l(e.uuid)},selectedTabUUID:null===s||void 0===s?void 0:s.uuid,tabs:p}),m&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(se.dE,{children:(0,S.jsx)(Yt,Jt(Jt({},u),{},{bookmarkValues:_,isLoadingUpdateDestinationBlockState:M,stream:m,streams:d,updateDestinationBlockState:T}))})}),d.length>=1&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(se.dE,{children:[(0,S.jsx)(ue.Z,{level:4,children:"Streams Summary"}),(0,S.jsx)(O.Z,{mt:1}),D]})})]})},ni=t(46732);function ti(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function ii(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function oi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ii(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ii(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"}($t||($t={}));var ri=45*w.iI,li=ri-4*w.iI;var ui=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,o=e.streams,r=(0,Ie.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),u=(0,f.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 oi(oi({},e),{},{isMissingStream:!0})}))}),[r,o]),c=oi({},r);u.forEach((function(e){var n=e.stream;delete c[n]}));var s=(0,f.useState)(c),a=s[0],d=s[1],p=(0,f.useState)(null),v=p[0],h=p[1],m=(0,f.useState)(!1),b=m[0],g=m[1],j=(0,f.useState)($t.ALL),k=j[0],P=j[1],_=(0,f.useRef)(null),I=ti(a),E=(0,f.useMemo)((function(){var e=o;return e=e.filter((function(e){var n=e.tap_stream_id;return k===$t.SELECTED?I.includes(n):k!==$t.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}),[k,v,I,o]),T=(0,f.useMemo)((function(){return o.every((function(e){var n=e.stream;return!!a[n]}))}),[a,o]);return(0,S.jsxs)(De.Z,{children:[(0,S.jsx)(se.cv,{rounded:!0,children:(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,S.jsx)(se.cv,{padding:1.25*w.iI,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(W.Z,{beforeIcon:(0,S.jsx)(V.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return h(e.target.value)},placeholder:"Search",value:v}),(0,S.jsx)(O.Z,{pr:1,children:(0,S.jsx)(ni.Z,{items:[{label:function(){return $t.ALL},onClick:function(){return P($t.ALL)},uuid:"all_streams"},{label:function(){return $t.SELECTED},onClick:function(){return P($t.SELECTED)},uuid:"selected"},{label:function(){return $t.NOT_SELECTED},onClick:function(){return P($t.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return g(!1)},onClickOutside:function(){return g(!1)},open:b,parentRef:_,uuid:"SelectStreams/filter",children:(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.wn,{}),noBackground:!0,onClick:function(){return g((function(e){return!e}))},ref:_,children:(0,S.jsx)(C.ZP,{children:k})})})})]})}),(0,S.jsx)(se.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(ri,"px"),children:(0,S.jsx)(Ze.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,S.jsx)(x.Z,{checked:T,onClick:function(){var e=(0,Ie.HK)(o||[],(function(e){return e.stream}));d(T?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:E.concat(u).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!a[t];return[(0,S.jsx)(x.Z,{checked:i,disabled:!i&&n,onClick:function(){d((function(n){return oi(oi({},n),{},(0,l.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,S.jsxs)(C.ZP,{danger:n,title:t,width:ri-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,S.jsx)(y.Z,{medium:!0}),(0,S.jsxs)(O.Z,{p:2,children:[(null===I||void 0===I?void 0:I.length)>50&&(0,S.jsx)(O.Z,{pb:2,children:(0,S.jsxs)(C.ZP,{danger:!0,maxWidth:li,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,S.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===o||void 0===o?void 0:o.length)&&(0,S.jsx)(O.Z,{pb:2,children:(0,S.jsx)(C.ZP,{bold:!0,maxWidth:li,warning:!0,whiteSpaceNormal:!0,children:"If you can successfully connect to the data source but no streams are displayed, check if the user has proper database/schema permissions."})}),(0,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(D.ZP,{loading:t,onClick:function(){return i(a)},primary:!0,children:"Confirm ".concat(ti(a).length," streams")})})]})]})};function ci(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 si(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ci(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ci(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ai=function(e){var n=e.api,t=e.block,i=e.blockContent,o=e.onChangeCodeBlock,u=e.pipeline,c=(0,f.useState)(null),s=c[0],a=c[1];(0,f.useEffect)((function(){i&&!s&&a((0,re.Pz)(null===i||void 0===i?void 0:i.config))}),[s,i]);var d=(0,f.useState)(null),p=d[0],h=d[1],m=(0,f.useState)(),b=m[0],x=m[1],j=(0,v.Db)(K.ZP[n].useCreate(),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var t,i,o=(0,J.C5)(n);h(null===e||void 0===e||null===(t=e[o])||void 0===t?void 0:t.success),x(null===e||void 0===e||null===(i=e[o])||void 0===i?void 0:i.error_message)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),y=(0,r.Z)(j,2),k=y[0],P=y[1].isLoading;return t?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(se.$W,{children:(0,S.jsx)(le.Z,{autoHeight:!0,language:g.t6.YAML,onChange:function(e){a(e),o(t.type,t.uuid,(0,re.Pz)(si(si({},i),{},{config:(0,re.Qc)(e)})))},tabSize:2,value:s||void 0,width:"100%"})}),(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{onClick:function(){k((0,l.Z)({},(0,J.C5)(n),{action_type:"test_connection",config:s,pipeline_uuid:u.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,S.jsx)(O.Z,{ml:1,children:P?(0,S.jsx)(G.Z,{color:"white",small:!0}):(0,S.jsxs)(S.Fragment,{children:[p&&(0,S.jsx)(C.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===p&&(0,S.jsx)(C.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),b&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{small:!0,warning:!0,children:b})})]})]}):null},di=t(85385);function pi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function fi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var vi=function(e){var n,t,i,o=e.addNewBlockAtIndex,l=e.blocks,u=e.codeBlocks,c=e.fetchFileTree,s=e.fetchPipeline,a=e.fetchSampleData,d=e.globalVariables,p=e.onChangeCodeBlock,h=e.openSidekickView,m=e.pipeline,b=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,y=e.setOutputBlocks,k=e.setSelectedBlock,_=e.setSelectedOutputBlock,I=e.setSelectedStream,E=(0,f.useState)(!0),T=E[0],M=E[1],B=(0,f.useState)(!0),R=B[0],A=B[1],N=(0,f.useState)(!0),L=N[0],F=N[1],U=(0,f.useState)(""),H=U[0],W=U[1],q=K.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,Y=(0,f.useMemo)((function(){return(null===q||void 0===q?void 0:q.integration_sources)||[]}),[q]),X=(0,f.useMemo)((function(){return(0,Ie.HK)(Y,(function(e){return e.uuid}))}),[Y]),Q=K.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,J=(0,f.useMemo)((function(){return(null===Q||void 0===Q?void 0:Q.integration_destinations)||[]}),[Q]),ee=(0,f.useMemo)((function(){return(0,Ie.HK)(J,(function(e){return e.uuid}))}),[J]),ne=(0,f.useMemo)((function(){return(0,Ie.sE)(l,(function(e){var n=e.type;return g.tf.DATA_LOADER===n}))}),[l]),te=(0,f.useMemo)((function(){return ne?(0,re.Qc)(ne.content):{}}),[ne]);(0,f.useEffect)((function(){var e;null!==te&&void 0!==te&&te.source&&W(null===(e=X[te.source])||void 0===e?void 0:e.docs)}),[X,te]);var ie=(0,f.useMemo)((function(){return(0,S.jsx)(ai,{api:"integration_sources",block:ne,blockContent:te,onChangeCodeBlock:p,pipeline:m})}),[ne,te,p,m]),oe=(0,f.useMemo)((function(){return(0,Ie.sE)(l,(function(e){var n=e.type;return g.tf.DATA_EXPORTER===n}))}),[l]),le=(0,f.useMemo)((function(){return oe?(0,re.Qc)(oe.content):{}}),[oe]),ce=(0,f.useMemo)((function(){return(0,S.jsx)(ai,{api:"integration_destinations",block:oe,blockContent:le,onChangeCodeBlock:p,pipeline:m})}),[oe,le,p,m]),ae=(0,f.useMemo)((function(){return(0,Ie.sE)(l,(function(e){var n=e.type;return g.tf.TRANSFORMER===n}))}),[l]),de=(0,f.useMemo)((function(){var e;return(0,je.Qr)(null===te||void 0===te?void 0:te.catalog)?null===m||void 0===m||null===(e=m.data_integration)||void 0===e?void 0:e.catalog:null===te||void 0===te?void 0:te.catalog}),[te,null===m||void 0===m||null===(n=m.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})),fe=((null===de||void 0===de?void 0:de.streams)||[]).every((function(e){return e.disable_column_type_check})),ve=(0,ct.Z)(de);(0,f.useEffect)((function(){!ve&&de&&(y((function(){return _(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,f.useState)(),be=me[0],ge=me[1],xe=(0,v.Db)(K.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];y((function(){return _(ne),[ne]})),t.length>0&&I(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),h(di.cH.DATA),a()}else ge(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),ye=(0,r.Z)(xe,2),ke=ye[0],Oe=ye[1].isLoading,we=(0,v.Db)(K.ZP.integration_sources.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,$.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(Ce.ks.UNSUPPORTED!==i.inclusion){var o;if(e.replication_method||(e.replication_method=Ce._B.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=Ce.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]=fi(fi({},n),{},{metadata:fi(fi({},i),{},{selected:!0})})}}))}));var u={streams:o.concat(l)};j(Ve.map((function(e){return e.tap_stream_id})));var a=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(a)||p(ne.type,ne.uuid,(0,re.Pz)(fi(fi({},te),{},{catalog:{}})));var d={pipeline:fi(fi({},m),{},{data_integration:fi(fi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:u})})};b(d).then((function(){s(),c()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),_e=(0,r.Z)(we,2),Se=_e[0],Ee=_e[1].isLoading,Te=(0,f.useState)(null),Me=Te[0],De=Te[1],Be=(0,v.Db)(K.ZP.integration_source_streams.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,$.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,f.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=fi(fi({},de),{},{streams:o.concat(n(i))}),l=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(l)||p(ne.type,ne.uuid,(0,re.Pz)(fi(fi({},te),{},{catalog:{}})));var u={pipeline:fi(fi({},m),{},{data_integration:fi(fi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:r})})};b(u).then((function(){return s()}))}),[de,ne,te,s,p,m,b]),Fe=(0,f.useCallback)((function(e){if(null!==de&&void 0!==de&&de.streams){var n=fi(fi({},de),{},{streams:de.streams.map((function(n){return e(n)}))}),t=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(t)||p(ne.type,ne.uuid,(0,re.Pz)(fi(fi({},te),{},{catalog:{}})));var i={pipeline:fi(fi({},m),{},{data_integration:fi(fi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:n})})};b(i).then((function(){return s()}))}}),[de,ne,te,s,p,m,b]),Ue=(0,f.useCallback)((function(e,n,t){Le(e,(function(e){return e.schema.properties[n]=t,e}))}),[Le]),He=(0,f.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=fi(fi({},r),t)}})),e}))}),[Le]),ze=(0,v.Db)(K.ZP.blocks.pipelines.useUpdate(null===m||void 0===m?void 0:m.uuid,null===oe||void 0===oe?void 0:oe.uuid),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){null===s||void 0===s||s()},onErrorCallback:function(e,n){return null===x||void 0===x?void 0:x({errors:n,response:e})}})}}),Ge=(0,r.Z)(ze,1)[0],We=(0,f.useMemo)((function(){var e=[];return null===d||void 0===d||d.forEach((function(n){var t=n.variables;return null===t||void 0===t?void 0:t.forEach((function(n){var t=n.uuid,i=n.value,o="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,S.jsx)(C.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,S.jsx)(C.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,S.jsx)(C.ZP,{monospace:!0,children:o},"variable-uuid-".concat(t,"-{value}-code")),(0,S.jsx)(zt.Z,{copiedText:o,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,S.jsx)(Ze.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[d]),Ke=(0,f.useCallback)((function(e){return(0,S.jsxs)(O.Z,{mt:2,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,S.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,S.jsx)("br",{}),"For more information, check out the ",(0,S.jsx)(P.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,S.jsx)(O.Z,{mt:1,children:We})]})}),[We]),Ve=(0,f.useMemo)((function(){return(null===Me||void 0===Me?void 0:Me.streams)||[]}),[Me]),qe=(0,ft.dd)((function(){return(0,S.jsx)(ui,{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)Se({integration_source:{streams:n}}),Qe();else{var t=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(t)||p(ne.type,ne.uuid,(0,re.Pz)(fi(fi({},te),{},{catalog:{}}))),b({pipeline:fi(fi({},m),{},{data_integration:fi(fi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:null})})}).then((function(){return s()})),Qe()}},streams:Ve})}),{},[de,ne,te,s,Ee,p,b,Ve],{background:!0,uuid:"select_streams"}),Ye=(0,r.Z)(qe,2),Xe=Ye[0],Qe=Ye[1];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{iconOnly:!0,onClick:function(){return A((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[R&&(0,S.jsx)(V.Kh,{size:1.5*w.iI}),!R&&(0,S.jsx)(V._M,{size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{children:"Source"}),!R&&(0,S.jsxs)(ue.Z,{default:!0,inline:!0,children:["\xa0",null===(t=X[null===te||void 0===te?void 0:te.source])||void 0===t?void 0:t.name]})]})]})}),R&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(se.dE,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===Y||void 0===Y?void 0:Y.length)>0?(0,S.jsxs)(z.Z,{onChange:function(e){var n,t,i,r=e.target.value;if(r){W(null===(n=X[r])||void 0===n?void 0:n.docs);var l=null===(t=X[r])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;l&&Object.keys(l).forEach((function(e){l[e]=l[e]||null})),ne?p(ne.type,ne.uuid,(0,re.Pz)(fi(fi({},te),{},{catalog:{},config:l,source:r}))):o({content:(0,re.Pz)({config:l,source:r}),language:g.t6.YAML,type:g.tf.DATA_LOADER},0,k),De(null),b().then((function(){s()}))}},primary:!0,value:null===te||void 0===te?void 0:te.source,children:[(0,S.jsx)("option",{value:""}),Y.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(G.Z,{inverted:!0}),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(ue.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ne&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===te||void 0===te?void 0:te.source)&&H&&(0,S.jsxs)(O.Z,{mb:2,children:[(0,S.jsx)(Ut.Z,{children:(0,S.jsx)(Ht.Z,{title:"Documentation: ".concat(te.source),children:(0,S.jsx)(se.zG,{children:(0,S.jsx)(he.Z,{children:H.replace(/\<br \/\>/g,"\n\n")})})})}),Ke("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),ie]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,S.jsx)(D.ZP,{loading:Ne,onClick:function(){b().then((function(){Ae().then((function(){return Xe()})),s()}))},primary:!0,small:!0,children:"View and select streams"})]}),be&&(0,S.jsx)(C.ZP,{warning:!0,children:be})]})]}),Ee&&(0,S.jsx)(O.Z,{p:2,children:(0,S.jsx)(G.Z,{})}),!Ee&&(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsx)(ei,{catalog:de,destination:null===le||void 0===le?void 0:le.destination,isLoadingLoadSampleData:Oe,loadSampleData:function(e){return ke({integration_source:{action_type:"sample_data",pipeline_uuid:null===m||void 0===m?void 0:m.uuid,streams:[e]}})},pipeline:m,setErrors:x,setSelectedStream:I,source:null===te||void 0===te?void 0:te.source,updateAllStreams:Fe,updateMetadataForColumns:He,updateSchemaProperty:Ue,updateStream:Le})})]}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[L&&ne&&(0,S.jsx)(V.Kh,{size:1.5*w.iI}),(!L||!ne)&&(0,S.jsx)(V._M,{disabled:!ne,size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(ue.Z,{children:"Transformers"})})]})}),L&&ne&&(0,S.jsx)(O.Z,{mb:5,children:(0,S.jsxs)(se.dE,{children:[u.length>0&&(0,S.jsx)(O.Z,{mb:1,children:u.map((function(e,n){return(0,S.jsx)(O.Z,{mb:1,children:e},n)}))}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(kt.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ne&&i.push(ne.uuid),o(fi(fi({},e),{},{configuration:t,content:n,upstream_blocks:i}),l.length-1,(function(e){oe&&(Ge({block:fi(fi({},oe),{},{upstream_blocks:[e.uuid]})}),k(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!ae,hideTransformerDataSources:!0,pipeline:m})})]})}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return M((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[T&&ne&&(0,S.jsx)(V.Kh,{size:1.5*w.iI}),(!T||!ne)&&(0,S.jsx)(V._M,{disabled:!ne,size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{children:"Destination"}),!T&&(0,S.jsxs)(ue.Z,{default:!0,inline:!0,children:["\xa0",null===(i=ee[null===le||void 0===le?void 0:le.destination])||void 0===i?void 0:i.name]})]})]})}),T&&ne&&(0,S.jsxs)(se.dE,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===J||void 0===J?void 0:J.length)>0?(0,S.jsxs)(z.Z,{onChange:function(e){var n=e.target.value;if(n){if(oe)p(oe.type,oe.uuid,(0,re.Pz)(fi(fi({},le),{},{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,re.Pz)({config:r,destination:n}),language:g.t6.YAML,type:g.tf.DATA_EXPORTER,upstream_blocks:u},1,k)}b().then((function(){s()}))}},primary:!0,value:null===le||void 0===le?void 0:le.destination,children:[(0,S.jsx)("option",{value:""}),J.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(G.Z,{inverted:!0}),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(ue.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),oe&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===le||void 0===le?void 0:le.destination)&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(O.Z,{mb:2,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,S.jsxs)(P.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(le.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[le.destination," documentation"]}),".",(0,S.jsx)("br",{}),(0,S.jsx)("br",{}),"If your configuration contains a key named ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,S.jsx)("br",{}),"The table that\u2019s created in this destination will have a name corresponding to the stream\u2019s unique name (by default) or the value you entered under the input field labeled ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Ke("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),ce,(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(C.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})]}),(0,S.jsx)(Pe.Z,{checked:!!pe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return fi(fi({},e),{},{auto_add_new_fields:!pe})}))}})]})}),(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsxs)(C.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,S.jsx)("br",{}),"If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped.",(0,S.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,S.jsx)(Pe.Z,{checked:!!fe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return fi(fi({},e),{},{disable_column_type_check:!fe})}))}})]})})]})]})]})},hi=t(82359),mi=t(35058),bi=t(38399),gi=t(33834),xi=t(42041);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 yi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ji(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ji(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ki=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.afterHidden,u=e.allBlocks,c=e.allowCodeBlockShortcuts,s=e.anyInputFocused,a=e.autocompleteItems,d=e.beforeHidden,p=e.blockInteractionsMapping,h=e.blockRefs,m=e.blocks,b=void 0===m?[]:m,x=e.blocksThatNeedToRefresh,j=e.dataProviders,y=e.deleteBlock,k=e.disableShortcuts,Z=e.fetchFileTree,I=e.fetchPipeline,E=e.fetchSampleData,T=e.files,M=e.globalDataProducts,D=e.globalVariables,B=e.hiddenBlocks,N=e.interactionsMapping,F=e.interruptKernel,U=e.mainContainerRef,z=e.mainContainerWidth,G=e.messages,W=e.onChangeCallbackBlock,V=e.onChangeCodeBlock,q=e.openSidekickView,Y=e.pipeline,X=e.pipelineContentTouched,Q=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,se=e.setEditingBlock,ae=e.setErrors,de=e.setHiddenBlocks,pe=e.setIntegrationStreams,fe=e.setOutputBlocks,ve=e.setPipelineContentTouched,he=e.setSelectedBlock,me=e.setSelectedOutputBlock,be=e.setSelectedStream,ge=e.setTextareaFocused,xe=e.showBrowseTemplates,ye=e.showConfigureProjectModal,ke=e.showDataIntegrationModal,Ze=e.showGlobalDataProducts,Pe=e.showUpdateBlockModal,Oe=e.sideBySideEnabled,Ce=e.textareaFocused,we=e.widgets,_e=(0,f.useRef)(null),Se=(0,f.useRef)(null),Ee=(0,f.useRef)({}),Te=(0,f.useState)(!1),Me=Te[0],De=Te[1],Be=(0,f.useState)(!1),Re=Be[0],Ae=Be[1],Ne=(0,f.useState)(!1),Le=Ne[0],Fe=Ne[1],Ue=(0,f.useState)(!0),He=Ue[0],ze=Ue[1],Ge=(0,f.useState)(null),We=Ge[0],Ke=Ge[1],Ve=(0,f.useState)(null),qe=Ve[0],Ye=Ve[1],Xe=(0,f.useState)(!1),Qe=Xe[0],Je=Xe[1],$e=(0,f.useState)(""),en=$e[0],nn=$e[1],tn=(0,f.useState)({height:null,width:null,x:null,y:null}),on=tn[0],rn=tn[1],ln=(0,f.useMemo)((function(){return H.qL.INTEGRATION===(null===Y||void 0===Y?void 0:Y.type)}),[Y]),un=(0,f.useMemo)((function(){return H.qL.STREAMING===(null===Y||void 0===Y?void 0:Y.type)}),[Y]),cn=(0,f.useMemo)((function(){return b.filter((function(e){var n=e.type;return!ln||g.tf.TRANSFORMER===n}))}),[b,ln]),sn=(0,f.useState)({}),an=(sn[0],sn[1]),dn=(0,kn.i)(),pn=dn.height,fn=dn.width;(0,f.useEffect)((function(){var e;null!==U&&void 0!==U&&U.current&&rn(null===U||void 0===U||null===(e=U.current)||void 0===e?void 0:e.getBoundingClientRect())}),[i,d,U,z,rn,pn,fn]);var vn=(0,f.useMemo)((function(){return ie.reduce((function(e,n,t){return yi(yi({},e),{},(0,l.Z)({},n.uuid,yi(yi({},n),{},{priority:t})))}),{})}),[ie]),hn=(0,f.useState)(null),mn=hn[0],bn=hn[1],gn=(0,f.useMemo)((function(){return(0,S.jsx)(It,{blocks:cn,columnIndex:0,columns:2,disabled:re,eventNameRefsMapping:(0,l.Z)({},Zt.$e,h),invisible:!(null!==b&&void 0!==b&&b.length)||!mn||re,mainContainerRect:on,scrollTogether:re,setCursorHeight:bn})}),[h,cn,mn,on,re,bn]),xn=(0,f.useState)(null),jn=xn[0],yn=xn[1],Zn=(0,f.useMemo)((function(){return(0,S.jsx)(It,{blocks:cn,columnIndex:1,columns:2,disabled:re,eventNameRefsMapping:(0,l.Z)({},Zt.tK,Ee),invisible:!(null!==b&&void 0!==b&&b.length)||!jn||re,mainContainerRect:on,rightAligned:!0,scrollTogether:re,setCursorHeight:yn})}),[Ee,cn,jn,on,re,yn]),Pn=(0,f.useState)(null),On=Pn[0],Cn=Pn[1],wn=(0,f.useMemo)((function(){var e;return(0,S.jsx)(It,{blocks:cn,columnIndex:2,columns:1,disabled:!re,eventNameRefsMapping:(e={},(0,l.Z)(e,Zt.tK,Ee),(0,l.Z)(e,Zt.$e,h),e),invisible:!(null!==b&&void 0!==b&&b.length)||!On||!re,mainContainerRect:on,rightAligned:!0,scrollTogether:re,setCursorHeight:Cn})}),[Ee,h,cn,On,on,re,Cn]),_n=(0,ct.Z)(le),In=(0,f.useMemo)((function(){return b.length}),[b]),En=(0,f.useMemo)((function(){var e;return H.qL.PYTHON===(null===Y||void 0===Y?void 0:Y.type)&&(null===Q||void 0===Q||null===(e=Q.features)||void 0===e?void 0:e[hi.d.ADD_NEW_BLOCK_V2])}),[Y,Q]),Tn=K.ZP.block_templates.list({show_all:!!En},{revalidateOnFocus:!1}).data,Dn=(0,f.useMemo)((function(){return(null===Tn||void 0===Tn?void 0:Tn.block_templates)||[]}),[Tn]),Bn=(0,f.useCallback)((function(e,t){var i=b[b.length-1],o=null,r=e.configuration||{},l=i?(0,wt.eY)(i,e):[];i&&([g.tf.DATA_LOADER,g.tf.TRANSFORMER].includes(i.type)&&g.tf.SCRATCHPAD===e.type&&(o="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(Y.uuid,"', '").concat(i.uuid,"', 'output_0')\n")),g.t6.SQL===i.language&&(r=yi(yi({},(0,je.GL)(i.configuration,[mi.cH,mi.Sv,mi.sc,mi.BD,mi.nq])),r))),g.t6.SQL===e.language&&(o=(0,bi.SF)(o)),o=(0,bi.X7)(e,o);var u=null!==t?t:In;n(yi(yi({},e),{},{configuration:r,content:o,upstream_blocks:l}),u,he),ge(!0)}),[n,b,In,Y,he,ge]),An="PipelineDetail/index",Nn=(0,Rn.y)(),Ln=Nn.disableGlobalKeyboardShortcuts,Fn=Nn.registerOnKeyDown,Un=Nn.unregisterOnKeyDown;(0,f.useEffect)((function(){return function(){Un(An)}}),[Un,An]),Fn(An,(function(e,n,t){if(X&&(0,xi.y)([Mn.zX,Mn.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(!k&&!Ln)if((0,xi.y)([Mn.zX,Mn.Um],n)||(0,xi.y)([Mn.PQ,Mn.Um],n))e.preventDefault(),oe();else if((0,xi.y)([Mn.zH],n)||(0,xi.y)([Mn.Fv],n)){if(le&&!e.repeat&&!(0,gi.cK)(e)){var i=b.findIndex((function(e){var n=e.uuid;return le.uuid===n}));if(-1!==i){var o=(0,xi.y)([Mn.zH],n)?i:i+1;Bn({type:g.tf.SCRATCHPAD},o)}}}else if(Ce)n[Mn.vP]?ge(!1):X||Mn.Z1.find((function(e){return n[e]}))||ve(!0);else if(!ln){var r;if(En&&((0,xi.y)([Mn.zX,Mn.A1],n)||(0,xi.y)([Mn.PQ,Mn.A1],n)))e.preventDefault(),Ae(!0),null===Se||void 0===Se||null===(r=Se.current)||void 0===r||r.focus();else if(En&&Re&&(0,xi.y)([Mn.vP],n)){var l;e.preventDefault(),Ae(!1),null===Se||void 0===Se||null===(l=Se.current)||void 0===l||l.blur()}else if(le){var u=b.findIndex((function(e){var n=e.uuid;return le.uuid===n}));if(n[Mn.vP])he(null);else if(t[0]===Mn.xD&&t[1]===Mn.xD)F();else if(t[0]===Mn.l1&&t[1]===Mn.l1&&-1!==u)y(le).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){u===b.length-1?he(b[u-1]):b.length>=0?he(b[u+1]):he(null)}),100)}));else if(n[Mn.Bu]&&u>=1){var c=b[u-1];if(c){var a,d;he(c);var p="".concat(c.type,"s/").concat(c.uuid,".py");null===(a=h.current[p])||void 0===a||null===(d=a.current)||void 0===d||d.scrollIntoView()}}else if(n[Mn.kD]&&u<=In-2){var f=b[u+1];if(f){var v,m;he(f);var x="".concat(f.type,"s/").concat(f.uuid,".py");null===(v=h.current[x])||void 0===v||null===(m=v.current)||void 0===m||m.scrollIntoView()}}else(0,xi.y)([Mn.Uq],n)&&ge(!0)}else _n&&n[Mn.Uq]&&he(_n);s||t[0]!==Mn.OC||t[1]!==Mn.OC||ee()}}),[n,s,h.current,b,Re,F,ln,In,X,ee,oe,Se,le,_n,ve,he,ge,Ce,En]),(0,f.useEffect)((function(){var e=setInterval((function(){X&&oe()}),1e4);return function(){clearInterval(e)}}),[X,oe]),(0,f.useEffect)((function(){setTimeout((function(){return Fe(!0)}),2*at.zn)}),[Y]);var zn=(0,v.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return K.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,$.wD)(e,{callback:function(){I()},onErrorCallback:function(e,n){return null===ae||void 0===ae?void 0:ae({errors:n,response:e})}})}}),Gn=(0,r.Z)(zn,1)[0],Wn=(0,f.useCallback)((function(e){De(!0),Ye(e),ce(!0)}),[De,ce,Ye]),Kn=(0,f.useCallback)((function(){De(!1),Je(!1),nn(""),ce(!1)}),[ce]),Vn=(0,f.useCallback)((function(e,n){var t,i;b.forEach((function(o,r){var l=o.uuid;t>=0&&i>=0||(l===e.uuid?t=r:l===n.uuid&&(i=r))}));var o=(0,Ie.oM)(b,i);return o=(0,Ie.Hk)(n,Math.max(t,0),o),oe({pipeline:{blocks:o,uuid:null===Y||void 0===Y?void 0:Y.uuid}})}),[b,Y,oe]),qn=(0,f.useMemo)((function(){return Y&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(kt.Z,{addNewBlock:Bn,blockTemplates:Dn,focusedAddNewBlockSearch:Re,hideCustom:ln||un,hideDataExporter:ln,hideDataLoader:ln,hideDbt:ln||un,hideScratchpad:ln,hideSensor:ln,onClickAddSingleDBTModel:Wn,pipeline:Y,project:Q,searchTextInputRef:Se,setCreatingNewDBTModel:Je,setFocusedAddNewBlockSearch:Ae,showBrowseTemplates:xe,showConfigureProjectModal:ye,showGlobalDataProducts:Ze}),!En&&!ln&&!un&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,S.jsx)("br",{}),"Turn on the feature named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:hi.d.ADD_NEW_BLOCK_V2})," in your ",(0,S.jsx)(jt(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,S.jsx)(P.Z,{muted:!0,underline:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[Bn,Dn,Re,ln,un,Wn,Y,Q,Se,Ae,xe,ye,Ze,En]),Yn=(0,f.useMemo)((function(){var e=[],i=(null===cn||void 0===cn?void 0:cn.length)||0;return cn.forEach((function(r,l){var s,d=l===i-1,v=r.type,m=r.uuid,P=(null===le||void 0===le?void 0:le.uuid)===m,O=vn[m],C=O?0===O.priority?bt.uF.BUSY:bt.uF.QUEUED:bt.uF.IDLE,w=(0,Ct.zv)({type:v,uuid:m});Ee.current[w]=(0,f.createRef)(),h.current[w]=(0,f.createRef)();var E=v===g.tf.MARKDOWN,T=v===g.tf.TRANSFORMER,D=!(null===B||void 0===B||!B[m]),R=l===In-1||ln,A=Ee.current[w],H=h.current[w],K=m,X=null===x||void 0===x||null===(s=x[v])||void 0===s?void 0:s[m];X&&(K="".concat(K,":").concat(X)),e.push((0,S.jsx)(L.Z,{addNewBlock:function(e,t){ge(!0);return n(e,Oe?l:l+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)||[];Gn({block:{uuid:r},upstreamBlocks:[e.uuid].concat((0,o.Z)(l))})}null===he||void 0===he||he(e)}))},addNewBlockMenuOpenIdx:We,addWidget:t,allBlocks:u,allowCodeBlockShortcuts:c,autocompleteItems:a,block:r,blockIdx:l,blockInteractions:null===p||void 0===p?void 0:p[m],blockOutputRef:A,blockRefs:h,blockTemplates:Dn,blocks:b,containerRef:_e,cursorHeight1:mn,cursorHeight2:jn,cursorHeight3:On,dataProviders:j,defaultValue:r.content,deleteBlock:function(e){y(e),ue(!1)},disableShortcuts:k,executionState:C,fetchFileTree:Z,fetchPipeline:I,globalDataProducts:M,hideRunButton:un||E||ln&&T,interactionsMapping:N,interruptKernel:F,isHidden:D,mainContainerRect:on,mainContainerRef:U,mainContainerWidth:z,messages:G[m],noDivider:R,onCallbackChange:function(e){return W(v,m,e)},onChange:function(e){return V(v,m,e)},onClickAddSingleDBTModel:Wn,onDrop:Vn,openSidekickView:q,pipeline:Y,project:Q,ref:H,runBlock:ne,runningBlocks:ie,savePipelineContent:oe,scrollTogether:re,selected:P,setAddNewBlockMenuOpenIdx:Ke,setAnyInputFocused:ue,setCreatingNewDBTModel:Je,setEditingBlock:se,setErrors:ae,setHiddenBlocks:de,setMountedBlocks:an,setOutputBlocks:fe,setSelected:function(e){return he(!0===e?r:null)},setSelectedBlock:he,setSelectedOutputBlock:me,setTextareaFocused:ge,showBrowseTemplates:xe,showConfigureProjectModal:ye,showDataIntegrationModal:ke,showGlobalDataProducts:Ze,showUpdateBlockModal:Pe,sideBySideEnabled:Oe,textareaFocused:P&&Ce,widgets:we,windowWidth:fn,children:Oe&&d&&(0,S.jsx)("div",{style:{paddingBottom:_.WC,paddingTop:_.WC},children:qn})},K))})),e}),[n,We,qn,t,u,c,a,p,Ee,h,Dn,b,cn,x,_e,mn,jn,On,j,y,k,Z,I,M,B,N,F,ln,un,on,U,z,G,In,W,V,Wn,Vn,q,Y,Q,ne,ie,vn,oe,re,le,Ke,ue,se,ae,de,an,fe,he,me,ge,xe,ye,ke,Ze,Pe,Oe,Ce,Gn,we,fn]),Xn=(0,f.useMemo)((function(){return(0,S.jsx)(vi,{addNewBlockAtIndex:n,blocks:b,codeBlocks:Yn,fetchFileTree:Z,fetchPipeline:I,fetchSampleData:E,globalVariables:D,onChangeCodeBlock:V,openSidekickView:q,pipeline:Y,savePipelineContent:oe,setErrors:ae,setIntegrationStreams:pe,setOutputBlocks:fe,setSelectedBlock:he,setSelectedOutputBlock:me,setSelectedStream:be})}),[n,b,Yn,Z,I,E,D,V,q,Y,oe,ae,pe,fe,he,me,be]);return(0,S.jsxs)(R.W,{backend:A.PD,children:[(0,S.jsx)(at.lO,{ref:_e,children:He&&(0,S.jsx)(yt.Z,{classNames:"pipeline-detail",in:Le,onEntered:function(){return setTimeout((function(){return ze(!1)}),at.zn)},timeout:1,children:(0,S.jsx)(at.fm,{})})}),ln&&(0,S.jsx)(O.Z,{mt:1,px:w.cd,children:Xn}),!Oe&&(0,S.jsx)(O.Z,{mt:1,px:w.cd,children:!ln&&(0,S.jsxs)(S.Fragment,{children:[Yn,(0,S.jsx)(O.Z,{mt:w.cd,children:qn})]})}),Oe&&(0,S.jsxs)("div",{style:{position:"relative"},children:[gn,Yn,Zn,wn,!(null!==b&&void 0!==b&&b.length)&&(0,S.jsx)(O.Z,{p:w.cd,children:qn})]}),Me&&(0,S.jsx)(Sn.Z,{onClickOutside:Kn,open:!0,children:(0,S.jsx)(Ft,{blocks:b,creatingNewDBTModel:Qe,dbtModelName:en,files:T,onClose:Kn,onOpenFile:function(e){var t=e;if(Qe){var i=(0,J.RA)(en||(0,J.Y6)()),o=".".concat(Hn.Lu.SQL);i.endsWith(o)&&(i=i.slice(0,-4)),t="".concat(e).concat(gt.sep).concat(i,".").concat(Hn.Lu.SQL)}var r={configuration:{file_path:t,limit:L.z},language:g.t6.SQL,name:(0,J.wE)(t),type:g.tf.DBT};Qe&&(r.content="--Docs: https://docs.mage.ai/dbt/sources\n");var l="undefined"===typeof qe||null===qe,u=b[l?b.length-1:qe],c=u?(0,wt.eY)(u,r):[];n(yi(yi({},r),{},{upstream_blocks:c}),(l?In:qe+1)-(Oe?1:0),he),Kn(),ge(!0)},setDbtModelName:nn})})]})},Zi=t(82555),Pi=t(68487),Oi=t(2842);function Ci(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function wi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ci(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ci(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _i=function(e){var n=e.after,t=e.afterFooter,i=e.afterHeader,o=e.afterHeightOffset,l=e.afterHidden,u=e.afterInnerHeightMinus,c=e.afterNavigationItems,s=e.afterOverflow,a=e.afterSubheader,d=e.before,p=e.beforeHeader,v=e.beforeHeightOffset,h=e.beforeHidden,m=e.beforeNavigationItems,b=e.children,g=e.errors,x=e.footerOffset,j=e.headerOffset,y=e.mainContainerFooter,k=e.mainContainerHeader,Z=e.mainContainerRef,P=e.page,O=e.pipeline,C=e.setAfterHidden,w=e.setAfterWidthForChildren,_=e.setBeforeHidden,I=e.setErrors,E=e.setMainContainerWidth,T=(0,kn.i)().width,M=(0,f.useState)((0,yn.U2)(yn.L8,Oi.Zt)),D=M[0],B=M[1],R=(0,f.useState)((0,yn.U2)(yn.J3,Oi.ve)),A=R[0],N=R[1],L=(0,f.useState)(!1),F=L[0],U=L[1],H=(0,f.useState)(!1),z=H[0],G=H[1],W=l,V=C;if(!V){var q=(0,f.useState)(!!(0,yn.U2)(yn.zg)),Y=(0,r.Z)(q,2);W=Y[0],V=Y[1]}var X=h,Q=_;if(!Q){var $=(0,f.useState)(!!(0,yn.U2)(yn.Uu)),ee=(0,r.Z)($,2);X=ee[0],Q=ee[1]}(0,f.useEffect)((function(){null===Z||void 0===Z||!Z.current||F||z||null===E||void 0===E||E(Z.current.getBoundingClientRect().width)}),[F,z,W,D,X,A,Z,E,T]),(0,f.useEffect)((function(){F||(null===w||void 0===w||w(D),(0,yn.t8)(yn.L8,D))}),[F,D,w]),(0,f.useEffect)((function(){z||(0,yn.t8)(yn.J3,A)}),[z,A]);var ne=K.ZP.projects.list({},{revalidateOnFocus:!1}).data,te=null===ne||void 0===ne?void 0:ne.projects,ie=(0,f.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return O&&(n.push.apply(n,[{bold:Zt.b7!==P,label:function(){return null===O||void 0===O?void 0:O.uuid},linkProps:{as:"/pipelines/".concat(null===O||void 0===O?void 0:O.uuid),href:"/pipelines/[pipeline]"}}]),Zt.b7===P&&n.push.apply(n,[{bold:!0,label:function(){return(0,J.kC)(P)}}])),(0,S.jsx)(Pi.Z,{breadcrumbs:n,project:null===te||void 0===te?void 0:te[0],version:null===te||void 0===te||null===(e=te[0])||void 0===e?void 0:e.version})}),[P,O,te]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Gn.Z,{title:null===O||void 0===O?void 0:O.name}),(0,S.jsx)(jn.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:o,afterHidden:W,afterInnerHeightMinus:u,afterMousedownActive:F,afterNavigationItems:c,afterOverflow:s,afterSubheader:a,afterWidth:D,before:d,beforeHeader:p,beforeHeightOffset:v,beforeHidden:X,beforeMousedownActive:z,beforeNavigationItems:m,beforeWidth:A,footerOffset:x,header:ie,headerOffset:j,mainContainerFooter:y,mainContainerHeader:k,mainContainerRef:Z,navigationShowMore:!0,setAfterHidden:V,setAfterMousedownActive:U,setAfterWidth:B,setBeforeHidden:Q,setBeforeMousedownActive:G,setBeforeWidth:N,children:b}),g&&(0,S.jsx)(Sn.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return I(null)},children:(0,S.jsx)(Zi.Z,wi(wi({},g),{},{onClose:function(){return I(null)}}))})]})},Si=t(55729),Ii=t(93808),Ei=t(8666),Ti=t(72226),Mi=t(29644),Di=t(46209),Bi=t(46568),Ri=t(82682),Ai=t(17679),Ni=t(61896),Li=(w.iI,Ai.O$,w.iI,Ni.dN,p.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],Oi.Wi,Ge.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),p.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*w.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),p.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),Fi=p.default.td.withConfig({displayName:"indexstyle__CellStyle",componentId:"sc-cr39lf-3"})(["display:flex;align-items:center;justify-content:space-between;border:1px solid #1C1C1C;height:100%;",""],(function(e){return!e.noPadding&&"\n padding: 0 ".concat(2*w.iI,"px;\n ")})),Ui=t(31748),Hi=t(79633);var zi=function(e){var n=e.copyText,t=e.deleteVariable,i=e.disableKeyEdit,o=e.editStateInit,u=void 0!==o&&o,c=e.fetchVariables,s=e.focusKey,a=e.hideEdit,d=e.obfuscate,p=e.onEnterCallback,h=e.onEscapeCallback,m=e.pipelineUUID,b=e.updateVariable,g=e.variable||{},x=g.uuid,j=g.value,y=(0,f.useRef)(null),Z=(0,f.useRef)(null),P=(0,f.useState)(!1),O=P[0],_=P[1],I=(0,f.useState)(x),E=I[0],T=I[1],M=(0,f.useState)(j),D=M[0],B=M[1],R=(0,f.useState)(u),A=R[0],N=R[1],L=(0,v.Db)(K.ZP.variables.pipelines.useUpdate(m,x),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){N(!1),c()}})}}),U=(0,r.Z)(L,1)[0],H=(0,f.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)),N(!1)):U({variable:{name:E,value:n}}),(0,gi.ez)(),null===p||void 0===p||p()}else"Escape"===e.key&&((0,gi.ez)(),N(!1),null===h||void 0===h||h())}),[p,h,b,U,E,D]),z=(0,f.useCallback)((function(){(0,gi.ez)(),t()}),[t]);(0,f.useEffect)((function(){var e,n;A&&(s?null===y||void 0===y||null===(e=y.current)||void 0===e||e.focus():null===Z||void 0===Z||null===(n=Z.current)||void 0===n||n.focus())}),[A,s]);var G=n||"kwargs['".concat(x,"']");return(0,S.jsx)("div",{onMouseEnter:function(){return _(!0)},onMouseLeave:function(){return _(!1)},children:(0,S.jsxs)(Ri.Z,{children:[(0,S.jsx)(Bi.Z,{hiddenSmDown:!0,md:1,children:(0,S.jsx)(Fi,{noPadding:!0,children:(0,S.jsx)(F.ZP,{backgroundColor:Ui.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(G),Wn.Am.success("Successfully copied to clipboard.",{position:Wn.Am.POSITION.BOTTOM_RIGHT,toastId:x})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(x),withIcon:!0,children:(0,S.jsx)(V.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(Bi.Z,{md:4,children:A&&!i?(0,S.jsx)(Fi,{children:(0,S.jsx)(W.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:y,small:!0,value:E})}):(0,S.jsx)(Fi,{children:(0,S.jsx)(C.ZP,{color:Hi.Or,monospace:!0,small:!0,textOverflow:!0,children:x})})}),(0,S.jsx)(Bi.Z,{md:7,children:A?(0,S.jsx)(Fi,{children:(0,S.jsx)(W.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,S.jsxs)(Fi,{children:[d?(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:"********"}):(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:j}),(0,S.jsxs)(k.Z,{children:[!a&&O&&(0,S.jsx)(F.ZP,{backgroundColor:Ui.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){N(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(x),withIcon:!0,children:(0,S.jsx)(V.I8,{size:2.5*w.iI})}),t&&O&&(0,S.jsx)(F.ZP,{backgroundColor:Ui.qJ,borderless:!0,inline:!0,muted:!0,onClick:z,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(x),withIcon:!0,children:(0,S.jsx)(V.rF,{size:2.5*w.iI})})]})]})})]})})},Gi=p.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],_e.n_,1.5*w.iI,w.l4,(function(e){return"\n border: ".concat(_e.YF,"px ").concat(_e.M8," ").concat((e.theme||we.Z).interactive.defaultBorder,";\n ")})),Wi=t(68781);function Ki(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 Vi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ki(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ki(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qi={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},Yi={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},Xi=(0,wt.YW)();var Qi=function(e){e.addNewBlockAtIndex;var n,t,i,o,l=e.block,u=(e.contentByBlockUUID,e.fetchFileTree),c=e.fetchPipeline,s=e.globalDataProducts,a=e.pipeline,d=e.setSelectedBlock,p=(e.showDataIntegrationModal,e.showUpdateBlockModal),h=(0,f.useRef)(null),m=(0,f.useRef)(null),b=(0,f.useMemo)((function(){return null===a||void 0===a?void 0:a.uuid}),[a]),y=(0,f.useMemo)((function(){return(null===a||void 0===a?void 0:a.retry_config)||{}}),[a]),_=(0,f.useMemo)((function(){return!(null!==a&&void 0!==a&&a.run_pipeline_in_one_process)&&[H.qL.PYSPARK,H.qL.PYTHON].includes(null===a||void 0===a?void 0:a.type)}),[a]),I=l.color,E=l.configuration,T=l.language,M=l.name,B=l.type,R=l.uuid,A=(0,f.useMemo)((function(){return g.tf.DBT===B}),[B]),N=null===a||void 0===a||null===(n=a.blocks)||void 0===n?void 0:n.findIndex((function(e){return e.uuid===R})),L=(0,f.useMemo)((function(){var e;return null===a||void 0===a||null===(e=a.blocks)||void 0===e?void 0:e[N]}),[N,null===a||void 0===a?void 0:a.blocks]),U=(0,ee.VI)(null,{},[],{uuid:"BlockSettings/index"}),q=(0,r.Z)(U,1)[0],Y=(0,f.useMemo)((function(){return(0,Ie.HK)(s||[],(function(e){return e.uuid}))}),[s]),Q=(0,f.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&&Y)return null===Y||void 0===Y?void 0:Y[n]}),[E,Y]),ne=K.ZP.pipelines.detail(Ei.b.PIPELINE===(null===Q||void 0===Q?void 0:Q.object_type)&&(null===Q||void 0===Q?void 0:Q.object_uuid)).data,te=(0,f.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.pipeline}),[ne]),ie=(0,f.useState)(null),oe=ie[0],re=ie[1],le=(0,f.useState)(!1),ce=le[0],ae=le[1],pe=(0,f.useState)(!1),fe=pe[0],ve=pe[1],he=(0,f.useState)(!1),be=he[0],ge=he[1],xe=(0,ct.Z)(l);(0,f.useEffect)((function(){(null===xe||void 0===xe?void 0:xe.uuid)!==(null===l||void 0===l?void 0:l.uuid)&&re(l)}),[l,xe]);var ye=(0,f.useMemo)((function(){return(null===oe||void 0===oe?void 0:oe.retry_config)||{}}),[oe]),ke=(0,f.useCallback)((function(e){ae(!0),re(e)}),[]),Pe=(0,f.useMemo)((function(){return(0,je.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,f.useCallback)((function(e){return ke((function(n){return Vi(Vi({},n),{},{configuration:Vi(Vi({},null===oe||void 0===oe?void 0:oe.configuration),e)})}))}),[null===oe||void 0===oe?void 0:oe.configuration,ke]),we=(0,f.useMemo)((function(){return null===oe||void 0===oe?void 0:oe.executor_type}),[oe]);(0,f.useEffect)((function(){fe||!we||Wi.R.find((function(e){return e===we}))||ve(!0)}),[fe,we]);var _e=K.ZP.blocks.pipelines.detail(b,encodeURIComponent(R),{_format:"with_settings",block_type:B}).data,Se=(0,f.useMemo)((function(){return(null===_e||void 0===_e?void 0:_e.block)||{}}),[_e]),Ee=(0,f.useMemo)((function(){return null!==Se&&void 0!==Se&&Se.pipelines?Object.values(null===Se||void 0===Se?void 0:Se.pipelines):[]}),[Se]),Te=(null===Ee||void 0===Ee?void 0:Ee.length)||1,Me=(0,v.Db)(K.ZP.blocks.pipelines.useUpdate(b,encodeURIComponent(R)),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){ae(!1),u(),c(),null!==e&&void 0!==e&&e.block&&d(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return q({errors:n,response:e})}})}}),De=(0,r.Z)(Me,2),Be=De[0],Re=De[1].isLoading,Ae=((0,f.useCallback)((function(e){return Be({block:e})}),[Be]),(0,f.useMemo)((function(){return Te>=1&&(0,S.jsx)(se.cl,{children:(0,S.jsx)(Ze.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===a||void 0===a?void 0:a.uuid)===o?(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,children:[i||o," (current)"]},"name"):(0,S.jsx)(P.Z,{href:"/pipelines/".concat(o,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||o},"name"),(0,S.jsx)(C.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[Ee,Te,a])),Ne=(0,f.useMemo)((function(){return y&&"undefined"!==typeof y&&!(0,je.Qr)(y)&&("undefined"!==typeof(null===y||void 0===y?void 0:y.delay)&&"undefined"===typeof(null===ye||void 0===ye?void 0:ye.delay)||"undefined"!==typeof(null===y||void 0===y?void 0:y.exponential_backoff)&&"undefined"===typeof(null===ye||void 0===ye?void 0:ye.exponential_backoff)||"undefined"!==typeof(null===y||void 0===y?void 0:y.max_delay)&&"undefined"===typeof(null===ye||void 0===ye?void 0:ye.max_delay)||"undefined"!==typeof(null===y||void 0===y?void 0:y.retries)&&"undefined"===typeof(null===ye||void 0===ye?void 0:ye.retries))}),[ye,y]),Le=(0,f.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,f.useCallback)((function(e){return ke((function(n){var t;return Vi(Vi({},n),{},{configuration:Vi(Vi({},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,ke]),Ue=(0,f.useMemo)((function(){return(0,de.jO)(l,a)}),[l,a]);return(0,f.useMemo)((function(){return Ue&&(0,de.Uc)(l)}),[l,Ue]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.HN,pt:w.cd,children:[Te>1&&(0,S.jsx)(O.Z,{mb:w.Mq,px:w.cd,children:(0,S.jsx)(Gi,{children:(0,S.jsxs)(Z.ZP,Vi(Vi({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{children:[(0,S.jsx)(V.BG,{fill:Hi.$R,size:X.l2}),(0,S.jsx)(O.Z,{pr:2}),(0,S.jsxs)(C.ZP,{bold:!0,large:!0,lineHeight:3*w.iI,warning:!0,children:["Shared by ",Te," pipelines"]})]}),!A&&(null===a||void 0===a?void 0:a.type)!==H.qL.INTEGRATION&&(0,S.jsx)(Oe.Z,{appearBefore:!0,block:!0,label:"Duplicates block so it is no longer shared with any other pipelines (detaches other pipeline associations)",lightBackground:!0,maxWidth:30*w.iI,size:null,children:(0,S.jsx)(D.ZP,Vi(Vi({},qi),{},{afterIcon:(0,S.jsx)(V.L9,{size:X.bL}),iconOnly:!1,onClick:function(){return p(Vi(Vi({},(0,je.gR)(L,["all_upstream_blocks_executed","callback_blocks","conditional_blocks","downstream_blocks","executor_config","executor_type","name","outputs","retry_config","status","tags","timeout"])),{},{detach:!0}),"".concat(M,"_copy"),!0)},padding:null,children:"Detach"}))})]}))})}),(0,S.jsx)(O.Z,{mb:w.HN,px:w.cd,children:(0,S.jsxs)(me.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,Vi(Vi({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Name"})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(D.ZP,Vi(Vi({},qi),{},{afterIcon:A?null:(0,S.jsx)(V.I8,{size:X.bL}),disabled:A,onClick:function(){return p(l,M)},children:(0,S.jsx)(C.ZP,{bold:!0,children:M||""})}))]}))}),g.tf.CUSTOM===(null===l||void 0===l?void 0:l.type)?(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,Vi(Vi({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Color"})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(D.ZP,Vi(Vi({},qi),{},{afterIcon:(0,S.jsx)(j.Z,{color:I?Xi[I]:null,size:X.bL,square:!0}),onClick:function(){return p(l,M)},outline:!1,children:(0,S.jsx)(C.ZP,{bold:!0,children:(0,J.kC)(I||"")})}))]}))}):null]})}),(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ue.Z,{level:5,children:"Executor type"}),(0,S.jsxs)(C.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/compute-resource#2-set-executor-type-and-customize-the-compute-resource-of-the-mage-executor",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(O.Z,{mt:1,children:[!fe&&(0,S.jsx)(z.Z,{label:"Executor type",onChange:function(e){return ke((function(n){return Vi(Vi({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:h,value:(null===oe||void 0===oe?void 0:oe.executor_type)||"",children:Wi.R.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}),fe&&(0,S.jsx)(W.Z,{label:"Executor type",monospace:!0,onChange:function(e){return ke((function(n){return Vi(Vi({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:m,setContentOnMount:!0,value:(null===oe||void 0===oe?void 0:oe.executor_type)||""}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{muted:!0,onClick:function(){fe?(ke((function(e){return Vi(Vi({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===m||void 0===m||null===(e=m.current)||void 0===e?void 0:e.focus()}),1),ve(!fe)},preventDefault:!0,small:!0,children:fe?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ue.Z,{level:5,children:"Retry configuration"}),(0,S.jsxs)(C.ZP,{muted:!0,children:[Ne&&(0,S.jsxs)(S.Fragment,{children:["This block is currently using the retry configuration from the pipeline. You can override the pipeline\u2019s retry configuration for this block.",(0,S.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(W.Z,{label:"Retries",monospace:!0,onChange:function(e){return ke((function(n){var t;return Vi(Vi({},n),{},{retry_config:Vi(Vi({},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===y||void 0===y?void 0:y.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ye||void 0===ye?void 0:ye.retries)?null===ye||void 0===ye?void 0:ye.retries:(null===y||void 0===y?void 0:y.retries)||""}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(W.Z,{label:"Delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return Vi(Vi({},n),{},{retry_config:Vi(Vi({},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===y||void 0===y?void 0:y.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ye||void 0===ye?void 0:ye.delay)?null===ye||void 0===ye?void 0:ye.delay:(null===y||void 0===y?void 0:y.delay)||""}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(W.Z,{label:"Max delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return Vi(Vi({},n),{},{retry_config:Vi(Vi({},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===y||void 0===y?void 0:y.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ye||void 0===ye?void 0:ye.max_delay)?null===ye||void 0===ye?void 0:ye.max_delay:(null===y||void 0===y?void 0:y.max_delay)||""})]}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(x.Z,{checked:"undefined"===typeof(null===ye||void 0===ye?void 0:ye.exponential_backoff)&&"undefined"!==typeof(null===y||void 0===y?void 0:y.exponential_backoff)?!(null===y||void 0===y||!y.exponential_backoff):!(null===ye||void 0===ye||!ye.exponential_backoff),label:"Exponential backoff",onClick:function(){return ke((function(e){var n;return Vi(Vi({},e),{},{retry_config:Vi(Vi({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===ye||void 0===ye?void 0:ye.exponential_backoff)&&"undefined"!==typeof(null===y||void 0===y?void 0:y.exponential_backoff)?!(null!==y&&void 0!==y&&y.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),_&&(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ue.Z,{level:5,children:"Block run timeout"}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(W.Z,{label:"Time in seconds",monospace:!0,onChange:function(e){return ke((function(n){return Vi(Vi({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null===oe||void 0===oe?void 0:oe.timeout)||""}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(C.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,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ue.Z,{level:5,children:"dbt settings"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(x.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 ke((function(e){var n,t,i;return Vi(Vi({},e),{},{configuration:Vi(Vi({},null===e||void 0===e?void 0:e.configuration),{},{dbt:Vi(Vi({},null===e||void 0===e||null===(n=e.configuration)||void 0===n?void 0:n.dbt),{},{disable_tests:!(null!==e&&void 0!==e&&null!==(t=e.configuration)&&void 0!==t&&null!==(i=t.dbt)&&void 0!==i&&i.disable_tests)})})})}))}})})]}),g.Lk.includes(B)&&g.t6.PYTHON===T&&(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{level:5,children:"Block variables"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(F.ZP,{Icon:V.mm,blackBorder:!0,halfPaddingBottom:!0,halfPaddingTop:!0,inline:!0,onClick:function(){return ge((function(e){return!e}))},smallIcon:!0,uuid:"Sidekick/BlockSettings/addNewBlockVariable",children:"New"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,mt:1,children:[(0,S.jsxs)(C.ZP,{muted:!0,children:["Press",(0,S.jsx)(C.ZP,Vi(Vi({},Yi),{},{children:" Enter"}))," or",(0,S.jsx)(C.ZP,Vi(Vi({},Yi),{},{children:" Return"}))," on a row to add or update a variable. These variables are only accessible in this block\xa0",(0,S.jsxs)(C.ZP,Vi(Vi({},Yi),{},{bold:!1,children:["(",R,")."]})),(0,S.jsxs)(C.ZP,{inline:!0,muted:!0,children:[" Refer to the",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/variables/block-variables",openNewWindow:!0,children:" documentation"})," for more details."]})]}),(0,S.jsxs)(C.ZP,{muted:!0,children:[(0,S.jsx)(C.ZP,{bold:!0,inline:!0,warning:!0,children:"Note: "}),"Click the",(0,S.jsx)(C.ZP,Vi(Vi({},Yi),{},{children:" Update block settings"}))," button below to save changes. If you do not, any new or updated block variables will not be persisted."]})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[be&&(0,S.jsx)(zi,{editStateInit:!0,focusKey:!0,onEnterCallback:function(){return ge(!1)},onEscapeCallback:function(){return ge(!1)},updateVariable:Ce},"new_block_variable"),null===(o=Object.entries(Pe))||void 0===o?void 0:o.map((function(e){var n=e[0];return(0,S.jsx)(zi,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=Vi({},null===oe||void 0===oe?void 0:oe.configuration);delete e[n],ke((function(n){return Vi(Vi({},n),{},{configuration:Vi({},e)})}))},disableKeyEdit:!0,updateVariable:Ce,variable:{uuid:n,value:e[1]}},n)}))]})]}),g.tf.GLOBAL_DATA_PRODUCT===B&&(0,S.jsxs)(O.Z,{mb:w.HN,children:[(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(ue.Z,{level:5,children:"Override global data product settings"})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(Ti.Z,{objectAttributes:Le,originalAttributes:Q,setObjectAttributes:Fe})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(Mi.Z,{objectAttributes:Le,originalAttributes:Q,setObjectAttributes:Fe})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(Di.Z,{blocks:null===te||void 0===te?void 0:te.blocks,objectAttributes:Le,originalAttributes:Q,setObjectAttributes:Fe})})]}),(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(D.ZP,{disabled:!ce,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:ye,timeout:null===oe||void 0===oe?void 0:oe.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,S.jsxs)(O.Z,{mb:w.HN,children:[!_e&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(G.Z,{inverted:!0})}),_e&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(ue.Z,{level:5,children:["Pipelines using this block (",Te,")"]}),(0,S.jsx)(C.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]})]})]})},Ji=t(4006),$i=t(12869),eo=t(10305),no=t(84820),to=t(85108),io=t(97301);function oo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ro(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?oo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function lo(e,n){var t,i,o,u,c=e.autocompleteItems,s=e.block,a=e.blockRefs,d=e.blocks,h=e.deleteWidget,m=e.executionState,b=e.fetchPipeline,x=e.fetchFileTree,j=e.messages,y=void 0===j?[]:j,I=e.onChangeContent,E=e.pipeline,T=e.runBlock,M=e.runningBlocks,D=e.savePipelineContent,B=e.selected,R=e.setAnyInputFocused,A=e.setErrors,N=e.setSelectedBlock,L=e.setTextareaFocused,U=e.textareaFocused,H=e.updateWidget,q=e.width,Y=(0,f.useRef)(null),X=(0,f.useContext)(p.ThemeContext),Q=K.ZP.blocks.pipelines.detail(null===E||void 0===E?void 0:E.uuid,null===s||void 0===s?void 0:s.upstream_blocks[0]).data,ee=(null===Q||void 0===Q||null===(t=Q.block)||void 0===t?void 0:t.outputs)||(null===s||void 0===s?void 0:s.outputs)||[],ne=(0,f.useState)(null),te=ne[0],ie=ne[1],oe=(0,f.useState)(null===(i=s.configuration)||void 0===i?void 0:i.chart_type),re=oe[0],ue=oe[1],ce=(0,f.useState)(s.configuration),se=ce[0],ae=ce[1],de=(0,f.useState)(s.content),pe=de[0],fe=de[1],ve=(0,f.useState)(!re||0===ee.length),he=ve[0],me=ve[1],be=(0,f.useState)(!1),ge=be[0],xe=be[1],ye=(0,f.useState)(null),Ze=ye[0],Pe=ye[1],Ce=(0,f.useState)(null===s||void 0===s?void 0:s.upstream_blocks),_e=Ce[0],Se=Ce[1],Ee=(0,f.useState)((null===ee||void 0===ee?void 0:ee.length)||0),Te=Ee[0],Me=Ee[1],De=(0,f.useState)(s.uuid),Be=De[0],Re=De[1],Ae=to.G8[re],Ne=to.x8[re],Le=(0,f.useMemo)((function(){return null===d||void 0===d?void 0:d.filter((function(e){var n=e.type;return[g.tf.DATA_LOADER,g.tf.TRANSFORMER].includes(n)}))}),[d]),Fe=(0,f.useMemo)((function(){return(0,Ie.HK)(Le,(function(e){return e.uuid}))}),[Le]),Ue=!!M.find((function(e){return e.uuid===s.uuid}))||(null===y||void 0===y?void 0:y.length)>=1&&m!==bt.uF.IDLE,He=(0,f.useMemo)((function(){return null===y||void 0===y?void 0:y.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[y]),ze=!!He.find((function(e){return e.error})),Ge=He.length>=1,We=(0,f.useMemo)((function(){return{blockType:s.type,hasError:ze,selected:B}}),[s.type,ze,B]);if(null!==He&&void 0!==He&&He.length){var Ke,Ve,qe=He.length-1;u=null===He||void 0===He||null===(Ke=He[qe])||void 0===Ke||null===(Ve=Ke.data)||void 0===Ve?void 0:Ve[0]}u?(u=(u=u.slice(1,u.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,J.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;bt.Gi.TEXT===i&&(0,J.Pb)(t)&&(o[r]=JSON.parse(t))})));var Ye=(0,f.useCallback)((function(e){var n=ro(ro(ro({},s),e),{},{configuration:ro(ro({},s.configuration),e.configuration)});D().then((function(){T({block:n,code:pe,ignoreAlreadyRunning:!0,runUpstream:!!_e.find((function(e){var n;return![g.DA.EXECUTED,g.DA.UPDATED].includes(null===(n=Fe[e])||void 0===n?void 0:n.status)}))})})),Me((function(e){return e+1}))}),[s,Fe,pe,T,D,Me,_e]),Xe=(0,f.useCallback)((function(e){fe(e),I(e)}),[I,fe]),Qe=(0,f.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;ae((function(n){return ro(ro({},n),e)}));var i=ro(ro({},s),{},{configuration:ro(ro(ro({},se),e),{},{chart_type:re})});H(i),Te&&t&&Ye(i)}),[s,re,se,Te,Ye,ae,H]);(0,f.useEffect)((function(){ie({python:(0,no.Z)({autocompleteItems:c,block:s,blocks:d,pipeline:E})})}),[c,s,d,E]);var Je=(0,f.useMemo)((function(){return(0,S.jsx)(le.Z,{autoHeight:!0,autocompleteProviders:te,onChange:Xe,selected:B,setSelected:function(e){return N(!0===e?s:null)},setTextareaFocused:L,showLineNumbers:!1,textareaFocused:U||mi.oV.TABLE===re&&!he,value:pe,width:"100%"})}),[te,s,re,pe,he,B,N,L,U,Xe]),$e=(0,f.useMemo)((function(){return(ze||Ge)&&(0,S.jsx)($i.Z,ro(ro({},We),{},{block:s,contained:!1,hideExtraInfo:!0,isInProgress:Ue,messages:He,selected:B}))}),[s,We,ze,Ge,Ue,He,B]),en=(0,ct.Z)(he),nn=(0,ct.Z)(q);(0,f.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?(Pe(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&&Pe(t)}),100)):n&&Pe(n.width)}),[he,en,Y,Pe,q,nn]);var tn=(0,f.useMemo)((function(){var e=[];return _e.forEach((function(n,t){var i=Fe[n],o=(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:X}).accent;e.push((0,S.jsxs)(O.Z,{ml:2,children:[(0,S.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(P.Z,{color:o,inline:!0,onClick:function(){var e,n,t=null===a||void 0===a||null===(e=a.current)||void 0===e?void 0:e["".concat(null===i||void 0===i?void 0:i.type,"s/").concat(null===i||void 0===i?void 0:i.uuid,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,S.jsx)(C.ZP,{color:o,monospace:!0,small:!0,children:n})})]},n))})),e}),[a,Fe,X,_e]),on=(0,f.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 mi.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=se[e];if(t){var i,o,r=null===(i=to.SR[re])||void 0===i||null===(o=i[e])||void 0===o?void 0:o.call(i);n.push((0,S.jsxs)(O.Z,{ml:2,children:[(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(C.ZP,{default:!0,inline:!0,small:!0,children:r})]})]},t))}})),n}),[re,se,Ae]),rn=(0,ct.Z)(re),ln=(0,ct.Z)(_e);(0,f.useEffect)((function(){if((!rn&&re&&null!==_e&&void 0!==_e&&_e.length||(null===ln||void 0===ln||!ln.length)&&(null===_e||void 0===_e?void 0:_e.length)>=1&&re)&&!pe&&(0,je.Qr)(se)&&Ne){var e=ro(ro({},s),{},{upstream_blocks:_e});Ne.configuration&&Qe(Ne.configuration(e)),Ne.content&&Xe(Ne.content(e))}}),[s,re,rn,se,pe,Ne,Qe,Xe,_e,ln]);var un=(0,f.useMemo)((function(){return se[mi.v8]||1}),[se]),cn=(0,f.useMemo)((function(){return Object.entries(Ae||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0],o=t[1];return ro(ro({},e),{},(0,l.Z)({},i,o.map((function(e){var n,t=e.autoRun,i=e.label,o=e.monospace,r=e.options,u=e.settings,c=void 0===u?{}:u,a=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,J.kC)(i()),monospace:o,onBlur:function(){return N(s)},onChange:function(e){return Qe((0,l.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return N(s)},value:(null===se||void 0===se?void 0:se[d])||""},f=(null!==Q&&void 0!==Q&&Q.block?[Q.block]:[]).reduce((function(e,n){var t=n.outputs;return t?e.concat(t.reduce((function(e,n){var t=n.sample_data;return null!==t&&void 0!==t&&t.columns?e.concat(t.columns):e}),[])):e}),[]);if(to.VR.COLUMNS===a){var v=se[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(!c.maxValues||v.length<c.maxValues)&&(0,S.jsx)(z.Z,ro(ro({},p),{},{onChange:function(e){var n=se[d]||[],i=e.target.value;n.includes(i)?n=(0,Ie.Od)(n,(function(e){return e===i})):n.push(i),Qe((0,l.Z)({},d,n),{autoRun:t})},value:null,children:(0,Ie.YC)(f.filter((function(e){return!v.includes(e)})),(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),v.map((function(e){return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){Qe((0,l.Z)({},d,(0,Ie.Od)(v,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(to.VR.METRICS===a){var h=se[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{bold:!0,children:"Metrics"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,S.jsxs)(eo.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]}))||(Qe((0,l.Z)({},d,h.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),o([null,null]),i()))},children:[(0,S.jsx)(z.Z,ro(ro({},p),{},{label:"aggregation",children:(0,Ie.YC)(mi.bn,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),(0,S.jsx)(z.Z,ro(ro({},p),{},{label:"column",children:(0,Ie.YC)(f,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}))]}),h.map((function(e){var n=e.aggregation,i=e.column;return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(ke.Z,{label:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){Qe((0,l.Z)({},d,(0,Ie.Od)(h,(function(e){var t=e.aggregation,o=e.column;return n===t&&i===o}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=r?(0,S.jsx)(z.Z,ro(ro({},p),{},{children:r.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})):(0,S.jsx)(W.Z,ro(ro({},p),{},{type:a}));return(0,S.jsx)(O.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[s,se,Ae,Q,N,Qe]),sn=cn.code,an=cn.noCode,dn=(0,v.Db)(K.ZP.widgets.pipelines.useUpdate(null===E||void 0===E?void 0:E.uuid,s.uuid),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){xe(!1),b(),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(s.uuid),vn=(0,Rn.y)(),hn=vn.registerOnKeyDown,mn=vn.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){mn(fn)}}),[mn,fn]),hn(fn,(function(e,n,t){ge&&String(t[0])===String(Mn.Uq)&&String(t[1])!==String(Mn.zX)&&pn({widget:ro(ro({},s),{},{name:Be})})}),[s,ge,Be,pn]),(0,S.jsx)(Bi.Z,{sm:12,md:12*un,children:(0,S.jsxs)(io.pM,{ref:n,children:[(0,S.jsx)(O.Z,{mt:1,pt:1,px:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flex:1,style:{position:"relative"},children:[(0,S.jsx)(Rt,{bold:!1,fullWidth:!0,inputValue:Be,notRequired:!0,onBlur:function(){return setTimeout((function(){return xe(!1)}),300)},onChange:function(e){Re(e.target.value),e.preventDefault()},onClick:function(){R(!0),xe(!0)},onFocus:function(){R(!0),xe(!0)},small:!0,stacked:!0,value:!ge&&s.uuid}),ge&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(P.Z,{noWrapping:!0,onClick:function(){return pn({widget:ro(ro({},s),{},{name:Be})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(z.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=ro(ro({},s),{},{upstream_blocks:n});H(t),Ye(t),Se(n)},placeholder:"Source block",small:!0,value:(null===_e||void 0===_e?void 0:_e[0])||"",children:null===Le||void 0===Le?void 0:Le.map((function(e){var n=e.uuid;return(0,S.jsx)("option",{value:n,children:n},n)}))}),(0,S.jsx)(O.Z,{mr:1}),!Ue&&(0,S.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,S.jsx)(F.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Ye(s)},uuid:"ChartBlock/run/".concat(s.uuid),children:(0,S.jsx)(V.Py,{size:2*w.iI})})}),bt.uF.QUEUED===m&&(0,S.jsx)(G.Z,{color:(X||we.Z).content.active,small:!0,type:"cylon"}),bt.uF.BUSY===m&&(0,S.jsx)(G.Z,{color:(X||we.Z).content.active,small:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,S.jsx)(F.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return me((function(e){return!e}))},selected:he,uuid:"ChartBlock/edit/".concat(s.uuid),children:(0,S.jsx)(V.I8,{size:2*w.iI})})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,S.jsx)(F.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return h(s)},uuid:"ChartBlock/delete/".concat(s.uuid),children:(0,S.jsx)(V.rF,{size:2*w.iI})})})]})]})}),(0,S.jsx)(O.Z,{mt:1}),(0,S.jsxs)(Z.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:6,ref:Y,children:o&&!(0,je.Qr)(o)&&(0,S.jsx)(O.Z,{pb:3,children:(0,S.jsx)(Ji.Z,{block:ro(ro({},s),{},{configuration:ro(ro({},s.configuration),se)}),data:o,width:Ze})})}),he&&(0,S.jsx)(io.Tb,{children:(0,S.jsxs)(Z.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(z.Z,{onChange:function(e){var n=e.target.value,t=ro(ro({},s),{},{configuration:ro(ro({},se),{},{chart_type:n})});H(t),Ye(t),ue(n)},placeholder:"Select chart type",value:re,children:mi.CK.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,J.kC)(e)},e)}))})}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(z.Z,{onChange:function(e){return Qe((0,l.Z)({},mi.v8,e.target.value))},placeholder:"Chart width",value:(null===se||void 0===se?void 0:se[mi.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return(0,S.jsx)("option",{value:i,children:t},t)}))})}),an]})})]}),he&&!(null===sn||void 0===sn||!sn.length)&&g.t6.SQL!==s.language&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{my:1,px:1,children:[(0,S.jsx)(C.ZP,{bold:!0,children:"Custom chart code"}),(0,S.jsxs)(C.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,S.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,S.jsxs)(io.T7,{children:[_e.length>=1&&(0,S.jsxs)(io.y9,{children:[(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",tn]}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",on]})]}),Je]})]}),$e&&(0,S.jsx)(O.Z,{px:1,children:$e})]})})}var uo=f.forwardRef(lo),co=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function so(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 ao(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?so(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):so(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var po=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,o=e.deleteWidget,r=e.messages,u=e.onChangeChartBlock,c=e.runBlock,s=e.runningBlocks,a=e.savePipelineContent,d=e.selectedBlock,p=e.setAnyInputFocused,v=e.setErrors,h=e.setSelectedBlock,m=e.setTextareaFocused,b=e.textareaFocused,g=e.updateWidget,x=e.widgets,j=e.width,y=(0,be.Z)(e,co),k=(0,f.useMemo)((function(){return s.reduce((function(e,n,t){return ao(ao({},e),{},(0,l.Z)({},n.uuid,ao(ao({},n),{},{priority:t})))}),{})}),[s]);return(0,S.jsxs)(Z.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(Ri.Z,{fullHeight:!0,style:{marginLeft:.5*w.iI,marginRight:.5*w.iI},children:null===x||void 0===x?void 0:x.map((function(e){var l=e.uuid,x=k[l],Z=x?0===x.priority?bt.uF.BUSY:bt.uF.QUEUED:bt.uF.IDLE;return i.current[l]=(0,f.createRef)(),(0,f.createElement)(uo,ao(ao({},y),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:o,executionState:Z,key:l,messages:r[l],onChangeContent:function(e){return u(l,e)},ref:i.current[l],runBlock:c,runningBlocks:s,savePipelineContent:a,selected:(null===d||void 0===d?void 0:d.uuid)===l,setAnyInputFocused:p,setErrors:v,setSelectedBlock:h,setTextareaFocused:m,textareaFocused:b,updateWidget:g,width:j}))}))}),(0,S.jsx)("div",{style:{height:"80vh"}})]})},fo=t(24138),vo=p.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),ho=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,o=void 0===i?"0 0 358 305":i;return(0,S.jsxs)(vo,{height:t*(305/358),viewBox:o,width:t,children:[(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M290 47H66c-3.866 0-7 3.134-7 7v200c0 3.866 3.134 7 7 7h224c3.866 0 7-3.134 7-7V54c0-3.866-3.134-7-7-7zM66 46c-4.4183 0-8 3.5817-8 8v200c0 4.418 3.5817 8 8 8h224c4.418 0 8-3.582 8-8V54c0-4.4183-3.582-8-8-8H66z",fill:"#000"}),(0,S.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,S.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,S.jsx)("rect",{x:"209.651",y:"17.1125",width:"1.0163",height:"14.2284",rx:".5082",transform:"rotate(24.933 209.651 17.1125)",fill:"#2AB2FE"}),(0,S.jsx)("path",{fill:"#2AB2FE",d:"M207.788 23.5313l35.4813 16.4949-.4285.9215-35.4812-16.4948zM247.033 31.9316c.946-2.0359 3.364-2.9191 5.4-1.9726l31.795 14.7811-11.383 24.4836-31.794-14.7811c-2.036-.9465-2.92-3.3642-1.973-5.4002l7.955-17.1108z"}),(0,S.jsx)("path",{d:"M284.228 44.7401l31.795 14.7811c2.036.9465 2.919 3.3642 1.972 5.4001l-7.954 17.1109c-.947 2.0359-3.365 2.9191-5.401 1.9726l-31.795-14.7811 11.383-24.4836z",fill:"#0093E4"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M352.959 83.7347a.5082.5082 0 00-.675.2466l-2.571 5.5296-35.481-16.4949-.428.9216 35.481 16.4949-2.571 5.5295a.5081.5081 0 00.247.675.5082.5082 0 00.675-.2466l5.57-11.9806a.5083.5083 0 00-.247-.6751z",fill:"#2AB2FE"}),(0,S.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("path",{d:"M337.354 256.065a38.3848 38.3848 0 01-10.816 21.271 38.3722 38.3722 0 01-21.293 10.768 38.3787 38.3787 0 01-23.542-3.895 38.3764 38.3764 0 01-16.691-17.054l17.208-8.494a19.1932 19.1932 0 0020.117 10.475 19.189 19.189 0 0010.647-5.385c2.886-2.88 4.78-6.605 5.407-10.635l18.963 2.949z",fill:"#FF3C3C"}),(0,S.jsx)("path",{d:"M294.876 288.277a38.3849 38.3849 0 01-21.64-10.056 38.3818 38.3818 0 01-11.516-20.899 38.3896 38.3896 0 013.06-23.666 38.386 38.386 0 0116.453-17.283l9.098 16.897a19.1904 19.1904 0 00-9.757 20.474 19.1937 19.1937 0 005.758 10.45 19.194 19.194 0 0010.82 5.028l-2.276 19.055z",fill:"#2ECDF7"}),(0,S.jsx)("path",{d:"M275.892 219.85a38.3804 38.3804 0 0145.342-1.268 38.3803 38.3803 0 0114.45 18.989 38.3873 38.3873 0 01.436 23.858l-18.346-5.631a19.1827 19.1827 0 00-.218-11.929 19.1907 19.1907 0 00-7.225-9.495 19.1875 19.1875 0 00-11.439-3.39 19.192 19.192 0 00-11.232 4.024l-11.768-15.158z",fill:"#885EFF"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M259.206 102.57c.241.135.327.439.193.68l-39.314 70.576c-.613 1.1-1.962 1.565-3.124 1.093-3.766-1.53-13.762-5.285-26.356-7.597-12.6-2.314-27.762-3.177-41.881 1.037-16.112 4.81-27.78 14.07-35.424 22.135-3.822 4.032-6.635 7.763-8.491 10.483-.928 1.36-1.616 2.467-2.072 3.232-.228.383-.397.68-.509.881-.057.1-.098.177-.126.227l-.03.057-.008.014-.001.003a.5008.5008 0 01-.676.21.5005.5005 0 01-.209-.676l.442.233-.442-.233.001-.001.002-.005.009-.016.033-.062c.03-.055.073-.135.132-.239.116-.208.29-.513.523-.904.465-.782 1.165-1.906 2.105-3.285 1.881-2.756 4.727-6.53 8.591-10.607 7.727-8.153 19.539-17.532 35.864-22.405 14.331-4.278 29.668-3.391 42.347-1.063 12.685 2.329 22.748 6.109 26.552 7.654.699.284 1.51.002 1.875-.653l39.313-70.575a.5008.5008 0 01.681-.194z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M221.651 176.111c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM157.778 166.428c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM106.428 204.191c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.8726-1.734-3.8726-3.873 0-2.139 1.7336-3.873 3.8726-3.873s3.873 1.734 3.873 3.873zM262.35 104.459c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M8.5523 214.855c-.3562-1.045.2025-2.181 1.248-2.538l13.7251-4.677c1.0456-.356 2.1819.203 2.5382 1.248l29.6737 87.084-17.5112 5.967-29.6738-87.084z",fill:"#4776FF"}),(0,S.jsx)("path",{d:"M45.0935 264.735c-.3562-1.045.2025-2.182 1.2481-2.538l13.725-4.677c1.0455-.356 2.1819.203 2.5382 1.248l10.6438 31.237-17.5112 5.967-10.6439-31.237z",fill:"#FFCC19"}),(0,S.jsx)("path",{d:"M54.4607 234.868c-.3563-1.046.2025-2.182 1.248-2.538l13.7251-4.677c1.0455-.356 2.1819.202 2.5382 1.248l18.7879 55.137-17.5113 5.967-18.7879-55.137z",fill:"#4776FF"})]})};var mo,bo=function(e){var n=e.blocksInNotebook;return e.extensionOption,(0,f.useMemo)((function(){return(null===n||void 0===n?void 0:n.filter((function(e){var n=e.type;return g.tf.DBT===n})))||[]}),[n]),(0,S.jsx)(S.Fragment,{})};function go(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 xo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?go(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):go(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"}(mo||(mo={}));var jo=function(e){var n,t,i=e.block,o=e.blockActionDescription,r=e.blocks,l=e.inputPlaceholder,u=e.loading,c=e.onClickTag,s=e.runBlockAndTrack,a=e.supportedUpstreamBlockLanguages,d=e.supportedUpstreamBlockTypes,v=e.updateBlock,h=(0,f.useContext)(p.ThemeContext),m=(0,f.useState)(""),b=m[0],g=m[1],P=(0,f.useState)(!1),I=P[0],E=P[1],T=(0,f.useState)(null),M=T[0],B=T[1],R=(0,f.useMemo)((function(){return(0,Ie.HK)(r,(function(e){return e.uuid}))}),[r]);(0,f.useEffect)((function(){M||B((0,Ie.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,M]);var A=(0,f.useMemo)((function(){return(null===r||void 0===r?void 0:r.filter((function(e){var n=e.name,t=e.type,i=e.uuid;return((null===n||void 0===n?void 0:n.toLowerCase().includes(null===b||void 0===b?void 0:b.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===b||void 0===b?void 0:b.toLowerCase())))&&(null===d||void 0===d?void 0:d.includes(t))})))||[]}),[b,r,d]),N=(0,f.useMemo)((function(){var e=[];return null===A||void 0===A||A.forEach((function(n,t){var i=n.color,o=n.language,r=n.type,l=n.uuid,u=(0,_.qn)(r,{blockColor:i,theme:h}).accent;t>=1&&e.push((0,S.jsx)(y.Z,{light:!0},"divider-".concat(l)));var c=!(null===M||void 0===M||!M[l]),s=null!==a&&"undefined"!==typeof a&&!(null!==a&&void 0!==a&&a.includes(o));e.push((0,S.jsx)(O.Z,{px:2,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:u,size:1.5*w.iI,square:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:s,small:!0,children:l})]}),s&&(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[o," support coming soon"]}),!s&&(0,S.jsx)(x.Z,{checked:!s&&c,disabled:s,onClick:function(){B((function(e){var n=xo({},e);return c?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[A,h,M]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(Sn.Z,{onClickOutside:function(){return E(!1)},open:!0,children:[(0,S.jsx)(W.Z,{beforeIcon:(0,S.jsx)(V.HN,{}),borderless:!0,compact:!0,onChange:function(e){return g(e.target.value)},onClick:function(e){(0,Re.j)(e),E(!0)},onFocus:function(e){(0,Re.j)(e),E(!0)},placeholder:l,small:!0,value:b}),I&&(0,S.jsxs)(S.Fragment,{children:[N,(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(D.ZP,{compact:!0,loading:u,onClick:function(){return v({block:i,upstream_blocks:Object.keys(M)}).then((function(){return E(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!I&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,S.jsxs)(O.Z,{pb:1,pr:1,children:[o&&(0,S.jsx)(O.Z,{mt:1,pl:1,children:(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:o})}),(0,S.jsx)(Z.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,S.jsx)("div",{},e);var t=n.color,o=n.type,r=(0,_.qn)(o,{blockColor:t,theme:h}).accentLight;return(0,S.jsx)(O.Z,{ml:1,mt:1,children:(0,S.jsx)(D.ZP,{backgroundColor:r,compact:!0,disabled:!s,onClick:function(e){(0,Re.j)(e),c?c(n):null===s||void 0===s||s({block:xo(xo({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},yo=t(75634);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.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,o=e.blocks,u=e.blocksInNotebook,c=e.deleteBlock,s=e.extensionOption,a=e.fetchFileTree,d=e.fetchPipeline,p=e.interruptKernel,h=e.messages,m=e.onChangeCallbackBlock,b=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,y=e.runningBlocks,k=e.savePipelineContent,Z=e.selectedBlock,_=e.setAnyInputFocused,I=e.setErrors,E=e.setSelectedBlock,T=e.setTextareaFocused,M=e.showBrowseTemplates,D=e.textareaFocused,B=(0,f.useRef)(null),R=(0,f.useState)(!1),A=R[0],N=R[1],U=(s||{}).uuid,H=(x||{}).extensions,z=(0,f.useMemo)((function(){return(null===s||void 0===s?void 0:s.templates)||[]}),[s]),G=(0,f.useMemo)((function(){return null===H||void 0===H?void 0:H[U]}),[U,H]),W=(0,f.useMemo)((function(){return(null===G||void 0===G?void 0:G.blocks)||[]}),[G]),q=(0,f.useMemo)((function(){return(0,Ie.HK)(W,(function(e){return e.uuid}))}),[W]),Y=(0,f.useMemo)((function(){return U===(null===Z||void 0===Z?void 0:Z.extension_uuid)&&q[null===Z||void 0===Z?void 0:Z.uuid]}),[q,U,Z]),X=(0,f.useMemo)((function(){return y.reduce((function(e,n,t){return Zo(Zo({},e),{},(0,l.Z)({},n.uuid,Zo(Zo({},n),{},{priority:t})))}),{})}),[y]),Q=(0,v.Db)((function(e){var n=e.block,t=e.upstream_blocks;return K.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,$.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return null===I||void 0===I?void 0:I({errors:n,response:e})}})}}),J=(0,r.Z)(Q,2),ee=J[0],ne=J[1].isLoading,te=(0,f.useMemo)((function(){return W.map((function(e,n){var r=Zo(Zo({},e),{},{extension_uuid:U}),l=r.type,s=r.uuid,v=(null===Z||void 0===Z?void 0:Z.uuid)===s,P=X[s],C=P?0===P.priority?bt.uF.BUSY:bt.uF.QUEUED:bt.uF.IDLE,M="".concat(l,"s/").concat(s,".py");return i.current[M]=(0,f.createRef)(),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(L.Z,{allBlocks:o,autocompleteItems:t,block:r,blockIdx:n,blockRefs:i,blocks:o,defaultValue:r.content,deleteBlock:function(e){c(Zo(Zo({},e),{},{extension_uuid:U})),_(!1)},executionState:C,extraContent:(0,S.jsx)(jo,{block:r,blockActionDescription:"Click a block name to run expectations on it.",blocks:u,inputPlaceholder:"Select blocks to run expectations on",loading:ne,supportedUpstreamBlockLanguages:[g.t6.PYTHON],supportedUpstreamBlockTypes:[g.tf.DATA_EXPORTER,g.tf.DATA_LOADER,g.tf.DBT,g.tf.TRANSFORMER],updateBlock:ee}),fetchFileTree:a,fetchPipeline:d,hideRunButton:!0,interruptKernel:p,messages:h[s],noDivider:!0,onCallbackChange:function(e){return m(l,s,e)},onChange:function(e){return b(l,s,e)},pipeline:x,ref:i.current[M],runBlock:j,runningBlocks:y,savePipelineContent:k,selected:v,setAnyInputFocused:_,setErrors:I,setSelected:function(e){return E(!0===e?r:null)},setTextareaFocused:T,textareaFocused:v&&D})},s)}))}),[t,i,o,u,c,W,U,a,d,p,ne,h,m,b,x,j,y,X,k,Z,_,I,E,T,D,ee]),ie="Extensions/GreatExpectations/index",oe=(0,Rn.y)(),re=oe.disableGlobalKeyboardShortcuts,le=oe.registerOnKeyDown,ue=oe.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){ue(ie)}}),[ue,ie]),le(ie,(function(e,n){!re&&Y&&((0,xi.y)([Mn.zX,Mn.Um],n)||(0,xi.y)([Mn.PQ,Mn.Um],n))&&(e.preventDefault(),k())}),[Y,k]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["When a block in your pipeline runs, it\u2019ll run any tests you define in its code. All associated extension blocks will also run during that phase. Learn more about the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,S.jsx)(P.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),te,(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(Sn.Z,{onClickOutside:function(){return N(!1)},open:!0,children:(0,S.jsx)(ni.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:g.tf.EXTENSION},(null===W||void 0===W?void 0:W.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,bi.hr)((function(e){return n(Zo(Zo({},e),{},{extension_uuid:U,type:g.tf.EXTENSION}),(null===W||void 0===W?void 0:W.length)||0)}),g.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:M})),onClickCallback:function(){return N(!1)},open:A,parentRef:B,uuid:"Extension",children:(0,S.jsx)(F.ZP,{beforeElement:(0,S.jsx)(yo.Wx,{teal:!0,children:(0,S.jsx)(V.mm,{size:yo.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),N(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},Oo=t(69419),Co=["pipeline"];function wo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function _o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?wo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):wo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var So=function(e){var n=e.pipeline,t=(0,be.Z)(e,Co),i=(0,h.useRouter)(),o=K.ZP.extension_options.list().data,r=(0,f.useMemo)((function(){return(null===o||void 0===o?void 0:o.extension_options)||[]}),[o]),l=(0,f.useMemo)((function(){return(0,Ie.HK)(r,(function(e){return e.uuid}))}),[r]),u=(0,f.useState)(null),c=u[0],s=u[1],a=(0,f.useMemo)((function(){return l[c]}),[l,c]),d=(0,f.useMemo)((function(){return _o(_o({},t),{},{pipeline:n})}),[n,t]);(0,f.useEffect)((function(){var e;s(null===(e=(0,Oo.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var p=(0,f.useMemo)((function(){return n?(mo.GREAT_EXPECTATIONS===c?e=Po:mo.DBT===c&&(e=bo),e?(0,S.jsx)(e,_o(_o({},d),{},{extensionOption:a})):void 0):null;var e}),[a,n,c,d]);return(0,S.jsx)(R.W,{backend:A.PD,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[!c&&(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!o&&!c&&(0,S.jsx)(G.Z,{}),p,!c&&(null===r||void 0===r?void 0:r.map((function(e,n){var t=e.description,o=e.name,r=e.uuid;return(0,S.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,pt.u7)({extension:r},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(Vn.Z,{dark:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(De.Z,{fullWidth:!1,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)("img",{alt:o,height:3*w.iI,src:"".concat(i.basePath,"/images/extensions/").concat(r,"/logo.png"),width:3*w.iI})})})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,children:o}),(0,S.jsx)(C.ZP,{default:!0,small:!0,children:t})]})]}),(0,S.jsx)(V._Q,{})]})})})},r)})))]})})},Io=t(28385),Eo=t(9134),To=t(83784),Mo=t(30229),Do=t(8916);var Bo=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,f.useState)(!1),s=c[0],a=c[1],d=(0,f.useState)(),p=d[0],h=d[1],m=(0,f.useState)(),b=m[0],x=m[1],j=null===t||void 0===t?void 0:t.uuid,y=(0,v.Db)(K.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,$.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}))}})}}),k=(0,r.Z)(y,1)[0],_=(0,v.Db)((function(e){return K.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),I=(0,r.Z)(_,1)[0],E=(0,f.useCallback)((function(e){if("Enter"===e.key){var t=b;try{t=JSON.parse(b)}catch(i){}k({variable:{name:p,value:t}}).then((function(){n(),h(null),x(null)})),(0,gi.ez)(),a(!1)}else"Escape"===e.key&&((0,gi.ez)(),a(!1))}),[k,n,p,b]),T=(0,f.useMemo)((function(){return u-4*w.iI}),[u]),M=(0,f.useMemo)((function(){return(0,Do.wx)(l,(function(e){return e.uuid===To.C}))}),[l]),D=(0,f.useMemo)((function(){return(0,Do.wx)(l,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,l]),B=(0,f.useMemo)((function(){return(0,S.jsxs)(Li,{width:T,children:[s&&(0,S.jsxs)(Ri.Z,{children:[(0,S.jsx)(Bi.Z,{md:1,children:(0,S.jsx)(Fi,{noPadding:!0,children:(0,S.jsx)(F.ZP,{backgroundColor:Ui.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(p),Wn.Am.success("Successfully copied to clipboard.",{position:Wn.Am.POSITION.BOTTOM_RIGHT,toastId:p})},uuid:"Sidekick/GlobalVariables/".concat(p),withIcon:!0,children:(0,S.jsx)(V.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(Bi.Z,{md:4,children:(0,S.jsx)(Fi,{children:(0,S.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){h(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"variable",small:!0,value:p})})}),(0,S.jsx)(Bi.Z,{md:7,children:(0,S.jsx)(Fi,{children:(0,S.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"enter value",small:!0,value:b})})})]}),null===M||void 0===M?void 0:M.map((function(e){return(0,S.jsx)(zi,{deleteVariable:function(){return I(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[I,M,p,b,j,h,x,a,s,T]),R=(0,f.useMemo)((function(){return(0,S.jsx)(Li,{width:T,children:null===D||void 0===D?void 0:D.map((function(e){return(0,S.jsx)(zi,{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,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(F.ZP,{Icon:V.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["Press ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:B}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments (Python), interpolated variables (SQL), or vector elements (R). To load a global variable, use the following syntax:"})}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For Python (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(Eo.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For SQL (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(Eo.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For R (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(Eo.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(ue.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,S.jsx)(O.Z,{mb:w.cd}),(0,S.jsx)(C.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(Mo.Xm).map((function(e,n){var t;return(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{large:!0,monospace:!0,children:(0,J.vg)(null===(t=Mo.Z4[e])||void 0===t?void 0:t.call(Mo.Z4))})}),(0,Do.JZ)([],e).map((function(n,t){return(0,S.jsx)(zi,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),D&&D.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{my:2,children:(0,S.jsx)(ue.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,S.jsx)(O.Z,{mb:2,children:R}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{children:["Output variables can be used in any ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:g.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(Eo.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"})})]})]})},Ro=t(89565),Ao=t.n(Ro),No=t(88494),Lo=p.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Ge.y$)()),Fo=p.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],Ge.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 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 Ho(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 zo=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,f.useMemo)((function(){return(null===l||void 0===l?void 0:l.length)||0}),[l]),s=(0,f.useMemo)((function(){return c>100?l.slice(-100):l}),[c,l]),a=(0,f.useCallback)((function(){(0,gi.ez)(),i()}),[i]),d=(0,f.useCallback)((function(){(0,gi.ez)(),n()}),[n]),p=(0,f.useCallback)((function(){var e=!r;u(e),(0,yn.t8)(yn.Q9,e)}),[r,u]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Lo,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{children:[(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.JM,{inverted:!0,size:2*w.iI}),compact:o,disabled:o,loading:o,onClick:a,success:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,S.jsx)(O.Z,{ml:1}),o&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.x8,{inverted:!0,size:2*w.iI}),onClick:d,success:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,S.jsx)(O.Z,{ml:1})]}),(0,S.jsx)(D.ZP,{onClick:t,secondary:!0,children:(0,S.jsx)(C.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(C.ZP,{children:"Hide"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Pe.Z,{checked:r,onCheck:p})]})]})}),!r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(Fo,{noScrollbarTrackBackground:!0,children:(0,S.jsx)(No.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:s.map((function(e,n){var t=e.data,i=e.type,o=[],r=(o=(o=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return o.map((function(e,t){var o,l={first:0===n&&0===t,last:n===c-1&&t===r-1};return bt.jU.includes(i)?o=(0,S.jsx)(No.T5,Ho(Ho({},l),{},{children:(0,S.jsx)(C.ZP,{monospace:!0,preWrap:!0,children:(0,S.jsx)(Ao(),{children:e})})})):i===bt.Gi.IMAGE_PNG&&(o=(0,S.jsx)("div",{style:{backgroundColor:"white"},children:(0,S.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,S.jsx)("div",{children:o},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},Go=t(91749);var Wo=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,o=e.setErrorMessages,l=e.width,u=(0,f.useState)(!1),c=u[0],s=u[1],a=(0,f.useState)(),d=a[0],p=a[1],h=(0,f.useState)(),m=h[0],b=h[1],g=(0,f.useMemo)((function(){return l-w.cd*w.iI*2}),[l]),x=(0,v.Db)(K.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,$.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],y=(0,v.Db)((function(e){return K.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),k=(0,r.Z)(y,1)[0],P=(0,f.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:d,value:m}}).then((function(){n(),p(null),b(null)})),(0,gi.ez)(),s(!1)):"Escape"===e.key&&((0,gi.ez)(),s(!1))}),[j,n,d,m]),_=(0,f.useCallback)((function(e){(0,gi.ez)(),k(e)}),[k]);return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{level:4,monospace:!0,children:"Secrets"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(F.ZP,{Icon:V.mm,blackBorder:!0,inline:!0,onClick:function(){return s((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{children:[(0,S.jsx)(C.ZP,{inline:!0,warning:!0,children:"WARNING:"})," the encryption key is stored in a file on your machine. If you need more secure encryption, we recommend using a secrets manager."]})}),c&&(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["Press ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Li,{width:g,children:[c&&(0,S.jsxs)(Ri.Z,{children:[(0,S.jsx)(Bi.Z,{md:1,children:(0,S.jsx)(Fi,{noPadding:!0,children:(0,S.jsx)(F.ZP,{backgroundColor:Ui.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(d,") }}")),Wn.Am.success("Successfully copied to clipboard.",{position:Wn.Am.POSITION.BOTTOM_RIGHT,toastId:d})},uuid:"Sidekick/Secrets/".concat(d),withIcon:!0,children:(0,S.jsx)(V.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(Bi.Z,{md:4,children:(0,S.jsx)(Fi,{children:(0,S.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){p(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret name",small:!0,value:d})})}),(0,S.jsx)(Bi.Z,{md:7,children:(0,S.jsx)(Fi,{children:(0,S.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){b(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret value",small:!0,value:m})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,S.jsx)(zi,{copyText:e.name,deleteVariable:function(){return _(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"Secrets are not editable, they can only be created and deleted. Secrets are shared across the project, and can be used in configuration fields. To reference a secret, use the following templating syntax:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(Eo.Z,{language:"yaml",maxWidth:g,small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n "})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(Eo.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 "})})]})},Ko=t(28026),Vo=t(68899),qo=t(15752),Yo=t(91835);function Xo(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 Qo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Xo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Jo=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,o=e.autocompleteItems,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.deleteBlock,d=e.displayBlockName,p=e.fetchFileTree,h=e.fetchPipeline,m=e.interruptKernel,b=e.messages,x=(e.onChangeCallbackBlock,e.onChangeCodeBlock),j=e.onSelectBlockFile,y=e.pipeline,k=e.runBlock,Z=e.runningBlocks,_=e.savePipelineContent,I=e.selectedBlock,E=e.setAnyInputFocused,T=e.setErrors,M=e.setHiddenBlocks,D=e.setSelectedBlock,B=e.setTextareaFocused,R=e.showBrowseTemplates,A=e.showUpdateBlockModal,N=e.textareaFocused,U=(0,f.useRef)(null),H=(0,f.useState)(!1),z=H[0],G=H[1],W=(0,Oo.iV)().block_uuid;(0,f.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null===W||void 0===W||null===(n=W.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 Qo(Qo({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[W,c,j,I,M]);var q=(y||{}).type,Y=(0,f.useMemo)((function(){return(0,Ie.HK)(t||[],(function(e){return e.uuid}))}),[t]),X=K.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,Q=(0,f.useMemo)((function(){return(null===X||void 0===X?void 0:X.block_templates)||[]}),[X]),ee=(0,f.useCallback)((function(e){return n(e,(null===Y||void 0===Y?void 0:Y.length)||0)}),[n,Y]),ne=(0,f.useMemo)((function(){return(0,bi.oM)(Q,ee)}),[ee,Q]),te=(0,f.useMemo)((function(){return(0,bi.hr)(ee,i,q,{blockTemplatesByBlockType:ne,languages:[g.t6.PYTHON],showBrowseTemplates:R})}),[ee,i,ne,q]),ie=(0,f.useMemo)((function(){return null===Y||void 0===Y?void 0:Y[null===I||void 0===I?void 0:I.uuid]}),[Y,I]),oe=(0,f.useMemo)((function(){return Z.reduce((function(e,n,t){return Qo(Qo({},e),{},(0,l.Z)({},n.uuid,Qo(Qo({},n),{},{priority:t})))}),{})}),[Z]),re=(0,v.Db)((function(e){var n=e.block,t=e.upstream_blocks;return K.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,$.wD)(e,{callback:function(){h()},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,se=(0,f.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,v=oe[i],P=v?0===v.priority?bt.uF.BUSY:bt.uF.QUEUED:bt.uF.IDLE,C="".concat(t,"s/").concat(i,".py");return u.current[C]=(0,f.createRef)(),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(L.Z,{allBlocks:c,autocompleteItems:o,block:e,blockIdx:n,blockRefs:u,blocks:c,defaultValue:e.content,deleteBlock:function(e){a(Qo({},e)),E(!1)},executionState:P,extraContent:(0,S.jsx)(jo,{block:e,blocks:s,inputPlaceholder:"Select blocks to add ".concat((0,J._6)(d,null)," to"),loading:ce,onClickTag:function(e){M((function(n){return Qo(Qo({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[g.tf.CUSTOM,g.tf.DATA_EXPORTER,g.tf.DATA_LOADER,g.tf.DBT,g.tf.SCRATCHPAD,g.tf.SENSOR,g.tf.TRANSFORMER],updateBlock:ue}),fetchFileTree:p,fetchPipeline:h,hideRunButton:!0,interruptKernel:m,messages:b[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:y,ref:u.current[C],runBlock:k,runningBlocks:Z,savePipelineContent:_,showUpdateBlockModal:A,selected:r,setAnyInputFocused:E,setErrors:T,setSelected:function(n){return D(!0===n?e:null)},setTextareaFocused:B,textareaFocused:r&&N})},i)}))}),[t,o,u,c,s,a,d,p,h,m,ce,b,x,j,y,k,Z,oe,_,I,E,T,M,D,B,A,N,ue]),ae="".concat(d,"/index"),de=(0,Rn.y)(),pe=de.disableGlobalKeyboardShortcuts,fe=de.registerOnKeyDown,ve=de.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){ve(ae)}}),[ve,ae]),fe(ae,(function(e,n){!pe&&ie&&((0,xi.y)([Mn.zX,Mn.Um],n)||(0,xi.y)([Mn.PQ,Mn.Um],n))&&(e.preventDefault(),_())}),[ie,_]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Run 1 or more ",(0,J.wX)(d)," block functions whenever another block succeeds or fails."]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,J.wX)((0,J._6)(d,null)),"/overview"),openNewWindow:!0,children:(0,J.wX)((0,J._6)(d,null))}),"."]})})]}),se,(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(Sn.Z,{onClickOutside:function(){return G(!1)},open:!0,children:(0,S.jsx)(ni.Z,{disableKeyboardShortcuts:!0,items:te,onClickCallback:function(){return G(!1)},open:z,parentRef:U,uuid:d,children:(0,S.jsxs)(F.ZP,{beforeElement:(0,S.jsx)(yo.Wx,{rose:i===g.tf.CALLBACK,children:(0,S.jsx)(V.mm,{size:yo.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),G(!0)},uuid:"AddNewBlocks/".concat(d),children:[(0,J.kC)(d)," block"]})})})})]})},$o=t(26084);function er(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function nr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?er(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):er(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var tr=[{Icon:V.AQ,name:"Callbacks",uuid:$o.Q.CALLBACK},{Icon:V.hW,name:"Conditionals",uuid:$o.Q.CONDITIONAL}];var ir=function(e){var n=(0,Yo.Z)({},e),t=(0,h.useRouter)(),i=(0,f.useState)(null),o=i[0],r=i[1];(0,f.useEffect)((function(){var e;r(null===(e=(0,Oo.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,f.useMemo)((function(){var e,t;if($o.Q.CALLBACK===o)e={addOnBlockType:g.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if($o.Q.CONDITIONAL===o){var i;e={addOnBlockType:g.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,S.jsx)(Jo,nr(nr({},e),n))}),[n,o]);return(0,S.jsx)(R.W,{backend:A.PD,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[l,!o&&(null===tr||void 0===tr?void 0:tr.map((function(e,n){var t=e.name,i=e.uuid,o=e.Icon;return(0,S.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,pt.u7)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(Vn.Z,{dark:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(De.Z,{fullWidth:!1,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(o,{fill:"#885EFF",size:2*w.iI})})})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(k.Z,{flexDirection:"column",children:(0,S.jsx)(C.ZP,{bold:!0,children:t})})]}),(0,S.jsx)(V._Q,{})]})})})},i)})))]})})};function or(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function rr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?or(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):or(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var lr=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,o=e.autocompleteItems,r=e.blockInteractionsMapping,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.cancelPipeline,d=e.chartRefs,p=e.checkIfPipelineRunning,v=e.containerHeightOffset,h=e.contentByBlockUUID,b=e.createInteraction,g=e.deleteBlock,x=e.deleteWidget,j=e.editingBlock,y=e.executePipeline,k=e.fetchFileTree,P=e.fetchPipeline,_=e.fetchSecrets,I=e.fetchVariables,E=e.globalDataProducts,T=e.globalVariables,M=e.insights,B=e.interactions,R=e.interactionsMapping,A=e.interruptKernel,N=e.isLoadingCreateInteraction,L=e.isLoadingUpdatePipelineInteraction,F=e.isPipelineExecuting,U=e.lastTerminalMessage,z=e.messages,G=e.metadata,W=e.onChangeCallbackBlock,K=e.onChangeChartBlock,q=e.onChangeCodeBlock,Y=e.onSelectBlockFile,X=e.onUpdateFileSuccess,Q=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,se=e.selectedBlock,ae=e.selectedFilePath,de=e.sendTerminalMessage,pe=e.setActiveSidekickView,fe=e.setAllowCodeBlockShortcuts,ve=e.setAnyInputFocused,he=e.setBlockInteractionsMapping,me=e.setDisableShortcuts,be=e.setEditingBlock,ye=e.setErrors,ke=e.setHiddenBlocks,Ze=e.setInteractionsMapping,Pe=e.setPermissions,Oe=e.setSelectedBlock,Ce=e.setTextareaFocused,we=e.showBrowseTemplates,_e=e.showDataIntegrationModal,Se=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,kn.i)().height,Le=Oi.uX,Fe=(0,f.useState)([]),Ue=Fe[0],He=Fe[1],ze=(0,f.useState)(!!(0,yn.U2)(yn.Q9)),We=ze[0],Ke=ze[1],Ve=(0,f.useMemo)((function(){return i-(Vo.k1+1)}),[i]),qe=(0,f.useMemo)((function(){var e;return!(null===ne||void 0===ne||null===(e=ne.features)||void 0===e||!e[hi.d.INTERACTIONS])}),[null===ne||void 0===ne?void 0:ne.features]),Ye=((null===j||void 0===j?void 0:j.upstreamBlocks)||{}).block,Xe=((null===re||void 0===re?void 0:re.columns)||[]).slice(0,100),Qe=(0,f.useMemo)((function(){return(null===re||void 0===re?void 0:re.rows)||[]}),[re]),Je=(0,f.useMemo)((function(){return(null===G||void 0===G?void 0:G.column_types)||{}}),[G]),$e=(0,f.useMemo)((function(){return(null===M||void 0===M?void 0:M[1])||{}}),[M]),en=(0,f.useMemo)((function(){return(0,Ie.HK)((null===M||void 0===M?void 0:M[0])||[],(function(e){return e.feature.uuid}))}),[M]),nn=!!re,tn=(0,f.useMemo)((function(){return H.qL.INTEGRATION===(null===J||void 0===J?void 0:J.type)}),[J]),on=H.qL.STREAMING!==(null===J||void 0===J?void 0:J.type)?-70:We?-16:300,rn=(0,f.useCallback)((0,Ai.Fk)({columnTypes:Je,columns:Xe,insightsByFeatureUUID:en,insightsOverview:$e,noColumnLinks:!0,statistics:Te}),[Je,Xe,en,$e,Te]),ln=(0,f.useMemo)((function(){return(0,S.jsx)(Bo,{blocks:c,fetchVariables:I,pipeline:J,selectedBlock:se,setErrorMessages:He,variables:T,width:Ve})}),[Ve,c,I,T,J,se]),un=(0,f.useMemo)((function(){return(0,S.jsx)(Io.Z,{onActionCallback:X,pipeline:J,selectedBlock:se,selectedFilePath:ae,setErrors:ye,width:Ve>Ge.nn?Ve-Ge.nn:Ve})}),[Ve,X,J,se,ae,ye]),cn=(0,f.useMemo)((function(){return(0,S.jsx)(Wo,{fetchSecrets:_,pipelineUUID:null===J||void 0===J?void 0:J.uuid,secrets:ce,setErrorMessages:He,width:Ve})}),[Ve,_,J,ce]),sn=(0,f.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:o,blockRefs:u,blocks:c,blocksInNotebook:s,deleteBlock:g,fetchFileTree:k,fetchPipeline:P,interruptKernel:A,messages:z,onChangeCallbackBlock:W,onChangeCodeBlock:q,onSelectBlockFile:Y,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:se,setAnyInputFocused:ve,setErrors:ye,setHiddenBlocks:ke,setSelectedBlock:Oe,setTextareaFocused:Ce,showBrowseTemplates:we,showUpdateBlockModal:Se,textareaFocused:Me}}),[t,o,u,c,s,g,k,P,A,z,W,q,Y,J,ie,oe,le,se,ve,ye,ke,Oe,Ce,we,Se,Me]),an=(0,f.useMemo)((function(){return Xe.length>0&&(0,S.jsx)(ge.Z,{columnHeaderHeight:(0,je.Qr)(Je)&&(0,je.Qr)(en)&&(0,je.Qr)($e)?0:xe.Eh,columns:Xe,height:Ne-Le-Oi.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:rn,rows:Qe,width:Ve})}),[Ve,Je,Xe,Le,Ne,en,$e,rn,Qe]),dn=(0,f.useMemo)((function(){return Ae.length>0&&(0,S.jsx)(po,{autocompleteItems:o,blockRefs:u,blocks:c,chartRefs:d,deleteWidget:x,fetchFileTree:k,fetchPipeline:P,messages:z,onChangeChartBlock:K,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:se,setAnyInputFocused:ve,setErrors:ye,setSelectedBlock:Oe,setTextareaFocused:Ce,textareaFocused:Me,updateWidget:Re,widgets:Ae,width:Ve})}),[Ve,o,u,c,d,x,k,P,z,K,J,ie,oe,le,se,ve,ye,Oe,Ce,Me,Re,Ae]),pn=(0,f.useMemo)((function(){return(0,S.jsx)("div",{style:{height:"100%",position:"relative",width:Ve},children:(0,S.jsx)(Ko.Z,{lastMessage:U,onFocus:function(){return Oe(null)},sendMessage:de,width:Ve})})}),[Ve,U,de,Oe]),fn=(0,f.useMemo)((function(){return(0,S.jsx)(So,rr({},sn))}),[sn]),vn=(0,f.useMemo)((function(){return(0,S.jsx)(ir,rr({},sn))}),[sn]),hn=(0,f.useMemo)((function(){return J&&se&&(0,S.jsx)(Qi,{addNewBlockAtIndex:t,block:se,contentByBlockUUID:h,fetchFileTree:k,fetchPipeline:P,globalDataProducts:E,pipeline:J,setSelectedBlock:Oe,showDataIntegrationModal:_e,showUpdateBlockModal:Se})}),[t,h,k,P,E,J,se,Oe,_e,Se]);return(0,S.jsxs)(S.Fragment,{children:[(null===Ue||void 0===Ue?void 0:Ue.length)>=1&&(0,S.jsxs)(O.Z,{mb:3,mt:2,mx:2,children:[(0,S.jsxs)(Z.ZP,{justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,S.jsx)(D.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return He([])},transparent:!0,children:(0,S.jsx)(V.x8,{muted:!0})})]}),null===Ue||void 0===Ue?void 0:Ue.map((function(e){return(0,S.jsx)(O.Z,{pb:1,children:(0,S.jsx)(C.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,S.jsxs)(xe.t0,{fullWidth:!0,heightOffset:di.cH.TERMINAL===n||n===di.cH.TREE?0:v||Ge.nn,onBlur:function(){ae||me(!1),null===fe||void 0===fe||fe(!1)},onFocus:function(){me(!0),n===di.cH.TREE&&(null===fe||void 0===fe||fe(!0))},overflowHidden:n===di.cH.TREE,tabIndex:0,children:[n===di.cH.TREE&&(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(null===J||void 0===J?void 0:J.uuid),children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(fo.ZP,{addNewBlockAtIndex:t,blockRefs:u,blocks:c,contentByBlockUUID:h,contextMenuEnabled:!0,deleteBlock:g,dragEnabled:!0,editingBlock:j,enablePorts:!tn,fetchPipeline:P,height:Ne-(Le-Ge.nn)-on,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?rr(rr({},e),{},(0,l.Z)({},n,!t)):e}))},pipeline:J,runBlock:ie,runningBlocks:oe,selectedBlock:se,setActiveSidekickView:pe,setEditingBlock:be,setErrors:ye,setSelectedBlock:function(e){Oe(e),Ee&&(0,qo.F)(e)},showUpdateBlockModal:Se,treeRef:De}),!Ye&&H.qL.STREAMING===(null===J||void 0===J?void 0:J.type)&&(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(zo,{cancelPipeline:a,checkIfPipelineRunning:p,executePipeline:y,isPipelineExecuting:F,pipelineExecutionHidden:We,pipelineMessages:ee,setPipelineExecutionHidden:Ke})})]})}),n===di.cH.DATA&&an,di.cH.SECRETS===n&&cn,di.cH.VARIABLES===n&&ln,di.cH.FILE_VERSIONS===n&&(0,S.jsx)(m.Z,{uuid:"FileVersions/".concat(ae?decodeURIComponent(ae):""),children:un}),tn||se&&nn||!se&&nn&&n===di.cH.DATA?null:di.du.includes(n)&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:di.fp,verticalHeightOffset:Le,width:Ve,children:(0,S.jsx)(C.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:se?!nn&&"No data or insights available":"Select a block for insights"})}),di.cH.CHARTS===n&&(Ae.length>0?dn:(0,S.jsxs)(Z.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:di.fp,verticalHeightOffset:Le,width:Ve,children:[(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(Z.ZP,{flexDirection:"row",children:(0,S.jsxs)(C.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,S.jsx)(V.GQ,{size:1.5*w.iI}),"\xa0in",(0,S.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,S.jsx)(O.Z,{mt:w.cd,px:1,children:(0,S.jsx)(ho,{size:40*w.iI})})]})),di.cH.TERMINAL===n&&pn,di.cH.EXTENSIONS===n&&fn,di.cH.ADDON_BLOCKS===n&&vn,di.cH.BLOCK_SETTINGS===n&&(se?hn:(0,S.jsx)(Z.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:di.fp,verticalHeightOffset:Le,width:Ve,children:(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(Z.ZP,{flexDirection:"row",children:(0,S.jsxs)(C.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,S.jsx)(V.JG,{size:1.5*w.iI}),"\xa0",(0,S.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})})),di.cH.INTERACTIONS===n&&qe&&(0,S.jsx)(Go.Z,{blockInteractionsMapping:r,containerWidth:Ve,createInteraction:function(e){return b({interaction:e})},interactions:B,interactionsMapping:R,isLoadingCreateInteraction:N,isLoadingUpdatePipelineInteraction:L,permissions:Q,pipeline:J,pipelineInteraction:$,refAfterFooter:te,savePipelineInteraction:ue,selectedBlock:se,setBlockInteractionsMapping:he,setInteractionsMapping:Ze,setPermissions:Pe,setSelectedBlock:Oe,updatePipelineInteraction:function(e){return Be({pipeline_interaction:e})}})]})]})};var ur=function(e){var n,t=e.activeView,i=e.pipeline,o=e.project,r=e.secrets,l=e.selectedBlock,u=e.setSelectedBlock,c=e.variables,s=null===i||void 0===i?void 0:i.uuid,a=(0,Oo.iV)(),d=(0,Do.wx)(c,(function(e){return e.uuid===To.C})),p=(0,di.Qq)({project:o})[t],v=(null===p||void 0===p||null===(n=p.buildLabel)||void 0===n?void 0:n.call(p,{pipeline:i,secrets:r,variables:d}))||(null===p||void 0===p?void 0:p.label);di.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(v=(0,S.jsxs)(S.Fragment,{children:["Block settings for ",(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===l||void 0===l?void 0:l.type).accent,inline:!0,monospace:!0,children:null===l||void 0===l?void 0:l.uuid})]}));var h=(0,S.jsx)(C.ZP,{bold:!0,children:v}),m=di.cH.EXTENSIONS===t&&(null===a||void 0===a?void 0:a.extension),b=K.ZP.extension_options.list({},{},{pauseFetch:!m}).data,g=(0,f.useMemo)((function(){return(null===b||void 0===b?void 0:b.extension_options)||[]}),[b]),x=(0,f.useMemo)((function(){return(0,Ie.HK)(g,(function(e){return e.uuid}))}),[g]),j=di.cH.ADDON_BLOCKS===t&&(null===a||void 0===a?void 0:a.addon);if(di.cH.INTERACTIONS===t){var y=[];null!==l&&void 0!==l&&l.uuid?y.push.apply(y,[{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}]):y.push({bold:!0,label:function(){return"Interactions"},monospace:!1}),h=(0,S.jsx)(oe.Z,{breadcrumbs:y,noMarginLeft:!0})}else{if(!t)return(0,S.jsx)("div",{});if(m){var k=x[null===a||void 0===a?void 0:a.extension];h=(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(jt(),{as:"/pipelines/".concat(s,"/edit?").concat(di.uM,"=").concat(di.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:v})}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,S.jsx)(C.ZP,{bold:!0,children:null===k||void 0===k?void 0:k.name})]})}else j&&(h=(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(jt(),{as:"/pipelines/".concat(s,"/edit?").concat(di.uM,"=").concat(di.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:v})}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,S.jsx)(C.ZP,{bold:!0,children:(0,J.vg)(null===a||void 0===a?void 0:a.addon)})]}))}return(0,S.jsx)(Oi.ym,{children:h})},cr=t(16756),sr=p.default.div.withConfig({displayName:"indexstyle__StatusFooterStyle",componentId:"sc-tixdln-0"})(["bottom:0;position:fixed;z-index:2;"," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||we.Z.background).header,";\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),ar=1.25*w.iI;function dr(e,n){var t=e.kernel,i=e.pipelineContentTouched,o=(e.pipelineLastSaved,e.saveStatus),r=e.width,l=t||{},u=(l.alive,l.usage),c=(0,f.useMemo)((function(){if(null!==u&&void 0!==u&&u.kernel_memory){var e=u.kernel_memory,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))).concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}return null}),[null===u||void 0===u?void 0:u.kernel_memory]),s=(0,f.useMemo)((function(){return"undefined"!==typeof(null===u||void 0===u?void 0:u.kernel_cpu)?(0,J.QV)(null===u||void 0===u?void 0:u.kernel_cpu,3):null}),[u]);return(0,S.jsxs)(sr,{ref:n,width:r,children:[(0,S.jsx)(y.Z,{light:!0}),(0,S.jsx)(O.Z,{px:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[u&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[null!==s&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(V.Bf,{muted:!0,size:ar}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,small:!0,children:["CPU: ",(0,S.jsxs)(C.ZP,{inline:!0,danger:s>=90,muted:s<50,small:!0,warning:s>=50&&s<90,children:[s,"%"]})]})]}),null!==s&&null!==c&&(0,S.jsxs)(O.Z,{mx:w.cd,children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,small:!0,children:"/"})]}),null!==c&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(V.ie,{muted:!0,size:ar}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,small:!0,children:["Memory: ",c]})]}),(0,S.jsx)(O.Z,{mx:w.cd})]})}),(0,S.jsx)(Oe.Z,{appearAbove:!0,appearBefore:!0,block:!0,description:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,S.jsx)(cr.Z,{inline:!0,keyText:(0,Bn.V5)()?Mn.RJ:Mn.hE}),"\xa0",(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,S.jsx)(cr.Z,{inline:!0,keyText:Mn.SS}),"\xa0",(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,S.jsx)("br",{})]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Or, go to ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[i&&(0,S.jsx)(V.uy,{size:ar,warning:!0}),!i&&(0,S.jsx)(V.$B,{size:ar,muted:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,small:!0,warning:i,children:o})]})})]})})]})}var pr=f.forwardRef(dr),fr=t(65044),vr=t(78419),hr=t(46684),mr=t(32929),br=t(11498),gr=t(28795),xr=t(85010);function jr(e){var n=e.activeView,t=e.pipeline,i=e.project,o=e.secrets,r=e.setActiveSidekickView,l=e.variables,u=(0,Do.wx)(l,(function(e){return e.uuid===To.C}));return(0,di.j5)({pipeline:t,project:i}).map((function(e){var i=e.buildLabel,l=e.key,c=e.label;return{Icon:di.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 yr=t(53005),kr=t(4383),Zr=t(70320),Pr=t(3917);function Or(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Cr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Or(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Or(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function wr(e){var n,t,i,u,c,s,x,j,y,k,P,C,_,I,E,R,A,N,L=e.page,U=e.pipeline,z=(0,f.useRef)(null),G=(0,f.useRef)(null),W=(0,Tn.Z)(),q=W.featureEnabled,Y=W.featureUUIDs,X=W.fetchProjects,ne=W.project,te=W.sparkEnabled,oe=(0,f.useContext)(p.ThemeContext),re=(0,h.useRouter)(),le=(0,kn.i)().height,ue=re.query.pipeline,ce=U.uuid||ue,se=(0,f.useState)(!!(0,yn.U2)(yn.zg)),ae=se[0],de=se[1],pe=(0,f.useState)(!!(0,yn.U2)(yn.Uu)),fe=pe[0],ve=pe[1],he=(0,f.useState)(!1),me=he[0],be=he[1],ge=(0,f.useState)(null),xe=ge[0],ye=ge[1],ke=(0,f.useState)(null),Ze=ke[0],Pe=ke[1],Oe=(0,f.useState)(null),Ce=Oe[0],_e=Oe[1],Se=(0,f.useState)(null),Ee=Se[0],Te=Se[1],Me=(0,f.useState)(null),De=Me[0],Be=Me[1],Re=(0,f.useState)([]),Ae=Re[0],Ne=Re[1],Le=(0,f.useState)({}),Fe=Le[0],Ue=Le[1],He=(0,f.useState)(!1),ze=He[0],Ge=He[1],We=(0,f.useState)(!1),Ke=We[0],Ve=We[1],qe=(0,f.useState)(!1),Ye=qe[0],Xe=qe[1],Qe=(0,f.useState)(!1),Je=Qe[0],$e=Qe[1],en=(0,f.useState)(!0),nn=en[0],tn=en[1],on=((0,f.useMemo)((function(){var e;return(0,Zr.h)(null===ne||void 0===ne||null===(e=ne.features)||void 0===e?void 0:e[hi.d.LOCAL_TIMEZONE])}),[null===ne||void 0===ne?void 0:ne.features]),(0,f.useMemo)((function(){var e;return!(null===ne||void 0===ne||null===(e=ne.features)||void 0===e||!e[hi.d.INTERACTIONS])}),[null===ne||void 0===ne?void 0:ne.features])),rn="".concat(vr.H8,"_").concat(ce),ln=(0,yn.U2)(rn),un=(0,f.useState)((0,Ie.sE)(Zt.NR,(function(e){return e.uuid===ln}))||Zt.NR[0]),cn=un[0],sn=un[1],an=(0,f.useCallback)((function(e){sn(e),(0,yn.t8)(rn,null===e||void 0===e?void 0:e.uuid)}),[rn,sn]),dn="".concat(vr.g6,"_").concat(ce),pn=(0,f.useState)({}),fn=pn[0],vn=pn[1],hn=(0,f.useRef)(null),mn=K.ZP.statuses.list({},{revalidateOnFocus:!1}).data,bn=(0,f.useMemo)((function(){var e,n;return null===mn||void 0===mn||null===(e=mn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[mn]),gn=(0,f.useMemo)((function(){var e,n;return null===mn||void 0===mn||null===(e=mn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[mn]),xn=(0,f.useState)({}),jn=xn[0],Zn=xn[1],Pn=(0,f.useState)([]),On=Pn[0],Sn=Pn[1],In=(0,ct.Z)(ce),En=K.ZP.pipelines.detail(ce,Cr({include_block_pipelines:!0,includes_outputs:(0,je.Qr)(jn)||"undefined"===typeof N||null===N||"undefined"===typeof(null===(n=N)||void 0===n?void 0:n.blocks)||null===(null===(t=N)||void 0===t?void 0:t.blocks)||!(null===(i=N)||void 0===i||null===(u=i.blocks)||void 0===u||!u.find((function(e){return"undefined"===typeof e.ouputs})))},nn?{includes_outputs_spark:!0}:{}),{refreshInterval:6e4},{key:"/pipelines/".concat(ce,"/edit")}),Mn=En.data,Dn=En.mutate,Bn=K.ZP.pipeline_interactions.detail(on&&ce),Rn=Bn.data,An=Bn.mutate,Nn=K.ZP.interactions.pipeline_interactions.list(on&&ce),Ln=Nn.data,Wn=Nn.mutate,Kn=(0,f.useMemo)((function(){return(null===Rn||void 0===Rn?void 0:Rn.pipeline_interaction)||{}}),[Rn]),qn=(0,f.useMemo)((function(){return(null===Ln||void 0===Ln?void 0:Ln.interactions)||{}}),[Ln]),Yn=(0,v.Db)(K.ZP.pipeline_interactions.useUpdate(ce),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){An()}})}}),Xn=(0,r.Z)(Yn,2),Qn=Xn[0],Jn=Xn[1].isLoading,$n=(0,v.Db)(K.ZP.interactions.pipeline_interactions.useCreate(ce),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){Wn(),An()}})}}),et=(0,r.Z)($n,2),nt=et[0],tt=et[1].isLoading,it=K.ZP.files.list(),ot=it.data,rt=it.mutate,ut=(0,f.useMemo)((function(){return(null===ot||void 0===ot?void 0:ot.files)||[]}),[ot]);N=(0,f.useMemo)((function(){return null===Mn||void 0===Mn?void 0:Mn.pipeline}),[Mn]);var st=(0,f.useMemo)((function(){var e;return H.qL.INTEGRATION===(null===(e=N)||void 0===e?void 0:e.type)}),[N]);(0,f.useEffect)((function(){N&&nn&&te&&tn(!1)}),[nn,N,tn,te]);var dt=(0,f.useState)((0,yn.U2)(vr.iL,!1)),vt=dt[0],ht=dt[1],gt=(0,f.useMemo)((function(){return!st&&(null===q||void 0===q?void 0:q(null===Y||void 0===Y?void 0:Y.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&vt}),[q,Y,st,vt]),xt=(0,f.useState)((0,yn.U2)(vr.qj,!1)),jt=xt[0],yt=xt[1],kt=(0,f.useMemo)((function(){return(null===q||void 0===q?void 0:q(null===Y||void 0===Y?void 0:Y.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&jt}),[q,Y,jt]),Pt=(0,f.useCallback)((function(e){yt(e),(0,yn.t8)(vr.qj,"function"===typeof e?e():e)}),[yt]),Ot=(0,f.useCallback)((function(e){var n="function"===typeof e?e():e;ht(e),(0,yn.t8)(vr.iL,n),n||Pt(e)}),[Pt,ht]),wt=(0,f.useCallback)((function(){var e=new CustomEvent(Zt.$e,{detail:{}});window.dispatchEvent(e)}),[]),_t=(0,f.useCallback)((function(){var e=new CustomEvent(Zt.tK,{detail:{}});window.dispatchEvent(e)}),[]),St=(0,f.useCallback)((function(e){vn((function(n){var t=e(n);return(0,yn.t8)(dn,JSON.stringify(t)),t})),gt&&(clearTimeout(G.current),G.current=setTimeout((function(){_t(),wt()}),Ht.e+1))}),[dn,vn,gt]);(0,f.useEffect)((function(){var e=(0,yn.U2)(dn);e&&(0,J.Pb)(e)&&vn(JSON.parse(e))}),[dn,vn]);var It=K.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),Et=It.data,Tt=It.mutate,Mt=(0,f.useMemo)((function(){var e=null===Et||void 0===Et?void 0:Et.kernels;return(null===e||void 0===e?void 0:e.find((function(e){var n;return e.name===H.a_[null===(n=N)||void 0===n?void 0:n.type]})))||(null===e||void 0===e?void 0:e[0])}),[Et,N]),Dt=(0,f.useState)(null),Bt=Dt[0],Rt=Dt[1],At=(0,f.useState)(Number((0,Pr.Tz)({dateObj:!0}))),Nt=At[0],Lt=At[1],Ft=(0,f.useState)(!1),Ut=Ft[0],zt=Ft[1],Gt=(0,ft.dd)((function(){return(0,S.jsx)(lt.Z,{centerOnScreen:!0,neutral:!0,onClick:Vt,subtitle:"Please refresh your page to have the most up-to-date data before making any changes.",title:"Your pipeline may be stale.",width:34*w.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),Wt=(0,r.Z)(Gt,2),Kt=Wt[0],Vt=Wt[1];(0,f.useEffect)((function(){var e;null!==Mn&&void 0!==Mn&&null!==(e=Mn.pipeline)&&void 0!==e&&e.updated_at&&Bt!==a()().utc().unix()&&Rt(a()(Mn.pipeline.updated_at).unix()),Bt&&Bt>Nt&&Kt()}),[null===Mn||void 0===Mn||null===(c=Mn.pipeline)||void 0===c?void 0:c.updated_at,Bt,Nt,Kt]);var qt=(0,Oo.iV)(),Yt=qt[di.uM],Xt=qt.block_uuid,Qt=qt.file_path,Jt=(0,f.useMemo)((function(){var e=qt["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[qt]),$t=(0,f.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)({},di.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,pt.u7)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,f.useEffect)((function(){Yt||$t(di.cH.TREE,!1)}),[Yt,$t]);var ei=(0,f.useCallback)((function(e,n,t){de(!1),setTimeout((function(){return $t(e,n,t)}),1)}),[$t]),ni=(0,f.useRef)({}),ti=(0,f.useRef)({}),ii=(0,f.useRef)(null),oi=(0,f.useRef)({}),ri=(0,f.useRef)({}),li=(0,f.useRef)({}),ui=(0,f.useState)({}),ci=ui[0],si=ui[1],ai=(0,f.useCallback)((function(e,n,t){var i=oi.current||{};oi.current=Cr(Cr({},i),{},(0,l.Z)({},e,Cr(Cr({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[oi]),pi=(0,f.useCallback)((function(e,n,t){var i=ri.current||{};ri.current=Cr(Cr({},i),{},(0,l.Z)({},e,Cr(Cr({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[ri]),fi=(0,f.useCallback)((function(e,n,t){ai(e,n,t),zt(!0)}),[ai,zt]),vi=(0,f.useCallback)((function(e,n,t){pi(e,n,t),zt(!0)}),[pi,zt]),mi=(0,f.useCallback)((function(e){li.current=Cr(Cr({},li.current),e)}),[li]),bi=(0,f.useCallback)((function(e,n){mi((0,l.Z)({},e,n)),zt(!0)}),[mi,zt]),gi=(0,f.useState)(null),xi=gi[0],ji=gi[1],yi=K.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,Zi=null===yi||void 0===yi?void 0:yi.data_providers;(0,f.useEffect)((function(){var e=Mn;null!==Mn&&void 0!==Mn&&Mn.hasOwnProperty("error")||null===yi||void 0===yi||!yi.hasOwnProperty("error")||(e=yi),(0,$.bB)(e,_e)}),[Mn,yi]);var Pi=K.ZP.variables.pipelines.list(ce,{global_only:!0},{revalidateOnFocus:!1}),Oi=Pi.data,Ci=Pi.mutate,wi=null===Oi||void 0===Oi?void 0:Oi.variables,Ii=K.ZP.secrets.list({},{revalidateOnFocus:!1}),Ei=Ii.data,Ti=Ii.mutate,Mi=null===Ei||void 0===Ei?void 0:Ei.secrets,Di=(0,f.useState)([]),Bi=Di[0],Ri=Di[1],Ai=(0,f.useState)([]),Ni=Ai[0],Li=Ai[1],Fi=(0,f.useRef)({}),Ui=(0,f.useCallback)((function(e){var n;zt(!0);var t=Fi.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),Fi.current[e.uuid]=Cr(Cr(Cr({},t),e),{},{configuration:Cr(Cr({},t.configuration),e.configuration),upstream_blocks:i})}),[zt,Fi]),Hi=(0,f.useState)(!1),zi=Hi[0],Gi=Hi[1],Wi=(0,f.useState)({upstreamBlocks:null}),Ki=Wi[0],Vi=Wi[1],qi=(0,f.useState)([]),Yi=qi[0],Xi=qi[1],Qi=(0,f.useState)(null),Ji=Qi[0],$i=Qi[1],eo=(0,Ct.Dp)(ce),no=(0,Ct.Q9)(eo,Bi),to=(0,f.useState)(no),io=to[0],oo=to[1],ro=(0,f.useState)(),lo=ro[0],uo=ro[1],co=(0,f.useState)(),so=co[0],ao=co[1],po=(0,f.useState)(null),fo=po[0],vo=po[1],ho=(0,ct.Z)(io),mo=(0,f.useCallback)((function(){Vi({upstreamBlocks:{block:null,values:[]}}),Zn({}),zt(!1),Xi([]),$i(null)}),[]);(0,f.useEffect)((function(){ce!==In&&(oi.current={},ri.current={})}),[ce,In]);var bo=K.ZP.block_outputs.detail(!ae&&(null===fo||void 0===fo?void 0:fo.type)!==g.tf.SCRATCHPAD&&(null===fo||void 0===fo?void 0:fo.type)!==g.tf.CHART&&null!==fo&&void 0!==fo&&fo.uuid?encodeURIComponent(null===fo||void 0===fo?void 0:fo.uuid):null,{pipeline_uuid:ce}),go=bo.data,xo=bo.mutate,jo=(0,f.useMemo)((function(){return null===go||void 0===go?void 0:go.block_output}),[go]),yo=(0,f.useMemo)((function(){var e,n,t;return st?null===(e=(0,Ie.sE)(null===jo||void 0===jo?void 0:jo.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,J.kE)(so))})))||void 0===e?void 0:e.sample_data:null===jo||void 0===jo||null===(n=jo.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[jo,st,so]),ko=K.ZP.blocks.pipelines.analyses.detail(ae?null:ce,(null===fo||void 0===fo?void 0:fo.type)!==g.tf.SCRATCHPAD&&(null===fo||void 0===fo?void 0:fo.type)!==g.tf.CHART&&(null===fo||void 0===fo?void 0:fo.uuid)&&encodeURIComponent(null===fo||void 0===fo?void 0:fo.uuid)),Zo=ko.data,Po=ko.mutate,Co=(null===Zo||void 0===Zo||null===(s=Zo.analyses)||void 0===s?void 0:s[0])||{},wo=Co.insights,_o=void 0===wo?{}:wo,So=Co.metadata,Io=void 0===So?{}:So,Eo=Co.statistics,To=void 0===Eo?{}:Eo;(0,f.useEffect)((function(){0===Yi.length&&(Po(),xo(),Ci())}),[Po,xo,Ci,Yi]),(0,f.useEffect)((function(){if(0===io.length)vo(null);else if((null===ho||void 0===ho?void 0:ho.length)!==(null===io||void 0===io?void 0:io.length)&&(null===io||void 0===io?void 0:io.length)<(null===ho||void 0===ho?void 0:ho.length)){var e=ho.findIndex((function(e){return e.uuid===(null===fo||void 0===fo?void 0:fo.uuid)})),n=ho.length-1===e?e-1:e+1;vo(ho[Math.max(0,n)])}}),[io,ho,null===fo||void 0===fo?void 0:fo.uuid]),(0,f.useEffect)((function(){var e;null!==(e=Ki.upstreamBlocks)&&void 0!==e&&e.block&&(de(!1),$t(di.cH.TREE))}),[Ki.upstreamBlocks,$t]);var Mo=K.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),Do=Mo.data,Bo=Mo.mutate,Ro=null===Do||void 0===Do?void 0:Do.autocomplete_items;(0,f.useEffect)((function(){Qt||Xe(!1),Be(Qt)}),[Qt,qt]),(0,f.useEffect)((function(){(0,Ie.fS)(Jt,Ae)||Ne(Jt)}),[Jt,Ae,qt]);var Ao=(0,v.Db)(K.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.pipeline.uuid;re.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),rt()},onErrorCallback:function(e,n){return Pe({errors:n,response:e})}})}}),No=(0,r.Z)(Ao,1)[0],Lo=(0,v.Db)(K.ZP.pipelines.useUpdate(ce,{update_content:!0}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){zt(!1),Dn().then((function(e){var n=e.pipeline;if(gt){var t,i,o,r=null===(t=N)||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,Ie.fS)(r||[],l||[])||setTimeout((function(){(0,qo.h)()}),1)}})),rt()},onErrorCallback:function(e,n){return Pe({errors:n,response:e})}})}}),Fo=(0,r.Z)(Lo,2),Uo=Fo[0],Ho=Fo[1].isLoading,zo=(0,f.useState)({}),Go=zo[0],Wo=zo[1],Ko=(0,f.useCallback)((function(e,n){var t,i=e||{},o=i.block,l=i.pipeline,u=void 0===l?{extensions:{}}:l,c=(n||{}).contentOnly;if(!(Bt&&Bt>Nt)){var s=(0,Pr.Tz)({dateObj:!0}),a=(0,Pr.Tz)();Lt(Number(s));var d={},p={},f={},v={};((null===u||void 0===u?void 0:u.blocks)||Bi).forEach((function(e){var n,t,i,l=e.extension_uuid,u=e.type,s=e.uuid,a=null===(n=ri.current[u])||void 0===n?void 0:n[s];"undefined"===typeof a&&(a=e.content);var h=null===(t=oi.current[u])||void 0===t?void 0:t[s];"undefined"===typeof h&&(h=e.callback_content);var m=null,b=null===(i=jn[s])||void 0===i?void 0:i.filter((function(e){return!!e})),x=null===b||void 0===b?void 0:b.find((function(e){return e.error}));if(b&&(!te||null===Yi||void 0===Yi||!Yi.length)){var j=[],y=0;b.forEach((function(n){var t=n.data,i=n.type;(g.tf.SCRATCHPAD===e.type||x||"table"!==i&&null!==Go&&void 0!==Go&&Go[null===e||void 0===e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(fr.Lz)?e:e.concat(n)}),[]),i===bt.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!gn||y<gn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var k=Cr(Cr({},e),{},{callback_content:h,content:a});null===m?delete k.outputs:k.outputs=m,(null===o||void 0===o?void 0:o.uuid)===s&&Object.entries(o).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];"object"===typeof i&&!Array.isArray(i)&&i?Object.entries(i).forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],o=n[1];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}:[g.tf.EXTENSION].includes(u)?(d[l]||(d[l]=[]),d[l].push(k)):g.tf.CALLBACK===u?f[k.uuid]=k:g.tf.CONDITIONAL===u?v[k.uuid]=k:p[k.uuid]=k}));var h=Cr(Cr({},null===(t=N)||void 0===t?void 0:t.extensions),null===u||void 0===u?void 0:u.extensions);Object.entries(d).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];h[t]||(h[t]={}),h[t].blocks=i}));var m=[],b=[],x=[];return((null===u||void 0===u?void 0:u.blocks)||Bi).forEach((function(e){var n=e.uuid,t=p[n],i=f[n],o=v[n];"undefined"!==typeof t?m.push(t):"undefined"!==typeof i?b.push(i):"undefined"!==typeof o&&x.push(o)})),Wo({}),Uo({pipeline:Cr(Cr(Cr({},N),u),{},{blocks:m,callbacks:b,conditionals:x,extensions:h,updated_at:a,widgets:Ni.map((function(e){var n,t,i=li.current[e.uuid],o=Fi.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var r=null===(n=jn[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===r||void 0===r?void 0:r.find((function(e){return e.error}));if(r){var u=[];r.forEach((function(n){var t=n.data,i=n.type;(g.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(fr.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 Cr(Cr(Cr({},e),o),{},{configuration:Cr(Cr({},e.configuration),o.configuration),content:i,outputs:t})}))})})}Kt()}),[Bi,gn,jn,Go,N,Bt,Nt,Yi,Kt,te,Uo,Ni]),Vo=(0,f.useMemo)((function(){return(0,Ct.Rz)(N,{displayRelative:!0,isPipelineUpdating:Ho,pipelineContentTouched:Ut,pipelineLastSaved:Bt})}),[Ho,N,Ut,Bt]),Yo=(0,ft.dd)((function(e){var n,t,i=e||{block:null,contentByBlockUUID:null},o=i.block,r=i.contentByBlockUUID,l=o||{type:null,uuid:null},u=l.type,c=l.uuid,s=Cr({},o);r&&(s.content=null===r||void 0===r||null===(n=r.current)||void 0===n||null===(t=n[u])||void 0===t?void 0:t[c]);return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(Cn,Cr(Cr({},e),{},{block:s,onChangeCodeBlock:vi,onClose:Jo,pipeline:N,savePipelineContent:Ko}))})}),{},[vi,N,Ko],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat(ce)}),Xo=(0,r.Z)(Yo,2),Qo=Xo[0],Jo=Xo[1],$o=(0,f.useCallback)((function(e){Ko();var n=encodeURIComponent(e),t=(0,Oo.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n),(0,pt.u7)({file_path:n,"file_paths[]":t})}),[Ko]),er=(0,f.useCallback)((function(e,n){var t,i=e||{},o=i.content,r=i.path;if(t=null!==n&&void 0!==n&&n.blockUUID?null===Bi||void 0===Bi?void 0:Bi.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.blockUUID)})):(0,yr.IO)(r,Bi)){var u=t,c=u.type,s=u.uuid;vi(c,s,o),Ri((function(e){var n=null===e||void 0===e?void 0:e.findIndex((function(e){var n=e.type,t=e.uuid;return n===c&&t===s}));return n>=0&&(e[n].content=o),e})),si((function(e){return Cr(Cr({},e),{},(0,l.Z)({},c,Cr(Cr({},null===e||void 0===e?void 0:e[c]),{},(0,l.Z)({},s,Number(new Date)))))})),Dn()}}),[Bi,Dn,vi]),nr=(0,f.useMemo)((function(){var e=[],n=[];return Bi.forEach((function(t){g.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[Bi]),tr=nr.blocksInNotebook,ir=nr.blocksInSidekick,or=(0,f.useCallback)((function(e,n){return Ko({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(ce!==r)window.location.href="".concat(re.basePath,"/pipelines/").concat(r,"/edit");else rt(),n!==(null===(o=N)||void 0===o?void 0:o.type)&&Dn(),(0,Ct.k1)(tr,ce,r),(0,Ct.k1)(ir,ce,r)}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&Pe((function(e){return Cr(Cr({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){$o("pipelines/".concat(ce,"/").concat(Hn.dT.METADATA_YAML)),Pe(null)}}]})}))}))}),[tr,ir,rt,Dn,$o,null===(x=N)||void 0===x?void 0:x.type,ce,re,Ko]),rr=(0,f.useState)(null),cr=rr[0],sr=rr[1],ar=(0,f.useState)(null),dr=ar[0],Or=ar[1],wr=(0,f.useState)(null),_r=wr[0],Sr=wr[1],Ir=(0,f.useCallback)((function(e){return Qn({pipeline_interaction:Cr(Cr({},Kn),{},{blocks:null!==e&&void 0!==e&&e.blockInteractionsMapping?null===e||void 0===e?void 0:e.blockInteractionsMapping:dr,interactions:cr,permissions:null===_r||void 0===_r?void 0:_r.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}}))}}))})})}),[dr,cr,_r,Kn,Qn]),Er=(0,v.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),K.ZP.blocks.pipelines.useDelete(ce,encodeURIComponent(o),r)()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;if(Ri((function(e){return(0,Ie.oM)(e,e.findIndex((function(e){var n=e.type,o=e.uuid;return t===n&&i===o})))})),Dn(),$i(null),t===g.tf.SCRATCHPAD&&rt(),on){var o=Cr({},dr);delete o[i],Ir({blockInteractionsMapping:o}).then((function(e){var n=e.pipeline_interaction;return Or(null===n||void 0===n?void 0:n.blocks)}))}},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Pe({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&Zn((function(e){return Cr(Cr({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:bt.Gi.TEXT_PLAIN}}))))}))}})}}),Tr=(0,r.Z)(Er,1)[0],Mr=(0,v.Db)((function(e){var n=e.uuid;return K.ZP.widgets.pipelines.useDelete(ce,n)()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.widget.uuid;Li((function(e){return(0,Ie.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),Dn(),rt()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Pe({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&Zn((function(e){return Cr(Cr({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:bt.Gi.TEXT_PLAIN}}))))}))}})}}),Dr=(0,r.Z)(Mr,1)[0],Br=(0,ft.dd)((function(e){return(0,S.jsx)(lt.Z,{centerOnScreen:!0,neutral:!0,onCancel:Nr,onClick:function(){return Fr(e)},subtitle:"Deleting this block is dangerous. Your block may have downstream dependencies that depend on this block. You can delete this block anyway and remove it as a dependency from downstream blocks.",title:"Your block has dependencies",width:34*w.iI})})),Rr=(0,r.Z)(Br,2),Ar=Rr[0],Nr=Rr[1],Lr=(0,v.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,o="".concat(t,"/").concat(i);return n&&Hn.JD[n]&&(o="".concat(o,".").concat(Hn.JD[n].toLowerCase())),K.ZP.blocks.useDelete(encodeURIComponent(o))()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){Bo(),Dn(),rt()},onErrorCallback:function(e,n){Ar(),Pe({displayMessage:e.exception,errors:n,response:e})}})}}),Fr=(0,r.Z)(Lr,1)[0],Ur=(0,v.Db)(K.ZP.kernels.useUpdate(null===Mt||void 0===Mt?void 0:Mt.id),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){return Tt()},onErrorCallback:function(e,n){return Pe({errors:n,response:e})}})}}),Hr=(0,r.Z)(Ur,1)[0],zr=(0,f.useCallback)((function(){return Hr({kernel:{action_type:"restart"}})}),[Hr]),Gr=(0,f.useCallback)((function(){Hr({kernel:{action_type:"interrupt"}}),Xi([])}),[Hr]),Wr=(0,v.Db)(K.ZP.blocks.pipelines.useCreate(ce)),Kr=(0,r.Z)(Wr,1)[0],Vr=(0,f.useCallback)((function(e,n,t){var i,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,J.Y6)();e.converted_from_type&&e.converted_from_uuid&&(i=null===(l=ri.current[e.converted_from_type])||void 0===l?void 0:l[e.converted_from_uuid]);var c=e.language,s=e.type;if(st){var a,d=(0,Ie.HK)((null===(a=N)||void 0===a?void 0:a.blocks)||[],(function(e){return e.type})),p=d[g.tf.DATA_EXPORTER],f=d[g.tf.DATA_LOADER],v=d[g.tf.TRANSFORMER];if(g.tf.DATA_LOADER===s){if(g.t6.YAML!==c)return void Pe({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(g.t6.YAML," and not ").concat(c,".")});var h;if(f)return void Pe({displayMessage:"Pipeline ".concat(null===(h=N)||void 0===h?void 0:h.uuid," already has a source: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}else if(g.tf.TRANSFORMER===s){var m;if(v)return void Pe({displayMessage:"Pipeline ".concat(null===(m=N)||void 0===m?void 0:m.uuid," already has a transformer: ").concat(null===v||void 0===v?void 0:v.uuid,".")})}else if(g.tf.DATA_EXPORTER===s){if(g.t6.YAML!==c)return void Pe({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(g.t6.YAML," and not ").concat(c,".")});var b;if(p)return void Pe({displayMessage:"Pipeline ".concat(null===(b=N)||void 0===b?void 0:b.uuid," already has a destination: ").concat(null===p||void 0===p?void 0:p.uuid,".")})}}var x=function(){return Kr({block:Cr({content:i,name:u,priority:n,require_unique_name:!0},e)}).then((function(n){(0,$.wD)(n,{callback:function(){var e,i,l=n.data.block;(null===t||void 0===t||t(l),gt&&null!==q&&void 0!==q&&q(null===Y||void 0===Y?void 0:Y.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))?null===(e=window)||void 0===e||null===(i=e.location)||void 0===i||i.reload():(rt(),Dn().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;Ri((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 Cr(Cr({},e),{},{extension_uuid:i})}))))}));var l=(0,Ie.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,yr.u$)(Cr(Cr({},e),{},{name:u}));o&&r&&o.startsWith(Zt.LR)?Pe((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){$o(r),Pe(null)}}],response:n}})):Pe({errors:t,response:n})}})}))};return gt&&null!==q&&void 0!==q&&q(null===Y||void 0===Y?void 0:Y.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)?Ko().then((function(){return x()})):x()}),[Kr,rt,Dn,st,$o,N,Ko,Ri,Pe,gt]),qr=(0,ft.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,J.Y6)():u,s=e.onCreateCallback;return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(ie,{block:n,defaultName:c,isReplacingBlock:o,isUpdatingBlock:l,onClose:Qr,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l||o){var i,r=n.detach||!1;Ko({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=N)||void 0===i?void 0:i.blocks)||[]}}).then((function(){$i(null),Qr()}))}else Vr(Cr(Cr({},n),(0,je.gR)(e,["name"])),t,s,null===e||void 0===e?void 0:e.name).then((function(){return Qr()}))},pipeline:N})})}),{},[Vr,N],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),Yr=(0,r.Z)(qr,2),Xr=Yr[0],Qr=Yr[1],Jr=(0,ft.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,o=e.onSaveSuccess;return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(Si.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),nl()},onSaveSuccess:function(e){X(),nl(),null===o||void 0===o||o(e)}})})}),{},[X],{background:!0,uuid:"configure_project"}),$r=(0,r.Z)(Jr,2),el=$r[0],nl=$r[1],tl=(0,v.Db)(K.ZP.widgets.pipelines.useCreate(ce)),il=(0,r.Z)(tl,1)[0],ol=(0,f.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,J.Y6)();return il({widget:Cr({name:i,priority:n,type:g.tf.CHART},e)}).then((function(e){return(0,$.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),rt(),Dn(),$t(di.cH.CHARTS),Te(n)},onErrorCallback:function(e,n){return Pe({errors:n,response:e})}})}))}),[rt,Dn,il,$t]);(0,f.useEffect)((function(){if(Ee){var e,n=null===(e=ti.current[Ee.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),Te(null))}}),[Ee,Te]),(0,f.useEffect)((function(){In!==ce&&(Ri([]),Li([]),oo([]),Sn([]))}),[ce,In]),(0,f.useEffect)((function(){var e,n;if("undefined"!==typeof(null===(e=N)||void 0===e?void 0:e.blocks)||"undefined"!==typeof(null===(n=N)||void 0===n?void 0:n.extensions)){var t,i,l,u,c,s,a,d,p=[];if("undefined"!==typeof(null===(t=N)||void 0===t?void 0:t.blocks))p.push.apply(p,(0,o.Z)(null===(c=N)||void 0===c?void 0:c.blocks));if("undefined"!==typeof(null===(i=N)||void 0===i?void 0:i.callbacks))p.push.apply(p,(0,o.Z)(null===(s=N)||void 0===s?void 0:s.callbacks));if("undefined"!==typeof(null===(l=N)||void 0===l?void 0:l.conditionals))p.push.apply(p,(0,o.Z)(null===(a=N)||void 0===a?void 0:a.conditionals));if("undefined"!==typeof(null===(u=N)||void 0===u?void 0:u.extensions))Object.entries((null===(d=N)||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 Cr(Cr({},e),{},{extension_uuid:t})}))))}));Ri(p)}}),[null===(j=N)||void 0===j?void 0:j.blocks,null===(y=N)||void 0===y?void 0:y.callbacks,null===(k=N)||void 0===k?void 0:k.conditionals,null===(P=N)||void 0===P?void 0:P.extensions]),(0,f.useEffect)((function(){var e;"undefined"!==typeof(null===(e=N)||void 0===e?void 0:e.widgets)&&Li(N.widgets)}),[null===(C=N)||void 0===C?void 0:C.widgets]),(0,f.useEffect)((function(){(null===no||void 0===no?void 0:no.length)>0&&0===(null===io||void 0===io?void 0:io.length)&&(oo(no),vo(no[0]))}),[io,no]);var rl=(0,ct.Z)(Bi);(0,f.useEffect)((function(){var e;if(!me&&("undefined"!==typeof(null===(e=N)||void 0===e?void 0:e.blocks)&&(!Bi.length||!(0,Ie.fS)(null===rl||void 0===rl?void 0:rl.map((function(e){return e.uuid})).sort(),null===Bi||void 0===Bi?void 0:Bi.map((function(e){return e.uuid})).sort())||(0,je.Qr)(jn)))){var n=(0,Ct.Rt)(N.blocks),t=n.content,i=n.messages;ri.current=t,(0,je.Qr)(i)||Zn((function(e){return Cr(Cr({},i),e)})),be(!0)}}),[Bi,rl,me,jn,null===(_=N)||void 0===_?void 0:_.blocks,be,Zn]),(0,f.useEffect)((function(){var e;if(!Ni.length&&"undefined"!==typeof(null===(e=N)||void 0===e?void 0:e.widgets)){var n=(0,Ct.Rt)(N.widgets),t=n.content,i=n.messages;li.current=t,Zn((function(e){return Cr(Cr({},i),e)}))}}),[null===(I=N)||void 0===I?void 0:I.widgets,Zn,Ni]);var ll=(0,f.useCallback)((function(e,n,t){var i=Bi.find((function(t){var i=t.type,o=t.uuid;return i===n&&o===e}));if(i){if($i(i),null!==ni&&void 0!==ni&&ni.current){var o,r=ni.current[(0,Ct.zv)(i)];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}(0,pt.u7)({block_uuid:null,file_path:null,"file_paths[]":[]})}else if(n===g.tf.CHART){var l=Ni.find((function(n){return n.uuid===e}));if(l&&($i(l),null!==ti&&void 0!==ti&&ti.current)){var u,c=ti.current[l.uuid];null===c||void 0===c||null===(u=c.current)||void 0===u||u.scrollIntoView()}}else t&&$o(t)}),[Bi,$o,Ni]);(0,f.useEffect)((function(){if(Xt&&!Ji){var e=Bi.find((function(e){var n,t=e.uuid;return(null===Xt||void 0===Xt||null===(n=Xt.split(":"))||void 0===n?void 0:n[0])===t}));e&&(St((function(n){return Cr(Cr({},n),{},(0,l.Z)({},e.uuid,!1))})),ll(e.uuid,e.type,null))}else(null===rl||void 0===rl?void 0:rl.length)!==(null===Bi||void 0===Bi?void 0:Bi.length)&&Ji&&(St((function(e){return Cr(Cr({},e),{},(0,l.Z)({},Ji.uuid,!1))})),ll(Ji.uuid,Ji.type,null))}),[Xt,Bi,null===rl||void 0===rl?void 0:rl.length,ll,Ji,St]);var ul=(0,f.useMemo)((function(){return new b.Z}),[]),cl=(0,f.useMemo)((function(){return{api_key:br.l,token:ul.decodedToken.token}}),[ul]),sl=(0,d.ZP)((0,kr.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 s=Bi.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==r?Zn((function(e){var t=e[c]||[];return Cr(Cr({},e),{},(0,l.Z)({},c,t.concat(n)))})):(Sn((function(e){return[].concat((0,o.Z)(e),[n])})),bt.uF.IDLE===i&&(Xi([]),Dn(),c||Gi(!1))),bt.uF.BUSY===i?Xi((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!s?e:e.concat(s)})):bt.uF.IDLE===i&&Xi((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),bn||zt(!0)}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,al=(0,f.useCallback)((function(){Ko().then((function(){Gi(!0),Sn([]),sl(JSON.stringify(Cr(Cr({},cl),{},{execute_pipeline:!0,pipeline_uuid:ce})))}))}),[ce,Ko,sl,cl]),dl=(0,f.useCallback)((function(){sl(JSON.stringify(Cr(Cr({},cl),{},{cancel_pipeline:!0,pipeline_uuid:ce})))}),[ce,sl,cl]),pl=(0,f.useCallback)((function(){sl(JSON.stringify(Cr(Cr({},cl),{},{cancel_pipeline:!0,pipeline_uuid:ce,skip_publish_message:!0})))}),[ce,sl,cl]),fl=(0,f.useCallback)((function(){sl(JSON.stringify(Cr(Cr({},cl),{},{check_if_pipeline_running:!0,pipeline_uuid:ce})))}),[ce,sl,cl]);(0,f.useEffect)((function(){var e;return window.addEventListener("pagehide",pl),null===re||void 0===re||null===(e=re.events)||void 0===e||e.on("routeChangeStart",pl),function(){var e;null===re||void 0===re||null===(e=re.events)||void 0===e||e.off("routeChangeStart",pl),window.removeEventListener("pagehide",pl)}}),[pl,null===re||void 0===re?void 0:re.events]);var vl=(0,f.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,s=e.runSettings,a=void 0===s?{}:s,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(!Yi.find((function(e){var n=e.uuid;return b===n}))||i){var g,x,j="".concat(vr.vF,"_").concat(null===(g=N)||void 0===g?void 0:g.uuid);sl(JSON.stringify(Cr(Cr({},cl),{},{code:t,extension_uuid:h,output_messages_to_logs:!!(0,yn.U2)(j),pipeline_uuid:null===(x=N)||void 0===x?void 0:x.uuid,run_downstream:r,run_incomplete_upstream:c,run_settings:a,run_tests:p,run_upstream:f,type:n.type,upstream_blocks:m,uuid:b,variables:v}))),Zn((function(e){return delete e[b],e})),Ge(!1),Xi((function(e){return e.find((function(e){var n=e.uuid;return b===n}))?e:e.concat(n)})),Wo((function(e){return Cr(Cr({},e),{},(0,l.Z)({},null===n||void 0===n?void 0:n.uuid,!0))}))}Dn()}),[Dn,N,Yi,sl,Zn,Xi,Ge,cl]),hl=(0,f.useCallback)((function(e){var n,t=e.block;return bn?vl(e):null===(n=Ko({block:{outputs:[],uuid:t.uuid}},{contentOnly:!0}))||void 0===n?void 0:n.then((function(){return vl(e)}))}),[bn,vl,Ko]),ml=(0,d.ZP)((0,kr.Ib)("terminal"),{shouldReconnect:function(){return!0}}),bl=ml.lastMessage,gl=ml.sendMessage,xl=(0,ft.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(M.Z,{contained:!0,defaultLinkUUID:i,onClickCustomTemplate:function(e){t({config:{custom_template:e,custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid}}),kl()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[mr.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),jl=(0,r.Z)(xl,2),yl=jl[0],kl=jl[1],Zl=K.ZP.global_data_products.list().data,Pl=(0,f.useMemo)((function(){return(null===Zl||void 0===Zl?void 0:Zl.global_data_products)||[]}),[Zl]),Ol=(0,ft.dd)((function(e){var n=e.addNewBlock;return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(Vn.Z,{children:(0,S.jsx)(zn.Z,{globalDataProducts:Pl,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:g.tf.GLOBAL_DATA_PRODUCT}),_l()}})})})}),{},[Pl],{background:!0,uuid:"global_data_products"}),Cl=(0,r.Z)(Ol,2),wl=Cl[0],_l=Cl[1],Sl=(0,f.useRef)(null),Il=(0,f.useState)(null),El=Il[0],Tl=Il[1],Ml=(0,f.useMemo)((function(){return di.cH.INTERACTIONS===Yt}),[Yt]);(0,f.useEffect)((function(){var e,n;Yt&&null!==Sl&&void 0!==Sl&&Sl.current&&Tl(null===Sl||void 0===Sl||null===(e=Sl.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[Yt,ae,le,on,Sl]),(0,f.useEffect)((function(){!cr&&(null===qn||void 0===qn?void 0:qn.length)>=1&&sr((0,Ie.HK)(qn||[],(function(e){return e.uuid})))}),[qn,cr,sr]),(0,f.useEffect)((function(){!dr&&null!==Kn&&void 0!==Kn&&Kn.blocks&&Or(null===Kn||void 0===Kn?void 0:Kn.blocks)}),[dr,Kn,Or]);var Dl=(0,f.useMemo)((function(){return(0,S.jsx)(lr,{activeView:Yt,addNewBlockAtIndex:function(e,n,t,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(){return Xr({block:e,idx:n,isReplacingBlock:o,name:i,onCreateCallback:t})}))},afterWidth:xe,autocompleteItems:Ro,blockInteractionsMapping:dr,blockRefs:ni,blocks:Bi,blocksInNotebook:tr,cancelPipeline:dl,chartRefs:ti,checkIfPipelineRunning:fl,containerHeightOffset:Ml?El+1:null,contentByBlockUUID:ri,createInteraction:nt,deleteBlock:Tr,deleteWidget:Dr,editingBlock:Ki,executePipeline:al,fetchFileTree:rt,fetchPipeline:Dn,fetchSecrets:Ti,fetchVariables:Ci,globalDataProducts:Pl,globalVariables:wi,insights:_o,interactions:qn,interactionsMapping:cr,interruptKernel:Gr,isLoadingCreateInteraction:tt,isLoadingUpdatePipelineInteraction:Jn,isPipelineExecuting:zi,isPipelineUpdating:Ho,lastTerminalMessage:bl,messages:jn,metadata:Io,onChangeCallbackBlock:fi,onChangeChartBlock:bi,onChangeCodeBlock:vi,onSelectBlockFile:ll,onUpdateFileSuccess:er,permissions:_r,pipeline:N,pipelineInteraction:Kn,pipelineMessages:On,project:ne,refAfterFooter:Sl,runBlock:hl,runningBlocks:Yi,sampleData:yo,savePipelineContent:Ko,savePipelineInteraction:Ir,secrets:Mi,selectedBlock:Ji,selectedFilePath:De,sendTerminalMessage:gl,setActiveSidekickView:$t,setAllowCodeBlockShortcuts:$e,setAnyInputFocused:Ve,setBlockInteractionsMapping:Or,setDisableShortcuts:Xe,setEditingBlock:Vi,setErrors:Pe,setHiddenBlocks:St,setInteractionsMapping:sr,setPermissions:Sr,setSelectedBlock:$i,setTextareaFocused:Ge,showBrowseTemplates:yl,showDataIntegrationModal:Qo,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,J.Y6)(),t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(){return Xr({block:e,isReplacingBlock:t,isUpdatingBlock:!t,name:n})}))},sideBySideEnabled:gt,statistics:To,textareaFocused:ze,treeRef:ii,updatePipelineInteraction:Qn,updatePipelineMetadata:or,updateWidget:Ui,widgets:Ni})}),[Yt,El,xe,Ro,dr,ni,Bi,tr,dl,fl,ri,nt,Tr,Dr,Ki,al,rt,Dn,Ti,Ci,Pl,wi,_o,qn,cr,Gr,tt,Jn,zi,Ho,Ml,bl,jn,Io,fi,bi,vi,ll,er,_r,N,Kn,On,ne,Sl,hl,Yi,yo,Ko,Ir,Mi,Ji,De,gl,$t,Ve,Or,Vi,Pe,St,sr,Sr,Ge,Xr,yl,Qo,gt,To,ze,Qn,or,Ui,Ni]),Bl=(0,f.useMemo)((function(){return(0,S.jsx)(ki,{addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){var o;Q.L.BLOCK_FILE!==(null===e||void 0===e||null===(o=e.block_action_object)||void 0===o?void 0:o.object_type)&&(g.tf.DBT!==(null===e||void 0===e?void 0:e.type)||g.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?Xr({block:e,idx:n,name:i,onCreateCallback:t}):Vr(e,n,t,i)}))},addWidget:function(e,n){var t=n.onCreateCallback;return ol(e,Ni.length,t)},afterHidden:ae,allBlocks:Bi,allowCodeBlockShortcuts:Je,anyInputFocused:Ke,autocompleteItems:Ro,beforeHidden:fe,blockInteractionsMapping:dr,blockRefs:ni,blocks:tr,blocksThatNeedToRefresh:ci,dataProviders:Zi,deleteBlock:Tr,disableShortcuts:Ye,fetchFileTree:rt,fetchPipeline:Dn,fetchSampleData:xo,files:ut,globalDataProducts:Pl,globalVariables:wi,hiddenBlocks:fn,interactionsMapping:cr,interruptKernel:Gr,mainContainerRef:hn,mainContainerWidth:xi,messages:jn,onChangeCallbackBlock:fi,onChangeCodeBlock:vi,openSidekickView:ei,pipeline:N,pipelineContentTouched:Ut,project:ne,restartKernel:zr,runBlock:hl,runningBlocks:Yi,savePipelineContent:Ko,scrollTogether:kt,selectedBlock:Ji,setAnyInputFocused:Ve,setDisableShortcuts:Xe,setEditingBlock:Vi,setErrors:Pe,setHiddenBlocks:St,setIntegrationStreams:uo,setOutputBlocks:oo,setPipelineContentTouched:zt,setSelectedBlock:$i,setSelectedOutputBlock:vo,setSelectedStream:ao,setTextareaFocused:Ge,showBrowseTemplates:yl,showConfigureProjectModal:el,showDataIntegrationModal:Qo,showGlobalDataProducts:wl,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,J.Y6)();return new Promise((function(){return Xr({block:e,isUpdatingBlock:!0,name:n})}))},sideBySideEnabled:gt,textareaFocused:ze,widgets:Ni})}),[Vr,ol,ae,Je,Ke,Ro,fe,ni,dr,Bi,tr,ci,Zi,Tr,Ye,rt,Dn,xo,ut,Pl,wi,fn,cr,Gr,hn,xi,jn,fi,vi,ei,N,Ut,ne,zr,hl,Yi,Ko,kt,Ji,Ve,Vi,Pe,St,zt,$i,Ge,Xr,yl,el,Qo,wl,gt,ze,Ni]),Rl=(0,f.useMemo)((function(){if(L===Zt.b7)return(0,S.jsx)(Fn,{cancelPipeline:dl,createPipeline:No,executePipeline:al,interruptKernel:Gr,isPipelineExecuting:zi,kernel:Mt,pipeline:N,restartKernel:zr,savePipelineContent:Ko,scrollTogether:kt,setActiveSidekickView:$t,setMessages:Zn,setScrollTogether:Pt,setSideBySideEnabled:Ot,sideBySideEnabled:gt,updatePipelineMetadata:or,children:De&&(0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",fullHeight:!0,children:(0,S.jsx)(D.ZP,{compact:!0,onClick:function(){return Be(null)},small:!0,children:"View pipeline"})})})})}),[dl,No,al,Gr,zi,Mt,L,N,zr,Ko,kt,De,$t,Zn,Pt,Be,Ot,gt,or]),Al=(0,f.useMemo)((function(){if(L===Zt.b7)return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(mt,{filePaths:Ae,filesTouched:Fe,isBusy:Yi.length>=1,kernel:Mt,pipeline:N,restartKernel:zr,savePipelineContent:Ko,selectedFilePath:De,setErrors:Pe,setRunningBlocks:Xi,updatePipelineMetadata:or,children:Rl}),(null===Ae||void 0===Ae?void 0:Ae.length)>0&&(0,S.jsx)(at.rK,{relativePosition:!0,secondary:!0,children:(0,S.jsx)(Un.Z,{filePaths:Ae,filesTouched:Fe,savePipelineContent:Ko,selectedFilePath:De})})]})}),[Rl,Fe,Mt,L,N,zr,Yi,Ko,De,Ae,Pe,or]),Nl=(0,f.useMemo)((function(){if(L===Zt.b7)return(0,S.jsx)(pr,{kernel:Mt,pipelineContentTouched:Ut,pipelineLastSaved:Bt,ref:z,saveStatus:Vo,width:xi})}),[xi,L,Ut,Bt,Vo]),Ll=(0,f.useMemo)((function(){var e;return null===lo||void 0===lo||null===(e=lo.filter((function(e){return(0,Ie.sE)(null===jo||void 0===jo?void 0:jo.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,J.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,S.jsx)(O.Z,{pl:1,children:(0,S.jsx)(F.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return ao(e)},selected:so===e,uuid:e,children:e})},e)}))}),[jo,lo,so]),Fl=(0,f.useRef)(null),Ul=(0,f.useMemo)((function(){return(0,S.jsx)(wn.Z,{addNewBlock:function(e,n){Vr(e,Bi.length,n,e.name),(null===Jt||void 0===Jt?void 0:Jt.length)>=1&&re.push("/pipelines/".concat(ce,"/edit"))},blocks:Bi,deleteWidget:Dr,fetchAutocompleteItems:Bo,fetchFileTree:rt,fetchPipeline:Dn,files:ut,onSelectBlockFile:ll,openFile:$o,openPipeline:function(e){mo(),re.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:ei,pipeline:N,ref:Fl,setErrors:Pe,setSelectedBlock:$i,widgets:Ni})}),[Vr,Bi,Dr,Bo,rt,Dn,null===Jt||void 0===Jt?void 0:Jt.length,ut,ll,$o,ei,N,ce,mo,re,Pe,$i,Ni]),Hl=(0,f.useMemo)((function(){return(0,S.jsx)(T,{blockRefs:ni,hiddenBlocks:fn,pipeline:N,setHiddenBlocks:St})}),[ni,fn,N,St]),zl=(0,f.useMemo)((function(){return Zt.Jf.uuid===(null===cn||void 0===cn?void 0:cn.uuid)?Ul:Zt.IY.uuid===(null===cn||void 0===cn?void 0:cn.uuid)?Hl:null}),[Ul,Hl,cn]),Gl=(0,f.useMemo)((function(){return(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(B.Z,{noPadding:!0,onClickTab:function(e){an(e)},selectedTabUUID:null===cn||void 0===cn?void 0:cn.uuid,tabs:Zt.NR,underlineColor:(oe||we.Z).accent.purple,underlineStyle:!0})})}),[an,cn,oe]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Gn.Z,{title:null===(E=N)||void 0===E?void 0:E.name}),(0,S.jsxs)(_i,{after:Dl,afterHeader:(0,S.jsx)(ur,{activeView:Yt,pipeline:N,project:ne,secrets:Mi,selectedBlock:Ji,setSelectedBlock:$i,variables:wi}),afterHeightOffset:hr.Mz,afterHidden:ae,afterInnerHeightMinus:El,afterNavigationItems:jr({activeView:Yt,pipeline:N,project:ne,secrets:Mi,setActiveSidekickView:$t,variables:wi}),afterOverflow:di.cH.DATA===Yt?"hidden":null,afterSubheader:(null===io||void 0===io?void 0:io.length)>0&&Yt===di.cH.DATA&&(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!st&&io.map((function(e){var n=e.uuid,t=(null===fo||void 0===fo?void 0:fo.uuid)===n;return(0,S.jsx)(O.Z,{pl:1,children:(0,S.jsx)(F.ZP,{afterElement:t?(0,S.jsx)(D.ZP,{basic:!0,highlightOnHover:!0,onClick:function(){(0,Ct.h8)(ce,e.uuid),oo((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,S.jsx)(V.x8,{muted:!0,size:1.25*w.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return vo(e)},selected:t,uuid:n,children:n})},n)})),st&&Ll]}),before:zl,beforeHeader:Gl,beforeHeightOffset:hr.Mz,beforeHidden:fe,beforeNavigationItems:(0,xr.H)(gr.M.EDIT,N),errors:Ce||Ze,footerOffset:null===z||void 0===z||null===(R=z.current)||void 0===R||null===(A=R.getBoundingClientRect())||void 0===A?void 0:A.height,headerOffset:(null===Ae||void 0===Ae?void 0:Ae.length)>0?36:0,mainContainerFooter:Nl,mainContainerHeader:Al,mainContainerRef:hn,page:L,pipeline:N,setAfterHidden:de,setAfterWidthForChildren:ye,setBeforeHidden:ve,setErrors:Ce?_e:Pe,setMainContainerWidth:ji,children:[(0,S.jsx)("div",{style:{height:De?0:null,opacity:De?0:null,visibility:De?"hidden":null},children:(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(ce),children:Bl})}),null===Jt||void 0===Jt?void 0:Jt.map((function(e){return(0,S.jsx)("div",{style:{display:De===e?null:"none"},children:(0,S.jsx)(m.Z,{uuid:"FileEditor/".concat(decodeURIComponent(e)),children:(0,S.jsx)(_n.Z,{active:De===e,addNewBlock:function(e,n){Vr(Cr(Cr({},e),{},{require_unique_name:!1}),Bi.length,n,e.name),re.push("/pipelines/".concat(ce,"/edit"))},fetchPipeline:Dn,fetchVariables:Ci,filePath:e,onUpdateFileSuccess:er,openSidekickView:ei,pipeline:N,selectedFilePath:De,sendTerminalMessage:gl,setDisableShortcuts:Xe,setErrors:Pe,setFilesTouched:Ue,setSelectedBlock:$i})})},e)})),(0,S.jsx)(O.Z,{pb:Qt||gt?0:Math.max(Math.floor(le*(2/3)/w.iI),0)})]})]})}wr.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=Zt.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 _r=(0,Ii.Z)(wr)},80329:function(e,n,t){"use strict";t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},23657:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(82684),l=t(74260),u=t(35686),c=t(77417);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.clustersRefreshInterval,t=e.computeServiceRefreshInterval,s=e.connectionsRefreshInterval,d=e.includeAllStates,p=(0,c.Z)(),f=p.sparkEnabled,v=u.ZP.compute_services.detail("compute-service",{},{refreshInterval:t},{pauseFetch:!f}),h=v.data,m=v.mutate,b=(0,r.useMemo)((function(){return null===h||void 0===h?void 0:h.compute_service}),[h]),g={};d&&(g.include_all_states=!0);var x=u.ZP.compute_clusters.compute_services.list(null===b||void 0===b?void 0:b.uuid,g,{refreshInterval:n},{pauseFetch:!f}),j=x.data,y=x.mutate,k=(0,r.useMemo)((function(){return(null===j||void 0===j?void 0:j.compute_clusters)||[]}),[j]),Z=(0,r.useMemo)((function(){return null===k||void 0===k?void 0:k.map((function(e){return e.cluster}))}),[k]),P=(0,r.useMemo)((function(){var e,n;return null!==b&&void 0!==b&&null!==(e=b.setup_steps)&&void 0!==e&&e.length?null===b||void 0===b||null===(n=b.setup_steps)||void 0===n?void 0:n.every((function(e){var n=e.required,t=e.status_calculated;return!n||!t||l.br.COMPLETED===t})):null}),[b]),O=((0,r.useMemo)((function(){return null===Z||void 0===Z?void 0:Z.find((function(e){return e.active}))}),[Z]),u.ZP.compute_connections.compute_services.list(null===b||void 0===b?void 0:b.uuid,{},{refreshInterval:s},{pauseFetch:!f})),C=O.data,w=O.mutate,_=(0,r.useMemo)((function(){return(null===C||void 0===C?void 0:C.compute_connections)||[]}),[C]),S=(0,r.useCallback)((function(){return new Promise((function(){null===y||void 0===y||y(),null===w||void 0===w||w(),null===m||void 0===m||m()}))}),[y,w,m]);return{activeCluster:null===Z||void 0===Z?void 0:Z.find((function(e){return e.active})),clusters:Z,clustersLoading:!j,computeService:b,computeServiceUUIDs:Object.entries(l.GO).reduce((function(e,n){var t=(0,o.Z)(n,2),r=t[0],l=t[1];return a(a({},e),{},(0,i.Z)({},r,l))}),{}),connections:_,connectionsLoading:!C,fetchAll:S,fetchComputeClusters:y,fetchComputeConnections:w,fetchComputeService:m,setupComplete:P}}},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(98305)}])}},function(e){e.O(0,[9774,2678,3662,1154,844,5820,6639,1124,341,1751,5896,2714,9161,1821,2631,7011,4783,6563,4267,600,8487,8264,7858,5499,722,1769,1550,90,9264,553,976,1749,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);