mage-ai 0.9.49__py3-none-any.whl → 0.9.51__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 (153) hide show
  1. mage_ai/api/operations/base.py +11 -2
  2. mage_ai/api/presenters/WorkspacePresenter.py +1 -0
  3. mage_ai/api/resources/PipelineResource.py +28 -19
  4. mage_ai/cache/utils.py +2 -0
  5. mage_ai/cluster_manager/kubernetes/workload_manager.py +184 -147
  6. mage_ai/cluster_manager/workspace/kubernetes.py +25 -3
  7. mage_ai/data_preparation/executors/block_executor.py +10 -4
  8. mage_ai/data_preparation/models/global_hooks/models.py +9 -3
  9. mage_ai/data_preparation/models/pipeline.py +1 -47
  10. mage_ai/data_preparation/preferences.py +71 -27
  11. mage_ai/data_preparation/templates/custom/python/default.jinja +3 -5
  12. mage_ai/io/postgres.py +1 -0
  13. mage_ai/server/constants.py +1 -1
  14. mage_ai/server/frontend_dist/404.html +2 -2
  15. mage_ai/server/frontend_dist/_next/static/chunks/4138-1ffb2d1ab4fc61f2.js +1 -0
  16. mage_ai/server/frontend_dist/_next/static/chunks/{5499-f60c2fc8ed0442d5.js → 5499-6f0bc8a94f2b78b4.js} +1 -1
  17. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage-221f6ba4b04367c6.js → frontend_dist/_next/static/chunks/pages/manage-41c56c0ae1c15cb6.js} +1 -1
  18. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-006a61883c0a6fce.js +1 -0
  19. mage_ai/server/frontend_dist/_next/static/{chun9Xv4R2ZZyX0zoxPm1 → z6eg1yN60N6gosbEr2pGr}/_buildManifest.js +1 -1
  20. mage_ai/server/frontend_dist/block-layout.html +2 -2
  21. mage_ai/server/frontend_dist/compute.html +2 -2
  22. mage_ai/server/frontend_dist/files.html +2 -2
  23. mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
  24. mage_ai/server/frontend_dist/global-data-products.html +2 -2
  25. mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
  26. mage_ai/server/frontend_dist/global-hooks.html +2 -2
  27. mage_ai/server/frontend_dist/index.html +2 -2
  28. mage_ai/server/frontend_dist/manage/files.html +2 -2
  29. mage_ai/server/frontend_dist/manage/settings.html +2 -2
  30. mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
  31. mage_ai/server/frontend_dist/manage/users/new.html +2 -2
  32. mage_ai/server/frontend_dist/manage/users.html +2 -2
  33. mage_ai/server/frontend_dist/manage.html +2 -2
  34. mage_ai/server/frontend_dist/oauth.html +3 -3
  35. mage_ai/server/frontend_dist/overview.html +2 -2
  36. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  37. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  38. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  39. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
  40. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  41. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  42. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  43. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  44. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  45. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  46. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  47. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
  48. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  49. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  50. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  51. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  52. mage_ai/server/frontend_dist/pipelines.html +2 -2
  53. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  54. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
  55. mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
  56. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  57. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
  58. mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
  59. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
  60. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
  61. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  62. mage_ai/server/frontend_dist/settings.html +2 -2
  63. mage_ai/server/frontend_dist/sign-in.html +3 -3
  64. mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
  65. mage_ai/server/frontend_dist/templates.html +2 -2
  66. mage_ai/server/frontend_dist/terminal.html +2 -2
  67. mage_ai/server/frontend_dist/test.html +3 -3
  68. mage_ai/server/frontend_dist/triggers.html +2 -2
  69. mage_ai/server/frontend_dist/version-control.html +2 -2
  70. mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
  71. mage_ai/server/frontend_dist_base_path_template/_next/static/{hcfGediUFcOE3vcIGjt-n → GkYZIZv7ClhebnBGgTrwO}/_buildManifest.js +1 -1
  72. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1952-0f9a12782f0aaae6.js → 1952-0c8a3cb84da67f53.js} +1 -1
  73. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{2714-68fef54789d7eaeb.js → 2714-1e79e9f2e998b544.js} +1 -1
  74. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{2717-82a714ddff3edf43.js → 2717-e599ab448e3c1b7f.js} +1 -1
  75. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3437-ed09bb896e50e022.js → 3437-0712d7142aed2c46.js} +1 -1
  76. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4138-1ffb2d1ab4fc61f2.js +1 -0
  77. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{4783-422429203610c318.js → 4783-1a21d9be47574bba.js} +1 -1
  78. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5499-f60c2fc8ed0442d5.js → 5499-6f0bc8a94f2b78b4.js} +1 -1
  79. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5896-7b8e36634d7d94eb.js → 5896-14e5a23b1c6a0769.js} +1 -1
  80. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{6285-648f9a732e100b2f.js → 6285-e9b45335bfb9ccaf.js} +1 -1
  81. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{6798-b904395b0c18647b.js → 6798-1ef0247e65215a0f.js} +1 -1
  82. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{976-0a8c2c4d7acd957b.js → 976-18c98af60b76f1a7.js} +1 -1
  83. mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage-221f6ba4b04367c6.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage-41c56c0ae1c15cb6.js} +1 -1
  84. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{edit-0cd2a275eb8b6345.js → edit-285ea9b8083b5f22.js} +1 -1
  85. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-e9c1506c0a1f87b6.js → [run]-15deea898d2fa18b.js} +1 -1
  86. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{settings-495e877aa7ed709e.js → settings-6f5a7e367ec63c43.js} +1 -1
  87. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-006a61883c0a6fce.js +1 -0
  88. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{preferences-f3c29ec53ee35795.js → preferences-b058d0ff37970cd9.js} +1 -1
  89. mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
  90. mage_ai/server/frontend_dist_base_path_template/compute.html +5 -5
  91. mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
  92. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
  93. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
  94. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +5 -5
  95. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +5 -5
  96. mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
  97. mage_ai/server/frontend_dist_base_path_template/manage/files.html +5 -5
  98. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
  99. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
  100. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
  101. mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
  102. mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
  103. mage_ai/server/frontend_dist_base_path_template/oauth.html +3 -3
  104. mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
  105. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
  106. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
  107. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
  108. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
  109. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
  110. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
  111. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
  112. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
  113. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
  114. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
  115. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
  116. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
  117. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
  118. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
  119. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
  120. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
  121. mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
  122. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
  123. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +5 -5
  124. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +5 -5
  125. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
  126. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +5 -5
  127. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +5 -5
  128. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
  129. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +5 -5
  130. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
  131. mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
  132. mage_ai/server/frontend_dist_base_path_template/sign-in.html +11 -11
  133. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
  134. mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
  135. mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
  136. mage_ai/server/frontend_dist_base_path_template/test.html +4 -4
  137. mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
  138. mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
  139. mage_ai/settings/__init__.py +32 -13
  140. mage_ai/tests/cache/test_pipeline_cache.py +1 -0
  141. mage_ai/tests/cluster_manager/kubernetes/test_workload_manager.py +76 -12
  142. {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/METADATA +1 -1
  143. {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/RECORD +149 -149
  144. mage_ai/server/frontend_dist/_next/static/chunks/4138-a2c37d37dba2f44c.js +0 -1
  145. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-34317532903c1ec9.js +0 -1
  146. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4138-a2c37d37dba2f44c.js +0 -1
  147. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-34317532903c1ec9.js +0 -1
  148. /mage_ai/server/frontend_dist/_next/static/{chun9Xv4R2ZZyX0zoxPm1 → z6eg1yN60N6gosbEr2pGr}/_ssgManifest.js +0 -0
  149. /mage_ai/server/frontend_dist_base_path_template/_next/static/{hcfGediUFcOE3vcIGjt-n → GkYZIZv7ClhebnBGgTrwO}/_ssgManifest.js +0 -0
  150. {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/LICENSE +0 -0
  151. {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/WHEEL +0 -0
  152. {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/entry_points.txt +0 -0
  153. {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4138],{61709:function(n,o,e){e.d(o,{IT:function(){return w},J8:function(){return k},MS:function(){return g},Ts:function(){return b},YW:function(){return C},_o:function(){return m},eY:function(){return p},fA:function(){return h},h5:function(){return x},oI:function(){return y}});var i=e(82394),t=e(44425),l=e(48339),r=e(57653),u=e(82359),d=e(85385),c=e(81728),a=e(55283),s=e(15610);function v(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function f(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?v(Object(e),!0).forEach((function(o){(0,i.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):v(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var p=function(n,o){var e=(null===o||void 0===o?void 0:o.upstream_blocks)||[];return t.iZ.includes(null===n||void 0===n?void 0:n.type)||t.iZ.includes(null===o||void 0===o?void 0:o.type)||t.tf.DATA_LOADER===(null===o||void 0===o?void 0:o.type)&&t.tf.SENSOR!==n.type||e.push(n.uuid),e},h=function(n,o,e){var i=[];return(null===n||void 0===n?void 0:n.type)!==r.qL.STREAMING||t.iZ.includes(null===o||void 0===o?void 0:o.type)||t.iZ.includes(null===e||void 0===e?void 0:e.type)||(i=i.concat((null===o||void 0===o?void 0:o.downstream_blocks)||[])),i},b=function(n,o,e,i){for(var l,r=[],u=o.findIndex((function(o){return o.uuid===n.uuid}));!l&&u>=0;){var d;l=o[u-1],t.tf.SCRATCHPAD===(null===(d=l)||void 0===d?void 0:d.type)&&(l=null),u-=1}return l&&r.push(l.uuid),t.Ut.map((function(o){return{label:function(){return"Convert to ".concat((0,c.wX)(t.V4[o]))},onClick:function(){return i({converted_from_type:o,converted_from_uuid:n.uuid,type:o,upstream_blocks:r})},uuid:"".concat(e,"/convert_to/").concat(o)}}))},k=function(n,o,e,i,l,r){var c,a,v=n||{},p=v.configuration,h=v.downstream_blocks,b=v.has_callback,k=v.language,g=v.metadata,m=v.replicated_block,x=v.type,y=v.upstream_blocks,C=v.uuid,w=p||{},O=w.dynamic,S=w.reduce_output,j=t.tf.DBT===x,B=[],E=!(null===r||void 0===r||null===(c=r.project)||void 0===c||null===(a=c.features)||void 0===a||!a[u.d.INTERACTIONS]);if(t.tf.SCRATCHPAD!==x&&![t.tf.CALLBACK,t.tf.EXTENSION,t.tf.MARKDOWN].includes(x)){B.push.apply(B,[{label:function(){return j?"Execute and run all upstream blocks":"Execute with all upstream blocks"},onClick:function(){return o({block:n,runUpstream:!0})},uuid:"execute_upstream"},{label:function(){return j?"Execute and run incomplete upstream blocks":"Execute with incomplete upstream blocks"},onClick:function(){return o({block:n,runIncompleteUpstream:!0})},uuid:"execute_incomplete_upstream"}]),j||t.tf.GLOBAL_DATA_PRODUCT===x||B.push({label:function(){return"Execute block and run tests"},onClick:function(){return o({block:n,runTests:!0})},uuid:"run_tests"});var I,T,_,Z,D,P=r||{},A=P.addNewBlock,R=P.blocksMapping,N=P.fetchFileTree,L=P.fetchPipeline,M=P.savePipelineContent,H=P.updatePipeline,U=[];if(null===h||void 0===h||h.forEach((function(n){var o=null===R||void 0===R?void 0:R[n];o&&o.upstream_blocks.forEach((function(n){var o,e;null!==R&&void 0!==R&&null!==(o=R[n])&&void 0!==o&&null!==(e=o.configuration)&&void 0!==e&&e.dynamic&&U.push(R[n])}))})),j&&t.t6.SQL===k)B.unshift.apply(B,[{label:function(){return"Test model"},onClick:function(){return o({block:n,runSettings:{test_model:!0}})},tooltip:function(){return"Execute command dbt test."},uuid:"test_model"},{label:function(){return"Build model"},onClick:function(){return o({block:n,runSettings:{build_model:!0}})},tooltip:function(){return"Execute command dbt build."},uuid:"build_model"},{label:function(){return"Add upstream models"},onClick:function(){H({pipeline:{add_upstream_for_block_uuid:null===n||void 0===n?void 0:n.uuid}})},tooltip:function(){return"Add upstream models for this model to the pipeline."},uuid:"add_upstream_models"}]),null!==g&&void 0!==g&&null!==(I=g.dbt)&&void 0!==I&&null!==(T=I.block)&&void 0!==T&&T.snapshot||B.unshift.apply(B,[{label:function(){return"Run model"},onClick:function(){return o({block:n,runSettings:{run_model:!0}})},tooltip:function(){return"Execute command dbt run."},uuid:"run_model"}]),null!==g&&void 0!==g&&null!==(_=g.dbt)&&void 0!==_&&null!==(Z=_.block)&&void 0!==Z&&Z.snapshot&&B.unshift.apply(B,[{label:function(){return"Run snapshot"},onClick:function(){return o({block:n,runSettings:{run_model:!0}})},tooltip:function(){return"Execute command dbt snapshot."},uuid:"run_model"}]);if(j||t.tf.GLOBAL_DATA_PRODUCT===x||!M||!O&&0!==U.length||B.push({label:function(){return O?"Disable block as dynamic":"Set block as dynamic"},onClick:function(){return M({block:f(f({},n),{},{configuration:f(f({},p),{},{dynamic:!O})})})},uuid:"dynamic"}),R||null!==n&&void 0!==n&&n.tags)((null===y||void 0===y?void 0:y.find((function(n){var o,e;return null===R||void 0===R||null===(o=R[n])||void 0===o||null===(e=o.configuration)||void 0===e?void 0:e.dynamic})))||null!==n&&void 0!==n&&null!==(D=n.tags)&&void 0!==D&&D.includes(t.L8.DYNAMIC_CHILD))&&B.push({label:function(){return S?"Don\u2019t reduce output":"Reduce output"},onClick:function(){return M({block:f(f({},n),{},{configuration:f(f({},p),{},{reduce_output:!S})})})},uuid:"reduce_output"});B.push({label:function(){return b?"Remove callback":"Add callback"},onClick:function(){if(b)return M({block:f(f({},n),{},{has_callback:!b})}).then((function(){N(),L()}));(0,s.u7)({addon:d.cH.CALLBACKS,sideview:d.cH.ADDON_BLOCKS})},uuid:"has_callback"}),j||B.push({disabled:!!m,label:function(){return"Replicate block"},onClick:function(){return A({replicated_block:C})},uuid:"Replicate block"})}return E&&B.push({label:function(){return"Add / Edit interactions"},onClick:function(){var n;null===r||void 0===r||null===(n=r.openSidekickView)||void 0===n||n.call(r,d.cH.INTERACTIONS)},uuid:"Add interactions"}),B.push({label:function(){return"Delete block"},onClick:function(){e(n),i(!1)},uuid:"delete_block"}),l?[B.pop()]:B};function g(n){var o=n.tags,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[],l=e.conditionFailed;return null===o||void 0===o||o.forEach((function(n){t.L8.DBT_SNAPSHOT===n?i.push({description:"This is a dbt snapshot file.",title:(0,c.vg)(t.L8.DBT_SNAPSHOT)}):t.L8.DYNAMIC===n?i.push({description:"This block will create N blocks for each of its downstream blocks.",title:(0,c.vg)(t.L8.DYNAMIC)}):t.L8.DYNAMIC_CHILD===n?i.push({description:"This block is dynamically created by its upstream parent block that is dynamic.",title:(0,c.vg)(t.L8.DYNAMIC_CHILD)}):t.L8.REDUCE_OUTPUT===n?i.push({description:"Reduce output from all dynamically created blocks into a single array output.",title:(0,c.vg)(t.L8.REDUCE_OUTPUT)}):t.L8.REPLICA===n?i.push({description:"This block is a replica of another block in the current pipeline.",title:(0,c.vg)(t.L8.REPLICA)}):t.L8.CONDITION===n?l?i.push({description:"This block condition evaluated as false.",title:"Condition unmet"}):i.push({description:"This block has a condition that will be run before its execution.",title:(0,c.vg)(t.L8.CONDITION)}):i.push({title:n})})),i}function m(n){var o=n.block,e=n.dynamic,i=n.dynamicUpstreamBlock,t=n.hasError,l=(n.reduceOutput,n.reduceOutputUpstreamBlock),r=n.selected,u=i&&!l;return{borderColorShareProps:{blockColor:null===o||void 0===o?void 0:o.color,blockType:null===o||void 0===o?void 0:o.type,dynamicBlock:e,dynamicChildBlock:u,hasError:t,selected:r},tags:g(o)}}function x(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o&&(null===o||void 0===o?void 0:o.length)>=0?o.map((function(n){return{data:n,execution_state:l.uF.IDLE,type:l.Gi.TEXT_PLAIN}})):n.filter((function(n){return null===n||void 0===n?void 0:n.type}))}function y(n){return{hasError:!!n.find((function(n){return n.error})),hasOutput:n.length>=1}}var C=function(){return Object.values(t.Lq).reduce((function(n,o){return f(f({},n),{},(0,i.Z)({},o,(0,a.qn)(t.tf.CUSTOM,{blockColor:o}).accent))}),{})};function w(n,o,e){var i=null===n||void 0===n?void 0:n.reduce((function(n,o){return o?n.concat(o):n}),[]),t=(null===i||void 0===i?void 0:i[(null===i||void 0===i?void 0:i.length)-1])||0;return(.25*Math.min(t,e)||0)/o}},47001:function(n,o,e){e.d(o,{Gi:function(){return c},Go:function(){return p},I5:function(){return f},Pq:function(){return s},RJ:function(){return a},YF:function(){return d},ZG:function(){return u},ze:function(){return v}});var i=e(38626),t=e(44897),l=e(42631),r=e(70515),u=3*r.iI,d=2,c=i.default.div.withConfig({displayName:"indexstyle__NodeContainerStyle",componentId:"sc-kc7274-0"})(["min-width:fit-content;"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ",""],(function(n){return!n.isDragging&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(n){return n.isDragging&&"\n cursor: grab;\n "}),(function(n){return!n.active&&(n.isCancelled||n.disabled)&&"\n // opacity doesn\u2019t work on Safari\n border: ".concat(d,"px dotted ").concat((n.theme.content||t.Z.content).muted,";\n cursor: not-allowed;\n opacity: 0.5;\n ")}),(function(n){return(!n.selected||!n.backgroundGradient)&&!n.active&&n.borderColorBottom&&"\n border-bottom-color: ".concat(n.borderColorBottom,";\n border-width: ").concat(d,"px;\n ")}),(function(n){return(!n.selected||!n.backgroundGradient)&&!n.active&&n.borderColorLeft&&"\n border-left-color: ".concat(n.borderColorLeft,";\n border-width: ").concat(d,"px;\n ")}),(function(n){return(!n.selected||!n.backgroundGradient)&&!n.active&&n.borderColorRight&&"\n border-right-color: ".concat(n.borderColorRight,";\n border-width: ").concat(d,"px;\n ")}),(function(n){return(!n.selected||!n.backgroundGradient)&&!n.active&&n.borderColorTop&&"\n border-top-color: ".concat(n.borderColorTop,";\n border-width: ").concat(d,"px;\n ")}),(function(n){return n.selected&&!n.active&&n.backgroundGradient&&"\n background: ".concat(n.backgroundGradient,";\n padding: ").concat(d,"px;\n ")}),(function(n){return!n.borderDeemphasized&&"\n border-style: solid;\n "}),(function(n){return n.borderDeemphasized&&"\n border-style: double;\n "}),(function(n){return!n.borderRadiusLarge&&"\n border-radius: ".concat(l.n_,"px;\n ")}),(function(n){return n.borderRadiusLarge&&"\n border-radius: ".concat(l.Ro,"px;\n ")}),(function(n){return n.active&&(n.borderColorBottom||n.borderColorLeft||n.borderColorRight||n.borderColorTop)&&"\n animation: border-dance ".concat(null!==n&&void 0!==n&&n.activeSlow?"2s":".5s"," infinite linear;\n background: linear-gradient(90deg, ").concat(n.borderColorTop||n.borderColorBottom||n.borderColorLeft||n.borderColorRight," 50%, transparent 50%),\n linear-gradient(90deg, ").concat(n.borderColorRight||n.borderColorTop||n.borderColorBottom||n.borderColorLeft," 50%, transparent 50%),\n linear-gradient(0deg, ").concat(n.borderColorLeft||n.borderColorRight||n.borderColorTop||n.borderColorBottom," 50%, transparent 50%),\n linear-gradient(0deg, ").concat(n.borderColorBottom||n.borderColorLeft||n.borderColorRight||n.borderColorTop," 50%, transparent 50%);\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n padding: ").concat(d,"px;\n\n @keyframes border-dance {\n 0% {\n background-position: left top,\n right bottom,\n left bottom,\n right top;\n }\n 100% {\n background-position: left 15px top,\n right 15px bottom,\n left bottom 15px,\n right top 15px;\n }\n }\n ")}),(function(n){return n.active&&(n.borderColorBottom||n.borderColorLeft||n.borderColorRight||n.borderColorTop)&&!n.noBackground&&"\n background-size: 15px 4px, 15px 4px, 4px 15px, 4px 15px;\n "}),(function(n){return n.active&&(n.borderColorBottom||n.borderColorLeft||n.borderColorRight||n.borderColorTop)&&n.noBackground&&"\n background-size: 15px 1.5px, 15px 1.5px, 1.5px 15px, 1.5px 15px;\n "}),(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")}),(function(n){return n.opacity&&"\n opacity: ".concat(n.opacity,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__NodeStyle",componentId:"sc-kc7274-1"})(["border-radius:","px;min-width:fit-content;overflow:hidden;"," "," "," "," ",""],l.n_,(function(n){return!n.noBackground&&"\n background-color: ".concat((n.theme.background||t.Z.background).codeTextarea,";\n ")}),(function(n){return n.isConditionFailed&&"\n background-color: ".concat((n.theme.content||t.Z.content).disabled,";\n cursor: not-allowed;\n ")}),(function(n){return n.isConditionFailed&&"\n background-color: ".concat((n.theme.content||t.Z.content).disabled,";\n cursor: not-allowed;\n ")}),(function(n){return n.disabled&&"\n &:hover {\n cursor: not-allowed;\n }\n "}),(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__StatusStyle",componentId:"sc-kc7274-2"})(["height:","px;width:","px;"],2*r.iI,2*r.iI),v=i.default.div.withConfig({displayName:"indexstyle__IconStyle",componentId:"sc-kc7274-3"})(["align-items:center;border-radius:","px;border:2px solid transparent;display:flex;height:","px;justify-content:center;width:","px;"," ",""],l.BG,5*r.iI,5*r.iI,(function(n){return n.backgroundColor&&"\n background-color: ".concat(n.backgroundColor,";\n border-color: ").concat(n.backgroundColor,";\n ")}),(function(n){return n.borderColor&&"\n border-color: ".concat(n.borderColor,";\n ")})),f=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-kc7274-4"})(["padding:","px;",""],1*r.iI,(function(n){return"\n background-color: ".concat((n.theme.background||t.Z.background).dashboard,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__BodyStyle",componentId:"sc-kc7274-5"})(["padding-left:","px;padding-right:","px;"],1*r.iI,1*r.iI);i.default.div.withConfig({displayName:"indexstyle__RuntimeStyle",componentId:"sc-kc7274-6"})(["margin-right:","px;padding:12px 4px;height:100%;width:50px;background:rgba(0,0,0,0.2);background-blend-mode:soft-light;"],2*r.iI)},99543:function(n,o,e){e.d(o,{DS:function(){return s},HI:function(){return B},SX:function(){return f},YE:function(){return p},_7:function(){return w},p1:function(){return j},qj:function(){return O},rQ:function(){return y}});var i=e(21831),t=e(44425),l=e(57653),r=e(47001),u=e(70515),d=e(61709),c=e(44375),a=e(4804),s=u.cd,v=u.cd*u.iI,f=2*u.iI,p=8.62,h=7.43,b=2*r.YF,k=2*r.YF,g=2*u.iI+5*u.iI,m=2*u.iI+5*u.iI+v+v+f,x=30*u.iI;function y(n){var o=(0,d.MS)(n);if((null===o||void 0===o?void 0:o.length)>=1)return(null===o||void 0===o?void 0:o.map((function(n){return n.title})).join(", "))||"";if(t.tf.GLOBAL_DATA_PRODUCT===(null===n||void 0===n?void 0:n.type)){var e,i=null===n||void 0===n||null===(e=n.configuration)||void 0===e?void 0:e.global_data_product;if(null!==i&&void 0!==i&&i.uuid)return null===i||void 0===i?void 0:i.uuid}return t.dO[null===n||void 0===n?void 0:n.language]||""}function C(n,o){var e,i,r,u=n.description,d=n.name,s=n.type,v=u||(null===t.V4||void 0===t.V4?void 0:t.V4[s])||s;if(l.qL.INTEGRATION===(null===o||void 0===o?void 0:o.type)&&t.tf.TRANSFORMER!==n.type){var f,p,h={};if(t.t6.YAML===n.language&&(null===n||void 0===n||null===(f=n.content)||void 0===f?void 0:f.length)>=1&&(h=(0,a.Qc)(n.content)),t.tf.DATA_LOADER===n.type)r="".concat(n.uuid,": ").concat(null===(p=h)||void 0===p?void 0:p.source);else if(t.tf.DATA_EXPORTER===n.type){var b;r="".concat(n.uuid,": ").concat(null===(b=h)||void 0===b?void 0:b.destination)}}else if(t.tf.DBT===n.type&&t.t6.SQL===n.language){var k=(0,c.IU)(n),g=k.name,m=k.project;r=g,v="".concat(v,"/").concat(m)}return null!==n&&void 0!==n&&n.replicated_block&&(r=d&&u?d:null===n||void 0===n?void 0:n.uuid,u||(v=null===n||void 0===n?void 0:n.replicated_block)),(null===n||void 0===n||null===(e=n.uuid)||void 0===e||null===(i=e.split(":"))||void 0===i?void 0:i.length)>=2&&d&&(r=d),r||(r=n.uuid),{displayText:r,subtitle:v}}function w(n,o){return C(n,o).displayText||""}function O(n,o){return C(n,o).subtitle||""}function S(n){var o=0;return null===n||void 0===n||n.forEach((function(n,e){var i=n.uuid;o+=4+i.length*h,e>=1&&(o+=4)})),o}function j(n,o,e){var i,t=0,l=b+g,r=B(n,o,e)-(k+2*u.iI),d=y(n),c=(null===d||void 0===d?void 0:d.length)*h;if(c>=1){var a=1;c>r&&(a=Math.ceil(c/r)),t+=1,l+=18*a}var s=e||{},v=s.blockStatus;return[s.callbackBlocks,s.conditionalBlocks,s.extensionBlocks].forEach((function(n){if((null===n||void 0===n?void 0:n.length)>=1){var o=S(n),e=1;o>r&&(e=Math.ceil(o/r)),t+=1,l+=18.5*e+4*(e-1)}})),"undefined"!==typeof(null===v||void 0===v||null===(i=v[n.uuid])||void 0===i?void 0:i.runtime)&&(l+=18,t+=1),l+=(t+=1)*(1*u.iI)}function B(n,o,e){var t,l,r=Math.max((null===(t=w(n,o))||void 0===t?void 0:t.length)*p,(null===(l=O(n,o))||void 0===l?void 0:l.length)*h),u=y(n),d=(null===u||void 0===u?void 0:u.length)*h,c=e||{},a=c.callbackBlocks,s=c.conditionalBlocks,v=c.extensionBlocks,f=Math.max.apply(Math,(0,i.Z)([a,s,v].map((function(n){return S(n)})).concat(d)));return f>r&&(r=Math.min(x,f)),k+m+r}},21978:function(n,o,e){e.d(o,{Jo:function(){return l},WN:function(){return u},bJ:function(){return r},rl:function(){return i}});var i,t=e(44425),l=(e(70515).iI,1e4),r={height:10,width:10},u={height:6,width:6};t.tf.DATA_EXPORTER,t.tf.SENSOR,t.Lq.GREY,t.Lq.PINK,t.Lq.TEAL,t.Lq.YELLOW;!function(n){n.NORTH="NORTH",n.SOUTH="SOUTH"}(i||(i={}))},55187:function(n,o,e){e.d(o,{$4:function(){return v},dg:function(){return c},ki:function(){return a}});var i=e(75582),t=e(38626),l=e(44897),r=e(42631),u=e(47041),d=e(70515),c=2;function a(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.Z,o={};return[null===n||void 0===n?void 0:n.accent,null===n||void 0===n?void 0:n.content,null===n||void 0===n?void 0:n.monotone].forEach((function(n){Object.entries(n).forEach((function(n){var e=(0,i.Z)(n,2),t=e[0],l=e[1];o[l]=t}))})),o}var s=Object.entries(a()).reduce((function(n,o){var e=(0,i.Z)(o,2),t=e[0],l=e[1];return n.concat("\n .edge-rect-".concat(l," {\n rect {\n fill: ").concat(t,";\n }\n }\n\n .edge-line-").concat(l," {\n line {\n stroke: ").concat(t,";\n }\n }\n "))}),[]),v=t.default.div.withConfig({displayName:"indexstyle__GraphContainerStyle",componentId:"sc-bc2ei5-0"})(["position:relative;div{","}"," .edge{&.activeSlow{animation:dashdraw 2s linear infinite;stroke-dasharray:5;stroke-width:",";}&.active{animation:dashdraw .5s linear infinite;stroke-dasharray:5;stroke-width:",";}&.inactive{}&.selected-twice{stroke-dasharray:4 2 4 2 4 8;stroke-width:",";}&.selected-twice.group{stroke-dasharray:8 24;stroke-width:",";}}@keyframes dashdraw{0%{stroke-dashoffset:10;}}.edge-rect{rect{fill:none;}}.edge-line{line{stroke-width:","px;}}.edge-line-remove{line{","}}",""],u.w5,(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")}),c,c,c,c,d.iI/4,(function(n){return"\n stroke: ".concat((n.theme.accent||l.Z.accent).negative,";\n ")}),s.join("\n"));t.default.div.withConfig({displayName:"indexstyle__NodeStyle",componentId:"sc-bc2ei5-1"})(["border-radius:","px;border:1px solid transparent;min-width:fit-content;"," "," "," "," "," ",""],r.BG,(function(n){return n.selected&&"\n border-color: ".concat((n.theme.content||l.Z.content).active,";\n ")}),(function(n){return n.backgroundColor&&"\n background-color: ".concat(n.backgroundColor,";\n ")}),(function(n){return(n.isCancelled||n.disabled)&&"\n // opacity doesn\u2019t work on Safari\n border-color: ".concat((n.theme.content||l.Z.content).active,";\n border-style: dashed;\n cursor: not-allowed;\n ")}),(function(n){return n.isConditionFailed&&"\n background-color: ".concat((n.theme.content||l.Z.content).disabled,";\n cursor: not-allowed;\n ")}),(function(n){return n.disabled&&"\n &:hover {\n cursor: not-allowed;\n }\n "}),(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")})),t.default.div.withConfig({displayName:"indexstyle__RuntimeStyle",componentId:"sc-bc2ei5-2"})(["margin-right:","px;padding:12px 4px;height:100%;width:50px;background:rgba(0,0,0,0.2);background-blend-mode:soft-light;"],2*d.iI)},24138:function(n,o,e){e.d(o,{Xz:function(){return En},kS:function(){return Tn},NB:function(){return In},GR:function(){return _n},ZP:function(){return Zn}});var i=e(75582),t=e(21831),l=e(82394),r=e(26304),u=e(77837),d=e(38860),c=e.n(d),a=e(51774),s=e.n(a),v=e(38626),f=e(82684),p=e(69864),h=e(79757),b=e(44425),k=e(39867),g=e(97618),m=e(55485),x=e(38276),y=e(30160),C=e(72473),w=e(47001),O=e(99543),S=e(55283),j=e(21978),B=e(41143),E=e(70515),I=e(86735);var T=e(61709),_=e(81728);function Z(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function D(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?Z(Object(e),!0).forEach((function(o){(0,l.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Z(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var P=function(n){var o=n/1e3,e=4-Math.floor(o).toString().length,i=(0,_.QV)(o,e>=0?e:0),t="s";return i>1e3&&(i=(0,_.QV)(i/60,0),t="m"),"".concat(i).concat(t)};function A(n){return"parent\u2192".concat(n)}function R(n){return["parent"].concat((0,I.YC)(n,(function(n){return n}))).join("\u2192")}function N(n,o){return"".concat(o,"\u2192").concat(n)}function L(n,o){return{from:o,fromPort:"".concat(o,"\u2192").concat(n,":from"),id:N(n,o),to:n,toPort:"".concat(o,"\u2192").concat(n,":to")}}function M(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return[n,o,"from"].filter((function(n){return n})).join("\u2192")}function H(n,o,e){var i,t={},l=D(D({},j.WN),{},{disabled:!0});if(null!==e&&void 0!==e&&null!==(i=e.activeNodes)&&void 0!==i&&i[n]&&(l.height=0,l.width=0),(null===o||void 0===o?void 0:o.length)>=1)o.forEach((function(o){var e=M(n,o);t[e]=D(D({},l),{},{id:e,side:j.rl.SOUTH})}));else{var r=M(n);t[r]=D(D({},l),{},{id:r,side:j.rl.SOUTH})}return t}function U(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return[o,n,"to"].filter((function(n){return n})).join("\u2192")}function G(n,o,e){var i,t={},l=D(D({},j.WN),{},{disabled:!0});if(null!==e&&void 0!==e&&null!==(i=e.activeNodes)&&void 0!==i&&i[n]&&(l.height=0,l.width=0),(null===o||void 0===o?void 0:o.length)>=1)o.forEach((function(o){var e=U(n,o);t[e]=D(D({},l),{},{id:e,side:j.rl.NORTH})}));else{var r=U(n);t[r]=D(D({},l),{},{id:r,side:j.rl.NORTH})}return t}function W(n){var o,e=n.activeNodes,r=n.blockStatus,u=(n.blockUUIDMapping,n.blocks),d=n.callbackBlocksByBlockUUID,c=n.conditionalBlocksByBlockUUID,a=n.downstreamBlocksMapping,s=n.enablePorts,v=n.extensionBlocksByBlockUUID,f=n.nodeHovering,p=n.pipeline,h=n.selectedBlock,b=D({},e);f&&(b[null===f||void 0===f?void 0:f.id]=f);var k={},g={},m={},x=(0,I.HK)(u||[],(function(n){return n.uuid})),y={};null===u||void 0===u||u.forEach((function(n){var o;if((null===n||void 0===n||null===(o=n.upstream_blocks)||void 0===o?void 0:o.length)>=1){var e=(null===n||void 0===n?void 0:n.upstream_blocks)||[],i=(0,I.YC)(e,(function(n){return n})).join(",");i in y||(y[i]={downstreamBlocks:[],upstreamBlocks:null===e||void 0===e?void 0:e.reduce((function(n,o){var e=null===x||void 0===x?void 0:x[o];return e?n.concat(e):n}),[])}),y[i].downstreamBlocks.push(n)}}));var C={},w={};Object.values(y||{}).forEach((function(n){var o=n.downstreamBlocks,e=n.upstreamBlocks;if((null===o||void 0===o?void 0:o.length)>=2){var i={};null===o||void 0===o||o.forEach((function(n){var o=n.downstream_blocks;if((null===o||void 0===o?void 0:o.length)>=1){var e=(0,I.YC)(o||[],(function(n){return n})).join(",");e in i||(i[e]=0),i[e]+=1}}));var l=Object.values(i||{})||[],r=Math.max.apply(Math,(0,t.Z)(l));(null===l||void 0===l||!l.length||r>=2)&&(null===o||void 0===o||o.forEach((function(o){var e=null===o||void 0===o?void 0:o.uuid;e in C||(C[e]=[]),C[e].push(n)})),null===e||void 0===e||e.forEach((function(o){var e=null===o||void 0===o?void 0:o.uuid;e in w||(w[e]=[]),w[e].push(n)})))}})),null===u||void 0===u||u.forEach((function(n){n.tags;var o=n.upstream_blocks,e=void 0===o?[]:o,i=n.uuid,t=a[i];i in m||(m[i]={});var u=null===d||void 0===d?void 0:d[null===n||void 0===n?void 0:n.uuid],s=null===c||void 0===c?void 0:c[null===n||void 0===n?void 0:n.uuid],f=null===v||void 0===v?void 0:v[null===n||void 0===n?void 0:n.uuid];k[i]={data:{block:n},height:(0,O.p1)(n,p,{blockStatus:r,callbackBlocks:u,conditionalBlocks:s,extensionBlocks:f}),id:i,width:(0,O.HI)(n,p,{blockStatus:r,callbackBlocks:u,conditionalBlocks:s,extensionBlocks:f})};var h={height:null!==b&&void 0!==b&&b[i]?2*E.iI:0,width:null!==b&&void 0!==b&&b[i]?2*E.iI:0},x="".concat(i,"-upstream-add"),y=function(n){return"".concat(n,"-dowstream-add")}(i);if(m[i][x]=D(D({},h),{},{id:x,side:j.rl.NORTH}),m[i][y]=D(D({},h),{},{id:y,side:j.rl.SOUTH}),!(i in C)){(null===e||void 0===e?void 0:e.length)>=1&&(m[i]=D(D({},null===m||void 0===m?void 0:m[i]),G(i,e,{activeNodes:b})),null===e||void 0===e||e.forEach((function(n){var o=L(i,n);g[o.id]=o})));var S=(null===w||void 0===w?void 0:w[i])||[],B=null===S||void 0===S?void 0:S.reduce((function(n,o){var e;return D(D({},n),null===o||void 0===o||null===(e=o.downstreamBlocks)||void 0===e?void 0:e.reduce((function(n,o){return D(D({},n),{},(0,l.Z)({},null===o||void 0===o?void 0:o.uuid,o))}),{}))}),{});null===t||void 0===t||t.forEach((function(n){var o=n.uuid;o in B||(m[i]=D(D({},null===m||void 0===m?void 0:m[i]),H(i,[o],{activeNodes:b})))}))}}));var S={};null===(o=Object.entries(w||{}))||void 0===o||o.forEach((function(n){var o=(0,i.Z)(n,2),e=(o[0],o[1]);null===e||void 0===e||e.forEach((function(n){var o=n.downstreamBlocks,e=n.upstreamBlocks,i=R(null===e||void 0===e?void 0:e.reduce((function(n,o){return o&&null!==o&&void 0!==o&&o.uuid?n.concat(null===o||void 0===o?void 0:o.uuid):n}),[]));i in S||(S[i]={downstreamBlocks:o,upstreamBlocks:e})}))}));var B={};return Object.entries(S||{}).forEach((function(n){var o,e=(0,i.Z)(n,2),t=e[0],l=e[1],r=l.downstreamBlocks,u=l.upstreamBlocks,d={data:{block:null===u||void 0===u?void 0:u[0],blocks:u,children:r},id:t};k[t]=d;var c=function(n,o,e,t,l){(0,I.YC)((null===n||void 0===n?void 0:n.map((function(n){return n.uuid})))||[],(function(n){return n.uuid}));var r,u={};null===n||void 0===n||n.forEach((function(n){var e=n.uuid,i=null===o||void 0===o?void 0:o[e];null===i||void 0===i||i.forEach((function(o){o.downstreamBlocks;var e=o.upstreamBlocks,i=R((0,I.YC)((null===e||void 0===e?void 0:e.map((function(n){return n.uuid})))||[],(function(n){return n.uuid})));i in u||(u[i]=[]),u[i].push(n)}))}));var d={};if(Object.entries(u||{}).forEach((function(n){var o=(0,i.Z)(n,2),l=(o[0],o[1]),r=null===l||void 0===l?void 0:l.filter((function(n){var o=n.uuid;return null===e||void 0===e?void 0:e[o]})),u=R(null===r||void 0===r?void 0:r.map((function(n){return n.uuid})));if(u in t){var c=null===t||void 0===t?void 0:t[u];d[u]=c}})),(null===(r=Object.keys(d))||void 0===r?void 0:r.length)>=1)return d}(r,C,w,S);c&&(B[t]=c);var a=null===(o=Object.values(c||{}))||void 0===o?void 0:o.reduce((function(n,o){var e=o.upstreamBlocks;return n.concat(null===e||void 0===e?void 0:e.map((function(n){return n.uuid})))}),[]);null===r||void 0===r||r.forEach((function(n){var o=n.uuid;null!==a&&void 0!==a&&a.includes(o)||!(o in k)||(k[o].parent=t)})),null===u||void 0===u||u.forEach((function(n){var o=null===n||void 0===n?void 0:n.uuid;null===r||void 0===r||r.forEach((function(n){var e=n.uuid;if((null===h||void 0===h?void 0:h.uuid)===o||(null===h||void 0===h?void 0:h.uuid)===e){var i=L(e,o);g[i.id]=i,m[o]=D(D({},null===m||void 0===m?void 0:m[o]),H(o,[e],{activeNodes:b})),m[e]=D(D({},null===m||void 0===m?void 0:m[e]),G(e,[o],{activeNodes:b}))}}));var e=L(t,o);g[e.id]=e,m[o]=D(D({},null===m||void 0===m?void 0:m[o]),H(o,[t],{activeNodes:b})),m[t]=D(D({},null===m||void 0===m?void 0:m[t]),G(t,[o],{activeNodes:b}))}))})),Object.entries(B||{}).forEach((function(n){var o=(0,i.Z)(n,2),e=o[0],t=o[1];Object.entries(t||{}).forEach((function(n){var o=(0,i.Z)(n,2),t=o[0],l=o[1],r=l.downstreamBlocks,u=l.upstreamBlocks,d=R([e,t]),c={data:{block:null===u||void 0===u?void 0:u[0],blocks:u,children:r},id:d,parent:e};k[d]=c,null===u||void 0===u||u.forEach((function(n){var o=n.uuid;o in k&&(k[o].parent=d);var e=N(t,o);if(e in g&&delete g[e],o in m){var i=M(o,t);i in(null===m||void 0===m?void 0:m[o])&&delete m[o][i]}if(t in m){var l=U(t,o);l in(null===m||void 0===m?void 0:m[t])&&delete m[t][l]}}));var a=L(t,d);g[a.id]=a,m[d]=D(D({},null===m||void 0===m?void 0:m[d]),H(d,[t],{activeNodes:b})),m[t]=D(D({},null===m||void 0===m?void 0:m[t]),G(t,[d],{activeNodes:b}))}))})),s&&Object.entries(m).forEach((function(n){var o=(0,i.Z)(n,2),e=o[0],t=o[1],l=null===k||void 0===k?void 0:k[e];l&&(l.ports=Object.values(t))})),{blocksWithDownstreamBlockSet:w,edges:Object.values(g||{}),nodes:Object.values(k||{}),ports:m}}function F(n){var o=n.block,e=n.blockStatus,i=n.messages,t=n.noStatus,l=n.runningBlocks,r=n.runningBlocksMapping;if(t||!o)return{};if(e){var u=(null===e||void 0===e?void 0:e[function(n){var o=n.uuid,e=n.replicated_block;return e?"".concat(o,":").concat(e):o}(o)])||{},d=u.status,c=u.runtime;return{hasFailed:B.V.FAILED===d,isCancelled:B.V.CANCELLED===d,isConditionFailed:B.V.CONDITION_FAILED===d,isInProgress:B.V.RUNNING===d,isQueued:B.V.INITIAL===d,isSuccessful:B.V.COMPLETED===d,runtime:c}}var a,s=(0,T.h5)((null===i||void 0===i?void 0:i[null===o||void 0===o?void 0:o.uuid])||[]),v=(0,T.oI)(s),f=v.hasError,p=v.hasOutput,h=!(null===r||void 0===r||!r[null===o||void 0===o?void 0:o.uuid]);return{hasFailed:!h&&(f||b.DA.FAILED===o.status),isInProgress:h,isQueued:h&&(null===(a=l[0])||void 0===a?void 0:a.uuid)!==o.uuid,isSuccessful:!h&&(!f&&p||b.DA.EXECUTED===o.status)}}var V,Y=e(28598);function X(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function q(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?X(Object(e),!0).forEach((function(o){(0,l.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):X(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var K=(V={},(0,l.Z)(V,b.tf.DATA_EXPORTER,C.zS),(0,l.Z)(V,b.tf.DATA_LOADER,C.rH),(0,l.Z)(V,b.tf.DBT,C.xE),(0,l.Z)(V,b.tf.GLOBAL_DATA_PRODUCT,C.ie),(0,l.Z)(V,b.tf.SENSOR,C.LM),(0,l.Z)(V,b.tf.TRANSFORMER,C.Sv),V);var z=function(n){var o=n.anotherBlockSelected,e=n.block,i=n.blocksWithSameDownstreamBlocks,r=n.callbackBlocks,u=n.children,d=n.conditionalBlocks,c=n.disabled,a=n.downstreamBlocks,s=n.extensionBlocks,p=n.hasFailed,j=n.height,B=n.hideNoStatus,E=n.hideStatus,T=n.isCancelled,_=n.isConditionFailed,Z=n.isDragging,D=n.isInProgress,A=n.isQueued,R=n.isSuccessful,N=n.opacity,L=n.pipeline,M=n.runtime,H=n.selected,U=n.selectedBlock,G=(0,f.useContext)(v.ThemeContext),W=!(D||A||p||R||T||_),F=p&&!(D||A),V=!F&&R&&!(D||A),X="";W?X="No status":V?X="Successful execution":F?X="Failed execution":D?X="Currently executiing":T&&(X="Cancelled execution");var z=e.color,Q=e.runtime,J=e.type,$=(0,S.qn)(J,{blockColor:z,theme:G}),nn=$.accent,on=$.accentLight,en=(0,f.useMemo)((function(){return(0,O.rQ)(e)}),[e]),tn=(0,f.useMemo)((function(){var n,o,e=K[J]||C.EJ,i=!1;return[b.tf.CALLBACK,b.tf.CHART,b.tf.CONDITIONAL,b.tf.CUSTOM,b.tf.DATA_EXPORTER,b.tf.DATA_LOADER,b.tf.EXTENSION,b.tf.SCRATCHPAD,b.tf.SENSOR,b.tf.MARKDOWN,b.tf.TRANSFORMER].includes(J)?n=nn:[b.tf.DBT].includes(J)&&(o=nn),[b.tf.DATA_EXPORTER].includes(J)&&(i=!0),(0,Y.jsx)(w.ze,{backgroundColor:n,borderColor:o,children:(0,Y.jsx)("div",{style:{height:w.ZG,width:w.ZG},children:(0,Y.jsx)(e,{inverted:i,size:w.ZG})})})}),[nn,J]),ln=(0,f.useMemo)((function(){var n=[],e=[];if(A)(0,I.w6)(4).forEach((function(){var o,i;n.push(null===G||void 0===G||null===(o=G.content)||void 0===o?void 0:o.muted),e.push(null===G||void 0===G||null===(i=G.content)||void 0===i?void 0:i.muted)}));else if((null===i||void 0===i?void 0:i.length)>=2&&(null===a||void 0===a?void 0:a.length)>=1){var r,u=[];null!==i&&void 0!==i&&i.find((function(n){var o=n.uuid;return(null===U||void 0===U?void 0:U.uuid)===o}))?u.push(U):u.push.apply(u,(0,t.Z)(i)),null===u||void 0===u||null===(r=u.slice(0,4))||void 0===r||r.forEach((function(o){var i=(0,S.qn)(null===o||void 0===o?void 0:o.type,{blockColor:null===o||void 0===o?void 0:o.color,theme:G}),t=i.accent,l=i.accentLight;n.push(l),e.push(t)}))}else n.push.apply(n,[on,on,on,on]),e.push.apply(e,[nn,nn,nn,nn]);if((null===n||void 0===n?void 0:n.length)<4)for(var d=0,c=(null===n||void 0===n?void 0:n.length)||0;(null===n||void 0===n?void 0:n.length)<4;)n.push(null===n||void 0===n?void 0:n[d]),(d+=1)===c&&(d=0);if((null===e||void 0===e?void 0:e.length)<4)for(var s=0,v=(null===e||void 0===e?void 0:e.length)||0;(null===e||void 0===e?void 0:e.length)<4;)e.push(null===e||void 0===e?void 0:e[s]),(s+=1)===v&&(s=0);return["borderColorBottom","borderColorLeft","borderColorRight","borderColorTop"].reduce((function(i,t,r){return q(q({},i),{},(0,l.Z)({},t,!H&&o?null===n||void 0===n?void 0:n[r]:null===e||void 0===e?void 0:e[r]))}),{})}),[nn,on,o,i,a,A,H,U,G]),rn=ln.borderColorBottom,un=ln.borderColorLeft,dn=ln.borderColorRight,cn=ln.borderColorTop;return(0,Y.jsx)(w.Gi,{active:D,activeSlow:A,backgroundGradient:!(null!==a&&void 0!==a&&a.length)&&(0,S.u2)(J),borderColorBottom:rn,borderColorLeft:un,borderColorRight:dn,borderColorTop:cn,borderDeemphasized:(null===a||void 0===a?void 0:a.length)>=1,borderRadiusLarge:(null===a||void 0===a?void 0:a.length)>=1,disabled:c,height:j,isCancelled:T,isDragging:Z,noBackground:(null===a||void 0===a?void 0:a.length)>=1,opacity:N,selected:H,children:(0,Y.jsxs)(w.RJ,{disabled:c,height:j-2*w.YF,isConditionFailed:_,noBackground:(null===a||void 0===a?void 0:a.length)>=1,children:[!(null!==a&&void 0!==a&&a.length)&&(0,Y.jsx)(w.I5,{children:(0,Y.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,Y.jsxs)(g.Z,{flex:1,children:[tn,(0,Y.jsx)(x.Z,{mr:O.DS}),(0,Y.jsxs)(g.Z,{flexDirection:"column",children:[(0,Y.jsx)(y.ZP,{bold:!0,monospace:!0,children:(0,O._7)(e,L)}),(0,Y.jsx)(y.ZP,{default:!0,monospace:!0,small:!0,children:(0,O.qj)(e,L)})]})]}),(0,Y.jsx)(x.Z,{mr:"15px"}),(0,Y.jsx)(w.Pq,{title:X,children:!E&&(0,Y.jsxs)(Y.Fragment,{children:[V&&(0,Y.jsx)(C.Jr,{size:O.SX,success:!0}),F&&(0,Y.jsx)(C.x8,{danger:!0,size:O.SX}),W&&!B&&(0,Y.jsx)(k.Z,{borderSize:1,muted:!0,size:O.SX})]})})]})}),(0,Y.jsxs)(w.Go,{children:[!(null!==a&&void 0!==a&&a.length)&&(0,Y.jsxs)(Y.Fragment,{children:[(null===en||void 0===en?void 0:en.length)>=1&&(0,Y.jsx)(x.Z,{mt:1,children:(0,Y.jsx)(y.ZP,{default:!0,monospace:!0,small:!0,children:en})}),[d,r,s].map((function(n,o){if((null===n||void 0===n?void 0:n.length)>=1)return(0,Y.jsx)("div",{style:{marginTop:4},children:(0,Y.jsx)(m.ZP,{alignItems:"center",flexWrap:"wrap",children:n.reduce((function(n,o,e){return e>=1&&n.push((0,Y.jsx)("div",{style:{width:4}},"space-".concat(o.uuid))),n.push((0,Y.jsx)("div",{style:{marginTop:4},children:(0,Y.jsx)(h.Z,{color:(0,S.qn)(o.type,{blockColor:o.color,theme:G}).accentLight,monospace:!0,small:!0,children:o.uuid})},"badge-".concat(o.uuid))),n}),[])})},"badge-blocks-".concat(o))})),(Q||M)&&(0,Y.jsx)(x.Z,{mt:1,children:(0,Y.jsx)(y.ZP,{monospace:!0,muted:!0,small:!0,children:P(Q||M)})})]}),u]})]})})},Q=e(50724),J=e(15338),$=e(93369),nn=e(48670),on=e(65956),en=e(57653),tn=e(71180),ln=e(12468),rn=e(42631),un=e(72191),dn=e(44897),cn=v.default.div.withConfig({displayName:"indexstyle__ZoomControlsStyle",componentId:"sc-1usy46j-0"})(["position:absolute;bottom:","px;left:50%;transform:translateX(-50%);display:flex;justify-content:center;background-color:",";border:1px solid ",";border-radius:","px;box-shadow:",";"],3*E.iI,(function(n){return(n.theme.background||dn.Z.background).panel}),(function(n){return(n.theme.borders||dn.Z.borders).darkLight}),rn.g5,(function(n){return(n.theme.shadow||dn.Z.shadow).frame})),an=v.default.div.withConfig({displayName:"indexstyle__ZoomDisplayStyle",componentId:"sc-1usy46j-1"})(["padding:","px ","px ","px ","px;border-radius:0 ","px ","px 0;cursor:default;",""],1.5*E.iI,3.25*E.iI,1.5*E.iI,1.875*E.iI,rn.g5,rn.g5,(function(n){return n.minimizeControls&&"\n padding: ".concat(1.5*E.iI,"px ").concat(1.875*E.iI,"px;\n border-radius: ").concat(rn.g5,"px;\n ")}));function sn(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function vn(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?sn(Object(e),!0).forEach((function(o){(0,l.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):sn(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var fn=35*E.iI,pn={bottomOffset:6.5*E.iI,size:null,widthFitContent:!0},hn={highlightOnHoverAlt:!0,iconOnly:!0,noBorder:!0,padding:"".concat(1.5*E.iI,"px ").concat(1.875*E.iI,"px"),transparent:!0},bn={size:un._k};function kn(n){var o=n.canvasRef,e=n.containerRef,i=n.zoomLevel,t=(0,f.useState)(!1),l=t[0],r=t[1];return(0,f.useEffect)((function(){if(null!==e&&void 0!==e&&e.current){var n=new ResizeObserver((function(){var n=e.current.offsetWidth;r(n<fn)}));return n.observe(e.current),function(){return n.disconnect()}}}),[e]),(0,Y.jsxs)(cn,{onDoubleClick:function(n){n.stopPropagation()},children:[!l&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ln.Z,vn(vn({},pn),{},{label:"Reset (shortcut: double-click canvas)",children:(0,Y.jsx)(tn.ZP,vn(vn({},hn),{},{borderRadius:"".concat(rn.g5,"px 0 0 ").concat(rn.g5,"px"),onClick:function(){var n,e;return null===o||void 0===o||null===(n=o.current)||void 0===n||null===(e=n.fitCanvas)||void 0===e?void 0:e.call(n)},padding:"".concat(1.5*E.iI,"px ").concat(1.875*E.iI,"px ").concat(1.5*E.iI,"px ").concat(3.25*E.iI,"px"),children:(0,Y.jsx)(C.Qc,vn({},bn))}))})),(0,Y.jsx)(ln.Z,vn(vn({},pn),{},{label:"Zoom in",children:(0,Y.jsx)(tn.ZP,vn(vn({},hn),{},{onClick:function(){var n,e;return null===o||void 0===o||null===(n=o.current)||void 0===n||null===(e=n.setZoom)||void 0===e?void 0:e.call(n,i-1+.5)},children:(0,Y.jsx)(C.DY,vn({},bn))}))})),(0,Y.jsx)(ln.Z,vn(vn({},pn),{},{label:"Zoom out",children:(0,Y.jsx)(tn.ZP,vn(vn({},hn),{},{onClick:function(){var n,e;return null===o||void 0===o||null===(n=o.current)||void 0===n||null===(e=n.setZoom)||void 0===e?void 0:e.call(n,i-1-.5)},children:(0,Y.jsx)(C.H9,vn({},bn))}))}))]}),(0,Y.jsx)(ln.Z,vn(vn({},pn),{},{label:"Zoom level",children:(0,Y.jsx)(an,{minimizeControls:l,children:(0,Y.jsx)(y.ZP,{center:!0,large:!0,minWidth:5*E.iI,children:"".concat(Math.round(100*i),"%")})})}))]})}var gn=(0,f.memo)(kn),mn=e(35686),xn=e(77417),yn=e(55187),Cn=e(85385),wn=e(72619),On=e(3314),Sn=["forwardedRef"];function jn(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function Bn(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?jn(Object(e),!0).forEach((function(o){(0,l.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):jn(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var En=s()((0,u.Z)(c().mark((function n(){var o,i;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,i=o.Canvas,n.abrupt("return",(function(n){var o=n.forwardedRef,e=(0,r.Z)(n,Sn);return(0,Y.jsx)(i,Bn({ref:o},e))}));case 5:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),In=s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Node);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),Tn=s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Edge);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),_n=s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Port);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}});s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Add);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Remove);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.MarkerArrow);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}});var Zn=function(n){var o=n.addNewBlockAtIndex,e=n.blockRefs,r=n.blockStatus,u=n.blocksOverride,d=n.blocks,c=n.contentByBlockUUID,a=n.contextMenuEnabled,s=n.deleteBlock,h=n.disabled,k=n.dragEnabled,g=n.editingBlock,C=n.enablePorts,w=void 0!==C&&C,B=n.fetchPipeline,T=n.height,_=n.heightOffset,Z=void 0===_?10*E.iI:_,D=n.messages,P=n.noStatus,N=n.onClickNode,L=n.runBlock,H=n.pannable,U=void 0===H||H,G=n.pipeline,V=n.runningBlocks,X=void 0===V?[]:V,q=n.selectedBlock,K=n.setActiveSidekickView,tn=n.setEditingBlock,ln=n.setErrors,rn=n.setSelectedBlock,un=n.setZoom,dn=n.showDynamicBlocks,cn=void 0!==dn&&dn,an=n.showUpdateBlockModal,sn=n.treeRef,vn=n.zoomable,fn=void 0===vn||vn,pn=(0,xn.Z)(),hn=pn.featureEnabled,bn=pn.featureUUIDs,kn=(0,f.useContext)(v.ThemeContext),Sn=((0,f.useMemo)((function(){return(0,yn.ki)(kn)}),[kn]),(0,f.useRef)(null)),jn=((0,f.useRef)({}),(0,f.useRef)({})),Zn=(0,f.useRef)({}),Dn=(0,f.useRef)(null),Pn=sn||Dn,An=(0,f.useState)(1),Rn=An[0],Nn=An[1],Ln=(0,f.useState)(null),Mn=Ln[0],Hn=Ln[1],Un=(0,f.useState)({}),Gn=Un[0],Wn=Un[1],Fn=(0,f.useState)({}),Vn=Fn[0],Yn=Fn[1],Xn=(0,f.useState)(null),qn=Xn[0],Kn=Xn[1],zn=(0,f.useState)(!1),Qn=zn[0],Jn=zn[1],$n=(0,f.useState)(null),no=$n[0],oo=$n[1],eo=(0,f.useState)(null),io=eo[0],to=eo[1],lo=(0,f.useState)(null),ro=lo[0],uo=lo[1];(0,f.useEffect)((function(){var n=function(n){Qn&&no&&oo((function(o){return Bn(Bn({},o),{},{event:n})}))},o=function(n){Qn&&no&&(Jn(!1),setTimeout((function(){return oo(null)}),1))};return window.addEventListener("mousemove",n),window.addEventListener("mouseup",o),function(){window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",o)}}),[Qn,no]);var co=(0,f.useState)(null),ao=co[0],so=co[1],vo=(0,f.useState)([]),fo=vo[0],po=vo[1],ho=(0,f.useState)(!1),bo=(ho[0],ho[1],(null===g||void 0===g?void 0:g.upstreamBlocks)||{}),ko=bo.block,go=bo.values,mo=void 0===go?[]:go,xo=(0,f.useMemo)((function(){return mo.length}),[mo]),yo=(0,f.useMemo)((function(){var n;return(null===(n=u||(null===G||void 0===G?void 0:G.blocks))||void 0===n?void 0:n.filter((function(n){var o=n.type;return!b.iZ.includes(o)})))||[]}),[u,null===G||void 0===G?void 0:G.blocks]),Co=(0,f.useMemo)((function(){return yo}),[yo,cn]),wo=(0,f.useMemo)((function(){if(u)return u;if(d)return d;if(G){var n={},o=[];return o.push.apply(o,(0,t.Z)(null===G||void 0===G?void 0:G.blocks)),o.push.apply(o,(0,t.Z)(null===G||void 0===G?void 0:G.callbacks)),o.push.apply(o,(0,t.Z)(null===G||void 0===G?void 0:G.conditionals)),Object.values(null===G||void 0===G?void 0:G.extensions).forEach((function(n){var e=n.blocks;o.push.apply(o,(0,t.Z)(e))})),o.reduce((function(o,e){return n[e.uuid]||o.push(e),o}),[])}return[]}),[d,u,G]),Oo=(0,f.useMemo)((function(){return(0,I.HK)(wo||[],(function(n){return n.uuid}))}),[wo]),So=(0,f.useMemo)((function(){var n={};return null===Co||void 0===Co||Co.map((function(o){var e;n[o.uuid]=null===o||void 0===o||null===(e=o.callback_blocks)||void 0===e?void 0:e.reduce((function(n,o){var e=null===Oo||void 0===Oo?void 0:Oo[o];return e?n.concat(e):n}),[])})),n}),[Co,Oo]),jo=(0,f.useMemo)((function(){var n={};return null===Co||void 0===Co||Co.map((function(o){var e;n[o.uuid]=null===o||void 0===o||null===(e=o.conditional_blocks)||void 0===e?void 0:e.reduce((function(n,o){var e=null===Oo||void 0===Oo?void 0:Oo[o];return e?n.concat(e):n}),[])})),n}),[Co,Oo]),Bo=(0,f.useMemo)((function(){var n={};return null===Co||void 0===Co||Co.map((function(o){var e,t=[];null===(e=Object.entries((null===G||void 0===G?void 0:G.extensions)||{}))||void 0===e||e.forEach((function(n){var e=(0,i.Z)(n,2),l=e[0],r=e[1].blocks;null===r||void 0===r||r.forEach((function(n){var e=n.upstream_blocks,i=n.uuid;if(null!==e&&void 0!==e&&e.includes(null===o||void 0===o?void 0:o.uuid)){var r=null===Oo||void 0===Oo?void 0:Oo[i];r&&t.push(Bn(Bn({},r),{},{extension_uuid:l}))}}))})),n[o.uuid]=t})),n}),[Co,Oo,G]),Eo=(0,f.useMemo)((function(){return(0,I.HK)(X,(function(n){return n.uuid}))}),[X]);(0,f.useEffect)((function(){setTimeout((function(){var n,o,e,i,t;0===(null===Pn||void 0===Pn||null===(n=Pn.current)||void 0===n||null===(o=n.containerRef)||void 0===o||null===(e=o.current)||void 0===e?void 0:e.scrollTop)&&(null===Pn||void 0===Pn||null===(i=Pn.current)||void 0===i||null===(t=i.fitCanvas)||void 0===t||t.call(i))}),1e3)}),[Pn]);var Io=(0,p.Db)(mn.ZP.blocks.pipelines.useUpdate(null===G||void 0===G?void 0:G.uuid,encodeURIComponent(null===ko||void 0===ko?void 0:ko.uuid)),{onSuccess:function(n){return(0,wn.wD)(n,{callback:function(){tn({upstreamBlocks:null}),null===B||void 0===B||B()},onErrorCallback:function(n,o){return null===ln||void 0===ln?void 0:ln({errors:o,response:n})}})}}),To=(0,i.Z)(Io,2),_o=To[0],Zo=To[1].isLoading,Do=(0,p.Db)((function(n){var o=n.block,e=n.downstreamBlocks,i=n.upstreamBlocks,t=Bn({},o);return"undefined"!==typeof e&&(t.downstream_blocks=e),"undefined"!==typeof i&&(t.upstream_blocks=i),mn.ZP.blocks.pipelines.useUpdate(null===G||void 0===G?void 0:G.uuid,encodeURIComponent(null===o||void 0===o?void 0:o.uuid))({block:t})}),{onSuccess:function(n){return(0,wn.wD)(n,{callback:function(){null===B||void 0===B||B()},onErrorCallback:function(n,o){return null===ln||void 0===ln?void 0:ln({errors:o,response:n})}})}}),Po=(0,i.Z)(Do,1)[0],Ao=(0,f.useCallback)((function(n){var o=n.type,i=n.uuid;if(null===rn||void 0===rn||rn(n),po([]),null!==e&&void 0!==e&&e.current){var t,l=e.current["".concat(o,"s/").concat(i,".py")];null===l||void 0===l||null===(t=l.current)||void 0===t||t.scrollIntoView()}}),[e,rn]),Ro=(0,f.useCallback)((function(n){po([]),tn((function(o){var e=o.upstreamBlocks.values||[],i=e.findIndex((function(o){var e=o.uuid;return n.uuid===e}));return Bn(Bn({},o),{},{upstreamBlocks:Bn(Bn({},o.upstreamBlocks),{},{values:i>=0?(0,I.oM)(e,i):e.concat(n)})})}))}),[tn]),No=(0,f.useMemo)((function(){var n={};return Co.forEach((function(o){o.upstream_blocks.forEach((function(e){n[e]||(n[e]=[]),n[e].push(o)}))})),n}),[Co]),Lo=(0,f.useMemo)((function(){return W({activeNodes:Gn,blockStatus:r,blockUUIDMapping:Oo,blocks:Co,callbackBlocksByBlockUUID:So,conditionalBlocksByBlockUUID:jo,downstreamBlocksMapping:No,enablePorts:w,extensionBlocksByBlockUUID:Bo,nodeHovering:io,pipeline:G,selectedBlock:ao})}),[Gn,r,Oo,Co,So,jo,No,w,Bo,io,G,ao]),Mo=Lo.edges,Ho=Lo.nodes,Uo=(Lo.ports,Lo.blocksWithDownstreamBlockSet),Go=(0,f.useMemo)((function(){var n=0;return T&&(n+=T),Z&&(n-=Z),Math.max(0,n)}),[T,Z]),Wo=(0,f.useCallback)((function(n,o){(0,On.j)(n);var e,i,t,l,r,u=o.data,d=u.block,c=u.blocks,a=d;if((null===c||void 0===c?void 0:c.length)>=2&&q){var s=null===c||void 0===c?void 0:c.findIndex((function(n){var o=n.uuid;return(null===q||void 0===q?void 0:q.uuid)===o}));a=s<(null===c||void 0===c?void 0:c.length)-1?null===c||void 0===c?void 0:c[s+1]:null===c||void 0===c?void 0:c[0]}if(!((null===ko||void 0===ko?void 0:ko.uuid)===a.uuid))if(ko)Ro(a);else if(null===N||void 0===N||N({block:a}),q&&(null===q||void 0===q?void 0:q.uuid)===(null===(e=a)||void 0===e?void 0:e.uuid)&&(((null===(i=a)||void 0===i||null===(t=i.downstream_blocks)||void 0===t?void 0:t.length)||0)<=1&&(null===(l=a)||void 0===l||null===(r=l.upstream_blocks)||void 0===r||!r.length)||ao&&(null===ao||void 0===ao?void 0:ao.uuid)===(null===q||void 0===q?void 0:q.uuid)))null===rn||void 0===rn||rn(null),so(null);else{var v;if(q)(null===q||void 0===q?void 0:q.uuid)===(null===(v=a)||void 0===v?void 0:v.uuid)?so(a):so(null);setTimeout((function(){Ao(a)}),1)}}),[ko,Ao,N,Ro,q,ao,so]),Fo=(0,f.useCallback)((function(n){var o,e=null===n||void 0===n?void 0:n.id;e in jn.current&&clearTimeout(null===jn||void 0===jn||null===(o=jn.current)||void 0===o?void 0:o[e])}),[Gn]),Vo=(0,f.useCallback)((function(n){var o=null===n||void 0===n?void 0:n.id;jn.current[o]=setTimeout((function(){Wn((function(n){var e=Bn({},n);return null===e||void 0===e||delete e[o],e}))}),1e3)}),[Wn]),Yo=(0,f.useCallback)((function(n,o,e){var i;if((0,On.j)(n),!Qn&&no){var t,r,u,d,c,a,s,v,f,p=null===o||void 0===o||null===(t=o.data)||void 0===t?void 0:t.block,h=null===no||void 0===no||null===(r=no.node)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.block;if(!((null===G||void 0===G?void 0:G.type)===en.qL.INTEGRATION&&((null===p||void 0===p?void 0:p.type)===b.tf.DATA_EXPORTER||(null===p||void 0===p?void 0:p.type)===b.tf.DATA_LOADER&&(null===h||void 0===h?void 0:h.type)===b.tf.DATA_EXPORTER))&&(null===p||void 0===p||null===(d=p.upstream_blocks)||void 0===d||!d.includes(null===h||void 0===h?void 0:h.uuid))&&(null===p||void 0===p?void 0:p.uuid)!==(null===h||void 0===h?void 0:h.uuid))if((null===o||void 0===o||null===(c=o.data)||void 0===c||null===(a=c.children)||void 0===a?void 0:a.length)>=1){var k,m=null===p||void 0===p||null===(k=p.downstream_blocks)||void 0===k?void 0:k.filter((function(n){var o;return!(null!==h&&void 0!==h&&null!==(o=h.upstream_blocks)&&void 0!==o&&o.includes(n))}));Po({block:h,upstreamBlocks:m})}else if((null===no||void 0===no||null===(s=no.node)||void 0===s||null===(v=s.data)||void 0===v||null===(f=v.children)||void 0===f?void 0:f.length)>=1){var x,y=null===h||void 0===h||null===(x=h.downstream_blocks)||void 0===x?void 0:x.filter((function(n){var o;return!(null!==p&&void 0!==p&&null!==(o=p.downstream_blocks)&&void 0!==o&&o.includes(n))}));Po({block:p,downstreamBlocks:y})}else Po({block:h,upstreamBlocks:((null===h||void 0===h?void 0:h.upstream_blocks)||[]).concat(null===p||void 0===p?void 0:p.uuid)})}if(null===g||void 0===g||!g.upstreamBlocks){Fo(o),to(o);var C=null===o||void 0===o?void 0:o.id;null===(i=Object.keys(Vn||{}))||void 0===i||!i.length||C in Vn?Wn((function(n){return Object.values(n||{}).forEach((function(n){Vo(n)})),Bn(Bn({},n),{},(0,l.Z)({},C,o))})):uo(o)}}),[Vn,Fo,g,Qn,no,G,Wn,to,uo,Vo]),Xo=(0,f.useCallback)((function(n,o,e){(0,On.j)(n),to(null),Vo(o)}),[to,Vo]),qo=(0,f.useCallback)((function(n,o,e){if((0,On.j)(n),!qn){var i=null===o||void 0===o?void 0:o.id;Zn.current[i]=setTimeout((function(){qn||(Hn(null),Wn({}),Jn(!0),oo({data:e,event:n,node:o}))}),500)}}),[qn,Wn,Hn,Jn,oo]),Ko=(0,f.useCallback)((function(n,o,e){(0,On.j)(n);var i,t=null===o||void 0===o?void 0:o.id;t in Zn.current&&clearTimeout(null===Zn||void 0===Zn||null===(i=Zn.current)||void 0===i?void 0:i[t])}),[]),zo=(0,f.useCallback)((function(n,o,e){var i;(0,On.j)(n);var t=null===o||void 0===o?void 0:o.id;clearTimeout(null===(i=Zn.current)||void 0===i?void 0:i[t]),Kn({data:e,event:n,node:o}),Hn(null)}),[Hn,Kn]),Qo=(0,f.useCallback)((function(n){var o=n.event,e=n.node;n.port;(0,On.j)(o),Fo(e),to(e)}),[Fo,to]),Jo=(0,f.useCallback)((function(n){var o=n.event,e=n.node;n.port;(0,On.j)(o),to(null),Vo(e)}),[to,Vo]),$o=(0,f.useCallback)((function(n){var o=n.event,e=n.node,i=n.port;Yn((function(n){return Bn(Bn({},n),{},(0,l.Z)({},null===e||void 0===e?void 0:e.id,{event:o,node:e,port:i}))}))}),[Yn]),ne=(0,f.useCallback)((function(n){n.event;var o=n.node,e=n.port,i=null===o||void 0===o?void 0:o.id;null===e||void 0===e||e.side;if(ro){var t,l,r,u,d=null===o||void 0===o||null===(t=o.properties)||void 0===t||null===(l=t.data)||void 0===l?void 0:l.block,c=null===ro||void 0===ro||null===(r=ro.data)||void 0===r?void 0:r.block;if(!((null===G||void 0===G?void 0:G.type)===en.qL.INTEGRATION&&((null===d||void 0===d?void 0:d.type)===b.tf.DATA_EXPORTER||(null===d||void 0===d?void 0:d.type)===b.tf.DATA_LOADER&&(null===c||void 0===c?void 0:c.type)===b.tf.DATA_EXPORTER))&&(null===d||void 0===d||null===(u=d.upstream_blocks)||void 0===u||!u.includes(c.uuid))&&(null===o||void 0===o?void 0:o.id)!==(null===ro||void 0===ro?void 0:ro.id)){var a={};j.rl.SOUTH===(null===e||void 0===e?void 0:e.side)?a.upstreamBlocks=((null===c||void 0===c?void 0:c.upstream_blocks)||[]).concat(null===d||void 0===d?void 0:d.uuid):a.downstreamBlocks=((null===c||void 0===c?void 0:c.downstream_blocks)||[]).concat(null===d||void 0===d?void 0:d.uuid),Po(Bn({block:c},a))}}Yn((function(n){var o=Bn({},n);return null===o||void 0===o||delete o[i],o})),Vo(o)}),[G,Yn,Vo,ro]),oe=(0,f.useCallback)((function(n,o,e){var i,t;if(no)return{anotherBlockSelected:!0,selected:!1};var l=(null===(i=Object.values(Vn||{}))||void 0===i?void 0:i.length)>=1,r=null===Vn||void 0===Vn?void 0:Vn[null===n||void 0===n?void 0:n.id],u=!1;if(ko)u=!!(0,I.sE)(mo,(function(n){return n.uuid===(null===o||void 0===o?void 0:o.uuid)}));else if(l)u=!!r;else if((null===e||void 0===e||null===(t=e.blocksWithSameDownstreamBlocks)||void 0===t?void 0:t.length)>=2){var d,c;u=null===e||void 0===e||null===(d=e.blocksWithSameDownstreamBlocks)||void 0===d||null===(c=d.map((function(n){return n.uuid})))||void 0===c?void 0:c.includes(null===q||void 0===q?void 0:q.uuid)}else u=(null===q||void 0===q?void 0:q.uuid)===(null===o||void 0===o?void 0:o.uuid);return{anotherBlockSelected:l?!r:!!q,selected:u}}),[Vn,ko,no,q,mo]),ee=(0,f.useCallback)((function(n,o,e){var i,t=e.isDragging,l=e.nodeHeight,u=e.nodeWidth,d=e.opacity,c=n.data,a=c.blocks,s=c.children;if((null===s||void 0===s?void 0:s.length)>=1){var v=[];null===s||void 0===s||s.forEach((function(o){var e=oe(n,o),i=e.anotherBlockSelected,l=e.selected,u=F({block:o,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}),c=u.hasFailed,a=u.isInProgress,s=u.isQueued,f=u.isSuccessful,p=null===So||void 0===So?void 0:So[null===o||void 0===o?void 0:o.uuid],b=null===jo||void 0===jo?void 0:jo[null===o||void 0===o?void 0:o.uuid],k=null===Bo||void 0===Bo?void 0:Bo[null===o||void 0===o?void 0:o.uuid];v.push((0,Y.jsx)(z,{anotherBlockSelected:i,block:o,callbackBlocks:null===So||void 0===So?void 0:So[null===o||void 0===o?void 0:o.uuid],conditionalBlocks:null===jo||void 0===jo?void 0:jo[null===o||void 0===o?void 0:o.uuid],disabled:(null===ko||void 0===ko?void 0:ko.uuid)===(null===o||void 0===o?void 0:o.uuid),extensionBlocks:null===Bo||void 0===Bo?void 0:Bo[null===o||void 0===o?void 0:o.uuid],hasFailed:c,height:(0,O.p1)(o,G,{blockStatus:r,callbackBlocks:p,conditionalBlocks:b,extensionBlocks:k}),hideNoStatus:!0,hideStatus:h||P,isDragging:t,isInProgress:a,isQueued:s,isSuccessful:f,opacity:d,pipeline:G,selected:l},null===o||void 0===o?void 0:o.uuid))})),i=(0,Y.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",style:{height:l,width:u},children:[(0,Y.jsx)(x.Z,{pr:E.cd}),v,(0,Y.jsx)(x.Z,{pr:E.cd})]})}var f,p=oe(n,o,{blocksWithSameDownstreamBlocks:a}),b=p.anotherBlockSelected,k=p.selected,g=F({block:o,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}),y=g.hasFailed,C=g.isInProgress,w=g.isQueued,S=g.isSuccessful;return f=(null===s||void 0===s?void 0:s.length)>=1?null===s||void 0===s?void 0:s.some((function(n){var e;return n&&(null===(e=F({block:o,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}))||void 0===e?void 0:e.isInProgress)})):C,(0,Y.jsx)(z,{anotherBlockSelected:b,block:o,blocksWithSameDownstreamBlocks:a,callbackBlocks:null===So||void 0===So?void 0:So[null===o||void 0===o?void 0:o.uuid],conditionalBlocks:null===jo||void 0===jo?void 0:jo[null===o||void 0===o?void 0:o.uuid],disabled:(null===ko||void 0===ko?void 0:ko.uuid)===(null===o||void 0===o?void 0:o.uuid),downstreamBlocks:s,extensionBlocks:null===Bo||void 0===Bo?void 0:Bo[null===o||void 0===o?void 0:o.uuid],hasFailed:y,height:l,hideNoStatus:!0,hideStatus:h||P,isDragging:t,isInProgress:f,isQueued:w,isSuccessful:S,opacity:d,pipeline:G,selected:k,children:i},null===o||void 0===o?void 0:o.uuid)}),[ko,r,So,jo,h,Bo,D,P,G,X,Eo]),ie=(0,f.useMemo)((function(){var n,o;if(Qn&&no){var e=no.event,i=no.node,t=no.data,l=e.clientX,u=e.clientY,d=(null===Sn||void 0===Sn||null===(n=Sn.current)||void 0===n?void 0:n.getBoundingClientRect())||{},c=d.x,a=d.y,s=null===i||void 0===i||null===(o=i.data)||void 0===o?void 0:o.block;if(s){var v=F({block:s,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}),f=(v.hasFailed,v.isInProgress,v.isQueued,v.isSuccessful,null===So||void 0===So?void 0:So[null===s||void 0===s?void 0:s.uuid]),p=null===jo||void 0===jo?void 0:jo[null===s||void 0===s?void 0:s.uuid],h=null===Bo||void 0===Bo?void 0:Bo[null===s||void 0===s?void 0:s.uuid],b={blockStatus:r,callbackBlocks:f,conditionalBlocks:p,extensionBlocks:h},k=(0,O.p1)(s,G,b),g=(0,O.HI)(s,G,b),m=ee(i,s,{isDragging:!0,nodeHeight:null===t||void 0===t?void 0:t.nodeHeight,nodeWidth:null===t||void 0===t?void 0:t.nodeWidth,opacity:.5});return(0,Y.jsx)("div",{style:{left:l-c-g/2,position:"absolute",top:u-a-k/2},children:m})}}}),[r,ee,So,jo,Bo,Qn,D,P,no,G,X,Eo]),te=(0,f.useMemo)((function(){var n,e,i,t;if(Mn){var l,r=Mn.edge,u=Oo[null===r||void 0===r?void 0:r.from],d=Oo[null===r||void 0===r?void 0:r.to],c=null===(n=event)||void 0===n?void 0:n.clientX,a=null===(e=event)||void 0===e?void 0:e.clientY,s=(null===Sn||void 0===Sn||null===(i=Sn.current)||void 0===i?void 0:i.getBoundingClientRect())||{},v=s.x,f=s.y;u&&!d?l=null===Uo||void 0===Uo?void 0:Uo[null===u||void 0===u?void 0:u.uuid]:!u&&d&&(l=null===Uo||void 0===Uo?void 0:Uo[null===d||void 0===d?void 0:d.uuid]);var p,h=function(){Po({block:d,upstreamBlocks:((null===d||void 0===d?void 0:d.upstream_blocks)||[]).filter((function(n){return n!==(null===u||void 0===u?void 0:u.uuid)}))})};if((null===(t=l)||void 0===t?void 0:t.length)>=1)null===(p=l)||void 0===p||p.forEach((function(n){var o=n.downstreamBlocks,e=n.upstreamBlocks,i=R(null===e||void 0===e?void 0:e.map((function(n){return n.uuid})));if(u&&!d&&(null===r||void 0===r?void 0:r.to)===i){var t=(0,I.HK)(o||[],(function(n){return n.uuid}));h=function(){Po({block:u,downstreamBlocks:((null===u||void 0===u?void 0:u.downstream_blocks)||[]).filter((function(n){return!(n in t)}))})}}else if(!u&&d&&(null===r||void 0===r?void 0:r.from)===i){var l=(0,I.HK)(e||[],(function(n){return n.uuid}));h=function(){Po({block:d,upstreamBlocks:((null===d||void 0===d?void 0:d.upstream_blocks)||[]).filter((function(n){return!(n in l)}))})}}}));else if(!u&&!d){var k,g,m=[];null===r||void 0===r||null===(k=r.to)||void 0===k||null===(g=k.split(":"))||void 0===g||g.forEach((function(n){if((null===n||void 0===n?void 0:n.length)>=1&&"parent"!==n){var o=null===Oo||void 0===Oo?void 0:Oo[n];o&&m.push(o)}})),h=function(){null===m||void 0===m||m.forEach((function(n){return Po({block:n,downstreamBlocks:[]})}))}}return(0,Y.jsx)("div",{style:{left:c-v,position:"absolute",top:a-f},children:(0,Y.jsx)(Q.Z,{disableEscape:!0,onClickOutside:function(){return Hn(null)},open:!0,children:(0,Y.jsxs)(on.Z,{noPadding:!0,children:[(0,Y.jsx)(x.Z,{px:E.cd,py:1,children:(0,Y.jsx)(nn.Z,{block:!0,onClick:function(){var n=null===Co||void 0===Co?void 0:Co.findIndex((function(n){return n.uuid===(null===d||void 0===d?void 0:d.uuid)}));null===o||void 0===o||o({downstream_blocks:d?[null===d||void 0===d?void 0:d.uuid]:null,language:null===d||void 0===d?void 0:d.language,type:b.tf.CUSTOM,upstream_blocks:u?[null===u||void 0===u?void 0:u.uuid]:null},n,(function(){Hn(null)}))},preventDefault:!0,sameColorAsText:!0,children:"Add new block between"})}),(0,Y.jsx)(J.Z,{light:!0}),(0,Y.jsx)(x.Z,{px:E.cd,py:1,children:(0,Y.jsx)(nn.Z,{block:!0,onClick:function(){var n;null===(n=h)||void 0===n||n(),Hn(null)},preventDefault:!0,sameColorAsText:!0,children:"Remove connection"})})]})})})}}),[Mn,Co,Hn,Po]),le=(0,f.useMemo)((function(){return null===hn||void 0===hn?void 0:hn(bn.INTERACTIONS)}),[hn,bn]),re=(0,f.useMemo)((function(){var n;if(qn){var e,i,t,l,r=qn.event,u=qn.node,d=(qn.data,u.data),a=d.block,v=d.blocks,f=(d.children,r.clientX),p=r.clientY,h=(null===Sn||void 0===Sn||null===(n=Sn.current)||void 0===n?void 0:n.getBoundingClientRect())||{},k=h.x,g=h.y,m=q&&(null===q||void 0===q?void 0:q.uuid)===(null===a||void 0===a?void 0:a.uuid)&&ao&&(null===ao||void 0===ao?void 0:ao.uuid)===(null===a||void 0===a?void 0:a.uuid),y=null===v||void 0===v?void 0:v.findIndex((function(n){return n.uuid===(null===a||void 0===a?void 0:a.uuid)})),C=en.qL.INTEGRATION===(null===G||void 0===G?void 0:G.type),w=[];if(C||w.push({onClick:function(){var n,o;null===L||void 0===L||L({block:a,code:null===c||void 0===c||null===(n=c.current)||void 0===n||null===(o=n[null===a||void 0===a?void 0:a.type])||void 0===o?void 0:o[null===a||void 0===a?void 0:a.uuid]})},uuid:"Run block"}),w.push.apply(w,[{onClick:function(){an(a,null===a||void 0===a?void 0:a.name)},uuid:"Rename block"}]),!C)w.push.apply(w,[{disabled:((null===a||void 0===a||null===(e=a.downstream_blocks)||void 0===e?void 0:e.length)||0)<=1&&!(null!==a&&void 0!==a&&null!==(i=a.upstream_blocks)&&void 0!==i&&i.length),onClick:function(){null===rn||void 0===rn||rn(m?null:a),so(m?null:a)},uuid:m?"Hide all dependencies":"Show all dependencies"},{onClick:function(){null===o||void 0===o||o({downstream_blocks:a?[null===a||void 0===a?void 0:a.uuid]:null,language:b.t6.YAML===(null===a||void 0===a?void 0:a.language)?b.t6.PYTHON:null===a||void 0===a?void 0:a.language,type:b.tf.CUSTOM},Math.max(0,y-1))},uuid:"Add upstream block"},{onClick:function(){null===o||void 0===o||o({language:b.t6.YAML===(null===a||void 0===a?void 0:a.language)?b.t6.PYTHON:null===a||void 0===a?void 0:a.language,type:b.tf.CUSTOM,upstream_blocks:a?[null===a||void 0===a?void 0:a.uuid]:null},y+1)},uuid:"Add downstream block"},{disabled:!(null!==a&&void 0!==a&&null!==(t=a.upstream_blocks)&&void 0!==t&&t.length),onClick:function(){Po({block:a,upstreamBlocks:[]})},uuid:"Remove upstream dependencies"},{disabled:!(null!==a&&void 0!==a&&null!==(l=a.downstream_blocks)&&void 0!==l&&l.length),onClick:function(){Po({block:a,downstreamBlocks:[]})},uuid:"Remove downstream dependencies"}]);return le&&w.push({onClick:function(){null===Ao||void 0===Ao||Ao(a),null===K||void 0===K||K(Cn.cH.INTERACTIONS)},uuid:"Add / Edit interactions"}),w.push.apply(w,[{onClick:function(){null===s||void 0===s||s(a)},uuid:"Delete block"},{onClick:function(){null===s||void 0===s||s(Bn(Bn({},a),{},{force:!0}))},uuid:"Delete block (ignore dependencies)"},{onClick:function(){null===Ao||void 0===Ao||Ao(a),null===K||void 0===K||K(Cn.cH.FILE_VERSIONS)},uuid:"View file versions"}]),(0,Y.jsx)("div",{style:{left:f-k,position:"absolute",top:p-g},children:(0,Y.jsx)(Q.Z,{disableEscape:!0,onClickOutside:function(){return Kn(null)},open:!0,children:(0,Y.jsx)(on.Z,{noPadding:!0,children:w.map((function(n){var o=n.disabled,e=n.onClick,i=n.uuid;return(0,Y.jsx)(x.Z,{px:E.cd,py:1,children:(0,Y.jsx)(nn.Z,{block:!0,disabled:o,onClick:function(){e(),Kn(null)},preventDefault:!0,sameColorAsText:!0,children:i})},i)}))})})})}}),[o,Co,c,qn,s,le,Ao,G,L,K,Kn,rn,so]);return(0,Y.jsxs)("div",{ref:Sn,style:{position:"relative"},children:[ko&&(0,Y.jsxs)(x.Z,{my:3,px:E.cd,children:[(0,Y.jsxs)(x.Z,{mb:E.cd,children:[(0,Y.jsxs)(y.ZP,{children:["Select parent block(s) for ",(0,Y.jsx)(y.ZP,{color:(0,S.qn)(ko.type,{blockColor:ko.color,theme:kn}).accent,inline:!0,monospace:!0,children:ko.uuid}),":"]}),(0,Y.jsx)(x.Z,{mt:1,children:mo.map((function(n,o){var e,i,t=n.uuid;return(0,Y.jsxs)(y.ZP,{color:(0,S.qn)(null===(e=Oo[t])||void 0===e?void 0:e.type,{blockColor:null===(i=Oo[t])||void 0===i?void 0:i.type,theme:kn}).accent,inline:!0,monospace:!0,children:[t,xo>=2&&o<=xo-2?(0,Y.jsx)(y.ZP,{inline:!0,children:",\xa0"}):null]},t)}))})]}),(0,Y.jsxs)(m.ZP,{alignItems:"center",children:[(0,Y.jsx)($.ZP,{compact:!0,inline:!0,loading:Zo,onClick:function(){return _o({block:Bn(Bn({},ko),{},{upstream_blocks:mo.map((function(n){return n.uuid}))})})},uuid:"DependencyGraph/save_parents",children:"Save dependencies"}),(0,Y.jsx)(x.Z,{ml:1}),(0,Y.jsx)($.ZP,{compact:!0,inline:!0,noBackground:!0,onClick:function(){po([]),tn({upstreamBlocks:null})},uuid:"DependencyGraph/cancel_save_parents",children:"Cancel"})]})]}),(0,Y.jsxs)(yn.$4,{height:Go,onDoubleClick:function(){var n,o;return null===Pn||void 0===Pn||null===(n=Pn.current)||void 0===n||null===(o=n.fitCanvas)||void 0===o?void 0:o.call(n)},children:[(0,Y.jsx)(gn,{canvasRef:Pn,containerRef:Sn,zoomLevel:Rn}),(0,Y.jsx)(En,{arrow:null,disabled:h,edge:function(n){var o,e,i,l,u,d,c,s=Oo[null===n||void 0===n?void 0:n.source],v=[];s||(null===n||void 0===n||null===(u=n.id)||void 0===u||null===(d=u.replace(null===n||void 0===n?void 0:n.source,""))||void 0===d||null===(c=d.split(":"))||void 0===c||c.forEach((function(n){if((null===n||void 0===n?void 0:n.length)>=1&&"parent"!==n){var o=null===Oo||void 0===Oo?void 0:Oo[n];o&&v.push(o)}})),null!==v&&void 0!==v&&v.length&&(s=v[0]));var f,p,h,b=null===(o=s)||void 0===o?void 0:o.uuid,k=[];if(b in(Uo||{})){var g=null===Uo||void 0===Uo?void 0:Uo[b];null===g||void 0===g||g.map((function(o){var e=o.downstreamBlocks,i=o.upstreamBlocks;R((0,I.YC)((null===i||void 0===i?void 0:i.map((function(n){return n.uuid})))||[],(function(n){return n})))===(null===n||void 0===n?void 0:n.target)&&(k.push.apply(k,(0,t.Z)(e)),f=i)}))}if(null===k||void 0===k||!k.length)if(A(b)===(null===n||void 0===n?void 0:n.target)){var m,x;k.push.apply(k,(0,t.Z)(null===(m=s)||void 0===m||null===(x=m.downstream_blocks)||void 0===x?void 0:x.map((function(n){return null===Oo||void 0===Oo?void 0:Oo[n]}))))}else{var y,C,w=null===(y=s)||void 0===y||null===(C=y.downstream_blocks)||void 0===C?void 0:C.find((function(o){return M(b,o)===(null===n||void 0===n?void 0:n.sourcePort)||A(b)===n.target})),O=null===Oo||void 0===Oo?void 0:Oo[w];k.push(O)}null===k||void 0===k||k.forEach((function(n){if(!p&&!h&&n){var o=F({block:n,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo});null!==o&&void 0!==o&&o.isInProgress&&(p=null===o||void 0===o?void 0:o.isInProgress),null!==o&&void 0!==o&&o.isQueued&&(h=null===o||void 0===o?void 0:o.isQueued)}}));var j,B=oe({id:b},s,{blocksWithSameDownstreamBlocks:f}),E=B.anotherBlockSelected,T=B.selected,_=(0,S.qn)(null===(e=s)||void 0===e?void 0:e.type,{blockColor:null===(i=s)||void 0===i?void 0:i.color,theme:kn}),Z=["edge",p?h?"activeSlow":"active":"inactive"],N=v.map((function(n){return n.uuid}));ao&&(((null===ao||void 0===ao?void 0:ao.uuid)===b||null!==N&&void 0!==N&&N.includes(null===ao||void 0===ao?void 0:ao.uuid)||null!==k&&void 0!==k&&null!==(j=k.map((function(n){return null===n||void 0===n?void 0:n.uuid})))&&void 0!==j&&j.includes(null===ao||void 0===ao?void 0:ao.uuid))&&Z.push("selected-twice"));return null!==n&&void 0!==n&&null!==(l=n.target)&&void 0!==l&&l.startsWith("parent")&&Z.push("group"),(0,Y.jsx)(Tn,Bn(Bn({},n),{},{className:Z.join(" "),onClick:a?function(n,o){Hn((function(e){var i;return(null===e||void 0===e||null===(i=e.edge)||void 0===i?void 0:i.id)===(null===o||void 0===o?void 0:o.id)?null:{block:s,edge:o,event:n}})),Kn(null)}:null,style:{stroke:E&&!T?null===_||void 0===_?void 0:_.accentLight:null===_||void 0===_?void 0:_.accent,strokeWidth:yn.dg}}))},edges:Mo,fit:!0,forwardedRef:Pn,layoutOptions:{"elk.hierarchyHandling":"INCLUDE_CHILDREN"},maxHeight:j.Jo,maxWidth:j.Jo,maxZoom:1,minZoom:-.7,node:function(n){null===n||void 0===n||n.id;var o,e=(null===n||void 0===n||null===(o=n.properties)||void 0===o?void 0:o.data)||{},i=e.block,t=e.blocks,l=null===i||void 0===i?void 0:i.uuid,u=(0,S.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:kn}),d=(null===io||void 0===io?void 0:io.id)===(null===n||void 0===n?void 0:n.id)||!(null===Gn||void 0===Gn||!Gn[l]),c=oe(n,i,{blocksWithSameDownstreamBlocks:t}),s=c.anotherBlockSelected,v=c.selected;return(0,Y.jsx)(In,Bn(Bn({},n),{},{dragType:"port",linkable:!0,port:(0,Y.jsx)(_n,{onDrag:function(){Hn(null),Fo(n)},onDragEnd:function(o,e,i){ne({event:o,node:n,port:i})},onDragStart:function(o,e,i){$o({event:o,node:n,port:i})},onEnter:function(o,e){Qo({event:o,node:n,port:e})},onLeave:function(o,e){Jo({event:o,node:n,port:e})},rx:d?10:0,ry:d?10:0,style:{fill:null===u||void 0===u?void 0:u.accentLight,stroke:s&&!v?null===u||void 0===u?void 0:u.accentLight:null===u||void 0===u?void 0:u.accent,strokeWidth:1}}),style:{fill:"transparent",stroke:"transparent",strokeWidth:0},children:function(n){var o,e=n.height,i=n.node,t=n.width,l=i.data,u=l.block,d=l.blocks,c=l.children,s=oe(i,u,{blocksWithSameDownstreamBlocks:d}),v=s.anotherBlockSelected,f=s.selected,p=F({block:u,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}),b=p.hasFailed,g=p.isInProgress,m=p.isQueued,x=p.isSuccessful;return o=(null===c||void 0===c?void 0:c.length)>=1?null===c||void 0===c?void 0:c.some((function(n){var o;return n&&(null===(o=F({block:n,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}))||void 0===o?void 0:o.isInProgress)})):g,(0,Y.jsx)("foreignObject",{height:e,onClick:function(n){return null===Wo||void 0===Wo?void 0:Wo(n,i)},onContextMenu:a?function(n){return zo(n,i,{nodeHeight:e,nodeWidth:t})}:null,onMouseDown:k?function(n){return qo(n,i,{nodeHeight:e,nodeWidth:t})}:null,onMouseEnter:function(n){return Yo(n,i,{nodeHeight:e,nodeWidth:t})},onMouseLeave:function(n){return Xo(n,i,{nodeHeight:e,nodeWidth:t})},onMouseUp:k?function(n){return Ko(n,i,{nodeHeight:e,nodeWidth:t})}:null,style:{},width:n.width,x:0,y:0,children:(0,Y.jsx)(z,{anotherBlockSelected:v,block:u,blocksWithSameDownstreamBlocks:d,callbackBlocks:null===So||void 0===So?void 0:So[null===u||void 0===u?void 0:u.uuid],conditionalBlocks:null===jo||void 0===jo?void 0:jo[null===u||void 0===u?void 0:u.uuid],disabled:(null===ko||void 0===ko?void 0:ko.uuid)===u.uuid,downstreamBlocks:c,extensionBlocks:null===Bo||void 0===Bo?void 0:Bo[null===u||void 0===u?void 0:u.uuid],hasFailed:b,height:e,hideNoStatus:!0,hideStatus:h||P,isInProgress:o,isQueued:m,isSuccessful:x,pipeline:G,selected:f,selectedBlock:q},u.uuid)})}}))},nodes:Ho,onNodeLinkCheck:function(n,o,e){return!Mo.some((function(n){return n.from===o.id&&n.to===e.id}))},onZoomChange:function(n){null===un||void 0===un||un(n),Nn(n)},pannable:U,selections:fo,zoomable:fn})]}),te,re,ie]})}},85385:function(n,o,e){e.d(o,{Qq:function(){return p},Z7:function(){return h},cH:function(){return t},du:function(){return v},fp:function(){return s},j5:function(){return f},uM:function(){return a}});var i,t,l=e(82394),r=e(57653),u=e(82359),d=e(72473),c=e(86735),a="sideview",s=90;!function(n){n.ADDON_BLOCKS="addon_blocks",n.BLOCK_SETTINGS="block_settings",n.CALLBACKS="callbacks",n.CHARTS="charts",n.DATA="data",n.EXTENSIONS="power_ups",n.FILE_VERSIONS="file_versions",n.GRAPHS="graphs",n.INTERACTIONS="interactions",n.REPORTS="reports",n.SECRETS="secrets",n.SETTINGS="settings",n.TERMINAL="terminal",n.TREE="tree",n.VARIABLES="variables"}(t||(t={}));t.BLOCK_SETTINGS,t.CALLBACKS,t.CHARTS,t.DATA,t.EXTENSIONS,t.TREE;var v=[t.DATA];function f(n){var o,e,i,l=[{key:t.TREE,label:"Tree"},{buildLabel:function(n){var o=(n.pipeline||{}).widgets,e=void 0===o?[]:o;return(null===e||void 0===e?void 0:e.length)>=1?"Charts (".concat(e.length,")"):"Charts"},key:t.CHARTS},{buildLabel:function(n){var o=n.variables;return(null===o||void 0===o?void 0:o.length)>=1?"Variables (".concat(o.length,")"):"Variables"},key:t.VARIABLES},{buildLabel:function(n){var o=n.secrets;return(null===o||void 0===o?void 0:o.length)>=1?"Secrets (".concat(o.length,")"):"Secrets"},key:t.SECRETS}];return r.qL.PYSPARK!==(null===n||void 0===n||null===(o=n.pipeline)||void 0===o?void 0:o.type)&&l.push.apply(l,[{buildLabel:function(n){n.pipeline;return"Add-on blocks"},key:t.ADDON_BLOCKS},{buildLabel:function(n){var o=(n.pipeline||{}).extensions,e=void 0===o?{}:o,i=0;return Object.values(e).forEach((function(n){var o=n.blocks;i+=(null===o||void 0===o?void 0:o.length)||0})),i>=1?"Power ups (".concat(i,")"):"Power ups"},key:t.EXTENSIONS}]),l.push.apply(l,[{key:t.DATA,label:"Data"},{key:t.TERMINAL,label:"Terminal"},{key:t.BLOCK_SETTINGS,label:"Block settings"}]),null!==n&&void 0!==n&&null!==(e=n.project)&&void 0!==e&&null!==(i=e.features)&&void 0!==i&&i[u.d.INTERACTIONS]&&l.push({key:t.INTERACTIONS,label:"Interactions"}),l}function p(n){return(0,c.HK)(f(n),(function(n){return n.key}))}var h=(i={},(0,l.Z)(i,t.ADDON_BLOCKS,d.EJ),(0,l.Z)(i,t.BLOCK_SETTINGS,d.JG),(0,l.Z)(i,t.CALLBACKS,d.AQ),(0,l.Z)(i,t.CHARTS,d.GQ),(0,l.Z)(i,t.DATA,d.iA),(0,l.Z)(i,t.EXTENSIONS,d.Bf),(0,l.Z)(i,t.INTERACTIONS,d.yd),(0,l.Z)(i,t.SECRETS,d.Yo),(0,l.Z)(i,t.SETTINGS,d.Zr),(0,l.Z)(i,t.TERMINAL,d.oI),(0,l.Z)(i,t.TREE,d.mp),(0,l.Z)(i,t.VARIABLES,d.LO),i)},79757:function(n,o,e){var i=e(82394),t=e(26304),l=(e(82684),e(38626)),r=e(44897),u=e(42631),d=e(95363),c=e(70515),a=e(61896),s=e(28598),v=["children"];function f(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function p(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?f(Object(e),!0).forEach((function(o){(0,i.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):f(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var h=l.default.p.withConfig({displayName:"Badge__BadgeStyle",componentId:"sc-tfqsp0-0"})(["border-radius:","px;display:inline;font-family:",";margin:0;white-space:nowrap;",";"," "," ",";",";"," "," "," "," "," "," "," ",""],u.BG,d.ry,a.iD,(function(n){return n.small&&"\n ".concat(a.HC,";\n ")}),(function(n){return n.xxsmall&&"\n font-size: ".concat(a.VK,"px;\n line-height: ").concat(a.VK,"px;\n ")}),(function(n){return!n.regular&&"\n padding: 2px 4px;\n "}),(function(n){return n.regular&&"\n padding: ".concat(1*c.iI,"px ").concat(1.25*c.iI,"px;\n ")}),(function(n){return n.noVerticalPadding&&"\n padding-bottom: 0;\n padding-top: 0;\n "}),(function(n){return!n.disabled&&!n.inverted&&"\n background-color: ".concat((n.theme||r.Z).background.row,";\n color: ").concat((n.theme||r.Z).content.default,";\n ")}),(function(n){return!n.disabled&&n.inverted&&"\n background-color: ".concat((n.theme||r.Z).background.dark,";\n color: ").concat((n.theme||r.Z).content.inverted,";\n ")}),(function(n){return n.cyan&&"\n background-color: ".concat((n.theme||r.Z).accent.cyan,";\n color: ").concat((n.theme||r.Z).monotone.black,";\n ")}),(function(n){return n.disabled&&"\n background-color: ".concat((n.theme||r.Z).feature.disabled,";\n color: ").concat((n.theme||r.Z).content.disabled,";\n ")}),(function(n){return n.color&&"\n background-color: ".concat(n.color," !important;\n color: ").concat((n.theme||r.Z).content.active,";\n ")}),(function(n){return n.quantifier&&"\n border-radius: 34px;\n line-height: 10px;\n padding: 4px 6px;\n "}),(function(n){return n.monospace&&"\n font-family: ".concat(d.Vp,";\n word-break: break-all;\n ")}));o.Z=function(n){var o=n.children,e=(0,t.Z)(n,v);return(0,s.jsx)(h,p(p({},e),{},{children:o}))}},65956:function(n,o,e){var i=e(38626),t=e(55485),l=e(38276),r=e(30160),u=e(44897),d=e(42631),c=e(47041),a=e(70515),s=e(28598),v=(0,i.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*a.iI,1.5*a.iI,1.5*a.iI),f=i.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],d.n_,(function(n){return n.fullWidth&&"\n width: 100%;\n "}),(function(n){return!n.borderless&&"\n border: 1px solid ".concat((n.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(n){return n.success&&"\n background-color: ".concat((n.theme.background||u.Z.background).successLight,";\n ")}),(function(n){return n.success&&!n.borderless&&"\n border: 1px solid ".concat((n.theme.background||u.Z.background).success,";\n ")}),(function(n){return!n.dark&&!n.success&&"\n background-color: ".concat((n.theme.background||u.Z.background).panel,";\n ")}),(function(n){return n.dark&&"\n background-color: ".concat((n.theme.background||u.Z.background).content,";\n ")}),(function(n){return!n.fullHeight&&"\n height: fit-content;\n "}),(function(n){return n.maxHeight&&"\n max-height: ".concat(n.maxHeight,";\n ")}),(function(n){return n.maxWidth&&"\n max-width: ".concat(n.maxWidth,"px;\n ")}),(function(n){return n.minWidth&&"\n min-width: ".concat(n.minWidth,"px;\n\n @media (max-width: ").concat(n.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(n){return n.borderless&&"\n border: none;\n "}),(function(n){return n.overflowVisible&&"\n overflow: visible;\n "})),p=i.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],d.n_,d.n_,(function(n){return"\n background-color: ".concat((n.theme.background||u.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((n.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")}),v,(function(n){return n.headerPaddingVertical&&"\n padding-bottom: ".concat(n.headerPaddingVertical,"px;\n padding-top: ").concat(n.headerPaddingVertical,"px;\n ")})),h=i.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*a.iI,c.w5,(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")}),(function(n){return n.maxHeight&&"\n max-height: calc(".concat(n.maxHeight," - ").concat(15*a.iI,"px);\n ")}),(function(n){return n.noPadding&&"\n padding: 0;\n "}),(function(n){return n.overflowVisible&&"\n overflow: visible;\n "})),b=i.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],d.M8,d.YF,1.75*a.iI);o.Z=function(n){var o=n.borderless,e=n.children,i=n.containerRef,u=n.contentContainerRef,d=n.dark,c=n.footer,a=n.fullHeight,v=void 0===a||a,k=n.fullWidth,g=void 0===k||k,m=n.header,x=n.headerHeight,y=n.headerIcon,C=n.headerPaddingVertical,w=n.headerTitle,O=n.maxHeight,S=n.maxWidth,j=n.minWidth,B=n.noPadding,E=n.overflowVisible,I=n.subtitle,T=n.success;return(0,s.jsxs)(f,{borderless:o,dark:d,fullHeight:v,fullWidth:g,maxHeight:O,maxWidth:S,minWidth:j,overflowVisible:E,ref:i,success:T,children:[(m||w)&&(0,s.jsxs)(p,{headerPaddingVertical:C,height:x,children:[m&&m,w&&(0,s.jsx)(t.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,s.jsxs)(t.ZP,{alignItems:"center",children:[y&&y,(0,s.jsx)(l.Z,{ml:y?1:0,children:(0,s.jsx)(r.ZP,{bold:!0,default:!0,children:w})})]})})]}),(0,s.jsxs)(h,{maxHeight:O,noPadding:B,overflowVisible:E,ref:u,children:[I&&"string"===typeof I&&(0,s.jsx)(l.Z,{mb:2,children:(0,s.jsx)(r.ZP,{default:!0,children:I})}),I&&"string"!==typeof I&&I,e]}),c&&(0,s.jsx)(b,{children:c})]})}},44375:function(n,o,e){e.d(o,{$1:function(){return l},Dy:function(){return t},IU:function(){return r}});var i=e(17717),t="--full-refresh";function l(n,o){var e,t=null===o||void 0===o?void 0:o.fullPath,l=null===n||void 0===n||null===(e=n.configuration)||void 0===e?void 0:e.file_path;if(t)return null===n||void 0===n?void 0:n.uuid;if(l){var r=l.split(i.sep),u=r[r.length-1].split(".");return u.pop(),u.join(".")}}function r(n){var o,e=null===n||void 0===n||null===(o=n.configuration)||void 0===o?void 0:o.file_path;if(e){var t=e.split(i.sep),l=t[0],r=t[t.length-1].split(".");return r.pop(),{directory:t.slice(1,t.length-1).join(i.sep),filePath:e,name:r.join("."),project:l}}return{filePath:e}}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1221],{8666:function(e,n,i){"use strict";var t;i.d(n,{b:function(){return t}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(t||(t={}))},30229:function(e,n,i){"use strict";i.d(n,{PN:function(){return l},TR:function(){return v},U5:function(){return d},Wb:function(){return f},Xm:function(){return o},Z4:function(){return s},fq:function(){return c},gm:function(){return a},kJ:function(){return p}});var t,u,o,r=i(82394),l="__bookmark_values__";!function(e){e.API="api",e.EVENT="event",e.TIME="time"}(o||(o={}));var c,d,s=(t={},(0,r.Z)(t,o.API,(function(){return"API"})),(0,r.Z)(t,o.EVENT,(function(){return"event"})),(0,r.Z)(t,o.TIME,(function(){return"schedule"})),t);!function(e){e.ACTIVE="active",e.INACTIVE="inactive"}(c||(c={})),function(e){e.ONCE="@once",e.HOURLY="@hourly",e.DAILY="@daily",e.WEEKLY="@weekly",e.MONTHLY="@monthly",e.ALWAYS_ON="@always_on"}(d||(d={}));var a,p,f=[d.ONCE,d.HOURLY,d.DAILY,d.WEEKLY,d.MONTHLY];!function(e){e.INTERVAL="frequency[]",e.STATUS="status[]",e.TAG="tag[]",e.TYPE="type[]"}(a||(a={})),function(e){e.CREATED_AT="created_at",e.NAME="name",e.PIPELINE="pipeline_uuid",e.STATUS="status",e.TYPE="schedule_type"}(p||(p={}));var v=(u={},(0,r.Z)(u,p.CREATED_AT,"Created at"),(0,r.Z)(u,p.NAME,"Name"),(0,r.Z)(u,p.PIPELINE,"Pipeline"),(0,r.Z)(u,p.STATUS,"Active"),(0,r.Z)(u,p.TYPE,"Type"),u)},31882:function(e,n,i){"use strict";var t=i(38626),u=i(71180),o=i(55485),r=i(30160),l=i(44897),c=i(72473),d=i(70515),s=i(61896),a=i(28598),p=t.default.div.withConfig({displayName:"Chip__ChipStyle",componentId:"sc-1ok73g-0"})(["display:inline-block;"," "," "," "," "," ",""],(function(e){return!e.primary&&"\n background-color: ".concat((e.theme.background||l.Z.background).tag,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.chart||l.Z.chart).primary,";\n ")}),(function(e){return!e.small&&"\n border-radius: ".concat((d.iI+s.Al)/2,"px;\n height: ").concat(1.5*d.iI+s.Al,"px;\n padding: ").concat(d.iI/1.5,"px ").concat(1.25*d.iI,"px;\n ")}),(function(e){return e.small&&"\n border-radius: ".concat((d.iI/2+s.Al)/2,"px;\n height: ").concat(s.Al+d.iI/2+2,"px;\n padding: ").concat(d.iI/4,"px ").concat(d.iI,"px;\n ")}),(function(e){return e.xsmall&&"\n border-radius: ".concat((d.iI/1+s.Al)/1,"px;\n height: ").concat(20,"px;\n padding: 4px 6px;\n ")}),(function(e){return e.border&&"\n border: 1px solid ".concat((e.theme.content||l.Z.content).muted,";\n ")}));n.Z=function(e){var n=e.border,i=e.children,t=e.disabled,l=e.label,s=e.monospace,f=e.onClick,v=e.primary,h=e.small,m=e.xsmall;return(0,a.jsx)(p,{border:n,primary:v,small:h,xsmall:m,children:(0,a.jsx)(u.ZP,{basic:!0,disabled:t,noBackground:!0,noPadding:!0,onClick:f,transparent:!0,children:(0,a.jsxs)(o.ZP,{alignItems:"center",children:[i,l&&(0,a.jsx)(r.ZP,{monospace:s,small:h,xsmall:m,children:l}),!t&&f&&(0,a.jsx)("div",{style:{marginLeft:2}}),!t&&f&&(0,a.jsx)(c.x8,{default:v,muted:!v,size:h?d.iI:1.25*d.iI})]})})})}},55620:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return Oe}});var t=i(77837),u=i(75582),o=i(21831),r=i(82394),l=i(38860),c=i.n(l),d=i(12691),s=i.n(d),a=i(82684),p=i(69864),f=i(34376),v=i(52749),h=i(60523),m=i(71180),g=i(90299),b=i(31882),x=i(94629),Z=i(97618),j=i(55485),C=i(85854),_=i(93369),I=i(65956),w=i(38276),P=i(30160),k=i(35576),y=i(17488),T=i(28598);var E=function(e){var n=e.description,i=e.isLoading,t=e.maxWidth,u=e.minWidth,o=e.noEmptyValue,r=e.onClose,l=e.onSave,c=e.textArea,d=e.title,s=e.value,p=(0,a.useRef)(null),f=(0,a.useState)(s),v=f[0],h=f[1],g=c?k.Z:y.Z;return(0,a.useEffect)((function(){var e;null===p||void 0===p||null===(e=p.current)||void 0===e||e.focus()}),[]),(0,T.jsxs)(I.Z,{maxWidth:t,minWidth:u,children:[(0,T.jsx)(P.ZP,{bold:!0,children:d}),(0,T.jsx)(w.Z,{mt:1,children:(0,T.jsx)(g,{monospace:!0,onChange:function(e){return h(e.target.value)},ref:p,rows:c?7:null,value:v})}),n&&(0,T.jsx)(w.Z,{mt:2,children:(0,T.jsx)(P.ZP,{muted:!0,small:!0,children:n})}),(0,T.jsx)(w.Z,{mt:3,children:(0,T.jsxs)(j.ZP,{children:[(0,T.jsx)(_.ZP,{bold:!0,inline:!0,loading:i,onClick:function(){v===s||o&&!v?r():l(v)},outline:!0,primary:!0,uuid:"Inputs/InputModal/SaveInput",children:"Save"}),(0,T.jsx)(w.Z,{ml:1}),(0,T.jsx)(m.ZP,{onClick:r,children:"Cancel"})]})})]})},A=i(48670),S=i(55072),O=i(57653),M=i(55729),D=i(93808),R=i(82359),N=i(44085),L=i(4190),U=i(75499),G=i(48381),H=i(69650),B=i(85544),Y=i(35686),$=i(44897),V=i(42631),W=i(44425),z=i(72473),F=i(23780),q=i(8666),K=i(46684),Q=i(53808),X="pipeline_list_filters",J="pipeline_list_group_bys",ee="pipeline_list_sort_column_index",ne="pipeline_list_sort_direction",ie="pipeline_list_selected_tab_uuid";function te(e){return(0,Q.t8)(X,e),e}function ue(e){return(0,Q.t8)(J,e),e}var oe=i(11498),re=i(32929),le=i(44898),ce=i(70515),de=i(30229),se=i(81655),ae=i(31608),pe=i(81728),fe=i(3917),ve=i(72619),he=i(69419),me=i(65458),ge=i(15610),be=i(86735),xe=i(42122),Ze=i(3314),je=i(70320),Ce=i(89538),_e=i(44952);function Ie(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function we(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Ie(Object(i),!0).forEach((function(n){(0,r.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ie(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var Pe={Icon:z.Pf,label:function(){return"Recently viewed"},uuid:"recent"},ke={Icon:z.vd,label:function(e){return null!==e&&void 0!==e&&e.count?"All pipelines \u203a ".concat((null===e||void 0===e?void 0:e.count)||0):"All pipelines"},uuid:"all"},ye=[ke,Pe],Te="tab",Ee=[O.$1.SEARCH],Ae={borderRadius:"".concat(V.BG,"px"),iconOnly:!0,noBackground:!0,noBorder:!0,outline:!0,padding:"4px"};function Se(){var e,n,i,t,l=(0,f.useRouter)(),c=(0,a.useRef)(null),d=(0,a.useRef)(null),_=(0,a.useRef)(null),k=(0,a.useRef)(null),y=(0,a.useState)(null),D=y[0],V=y[1],Ie=(0,a.useState)(null),Se=Ie[0],Oe=Ie[1],Me=(0,a.useState)(null),De=Me[0],Re=Me[1],Ne=(0,a.useState)(null),Le=Ne[0],Ue=Ne[1],Ge=(0,a.useState)(null),He=Ge[0],Be=Ge[1],Ye=(0,a.useCallback)((function(e){Be(e),clearTimeout(k.current),k.current=setTimeout((function(){return(0,ge.u7)((0,r.Z)({},O.$1.SEARCH,e))}),500)}),[Be]),$e=(0,a.useState)({}),Ve=$e[0],We=$e[1],ze=(0,a.useState)(null),Fe=ze[0],qe=ze[1],Ke=(0,he.iV)(),Qe=we((0,r.Z)({},oe.$D.LIMIT,S.Q),(0,he.DQ)(Ke,[O.$1.SEARCH,O.$1.STATUS,O.$1.TAG,O.$1.TYPE].concat((0,o.Z)(oe.RG)))),Xe=(0,a.useMemo)((function(){return null===Ke||void 0===Ke?void 0:Ke.tab}),[Ke]);(0,a.useEffect)((function(){var e;V(null===c||void 0===c||null===(e=c.current)||void 0===e?void 0:e.getBoundingClientRect().height)}),[Ke,c]);var Je=Y.ZP.projects.list(),en=Je.data,nn=Je.mutate,tn=(0,a.useMemo)((function(){var e;return null===en||void 0===en||null===(e=en.projects)||void 0===e?void 0:e[0]}),[en]),un=(0,a.useMemo)((function(){var e;return(0,je.hY)(null===tn||void 0===tn||null===(e=tn.features)||void 0===e?void 0:e[R.d.LOCAL_TIMEZONE])}),[null===tn||void 0===tn?void 0:tn.features]),on=(0,a.useMemo)((function(){var e;return null===tn||void 0===tn||null===(e=tn.features)||void 0===e?void 0:e[R.d.OPERATION_HISTORY]}),[tn]),rn=(0,a.useMemo)((function(){return un?se.O$:{}}),[un]),ln=Y.ZP.pipelines.list(we(we({},Qe),{},{include_schedules:1}),{revalidateOnFocus:!1},{pauseFetch:on&&Xe&&Pe.uuid===Xe}),cn=ln.data,dn=ln.mutate,sn=(0,a.useMemo)((function(){return(null===Ke||void 0===Ke?void 0:Ke[O.$1.HISTORY_DAYS])||7}),[Ke]),an=Y.ZP.pipelines.list(we(we({},Qe),{},(e={},(0,r.Z)(e,O.$1.HISTORY_DAYS,(0,pe.HW)(sn)?Number(sn):sn),(0,r.Z)(e,"include_schedules",1),e)),{},{pauseFetch:!on||!Xe||Pe.uuid!==Xe}),pn=an.data,fn=an.mutate,vn=(0,a.useCallback)((function(e){return e}),[He]),hn=(0,a.useMemo)((function(){var e=vn((null===cn||void 0===cn?void 0:cn.pipelines)||[]);if(null!==Ke&&void 0!==Ke&&Ke[O.$1.TAG]){var n=Ke[O.$1.TAG];e=e.filter((function(e){var i=e.tags;return i.some((function(e){return n.includes(e)}))||0===i.length&&n.includes(O.$1.NO_TAGS)}))}return e}),[cn,vn,Ke]),mn=(0,a.useMemo)((function(){return vn((null===pn||void 0===pn?void 0:pn.pipelines)||[])}),[pn,vn]),gn=(0,a.useMemo)((function(){return(0,be.HK)(hn,(function(e){return e.uuid}))}),[hn]),bn=(0,a.useMemo)((function(){return(0,be.HK)(mn,(function(e){return e.uuid}))}),[mn]),xn=(0,a.useCallback)((function(e){var n,i,t,u;return null===e||void 0===e||null===(n=e[2])||void 0===n||null===(i=n.props)||void 0===i||null===(t=i.children)||void 0===t||null===(u=t.props)||void 0===u?void 0:u.children}),[]),Zn=(0,a.useMemo)((function(){return(null===De||void 0===De?void 0:De.length)>0?null===De||void 0===De?void 0:De.map((function(e){var n=xn(e);return null===gn||void 0===gn?void 0:gn[n]})):hn}),[xn,De,hn,gn]),jn=(0,a.useMemo)((function(){return(null===Le||void 0===Le?void 0:Le.length)>0?null===Le||void 0===Le?void 0:Le.map((function(e){var n=xn(e);return null===bn||void 0===bn?void 0:bn[n]})):mn}),[xn,Le,mn,bn]),Cn=(0,a.useMemo)((function(){return[1,2,3,4,5,6,8,9]}),[]),_n=null===Ke||void 0===Ke?void 0:Ke[se.lG.SORT_COL_IDX],In=null===Ke||void 0===Ke?void 0:Ke[se.lG.SORT_DIRECTION],wn=(0,a.useMemo)((function(){return _n?{columnIndex:+_n,sortDirection:In||se.sh.ASC}:void 0}),[_n,In]),Pn=null===Ke||void 0===Ke?void 0:Ke[O.$1.GROUP],kn=(0,p.Db)((function(e){var n=e.pipelineUUID,i=e.filesOnly,t=void 0!==i&&i;return Y.ZP.downloads.pipelines.useCreate(n)({download:{ignore_folder_structure:t}})}),{onSuccess:function(e){return(0,ve.wD)(e,{callback:function(){var n=e.data.download.token;(0,_e.K)(n)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),yn=(0,u.Z)(kn,1)[0];(0,a.useEffect)((function(){var e,n,i,t={};if(_n&&Cn.includes(+_n))(0,Q.t8)(ee,_n),In&&(0,Q.t8)(ne,In);else{var o=(0,Q.U2)(ee,null),l=(0,Q.U2)(ne,se.sh.ASC);null!==o&&(t[se.lG.SORT_COL_IDX]=o,t[se.lG.SORT_DIRECTION]=l)}on&&(Xe?(0,Q.t8)(ie,Xe):t.tab=(0,Q.U2)(ie,null===ye||void 0===ye||null===(n=ye[0])||void 0===n?void 0:n.uuid));if(Pn)ue((0,r.Z)({},Pn,!0));else{var c,d=(0,Q.U2)(J,{});d&&Object.entries(d).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];!c&&t&&(c=i)})),c&&(t[O.$1.GROUP]=c)}if((0,xe.Qr)(Qe)){var s={},a=(0,Q.U2)(X,{});a&&Object.entries(a).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];"undefined"!==typeof t&&null!==t&&(oe.RG.includes(i)||Ee.includes(i)?s[i]=t:(s[i]=[],Object.entries(t).forEach((function(e){var n=(0,u.Z)(e,2),t=n[0];n[1]&&s[i].push(t)}))))})),(0,xe.Qr)(s)||(t={},Object.entries(we(we({},t),s)||{}).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],o=n[1];"undefined"!==typeof o&&null!==o&&(t[i]=o)})))}else{var p={};Object.entries(Qe).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];p[i]={};var o,r=t;"undefined"!==typeof t&&null!==t&&(oe.RG.includes(i)||Ee.includes(i)?p[i]=r:(Array.isArray(r)||(r=[r]),r&&Array.isArray(r)&&(null===(o=r)||void 0===o||o.forEach((function(e){p[i][e]=!0})))))})),te((0,xe.hB)(p))}null!==(e=t)&&void 0!==e&&e[O.$1.SEARCH]&&Ye(null===(i=t)||void 0===i?void 0:i[O.$1.SEARCH]);(0,xe.Qr)(t)||(console.log("wtf",t,(0,xe.hB)(t)),(0,ge.u7)((0,xe.hB)(t),{pushHistory:!1}))}),[Pn,on,Qe,Xe,Cn,_n,In]),(0,a.useEffect)((function(){(0,ve.bB)(cn,qe)}),[cn]);var Tn=function(e){return(0,p.Db)(Y.ZP.pipelines.useCreate(),{onSuccess:function(n){return(0,ve.wD)(n,{callback:function(n){var i=n.pipeline.uuid;null===e||void 0===e||e(i)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}})},En=Tn((function(e){return l.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))})),An=(0,u.Z)(En,2),Sn=An[0],On=An[1].isLoading,Mn=Tn((function(){null===dn||void 0===dn||dn(),null===fn||void 0===fn||fn()})),Dn=(0,u.Z)(Mn,2),Rn=Dn[0],Nn=Dn[1].isLoading,Ln=(0,p.Db)((function(e){return Y.ZP.pipelines.useUpdate(e.uuid)({pipeline:e})}),{onSuccess:function(e){return(0,ve.wD)(e,{callback:function(e){var n=e.pipeline.uuid;We((function(e){return we(we({},e),{},(0,r.Z)({},n,!1))})),dn(),null===fn||void 0===fn||fn(),null===qn||void 0===qn||qn(),Oe(null)},onErrorCallback:function(e,n){var i,t=null===e||void 0===e||null===(i=e.url_parameters)||void 0===i?void 0:i.pk;We((function(e){return we(we({},e),{},(0,r.Z)({},t,!1))})),qe({errors:n,response:e})}})}}),Un=(0,u.Z)(Ln,2),Gn=Un[0],Hn=Un[1].isLoading,Bn=(0,p.Db)((function(e){return Y.ZP.pipelines.useDelete(e)()}),{onSuccess:function(e){return(0,ve.wD)(e,{callback:function(){null===dn||void 0===dn||dn(),null===fn||void 0===fn||fn()},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),Yn=(0,u.Z)(Bn,2),$n=Yn[0],Vn=Yn[1].isLoading,Wn=(0,Ce.dd)((function(e){var n=e.pipeline,i=e.pipelineDescription,t=e.pipelineName;return(0,T.jsx)(E,{isLoading:Hn,minWidth:55*ce.iI,noEmptyValue:!!t,onClose:qn,onSave:function(e){var i=n||Se;if(i){var u=i.uuid,o={uuid:u};t?o.name=e:o.description=e,We((function(e){return we(we({},e),{},(0,r.Z)({},u,!0))})),Gn(o)}},textArea:!t,title:t?"Rename pipeline":"Edit description for ".concat(null===n||void 0===n?void 0:n.uuid),value:t||i})}),{},[Hn,Se],{background:!0,uuid:"rename_pipeline_and_save"}),zn=(0,u.Z)(Wn,2),Fn=zn[0],qn=zn[1],Kn=(0,Ce.dd)((function(){return(0,T.jsx)(F.BC,{children:(0,T.jsx)(h.Z,{contained:!0,onClickCustomTemplate:function(e){Sn({pipeline:{custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid,name:(0,pe.Y6)()}}).then((function(){Jn()}))},showBreadcrumbs:!0,tabs:[re.A2]})})}),{},[Sn],{background:!0,uuid:"browse_templates"}),Qn=(0,u.Z)(Kn,2),Xn=Qn[0],Jn=Qn[1],ei=(0,Ce.dd)((function(e){var n=e.cancelButtonText,i=(e.header,e.onCancel),t=e.onSaveSuccess;return(0,T.jsx)(F.BC,{children:(0,T.jsx)(M.Z,{cancelButtonText:n,contained:!0,header:(0,T.jsx)(w.Z,{mb:ce.HN,children:(0,T.jsxs)(I.Z,{children:[(0,T.jsx)(P.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate pipelines using AI."}),(0,T.jsx)(w.Z,{mt:1,children:(0,T.jsxs)(P.ZP,{warning:!0,children:["Read ",(0,T.jsx)(A.Z,{href:"https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key",openNewWindow:!0,children:"OpenAI\u2019s documentation"})," to get your API key."]})})]})}),onCancel:function(){null===i||void 0===i||i(),ti()},onSaveSuccess:function(e){nn(),ti(),null===t||void 0===t||t(e)}})})}),{},[nn],{background:!0,uuid:"configure_project"}),ni=(0,u.Z)(ei,2),ii=ni[0],ti=ni[1],ui=(0,Ce.dd)((function(){return(0,T.jsx)(F.BC,{children:(0,T.jsx)(v.Z,{createPipeline:Sn,isLoading:On,onClose:li})})}),{},[Sn,On],{background:!0,disableClickOutside:!0,disableCloseButton:!0,uuid:"AI_modal"}),oi=(0,u.Z)(ui,2),ri=oi[0],li=oi[1],ci=(0,a.useMemo)((function(){return(0,me.d)(Sn,{showAIModal:function(){null!==tn&&void 0!==tn&&tn.openai_api_key?ri():ii({onSaveSuccess:function(){ri()}})},showBrowseTemplates:Xn})}),[Sn,tn,ri,Xn,ii]),di=Y.ZP.tags.list().data,si=(0,a.useMemo)((function(){return(0,be.YC)((null===di||void 0===di?void 0:di.tags)||[],(function(e){return e.uuid}))}),[di]),ai=(0,a.useMemo)((function(){return(0,T.jsx)(B.Z,{addButtonProps:{isLoading:On,label:"New",menuItems:ci},deleteRowProps:{confirmationMessage:"This is irreversible and will immediately delete everything associated with the pipeline, including its blocks, triggers, runs, logs, and history.",isLoading:Vn,item:"pipeline",onDelete:function(){window.confirm("Are you sure you want to delete pipeline ".concat(null===Se||void 0===Se?void 0:Se.uuid,"?"))&&$n(null===Se||void 0===Se?void 0:Se.uuid)}},extraActionButtonProps:{Icon:z.oX,confirmationDescription:"Cloning the selected pipeline will create a new pipeline with the same configuration and code blocks. The blocks use the same block files as the original pipeline. Pipeline triggers, runs, backfills, and logs are not copied over to the new pipeline.",confirmationMessage:"Do you want to clone the pipeline ".concat(null===Se||void 0===Se?void 0:Se.uuid,"?"),isLoading:Nn,onClick:function(){return Rn({pipeline:{clone_pipeline_uuid:null===Se||void 0===Se?void 0:Se.uuid}})},openConfirmationDialogue:!0,tooltip:"Clone pipeline"},filterOptions:{status:O.kA,tag:[O.$1.NO_TAGS].concat((0,o.Z)(si.map((function(e){return e.uuid})))),type:Object.values(O.qL)},filterValueLabelMapping:{status:O.kA.reduce((function(e,n){return we(we({},e),{},(0,r.Z)({},n,(0,pe.J3)((0,pe.kC)(n))))}),{}),tag:we((0,r.Z)({},O.$1.NO_TAGS,"No tags"),si.reduce((function(e,n){var i=n.uuid;return we(we({},e),{},(0,r.Z)({},i,i))}),{})),type:O.G7},groupButtonProps:{groupByLabel:Pn,menuItems:[{beforeIcon:Pn===O.r0.STATUS?(0,T.jsx)(z.Jr,{fill:$.Z.content.default,size:1.5*ce.iI}):(0,T.jsx)(z.Cd,{muted:!0,size:1.5*ce.iI}),label:function(){return(0,pe.kC)(O.r0.STATUS)},onClick:function(){var e=Pn===O.r0.STATUS?null:O.r0.STATUS;e||ue({}),(0,ge.u7)((0,r.Z)({},O.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Status"},{beforeIcon:Pn===O.r0.TAG?(0,T.jsx)(z.Jr,{fill:$.Z.content.default,size:1.5*ce.iI}):(0,T.jsx)(z.Cd,{muted:!0,size:1.5*ce.iI}),label:function(){return(0,pe.kC)(O.r0.TAG)},onClick:function(){var e=Pn===O.r0.TAG?null:O.r0.TAG;e||ue({}),(0,ge.u7)((0,r.Z)({},O.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Tag"},{beforeIcon:Pn===O.r0.TYPE?(0,T.jsx)(z.Jr,{fill:$.Z.content.default,size:1.5*ce.iI}):(0,T.jsx)(z.Cd,{muted:!0,size:1.5*ce.iI}),label:function(){return(0,pe.kC)(O.r0.TYPE)},onClick:function(){var e=Pn===O.r0.TYPE?null:O.r0.TYPE;e||ue({}),(0,ge.u7)((0,r.Z)({},O.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Type"}]},moreActionsMenuItems:[{label:function(){return"Rename pipeline"},onClick:function(){return Fn({pipelineName:null===Se||void 0===Se?void 0:Se.name})},uuid:"Pipelines/MoreActionsMenu/Rename"},{label:function(){return"Edit description"},onClick:function(){return Fn({pipeline:Se,pipelineDescription:null===Se||void 0===Se?void 0:Se.description})},uuid:"Pipelines/MoreActionsMenu/EditDescription"}],onClickFilterDefaults:function(){te({}),l.push("/pipelines")},onFilterApply:function(e,n){Object.values(n).every((function(e){return!(null!==e&&void 0!==e&&e.length)}))&&te({})},query:Qe,searchProps:{onChange:Ye,value:He},selectedRowId:null===Se||void 0===Se?void 0:Se.uuid,setSelectedRow:Oe})}),[Rn,$n,Pn,Nn,On,Vn,ci,Qe,l,He,Se,Fn,si]),pi=(0,F.VI)(null,{},[],{uuid:"pipelines/list"}),fi=(0,u.Z)(pi,1)[0],vi=(0,p.Db)(Y.ZP.projects.useUpdate(null===tn||void 0===tn?void 0:tn.name),{onSuccess:function(e){return(0,ve.wD)(e,{callback:function(){nn()},onErrorCallback:function(e,n){return fi({errors:n,response:e})}})}}),hi=(0,u.Z)(vi,2),mi=hi[0],gi=hi[1].isLoading,bi=(0,a.useCallback)((function(e){return mi({project:e})}),[mi]),xi=(0,Ce.dd)((function(){return(0,T.jsxs)(I.Z,{maxWidth:60*ce.iI,children:[(0,T.jsx)(w.Z,{mb:1,children:(0,T.jsx)(C.Z,{children:"Help improve Mage"})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsx)(P.ZP,{default:!0,children:"Please contribute usage statistics to help improve the developer experience for you and everyone in the community \ud83e\udd1d."})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsx)(I.Z,{success:!0,children:(0,T.jsxs)(j.ZP,{alignItems:"center",children:[(0,T.jsx)(z.Yo,{size:5*ce.iI,success:!0}),(0,T.jsx)(w.Z,{mr:1}),(0,T.jsx)(Z.Z,{children:(0,T.jsx)(P.ZP,{children:"All usage statistics are completely anonymous. It\u2019s impossible for Mage to know which statistics belongs to whom."})})]})})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsxs)(P.ZP,{default:!0,children:["By opting into sending usage statistics to ",(0,T.jsx)(A.Z,{href:"https://www.mage.ai",openNewWindow:!0,children:"Mage"}),", it\u2019ll help the team and community of contributors (",(0,T.jsx)(A.Z,{href:"https://www.mage.ai/chat",openNewWindow:!0,children:"Magers"}),") learn what\u2019s going wrong with the tool and what improvements can be made."]})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsx)(P.ZP,{default:!0,children:"In addition to helping reduce potential errors, you\u2019ll help inform which features are useful and which need work."})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsxs)(j.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,T.jsx)(P.ZP,{bold:!0,children:"I want to help make Mage more powerful for everyone"}),(0,T.jsx)(w.Z,{mr:ce.cd}),(0,T.jsx)(H.Z,{checked:!0,onCheck:function(){window.confirm("Are you sure you don\u2019t want to help everyone in the community?")&&bi({help_improve_mage:!1}).then((function(){return Ci()}))}})]})}),gi&&(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsx)(L.Z,{inverted:!0})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsxs)(P.ZP,{muted:!0,small:!0,children:["To learn more about how this works, please check out the ",(0,T.jsx)(A.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,small:!0,children:"documentation"}),"."]})}),(0,T.jsx)(m.ZP,{onClick:function(){return bi({help_improve_mage:!0}).then((function(){return Ci()}))},secondary:!0,children:"Close"})]})}),{},[tn],{background:!0,hideCallback:function(){bi({help_improve_mage:!0})},uuid:"help_mage"}),Zi=(0,u.Z)(xi,2),ji=Zi[0],Ci=Zi[1];(0,a.useEffect)((function(){tn&&null===(null===tn||void 0===tn?void 0:tn.help_improve_mage)&&ji()}),[tn,ji]);var _i=(0,a.useCallback)((function(e){var n={};null===e||void 0===e||e.forEach((function(e,i){var t=null===e||void 0===e?void 0:e[Pn];if(O.r0.STATUS===Pn){var u=(e||{}).schedules,o=void 0===u?[]:u,r=o.length;t=o.find((function(e){var n=e.status;return de.fq.ACTIVE===n}))?O.QK.ACTIVE:r>=1?O.QK.INACTIVE:O.QK.NO_SCHEDULES}else if(O.r0.TAG===Pn){t=(null===e||void 0===e?void 0:e.tags)?(0,be.YC)(e.tags,(function(e){return e})).join(", "):""}n[t]||(n[t]=[]),n[t].push(i)}));var i=[],t=[];O.r0.STATUS===Pn?Object.values(O.QK).forEach((function(e){i.push(n[e]),t.push((0,pe.vg)(e))})):O.r0.TAG===Pn?(0,be.YC)(Object.keys(n),(function(e){return e})).forEach((function(e){i.push(n[e]),e?t.push(e.split(", ").map((function(e,n){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{style:{marginLeft:n>=1?4:0}},"".concat(e,"-").concat(n,"-spacing")),(0,T.jsx)(b.Z,{small:!0,children:(0,T.jsx)(P.ZP,{children:e})},"".concat(e,"-").concat(n))]})}))):t.push("No tags")})):O.r0.TYPE===Pn&&Object.values(O.qL).forEach((function(e){i.push(n[e]),t.push(O.G7[e])}));var u=[],o=[];return null===i||void 0===i||i.forEach((function(e,n){"undefined"!==typeof e&&null!==e&&(null===e||void 0===e?void 0:e.length)>=1&&(o.push(e),u.push(null===t||void 0===t?void 0:t[n]))})),{rowGroupHeaders:u,rowsGroupedByIndex:o}}),[Pn]),Ii=(0,a.useMemo)((function(){return _i(Zn)}),[_i,Zn]),wi=Ii.rowGroupHeaders,Pi=Ii.rowsGroupedByIndex,ki=(0,a.useMemo)((function(){return _i(jn)}),[_i,jn]),yi=ki.rowGroupHeaders,Ti=ki.rowsGroupedByIndex,Ei=(0,a.useCallback)((function(e,n,i,t,u){return(0,T.jsx)(U.Z,{columnFlex:[null,null,null,2,null,null,null,1,null,null,null],columns:[{label:function(){return""},uuid:"action"},{uuid:(0,pe.kC)(O.r0.STATUS)},{uuid:"Name"},{uuid:"Description"},{uuid:(0,pe.kC)(O.r0.TYPE)},we(we({},rn),{},{uuid:"Updated at"}),we(we({},rn),{},{uuid:"Created at"}),{uuid:"Tags"},{uuid:"Blocks"},{uuid:"Triggers"},{center:!0,label:function(){return""},uuid:"Actions"}],defaultSortColumnIndex:2,getUniqueRowIdentifier:xn,isSelectedRow:function(e){var i;return(null===(i=n[e])||void 0===i?void 0:i.uuid)===(null===Se||void 0===Se?void 0:Se.uuid)},localStorageKeySortColIdx:ee,localStorageKeySortDirection:ne,onClickRow:function(e){return Oe((function(i){var t=n[e];return(null===i||void 0===i?void 0:i.uuid)!==(null===t||void 0===t?void 0:t.uuid)?t:null}))},onDoubleClickRow:function(e){l.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n[e].uuid,"/edit"))},ref:d,renderRightClickMenuItems:function(e){var i=n[e];return[{label:function(){return"Edit description"},onClick:function(){return Fn({pipeline:i,pipelineDescription:null===i||void 0===i?void 0:i.description})},uuid:"edit_description"},{label:function(){return"Rename"},onClick:function(){return Fn({pipeline:i,pipelineName:null===i||void 0===i?void 0:i.name})},uuid:"rename"},{label:function(){return"Clone"},onClick:function(){return Rn({pipeline:{clone_pipeline_uuid:null===i||void 0===i?void 0:i.uuid}})},uuid:"clone"},{label:function(){return"Download (keep folder structure)"},onClick:function(){yn({pipelineUUID:null===i||void 0===i?void 0:i.uuid,filesOnly:!1})},uuid:"download_keep_folder_structure"},{label:function(){return"Download (without folder structure)"},onClick:function(){yn({pipelineUUID:null===i||void 0===i?void 0:i.uuid,filesOnly:!0})},uuid:"download_without_folder_structure"},{label:function(){return"Add/Remove tags"},onClick:function(){l.push("/pipelines/[pipeline]/settings","/pipelines/".concat(null===i||void 0===i?void 0:i.uuid,"/settings"))},uuid:"add_tags"},{label:function(){return"Create template"},onClick:function(){l.push("/templates?object_type=".concat(le.R,"&new=1&pipeline_uuid=").concat(null===i||void 0===i?void 0:i.uuid))},uuid:"create_custom_template"},{label:function(){return"Create global data product"},onClick:function(){l.push("/global-data-products?object_type=".concat(q.b.PIPELINE,"&new=1&object_uuid=").concat(null===i||void 0===i?void 0:i.uuid))},uuid:"create_global_data_product"},{label:function(){return"Delete"},onClick:function(){window.confirm("Are you sure you want to delete pipeline ".concat(null===i||void 0===i?void 0:i.uuid,"?"))&&$n(null===i||void 0===i?void 0:i.uuid)},uuid:"delete"}]},rightClickMenuHeight:252,rightClickMenuWidth:30*ce.iI,rowGroupHeaders:i,rows:null===e||void 0===e?void 0:e.map((function(e,n){var i=e.blocks,t=e.created_at,u=e.description,o=e.schedules,c=e.tags,d=e.type,a=e.updated_at,p=e.uuid,f=i.filter((function(e){var n=e.type;return W.tf.SCRATCHPAD!==n})).length,v=o.length,h=o.find((function(e){var n=e.status;return de.fq.ACTIVE===n})),g=(0,T.jsx)("div",{children:(0,T.jsx)(G.Z,{tags:null===c||void 0===c?void 0:c.map((function(e){return{uuid:e}}))})},"pipeline_tags_".concat(n));return[v>=1||Ve[p]?(0,T.jsx)(m.ZP,{iconOnly:!0,loading:!!Ve[p],noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(n){(0,Ze.j)(n),We((function(e){return we(we({},e),{},(0,r.Z)({},p,!0))})),Gn(we(we({},e),{},{status:h?de.fq.INACTIVE:de.fq.ACTIVE}))},children:h?(0,T.jsx)(z.dz,{muted:!0,size:2*ce.iI}):(0,T.jsx)(z.Py,{default:!0,size:2*ce.iI})}):null,(0,T.jsx)(P.ZP,{default:!h,monospace:!0,success:!!h,children:h?de.fq.ACTIVE:v>=1?de.fq.INACTIVE:"no schedules"},"pipeline_status_".concat(n)),(0,T.jsx)(s(),{as:"/pipelines/".concat(p),href:"/pipelines/[pipeline]",passHref:!0,children:(0,T.jsx)(A.Z,{sameColorAsText:!0,children:p})},"pipeline_name_".concat(n)),(0,T.jsx)(P.ZP,{default:!0,preWrap:!0,title:u,children:u},"pipeline_description_".concat(n)),(0,T.jsx)(P.ZP,{children:O.G7[d]},"pipeline_type_".concat(n)),(0,T.jsx)(P.ZP,{monospace:!0,small:!0,title:a?(0,fe._6)(a):null,children:a?(0,fe.XG)(a,un):(0,T.jsx)(T.Fragment,{children:"\u2014"})},"pipeline_updated_at_".concat(n)),(0,T.jsx)(P.ZP,{monospace:!0,small:!0,title:t?(0,fe._6)(t):null,children:t?(0,fe.XG)(t.slice(0,19),un):(0,T.jsx)(T.Fragment,{children:"\u2014"})},"pipeline_created_at_".concat(n)),g,(0,T.jsx)(P.ZP,{default:0===f,monospace:!0,children:f},"pipeline_block_count_".concat(n)),(0,T.jsx)(P.ZP,{default:0===v,monospace:!0,children:v},"pipeline_trigger_count_".concat(n)),(0,T.jsxs)(Z.Z,{flex:1,justifyContent:"flex-end",children:[(0,T.jsx)(m.ZP,we(we({},Ae),{},{onClick:function(){yn({pipelineUUID:p})},title:"Download (keep folder structure)",children:(0,T.jsx)(z.vc,{default:!0,size:2*ce.iI})})),(0,T.jsx)(w.Z,{mr:1}),(0,T.jsx)(m.ZP,we(we({},Ae),{},{onClick:function(){l.push("/pipelines/[pipeline]","/pipelines/".concat(p))},title:"Detail",children:(0,T.jsx)(z.UY,{default:!0,size:2*ce.iI})})),(0,T.jsx)(w.Z,{mr:1}),(0,T.jsx)(m.ZP,we(we({},Ae),{},{onClick:function(){l.push("/pipelines/[pipeline]/logs","/pipelines/".concat(p,"/logs"))},title:"Logs",children:(0,T.jsx)(z.$B,{default:!0,size:2*ce.iI})}))]},"chevron_icon_".concat(n))]})),rowsGroupedByIndex:t,setRowsSorted:u,sortableColumnIndexes:Cn,sortedColumn:wn,stickyHeader:!0})}),[Rn,$n,yn,un,xn,Ve,l,Se,We,Oe,Fn,Cn,wn,rn,Gn]),Ai=(0,a.useMemo)((function(){return Ei(hn,Zn,wi,Pi,Re)}),[hn,Zn,Ei,wi,Pi,Re]),Si=(0,a.useMemo)((function(){return Ei(mn,jn,yi,Ti,Ue)}),[mn,jn,Ei,yi,Ti,Ue]),Oi=(0,a.useMemo)((function(){return(null===hn||void 0===hn?void 0:hn.length)||0}),[hn]),Mi=(0,a.useMemo)((function(){return(null===mn||void 0===mn?void 0:mn.length)||0}),[mn]),Di=(0,a.useMemo)((function(){return(!on||ke.uuid===Xe)&&!Oi||on&&Pe.uuid===Xe&&!Mi}),[on,Oi,Mi,Xe]),Ri=(0,a.useMemo)((function(){var e=null===Qe||void 0===Qe?void 0:Qe[oe.$D.LIMIT];return(0,T.jsxs)(j.ZP,{alignItems:"center",children:[(0,T.jsx)(P.ZP,{muted:!0,small:!0,children:"Per page"}),(0,T.jsx)(w.Z,{mr:1}),(0,T.jsxs)(N.Z,{compact:!0,onChange:function(e){return(0,ge.u7)((0,r.Z)({},oe.$D.LIMIT,e.target.value),{pushHistory:!0})},small:!0,value:e,children:[e&&(e>5*S.Q||e%S.Q)&&(0,T.jsx)("option",{value:e,children:e}),(0,be.w6)(5).map((function(e,n){var i=(n+1)*S.Q;return(0,T.jsx)("option",{value:i,children:i})}))]})]})}),[Qe]),Ni=(0,a.useMemo)((function(){var e,n,i=cn;on&&Pe.uuid===Xe&&(i=pn);var t=(null===(e=i)||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.count)||0,u=(null===Qe||void 0===Qe?void 0:Qe[oe.$D.LIMIT])||S.Q,o=(null===Qe||void 0===Qe?void 0:Qe[oe.$D.OFFSET])||0,l=Math.ceil(t/u);return(0,T.jsx)(w.Z,{p:ce.cd,children:(0,T.jsx)(S.ZP,{maxPages:S.Et,onUpdate:function(e){var n=Number(e);(0,ge.u7)((0,r.Z)({},oe.$D.OFFSET,n*u))},page:Math.floor(o/u),totalPages:l})})}),[cn,pn,on,Qe,Xe]);return(0,T.jsxs)(x.Z,{errors:Fe,setErrors:qe,subheaderChildren:(0,T.jsxs)(j.ZP,{alignItems:"center",justifyContent:"space-between",children:[ai,Ri]}),title:"Pipelines",uuid:"pipelines/index",children:[on&&(0,T.jsx)(w.Z,{px:ce.cd,ref:c,children:(0,T.jsx)(g.Z,{noPadding:!0,onClickTab:function(e){var n,i=e.uuid;return(0,ge.u7)((n={},(0,r.Z)(n,Te,i),(0,r.Z)(n,oe.$D.LIMIT,null),(0,r.Z)(n,oe.$D.OFFSET,null),n),{pushHistory:!0})},regularSizeText:!0,selectedTabUUID:Xe,tabs:ye.map((function(e){var n=e.Icon,i=e.label;return{Icon:n,label:function(){var e;return i({count:null===cn||void 0===cn||null===(e=cn.metadata)||void 0===e?void 0:e.count})},uuid:e.uuid}})),underlineStyle:!0})}),Di?(0,T.jsx)(w.Z,{p:ce.Mq,children:cn?(0,T.jsx)(P.ZP,{bold:!0,default:!0,monospace:!0,muted:!0,children:"No pipelines available"}):(0,T.jsx)(L.Z,{inverted:!0,large:!0})}):null,(0,T.jsxs)(ae.cl,{hide:Di,includePadding:!!Pn,maxHeight:"calc(100vh - ".concat(K.Mz+74+(D||0)+(null===_||void 0===_||null===(n=_.current)||void 0===n||null===(i=n.getBoundingClientRect)||void 0===i||null===(t=i.call(n))||void 0===t?void 0:t.height),"px)"),children:[(!on||ke.uuid===Xe)&&Ai,on&&Pe.uuid===Xe&&Si]}),(0,T.jsx)("div",{ref:_,children:Ni})]})}Se.getInitialProps=(0,t.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var Oe=(0,D.Z)(Se)},44952:function(e,n,i){"use strict";i.d(n,{K:function(){return u}});var t=i(4383);function u(e){var n=(0,t.ZP)("downloads",e),i=document.createElement("a");i.href=n,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(n),document.body.removeChild(i)}},79274:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines",function(){return i(55620)}])}},function(e){e.O(0,[2678,1154,844,5820,6639,1124,341,1751,1821,4267,6990,8487,8264,7858,5499,4366,4138,5810,1769,1550,90,9264,2474,1952,9774,2888,179],(function(){return n=79274,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4138],{61709:function(n,o,e){e.d(o,{IT:function(){return w},J8:function(){return k},MS:function(){return g},Ts:function(){return b},YW:function(){return C},_o:function(){return m},eY:function(){return p},fA:function(){return h},h5:function(){return x},oI:function(){return y}});var i=e(82394),t=e(44425),l=e(48339),r=e(57653),u=e(82359),d=e(85385),c=e(81728),a=e(55283),s=e(15610);function v(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function f(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?v(Object(e),!0).forEach((function(o){(0,i.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):v(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var p=function(n,o){var e=(null===o||void 0===o?void 0:o.upstream_blocks)||[];return t.iZ.includes(null===n||void 0===n?void 0:n.type)||t.iZ.includes(null===o||void 0===o?void 0:o.type)||t.tf.DATA_LOADER===(null===o||void 0===o?void 0:o.type)&&t.tf.SENSOR!==n.type||e.push(n.uuid),e},h=function(n,o,e){var i=[];return(null===n||void 0===n?void 0:n.type)!==r.qL.STREAMING||t.iZ.includes(null===o||void 0===o?void 0:o.type)||t.iZ.includes(null===e||void 0===e?void 0:e.type)||(i=i.concat((null===o||void 0===o?void 0:o.downstream_blocks)||[])),i},b=function(n,o,e,i){for(var l,r=[],u=o.findIndex((function(o){return o.uuid===n.uuid}));!l&&u>=0;){var d;l=o[u-1],t.tf.SCRATCHPAD===(null===(d=l)||void 0===d?void 0:d.type)&&(l=null),u-=1}return l&&r.push(l.uuid),t.Ut.map((function(o){return{label:function(){return"Convert to ".concat((0,c.wX)(t.V4[o]))},onClick:function(){return i({converted_from_type:o,converted_from_uuid:n.uuid,type:o,upstream_blocks:r})},uuid:"".concat(e,"/convert_to/").concat(o)}}))},k=function(n,o,e,i,l,r){var c,a,v=n||{},p=v.configuration,h=v.downstream_blocks,b=v.has_callback,k=v.language,g=v.metadata,m=v.replicated_block,x=v.type,y=v.upstream_blocks,C=v.uuid,w=p||{},O=w.dynamic,S=w.reduce_output,j=t.tf.DBT===x,B=[],E=!(null===r||void 0===r||null===(c=r.project)||void 0===c||null===(a=c.features)||void 0===a||!a[u.d.INTERACTIONS]);if(t.tf.SCRATCHPAD!==x&&![t.tf.CALLBACK,t.tf.EXTENSION,t.tf.MARKDOWN].includes(x)){B.push.apply(B,[{label:function(){return j?"Execute and run all upstream blocks":"Execute with all upstream blocks"},onClick:function(){return o({block:n,runUpstream:!0})},uuid:"execute_upstream"},{label:function(){return j?"Execute and run incomplete upstream blocks":"Execute with incomplete upstream blocks"},onClick:function(){return o({block:n,runIncompleteUpstream:!0})},uuid:"execute_incomplete_upstream"}]),j||t.tf.GLOBAL_DATA_PRODUCT===x||B.push({label:function(){return"Execute block and run tests"},onClick:function(){return o({block:n,runTests:!0})},uuid:"run_tests"});var I,T,_,Z,D,P=r||{},A=P.addNewBlock,R=P.blocksMapping,N=P.fetchFileTree,L=P.fetchPipeline,M=P.savePipelineContent,H=P.updatePipeline,U=[];if(null===h||void 0===h||h.forEach((function(n){var o=null===R||void 0===R?void 0:R[n];o&&o.upstream_blocks.forEach((function(n){var o,e;null!==R&&void 0!==R&&null!==(o=R[n])&&void 0!==o&&null!==(e=o.configuration)&&void 0!==e&&e.dynamic&&U.push(R[n])}))})),j&&t.t6.SQL===k)B.unshift.apply(B,[{label:function(){return"Test model"},onClick:function(){return o({block:n,runSettings:{test_model:!0}})},tooltip:function(){return"Execute command dbt test."},uuid:"test_model"},{label:function(){return"Build model"},onClick:function(){return o({block:n,runSettings:{build_model:!0}})},tooltip:function(){return"Execute command dbt build."},uuid:"build_model"},{label:function(){return"Add upstream models"},onClick:function(){H({pipeline:{add_upstream_for_block_uuid:null===n||void 0===n?void 0:n.uuid}})},tooltip:function(){return"Add upstream models for this model to the pipeline."},uuid:"add_upstream_models"}]),null!==g&&void 0!==g&&null!==(I=g.dbt)&&void 0!==I&&null!==(T=I.block)&&void 0!==T&&T.snapshot||B.unshift.apply(B,[{label:function(){return"Run model"},onClick:function(){return o({block:n,runSettings:{run_model:!0}})},tooltip:function(){return"Execute command dbt run."},uuid:"run_model"}]),null!==g&&void 0!==g&&null!==(_=g.dbt)&&void 0!==_&&null!==(Z=_.block)&&void 0!==Z&&Z.snapshot&&B.unshift.apply(B,[{label:function(){return"Run snapshot"},onClick:function(){return o({block:n,runSettings:{run_model:!0}})},tooltip:function(){return"Execute command dbt snapshot."},uuid:"run_model"}]);if(j||t.tf.GLOBAL_DATA_PRODUCT===x||!M||!O&&0!==U.length||B.push({label:function(){return O?"Disable block as dynamic":"Set block as dynamic"},onClick:function(){return M({block:f(f({},n),{},{configuration:f(f({},p),{},{dynamic:!O})})})},uuid:"dynamic"}),R||null!==n&&void 0!==n&&n.tags)((null===y||void 0===y?void 0:y.find((function(n){var o,e;return null===R||void 0===R||null===(o=R[n])||void 0===o||null===(e=o.configuration)||void 0===e?void 0:e.dynamic})))||null!==n&&void 0!==n&&null!==(D=n.tags)&&void 0!==D&&D.includes(t.L8.DYNAMIC_CHILD))&&B.push({label:function(){return S?"Don\u2019t reduce output":"Reduce output"},onClick:function(){return M({block:f(f({},n),{},{configuration:f(f({},p),{},{reduce_output:!S})})})},uuid:"reduce_output"});B.push({label:function(){return b?"Remove callback":"Add callback"},onClick:function(){if(b)return M({block:f(f({},n),{},{has_callback:!b})}).then((function(){N(),L()}));(0,s.u7)({addon:d.cH.CALLBACKS,sideview:d.cH.ADDON_BLOCKS})},uuid:"has_callback"}),j||B.push({disabled:!!m,label:function(){return"Replicate block"},onClick:function(){return A({replicated_block:C})},uuid:"Replicate block"})}return E&&B.push({label:function(){return"Add / Edit interactions"},onClick:function(){var n;null===r||void 0===r||null===(n=r.openSidekickView)||void 0===n||n.call(r,d.cH.INTERACTIONS)},uuid:"Add interactions"}),B.push({label:function(){return"Delete block"},onClick:function(){e(n),i(!1)},uuid:"delete_block"}),l?[B.pop()]:B};function g(n){var o=n.tags,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[],l=e.conditionFailed;return null===o||void 0===o||o.forEach((function(n){t.L8.DBT_SNAPSHOT===n?i.push({description:"This is a dbt snapshot file.",title:(0,c.vg)(t.L8.DBT_SNAPSHOT)}):t.L8.DYNAMIC===n?i.push({description:"This block will create N blocks for each of its downstream blocks.",title:(0,c.vg)(t.L8.DYNAMIC)}):t.L8.DYNAMIC_CHILD===n?i.push({description:"This block is dynamically created by its upstream parent block that is dynamic.",title:(0,c.vg)(t.L8.DYNAMIC_CHILD)}):t.L8.REDUCE_OUTPUT===n?i.push({description:"Reduce output from all dynamically created blocks into a single array output.",title:(0,c.vg)(t.L8.REDUCE_OUTPUT)}):t.L8.REPLICA===n?i.push({description:"This block is a replica of another block in the current pipeline.",title:(0,c.vg)(t.L8.REPLICA)}):t.L8.CONDITION===n?l?i.push({description:"This block condition evaluated as false.",title:"Condition unmet"}):i.push({description:"This block has a condition that will be run before its execution.",title:(0,c.vg)(t.L8.CONDITION)}):i.push({title:n})})),i}function m(n){var o=n.block,e=n.dynamic,i=n.dynamicUpstreamBlock,t=n.hasError,l=(n.reduceOutput,n.reduceOutputUpstreamBlock),r=n.selected,u=i&&!l;return{borderColorShareProps:{blockColor:null===o||void 0===o?void 0:o.color,blockType:null===o||void 0===o?void 0:o.type,dynamicBlock:e,dynamicChildBlock:u,hasError:t,selected:r},tags:g(o)}}function x(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o&&(null===o||void 0===o?void 0:o.length)>=0?o.map((function(n){return{data:n,execution_state:l.uF.IDLE,type:l.Gi.TEXT_PLAIN}})):n.filter((function(n){return null===n||void 0===n?void 0:n.type}))}function y(n){return{hasError:!!n.find((function(n){return n.error})),hasOutput:n.length>=1}}var C=function(){return Object.values(t.Lq).reduce((function(n,o){return f(f({},n),{},(0,i.Z)({},o,(0,a.qn)(t.tf.CUSTOM,{blockColor:o}).accent))}),{})};function w(n,o,e){var i=null===n||void 0===n?void 0:n.reduce((function(n,o){return o?n.concat(o):n}),[]),t=(null===i||void 0===i?void 0:i[(null===i||void 0===i?void 0:i.length)-1])||0;return(.25*Math.min(t,e)||0)/o}},47001:function(n,o,e){e.d(o,{Gi:function(){return c},Go:function(){return p},I5:function(){return f},Pq:function(){return s},RJ:function(){return a},YF:function(){return d},ZG:function(){return u},ze:function(){return v}});var i=e(38626),t=e(44897),l=e(42631),r=e(70515),u=3*r.iI,d=2,c=i.default.div.withConfig({displayName:"indexstyle__NodeContainerStyle",componentId:"sc-kc7274-0"})(["min-width:fit-content;"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ",""],(function(n){return!n.isDragging&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(n){return n.isDragging&&"\n cursor: grab;\n "}),(function(n){return!n.active&&(n.isCancelled||n.disabled)&&"\n // opacity doesn\u2019t work on Safari\n border: ".concat(d,"px dotted ").concat((n.theme.content||t.Z.content).muted,";\n cursor: not-allowed;\n opacity: 0.5;\n ")}),(function(n){return(!n.selected||!n.backgroundGradient)&&!n.active&&n.borderColorBottom&&"\n border-bottom-color: ".concat(n.borderColorBottom,";\n border-width: ").concat(d,"px;\n ")}),(function(n){return(!n.selected||!n.backgroundGradient)&&!n.active&&n.borderColorLeft&&"\n border-left-color: ".concat(n.borderColorLeft,";\n border-width: ").concat(d,"px;\n ")}),(function(n){return(!n.selected||!n.backgroundGradient)&&!n.active&&n.borderColorRight&&"\n border-right-color: ".concat(n.borderColorRight,";\n border-width: ").concat(d,"px;\n ")}),(function(n){return(!n.selected||!n.backgroundGradient)&&!n.active&&n.borderColorTop&&"\n border-top-color: ".concat(n.borderColorTop,";\n border-width: ").concat(d,"px;\n ")}),(function(n){return n.selected&&!n.active&&n.backgroundGradient&&"\n background: ".concat(n.backgroundGradient,";\n padding: ").concat(d,"px;\n ")}),(function(n){return!n.borderDeemphasized&&"\n border-style: solid;\n "}),(function(n){return n.borderDeemphasized&&"\n border-style: double;\n "}),(function(n){return!n.borderRadiusLarge&&"\n border-radius: ".concat(l.n_,"px;\n ")}),(function(n){return n.borderRadiusLarge&&"\n border-radius: ".concat(l.Ro,"px;\n ")}),(function(n){return n.active&&(n.borderColorBottom||n.borderColorLeft||n.borderColorRight||n.borderColorTop)&&"\n animation: border-dance ".concat(null!==n&&void 0!==n&&n.activeSlow?"2s":".5s"," infinite linear;\n background: linear-gradient(90deg, ").concat(n.borderColorTop||n.borderColorBottom||n.borderColorLeft||n.borderColorRight," 50%, transparent 50%),\n linear-gradient(90deg, ").concat(n.borderColorRight||n.borderColorTop||n.borderColorBottom||n.borderColorLeft," 50%, transparent 50%),\n linear-gradient(0deg, ").concat(n.borderColorLeft||n.borderColorRight||n.borderColorTop||n.borderColorBottom," 50%, transparent 50%),\n linear-gradient(0deg, ").concat(n.borderColorBottom||n.borderColorLeft||n.borderColorRight||n.borderColorTop," 50%, transparent 50%);\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n padding: ").concat(d,"px;\n\n @keyframes border-dance {\n 0% {\n background-position: left top,\n right bottom,\n left bottom,\n right top;\n }\n 100% {\n background-position: left 15px top,\n right 15px bottom,\n left bottom 15px,\n right top 15px;\n }\n }\n ")}),(function(n){return n.active&&(n.borderColorBottom||n.borderColorLeft||n.borderColorRight||n.borderColorTop)&&!n.noBackground&&"\n background-size: 15px 4px, 15px 4px, 4px 15px, 4px 15px;\n "}),(function(n){return n.active&&(n.borderColorBottom||n.borderColorLeft||n.borderColorRight||n.borderColorTop)&&n.noBackground&&"\n background-size: 15px 1.5px, 15px 1.5px, 1.5px 15px, 1.5px 15px;\n "}),(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")}),(function(n){return n.opacity&&"\n opacity: ".concat(n.opacity,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__NodeStyle",componentId:"sc-kc7274-1"})(["border-radius:","px;min-width:fit-content;overflow:hidden;"," "," "," "," ",""],l.n_,(function(n){return!n.noBackground&&"\n background-color: ".concat((n.theme.background||t.Z.background).codeTextarea,";\n ")}),(function(n){return n.isConditionFailed&&"\n background-color: ".concat((n.theme.content||t.Z.content).disabled,";\n cursor: not-allowed;\n ")}),(function(n){return n.isConditionFailed&&"\n background-color: ".concat((n.theme.content||t.Z.content).disabled,";\n cursor: not-allowed;\n ")}),(function(n){return n.disabled&&"\n &:hover {\n cursor: not-allowed;\n }\n "}),(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__StatusStyle",componentId:"sc-kc7274-2"})(["height:","px;width:","px;"],2*r.iI,2*r.iI),v=i.default.div.withConfig({displayName:"indexstyle__IconStyle",componentId:"sc-kc7274-3"})(["align-items:center;border-radius:","px;border:2px solid transparent;display:flex;height:","px;justify-content:center;width:","px;"," ",""],l.BG,5*r.iI,5*r.iI,(function(n){return n.backgroundColor&&"\n background-color: ".concat(n.backgroundColor,";\n border-color: ").concat(n.backgroundColor,";\n ")}),(function(n){return n.borderColor&&"\n border-color: ".concat(n.borderColor,";\n ")})),f=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-kc7274-4"})(["padding:","px;",""],1*r.iI,(function(n){return"\n background-color: ".concat((n.theme.background||t.Z.background).dashboard,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__BodyStyle",componentId:"sc-kc7274-5"})(["padding-left:","px;padding-right:","px;"],1*r.iI,1*r.iI);i.default.div.withConfig({displayName:"indexstyle__RuntimeStyle",componentId:"sc-kc7274-6"})(["margin-right:","px;padding:12px 4px;height:100%;width:50px;background:rgba(0,0,0,0.2);background-blend-mode:soft-light;"],2*r.iI)},99543:function(n,o,e){e.d(o,{DS:function(){return s},HI:function(){return B},SX:function(){return f},YE:function(){return p},_7:function(){return w},p1:function(){return j},qj:function(){return O},rQ:function(){return y}});var i=e(21831),t=e(44425),l=e(57653),r=e(47001),u=e(70515),d=e(61709),c=e(44375),a=e(4804),s=u.cd,v=u.cd*u.iI,f=2*u.iI,p=8.62,h=7.43,b=2*r.YF,k=2*r.YF,g=2*u.iI+5*u.iI,m=2*u.iI+5*u.iI+v+v+f,x=30*u.iI;function y(n){var o=(0,d.MS)(n);if((null===o||void 0===o?void 0:o.length)>=1)return(null===o||void 0===o?void 0:o.map((function(n){return n.title})).join(", "))||"";if(t.tf.GLOBAL_DATA_PRODUCT===(null===n||void 0===n?void 0:n.type)){var e,i=null===n||void 0===n||null===(e=n.configuration)||void 0===e?void 0:e.global_data_product;if(null!==i&&void 0!==i&&i.uuid)return null===i||void 0===i?void 0:i.uuid}return t.dO[null===n||void 0===n?void 0:n.language]||""}function C(n,o){var e,i,r,u=n.description,d=n.name,s=n.type,v=u||(null===t.V4||void 0===t.V4?void 0:t.V4[s])||s;if(l.qL.INTEGRATION===(null===o||void 0===o?void 0:o.type)&&t.tf.TRANSFORMER!==n.type){var f,p,h={};if(t.t6.YAML===n.language&&(null===n||void 0===n||null===(f=n.content)||void 0===f?void 0:f.length)>=1&&(h=(0,a.Qc)(n.content)),t.tf.DATA_LOADER===n.type)r="".concat(n.uuid,": ").concat(null===(p=h)||void 0===p?void 0:p.source);else if(t.tf.DATA_EXPORTER===n.type){var b;r="".concat(n.uuid,": ").concat(null===(b=h)||void 0===b?void 0:b.destination)}}else if(t.tf.DBT===n.type&&t.t6.SQL===n.language){var k=(0,c.IU)(n),g=k.name,m=k.project;r=g,v="".concat(v,"/").concat(m)}return null!==n&&void 0!==n&&n.replicated_block&&(r=d&&u?d:null===n||void 0===n?void 0:n.uuid,u||(v=null===n||void 0===n?void 0:n.replicated_block)),(null===n||void 0===n||null===(e=n.uuid)||void 0===e||null===(i=e.split(":"))||void 0===i?void 0:i.length)>=2&&d&&(r=d),r||(r=n.uuid),{displayText:r,subtitle:v}}function w(n,o){return C(n,o).displayText||""}function O(n,o){return C(n,o).subtitle||""}function S(n){var o=0;return null===n||void 0===n||n.forEach((function(n,e){var i=n.uuid;o+=4+i.length*h,e>=1&&(o+=4)})),o}function j(n,o,e){var i,t=0,l=b+g,r=B(n,o,e)-(k+2*u.iI),d=y(n),c=(null===d||void 0===d?void 0:d.length)*h;if(c>=1){var a=1;c>r&&(a=Math.ceil(c/r)),t+=1,l+=18*a}var s=e||{},v=s.blockStatus;return[s.callbackBlocks,s.conditionalBlocks,s.extensionBlocks].forEach((function(n){if((null===n||void 0===n?void 0:n.length)>=1){var o=S(n),e=1;o>r&&(e=Math.ceil(o/r)),t+=1,l+=18.5*e+4*(e-1)}})),"undefined"!==typeof(null===v||void 0===v||null===(i=v[n.uuid])||void 0===i?void 0:i.runtime)&&(l+=18,t+=1),l+=(t+=1)*(1*u.iI)}function B(n,o,e){var t,l,r=Math.max((null===(t=w(n,o))||void 0===t?void 0:t.length)*p,(null===(l=O(n,o))||void 0===l?void 0:l.length)*h),u=y(n),d=(null===u||void 0===u?void 0:u.length)*h,c=e||{},a=c.callbackBlocks,s=c.conditionalBlocks,v=c.extensionBlocks,f=Math.max.apply(Math,(0,i.Z)([a,s,v].map((function(n){return S(n)})).concat(d)));return f>r&&(r=Math.min(x,f)),k+m+r}},21978:function(n,o,e){e.d(o,{Jo:function(){return l},WN:function(){return u},bJ:function(){return r},rl:function(){return i}});var i,t=e(44425),l=(e(70515).iI,1e4),r={height:10,width:10},u={height:6,width:6};t.tf.DATA_EXPORTER,t.tf.SENSOR,t.Lq.GREY,t.Lq.PINK,t.Lq.TEAL,t.Lq.YELLOW;!function(n){n.NORTH="NORTH",n.SOUTH="SOUTH"}(i||(i={}))},55187:function(n,o,e){e.d(o,{$4:function(){return v},dg:function(){return c},ki:function(){return a}});var i=e(75582),t=e(38626),l=e(44897),r=e(42631),u=e(47041),d=e(70515),c=2;function a(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.Z,o={};return[null===n||void 0===n?void 0:n.accent,null===n||void 0===n?void 0:n.content,null===n||void 0===n?void 0:n.monotone].forEach((function(n){Object.entries(n).forEach((function(n){var e=(0,i.Z)(n,2),t=e[0],l=e[1];o[l]=t}))})),o}var s=Object.entries(a()).reduce((function(n,o){var e=(0,i.Z)(o,2),t=e[0],l=e[1];return n.concat("\n .edge-rect-".concat(l," {\n rect {\n fill: ").concat(t,";\n }\n }\n\n .edge-line-").concat(l," {\n line {\n stroke: ").concat(t,";\n }\n }\n "))}),[]),v=t.default.div.withConfig({displayName:"indexstyle__GraphContainerStyle",componentId:"sc-bc2ei5-0"})(["position:relative;div{","}"," .edge{&.activeSlow{animation:dashdraw 2s linear infinite;stroke-dasharray:5;stroke-width:",";}&.active{animation:dashdraw .5s linear infinite;stroke-dasharray:5;stroke-width:",";}&.inactive{}&.selected-twice{stroke-dasharray:4 2 4 2 4 8;stroke-width:",";}&.selected-twice.group{stroke-dasharray:8 24;stroke-width:",";}}@keyframes dashdraw{0%{stroke-dashoffset:10;}}.edge-rect{rect{fill:none;}}.edge-line{line{stroke-width:","px;}}.edge-line-remove{line{","}}",""],u.w5,(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")}),c,c,c,c,d.iI/4,(function(n){return"\n stroke: ".concat((n.theme.accent||l.Z.accent).negative,";\n ")}),s.join("\n"));t.default.div.withConfig({displayName:"indexstyle__NodeStyle",componentId:"sc-bc2ei5-1"})(["border-radius:","px;border:1px solid transparent;min-width:fit-content;"," "," "," "," "," ",""],r.BG,(function(n){return n.selected&&"\n border-color: ".concat((n.theme.content||l.Z.content).active,";\n ")}),(function(n){return n.backgroundColor&&"\n background-color: ".concat(n.backgroundColor,";\n ")}),(function(n){return(n.isCancelled||n.disabled)&&"\n // opacity doesn\u2019t work on Safari\n border-color: ".concat((n.theme.content||l.Z.content).active,";\n border-style: dashed;\n cursor: not-allowed;\n ")}),(function(n){return n.isConditionFailed&&"\n background-color: ".concat((n.theme.content||l.Z.content).disabled,";\n cursor: not-allowed;\n ")}),(function(n){return n.disabled&&"\n &:hover {\n cursor: not-allowed;\n }\n "}),(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")})),t.default.div.withConfig({displayName:"indexstyle__RuntimeStyle",componentId:"sc-bc2ei5-2"})(["margin-right:","px;padding:12px 4px;height:100%;width:50px;background:rgba(0,0,0,0.2);background-blend-mode:soft-light;"],2*d.iI)},24138:function(n,o,e){e.d(o,{Xz:function(){return En},kS:function(){return Tn},NB:function(){return In},GR:function(){return _n},ZP:function(){return Zn}});var i=e(75582),t=e(21831),l=e(82394),r=e(26304),u=e(77837),d=e(38860),c=e.n(d),a=e(51774),s=e.n(a),v=e(38626),f=e(82684),p=e(69864),h=e(79757),b=e(44425),k=e(39867),g=e(97618),m=e(55485),x=e(38276),y=e(30160),C=e(72473),w=e(47001),O=e(99543),S=e(55283),j=e(21978),B=e(41143),E=e(70515),I=e(86735);var T=e(61709),_=e(81728);function Z(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function D(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?Z(Object(e),!0).forEach((function(o){(0,l.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Z(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var P=function(n){var o=n/1e3,e=4-Math.floor(o).toString().length,i=(0,_.QV)(o,e>=0?e:0),t="s";return i>1e3&&(i=(0,_.QV)(i/60,0),t="m"),"".concat(i).concat(t)};function A(n){return"parent\u2192".concat(n)}function R(n){return["parent"].concat((0,I.YC)(n,(function(n){return n}))).join("\u2192")}function N(n,o){return"".concat(o,"\u2192").concat(n)}function L(n,o){return{from:o,fromPort:"".concat(o,"\u2192").concat(n,":from"),id:N(n,o),to:n,toPort:"".concat(o,"\u2192").concat(n,":to")}}function M(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return[n,o,"from"].filter((function(n){return n})).join("\u2192")}function H(n,o,e){var i,t={},l=D(D({},j.WN),{},{disabled:!0});if(null!==e&&void 0!==e&&null!==(i=e.activeNodes)&&void 0!==i&&i[n]&&(l.height=0,l.width=0),(null===o||void 0===o?void 0:o.length)>=1)o.forEach((function(o){var e=M(n,o);t[e]=D(D({},l),{},{id:e,side:j.rl.SOUTH})}));else{var r=M(n);t[r]=D(D({},l),{},{id:r,side:j.rl.SOUTH})}return t}function U(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return[o,n,"to"].filter((function(n){return n})).join("\u2192")}function G(n,o,e){var i,t={},l=D(D({},j.WN),{},{disabled:!0});if(null!==e&&void 0!==e&&null!==(i=e.activeNodes)&&void 0!==i&&i[n]&&(l.height=0,l.width=0),(null===o||void 0===o?void 0:o.length)>=1)o.forEach((function(o){var e=U(n,o);t[e]=D(D({},l),{},{id:e,side:j.rl.NORTH})}));else{var r=U(n);t[r]=D(D({},l),{},{id:r,side:j.rl.NORTH})}return t}function W(n){var o,e=n.activeNodes,r=n.blockStatus,u=(n.blockUUIDMapping,n.blocks),d=n.callbackBlocksByBlockUUID,c=n.conditionalBlocksByBlockUUID,a=n.downstreamBlocksMapping,s=n.enablePorts,v=n.extensionBlocksByBlockUUID,f=n.nodeHovering,p=n.pipeline,h=n.selectedBlock,b=D({},e);f&&(b[null===f||void 0===f?void 0:f.id]=f);var k={},g={},m={},x=(0,I.HK)(u||[],(function(n){return n.uuid})),y={};null===u||void 0===u||u.forEach((function(n){var o;if((null===n||void 0===n||null===(o=n.upstream_blocks)||void 0===o?void 0:o.length)>=1){var e=(null===n||void 0===n?void 0:n.upstream_blocks)||[],i=(0,I.YC)(e,(function(n){return n})).join(",");i in y||(y[i]={downstreamBlocks:[],upstreamBlocks:null===e||void 0===e?void 0:e.reduce((function(n,o){var e=null===x||void 0===x?void 0:x[o];return e?n.concat(e):n}),[])}),y[i].downstreamBlocks.push(n)}}));var C={},w={};Object.values(y||{}).forEach((function(n){var o=n.downstreamBlocks,e=n.upstreamBlocks;if((null===o||void 0===o?void 0:o.length)>=2){var i={};null===o||void 0===o||o.forEach((function(n){var o=n.downstream_blocks;if((null===o||void 0===o?void 0:o.length)>=1){var e=(0,I.YC)(o||[],(function(n){return n})).join(",");e in i||(i[e]=0),i[e]+=1}}));var l=Object.values(i||{})||[],r=Math.max.apply(Math,(0,t.Z)(l));(null===l||void 0===l||!l.length||r>=2)&&(null===o||void 0===o||o.forEach((function(o){var e=null===o||void 0===o?void 0:o.uuid;e in C||(C[e]=[]),C[e].push(n)})),null===e||void 0===e||e.forEach((function(o){var e=null===o||void 0===o?void 0:o.uuid;e in w||(w[e]=[]),w[e].push(n)})))}})),null===u||void 0===u||u.forEach((function(n){n.tags;var o=n.upstream_blocks,e=void 0===o?[]:o,i=n.uuid,t=a[i];i in m||(m[i]={});var u=null===d||void 0===d?void 0:d[null===n||void 0===n?void 0:n.uuid],s=null===c||void 0===c?void 0:c[null===n||void 0===n?void 0:n.uuid],f=null===v||void 0===v?void 0:v[null===n||void 0===n?void 0:n.uuid];k[i]={data:{block:n},height:(0,O.p1)(n,p,{blockStatus:r,callbackBlocks:u,conditionalBlocks:s,extensionBlocks:f}),id:i,width:(0,O.HI)(n,p,{blockStatus:r,callbackBlocks:u,conditionalBlocks:s,extensionBlocks:f})};var h={height:null!==b&&void 0!==b&&b[i]?2*E.iI:0,width:null!==b&&void 0!==b&&b[i]?2*E.iI:0},x="".concat(i,"-upstream-add"),y=function(n){return"".concat(n,"-dowstream-add")}(i);if(m[i][x]=D(D({},h),{},{id:x,side:j.rl.NORTH}),m[i][y]=D(D({},h),{},{id:y,side:j.rl.SOUTH}),!(i in C)){(null===e||void 0===e?void 0:e.length)>=1&&(m[i]=D(D({},null===m||void 0===m?void 0:m[i]),G(i,e,{activeNodes:b})),null===e||void 0===e||e.forEach((function(n){var o=L(i,n);g[o.id]=o})));var S=(null===w||void 0===w?void 0:w[i])||[],B=null===S||void 0===S?void 0:S.reduce((function(n,o){var e;return D(D({},n),null===o||void 0===o||null===(e=o.downstreamBlocks)||void 0===e?void 0:e.reduce((function(n,o){return D(D({},n),{},(0,l.Z)({},null===o||void 0===o?void 0:o.uuid,o))}),{}))}),{});null===t||void 0===t||t.forEach((function(n){var o=n.uuid;o in B||(m[i]=D(D({},null===m||void 0===m?void 0:m[i]),H(i,[o],{activeNodes:b})))}))}}));var S={};null===(o=Object.entries(w||{}))||void 0===o||o.forEach((function(n){var o=(0,i.Z)(n,2),e=(o[0],o[1]);null===e||void 0===e||e.forEach((function(n){var o=n.downstreamBlocks,e=n.upstreamBlocks,i=R(null===e||void 0===e?void 0:e.reduce((function(n,o){return o&&null!==o&&void 0!==o&&o.uuid?n.concat(null===o||void 0===o?void 0:o.uuid):n}),[]));i in S||(S[i]={downstreamBlocks:o,upstreamBlocks:e})}))}));var B={};return Object.entries(S||{}).forEach((function(n){var o,e=(0,i.Z)(n,2),t=e[0],l=e[1],r=l.downstreamBlocks,u=l.upstreamBlocks,d={data:{block:null===u||void 0===u?void 0:u[0],blocks:u,children:r},id:t};k[t]=d;var c=function(n,o,e,t,l){(0,I.YC)((null===n||void 0===n?void 0:n.map((function(n){return n.uuid})))||[],(function(n){return n.uuid}));var r,u={};null===n||void 0===n||n.forEach((function(n){var e=n.uuid,i=null===o||void 0===o?void 0:o[e];null===i||void 0===i||i.forEach((function(o){o.downstreamBlocks;var e=o.upstreamBlocks,i=R((0,I.YC)((null===e||void 0===e?void 0:e.map((function(n){return n.uuid})))||[],(function(n){return n.uuid})));i in u||(u[i]=[]),u[i].push(n)}))}));var d={};if(Object.entries(u||{}).forEach((function(n){var o=(0,i.Z)(n,2),l=(o[0],o[1]),r=null===l||void 0===l?void 0:l.filter((function(n){var o=n.uuid;return null===e||void 0===e?void 0:e[o]})),u=R(null===r||void 0===r?void 0:r.map((function(n){return n.uuid})));if(u in t){var c=null===t||void 0===t?void 0:t[u];d[u]=c}})),(null===(r=Object.keys(d))||void 0===r?void 0:r.length)>=1)return d}(r,C,w,S);c&&(B[t]=c);var a=null===(o=Object.values(c||{}))||void 0===o?void 0:o.reduce((function(n,o){var e=o.upstreamBlocks;return n.concat(null===e||void 0===e?void 0:e.map((function(n){return n.uuid})))}),[]);null===r||void 0===r||r.forEach((function(n){var o=n.uuid;null!==a&&void 0!==a&&a.includes(o)||!(o in k)||(k[o].parent=t)})),null===u||void 0===u||u.forEach((function(n){var o=null===n||void 0===n?void 0:n.uuid;null===r||void 0===r||r.forEach((function(n){var e=n.uuid;if((null===h||void 0===h?void 0:h.uuid)===o||(null===h||void 0===h?void 0:h.uuid)===e){var i=L(e,o);g[i.id]=i,m[o]=D(D({},null===m||void 0===m?void 0:m[o]),H(o,[e],{activeNodes:b})),m[e]=D(D({},null===m||void 0===m?void 0:m[e]),G(e,[o],{activeNodes:b}))}}));var e=L(t,o);g[e.id]=e,m[o]=D(D({},null===m||void 0===m?void 0:m[o]),H(o,[t],{activeNodes:b})),m[t]=D(D({},null===m||void 0===m?void 0:m[t]),G(t,[o],{activeNodes:b}))}))})),Object.entries(B||{}).forEach((function(n){var o=(0,i.Z)(n,2),e=o[0],t=o[1];Object.entries(t||{}).forEach((function(n){var o=(0,i.Z)(n,2),t=o[0],l=o[1],r=l.downstreamBlocks,u=l.upstreamBlocks,d=R([e,t]),c={data:{block:null===u||void 0===u?void 0:u[0],blocks:u,children:r},id:d,parent:e};k[d]=c,null===u||void 0===u||u.forEach((function(n){var o=n.uuid;o in k&&(k[o].parent=d);var e=N(t,o);if(e in g&&delete g[e],o in m){var i=M(o,t);i in(null===m||void 0===m?void 0:m[o])&&delete m[o][i]}if(t in m){var l=U(t,o);l in(null===m||void 0===m?void 0:m[t])&&delete m[t][l]}}));var a=L(t,d);g[a.id]=a,m[d]=D(D({},null===m||void 0===m?void 0:m[d]),H(d,[t],{activeNodes:b})),m[t]=D(D({},null===m||void 0===m?void 0:m[t]),G(t,[d],{activeNodes:b}))}))})),s&&Object.entries(m).forEach((function(n){var o=(0,i.Z)(n,2),e=o[0],t=o[1],l=null===k||void 0===k?void 0:k[e];l&&(l.ports=Object.values(t))})),{blocksWithDownstreamBlockSet:w,edges:Object.values(g||{}),nodes:Object.values(k||{}),ports:m}}function F(n){var o=n.block,e=n.blockStatus,i=n.messages,t=n.noStatus,l=n.runningBlocks,r=n.runningBlocksMapping;if(t||!o)return{};if(e){var u=(null===e||void 0===e?void 0:e[function(n){var o=n.uuid,e=n.replicated_block;return e?"".concat(o,":").concat(e):o}(o)])||{},d=u.status,c=u.runtime;return{hasFailed:B.V.FAILED===d,isCancelled:B.V.CANCELLED===d,isConditionFailed:B.V.CONDITION_FAILED===d,isInProgress:B.V.RUNNING===d,isQueued:B.V.INITIAL===d,isSuccessful:B.V.COMPLETED===d,runtime:c}}var a,s=(0,T.h5)((null===i||void 0===i?void 0:i[null===o||void 0===o?void 0:o.uuid])||[]),v=(0,T.oI)(s),f=v.hasError,p=v.hasOutput,h=!(null===r||void 0===r||!r[null===o||void 0===o?void 0:o.uuid]);return{hasFailed:!h&&(f||b.DA.FAILED===o.status),isInProgress:h,isQueued:h&&(null===(a=l[0])||void 0===a?void 0:a.uuid)!==o.uuid,isSuccessful:!h&&(!f&&p||b.DA.EXECUTED===o.status)}}var V,Y=e(28598);function X(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function q(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?X(Object(e),!0).forEach((function(o){(0,l.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):X(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var K=(V={},(0,l.Z)(V,b.tf.DATA_EXPORTER,C.zS),(0,l.Z)(V,b.tf.DATA_LOADER,C.rH),(0,l.Z)(V,b.tf.DBT,C.xE),(0,l.Z)(V,b.tf.GLOBAL_DATA_PRODUCT,C.ie),(0,l.Z)(V,b.tf.SENSOR,C.LM),(0,l.Z)(V,b.tf.TRANSFORMER,C.Sv),V);var z=function(n){var o=n.anotherBlockSelected,e=n.block,i=n.blocksWithSameDownstreamBlocks,r=n.callbackBlocks,u=n.children,d=n.conditionalBlocks,c=n.disabled,a=n.downstreamBlocks,s=n.extensionBlocks,p=n.hasFailed,j=n.height,B=n.hideNoStatus,E=n.hideStatus,T=n.isCancelled,_=n.isConditionFailed,Z=n.isDragging,D=n.isInProgress,A=n.isQueued,R=n.isSuccessful,N=n.opacity,L=n.pipeline,M=n.runtime,H=n.selected,U=n.selectedBlock,G=(0,f.useContext)(v.ThemeContext),W=!(D||A||p||R||T||_),F=p&&!(D||A),V=!F&&R&&!(D||A),X="";W?X="No status":V?X="Successful execution":F?X="Failed execution":D?X="Currently executiing":T&&(X="Cancelled execution");var z=e.color,Q=e.runtime,J=e.type,$=(0,S.qn)(J,{blockColor:z,theme:G}),nn=$.accent,on=$.accentLight,en=(0,f.useMemo)((function(){return(0,O.rQ)(e)}),[e]),tn=(0,f.useMemo)((function(){var n,o,e=K[J]||C.EJ,i=!1;return[b.tf.CALLBACK,b.tf.CHART,b.tf.CONDITIONAL,b.tf.CUSTOM,b.tf.DATA_EXPORTER,b.tf.DATA_LOADER,b.tf.EXTENSION,b.tf.SCRATCHPAD,b.tf.SENSOR,b.tf.MARKDOWN,b.tf.TRANSFORMER].includes(J)?n=nn:[b.tf.DBT].includes(J)&&(o=nn),[b.tf.DATA_EXPORTER].includes(J)&&(i=!0),(0,Y.jsx)(w.ze,{backgroundColor:n,borderColor:o,children:(0,Y.jsx)("div",{style:{height:w.ZG,width:w.ZG},children:(0,Y.jsx)(e,{inverted:i,size:w.ZG})})})}),[nn,J]),ln=(0,f.useMemo)((function(){var n=[],e=[];if(A)(0,I.w6)(4).forEach((function(){var o,i;n.push(null===G||void 0===G||null===(o=G.content)||void 0===o?void 0:o.muted),e.push(null===G||void 0===G||null===(i=G.content)||void 0===i?void 0:i.muted)}));else if((null===i||void 0===i?void 0:i.length)>=2&&(null===a||void 0===a?void 0:a.length)>=1){var r,u=[];null!==i&&void 0!==i&&i.find((function(n){var o=n.uuid;return(null===U||void 0===U?void 0:U.uuid)===o}))?u.push(U):u.push.apply(u,(0,t.Z)(i)),null===u||void 0===u||null===(r=u.slice(0,4))||void 0===r||r.forEach((function(o){var i=(0,S.qn)(null===o||void 0===o?void 0:o.type,{blockColor:null===o||void 0===o?void 0:o.color,theme:G}),t=i.accent,l=i.accentLight;n.push(l),e.push(t)}))}else n.push.apply(n,[on,on,on,on]),e.push.apply(e,[nn,nn,nn,nn]);if((null===n||void 0===n?void 0:n.length)<4)for(var d=0,c=(null===n||void 0===n?void 0:n.length)||0;(null===n||void 0===n?void 0:n.length)<4;)n.push(null===n||void 0===n?void 0:n[d]),(d+=1)===c&&(d=0);if((null===e||void 0===e?void 0:e.length)<4)for(var s=0,v=(null===e||void 0===e?void 0:e.length)||0;(null===e||void 0===e?void 0:e.length)<4;)e.push(null===e||void 0===e?void 0:e[s]),(s+=1)===v&&(s=0);return["borderColorBottom","borderColorLeft","borderColorRight","borderColorTop"].reduce((function(i,t,r){return q(q({},i),{},(0,l.Z)({},t,!H&&o?null===n||void 0===n?void 0:n[r]:null===e||void 0===e?void 0:e[r]))}),{})}),[nn,on,o,i,a,A,H,U,G]),rn=ln.borderColorBottom,un=ln.borderColorLeft,dn=ln.borderColorRight,cn=ln.borderColorTop;return(0,Y.jsx)(w.Gi,{active:D,activeSlow:A,backgroundGradient:!(null!==a&&void 0!==a&&a.length)&&(0,S.u2)(J),borderColorBottom:rn,borderColorLeft:un,borderColorRight:dn,borderColorTop:cn,borderDeemphasized:(null===a||void 0===a?void 0:a.length)>=1,borderRadiusLarge:(null===a||void 0===a?void 0:a.length)>=1,disabled:c,height:j,isCancelled:T,isDragging:Z,noBackground:(null===a||void 0===a?void 0:a.length)>=1,opacity:N,selected:H,children:(0,Y.jsxs)(w.RJ,{disabled:c,height:j-2*w.YF,isConditionFailed:_,noBackground:(null===a||void 0===a?void 0:a.length)>=1,children:[!(null!==a&&void 0!==a&&a.length)&&(0,Y.jsx)(w.I5,{children:(0,Y.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,Y.jsxs)(g.Z,{flex:1,children:[tn,(0,Y.jsx)(x.Z,{mr:O.DS}),(0,Y.jsxs)(g.Z,{flexDirection:"column",children:[(0,Y.jsx)(y.ZP,{bold:!0,monospace:!0,children:(0,O._7)(e,L)}),(0,Y.jsx)(y.ZP,{default:!0,monospace:!0,small:!0,children:(0,O.qj)(e,L)})]})]}),(0,Y.jsx)(x.Z,{mr:"15px"}),(0,Y.jsx)(w.Pq,{title:X,children:!E&&(0,Y.jsxs)(Y.Fragment,{children:[V&&(0,Y.jsx)(C.Jr,{size:O.SX,success:!0}),F&&(0,Y.jsx)(C.x8,{danger:!0,size:O.SX}),W&&!B&&(0,Y.jsx)(k.Z,{borderSize:1,muted:!0,size:O.SX})]})})]})}),(0,Y.jsxs)(w.Go,{children:[!(null!==a&&void 0!==a&&a.length)&&(0,Y.jsxs)(Y.Fragment,{children:[(null===en||void 0===en?void 0:en.length)>=1&&(0,Y.jsx)(x.Z,{mt:1,children:(0,Y.jsx)(y.ZP,{default:!0,monospace:!0,small:!0,children:en})}),[d,r,s].map((function(n,o){if((null===n||void 0===n?void 0:n.length)>=1)return(0,Y.jsx)("div",{style:{marginTop:4},children:(0,Y.jsx)(m.ZP,{alignItems:"center",flexWrap:"wrap",children:n.reduce((function(n,o,e){return e>=1&&n.push((0,Y.jsx)("div",{style:{width:4}},"space-".concat(o.uuid))),n.push((0,Y.jsx)("div",{style:{marginTop:4},children:(0,Y.jsx)(h.Z,{color:(0,S.qn)(o.type,{blockColor:o.color,theme:G}).accentLight,monospace:!0,small:!0,children:o.uuid})},"badge-".concat(o.uuid))),n}),[])})},"badge-blocks-".concat(o))})),(Q||M)&&(0,Y.jsx)(x.Z,{mt:1,children:(0,Y.jsx)(y.ZP,{monospace:!0,muted:!0,small:!0,children:P(Q||M)})})]}),u]})]})})},Q=e(50724),J=e(15338),$=e(93369),nn=e(48670),on=e(65956),en=e(57653),tn=e(71180),ln=e(12468),rn=e(42631),un=e(72191),dn=e(44897),cn=v.default.div.withConfig({displayName:"indexstyle__ZoomControlsStyle",componentId:"sc-1usy46j-0"})(["position:absolute;bottom:","px;left:50%;transform:translateX(-50%);display:flex;justify-content:center;background-color:",";border:1px solid ",";border-radius:","px;box-shadow:",";"],3*E.iI,(function(n){return(n.theme.background||dn.Z.background).panel}),(function(n){return(n.theme.borders||dn.Z.borders).darkLight}),rn.g5,(function(n){return(n.theme.shadow||dn.Z.shadow).frame})),an=v.default.div.withConfig({displayName:"indexstyle__ZoomDisplayStyle",componentId:"sc-1usy46j-1"})(["padding:","px ","px ","px ","px;border-radius:0 ","px ","px 0;cursor:default;",""],1.5*E.iI,3.25*E.iI,1.5*E.iI,1.875*E.iI,rn.g5,rn.g5,(function(n){return n.minimizeControls&&"\n padding: ".concat(1.5*E.iI,"px ").concat(1.875*E.iI,"px;\n border-radius: ").concat(rn.g5,"px;\n ")}));function sn(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function vn(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?sn(Object(e),!0).forEach((function(o){(0,l.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):sn(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var fn=35*E.iI,pn={bottomOffset:6.5*E.iI,size:null,widthFitContent:!0},hn={highlightOnHoverAlt:!0,iconOnly:!0,noBorder:!0,padding:"".concat(1.5*E.iI,"px ").concat(1.875*E.iI,"px"),transparent:!0},bn={size:un._k};function kn(n){var o=n.canvasRef,e=n.containerRef,i=n.zoomLevel,t=(0,f.useState)(!1),l=t[0],r=t[1];return(0,f.useEffect)((function(){if(null!==e&&void 0!==e&&e.current){var n=new ResizeObserver((function(){var n=e.current.offsetWidth;r(n<fn)}));return n.observe(e.current),function(){return n.disconnect()}}}),[e]),(0,Y.jsxs)(cn,{onDoubleClick:function(n){n.stopPropagation()},children:[!l&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ln.Z,vn(vn({},pn),{},{label:"Reset (shortcut: double-click canvas)",children:(0,Y.jsx)(tn.ZP,vn(vn({},hn),{},{borderRadius:"".concat(rn.g5,"px 0 0 ").concat(rn.g5,"px"),onClick:function(){var n,e;return null===o||void 0===o||null===(n=o.current)||void 0===n||null===(e=n.fitCanvas)||void 0===e?void 0:e.call(n)},padding:"".concat(1.5*E.iI,"px ").concat(1.875*E.iI,"px ").concat(1.5*E.iI,"px ").concat(3.25*E.iI,"px"),children:(0,Y.jsx)(C.Qc,vn({},bn))}))})),(0,Y.jsx)(ln.Z,vn(vn({},pn),{},{label:"Zoom in",children:(0,Y.jsx)(tn.ZP,vn(vn({},hn),{},{onClick:function(){var n,e;return null===o||void 0===o||null===(n=o.current)||void 0===n||null===(e=n.setZoom)||void 0===e?void 0:e.call(n,i-1+.5)},children:(0,Y.jsx)(C.DY,vn({},bn))}))})),(0,Y.jsx)(ln.Z,vn(vn({},pn),{},{label:"Zoom out",children:(0,Y.jsx)(tn.ZP,vn(vn({},hn),{},{onClick:function(){var n,e;return null===o||void 0===o||null===(n=o.current)||void 0===n||null===(e=n.setZoom)||void 0===e?void 0:e.call(n,i-1-.5)},children:(0,Y.jsx)(C.H9,vn({},bn))}))}))]}),(0,Y.jsx)(ln.Z,vn(vn({},pn),{},{label:"Zoom level",children:(0,Y.jsx)(an,{minimizeControls:l,children:(0,Y.jsx)(y.ZP,{center:!0,large:!0,minWidth:5*E.iI,children:"".concat(Math.round(100*i),"%")})})}))]})}var gn=(0,f.memo)(kn),mn=e(35686),xn=e(77417),yn=e(55187),Cn=e(85385),wn=e(72619),On=e(3314),Sn=["forwardedRef"];function jn(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function Bn(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?jn(Object(e),!0).forEach((function(o){(0,l.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):jn(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var En=s()((0,u.Z)(c().mark((function n(){var o,i;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,i=o.Canvas,n.abrupt("return",(function(n){var o=n.forwardedRef,e=(0,r.Z)(n,Sn);return(0,Y.jsx)(i,Bn({ref:o},e))}));case 5:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),In=s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Node);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),Tn=s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Edge);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),_n=s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Port);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}});s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Add);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.Remove);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}}),s()((0,u.Z)(c().mark((function n(){var o;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all([e.e(4434),e.e(5987),e.e(2920)]).then(e.t.bind(e,74529,23));case 2:return o=n.sent,n.abrupt("return",o.MarkerArrow);case 4:case"end":return n.stop()}}),n)}))),{ssr:!1,loadableGenerated:{webpack:function(){return[74529]}}});var Zn=function(n){var o=n.addNewBlockAtIndex,e=n.blockRefs,r=n.blockStatus,u=n.blocksOverride,d=n.blocks,c=n.contentByBlockUUID,a=n.contextMenuEnabled,s=n.deleteBlock,h=n.disabled,k=n.dragEnabled,g=n.editingBlock,C=n.enablePorts,w=void 0!==C&&C,B=n.fetchPipeline,T=n.height,_=n.heightOffset,Z=void 0===_?10*E.iI:_,D=n.messages,P=n.noStatus,N=n.onClickNode,L=n.runBlock,H=n.pannable,U=void 0===H||H,G=n.pipeline,V=n.runningBlocks,X=void 0===V?[]:V,q=n.selectedBlock,K=n.setActiveSidekickView,tn=n.setEditingBlock,ln=n.setErrors,rn=n.setSelectedBlock,un=n.setZoom,dn=n.showDynamicBlocks,cn=void 0!==dn&&dn,an=n.showUpdateBlockModal,sn=n.treeRef,vn=n.zoomable,fn=void 0===vn||vn,pn=(0,xn.Z)(),hn=pn.featureEnabled,bn=pn.featureUUIDs,kn=(0,f.useContext)(v.ThemeContext),Sn=((0,f.useMemo)((function(){return(0,yn.ki)(kn)}),[kn]),(0,f.useRef)(null)),jn=((0,f.useRef)({}),(0,f.useRef)({})),Zn=(0,f.useRef)({}),Dn=(0,f.useRef)(null),Pn=sn||Dn,An=(0,f.useState)(1),Rn=An[0],Nn=An[1],Ln=(0,f.useState)(null),Mn=Ln[0],Hn=Ln[1],Un=(0,f.useState)({}),Gn=Un[0],Wn=Un[1],Fn=(0,f.useState)({}),Vn=Fn[0],Yn=Fn[1],Xn=(0,f.useState)(null),qn=Xn[0],Kn=Xn[1],zn=(0,f.useState)(!1),Qn=zn[0],Jn=zn[1],$n=(0,f.useState)(null),no=$n[0],oo=$n[1],eo=(0,f.useState)(null),io=eo[0],to=eo[1],lo=(0,f.useState)(null),ro=lo[0],uo=lo[1];(0,f.useEffect)((function(){var n=function(n){Qn&&no&&oo((function(o){return Bn(Bn({},o),{},{event:n})}))},o=function(n){Qn&&no&&(Jn(!1),setTimeout((function(){return oo(null)}),1))};return window.addEventListener("mousemove",n),window.addEventListener("mouseup",o),function(){window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",o)}}),[Qn,no]);var co=(0,f.useState)(null),ao=co[0],so=co[1],vo=(0,f.useState)([]),fo=vo[0],po=vo[1],ho=(0,f.useState)(!1),bo=(ho[0],ho[1],(null===g||void 0===g?void 0:g.upstreamBlocks)||{}),ko=bo.block,go=bo.values,mo=void 0===go?[]:go,xo=(0,f.useMemo)((function(){return mo.length}),[mo]),yo=(0,f.useMemo)((function(){var n;return(null===(n=u||(null===G||void 0===G?void 0:G.blocks))||void 0===n?void 0:n.filter((function(n){var o=n.type;return!b.iZ.includes(o)})))||[]}),[u,null===G||void 0===G?void 0:G.blocks]),Co=(0,f.useMemo)((function(){return yo}),[yo,cn]),wo=(0,f.useMemo)((function(){if(u)return u;if(d)return d;if(G){var n={},o=[];return o.push.apply(o,(0,t.Z)(null===G||void 0===G?void 0:G.blocks)),o.push.apply(o,(0,t.Z)(null===G||void 0===G?void 0:G.callbacks)),o.push.apply(o,(0,t.Z)(null===G||void 0===G?void 0:G.conditionals)),Object.values(null===G||void 0===G?void 0:G.extensions).forEach((function(n){var e=n.blocks;o.push.apply(o,(0,t.Z)(e))})),o.reduce((function(o,e){return n[e.uuid]||o.push(e),o}),[])}return[]}),[d,u,G]),Oo=(0,f.useMemo)((function(){return(0,I.HK)(wo||[],(function(n){return n.uuid}))}),[wo]),So=(0,f.useMemo)((function(){var n={};return null===Co||void 0===Co||Co.map((function(o){var e;n[o.uuid]=null===o||void 0===o||null===(e=o.callback_blocks)||void 0===e?void 0:e.reduce((function(n,o){var e=null===Oo||void 0===Oo?void 0:Oo[o];return e?n.concat(e):n}),[])})),n}),[Co,Oo]),jo=(0,f.useMemo)((function(){var n={};return null===Co||void 0===Co||Co.map((function(o){var e;n[o.uuid]=null===o||void 0===o||null===(e=o.conditional_blocks)||void 0===e?void 0:e.reduce((function(n,o){var e=null===Oo||void 0===Oo?void 0:Oo[o];return e?n.concat(e):n}),[])})),n}),[Co,Oo]),Bo=(0,f.useMemo)((function(){var n={};return null===Co||void 0===Co||Co.map((function(o){var e,t=[];null===(e=Object.entries((null===G||void 0===G?void 0:G.extensions)||{}))||void 0===e||e.forEach((function(n){var e=(0,i.Z)(n,2),l=e[0],r=e[1].blocks;null===r||void 0===r||r.forEach((function(n){var e=n.upstream_blocks,i=n.uuid;if(null!==e&&void 0!==e&&e.includes(null===o||void 0===o?void 0:o.uuid)){var r=null===Oo||void 0===Oo?void 0:Oo[i];r&&t.push(Bn(Bn({},r),{},{extension_uuid:l}))}}))})),n[o.uuid]=t})),n}),[Co,Oo,G]),Eo=(0,f.useMemo)((function(){return(0,I.HK)(X,(function(n){return n.uuid}))}),[X]);(0,f.useEffect)((function(){setTimeout((function(){var n,o,e,i,t;0===(null===Pn||void 0===Pn||null===(n=Pn.current)||void 0===n||null===(o=n.containerRef)||void 0===o||null===(e=o.current)||void 0===e?void 0:e.scrollTop)&&(null===Pn||void 0===Pn||null===(i=Pn.current)||void 0===i||null===(t=i.fitCanvas)||void 0===t||t.call(i))}),1e3)}),[Pn]);var Io=(0,p.Db)(mn.ZP.blocks.pipelines.useUpdate(null===G||void 0===G?void 0:G.uuid,encodeURIComponent(null===ko||void 0===ko?void 0:ko.uuid)),{onSuccess:function(n){return(0,wn.wD)(n,{callback:function(){tn({upstreamBlocks:null}),null===B||void 0===B||B()},onErrorCallback:function(n,o){return null===ln||void 0===ln?void 0:ln({errors:o,response:n})}})}}),To=(0,i.Z)(Io,2),_o=To[0],Zo=To[1].isLoading,Do=(0,p.Db)((function(n){var o=n.block,e=n.downstreamBlocks,i=n.upstreamBlocks,t=Bn({},o);return"undefined"!==typeof e&&(t.downstream_blocks=e),"undefined"!==typeof i&&(t.upstream_blocks=i),mn.ZP.blocks.pipelines.useUpdate(null===G||void 0===G?void 0:G.uuid,encodeURIComponent(null===o||void 0===o?void 0:o.uuid))({block:t})}),{onSuccess:function(n){return(0,wn.wD)(n,{callback:function(){null===B||void 0===B||B()},onErrorCallback:function(n,o){return null===ln||void 0===ln?void 0:ln({errors:o,response:n})}})}}),Po=(0,i.Z)(Do,1)[0],Ao=(0,f.useCallback)((function(n){var o=n.type,i=n.uuid;if(null===rn||void 0===rn||rn(n),po([]),null!==e&&void 0!==e&&e.current){var t,l=e.current["".concat(o,"s/").concat(i,".py")];null===l||void 0===l||null===(t=l.current)||void 0===t||t.scrollIntoView()}}),[e,rn]),Ro=(0,f.useCallback)((function(n){po([]),tn((function(o){var e=o.upstreamBlocks.values||[],i=e.findIndex((function(o){var e=o.uuid;return n.uuid===e}));return Bn(Bn({},o),{},{upstreamBlocks:Bn(Bn({},o.upstreamBlocks),{},{values:i>=0?(0,I.oM)(e,i):e.concat(n)})})}))}),[tn]),No=(0,f.useMemo)((function(){var n={};return Co.forEach((function(o){o.upstream_blocks.forEach((function(e){n[e]||(n[e]=[]),n[e].push(o)}))})),n}),[Co]),Lo=(0,f.useMemo)((function(){return W({activeNodes:Gn,blockStatus:r,blockUUIDMapping:Oo,blocks:Co,callbackBlocksByBlockUUID:So,conditionalBlocksByBlockUUID:jo,downstreamBlocksMapping:No,enablePorts:w,extensionBlocksByBlockUUID:Bo,nodeHovering:io,pipeline:G,selectedBlock:ao})}),[Gn,r,Oo,Co,So,jo,No,w,Bo,io,G,ao]),Mo=Lo.edges,Ho=Lo.nodes,Uo=(Lo.ports,Lo.blocksWithDownstreamBlockSet),Go=(0,f.useMemo)((function(){var n=0;return T&&(n+=T),Z&&(n-=Z),Math.max(0,n)}),[T,Z]),Wo=(0,f.useCallback)((function(n,o){(0,On.j)(n);var e,i,t,l,r,u=o.data,d=u.block,c=u.blocks,a=d;if((null===c||void 0===c?void 0:c.length)>=2&&q){var s=null===c||void 0===c?void 0:c.findIndex((function(n){var o=n.uuid;return(null===q||void 0===q?void 0:q.uuid)===o}));a=s<(null===c||void 0===c?void 0:c.length)-1?null===c||void 0===c?void 0:c[s+1]:null===c||void 0===c?void 0:c[0]}if(!((null===ko||void 0===ko?void 0:ko.uuid)===a.uuid))if(ko)Ro(a);else if(null===N||void 0===N||N({block:a}),q&&(null===q||void 0===q?void 0:q.uuid)===(null===(e=a)||void 0===e?void 0:e.uuid)&&(((null===(i=a)||void 0===i||null===(t=i.downstream_blocks)||void 0===t?void 0:t.length)||0)<=1&&(null===(l=a)||void 0===l||null===(r=l.upstream_blocks)||void 0===r||!r.length)||ao&&(null===ao||void 0===ao?void 0:ao.uuid)===(null===q||void 0===q?void 0:q.uuid)))null===rn||void 0===rn||rn(null),so(null);else{var v;if(q)(null===q||void 0===q?void 0:q.uuid)===(null===(v=a)||void 0===v?void 0:v.uuid)?so(a):so(null);setTimeout((function(){Ao(a)}),1)}}),[ko,Ao,N,Ro,q,ao,so]),Fo=(0,f.useCallback)((function(n){var o,e=null===n||void 0===n?void 0:n.id;e in jn.current&&clearTimeout(null===jn||void 0===jn||null===(o=jn.current)||void 0===o?void 0:o[e])}),[Gn]),Vo=(0,f.useCallback)((function(n){var o=null===n||void 0===n?void 0:n.id;jn.current[o]=setTimeout((function(){Wn((function(n){var e=Bn({},n);return null===e||void 0===e||delete e[o],e}))}),1e3)}),[Wn]),Yo=(0,f.useCallback)((function(n,o,e){var i;if((0,On.j)(n),!Qn&&no){var t,r,u,d,c,a,s,v,f,p=null===o||void 0===o||null===(t=o.data)||void 0===t?void 0:t.block,h=null===no||void 0===no||null===(r=no.node)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.block;if(!((null===G||void 0===G?void 0:G.type)===en.qL.INTEGRATION&&((null===p||void 0===p?void 0:p.type)===b.tf.DATA_EXPORTER||(null===p||void 0===p?void 0:p.type)===b.tf.DATA_LOADER&&(null===h||void 0===h?void 0:h.type)===b.tf.DATA_EXPORTER))&&(null===p||void 0===p||null===(d=p.upstream_blocks)||void 0===d||!d.includes(null===h||void 0===h?void 0:h.uuid))&&(null===p||void 0===p?void 0:p.uuid)!==(null===h||void 0===h?void 0:h.uuid))if((null===o||void 0===o||null===(c=o.data)||void 0===c||null===(a=c.children)||void 0===a?void 0:a.length)>=1){var k,m=null===p||void 0===p||null===(k=p.downstream_blocks)||void 0===k?void 0:k.filter((function(n){var o;return!(null!==h&&void 0!==h&&null!==(o=h.upstream_blocks)&&void 0!==o&&o.includes(n))}));Po({block:h,upstreamBlocks:m})}else if((null===no||void 0===no||null===(s=no.node)||void 0===s||null===(v=s.data)||void 0===v||null===(f=v.children)||void 0===f?void 0:f.length)>=1){var x,y=null===h||void 0===h||null===(x=h.downstream_blocks)||void 0===x?void 0:x.filter((function(n){var o;return!(null!==p&&void 0!==p&&null!==(o=p.downstream_blocks)&&void 0!==o&&o.includes(n))}));Po({block:p,downstreamBlocks:y})}else Po({block:h,upstreamBlocks:((null===h||void 0===h?void 0:h.upstream_blocks)||[]).concat(null===p||void 0===p?void 0:p.uuid)})}if(null===g||void 0===g||!g.upstreamBlocks){Fo(o),to(o);var C=null===o||void 0===o?void 0:o.id;null===(i=Object.keys(Vn||{}))||void 0===i||!i.length||C in Vn?Wn((function(n){return Object.values(n||{}).forEach((function(n){Vo(n)})),Bn(Bn({},n),{},(0,l.Z)({},C,o))})):uo(o)}}),[Vn,Fo,g,Qn,no,G,Wn,to,uo,Vo]),Xo=(0,f.useCallback)((function(n,o,e){(0,On.j)(n),to(null),Vo(o)}),[to,Vo]),qo=(0,f.useCallback)((function(n,o,e){if((0,On.j)(n),!qn){var i=null===o||void 0===o?void 0:o.id;Zn.current[i]=setTimeout((function(){qn||(Hn(null),Wn({}),Jn(!0),oo({data:e,event:n,node:o}))}),500)}}),[qn,Wn,Hn,Jn,oo]),Ko=(0,f.useCallback)((function(n,o,e){(0,On.j)(n);var i,t=null===o||void 0===o?void 0:o.id;t in Zn.current&&clearTimeout(null===Zn||void 0===Zn||null===(i=Zn.current)||void 0===i?void 0:i[t])}),[]),zo=(0,f.useCallback)((function(n,o,e){var i;(0,On.j)(n);var t=null===o||void 0===o?void 0:o.id;clearTimeout(null===(i=Zn.current)||void 0===i?void 0:i[t]),Kn({data:e,event:n,node:o}),Hn(null)}),[Hn,Kn]),Qo=(0,f.useCallback)((function(n){var o=n.event,e=n.node;n.port;(0,On.j)(o),Fo(e),to(e)}),[Fo,to]),Jo=(0,f.useCallback)((function(n){var o=n.event,e=n.node;n.port;(0,On.j)(o),to(null),Vo(e)}),[to,Vo]),$o=(0,f.useCallback)((function(n){var o=n.event,e=n.node,i=n.port;Yn((function(n){return Bn(Bn({},n),{},(0,l.Z)({},null===e||void 0===e?void 0:e.id,{event:o,node:e,port:i}))}))}),[Yn]),ne=(0,f.useCallback)((function(n){n.event;var o=n.node,e=n.port,i=null===o||void 0===o?void 0:o.id;null===e||void 0===e||e.side;if(ro){var t,l,r,u,d=null===o||void 0===o||null===(t=o.properties)||void 0===t||null===(l=t.data)||void 0===l?void 0:l.block,c=null===ro||void 0===ro||null===(r=ro.data)||void 0===r?void 0:r.block;if(!((null===G||void 0===G?void 0:G.type)===en.qL.INTEGRATION&&((null===d||void 0===d?void 0:d.type)===b.tf.DATA_EXPORTER||(null===d||void 0===d?void 0:d.type)===b.tf.DATA_LOADER&&(null===c||void 0===c?void 0:c.type)===b.tf.DATA_EXPORTER))&&(null===d||void 0===d||null===(u=d.upstream_blocks)||void 0===u||!u.includes(c.uuid))&&(null===o||void 0===o?void 0:o.id)!==(null===ro||void 0===ro?void 0:ro.id)){var a={};j.rl.SOUTH===(null===e||void 0===e?void 0:e.side)?a.upstreamBlocks=((null===c||void 0===c?void 0:c.upstream_blocks)||[]).concat(null===d||void 0===d?void 0:d.uuid):a.downstreamBlocks=((null===c||void 0===c?void 0:c.downstream_blocks)||[]).concat(null===d||void 0===d?void 0:d.uuid),Po(Bn({block:c},a))}}Yn((function(n){var o=Bn({},n);return null===o||void 0===o||delete o[i],o})),Vo(o)}),[G,Yn,Vo,ro]),oe=(0,f.useCallback)((function(n,o,e){var i,t;if(no)return{anotherBlockSelected:!0,selected:!1};var l=(null===(i=Object.values(Vn||{}))||void 0===i?void 0:i.length)>=1,r=null===Vn||void 0===Vn?void 0:Vn[null===n||void 0===n?void 0:n.id],u=!1;if(ko)u=!!(0,I.sE)(mo,(function(n){return n.uuid===(null===o||void 0===o?void 0:o.uuid)}));else if(l)u=!!r;else if((null===e||void 0===e||null===(t=e.blocksWithSameDownstreamBlocks)||void 0===t?void 0:t.length)>=2){var d,c;u=null===e||void 0===e||null===(d=e.blocksWithSameDownstreamBlocks)||void 0===d||null===(c=d.map((function(n){return n.uuid})))||void 0===c?void 0:c.includes(null===q||void 0===q?void 0:q.uuid)}else u=(null===q||void 0===q?void 0:q.uuid)===(null===o||void 0===o?void 0:o.uuid);return{anotherBlockSelected:l?!r:!!q,selected:u}}),[Vn,ko,no,q,mo]),ee=(0,f.useCallback)((function(n,o,e){var i,t=e.isDragging,l=e.nodeHeight,u=e.nodeWidth,d=e.opacity,c=n.data,a=c.blocks,s=c.children;if((null===s||void 0===s?void 0:s.length)>=1){var v=[];null===s||void 0===s||s.forEach((function(o){var e=oe(n,o),i=e.anotherBlockSelected,l=e.selected,u=F({block:o,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}),c=u.hasFailed,a=u.isInProgress,s=u.isQueued,f=u.isSuccessful,p=null===So||void 0===So?void 0:So[null===o||void 0===o?void 0:o.uuid],b=null===jo||void 0===jo?void 0:jo[null===o||void 0===o?void 0:o.uuid],k=null===Bo||void 0===Bo?void 0:Bo[null===o||void 0===o?void 0:o.uuid];v.push((0,Y.jsx)(z,{anotherBlockSelected:i,block:o,callbackBlocks:null===So||void 0===So?void 0:So[null===o||void 0===o?void 0:o.uuid],conditionalBlocks:null===jo||void 0===jo?void 0:jo[null===o||void 0===o?void 0:o.uuid],disabled:(null===ko||void 0===ko?void 0:ko.uuid)===(null===o||void 0===o?void 0:o.uuid),extensionBlocks:null===Bo||void 0===Bo?void 0:Bo[null===o||void 0===o?void 0:o.uuid],hasFailed:c,height:(0,O.p1)(o,G,{blockStatus:r,callbackBlocks:p,conditionalBlocks:b,extensionBlocks:k}),hideNoStatus:!0,hideStatus:h||P,isDragging:t,isInProgress:a,isQueued:s,isSuccessful:f,opacity:d,pipeline:G,selected:l},null===o||void 0===o?void 0:o.uuid))})),i=(0,Y.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",style:{height:l,width:u},children:[(0,Y.jsx)(x.Z,{pr:E.cd}),v,(0,Y.jsx)(x.Z,{pr:E.cd})]})}var f,p=oe(n,o,{blocksWithSameDownstreamBlocks:a}),b=p.anotherBlockSelected,k=p.selected,g=F({block:o,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}),y=g.hasFailed,C=g.isInProgress,w=g.isQueued,S=g.isSuccessful;return f=(null===s||void 0===s?void 0:s.length)>=1?null===s||void 0===s?void 0:s.some((function(n){var e;return n&&(null===(e=F({block:o,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}))||void 0===e?void 0:e.isInProgress)})):C,(0,Y.jsx)(z,{anotherBlockSelected:b,block:o,blocksWithSameDownstreamBlocks:a,callbackBlocks:null===So||void 0===So?void 0:So[null===o||void 0===o?void 0:o.uuid],conditionalBlocks:null===jo||void 0===jo?void 0:jo[null===o||void 0===o?void 0:o.uuid],disabled:(null===ko||void 0===ko?void 0:ko.uuid)===(null===o||void 0===o?void 0:o.uuid),downstreamBlocks:s,extensionBlocks:null===Bo||void 0===Bo?void 0:Bo[null===o||void 0===o?void 0:o.uuid],hasFailed:y,height:l,hideNoStatus:!0,hideStatus:h||P,isDragging:t,isInProgress:f,isQueued:w,isSuccessful:S,opacity:d,pipeline:G,selected:k,children:i},null===o||void 0===o?void 0:o.uuid)}),[ko,r,So,jo,h,Bo,D,P,G,X,Eo]),ie=(0,f.useMemo)((function(){var n,o;if(Qn&&no){var e=no.event,i=no.node,t=no.data,l=e.clientX,u=e.clientY,d=(null===Sn||void 0===Sn||null===(n=Sn.current)||void 0===n?void 0:n.getBoundingClientRect())||{},c=d.x,a=d.y,s=null===i||void 0===i||null===(o=i.data)||void 0===o?void 0:o.block;if(s){var v=F({block:s,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}),f=(v.hasFailed,v.isInProgress,v.isQueued,v.isSuccessful,null===So||void 0===So?void 0:So[null===s||void 0===s?void 0:s.uuid]),p=null===jo||void 0===jo?void 0:jo[null===s||void 0===s?void 0:s.uuid],h=null===Bo||void 0===Bo?void 0:Bo[null===s||void 0===s?void 0:s.uuid],b={blockStatus:r,callbackBlocks:f,conditionalBlocks:p,extensionBlocks:h},k=(0,O.p1)(s,G,b),g=(0,O.HI)(s,G,b),m=ee(i,s,{isDragging:!0,nodeHeight:null===t||void 0===t?void 0:t.nodeHeight,nodeWidth:null===t||void 0===t?void 0:t.nodeWidth,opacity:.5});return(0,Y.jsx)("div",{style:{left:l-c-g/2,position:"absolute",top:u-a-k/2},children:m})}}}),[r,ee,So,jo,Bo,Qn,D,P,no,G,X,Eo]),te=(0,f.useMemo)((function(){var n,e,i,t;if(Mn){var l,r=Mn.edge,u=Oo[null===r||void 0===r?void 0:r.from],d=Oo[null===r||void 0===r?void 0:r.to],c=null===(n=event)||void 0===n?void 0:n.clientX,a=null===(e=event)||void 0===e?void 0:e.clientY,s=(null===Sn||void 0===Sn||null===(i=Sn.current)||void 0===i?void 0:i.getBoundingClientRect())||{},v=s.x,f=s.y;u&&!d?l=null===Uo||void 0===Uo?void 0:Uo[null===u||void 0===u?void 0:u.uuid]:!u&&d&&(l=null===Uo||void 0===Uo?void 0:Uo[null===d||void 0===d?void 0:d.uuid]);var p,h=function(){Po({block:d,upstreamBlocks:((null===d||void 0===d?void 0:d.upstream_blocks)||[]).filter((function(n){return n!==(null===u||void 0===u?void 0:u.uuid)}))})};if((null===(t=l)||void 0===t?void 0:t.length)>=1)null===(p=l)||void 0===p||p.forEach((function(n){var o=n.downstreamBlocks,e=n.upstreamBlocks,i=R(null===e||void 0===e?void 0:e.map((function(n){return n.uuid})));if(u&&!d&&(null===r||void 0===r?void 0:r.to)===i){var t=(0,I.HK)(o||[],(function(n){return n.uuid}));h=function(){Po({block:u,downstreamBlocks:((null===u||void 0===u?void 0:u.downstream_blocks)||[]).filter((function(n){return!(n in t)}))})}}else if(!u&&d&&(null===r||void 0===r?void 0:r.from)===i){var l=(0,I.HK)(e||[],(function(n){return n.uuid}));h=function(){Po({block:d,upstreamBlocks:((null===d||void 0===d?void 0:d.upstream_blocks)||[]).filter((function(n){return!(n in l)}))})}}}));else if(!u&&!d){var k,g,m=[];null===r||void 0===r||null===(k=r.to)||void 0===k||null===(g=k.split(":"))||void 0===g||g.forEach((function(n){if((null===n||void 0===n?void 0:n.length)>=1&&"parent"!==n){var o=null===Oo||void 0===Oo?void 0:Oo[n];o&&m.push(o)}})),h=function(){null===m||void 0===m||m.forEach((function(n){return Po({block:n,downstreamBlocks:[]})}))}}return(0,Y.jsx)("div",{style:{left:c-v,position:"absolute",top:a-f},children:(0,Y.jsx)(Q.Z,{disableEscape:!0,onClickOutside:function(){return Hn(null)},open:!0,children:(0,Y.jsxs)(on.Z,{noPadding:!0,children:[(0,Y.jsx)(x.Z,{px:E.cd,py:1,children:(0,Y.jsx)(nn.Z,{block:!0,onClick:function(){var n=null===Co||void 0===Co?void 0:Co.findIndex((function(n){return n.uuid===(null===d||void 0===d?void 0:d.uuid)}));null===o||void 0===o||o({downstream_blocks:d?[null===d||void 0===d?void 0:d.uuid]:null,language:null===d||void 0===d?void 0:d.language,type:b.tf.CUSTOM,upstream_blocks:u?[null===u||void 0===u?void 0:u.uuid]:null},n,(function(){Hn(null)}))},preventDefault:!0,sameColorAsText:!0,children:"Add new block between"})}),(0,Y.jsx)(J.Z,{light:!0}),(0,Y.jsx)(x.Z,{px:E.cd,py:1,children:(0,Y.jsx)(nn.Z,{block:!0,onClick:function(){var n;null===(n=h)||void 0===n||n(),Hn(null)},preventDefault:!0,sameColorAsText:!0,children:"Remove connection"})})]})})})}}),[Mn,Co,Hn,Po]),le=(0,f.useMemo)((function(){return null===hn||void 0===hn?void 0:hn(bn.INTERACTIONS)}),[hn,bn]),re=(0,f.useMemo)((function(){var n;if(qn){var e,i,t,l,r=qn.event,u=qn.node,d=(qn.data,u.data),a=d.block,v=d.blocks,f=(d.children,r.clientX),p=r.clientY,h=(null===Sn||void 0===Sn||null===(n=Sn.current)||void 0===n?void 0:n.getBoundingClientRect())||{},k=h.x,g=h.y,m=q&&(null===q||void 0===q?void 0:q.uuid)===(null===a||void 0===a?void 0:a.uuid)&&ao&&(null===ao||void 0===ao?void 0:ao.uuid)===(null===a||void 0===a?void 0:a.uuid),y=null===v||void 0===v?void 0:v.findIndex((function(n){return n.uuid===(null===a||void 0===a?void 0:a.uuid)})),C=en.qL.INTEGRATION===(null===G||void 0===G?void 0:G.type),w=[];if(C||w.push({onClick:function(){var n,o;null===L||void 0===L||L({block:a,code:null===c||void 0===c||null===(n=c.current)||void 0===n||null===(o=n[null===a||void 0===a?void 0:a.type])||void 0===o?void 0:o[null===a||void 0===a?void 0:a.uuid]})},uuid:"Run block"}),w.push.apply(w,[{onClick:function(){an(a,null===a||void 0===a?void 0:a.name)},uuid:"Rename block"}]),!C)w.push.apply(w,[{disabled:((null===a||void 0===a||null===(e=a.downstream_blocks)||void 0===e?void 0:e.length)||0)<=1&&!(null!==a&&void 0!==a&&null!==(i=a.upstream_blocks)&&void 0!==i&&i.length),onClick:function(){null===rn||void 0===rn||rn(m?null:a),so(m?null:a)},uuid:m?"Hide all dependencies":"Show all dependencies"},{onClick:function(){null===o||void 0===o||o({downstream_blocks:a?[null===a||void 0===a?void 0:a.uuid]:null,language:b.t6.YAML===(null===a||void 0===a?void 0:a.language)?b.t6.PYTHON:null===a||void 0===a?void 0:a.language,type:b.tf.CUSTOM},Math.max(0,y-1))},uuid:"Add upstream block"},{onClick:function(){null===o||void 0===o||o({language:b.t6.YAML===(null===a||void 0===a?void 0:a.language)?b.t6.PYTHON:null===a||void 0===a?void 0:a.language,type:b.tf.CUSTOM,upstream_blocks:a?[null===a||void 0===a?void 0:a.uuid]:null},y+1)},uuid:"Add downstream block"},{disabled:!(null!==a&&void 0!==a&&null!==(t=a.upstream_blocks)&&void 0!==t&&t.length),onClick:function(){Po({block:a,upstreamBlocks:[]})},uuid:"Remove upstream dependencies"},{disabled:!(null!==a&&void 0!==a&&null!==(l=a.downstream_blocks)&&void 0!==l&&l.length),onClick:function(){Po({block:a,downstreamBlocks:[]})},uuid:"Remove downstream dependencies"}]);return le&&w.push({onClick:function(){null===Ao||void 0===Ao||Ao(a),null===K||void 0===K||K(Cn.cH.INTERACTIONS)},uuid:"Add / Edit interactions"}),w.push.apply(w,[{onClick:function(){null===s||void 0===s||s(a)},uuid:"Delete block"},{onClick:function(){null===s||void 0===s||s(Bn(Bn({},a),{},{force:!0}))},uuid:"Delete block (ignore dependencies)"},{onClick:function(){null===Ao||void 0===Ao||Ao(a),null===K||void 0===K||K(Cn.cH.FILE_VERSIONS)},uuid:"View file versions"}]),(0,Y.jsx)("div",{style:{left:f-k,position:"absolute",top:p-g},children:(0,Y.jsx)(Q.Z,{disableEscape:!0,onClickOutside:function(){return Kn(null)},open:!0,children:(0,Y.jsx)(on.Z,{noPadding:!0,children:w.map((function(n){var o=n.disabled,e=n.onClick,i=n.uuid;return(0,Y.jsx)(x.Z,{px:E.cd,py:1,children:(0,Y.jsx)(nn.Z,{block:!0,disabled:o,onClick:function(){e(),Kn(null)},preventDefault:!0,sameColorAsText:!0,children:i})},i)}))})})})}}),[o,Co,c,qn,s,le,Ao,G,L,K,Kn,rn,so]);return(0,Y.jsxs)("div",{ref:Sn,style:{position:"relative"},children:[ko&&(0,Y.jsxs)(x.Z,{my:3,px:E.cd,children:[(0,Y.jsxs)(x.Z,{mb:E.cd,children:[(0,Y.jsxs)(y.ZP,{children:["Select parent block(s) for ",(0,Y.jsx)(y.ZP,{color:(0,S.qn)(ko.type,{blockColor:ko.color,theme:kn}).accent,inline:!0,monospace:!0,children:ko.uuid}),":"]}),(0,Y.jsx)(x.Z,{mt:1,children:mo.map((function(n,o){var e,i,t=n.uuid;return(0,Y.jsxs)(y.ZP,{color:(0,S.qn)(null===(e=Oo[t])||void 0===e?void 0:e.type,{blockColor:null===(i=Oo[t])||void 0===i?void 0:i.type,theme:kn}).accent,inline:!0,monospace:!0,children:[t,xo>=2&&o<=xo-2?(0,Y.jsx)(y.ZP,{inline:!0,children:",\xa0"}):null]},t)}))})]}),(0,Y.jsxs)(m.ZP,{alignItems:"center",children:[(0,Y.jsx)($.ZP,{compact:!0,inline:!0,loading:Zo,onClick:function(){return _o({block:Bn(Bn({},ko),{},{upstream_blocks:mo.map((function(n){return n.uuid}))})})},uuid:"DependencyGraph/save_parents",children:"Save dependencies"}),(0,Y.jsx)(x.Z,{ml:1}),(0,Y.jsx)($.ZP,{compact:!0,inline:!0,noBackground:!0,onClick:function(){po([]),tn({upstreamBlocks:null})},uuid:"DependencyGraph/cancel_save_parents",children:"Cancel"})]})]}),(0,Y.jsxs)(yn.$4,{height:Go,onDoubleClick:function(){var n,o;return null===Pn||void 0===Pn||null===(n=Pn.current)||void 0===n||null===(o=n.fitCanvas)||void 0===o?void 0:o.call(n)},children:[(0,Y.jsx)(gn,{canvasRef:Pn,containerRef:Sn,zoomLevel:Rn}),(0,Y.jsx)(En,{arrow:null,disabled:h,edge:function(n){var o,e,i,l,u,d,c,s=Oo[null===n||void 0===n?void 0:n.source],v=[];s||(null===n||void 0===n||null===(u=n.id)||void 0===u||null===(d=u.replace(null===n||void 0===n?void 0:n.source,""))||void 0===d||null===(c=d.split(":"))||void 0===c||c.forEach((function(n){if((null===n||void 0===n?void 0:n.length)>=1&&"parent"!==n){var o=null===Oo||void 0===Oo?void 0:Oo[n];o&&v.push(o)}})),null!==v&&void 0!==v&&v.length&&(s=v[0]));var f,p,h,b=null===(o=s)||void 0===o?void 0:o.uuid,k=[];if(b in(Uo||{})){var g=null===Uo||void 0===Uo?void 0:Uo[b];null===g||void 0===g||g.map((function(o){var e=o.downstreamBlocks,i=o.upstreamBlocks;R((0,I.YC)((null===i||void 0===i?void 0:i.map((function(n){return n.uuid})))||[],(function(n){return n})))===(null===n||void 0===n?void 0:n.target)&&(k.push.apply(k,(0,t.Z)(e)),f=i)}))}if(null===k||void 0===k||!k.length)if(A(b)===(null===n||void 0===n?void 0:n.target)){var m,x;k.push.apply(k,(0,t.Z)(null===(m=s)||void 0===m||null===(x=m.downstream_blocks)||void 0===x?void 0:x.map((function(n){return null===Oo||void 0===Oo?void 0:Oo[n]}))))}else{var y,C,w=null===(y=s)||void 0===y||null===(C=y.downstream_blocks)||void 0===C?void 0:C.find((function(o){return M(b,o)===(null===n||void 0===n?void 0:n.sourcePort)||A(b)===n.target})),O=null===Oo||void 0===Oo?void 0:Oo[w];k.push(O)}null===k||void 0===k||k.forEach((function(n){if(!p&&!h&&n){var o=F({block:n,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo});null!==o&&void 0!==o&&o.isInProgress&&(p=null===o||void 0===o?void 0:o.isInProgress),null!==o&&void 0!==o&&o.isQueued&&(h=null===o||void 0===o?void 0:o.isQueued)}}));var j,B=oe({id:b},s,{blocksWithSameDownstreamBlocks:f}),E=B.anotherBlockSelected,T=B.selected,_=(0,S.qn)(null===(e=s)||void 0===e?void 0:e.type,{blockColor:null===(i=s)||void 0===i?void 0:i.color,theme:kn}),Z=["edge",p?h?"activeSlow":"active":"inactive"],N=v.map((function(n){return n.uuid}));ao&&(((null===ao||void 0===ao?void 0:ao.uuid)===b||null!==N&&void 0!==N&&N.includes(null===ao||void 0===ao?void 0:ao.uuid)||null!==k&&void 0!==k&&null!==(j=k.map((function(n){return null===n||void 0===n?void 0:n.uuid})))&&void 0!==j&&j.includes(null===ao||void 0===ao?void 0:ao.uuid))&&Z.push("selected-twice"));return null!==n&&void 0!==n&&null!==(l=n.target)&&void 0!==l&&l.startsWith("parent")&&Z.push("group"),(0,Y.jsx)(Tn,Bn(Bn({},n),{},{className:Z.join(" "),onClick:a?function(n,o){Hn((function(e){var i;return(null===e||void 0===e||null===(i=e.edge)||void 0===i?void 0:i.id)===(null===o||void 0===o?void 0:o.id)?null:{block:s,edge:o,event:n}})),Kn(null)}:null,style:{stroke:E&&!T?null===_||void 0===_?void 0:_.accentLight:null===_||void 0===_?void 0:_.accent,strokeWidth:yn.dg}}))},edges:Mo,fit:!0,forwardedRef:Pn,layoutOptions:{"elk.hierarchyHandling":"INCLUDE_CHILDREN"},maxHeight:j.Jo,maxWidth:j.Jo,maxZoom:1,minZoom:-.7,node:function(n){null===n||void 0===n||n.id;var o,e=(null===n||void 0===n||null===(o=n.properties)||void 0===o?void 0:o.data)||{},i=e.block,t=e.blocks,l=null===i||void 0===i?void 0:i.uuid,u=(0,S.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:kn}),d=(null===io||void 0===io?void 0:io.id)===(null===n||void 0===n?void 0:n.id)||!(null===Gn||void 0===Gn||!Gn[l]),c=oe(n,i,{blocksWithSameDownstreamBlocks:t}),s=c.anotherBlockSelected,v=c.selected;return(0,Y.jsx)(In,Bn(Bn({},n),{},{dragType:"port",linkable:!0,port:(0,Y.jsx)(_n,{onDrag:function(){Hn(null),Fo(n)},onDragEnd:function(o,e,i){ne({event:o,node:n,port:i})},onDragStart:function(o,e,i){$o({event:o,node:n,port:i})},onEnter:function(o,e){Qo({event:o,node:n,port:e})},onLeave:function(o,e){Jo({event:o,node:n,port:e})},rx:d?10:0,ry:d?10:0,style:{fill:null===u||void 0===u?void 0:u.accentLight,stroke:s&&!v?null===u||void 0===u?void 0:u.accentLight:null===u||void 0===u?void 0:u.accent,strokeWidth:1}}),style:{fill:"transparent",stroke:"transparent",strokeWidth:0},children:function(n){var o,e=n.height,i=n.node,t=n.width,l=i.data,u=l.block,d=l.blocks,c=l.children,s=oe(i,u,{blocksWithSameDownstreamBlocks:d}),v=s.anotherBlockSelected,f=s.selected,p=F({block:u,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}),b=p.hasFailed,g=p.isInProgress,m=p.isQueued,x=p.isSuccessful;return o=(null===c||void 0===c?void 0:c.length)>=1?null===c||void 0===c?void 0:c.some((function(n){var o;return n&&(null===(o=F({block:n,blockStatus:r,messages:D,noStatus:P,runningBlocks:X,runningBlocksMapping:Eo}))||void 0===o?void 0:o.isInProgress)})):g,(0,Y.jsx)("foreignObject",{height:e,onClick:function(n){return null===Wo||void 0===Wo?void 0:Wo(n,i)},onContextMenu:a?function(n){return zo(n,i,{nodeHeight:e,nodeWidth:t})}:null,onMouseDown:k?function(n){return qo(n,i,{nodeHeight:e,nodeWidth:t})}:null,onMouseEnter:function(n){return Yo(n,i,{nodeHeight:e,nodeWidth:t})},onMouseLeave:function(n){return Xo(n,i,{nodeHeight:e,nodeWidth:t})},onMouseUp:k?function(n){return Ko(n,i,{nodeHeight:e,nodeWidth:t})}:null,style:{},width:n.width,x:0,y:0,children:(0,Y.jsx)(z,{anotherBlockSelected:v,block:u,blocksWithSameDownstreamBlocks:d,callbackBlocks:null===So||void 0===So?void 0:So[null===u||void 0===u?void 0:u.uuid],conditionalBlocks:null===jo||void 0===jo?void 0:jo[null===u||void 0===u?void 0:u.uuid],disabled:(null===ko||void 0===ko?void 0:ko.uuid)===u.uuid,downstreamBlocks:c,extensionBlocks:null===Bo||void 0===Bo?void 0:Bo[null===u||void 0===u?void 0:u.uuid],hasFailed:b,height:e,hideNoStatus:!0,hideStatus:h||P,isInProgress:o,isQueued:m,isSuccessful:x,pipeline:G,selected:f,selectedBlock:q},u.uuid)})}}))},nodes:Ho,onNodeLinkCheck:function(n,o,e){return!Mo.some((function(n){return n.from===o.id&&n.to===e.id}))},onZoomChange:function(n){null===un||void 0===un||un(n),Nn(n)},pannable:U,selections:fo,zoomable:fn})]}),te,re,ie]})}},85385:function(n,o,e){e.d(o,{Qq:function(){return p},Z7:function(){return h},cH:function(){return t},du:function(){return v},fp:function(){return s},j5:function(){return f},uM:function(){return a}});var i,t,l=e(82394),r=e(57653),u=e(82359),d=e(72473),c=e(86735),a="sideview",s=90;!function(n){n.ADDON_BLOCKS="addon_blocks",n.BLOCK_SETTINGS="block_settings",n.CALLBACKS="callbacks",n.CHARTS="charts",n.DATA="data",n.EXTENSIONS="power_ups",n.FILE_VERSIONS="file_versions",n.GRAPHS="graphs",n.INTERACTIONS="interactions",n.REPORTS="reports",n.SECRETS="secrets",n.SETTINGS="settings",n.TERMINAL="terminal",n.TREE="tree",n.VARIABLES="variables"}(t||(t={}));t.BLOCK_SETTINGS,t.CALLBACKS,t.CHARTS,t.DATA,t.EXTENSIONS,t.TREE;var v=[t.DATA];function f(n){var o,e,i,l=[{key:t.TREE,label:"Tree"},{buildLabel:function(n){var o=(n.pipeline||{}).widgets,e=void 0===o?[]:o;return(null===e||void 0===e?void 0:e.length)>=1?"Charts (".concat(e.length,")"):"Charts"},key:t.CHARTS},{buildLabel:function(n){var o=n.variables;return(null===o||void 0===o?void 0:o.length)>=1?"Variables (".concat(o.length,")"):"Variables"},key:t.VARIABLES},{buildLabel:function(n){var o=n.secrets;return(null===o||void 0===o?void 0:o.length)>=1?"Secrets (".concat(o.length,")"):"Secrets"},key:t.SECRETS}];return r.qL.PYSPARK!==(null===n||void 0===n||null===(o=n.pipeline)||void 0===o?void 0:o.type)&&l.push.apply(l,[{buildLabel:function(n){n.pipeline;return"Add-on blocks"},key:t.ADDON_BLOCKS},{buildLabel:function(n){var o=(n.pipeline||{}).extensions,e=void 0===o?{}:o,i=0;return Object.values(e).forEach((function(n){var o=n.blocks;i+=(null===o||void 0===o?void 0:o.length)||0})),i>=1?"Power ups (".concat(i,")"):"Power ups"},key:t.EXTENSIONS}]),l.push.apply(l,[{key:t.DATA,label:"Data"},{key:t.TERMINAL,label:"Terminal"},{key:t.BLOCK_SETTINGS,label:"Block settings"}]),null!==n&&void 0!==n&&null!==(e=n.project)&&void 0!==e&&null!==(i=e.features)&&void 0!==i&&i[u.d.INTERACTIONS]&&l.push({key:t.INTERACTIONS,label:"Interactions"}),l}function p(n){return(0,c.HK)(f(n),(function(n){return n.key}))}var h=(i={},(0,l.Z)(i,t.ADDON_BLOCKS,d.EJ),(0,l.Z)(i,t.BLOCK_SETTINGS,d.JG),(0,l.Z)(i,t.CALLBACKS,d.AQ),(0,l.Z)(i,t.CHARTS,d.GQ),(0,l.Z)(i,t.DATA,d.iA),(0,l.Z)(i,t.EXTENSIONS,d.Bf),(0,l.Z)(i,t.INTERACTIONS,d.yd),(0,l.Z)(i,t.SECRETS,d.Yo),(0,l.Z)(i,t.SETTINGS,d.Zr),(0,l.Z)(i,t.TERMINAL,d.oI),(0,l.Z)(i,t.TREE,d.mp),(0,l.Z)(i,t.VARIABLES,d.LO),i)},79757:function(n,o,e){var i=e(82394),t=e(26304),l=(e(82684),e(38626)),r=e(44897),u=e(42631),d=e(95363),c=e(70515),a=e(61896),s=e(28598),v=["children"];function f(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);o&&(i=i.filter((function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),e.push.apply(e,i)}return e}function p(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{};o%2?f(Object(e),!0).forEach((function(o){(0,i.Z)(n,o,e[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):f(Object(e)).forEach((function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(e,o))}))}return n}var h=l.default.p.withConfig({displayName:"Badge__BadgeStyle",componentId:"sc-tfqsp0-0"})(["border-radius:","px;display:inline;font-family:",";margin:0;white-space:nowrap;",";"," "," ",";",";"," "," "," "," "," "," "," ",""],u.BG,d.ry,a.iD,(function(n){return n.small&&"\n ".concat(a.HC,";\n ")}),(function(n){return n.xxsmall&&"\n font-size: ".concat(a.VK,"px;\n line-height: ").concat(a.VK,"px;\n ")}),(function(n){return!n.regular&&"\n padding: 2px 4px;\n "}),(function(n){return n.regular&&"\n padding: ".concat(1*c.iI,"px ").concat(1.25*c.iI,"px;\n ")}),(function(n){return n.noVerticalPadding&&"\n padding-bottom: 0;\n padding-top: 0;\n "}),(function(n){return!n.disabled&&!n.inverted&&"\n background-color: ".concat((n.theme||r.Z).background.row,";\n color: ").concat((n.theme||r.Z).content.default,";\n ")}),(function(n){return!n.disabled&&n.inverted&&"\n background-color: ".concat((n.theme||r.Z).background.dark,";\n color: ").concat((n.theme||r.Z).content.inverted,";\n ")}),(function(n){return n.cyan&&"\n background-color: ".concat((n.theme||r.Z).accent.cyan,";\n color: ").concat((n.theme||r.Z).monotone.black,";\n ")}),(function(n){return n.disabled&&"\n background-color: ".concat((n.theme||r.Z).feature.disabled,";\n color: ").concat((n.theme||r.Z).content.disabled,";\n ")}),(function(n){return n.color&&"\n background-color: ".concat(n.color," !important;\n color: ").concat((n.theme||r.Z).content.active,";\n ")}),(function(n){return n.quantifier&&"\n border-radius: 34px;\n line-height: 10px;\n padding: 4px 6px;\n "}),(function(n){return n.monospace&&"\n font-family: ".concat(d.Vp,";\n word-break: break-all;\n ")}));o.Z=function(n){var o=n.children,e=(0,t.Z)(n,v);return(0,s.jsx)(h,p(p({},e),{},{children:o}))}},65956:function(n,o,e){var i=e(38626),t=e(55485),l=e(38276),r=e(30160),u=e(44897),d=e(42631),c=e(47041),a=e(70515),s=e(28598),v=(0,i.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*a.iI,1.5*a.iI,1.5*a.iI),f=i.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],d.n_,(function(n){return n.fullWidth&&"\n width: 100%;\n "}),(function(n){return!n.borderless&&"\n border: 1px solid ".concat((n.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(n){return n.success&&"\n background-color: ".concat((n.theme.background||u.Z.background).successLight,";\n ")}),(function(n){return n.success&&!n.borderless&&"\n border: 1px solid ".concat((n.theme.background||u.Z.background).success,";\n ")}),(function(n){return!n.dark&&!n.success&&"\n background-color: ".concat((n.theme.background||u.Z.background).panel,";\n ")}),(function(n){return n.dark&&"\n background-color: ".concat((n.theme.background||u.Z.background).content,";\n ")}),(function(n){return!n.fullHeight&&"\n height: fit-content;\n "}),(function(n){return n.maxHeight&&"\n max-height: ".concat(n.maxHeight,";\n ")}),(function(n){return n.maxWidth&&"\n max-width: ".concat(n.maxWidth,"px;\n ")}),(function(n){return n.minWidth&&"\n min-width: ".concat(n.minWidth,"px;\n\n @media (max-width: ").concat(n.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(n){return n.borderless&&"\n border: none;\n "}),(function(n){return n.overflowVisible&&"\n overflow: visible;\n "})),p=i.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],d.n_,d.n_,(function(n){return"\n background-color: ".concat((n.theme.background||u.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((n.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")}),v,(function(n){return n.headerPaddingVertical&&"\n padding-bottom: ".concat(n.headerPaddingVertical,"px;\n padding-top: ").concat(n.headerPaddingVertical,"px;\n ")})),h=i.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*a.iI,c.w5,(function(n){return n.height&&"\n height: ".concat(n.height,"px;\n ")}),(function(n){return n.maxHeight&&"\n max-height: calc(".concat(n.maxHeight," - ").concat(15*a.iI,"px);\n ")}),(function(n){return n.noPadding&&"\n padding: 0;\n "}),(function(n){return n.overflowVisible&&"\n overflow: visible;\n "})),b=i.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],d.M8,d.YF,1.75*a.iI);o.Z=function(n){var o=n.borderless,e=n.children,i=n.containerRef,u=n.contentContainerRef,d=n.dark,c=n.footer,a=n.fullHeight,v=void 0===a||a,k=n.fullWidth,g=void 0===k||k,m=n.header,x=n.headerHeight,y=n.headerIcon,C=n.headerPaddingVertical,w=n.headerTitle,O=n.maxHeight,S=n.maxWidth,j=n.minWidth,B=n.noPadding,E=n.overflowVisible,I=n.subtitle,T=n.success;return(0,s.jsxs)(f,{borderless:o,dark:d,fullHeight:v,fullWidth:g,maxHeight:O,maxWidth:S,minWidth:j,overflowVisible:E,ref:i,success:T,children:[(m||w)&&(0,s.jsxs)(p,{headerPaddingVertical:C,height:x,children:[m&&m,w&&(0,s.jsx)(t.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,s.jsxs)(t.ZP,{alignItems:"center",children:[y&&y,(0,s.jsx)(l.Z,{ml:y?1:0,children:(0,s.jsx)(r.ZP,{bold:!0,default:!0,children:w})})]})})]}),(0,s.jsxs)(h,{maxHeight:O,noPadding:B,overflowVisible:E,ref:u,children:[I&&"string"===typeof I&&(0,s.jsx)(l.Z,{mb:2,children:(0,s.jsx)(r.ZP,{default:!0,children:I})}),I&&"string"!==typeof I&&I,e]}),c&&(0,s.jsx)(b,{children:c})]})}},44375:function(n,o,e){e.d(o,{$1:function(){return l},Dy:function(){return t},IU:function(){return r}});var i=e(17717),t="--full-refresh";function l(n,o){var e,t=null===o||void 0===o?void 0:o.fullPath,l=null===n||void 0===n||null===(e=n.configuration)||void 0===e?void 0:e.file_path;if(t)return null===n||void 0===n?void 0:n.uuid;if(l){var r=l.split(i.sep),u=r[r.length-1].split(".");return u.pop(),u.join(".")}}function r(n){var o,e=null===n||void 0===n||null===(o=n.configuration)||void 0===o?void 0:o.file_path;if(e){var t=e.split(i.sep),l=t[0],r=t[t.length-1].split(".");return r.pop(),{directory:t.slice(1,t.length-1).join(i.sep),filePath:e,name:r.join("."),project:l}}return{filePath:e}}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1221],{8666:function(e,n,i){"use strict";var t;i.d(n,{b:function(){return t}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(t||(t={}))},30229:function(e,n,i){"use strict";i.d(n,{PN:function(){return l},TR:function(){return v},U5:function(){return d},Wb:function(){return f},Xm:function(){return o},Z4:function(){return s},fq:function(){return c},gm:function(){return a},kJ:function(){return p}});var t,u,o,r=i(82394),l="__bookmark_values__";!function(e){e.API="api",e.EVENT="event",e.TIME="time"}(o||(o={}));var c,d,s=(t={},(0,r.Z)(t,o.API,(function(){return"API"})),(0,r.Z)(t,o.EVENT,(function(){return"event"})),(0,r.Z)(t,o.TIME,(function(){return"schedule"})),t);!function(e){e.ACTIVE="active",e.INACTIVE="inactive"}(c||(c={})),function(e){e.ONCE="@once",e.HOURLY="@hourly",e.DAILY="@daily",e.WEEKLY="@weekly",e.MONTHLY="@monthly",e.ALWAYS_ON="@always_on"}(d||(d={}));var a,p,f=[d.ONCE,d.HOURLY,d.DAILY,d.WEEKLY,d.MONTHLY];!function(e){e.INTERVAL="frequency[]",e.STATUS="status[]",e.TAG="tag[]",e.TYPE="type[]"}(a||(a={})),function(e){e.CREATED_AT="created_at",e.NAME="name",e.PIPELINE="pipeline_uuid",e.STATUS="status",e.TYPE="schedule_type"}(p||(p={}));var v=(u={},(0,r.Z)(u,p.CREATED_AT,"Created at"),(0,r.Z)(u,p.NAME,"Name"),(0,r.Z)(u,p.PIPELINE,"Pipeline"),(0,r.Z)(u,p.STATUS,"Active"),(0,r.Z)(u,p.TYPE,"Type"),u)},31882:function(e,n,i){"use strict";var t=i(38626),u=i(71180),o=i(55485),r=i(30160),l=i(44897),c=i(72473),d=i(70515),s=i(61896),a=i(28598),p=t.default.div.withConfig({displayName:"Chip__ChipStyle",componentId:"sc-1ok73g-0"})(["display:inline-block;"," "," "," "," "," ",""],(function(e){return!e.primary&&"\n background-color: ".concat((e.theme.background||l.Z.background).tag,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.chart||l.Z.chart).primary,";\n ")}),(function(e){return!e.small&&"\n border-radius: ".concat((d.iI+s.Al)/2,"px;\n height: ").concat(1.5*d.iI+s.Al,"px;\n padding: ").concat(d.iI/1.5,"px ").concat(1.25*d.iI,"px;\n ")}),(function(e){return e.small&&"\n border-radius: ".concat((d.iI/2+s.Al)/2,"px;\n height: ").concat(s.Al+d.iI/2+2,"px;\n padding: ").concat(d.iI/4,"px ").concat(d.iI,"px;\n ")}),(function(e){return e.xsmall&&"\n border-radius: ".concat((d.iI/1+s.Al)/1,"px;\n height: ").concat(20,"px;\n padding: 4px 6px;\n ")}),(function(e){return e.border&&"\n border: 1px solid ".concat((e.theme.content||l.Z.content).muted,";\n ")}));n.Z=function(e){var n=e.border,i=e.children,t=e.disabled,l=e.label,s=e.monospace,f=e.onClick,v=e.primary,h=e.small,m=e.xsmall;return(0,a.jsx)(p,{border:n,primary:v,small:h,xsmall:m,children:(0,a.jsx)(u.ZP,{basic:!0,disabled:t,noBackground:!0,noPadding:!0,onClick:f,transparent:!0,children:(0,a.jsxs)(o.ZP,{alignItems:"center",children:[i,l&&(0,a.jsx)(r.ZP,{monospace:s,small:h,xsmall:m,children:l}),!t&&f&&(0,a.jsx)("div",{style:{marginLeft:2}}),!t&&f&&(0,a.jsx)(c.x8,{default:v,muted:!v,size:h?d.iI:1.25*d.iI})]})})})}},55620:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return Oe}});var t=i(77837),u=i(75582),o=i(21831),r=i(82394),l=i(38860),c=i.n(l),d=i(12691),s=i.n(d),a=i(82684),p=i(69864),f=i(34376),v=i(52749),h=i(60523),m=i(71180),g=i(90299),b=i(31882),x=i(94629),Z=i(97618),j=i(55485),C=i(85854),_=i(93369),I=i(65956),w=i(38276),P=i(30160),k=i(35576),y=i(17488),T=i(28598);var E=function(e){var n=e.description,i=e.isLoading,t=e.maxWidth,u=e.minWidth,o=e.noEmptyValue,r=e.onClose,l=e.onSave,c=e.textArea,d=e.title,s=e.value,p=(0,a.useRef)(null),f=(0,a.useState)(s),v=f[0],h=f[1],g=c?k.Z:y.Z;return(0,a.useEffect)((function(){var e;null===p||void 0===p||null===(e=p.current)||void 0===e||e.focus()}),[]),(0,T.jsxs)(I.Z,{maxWidth:t,minWidth:u,children:[(0,T.jsx)(P.ZP,{bold:!0,children:d}),(0,T.jsx)(w.Z,{mt:1,children:(0,T.jsx)(g,{monospace:!0,onChange:function(e){return h(e.target.value)},ref:p,rows:c?7:null,value:v})}),n&&(0,T.jsx)(w.Z,{mt:2,children:(0,T.jsx)(P.ZP,{muted:!0,small:!0,children:n})}),(0,T.jsx)(w.Z,{mt:3,children:(0,T.jsxs)(j.ZP,{children:[(0,T.jsx)(_.ZP,{bold:!0,inline:!0,loading:i,onClick:function(){v===s||o&&!v?r():l(v)},outline:!0,primary:!0,uuid:"Inputs/InputModal/SaveInput",children:"Save"}),(0,T.jsx)(w.Z,{ml:1}),(0,T.jsx)(m.ZP,{onClick:r,children:"Cancel"})]})})]})},A=i(48670),S=i(55072),O=i(57653),M=i(55729),D=i(93808),R=i(82359),N=i(44085),L=i(4190),U=i(75499),G=i(48381),H=i(69650),B=i(85544),Y=i(35686),$=i(44897),V=i(42631),W=i(44425),z=i(72473),F=i(23780),q=i(8666),K=i(46684),Q=i(53808),X="pipeline_list_filters",J="pipeline_list_group_bys",ee="pipeline_list_sort_column_index",ne="pipeline_list_sort_direction",ie="pipeline_list_selected_tab_uuid";function te(e){return(0,Q.t8)(X,e),e}function ue(e){return(0,Q.t8)(J,e),e}var oe=i(11498),re=i(32929),le=i(44898),ce=i(70515),de=i(30229),se=i(81655),ae=i(31608),pe=i(81728),fe=i(3917),ve=i(72619),he=i(69419),me=i(65458),ge=i(15610),be=i(86735),xe=i(42122),Ze=i(3314),je=i(70320),Ce=i(89538),_e=i(44952);function Ie(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function we(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Ie(Object(i),!0).forEach((function(n){(0,r.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ie(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var Pe={Icon:z.Pf,label:function(){return"Recently viewed"},uuid:"recent"},ke={Icon:z.vd,label:function(e){return null!==e&&void 0!==e&&e.count?"All pipelines \u203a ".concat((null===e||void 0===e?void 0:e.count)||0):"All pipelines"},uuid:"all"},ye=[ke,Pe],Te="tab",Ee=[O.$1.SEARCH],Ae={borderRadius:"".concat(V.BG,"px"),iconOnly:!0,noBackground:!0,noBorder:!0,outline:!0,padding:"4px"};function Se(){var e,n,i,t,l=(0,f.useRouter)(),c=(0,a.useRef)(null),d=(0,a.useRef)(null),_=(0,a.useRef)(null),k=(0,a.useRef)(null),y=(0,a.useState)(null),D=y[0],V=y[1],Ie=(0,a.useState)(null),Se=Ie[0],Oe=Ie[1],Me=(0,a.useState)(null),De=Me[0],Re=Me[1],Ne=(0,a.useState)(null),Le=Ne[0],Ue=Ne[1],Ge=(0,a.useState)(null),He=Ge[0],Be=Ge[1],Ye=(0,a.useCallback)((function(e){Be(e),clearTimeout(k.current),k.current=setTimeout((function(){return(0,ge.u7)((0,r.Z)({},O.$1.SEARCH,e))}),500)}),[Be]),$e=(0,a.useState)({}),Ve=$e[0],We=$e[1],ze=(0,a.useState)(null),Fe=ze[0],qe=ze[1],Ke=(0,he.iV)(),Qe=we((0,r.Z)({},oe.$D.LIMIT,S.Q),(0,he.DQ)(Ke,[O.$1.SEARCH,O.$1.STATUS,O.$1.TAG,O.$1.TYPE].concat((0,o.Z)(oe.RG)))),Xe=(0,a.useMemo)((function(){return null===Ke||void 0===Ke?void 0:Ke.tab}),[Ke]);(0,a.useEffect)((function(){var e;V(null===c||void 0===c||null===(e=c.current)||void 0===e?void 0:e.getBoundingClientRect().height)}),[Ke,c]);var Je=Y.ZP.projects.list(),en=Je.data,nn=Je.mutate,tn=(0,a.useMemo)((function(){var e;return null===en||void 0===en||null===(e=en.projects)||void 0===e?void 0:e[0]}),[en]),un=(0,a.useMemo)((function(){var e;return(0,je.hY)(null===tn||void 0===tn||null===(e=tn.features)||void 0===e?void 0:e[R.d.LOCAL_TIMEZONE])}),[null===tn||void 0===tn?void 0:tn.features]),on=(0,a.useMemo)((function(){var e;return null===tn||void 0===tn||null===(e=tn.features)||void 0===e?void 0:e[R.d.OPERATION_HISTORY]}),[tn]),rn=(0,a.useMemo)((function(){return un?se.O$:{}}),[un]),ln=Y.ZP.pipelines.list(we(we({},Qe),{},{include_schedules:1}),{revalidateOnFocus:!1},{pauseFetch:on&&Xe&&Pe.uuid===Xe}),cn=ln.data,dn=ln.mutate,sn=(0,a.useMemo)((function(){return(null===Ke||void 0===Ke?void 0:Ke[O.$1.HISTORY_DAYS])||7}),[Ke]),an=Y.ZP.pipelines.list(we(we({},Qe),{},(e={},(0,r.Z)(e,O.$1.HISTORY_DAYS,(0,pe.HW)(sn)?Number(sn):sn),(0,r.Z)(e,"include_schedules",1),e)),{},{pauseFetch:!on||!Xe||Pe.uuid!==Xe}),pn=an.data,fn=an.mutate,vn=(0,a.useCallback)((function(e){return e}),[He]),hn=(0,a.useMemo)((function(){var e=vn((null===cn||void 0===cn?void 0:cn.pipelines)||[]);if(null!==Ke&&void 0!==Ke&&Ke[O.$1.TAG]){var n=Ke[O.$1.TAG];e=e.filter((function(e){var i=e.tags;return i.some((function(e){return n.includes(e)}))||0===i.length&&n.includes(O.$1.NO_TAGS)}))}return e}),[cn,vn,Ke]),mn=(0,a.useMemo)((function(){return vn((null===pn||void 0===pn?void 0:pn.pipelines)||[])}),[pn,vn]),gn=(0,a.useMemo)((function(){return(0,be.HK)(hn,(function(e){return e.uuid}))}),[hn]),bn=(0,a.useMemo)((function(){return(0,be.HK)(mn,(function(e){return e.uuid}))}),[mn]),xn=(0,a.useCallback)((function(e){var n,i,t,u;return null===e||void 0===e||null===(n=e[2])||void 0===n||null===(i=n.props)||void 0===i||null===(t=i.children)||void 0===t||null===(u=t.props)||void 0===u?void 0:u.children}),[]),Zn=(0,a.useMemo)((function(){return(null===De||void 0===De?void 0:De.length)>0?null===De||void 0===De?void 0:De.map((function(e){var n=xn(e);return null===gn||void 0===gn?void 0:gn[n]})):hn}),[xn,De,hn,gn]),jn=(0,a.useMemo)((function(){return(null===Le||void 0===Le?void 0:Le.length)>0?null===Le||void 0===Le?void 0:Le.map((function(e){var n=xn(e);return null===bn||void 0===bn?void 0:bn[n]})):mn}),[xn,Le,mn,bn]),Cn=(0,a.useMemo)((function(){return[1,2,3,4,5,6,8,9]}),[]),_n=null===Ke||void 0===Ke?void 0:Ke[se.lG.SORT_COL_IDX],In=null===Ke||void 0===Ke?void 0:Ke[se.lG.SORT_DIRECTION],wn=(0,a.useMemo)((function(){return _n?{columnIndex:+_n,sortDirection:In||se.sh.ASC}:void 0}),[_n,In]),Pn=null===Ke||void 0===Ke?void 0:Ke[O.$1.GROUP],kn=(0,p.Db)((function(e){var n=e.pipelineUUID,i=e.filesOnly,t=void 0!==i&&i;return Y.ZP.downloads.pipelines.useCreate(n)({download:{ignore_folder_structure:t}})}),{onSuccess:function(e){return(0,ve.wD)(e,{callback:function(){var n=e.data.download.token;(0,_e.K)(n)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),yn=(0,u.Z)(kn,1)[0];(0,a.useEffect)((function(){var e,n,i,t={};if(_n&&Cn.includes(+_n))(0,Q.t8)(ee,_n),In&&(0,Q.t8)(ne,In);else{var o=(0,Q.U2)(ee,null),l=(0,Q.U2)(ne,se.sh.ASC);null!==o&&(t[se.lG.SORT_COL_IDX]=o,t[se.lG.SORT_DIRECTION]=l)}on&&(Xe?(0,Q.t8)(ie,Xe):t.tab=(0,Q.U2)(ie,null===ye||void 0===ye||null===(n=ye[0])||void 0===n?void 0:n.uuid));if(Pn)ue((0,r.Z)({},Pn,!0));else{var c,d=(0,Q.U2)(J,{});d&&Object.entries(d).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];!c&&t&&(c=i)})),c&&(t[O.$1.GROUP]=c)}if((0,xe.Qr)(Qe)){var s={},a=(0,Q.U2)(X,{});a&&Object.entries(a).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];"undefined"!==typeof t&&null!==t&&(oe.RG.includes(i)||Ee.includes(i)?s[i]=t:(s[i]=[],Object.entries(t).forEach((function(e){var n=(0,u.Z)(e,2),t=n[0];n[1]&&s[i].push(t)}))))})),(0,xe.Qr)(s)||(t={},Object.entries(we(we({},t),s)||{}).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],o=n[1];"undefined"!==typeof o&&null!==o&&(t[i]=o)})))}else{var p={};Object.entries(Qe).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];p[i]={};var o,r=t;"undefined"!==typeof t&&null!==t&&(oe.RG.includes(i)||Ee.includes(i)?p[i]=r:(Array.isArray(r)||(r=[r]),r&&Array.isArray(r)&&(null===(o=r)||void 0===o||o.forEach((function(e){p[i][e]=!0})))))})),te((0,xe.hB)(p))}null!==(e=t)&&void 0!==e&&e[O.$1.SEARCH]&&Ye(null===(i=t)||void 0===i?void 0:i[O.$1.SEARCH]);(0,xe.Qr)(t)||(console.log("wtf",t,(0,xe.hB)(t)),(0,ge.u7)((0,xe.hB)(t),{pushHistory:!1}))}),[Pn,on,Qe,Xe,Cn,_n,In]),(0,a.useEffect)((function(){(0,ve.bB)(cn,qe)}),[cn]);var Tn=function(e){return(0,p.Db)(Y.ZP.pipelines.useCreate(),{onSuccess:function(n){return(0,ve.wD)(n,{callback:function(n){var i=n.pipeline.uuid;null===e||void 0===e||e(i)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}})},En=Tn((function(e){return l.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))})),An=(0,u.Z)(En,2),Sn=An[0],On=An[1].isLoading,Mn=Tn((function(){null===dn||void 0===dn||dn(),null===fn||void 0===fn||fn()})),Dn=(0,u.Z)(Mn,2),Rn=Dn[0],Nn=Dn[1].isLoading,Ln=(0,p.Db)((function(e){return Y.ZP.pipelines.useUpdate(e.uuid)({pipeline:e})}),{onSuccess:function(e){return(0,ve.wD)(e,{callback:function(e){var n=e.pipeline.uuid;We((function(e){return we(we({},e),{},(0,r.Z)({},n,!1))})),dn(),null===fn||void 0===fn||fn(),null===qn||void 0===qn||qn(),Oe(null)},onErrorCallback:function(e,n){var i,t=null===e||void 0===e||null===(i=e.url_parameters)||void 0===i?void 0:i.pk;We((function(e){return we(we({},e),{},(0,r.Z)({},t,!1))})),qe({errors:n,response:e})}})}}),Un=(0,u.Z)(Ln,2),Gn=Un[0],Hn=Un[1].isLoading,Bn=(0,p.Db)((function(e){return Y.ZP.pipelines.useDelete(e)()}),{onSuccess:function(e){return(0,ve.wD)(e,{callback:function(){null===dn||void 0===dn||dn(),null===fn||void 0===fn||fn()},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),Yn=(0,u.Z)(Bn,2),$n=Yn[0],Vn=Yn[1].isLoading,Wn=(0,Ce.dd)((function(e){var n=e.pipeline,i=e.pipelineDescription,t=e.pipelineName;return(0,T.jsx)(E,{isLoading:Hn,minWidth:55*ce.iI,noEmptyValue:!!t,onClose:qn,onSave:function(e){var i=n||Se;if(i){var u=i.uuid,o={uuid:u};t?o.name=e:o.description=e,We((function(e){return we(we({},e),{},(0,r.Z)({},u,!0))})),Gn(o)}},textArea:!t,title:t?"Rename pipeline":"Edit description for ".concat(null===n||void 0===n?void 0:n.uuid),value:t||i})}),{},[Hn,Se],{background:!0,uuid:"rename_pipeline_and_save"}),zn=(0,u.Z)(Wn,2),Fn=zn[0],qn=zn[1],Kn=(0,Ce.dd)((function(){return(0,T.jsx)(F.BC,{children:(0,T.jsx)(h.Z,{contained:!0,onClickCustomTemplate:function(e){Sn({pipeline:{custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid,name:(0,pe.Y6)()}}).then((function(){Jn()}))},showBreadcrumbs:!0,tabs:[re.A2]})})}),{},[Sn],{background:!0,uuid:"browse_templates"}),Qn=(0,u.Z)(Kn,2),Xn=Qn[0],Jn=Qn[1],ei=(0,Ce.dd)((function(e){var n=e.cancelButtonText,i=(e.header,e.onCancel),t=e.onSaveSuccess;return(0,T.jsx)(F.BC,{children:(0,T.jsx)(M.Z,{cancelButtonText:n,contained:!0,header:(0,T.jsx)(w.Z,{mb:ce.HN,children:(0,T.jsxs)(I.Z,{children:[(0,T.jsx)(P.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate pipelines using AI."}),(0,T.jsx)(w.Z,{mt:1,children:(0,T.jsxs)(P.ZP,{warning:!0,children:["Read ",(0,T.jsx)(A.Z,{href:"https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key",openNewWindow:!0,children:"OpenAI\u2019s documentation"})," to get your API key."]})})]})}),onCancel:function(){null===i||void 0===i||i(),ti()},onSaveSuccess:function(e){nn(),ti(),null===t||void 0===t||t(e)}})})}),{},[nn],{background:!0,uuid:"configure_project"}),ni=(0,u.Z)(ei,2),ii=ni[0],ti=ni[1],ui=(0,Ce.dd)((function(){return(0,T.jsx)(F.BC,{children:(0,T.jsx)(v.Z,{createPipeline:Sn,isLoading:On,onClose:li})})}),{},[Sn,On],{background:!0,disableClickOutside:!0,disableCloseButton:!0,uuid:"AI_modal"}),oi=(0,u.Z)(ui,2),ri=oi[0],li=oi[1],ci=(0,a.useMemo)((function(){return(0,me.d)(Sn,{showAIModal:function(){null!==tn&&void 0!==tn&&tn.openai_api_key?ri():ii({onSaveSuccess:function(){ri()}})},showBrowseTemplates:Xn})}),[Sn,tn,ri,Xn,ii]),di=Y.ZP.tags.list().data,si=(0,a.useMemo)((function(){return(0,be.YC)((null===di||void 0===di?void 0:di.tags)||[],(function(e){return e.uuid}))}),[di]),ai=(0,a.useMemo)((function(){return(0,T.jsx)(B.Z,{addButtonProps:{isLoading:On,label:"New",menuItems:ci},deleteRowProps:{confirmationMessage:"This is irreversible and will immediately delete everything associated with the pipeline, including its blocks, triggers, runs, logs, and history.",isLoading:Vn,item:"pipeline",onDelete:function(){window.confirm("Are you sure you want to delete pipeline ".concat(null===Se||void 0===Se?void 0:Se.uuid,"?"))&&$n(null===Se||void 0===Se?void 0:Se.uuid)}},extraActionButtonProps:{Icon:z.oX,confirmationDescription:"Cloning the selected pipeline will create a new pipeline with the same configuration and code blocks. The blocks use the same block files as the original pipeline. Pipeline triggers, runs, backfills, and logs are not copied over to the new pipeline.",confirmationMessage:"Do you want to clone the pipeline ".concat(null===Se||void 0===Se?void 0:Se.uuid,"?"),isLoading:Nn,onClick:function(){return Rn({pipeline:{clone_pipeline_uuid:null===Se||void 0===Se?void 0:Se.uuid}})},openConfirmationDialogue:!0,tooltip:"Clone pipeline"},filterOptions:{status:O.kA,tag:[O.$1.NO_TAGS].concat((0,o.Z)(si.map((function(e){return e.uuid})))),type:Object.values(O.qL)},filterValueLabelMapping:{status:O.kA.reduce((function(e,n){return we(we({},e),{},(0,r.Z)({},n,(0,pe.J3)((0,pe.kC)(n))))}),{}),tag:we((0,r.Z)({},O.$1.NO_TAGS,"No tags"),si.reduce((function(e,n){var i=n.uuid;return we(we({},e),{},(0,r.Z)({},i,i))}),{})),type:O.G7},groupButtonProps:{groupByLabel:Pn,menuItems:[{beforeIcon:Pn===O.r0.STATUS?(0,T.jsx)(z.Jr,{fill:$.Z.content.default,size:1.5*ce.iI}):(0,T.jsx)(z.Cd,{muted:!0,size:1.5*ce.iI}),label:function(){return(0,pe.kC)(O.r0.STATUS)},onClick:function(){var e=Pn===O.r0.STATUS?null:O.r0.STATUS;e||ue({}),(0,ge.u7)((0,r.Z)({},O.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Status"},{beforeIcon:Pn===O.r0.TAG?(0,T.jsx)(z.Jr,{fill:$.Z.content.default,size:1.5*ce.iI}):(0,T.jsx)(z.Cd,{muted:!0,size:1.5*ce.iI}),label:function(){return(0,pe.kC)(O.r0.TAG)},onClick:function(){var e=Pn===O.r0.TAG?null:O.r0.TAG;e||ue({}),(0,ge.u7)((0,r.Z)({},O.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Tag"},{beforeIcon:Pn===O.r0.TYPE?(0,T.jsx)(z.Jr,{fill:$.Z.content.default,size:1.5*ce.iI}):(0,T.jsx)(z.Cd,{muted:!0,size:1.5*ce.iI}),label:function(){return(0,pe.kC)(O.r0.TYPE)},onClick:function(){var e=Pn===O.r0.TYPE?null:O.r0.TYPE;e||ue({}),(0,ge.u7)((0,r.Z)({},O.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Type"}]},moreActionsMenuItems:[{label:function(){return"Rename pipeline"},onClick:function(){return Fn({pipelineName:null===Se||void 0===Se?void 0:Se.name})},uuid:"Pipelines/MoreActionsMenu/Rename"},{label:function(){return"Edit description"},onClick:function(){return Fn({pipeline:Se,pipelineDescription:null===Se||void 0===Se?void 0:Se.description})},uuid:"Pipelines/MoreActionsMenu/EditDescription"}],onClickFilterDefaults:function(){te({}),l.push("/pipelines")},onFilterApply:function(e,n){Object.values(n).every((function(e){return!(null!==e&&void 0!==e&&e.length)}))&&te({})},query:Qe,searchProps:{onChange:Ye,value:He},selectedRowId:null===Se||void 0===Se?void 0:Se.uuid,setSelectedRow:Oe})}),[Rn,$n,Pn,Nn,On,Vn,ci,Qe,l,He,Se,Fn,si]),pi=(0,F.VI)(null,{},[],{uuid:"pipelines/list"}),fi=(0,u.Z)(pi,1)[0],vi=(0,p.Db)(Y.ZP.projects.useUpdate(null===tn||void 0===tn?void 0:tn.name),{onSuccess:function(e){return(0,ve.wD)(e,{callback:function(){nn()},onErrorCallback:function(e,n){return fi({errors:n,response:e})}})}}),hi=(0,u.Z)(vi,2),mi=hi[0],gi=hi[1].isLoading,bi=(0,a.useCallback)((function(e){return mi({project:e})}),[mi]),xi=(0,Ce.dd)((function(){return(0,T.jsxs)(I.Z,{maxWidth:60*ce.iI,children:[(0,T.jsx)(w.Z,{mb:1,children:(0,T.jsx)(C.Z,{children:"Help improve Mage"})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsx)(P.ZP,{default:!0,children:"Please contribute usage statistics to help improve the developer experience for you and everyone in the community \ud83e\udd1d."})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsx)(I.Z,{success:!0,children:(0,T.jsxs)(j.ZP,{alignItems:"center",children:[(0,T.jsx)(z.Yo,{size:5*ce.iI,success:!0}),(0,T.jsx)(w.Z,{mr:1}),(0,T.jsx)(Z.Z,{children:(0,T.jsx)(P.ZP,{children:"All usage statistics are completely anonymous. It\u2019s impossible for Mage to know which statistics belongs to whom."})})]})})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsxs)(P.ZP,{default:!0,children:["By opting into sending usage statistics to ",(0,T.jsx)(A.Z,{href:"https://www.mage.ai",openNewWindow:!0,children:"Mage"}),", it\u2019ll help the team and community of contributors (",(0,T.jsx)(A.Z,{href:"https://www.mage.ai/chat",openNewWindow:!0,children:"Magers"}),") learn what\u2019s going wrong with the tool and what improvements can be made."]})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsx)(P.ZP,{default:!0,children:"In addition to helping reduce potential errors, you\u2019ll help inform which features are useful and which need work."})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsxs)(j.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,T.jsx)(P.ZP,{bold:!0,children:"I want to help make Mage more powerful for everyone"}),(0,T.jsx)(w.Z,{mr:ce.cd}),(0,T.jsx)(H.Z,{checked:!0,onCheck:function(){window.confirm("Are you sure you don\u2019t want to help everyone in the community?")&&bi({help_improve_mage:!1}).then((function(){return Ci()}))}})]})}),gi&&(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsx)(L.Z,{inverted:!0})}),(0,T.jsx)(w.Z,{mb:ce.cd,children:(0,T.jsxs)(P.ZP,{muted:!0,small:!0,children:["To learn more about how this works, please check out the ",(0,T.jsx)(A.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,small:!0,children:"documentation"}),"."]})}),(0,T.jsx)(m.ZP,{onClick:function(){return bi({help_improve_mage:!0}).then((function(){return Ci()}))},secondary:!0,children:"Close"})]})}),{},[tn],{background:!0,hideCallback:function(){bi({help_improve_mage:!0})},uuid:"help_mage"}),Zi=(0,u.Z)(xi,2),ji=Zi[0],Ci=Zi[1];(0,a.useEffect)((function(){tn&&null===(null===tn||void 0===tn?void 0:tn.help_improve_mage)&&ji()}),[tn,ji]);var _i=(0,a.useCallback)((function(e){var n={};null===e||void 0===e||e.forEach((function(e,i){var t=null===e||void 0===e?void 0:e[Pn];if(O.r0.STATUS===Pn){var u=(e||{}).schedules,o=void 0===u?[]:u,r=o.length;t=o.find((function(e){var n=e.status;return de.fq.ACTIVE===n}))?O.QK.ACTIVE:r>=1?O.QK.INACTIVE:O.QK.NO_SCHEDULES}else if(O.r0.TAG===Pn){t=(null===e||void 0===e?void 0:e.tags)?(0,be.YC)(e.tags,(function(e){return e})).join(", "):""}n[t]||(n[t]=[]),n[t].push(i)}));var i=[],t=[];O.r0.STATUS===Pn?Object.values(O.QK).forEach((function(e){i.push(n[e]),t.push((0,pe.vg)(e))})):O.r0.TAG===Pn?(0,be.YC)(Object.keys(n),(function(e){return e})).forEach((function(e){i.push(n[e]),e?t.push(e.split(", ").map((function(e,n){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{style:{marginLeft:n>=1?4:0}},"".concat(e,"-").concat(n,"-spacing")),(0,T.jsx)(b.Z,{small:!0,children:(0,T.jsx)(P.ZP,{children:e})},"".concat(e,"-").concat(n))]})}))):t.push("No tags")})):O.r0.TYPE===Pn&&Object.values(O.qL).forEach((function(e){i.push(n[e]),t.push(O.G7[e])}));var u=[],o=[];return null===i||void 0===i||i.forEach((function(e,n){"undefined"!==typeof e&&null!==e&&(null===e||void 0===e?void 0:e.length)>=1&&(o.push(e),u.push(null===t||void 0===t?void 0:t[n]))})),{rowGroupHeaders:u,rowsGroupedByIndex:o}}),[Pn]),Ii=(0,a.useMemo)((function(){return _i(Zn)}),[_i,Zn]),wi=Ii.rowGroupHeaders,Pi=Ii.rowsGroupedByIndex,ki=(0,a.useMemo)((function(){return _i(jn)}),[_i,jn]),yi=ki.rowGroupHeaders,Ti=ki.rowsGroupedByIndex,Ei=(0,a.useCallback)((function(e,n,i,t,u){return(0,T.jsx)(U.Z,{columnFlex:[null,null,null,2,null,null,null,1,null,null,null],columns:[{label:function(){return""},uuid:"action"},{uuid:(0,pe.kC)(O.r0.STATUS)},{uuid:"Name"},{uuid:"Description"},{uuid:(0,pe.kC)(O.r0.TYPE)},we(we({},rn),{},{uuid:"Updated at"}),we(we({},rn),{},{uuid:"Created at"}),{uuid:"Tags"},{uuid:"Blocks"},{uuid:"Triggers"},{center:!0,label:function(){return""},uuid:"Actions"}],defaultSortColumnIndex:2,getUniqueRowIdentifier:xn,isSelectedRow:function(e){var i;return(null===(i=n[e])||void 0===i?void 0:i.uuid)===(null===Se||void 0===Se?void 0:Se.uuid)},localStorageKeySortColIdx:ee,localStorageKeySortDirection:ne,onClickRow:function(e){return Oe((function(i){var t=n[e];return(null===i||void 0===i?void 0:i.uuid)!==(null===t||void 0===t?void 0:t.uuid)?t:null}))},onDoubleClickRow:function(e){l.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n[e].uuid,"/edit"))},ref:d,renderRightClickMenuItems:function(e){var i=n[e];return[{label:function(){return"Edit description"},onClick:function(){return Fn({pipeline:i,pipelineDescription:null===i||void 0===i?void 0:i.description})},uuid:"edit_description"},{label:function(){return"Rename"},onClick:function(){return Fn({pipeline:i,pipelineName:null===i||void 0===i?void 0:i.name})},uuid:"rename"},{label:function(){return"Clone"},onClick:function(){return Rn({pipeline:{clone_pipeline_uuid:null===i||void 0===i?void 0:i.uuid}})},uuid:"clone"},{label:function(){return"Download (keep folder structure)"},onClick:function(){yn({pipelineUUID:null===i||void 0===i?void 0:i.uuid,filesOnly:!1})},uuid:"download_keep_folder_structure"},{label:function(){return"Download (without folder structure)"},onClick:function(){yn({pipelineUUID:null===i||void 0===i?void 0:i.uuid,filesOnly:!0})},uuid:"download_without_folder_structure"},{label:function(){return"Add/Remove tags"},onClick:function(){l.push("/pipelines/[pipeline]/settings","/pipelines/".concat(null===i||void 0===i?void 0:i.uuid,"/settings"))},uuid:"add_tags"},{label:function(){return"Create template"},onClick:function(){l.push("/templates?object_type=".concat(le.R,"&new=1&pipeline_uuid=").concat(null===i||void 0===i?void 0:i.uuid))},uuid:"create_custom_template"},{label:function(){return"Create global data product"},onClick:function(){l.push("/global-data-products?object_type=".concat(q.b.PIPELINE,"&new=1&object_uuid=").concat(null===i||void 0===i?void 0:i.uuid))},uuid:"create_global_data_product"},{label:function(){return"Delete"},onClick:function(){window.confirm("Are you sure you want to delete pipeline ".concat(null===i||void 0===i?void 0:i.uuid,"?"))&&$n(null===i||void 0===i?void 0:i.uuid)},uuid:"delete"}]},rightClickMenuHeight:252,rightClickMenuWidth:30*ce.iI,rowGroupHeaders:i,rows:null===e||void 0===e?void 0:e.map((function(e,n){var i=e.blocks,t=e.created_at,u=e.description,o=e.schedules,c=e.tags,d=e.type,a=e.updated_at,p=e.uuid,f=i.filter((function(e){var n=e.type;return W.tf.SCRATCHPAD!==n})).length,v=o.length,h=o.find((function(e){var n=e.status;return de.fq.ACTIVE===n})),g=(0,T.jsx)("div",{children:(0,T.jsx)(G.Z,{tags:null===c||void 0===c?void 0:c.map((function(e){return{uuid:e}}))})},"pipeline_tags_".concat(n));return[v>=1||Ve[p]?(0,T.jsx)(m.ZP,{iconOnly:!0,loading:!!Ve[p],noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(n){(0,Ze.j)(n),We((function(e){return we(we({},e),{},(0,r.Z)({},p,!0))})),Gn(we(we({},e),{},{status:h?de.fq.INACTIVE:de.fq.ACTIVE}))},children:h?(0,T.jsx)(z.dz,{muted:!0,size:2*ce.iI}):(0,T.jsx)(z.Py,{default:!0,size:2*ce.iI})}):null,(0,T.jsx)(P.ZP,{default:!h,monospace:!0,success:!!h,children:h?de.fq.ACTIVE:v>=1?de.fq.INACTIVE:"no schedules"},"pipeline_status_".concat(n)),(0,T.jsx)(s(),{as:"/pipelines/".concat(p),href:"/pipelines/[pipeline]",passHref:!0,children:(0,T.jsx)(A.Z,{sameColorAsText:!0,children:p})},"pipeline_name_".concat(n)),(0,T.jsx)(P.ZP,{default:!0,preWrap:!0,title:u,children:u},"pipeline_description_".concat(n)),(0,T.jsx)(P.ZP,{children:O.G7[d]},"pipeline_type_".concat(n)),(0,T.jsx)(P.ZP,{monospace:!0,small:!0,title:a?(0,fe._6)(a):null,children:a?(0,fe.XG)(a,un):(0,T.jsx)(T.Fragment,{children:"\u2014"})},"pipeline_updated_at_".concat(n)),(0,T.jsx)(P.ZP,{monospace:!0,small:!0,title:t?(0,fe._6)(t):null,children:t?(0,fe.XG)(t.slice(0,19),un):(0,T.jsx)(T.Fragment,{children:"\u2014"})},"pipeline_created_at_".concat(n)),g,(0,T.jsx)(P.ZP,{default:0===f,monospace:!0,children:f},"pipeline_block_count_".concat(n)),(0,T.jsx)(P.ZP,{default:0===v,monospace:!0,children:v},"pipeline_trigger_count_".concat(n)),(0,T.jsxs)(Z.Z,{flex:1,justifyContent:"flex-end",children:[(0,T.jsx)(m.ZP,we(we({},Ae),{},{onClick:function(){yn({pipelineUUID:p})},title:"Download (keep folder structure)",children:(0,T.jsx)(z.vc,{default:!0,size:2*ce.iI})})),(0,T.jsx)(w.Z,{mr:1}),(0,T.jsx)(m.ZP,we(we({},Ae),{},{onClick:function(){l.push("/pipelines/[pipeline]","/pipelines/".concat(p))},title:"Detail",children:(0,T.jsx)(z.UY,{default:!0,size:2*ce.iI})})),(0,T.jsx)(w.Z,{mr:1}),(0,T.jsx)(m.ZP,we(we({},Ae),{},{onClick:function(){l.push("/pipelines/[pipeline]/logs","/pipelines/".concat(p,"/logs"))},title:"Logs",children:(0,T.jsx)(z.$B,{default:!0,size:2*ce.iI})}))]},"chevron_icon_".concat(n))]})),rowsGroupedByIndex:t,setRowsSorted:u,sortableColumnIndexes:Cn,sortedColumn:wn,stickyHeader:!0})}),[Rn,$n,yn,un,xn,Ve,l,Se,We,Oe,Fn,Cn,wn,rn,Gn]),Ai=(0,a.useMemo)((function(){return Ei(hn,Zn,wi,Pi,Re)}),[hn,Zn,Ei,wi,Pi,Re]),Si=(0,a.useMemo)((function(){return Ei(mn,jn,yi,Ti,Ue)}),[mn,jn,Ei,yi,Ti,Ue]),Oi=(0,a.useMemo)((function(){return(null===hn||void 0===hn?void 0:hn.length)||0}),[hn]),Mi=(0,a.useMemo)((function(){return(null===mn||void 0===mn?void 0:mn.length)||0}),[mn]),Di=(0,a.useMemo)((function(){return(!on||ke.uuid===Xe)&&!Oi||on&&Pe.uuid===Xe&&!Mi}),[on,Oi,Mi,Xe]),Ri=(0,a.useMemo)((function(){var e=null===Qe||void 0===Qe?void 0:Qe[oe.$D.LIMIT];return(0,T.jsxs)(j.ZP,{alignItems:"center",children:[(0,T.jsx)(P.ZP,{muted:!0,small:!0,children:"Per page"}),(0,T.jsx)(w.Z,{mr:1}),(0,T.jsxs)(N.Z,{compact:!0,onChange:function(e){return(0,ge.u7)((0,r.Z)({},oe.$D.LIMIT,e.target.value),{pushHistory:!0})},small:!0,value:e,children:[e&&(e>5*S.Q||e%S.Q)&&(0,T.jsx)("option",{value:e,children:e}),(0,be.w6)(5).map((function(e,n){var i=(n+1)*S.Q;return(0,T.jsx)("option",{value:i,children:i})}))]})]})}),[Qe]),Ni=(0,a.useMemo)((function(){var e,n,i=cn;on&&Pe.uuid===Xe&&(i=pn);var t=(null===(e=i)||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.count)||0,u=(null===Qe||void 0===Qe?void 0:Qe[oe.$D.LIMIT])||S.Q,o=(null===Qe||void 0===Qe?void 0:Qe[oe.$D.OFFSET])||0,l=Math.ceil(t/u);return(0,T.jsx)(w.Z,{p:ce.cd,children:(0,T.jsx)(S.ZP,{maxPages:S.Et,onUpdate:function(e){var n=Number(e);(0,ge.u7)((0,r.Z)({},oe.$D.OFFSET,n*u))},page:Math.floor(o/u),totalPages:l})})}),[cn,pn,on,Qe,Xe]);return(0,T.jsxs)(x.Z,{errors:Fe,setErrors:qe,subheaderChildren:(0,T.jsxs)(j.ZP,{alignItems:"center",justifyContent:"space-between",children:[ai,Ri]}),title:"Pipelines",uuid:"pipelines/index",children:[on&&(0,T.jsx)(w.Z,{px:ce.cd,ref:c,children:(0,T.jsx)(g.Z,{noPadding:!0,onClickTab:function(e){var n,i=e.uuid;return(0,ge.u7)((n={},(0,r.Z)(n,Te,i),(0,r.Z)(n,oe.$D.LIMIT,null),(0,r.Z)(n,oe.$D.OFFSET,null),n),{pushHistory:!0})},regularSizeText:!0,selectedTabUUID:Xe,tabs:ye.map((function(e){var n=e.Icon,i=e.label;return{Icon:n,label:function(){var e;return i({count:null===cn||void 0===cn||null===(e=cn.metadata)||void 0===e?void 0:e.count})},uuid:e.uuid}})),underlineStyle:!0})}),Di?(0,T.jsx)(w.Z,{p:ce.Mq,children:cn?(0,T.jsx)(P.ZP,{bold:!0,default:!0,monospace:!0,muted:!0,children:"No pipelines available"}):(0,T.jsx)(L.Z,{inverted:!0,large:!0})}):null,(0,T.jsxs)(ae.cl,{hide:Di,includePadding:!!Pn,maxHeight:"calc(100vh - ".concat(K.Mz+74+(D||0)+(null===_||void 0===_||null===(n=_.current)||void 0===n||null===(i=n.getBoundingClientRect)||void 0===i||null===(t=i.call(n))||void 0===t?void 0:t.height),"px)"),children:[(!on||ke.uuid===Xe)&&Ai,on&&Pe.uuid===Xe&&Si]}),(0,T.jsx)("div",{ref:_,children:Ni})]})}Se.getInitialProps=(0,t.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var Oe=(0,D.Z)(Se)},44952:function(e,n,i){"use strict";i.d(n,{K:function(){return u}});var t=i(4383);function u(e){var n=(0,t.ZP)("downloads",e),i=document.createElement("a");i.href=n,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(n),document.body.removeChild(i)}},79274:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines",function(){return i(55620)}])}},function(e){e.O(0,[2678,1154,844,5820,6639,1124,341,1751,1821,4267,6990,8487,8264,7858,5499,4366,4138,5810,1769,1550,90,9264,2474,1952,9774,2888,179],(function(){return n=79274,e(e.s=n);var n}));var n=e.O();_N_E=n}]);