mage-ai 0.9.14__py3-none-any.whl → 0.9.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/api/resources/PipelineRunResource.py +8 -5
- mage_ai/data_preparation/executors/block_executor.py +5 -7
- mage_ai/data_preparation/templates/constants.py +16 -0
- mage_ai/data_preparation/templates/data_exporters/mssql.py +32 -0
- mage_ai/data_preparation/templates/data_loaders/mssql.py +27 -0
- mage_ai/io/base.py +5 -0
- mage_ai/io/mssql.py +1 -0
- mage_ai/orchestration/db/models/base.py +15 -15
- mage_ai/orchestration/db/models/oauth.py +35 -4
- mage_ai/orchestration/pipeline_scheduler.py +12 -6
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/404.html.html +2 -2
- mage_ai/server/frontend_dist/_next/static/chunks/{2786-f71862671f66d948.js → 2786-756b3834d10b8711.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3391-e1578fe1bdb5a557.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/6299-9b785c07dacf22b3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8952-050e60a8b1eaa32a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-03841b6dd7d240f6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-6e2c0e3f818fd4de.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-6e59dc4e57dd2680.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-02295848c811e26a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-ce11db27e4af7869.js → [...slug]-91889109af36a793.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/{CNjkRIWPaAu1yJUmIaX_q → h5mR3pjfn_EQy348CZ_ok}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +2 -2
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +2 -2
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{2786-f71862671f66d948.js → 2786-756b3834d10b8711.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3391-e1578fe1bdb5a557.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6299-9b785c07dacf22b3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8952-050e60a8b1eaa32a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-03841b6dd7d240f6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-6e2c0e3f818fd4de.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-6e59dc4e57dd2680.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-02295848c811e26a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-ce11db27e4af7869.js → [...slug]-91889109af36a793.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/{yJvL-3bfsNF3WCStZ10Dm → xykYLW_ARw5SevdiponLI}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
- mage_ai/server/server.py +12 -1
- mage_ai/shared/retry.py +1 -1
- {mage_ai-0.9.14.dist-info → mage_ai-0.9.15.dist-info}/METADATA +1 -1
- {mage_ai-0.9.14.dist-info → mage_ai-0.9.15.dist-info}/RECORD +123 -122
- mage_ai/server/frontend_dist/_next/static/chunks/3391-6f0a0a5c254cd7f2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6299-fcb702d0f3d3291b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8952-9d6fa18fa9378989.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-2dc2a0dfc0ff620d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-6577159a0af52a78.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-54cb4936accdd2d9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-d331e98ad103b13e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3391-6f0a0a5c254cd7f2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6299-fcb702d0f3d3291b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8952-9d6fa18fa9378989.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-2dc2a0dfc0ff620d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-6577159a0af52a78.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-54cb4936accdd2d9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-d331e98ad103b13e.js +0 -1
- mage_ai/tests/orchestration/db/test_models.py +0 -710
- /mage_ai/server/frontend_dist/_next/static/{CNjkRIWPaAu1yJUmIaX_q → h5mR3pjfn_EQy348CZ_ok}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist/_next/static/{CNjkRIWPaAu1yJUmIaX_q → h5mR3pjfn_EQy348CZ_ok}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{yJvL-3bfsNF3WCStZ10Dm → xykYLW_ARw5SevdiponLI}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{yJvL-3bfsNF3WCStZ10Dm → xykYLW_ARw5SevdiponLI}/_ssgManifest.js +0 -0
- {mage_ai-0.9.14.dist-info → mage_ai-0.9.15.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.14.dist-info → mage_ai-0.9.15.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.14.dist-info → mage_ai-0.9.15.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.14.dist-info → mage_ai-0.9.15.dist-info}/top_level.txt +0 -0
mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-54cb4936accdd2d9.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551,2485],{48591:function(e,n,t){"use strict";var i=t(21831),r=t(75582),o=t(82684),l=t(37958);n.Z=function(e){var n=e.children,t=e.uuid,c=e.uuids,u=void 0===c?[]:c,a=(0,l.j)("apiReloads"),s=(0,r.Z)(a,1)[0],d=(0,i.Z)(u);t&&d.push(t);var p=d.map((function(e){return String(s[e])||"-"})).join("_");return o.cloneElement(n,{key:p})}},2485:function(e,n,t){"use strict";var i=t(21831),r=t(82394),o=t(82684),l=t(38626),c=t(34376),u=t(28413),a=t(60328),s=t(32316),d=t(18908),p=t(67971),f=t(49666),h=t(86673),v=t(54283),m=t(55264),b=t(62749),g=t(19711),x=t(82531),j=t(22341),y=t(38639),k=t(57541),Z=t(33766),O=t(24141),P=t(28598);function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function C(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n,t=e.contained,r=e.defaultLinkUUID,w=e.defaultTab,_=e.objectType,S=e.onClickCustomTemplate,E=e.pipelineUUID,I=e.showAddingNewTemplates,T=e.showBreadcrumbs,D=e.tabs,A=(0,c.useRouter)(),M=(0,o.useContext)(l.ThemeContext),B=(0,O.i)(),R=B.height,N=B.width,L=(0,o.useMemo)((function(){return D||k.dP}),[D]),F=(0,o.useState)(I||!1),U=F[0],H=F[1],W=(0,o.useState)(r?k.qy.find((function(e){return e.uuid===r})):k.qy[0]),z=W[0],V=W[1],G=(0,o.useState)(w?L.find((function(e){return e.uuid===(null===w||void 0===w?void 0:w.uuid)})):L[0]),K=G[0],Y=G[1],q=(0,o.useState)(null),Q=q[0],J=q[1],X=x.ZP.custom_templates.list({object_type:d.Z},{},{pauseFetch:k.n9.uuid!==(null===K||void 0===K?void 0:K.uuid)}),$=X.data,ee=X.mutate,ne=(0,o.useMemo)((function(){var e=(null===$||void 0===$?void 0:$.custom_templates)||[];return null!==z&&void 0!==z&&z.filterTemplates?null===z||void 0===z?void 0:z.filterTemplates(e):e}),[$,z]),te=x.ZP.custom_templates.list({object_type:d.R},{},{pauseFetch:k.A2.uuid!==(null===K||void 0===K?void 0:K.uuid)}),ie=te.data,re=te.mutate,oe=(0,o.useMemo)((function(){var e=(null===ie||void 0===ie?void 0:ie.custom_templates)||[];return null!==z&&void 0!==z&&z.filterTemplates?null===z||void 0===z?void 0:z.filterTemplates(e):e}),[ie,z]),le=(0,o.useMemo)((function(){return k.qy.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,r=e.selectedIconProps,o=e.uuid,l=(null===z||void 0===z?void 0:z.uuid)===o,c=C({size:y.ZG},l&&r?r:{});return(0,P.jsx)(y.wj,{onClick:function(){return V(e)},selected:l,children:(0,P.jsxs)(p.ZP,{alignItems:"center",children:[(0,P.jsx)(y.ze,{backgroundColor:l&&i?i(M):null,children:n?(0,P.jsx)(n,C({},c)):(0,P.jsx)(j.pd,C({},c))}),(0,P.jsx)(g.ZP,{bold:!0,large:!0,children:t?t():o})]})},o)}))}),[z,M]),ce=(0,o.useMemo)((function(){return k.hS.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,r=e.selectedIconProps,o=e.uuid,l=(null===z||void 0===z?void 0:z.uuid)===o,c=C({size:y.ZG},l&&r?r:{});return(0,P.jsx)(y.wj,{onClick:function(){return V(e)},selected:l,children:(0,P.jsxs)(p.ZP,{alignItems:"center",children:[(0,P.jsx)(y.ze,{backgroundColor:l&&i?i(M):null,children:n?(0,P.jsx)(n,C({},c)):(0,P.jsx)(j.pd,C({},c))}),(0,P.jsx)(g.ZP,{bold:!0,large:!0,children:t?t():o})]})},o)}))}),[z,M]),ue=(0,o.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.description,t=e.name,r=e.tags,o=e.template_uuid,l=e.user,c=[];return null!==r&&void 0!==r&&r.length?c.push.apply(c,(0,i.Z)(r)):null!==l&&void 0!==l&&l.username&&c.push(null===l||void 0===l?void 0:l.username),(0,P.jsxs)(y.UE,{onClick:function(){S?S(e):A.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(o)))},children:[(0,P.jsx)(y.Tj,{children:(0,P.jsx)(g.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||o})}),(0,P.jsx)(y.SL,{children:(0,P.jsx)(g.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,P.jsx)(y.EN,{children:(null===c||void 0===c?void 0:c.length)>=1&&(0,P.jsx)(m.Z,{tags:null===c||void 0===c?void 0:c.map((function(e){return{uuid:e}}))})})]},o)}))}),[ne,S,A]),ae=(0,o.useMemo)((function(){return null===oe||void 0===oe?void 0:oe.map((function(e){var n=e.description,t=e.name,r=e.tags,o=e.template_uuid,l=e.user,c=[];return null!==r&&void 0!==r&&r.length?c.push.apply(c,(0,i.Z)(r)):null!==l&&void 0!==l&&l.username&&c.push(null===l||void 0===l?void 0:l.username),(0,P.jsxs)(y.UE,{onClick:function(){S?S(e):A.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(o),"?object_type=").concat(d.R))},children:[(0,P.jsx)(y.Tj,{children:(0,P.jsx)(g.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||o})}),(0,P.jsx)(y.SL,{children:(0,P.jsx)(g.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,P.jsx)(y.EN,{children:(null===c||void 0===c?void 0:c.length)>=1&&(0,P.jsx)(m.Z,{tags:null===c||void 0===c?void 0:c.map((function(e){return{uuid:e}}))})})]},o)}))}),[oe,S,A]),se=(0,o.useMemo)((function(){if(!T)return null;var e=[];return U?e.push.apply(e,[{label:function(){return"Templates"},onClick:function(){H(!1)}},{bold:!0,label:function(){return"New custom template"}}]):e.push({label:function(){return"Templates"}}),(0,P.jsx)(y.FX,{children:(0,P.jsx)(u.Z,{breadcrumbs:e})})}),[U,T]),de=(0,o.useMemo)((function(){return T?36:0}),[T]),pe=(0,o.useMemo)((function(){return R-de}),[R,de]);if(U)return n=d.R===_&&E?(0,P.jsx)(f.Z,{onMutateSuccess:re,pipelineUUID:E,templateAttributes:z&&(null===z||void 0===z?void 0:z.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{pipeline_type:null===z||void 0===z?void 0:z.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}):(0,P.jsx)(b.Z,{contained:t,heightOffset:de,onCreateCustomTemplate:t?function(e){J(e)}:null,onMutateSuccess:ee,templateAttributes:z&&(null===z||void 0===z?void 0:z.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{block_type:null===z||void 0===z?void 0:z.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}),t?(0,P.jsxs)(P.Fragment,{children:[T&&se,(0,P.jsx)(y.Rd,{height:pe,width:N,children:n})]}):n;var fe=(0,P.jsxs)(y.Nk,{children:[(0,P.jsxs)(y.bC,{height:t?pe:null,children:[(0,P.jsx)(y.Yf,{children:(0,P.jsx)(s.Z,{noPadding:!0,onClickTab:function(e){t?Y(e):(0,Z.u7)({object_type:k.A2.uuid===e.uuid?d.R:d.Z})},selectedTabUUID:null===K||void 0===K?void 0:K.uuid,tabs:L})}),(0,P.jsxs)(y.wl,{contained:t,heightOffset:de,children:[k.n9.uuid===(null===K||void 0===K?void 0:K.uuid)&&le,k.A2.uuid===(null===K||void 0===K?void 0:K.uuid)&&ce]})]}),(0,P.jsxs)(y.w5,{children:[k.n9.uuid===(null===K||void 0===K?void 0:K.uuid)&&(0,P.jsx)(y.HS,{children:(0,P.jsx)(a.Z,{beforeIcon:(0,P.jsx)(j.mm,{size:y.ZG}),onClick:function(){H(!0)},primary:!0,children:"New block template"})}),k.n9.uuid===(null===K||void 0===K?void 0:K.uuid)&&(0,P.jsxs)(P.Fragment,{children:[!$&&(0,P.jsx)(h.Z,{p:2,children:(0,P.jsx)(v.Z,{inverted:!0})}),$&&!(null!==ue&&void 0!==ue&&ue.length)&&(0,P.jsxs)(h.Z,{p:2,children:[(0,P.jsx)(g.ZP,{children:"There are currently no templates matching your search."}),(0,P.jsx)("br",{}),(0,P.jsx)(g.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ue||void 0===ue?void 0:ue.length)>=1&&(0,P.jsx)(y.n8,{children:ue})]}),k.A2.uuid===(null===K||void 0===K?void 0:K.uuid)&&(0,P.jsxs)(P.Fragment,{children:[!ie&&(0,P.jsx)(h.Z,{p:2,children:(0,P.jsx)(v.Z,{inverted:!0})}),ie&&!(null!==ae&&void 0!==ae&&ae.length)&&(0,P.jsxs)(h.Z,{p:2,children:[(0,P.jsx)(g.ZP,{children:"There are currently no templates matching your search."}),(0,P.jsx)("br",{}),(0,P.jsx)(g.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ae||void 0===ae?void 0:ae.length)>=1&&(0,P.jsx)(y.n8,{children:ae})]})]})]});return t?(0,P.jsxs)(P.Fragment,{children:[T&&se,(0,P.jsx)(y.Rd,{height:pe,width:N,children:fe})]}):fe}},91207:function(e,n,t){"use strict";t.d(n,{Z:function(){return R}});var i=t(82394),r=t(75582),o=t(17717),l=t(82684),c=t(37958),u=t(83455),a=t(35490),s=t(86422),d=t(60328),p=t(38626),f=t(93461),h=t(67971),v=t(28598),m=p.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),b=p.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),g=function(e){var n=e.children,t=e.divider,i=l.Children.toArray(n).length;return(0,v.jsx)(m,{children:(0,v.jsx)(h.ZP,{children:l.Children.map(n,(function(e,n){return e&&(0,v.jsxs)(f.Z,{children:[n>=1&&t&&(0,v.jsx)(b,{}),l.cloneElement(e,{borderRadiusLeft:i>=2&&0===n,borderRadiusRight:i>=2&&n===i-1,halfPaddingLeft:i>=2&&0!==n,halfPaddingRight:i>=2&&n!==i-1,noBorder:i>=2&&n>0&&n<i-1,noBorderRight:i>=2&&n!==i-1})]},"button-group-child-".concat(n))}))})})},x=t(57722),j=t(73828),y=t(11135),k=t(98781),Z=t(86673),O=t(82531),P=t(16115),w=t(94353),C=t(60701),_=t(55512),S=t(24224),E=t(32821),I=t(90211),T=t(96510),D=t(51504),A=t(41150);function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function B(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?M(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):M(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var R=function(e){var n=e.active,t=e.addNewBlock,p=e.disableRefreshWarning,f=e.fetchPipeline,m=e.fetchVariables,b=e.filePath,M=e.hideHeaderButtons,R=e.onContentChange,N=e.openSidekickView,L=e.pipeline,F=e.saveFile,U=e.selectedFilePath,H=e.sendTerminalMessage,W=e.setDisableShortcuts,z=e.setErrors,V=e.setFilesTouched,G=e.setSelectedBlock,K=(0,c.j)("apiReloads"),Y=(0,r.Z)(K,2)[1],q=(0,l.useState)(null),Q=q[0],J=q[1],X=(0,l.useState)(!1),$=X[0],ee=(X[1],(0,l.useRef)(null)),ne=(0,l.useMemo)((function(){return new a.Z}),[]),te=(0,l.useMemo)((function(){return{api_key:w.l,token:ne.decodedToken.token}}),[ne]),ie=O.ZP.statuses.list().data,re=(0,l.useMemo)((function(){var e,n;return null===ie||void 0===ie||null===(e=ie.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[ie]),oe=O.ZP.file_contents.detail(b).data;(0,l.useEffect)((function(){null!==oe&&void 0!==oe&&oe.file_content&&J(oe.file_content)}),[oe]);var le=(0,l.useState)(null===Q||void 0===Q?void 0:Q.content),ce=le[0],ue=le[1],ae=(0,l.useCallback)((function(e){ue(e),R&&(null===R||void 0===R||R(e))}),[R]),se=(0,l.useState)(!1),de=se[0],pe=se[1];(0,l.useEffect)((function(){n&&W&&(null===W||void 0===W||W(!0))}),[n,W]),(0,l.useEffect)((function(){var e;U&&(null===ee||void 0===ee||null===(e=ee.current)||void 0===e||e.scrollIntoView())}),[U]);var fe=(0,u.Db)(O.ZP.file_contents.useUpdate((null===Q||void 0===Q?void 0:Q.path)&&encodeURIComponent(null===Q||void 0===Q?void 0:Q.path)),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){Y((function(e){return B(B({},e),{},(0,i.Z)({},"FileVersions/".concat(null===Q||void 0===Q?void 0:Q.path),Number(new Date)))}))},onErrorCallback:function(e,n){return null===z||void 0===z?void 0:z({errors:n,response:e})}})}}),he=(0,r.Z)(fe,1)[0],ve=(0,l.useCallback)((function(e,n){if(F)return F(e,n);he({file_content:B(B({},n),{},{content:e})}).then((function(){decodeURIComponent(b).split(o.sep).pop()===j.dT.METADATA_YAML&&m&&(null===m||void 0===m||m())})),V((function(e){return B(B({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),pe(!1)}),[m,b,F,V,he]),me=(0,l.useMemo)((function(){return(0,_.lU)()}),[]),be=(0,l.useMemo)((function(){var e,n,t,i;return null===(null===Q||void 0===Q||null===(e=Q.path)||void 0===e?void 0:e.match(me))?j.Lu.TXT:null===Q||void 0===Q||null===(n=Q.path)||void 0===n||null===(t=n.match(me))||void 0===t||null===(i=t[0])||void 0===i?void 0:i.split(".")[1]}),[me,Q]),ge=(0,l.useMemo)((function(){if(null!==Q&&void 0!==Q&&Q.path)return(0,v.jsx)(x.Z,{autoHeight:!0,language:j.nB[be],onChange:function(e){ae(e),V((function(e){return B(B({},e),{},(0,i.Z)({},null===Q||void 0===Q?void 0:Q.path,!0))})),pe(!0)},onSave:function(e){ve(e,Q)},selected:!0,textareaFocused:!0,value:(0,I.Pb)(null===Q||void 0===Q?void 0:Q.content)?JSON.stringify(JSON.parse(null===Q||void 0===Q?void 0:Q.content),null,2):null===Q||void 0===Q?void 0:Q.content,width:"100%"})}),[Q,be,ve,ae,V]),xe=null!==L&&void 0!==L&&L.blocks?(0,S.sE)(null===L||void 0===L?void 0:L.blocks,(function(e){var n=e.type;return s.tf.DATA_EXPORTER===n})):null,je=(0,u.Db)(O.ZP.blocks.pipelines.useUpdate(null===L||void 0===L?void 0:L.uuid,null===xe||void 0===xe?void 0:xe.uuid),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){null===f||void 0===f||f()}})}}),ye=(0,r.Z)(je,1)[0],ke=t&&L&&(be===j.Lu.PY||be===j.Lu.SQL||(be===j.Lu.YAML||be===j.Lu.R)&&(0,E.V3)(Q,null===Q||void 0===Q?void 0:Q.path))&&(0,_.ck)(Q.path.split(o.sep))!==s.tf.SCRATCHPAD&&(0,E.lr)(Q)&&(0,v.jsx)(d.Z,{onClick:function(){var e=(null===L||void 0===L?void 0:L.type)===k.qL.INTEGRATION,n=(0,_.TU)(Q,re,L);t(n,(function(n){e&&xe&&ye({block:B(B({},xe),{},{upstream_blocks:[n.uuid]})}),null===G||void 0===G||G(n)}))},primary:!0,children:"Add to current pipeline"}),Ze=H&&(0,v.jsx)(Z.Z,{m:2,children:(0,v.jsx)(y.ZP,{disabled:!re,inline:!0,loading:$,onClick:function(){null===N||void 0===N||N(C.cH.TERMINAL),null===H||void 0===H||H(JSON.stringify(B(B({},te),{},{command:["stdin","pip install -r ".concat(re,"/requirements.txt\r")]})))},title:re?"Pip install packages from your saved requirements.txt file (\u2318+S to save).":"Please use right panel terminal to install packages.",uuid:"FileEditor/InstallPackages",children:"Install packages"})}),Oe="FileEditor/".concat(null===Q||void 0===Q?void 0:Q.path),Pe=(0,A.y)(),we=Pe.registerOnKeyDown,Ce=Pe.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){Ce(Oe)}}),[Ce,Oe]),we(Oe,(function(e,t){if(n&&!p)if((0,D.y)([P.zX,P.Um],t)||(0,D.y)([P.PQ,P.Um],t))e.preventDefault(),ve(ce,Q);else if(de&&(0,D.y)([P.zX,P.hS],t)){e.preventDefault();var i="".concat(Q.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[n,ce,p,Q,ve,de]),(0,v.jsxs)("div",{ref:ee,children:[!M&&(0,v.jsx)(Z.Z,{p:2,children:(0,v.jsxs)(h.ZP,{justifyContent:"space-between",children:[(0,v.jsxs)(g,{children:[ke,(0,v.jsx)(d.Z,{disabled:!ce,onClick:function(e){e.preventDefault(),ve(ce,Q)},title:ce?null:"No changes have been made to this file.",children:"Save file content"})]}),N&&(0,v.jsx)(g,{children:(0,v.jsx)(d.Z,{compact:!0,onClick:function(){N(C.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),ge,b===j.dT.REQS_TXT&&Ze]})}},23351:function(e,n,t){"use strict";var i=t(82394),r=t(75582),o=t(17717),l=t(37958),c=t(82684),u=t(83455),a=t(60328),s=t(57722),d=t(73828),p=t(93461),f=t(67971),h=t(87372),v=t(86673),m=t(54283),b=t(87815),g=t(19711),x=t(82531),j=t(49125),y=t(55512),k=t(42305),Z=t(90211),O=t(96510),P=t(66653),w=t(24224),C=t(28598);function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function S(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.onActionCallback,t=e.selectedBlock,_=e.selectedFilePath,E=e.setErrors,I=e.width,T=(0,l.j)("apiReloads"),D=(0,r.Z)(T,2)[1],A=x.ZP.file_versions.files.list(_&&encodeURIComponent(_)),M=A.data,B=A.mutate,R=(0,c.useMemo)((function(){return(null===M||void 0===M?void 0:M.file_versions)||[]}),[M]),N=(0,c.useState)(null),L=N[0],F=N[1],U=(0,c.useMemo)((function(){return null===R||void 0===R?void 0:R[L]}),[L,R]),H=x.ZP.file_contents.detail(U?encodeURIComponent(U.path):null).data,W=(0,c.useMemo)((function(){return null===H||void 0===H?void 0:H.file_content}),[H]),z=(0,c.useMemo)((function(){return(0,y.lU)()}),[]),V=(0,c.useMemo)((function(){var e,n,t;return null===_||void 0===_||null===(e=_.match(z))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[_,z]),G=(0,u.Db)(x.ZP.file_contents.useUpdate(_&&encodeURIComponent(_)),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(e){var t;_&&B();var r=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(r);if(r){var c=r.split(o.sep);if("pipelines"===c[0]){var u=c.slice(1,c.length-1).join(o.sep);l="PipelineDetail/".concat(u)}}D((function(e){return S(S({},e),{},(0,i.Z)({},l,Number(new Date)))})),F((function(e){return e+1})),null===n||void 0===n||n(e)},onErrorCallback:function(e,n){return E({errors:n,response:e})}})}}),K=(0,r.Z)(G,2),Y=K[0],q=K[1].isLoading,Q=(0,c.useMemo)((function(){var e=R.map((function(e){var n=e.name,t=e.path;return[(0,C.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(p.Z,{flex:1,children:[(0,C.jsx)(g.ZP,{default:!0,monospace:!0,children:(0,k.JX)(n,{withSeconds:!0})}),(0,C.jsx)(v.Z,{px:2*j.cd,children:(0,C.jsx)(g.ZP,{monospace:!0,children:n})})]}),U&&(null===U||void 0===U?void 0:U.path)===t&&(0,C.jsx)(a.Z,{compact:!0,loading:q,onClick:function(e){(0,P.j)(e),Y({file_content:{version:n}})},small:!0,children:"Replace with this version"})]},n)]}));if(U){var n=(0,C.jsx)(v.Z,{p:j.cd,children:(0,C.jsx)(m.Z,{},"spinner")});if(W&&(null===W||void 0===W?void 0:W.path)===(null===U||void 0===U?void 0:U.path)){var t=W.content,i=void 0===t?"":t;n=(0,C.jsx)(s.Z,{autoHeight:!0,language:d.nB[V],padding:!0,readOnly:!0,value:(0,Z.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:I})}e=(0,w.Hk)([n],L+1,e)}return e}),[W,V,R,q,U,L,Y,I]);return(0,C.jsxs)("div",{style:{width:I},children:[(0,C.jsxs)(v.Z,{p:j.cd,children:[(0,C.jsx)(h.Z,{level:5,children:"File versions"}),(0,C.jsx)(g.ZP,{inline:!0,monospace:!0,children:_?decodeURIComponent(_):null===t||void 0===t?void 0:t.uuid})]}),(0,C.jsx)(b.Z,{buildRowProps:function(e){if(U&&L+1===e)return{renderCell:function(e){return e},renderRow:function(e){return e}}},columnFlex:[1],columns:[{uuid:"Version"}],isSelectedRow:function(e){var n;return(null===(n=R[e])||void 0===n?void 0:n.name)===(null===U||void 0===U?void 0:U.name)},onClickRow:function(e){U?e===L?F(null):e<L?F(e):e>L+1&&F(e-1):F(e)},rows:Q})]})}},83766:function(e,n,t){"use strict";var i=t(82394),r=t(86673),o=t(87815),l=t(19711),c=t(82944),u=t(49125),a=t(28598);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,s=e.setObjectAttributes;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(r.Z,{mb:1,px:u.cd,children:[(0,a.jsx)(l.ZP,{bold:!0,children:"Outdated after"}),(0,a.jsx)(l.ZP,{muted:!0,small:!0,children:"After the global data product successfully completes running, how long after that will the global data product be outdated?"})]}),(0,a.jsx)(o.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var r,o,u=e.uuid,p=null===n||void 0===n||null===(r=n.outdated_after)||void 0===r?void 0:r[u],f=null===t||void 0===t||null===(o=t.outdated_after)||void 0===o?void 0:o[u];return[(0,a.jsxs)(l.ZP,{default:!0,monospace:!0,children:[u," ",f&&(0,a.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(u)),(0,a.jsx)(c.Z,{compact:!0,monospace:!0,onChange:function(e){return s((function(n){var t;return d(d({},n),{},{outdated_after:d(d({},null===n||void 0===n?void 0:n.outdated_after),{},(0,i.Z)({},u,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},placeholder:"Enter a number",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof p||null===p?"":p},"input-".concat(u))]}))})]})}},31682:function(e,n,t){"use strict";var i=t(82394),r=t(55378),o=t(86673),l=t(87815),c=t(19711),u=t(82944),a=t(49125),s=t(90211),d=t(24224),p=t(28598);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,f=e.setObjectAttributes;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(o.Z,{mb:1,px:a.cd,children:[(0,p.jsxs)(c.ZP,{bold:!0,children:["Outdated starting at ",(0,p.jsx)(c.ZP,{inline:!0,muted:!0,children:"(optional)"})]}),(0,p.jsx)(c.ZP,{muted:!0,small:!0,children:"If enough time has passed since the last global data product has ran successfully and the global data product is determined to be outdated, then you can configure it to be outdated at a specific date or time."}),(0,p.jsx)("div",{style:{marginTop:4},children:(0,p.jsxs)(c.ZP,{muted:!0,small:!0,children:["For example, let\u2019s say the global data product is outdated after 12 hours. The last successful run was yesterday at 18:00. The global data product will be outdated today at 06:00. However, if the ",(0,p.jsx)(c.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Outdated starting at"})," has a value of 17 for ",(0,p.jsx)(c.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Hour of day"}),", then the global data product won\u2019t run again until today at 17:00."]})})]}),(0,p.jsx)(l.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"second_of_minute",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"minute_of_hour",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"hour_of_day",values:(0,d.w6)(24).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"day_of_week",values:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map((function(e,n){return{uuid:e,value:n}}))},{uuid:"day_of_month",values:(0,d.w6)(31).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"day_of_year",values:(0,d.w6)(365).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_month",values:(0,d.w6)(5).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_year",values:(0,d.w6)(52).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"month_of_year",values:["January","February","March","April","May","June","July","August","September","October","November","December"].map((function(e,n){return{uuid:e,value:n+1}}))}].map((function(e){var o,l,a,d=e.uuid,v=e.values,m=null===n||void 0===n||null===(o=n.outdated_starting_at)||void 0===o?void 0:o[d],b=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],g={compact:!0,key:"outdated-starting-at-input-".concat(d),monospace:!0,onChange:function(e){return f((function(n){var t;return h(h({},n),{},{outdated_starting_at:h(h({},null===n||void 0===n?void 0:n.outdated_starting_at),{},(0,i.Z)({},d,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},primary:!0,small:!0,value:"undefined"===typeof m||null===m?"":m};return a=v?(0,p.jsx)(r.Z,h(h({},g),{},{placeholder:"Select a value",children:v.map((function(e){var n=e.uuid,t=e.value;return(0,p.jsx)("option",{value:t,children:n},t)}))})):(0,p.jsx)(u.Z,h(h({},g),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,p.jsxs)(c.ZP,{default:!0,monospace:!0,children:[(0,s.vg)(d)," ",b&&(0,p.jsxs)(c.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"outdated-starting-at-label-".concat(d)),a]}))})]})}},21978:function(e,n,t){"use strict";var i=t(82394),r=t(12691),o=t.n(r),l=t(38341),c=t(10919),u=t(86673),a=t(87815),s=t(19711),d=t(82944),p=t(49125),f=t(28598);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.blocks,t=e.objectAttributes,r=e.originalAttributes,h=e.setObjectAttributes;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(u.Z,{mb:1,px:p.cd,children:[(0,f.jsx)(s.ZP,{bold:!0,children:"Block data to output"}),(0,f.jsx)(s.ZP,{muted:!0,small:!0,children:"The data output from the block(s) you select below will be the data product that is returned when a downstream entity is requesting data from this global data product."}),(0,f.jsx)("div",{style:{marginTop:4},children:(0,f.jsx)(s.ZP,{muted:!0,small:!0,children:"When requesting data from this global data product, the selected block(s) will return data from its most recent partition. You can override this by adding a value in the partitions setting. For example, if you set the partitions value to 5, then the selected block will return data from its 5 most recent partitions. If you set the partitions value to 0, then all the partitions will be returned."})})]}),(0,f.jsx)(a.Z,{columnFlex:[null,1,null],columns:[{label:function(){return""},uuid:"selected"},{uuid:"Block UUID"},{uuid:"Partitions"}],rows:null===n||void 0===n?void 0:n.map((function(e){var n,u=e.uuid,a=null===t||void 0===t?void 0:t.settings,p=null===a||void 0===a?void 0:a[u],m=null===p||void 0===p?void 0:p.partitions,b=null===r||void 0===r||null===(n=r.settings)||void 0===n?void 0:n[u],g=null===b||void 0===b?void 0:b.partitions,x=!!p||!!b;return[(0,f.jsx)(l.Z,{checked:x,onClick:function(){return function(e){h((function(n){var t=(null===n||void 0===n?void 0:n.settings)||{};return e?t[u]={}:null===t||void 0===t||delete t[u],v(v({},n),{},{settings:t})}))}(!x)}},"selected--".concat(u)),(0,f.jsxs)("div",{children:[(0,f.jsx)(o(),{as:"/pipelines/".concat(null===t||void 0===t?void 0:t.object_uuid,"/edit?block_uuid=").concat(u),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,f.jsx)(c.Z,{monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:u})})," ",g&&(0,f.jsxs)(s.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"block-uuid-".concat(u)),(0,f.jsx)(d.Z,{compact:!0,monospace:!0,onChange:function(e){return h((function(n){var t,r;return v(v({},n),{},{settings:v(v({},null===n||void 0===n?void 0:n.settings),{},(0,i.Z)({},u,v(v({},null===n||void 0===n||null===(t=n.settings)||void 0===t?void 0:t[u]),{},{partitions:0===(null===(r=e.target.value)||void 0===r?void 0:r.length)?null:Number(e.target.value)})))})}))},placeholder:"1",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof m||null===m?"":m},"input-".concat(u))]}))})]})}},65232:function(e,n,t){"use strict";var i=t(12691),r=t.n(i),o=t(82684),l=t(34376),c=t(30119),u=t(10919),a=t(86673),s=t(54283),d=t(87815),p=t(19711),f=t(82531),h=t(49125),v=t(66653),m=t(28598);n.Z=function(e){var n=e.globalDataProducts,t=e.onClickRow,i=(0,l.useRouter)(),b=f.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,g=(0,o.useMemo)((function(){return n||(null===b||void 0===b?void 0:b.global_data_products)||[]}),[b,n]);return b||n?b&&0===(null===g||void 0===g?void 0:g.length)?(0,m.jsx)(a.Z,{p:h.cd,children:(0,m.jsx)(p.ZP,{children:"There are currently no global data products registered."})}):(0,m.jsx)(d.Z,{columnFlex:[1,null,null],columns:[{uuid:"UUID"},{uuid:"Object type"},{uuid:"Object UUID"}],onClickRow:function(e){var n=null===g||void 0===g?void 0:g[e];n&&(t?null===t||void 0===t||t(n):i.push("/global-data-products/[...slug]","/global-data-products/".concat(null===n||void 0===n?void 0:n.uuid)))},rows:null===g||void 0===g?void 0:g.map((function(e){var n=e.object_type,t=e.object_uuid,o=e.uuid,l={as:null,href:null};return c.b.PIPELINE===n&&(l.as="/pipelines/".concat(t,"/edit"),l.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(p.ZP,{monospace:!0,children:o},"uuid"),(0,m.jsx)(p.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(r(),{as:null===l||void 0===l?void 0:l.as,href:(null===l||void 0===l?void 0:l.href)||"",passHref:!0,children:(0,m.jsx)(u.Z,{default:!0,monospace:!0,onClick:function(e){(0,v.j)(e),i.push(l.href,l.as)},preventDefault:!0,children:t})},"objectUUID")]})),uuid:"global-data-products"}):(0,m.jsx)(a.Z,{p:h.cd,children:(0,m.jsx)(s.Z,{})})}},85307:function(e,n,t){"use strict";t.d(n,{$W:function(){return a},cl:function(){return s},cv:function(){return d},dE:function(){return u}});var i=t(38626),r=t(23831),o=t(73942),l=t(49125),c=t(37391),u=i.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],o.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).popup,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-1"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeTextarea,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-2"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],c.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-3"})(["padding:","px;"," "," ",""],2*l.iI,(function(e){return"\n background-color: ".concat((e.theme||r.Z).interactive.defaultBackground,";\n border-bottom: ").concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||r.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(o.n_,"px;\n border-top-right-radius: ").concat(o.n_,"px;\n ")}))},38488:function(e,n,t){"use strict";t.d(n,{Z:function(){return P}});var i=t(82394),r=t(26304),o=t(82684),l=t(38626),c=t(16634),u=t(67971),a=t(10919),s=t(86673),d=t(19711),p=t(46261),f=t(23831),h=t(22341),v=t(28347),m=t(49125),b=t(33766),g=t(66653),x=t(28598);var j=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,r=e.isLast,l=e.onClickTab,j=e.onClickTabClose,y=e.renderTabTitle,k=e.savePipelineContent,Z=e.selected,O=e.themeContext,P=(0,o.useState)(!1),w=P[0],C=P[1];return(0,x.jsx)(u.ZP,{flexDirection:"column",fullHeight:!0,onClick:function(e){e.preventDefault(),Z||(l?l(n):(null===k||void 0===k||k(),(0,b.u7)({file_path:encodeURIComponent(n)})))},onMouseEnter:function(){return C(!0)},onMouseLeave:function(){return C(!1)},children:(0,x.jsx)(v.Gb,{last:r,selected:Z,children:(0,x.jsxs)(u.ZP,{alignItems:"center",fullHeight:!0,children:[(0,x.jsx)(p.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,x.jsxs)(u.ZP,{alignItems:"center",fullHeight:!0,children:[!i[n]&&(0,x.jsx)(h.iU,{muted:!Z,size:1.5*m.iI}),i[n]&&(0,x.jsx)(p.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,x.jsx)("div",{style:{padding:1},children:(0,x.jsx)(c.Z,{borderColor:(O||f.Z).borders.danger,size:1.25*m.iI})})}),(0,x.jsx)(s.Z,{mr:1}),(0,x.jsx)(d.ZP,{muted:!Z,children:y?y(n):n})]})}),(0,x.jsx)(s.Z,{mr:2}),(0,x.jsx)(p.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,x.jsxs)(a.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(e){(0,g.j)(e),null===j||void 0===j||j(n)},preventDefault:!0,children:[(w||Z)&&(0,x.jsx)(h.x8,{muted:!Z,size:1.25*m.iI}),!w&&!Z&&(0,x.jsx)("div",{style:{width:1.25*m.iI}})]})})]})})})},y=t(24224),k=["filePaths","isSelectedFilePath","onClickTabClose","selectedFilePath"];function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var P=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTabClose,c=e.selectedFilePath,a=(0,r.Z)(e,k),s=(0,o.useContext)(l.ThemeContext),d=(0,o.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),p=(0,o.useMemo)((function(){return null===d||void 0===d?void 0:d.length}),[d]);return(0,x.jsx)(u.ZP,{alignItems:"center",justifyContent:"flex-start",children:null===d||void 0===d?void 0:d.map((function(e,n){var r=t?t(e,c):c===encodeURIComponent(e);return(0,o.createElement)(j,O(O({},a),{},{filePath:e,isLast:n===p-1,key:e,onClickTabClose:function(e){if(i)i(e);else{var n=(0,y.Od)(d,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,b.u7)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})}},selected:r,themeContext:s}))}))})}},70543:function(e,n,t){"use strict";t.d(n,{IY:function(){return l},Jf:function(){return o},LR:function(){return r},NR:function(){return c},b7:function(){return i}});var i="edit",r="[ERR_BLOCK_EXISTS]",o={uuid:"All files"},l={uuid:"Files in pipeline"},c=[o,l]},28347:function(e,n,t){"use strict";t.d(n,{Gb:function(){return p},fm:function(){return s},lO:function(){return a},rK:function(){return d},zn:function(){return u}});var i=t(38626),r=t(23831),o=t(82386),l=t(49125),c=t(37391),u=300,a=i.default.div.withConfig({displayName:"indexstyle__PipelineContainerStyle",componentId:"sc-1sv9513-0"})([".pipeline-detail-enter-active{opacity:1;transition:opacity ","ms linear;}.pipeline-detail-enter-done{opacity:0;transition:opacity ","ms linear;}"],u,u),s=i.default.div.withConfig({displayName:"indexstyle__OverlayStyle",componentId:"sc-1sv9513-1"})(["height:100vh;opacity:1;position:fixed;width:100vw;z-index:9999;",""],(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeArea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],o.Wi,o.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||r.Z.borders).medium,";\n ")}),(function(e){return e.relativePosition&&"\n position: relative;\n "}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(o.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,c.y$)()),p=i.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-right:1px solid transparent;height:100%;padding:","px ","px;"," "," ",""],l.iI,l.cd*l.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||r.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||r.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||r.Z.borders).light," !important;\n ")}))},59920:function(e,n,t){"use strict";var i;t.d(n,{M:function(){return i}}),function(e){e.BACKFILLS="backfills",e.BLOCK_RUNS="block_runs",e.EDIT="edit",e.MONITOR="monitor",e.PIPELINE_LOGS="pipeline_logs",e.PIPELINE_RUNS="pipeline_runs",e.RUNS="runs",e.SETTINGS="settings",e.SYNCS="syncs",e.TRIGGERS="triggers"}(i||(i={}))},36405:function(e,n,t){"use strict";t.d(n,{H:function(){return c}});var i=t(98781),r=t(22341),o=t(59920),l=t(9736);function c(e,n,t){var c=(n||{}).uuid||t,u=[{Icon:r.Bf,id:o.M.TRIGGERS,isSelected:function(){return o.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(c,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:r.Pf,id:o.M.RUNS,isSelected:function(){return o.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(c,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:r.dE,id:o.M.BACKFILLS,isSelected:function(){return o.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(c,"/backfills"),href:"/pipelines/[pipeline]/backfills"}},{Icon:r.UL,id:o.M.PIPELINE_LOGS,isSelected:function(){return o.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(c,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:r.ug,id:o.M.MONITOR,isSelected:function(){return o.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(c,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.INTEGRATION===(null===n||void 0===n?void 0:n.type)&&u.unshift({Icon:r.Nt,id:o.M.SYNCS,isSelected:function(){return o.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(c,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),(0,l.Ct)()||(u.unshift({Icon:r.EK,disabled:!c,id:o.M.EDIT,isSelected:function(){return o.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(c,"/edit"),href:"/pipelines/[pipeline]/edit"}}),u.push({Icon:r.Zr,id:o.M.SETTINGS,isSelected:function(){return o.M.SETTINGS===e},label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(c,"/settings"),href:"/pipelines/[pipeline]/settings"}})),u}},58122:function(e,n,t){"use strict";t.d(n,{FS:function(){return u},JZ:function(){return s},e7:function(){return d},wx:function(){return a}});var i=t(75582),r=t(82394),o=t(93348);function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function u(e){return"string"===typeof e?e:JSON.stringify(e)}function a(e,n){var t,i;return null===e||void 0===e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(i=t.variables)||void 0===i?void 0:i.map((function(e){var n=e.value;return c(c({},e),{},{value:u(n)})}))}function s(e,n){return n===o.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===o.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function d(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),o=t[0],l=t[1],u=l;try{u=JSON.parse(l)}catch(a){}return c(c({},e),{},(0,r.Z)({},o,u))}),{}):e}},55264:function(e,n,t){"use strict";var i=t(82684),r=t(79891),o=t(67971),l=t(19711),c=t(24224),u=t(28598);n.Z=function(e){var n=e.onClickTag,t=e.tags,a=void 0===t?[]:t,s=(0,i.useMemo)((function(){return(null===a||void 0===a?void 0:a.length)||0}),[a]),d=(0,i.useMemo)((function(){return(0,c.YC)(a||[],"uuid")}),[a]);return(0,u.jsx)(o.ZP,{alignItems:"center",flexWrap:"wrap",children:null===d||void 0===d?void 0:d.reduce((function(e,t){return e.push((0,u.jsx)("div",{style:{marginBottom:2,marginRight:s>=2?4:0,marginTop:2},children:(0,u.jsx)(r.Z,{onClick:n?function(){return n(t)}:null,small:!0,children:(0,u.jsx)(l.ZP,{children:t.uuid})})},"tag-".concat(t.uuid))),e}),[])})}},68735:function(e,n,t){"use strict";var i=t(26304),r=t(21831),o=t(82394),l=t(82684),c=t(26226),u=t(38626),a=t(90948),s=t(84969),d=t(65743),p=t(85587),f=t(79487),h=t(52136),v=t(67778),m=t(29989),b=t(17066),g=t(84482),x=t(76771),j=t(98889),y=t(65376),k=t(61655),Z=t(97745),O=t(48072),P=t(10103),w=t(84181),C=t(24903),_=t(67971),S=t(19711),E=t(52359),I=t(23831),T=t(80906),D=t(73899),A=t(2005),M=t(31012),B=t(49125),R=t(24224),N=t(344),L=t(45739),F=t(28598),U=["areaBetweenLines","data","events","height","lineLegendNames","margin","width","xAxisLabel","xLabelFormat","yAxisLabel","yLabelFormat"];function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function W(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?H(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):H(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var z=W(W({},y.j),{},{backgroundColor:I.Z.background.muted,border:"none"}),V=(0,k.Z)((function(e){var n=e.areaBetweenLines,t=e.data,i=e.events,o=void 0!==i&&i,c=e.getX,k=e.getY,_=e.getYScaleValues,E=e.gridProps,U=void 0===E?{}:E,H=e.height,V=e.hideGridX,G=e.hideTooltip,K=e.increasedXTicks,Y=e.lineLegendNames,q=e.margin,Q=e.noCurve,J=e.numYTicks,X=e.renderXTooltipContent,$=e.renderYTooltipContent,ee=e.showTooltip,ne=e.thickStroke,te=e.tooltipData,ie=e.tooltipLeft,re=void 0===ie?0:ie,oe=e.tooltipTop,le=void 0===oe?[]:oe,ce=e.width,ue=e.xLabelFormat,ae=e.xLabelRotate,se=void 0===ae||ae,de=e.yLabelFormat,pe=(0,l.useContext)(u.ThemeContext),fe=c||function(e){return null===e||void 0===e?void 0:e.x},he=k||function(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null===e||void 0===e||null===(n=e.y)||void 0===n?void 0:n[t]},ve=I.Z.monotone.gray,me=I.Z.brand.wind200,be=I.Z.content.muted,ge=I.Z.monotone.gray,xe=t.map((function(e){return Number(fe(e))}));if(ce<10)return null;var je=ce-q.left-q.right,ye=H-q.top-q.bottom,ke=je/2,Ze=0===t.length?0:Math.max.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return(null===n||void 0===n?void 0:n.length)||0})))),Oe=(0,l.useMemo)((function(){return(0,w.Z)({domain:[Math.min.apply(Math,(0,r.Z)(xe)),Math.max.apply(Math,(0,r.Z)(xe))],range:[0,je]})}),[je,xe]),Pe=Math.min.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return Math.min.apply(Math,(0,r.Z)(_?_(n):n||[]))})))),we=Math.max.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return Math.max.apply(Math,(0,r.Z)(_?_(n):n||[]))})))),Ce=(0,l.useMemo)((function(){return(0,w.Z)({domain:[Pe,we],nice:!0,range:[ye,0]})}),[ye,we,Pe]),_e=ce>520?K?20:10:K?10:5,Se=(0,L.K)(pe),Ee=be,Ie=Se.map((function(e){return{stroke:e}})),Te=(0,C.Z)({domain:Y||[],range:Ie.map((function(e){return e.stroke}))}),De=(0,l.useCallback)((function(e){var n=((0,O.Z)(e)||{x:0}).x,i=Oe.invert(n-q.left),r=(0,R.ry)(xe,(function(e){return i>=e})),o=t[r-1],l=t[r],c=o;l&&(i-fe(o)>fe(l)-i?c=l:(c=o,r-=1));var u=(0,P.range)(0,Ze).map((function(e){return Ce(he(c,e))})),a=u.some((function(e){return"undefined"===typeof e}));(he(c)||_&&!a)&&ee({tooltipData:W(W({},c),{},{index:r}),tooltipLeft:n,tooltipTop:u})}),[t,fe,he,_,q,ee,Oe,xe,Ce]),Ae={};return Q||(Ae.curve=Z.ZP),(0,F.jsxs)(F.Fragment,{children:[Y&&(0,F.jsx)("div",{style:{marginLeft:null===q||void 0===q?void 0:q.left},children:(0,F.jsx)(b.Z,{labelFormat:function(e){return e},scale:Te,children:function(e){return(0,F.jsx)("div",{style:{display:"flex",flexDirection:T.qs.ROW},children:e.map((function(e,n){return(0,F.jsxs)(g.Z,{margin:"0 5px",onClick:function(){o&&alert("clicked: ".concat(JSON.stringify(e)))},children:[(0,F.jsx)("svg",{height:15,width:15,children:(0,F.jsx)("rect",{fill:e.value,height:15,width:15})}),(0,F.jsx)(x.Z,{align:"left",margin:"0 0 0 4px",children:(0,F.jsx)(S.ZP,{small:!0,children:e.text})})]},"legend-quantile-".concat(n))}))})}})}),(0,F.jsxs)("svg",{height:H,width:ce,children:[!n&&(0,F.jsx)(d.Z,{fill:"transparent",height:H,onMouseLeave:function(){return G()},onMouseMove:De,onTouchMove:De,onTouchStart:De,rx:14,width:ce-(q.left+q.right),x:q.left,y:0}),(0,F.jsxs)(m.Z,{left:q.left,top:q.top,children:[!V&&(0,F.jsx)(h.Z,W({height:ye,pointerEvents:"none",scale:Oe,stroke:ve,strokeDasharray:"3,3",strokeOpacity:.4,width:je},U)),(0,F.jsx)(v.Z,W({height:ye,pointerEvents:"none",scale:Ce,stroke:ve,strokeDasharray:"3,3",strokeOpacity:.4,width:je},U)),(0,F.jsx)("line",{stroke:ve,x1:je,x2:je,y1:0,y2:ye}),(0,F.jsx)(a.Z,{numTicks:_e,scale:Oe,stroke:Ee,tickFormat:function(e){return ue?ue(e):e},tickLabelProps:function(e){return{fill:be,fontFamily:A.ry,fontSize:M.J5,textAnchor:"middle",transform:se&&"rotate(-45, ".concat(Oe(e),", 0) translate(-32, 4)")}},tickStroke:Ee,top:ye}),(0,F.jsx)(s.Z,{hideTicks:!0,numTicks:J,scale:Ce,stroke:Ee,tickFormat:function(e){return de?de(e):(0,N.P5)(e)},tickLabelProps:function(e){return{dx:String(e).length>4?3:0,fill:be,fontFamily:A.ry,fontSize:M.J5,textAnchor:"end",transform:"translate(0,2.5)"}},tickStroke:Ee}),n&&n.map((function(e){var n=e[0],i=e[1];return(0,l.createElement)(j.Z,W(W({},Ae),{},{aboveAreaProps:{fill:I.Z.brand.earth400,fillOpacity:.3},belowAreaProps:{fill:me,fillOpacity:.2},clipAboveTo:0,clipBelowTo:ye,data:t,id:"".concat(Math.random()),key:"".concat(n,"-").concat(i),x:function(e){return Oe(fe(e))},y0:function(e){return Ce("undefined"===typeof i?Pe:he(e,i))},y1:function(e){return Ce(he(e,n))}}))})),(0,P.range)(0,Ze).map((function(e){return(0,l.createElement)(p.Z,W(W({},Ae),{},{data:t.filter((function(e){return void 0!=e.y})),key:e,pointerEvents:"none",strokeWidth:ne?2:1,x:function(e){return Oe(fe(e))},y:function(n){return Ce(n.y&&(e>=n.y.length?Pe:he(n,e)))}},Ie[e]))}))]}),te&&(0,F.jsxs)("g",{children:[(0,F.jsx)(f.Z,{from:{x:re,y:q.top},pointerEvents:"none",stroke:D.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:re,y:ye+q.top}}),le.map((function(e,n){return(0,F.jsx)("circle",{cx:re,cy:e+1+q.top,fill:Ie[n].stroke,fillOpacity:.1,pointerEvents:"none",r:4,stroke:ge,strokeOpacity:.1,strokeWidth:1},n)})),le.map((function(e,n){return(0,F.jsx)("circle",{cx:re,cy:e+q.top,fill:Ie[n].stroke,pointerEvents:"none",r:4,stroke:Ie[n].stroke,strokeWidth:2},n)}))]})]}),te&&(0,F.jsxs)("div",{children:[le.map((function(e,n){var t=he(te,n);return n>=1&&Math.abs(le[n-1]-e)<5*B.iI&&(e+=3*B.iI),(0,F.jsxs)(y.Z,{left:re>ke?re-(0,N.Vs)($,te,n)*B.iI:re+B.iI,style:z,top:e-2*B.iI,children:[$&&$(te,n),!$&&(0,F.jsxs)(S.ZP,{center:!0,small:!0,children:[t.toFixed?t.toFixed(3):t," ",null===Y||void 0===Y?void 0:Y[n]]})]},n)})),(0,F.jsxs)(y.Z,{left:re>ke?re-4*(0,N.Vs)(X,te):re,style:W(W({},z),{},{transform:"translateX(-65%)"}),top:ye+q.top,children:[X&&X(te),!X&&(0,F.jsx)(S.ZP,{center:!0,small:!0,children:fe(te).toFixed(3)})]})]})]})}));n.Z=function(e){var n=e.areaBetweenLines,t=e.data,r=(e.events,e.height),o=e.lineLegendNames,l=e.margin,u=void 0===l?{}:l,a=e.width,s=e.xAxisLabel,d=e.xLabelFormat,p=e.yAxisLabel,f=e.yLabelFormat,h=(0,i.Z)(e,U),v=W(W({},{bottom:3*B.iI,left:5*B.iI,right:3*B.iI,top:3*B.iI}),u);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{style:{display:"flex",height:r,marginBottom:B.iI,width:"100%"},children:[p&&(0,F.jsx)(_.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,F.jsx)(E.Z,{children:(0,F.jsx)(S.ZP,{center:!0,muted:!0,small:!0,children:p})})}),(0,F.jsx)("div",{style:{height:r,width:"undefined"===typeof a?"100%":a},children:(0,F.jsx)(c.Z,{children:function(e){var i=e.width,r=e.height;return(0,F.jsx)(V,W(W({},h),{},{areaBetweenLines:n,data:t,height:r,lineLegendNames:o,margin:v,width:i,xLabelFormat:d,yLabelFormat:f}))}})})]}),s&&(0,F.jsx)("div",{style:{paddingLeft:p?36:0,paddingTop:4},children:(0,F.jsx)(S.ZP,{center:!0,muted:!0,small:!0,children:s})})]})}},21853:function(e,n,t){"use strict";t.d(n,{Z:function(){return S}});var i=t(82394),r=t(75582),o=t(82684),l=t(83455),c=t(60328),u=t(34744),a=t(93461),s=t(67971),d=t(87372),p=t(10919),f=t(29237),h=t(86673),v=t(19711),m=t(82944),b=t(70902),g=t(82531),x=t(38626),j=t(23831),y=t(73942),k=t(49125),Z=x.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],y.n_,k.cd*k.iI,(function(e){return"\n background-color: ".concat((e.theme.background||j.Z.background).codeArea,";\n ")})),O=t(96510),P=t(9728),w=t(28598);function C(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function _(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?C(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):C(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var S=function(e){var n=e.cancelButtonText,t=e.contained,x=e.header,j=e.onCancel,y=e.onSaveSuccess,C=(0,P.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),S=(0,r.Z)(C,1)[0],E=(0,o.useState)(null),I=E[0],T=E[1],D=g.ZP.projects.list(),A=D.data,M=D.mutate,B=(0,o.useMemo)((function(){var e;return null===A||void 0===A||null===(e=A.projects)||void 0===e?void 0:e[0]}),[A]),R=B||{},N=R.name,L=R.project_uuid;(0,o.useEffect)((function(){I||T(B)}),[B,I]);var F=(0,l.Db)(g.ZP.projects.useUpdate(N),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(e){var n=e.project;M(),T(n),y&&(null===y||void 0===y||y(n))},onErrorCallback:function(e,n){return S({errors:n,response:e})}})}}),U=(0,r.Z)(F,2),H=U[0],W=U[1].isLoading,z=(0,o.useCallback)((function(e){return H({project:e})}),[H]),V=(0,w.jsxs)(w.Fragment,{children:[x,(0,w.jsxs)(f.Z,{noPadding:!0,children:[(0,w.jsxs)(h.Z,{p:k.cd,children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Project name"})}),(0,w.jsx)(v.ZP,{default:!0,monospace:!0,children:N})]}),(0,w.jsx)(u.Z,{light:!0}),(0,w.jsxs)(h.Z,{p:k.cd,children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Project UUID"})}),(0,w.jsx)(v.ZP,{default:!!L,monospace:!0,muted:!L,children:L||"Not required"})]}),(0,w.jsx)(u.Z,{light:!0}),(0,w.jsx)(h.Z,{p:k.cd,children:(0,w.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(a.Z,{flexDirection:"column",children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Help improve Mage"})}),(0,w.jsxs)(v.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,w.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,w.jsx)(h.Z,{mr:k.cd}),(0,w.jsx)(b.Z,{checked:null===I||void 0===I?void 0:I.help_improve_mage,onCheck:function(){return T((function(e){return _(_({},e),{},{help_improve_mage:!(null!==I&&void 0!==I&&I.help_improve_mage)})}))}})]})})]}),(0,w.jsx)(h.Z,{mt:k.HN}),(0,w.jsx)(f.Z,{noPadding:!0,children:(0,w.jsxs)(h.Z,{p:k.cd,children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Features"})}),Object.entries((null===I||void 0===I?void 0:I.features)||{}).map((function(e){var n=(0,r.Z)(e,2),t=n[0],o=n[1];return(0,w.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(v.ZP,{default:!0,monospace:!0,children:t}),(0,w.jsx)(h.Z,{mr:k.cd}),(0,w.jsx)(b.Z,{checked:!!o,onCheck:function(){return T((function(e){return _(_({},e),{},{features:_(_({},null===I||void 0===I?void 0:I.features),{},(0,i.Z)({},t,!o))})}))}})]},t)}))]})}),(0,w.jsx)(h.Z,{mt:k.HN}),(0,w.jsx)(f.Z,{noPadding:!0,children:(0,w.jsxs)(h.Z,{p:k.cd,children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"OpenAI"})}),(0,w.jsx)(m.Z,{label:"API key",monospace:!0,onChange:function(e){return T((function(n){return _(_({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===I||void 0===I?void 0:I.openai_api_key)||""})]})}),(0,w.jsx)(h.Z,{mt:k.HN}),(0,w.jsxs)(s.ZP,{alignItems:"center",children:[(0,w.jsx)(c.Z,{loading:W,onClick:function(){z({features:null===I||void 0===I?void 0:I.features,help_improve_mage:null===I||void 0===I?void 0:I.help_improve_mage,openai_api_key:null===I||void 0===I?void 0:I.openai_api_key})},primary:!0,children:"Save project settings"}),j&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(h.Z,{mr:k.cd}),(0,w.jsx)(c.Z,{onClick:j,secondary:!0,children:n||"Cancel"})]})]})]});return t?(0,w.jsx)(Z,{children:V}):V}},76096:function(e,n,t){"use strict";var i=t(82394),r=t(26304),o=(t(82684),t(33591)),l=t(28598),c=["children","fullHeight","gutter","style"];function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,u=e.style,s=void 0===u?{}:u,d=(0,r.Z)(e,c),p=a({},s);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,l.jsx)(o.Col,a(a({},d),{},{style:p,children:n}))}},97361:function(e,n,t){"use strict";var i=t(82394),r=t(26304),o=t(82684),l=t(33591),c=t(28598),u=["children","fullHeight","gutter","justifyContent","style"];function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,a=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,r.Z)(e,u),h=s({},p);return i&&(h.marginLeft=-1*i,h.marginRight=h.marginLeft),t&&(h.height="100%"),(0,c.jsx)(l.Row,s(s({},f),{},{justifyContent:a,style:h,children:o.Children.map(n,(function(e,n){return e&&o.cloneElement(e,{gutter:i,key:n})}))}))}},18221:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return r}}),function(e){e.AZURE_CONTAINER_INSTANCE="azure_container_instance",e.ECS="ecs",e.GCP_CLOUD_RUN="gcp_cloud_run",e.K8S="k8s",e.LOCAL_PYTHON="local_python",e.PYSPARK="pyspark"}(i||(i={}));var r=[i.AZURE_CONTAINER_INSTANCE,i.ECS,i.GCP_CLOUD_RUN,i.K8S,i.LOCAL_PYTHON,i.PYSPARK]},30119:function(e,n,t){"use strict";var i;t.d(n,{b:function(){return i}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(i||(i={}))},93348:function(e,n,t){"use strict";t.d(n,{TR:function(){return d},U5:function(){return u},Xm:function(){return o},Z4:function(){return s},fq:function(){return c},kJ:function(){return a}});var i,r,o,l=t(82394);!function(e){e.API="api",e.EVENT="event",e.TIME="time"}(o||(o={}));var c,u,a,s=(i={},(0,l.Z)(i,o.API,(function(){return"API"})),(0,l.Z)(i,o.EVENT,(function(){return"event"})),(0,l.Z)(i,o.TIME,(function(){return"schedule"})),i);!function(e){e.ACTIVE="active",e.INACTIVE="inactive"}(c||(c={})),function(e){e.ONCE="@once",e.HOURLY="@hourly",e.DAILY="@daily",e.WEEKLY="@weekly",e.MONTHLY="@monthly"}(u||(u={})),function(e){e.CREATED_AT="created_at",e.NAME="name",e.PIPELINE="pipeline_uuid",e.STATUS="status",e.TYPE="schedule_type"}(a||(a={}));var d=(r={},(0,l.Z)(r,a.CREATED_AT,"Created at"),(0,l.Z)(r,a.NAME,"Name"),(0,l.Z)(r,a.PIPELINE,"Pipeline"),(0,l.Z)(r,a.STATUS,"Status"),(0,l.Z)(r,a.TYPE,"Type"),r)},52769:function(e,n,t){"use strict";t.d(n,{C:function(){return i}});var i="global"},79891:function(e,n,t){"use strict";var i=t(38626),r=t(60328),o=t(67971),l=t(86673),c=t(19711),u=t(23831),a=t(22341),s=t(49125),d=t(31012),p=t(28598),f=i.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||u.Z.background).tag,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.chart||u.Z.chart).primary,";\n ")}),(function(e){return!e.small&&"\n border-radius: ".concat((s.iI+d.Al)/2,"px;\n height: ").concat(1.5*s.iI+d.Al,"px;\n padding: ").concat(s.iI/1.5,"px ").concat(1.25*s.iI,"px;\n ")}),(function(e){return e.small&&"\n border-radius: ".concat((s.iI/2+d.Al)/2,"px;\n height: ").concat(d.Al+s.iI/2+2,"px;\n padding: ").concat(s.iI/4,"px ").concat(s.iI,"px;\n ")}),(function(e){return e.border&&"\n border: 1px solid ".concat((e.theme.content||u.Z.content).muted,";\n ")}));n.Z=function(e){var n=e.border,t=e.children,i=e.disabled,u=e.label,d=e.onClick,h=e.primary,v=e.small;return(0,p.jsx)(f,{border:n,primary:h,small:v,children:(0,p.jsx)(r.Z,{basic:!0,disabled:i,noBackground:!0,noPadding:!0,onClick:d,transparent:!0,children:(0,p.jsxs)(o.ZP,{alignItems:"center",children:[t,u&&(0,p.jsx)(c.ZP,{small:v,children:u}),!i&&d&&(0,p.jsx)(l.Z,{ml:1,children:(0,p.jsx)(a.x8,{default:h,muted:!h,size:v?s.iI:1.25*s.iI})})]})})})}},65730:function(e,n,t){"use strict";var i,r=t(82394),o=(t(82684),t(64866)),l=t(21764),c=t(67971),u=t(10919),a=t(86673),s=t(19711),d=t(46261),p=t(22341),f=t(49125),h=t(28598);function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.LEFT="left",e.RIGHT="right"}(i||(i={})),n.Z=function(e){var n,t=e.children,r=e.copiedText,v=e.iconPosition,b=void 0===v?i.LEFT:v,g=e.inverted,x=e.linkProps,j=e.linkText,y=e.monospace,k=e.muted,Z=e.small,O=e.toastMessage,P=e.withCopyIcon;return t?n=(0,h.jsx)("span",{children:t}):P&&(n=(0,h.jsx)(u.Z,m(m({href:"#",inline:!0,muted:k,preventDefault:!0,sameColorAsText:!0,small:Z},x),{},{children:(0,h.jsxs)(c.ZP,{alignItems:"center",children:[b===i.LEFT&&(0,h.jsx)(a.Z,{mr:j?1:0,children:(0,h.jsx)(c.ZP,{alignItems:"center",children:(0,h.jsx)(p.CK,{inverted:g,muted:k,size:2*f.iI})})}),j&&(0,h.jsx)(s.ZP,{inverted:g,monospace:y,muted:k,small:Z,children:j}),b===i.RIGHT&&(0,h.jsx)(a.Z,{ml:j?1:0,children:(0,h.jsx)(c.ZP,{alignItems:"center",children:(0,h.jsx)(p.CK,{inverted:g,muted:k})})})]})}))),(0,h.jsx)(d.Z,{block:!0,label:"Copy",size:null,widthFitContent:!0,children:(0,h.jsx)(o.CopyToClipboard,{onCopy:function(){return l.Am.success(O||"Successfully copied to clipboard.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:r})},text:r,children:n})})}},18776:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(38626),r=t(23831),o=t(73942),l=i.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],o.n_,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),c=t(28598);var u=function(e){var n=e.children,t=e.fullWidth,i=void 0===t||t;return(0,c.jsx)(l,{fullWidth:i,children:n})}},98636:function(e,n,t){"use strict";t.d(n,{g:function(){return b},Z:function(){return g}});var i=t(82684),r=t(38626),o=t(23831),l=t(73942),c=t(37391),u=t(49125),a=1.5*u.iI,s=1.5*u.iI,d=r.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],l.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||o.Z).background.page,";\n border: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||o.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||o.Z).shadow.frame,";\n ")}),(function(e){return e.noBackground&&"\n background-color: transparent;\n "}),(function(e){return e.noBoxShadow&&"\n box-shadow: none;\n "})),p=r.default.div.withConfig({displayName:"indexstyle__RowContainerStyle",componentId:"sc-13p7y8j-1"})(["overflow:auto;border-bottom-left-radius:","px;border-bottom-right-radius:","px;"," "," "," ",""],l.n_,l.n_,c.w5,(function(e){return e.maxHeight>0&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),(function(e){return e.minHeight>0&&"\n min-height: ".concat(e.minHeight,"px;\n ")}),(function(e){return e.scrollable&&"\n margin-bottom: ".concat(u.iI,"px;\n overflow-y: auto;\n padding-top: ").concat(3,"px;\n padding-left: ").concat(3,"px;\n padding-right: ").concat(3,"px;\n ")})),f=r.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-13p7y8j-2"})(["border-top-left-radius:","px;border-top-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*u.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")})),h=r.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],s,2*u.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||o.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||o.Z).interactive.defaultBorder,";\n ")}),(function(e){return e.noHorizontalPadding&&"\n padding-left: 0;\n padding-right: 0;\n "}),(function(e){return e.condensed&&"\n padding-top: ".concat(9,"px;\n padding-bottom: ").concat(9,"px;\n ")}),(function(e){return e.secondary&&"\n background-color: ".concat((e.theme.background||o.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom: none;\n ")})),v=r.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*u.iI,(function(e){return"\n border-top: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||o.Z).borders.medium2,";\n ")})),m=t(28598),b=h;var g=function(e){var n=e.alternating,t=e.children,r=e.footer,o=e.header,l=e.maxHeight,c=e.minHeight,u=e.noBackground,a=e.noBoxShadow,s=e.sameColorBorders,h=e.scrollable,b=e.width,g=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:u,noBoxShadow:a,width:b,children:[o&&(0,m.jsx)(f,{children:o}),(0,m.jsx)(p,{maxHeight:l,minHeight:c,scrollable:h,children:i.Children.map(g,(function(e,t){return e&&i.cloneElement(e,{last:t===g.length-1,sameColorBorders:s,secondary:n&&t%2===1})}))}),r&&(0,m.jsx)(v,{children:r})]})}},70111:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return go}});var i=t(77837),r=t(21831),o=t(82394),l=t(75582),c=t(38860),u=t.n(c),a=t(56085),s=t(82684),d=t(83455),p=t(34376),f=t(48591),h=t(35490),v=t(86422),m=t(38626),b=t(38341),g=t(16634),x=t(34744),j=t(93461),y=t(67971),k=t(10919),Z=t(86673),O=t(19711),P=t(49125),w=t(44162),C=t(28598);function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function S(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var E=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,r=e.setHiddenBlocks,l=(0,s.useContext)(m.ThemeContext),c=(0,s.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),u=(0,s.useMemo)((function(){var e=[],n=[];return c.forEach((function(i){var r=i.uuid;null!==t&&void 0!==t&&t[r]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[c,t]),a=u.blocksHidden,d=u.blocksVisible,p=(0,s.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)>=1&&0===d.length}),[c,d]),f=(0,s.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)>=1&&0===a.length}),[c,a]),h=(0,s.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var r,o=n.current["".concat(t,"s/").concat(i,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}}),[n]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:f,label:"Show all",onClick:function(){return r((function(){return{}}))}})}),(0,C.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:p,label:"Hide all",onClick:function(){return r((function(){return c.reduce((function(e,n){var t=n.uuid;return S(S({},e),{},(0,o.Z)({},t,!0))}),{})}))}})})]})}),(0,C.jsx)(x.Z,{medium:!0}),null===c||void 0===c?void 0:c.map((function(e){var n=e.uuid,i=(0,w.qn)(e.type,{blockColor:e.color,theme:l}).accent,c=!(null!==t&&void 0!==t&&t[n]);return(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){r((function(e){return S(S({},e),{},(0,o.Z)({},n,c))})),c||setTimeout((function(){return h(e)}),1)},preventDefault:!0,children:(0,C.jsx)(Z.Z,{mt:1,px:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(Z.Z,{pr:1,children:(0,C.jsx)(b.Z,{checked:c})}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(g.Z,{color:i,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},I=t(2485),T=t(60328),D=t(32316),A=t(65701),M=t(1254);var B=function(e){var n=e.size;return(0,C.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,C.jsx)("path",{d:"M67.7193 2.36691C69.8656 1.52184 72.3078 2.0081 73.9667 3.61084L116.977 45.1646C119.018 47.1366 119.362 50.2841 117.794 52.65L92.5787 90.7113C92.1293 91.3897 91.5441 91.9675 90.8601 92.4083L51.1076 118.029C48.6859 119.589 45.4904 119.168 43.5558 117.033L3.02296 72.3013C1.48382 70.6027 1.07052 68.1652 1.96372 66.0542L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L67.7193 2.36691Z",fill:"url(#paint0_radial_11972_15232)"}),(0,C.jsx)("path",{d:"M71.2431 0.979492L23.6155 19.9931C22.1646 20.5723 21.0034 21.7045 20.3877 23.1402L0.499023 69.5159L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L71.2431 0.979492Z",fill:"url(#paint1_radial_11972_15232)"}),(0,C.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint3_radial_11972_15232)"}),(0,C.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint4_linear_11972_15232)"}),(0,C.jsx)("path",{d:"M23.3591 24.6945L58.2913 58.6736L25.3897 22.7247C24.8455 22.13 23.9152 22.1095 23.3452 22.6795C22.7871 23.2375 22.7934 24.1442 23.3591 24.6945Z",fill:"url(#paint5_radial_11972_15232)"}),(0,C.jsx)("path",{d:"M51.6694 46.395L73.0043 69.5215C73.6132 70.1816 74.5925 70.3441 75.382 69.9161L117.654 46.9975L75.6257 67.8209C74.8809 68.1899 73.9844 68.0497 73.3879 67.4708L51.6694 46.395Z",fill:"url(#paint6_radial_11972_15232)"}),(0,C.jsxs)("defs",{children:[(0,C.jsxs)("radialGradient",{id:"paint0_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16.9412 88.4412) rotate(18.02) scale(82.0367 81.4644)",children:[(0,C.jsx)("stop",{stopColor:"#FFDA19"}),(0,C.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,C.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,C.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,C.jsxs)("radialGradient",{id:"paint1_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.8711 10.2518) rotate(87.6364) scale(26.1711 27.0141)",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("radialGradient",{id:"paint2_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(150.671 44.2502) rotate(128.639) scale(125.554 128.436)",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("radialGradient",{id:"paint3_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(133.353 52.8357) rotate(144.647) scale(86.7385 72.7129)",children:[(0,C.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,C.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("radialGradient",{id:"paint5_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(25.2251 23.4978) rotate(48.3599) scale(35.5147 43.1672)",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("radialGradient",{id:"paint6_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(76.5908 67.6516) rotate(104.629) scale(14.9575 79.0374)",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},R=t(89949),N=t(11135),L=t(33572),F=t(98781),U=t(55378),H=t(54283),W=t(82944),z=t(82531),V=t(22341),G=t(23831),K=t(73942),Y=m.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-h093u4-0"})([""," ",""],(function(e){return!e.width&&"\n width: ".concat(40*P.iI,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),q=m.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-h093u4-1"})(["padding:","px;",""],2.5*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-top-left-radius: ").concat(K.n_,"px;\n border-top-right-radius: ").concat(K.n_,"px;\n border-top: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n ")})),Q=m.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-h093u4-2"})(["align-items:center;justify-content:space-between;",""],(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-top: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n display: ").concat((null===e||void 0===e?void 0:e.display)||"flex",";\n padding-bottom: ").concat(1*P.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n padding-left: ").concat(P.cd*P.iI,"px;\n padding-top: ").concat(1*P.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n ")})),J=m.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-h093u4-3"})(["padding:","px ","px;",""],2.5*P.iI,2*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).panel,";\n border-bottom-left-radius: ").concat(K.n_,"px;\n border-bottom-right-radius: ").concat(K.n_,"px;\n border-bottom: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||G.Z.interactive).defaultBorder,";\n ")})),X=(P.iI,2*P.iI),$=(P.iI,3*P.iI),ee=t(72470),ne=t(90211),te=t(96510),ie=t(9728);function re(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function oe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?re(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):re(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var le=function(e){var n,t=e.block,i=e.defaultName,r=e.isUpdatingBlock,o=e.onClose,c=e.onSave,u=e.pipeline,a=(e.preventDuplicateBlockName,(0,ie.VI)(null,{},[],{uuid:"ConfigureBlock"})),p=(0,l.Z)(a,1)[0],f=Object.keys((null===t||void 0===t?void 0:t.pipelines)||{}).length,h=(0,s.useRef)(null),m=(0,s.useState)({color:(null===t||void 0===t?void 0:t.color)||null,language:null===t||void 0===t?void 0:t.language,name:i,type:null===t||void 0===t?void 0:t.type}),b=m[0],g=m[1];(0,s.useEffect)((function(){var e;null===h||void 0===h||null===(e=h.current)||void 0===e||e.focus()}),[]);var x=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===u||void 0===u?void 0:u.type)}),[u]),k=(0,s.useMemo)((function(){return v.tf.CUSTOM===(null===t||void 0===t?void 0:t.type)}),[t]),w=(0,s.useMemo)((function(){return v.tf.MARKDOWN===(null===t||void 0===t?void 0:t.type)}),[t]),_=(0,s.useMemo)((function(){return null===t||void 0===t?void 0:t.block_action_object}),[t]),S=(0,s.useMemo)((function(){return ee.L.GENERATE_BLOCK===(null===_||void 0===_?void 0:_.object_type)}),[_]),E=(0,s.useMemo)((function(){return S&&(null===_||void 0===_?void 0:_.description)}),[_,S]),I=(0,s.useState)(null),D=I[0],G=I[1],K=(0,d.Db)(z.ZP.llms.useCreate(),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var n=e.llm,t=(null===n||void 0===n?void 0:n.response)||{},i=t.block_type,r=t.configuration,o=t.content,l=t.language;g((function(e){return oe(oe({},e),{},{block_action_object:null,configuration:r,content:o,language:l,type:i})})),G(n)},onErrorCallback:function(e,n){return p({errors:n,response:e})}})}}),X=(0,l.Z)(K,2),re=X[0],le=X[1].isLoading;(0,s.useEffect)((function(){S&&E&&!D&&re({llm:{request:{block_description:E},use_case:L.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[re,E,S,D]);var ce=(0,s.useMemo)((function(){var e,n;return null!==t&&void 0!==t&&null!==(e=t.config)&&void 0!==e&&e.custom_template?null===t||void 0===t||null===(n=t.config)||void 0===n?void 0:n.custom_template:[ee.L.CUSTOM_BLOCK_TEMPLATE,ee.L.MAGE_TEMPLATE].includes(null===_||void 0===_?void 0:_.object_type)?oe(oe({},_),{},{name:null===_||void 0===_?void 0:_.title}):void 0}),[t,_]),ue=(0,s.useMemo)((function(){var e=(null===b||void 0===b?void 0:b.type)||(null===t||void 0===t?void 0:t.type);ce&&(e=null===ce||void 0===ce?void 0:ce.block_type);var n=v.V4[e];return x&&(v.tf.DATA_LOADER===e?n="Source":v.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[t,b,ce,x]);return(0,C.jsxs)(Y,{width:S&&(null===b||void 0===b?void 0:b.content)&&80*P.iI,children:[(0,C.jsxs)(q,{children:[S&&le&&(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{children:"Generating block using AI..."}),(0,C.jsx)(H.Z,{inverted:!0})]}),S&&!le&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(V.xq,{size:5*P.iI,warning:!0})}),!S&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(B,{size:15*P.iI})})]}),S&&!le&&(0,C.jsx)(Q,{children:(0,C.jsxs)(Z.Z,{py:1,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(O.ZP,{default:!0,children:"Block generated using AI"})}),(0,C.jsx)(O.ZP,{textOverflow:!0,children:E})]})}),ce&&(0,C.jsx)(Q,{children:(0,C.jsxs)(Z.Z,{py:1,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(O.ZP,{default:!0,children:"Template"})}),(0,C.jsx)(O.ZP,{textOverflow:!0,children:null===(n=(null===ce||void 0===ce?void 0:ce.name)||(null===ce||void 0===ce?void 0:ce.template_uuid))||void 0===n?void 0:n.slice(0,40)})]})}),v.tf.GLOBAL_DATA_PRODUCT!==(null===t||void 0===t?void 0:t.type)&&f>1&&(0,C.jsxs)(Q,{children:[(0,C.jsx)(j.Z,{flex:"1",children:(0,C.jsx)(V.uy,{size:$,warning:!0})}),(0,C.jsx)(j.Z,{flex:"6",children:(0,C.jsxs)(O.ZP,{bold:!0,warning:!0,children:["Renaming this block will affect ",f," pipelines. The renamed block may need to be re-added to the shared pipeline(s)."]})})]}),(0,C.jsxs)(Q,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Name"}),(0,C.jsx)(W.Z,{alignRight:!0,noBackground:!0,noBorder:!0,onChange:function(e){return g((function(n){return oe(oe({},n),{},{name:e.target.value})}))},paddingVertical:P.iI,placeholder:"Block name...",ref:h,value:(null===b||void 0===b?void 0:b.name)||""})]}),(0,C.jsxs)(Q,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Type"}),(0,C.jsx)(Z.Z,{mr:P.cd,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{muted:!0,children:ue}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(V.QM,{muted:!0})]})})]}),!w&&(k||ce||(null===b||void 0===b?void 0:b.language))&&(0,C.jsxs)(Q,{paddingVerticalAddition:3,children:[(0,C.jsx)(O.ZP,{default:!0,children:"Language"}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[[v.t6.PYTHON,v.t6.SQL,v.t6.R].reduce((function(e,n){var t=(ce?null===ce||void 0===ce?void 0:ce.language:null===b||void 0===b?void 0:b.language)===n;return k&&!r||t?(e.push((0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(T.Z,{borderColor:t?null:"transparent",compact:!0,default:!k&&!t,disabled:!k&&!t,noBackground:!0,notClickable:(!k||r)&&t,onClick:ce?null:function(){return g((function(e){return oe(oe({},e),{},{language:n})}))},selected:t,children:v.LE[n]})},n)),e):e}),[]),!k&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(V.QM,{muted:!0})]}),(0,C.jsx)(Z.Z,{mr:k?1:2})]})]}),(k||(null===ce||void 0===ce?void 0:ce.color)||(null===b||void 0===b?void 0:b.color))&&(0,C.jsxs)(Q,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Color"}),k&&(0,C.jsxs)(U.Z,{alignRight:!0,noBackground:!0,noBorder:!0,onChange:function(e){return g((function(n){return oe(oe({},n),{},{color:e.target.value})}))},value:ce?(null===ce||void 0===ce?void 0:ce.color)||"":(null===b||void 0===b?void 0:b.color)||"",children:[(0,C.jsx)("option",{value:""}),Object.values(v.Lq).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,ne.kC)(e)},e)}))]}),!k&&(0,C.jsx)(Z.Z,{mr:P.cd,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{muted:!0,children:(0,ne.kC)((null===ce||void 0===ce?void 0:ce.color)||(null===b||void 0===b?void 0:b.color)||"")}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(V.QM,{muted:!0})]})})]}),S&&(null===b||void 0===b?void 0:b.content)&&(0,C.jsx)(Q,{display:"block",children:(0,C.jsx)(Z.Z,{pr:P.cd,py:1,children:(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsx)(R.Z,{block:oe(oe({},b),{},{uuid:E}),defaultValue:null===b||void 0===b?void 0:b.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return g((function(n){return oe(oe({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},E)})})}),(0,C.jsx)(J,{children:(0,C.jsxs)(y.ZP,{fullWidth:!0,children:[(0,C.jsxs)(N.ZP,{bold:!0,centerText:!0,disabled:le,onClick:function(){return c(oe(oe({},b),{},{name:(null===b||void 0===b?void 0:b.name)||i}))},primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and ",r?"update":"add"," block"]}),(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(T.Z,{onClick:o,tabIndex:0,children:"Cancel"})})]})})]})},ce=t(46299),ue=t(91207),ae=t(47999),se=t(62084),de=t(16115),pe=t(64318),fe=t(54405),he=t(41150);function ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function me(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ve(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ve(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var be,ge,xe=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,r=e.executePipeline,l=e.interruptKernel,c=e.isPipelineExecuting,u=e.pipeline,a=e.restartKernel,d=e.savePipelineContent,p=(e.setActiveSidekickView,e.setMessages),f=(0,s.useState)(null),h=f[0],v=f[1],m=(0,s.useRef)(null),b=(0,s.useRef)(null),g=(0,s.useRef)(null),x=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,ne.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,ne.Y6)(),type:F.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,fe.V5)()?de.RJ:de.hE,de.SS]],label:function(){return"Save pipeline"},onClick:function(){return d()},uuid:"save_pipeline"}],j=(0,s.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[de.kA],[de.kA]],onClick:function(){return l()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[de.t_[de.OC]],[de.t_[de.OC]]],onClick:function(){return a()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return p((function(e){return Object.keys(e).reduce((function(e,n){return me(me({},e),{},(0,o.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return c?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):e.push({label:function(){return"Execute pipeline"},onClick:function(){return r()},uuid:"Execute pipeline"}),e}),[n,r,l,c,a,p]),k=(0,s.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===u||void 0===u?void 0:u.uuid,"/settings"),href:"/pipelines/[pipeline]/settings"},uuid:"Pipeline settings"},{label:function(){return"Browse custom templates"},linkProps:{href:"/templates"},uuid:"browse_custom_templates"},{label:function(){return"Create custom templates"},linkProps:{href:"/templates?new=1"},uuid:"create_custom_templates"}]}),[u]),Z="FileHeaderMenu/index",P=(0,he.y)(),w=P.registerOnKeyDown,_=P.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){_(Z)}}),[_,Z]),w(Z,(function(e,n,t){null!==h&&(n[de.QK]?v((function(e){return 0===e?2:e-1})):n[de.DY]&&v((function(e){return 2===e?0:e+1})))}),[h,v]),(0,C.jsx)(ae.Z,{onClickOutside:function(){return v(null)},open:!0,style:{position:"relative"},children:(0,C.jsxs)(y.ZP,{children:[(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(pe.u,{highlighted:0===h,onClick:function(){return v((function(e){return 0===e?null:0}))},onMouseEnter:function(){return v((function(e){return null!==e?0:null}))},ref:m,children:(0,C.jsx)(O.ZP,{children:"File"})}),(0,C.jsx)(se.Z,{items:x,onClickCallback:function(){return v(null)},open:0===h,parentRef:m,uuid:"FileHeaderMenu/file_items"})]}),(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(pe.u,{highlighted:1===h,onClick:function(){return v((function(e){return 1===e?null:1}))},onMouseEnter:function(){return v((function(e){return null!==e?1:null}))},ref:b,children:(0,C.jsx)(O.ZP,{children:"Run"})}),(0,C.jsx)(se.Z,{items:j,onClickCallback:function(){return v(null)},open:1===h,parentRef:b,uuid:"FileHeaderMenu/run_items"})]}),(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(pe.u,{highlighted:2===h,onClick:function(){return v((function(e){return 2===e?null:2}))},onMouseEnter:function(){return v((function(e){return null!==e?2:null}))},ref:g,children:(0,C.jsx)(O.ZP,{children:"Edit"})}),(0,C.jsx)(se.Z,{items:k,onClickCallback:function(){return v(null)},open:2===h,parentRef:g,uuid:"FileHeaderMenu/edit_items"})]}),t]})})},je=t(38488),ye=t(65232),ke=t(57384);!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(be||(be={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(ge||(ge={}));var Ze,Oe=t(90686),Pe=t(62609),we=t(46261),Ce=t(66166);!function(e){e.EMR="emr"}(Ze||(Ze={}));var _e=t(91427),Se=t(28347),Ee=t(42305),Ie=t(24224),Te=t(33766),De=t(99497);var Ae=function(e){var n,t=e.children,i=(e.filePaths,e.filesTouched,e.isBusy),o=e.isPipelineUpdating,c=e.kernel,u=e.pipeline,a=e.pipelineContentTouched,p=e.pipelineLastSaved,f=(e.restartKernel,e.savePipelineContent,e.selectedFilePath),h=e.setErrors,v=e.setRunningBlocks,b=e.updatePipelineMetadata,x=(0,s.useContext)(m.ThemeContext),w=c||{},_=w.alive,S=w.usage,E=(0,s.useState)(!1),I=E[0],T=E[1],D=(0,s.useState)(""),A=D[0],M=D[1],B=(0,s.useState)(Ze.EMR),R=B[0],L=(B[1],(0,s.useState)(!1)),U=L[0],H=L[1],W=(0,s.useState)(!1),K=W[0],Y=W[1],q=(0,s.useRef)(null),Q=z.ZP.clusters.detail(R,{},{revalidateOnFocus:!1}),J=Q.data,X=Q.mutate,$=(0,s.useMemo)((function(){var e;return(null===J||void 0===J||null===(e=J.cluster)||void 0===e?void 0:e.clusters)||[]}),[J]),ee=(0,s.useMemo)((function(){return(0,Ie.sE)($,(function(e){return e.is_active}))}),[$]),ne=(0,d.Db)(z.ZP.clusters.useUpdate(R),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){X()},onErrorCallback:function(e,n){return h({errors:n,response:e})}})}}),ie=(0,l.Z)(ne,1)[0];(0,s.useEffect)((function(){null!==u&&void 0!==u&&u.uuid&&M(u.uuid)}),[null===u||void 0===u?void 0:u.uuid]),n=a?"Unsaved changes":o?"Saving changes...":p?"Last saved ".concat((0,Ee.JX)(Number(p)/1e3)):"All changes saved";var re="KernelStatus",oe=(0,he.y)(),le=oe.registerOnKeyDown,ce=oe.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){ce(re)}}),[ce,re]),le(re,(function(e,n,t){I&&String(t[0])===String(de.Uq)&&String(t[1])!==String(de.zX)&&((null===u||void 0===u?void 0:u.uuid)===A?e.target.blur():(b(A),T(!1)))}),[I,A,T,b]);var ue=(0,s.useMemo)((function(){return null===S||void 0===S?void 0:S.pid}),[null===S||void 0===S?void 0:S.pid]),pe=(0,Ce.Z)(ue),ve=(0,s.useMemo)((function(){if(null!==S&&void 0!==S&&S.kernel_memory){var e=S.kernel_memory,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))).concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}}),[null===S||void 0===S?void 0:S.kernel_memory]),me=(0,De.dd)((function(){return(0,C.jsx)(Pe.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:je,onClick:function(){(0,_e.t8)(_e.DU,1),je()},subtitle:"You may need to refresh your page to continue using the notebook. Unexpected kernel restarts may be caused by your kernel running out of memory.",title:"The kernel has restarted",width:34*P.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),be=(0,l.Z)(me,2),xe=be[0],je=be[1];(0,s.useEffect)((function(){var e=(0,_e.U2)(_e.DU,0);ue!==pe&&i&&!e&&(xe(),v([]))}),[i,ue,pe,v,xe]);var ye=(0,s.useMemo)((function(){return(0,C.jsx)("div",{ref:q,style:{position:"relative"},children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(null===u||void 0===u?void 0:u.type)===F.qL.PYSPARK&&(0,C.jsxs)(Z.Z,{mr:1,children:[(0,C.jsxs)(k.Z,{muted:!!ee,onClick:function(){return H(!0)},preventDefault:!0,sameColorAsText:!ee,underline:!ee,children:[ee&&ee.id,!ee&&"Select cluster"]}),(0,C.jsx)(ae.Z,{disableEscape:!0,onClickOutside:function(){return H(!1)},open:U,children:(0,C.jsx)(se.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,r.Z)($.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(O.ZP,{muted:!t&&ge.WAITING!==i,children:n})}),t&&(0,C.jsx)(V.Jr,{size:2*P.iI,success:!0}),!t&&(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||ge.WAITING!==i?null:function(){return ie({cluster:{id:n,is_active:!0}})},uuid:n}})))),onClickCallback:function(){return H(!1)},open:U,parentRef:q,uuid:"KernelStatus/select_cluster",width:40*P.iI})})]}),(0,C.jsx)(N.ZP,{beforeElement:(0,C.jsx)(g.Z,{color:i?(x||G.Z).borders.info:_?(x||G.Z).borders.success:(x||G.Z).borders.danger,size:P.iI}),blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Y(!0)},uuid:"Pipeline/KernelStatus/kernel",children:(null===u||void 0===u?void 0:u.type)||F.qL.PYTHON}),(0,C.jsx)(ae.Z,{disableEscape:!0,onClickOutside:function(){return Y(!1)},open:K,children:(0,C.jsx)(se.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,r.Z)(Object.keys(F.a_).filter((function(e){return(null===u||void 0===u?void 0:u.type)!=e})).map((function(e){return{label:function(){return e},onClick:function(){return b(null===u||void 0===u?void 0:u.name,e)},uuid:e}})))),onClickCallback:function(){return Y(!1)},open:K,parentRef:q,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*P.iI})})]})})}),[_,$,i,u,ee,H,Y,U,K,x,ie,b]);return(0,C.jsx)(Se.rK,{relativePosition:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:[(0,C.jsxs)(Z.Z,{px:P.cd,children:[f&&(0,C.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:f?function(){return(0,Te.u7)({file_path:null})}:null,preventDefault:!0,children:t}),!f&&(0,C.jsxs)(y.ZP,{alignItems:"center",children:[t,I&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(k.Z,{onClick:function(){b(A),T(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]}),S&&(0,C.jsx)(Z.Z,{mr:P.cd,children:(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsxs)(O.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["CPU: ",null===S||void 0===S?void 0:S.kernel_cpu,"undefined"!==typeof(null===S||void 0===S?void 0:S.kernel_cpu)&&"%"]}),(0,C.jsxs)(O.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["Memory: ",ve]})]})})]}),(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(we.Z,{appearBefore:!0,block:!0,description:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,C.jsx)(Oe.Z,{inline:!0,keyText:(0,fe.V5)()?de.RJ:de.hE}),"\xa0",(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,C.jsx)(Oe.Z,{inline:!0,keyText:de.SS}),"\xa0",(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,C.jsx)("br",{})]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Or, go to ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,C.jsx)(O.ZP,{muted:!0,children:n})}),(0,C.jsx)(Z.Z,{ml:2}),ye]})})]})})},Me=t(82635),Be=t(29237),Re=t(17717),Ne=t(12691),Le=t.n(Ne),Fe=t(16910),Ue=t(28317),He=t(26304),We=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function ze(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ve(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ze(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ze(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ge=m.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*P.iI),Ke=m.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var Ye=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,r=e.description,o=e.disableWordBreak,l=e.fullWidth,c=e.inputValue,u=e.inputWidth,a=e.invertedTheme,d=e.label,p=e.labelColor,f=e.menuOpen,h=void 0!==f&&f,v=e.monospace,m=e.muted,b=e.onClick,g=e.notRequired,x=e.selectedTextProps,P=e.small,w=e.stacked,_=e.suffixValue,S=e.tooltipProps,E=e.value,I=(0,He.Z)(e,We),T=(0,s.useRef)(null),D=(0,s.useState)(!1),A=D[0],M=D[1],B=(0,s.useState)(!1),R=B[0],N=B[1],L=d&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(O.ZP,{bold:t,color:p,inverted:a,lineHeight:20,monospace:v,muted:m,small:P,children:d}),S&&(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(we.Z,Ve({muted:!0},S))})]}),F=(0,C.jsxs)(j.Z,{flex:l?"1":"none",children:[E&&(0,C.jsx)(k.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){b(),T.current&&T.current.focus(),M(!0)},preventDefault:!0,sameColorAsText:m||!(null!==x&&void 0!==x&&x.primary)&&!(null!==x&&void 0!==x&&x.danger)&&!(null!==x&&void 0!==x&&x.warning),underline:null===x||void 0===x?void 0:x.underline,warning:null===x||void 0===x?void 0:x.warning,children:(0,C.jsx)(O.ZP,Ve(Ve({inverted:a,muted:m},x),{},{disableWordBreak:o,monospace:v,small:P,width:u,children:E}))}),(0,C.jsx)(W.Z,Ve(Ve({},I),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:a,monospace:v,onBlur:function(e){M(!1),I.onBlur&&I.onBlur(e),R||N(!0)},onFocus:function(e){M(!0),I.onFocus&&I.onFocus(e)},ref:T,small:P,value:c,visible:!E}))]}),U=r&&(0,C.jsx)(Ke,{children:(0,C.jsx)(O.ZP,{dangerouslySetInnerHTML:{__html:r},monospace:v,muted:!0,small:P})}),H=(0,s.useMemo)((function(){return(0,C.jsx)(O.ZP,{default:!0,small:P,children:_})}),[P,_]);return(0,C.jsxs)(C.Fragment,{children:[w&&(0,C.jsxs)(C.Fragment,{children:[L&&(0,C.jsxs)(Ge,{children:[(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,C.jsxs)(y.ZP,{fullWidth:l,children:[F,_&&H]})]}),!w&&(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,C.jsxs)(C.Fragment,{children:[L,(0,C.jsx)(Z.Z,{ml:1})]}),F,_&&H]}),R&&!A&&!E&&!h&&!g&&(0,C.jsx)(O.ZP,{danger:!0,small:P,children:"This field is required."})]})},qe=t(37391),Qe=t(90880),Je=6.25*P.iI,Xe=(P.iI,100*P.iI),$e=m.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],K.n_,Xe,(function(e){return"\n box-shadow: ".concat((e.theme||G.Z).shadow.window,";\n background-color: ").concat((e.theme||G.Z).background.panel,";\n ")})),en=(0,m.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],Je,P.iI,P.cd*P.iI,(function(e){return"\n background-color: ".concat((e.theme||G.Z).background.output,";\n ")})),nn=m.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],en,K.n_,K.n_,(function(e){return"\n border-bottom: ".concat(K.YF,"px ").concat(K.M8," ").concat((e.theme||G.Z).borders.medium,";\n ")})),tn=m.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],P.iI,qe.w5,(0,Qe.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*P.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*Je,"px);\n ")})),rn=m.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],en,K.n_,K.n_,(function(e){return"\n border-top: ".concat(K.YF,"px ").concat(K.M8," ").concat((e.theme||G.Z).borders.medium,";\n ")})),on=m.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*P.iI,2*P.iI,(function(e){return"\n border-bottom: ".concat(K.YF,"px ").concat(K.M8," ").concat((e.theme||G.Z).borders.medium,";\n ")}));function ln(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function cn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ln(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ln(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var un=function(e){var n=e.blocks,t=e.creatingNewDBTModel,i=e.dbtModelName,r=e.files,o=e.onClose,l=e.onOpenFile,c=e.setDbtModelName,u=(0,s.useState)(!1),a=u[0],d=u[1],p=(0,s.useState)(null),f=p[0],h=p[1],m=(0,s.useMemo)((function(){var e,n,t=null===(e=(0,Ie.sE)((null===r||void 0===r||null===(n=r[0])||void 0===n?void 0:n.children)||[],(function(e){return"dbt"===e.name})))||void 0===e?void 0:e.children,i=[];return null===t||void 0===t||t.forEach((function(e){var n=e.children,t=void 0===n?[]:n;t.length>=1&&i.push(cn(cn({},e),{},{children:t}))})),i}),[r]),b=(0,s.useMemo)((function(){return(0,Ie.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,C.jsxs)($e,{children:[(0,C.jsxs)(nn,{children:[(0,C.jsx)(j.Z,{alignItems:"center",children:(0,C.jsx)(O.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new dbt model":"Select dbt model or snapshot file"})}),(0,C.jsx)(T.Z,{iconOnly:!0,onClick:o,children:(0,C.jsx)(V.x8,{muted:!0})})]}),t&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(on,{children:(0,C.jsx)(Ye,{dynamicSizing:!0,inputValue:i,label:"Model name (cannot be changed):",labelColor:G.Z.accent.dbt,notRequired:!0,onBlur:function(){d(!1)},onChange:function(e){c(e.target.value),e.preventDefault()},onClick:function(){d(!0)},onFocus:function(){d(!0)},placeholder:"Enter name",required:!0,stacked:!0,suffixValue:".".concat(v.t6.SQL),value:!a&&i})}),(0,C.jsxs)(on,{children:[(0,C.jsx)(O.ZP,{bold:!0,color:G.Z.accent.dbt,children:"Select folder location:"}),(0,C.jsx)(O.ZP,{bold:!0,muted:!f,children:f?"dbt".concat(Re.sep).concat(f):"Choose folder below"})]})]}),(0,C.jsx)(tn,{children:(0,C.jsx)(ce.Z,{allowSelectingFolders:t,disableContextMenu:!0,files:m,isFileDisabled:function(e,n){return t?!n||(null===n||void 0===n?void 0:n.some((function(e){return"models"===(null===e||void 0===e?void 0:e.name)}))):!!b[e]||!(null!==n&&void 0!==n&&n.length)&&!e.match(new RegExp(".".concat(v.t6.SQL,"$")))},openFile:l,selectFile:h,uncollapsed:!0,useRootFolder:!0})}),t&&(0,C.jsx)(rn,{children:(0,C.jsx)(T.Z,{backgroundColor:i&&f?G.Z.accent.dbt:G.Z.monotone.grey500,disabled:!i||!f,onClick:function(){return l(f)},padding:"6px 8px",children:"Create model"})})]})},an=t(73828),sn=t(10975),dn=t(14567),pn=t(18283),fn=t(93005),hn=t(75968),vn=t(87323);function mn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function bn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function gn(e,n){var t,i=e.block,r=e.blocks,o=e.onClick,c=e.onDrop,u=i.type,a=(0,sn.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:i,type:fn.vT}}),[i]),d=(0,l.Z)(a,3),p=d[0],f=d[1],h=(d[2],(0,dn.L)((function(){return{accept:fn.vT,drop:function(e){return null===c||void 0===c?void 0:c(i,e)}}}),[i])),b=(0,l.Z)(h,2)[1],x=(0,s.useContext)(m.ThemeContext),_=(0,w.qn)(u,{blockColor:i.color,theme:x}).accent,S=(0,vn.cU)([i],r)[0],E=S.dynamic,I=S.dynamicUpstreamBlock,T=S.reduceOutput,D=S.reduceOutputUpstreamBlock,A=(0,s.useMemo)((function(){return(0,hn._o)({block:i,dynamic:E,dynamicUpstreamBlock:I,reduceOutput:T,reduceOutputUpstreamBlock:D})}),[i,E,I,T,D]).borderColorShareProps,M=(0,s.useMemo)((function(){return v.tf.DBT===(null===i||void 0===i?void 0:i.type)}),[i]);return(0,C.jsx)(Z.Z,{pb:1,ref:b,children:(0,C.jsx)(w.PY,bn(bn({},bn(bn({},A),p)),{},{ref:f,children:(0,C.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:function(){return o()},preventDefault:!0,ref:n,children:(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",flex:1,children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(pn.Z,{monospace:!0,children:v.dO[i.language]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(g.Z,{color:_,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{color:_,monospace:!0,children:null===(t=M?v.tf.DBT:v.V4[i.type])||void 0===t?void 0:t.toUpperCase()})]}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsx)(V.iU,{size:1.5*P.iI}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:null===i||void 0===i?void 0:i.uuid})]}),(0,C.jsx)(we.Z,{appearAbove:!0,appearBefore:!0,block:!0,label:"Show ".concat(null===i||void 0===i?void 0:i.uuid," block"),size:2*P.iI,widthFitContent:!0,children:(0,C.jsx)(V.Db,{muted:!0,size:2*P.iI})})]})})})}))})}var xn,jn,yn,kn,Zn=s.forwardRef(gn),On=t(4804),Pn=t(65730),wn=t(87372);!function(e){e.FULL_TABLE="FULL_TABLE",e.INCREMENTAL="INCREMENTAL",e.LOG_BASED="LOG_BASED"}(jn||(jn={})),function(e){e.IGNORE="IGNORE",e.UPDATE="UPDATE"}(yn||(yn={})),function(e){e.DATE_TIME="date-time",e.UUID="uuid"}(kn||(kn={}));var Cn,_n="datetime",Sn=(xn={},(0,o.Z)(xn,kn.DATE_TIME,_n),(0,o.Z)(xn,kn.UUID,kn.UUID),xn);!function(e){e.ARRAY="array",e.BOOLEAN="boolean",e.INTEGER="integer",e.NULL="null",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(Cn||(Cn={}));var En,In,Tn,Dn,An,Mn=[Cn.ARRAY,Cn.BOOLEAN,_n,Cn.INTEGER,Cn.NULL,Cn.NUMBER,Cn.OBJECT,Cn.STRING,kn.UUID];!function(e){e.PROPERTIES="properties"}(En||(En={})),function(e){e.AUTOMATIC="automatic",e.AVAILABLE="available",e.UNSUPPORTED="unsupported"}(In||(In={})),function(e){e.FORCED_REPLICATION_METHOD="forced-replication-method",e.KEY_PROPERTIES="table-key-properties",e.REPLICATION_KEYS="valid-replication-keys",e.SCHEMA_NAME="schema-name"}(Tn||(Tn={})),function(e){e.AMPLITUDE="amplitude",e.BIGQUERY="bigquery",e.CHARGEBEE="chargebee",e.GOOGLE_ADS="google_ads",e.GOOGLE_SEARCH_CONSOLE="google_search_console",e.GOOGLE_SHEETS="google_sheets",e.INTERCOM="intercom",e.MYSQL="mysql",e.PIPEDRIVE="pipedrive",e.POSTGRESQL="postgresql",e.REDSHIFT="redshift",e.SALESFORCE="salesforce",e.STRIPE="stripe"}(Dn||(Dn={})),function(e){e.BIGQUERY="bigquery",e.DELTA_LAKE_S3="delta_lake_s3",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.SNOWFLAKE="snowflake"}(An||(An={}));var Bn=t(79891),Rn=t(87815),Nn=t(70902),Ln=t(85307),Fn=t(7715);function Un(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Hn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Un(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wn="4px",zn=[An.BIGQUERY,An.DELTA_LAKE_S3];var Vn=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,r=e.isLoadingUpdateDestinationBlockState,c=e.loadSampleData,u=e.source,a=e.stream,d=e.streams,p=e.updateAllStreams,f=e.updateDestinationBlockState,h=e.updateMetadataForColumns,v=e.updateSchemaProperty,m=e.updateStream,g=(0,s.useRef)(null),x=a.bookmark_properties,k=a.destination_table,w=void 0===k?"":k,_=a.key_properties,S=a.metadata,E=a.partition_keys,I=a.replication_method,D=a.run_in_parallel,A=a.schema.properties,M=a.tap_stream_id,B=a.unique_constraints,R=a.unique_conflict_method,N=(0,s.useState)(w),L=N[0],F=N[1],H=(0,s.useState)(!1),z=H[0],V=H[1],G=(0,s.useState)(null),K=G[0],Y=G[1],q=(0,s.useState)(!1),Q=q[0],J=q[1],X=(0,s.useState)((0,o.Z)({},M,n||{})),$=X[0],ee=X[1],te=(0,Ce.Z)(M);(0,s.useEffect)((function(){te!==M&&(F(w),Y(null))}),[w,I,M,te,R]),(0,s.useEffect)((function(){var e=null===$||void 0===$?void 0:$[M];(null===x||void 0===x?void 0:x.length)>0&&((0,Fn.Qr)(e)||!(0,Fn.Xy)(n,e))&&ee((function(e){return Hn(Hn({},e),{},(0,o.Z)({},M,n))}))}),[null===x||void 0===x?void 0:x.length,n,M]);var ie=(0,s.useMemo)((function(){return(0,Ie.HK)(S,(function(e){return e.breadcrumb.join("/")}))}),[S]),re=(0,s.useMemo)((function(){var e;return null===(e=(0,Ie.sE)(S,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[S]),oe=(0,s.useMemo)((function(){return re[Tn.KEY_PROPERTIES]||[]}),[re]),le=(0,s.useMemo)((function(){return re[Tn.REPLICATION_KEYS]||[]}),[re]),ce=zn.includes(t),ue=d.length>1,ae=(0,s.useCallback)((function(e){var n=Hn({},null===$||void 0===$?void 0:$[M]);n.hasOwnProperty(e)&&delete n[e],ee((function(e){return Hn(Hn({},e),{},(0,o.Z)({},M,Hn({},n)))})),f({block:{bookmark_values:n,destination_table:L,tap_stream_id:M}})}),[$,L,M,f]),se=(0,s.useMemo)((function(){var e=[],n=[],i=(0,Ie.mr)(Object.entries(A)).map((function(i,r){var o=(0,l.Z)(i,2),c=o[0],u=o[1],a=u.anyOf,s=void 0===a?[]:a,d=u.format,f=u.type,g=void 0===f?[]:f,k=new Set(Array.isArray(g)?g:[g]),w=new Set(k);s.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){k.add(e),w.add(e)})):(k.add(t),w.add(t),n&&w.add(n))}));var S=Array.from(k);d&&w.add(d);var I=(ie["properties/".concat(c)]||{}).metadata,D=(I.inclusion,I.selected);e.push(D),n.push(c);var A=Mn.reduce((function(e,n){return S.indexOf(n)>=0||_n===String(n)&&kn.DATE_TIME===d||kn.UUID===String(n)&&kn.UUID===d?e:e.concat((0,C.jsx)("option",{value:n,children:n},n))}),[]),R=S.findIndex((function(e){return e===Cn.STRING})),N=[(0,C.jsx)(b.Z,{checked:D,onClick:function(){h(M,[c],{selected:!D})}},"".concat(M,"/").concat(c,"/selected")),(0,C.jsx)(O.ZP,{children:c},"".concat(M,"/").concat(c,"/name")),(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:S.map((function(e,n){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{border:!0,label:d&&Cn.STRING===e&&R===n?Sn[d]:e,onClick:function(){var n={format:d,type:S.filter((function(n){return n!==e}))};kn.DATE_TIME!==d&&kn.UUID!==d||Cn.STRING!==e||(n.format=null),v(M,c,n)},small:!0})},"".concat(M,"/").concat(c,"/").concat(e,"/").concat(n,"/chip"))}))})}),A.length>=1&&(0,C.jsxs)(U.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:d,type:S};_n===String(n)?(t.format=kn.DATE_TIME,t.type.push(Cn.STRING)):kn.UUID===String(n)?(t.format=kn.UUID,t.type.push(Cn.STRING)):t.type.push(n),v(M,c,t)},primary:!0,small:!0,value:"",width:10*P.iI,children:[(0,C.jsx)("option",{value:""}),A]})]},"".concat(M,"/").concat(c,"/type")),(0,C.jsx)(b.Z,{checked:!(null===B||void 0===B||!B.includes(c)),disabled:oe.length>=1&&!oe.includes(c),onClick:oe.length>=1&&!oe.includes(c)?null:function(){return m(M,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(c)?e.unique_constraints=(0,Ie.Od)(e.unique_constraints,(function(e){return c===e})):e.unique_constraints=[c].concat(e.unique_constraints||[]),e}))}},"".concat(M,"/").concat(c,"/unique")),(0,C.jsx)(b.Z,{checked:!(null===x||void 0===x||!x.includes(c)),disabled:le.length>=1&&!le.includes(c),onClick:le.length>=1&&!le.includes(c)?null:function(){return m(M,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(c)?(ae(c),e.bookmark_properties=(0,Ie.Od)(e.bookmark_properties,(function(e){return c===e}))):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),e}))}},"".concat(M,"/").concat(c,"/bookmark")),(0,C.jsx)(b.Z,{checked:!(null===_||void 0===_||!_.includes(c)),onClick:function(){return m(M,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(c)?e.key_properties=(0,Ie.Od)(e.key_properties,(function(e){return c===e})):e.key_properties=[c].concat(e.key_properties||[]),e}))}},"".concat(M,"/").concat(c,"/key_property"))];if(ce){var L=t!==An.DELTA_LAKE_S3,F=L&&(oe.includes(c)||!w.has(kn.DATE_TIME));N.push((0,C.jsx)(b.Z,{checked:!(null===E||void 0===E||!E.includes(c)),disabled:F,onClick:F?null:function(){return m(M,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(c)?e.partition_keys=(0,Ie.Od)(e.partition_keys,(function(e){return c===e})):L&&1===(null===(t=e.partition_keys)||void 0===t?void 0:t.length)?e.partition_keys=[c]:e.partition_keys=[c].concat(e.partition_keys||[]);return e}))}},"".concat(M,"/").concat(c,"/partition_key")))}if(ue){var H=K===r;N.push((0,C.jsx)(T.Z,{compact:!0,disabled:H,onClick:function(){Y(r),setTimeout((function(){return Y(null)}),2e3),p((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==M&&null!==e&&void 0!==e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[c]){var i,r,o,l,u,a,s,p,f;e.schema.properties[c]={format:d||null,type:S};var h=null===(i=(0,Ie.sE)((null===e||void 0===e?void 0:e.metadata)||[],(function(e){return 0===e.breadcrumb.length})))||void 0===i?void 0:i.metadata,v=h[Tn.REPLICATION_KEYS]||[],m=h[Tn.KEY_PROPERTIES]||[];null===B||void 0===B||!B.includes(c)||null!==e&&void 0!==e&&null!==(r=e.unique_constraints)&&void 0!==r&&r.includes(c)||!m.includes(c)?null!==B&&void 0!==B&&B.includes(c)||null===e||void 0===e||null===(o=e.unique_constraints)||void 0===o||!o.includes(c)||(e.unique_constraints=(0,Ie.Od)(e.unique_constraints,(function(e){return c===e}))):e.unique_constraints=[c].concat(e.unique_constraints||[]),null===x||void 0===x||!x.includes(c)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(c)||!v.includes(c)?null!==x&&void 0!==x&&x.includes(c)||null===e||void 0===e||null===(u=e.bookmark_properties)||void 0===u||!u.includes(c)||(e.bookmark_properties=(0,Ie.Od)(e.bookmark_properties,(function(e){return c===e}))):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),null===_||void 0===_||!_.includes(c)||null!==e&&void 0!==e&&null!==(a=e.key_properties)&&void 0!==a&&a.includes(c)?null!==_&&void 0!==_&&_.includes(c)||null===e||void 0===e||null===(s=e.key_properties)||void 0===s||!s.includes(c)||(e.key_properties=(0,Ie.Od)(e.key_properties,(function(e){return c===e}))):e.key_properties=[c].concat(e.key_properties||[]),null===E||void 0===E||!E.includes(c)||null!==e&&void 0!==e&&null!==(p=e.partition_keys)&&void 0!==p&&p.includes(c)?null!==E&&void 0!==E&&E.includes(c)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(c)||(e.partition_keys=(0,Ie.Od)(e.partition_keys,(function(e){return c===e}))):e.partition_keys=[c].concat(e.partition_keys||[])}return Hn({},e)}))},pill:!0,secondary:!0,children:(0,C.jsx)(O.ZP,{success:H,children:H?"Applied!":"Apply"})}))}return N})),r=e.every((function(e){return e})),o=[null,2,1,null,null,null],c=[{label:function(){return(0,C.jsx)(b.Z,{checked:r,onClick:function(){h(M,n,{selected:!r})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{uuid:"Unique"},{uuid:"Bookmark"},{uuid:"Key prop"}];return ce&&(o.push(null),c.push({uuid:"Partition key"})),ue&&(o.push(null),c.push({tooltipMessage:"This will apply this individual feature's schema settings to all selected streams that have the same feature. Unique features must be valid key properties in other streams. Bookmark features must be valid replication keys in other streams.",uuid:"All streams"})),(0,C.jsx)(Ln.cl,{children:(0,C.jsx)(Rn.Z,{alignTop:!0,columnFlex:o,columns:c,rows:i,stickyHeader:!0})})}),[x,t,ue,K,_,ie,E,A,ae,ce,M,B,p,h,v,m,oe,le]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(wn.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,C.jsx)(wn.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:M})," schema"]}),(0,C.jsx)(Z.Z,{mb:3,children:(0,C.jsx)(Be.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{children:"Destination table name"}),(0,C.jsx)(Z.Z,{ml:Wn}),(0,C.jsx)(we.Z,{label:(0,C.jsxs)(O.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:M}),". To change the table name, enter in a different value."]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(W.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;F(n),clearTimeout(g.current),g.current=setTimeout((function(){m(M,(function(e){return Hn(Hn({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*P.iI})]})})}),(0,C.jsx)(Z.Z,{mb:3,children:(0,C.jsx)(Be.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{children:"Replication method"}),(0,C.jsx)(Z.Z,{ml:Wn}),(0,C.jsx)(we.Z,{label:(0,C.jsxs)(O.ZP,{children:["Do you want to synchronize the entire stream (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:jn.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:jn.INCREMENTAL}),")?",u===Dn.POSTGRESQL&&(0,C.jsxs)(O.ZP,{children:["Log-based incremental replication (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:jn.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsxs)(U.Z,{compact:!0,onChange:function(e){m(M,(function(n){return Hn(Hn({},n),{},{replication_method:e.target.value})}))},primary:!0,value:I,children:[(0,C.jsx)("option",{value:""}),Object.values(jn).filter((function(e){return u===Dn.POSTGRESQL||e!==jn.LOG_BASED})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))]}),(0,C.jsx)(Z.Z,{ml:3}),(0,C.jsx)(O.ZP,{children:"Unique conflict method"}),(0,C.jsx)(Z.Z,{ml:Wn}),(0,C.jsx)(we.Z,{label:(0,C.jsxs)(O.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,ne._6)("column",null===B||void 0===B?void 0:B.length),(null===B||void 0===B?void 0:B.length)>0&&(0,C.jsx)(C.Fragment,{children:"\xa0"}),null===B||void 0===B?void 0:B.sort().map((function(e,n){return(0,C.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===B||void 0===B?void 0:B.length)&&n===(null===B||void 0===B?void 0:B.length)-1?(0,C.jsx)(O.ZP,{inline:!0,children:" and "},e):n>=1&&(0,C.jsx)(C.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:yn.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:yn.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsxs)(U.Z,{compact:!0,inputWidth:11*P.iI,onChange:function(e){m(M,(function(n){return Hn(Hn({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:R,children:[(0,C.jsx)("option",{value:""}),(0,C.jsx)("option",{value:yn.IGNORE,children:yn.IGNORE}),(0,C.jsx)("option",{value:yn.UPDATE,children:yn.UPDATE})]})]}),ue&&(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{default:!0,children:"All streams"}),(0,C.jsx)(Z.Z,{ml:Wn}),(0,C.jsx)(we.Z,{appearBefore:!0,label:(0,C.jsx)(O.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(T.Z,{compact:!0,disabled:z,onClick:function(){V(!0),setTimeout((function(){return V(!1)}),2e3),p((function(e){return Hn(Hn({},e),{},{replication_method:I,unique_conflict_method:R})}))},pill:!0,secondary:!0,children:(0,C.jsx)(O.ZP,{bold:!z,success:z,children:z?"Applied!":"Apply"})})]})]})})}),(0,C.jsx)(Be.Z,{headerTitle:"Features",noPadding:!0,children:se}),(0,C.jsx)(Z.Z,{mt:2,children:(0,C.jsx)(T.Z,{loading:i,onClick:function(){return c(M)},primary:!0,small:!0,children:"Load sample data"})}),(0,C.jsxs)(Z.Z,{mt:5,children:[(0,C.jsx)(wn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,C.jsx)(Z.Z,{mb:5,children:(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,C.jsx)(O.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(Nn.Z,{checked:D,onCheck:function(){return m(M,(function(e){return e.run_in_parallel=!D,e}))}},"".concat(M,"/run_in_parallel"))]})}),jn.INCREMENTAL===I&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,C.jsxs)(O.ZP,{default:!0,children:["After each integration pipeline run, the last record that was successfully synchronized will be used as the bookmark. The properties listed below will be extracted from the last record and used as the bookmark.",(0,C.jsx)("br",{}),"On the next run, the synchronization will start after the bookmarked record."]})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==x&&void 0!==x&&x.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===x||void 0===x?void 0:x.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){ae(e),m(M,(function(n){return Hn(Hn({},n),{},{bookmark_properties:(0,Ie.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===x||void 0===x?void 0:x.length)>0&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{my:2,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),(0,C.jsx)(O.ZP,{default:!0,children:'In order to override the bookmark values for the next sync, you must first select a destination. Then click the toggle to edit the values for the bookmark properties in the table below. Click the "Save" button to save your changes.'})]}),(0,C.jsx)(Nn.Z,{checked:Q,disabled:!t,onCheck:function(){return J((function(e){return!e}))}})]})}),Q&&!!t&&(0,C.jsx)(Be.Z,{header:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,C.jsx)(T.Z,{compact:!0,loading:r,onClick:function(){f({block:{bookmark_values:(null===$||void 0===$?void 0:$[M])||{},destination_table:L,tap_stream_id:M}})},pill:!0,secondary:!0,children:"Save"})]}),headerPaddingVertical:P.iI,noPadding:!0,overflowVisible:!0,children:(0,C.jsx)(Rn.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Bookmark property"},{uuid:"Value"}],rows:x.map((function(e){var n;return[(0,C.jsx)(O.ZP,{default:!0,monospace:!0,children:e},e),(0,C.jsx)(W.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ee((function(t){return Hn(Hn({},t),{},(0,o.Z)({},M,Hn(Hn({},t[M]),{},(0,o.Z)({},e,n.target.value))))}))},paddingHorizontal:0,placeholder:"Enter value",value:null===$||void 0===$||null===(n=$[M])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,C.jsx)(O.ZP,{default:!0,children:"Multiple records (e.g. 2 or more) with the same values in the columns listed below will be considered duplicates."})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==B&&void 0!==B&&B.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===B||void 0===B?void 0:B.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){m(M,(function(n){return Hn(Hn({},n),{},{unique_constraints:(0,Ie.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,C.jsx)(O.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==_&&void 0!==_&&_.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===_||void 0===_?void 0:_.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){m(M,(function(n){return Hn(Hn({},n),{},{key_properties:(0,Ie.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ce&&(0,C.jsxs)(Z.Z,{mb:3,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,C.jsx)(O.ZP,{default:!0,children:"One datetime column can be used to partition the table. (Note: Partition keys currently only work with BigQuery destinations. Support for other destinations is WIP.)"})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==E&&void 0!==E&&E.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===E||void 0===E?void 0:E.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){m(M,(function(n){return Hn(Hn({},n),{},{partition_keys:(0,Ie.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Gn=["catalog","pipeline","setErrors","setSelectedStream"];function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qn,Qn=function(e){var n,t=e.catalog,i=e.pipeline,r=e.setErrors,o=e.setSelectedStream,c=(0,He.Z)(e,Gn),u=(0,s.useState)(null),a=u[0],p=u[1],f=(0,s.useMemo)((function(){return(null===t||void 0===t?void 0:t.streams)||[]}),[t]),h=(0,s.useMemo)((function(){return(0,Ie.YC)(f,"stream").map((function(e){return{uuid:e.stream}}))}),[f]),m=(0,s.useMemo)((function(){return(0,Ie.HK)(f,(function(e){return e.stream}))}),[f]),b=(0,s.useMemo)((function(){return m[null===a||void 0===a?void 0:a.uuid]}),[a,m]),g=(0,s.useMemo)((function(){return(0,Ie.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return v.tf.DATA_EXPORTER===n}))}),[null===i||void 0===i?void 0:i.blocks]),x=b||{},j=x.destination_table,y=x.tap_stream_id,k=!(!y||!j),P=z.ZP.blocks.pipelines.detail(k?null===i||void 0===i?void 0:i.uuid:null,k?null===g||void 0===g?void 0:g.uuid:null,{destination_table:j,state_stream:y}),w=P.data,_=P.mutate,S=null===w||void 0===w||null===(n=w.block)||void 0===n?void 0:n.bookmarks,E=(0,d.Db)(z.ZP.blocks.pipelines.useUpdate(null===i||void 0===i?void 0:i.uuid,null===g||void 0===g?void 0:g.uuid,{query:{update_state:!0}}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){null===_||void 0===_||_()},onErrorCallback:function(e,n){return null===r||void 0===r?void 0:r({errors:n,response:e})}})}}),I=(0,l.Z)(E,2),T=I[0],A=I[1].isLoading;(0,s.useEffect)((function(){h.length>0&&(a&&(0,Ie.sE)(h,(function(e){var n=e.uuid;return a.uuid===n}))||p(h[0]))}),[a,p,h]);var M=(0,s.useMemo)((function(){var e=[{uuid:"Stream"},{uuid:"Columns Selected"},{uuid:"Replication Method"},{uuid:"Destination Table"},{uuid:"Bookmark Props"},{uuid:"Key Props"},{uuid:"Unique Constraints"},{uuid:"Unique Conflict Method"},{uuid:"Partition Keys"}];return(0,C.jsx)(Ln.cl,{children:(0,C.jsx)(Rn.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:f.map((function(e){var n=e.replication_method,t=e.destination_table,i=e.bookmark_properties,r=e.key_properties,o=e.metadata,l=e.unique_constraints,c=e.unique_conflict_method,u=e.partition_keys,a=e.tap_stream_id,s=o.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,r=(null===t||void 0===t?void 0:t.length)>0,o=i&&r?1:0,l=r?1:0;return{selectedCount:e.selectedCount+o,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,C.jsx)(O.ZP,{children:"".concat(s.selectedCount," of ").concat(s.totalCount," total")},"".concat(a,"_col_selected")),p=[a,n,t,i,r,l,c,u].map((function(e,n){return(0,C.jsx)(O.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(a,"_cell_").concat(n))}));return p.slice(0,1).concat(d).concat(p.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[f]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(D.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){p(e),o(e.uuid)},selectedTabUUID:null===a||void 0===a?void 0:a.uuid,tabs:h}),b&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(Ln.dE,{children:(0,C.jsx)(Vn,Yn(Yn({},c),{},{bookmarkValues:S,isLoadingUpdateDestinationBlockState:A,stream:b,streams:f,updateDestinationBlockState:T}))})}),f.length>=1&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(Ln.dE,{children:[(0,C.jsx)(wn.Z,{level:4,children:"Streams Summary"}),(0,C.jsx)(Z.Z,{mt:1}),M]})})]})},Jn=t(30264),Xn=t(18776);function $n(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function et(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function nt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?et(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):et(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.ALL="All",e.SELECTED="Selected",e.NOT_SELECTED="Not selected"}(qn||(qn={}));var tt=45*P.iI,it=tt-4*P.iI;var rt=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,r=e.streams,l=(0,Ie.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),c=(0,s.useMemo)((function(){var e=new Set(r.map((function(e){return e.stream})));return Object.values(l).filter((function(n){var t=n.stream;return!e.has(t)})).map((function(e){return nt(nt({},e),{},{isMissingStream:!0})}))}),[l,r]),u=nt({},l);c.forEach((function(e){var n=e.stream;delete u[n]}));var a=(0,s.useState)(u),d=a[0],p=a[1],f=(0,s.useState)(null),h=f[0],v=f[1],m=(0,s.useState)(!1),g=m[0],j=m[1],k=(0,s.useState)(qn.ALL),w=k[0],_=k[1],S=(0,s.useRef)(null),E=$n(d),I=(0,s.useMemo)((function(){var e=r;return e=e.filter((function(e){var n=e.tap_stream_id;return w===qn.SELECTED?E.includes(n):w!==qn.NOT_SELECTED||!E.includes(n)})),h?e.filter((function(e){var n=e.tap_stream_id;return null===n||void 0===n?void 0:n.toLowerCase().includes(null===h||void 0===h?void 0:h.toLowerCase())})):e}),[w,h,E,r]),D=(0,s.useMemo)((function(){return r.every((function(e){var n=e.stream;return!!d[n]}))}),[d,r]);return(0,C.jsxs)(Xn.Z,{children:[(0,C.jsx)(Ln.cv,{rounded:!0,children:(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,C.jsx)(Ln.cv,{padding:1.25*P.iI,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(W.Z,{beforeIcon:(0,C.jsx)(V.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return v(e.target.value)},placeholder:"Search",value:h}),(0,C.jsx)(Z.Z,{pr:1,children:(0,C.jsx)(Jn.Z,{items:[{label:function(){return qn.ALL},onClick:function(){return _(qn.ALL)},uuid:"all_streams"},{label:function(){return qn.SELECTED},onClick:function(){return _(qn.SELECTED)},uuid:"selected"},{label:function(){return qn.NOT_SELECTED},onClick:function(){return _(qn.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return j(!1)},onClickOutside:function(){return j(!1)},open:g,parentRef:S,uuid:"SelectStreams/filter",children:(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(V.wn,{}),noBackground:!0,onClick:function(){return j((function(e){return!e}))},ref:S,children:(0,C.jsx)(O.ZP,{children:w})})})})]})}),(0,C.jsx)(Ln.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(tt,"px"),children:(0,C.jsx)(Rn.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,C.jsx)(b.Z,{checked:D,onClick:function(){var e=(0,Ie.HK)(r||[],(function(e){return e.stream}));p(D?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:I.concat(c).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!d[t];return[(0,C.jsx)(b.Z,{checked:i,disabled:!i&&n,onClick:function(){p((function(n){return nt(nt({},n),{},(0,o.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,C.jsxs)(O.ZP,{danger:n,title:t,width:tt-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,C.jsx)(x.Z,{medium:!0}),(0,C.jsxs)(Z.Z,{p:2,children:[(null===E||void 0===E?void 0:E.length)>50&&(0,C.jsx)(Z.Z,{pb:2,children:(0,C.jsxs)(O.ZP,{danger:!0,maxWidth:it,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,C.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===r||void 0===r?void 0:r.length)&&(0,C.jsx)(Z.Z,{pb:2,children:(0,C.jsx)(O.ZP,{bold:!0,maxWidth:it,warning:!0,whiteSpaceNormal:!0,children:"If you can successfully connect to the data source but no streams are displayed, check if the user has proper database/schema permissions."})}),(0,C.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,C.jsx)(T.Z,{loading:t,onClick:function(){return i(d)},primary:!0,children:"Confirm ".concat($n(d).length," streams")})})]})]})},ot=t(57722);function lt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ct(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?lt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):lt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ut=function(e){var n=e.api,t=e.block,i=e.blockContent,r=e.onChangeCodeBlock,c=e.pipeline,u=(0,s.useState)(null),a=u[0],p=u[1];(0,s.useEffect)((function(){i&&!a&&p((0,On.Pz)(null===i||void 0===i?void 0:i.config))}),[a,i]);var f=(0,s.useState)(null),h=f[0],m=f[1],b=(0,s.useState)(),g=b[0],x=b[1],j=(0,d.Db)(z.ZP[n].useCreate(),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var t,i,r=(0,ne.C5)(n);m(null===e||void 0===e||null===(t=e[r])||void 0===t?void 0:t.success),x(null===e||void 0===e||null===(i=e[r])||void 0===i?void 0:i.error_message)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),k=(0,l.Z)(j,2),P=k[0],w=k[1].isLoading;return t?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ln.$W,{children:(0,C.jsx)(ot.Z,{autoHeight:!0,language:v.t6.YAML,onChange:function(e){p(e),r(t.type,t.uuid,(0,On.Pz)(ct(ct({},i),{},{config:(0,On.Qc)(e)})))},tabSize:2,value:a||void 0,width:"100%"})}),(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{onClick:function(){P((0,o.Z)({},(0,ne.C5)(n),{action_type:"test_connection",config:a,pipeline_uuid:c.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,C.jsx)(Z.Z,{ml:1,children:w?(0,C.jsx)(H.Z,{color:"white",small:!0}):(0,C.jsxs)(C.Fragment,{children:[h&&(0,C.jsx)(O.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===h&&(0,C.jsx)(O.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),g&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(O.ZP,{small:!0,warning:!0,children:g})})]})]}):null},at=t(60701);function st(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function dt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?st(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):st(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pt=function(e){var n,t,i,r=e.addNewBlockAtIndex,o=e.blocks,c=e.codeBlocks,u=e.fetchFileTree,a=e.fetchPipeline,p=e.fetchSampleData,f=e.globalVariables,h=e.onChangeCodeBlock,m=e.openSidekickView,b=e.pipeline,g=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,w=e.setOutputBlocks,_=e.setSelectedBlock,S=e.setSelectedOutputBlock,E=e.setSelectedStream,I=(0,s.useState)(!0),D=I[0],A=I[1],M=(0,s.useState)(!0),B=M[0],R=M[1],N=(0,s.useState)(!0),L=N[0],F=N[1],W=z.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,G=(0,s.useMemo)((function(){return(null===W||void 0===W?void 0:W.integration_sources)||[]}),[W]),K=(0,s.useMemo)((function(){return(0,Ie.HK)(G,(function(e){return e.uuid}))}),[G]),Y=z.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,q=(0,s.useMemo)((function(){return(null===Y||void 0===Y?void 0:Y.integration_destinations)||[]}),[Y]),Q=(0,s.useMemo)((function(){return(0,Ie.HK)(q,(function(e){return e.uuid}))}),[q]),J=(0,s.useMemo)((function(){return(0,Ie.sE)(o,(function(e){var n=e.type;return v.tf.DATA_LOADER===n}))}),[o]),X=(0,s.useMemo)((function(){return J?(0,On.Qc)(J.content):{}}),[J]),$=(0,s.useMemo)((function(){return(0,C.jsx)(ut,{api:"integration_sources",block:J,blockContent:X,onChangeCodeBlock:h,pipeline:b})}),[J,X,h,b]),ee=(0,s.useMemo)((function(){return(0,Ie.sE)(o,(function(e){var n=e.type;return v.tf.DATA_EXPORTER===n}))}),[o]),ne=(0,s.useMemo)((function(){return ee?(0,On.Qc)(ee.content):{}}),[ee]),ie=(0,s.useMemo)((function(){return(0,C.jsx)(ut,{api:"integration_destinations",block:ee,blockContent:ne,onChangeCodeBlock:h,pipeline:b})}),[ee,ne,h,b]),re=(0,s.useMemo)((function(){return(0,Ie.sE)(o,(function(e){var n=e.type;return v.tf.TRANSFORMER===n}))}),[o]),oe=(0,s.useMemo)((function(){var e;return(0,Fn.Qr)(null===X||void 0===X?void 0:X.catalog)?null===b||void 0===b||null===(e=b.data_integration)||void 0===e?void 0:e.catalog:null===X||void 0===X?void 0:X.catalog}),[X,null===b||void 0===b||null===(n=b.data_integration)||void 0===n?void 0:n.catalog]),le=((null===oe||void 0===oe?void 0:oe.streams)||[]).every((function(e){return e.auto_add_new_fields})),ce=((null===oe||void 0===oe?void 0:oe.streams)||[]).every((function(e){return e.disable_column_type_check})),ue=(0,Ce.Z)(oe);(0,s.useEffect)((function(){!ue&&oe&&(w((function(){return S(J),[J]})),j((function(e){var n;return e||(null===oe||void 0===oe||null===(n=oe.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[oe]);var ae=(0,s.useState)(),se=ae[0],de=ae[1],pe=(0,d.Db)(z.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];w((function(){return S(J),[J]})),t.length>0&&E(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),m(at.cH.DATA),p()}else de(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),fe=(0,l.Z)(pe,2),he=fe[0],ve=fe[1].isLoading,me=(0,d.Db)(z.ZP.integration_sources.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,r=((null===oe||void 0===oe?void 0:oe.streams)||[]).filter((function(e){var n=e.tap_stream_id;return t.includes(n)})),o=r.map((function(e){return e.tap_stream_id})),l=i.filter((function(e){var n=e.tap_stream_id;return t.includes(n)&&!o.includes(n)}));l.forEach((function(e){e.metadata.forEach((function(n,t){var i=n.metadata;if(In.UNSUPPORTED!==i.inclusion){var r;if(e.replication_method||(e.replication_method=jn.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=yn.UPDATE),!e.destination_table)e.destination_table=null===e||void 0===e||null===(r=e.tap_stream_id)||void 0===r?void 0:r.replace(/\W+/g,"_");e.metadata[t]=dt(dt({},n),{},{metadata:dt(dt({},i),{},{selected:!0})})}}))}));var c={streams:r.concat(l)};j(Ne.map((function(e){return e.tap_stream_id})));var s=null===X||void 0===X?void 0:X.catalog;(0,Fn.Qr)(s)||h(J.type,J.uuid,(0,On.Pz)(dt(dt({},X),{},{catalog:{}})));var d={pipeline:dt(dt({},b),{},{data_integration:dt(dt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:c})})};g(d).then((function(){a(),u()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),be=(0,l.Z)(me,2),ge=be[0],xe=be[1].isLoading,je=(0,s.useState)(null),ye=je[0],ke=je[1],Ze=(0,d.Db)(z.ZP.integration_source_streams.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){ke(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Oe=(0,l.Z)(Ze,2),Pe=Oe[0],we=Oe[1].isLoading,_e=(0,s.useCallback)((function(e,n){var t=function(e,n){var t,i=[];return e.streams.forEach((function(e){e.tap_stream_id===n?t=e:i.push(e)})),{stream:t,streams:i}}(oe,e),i=t.stream,r=t.streams,o=dt(dt({},oe),{},{streams:r.concat(n(i))}),l=null===X||void 0===X?void 0:X.catalog;(0,Fn.Qr)(l)||h(J.type,J.uuid,(0,On.Pz)(dt(dt({},X),{},{catalog:{}})));var c={pipeline:dt(dt({},b),{},{data_integration:dt(dt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:o})})};g(c).then((function(){return a()}))}),[oe,J,X,a,h,b,g]),Se=(0,s.useCallback)((function(e){if(null!==oe&&void 0!==oe&&oe.streams){var n=dt(dt({},oe),{},{streams:oe.streams.map((function(n){return e(n)}))}),t=null===X||void 0===X?void 0:X.catalog;(0,Fn.Qr)(t)||h(J.type,J.uuid,(0,On.Pz)(dt(dt({},X),{},{catalog:{}})));var i={pipeline:dt(dt({},b),{},{data_integration:dt(dt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return a()}))}}),[oe,J,X,a,h,b,g]),Ee=(0,s.useCallback)((function(e,n,t){_e(e,(function(e){return e.schema.properties[n]=t,e}))}),[_e]),Te=(0,s.useCallback)((function(e,n,t){_e(e,(function(e){var i=e.metadata;return n.forEach((function(n){var r=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(r>=0){var o=i[r].metadata;e.metadata[r].metadata=dt(dt({},o),t)}})),e}))}),[_e]),Ae=(0,d.Db)(z.ZP.blocks.pipelines.useUpdate(null===b||void 0===b?void 0:b.uuid,null===ee||void 0===ee?void 0:ee.uuid),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){null===a||void 0===a||a()},onErrorCallback:function(e,n){return null===x||void 0===x?void 0:x({errors:n,response:e})}})}}),Me=(0,l.Z)(Ae,1)[0],Be=(0,s.useMemo)((function(){var e=[];return null===f||void 0===f||f.forEach((function(n){var t=n.variables;return null===t||void 0===t?void 0:t.forEach((function(n){var t=n.uuid,i=n.value,r="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,C.jsx)(O.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,C.jsx)(O.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,C.jsx)(O.ZP,{monospace:!0,children:r},"variable-uuid-".concat(t,"-{value}-code")),(0,C.jsx)(Pn.Z,{copiedText:r,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,C.jsx)(Rn.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[f]),Re=(0,s.useCallback)((function(e){return(0,C.jsxs)(Z.Z,{mt:2,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,C.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,C.jsx)("br",{}),"For more information, check out the ",(0,C.jsx)(k.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,C.jsx)(Z.Z,{mt:1,children:Be})]})}),[Be]),Ne=(0,s.useMemo)((function(){return(null===ye||void 0===ye?void 0:ye.streams)||[]}),[ye]),Le=(0,De.dd)((function(){return(0,C.jsx)(rt,{catalog:oe,isLoading:xe,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)ge({integration_source:{streams:n}}),We();else{var t=null===X||void 0===X?void 0:X.catalog;(0,Fn.Qr)(t)||h(J.type,J.uuid,(0,On.Pz)(dt(dt({},X),{},{catalog:{}}))),g({pipeline:dt(dt({},b),{},{data_integration:dt(dt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:null})})}).then((function(){return a()})),We()}},streams:Ne})}),{},[oe,J,X,a,xe,h,g,Ne],{background:!0,uuid:"select_streams"}),Fe=(0,l.Z)(Le,2),He=Fe[0],We=Fe[1];return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{iconOnly:!0,onClick:function(){return R((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[B&&(0,C.jsx)(V.Kh,{size:1.5*P.iI}),!B&&(0,C.jsx)(V._M,{size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(wn.Z,{children:"Source"}),!B&&(0,C.jsxs)(wn.Z,{default:!0,inline:!0,children:["\xa0",null===(t=K[null===X||void 0===X?void 0:X.source])||void 0===t?void 0:t.name]})]})]})}),B&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Ln.dE,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(wn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===G||void 0===G?void 0:G.length)>0?(0,C.jsxs)(U.Z,{onChange:function(e){var n,t,i=e.target.value;if(i){var o=null===(n=K[i])||void 0===n||null===(t=n.templates)||void 0===t?void 0:t.config;o&&Object.keys(o).forEach((function(e){o[e]=o[e]||null})),J?h(J.type,J.uuid,(0,On.Pz)(dt(dt({},X),{},{catalog:{},config:o,source:i}))):r({content:(0,On.Pz)({config:o,source:i}),language:v.t6.YAML,type:v.tf.DATA_LOADER},0,_),ke(null),g().then((function(){a()}))}},primary:!0,value:null===X||void 0===X?void 0:X.source,children:[(0,C.jsx)("option",{value:""}),G.map((function(e){var n=e.name,t=e.uuid;return(0,C.jsx)("option",{value:t,children:n},t)}))]}):(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(H.Z,{inverted:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(wn.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),J&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(wn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===X||void 0===X?void 0:X.source)&&(0,C.jsxs)(Z.Z,{mb:2,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["For more information on how to configure this source, read the ",(0,C.jsxs)(k.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/sources/".concat(X.source,"/README.md"),openNewWindow:!0,primary:!0,children:[X.source," documentation"]})]}),Re("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),$]}),(0,C.jsxs)("div",{children:[(0,C.jsx)(wn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,C.jsx)(T.Z,{loading:we,onClick:function(){g().then((function(){Pe().then((function(){return He()})),a()}))},primary:!0,small:!0,children:"View and select streams"})]}),se&&(0,C.jsx)(O.ZP,{warning:!0,children:se})]})]}),xe&&(0,C.jsx)(Z.Z,{p:2,children:(0,C.jsx)(H.Z,{})}),!xe&&(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsx)(Qn,{catalog:oe,destination:null===ne||void 0===ne?void 0:ne.destination,isLoadingLoadSampleData:ve,loadSampleData:function(e){return he({integration_source:{action_type:"sample_data",pipeline_uuid:null===b||void 0===b?void 0:b.uuid,streams:[e]}})},pipeline:b,setErrors:x,setSelectedStream:E,source:null===X||void 0===X?void 0:X.source,updateAllStreams:Se,updateMetadataForColumns:Te,updateSchemaProperty:Ee,updateStream:_e})})]}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{disabled:!J,iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[L&&J&&(0,C.jsx)(V.Kh,{size:1.5*P.iI}),(!L||!J)&&(0,C.jsx)(V._M,{disabled:!J,size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)(wn.Z,{children:"Transformers"})})]})}),L&&J&&(0,C.jsx)(Z.Z,{mb:5,children:(0,C.jsxs)(Ln.dE,{children:[c.length>0&&(0,C.jsx)(Z.Z,{mb:1,children:c.map((function(e,n){return(0,C.jsx)(Z.Z,{mb:1,children:e},n)}))}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(Ue.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return J&&i.push(J.uuid),r(dt(dt({},e),{},{configuration:t,content:n,upstream_blocks:i}),o.length-1,(function(e){ee&&(Me({block:dt(dt({},ee),{},{upstream_blocks:[e.uuid]})}),_(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!re,hideTransformerDataSources:!0,pipeline:b})})]})}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{disabled:!J,iconOnly:!0,onClick:function(){return A((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[D&&J&&(0,C.jsx)(V.Kh,{size:1.5*P.iI}),(!D||!J)&&(0,C.jsx)(V._M,{disabled:!J,size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(wn.Z,{children:"Destination"}),!D&&(0,C.jsxs)(wn.Z,{default:!0,inline:!0,children:["\xa0",null===(i=Q[null===ne||void 0===ne?void 0:ne.destination])||void 0===i?void 0:i.name]})]})]})}),D&&J&&(0,C.jsxs)(Ln.dE,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(wn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===q||void 0===q?void 0:q.length)>0?(0,C.jsxs)(U.Z,{onChange:function(e){var n=e.target.value;if(n){if(ee)h(ee.type,ee.uuid,(0,On.Pz)(dt(dt({},ne),{},{destination:n})));else{var t,i,l=null===(t=Q[n])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;l&&(Object.keys(l).forEach((function(e){l[e]=l[e]||null})),l.hasOwnProperty("table")&&delete l.table);var c=[];if((null===o||void 0===o?void 0:o.length)>=2){var u=o.find((function(e){var n=e.uuid;return(null===J||void 0===J?void 0:J.uuid)!==n}));u&&c.push(u.uuid)}else J&&c.push(J.uuid);r({content:(0,On.Pz)({config:l,destination:n}),language:v.t6.YAML,type:v.tf.DATA_EXPORTER,upstream_blocks:c},1,_)}g().then((function(){a()}))}},primary:!0,value:null===ne||void 0===ne?void 0:ne.destination,children:[(0,C.jsx)("option",{value:""}),q.map((function(e){var n=e.name,t=e.uuid;return(0,C.jsx)("option",{value:t,children:n},t)}))]}):(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(H.Z,{inverted:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(wn.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),ee&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(wn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===ne||void 0===ne?void 0:ne.destination)&&(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)(Z.Z,{mb:2,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,C.jsxs)(k.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(ne.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[ne.destination," documentation"]}),".",(0,C.jsx)("br",{}),(0,C.jsx)("br",{}),"If your configuration contains a key named ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,C.jsx)("br",{}),"The table that\u2019s created in this destination will have a name corresponding to the stream\u2019s unique name (by default) or the value you entered under the input field labeled ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Re("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),ie,(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,C.jsx)(O.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})]}),(0,C.jsx)(Nn.Z,{checked:!!le,disabled:!(null!==oe&&void 0!==oe&&oe.streams),onCheck:function(){return Se((function(e){return dt(dt({},e),{},{auto_add_new_fields:!le})}))}})]})}),(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,C.jsxs)(O.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,C.jsx)("br",{}),"If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped.",(0,C.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,C.jsx)(Nn.Z,{checked:!!ce,disabled:!(null!==oe&&void 0!==oe&&oe.streams),onCheck:function(){return Se((function(e){return dt(dt({},e),{},{disable_column_type_check:!ce})}))}})]})})]})]})]})},ft=t(46336),ht=t(42451),vt=t(84212),mt=t(51504);function bt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function gt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var xt=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.allBlocks,c=e.allowCodeBlockShortcuts,u=e.anyInputFocused,a=e.autocompleteItems,p=e.blockRefs,f=e.blocks,h=void 0===f?[]:f,m=e.dataProviders,b=e.deleteBlock,g=e.disableShortcuts,x=e.fetchFileTree,j=e.fetchPipeline,y=e.fetchSampleData,w=e.files,_=e.globalDataProducts,S=e.globalVariables,E=e.hiddenBlocks,I=e.interruptKernel,T=e.mainContainerRef,D=e.mainContainerWidth,B=e.messages,N=e.onChangeCallbackBlock,L=e.onChangeCodeBlock,U=e.openSidekickView,H=e.pipeline,W=e.pipelineContentTouched,V=e.project,G=e.restartKernel,K=e.runBlock,Y=e.runningBlocks,q=void 0===Y?[]:Y,Q=e.savePipelineContent,J=e.selectedBlock,X=e.setAnyInputFocused,$=e.setDisableShortcuts,ee=e.setEditingBlock,ie=e.setErrors,re=e.setIntegrationStreams,oe=e.setHiddenBlocks,le=e.setOutputBlocks,ce=e.setPipelineContentTouched,ue=e.setSelectedBlock,se=e.setSelectedOutputBlock,pe=e.setSelectedStream,fe=e.setTextareaFocused,ve=e.showBrowseTemplates,me=e.showConfigureProjectModal,be=e.showGlobalDataProducts,ge=e.showUpdateBlockModal,xe=e.textareaFocused,je=e.widgets,ye=(0,s.useRef)(null),ke=(0,s.useState)(!1),Ze=ke[0],Oe=ke[1],Pe=(0,s.useState)(!1),we=Pe[0],_e=Pe[1],Ee=(0,s.useState)(!1),Te=Ee[0],De=Ee[1],Ae=(0,s.useState)(!0),Be=Ae[0],Ne=Ae[1],He=(0,s.useState)(null),We=He[0],ze=He[1],Ve=(0,s.useState)(null),Ge=Ve[0],Ke=Ve[1],Ye=(0,s.useState)(!1),qe=Ye[0],Qe=Ye[1],Je=(0,s.useState)(""),Xe=Je[0],$e=Je[1],en=(0,s.useMemo)((function(){return q.reduce((function(e,n,t){return gt(gt({},e),{},(0,o.Z)({},n.uuid,gt(gt({},n),{},{priority:t})))}),{})}),[q]),nn=(0,Ce.Z)(J),tn=(0,s.useMemo)((function(){return h.length}),[h]),rn=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===H||void 0===H?void 0:H.type)}),[H]),on=(0,s.useMemo)((function(){return F.qL.STREAMING===(null===H||void 0===H?void 0:H.type)}),[H]),ln=(0,s.useMemo)((function(){var e;return F.qL.PYTHON===(null===H||void 0===H?void 0:H.type)&&(null===V||void 0===V||null===(e=V.features)||void 0===e?void 0:e[ft.d.ADD_NEW_BLOCK_V2])}),[H,V]),cn=z.ZP.block_templates.list({show_all:!!ln},{revalidateOnFocus:!1}).data,sn=(0,s.useMemo)((function(){return(null===cn||void 0===cn?void 0:cn.block_templates)||[]}),[cn]),dn="PipelineDetail/index",pn=(0,he.y)(),fn=pn.disableGlobalKeyboardShortcuts,vn=pn.registerOnKeyDown,mn=pn.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){mn(dn)}}),[mn,dn]),vn(dn,(function(e,n,t){if(W&&(0,mt.y)([de.zX,de.hS],n)){e.preventDefault();"undefined"!==typeof location&&window.confirm("You have changes that are unsaved. Click cancel and save your changes before reloading page.")&&location.reload()}if(!g&&!fn)if((0,mt.y)([de.zX,de.Um],n)||(0,mt.y)([de.PQ,de.Um],n))e.preventDefault(),Q();else if(xe)n[de.vP]?fe(!1):W||de.Z1.find((function(e){return n[e]}))||ce(!0);else if(!rn){var i;if(ln&&((0,mt.y)([de.zX,de.A1],n)||(0,mt.y)([de.PQ,de.A1],n)))e.preventDefault(),_e(!0),null===ye||void 0===ye||null===(i=ye.current)||void 0===i||i.focus();else if(ln&&we&&(0,mt.y)([de.vP],n)){var r;e.preventDefault(),_e(!1),null===ye||void 0===ye||null===(r=ye.current)||void 0===r||r.blur()}else if(J){var o=h.findIndex((function(e){var n=e.uuid;return J.uuid===n}));if(n[de.vP])ue(null);else if(t[0]===de.xD&&t[1]===de.xD)I();else if(t[0]===de.l1&&t[1]===de.l1&&-1!==o)b(J).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){o===h.length-1?ue(h[o-1]):h.length>=0?ue(h[o+1]):ue(null)}),100)}));else if(n[de.Bu]&&o>=1){var l=h[o-1];if(l){var c,a;ue(l);var s="".concat(l.type,"s/").concat(l.uuid,".py");null===(c=p.current[s])||void 0===c||null===(a=c.current)||void 0===a||a.scrollIntoView()}}else if(n[de.kD]&&o<=tn-2){var d=h[o+1];if(d){var f,v;ue(d);var m="".concat(d.type,"s/").concat(d.uuid,".py");null===(f=p.current[m])||void 0===f||null===(v=f.current)||void 0===v||v.scrollIntoView()}}else(0,mt.y)([de.Uq],n)&&fe(!0)}else nn&&n[de.Uq]&&ue(nn);u||t[0]!==de.OC||t[1]!==de.OC||G()}}),[n,u,p.current,h,we,I,rn,tn,W,G,Q,ye,J,nn,ce,ue,fe,xe,ln]),(0,s.useEffect)((function(){var e=setInterval((function(){W&&Q()}),1e4);return function(){clearInterval(e)}}),[W,Q]),(0,s.useEffect)((function(){setTimeout((function(){return De(!0)}),2*Se.zn)}),[H]);var bn=(0,d.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return z.ZP.blocks.pipelines.useUpdate(null===H||void 0===H?void 0:H.uuid,null===n||void 0===n?void 0:n.uuid)({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){j()},onErrorCallback:function(e,n){return null===ie||void 0===ie?void 0:ie({errors:n,response:e})}})}}),gn=(0,l.Z)(bn,1)[0],xn=(0,s.useCallback)((function(e){Oe(!0),Ke(e),$(!0)}),[Oe,$,Ke]),jn=(0,s.useCallback)((function(){Oe(!1),Qe(!1),$e(""),$(!1)}),[$]),yn=(0,s.useCallback)((function(e,n){var t,i;h.forEach((function(r,o){var l=r.uuid;t>=0&&i>=0||(l===e.uuid?t=o:l===n.uuid&&(i=o))}));var r=(0,Ie.oM)(h,i);return r=(0,Ie.Hk)(n,Math.max(t,0),r),Q({pipeline:{blocks:r,uuid:null===H||void 0===H?void 0:H.uuid}})}),[h,H,Q]),kn=(0,s.useMemo)((function(){var e=[];return h.filter((function(e){var n=e.type;return!rn||v.tf.TRANSFORMER===n})).forEach((function(l,u){var d,f=l.type,y=l.uuid,k=(null===J||void 0===J?void 0:J.uuid)===y,Z=en[y],O=Z?0===Z.priority?Me.uF.BUSY:Me.uF.QUEUED:Me.uF.IDLE,P="".concat(f,"s/").concat(y,".py");p.current[P]=(0,s.createRef)();var w=f===v.tf.MARKDOWN,S=f===v.tf.TRANSFORMER,A=!(null===E||void 0===E||!E[y]),M=u===tn-1||rn,F=p.current[P];d=A?(0,C.jsx)(Zn,{block:l,blocks:h,onClick:function(){return oe((function(e){return gt(gt({},e),{},(0,o.Z)({},y,!A))}))},onDrop:yn,ref:F},y):(0,C.jsx)(R.Z,{addNewBlock:function(e,t){fe(!0);return n(e,u+1,(function(e){if(1===(null===t||void 0===t?void 0:t.length)){var n,i,o=null===(n=t[0])||void 0===n?void 0:n.uuid,l=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];gn({block:{uuid:o},upstreamBlocks:[e.uuid].concat((0,r.Z)(l))})}null===ue||void 0===ue||ue(e)}))},addNewBlockMenuOpenIdx:We,addWidget:t,allBlocks:i,allowCodeBlockShortcuts:c,autocompleteItems:a,block:l,blockIdx:u,blockRefs:p,blockTemplates:sn,blocks:h,dataProviders:m,defaultValue:l.content,deleteBlock:function(e){b(e),X(!1)},disableShortcuts:g,executionState:O,fetchFileTree:x,fetchPipeline:j,globalDataProducts:_,hideRunButton:on||w||rn&&S,interruptKernel:I,mainContainerRef:T,mainContainerWidth:D,messages:B[y],noDivider:M,onCallbackChange:function(e){return N(f,y,e)},onChange:function(e){return L(f,y,e)},onClickAddSingleDBTModel:xn,onDrop:yn,openSidekickView:U,pipeline:H,project:V,ref:F,runBlock:K,runningBlocks:q,savePipelineContent:Q,selected:k,setAddNewBlockMenuOpenIdx:ze,setAnyInputFocused:X,setCreatingNewDBTModel:Qe,setEditingBlock:ee,setErrors:ie,setOutputBlocks:le,setSelected:function(e){return ue(!0===e?l:null)},setSelectedBlock:ue,setSelectedOutputBlock:se,setTextareaFocused:fe,showBrowseTemplates:ve,showConfigureProjectModal:me,showGlobalDataProducts:be,showUpdateBlockModal:ge,textareaFocused:k&&xe,widgets:je},y),e.push(d)})),e}),[n,We,t,i,c,a,p,sn,h,m,b,g,x,j,_,E,I,rn,on,T,D,B,tn,N,L,xn,yn,U,H,V,K,q,en,Q,J,ze,X,ee,ie,oe,le,ue,se,fe,ve,me,be,ge,xe,gn,je]),On=(0,s.useMemo)((function(){return(0,C.jsx)(pt,{addNewBlockAtIndex:n,blocks:h,codeBlocks:kn,fetchFileTree:x,fetchPipeline:j,fetchSampleData:y,globalVariables:S,onChangeCodeBlock:L,openSidekickView:U,pipeline:H,savePipelineContent:Q,setErrors:ie,setIntegrationStreams:re,setOutputBlocks:le,setSelectedBlock:ue,setSelectedOutputBlock:se,setSelectedStream:pe})}),[n,h,kn,x,j,y,S,L,U,H,Q,ie,re,le,ue,se,pe]),Pn=(0,s.useMemo)((function(){return H&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ue.Z,{addNewBlock:function(e){var t=h[h.length-1],i=null,r=e.configuration||{},o=t?(0,hn.eY)(t,e):[];t&&([v.tf.DATA_LOADER,v.tf.TRANSFORMER].includes(t.type)&&v.tf.SCRATCHPAD===e.type&&(i="from mage_ai.data_preparation.variable_manager import get_variable\n\n\n df = get_variable('".concat(H.uuid,"', '").concat(t.uuid,"', 'output_0')\n ")),v.t6.SQL===t.language&&(r=gt(gt({},(0,Fn.GL)(t.configuration,[ht.cH,ht.Sv,ht.sc,ht.BD,ht.nq])),r))),v.t6.SQL===e.language&&(i=(0,vt.SF)(i)),i=(0,vt.X7)(e,i),n(gt(gt({},e),{},{configuration:r,content:i,upstream_blocks:o}),tn,ue),fe(!0)},blockTemplates:sn,focusedAddNewBlockSearch:we,hideCustom:rn||on,hideDataExporter:rn,hideDataLoader:rn,hideDbt:rn||on,hideScratchpad:rn,hideSensor:rn,onClickAddSingleDBTModel:xn,pipeline:H,project:V,searchTextInputRef:ye,setCreatingNewDBTModel:Qe,setFocusedAddNewBlockSearch:_e,showBrowseTemplates:ve,showConfigureProjectModal:me,showGlobalDataProducts:be}),!ln&&!rn&&!on&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,C.jsx)("br",{}),"Turn on the feature named ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:ft.d.ADD_NEW_BLOCK_V2})," in your ",(0,C.jsx)(Le(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,C.jsx)(k.Z,{muted:!0,underline:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[n,sn,h,we,rn,on,tn,xn,H,V,ye,_e,ue,fe,ve,me,be,ln]);return(0,C.jsxs)(A.W,{backend:M.PD,children:[(0,C.jsx)(Se.lO,{children:Be&&(0,C.jsx)(Fe.Z,{classNames:"pipeline-detail",in:Te,onEntered:function(){return setTimeout((function(){return Ne(!1)}),Se.zn)},timeout:1,children:(0,C.jsx)(Se.fm,{})})}),(0,C.jsxs)(Z.Z,{mt:1,px:P.cd,children:[rn&&On,!rn&&(0,C.jsxs)(C.Fragment,{children:[kn,(0,C.jsx)(Z.Z,{mt:P.cd,children:Pn})]}),Ze&&(0,C.jsx)(ae.Z,{onClickOutside:jn,open:!0,children:(0,C.jsx)(un,{blocks:h,creatingNewDBTModel:qe,dbtModelName:Xe,files:w,onClose:jn,onOpenFile:function(e){var t=e;if(qe){var i=(0,ne.RA)(Xe||(0,ne.Y6)()),r=".".concat(an.Lu.SQL);i.endsWith(r)&&(i=i.slice(0,-4)),t="".concat(e).concat(Re.sep).concat(i,".").concat(an.Lu.SQL)}var o={configuration:{file_path:t,limit:R.z},language:v.t6.SQL,name:(0,ne.wE)(t),type:v.tf.DBT};qe&&(o.content="--Docs: https://docs.mage.ai/dbt/sources\n");var l="undefined"===typeof Ge||null===Ge,c=h[l?h.length-1:Ge],u=c?(0,hn.eY)(c,o):[];n(gt(gt({},o),{},{upstream_blocks:u}),l?tn:Ge+1,ue),jn(),fe(!0)},setDbtModelName:$e})})]})]})},jt=t(49894),yt=t(41424),kt=t(32063),Zt=t(82386),Ot=t(70543),Pt=t(24141);function wt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ct(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?wt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):wt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _t=function(e){var n=e.after,t=e.afterHeader,i=e.afterHeightOffset,r=e.afterHidden,o=e.afterNavigationItems,c=e.afterOverflow,u=e.afterSubheader,a=e.before,d=e.beforeHeader,p=e.beforeHeightOffset,f=e.beforeNavigationItems,h=e.children,v=e.errors,m=e.headerOffset,b=e.mainContainerHeader,g=e.mainContainerRef,x=e.page,j=e.pipeline,y=e.setAfterHidden,k=e.setAfterWidthForChildren,Z=e.setErrors,O=e.setMainContainerWidth,P=(0,Pt.i)().width,w=(0,s.useState)((0,_e.U2)(_e.L8,Zt.Zt)),_=w[0],S=w[1],E=(0,s.useState)((0,_e.U2)(_e.J3,Zt.ve)),I=E[0],T=E[1],D=(0,s.useState)(!!(0,_e.U2)(_e.Uu)),A=D[0],M=D[1],B=(0,s.useState)(!1),R=B[0],N=B[1],L=(0,s.useState)(!1),F=L[0],U=L[1],H=r,W=y;if(!W){var V=(0,s.useState)(!!(0,_e.U2)(_e.zg)),G=(0,l.Z)(V,2);H=G[0],W=G[1]}(0,s.useEffect)((function(){null===g||void 0===g||!g.current||R||F||null===O||void 0===O||O(g.current.getBoundingClientRect().width)}),[R,F,H,_,A,I,g,O,P]),(0,s.useEffect)((function(){R||(null===k||void 0===k||k(_),(0,_e.t8)(_e.L8,_))}),[R,_,k]),(0,s.useEffect)((function(){F||(0,_e.t8)(_e.J3,I)}),[F,I]);var K=z.ZP.projects.list({},{revalidateOnFocus:!1}).data,Y=null===K||void 0===K?void 0:K.projects,q=(0,s.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return j&&(n.push.apply(n,[{bold:Ot.b7!==x,label:function(){return null===j||void 0===j?void 0:j.uuid},linkProps:{as:"/pipelines/".concat(null===j||void 0===j?void 0:j.uuid),href:"/pipelines/[pipeline]"}}]),Ot.b7===x&&n.push.apply(n,[{bold:!0,label:function(){return(0,ne.kC)(x)}}])),(0,C.jsx)(yt.Z,{breadcrumbs:n,project:null===Y||void 0===Y?void 0:Y[0],version:null===Y||void 0===Y||null===(e=Y[0])||void 0===e?void 0:e.version})}),[x,j,Y]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ke.Z,{title:null===j||void 0===j?void 0:j.name}),(0,C.jsx)(kt.Z,{after:n,afterHeader:t,afterHeightOffset:i,afterHidden:H,afterMousedownActive:R,afterNavigationItems:o,afterOverflow:c,afterSubheader:u,afterWidth:_,before:a,beforeHeader:d,beforeHeightOffset:p,beforeHidden:A,beforeMousedownActive:F,beforeNavigationItems:f,beforeWidth:I,header:q,headerOffset:m,mainContainerHeader:b,mainContainerRef:g,navigationShowMore:!0,setAfterHidden:W,setAfterMousedownActive:N,setAfterWidth:S,setBeforeHidden:M,setBeforeMousedownActive:U,setBeforeWidth:T,children:h}),v&&(0,C.jsx)(ae.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return Z(null)},children:(0,C.jsx)(jt.Z,Ct(Ct({},v),{},{onClose:function(){return Z(null)}}))})]})},St=t(21853),Et=t(41788),It=t(30119),Tt=t(83766),Dt=t(31682),At=t(98636),Mt=t(21978),Bt=m.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],K.n_,1.5*P.iI,P.l4,(function(e){return"\n border: ".concat(K.YF,"px ").concat(K.M8," ").concat((e.theme||G.Z).interactive.defaultBorder,";\n ")})),Rt=t(18221),Nt=t(73899);function Lt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ft(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Lt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Lt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ut={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"};var Ht=function(e){var n=e.block,t=e.fetchFileTree,i=e.fetchPipeline,r=e.globalDataProducts,o=e.pipeline,c=e.setSelectedBlock,u=e.showUpdateBlockModal,a=(0,s.useRef)(null),p=(0,s.useRef)(null),f=(0,s.useMemo)((function(){return null===o||void 0===o?void 0:o.uuid}),[o]),h=(0,s.useMemo)((function(){return(null===o||void 0===o?void 0:o.retry_config)||{}}),[o]),m=n.color,x=n.configuration,w=n.name,_=n.type,S=n.uuid,E=(0,ie.VI)(null,{},[],{uuid:"BlockSettings/index"}),I=(0,l.Z)(E,1)[0],D=(0,s.useMemo)((function(){return(0,Ie.HK)(r||[],(function(e){return e.uuid}))}),[r]),A=(0,s.useMemo)((function(){var e,n=null===x||void 0===x||null===(e=x.global_data_product)||void 0===e?void 0:e.uuid;if(n&&D)return null===D||void 0===D?void 0:D[n]}),[x,D]),M=z.ZP.pipelines.detail(It.b.PIPELINE===(null===A||void 0===A?void 0:A.object_type)&&(null===A||void 0===A?void 0:A.object_uuid)).data,B=(0,s.useMemo)((function(){return null===M||void 0===M?void 0:M.pipeline}),[M]),R=(0,s.useState)(null),N=R[0],L=R[1],F=(0,s.useState)(!1),G=F[0],K=F[1],Y=(0,s.useState)(!1),q=Y[0],Q=Y[1],J=(0,Ce.Z)(n);(0,s.useEffect)((function(){(null===J||void 0===J?void 0:J.uuid)!==(null===n||void 0===n?void 0:n.uuid)&&L(n)}),[n,J]);var ee=(0,s.useMemo)((function(){return(null===N||void 0===N?void 0:N.retry_config)||{}}),[N]),re=(0,s.useCallback)((function(e){K(!0),L(e)}),[]),oe=(0,s.useMemo)((function(){return null===N||void 0===N?void 0:N.executor_type}),[N]);(0,s.useEffect)((function(){q||!oe||Rt.R.find((function(e){return e===oe}))||Q(!0)}),[q,oe]);var le=z.ZP.blocks.pipelines.detail(f,encodeURIComponent(S),{_format:"with_settings",block_type:_}).data,ce=(0,s.useMemo)((function(){return(null===le||void 0===le?void 0:le.block)||{}}),[le]),ue=(0,s.useMemo)((function(){return null!==ce&&void 0!==ce&&ce.pipelines?Object.values(null===ce||void 0===ce?void 0:ce.pipelines):[]}),[ce]),ae=(null===ue||void 0===ue?void 0:ue.length)||1,se=(0,d.Db)(z.ZP.blocks.pipelines.useUpdate(f,S),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){K(!1),t(),i(),null!==e&&void 0!==e&&e.block&&c(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return I({errors:n,response:e})}})}}),de=(0,l.Z)(se,2),pe=de[0],fe=de[1].isLoading,he=(0,s.useMemo)((function(){return ae>=1&&(0,C.jsx)(Ln.cl,{children:(0,C.jsx)(Rn.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Description"}],rows:ue.map((function(e){var n=e.pipeline,t=n.description,i=n.name,r=n.uuid;return[(null===o||void 0===o?void 0:o.uuid)===r?(0,C.jsxs)(O.ZP,{monospace:!0,muted:!0,children:[i||r," (current)"]},"name"):(0,C.jsx)(k.Z,{href:"/pipelines/".concat(r,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||r},"name"),(0,C.jsx)(O.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[ue,ae,o]),ve=(0,s.useMemo)((function(){return h&&"undefined"!==typeof h&&!(0,Fn.Qr)(h)&&("undefined"!==typeof(null===h||void 0===h?void 0:h.delay)&&"undefined"===typeof(null===ee||void 0===ee?void 0:ee.delay)||"undefined"!==typeof(null===h||void 0===h?void 0:h.exponential_backoff)&&"undefined"===typeof(null===ee||void 0===ee?void 0:ee.exponential_backoff)||"undefined"!==typeof(null===h||void 0===h?void 0:h.max_delay)&&"undefined"===typeof(null===ee||void 0===ee?void 0:ee.max_delay)||"undefined"!==typeof(null===h||void 0===h?void 0:h.retries)&&"undefined"===typeof(null===ee||void 0===ee?void 0:ee.retries))}),[ee,h]),me=(0,s.useMemo)((function(){var e;return(null===N||void 0===N||null===(e=N.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[N]),be=(0,s.useCallback)((function(e){return re((function(n){var t;return Ft(Ft({},n),{},{configuration:Ft(Ft({},null===N||void 0===N?void 0:N.configuration),{},{global_data_product:e(null===N||void 0===N||null===(t=N.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[N,re]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:P.HN,children:(0,C.jsxs)(Z.Z,{p:P.cd,children:[ae>1&&(0,C.jsx)(Z.Z,{mb:P.Mq,children:(0,C.jsx)(Bt,{children:(0,C.jsx)(y.ZP,Ft(Ft({},y.A0),{},{children:(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(V.BG,{fill:Nt.$R,size:$}),(0,C.jsx)(Z.Z,{pr:2}),(0,C.jsxs)(O.ZP,{bold:!0,large:!0,lineHeight:3*P.iI,warning:!0,children:["Shared by ",ae," pipelines"]})]})}))})}),(0,C.jsx)(Z.Z,{mb:P.HN,children:(0,C.jsxs)(At.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,C.jsx)(At.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,Ft(Ft({},y.A0),{},{children:[(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Name:\xa0"}),(0,C.jsx)(O.ZP,{children:w||""})]}),(0,C.jsx)(T.Z,Ft(Ft({},Ut),{},{onClick:function(){return u(n,w)},children:(0,C.jsx)(V.I8,{size:X})}))]}))}),v.tf.CUSTOM===(null===n||void 0===n?void 0:n.type)?(0,C.jsx)(At.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,Ft(Ft({},y.A0),{},{children:[(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Color:\xa0"}),(0,C.jsx)(O.ZP,{children:(0,ne.kC)(m||"")})]}),(0,C.jsx)(T.Z,Ft(Ft({},Ut),{},{onClick:function(){return u(n,w)},outline:!1,children:(0,C.jsx)(g.Z,{color:m?v.Vd[m]:null,size:X,square:!0})}))]}))}):null]})}),(0,C.jsxs)(Z.Z,{mb:P.HN,px:P.cd,children:[(0,C.jsx)(wn.Z,{children:"Executor type"}),(0,C.jsxs)(O.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/compute-resource#2-set-executor-type-and-customize-the-compute-resource-of-the-mage-executor",openNewWindow:!0,children:"documentation"}),"."]}),(0,C.jsxs)(Z.Z,{mt:1,children:[!q&&(0,C.jsx)(U.Z,{label:"Executor type",onChange:function(e){return re((function(n){return Ft(Ft({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:a,value:(null===N||void 0===N?void 0:N.executor_type)||"",children:Rt.R.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))}),q&&(0,C.jsx)(W.Z,{label:"Executor type",monospace:!0,onChange:function(e){return re((function(n){return Ft(Ft({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:p,setContentOnMount:!0,value:(null===N||void 0===N?void 0:N.executor_type)||""}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(k.Z,{muted:!0,onClick:function(){q?(re((function(e){return Ft(Ft({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===a||void 0===a||null===(e=a.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===p||void 0===p||null===(e=p.current)||void 0===e?void 0:e.focus()}),1),Q(!q)},preventDefault:!0,small:!0,children:q?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,C.jsxs)(Z.Z,{mb:P.HN,px:P.cd,children:[(0,C.jsx)(wn.Z,{children:"Retry configuration"}),(0,C.jsxs)(O.ZP,{muted:!0,children:[ve&&(0,C.jsxs)(C.Fragment,{children:["This block is currently using the retry configuration from the pipeline. You can override the pipeline\u2019s retry configuration for this block.",(0,C.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(W.Z,{label:"Retries",monospace:!0,onChange:function(e){return re((function(n){var t;return Ft(Ft({},n),{},{retry_config:Ft(Ft({},null===n||void 0===n?void 0:n.retry_config),{},{retries:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===h||void 0===h?void 0:h.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ee||void 0===ee?void 0:ee.retries)?null===ee||void 0===ee?void 0:ee.retries:(null===h||void 0===h?void 0:h.retries)||""}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(W.Z,{label:"Delay",monospace:!0,onChange:function(e){return re((function(n){var t;return Ft(Ft({},n),{},{retry_config:Ft(Ft({},null===n||void 0===n?void 0:n.retry_config),{},{delay:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===h||void 0===h?void 0:h.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ee||void 0===ee?void 0:ee.delay)?null===ee||void 0===ee?void 0:ee.delay:(null===h||void 0===h?void 0:h.delay)||""}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(W.Z,{label:"Max delay",monospace:!0,onChange:function(e){return re((function(n){var t;return Ft(Ft({},n),{},{retry_config:Ft(Ft({},null===n||void 0===n?void 0:n.retry_config),{},{max_delay:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===h||void 0===h?void 0:h.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===ee||void 0===ee?void 0:ee.max_delay)?null===ee||void 0===ee?void 0:ee.max_delay:(null===h||void 0===h?void 0:h.max_delay)||""})]}),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(b.Z,{checked:"undefined"===typeof(null===ee||void 0===ee?void 0:ee.exponential_backoff)&&"undefined"!==typeof(null===h||void 0===h?void 0:h.exponential_backoff)?!(null===h||void 0===h||!h.exponential_backoff):!(null===ee||void 0===ee||!ee.exponential_backoff),label:"Exponential backoff",onClick:function(){return re((function(e){var n;return Ft(Ft({},e),{},{retry_config:Ft(Ft({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===ee||void 0===ee?void 0:ee.exponential_backoff)&&"undefined"!==typeof(null===h||void 0===h?void 0:h.exponential_backoff)?!(null!==h&&void 0!==h&&h.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),v.tf.GLOBAL_DATA_PRODUCT===_&&(0,C.jsxs)(Z.Z,{mb:P.HN,children:[(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsx)(wn.Z,{children:"Override global data product settings"})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(Tt.Z,{objectAttributes:me,originalAttributes:A,setObjectAttributes:be})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(Dt.Z,{objectAttributes:me,originalAttributes:A,setObjectAttributes:be})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(Mt.Z,{blocks:null===B||void 0===B?void 0:B.blocks,objectAttributes:me,originalAttributes:A,setObjectAttributes:be})})]}),(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsx)(T.Z,{disabled:!G,loading:fe,onClick:function(){return pe({block:{configuration:null===N||void 0===N?void 0:N.configuration,executor_type:null===N||void 0===N?void 0:N.executor_type,retry_config:ee}})},primary:!0,children:"Update block settings"})})]})}),(0,C.jsxs)(Z.Z,{mb:P.HN,children:[!le&&(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(H.Z,{inverted:!0})}),le&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsxs)(wn.Z,{children:["Pipelines using this block (",ae,")"]}),(0,C.jsx)(O.ZP,{default:!0,children:"A shared block is available to and reused by multiple pipelines. It enables you to write code once and have it easily accessible anywhere in the workspace. As a result, any code changes will affect all pipelines sharing the block."})]}),he]})]})]})},Wt=t(92083),zt=t.n(Wt),Vt=t(26226),Gt=t(84969),Kt=t(90948),Yt=t(65743),qt=t(39048),Qt=t(79487),Jt=t(29989),Xt=t(61655),$t=t(16853),ei=t(65376),ni=t(52359),ti=t(2005),ii=t(48072),ri=t(24903),oi=t(98677),li=t(84181),ci=t(31012);function ui(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ai(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ui(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ui(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var si={bottom:P.iI*(3+P.cd),left:P.iI*P.cd,right:P.iI*P.cd,top:P.iI*P.cd};function di(e,n){return Math.max.apply(Math,(0,r.Z)(e.map(n)))}function pi(e){var n=e.data,t=e.height,i=e.keyForYData,o=e.large,l=e.margin,c=void 0===l?{}:l,u=e.orientationVertical,a=void 0!==u&&u,d=e.showTooltip,p=e.width,f=e.yLabelFormat,h=(0,s.useContext)(m.ThemeContext),v=(0,s.useCallback)((function(e){return e[i]}),[i]),b=f;b||(b=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var g=o?ci.iD:ci.J5,x=ai(ai({},si),c),j=n.slice(Math.max(0,n.length-50)),y=(0,s.useMemo)((function(){return Object.keys((null===j||void 0===j?void 0:j[0])||{}).filter((function(e){return e!==i}))}),[j,i]),k=(0,ri.Z)({domain:y,range:[Nt.a$,Nt.Ej,Nt.hM,Nt.ZA,Nt.$R,Nt.X_,Nt.er,Nt.hl,Nt.nQ]}),Z=(0,s.useMemo)((function(){return j.map(v)}),[j,v]),O=(0,oi.Z)({domain:Z,padding:.1}),P=(0,oi.Z)({domain:y,padding:.1}),w=(0,li.Z)({domain:[0,di(j,(function(e){return di(y,(function(n){return Number(e[n])}))}))]}),C={active:(null===h||void 0===h?void 0:h.content.default)||G.Z.content.default,backgroundPrimary:(null===h||void 0===h?void 0:h.chart.backgroundPrimary)||G.Z.chart.backgroundPrimary,backgroundSecondary:(null===h||void 0===h?void 0:h.chart.backgroundSecondary)||G.Z.chart.backgroundSecondary,muted:(null===h||void 0===h?void 0:h.content.muted)||G.Z.content.muted,primary:(null===h||void 0===h?void 0:h.chart.primary)||G.Z.chart.primary,tooltipBackground:(null===h||void 0===h?void 0:h.background.navigation)||G.Z.background.navigation},_=Z;a&&(_=j.reduce((function(e,n){return e.concat(y.map((function(e){var t=n[e];return(0,ne.HW)(t)?parseInt(String(t)):t})))}),[]));var S=Math.min(Math.max.apply(Math,(0,r.Z)(_.map((function(e){return String(e).length})))),20);x.left+=7*S;var E=p-(x.left+x.right),I=t-(x.top+x.bottom);a?(O.rangeRound([0,E]),w.rangeRound([I,0])):(O.rangeRound([I,0]),w.rangeRound([0,E])),P.rangeRound([0,O.bandwidth()]);var T=j.map(v).length,D=0;a||(D=O(_[T-1]));var A=(0,s.useCallback)((function(e){var n=(0,ii.Z)(e)||{x:0,y:0},t=n.x,i=n.y,r=t-x.left,o=i-x.top,l=0;l=a?(r-D/2)/(E-D):1-(o-D/2)/(I-D);var c=Math.floor(l*T),u=j[c];"undefined"===typeof u&&(u=j[c-1]),a?r>D&&r<E+x.left-D&&d({tooltipData:u,tooltipLeft:t,tooltipTop:i}):o>D&&o<I-D&&d({tooltipData:u,tooltipLeft:t,tooltipTop:i})}),[j,T,x.left,x.top,a,d,D,E,I]);return{colorScale:k,colors:C,data:j,fontSize:g,handleTooltip:A,margin:x,tempScale:w,tickValues:_,xKeys:y,xMax:E,y1Scale:P,yLabelFormat:b,yMax:I,yScale:O,ySerialize:v}}var fi=["height","width","xAxisLabel","yAxisLabel"];function hi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function vi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?hi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mi=3*P.iI,bi=(P.iI,P.iI,P.iI,(0,Xt.Z)((function(e){var n=e.data,t=e.height,i=e.hideTooltip,r=e.keyForYData,o=void 0===r?"__y":r,c=e.large,u=e.margin,a=void 0===u?{}:u,s=e.renderNoDataText,d=e.renderTooltipContent,p=e.showTooltip,f=e.tooltipData,h=e.tooltipLeft,v=e.tooltipOpen,m=e.tooltipTop,b=e.width,g=e.xAxisLabel,x=e.xNumTicks,j=e.yLabelFormat,y=pi({data:n,height:t,keyForYData:o,large:c,margin:a,showTooltip:p,width:b,yLabelFormat:j}),k=y.colorScale,Z=y.colors,P=y.data,w=y.fontSize,_=y.handleTooltip,S=y.margin,E=y.tempScale,I=y.tickValues,T=y.xKeys,D=y.xMax,A=y.y1Scale,M=y.yLabelFormat,B=y.yMax,R=y.yScale,N=y.ySerialize,L=[],F=Math.floor((null===I||void 0===I?void 0:I.length)/Math.floor(t/mi));return null===I||void 0===I||I.forEach((function(e,n){n%F===0&&L.push(e)})),b<10?null:(0,C.jsxs)("div",{children:[(0,C.jsxs)("svg",{height:t,width:b,children:[s&&!(null!==P&&void 0!==P&&P.length)&&(0,C.jsx)("text",{fill:Z.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:ti.ry,fontSize:w,x:"50%",y:"50%",children:s()}),(0,C.jsx)(Yt.Z,{fill:"transparent",height:t-(S.top+S.bottom),onMouseLeave:function(){return i()},onMouseMove:_,onTouchMove:_,onTouchStart:_,rx:14,width:b-(S.left+S.right),x:S.left,y:S.top}),(null===P||void 0===P?void 0:P.length)&&(0,C.jsxs)(Jt.Z,{left:S.left,top:S.top,children:[(0,C.jsx)(qt.Z,{color:k,data:P,keys:T,width:D,xScale:E,y0:N,y0Scale:R,y1Scale:A,children:function(e){return e.map((function(e){return(0,C.jsx)(Jt.Z,{top:e.y0,children:e.bars.map((function(n){return(0,C.jsx)("g",{children:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("rect",{fill:n.color,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})})},"".concat(e.index,"-").concat(n.index,"-").concat(n.key))}))},"bar-group-horizontal-".concat(e.index,"-").concat(e.y0))}))}}),(0,C.jsx)(Gt.Z,{hideTicks:!0,scale:R,stroke:Z.muted,tickFormat:function(e){return M(e)},tickLabelProps:function(){return{fill:Z.active,fontFamily:ti.ry,fontSize:w,style:{width:"10px"},textAnchor:"end"}},tickStroke:Z.muted,tickValues:L,top:2}),(0,C.jsx)(Kt.Z,{label:g,labelProps:{fill:Z.muted,fontFamily:ti.ry,fontSize:w,textAnchor:"middle"},numTicks:x,scale:E,stroke:Z.muted,tickLabelProps:function(){return{fill:Z.active,fontFamily:ti.ry,fontSize:w,textAnchor:"middle"}},tickStroke:Z.muted,top:B})]}),f&&(0,C.jsx)("g",{children:(0,C.jsx)(Qt.Z,{from:{x:S.left,y:m},pointerEvents:"none",stroke:Z.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:D+S.left,y:m}})})]}),v&&f&&(0,C.jsxs)($t.Z,{left:h,style:vi(vi({},ei.j),{},{backgroundColor:Z.tooltipBackground}),top:m,children:[d&&d(f),!d&&Object.entries(f).map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];if(o!==t){var r=i;return(0,ne.HW)(r)&&String(r).split(".").length>=2&&(r=r.toFixed(4)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[t,": ",r]},t)}}))]})]})})));var gi=function(e){var n,t=e.height,i=e.width,r=e.xAxisLabel,o=e.yAxisLabel,l=(0,He.Z)(e,fi);return n="undefined"===typeof i?"100%":o?0===i?i:i-28:i,(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{style:{display:"flex",height:t,marginBottom:r?P.iI:null,width:"100%"},children:[o&&(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,C.jsx)(ni.Z,{children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:o})})}),(0,C.jsx)("div",{style:{height:t,width:n},children:(0,C.jsx)(Vt.Z,{children:function(e){var n=e.width,t=e.height;return(0,C.jsx)(bi,vi(vi({},l),{},{height:t,width:n}))}})})]}),r&&(0,C.jsx)("div",{style:{paddingLeft:o?36:0,paddingTop:4},children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:r})})]})},xi=t(95422),ji=["keyForYData"],yi=["height","width","xAxisLabel","yAxisLabel"];function ki(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Zi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ki(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ki(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Oi=6*P.iI,Pi=(0,Xt.Z)((function(e){var n=e.keyForYData,t=void 0===n?"__y":n,i=(0,He.Z)(e,ji),r=i.height,o=i.hideTooltip,c=i.renderNoDataText,u=i.renderTooltipContent,a=i.tooltipData,s=i.tooltipLeft,d=i.tooltipOpen,p=i.tooltipTop,f=i.width,h=i.xLabelFormat,v=i.xNumTicks,m=i.yNumTicks,b=pi(Zi(Zi({},i),{},{keyForYData:t,orientationVertical:!0})),g=b.colorScale,x=b.colors,j=b.data,y=b.fontSize,k=b.handleTooltip,Z=b.margin,P=b.tempScale,w=(b.tickValues,b.xKeys),_=(b.xMax,b.y1Scale),S=b.yLabelFormat,E=b.yMax,I=b.yScale,T=b.ySerialize,D=Math.min(v,f/Oi);return f<10?null:(0,C.jsxs)("div",{children:[(0,C.jsxs)("svg",{height:r,width:f,children:[c&&!(null!==j&&void 0!==j&&j.length)&&(0,C.jsx)("text",{fill:x.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:ti.ry,fontSize:y,x:"50%",y:"50%",children:c()}),(null===j||void 0===j?void 0:j.length)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Yt.Z,{fill:"transparent",height:r-(Z.top+Z.bottom),onMouseLeave:function(){return o()},onMouseMove:k,onTouchMove:k,onTouchStart:k,rx:14,width:f-(Z.left+Z.right),x:Z.left,y:2*Z.top}),(0,C.jsxs)(Jt.Z,{top:Z.top,children:[(0,C.jsx)(xi.Z,{color:g,data:j,height:E,keys:w,x0:T,x0Scale:I,x1Scale:_,yScale:P,children:function(e){return e.map((function(e){return(0,C.jsx)(Jt.Z,{left:e.x0+Z.left,top:Z.top,children:e.bars.map((function(n){return(0,C.jsx)("g",{children:(0,C.jsx)("rect",{fill:n.color,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})},"".concat(e.index,"-").concat(n.index,"-").concat(n.key))}))},"bar-group-horizontal-".concat(e.index,"-").concat(e.x0))}))}}),(0,C.jsx)(Gt.Z,{left:Z.left,numTicks:m,scale:P,stroke:x.muted,tickFormat:function(e){return S(e)},tickLabelProps:function(){return{fill:x.active,fontFamily:ti.ry,fontSize:y,textAnchor:"end",transform:"translate(-2,2.5)"}},tickStroke:x.muted,top:Z.top}),(0,C.jsx)(Kt.Z,{hideTicks:!0,left:Z.left,numTicks:D,scale:I,stroke:x.muted,tickFormat:h,tickLabelProps:function(){return{fill:x.active,fontFamily:ti.ry,fontSize:y,textAnchor:"middle"}},tickStroke:x.muted,top:E+Z.top})]})]}),a&&(0,C.jsx)("g",{children:(0,C.jsx)(Qt.Z,{from:{x:s,y:2*Z.top},pointerEvents:"none",stroke:x.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:s,y:E+2*Z.top}})})]}),d&&a&&(0,C.jsxs)($t.Z,{left:s,style:Zi(Zi({},ei.j),{},{backgroundColor:x.tooltipBackground}),top:p,children:[u&&u(a),!u&&Object.entries(a).map((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];if(t!==i){var o=r;return(0,ne.HW)(o)&&String(o).split(".").length>=2&&(o=o.toFixed(4)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[i,": ",o]},i)}})),(0,C.jsx)("br",{}),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[h&&h(T(a)),!h&&T(a)]})]})]})}));var wi=function(e){var n=e.height,t=e.width,i=e.xAxisLabel,r=e.yAxisLabel,o=(0,He.Z)(e,yi);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{style:{display:"flex",height:n,marginBottom:i?P.iI:null,width:"100%"},children:[r&&(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,C.jsx)(ni.Z,{children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:r})})}),(0,C.jsx)("div",{style:{height:n,width:r?0===t?t:t-28:t},children:(0,C.jsx)(Vt.Z,{children:function(e){var n=e.height,t=e.width;return(0,C.jsx)(Pi,Zi(Zi({},o),{},{height:n,width:t}))}})})]}),i&&(0,C.jsx)("div",{style:{paddingLeft:r?36:0,paddingTop:4},children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:i})})]})},Ci=t(62976),_i=t(66872),Si=t(68735),Ei=t(320),Ii=40*P.iI,Ti=m.default.div.withConfig({displayName:"indexstyle__ChartBlockStyle",componentId:"sc-1c3ufnj-0"})(["border-radius:","px;margin-left:","px;margin-right:","px;margin-top:","px;",""],K.n_,.5*P.iI,.5*P.iI,1*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).codeArea,";\n ")})),Di=m.default.div.withConfig({displayName:"indexstyle__ConfigurationOptionsStyle",componentId:"sc-1c3ufnj-1"})(["flex:4;padding-left:","px;padding-right:","px;"],1*P.iI,1*P.iI),Ai=m.default.div.withConfig({displayName:"indexstyle__CodeStyle",componentId:"sc-1c3ufnj-2"})(["padding-top:","px;",""],P.iI/2,(function(e){return"\n background-color: ".concat((e.theme.background||G.Z.background).codeTextarea,";\n ")})),Mi=m.default.div.withConfig({displayName:"indexstyle__CodeHelperStyle",componentId:"sc-1c3ufnj-3"})(["margin-bottom:","px;padding-bottom:","px;padding-left:","px;",""],P.cd*P.iI,P.iI,P.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||G.Z.borders).medium,";\n ")}));function Bi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ri(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Bi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ni=function(e){var n,t=e.block,i=e.data,r=e.width,c=t.configuration,u=void 0===c?{}:c,a=u||{},s=a.chart_style,d=a.chart_type,p=a.y_sort_order,f=u[ht.JJ]||Ii,h=(null===u||void 0===u||null===(n=u[ht.bE])||void 0===n?void 0:n.map((function(e){return(0,ht.c0)(e)})))||[],v=Ee.n1,m=u[ht.Yg];if([ht.aE.HOUR,ht.aE.MINUTE,ht.aE.SECOND].includes(m)&&(v=Ee.OC),ht.oV.BAR_CHART===d||ht.oV.TIME_SERIES_BAR_CHART===d){var b=i.x,g=i.y,x=ht.oV.TIME_SERIES_BAR_CHART===d;if(b&&g&&Array.isArray(b)&&Array.isArray(g)){var j,y=null===(j=u[ht.eN])||void 0===j?void 0:j.join(", "),k=null===h||void 0===h?void 0:h.join(", ");h.length||h.push(ht.rj);var Z=h[0],w=b.map((function(e,n){return Ri({__y:e},h.reduce((function(e,t,i){var r,l=null===g||void 0===g||null===(r=g[i])||void 0===r?void 0:r[n];return"undefined"===typeof l?e:Ri(Ri({},e),{},(0,o.Z)({},t,l))}),{}))}));ht.MP.ASCENDING===p?w=(0,Ie.YC)(w,(function(e){return e[Z]}),{ascending:!1}):ht.MP.DESCENDING===p&&(w=(0,Ie.YC)(w,(function(e){return e[Z]}),{ascending:!0}));var _={data:w,height:f,renderNoDataText:function(){return"No data matching query"},width:r,xNumTicks:3};return ht.JT.HORIZONTAL===s?(0,C.jsx)(gi,Ri(Ri({},_),{},{xAxisLabel:k||u[ht.rj],yAxisLabel:y||u[ht.a3]})):(0,C.jsx)(wi,Ri(Ri({},_),{},{xAxisLabel:y,xLabelFormat:function(e){return x?zt()(1e3*e).format(Ee.n1):e},xNumTicks:w.length,yAxisLabel:k,yNumTicks:5}))}}else if(ht.oV.HISTOGRAM===d){var S,E=i.x,I=i.y,T=null===(S=u[ht.eN])||void 0===S?void 0:S.join(", ");if(E&&I&&Array.isArray(E))return(0,C.jsx)(_i.Z,{data:E.map((function(e,n){var t,i=e.max,r=e.min;return[i,null===I||void 0===I||null===(t=I[n])||void 0===t?void 0:t.value,r]})),height:f,width:r,large:!0,margin:{left:5*P.iI,right:1*P.iI,top:3*P.iI},noPadding:!0,renderTooltipContent:function(e){var n=(0,l.Z)(e,3),t=n[0],i=n[1],r=n[2];return(0,C.jsxs)(O.ZP,{inverted:!0,monospace:!0,small:!0,children:["Count : ",i,(0,C.jsx)("br",{}),"Bucket: ",r,"-",t]})},showAxisLabels:!0,showYAxisLabels:!0,showZeroes:!0,sortData:function(e){return(0,Ie.YC)(e,"[0]")},xAxisLabel:T||u[ht.a3],yAxisLabel:T?"count(".concat(T,")"):u[ht.rj]})}else if(ht.oV.LINE_CHART===d||ht.oV.TIME_SERIES_LINE_CHART===d){var D=i.x,A=i.y,M=ht.oV.TIME_SERIES_LINE_CHART===d;if(D&&A&&Array.isArray(D)&&Array.isArray(A)&&Array.isArray(null===A||void 0===A?void 0:A[0])){var B,R=h;u[ht.e]&&(R=u[ht.e].split(",").map((function(e){return e.trim()})));var N=D.map((function(e,n){return{x:e,y:(0,Ie.w6)(A.length).map((function(e,t){var i=A[t][n];return"undefined"===typeof i||null===i?0:i}))}})),L=null===(B=u[ht.eN])||void 0===B?void 0:B.join(", "),F=h.join(", ");return(0,C.jsx)(Si.Z,{data:N,height:f,lineLegendNames:R,margin:{bottom:8*P.iI,left:5*P.iI},noCurve:!0,renderXTooltipContent:function(e){e.index;var n=e.x,t=u[ht.a3],i=n;return u[ht.eN]&&(t=u[ht.eN].map(String).join(", ")),M&&(i=zt()(1e3*n).format(v)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[t,": ",i]})},renderYTooltipContent:function(e,n){var t=e.y;return(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[R&&R[n]&&"".concat(R[n],": "),t&&(0,ne.x6)((0,ne.QV)(t[n],4))]})},width:r?r-3*P.iI:r,xAxisLabel:L||String(u[ht.a3]),xLabelFormat:function(e){return M?zt()(1e3*e).format(Ee.n1):e},yAxisLabel:F||String(u[ht.rj]),yLabelFormat:function(e){return e}})}}else if(ht.oV.PIE_CHART===d){var U,H=i[String(u[ht.a3])],W=null===(U=u[ht.eN])||void 0===U?void 0:U.join(", ");if(H)return(0,C.jsx)(Ei.Z,{data:Object.entries(H),getX:function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return"".concat(t," (").concat((0,ne.x6)(i),")")},getY:function(e){return(0,l.Z)(e,2)[1]},height:f,width:r,xAxisLabel:W||String(u[ht.a3])})}else if(ht.oV.TABLE===d){var z=i.index,V=i.x,G=i.y;return Array.isArray(V)&&Array.isArray(G)&&Array.isArray(G[0])&&(0,C.jsx)(Ci.Z,{columns:V,index:z,height:u[ht.JJ]?null:f,maxHeight:u[ht.JJ]?f:null,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,rows:G,width:r})}return(0,C.jsx)("div",{})},Li=t(65051),Fi=t(76096);var Ui=function(e){var n=e.children,t=e.onChange,i=(0,s.useState)(s.Children.map(n,(function(){return null}))),r=i[0],o=i[1],l=(0,s.useState)(0),c=l[0],u=l[1];return(0,C.jsx)(y.ZP,{children:s.Children.map(n,(function(e,n){return(0,C.jsx)(Z.Z,{ml:n>=1?1:0,style:{display:"flex",flex:1},children:s.cloneElement(e,{onChange:function(e){o((function(i){return i[n]=e.target.value,t(i,{resetValues:function(){return u((function(e){return e+1}))},setValues:o}),i}))},value:r[n]})},"multi-select-child-".concat(n,"-").concat(c))}))})},Hi=t(59582),Wi=t(78759);function zi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Vi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Gi(e,n){var t,i,r,c,u=e.autocompleteItems,a=e.block,p=e.blockRefs,f=e.blocks,h=e.deleteWidget,b=e.executionState,g=e.fetchPipeline,x=e.fetchFileTree,_=e.messages,S=void 0===_?[]:_,E=e.onChangeContent,I=e.pipeline,T=e.runBlock,D=e.runningBlocks,A=e.savePipelineContent,M=e.selected,B=e.setAnyInputFocused,R=e.setErrors,L=e.setSelectedBlock,F=e.setTextareaFocused,K=e.textareaFocused,Y=e.updateWidget,q=e.width,Q=(0,s.useRef)(null),J=(0,s.useContext)(m.ThemeContext),X=z.ZP.blocks.pipelines.detail(null===I||void 0===I?void 0:I.uuid,null===a||void 0===a?void 0:a.upstream_blocks[0]).data,$=(null===X||void 0===X||null===(t=X.block)||void 0===t?void 0:t.outputs)||(null===a||void 0===a?void 0:a.outputs)||[],ee=(0,s.useState)(null),ie=ee[0],re=ee[1],oe=(0,s.useState)(null===(i=a.configuration)||void 0===i?void 0:i.chart_type),le=oe[0],ce=oe[1],ue=(0,s.useState)(a.configuration),ae=ue[0],se=ue[1],pe=(0,s.useState)(a.content),fe=pe[0],ve=pe[1],me=(0,s.useState)(!le||0===$.length),be=me[0],ge=me[1],xe=(0,s.useState)(!1),je=xe[0],ye=xe[1],ke=(0,s.useState)(null),Ze=ke[0],Oe=ke[1],Pe=(0,s.useState)(null===a||void 0===a?void 0:a.upstream_blocks),_e=Pe[0],Se=Pe[1],Ee=(0,s.useState)((null===$||void 0===$?void 0:$.length)||0),Te=Ee[0],De=Ee[1],Ae=(0,s.useState)(a.uuid),Be=Ae[0],Re=Ae[1],Ne=Wi.G8[le],Le=Wi.x8[le],Fe=(0,s.useMemo)((function(){return null===f||void 0===f?void 0:f.filter((function(e){var n=e.type;return[v.tf.DATA_LOADER,v.tf.TRANSFORMER].includes(n)}))}),[f]),Ue=(0,s.useMemo)((function(){return(0,Ie.HK)(Fe,(function(e){return e.uuid}))}),[Fe]),He=!!D.find((function(e){return e.uuid===a.uuid}))||(null===S||void 0===S?void 0:S.length)>=1&&b!==Me.uF.IDLE,We=(0,s.useMemo)((function(){return null===S||void 0===S?void 0:S.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[S]),ze=!!We.find((function(e){return e.error})),Ve=We.length>=1,Ge=(0,s.useMemo)((function(){return{blockType:a.type,hasError:ze,selected:M}}),[a.type,ze,M]);if(null!==We&&void 0!==We&&We.length){var Ke,qe,Qe=We.length-1;c=null===We||void 0===We||null===(Ke=We[Qe])||void 0===Ke||null===(qe=Ke.data)||void 0===qe?void 0:qe[0]}c?(c=(c=c.slice(1,c.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,ne.Pb)(c)&&(r=JSON.parse(c))):(null===$||void 0===$?void 0:$.length)>=1&&(r={},$.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,o=n.variable_uuid;Me.Gi.TEXT===i&&(0,ne.Pb)(t)&&(r[o]=JSON.parse(t))})));var Je=(0,s.useCallback)((function(e){var n=Vi(Vi(Vi({},a),e),{},{configuration:Vi(Vi({},a.configuration),e.configuration)});A().then((function(){T({block:n,code:fe,ignoreAlreadyRunning:!0,runUpstream:!!_e.find((function(e){var n;return![v.DA.EXECUTED,v.DA.UPDATED].includes(null===(n=Ue[e])||void 0===n?void 0:n.status)}))})})),De((function(e){return e+1}))}),[a,Ue,fe,De,_e]),Xe=(0,s.useCallback)((function(e){ve(e),E(e)}),[E,ve]),$e=(0,s.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;se((function(n){return Vi(Vi({},n),e)}));var i=Vi(Vi({},a),{},{configuration:Vi(Vi(Vi({},ae),e),{},{chart_type:le})});Y(i),Te&&t&&Je(i)}),[a,le,ae,Te,Je,se,Y]);(0,s.useEffect)((function(){re({python:(0,Hi.Z)({autocompleteItems:u,block:a,blocks:f,pipeline:I})})}),[u,a,f,I]);var en=(0,s.useMemo)((function(){return(0,C.jsx)(ot.Z,{autoHeight:!0,autocompleteProviders:ie,onChange:Xe,selected:M,setSelected:function(e){return L(!0===e?a:null)},setTextareaFocused:F,showLineNumbers:!1,textareaFocused:K||ht.oV.TABLE===le&&!be,value:fe,width:"100%"})}),[ie,a,le,fe,be,M,L,F,K,Xe]),nn=(0,s.useMemo)((function(){return(ze||Ve)&&(0,C.jsx)(Li.Z,Vi(Vi({},Ge),{},{block:a,contained:!1,hideExtraInfo:!0,isInProgress:He,messages:We,selected:M}))}),[a,Ge,ze,Ve,He,We,M]),tn=(0,Ce.Z)(be),rn=(0,Ce.Z)(q);(0,s.useEffect)((function(){var e,n=null===Q||void 0===Q||null===(e=Q.current)||void 0===e?void 0:e.getBoundingClientRect();tn!==be||rn!==q?(Oe(0),setTimeout((function(){var e,n,t=null===Q||void 0===Q||null===(e=Q.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&Oe(t)}),100)):n&&Oe(n.width)}),[be,tn,Q,Oe,q,rn]);var on=(0,s.useMemo)((function(){var e=[];return _e.forEach((function(n,t){var i=Ue[n],r=(0,w.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:J}).accent;e.push((0,C.jsxs)(Z.Z,{ml:2,children:[(0,C.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,C.jsx)(k.Z,{color:r,inline:!0,onClick:function(){var e,n,t=null===p||void 0===p||null===(e=p.current)||void 0===e?void 0:e["".concat(null===i||void 0===i?void 0:i.type,"s/").concat(null===i||void 0===i?void 0:i.uuid,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,C.jsx)(O.ZP,{color:r,monospace:!0,small:!0,children:n})})]},n))})),e}),[p,Ue,J,_e]),ln=(0,s.useMemo)((function(){var e,n=[],t=null===Ne||void 0===Ne||null===(e=Ne.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return ht.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=ae[e];if(t){var i,r,o=null===(i=Wi.SR[le])||void 0===i||null===(r=i[e])||void 0===r?void 0:r.call(i);n.push((0,C.jsxs)(Z.Z,{ml:2,children:[(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",o&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,C.jsx)(O.ZP,{default:!0,inline:!0,small:!0,children:o})]})]},t))}})),n}),[le,ae,Ne]),cn=(0,Ce.Z)(le),un=(0,Ce.Z)(_e);(0,s.useEffect)((function(){if((!cn&&le&&null!==_e&&void 0!==_e&&_e.length||(null===un||void 0===un||!un.length)&&(null===_e||void 0===_e?void 0:_e.length)>=1&&le)&&!fe&&(0,Fn.Qr)(ae)&&Le){var e=Vi(Vi({},a),{},{upstream_blocks:_e});Le.configuration&&$e(Le.configuration(e)),Le.content&&Xe(Le.content(e))}}),[a,le,cn,ae,fe,Le,$e,Xe,_e,un]);var an=(0,s.useMemo)((function(){return ae[ht.v8]||1}),[ae]),sn=(0,s.useMemo)((function(){return Object.entries(Ne||{}).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0],r=t[1];return Vi(Vi({},e),{},(0,o.Z)({},i,r.map((function(e){var n,t=e.autoRun,i=e.label,r=e.monospace,l=e.options,c=e.settings,u=void 0===c?{}:c,s=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,ne.kC)(i()),monospace:r,onBlur:function(){return L(a)},onChange:function(e){return $e((0,o.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return L(a)},value:(null===ae||void 0===ae?void 0:ae[d])||""},f=(null!==X&&void 0!==X&&X.block?[X.block]:[]).reduce((function(e,n){var t=n.outputs;return t?e.concat(t.reduce((function(e,n){var t=n.sample_data;return null!==t&&void 0!==t&&t.columns?e.concat(t.columns):e}),[])):e}),[]);if(Wi.VR.COLUMNS===s){var h=ae[d]||[];n=(0,C.jsxs)(C.Fragment,{children:[(!u.maxValues||h.length<u.maxValues)&&(0,C.jsx)(U.Z,Vi(Vi({},p),{},{onChange:function(e){var n=ae[d]||[],i=e.target.value;n.includes(i)?n=(0,Ie.Od)(n,(function(e){return e===i})):n.push(i),$e((0,o.Z)({},d,n),{autoRun:t})},value:null,children:(0,Ie.YC)(f.filter((function(e){return!h.includes(e)})),(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})),h.map((function(e){return(0,C.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){$e((0,o.Z)({},d,(0,Ie.Od)(h,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(Wi.VR.METRICS===s){var v=ae[d]||[];n=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Metrics"}),(0,C.jsx)(O.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,C.jsxs)(Ui,{onChange:function(e,n){var i=n.resetValues,r=n.setValues;2===e.filter((function(e){return!!e})).length&&(v.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||($e((0,o.Z)({},d,v.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),r([null,null]),i()))},children:[(0,C.jsx)(U.Z,Vi(Vi({},p),{},{label:"aggregation",children:(0,Ie.YC)(ht.bn,(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})),(0,C.jsx)(U.Z,Vi(Vi({},p),{},{label:"column",children:(0,Ie.YC)(f,(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))}))]}),v.map((function(e){var n=e.aggregation,i=e.column;return(0,C.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,C.jsx)(Bn.Z,{label:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(O.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){$e((0,o.Z)({},d,(0,Ie.Od)(v,(function(e){var t=e.aggregation,r=e.column;return n===t&&i===r}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=l?(0,C.jsx)(U.Z,Vi(Vi({},p),{},{children:l.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})):(0,C.jsx)(W.Z,Vi(Vi({},p),{},{type:s}));return(0,C.jsx)(Z.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[a,ae,Ne,X,L,$e]),dn=sn.code,pn=sn.noCode,fn=(0,d.Db)(z.ZP.widgets.pipelines.useUpdate(null===I||void 0===I?void 0:I.uuid,a.uuid),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){ye(!1),g(),x()},onErrorCallback:function(e,n){return null===R||void 0===R?void 0:R({errors:n,response:e})}})}}),hn=(0,l.Z)(fn,1)[0],vn="ChartBlock/".concat(a.uuid),mn=(0,he.y)(),bn=mn.registerOnKeyDown,gn=mn.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){gn(vn)}}),[gn,vn]),bn(vn,(function(e,n,t){je&&String(t[0])===String(de.Uq)&&String(t[1])!==String(de.zX)&&hn({widget:Vi(Vi({},a),{},{name:Be})})}),[a,je,Be,hn]),(0,C.jsx)(Fi.Z,{sm:12,md:12*an,children:(0,C.jsxs)(Ti,{ref:n,children:[(0,C.jsx)(Z.Z,{mt:1,pt:1,px:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{flex:1,style:{position:"relative"},children:[(0,C.jsx)(Ye,{bold:!1,fullWidth:!0,inputValue:Be,notRequired:!0,onBlur:function(){return setTimeout((function(){return ye(!1)}),300)},onChange:function(e){Re(e.target.value),e.preventDefault()},onClick:function(){B(!0),ye(!0)},onFocus:function(){B(!0),ye(!0)},small:!0,stacked:!0,value:!je&&a.uuid}),je&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(k.Z,{noWrapping:!0,onClick:function(){return hn({widget:Vi(Vi({},a),{},{name:Be})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(U.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Vi(Vi({},a),{},{upstream_blocks:n});Y(t),Je(t),Se(n)},placeholder:"Source block",small:!0,value:(null===_e||void 0===_e?void 0:_e[0])||"",children:null===Fe||void 0===Fe?void 0:Fe.map((function(e){var n=e.uuid;return(0,C.jsx)("option",{value:n,children:n},n)}))}),(0,C.jsx)(Z.Z,{mr:1}),!He&&(0,C.jsx)(we.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Je(a)},uuid:"ChartBlock/run/".concat(a.uuid),children:(0,C.jsx)(V.Py,{size:2*P.iI})})}),Me.uF.QUEUED===b&&(0,C.jsx)(H.Z,{color:(J||G.Z).content.active,small:!0,type:"cylon"}),Me.uF.BUSY===b&&(0,C.jsx)(H.Z,{color:(J||G.Z).content.active,small:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(we.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return ge((function(e){return!e}))},selected:be,uuid:"ChartBlock/edit/".concat(a.uuid),children:(0,C.jsx)(V.I8,{size:2*P.iI})})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(we.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return h(a)},uuid:"ChartBlock/delete/".concat(a.uuid),children:(0,C.jsx)(V.rF,{size:2*P.iI})})})]})]})}),(0,C.jsx)(Z.Z,{mt:1}),(0,C.jsxs)(y.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:6,ref:Q,children:r&&!(0,Fn.Qr)(r)&&(0,C.jsx)(Z.Z,{pb:3,children:(0,C.jsx)(Ni,{block:Vi(Vi({},a),{},{configuration:Vi(Vi({},a.configuration),ae)}),data:r,width:Ze})})}),be&&(0,C.jsx)(Di,{children:(0,C.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(U.Z,{onChange:function(e){var n=e.target.value,t=Vi(Vi({},a),{},{configuration:Vi(Vi({},ae),{},{chart_type:n})});Y(t),Je(t),ce(n)},placeholder:"Select chart type",value:le,children:ht.CK.map((function(e){return(0,C.jsx)("option",{value:e,children:(0,ne.kC)(e)},e)}))})}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(U.Z,{onChange:function(e){return $e((0,o.Z)({},ht.v8,e.target.value))},placeholder:"Chart width",value:(null===ae||void 0===ae?void 0:ae[ht.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return(0,C.jsx)("option",{value:i,children:t},t)}))})}),pn]})})]}),be&&!(null===dn||void 0===dn||!dn.length)&&v.t6.SQL!==a.language&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{my:1,px:1,children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Custom chart code"}),(0,C.jsxs)(O.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,C.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,C.jsxs)(Ai,{children:[_e.length>=1&&(0,C.jsxs)(Mi,{children:[(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",on]}),(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",ln]})]}),en]})]}),nn&&(0,C.jsx)(Z.Z,{px:1,children:nn})]})})}var Ki=s.forwardRef(Gi),Yi=t(97361),qi=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function Qi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ji(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xi=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,r=e.deleteWidget,l=e.messages,c=e.onChangeChartBlock,u=e.runBlock,a=e.runningBlocks,d=e.savePipelineContent,p=e.selectedBlock,f=e.setAnyInputFocused,h=e.setErrors,v=e.setSelectedBlock,m=e.setTextareaFocused,b=e.textareaFocused,g=e.updateWidget,x=e.widgets,j=e.width,k=(0,He.Z)(e,qi),Z=(0,s.useMemo)((function(){return a.reduce((function(e,n,t){return Ji(Ji({},e),{},(0,o.Z)({},n.uuid,Ji(Ji({},n),{},{priority:t})))}),{})}),[a]);return(0,C.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,C.jsx)(Yi.Z,{fullHeight:!0,style:{marginLeft:.5*P.iI,marginRight:.5*P.iI},children:null===x||void 0===x?void 0:x.map((function(e){var o=e.uuid,x=Z[o],y=x?0===x.priority?Me.uF.BUSY:Me.uF.QUEUED:Me.uF.IDLE;return i.current[o]=(0,s.createRef)(),(0,s.createElement)(Ki,Ji(Ji({},k),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:r,executionState:y,key:o,messages:l[o],onChangeContent:function(e){return c(o,e)},ref:i.current[o],runBlock:u,runningBlocks:a,savePipelineContent:d,selected:(null===p||void 0===p?void 0:p.uuid)===o,setAnyInputFocused:f,setErrors:h,setSelectedBlock:v,setTextareaFocused:m,textareaFocused:b,updateWidget:g,width:j}))}))}),(0,C.jsx)("div",{style:{height:"80vh"}})]})},$i=t(48952),er=m.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),nr=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,r=void 0===i?"0 0 358 305":i;return(0,C.jsxs)(er,{height:t*(305/358),viewBox:r,width:t,children:[(0,C.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M290 47H66c-3.866 0-7 3.134-7 7v200c0 3.866 3.134 7 7 7h224c3.866 0 7-3.134 7-7V54c0-3.866-3.134-7-7-7zM66 46c-4.4183 0-8 3.5817-8 8v200c0 4.418 3.5817 8 8 8h224c4.418 0 8-3.582 8-8V54c0-4.4183-3.582-8-8-8H66z",fill:"#000"}),(0,C.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,C.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,C.jsx)("rect",{x:"209.651",y:"17.1125",width:"1.0163",height:"14.2284",rx:".5082",transform:"rotate(24.933 209.651 17.1125)",fill:"#2AB2FE"}),(0,C.jsx)("path",{fill:"#2AB2FE",d:"M207.788 23.5313l35.4813 16.4949-.4285.9215-35.4812-16.4948zM247.033 31.9316c.946-2.0359 3.364-2.9191 5.4-1.9726l31.795 14.7811-11.383 24.4836-31.794-14.7811c-2.036-.9465-2.92-3.3642-1.973-5.4002l7.955-17.1108z"}),(0,C.jsx)("path",{d:"M284.228 44.7401l31.795 14.7811c2.036.9465 2.919 3.3642 1.972 5.4001l-7.954 17.1109c-.947 2.0359-3.365 2.9191-5.401 1.9726l-31.795-14.7811 11.383-24.4836z",fill:"#0093E4"}),(0,C.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M352.959 83.7347a.5082.5082 0 00-.675.2466l-2.571 5.5296-35.481-16.4949-.428.9216 35.481 16.4949-2.571 5.5295a.5081.5081 0 00.247.675.5082.5082 0 00.675-.2466l5.57-11.9806a.5083.5083 0 00-.247-.6751z",fill:"#2AB2FE"}),(0,C.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("path",{d:"M337.354 256.065a38.3848 38.3848 0 01-10.816 21.271 38.3722 38.3722 0 01-21.293 10.768 38.3787 38.3787 0 01-23.542-3.895 38.3764 38.3764 0 01-16.691-17.054l17.208-8.494a19.1932 19.1932 0 0020.117 10.475 19.189 19.189 0 0010.647-5.385c2.886-2.88 4.78-6.605 5.407-10.635l18.963 2.949z",fill:"#FF3C3C"}),(0,C.jsx)("path",{d:"M294.876 288.277a38.3849 38.3849 0 01-21.64-10.056 38.3818 38.3818 0 01-11.516-20.899 38.3896 38.3896 0 013.06-23.666 38.386 38.386 0 0116.453-17.283l9.098 16.897a19.1904 19.1904 0 00-9.757 20.474 19.1937 19.1937 0 005.758 10.45 19.194 19.194 0 0010.82 5.028l-2.276 19.055z",fill:"#2ECDF7"}),(0,C.jsx)("path",{d:"M275.892 219.85a38.3804 38.3804 0 0145.342-1.268 38.3803 38.3803 0 0114.45 18.989 38.3873 38.3873 0 01.436 23.858l-18.346-5.631a19.1827 19.1827 0 00-.218-11.929 19.1907 19.1907 0 00-7.225-9.495 19.1875 19.1875 0 00-11.439-3.39 19.192 19.192 0 00-11.232 4.024l-11.768-15.158z",fill:"#885EFF"}),(0,C.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M259.206 102.57c.241.135.327.439.193.68l-39.314 70.576c-.613 1.1-1.962 1.565-3.124 1.093-3.766-1.53-13.762-5.285-26.356-7.597-12.6-2.314-27.762-3.177-41.881 1.037-16.112 4.81-27.78 14.07-35.424 22.135-3.822 4.032-6.635 7.763-8.491 10.483-.928 1.36-1.616 2.467-2.072 3.232-.228.383-.397.68-.509.881-.057.1-.098.177-.126.227l-.03.057-.008.014-.001.003a.5008.5008 0 01-.676.21.5005.5005 0 01-.209-.676l.442.233-.442-.233.001-.001.002-.005.009-.016.033-.062c.03-.055.073-.135.132-.239.116-.208.29-.513.523-.904.465-.782 1.165-1.906 2.105-3.285 1.881-2.756 4.727-6.53 8.591-10.607 7.727-8.153 19.539-17.532 35.864-22.405 14.331-4.278 29.668-3.391 42.347-1.063 12.685 2.329 22.748 6.109 26.552 7.654.699.284 1.51.002 1.875-.653l39.313-70.575a.5008.5008 0 01.681-.194z",fill:"#7D55EC"}),(0,C.jsx)("path",{d:"M221.651 176.111c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM157.778 166.428c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM106.428 204.191c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.8726-1.734-3.8726-3.873 0-2.139 1.7336-3.873 3.8726-3.873s3.873 1.734 3.873 3.873zM262.35 104.459c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873z",fill:"#7D55EC"}),(0,C.jsx)("path",{d:"M8.5523 214.855c-.3562-1.045.2025-2.181 1.248-2.538l13.7251-4.677c1.0456-.356 2.1819.203 2.5382 1.248l29.6737 87.084-17.5112 5.967-29.6738-87.084z",fill:"#4776FF"}),(0,C.jsx)("path",{d:"M45.0935 264.735c-.3562-1.045.2025-2.182 1.2481-2.538l13.725-4.677c1.0455-.356 2.1819.203 2.5382 1.248l10.6438 31.237-17.5112 5.967-10.6439-31.237z",fill:"#FFCC19"}),(0,C.jsx)("path",{d:"M54.4607 234.868c-.3563-1.046.2025-2.182 1.248-2.538l13.7251-4.677c1.0455-.356 2.1819.202 2.5382 1.248l18.7879 55.137-17.5113 5.967-18.7879-55.137z",fill:"#4776FF"})]})};var tr,ir=function(e){var n=e.blocksInNotebook;return e.extensionOption,(0,s.useMemo)((function(){return(null===n||void 0===n?void 0:n.filter((function(e){var n=e.type;return v.tf.DBT===n})))||[]}),[n]),(0,C.jsx)(C.Fragment,{})};!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}(tr||(tr={}));var rr=t(66653);function or(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function lr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?or(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):or(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var cr=function(e){var n,t,i=e.block,r=e.blockActionDescription,o=e.blocks,l=e.inputPlaceholder,c=e.loading,u=e.onClickTag,a=e.runBlockAndTrack,d=e.supportedUpstreamBlockLanguages,p=e.supportedUpstreamBlockTypes,f=e.updateBlock,h=(0,s.useContext)(m.ThemeContext),v=(0,s.useState)(""),k=v[0],_=v[1],S=(0,s.useState)(!1),E=S[0],I=S[1],D=(0,s.useState)(null),A=D[0],M=D[1],B=(0,s.useMemo)((function(){return(0,Ie.HK)(o,(function(e){return e.uuid}))}),[o]);(0,s.useEffect)((function(){A||M((0,Ie.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,A]);var R=(0,s.useMemo)((function(){return(null===o||void 0===o?void 0:o.filter((function(e){var n=e.name,t=e.type,i=e.uuid;return((null===n||void 0===n?void 0:n.toLowerCase().includes(null===k||void 0===k?void 0:k.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===k||void 0===k?void 0:k.toLowerCase())))&&(null===p||void 0===p?void 0:p.includes(t))})))||[]}),[k,o,p]),N=(0,s.useMemo)((function(){var e=[];return null===R||void 0===R||R.forEach((function(n,t){var i=n.color,r=n.language,o=n.type,l=n.uuid,c=(0,w.qn)(o,{blockColor:i,theme:h}).accent;t>=1&&e.push((0,C.jsx)(x.Z,{light:!0},"divider-".concat(l)));var u=!(null===A||void 0===A||!A[l]),a=null!==d&&"undefined"!==typeof d&&!(null!==d&&void 0!==d&&d.includes(r));e.push((0,C.jsx)(Z.Z,{px:2,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(g.Z,{color:c,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{monospace:!0,muted:a,small:!0,children:l})]}),a&&(0,C.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[r," support coming soon"]}),!a&&(0,C.jsx)(b.Z,{checked:!a&&u,disabled:a,onClick:function(){M((function(e){var n=lr({},e);return u?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[R,h,A]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(ae.Z,{onClickOutside:function(){return I(!1)},open:!0,children:[(0,C.jsx)(W.Z,{beforeIcon:(0,C.jsx)(V.HN,{}),borderless:!0,compact:!0,onChange:function(e){return _(e.target.value)},onClick:function(e){(0,rr.j)(e),I(!0)},onFocus:function(e){(0,rr.j)(e),I(!0)},placeholder:l,small:!0,value:k}),E&&(0,C.jsxs)(C.Fragment,{children:[N,(0,C.jsx)(Z.Z,{mx:1,children:(0,C.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,C.jsx)(T.Z,{compact:!0,loading:c,onClick:function(){return f({block:i,upstream_blocks:Object.keys(A)}).then((function(){return I(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!E&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,C.jsxs)(Z.Z,{pb:1,pr:1,children:[r&&(0,C.jsx)(Z.Z,{mt:1,pl:1,children:(0,C.jsx)(O.ZP,{muted:!0,small:!0,children:r})}),(0,C.jsx)(y.ZP,{alignItems:"center",children:null===i||void 0===i||null===(t=i.upstream_blocks)||void 0===t?void 0:t.map((function(e){var n=null===B||void 0===B?void 0:B[e];if(!n)return(0,C.jsx)("div",{},e);var t=n.color,r=n.type,o=(0,w.qn)(r,{blockColor:t,theme:h}).accentLight;return(0,C.jsx)(Z.Z,{ml:1,mt:1,children:(0,C.jsx)(T.Z,{backgroundColor:o,compact:!0,disabled:!a,onClick:function(e){(0,rr.j)(e),u?u(n):null===a||void 0===a||a({block:lr(lr({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},ur=t(19140);function ar(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function sr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ar(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ar(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var dr=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,r=e.blocks,c=e.blocksInNotebook,u=e.deleteBlock,a=e.extensionOption,p=e.fetchFileTree,f=e.fetchPipeline,h=e.interruptKernel,m=e.messages,b=e.onChangeCallbackBlock,g=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,y=e.runningBlocks,w=e.savePipelineContent,_=e.selectedBlock,S=e.setAnyInputFocused,E=e.setErrors,I=e.setSelectedBlock,T=e.setTextareaFocused,D=e.showBrowseTemplates,A=e.textareaFocused,M=(0,s.useRef)(null),B=(0,s.useState)(!1),L=B[0],F=B[1],U=(a||{}).uuid,H=(x||{}).extensions,W=(0,s.useMemo)((function(){return(null===a||void 0===a?void 0:a.templates)||[]}),[a]),G=(0,s.useMemo)((function(){return null===H||void 0===H?void 0:H[U]}),[U,H]),K=(0,s.useMemo)((function(){return(null===G||void 0===G?void 0:G.blocks)||[]}),[G]),Y=(0,s.useMemo)((function(){return(0,Ie.HK)(K,(function(e){return e.uuid}))}),[K]),q=(0,s.useMemo)((function(){return U===(null===_||void 0===_?void 0:_.extension_uuid)&&Y[null===_||void 0===_?void 0:_.uuid]}),[Y,U,_]),Q=(0,s.useMemo)((function(){return y.reduce((function(e,n,t){return sr(sr({},e),{},(0,o.Z)({},n.uuid,sr(sr({},n),{},{priority:t})))}),{})}),[y]),J=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return z.ZP.blocks.pipelines.useUpdate(null===x||void 0===x?void 0:x.uuid,encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{extension_uuid:null===n||void 0===n?void 0:n.extension_uuid}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){f()},onErrorCallback:function(e,n){return null===E||void 0===E?void 0:E({errors:n,response:e})}})}}),X=(0,l.Z)(J,2),$=X[0],ee=X[1].isLoading,ne=(0,s.useMemo)((function(){return K.map((function(e,n){var o=sr(sr({},e),{},{extension_uuid:U}),l=o.type,a=o.uuid,d=(null===_||void 0===_?void 0:_.uuid)===a,k=Q[a],O=k?0===k.priority?Me.uF.BUSY:Me.uF.QUEUED:Me.uF.IDLE,D="".concat(l,"s/").concat(a,".py");return i.current[D]=(0,s.createRef)(),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(R.Z,{allBlocks:r,autocompleteItems:t,block:o,blockIdx:n,blockRefs:i,blocks:r,defaultValue:o.content,deleteBlock:function(e){u(sr(sr({},e),{},{extension_uuid:U})),S(!1)},executionState:O,extraContent:(0,C.jsx)(cr,{block:o,blockActionDescription:"Click a block name to run expectations on it.",blocks:c,inputPlaceholder:"Select blocks to run expectations on",loading:ee,supportedUpstreamBlockLanguages:[v.t6.PYTHON],supportedUpstreamBlockTypes:[v.tf.DATA_EXPORTER,v.tf.DATA_LOADER,v.tf.DBT,v.tf.TRANSFORMER],updateBlock:$}),fetchFileTree:p,fetchPipeline:f,hideRunButton:!0,interruptKernel:h,messages:m[a],noDivider:!0,onCallbackChange:function(e){return b(l,a,e)},onChange:function(e){return g(l,a,e)},pipeline:x,ref:i.current[D],runBlock:j,runningBlocks:y,savePipelineContent:w,selected:d,setAnyInputFocused:S,setErrors:E,setSelected:function(e){return I(!0===e?o:null)},setTextareaFocused:T,textareaFocused:d&&A})},a)}))}),[t,i,r,c,u,K,U,p,f,h,ee,m,b,g,x,j,y,Q,w,_,S,E,I,T,A,$]),ie="Extensions/GreatExpectations/index",re=(0,he.y)(),oe=re.disableGlobalKeyboardShortcuts,le=re.registerOnKeyDown,ce=re.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){ce(ie)}}),[ce,ie]),le(ie,(function(e,n){!oe&&q&&((0,mt.y)([de.zX,de.Um],n)||(0,mt.y)([de.PQ,de.Um],n))&&(e.preventDefault(),w())}),[q,w]),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(O.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["When a block in your pipeline runs, it\u2019ll run any tests you define in its code. All associated extension blocks will also run during that phase. Learn more about the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,C.jsx)(k.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),ne,(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(ae.Z,{onClickOutside:function(){return F(!1)},open:!0,children:(0,C.jsx)(Jn.Z,{disableKeyboardShortcuts:!0,items:null===W||void 0===W?void 0:W.map((function(e){var t=e.description,i=e.name,r=e.path;return{label:function(){return i},onClick:function(){return n({config:{template_path:r},extension_uuid:U,type:v.tf.EXTENSION},(null===K||void 0===K?void 0:K.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,vt.hr)((function(e){return n(sr(sr({},e),{},{extension_uuid:U,type:v.tf.EXTENSION}),(null===K||void 0===K?void 0:K.length)||0)}),v.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:D})),onClickCallback:function(){return F(!1)},open:L,parentRef:M,uuid:"Extension",children:(0,C.jsx)(N.ZP,{beforeElement:(0,C.jsx)(ur.Wx,{teal:!0,children:(0,C.jsx)(V.mm,{size:ur.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),F(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},pr=t(59e3),fr=["pipeline"];function hr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function vr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?hr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mr=function(e){var n=e.pipeline,t=(0,He.Z)(e,fr),i=(0,p.useRouter)(),r=z.ZP.extension_options.list().data,o=(0,s.useMemo)((function(){return(null===r||void 0===r?void 0:r.extension_options)||[]}),[r]),l=(0,s.useMemo)((function(){return(0,Ie.HK)(o,(function(e){return e.uuid}))}),[o]),c=(0,s.useState)(null),u=c[0],a=c[1],d=(0,s.useMemo)((function(){return l[u]}),[l,u]),f=(0,s.useMemo)((function(){return vr(vr({},t),{},{pipeline:n})}),[n,t]);(0,s.useEffect)((function(){var e;a(null===(e=(0,pr.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var h=(0,s.useMemo)((function(){return n?(tr.GREAT_EXPECTATIONS===u?e=dr:tr.DBT===u&&(e=ir),e?(0,C.jsx)(e,vr(vr({},f),{},{extensionOption:d})):void 0):null;var e}),[d,n,u,f]);return(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsxs)(Z.Z,{p:P.cd,children:[!u&&(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!r&&!u&&(0,C.jsx)(H.Z,{}),h,!u&&(null===o||void 0===o?void 0:o.map((function(e,n){var t=e.description,r=e.name,o=e.uuid;return(0,C.jsx)(Z.Z,{mt:n>=1?P.cd:0,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Te.u7)({extension:o},{pushHistory:!0})},preventDefault:!0,children:(0,C.jsx)(Be.Z,{dark:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Xn.Z,{fullWidth:!1,children:(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)("img",{alt:r,height:3*P.iI,src:"".concat(i.basePath,"/images/extensions/").concat(o,"/logo.png"),width:3*P.iI})})})}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(O.ZP,{bold:!0,children:r}),(0,C.jsx)(O.ZP,{default:!0,small:!0,children:t})]})]}),(0,C.jsx)(V._Q,{})]})})})},o)})))]})})},br=t(23351),gr=t(21764),xr=t(22673),jr=t(52769),yr=t(9468),kr=(P.iI,yr.O$,P.iI,ci.dN,m.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],Zt.Wi,qe.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),m.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*P.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),m.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),Zr=m.default.td.withConfig({displayName:"indexstyle__CellStyle",componentId:"sc-cr39lf-3"})(["display:flex;align-items:center;justify-content:space-between;border:1px solid #1C1C1C;height:100%;",""],(function(e){return!e.noPadding&&"\n padding: 0 ".concat(2*P.iI,"px;\n ")})),Or=t(19963);var Pr=function(e){var n=e.copyText,t=e.deleteVariable,i=e.fetchVariables,r=e.hideEdit,o=e.obfuscate,c=e.pipelineUUID,u=e.variable,a=u.uuid,p=(u.type,u.value),f=(0,s.useRef)(null),h=(0,s.useState)(!1),v=h[0],m=h[1],b=(0,s.useState)(a),g=b[0],x=b[1],y=(0,s.useState)(p),k=y[0],Z=y[1],w=(0,s.useState)(!1),_=w[0],S=w[1],E=(0,d.Db)(z.ZP.variables.pipelines.useUpdate(c,a),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){S(!1),i()}})}}),I=(0,l.Z)(E,1)[0],T=(0,s.useCallback)((function(e){if("Enter"===e.key){var n=k;try{n=JSON.parse(k)}catch(t){}I({variable:{name:g,value:n}})}else"Escape"===e.key&&S(!1)}),[g,k]);(0,s.useEffect)((function(){var e;_&&(null===f||void 0===f||null===(e=f.current)||void 0===e||e.focus())}),[_,f]);var D=n||"kwargs['".concat(a,"']");return(0,C.jsx)("div",{onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},children:(0,C.jsxs)(Yi.Z,{children:[(0,C.jsx)(Fi.Z,{md:1,hiddenSmDown:!0,children:(0,C.jsx)(Zr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(D),gr.Am.success("Successfully copied to clipboard.",{position:gr.Am.POSITION.BOTTOM_RIGHT,toastId:a})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(a),withIcon:!0,children:(0,C.jsx)(V.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Fi.Z,{md:4,children:_?(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:T,paddingHorizontal:0,placeholder:"variable",small:!0,value:g})}):(0,C.jsx)(Zr,{children:(0,C.jsx)(O.ZP,{color:Nt.Or,monospace:!0,small:!0,textOverflow:!0,children:a})})}),(0,C.jsx)(Fi.Z,{md:7,children:_?(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){Z(e.target.value),e.preventDefault()},onKeyDown:T,paddingHorizontal:0,placeholder:"enter value",ref:f,small:!0,value:k})}):(0,C.jsxs)(Zr,{children:[o?(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:"********"}):(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:p}),(0,C.jsxs)(j.Z,{children:[!r&&v&&(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){S(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(a),withIcon:!0,children:(0,C.jsx)(V.I8,{size:2.5*P.iI})}),t&&v&&(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,inline:!0,muted:!0,onClick:t,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(a),withIcon:!0,children:(0,C.jsx)(V.rF,{size:2.5*P.iI})})]})]})})]})})},wr=t(93348),Cr=t(58122);var _r=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,r=e.setErrorMessages,o=e.variables,c=e.width,u=(0,s.useState)(!1),a=u[0],p=u[1],f=(0,s.useState)(),h=f[0],m=f[1],b=(0,s.useState)(),g=b[0],x=b[1],j=null===t||void 0===t?void 0:t.uuid,w=(0,d.Db)(z.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,te.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;r((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),_=(0,l.Z)(w,1)[0],S=(0,d.Db)((function(e){return z.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),E=(0,l.Z)(S,1)[0],I=(0,s.useCallback)((function(e){if("Enter"===e.key){var t=g;try{t=JSON.parse(g)}catch(i){}_({variable:{name:h,value:t}}).then((function(){n(),m(null),x(null)})),p(!1)}else"Escape"===e.key&&p(!1)}),[_,n,h,g]),T=(0,s.useMemo)((function(){return c-4*P.iI}),[c]),D=(0,s.useMemo)((function(){return(0,Cr.wx)(o,(function(e){return e.uuid===jr.C}))}),[o]),A=(0,s.useMemo)((function(){return(0,Cr.wx)(o,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,o]),M=(0,s.useMemo)((function(){return(0,C.jsxs)(kr,{width:T,children:[a&&(0,C.jsxs)(Yi.Z,{children:[(0,C.jsx)(Fi.Z,{md:1,children:(0,C.jsx)(Zr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(h),gr.Am.success("Successfully copied to clipboard.",{position:gr.Am.POSITION.BOTTOM_RIGHT,toastId:h})},uuid:"Sidekick/GlobalVariables/".concat(h),withIcon:!0,children:(0,C.jsx)(V.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Fi.Z,{md:4,children:(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){m(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"variable",small:!0,value:h})})}),(0,C.jsx)(Fi.Z,{md:7,children:(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"enter value",small:!0,value:g})})})]}),null===D||void 0===D?void 0:D.map((function(e){return(0,C.jsx)(Pr,{deleteVariable:function(){return E(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[E,D,h,g,j,m,x,p,a,T]),B=(0,s.useMemo)((function(){return(0,C.jsx)(kr,{width:T,children:null===A||void 0===A?void 0:A.map((function(e){return(0,C.jsx)(Pr,{copyText:(n=e.uuid,"from mage_ai.data_preparation.variable_manager import (\n get_variable,\n)\n\n".concat(function(e,n,t){return"\n".concat(t," = get_variable('").concat(e,"', '").concat(n,"', '").concat(t,"')\n")}(j,null===i||void 0===i?void 0:i.uuid,n))),hideEdit:!0,pipelineUUID:j,variable:e},e.uuid);var n}))})}),[A,i,T]);return(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(wn.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:V.mm,blackBorder:!0,inline:!0,onClick:function(){return p((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:M}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments (Python), interpolated variables (SQL), or vector elements (R). To load a global variable, use the following syntax:"})}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For Python (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(xr.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For SQL (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(xr.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For R (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(xr.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(wn.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,C.jsx)(Z.Z,{mb:P.cd}),(0,C.jsx)(O.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(wr.Xm).map((function(e,n){var t;return(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{large:!0,monospace:!0,children:(0,ne.vg)(null===(t=wr.Z4[e])||void 0===t?void 0:t.call(wr.Z4))})}),(0,Cr.JZ)([],e).map((function(n,t){return(0,C.jsx)(Pr,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),A&&A.length>0&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{my:2,children:(0,C.jsx)(wn.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,C.jsx)(Z.Z,{mb:2,children:B}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{children:["Output variables can be used in any ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:v.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(xr.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.variable_manager import (\n get_variable,\n )\n\n\n df = get_variable(\n 'pipeline_uuid',\n 'block_uuid',\n 'variable_name',\n )\n"})})]})]})},Sr=t(89565),Er=t.n(Sr),Ir=t(22782),Tr=m.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,qe.y$)()),Dr=m.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],qe.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return!e.height&&"\n max-height: ".concat(e.maxHeight||300,"px;\n ")}));function Ar(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Mr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ar(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ar(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Br=function(e){var n=e.cancelPipeline,t=e.checkIfPipelineRunning,i=e.executePipeline,r=e.isPipelineExecuting,o=e.pipelineExecutionHidden,l=e.pipelineMessages,c=e.setPipelineExecutionHidden,u=(0,s.useMemo)((function(){return(null===l||void 0===l?void 0:l.length)||0}),[l]),a=(0,s.useMemo)((function(){return u>100?l.slice(-100):l}),[u,l]),d=(0,s.useCallback)((function(){var e=!o;c(e),(0,_e.t8)(_e.Q9,e)}),[o,c]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Tr,{children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(V.JM,{inverted:!0,size:2*P.iI}),compact:r,disabled:r,loading:r,onClick:i,success:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,C.jsx)(Z.Z,{ml:1}),r&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(V.x8,{inverted:!0,size:2*P.iI}),onClick:n,success:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,C.jsx)(Z.Z,{ml:1})]}),(0,C.jsx)(T.Z,{onClick:t,secondary:!0,children:(0,C.jsx)(O.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(O.ZP,{children:"Hide"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Nn.Z,{checked:o,onCheck:d})]})]})}),!o&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(Dr,{noScrollbarTrackBackground:!0,children:(0,C.jsx)(Ir.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:a.map((function(e,n){var t=e.data,i=e.type,r=[],o=(r=(r=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return r.map((function(e,t){var r,l={first:0===n&&0===t,last:n===u-1&&t===o-1};return Me.jU.includes(i)?r=(0,C.jsx)(Ir.T5,Mr(Mr({},l),{},{children:(0,C.jsx)(O.ZP,{monospace:!0,preWrap:!0,children:(0,C.jsx)(Er(),{children:e})})})):i===Me.Gi.IMAGE_PNG&&(r=(0,C.jsx)("div",{style:{backgroundColor:"white"},children:(0,C.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,C.jsx)("div",{children:r},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})};var Rr=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,r=e.setErrorMessages,o=e.width,c=(0,s.useState)(!1),u=c[0],a=c[1],p=(0,s.useState)(),f=p[0],h=p[1],v=(0,s.useState)(),m=v[0],b=v[1],g=(0,s.useMemo)((function(){return o-P.cd*P.iI*2}),[o]),x=(0,d.Db)(z.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,te.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;r((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),j=(0,l.Z)(x,1)[0],k=(0,d.Db)((function(e){return z.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),w=(0,l.Z)(k,1)[0],_=(0,s.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:f,value:m}}).then((function(){n(),h(null),b(null)})),a(!1)):"Escape"===e.key&&a(!1)}),[j,n,f,m]);return(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(wn.Z,{level:4,monospace:!0,children:"Secrets"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:V.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{children:[(0,C.jsx)(O.ZP,{inline:!0,warning:!0,children:"WARNING:"})," the encryption key is stored in a file on your machine. If you need more secure encryption, we recommend using a secrets manager."]})}),u&&(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(kr,{width:g,children:[u&&(0,C.jsxs)(Yi.Z,{children:[(0,C.jsx)(Fi.Z,{md:1,children:(0,C.jsx)(Zr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(f,") }}")),gr.Am.success("Successfully copied to clipboard.",{position:gr.Am.POSITION.BOTTOM_RIGHT,toastId:f})},uuid:"Sidekick/Secrets/".concat(f),withIcon:!0,children:(0,C.jsx)(V.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Fi.Z,{md:4,children:(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){h(e.target.value),e.preventDefault()},onKeyDown:_,paddingHorizontal:0,placeholder:"secret name",small:!0,value:f})})}),(0,C.jsx)(Fi.Z,{md:7,children:(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){b(e.target.value),e.preventDefault()},onKeyDown:_,paddingHorizontal:0,placeholder:"secret value",small:!0,value:m})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,C.jsx)(Pr,{copyText:e.name,deleteVariable:function(){return w(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"Secrets are not editable, they can only be created and deleted. Secrets are shared across the project, and can be used in configuration fields. To reference a secret, use the following templating syntax:"})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(xr.Z,{language:"yaml",small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n ",maxWidth:g})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(xr.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n ",maxWidth:g})})]})},Nr=t(33699),Lr=t(72454),Fr=t(64155),Ur=t(91835);function Hr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Wr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Hr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Hr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var zr=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,r=e.autocompleteItems,c=e.blockRefs,u=e.blocks,a=e.blocksInNotebook,p=e.deleteBlock,f=e.displayBlockName,h=e.fetchFileTree,m=e.fetchPipeline,b=e.interruptKernel,g=e.messages,x=(e.onChangeCallbackBlock,e.onChangeCodeBlock),j=e.onSelectBlockFile,y=e.pipeline,w=e.runBlock,_=e.runningBlocks,S=e.savePipelineContent,E=e.selectedBlock,I=e.setAnyInputFocused,T=e.setErrors,D=e.setHiddenBlocks,A=e.setSelectedBlock,M=e.setTextareaFocused,B=e.showBrowseTemplates,L=e.textareaFocused,F=(0,s.useRef)(null),U=(0,s.useState)(!1),H=U[0],W=U[1],G=(0,pr.iV)().block_uuid;(0,s.useEffect)((function(){var e=u.find((function(e){var n,t=e.uuid;return(null===G||void 0===G||null===(n=G.split(":"))||void 0===n?void 0:n[0])===t}));e&&(E&&(null===e||void 0===e?void 0:e.uuid)===(null===E||void 0===E?void 0:E.uuid)||(D((function(n){return Wr(Wr({},n),{},(0,o.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[G,u,j,E,D]);var K=(y||{}).type,Y=(0,s.useMemo)((function(){return(0,Ie.HK)(t||[],(function(e){return e.uuid}))}),[t]),q=z.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,Q=(0,s.useMemo)((function(){return(null===q||void 0===q?void 0:q.block_templates)||[]}),[q]),J=(0,s.useCallback)((function(e){return n(e,(null===Y||void 0===Y?void 0:Y.length)||0)}),[n,Y]),X=(0,s.useMemo)((function(){return(0,vt.oM)(Q,J)}),[J,Q]),$=(0,s.useMemo)((function(){return(0,vt.hr)(J,i,K,{blockTemplatesByBlockType:X,languages:[v.t6.PYTHON],showBrowseTemplates:B})}),[J,i,X,K]),ee=(0,s.useMemo)((function(){return null===Y||void 0===Y?void 0:Y[null===E||void 0===E?void 0:E.uuid]}),[Y,E]),ie=(0,s.useMemo)((function(){return _.reduce((function(e,n,t){return Wr(Wr({},e),{},(0,o.Z)({},n.uuid,Wr(Wr({},n),{},{priority:t})))}),{})}),[_]),re=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return z.ZP.blocks.pipelines.useUpdate(null===y||void 0===y?void 0:y.uuid,encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{block_type:null===n||void 0===n?void 0:n.type}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){m()},onErrorCallback:function(e,n){return null===T||void 0===T?void 0:T({errors:n,response:e})}})}}),oe=(0,l.Z)(re,2),le=oe[0],ce=oe[1].isLoading,ue=(0,s.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e,n){var t=e.type,i=e.uuid,l=(null===E||void 0===E?void 0:E.uuid)===i,d=ie[i],k=d?0===d.priority?Me.uF.BUSY:Me.uF.QUEUED:Me.uF.IDLE,O="".concat(t,"s/").concat(i,".py");return c.current[O]=(0,s.createRef)(),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(R.Z,{allBlocks:u,autocompleteItems:r,block:e,blockIdx:n,blockRefs:c,blocks:u,defaultValue:e.content,deleteBlock:function(e){p(Wr({},e)),I(!1)},executionState:k,extraContent:(0,C.jsx)(cr,{block:e,blocks:a,inputPlaceholder:"Select blocks to add ".concat((0,ne._6)(f,null)," to"),loading:ce,onClickTag:function(e){D((function(n){return Wr(Wr({},n),{},(0,o.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[v.tf.CUSTOM,v.tf.DATA_EXPORTER,v.tf.DATA_LOADER,v.tf.DBT,v.tf.SCRATCHPAD,v.tf.SENSOR,v.tf.TRANSFORMER],updateBlock:le}),fetchFileTree:h,fetchPipeline:m,hideRunButton:!0,interruptKernel:b,messages:g[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:y,ref:c.current[O],runBlock:w,runningBlocks:_,savePipelineContent:S,selected:l,setAnyInputFocused:I,setErrors:T,setSelected:function(n){return A(!0===n?e:null)},setTextareaFocused:M,textareaFocused:l&&L})},i)}))}),[t,r,c,u,a,p,f,h,m,b,ce,g,x,j,y,w,_,ie,S,E,I,T,D,A,M,L,le]),se="".concat(f,"/index"),pe=(0,he.y)(),fe=pe.disableGlobalKeyboardShortcuts,ve=pe.registerOnKeyDown,me=pe.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){me(se)}}),[me,se]),ve(se,(function(e,n){!fe&&ee&&((0,mt.y)([de.zX,de.Um],n)||(0,mt.y)([de.PQ,de.Um],n))&&(e.preventDefault(),S())}),[ee,S]),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Run 1 or more ",(0,ne.wX)(f)," block functions whenever another block succeeds or fails."]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Learn more about ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,ne.wX)((0,ne._6)(f,null)),"/overview"),openNewWindow:!0,children:(0,ne.wX)((0,ne._6)(f,null))}),"."]})})]}),ue,(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(ae.Z,{onClickOutside:function(){return W(!1)},open:!0,children:(0,C.jsx)(Jn.Z,{disableKeyboardShortcuts:!0,items:$,onClickCallback:function(){return W(!1)},open:H,parentRef:F,uuid:f,children:(0,C.jsxs)(N.ZP,{beforeElement:(0,C.jsx)(ur.Wx,{rose:i===v.tf.CALLBACK,children:(0,C.jsx)(V.mm,{size:ur.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),W(!0)},uuid:"AddNewBlocks/".concat(f),children:[(0,ne.kC)(f)," block"]})})})})]})},Vr=t(45419);function Gr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Kr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Gr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Yr=[{Icon:V.AQ,name:"Callbacks",uuid:Vr.Q.CALLBACK},{Icon:V.hW,name:"Conditionals",uuid:Vr.Q.CONDITIONAL}];var qr=function(e){var n=(0,Ur.Z)({},e),t=(0,p.useRouter)(),i=(0,s.useState)(null),r=i[0],o=i[1];(0,s.useEffect)((function(){var e;o(null===(e=(0,pr.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,s.useMemo)((function(){var e,t;if(Vr.Q.CALLBACK===r)e={addOnBlockType:v.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(Vr.Q.CONDITIONAL===r){var i;e={addOnBlockType:v.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,C.jsx)(zr,Kr(Kr({},e),n))}),[n,r]);return(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsxs)(Z.Z,{p:P.cd,children:[l,!r&&(null===Yr||void 0===Yr?void 0:Yr.map((function(e,n){var t=e.name,i=e.uuid,r=e.Icon;return(0,C.jsx)(Z.Z,{mt:n>=1?P.cd:0,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Te.u7)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,C.jsx)(Be.Z,{dark:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Xn.Z,{fullWidth:!1,children:(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)(r,{fill:"#885EFF",size:2*P.iI})})})}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsx)(j.Z,{flexDirection:"column",children:(0,C.jsx)(O.ZP,{bold:!0,children:t})})]}),(0,C.jsx)(V._Q,{})]})})})},i)})))]})})};function Qr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Jr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xr=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,r=e.autocompleteItems,l=e.blockRefs,c=e.blocks,u=e.blocksInNotebook,a=e.cancelPipeline,d=e.chartRefs,p=e.checkIfPipelineRunning,h=e.deleteBlock,v=e.deleteWidget,m=e.editingBlock,b=e.executePipeline,g=e.fetchFileTree,x=e.fetchPipeline,j=e.fetchSecrets,k=e.fetchVariables,w=e.globalDataProducts,_=e.globalVariables,S=e.insights,E=e.interruptKernel,I=e.isPipelineExecuting,D=e.lastTerminalMessage,A=e.messages,M=e.metadata,B=e.onChangeCallbackBlock,R=e.onChangeChartBlock,N=e.onChangeCodeBlock,L=e.onSelectBlockFile,U=e.pipeline,H=e.pipelineMessages,W=e.runBlock,z=e.runningBlocks,G=e.sampleData,K=e.savePipelineContent,Y=e.secrets,q=e.selectedBlock,Q=e.selectedFilePath,J=e.sendTerminalMessage,X=e.setAllowCodeBlockShortcuts,$=e.setAnyInputFocused,ee=e.setDepGraphZoom,ne=e.setDisableShortcuts,te=e.setEditingBlock,ie=e.setErrors,re=e.setHiddenBlocks,oe=e.setSelectedBlock,le=e.setTextareaFocused,ce=e.showBrowseTemplates,ue=e.showUpdateBlockModal,ae=e.statistics,se=e.textareaFocused,de=e.treeRef,pe=e.updateWidget,fe=e.widgets,he=(0,Pt.i)().height,ve=Zt.uX,me=(0,s.useState)([]),be=me[0],ge=me[1],xe=(0,s.useState)(!!(0,_e.U2)(_e.Q9)),je=xe[0],ye=xe[1],ke=(0,s.useMemo)((function(){return i-(Lr.k1+1)}),[i]),Ze=((null===m||void 0===m?void 0:m.upstreamBlocks)||{}).block,Oe=((null===G||void 0===G?void 0:G.columns)||[]).slice(0,100),Pe=(0,s.useMemo)((function(){return(null===G||void 0===G?void 0:G.rows)||[]}),[G]),we=(0,s.useMemo)((function(){return(null===M||void 0===M?void 0:M.column_types)||{}}),[M]),Ce=(0,s.useMemo)((function(){return(null===S||void 0===S?void 0:S[1])||{}}),[S]),Se=(0,s.useMemo)((function(){return(0,Ie.HK)((null===S||void 0===S?void 0:S[0])||[],(function(e){return e.feature.uuid}))}),[S]),Ee=!!G,Te=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===U||void 0===U?void 0:U.type)}),[U]),De=F.qL.STREAMING!==(null===U||void 0===U?void 0:U.type)?-70:je?-16:300,Ae=(0,s.useCallback)((0,yr.Fk)({columnTypes:we,columns:Oe,insightsByFeatureUUID:Se,insightsOverview:Ce,noColumnLinks:!0,statistics:ae}),[we,Oe,Se,Ce,ae]),Me=(0,s.useMemo)((function(){return(0,C.jsx)(_r,{blocks:c,fetchVariables:k,pipeline:U,selectedBlock:q,setErrorMessages:ge,variables:_,width:ke})}),[ke,c,k,_,U,q]),Be=(0,s.useMemo)((function(){return(0,C.jsx)(br.Z,{selectedBlock:q,selectedFilePath:Q,setErrors:ie,width:ke>qe.nn?ke-qe.nn:ke})}),[ke,q,Q,ie]),Re=(0,s.useMemo)((function(){return(0,C.jsx)(Rr,{fetchSecrets:j,pipelineUUID:null===U||void 0===U?void 0:U.uuid,secrets:Y,setErrorMessages:ge,width:ke})}),[ke,j,U,Y]),Ne=(0,s.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:r,blockRefs:l,blocks:c,blocksInNotebook:u,deleteBlock:h,fetchFileTree:g,fetchPipeline:x,interruptKernel:E,messages:A,onChangeCallbackBlock:B,onChangeCodeBlock:N,onSelectBlockFile:L,pipeline:U,runBlock:W,runningBlocks:z,savePipelineContent:K,selectedBlock:q,setAnyInputFocused:$,setErrors:ie,setHiddenBlocks:re,setSelectedBlock:oe,setTextareaFocused:le,showBrowseTemplates:ce,textareaFocused:se}}),[t,r,l,c,u,h,g,x,E,A,B,N,L,U,W,z,K,q,$,ie,re,oe,le,ce,se]),Le=(0,s.useMemo)((function(){return Oe.length>0&&(0,C.jsx)(Ci.Z,{columnHeaderHeight:(0,Fn.Qr)(we)&&(0,Fn.Qr)(Se)&&(0,Fn.Qr)(Ce)?0:Fr.Eh,columns:Oe,height:he-ve-Zt.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:Ae,rows:Pe,width:ke})}),[ke,we,Oe,ve,he,Se,Ce,Ae,Pe]),Fe=(0,s.useMemo)((function(){return fe.length>0&&(0,C.jsx)(Xi,{autocompleteItems:r,blockRefs:l,blocks:c,chartRefs:d,deleteWidget:v,fetchFileTree:g,fetchPipeline:x,messages:A,onChangeChartBlock:R,pipeline:U,runBlock:W,runningBlocks:z,savePipelineContent:K,selectedBlock:q,setAnyInputFocused:$,setErrors:ie,setSelectedBlock:oe,setTextareaFocused:le,textareaFocused:se,updateWidget:pe,widgets:fe,width:ke})}),[ke,r,l,c,d,v,g,x,A,R,U,W,z,K,q,$,ie,oe,le,se,pe,fe]),Ue=(0,s.useMemo)((function(){return(0,C.jsx)("div",{style:{height:"100%",position:"relative",width:ke},children:(0,C.jsx)(Nr.Z,{lastMessage:D,onFocus:function(){return oe(null)},sendMessage:J,width:ke})})}),[ke,D,J,oe]),He=(0,s.useMemo)((function(){return(0,C.jsx)(mr,Jr({},Ne))}),[Ne]),We=(0,s.useMemo)((function(){return(0,C.jsx)(qr,Jr({},Ne))}),[Ne]),ze=(0,s.useMemo)((function(){return U&&q&&(0,C.jsx)(Ht,{block:q,fetchFileTree:g,fetchPipeline:x,globalDataProducts:w,pipeline:U,setSelectedBlock:oe,showUpdateBlockModal:ue})}),[g,x,w,U,q,oe,ue]);return(0,C.jsxs)(C.Fragment,{children:[(null===be||void 0===be?void 0:be.length)>=1&&(0,C.jsxs)(Z.Z,{mb:3,mt:2,mx:2,children:[(0,C.jsxs)(y.ZP,{justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,C.jsx)(T.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return ge([])},transparent:!0,children:(0,C.jsx)(V.x8,{muted:!0})})]}),null===be||void 0===be?void 0:be.map((function(e){return(0,C.jsx)(Z.Z,{pb:1,children:(0,C.jsx)(O.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,C.jsxs)(Fr.t0,{fullWidth:!0,heightOffset:at.cH.TERMINAL===n||n===at.cH.TREE?0:qe.nn,onBlur:function(){Q||ne(!1),null===X||void 0===X||X(!1)},onFocus:function(){ne(!0),n===at.cH.TREE&&(null===X||void 0===X||X(!0))},overflowHidden:n===at.cH.TREE,children:[n===at.cH.TREE&&(0,C.jsx)(f.Z,{uuid:"PipelineDetail/".concat(null===U||void 0===U?void 0:U.uuid),children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)($i.Z,{blockRefs:l,blocks:c,editingBlock:m,enablePorts:!Te,fetchPipeline:x,height:he-(ve-qe.nn)-De,messages:A,onClickNode:function(e){var n=e.block.uuid;return re((function(e){var t=!(null===e||void 0===e||!e[n]);return t?Jr(Jr({},e),{},(0,o.Z)({},n,!t)):e}))},pipeline:U,runningBlocks:z,selectedBlock:q,setEditingBlock:te,setErrors:ie,setSelectedBlock:oe,setZoom:ee,treeRef:de}),!Ze&&F.qL.STREAMING===(null===U||void 0===U?void 0:U.type)&&(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsx)(Br,{cancelPipeline:a,checkIfPipelineRunning:p,executePipeline:b,isPipelineExecuting:I,pipelineExecutionHidden:je,pipelineMessages:H,setPipelineExecutionHidden:ye})})]})}),n===at.cH.DATA&&Le,at.cH.SECRETS===n&&Re,at.cH.VARIABLES===n&&Me,at.cH.FILE_VERSIONS===n&&(0,C.jsx)(f.Z,{uuid:"FileVersions/".concat(Q?decodeURIComponent(Q):""),children:Be}),Te||q&&Ee||!q&&Ee&&n===at.cH.DATA?null:at.du.includes(n)&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:at.fp,verticalHeightOffset:ve,width:ke,children:(0,C.jsx)(O.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:q?!Ee&&"No data or insights available":"Select a block for insights"})}),at.cH.CHARTS===n&&(fe.length>0?Fe:(0,C.jsxs)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:at.fp,verticalHeightOffset:ve,width:ke,children:[(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(y.ZP,{flexDirection:"row",children:(0,C.jsxs)(O.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,C.jsx)(V.GQ,{size:1.5*P.iI}),"\xa0in",(0,C.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,C.jsx)(Z.Z,{mt:P.cd,px:1,children:(0,C.jsx)(nr,{size:40*P.iI})})]})),at.cH.TERMINAL===n&&Ue,at.cH.EXTENSIONS===n&&He,at.cH.ADDON_BLOCKS===n&&We,at.cH.BLOCK_SETTINGS===n&&(q?ze:(0,C.jsx)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:at.fp,verticalHeightOffset:ve,width:ke,children:(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(y.ZP,{flexDirection:"row",children:(0,C.jsxs)(O.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,C.jsx)(V.JG,{size:1.5*P.iI}),"\xa0",(0,C.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})}))]})]})},$r=t(35438);function eo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function no(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?eo(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):eo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var to=function(e){var n,t=e.activeView,i=e.depGraphZoom,r=e.pipeline,o=e.secrets,l=e.selectedBlock,c=e.treeRef,u=e.variables,a=null===r||void 0===r?void 0:r.uuid,d=(0,pr.iV)(),p=(0,Cr.wx)(u,(function(e){return e.uuid===jr.C})),f=at.Qq[t],h=(null===f||void 0===f||null===(n=f.buildLabel)||void 0===n?void 0:n.call(f,{pipeline:r,secrets:o,variables:p}))||(null===f||void 0===f?void 0:f.label);at.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(h=(0,C.jsxs)(C.Fragment,{children:["Block settings for ",(0,C.jsx)(O.ZP,{bold:!0,color:(0,w.qn)(null===l||void 0===l?void 0:l.type).accent,inline:!0,monospace:!0,children:null===l||void 0===l?void 0:l.uuid})]}));var v=(0,C.jsx)(O.ZP,{bold:!0,children:h}),m=at.cH.EXTENSIONS===t&&(null===d||void 0===d?void 0:d.extension),b=z.ZP.extension_options.list({},{},{pauseFetch:!m}).data,g=(0,s.useMemo)((function(){return(null===b||void 0===b?void 0:b.extension_options)||[]}),[b]),x=(0,s.useMemo)((function(){return(0,Ie.HK)(g,(function(e){return e.uuid}))}),[g]),P=at.cH.ADDON_BLOCKS===t&&(null===d||void 0===d?void 0:d.addon);if(!t)return(0,C.jsx)("div",{});if(c&&at.cH.TREE===t)v=(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[v,(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(T.Z,no(no({},$r.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.zoomIn)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Zoom in"})})),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,no(no({},$r.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.zoomOut)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Zoom out"})})),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(we.Z,{appearAbove:!0,appearBefore:!0,default:!0,label:"Shortcut: Double-click canvas",lightBackground:!0,size:null,widthFitContent:!0,children:(0,C.jsx)(T.Z,no(no({},$r.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.fitCanvas)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Reset"})}))}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(O.ZP,{bold:!0,children:[null===i||void 0===i?void 0:i.toFixed(2),"x"]})]})]});else if(m){var _=x[null===d||void 0===d?void 0:d.extension];v=(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(Le(),{as:"/pipelines/".concat(a,"/edit?").concat(at.uM,"=").concat(at.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,C.jsx)(k.Z,{default:!0,children:h})}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,C.jsx)(O.ZP,{bold:!0,children:null===_||void 0===_?void 0:_.name})]})}else P&&(v=(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(Le(),{as:"/pipelines/".concat(a,"/edit?").concat(at.uM,"=").concat(at.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,C.jsx)(k.Z,{default:!0,children:h})}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,C.jsx)(O.ZP,{bold:!0,children:(0,ne.vg)(null===d||void 0===d?void 0:d.addon)})]}));return(0,C.jsx)(Zt.ym,{children:v})},io=t(35033),ro=t(11366),oo=t(3055),lo=t(57541),co=t(94353),uo=t(59920),ao=t(36405);function so(e){var n=e.activeView,t=e.pipeline,i=e.secrets,r=e.setActiveSidekickView,o=e.variables,l=(0,Cr.wx)(o,(function(e){return e.uuid===jr.C}));return at.j5.map((function(e){var o=e.buildLabel,c=e.key,u=e.label;return{Icon:at.Z7[c],id:c,isSelected:function(){return n===c},label:function(){return(null===o||void 0===o?void 0:o({pipeline:t,secrets:i,variables:l}))||u},onClick:function(){return r(c,!0)}}}))}var po=t(43482),fo=t(32821),ho=t(28799);function vo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function mo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vo(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function bo(e){var n,t,i=e.page,c=e.pipeline,u=(0,p.useRouter)(),m=(0,Pt.i)().height,b=u.query.pipeline,g=c.uuid||b,x=(0,s.useState)(!!(0,_e.U2)(_e.zg)),j=x[0],k=x[1],O=(0,s.useState)(null),w=O[0],_=O[1],S=(0,s.useState)(null),A=S[0],M=S[1],B=(0,s.useState)(null),R=B[0],L=B[1],U=(0,s.useState)(null),H=U[0],W=U[1],G=(0,s.useState)(null),K=G[0],Y=G[1],q=(0,s.useState)([]),Q=q[0],J=q[1],X=(0,s.useState)({}),$=X[0],re=X[1],oe=(0,s.useState)(!1),ae=oe[0],se=oe[1],de=(0,s.useState)(!1),pe=de[0],fe=de[1],he=(0,s.useState)(!1),ve=he[0],me=he[1],be=(0,s.useState)(!1),ge=be[0],Ze=be[1],Oe=(0,s.useState)(1),we=Oe[0],Re=Oe[1],Ne=z.ZP.projects.list(),Le=Ne.data,Fe=Ne.mutate,Ue=(0,s.useMemo)((function(){var e;return null===Le||void 0===Le||null===(e=Le.projects)||void 0===e?void 0:e[0]}),[Le]),He="".concat(ro.H8,"_").concat(g),We=(0,_e.U2)(He),ze=(0,s.useState)((0,Ie.sE)(Ot.NR,(function(e){return e.uuid===We}))||Ot.NR[0]),Ve=ze[0],Ge=ze[1],Ke=(0,s.useCallback)((function(e){Ge(e),(0,_e.t8)(He,null===e||void 0===e?void 0:e.uuid)}),[He,Ge]),Ye="".concat(ro.g6,"_").concat(g),qe=(0,s.useState)({}),Qe=qe[0],Je=qe[1],Xe=(0,s.useCallback)((function(e){Je((function(n){var t=e(n);return(0,_e.t8)(Ye,JSON.stringify(t)),t}))}),[Ye,Je]);(0,s.useEffect)((function(){var e=(0,_e.U2)(Ye);e&&(0,ne.Pb)(e)&&Je(JSON.parse(e))}),[Ye,Je]);var $e=(0,s.useRef)(null),en=z.ZP.statuses.list({},{revalidateOnFocus:!1}).data,nn=(0,s.useMemo)((function(){var e,n;return null===en||void 0===en||null===(e=en.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[en]),tn=(0,s.useMemo)((function(){var e,n;return null===en||void 0===en||null===(e=en.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[en]),rn=(0,s.useState)({}),on=rn[0],ln=rn[1],cn=(0,s.useState)([]),un=cn[0],sn=cn[1],dn=z.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),pn=dn.data,fn=dn.mutate,hn=null===pn||void 0===pn?void 0:pn.kernels,vn=(null===hn||void 0===hn?void 0:hn.find((function(e){return e.name===F.a_[null===On||void 0===On?void 0:On.type]})))||(null===hn||void 0===hn?void 0:hn[0]),mn=(0,Ce.Z)(g),bn=z.ZP.pipelines.detail(g,{include_block_pipelines:!0,includes_outputs:(0,Fn.Qr)(on)},{refreshInterval:6e4}),gn=bn.data,xn=bn.mutate,jn=z.ZP.files.list(),yn=jn.data,kn=jn.mutate,Zn=(0,s.useMemo)((function(){return(null===yn||void 0===yn?void 0:yn.files)||[]}),[yn]),On=null===gn||void 0===gn?void 0:gn.pipeline,Pn=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===On||void 0===On?void 0:On.type)}),[On]),wn=(0,s.useState)(null),Cn=wn[0],_n=wn[1],Sn=(0,s.useState)((0,Ee.Tz)({dateObj:!0})),En=Sn[0],In=Sn[1],Tn=(0,s.useState)(!1),Dn=Tn[0],An=Tn[1],Mn=(0,De.dd)((function(){return(0,C.jsx)(Pe.Z,{centerOnScreen:!0,neutral:!0,onClick:Nn,subtitle:"Please refresh your page to have the most up-to-date data before making any changes.",title:"Your pipeline may be stale.",width:34*P.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),Bn=(0,l.Z)(Mn,2),Rn=Bn[0],Nn=Bn[1];(0,s.useEffect)((function(){var e,n;null!==gn&&void 0!==gn&&null!==(e=gn.pipeline)&&void 0!==e&&e.updated_at&&(null===Cn||void 0===Cn?void 0:Cn.toISOString())!==new Date(null===gn||void 0===gn||null===(n=gn.pipeline)||void 0===n?void 0:n.updated_at).toISOString()&&_n(new Date(gn.pipeline.updated_at)),Cn&&Number(Cn)>Number(En)&&Rn()}),[null===gn||void 0===gn||null===(n=gn.pipeline)||void 0===n?void 0:n.updated_at,Cn,En,Rn]);var Ln=(0,pr.iV)(),Un=Ln[at.uM],Hn=Ln.block_uuid,Wn=Ln.file_path,zn=(0,s.useMemo)((function(){var e=Ln["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Ln]),Vn=(0,s.useCallback)((function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2?arguments[2]:void 0,i=(0,o.Z)({},at.uM,e);null!==t&&void 0!==t&&t.addon&&(i.addon=null===t||void 0===t?void 0:t.addon),null!==t&&void 0!==t&&t.blockUUID&&(i.block_uuid=null===t||void 0===t?void 0:t.blockUUID),null!==t&&void 0!==t&&t.extension&&(i.extension=null===t||void 0===t?void 0:t.extension),(0,Te.u7)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,s.useEffect)((function(){Un||Vn(at.cH.TREE,!1)}),[Un,Vn]);var Gn=(0,s.useCallback)((function(e,n,t){k(!1),setTimeout((function(){return Vn(e,n,t)}),1)}),[Vn]),Kn=(0,s.useRef)({}),Yn=(0,s.useRef)({}),qn=(0,s.useRef)(null),Qn=(0,s.useRef)({}),Jn=(0,s.useRef)({}),Xn=(0,s.useRef)({}),$n=(0,s.useCallback)((function(e,n,t){var i=Qn.current||{};Qn.current=mo(mo({},i),{},(0,o.Z)({},e,mo(mo({},i[e]||{}),{},(0,o.Z)({},n,t))))}),[Qn]),et=(0,s.useCallback)((function(e,n,t){var i=Jn.current||{};Jn.current=mo(mo({},i),{},(0,o.Z)({},e,mo(mo({},i[e]||{}),{},(0,o.Z)({},n,t))))}),[Jn]),nt=(0,s.useCallback)((function(e,n,t){$n(e,n,t),An(!0)}),[$n,An]),tt=(0,s.useCallback)((function(e,n,t){et(e,n,t),An(!0)}),[et,An]),it=(0,s.useCallback)((function(e){Xn.current=mo(mo({},Xn.current),e)}),[Xn]),rt=(0,s.useCallback)((function(e,n){it((0,o.Z)({},e,n)),An(!0)}),[it,An]),ot=(0,s.useState)(null),lt=ot[0],ct=ot[1],ut=z.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,st=null===ut||void 0===ut?void 0:ut.data_providers;(0,s.useEffect)((function(){var e=gn;null!==gn&&void 0!==gn&&gn.hasOwnProperty("error")||null===ut||void 0===ut||!ut.hasOwnProperty("error")||(e=ut),(0,te.bB)(e,L)}),[gn,ut]);var dt=z.ZP.variables.pipelines.list(g,{global_only:!0},{revalidateOnFocus:!1}),pt=dt.data,ft=dt.mutate,ht=null===pt||void 0===pt?void 0:pt.variables,vt=z.ZP.secrets.list({},{revalidateOnFocus:!1}),mt=vt.data,bt=vt.mutate,gt=null===mt||void 0===mt?void 0:mt.secrets,jt=(0,s.useState)([]),yt=jt[0],kt=jt[1],Zt=(0,s.useState)([]),wt=Zt[0],Ct=Zt[1],Et=(0,s.useRef)({}),It=(0,s.useCallback)((function(e){var n;An(!0);var t=Et.current[e.uuid]||{},i=t.upstream_blocks;(null===e||void 0===e||null===(n=e.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(i=e.upstream_blocks),Et.current[e.uuid]=mo(mo(mo({},t),e),{},{configuration:mo(mo({},t.configuration),e.configuration),upstream_blocks:i})}),[An,Et]),Tt=(0,s.useState)(!1),Dt=Tt[0],At=Tt[1],Mt=(0,s.useState)({upstreamBlocks:null}),Bt=Mt[0],Rt=Mt[1],Nt=(0,s.useState)([]),Lt=Nt[0],Ft=Nt[1],Ut=(0,s.useState)(null),Ht=Ut[0],Wt=Ut[1],zt=(0,po.Dp)(g),Vt=(0,po.Q9)(zt,yt),Gt=(0,s.useState)(Vt),Kt=Gt[0],Yt=Gt[1],qt=(0,s.useState)(),Qt=qt[0],Jt=qt[1],Xt=(0,s.useState)(),$t=Xt[0],ei=Xt[1],ni=(0,s.useState)(null),ti=ni[0],ii=ni[1],ri=(0,Ce.Z)(Kt),oi=(0,s.useCallback)((function(){Rt({upstreamBlocks:{block:null,values:[]}}),ln({}),An(!1),Ft([]),Wt(null)}),[]);(0,s.useEffect)((function(){g!==mn&&(Qn.current={},Jn.current={})}),[g,mn]);var li=z.ZP.block_outputs.detail(!j&&(null===ti||void 0===ti?void 0:ti.type)!==v.tf.SCRATCHPAD&&(null===ti||void 0===ti?void 0:ti.type)!==v.tf.CHART&&null!==ti&&void 0!==ti&&ti.uuid?encodeURIComponent(null===ti||void 0===ti?void 0:ti.uuid):null,{pipeline_uuid:g}),ci=li.data,ui=li.mutate,ai=(0,s.useMemo)((function(){return null===ci||void 0===ci?void 0:ci.block_output}),[ci]),si=(0,s.useMemo)((function(){var e,n,t;return Pn?null===(e=(0,Ie.sE)(null===ai||void 0===ai?void 0:ai.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,ne.kE)($t))})))||void 0===e?void 0:e.sample_data:null===ai||void 0===ai||null===(n=ai.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[ai,Pn,$t]),di=z.ZP.blocks.pipelines.analyses.detail(j?null:g,(null===ti||void 0===ti?void 0:ti.type)!==v.tf.SCRATCHPAD&&(null===ti||void 0===ti?void 0:ti.type)!==v.tf.CHART&&(null===ti||void 0===ti?void 0:ti.uuid)&&encodeURIComponent(null===ti||void 0===ti?void 0:ti.uuid)),pi=di.data,fi=di.mutate,hi=(null===pi||void 0===pi||null===(t=pi.analyses)||void 0===t?void 0:t[0])||{},vi=hi.insights,mi=void 0===vi?{}:vi,bi=hi.metadata,gi=void 0===bi?{}:bi,xi=hi.statistics,ji=void 0===xi?{}:xi;(0,s.useEffect)((function(){0===Lt.length&&(fi(),ui(),ft())}),[fi,ui,ft,Lt]),(0,s.useEffect)((function(){if(0===Kt.length)ii(null);else if((null===ri||void 0===ri?void 0:ri.length)!==(null===Kt||void 0===Kt?void 0:Kt.length)&&(null===Kt||void 0===Kt?void 0:Kt.length)<(null===ri||void 0===ri?void 0:ri.length)){var e=ri.findIndex((function(e){return e.uuid===(null===ti||void 0===ti?void 0:ti.uuid)})),n=ri.length-1===e?e-1:e+1;ii(ri[Math.max(0,n)])}}),[Kt,ri,null===ti||void 0===ti?void 0:ti.uuid]),(0,s.useEffect)((function(){var e;null!==(e=Bt.upstreamBlocks)&&void 0!==e&&e.block&&(k(!1),Vn(at.cH.TREE))}),[Bt.upstreamBlocks,Vn]);var yi=z.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),ki=yi.data,Zi=yi.mutate,Oi=null===ki||void 0===ki?void 0:ki.autocomplete_items;(0,s.useEffect)((function(){Wn||me(!1),Y(Wn)}),[Wn]),(0,s.useEffect)((function(){(0,Ie.fS)(zn,Q)||J(zn)}),[zn,Q]);var Pi=(0,d.Db)(z.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var n=e.pipeline.uuid;u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),kn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),wi=(0,l.Z)(Pi,1)[0],Ci=(0,d.Db)(z.ZP.pipelines.useUpdate(g,{update_content:!0}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){An(!1),xn(),kn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),_i=(0,l.Z)(Ci,2),Si=_i[0],Ei=_i[1].isLoading,Ii=(0,s.useCallback)((function(e,n){var t=e||{},i=t.block,r=t.pipeline,o=void 0===r?{extensions:{}}:r,c=(n||{}).contentOnly;if(!(Cn&&Number(Cn)>Number(En))){var u=(0,Ee.Tz)({dateObj:!0}),a=(0,Ee.Tz)();In(u);var s={},d={},p={},f={};((null===o||void 0===o?void 0:o.blocks)||yt).forEach((function(e){var n,t,r,o=e.extension_uuid,u=e.type,a=e.uuid,h=null===(n=Jn.current[u])||void 0===n?void 0:n[a];"undefined"===typeof h&&(h=e.content);var m,b=null===(t=Qn.current[u])||void 0===t?void 0:t[a];"undefined"===typeof b&&(b=e.callback_content);var g=null===(r=on[a])||void 0===r?void 0:r.filter((function(e){return!!e})),x=null===g||void 0===g?void 0:g.find((function(e){return e.error}));if(g){var j=[],y=0;g.forEach((function(n){var t=n.data,i=n.type;(v.tf.SCRATCHPAD===e.type||x||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(io.Lz)?e:e.concat(n)}),[]),i===Me.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!tn||y<tn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"".concat(a,"_").concat(n)}}))}var k=mo(mo({},e),{},{callback_content:b,content:h,outputs:m});(null===i||void 0===i?void 0:i.uuid)===a&&Object.entries(i).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];"object"===typeof i&&!Array.isArray(i)&&i?Object.entries(i).forEach((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];k[t]||(k[t]={}),k[t][i]=r})):k[t]=i})),c?d[k.uuid]={callback_content:k.callback_content,content:k.content,outputs:k.outputs,uuid:k.uuid}:[v.tf.EXTENSION].includes(u)?(s[o]||(s[o]=[]),s[o].push(k)):v.tf.CALLBACK===u?p[k.uuid]=k:v.tf.CONDITIONAL===u?f[k.uuid]=k:d[k.uuid]=k}));var h=mo(mo({},null===On||void 0===On?void 0:On.extensions),null===o||void 0===o?void 0:o.extensions);Object.entries(s).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];h[t]||(h[t]={}),h[t].blocks=i}));var m=[],b=[],g=[];return((null===o||void 0===o?void 0:o.blocks)||yt).forEach((function(e){var n=e.uuid,t=d[n],i=p[n],r=f[n];"undefined"!==typeof t?m.push(t):"undefined"!==typeof i?b.push(i):"undefined"!==typeof r&&g.push(r)})),Si({pipeline:mo(mo(mo({},On),o),{},{blocks:m,callbacks:b,conditionals:g,extensions:h,updated_at:a,widgets:wt.map((function(e){var n,t,i=Xn.current[e.uuid],r=Et.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var o=null===(n=on[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===o||void 0===o?void 0:o.find((function(e){return e.error}));if(o){var c=[];o.forEach((function(n){var t=n.data,i=n.type;(v.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(io.Lz)?e:e.concat(n)}),[])),c.push(n))})),t=c.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}return mo(mo(mo({},e),r),{},{configuration:mo(mo({},e.configuration),r.configuration),content:i,outputs:t})}))})})}Rn()}),[yt,tn,on,On,Cn,En,Rn,Si,wt]),Ti=(0,s.useCallback)((function(e){Ii();var n=encodeURIComponent(e),t=(0,pr.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n);var i=(0,fo.IO)(e,yt);if(i){if(Wt(i),null!==Kn&&void 0!==Kn&&Kn.current){var r,o=Kn.current["".concat(i.type,"s/").concat(i.uuid,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}}else(0,Te.u7)({file_path:n,"file_paths[]":t})}),[Kn,yt,Ii]),Di=(0,s.useMemo)((function(){var e=[],n=[];return yt.forEach((function(t){v.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[yt]),Ai=Di.blocksInNotebook,Mi=Di.blocksInSidekick,Bi=(0,s.useCallback)((function(e,n){return Ii({pipeline:{name:e,type:n}}).then((function(e){var t,i;if(null!==e&&void 0!==e&&null!==(t=e.data)&&void 0!==t&&t.pipeline){var r=e.data.pipeline.uuid;g!==r?window.location.href="".concat(u.basePath,"/pipelines/").concat(r,"/edit"):(kn(),n!==(null===On||void 0===On?void 0:On.type)&&xn(),(0,po.k1)(Ai,g,r),(0,po.k1)(Mi,g,r))}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&M((function(e){return mo(mo({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){Ti("pipelines/".concat(g,"/").concat(an.dT.METADATA_YAML)),M(null)}}]})}))}))}),[Ai,Mi,kn,xn,Ti,null===On||void 0===On?void 0:On.type,g,u,Ii]),Ri=(0,d.Db)((function(e){var n=e.type,t=e.extension_uuid,i=e.uuid,r={};return n&&(r.block_type=n),t&&(r.extension_uuid=t),z.ZP.blocks.pipelines.useDelete(g,encodeURIComponent(i),r)()}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;kt((function(e){return(0,Ie.oM)(e,e.findIndex((function(e){var n=e.type,r=e.uuid;return t===n&&i===r})))})),xn(),Wt(null),t===v.tf.SCRATCHPAD&&kn()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;M({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&ln((function(e){return mo(mo({},e),{},(0,o.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Me.Gi.TEXT_PLAIN}}))))}))}})}}),Ni=(0,l.Z)(Ri,1)[0],Li=(0,d.Db)((function(e){var n=e.uuid;return z.ZP.widgets.pipelines.useDelete(g,n)()}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var n=e.widget.uuid;Ct((function(e){return(0,Ie.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),xn(),kn()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;M({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&ln((function(e){return mo(mo({},e),{},(0,o.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Me.Gi.TEXT_PLAIN}}))))}))}})}}),Fi=(0,l.Z)(Li,1)[0],Ui=(0,De.dd)((function(e){return(0,C.jsx)(Pe.Z,{centerOnScreen:!0,neutral:!0,onCancel:zi,onClick:function(){return Gi(e)},subtitle:"Deleting this block is dangerous. Your block may have downstream dependencies that depend on this block. You can delete this block anyway and remove it as a dependency from downstream blocks.",title:"Your block has dependencies",width:34*P.iI})})),Hi=(0,l.Z)(Ui,2),Wi=Hi[0],zi=Hi[1],Vi=(0,d.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,r="".concat(t,"/").concat(i);return n&&an.JD[n]&&(r="".concat(r,".").concat(an.JD[n].toLowerCase())),z.ZP.blocks.useDelete(encodeURIComponent(r))()}),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){Zi(),xn(),kn()},onErrorCallback:function(e,n){Wi(),M({displayMessage:e.exception,errors:n,response:e})}})}}),Gi=(0,l.Z)(Vi,1)[0],Ki=(0,d.Db)(z.ZP.kernels.useUpdate(null===vn||void 0===vn?void 0:vn.id),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(){return fn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),Yi=(0,l.Z)(Ki,1)[0],qi=(0,s.useCallback)((function(){return Yi({kernel:{action_type:"restart"}})}),[Yi]),Qi=(0,s.useCallback)((function(){Yi({kernel:{action_type:"interrupt"}}),Ft([])}),[Yi]),Ji=(0,d.Db)(z.ZP.blocks.pipelines.useCreate(g)),Xi=(0,l.Z)(Ji,1)[0],$i=(0,s.useCallback)((function(e,n,t){var i,o,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,ne.Y6)();e.converted_from_type&&e.converted_from_uuid&&(i=null===(o=Jn.current[e.converted_from_type])||void 0===o?void 0:o[e.converted_from_uuid]);var u=e.language,a=e.type;if(Pn){var s=(0,Ie.HK)((null===On||void 0===On?void 0:On.blocks)||[],(function(e){return e.type})),d=s[v.tf.DATA_EXPORTER],p=s[v.tf.DATA_LOADER],f=s[v.tf.TRANSFORMER];if(v.tf.DATA_LOADER===a){if(v.t6.YAML!==u)return void M({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(v.t6.YAML," and not ").concat(u,".")});if(p)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a source: ").concat(null===p||void 0===p?void 0:p.uuid,".")})}else if(v.tf.TRANSFORMER===a){if(f)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a transformer: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}else if(v.tf.DATA_EXPORTER===a){if(v.t6.YAML!==u)return void M({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(v.t6.YAML," and not ").concat(u,".")});if(d)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a destination: ").concat(null===d||void 0===d?void 0:d.uuid,".")})}}return Xi({block:mo({content:i,name:c,priority:n,require_unique_name:!0},e)}).then((function(n){(0,te.wD)(n,{callback:function(){var e=n.data.block;null===t||void 0===t||t(e),kn(),xn().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;return kt((function(e){var n=(0,r.Z)(t);Object.entries(i||{}).forEach((function(e){var t=(0,l.Z)(e,2),i=t[0],o=t[1].blocks;o&&n.push.apply(n,(0,r.Z)(o.map((function(e){return mo(mo({},e),{},{extension_uuid:i})}))))}));var o=(0,Ie.HK)(e,(function(e){return e.uuid})),c=[];return n.forEach((function(e){var n=o[e.uuid];n?c.push(n):c.push(e)})),c}))}))},onErrorCallback:function(n,t){var i,r=null===n||void 0===n||null===(i=n.error)||void 0===i?void 0:i.exception,o=(0,fo.u$)(mo(mo({},e),{},{name:c}));r&&o&&r.startsWith(Ot.LR)?M((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){Ti(o),M(null)}}],response:n}})):M({errors:t,response:n})}})}))}),[Xi,kn,xn,Pn,Ti,kt,M,On]),er=(0,De.dd)((function(e){var n=e.block,t=e.idx,i=e.isUpdatingBlock,r=void 0!==i&&i,o=e.name,l=void 0===o?(0,ne.Y6)():o,c=e.onCreateCallback,u=e.preventDuplicateBlockName;return(0,C.jsx)(ie.BC,{children:(0,C.jsx)(le,{block:n,defaultName:l,isUpdatingBlock:r,onClose:ir,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r?Ii({block:{color:(null===e||void 0===e?void 0:e.color)||null,name:null===e||void 0===e?void 0:e.name,uuid:n.uuid},pipeline:{blocks:(null===On||void 0===On?void 0:On.blocks)||[]}}).then((function(){Wt(null),ir()})):$i(mo(mo({},n),(0,Fn.gR)(e,["name"])),t,c,null===e||void 0===e?void 0:e.name).then((function(){return ir()}))},pipeline:On,preventDuplicateBlockName:u})})}),{},[$i,On],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),nr=(0,l.Z)(er,2),tr=nr[0],ir=nr[1],rr=(0,De.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,r=e.onSaveSuccess;return(0,C.jsx)(ie.BC,{children:(0,C.jsx)(St.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),cr()},onSaveSuccess:function(e){Fe(),cr(),null===r||void 0===r||r(e)}})})}),{},[Fe],{background:!0,uuid:"configure_project"}),or=(0,l.Z)(rr,2),lr=or[0],cr=or[1],ur=(0,d.Db)(z.ZP.widgets.pipelines.useCreate(g)),ar=(0,l.Z)(ur,1)[0],sr=(0,s.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,ne.Y6)();return ar({widget:mo({name:i,priority:n,type:v.tf.CHART},e)}).then((function(e){return(0,te.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),kn(),xn(),Vn(at.cH.CHARTS),W(n)},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}))}),[kn,xn,ar,Vn]);(0,s.useEffect)((function(){if(H){var e,n=null===(e=Yn.current[H.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),W(null))}}),[H,W]),(0,s.useEffect)((function(){mn!==g&&(kt([]),Ct([]),Yt([]),sn([]))}),[g,mn]),(0,s.useEffect)((function(){if("undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)||"undefined"!==typeof(null===On||void 0===On?void 0:On.extensions)){var e=[];"undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.blocks)),"undefined"!==typeof(null===On||void 0===On?void 0:On.callbacks)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.callbacks)),"undefined"!==typeof(null===On||void 0===On?void 0:On.conditionals)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.conditionals)),"undefined"!==typeof(null===On||void 0===On?void 0:On.extensions)&&Object.entries((null===On||void 0===On?void 0:On.extensions)||{}).forEach((function(n){var t=(0,l.Z)(n,2),i=t[0],o=t[1].blocks;o&&e.push.apply(e,(0,r.Z)(o.map((function(e){return mo(mo({},e),{},{extension_uuid:i})}))))})),kt(e)}}),[null===On||void 0===On?void 0:On.blocks,null===On||void 0===On?void 0:On.callbacks,null===On||void 0===On?void 0:On.conditionals,null===On||void 0===On?void 0:On.extensions]),(0,s.useEffect)((function(){"undefined"!==typeof(null===On||void 0===On?void 0:On.widgets)&&Ct(On.widgets)}),[null===On||void 0===On?void 0:On.widgets]),(0,s.useEffect)((function(){(null===Vt||void 0===Vt?void 0:Vt.length)>0&&0===(null===Kt||void 0===Kt?void 0:Kt.length)&&(Yt(Vt),ii(Vt[0]))}),[Kt,Vt]);var dr=(0,Ce.Z)(yt);(0,s.useEffect)((function(){if("undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)&&(!yt.length||!(0,Ie.fS)(null===dr||void 0===dr?void 0:dr.map((function(e){return e.uuid})).sort(),null===yt||void 0===yt?void 0:yt.map((function(e){return e.uuid})).sort()))){var e=(0,po.Rt)(On.blocks),n=e.content,t=e.messages;Jn.current=n,ln((function(e){return mo(mo({},t),e)}))}}),[yt,dr,null===On||void 0===On?void 0:On.blocks,ln]),(0,s.useEffect)((function(){if(!wt.length&&"undefined"!==typeof(null===On||void 0===On?void 0:On.widgets)){var e=(0,po.Rt)(On.widgets),n=e.content,t=e.messages;Xn.current=n,ln((function(e){return mo(mo({},t),e)}))}}),[null===On||void 0===On?void 0:On.widgets,ln,wt]);var fr=(0,s.useCallback)((function(e,n,t){var i=yt.find((function(t){var i=t.type,r=t.uuid;return i===n&&r===e}));if(i){if(Wt(i),null!==Kn&&void 0!==Kn&&Kn.current){var r,o=Kn.current["".concat(i.type,"s/").concat(i.uuid,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}(0,Te.u7)({block_uuid:null,file_path:null,"file_paths[]":[]})}else if(n===v.tf.CHART){var l=wt.find((function(n){return n.uuid===e}));if(l&&(Wt(l),null!==Yn&&void 0!==Yn&&Yn.current)){var c,u=Yn.current[l.uuid];null===u||void 0===u||null===(c=u.current)||void 0===c||c.scrollIntoView()}}else t&&Ti(t)}),[yt,Ti,wt]);(0,s.useEffect)((function(){if(Hn&&!Ht){var e=yt.find((function(e){var n,t=e.uuid;return(null===Hn||void 0===Hn||null===(n=Hn.split(":"))||void 0===n?void 0:n[0])===t}));e&&(Xe((function(n){return mo(mo({},n),{},(0,o.Z)({},e.uuid,!1))})),fr(e.uuid,e.type,null))}else(null===dr||void 0===dr?void 0:dr.length)!==(null===yt||void 0===yt?void 0:yt.length)&&Ht&&(Xe((function(e){return mo(mo({},e),{},(0,o.Z)({},Ht.uuid,!1))})),fr(Ht.uuid,Ht.type,null))}),[Hn,yt,null===dr||void 0===dr?void 0:dr.length,fr,Ht,Xe]);var hr=(0,s.useMemo)((function(){return new h.Z}),[]),vr=(0,s.useMemo)((function(){return{api_key:co.l,token:hr.decodedToken.token}}),[hr]),mr=(0,a.ZP)((0,ho.Ib)(),{onClose:function(){return console.log("socketUrlPublish closed")},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.block_type,i=n.execution_state,l=n.msg_type,c=n.pipeline_uuid,u=n.uuid;if(!u&&!c)return;var a=yt.find((function(e){var n=e.type,i=e.uuid;return t===n&&u===i}));"stream_pipeline"!==l?ln((function(e){var t=e[u]||[];return mo(mo({},e),{},(0,o.Z)({},u,t.concat(n)))})):(sn((function(e){return[].concat((0,r.Z)(e),[n])})),Me.uF.IDLE===i&&(Ft([]),xn(),u||At(!1))),Me.uF.BUSY===i?Ft((function(e){return e.find((function(e){var n=e.uuid;return u===n}))||!a?e:e.concat(a)})):Me.uF.IDLE===i&&Ft((function(e){return e.filter((function(e){var n=e.uuid;return u!==n}))})),nn||An(!0)}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,br=(0,s.useCallback)((function(){Ii().then((function(){At(!0),sn([]),mr(JSON.stringify(mo(mo({},vr),{},{execute_pipeline:!0,pipeline_uuid:g})))}))}),[g,Ii,mr,vr]),gr=(0,s.useCallback)((function(){mr(JSON.stringify(mo(mo({},vr),{},{cancel_pipeline:!0,pipeline_uuid:g})))}),[g,mr,vr]),xr=(0,s.useCallback)((function(){mr(JSON.stringify(mo(mo({},vr),{},{cancel_pipeline:!0,pipeline_uuid:g,skip_publish_message:!0})))}),[g,mr,vr]),jr=(0,s.useCallback)((function(){mr(JSON.stringify(mo(mo({},vr),{},{check_if_pipeline_running:!0,pipeline_uuid:g})))}),[g,mr,vr]);(0,s.useEffect)((function(){var e;return window.addEventListener("pagehide",xr),null===u||void 0===u||null===(e=u.events)||void 0===e||e.on("routeChangeStart",xr),function(){var e;null===u||void 0===u||null===(e=u.events)||void 0===e||e.off("routeChangeStart",xr),window.removeEventListener("pagehide",xr)}}),[xr,null===u||void 0===u?void 0:u.events]);var yr=(0,s.useCallback)((function(e){var n=e.block,t=e.code,i=e.ignoreAlreadyRunning,r=e.runDownstream,o=void 0!==r&&r,l=e.runIncompleteUpstream,c=void 0!==l&&l,u=e.runSettings,a=void 0===u?{}:u,s=e.runTests,d=void 0!==s&&s,p=e.runUpstream,f=n.extension_uuid,h=n.upstream_blocks,v=n.uuid;if(!Lt.find((function(e){var n=e.uuid;return v===n}))||i){var m="".concat(ro.vF,"_").concat(null===On||void 0===On?void 0:On.uuid);mr(JSON.stringify(mo(mo({},vr),{},{code:t,extension_uuid:f,output_messages_to_logs:!!(0,_e.U2)(m),pipeline_uuid:null===On||void 0===On?void 0:On.uuid,run_downstream:o,run_incomplete_upstream:c,run_settings:a,run_tests:d,run_upstream:p,type:n.type,upstream_blocks:h,uuid:v}))),ln((function(e){return delete e[v],e})),se(!1),Ft((function(e){return e.find((function(e){var n=e.uuid;return v===n}))?e:e.concat(n)}))}xn()}),[xn,On,Lt,mr,ln,Ft,se,vr]),kr=(0,s.useCallback)((function(e){var n=e.block;return nn?yr(e):Ii({block:{outputs:[],uuid:n.uuid}},{contentOnly:!0}).then((function(){return yr(e)}))}),[nn,yr,Ii]),Zr=(0,a.ZP)((0,ho.Ib)("terminal"),{queryParams:vr,shouldReconnect:function(){return!0}}),Or=Zr.lastMessage,Pr=Zr.sendMessage,wr=(0,De.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,C.jsx)(ie.BC,{children:(0,C.jsx)(I.Z,{contained:!0,defaultLinkUUID:i,onClickCustomTemplate:function(e){t({config:{custom_template:e,custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid}}),Sr()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[lo.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),Cr=(0,l.Z)(wr,2),_r=Cr[0],Sr=Cr[1],Er=z.ZP.global_data_products.list().data,Ir=(0,s.useMemo)((function(){return(null===Er||void 0===Er?void 0:Er.global_data_products)||[]}),[Er]),Tr=(0,De.dd)((function(e){var n=e.addNewBlock;return(0,C.jsx)(ie.BC,{children:(0,C.jsx)(Be.Z,{children:(0,C.jsx)(ye.Z,{globalDataProducts:Ir,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:v.tf.GLOBAL_DATA_PRODUCT}),Mr()}})})})}),{},[Ir],{background:!0,uuid:"global_data_products"}),Dr=(0,l.Z)(Tr,2),Ar=Dr[0],Mr=Dr[1],Br=(0,s.useMemo)((function(){return(0,C.jsx)(Xr,{activeView:Un,addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){return tr({block:e,idx:n,name:i,onCreateCallback:t})}))},afterWidth:w,autocompleteItems:Oi,blockRefs:Kn,blocks:yt,blocksInNotebook:Ai,cancelPipeline:gr,chartRefs:Yn,checkIfPipelineRunning:jr,deleteBlock:Ni,deleteWidget:Fi,editingBlock:Bt,executePipeline:br,fetchFileTree:kn,fetchPipeline:xn,fetchSecrets:bt,fetchVariables:ft,globalDataProducts:Ir,globalVariables:ht,insights:mi,interruptKernel:Qi,isPipelineExecuting:Dt,isPipelineUpdating:Ei,lastTerminalMessage:Or,messages:on,metadata:gi,onChangeCallbackBlock:nt,onChangeChartBlock:rt,onChangeCodeBlock:tt,onSelectBlockFile:fr,pipeline:On,pipelineMessages:un,runBlock:kr,runningBlocks:Lt,sampleData:si,savePipelineContent:Ii,secrets:gt,selectedBlock:Ht,selectedFilePath:K,sendTerminalMessage:Pr,setActiveSidekickView:Vn,setAllowCodeBlockShortcuts:Ze,setAnyInputFocused:fe,setDepGraphZoom:Re,setDisableShortcuts:me,setEditingBlock:Rt,setErrors:M,setHiddenBlocks:Xe,setSelectedBlock:Wt,setTextareaFocused:se,showBrowseTemplates:_r,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,ne.Y6)(),t=arguments.length>2?arguments[2]:void 0;return new Promise((function(){return tr({block:e,isUpdatingBlock:!0,name:n,preventDuplicateBlockName:t})}))},statistics:ji,textareaFocused:ae,treeRef:qn,updatePipelineMetadata:Bi,updateWidget:It,widgets:wt})}),[Un,w,Oi,Kn,yt,Ai,gr,jr,Ni,Fi,Bt,br,kn,xn,bt,ft,Ir,ht,mi,Qi,Dt,Ei,Or,on,gi,nt,rt,tt,fr,On,un,kr,Lt,si,Ii,gt,Ht,K,Pr,Vn,fe,Rt,M,Xe,se,tr,_r,ji,ae,Bi,It,wt]),Rr=(0,s.useMemo)((function(){return(0,C.jsx)(xt,{addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){var r;ee.L.BLOCK_FILE!==(null===e||void 0===e||null===(r=e.block_action_object)||void 0===r?void 0:r.object_type)&&(v.tf.DBT!==(null===e||void 0===e?void 0:e.type)||v.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?tr({block:e,idx:n,name:i,onCreateCallback:t}):$i(e,n,t,i)}))},addWidget:function(e,n){var t=n.onCreateCallback;return sr(e,wt.length,t)},allBlocks:yt,allowCodeBlockShortcuts:ge,anyInputFocused:pe,autocompleteItems:Oi,blockRefs:Kn,blocks:Ai,dataProviders:st,deleteBlock:Ni,disableShortcuts:ve,fetchFileTree:kn,fetchPipeline:xn,fetchSampleData:ui,files:Zn,globalDataProducts:Ir,globalVariables:ht,hiddenBlocks:Qe,interruptKernel:Qi,mainContainerRef:$e,mainContainerWidth:lt,messages:on,onChangeCallbackBlock:nt,onChangeCodeBlock:tt,openSidekickView:Gn,pipeline:On,pipelineContentTouched:Dn,project:Ue,restartKernel:qi,runBlock:kr,runningBlocks:Lt,savePipelineContent:Ii,selectedBlock:Ht,setAnyInputFocused:fe,setDisableShortcuts:me,setEditingBlock:Rt,setErrors:M,setHiddenBlocks:Xe,setIntegrationStreams:Jt,setOutputBlocks:Yt,setPipelineContentTouched:An,setSelectedBlock:Wt,setSelectedOutputBlock:ii,setSelectedStream:ei,setTextareaFocused:se,showBrowseTemplates:_r,showConfigureProjectModal:lr,showGlobalDataProducts:Ar,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,ne.Y6)();return new Promise((function(){return tr({block:e,isUpdatingBlock:!0,name:n})}))},textareaFocused:ae,widgets:wt})}),[$i,sr,ge,pe,Oi,Kn,yt,Ai,st,Ni,ve,kn,xn,ui,Zn,Ir,ht,Qe,Qi,$e,lt,on,nt,tt,Gn,On,Dn,Ue,qi,kr,Lt,Ii,Ht,fe,Rt,M,Xe,An,Wt,se,tr,_r,lr,Ar,ae,wt]),Nr=(0,s.useMemo)((function(){if(i===Ot.b7)return(0,C.jsx)(xe,{cancelPipeline:gr,createPipeline:wi,executePipeline:br,interruptKernel:Qi,isPipelineExecuting:Dt,pipeline:On,restartKernel:qi,savePipelineContent:Ii,setActiveSidekickView:Vn,setMessages:ln,children:K&&(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,children:(0,C.jsx)(T.Z,{compact:!0,onClick:function(){return Y(null)},small:!0,children:"View pipeline"})})})})}),[gr,wi,br,Qi,Dt,i,On,qi,Ii,K,Vn,ln,Y]),Lr=(0,s.useMemo)((function(){if(i===Ot.b7)return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ae,{filePaths:Q,filesTouched:$,isBusy:Lt.length>=1,isPipelineUpdating:Ei,kernel:vn,pipeline:On,pipelineContentTouched:Dn,pipelineLastSaved:Cn,restartKernel:qi,savePipelineContent:Ii,selectedFilePath:K,setErrors:M,setRunningBlocks:Ft,updatePipelineMetadata:Bi,children:Nr}),(null===Q||void 0===Q?void 0:Q.length)>0&&(0,C.jsx)(Se.rK,{relativePosition:!0,secondary:!0,children:(0,C.jsx)(je.Z,{filePaths:Q,filesTouched:$,savePipelineContent:Ii,selectedFilePath:K})})]})}),[Nr,$,Ei,vn,i,On,Dn,Cn,qi,Lt,Ii,K,Q,M,Bi]),Fr=(0,s.useMemo)((function(){var e;return null===Qt||void 0===Qt||null===(e=Qt.filter((function(e){return(0,Ie.sE)(null===ai||void 0===ai?void 0:ai.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,ne.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,C.jsx)(Z.Z,{pl:1,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return ei(e)},selected:$t===e,uuid:e,children:e})},e)}))}),[ai,Qt,$t]),Ur=(0,s.useRef)(null),Hr=(0,s.useMemo)((function(){return(0,C.jsx)(ce.Z,{addNewBlock:function(e,n){$i(e,yt.length,n,e.name),(null===zn||void 0===zn?void 0:zn.length)>=1&&u.push("/pipelines/".concat(g,"/edit"))},blocks:yt,deleteWidget:Fi,fetchAutocompleteItems:Zi,fetchFileTree:kn,fetchPipeline:xn,files:Zn,onSelectBlockFile:fr,openFile:Ti,openPipeline:function(e){oi(),u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:Gn,pipeline:On,ref:Ur,setErrors:M,setSelectedBlock:Wt,widgets:wt})}),[$i,yt,Fi,Zi,kn,xn,null===zn||void 0===zn?void 0:zn.length,Zn,fr,Ti,Gn,On,g,oi,u,M,Wt,wt]),Wr=(0,s.useMemo)((function(){return(0,C.jsx)(E,{blockRefs:Kn,hiddenBlocks:Qe,pipeline:On,setHiddenBlocks:Xe})}),[Kn,Qe,On,Xe]),zr=(0,s.useMemo)((function(){return Ot.Jf.uuid===(null===Ve||void 0===Ve?void 0:Ve.uuid)?Hr:Ot.IY.uuid===(null===Ve||void 0===Ve?void 0:Ve.uuid)?Wr:null}),[Hr,Wr,Ve]),Vr=(0,s.useMemo)((function(){return(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(D.Z,{noPadding:!0,onClickTab:function(e){Ke(e)},selectedTabUUID:null===Ve||void 0===Ve?void 0:Ve.uuid,small:!0,tabs:Ot.NR})})}),[Ke,Ve]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ke.Z,{title:null===On||void 0===On?void 0:On.name}),(0,C.jsxs)(_t,{after:Br,afterHeader:(0,C.jsx)(to,{activeView:Un,depGraphZoom:we,pipeline:On,secrets:gt,selectedBlock:Ht,treeRef:qn,variables:ht}),afterHeightOffset:oo.Mz,afterHidden:j,afterNavigationItems:so({activeView:Un,pipeline:On,secrets:gt,setActiveSidekickView:Vn,variables:ht}),afterOverflow:at.cH.DATA===Un?"hidden":null,afterSubheader:(null===Kt||void 0===Kt?void 0:Kt.length)>0&&Un===at.cH.DATA&&(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!Pn&&Kt.map((function(e){var n=e.uuid,t=(null===ti||void 0===ti?void 0:ti.uuid)===n;return(0,C.jsx)(Z.Z,{pl:1,children:(0,C.jsx)(N.ZP,{afterElement:t?(0,C.jsx)(T.Z,{basic:!0,highlightOnHover:!0,onClick:function(){(0,po.h8)(g,e.uuid),Yt((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,C.jsx)(V.x8,{muted:!0,size:1.25*P.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return ii(e)},selected:t,uuid:n,children:n})},n)})),Pn&&Fr]}),before:zr,beforeHeader:Vr,beforeHeightOffset:oo.Mz,beforeNavigationItems:(0,ao.H)(uo.M.EDIT,On),errors:R||A,headerOffset:(null===Q||void 0===Q?void 0:Q.length)>0?36:0,mainContainerHeader:Lr,mainContainerRef:$e,page:i,pipeline:On,setAfterHidden:k,setAfterWidthForChildren:_,setErrors:R?L:M,setMainContainerWidth:ct,children:[(0,C.jsx)("div",{style:{height:K?0:null,opacity:K?0:null,visibility:K?"hidden":null},children:(0,C.jsx)(f.Z,{uuid:"PipelineDetail/".concat(g),children:Rr})}),null===zn||void 0===zn?void 0:zn.map((function(e){return(0,C.jsx)("div",{style:{display:K===e?null:"none"},children:(0,C.jsx)(f.Z,{uuid:"FileEditor/".concat(decodeURIComponent(e)),children:(0,C.jsx)(ue.Z,{active:K===e,addNewBlock:function(e,n){$i(mo(mo({},e),{},{require_unique_name:!1}),yt.length,n,e.name),u.push("/pipelines/".concat(g,"/edit"))},fetchPipeline:xn,fetchVariables:ft,filePath:e,openSidekickView:Gn,pipeline:On,selectedFilePath:K,sendTerminalMessage:Pr,setDisableShortcuts:me,setErrors:M,setFilesTouched:re,setSelectedBlock:Wt})})},e)})),(0,C.jsx)(Z.Z,{pb:Wn?0:Math.max(Math.floor(m*(2/3)/P.iI),0)})]})]})}bo.getInitialProps=function(){var e=(0,i.Z)(u().mark((function e(n){var t,i,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,i=Ot.b7,r={page:i,pipeline:{uuid:t}},e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var go=(0,Et.Z)(bo)},37958:function(e,n,t){"use strict";t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},42305:function(e,n,t){"use strict";t.d(n,{A5:function(){return x},AY:function(){return j},BP:function(){return g},JX:function(){return b},OC:function(){return d},Pc:function(){return y},Ro:function(){return k},Tz:function(){return m},Y_:function(){return O},d$:function(){return v},jV:function(){return Z},lJ:function(){return P},n1:function(){return f},s8:function(){return a},vk:function(){return o},yD:function(){return s}});var i,r,o,l=t(82394),c=t(92083),u=t.n(c);!function(e){e.TODAY="today",e.WEEK="week",e.MONTH="month"}(o||(o={}));var a=(i={},(0,l.Z)(i,o.TODAY,"today"),(0,l.Z)(i,o.WEEK,"last 7 days"),(0,l.Z)(i,o.MONTH,"last 30 days"),i),s=(r={},(0,l.Z)(r,o.TODAY,0),(0,l.Z)(r,o.WEEK,6),(0,l.Z)(r,o.MONTH,29),r),d="YYYY-MM-DD HH:mm:ss",p="YYYY-MM-DD HH:mm",f="YYYY-MM-DD",h="MMMM D, YYYY";function v(e,n){var t=n.dayAgo,i=n.includeSeconds,r=n.utcFormat,o=u()(e),l=p;return r&&(o=o.utc()),t&&(o=o.subtract(1,"days")),i&&(l=d),o.format(l)}function m(e){var n=v((new Date).toISOString(),{includeSeconds:!0,utcFormat:!0});return null!==e&&void 0!==e&&e.dateObj?new Date(n):n}function b(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u().unix(e).format(null!==n&&void 0!==n&&n.withSeconds?d:p)}function g(e,n,t){return u()(e).utc().hours(+n).minutes(+t).format()}function x(e){return u()(e).unix()}function j(e,n,t,i){var r="".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t);return i?"".concat(r,":").concat(i):r}function y(e){var n=u().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function k(e,n){var t=u().utc(),i=u().utc();null!==n&&void 0!==n&&n.localTime&&(t=u()().local(),i=u()().local());var r=(t=t.subtract(e,"days")).format(h),o=i.format(h);return null!==n&&void 0!==n&&n.endDateOnly?o:"".concat(r," - ").concat(o)}function Z(e,n){var t=null!==n&&void 0!==n&&n.localTime?u()().local():u().utc();if(e===o.WEEK){var i=s[o.WEEK];t=t.subtract(i,"days")}else if(e===o.MONTH){var r=s[o.MONTH];t=t.subtract(r,"days")}return null!==n&&void 0!==n&&n.isoString?t.startOf("day").toISOString():t.startOf("day").format(d)}function O(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:90,n=new Date,t=[],i=0;i<e;i++)t.unshift(n.toISOString().split("T")[0]),n.setDate(n.getDate()-1);return t}function P(e){return e.padStart(2,"0")}},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(70111)}])}},function(e){e.O(0,[3662,844,9902,426,1774,8792,8789,4259,5896,7849,9055,2714,7011,5872,2991,1424,1005,7815,6422,8952,7722,4822,3391,1484,6299,437,9774,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|