mage-ai 0.8.5__py3-none-any.whl → 0.8.6__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/presenters/OutputPresenter.py +1 -0
- mage_ai/data_preparation/models/block/__init__.py +6 -1
- mage_ai/data_preparation/models/block/dbt/__init__.py +4 -0
- mage_ai/data_preparation/models/block/dbt/utils/__init__.py +53 -36
- mage_ai/data_preparation/models/block/utils.py +2 -1
- mage_ai/io/postgres.py +10 -5
- 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/{2249-84de2142241f4925.js → 2249-70929b8c547bbc18.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{4846-0096ccafbe28a868.js → 4846-58b7e138009c98a2.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{5944-9488f2ddf3543b08.js → 5944-757b7898608a65e1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{6641-fb7a8be8444f2dd4.js → 6641-a0ed2bd8f5dc777b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8961-7a2143c4424c9217.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{9140-836abb2721055e82.js → 9140-6f67e0879394373d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9898-51ca6a904b7a2382.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a1e8869ed201ce7e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-0678cf63c79072a7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-5ccc75887776efb0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-a6dbd67285ecc5a5.js → block-runs-8f23f7ca9efcb069.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-d2bbafbb5b2c09e7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-b0b91245d3299bdf.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{triggers-dbce4f85a95ea336.js → triggers-e0172c422c95eda9.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/{K0IzhmyaFuEHbzvE39__f → okm8eXXn0kUptL5A1B7a6}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage.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]/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/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +13 -13
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +3 -3
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/utils/output_display.py +7 -0
- mage_ai/server/websocket_server.py +2 -2
- mage_ai/services/datadog/__init__.py +123 -0
- mage_ai/tests/services/datadog/__init__.py +0 -0
- mage_ai/tests/services/datadog/test_datadog.py +69 -0
- {mage_ai-0.8.5.dist-info → mage_ai-0.8.6.dist-info}/METADATA +2 -1
- {mage_ai-0.8.5.dist-info → mage_ai-0.8.6.dist-info}/RECORD +62 -59
- mage_ai/server/frontend_dist/_next/static/chunks/8961-e25997bc088e0d19.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9898-91c6384c9bd33ca7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-688184bd8b4d4f5c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-3b2d760d97cec235.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-abce05c25bee218d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-a056c0e384d39c9b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-6a8545f96cc7b8f2.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{K0IzhmyaFuEHbzvE39__f → okm8eXXn0kUptL5A1B7a6}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist/_next/static/{K0IzhmyaFuEHbzvE39__f → okm8eXXn0kUptL5A1B7a6}/_ssgManifest.js +0 -0
- {mage_ai-0.8.5.dist-info → mage_ai-0.8.6.dist-info}/LICENSE +0 -0
- {mage_ai-0.8.5.dist-info → mage_ai-0.8.6.dist-info}/WHEEL +0 -0
- {mage_ai-0.8.5.dist-info → mage_ai-0.8.6.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.8.5.dist-info → mage_ai-0.8.6.dist-info}/top_level.txt +0 -0
mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-3b2d760d97cec235.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551],{7432:function(e,n,t){var i={"./Active4D.json":[266,266],"./All Hallows Eve.json":[4450,4450],"./Amy.json":[88849,8849],"./Birds of Paradise.json":[78097,8097],"./Blackboard.json":[88018,6115],"./Brilliance Black.json":[73835,3835],"./Brilliance Dull.json":[6507,6507],"./Chrome DevTools.json":[22508,2508],"./Clouds Midnight.json":[49566,9566],"./Clouds.json":[57951,7951],"./Cobalt.json":[80826,826],"./Cobalt2.json":[98256,8256],"./Dawn.json":[76958,6958],"./Dominion Day.json":[89307,9307],"./Dracula.json":[33453,3453],"./Dreamweaver.json":[19363,9363],"./Eiffel.json":[82481,2481],"./Espresso Libre.json":[44776,4776],"./GitHub Dark.json":[792,792],"./GitHub Light.json":[61450,1450],"./GitHub.json":[10739,739],"./IDLE.json":[67947,7947],"./Katzenmilch.json":[81240,1240],"./Kuroir Theme.json":[4388,4388],"./LAZY.json":[25164,5164],"./MagicWB (Amiga).json":[76443,6443],"./Merbivore Soft.json":[99361,9361],"./Merbivore.json":[86042,6042],"./Monokai Bright.json":[14883,4883],"./Monokai.json":[34454,4454],"./Night Owl.json":[60261,261],"./Nord.json":[59785,9785],"./Oceanic Next.json":[58920,8920],"./Pastels on Dark.json":[38901,8901],"./Slush and Poppies.json":[26434,6434],"./Solarized-dark.json":[36116,6116],"./Solarized-light.json":[5008,5008],"./SpaceCadet.json":[20440,440],"./Sunburst.json":[68018,8018],"./Textmate (Mac Classic).json":[15824,5824],"./Tomorrow-Night-Blue.json":[81150,1150],"./Tomorrow-Night-Bright.json":[8762,8762],"./Tomorrow-Night-Eighties.json":[82545,2545],"./Tomorrow-Night.json":[99855,9855],"./Tomorrow.json":[34092,4092],"./Twilight.json":[93898,3898],"./Upstream Sunburst.json":[98807,8807],"./Vibrant Ink.json":[89927,9927],"./Xcode_default.json":[64042,4042],"./Zenburnesque.json":[33467,3467],"./iPlastic.json":[88277,8277],"./idleFingers.json":[5104,5104],"./krTheme.json":[9633,9633],"./monoindustrial.json":[15729,5729],"./themelist.json":[79437,9437]};function r(e){if(!t.o(i,e))return Promise.resolve().then((function(){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}));var n=i[e],r=n[0];return t.e(n[1]).then((function(){return t.t(r,19)}))}r.keys=function(){return Object.keys(i)},r.id=7432,e.exports=r},5677:function(e,n,t){"use strict";t.d(n,{M4:function(){return d},S0:function(){return u},S_:function(){return a},Yn:function(){return f},rW:function(){return s}});var i=t(82394),r=t(21831),o=t(75582);function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function 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,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function a(e,n){return Object.entries(n).map((function(n){var t=(0,o.Z)(n,2),i=t[0],r=t[1];return e.languages.registerCompletionItemProvider(i,{provideCompletionItems:r(e)})}))}function u(e){var n=function(e){var n="[\\w.]+",t=["import ".concat(n," as ").concat(n),"import ".concat(n),"from ".concat(n," import ").concat(n," as ").concat(n),"from ".concat(n," import ").concat(n)],i=new RegExp("(".concat(t.join("|"),")"),"g");return(0,r.Z)(e.matchAll(i)).map((function(e){return e[1]}))}(e),t="[\\w.]+",o=["from ".concat(t," import ").concat(t," as (").concat(t,")"),"from ".concat(t," import (").concat(t,")"),"import ".concat(t," as (").concat(t,")"),"import (".concat(t,")")],l=new RegExp("(".concat(o.join("|"),")"));return n.reduce((function(e,n){var t=n.match(l);if(!t)return e;var o=(0,r.Z)(t),a=o[2],u=o[3],s=o[4],d=o[5],f=a||u||s||d;return c(c({},e),{},(0,i.Z)({},f,n))}),{})}function s(e,n){var t=e;n&&(t=t.split(" as ".concat(n))[0]);var i="[\\w.]+",l=["from ".concat(i," import (").concat(i,")"),"import (".concat(i,")")],c=new RegExp("(".concat(l.join("|"),")"),"g"),a=(0,r.Z)(t.matchAll(c))[0];if(a){var u=(0,o.Z)(a,4),s=u[2],d=u[3];return s||d}}function d(e,n){return function(e,n){return e.split("\n")[n.startLineNumber-1]}(e,n).slice(0,n.startColumn-1)}function f(e){var n=new RegExp("([\\w_]+)[ ]*=[ ]*([\\w_]+)","g");return(0,r.Z)(e.matchAll(n)).map((function(e){return{assignmentValue:e[2],variableName:e[1]}}))}},32365:function(e,n,t){"use strict";t.d(n,{Ep:function(){return r},KT:function(){return c},Nk:function(){return l},aU:function(){return o}});var i=t(9518),r=2,o=21,l=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-w2hta3-0"})([""]),c=i.default.div.withConfig({displayName:"indexstyle__PlaceholderStyle",componentId:"sc-w2hta3-1"})(["padding-left:67px;position:absolute;z-index:1;"])},57722:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var i=t(82684),r=t(85202),o=t(38789),l=t(19711),c=t(66166),a="twilight",u=t(2005),s=t(31012),d=t(32365),f=t(5677);var p=t(75582),h={"all-hallows-eve":"All Hallows Eve","birds-of-paradise":"Birds of Paradise","brilliance-black":"Brilliance Black","brilliance-dull":"Brilliance Dull","chrome-devtools":"Chrome DevTools","clouds-midnight":"Clouds Midnight","espresso-libre":"Espresso Libre","kuroir-theme":"Kuroir Theme","magicwb--amiga-":"MagicWB (Amiga)","merbivore-soft":"Merbivore Soft","monokai-bright":"Monokai Bright","night-owl":"Night Owl","oceanic-next":"Oceanic Next","pastels-on-dark":"Pastels on Dark","slush-and-poppies":"Slush and Poppies","solarized-dark":"Solarized-dark","solarized-light":"Solarized-light","textmate--mac-classic-":"Textmate (Mac Classic)","tomorrow-night":"Tomorrow-Night","tomorrow-night-blue":"Tomorrow-Night-Blue","tomorrow-night-bright":"Tomorrow-Night-Bright","tomorrow-night-eighties":"Tomorrow-Night-Eighties","upstream-sunburst":"Upstream Sunburst","vibrant-ink":"Vibrant Ink","xcode-default":"Xcode_default",active4d:"Active4D",amy:"Amy",blackboard:"Blackboard",clouds:"Clouds",cobalt:"Cobalt",dawn:"Dawn",dreamweaver:"Dreamweaver",eiffel:"Eiffel",github:"GitHub",idle:"IDLE",idlefingers:"idleFingers",iplastic:"iPlastic",katzenmilch:"Katzenmilch",krtheme:"krTheme",lazy:"LAZY",merbivore:"Merbivore",monoindustrial:"monoindustrial",monokai:"Monokai",spacecadet:"SpaceCadet",sunburst:"Sunburst",tomorrow:"Tomorrow",twilight:"Twilight",zenburnesque:"Zenburnesque"};var m=t(80636),v=t(28598);var g=function(e){var n=e.autocompleteProviders,g=e.autoHeight,b=e.autoSave,x=e.fontSize,j=void 0===x?s.i3:x,y=e.height,k=e.language,Z=e.onChange,_=e.onDidChangeCursorPosition,C=e.onSave,O=e.placeholder,w=e.selected,S=e.setSelected,E=e.setTextareaFocused,P=e.shortcuts,I=e.showLineNumbers,T=void 0===I||I,A=e.tabSize,R=void 0===A?4:A,D=e.textareaFocused,M=e.theme,N=e.value,B=e.width,L=void 0===B?"100%":B,F=(0,i.useRef)(null),H=(0,i.useRef)(null),U=(0,i.useRef)(null),z=(0,i.useState)([]),G=z[0],W=z[1],Q=(0,i.useState)(null),q=Q[0],Y=Q[1],V=(0,i.useState)(!1),K=V[0],X=V[1],J=(0,i.useState)(y),$=(J[0],J[1],(0,i.useState)(M||a)),ee=$[0],ne=$[1],te=(0,i.useCallback)((function(e){e.languages.typescript.javascriptDefaults.setEagerModelSync(!0),Y(e)}),[]),ie=(0,i.useCallback)((function(e,n){F.current=e,H.current=n;var t=[];null===P||void 0===P||P.forEach((function(i){t.push(i(n,e))})),C&&t.push((0,m.e)(n,(function(){C(e.getValue())}))),function(e,n,t){t.forEach((function(e){n.addAction(e)}))}(0,e,t),e.getModel().updateOptions({tabSize:R}),g&&!y&&(e._domElement.style.height="".concat(((N||"").split("\n").length+d.Ep)*d.aU,"px")),e.onDidFocusEditorWidget((function(){null===S||void 0===S||S(!0),null===E||void 0===E||E(!0)})),e.onDidContentSizeChange((function(n){var t=n.contentHeight,i=n.contentHeightChanged;g&&i&&(e._domElement.style.height="".concat(t+2*d.aU,"px"))})),w&&D&&setTimeout((function(){e.focus()}),1),_&&e.onDidChangeCursorPosition((function(n){var t=n.position.lineNumber,i=e._domElement.getBoundingClientRect(),r=i.height,o=i.top;_({editorRect:{height:Number(r),top:Number(o)},position:{lineNumber:Number(t)}})})),X(!0)}),[g,y,_,C,U.current,w,W,X,S,E,P,R,D,N]);(0,i.useEffect)((function(){(function(e){return new Promise((function(n){Promise.all([o._m.init(),t(7432)("./".concat(h[e],".json"))]).then((function(t){var i=(0,p.Z)(t,2),r=i[0],o=i[1];o.colors["editor.background"]="#000000",o.colors["editor.foreground"]="#FFFFFF",r.editor.defineTheme(e,o),n()}))}))})(a).then((function(){ne(a)}))}),[]),(0,i.useEffect)((function(){var e;return b&&C&&(e=setInterval((function(){C(F.current.getValue())}),5e3)),function(){b&&e&&clearInterval(e)}}),[b,F,C]);var re=(0,c.Z)(w),oe=(0,c.Z)(D);return(0,i.useEffect)((function(){null!==F&&void 0!==F&&F.current&&(w&&D?setTimeout((function(){F.current.focus()}),1):r.findDOMNode(F.current._domElement).getElementsByClassName("inputarea")[0].blur())}),[F,w,re,D,oe]),(0,i.useEffect)((function(){return function(){G.map((function(e){return e.dispose()}))}}),[G]),(0,i.useEffect)((function(){q&&n&&(0===G.length&&D||!oe&&D?W((0,f.S_)(q,n)):oe&&!D&&G.map((function(e){return e.dispose()})))}),[n,G,q,D,oe]),(0,v.jsxs)(d.Nk,{style:{display:K?null:"none"},children:[O&&!(null!==N&&void 0!==N&&N.length)&&(0,v.jsx)(d.KT,{children:(0,v.jsx)(l.ZP,{monospace:!0,muted:!0,children:O})}),(0,v.jsx)(o.ZP,{beforeMount:te,height:y,language:k||"python",onChange:function(e){null===Z||void 0===Z||Z(e)},onMount:ie,options:{fontFamily:u.Vp,fontLigatures:!0,fontSize:j,hideCursorInOverviewRuler:!0,lineNumbers:T,minimap:{enabled:!1},overviewRulerBorder:!1,renderLineHighlightOnlyWhenFocus:!0,scrollBeyondLastLine:!1,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"},wordBasedSuggestions:!1},theme:ee,value:N,width:L}),(0,v.jsx)("div",{ref:U})]})}},80636:function(e,n,t){"use strict";function i(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"saveCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],label:"Save",precondition:null,run:function(e){n()}}}function r(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"executeCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Enter],label:"Run selected block",precondition:null,run:function(){return n()}}}t.d(n,{Q:function(){return r},e:function(){return i}})},62976:function(e,n,t){"use strict";t.d(n,{Z:function(){return D}});var i=t(82394),r=t(21831),o=t(82684),l=t(10919),c=t(12691),a=t.n(c),u=t(34376),s=t.n(u),d=t(9518),f=t(63068),p=t(44628),h=t(6508),m=t(67971),v=t(19711),g=t(23831),b=t(31969),x=function(){var e=document.createElement("div");e.setAttribute("style","width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;"),document.body.appendChild(e);var n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),n},j=t(2005),y=t(31012),k=t(37391),Z=t(6753),_=t(49125),C=t(20567),O=t(24224),w=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 E(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}var P=2*_.iI+y.dN,I=20*_.iI,T=d.default.div.withConfig({displayName:"DataTable__Styles",componentId:"sc-1arr863-0"})([""," "," "," .body > div{","}.table{border-spacing:0;display:inline-block;"," "," "," "," .tr{.td.td-index-column{","}}.th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","}.th,.td{"," font-family:",";margin:0;","}.td{padding:","px;}&.sticky{overflow:auto;}.header{overflow:hidden;}}"],(function(e){return e.disableScrolling&&"\n overflow: hidden;\n "}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),k.w5,(function(e){return!e.noBorderBottom&&"\n border-bottom: 1px solid ".concat((e.theme.borders||b.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderLeft&&"\n border-left: 1px solid ".concat((e.theme.borders||b.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||b.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderTop&&"\n border-top: 1px solid ".concat((e.theme.borders||b.Z.borders).medium,";\n ")}),(function(e){return"\n color: ".concat((e.theme.content||b.Z.content).default,";\n ")}),(function(e){return"\n height: ".concat(e.columnHeaderHeight||P,"px;\n ")}),y.iD,j.ry,(function(e){return"\n background-color: ".concat((e.theme.background||b.Z.background).table,";\n border-bottom: 1px solid ").concat((e.theme.borders||b.Z.borders).medium,";\n border-right: 1px solid ").concat((e.theme.borders||b.Z.borders).medium,";\n ")}),1*_.iI);function A(e){var n=e.original,t=8.5*Math.max.apply(Math,(0,r.Z)(n.map((function(e){return(null===e||void 0===e?void 0:e.length)||0})))),i=Math.ceil(t/(I-2*_.iI));return Math.max(i,1)*y.dN+2*_.iI}function R(e){var n=e.columnHeaderHeight,t=e.columns,i=e.data,c=e.disableScrolling,u=e.height,k=e.index,S=e.invalidValues,T=e.maxHeight,R=e.numberOfIndexes,D=e.previewIndexes,M=e.renderColumnHeader,N=e.width,B=(0,o.useContext)(d.ThemeContext),L=(0,o.useRef)(null),F=(0,o.useRef)(null);(0,o.useEffect)((function(){var e=function(e){var n;null===L||void 0===L||null===(n=L.current)||void 0===n||n.scroll(e.target.scrollLeft,0)};return F&&F.current.addEventListener("scroll",e),function(){var n;null===F||void 0===F||null===(n=F.current)||void 0===n||n.removeEventListener("scroll",e)}}),[L,F]);var H=(0,o.useMemo)((function(){return k&&i&&k.length===i.length}),[i,k]),U=(0,o.useMemo)((function(){var e=[];return(0,O.w6)(R).forEach((function(n,t){var o=8.7*String(null===i||void 0===i?void 0:i.length).length;if(H){var l=k.map((function(e){return R>=2?String(e[t]).length:String(e).length}));o=8.7*Math.max.apply(Math,(0,r.Z)(l))}e.push(o+2*_.iI)})),e}),[i,k,R,H]),z=t.map((function(e){return null===e||void 0===e?void 0:e.Header})).slice(1),G=(0,o.useMemo)((function(){return x()}),[]),W=(0,o.useMemo)((function(){var e=N-(Math.max.apply(Math,(0,r.Z)(U))+1.5*_.iI+G),n=t.length-1,i=I;return i*n<e&&(i=e/n),{width:i}}),[t,U,G,N]),Q=(0,p.useTable)({columns:t,data:i,defaultColumn:W},p.useBlockLayout,h.useSticky),q=Q.getTableBodyProps,Y=Q.getTableProps,V=Q.headerGroups,K=Q.prepareRow,X=Q.rows,J=s().query.slug,$=void 0===J?[]:J,ee=new Set((null===D||void 0===D?void 0:D.removedRows)||[]),ne=(0,o.useCallback)((function(e){var n=e.index,t=e.style,i=X[n];K(i);var r=i.original,c=ee.has(n);return(0,w.jsx)("div",E(E({},i.getRowProps({style:E(E({},t),{},{width:"auto"})})),{},{className:"tr",children:i.cells.map((function(e,t){var i,u=t<=R-1,s=e.getCellProps(),d=e.column.id,f=null===S||void 0===S||null===(i=S[d])||void 0===i?void 0:i.includes(n),p=E({},s.style);u&&(p.fontFamily=j.Vp,p.left=0,p.position="sticky",p.textAlign=k?"right":"center",p.width=U[t]);var h,g=r[t-R],x=z.indexOf(d);if(f&&(p.color=b.Z.interactive.dangerBorder),c&&(p.backgroundColor=b.Z.background.danger),Array.isArray(g)||"object"===typeof g)try{g=JSON.stringify(g)}catch(y){g="Error: cannot display value"}return u&&(H?(h=k[n],Array.isArray(h)&&(h=h[t])):h=e.render("Cell")),(0,o.createElement)("div",E(E({},s),{},{className:"td ".concat(u?"td-index-column":""),key:"".concat(t,"-").concat(g),style:p}),h,!u&&(0,w.jsxs)(m.Z,{justifyContent:"space-between",children:[(0,w.jsxs)(v.ZP,{danger:f,default:!0,wordBreak:!0,children:[!0===g&&"true",!1===g&&"false",(null===g||"null"===g)&&"null",!0!==g&&!1!==g&&null!==g&&"null"!==g&&g]}),f&&(0,w.jsx)(a(),{as:(0,C.o_)(Z.mW,x),href:"/datasets/[...slug]",passHref:!0,children:(0,w.jsx)(l.Z,{danger:!0,children:"View all"})})]}))}))}))}),[k,S,U,R,K,X,$]),te=(0,o.useMemo)((function(){var e;return T?(e=(0,O.Sm)(X.map(A)),e+=n||P-y.dN):(e=u,e-=n||P),e}),[n,A,u,T,X]),ie=(0,o.useMemo)((function(){return(0,w.jsx)(f.S_,{estimatedItemSize:P,height:te,itemCount:null===X||void 0===X?void 0:X.length,itemSize:function(e){return A(X[e])},outerRef:F,style:{maxHeight:T,pointerEvents:c?"none":null},children:ne})}),[te,F,ne,X]);return(0,w.jsx)("div",E(E({},Y()),{},{className:"table sticky",style:{width:N},children:(0,w.jsxs)("div",E(E({},q()),{},{className:"body",children:[(0,w.jsx)("div",{className:"header",ref:L,children:V.map((function(e,n){return(0,o.createElement)("div",E(E({},e.getHeaderGroupProps()),{},{className:"tr",key:"".concat(e.id,"_").concat(n)}),e.headers.map((function(e,n){var t,i=n<=R-1,r=e.getHeaderProps(),l=E({},r.style);return i?(l.fontFamily=j.Vp,l.left=0,l.position="sticky",l.textAlign="center",l.width=U[n],l.minWidth=U[n]):M?t=M(e,n-R,{width:W.width}):(t=e.render("Header"),l.color=(B||g.Z).content.default,l.padding=1*_.iI,l.minWidth=W.width),(0,o.createElement)("div",E(E({},r),{},{className:"th",key:e.id,style:l,title:i?"Row number":void 0}),t)})))}))}),ie]}))}))}var D=function(e){var n=e.columnHeaderHeight,t=e.columns,r=e.disableScrolling,l=e.height,c=e.index,a=e.invalidValues,u=e.maxHeight,s=e.noBorderBottom,d=e.noBorderLeft,f=e.noBorderRight,p=e.noBorderTop,h=e.previewIndexes,m=e.renderColumnHeader,v=e.rows,g=e.width,b=(0,o.useMemo)((function(){return null!==c&&void 0!==c&&c.length&&Array.isArray(c[0])?c[0].length:1}),[c]),x=(0,o.useMemo)((function(){return(0,O.w6)(b).map((function(e,n){return{Header:(0,O.w6)(n+1).map((function(){return" "})).join(" "),accessor:function(e,n){return n},sticky:"left"}})).concat(null===t||void 0===t?void 0:t.map((function(e){return{Header:String(e),accessor:String(e)}})))}),[t,b]);return(0,o.useMemo)((function(){return null===v||void 0===v?void 0:v.map((function(e){return e.reduce((function(e,n,r){return E(E({},e),{},(0,i.Z)({},t[r],n))}),{})}))}),[t,v]),(0,w.jsx)(T,{columnHeaderHeight:n,disableScrolling:r,height:l,maxHeight:(u||0)+37,noBorderBottom:s,noBorderLeft:d,noBorderRight:f,noBorderTop:p,children:(0,w.jsx)(R,{columnHeaderHeight:n,columns:x,data:v,disableScrolling:r,height:l,index:c,invalidValues:a,maxHeight:u,numberOfIndexes:b,previewIndexes:h,renderColumnHeader:m,width:g})})}},55106:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var i=t(82394),r=t(75582),o=t(82684),l=t(83455),c=t(9518),a=t(77011),u=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}var f=c.default.div.withConfig({displayName:"MultiFileInput__DropzoneStyle",componentId:"sc-1l6yd2y-0"})(["&:hover{cursor:pointer;}"]);var p=function(e){var n=e.children,t=e.inputOnChange,i=e.inputProps,r=e.onDragActiveChange,l=e.setFiles,c=(0,o.useCallback)((function(e){l(e)}),[l]),s=(0,a.uI)({onDrop:c}),p=s.getInputProps,h=s.getRootProps,m=s.isDragActive,v=p(),g=v.accept,b=v.autoComplete,x=v.multiple,j=v.onChange,y=v.onClick,k=v.ref,Z=v.style,_=v.tabIndex,C=v.type,O=d(d({},i),{},{accept:g,autoComplete:b,multiple:x,onChange:function(e){null===t||void 0===t||t(e),null===i||void 0===i||i.onChange(e),j(e)},onClick:y,ref:k,style:Z,tabIndex:_,type:C});return(0,o.useEffect)((function(){null===r||void 0===r||r(m)}),[m,r]),(0,u.jsxs)(f,d(d({},h()),{},{children:[(0,u.jsx)("input",d(d({},O),{},{directory:"",webkitdirectory:""})),n]}))},h=t(82531);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 v(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 g=function(e){var n=e.children,t=e.directoryPath,c=e.onDragActiveChange,a=e.setFileUploadProgress,s=e.setUploadedFiles,d=(0,l.Db)(h.ZP.files.useCreate({onUploadProgress:function(e,n){var t,r=n.body,o="".concat(null===r||void 0===r?void 0:r.dir_path,"/").concat(null===r||void 0===r||null===(t=r.file)||void 0===t?void 0:t.name);null===a||void 0===a||a((function(n){return v(v({},n),{},(0,i.Z)({},o,e.loaded/e.total))}))}})),f=(0,r.Z)(d,1)[0],m=(0,o.useCallback)((function(e){e.forEach((function(e){var n=e.name,r=e.path.split("/").filter((function(e){return e&&e!==n})).join("/"),o="".concat(t,"/").concat(r),l="".concat(o,"/").concat(n);f({dir_path:o,file:e,overwrite:!1}).then((function(e){var n=e.data,t=n.error,r=n.file;s((function(e){return v(v({},e),{},(0,i.Z)({},l,r||t))}))})),a((function(e){return v(v({},e),{},(0,i.Z)({},l,0))}))}))}),[f,t,a,s]);return(0,u.jsx)(p,{onDragActiveChange:c,setFiles:m,children:n})}},85307:function(e,n,t){"use strict";t.d(n,{$W:function(){return u},cl:function(){return s},cv:function(){return d},dE:function(){return a}});var i=t(9518),r=t(23831),o=t(73942),l=t(49125),c=t(37391),a=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 ")})),u=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 ")}))},64155:function(e,n,t){"use strict";t.d(n,{Eh:function(){return a},ht:function(){return s},t0:function(){return u}});var i=t(9518),r=t(82386),o=t(1286),l=t(31012),c=t(49125),a=(c.iI,o.O$+3*c.iI+l.dN),u=i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-15ofupc-0"})(["position:relative;width:fit-content;"," ",""],(function(e){return"\n height: calc(100vh - ".concat(r.uX,"px - ").concat(e.heightOffset,"px);\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),s=i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-15ofupc-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}))},33699:function(e,n,t){"use strict";t.d(n,{y:function(){return R},Z:function(){return D}});var i=t(89565),r=t.n(i),o=t(56085),l=t(82684),c=t(35490),a=t(47999),u=t(67971),s=t(82635),d=t(86673),f=t(54283),p=t(19711),h=t(9518),m=t(23831),v=t(49125),g=t(37391),b=(0,h.css)([""," ",""],(function(e){return!e.width&&"\n width: 100%;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),x=h.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-11d4rgl-0"})([""," "," height:100%;overflow:auto;position:absolute;",""],b,g.w5,(function(e){return"\n background-color: ".concat((e.theme.background||m.Z.background).codeTextarea,";\n ")})),j=h.default.div.withConfig({displayName:"indexstyle__InnerStyle",componentId:"sc-11d4rgl-1"})([""," padding:","px;"],b,v.cd*v.iI),y=h.default.div.withConfig({displayName:"indexstyle__LineStyle",componentId:"sc-11d4rgl-2"})(["height:","px;"],20),k=(0,h.css)(["@keyframes cursor-blink{0%{opacity:0;}}::before{","}::after{","}"],(function(e){return e.focusBeginning&&"\n position: absolute;\n background-color: ".concat((e.theme.accent||m.Z.accent).warning,';\n content: "";\n display: inline-block;\n height: ').concat(20,"px;\n width: ").concat(v.iI,"px;\n opacity: 0.3;\n ")}),(function(e){return e.focused&&"\n background-color: ".concat((e.theme.accent||m.Z.accent).warning,';\n content: "";\n display: inline-block;\n height: ').concat(20,"px;\n width: ").concat(v.iI,"px;\n opacity: 0.3;\n ")})),Z=h.default.div.withConfig({displayName:"indexstyle__InputStyle",componentId:"sc-11d4rgl-3"})(["align-items:center;display:flex;gap:2px;",""],k),_=h.default.span.withConfig({displayName:"indexstyle__CharacterStyle",componentId:"sc-11d4rgl-4"})([""," ::after{","}"],k,(function(e){return e.focused&&"\n position: absolute;\n "})),C=t(16115),O=t(94353),w=t(28799),S=t(51504),E=t(66653),P=t(41150),I=t(28598);function T(e,n){var t="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"===typeof e)return A(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,n)}(e))||n&&e&&"number"===typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,c=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){c=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(c)throw o}}}}function A(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}var R="terminal";var D=function(e){var n=e.interruptKernel,t=e.onFocus,i=e.uuid,h=void 0===i?R:i,m=e.width,v=(0,l.useRef)(null),g=(0,l.useRef)(null),b=(0,l.useState)(!1),k=b[0],A=b[1],D=(0,l.useState)(""),M=D[0],N=D[1],B=(0,l.useState)(0),L=B[0],F=B[1],H=(0,l.useState)(0),U=H[0],z=H[1],G=(0,l.useState)([]),W=G[0],Q=G[1],q=(0,l.useState)(!1),Y=q[0],V=q[1],K=(0,l.useState)([]),X=K[0],J=K[1],$=(0,o.ZP)((0,w.Ib)(),{shouldReconnect:function(){return!0}}),ee=$.lastMessage,ne=($.readyState,$.sendMessage);(0,l.useEffect)((function(){if(ee){var e=null!==ee&&void 0!==ee&&ee.data?JSON.parse(ee.data):null;(null===e||void 0===e?void 0:e.uuid)===h&&(s.uF.BUSY===(null===e||void 0===e?void 0:e.execution_state)?A(!0):s.uF.IDLE===(null===e||void 0===e?void 0:e.execution_state)&&A(!1),J((function(n){return e?n.concat(e):n})))}}),[ee,A,J,h]),(0,l.useEffect)((function(){if(v.current&&g.current){var e=g.current.getBoundingClientRect().height;v.current.scrollTo(0,e)}}),[X,v,g]);var te=(0,P.y)(),ie=te.registerOnKeyDown,re=te.setDisableGlobalKeyboardShortcuts,oe=te.unregisterOnKeyDown;(0,l.useEffect)((function(){return function(){oe(h)}}),[oe,h]);var le=(0,l.useCallback)((function(){z((function(e){return e>0?e-1:e}))}),[]),ce=(0,l.useCallback)((function(){z((function(e){return e<=M.length?e+1:e}))}),[M]);return ie(h,(function(e,t,i){var r=e.code,o=e.key;if(Y)if((0,E.j)(e),(0,S.y)([C.PQ,C.VS],t))A(!1),J((function(e){var n;return e.concat({command:!0,data:(null===M||void 0===M||null===(n=M.trim())||void 0===n?void 0:n.length)>=1?M:"\n",type:s.Gi.TEXT})})),N(""),n();else if(!k)if(C.Qj!==r||t[C.zX])if((0,S.y)([C.QK],t))le();else if((0,S.y)([C.DY],t))ce();else if((0,S.y)([C.Bu],t)){if(W.length>=1){var l=Math.max(0,L-1);N(W[l]),F(l),z(W[l].length)}}else if((0,S.y)([C.kD],t)){if(W.length>=1){var a=Math.min(W.length,L+1),u=W[a]||"";N(u),F(a),z(u.length)}}else if((0,S.y)([C.Uq],t))(null===M||void 0===M?void 0:M.length)>=1&&(A(!0),ne(JSON.stringify({api_key:O.l,code:"!".concat(M),token:(new c.Z).decodedToken.token,uuid:h})),F(W.length+1),Q((function(e){return e.concat(M)})),z(0)),J((function(e){var n;return e.concat({command:!0,data:(null===M||void 0===M||null===(n=M.trim())||void 0===n?void 0:n.length)>=1?M:"\n",type:s.Gi.TEXT})})),N("");else if((0,S.y)([C.zX,C.VS],t))navigator.clipboard.writeText(window.getSelection().toString());else if((0,S.y)([C.zX,C.Pd],t)||(0,S.y)([C.PQ,C.Pd],t)){var d,f,p;"undefined"===typeof(null===(d=navigator)||void 0===d?void 0:d.clipboard)?alert('Clipboard pasting is not allowed in insecure contexts. If your Mage deployment is not secure but you still want to use clipboard paste, you can override this setting (which should only be done temporarily) on Chrome browsers by going to "chrome://flags/#unsafely-treat-insecure-origin-as-secure", adding your origin to "Insecure origins treated as secure", and enabling that setting.'):null!==(f=navigator)&&void 0!==f&&null!==(p=f.clipboard)&&void 0!==p&&p.readText?navigator.clipboard.readText().then((function(e){N((function(n){return n+e})),z(M.length+e.length)})).catch((function(e){return alert("".concat(e,'\n For Chrome, users need to allow clipboard permissions for this site under "Privacy and security" -> "Site settings".\n For Safari, users need to allow the clipboard paste by clicking "Paste" in the context menu that appears.'))})):navigator.clipboard.read().then((function(e){var n,t=T(e);try{for(t.s();!(n=t.n()).done;){var i,r=n.value,o=T(r.types);try{for(o.s();!(i=o.n()).done;){var l=i.value;if("text/plain"===l)return r.getType(l)}}catch(c){o.e(c)}finally{o.f()}}}catch(c){t.e(c)}finally{t.f()}})).then((function(e){return e.text()})).then((function(e){N((function(n){return n+e})),z(M.length+e.length)})).catch((function(e){return alert("".concat(e,'\n For Firefox, users need to allow clipboard paste by setting the "dom.events.asyncClipboard.read" preference in "about:config" to "true" and clicking "Paste" in the context menu that appears.'))}))}else t[C.zX]||t[C.PQ]||1!==o.length||(N((function(e){return e.slice(0,U)+o+e.slice(U)})),ce());else{var m=Math.max(0,U-1);N((function(e){return e.slice(0,m)+e.slice(U)})),z((function(e){return Math.max(0,e-1)}))}}),[k,M,W,L,Y,n,A,N,Q,F,J,h]),(0,I.jsx)(x,{ref:v,width:m,children:(0,I.jsx)(a.Z,{isOpen:!0,onClick:function(){null===t||void 0===t||t(),V(!0),re(!0)},onClickOutside:function(){V(!1),re(!1)},style:{minHeight:"100%"},children:(0,I.jsxs)(j,{ref:g,width:m,children:[null===X||void 0===X?void 0:X.reduce((function(e,n,t){var i=n||{},o=i.command,l=i.data,c=i.type,a=[];a=(a=Array.isArray(l)?l:[l]).filter((function(e){return e}));var d=[];return a.forEach((function(e,n){var i;if(s.jU.includes(c)&&(i=(0,I.jsxs)(p.ZP,{monospace:!0,noWrapping:!0,pre:!0,children:[e&&(0,I.jsx)(r(),{children:e}),!e&&(0,I.jsx)(I.Fragment,{children:"\xa0"})]})),i){var l="command-".concat(t,"-").concat(n,"-").concat(e);o?d.push((0,I.jsx)(y,{children:(0,I.jsxs)(u.Z,{alignItems:"center",children:[(0,I.jsx)(p.ZP,{inline:!0,monospace:!0,warning:!0,children:"\u2192\xa0"}),i]})},l)):d.push((0,I.jsx)(y,{children:i},l))}})),e.concat(d)}),[]),k&&(0,I.jsx)(d.Z,{mt:1,children:(0,I.jsx)(f.Z,{})}),!k&&(0,I.jsx)(Z,{focused:Y&&(0===M.length||U>M.length),children:(0,I.jsxs)(p.ZP,{monospace:!0,children:[(0,I.jsx)(p.ZP,{inline:!0,monospace:!0,warning:!0,children:"\u2192\xa0"}),null===M||void 0===M?void 0:M.split("").map((function(e,n){return(0,I.jsxs)(_,{focusBeginning:Y&&0===U&&0===n,focused:Y&&U===n+1,children:[" "===e&&(0,I.jsx)(I.Fragment,{children:"\xa0"})," "!==e&&e]},"command-".concat(n,"-").concat(e))}))]})})]})})})}},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 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 u(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.style,s=void 0===a?{}:a,d=(0,r.Z)(e,c),f=u({},s);return i&&(f.paddingLeft=i,f.paddingRight=f.paddingLeft),t&&(f.height="100%"),(0,l.jsx)(o.Col,u(u({},d),{},{style:f,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),a=["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 s(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,d=void 0===u?{}:u,f=(0,r.Z)(e,a),p=s({},d);return i&&(p.marginLeft=-1*i,p.marginRight=p.marginLeft),t&&(p.height="100%"),(0,c.jsx)(l.Row,s(s({},f),{},{style:p,children:o.Children.map(n,(function(e,n){return e&&o.cloneElement(e,{gutter:i,key:n})}))}))}},82635:function(e,n,t){"use strict";var i,r;t.d(n,{Gi:function(){return r},jU:function(){return l},uF:function(){return i}}),function(e){e.BUSY="busy",e.IDLE="idle",e.QUEUED="queued"}(i||(i={})),function(e){e.IMAGE_PNG="image/png",e.PROGRESS="progress",e.TABLE="table",e.TEXT="text",e.TEXT_HTML="text/html",e.TEXT_PLAIN="text/plain"}(r||(r={}));var o,l=[r.TEXT,r.TEXT_PLAIN];!function(e){e.DISPLAY_DATA="display_data",e.STATUS="status",e.STREAM="stream",e.STREAM_PIPELINE="stream_pipeline"}(o||(o={}))},93348:function(e,n,t){"use strict";t.d(n,{TR:function(){return d},U5:function(){return a},Xm:function(){return o},Z4:function(){return s},fq:function(){return c},kJ:function(){return u}});var i,r,o,l=t(82394);!function(e){e.API="api",e.EVENT="event",e.TIME="time"}(o||(o={}));var c,a,u,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"}(a||(a={})),function(e){e.CREATED_AT="created_at",e.NAME="name",e.PIPELINE="pipeline_uuid",e.STATUS="status",e.TYPE="schedule_type"}(u||(u={}));var d=(r={},(0,l.Z)(r,u.CREATED_AT,"Created at"),(0,l.Z)(r,u.NAME,"Name"),(0,l.Z)(r,u.PIPELINE,"Pipeline"),(0,l.Z)(r,u.STATUS,"Status"),(0,l.Z)(r,u.TYPE,"Type"),r)},30264:function(e,n,t){"use strict";var i=t(82394),r=t(26304),o=(t(82684),t(47999)),l=t(62084),c=t(28598),a=["children","items","open","onClickCallback","onClickOutside","parentRef","uuid"];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 s(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.items,i=e.open,u=e.onClickCallback,d=e.onClickOutside,f=e.parentRef,p=e.uuid,h=(0,r.Z)(e,a),m=(0,c.jsxs)("div",{style:{position:"relative",zIndex:d?3:2},children:[(0,c.jsx)("div",{ref:f,children:n}),(0,c.jsx)(l.Z,s(s({},h),{},{items:t,onClickCallback:u,open:i,parentRef:f,uuid:p}))]});return d?(0,c.jsx)(o.Z,{onClickOutside:d,open:!0,children:m}):m}},29237:function(e,n,t){"use strict";var i=t(9518),r=t(67971),o=t(86673),l=t(19711),c=t(31969),a=t(73942),u=t(37391),s=t(49125),d=t(28598),f=1.75,p=(0,i.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],f*s.iI,1.5*s.iI,1.5*s.iI),h=i.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," "," "," ",""],a.n_,(function(e){return"\n background-color: ".concat((e.theme.background||c.Z.background).panel,";\n border: 1px solid ").concat((e.theme.interactive||c.Z.interactive).defaultBorder,";\n ")}),(function(e){return!e.fullHeight&&"\n height: fit-content;\n "}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")}),(function(e){return e.minWidth&&"\n min-width: ".concat(e.minWidth,"px;\n\n @media (max-width: ").concat(e.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(e){return e.borderless&&"\n border: none;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),m=i.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," ",""],a.n_,a.n_,(function(e){return"\n background-color: ".concat((e.theme.background||c.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||c.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),p),v=i.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],f*s.iI,u.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: calc(".concat(e.maxHeight," - ").concat(15*s.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),g=i.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],a.M8,a.YF,f*s.iI);n.Z=function(e){var n=e.borderless,t=e.children,i=e.containerRef,c=e.contentContainerRef,a=e.footer,u=e.fullHeight,s=void 0===u||u,f=e.header,p=e.headerHeight,b=e.headerIcon,x=e.headerTitle,j=e.maxHeight,y=e.noPadding,k=e.overflowVisible,Z=e.subtitle,_=e.minWidth;return(0,d.jsxs)(h,{borderless:n,fullHeight:s,maxHeight:j,minWidth:_,overflowVisible:k,ref:i,children:[(f||x)&&(0,d.jsxs)(m,{height:p,children:[f&&f,x&&(0,d.jsx)(r.Z,{alignItems:"center",justifyContent:"space-between",children:(0,d.jsxs)(r.Z,{alignItems:"center",children:[b&&b,(0,d.jsx)(o.Z,{ml:b?1:0,children:(0,d.jsx)(l.ZP,{bold:!0,default:!0,children:x})})]})})]}),(0,d.jsxs)(v,{maxHeight:j,noPadding:y,overflowVisible:k,ref:c,children:[Z&&(0,d.jsx)(o.Z,{mb:2,children:(0,d.jsx)(l.ZP,{default:!0,children:Z})}),t]}),a&&(0,d.jsx)(g,{children:a})]})}},32316:function(e,n,t){"use strict";t.d(n,{Z:function(){return h}});var i=t(82684),r=t(60328),o=t(67971),l=t(882),c=t(86673),a=t(99994),u=t(9518),s=t(49125),d=t(37391),f=u.default.div.withConfig({displayName:"indexstyle__TabsContainerStyle",componentId:"sc-segf7l-0"})(["padding-left:","px;padding-right:","px;"," "," ",""],s.cd*s.iI,s.cd*s.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.allowScroll&&"\n overflow: auto;\n "}),d.w5),p=t(28598);var h=function(e){var n=e.allowScroll,t=e.contained,u=e.noPadding,d=e.onClickTab,h=e.selectedTabUUID,m=e.tabs,v=(0,i.useMemo)((function(){var e=m.length,n=[];return m.forEach((function(t,i){var u=t.Icon,f=t.IconSelected,m=t.label,v=t.uuid,g=v===h,b=g&&f||u,x=m?m():v,j=(0,p.jsxs)(o.Z,{alignItems:"center",children:[b&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(b,{default:!g,size:2*s.iI}),(0,p.jsx)(c.Z,{mr:1})]}),x]});i>=1&&e>=2&&n.push((0,p.jsx)("div",{style:{marginLeft:1.5*s.iI}},"spacing-".concat(v))),g?n.push((0,p.jsx)(l.Z,{backgroundGradient:a.yr,backgroundPanel:!0,borderLess:!0,borderWidth:2,onClick:function(){return d(t)},paddingUnitsHorizontal:2,paddingUnitsVertical:1.25,children:j},v)):n.push((0,p.jsx)("div",{style:{padding:4},children:(0,p.jsx)(r.Z,{borderLess:!0,default:!0,onClick:function(){return d(t)},outline:!0,children:j},"button-tab-".concat(v))}))})),n}),[d,h,m]),g=(0,p.jsx)(o.Z,{alignItems:"center",children:v});return t?g:(0,p.jsx)(f,{allowScroll:n,noPadding:u,children:g})}},82944:function(e,n,t){"use strict";var i=t(82394),r=t(91835),o=t(82684),l=t(9518),c=t(69898),a=t(28598);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 s(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}var d=l.default.input.withConfig({displayName:"TextInput__TextInputStyle",componentId:"sc-1ii4qtc-0"})(["",""],c.p),f=function(e,n){var t=(0,r.Z)({},e);return(0,a.jsx)(c.Z,s(s({},t),{},{input:(0,a.jsx)(d,s({},t)),ref:n}))};n.Z=o.forwardRef(f)},46714:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return wc}});var i,r=t(77837),o=t(21831),l=t(75582),c=t(82394),a=t(38860),u=t.n(a),s=t(56085),d=t(82684),f=t(83455),p=t(34376),h=t(86422),m=t(62084),v="buckets",g="chart_style",b="group_by",x="height",j="index",y="legend_labels",k="limit",Z="metrics",_="time_interval",C="width_percentage",O="x",w="y",S="y_sort_order",E="data_provider",P="data_provider_database",I="data_provider_profile",T="data_provider_schema",A="data_provider_table",R="dbt_project_name",D="dbt_profile_target",M="export_write_policy",N="limit",B="use_raw_sql",L=[O,w];!function(e){e.BAR_CHART="bar chart",e.HISTOGRAM="histogram",e.LINE_CHART="line chart",e.PIE_CHART="pie chart",e.TABLE="table",e.TIME_SERIES_BAR_CHART="time series bar chart",e.TIME_SERIES_LINE_CHART="time series line chart"}(i||(i={}));var F,H,U=[i.BAR_CHART,i.HISTOGRAM,i.LINE_CHART,i.PIE_CHART,i.TABLE,i.TIME_SERIES_BAR_CHART,i.TIME_SERIES_LINE_CHART];!function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(F||(F={})),function(e){e.AVERAGE="average",e.COUNT="count",e.COUNT_DISTINCT="count_distinct",e.MAX="max",e.MEDIAN="median",e.MIN="min",e.MODE="mode",e.SUM="sum"}(H||(H={}));var z,G,W,Q,q,Y,V,K,X,J=[H.AVERAGE,H.COUNT,H.COUNT_DISTINCT,H.MAX,H.MEDIAN,H.MIN,H.MODE,H.SUM];!function(e){e.ASCENDING="ascending",e.DESCENDING="descending"}(z||(z={})),function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.MONTH="month",e.ORIGINAL="original",e.SECOND="second",e.WEEK="week",e.YEAR="year"}(G||(G={})),function(e){e.COLUMNS="columns",e.METRICS="metrics",e.NUMBER="number"}(X||(X={}));var $={noCode:[{label:function(){return"time column"},settings:{maxValues:1},type:X.COLUMNS,uuid:b},{label:function(){return"time interval"},options:[G.ORIGINAL,G.SECOND,G.MINUTE,G.HOUR,G.DAY,G.WEEK,G.MONTH,G.YEAR],uuid:_},{label:function(){return"metrics"},type:X.METRICS,uuid:Z}]},ee=(W={},(0,c.Z)(W,i.BAR_CHART,{noCode:[{label:function(){return"group by columns"},type:X.COLUMNS,uuid:b},{label:function(){return"metrics"},type:X.METRICS,uuid:Z},{autoRun:!0,label:function(){return"chart style"},options:[F.HORIZONTAL,F.VERTICAL],uuid:g},{autoRun:!0,label:function(){return"sort direction"},options:[null,z.ASCENDING,z.DESCENDING],uuid:S}],code:[{label:function(){return"variable name of x-axis values"},monospace:!0,uuid:O},{label:function(){return"variable name of y-axis values"},monospace:!0,uuid:w}]}),(0,c.Z)(W,i.HISTOGRAM,{noCode:[{label:function(){return"number column for chart"},settings:{maxValues:1},type:X.COLUMNS,uuid:b},{autoRun:!0,label:function(){return"Number of buckets"},type:X.NUMBER,uuid:v}],code:[{label:function(){return"variable name of values"},monospace:!0,uuid:O}]}),(0,c.Z)(W,i.LINE_CHART,{noCode:[{label:function(){return"group by columns"},settings:{maxValues:1},type:X.COLUMNS,uuid:b},{label:function(){return"metrics"},type:X.METRICS,uuid:Z}],code:[{label:function(){return"variable name of x-axis values"},monospace:!0,uuid:O},{label:function(){return"variable name of y-axis values"},monospace:!0,uuid:w},{label:function(){return"labels of lines in chart (comma separated)"},uuid:y}]}),(0,c.Z)(W,i.PIE_CHART,{noCode:[{label:function(){return"column for chart"},settings:{maxValues:1},type:X.COLUMNS,uuid:b},{autoRun:!0,label:function(){return"Number of slices"},type:X.NUMBER,uuid:v}],code:[{label:function(){return"variable name of values"},monospace:!0,uuid:O}]}),(0,c.Z)(W,i.TABLE,{noCode:[{label:function(){return"columns"},type:X.COLUMNS,uuid:b},{label:function(){return"max number of rows"},type:X.NUMBER,uuid:k}],code:[{label:function(){return"variable name of columns"},monospace:!0,uuid:O},{label:function(){return"variable name of rows"},monospace:!0,uuid:w}]}),(0,c.Z)(W,i.TIME_SERIES_BAR_CHART,$),(0,c.Z)(W,i.TIME_SERIES_LINE_CHART,$),W),ne=(Q={},(0,c.Z)(Q,i.BAR_CHART,{configuration:function(e){var n;return n={},(0,c.Z)(n,O,"x"),(0,c.Z)(n,w,"y"),(0,c.Z)(n,g,F.VERTICAL),n},content:function(e){return"columns = df_1.columns\nx = df_1.columns[:7]\ny = [[v] for v in [len(df_1[col].unique()) for col in x]]\n"}}),(0,c.Z)(Q,i.HISTOGRAM,{configuration:function(e){var n;return n={},(0,c.Z)(n,v,10),(0,c.Z)(n,O,"x"),n},content:function(e){return"columns = df_1.columns\ncol = list(filter(lambda x: df_1[x].dtype == float or df_1[x].dtype == int, columns))[0]\nx = df_1[col]\n"}}),(0,c.Z)(Q,i.LINE_CHART,{configuration:function(e){var n;return n={},(0,c.Z)(n,O,"x"),(0,c.Z)(n,w,"y"),n},content:function(e){return"columns = df_1.columns\ncols = list(filter(lambda x: df_1[x].dtype == float or df_1[x].dtype == int, columns))\nx = df_1[cols[0]]\ny = [df_1[cols[1]]]\n"}}),(0,c.Z)(Q,i.PIE_CHART,{configuration:function(e){var n;return n={},(0,c.Z)(n,v,7),(0,c.Z)(n,O,"x"),n},content:function(e){return"x = df_1[df_1.columns[0]]"}}),(0,c.Z)(Q,i.TABLE,{configuration:function(e){var n;return n={},(0,c.Z)(n,k,10),(0,c.Z)(n,O,"x"),(0,c.Z)(n,w,"y"),n},content:function(e){return"x = df_1.columns\ny = df_1.to_numpy()"}}),(0,c.Z)(Q,i.TIME_SERIES_BAR_CHART,{configuration:function(e){return(0,c.Z)({},_,G.ORIGINAL)}}),(0,c.Z)(Q,i.TIME_SERIES_LINE_CHART,{configuration:function(e){return(0,c.Z)({},_,G.ORIGINAL)}}),Q),te=(K={},(0,c.Z)(K,i.BAR_CHART,(q={},(0,c.Z)(q,O,(function(){return"must be a list of booleans, dates, integers, floats, or strings."})),(0,c.Z)(q,w,(function(){return"must be a list of lists containing integers or floats."})),q)),(0,c.Z)(K,i.HISTOGRAM,(0,c.Z)({},O,(function(){return"must be a list of integers or floats."}))),(0,c.Z)(K,i.LINE_CHART,(Y={},(0,c.Z)(Y,O,(function(){return"must be a list of integers or floats."})),(0,c.Z)(Y,w,(function(){return"must be a list of lists containing integers or floats. Each list is a single line in the chart."})),Y)),(0,c.Z)(K,i.PIE_CHART,(0,c.Z)({},O,(function(){return"must be a list of booleans, dates, integers, floats, or strings."}))),(0,c.Z)(K,i.TABLE,(V={},(0,c.Z)(V,O,(function(){return"must be a list of strings."})),(0,c.Z)(V,w,(function(){return"must be a list of lists containing booleans, dates, integers, floats, or strings."})),V)),K),ie=[{label:function(){return"% of missing values"},widgetTemplate:function(e){var n,t=e.block;return{name:"missing values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,O,"columns_with_mising_values"),(0,c.Z)(n,w,"percentage_of_missing_values"),(0,c.Z)(n,g,F.HORIZONTAL),(0,c.Z)(n,S,z.DESCENDING),(0,c.Z)(n,"chart_type",i.BAR_CHART),n),content:"number_of_rows = len(df_1.index)\ncolumns_with_mising_values = []\npercentage_of_missing_values = []\nfor col in df_1.columns:\n missing = df_1[col].isna().sum()\n if missing > 0:\n columns_with_mising_values.append(col)\n percentage_of_missing_values.append(100 * missing / number_of_rows)\n"}}},{label:function(){return"Unique values"},widgetTemplate:function(e){var n,t=e.block;return{name:"unique values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,O,"columns"),(0,c.Z)(n,w,"number_of_unique_values"),(0,c.Z)(n,g,F.HORIZONTAL),(0,c.Z)(n,S,z.DESCENDING),(0,c.Z)(n,"chart_type",i.BAR_CHART),n),content:"columns = df_1.columns\nnumber_of_unique_values = [df_1[col].nunique() for col in columns]\n"}}},{label:function(){return"Most frequent values"},widgetTemplate:function(e){var n,t=e.block;return{name:"most frequent values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,x,3e3),(0,c.Z)(n,j,"column_index"),(0,c.Z)(n,O,"columns"),(0,c.Z)(n,w,"rows"),(0,c.Z)(n,"chart_type",i.TABLE),n),content:"columns = ['mode value', 'frequency', '% of values']\n\ncolumn_index = []\nrows = []\nfor col in df_1.columns:\n value_counts = df_1[col].value_counts()\n if len(value_counts.index) == 0:\n continue\n column_value = value_counts.index[0]\n value = value_counts[column_value]\n number_of_rows = df_1[col].count()\n column_index.append(col)\n rows.append([\n column_value,\n f'{round(100 * value / number_of_rows, 2)}%',\n value,\n ])\n"}}},{label:function(){return"Summary overview"},widgetTemplate:function(e){var n,t=e.block;return{name:"summary overview for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,x,3e3),(0,c.Z)(n,j,"stats"),(0,c.Z)(n,O,"headers"),(0,c.Z)(n,w,"rows"),(0,c.Z)(n,"chart_type",i.TABLE),n),content:"from mage_ai.data_cleaner.column_types.column_type_detector import infer_column_types\n\n\nheaders = ['value']\nstats = ['Columns', 'Rows']\nrows = [[len(df_1.columns)], [len(df_1.index)]]\n\ncol_counts = {}\nfor col, col_type in infer_column_types(df_1).items():\n col_type_name = col_type.value\n if not col_counts.get(col_type_name):\n col_counts[col_type_name] = 0\n col_counts[col_type_name] += 1\n\nfor col_type, count in sorted(col_counts.items()):\n stats.append(f'# of {col_type}')\n rows.append([count])\n"}}},{label:function(){return"Feature profiles"},widgetTemplate:function(e){var n,t=e.block;return{name:"feature profiles for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,x,3e3),(0,c.Z)(n,j,"stats"),(0,c.Z)(n,O,"columns"),(0,c.Z)(n,w,"rows"),(0,c.Z)(n,"chart_type",i.TABLE),n),content:"from mage_ai.data_cleaner.column_types.column_type_detector import infer_column_types\nimport statistics\n\n\ncolumns_and_types = infer_column_types(df_1).items()\ncolumns = [t[0] for t in columns_and_types]\nstats = ['Type', 'Missing values', 'Unique values', 'Min', 'Max', 'Mean', 'Median', 'Mode']\nrows = [[] for _ in stats]\n\nfor col, col_type in columns_and_types:\n series = df_1[col]\n min_value = None\n max_value = None\n mean = None\n median = None\n\n not_null = series[series.notnull()]\n\n if col_type.value in ['number', 'number_with_decimals']:\n count = len(not_null.index)\n if count >= 1:\n mean = round(not_null.sum() / count, 2)\n median = sorted(not_null)[int(count / 2)]\n min_value = round(series.min(), 2)\n max_value = round(series.max(), 2)\n else:\n min_value = not_null.astype(str).min()\n max_value = not_null.astype(str).max()\n\n _, mode = sorted(\n [(v, k) for k, v in not_null.value_counts().items()],\n reverse=True,\n )[0]\n\n for idx, value in enumerate([\n col_type.value,\n len(series[series.isna()].index),\n len(series.unique()),\n min_value,\n max_value,\n mean,\n median,\n mode,\n ]):\n rows[idx].append(value)\n"}}}],re=t(49125),oe=t(90211),le=t(28598);function ce(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 ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ce(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ce(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ue=function(e){var n=e.addWidget,t=e.block,i=e.left,r=e.rightOffset,l=e.onClickCallback,c=e.open,a=e.parentRef,u=e.runBlock,s=e.topOffset,f=(0,d.useMemo)((function(){return U.map((function(e){var i,r,o={configuration:{chart_type:e},language:t.language,type:h.tf.CHART,upstream_blocks:t?[t.uuid]:null},l=ne[e],c=(null===l||void 0===l||null===(i=l.configuration)||void 0===i?void 0:i.call(l,o))||{},a=h.t6.SQL===(null===t||void 0===t?void 0:t.language)?null:(null===l||void 0===l||null===(r=l.content)||void 0===r?void 0:r.call(l,o))||null,s=e;return t&&(s="".concat(s," for ").concat(t.uuid)),{label:function(){return(0,oe.vg)(e)},onClick:function(){return n(ae(ae({},o),{},{name:"".concat(s," ").concat((0,oe.Mp)()),configuration:ae(ae({},o.configuration),c),content:a}),{onCreateCallback:function(e){t&&h.t6.SQL!==t.language&&([h.DA.EXECUTED,h.DA.UPDATED].includes(t.status)?u({block:e,code:a,disableReset:!0}):u({block:t,runDownstream:!0}))}})},uuid:e}}))}),[U,t,u]),p=(0,d.useMemo)((function(){return ie.map((function(e){var i=e.label,r=ae(ae({},(0,e.widgetTemplate)({block:t})),{},{language:t.language,type:h.tf.CHART,upstream_blocks:t?[t.uuid]:null});return{label:i,onClick:function(){return n(r,{onCreateCallback:function(e){t&&h.t6.SQL!==t.language&&([h.DA.EXECUTED,h.DA.UPDATED].includes(t.status)?u({block:e,code:e.content,disableReset:!0}):u({block:t,runDownstream:!0}))}})},uuid:i()}}))}),[ie,n,t,u]),v=[{isGroupingTitle:!0,label:function(){return"Custom charts"},uuid:"custom_charts"}].concat((0,o.Z)(f));return h.t6.SQL!==t.language&&v.push.apply(v,[{isGroupingTitle:!0,label:function(){return"Templates"},uuid:"chart_templates"}].concat((0,o.Z)(p))),(0,le.jsx)(m.Z,{items:v,left:i,onClickCallback:l,open:c,parentRef:a,rightOffset:r,topOffset:s,uuid:"CommandButtons/add_charts",width:25*re.iI})},se=t(35490),de=t(60328),fe=t(47999),pe=t(38341),he=t(67971),me=t(11135),ve=t(29237),ge=t(98781),be=t(86673),xe=t(19711),je=t(82944),ye=t(16115),ke=t(11366),Ze=t(91427),_e=t(51504);var Ce,Oe,we,Se,Ee=function(e){var n=e.block,t=e.defaultName,i=e.onClose,r=e.onSave,o=e.pipeline,l=(0,d.useRef)(null),c=(0,d.useState)(t),a=c[0],u=c[1],s=(0,d.useState)(!!(0,Ze.U2)(ke.k)),f=s[0],p=s[1];(0,d.useEffect)((function(){var e;null===l||void 0===l||null===(e=l.current)||void 0===e||e.focus()}),[]);var m=(0,d.useMemo)((function(){return ge.q.INTEGRATION===(null===o||void 0===o?void 0:o.type)}),[o]),v=(0,d.useMemo)((function(){var e=null===n||void 0===n?void 0:n.type;if(m){if(h.tf.DATA_LOADER===e)return"Source";if(h.tf.DATA_EXPORTER===e)return"Destination"}return h.V4[e]}),[n,m]);return(0,le.jsxs)(ve.Z,{children:[(0,le.jsxs)(xe.ZP,{bold:!0,children:[v," block name"]}),(0,le.jsx)(be.Z,{mt:1,children:(0,le.jsx)(je.Z,{monospace:!0,onChange:function(e){return u(e.target.value)},ref:l,value:a})}),(0,le.jsx)(be.Z,{mt:2,children:(0,le.jsx)(he.Z,{alignItems:"center",children:(0,le.jsx)(pe.Z,{checked:f,label:(0,le.jsxs)(xe.ZP,{muted:!0,small:!0,children:["Automatically use randomly generated name",(0,le.jsx)("br",{}),"for blocks created in the future"]}),onClick:function(){p(!f),(0,Ze.t8)(ke.k,!f)}})})}),(0,le.jsx)(be.Z,{mt:3,children:(0,le.jsxs)(he.Z,{children:[(0,le.jsx)(me.ZP,{bold:!0,inline:!0,keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,_e.y)([ye.Uq],n)},onClick:function(){return r({name:a||t})},primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:"Save and add block"}),(0,le.jsx)(be.Z,{ml:1,children:(0,le.jsx)(de.Z,{onClick:i,tabIndex:0,children:"Cancel"})})]})})]})},Pe=t(26304),Ie=t(9518),Te=t(16634);!function(e){e.JSON="json",e.PY="py",e.R="r",e.SQL="sql",e.TXT="txt",e.YAML="yaml",e.YML="yml"}(we||(we={})),function(e){e.INIT_PY="__init__.py",e.METADATA_YAML="metadata.yaml",e.REQS_TXT="requirements.txt"}(Se||(Se={}));var Ae,Re,De=[we.PY,we.SQL],Me=[we.JSON,we.PY,we.R,we.SQL,we.TXT,we.YAML,we.YML],Ne=new RegExp(Me.map((function(e){return".".concat(e,"$")})).join("|")),Be=Me.concat(we.PY),Le=new RegExp(Be.map((function(e){return".".concat(e,"$")})).join("|")),Fe="charts",He="pipelines",Ue=(Ce={},(0,c.Z)(Ce,we.JSON,we.JSON),(0,c.Z)(Ce,we.PY,h.t6.PYTHON),(0,c.Z)(Ce,we.R,h.t6.R),(0,c.Z)(Ce,we.SQL,h.t6.SQL),(0,c.Z)(Ce,we.TXT,"text"),(0,c.Z)(Ce,we.YAML,h.t6.YAML),(0,c.Z)(Ce,we.YML,h.t6.YAML),Ce),ze=(Oe={},(0,c.Z)(Oe,h.t6.PYTHON,we.PY),(0,c.Z)(Oe,h.t6.R,we.R),(0,c.Z)(Oe,h.t6.SQL,we.SQL),(0,c.Z)(Oe,h.t6.YAML,we.YAML),(0,c.Z)(Oe,"text",we.TXT),Oe),Ge=t(10503),We=t(43032),Qe="sideview";!function(e){e.CHARTS="charts",e.DATA="data",e.GRAPHS="graphs",e.REPORTS="reports",e.SECRETS="secrets",e.TERMINAL="terminal",e.TREE="tree",e.VARIABLES="variables"}(Re||(Re={}));var qe=[Re.CHARTS,Re.DATA,Re.REPORTS,Re.TREE],Ye=[Re.DATA,Re.REPORTS,Re.GRAPHS],Ve=[{key:Re.TREE,label:"Tree"},{key:Re.CHARTS,label:"Charts"},{key:Re.VARIABLES,label:"Variables"},{key:Re.SECRETS,label:"Secrets"},{key:Re.DATA,label:"Data"},{key:Re.TERMINAL,label:"Terminal"}],Ke=(Ae={},(0,c.Z)(Ae,Re.CHARTS,Ge.er),(0,c.Z)(Ae,Re.DATA,Ge.t1),(0,c.Z)(Ae,Re.GRAPHS,Ge.er),(0,c.Z)(Ae,Re.REPORTS,Ge.Do),(0,c.Z)(Ae,Re.SECRETS,Ge.EK),(0,c.Z)(Ae,Re.TREE,Ge.BJ),(0,c.Z)(Ae,Re.VARIABLES,Ge.KJ),Ae),Xe=t(44162);function Je(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=n||(null===e||void 0===e?void 0:e.name);return null!==e&&void 0!==e&&e.parent?Je(e.parent,"".concat(e.parent.name,"/").concat(t)):t}function $e(e){return e.split("/").slice(1).join("/")}function en(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=Je(e,n);return $e(t)}function nn(e){var n,t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=Je(e,i).split("/");if(!r)return null;if(1===r.length)(r=null===e||void 0===e||null===(t=e.path)||void 0===t?void 0:t.split("/"))&&(n=r[0]===h.tf.CUSTOM?r[0]:(0,oe.C5)(r[0]||""));else if(r[1]===h.tf.CUSTOM)n=r[1];else{var o=r[1];n=h.tf.DBT===o?o:(0,oe.C5)(o||"")}if(!r)return null;var l="";l=r.length>=3?r.slice(2,r.length).join("/"):r[r.length-1];var c=[".".concat(we.PY),".".concat(we.R),".".concat(we.SQL),".".concat(we.YAML),".".concat(we.YML)].join("|"),a=new RegExp("".concat(c,"$"));if(h.$W.concat(h.tf.DBT).includes(n)&&l.match(a)){var u=l.split("."),s=u[1];return{language:Ue[s],type:n,uuid:u[0]}}}function tn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=Je(e,n).split("/");if(t[1]){var i=(0,oe.C5)(t[n?0:1]);t[1]===h.tf.DBT&&(i=h.tf.DBT);var r=t[t.length-1],o=new RegExp(".".concat(we.YAML,"$")),l=new RegExp(".".concat(we.R,"$")),c=new RegExp(".".concat(we.SQL,"$"));if(r.match(o)&&h.VZ.includes(i))return{type:i,uuid:r.replace(o,"")};if(r.match(l)&&h.J8.includes(i))return{type:i,uuid:r.replace(l,"")};if(r.match(c)&&h.HX.includes(i)){var a=r.replace(/[.]/g,"_"),u=i===h.tf.DBT?t.slice(2,-1).join("_").concat("_".concat(a)):r.replace(c,"");return{type:i,uuid:u}}}}var rn=t(24224);function on(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 ln(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?on(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var cn="default_repo";var an=function e(n){var t=n.allowSelectingFolders,i=n.containerRef,r=n.disableContextMenu,o=n.file,l=n.isFileDisabled,c=n.level,a=n.onSelectBlockFile,u=n.onlyShowChildren,s=n.openFile,f=n.openPipeline,p=n.openSidekickView,m=n.pipelineBlockUuids,v=n.selectFile,g=n.setContextItem,b=n.setCoordinates,x=n.setDraggingFile,j=n.setSelectedFile,y=n.theme,k=n.timeout,Z=n.uncollapsed,_=n.useRootFolder,C=o.children,O=o.disabled,w=o.name,S=o.parent;w||(o.name=cn);var E,P=_?Je(o):en(o),I=(null===S||void 0===S?void 0:S.name)===He,T=(0,d.useMemo)((function(){return C?(0,rn.YC)(C,(function(e){return e.children?0:1})):C}),[C]),A=l?l(P,T):O||"__init__.py"===w||!(null===w||void 0===w||!w.match(/^\./))||!w.match(Le)&&!C,R="".concat(c,"/").concat(w),D=(m.includes(function(e){var n=e.name.split("."),t=n[n.length-1];return De.includes(t)&&n.pop(),n.join("")}(o)),(0,d.useState)("undefined"===typeof Z?(0,Ze.U2)(R,!1):!Z)),M=D[0],N=D[1],B=Ge.iU;1===c&&w===He?B=Ge.B_:w===Fe?B=Ge.er:T&&(B=Ge.gt),T&&h.$W.includes((0,oe.C5)(w))&&(0,oe.C5)(w)!==h.tf.CHART&&(E=(0,Xe.qn)((0,oe.C5)(w),{theme:y}).accent);var L=(0,d.useMemo)((function(){return null===T||void 0===T?void 0:T.map((function(n){return(0,le.jsx)(e,{allowSelectingFolders:t,containerRef:i,disableContextMenu:r,file:ln(ln({},n),{},{parent:o}),isFileDisabled:l,level:u?c:c+1,onSelectBlockFile:a,openFile:s,openPipeline:f,openSidekickView:p,pipelineBlockUuids:m,selectFile:v,setContextItem:g,setCoordinates:b,setDraggingFile:x,setSelectedFile:j,theme:y,timeout:k,uncollapsed:Z,useRootFolder:_},"".concat(R,"/").concat((null===n||void 0===n?void 0:n.name)||cn))}))}),[t,i,T,r,o,l,c,a,u,s,f,p,m,v,g,y,k,Z,_,R]);return(0,le.jsxs)(le.Fragment,{children:[!u&&(0,le.jsxs)("div",{className:"row",onClick:function(e){if(e.preventDefault(),!A){if((null===S||void 0===S?void 0:S.name)===Fe){null===p||void 0===p||p(Re.CHARTS);var n=nn(o);n&&(null===a||void 0===a||a(n.uuid,n.type,en(o)))}var i=tn(o);if(T)t?v(P):N((function(e){return(0,Ze.t8)(R,!e),!e}));else if(i)null===a||void 0===a||a(i.uuid,i.type,en(o));else if(w.match(Ne))s(P);else{var r=nn(o);r&&(null===a||void 0===a||a(r.uuid,r.type,en(o)))}}},onContextMenu:function(e){var n;clearTimeout(k.current);var t=nn(o);null===i||void 0===i||null===(n=i.current)||void 0===n||!n.contains(e.target)||!t&&"undefined"===typeof T||r||(e.preventDefault(),b(A?null:{x:e.pageX,y:e.pageY}),x(null),j(A?null:o),A||I||T||w.match(Ne)||Se.INIT_PY)},onMouseDown:function(e){var n,t=o?nn(o):null;null===i||void 0===i||null===(n=i.current)||void 0===n||!n.contains(e.target)||!t||(null===T||void 0===T?void 0:T.length)>=1||r||A||I||(e.preventDefault(),clearTimeout(k.current),k.current=setTimeout((function(){b({x:e.pageX,y:e.pageY}),x(o),j(null)}),300))},style:{alignItems:"center",cursor:"default",display:"flex",minWidth:c*We.Cl+o.name.length*re.Fo+2*re.iI,paddingBottom:re.iI/4,paddingLeft:re.iI/4+We.Cl*c,paddingRight:re.iI/4,paddingTop:re.iI/4},children:[T&&!M&&(0,le.jsx)(Ge._M,{muted:!0,size:We.ZG}),T&&M&&(0,le.jsx)(Ge._Q,{muted:!0,size:We.ZG}),!T&&(0,le.jsx)("div",{style:{width:We.ZG}}),(0,le.jsxs)("div",{style:{marginLeft:re.iI/2,marginRight:re.iI/2},children:[!E&&(0,le.jsx)(B,{disabled:A,size:We.ZG}),E&&(0,le.jsx)(Te.Z,{color:E,size:We.ZG,square:!0})]}),(0,le.jsx)(xe.ZP,{color:E,default:!E&&!A,disabled:A,monospace:!0,small:!0,children:w})]}),(0,le.jsx)("div",{style:{display:M?"none":"block"},children:L})]})},un=t(82531);var sn=function(e){var n=e.fetchFileTree,t=e.onCancel,i=e.selectedFolder,r=e.setErrors,o=(0,d.useRef)(null),c=(0,d.useState)(""),a=c[0],u=c[1],s=(0,d.useState)(""),p=s[0],h=s[1];(0,d.useEffect)((function(){var e;null===o||void 0===o||null===(e=o.current)||void 0===e||e.focus()}),[]),(0,d.useEffect)((function(){i&&u(en(i))}),[i]);var m=(0,f.Db)(un.ZP.files.useCreate()),v=(0,l.Z)(m,1)[0];return(0,le.jsxs)(ve.Z,{footer:(0,le.jsxs)(he.Z,{children:[(0,le.jsx)(me.ZP,{bold:!0,disabled:!(p&&a),inline:!0,keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,_e.y)([ye.Uq],n)},onClick:function(){v({file:{dir_path:a,name:p,overwrite:!1},file_json_only:!0}).then((function(e){var i=e.data,o=i.error;o?null===r||void 0===r||r({errors:{messages:[o.message]},response:i}):(t(),null===n||void 0===n||n())}))},primary:!0,tabIndex:0,uuid:"NewFile/create_file",children:"Create file"}),(0,le.jsx)(be.Z,{ml:1,children:(0,le.jsx)(de.Z,{onClick:function(){return t()},tabIndex:0,children:"Cancel"})})]}),headerTitle:"New file",children:[(0,le.jsx)(je.Z,{label:"Directory",monospace:!0,onChange:function(e){return u(e.target.value)},required:!0,setContentOnMount:!0,value:a}),(0,le.jsx)(be.Z,{mt:2,children:(0,le.jsx)(je.Z,{label:"Filename",monospace:!0,onChange:function(e){return h(e.target.value)},ref:o,required:!0,value:p})})]})},dn=t(55106),fn=t(66176),pn=t(87815),hn=t(23831),mn=t(73942),vn=(re.iI,Ie.default.div.withConfig({displayName:"indexstyle__DropZoneStyle",componentId:"sc-1g3zz7z-0"})(["border-radius:","px;padding:","px;max-width:","px;min-width:","px;",""],mn.n_,8*re.iI,100*re.iI,55*re.iI,(function(e){return"\n border: 1px dashed ".concat((e.theme.borders||hn.Z.borders).contrast,";\n ")}))),gn=Ie.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-1g3zz7z-1"})(["max-width:","px;min-width:","px;"],100*re.iI,55*re.iI),bn=t(7715);var xn=function(e){var n=e.fetchFileTree,t=e.onCancel,i=e.selectedFolder,r=(0,d.useState)(!1),o=r[0],c=r[1],a=(0,d.useState)({}),u=a[0],s=a[1],f=(0,d.useState)({}),p=f[0],h=f[1],m=!(0,bn.Qr)(u),v=(0,d.useMemo)((function(){var e=[];return(0,rn.YC)(Object.entries(u),(function(e){var n=(0,l.Z)(e,2),t=n[0];n[1];return t})).forEach((function(n){var t=(0,l.Z)(n,2),i=t[0],r=t[1],o=p[i],c=null===o||void 0===o?void 0:o.message;e.push([(0,le.jsxs)("div",{children:[(0,le.jsx)(xe.ZP,{overflowWrap:!0,preWrap:!0,children:i}),c&&(0,le.jsx)(be.Z,{mt:1,children:(0,le.jsx)(xe.ZP,{danger:!0,small:!0,children:c})})]},"name-".concat(i)),(0,le.jsx)(fn.Z,{danger:!!c,progress:100*r},"progress-".concat(i))])})),(0,le.jsx)(pn.Z,{columnFlex:[1,4],columns:[{uuid:"Filename"},{uuid:"Upload progress"}],rows:e,uuid:"block-runs"})}),[u,p]);return(0,le.jsxs)(ve.Z,{footer:(0,le.jsxs)(he.Z,{fullWidth:!0,children:[(0,le.jsx)(de.Z,{onClick:function(){return t()},children:"Close"}),m&&(0,le.jsx)(be.Z,{ml:1,children:(0,le.jsx)(de.Z,{onClick:function(){s({}),h({})},children:"Clear files and retry"})})]}),headerTitle:"Upload files",children:[m&&(0,le.jsx)(gn,{children:v}),!m&&(0,le.jsx)(dn.Z,{directoryPath:i?en(i):"",onDragActiveChange:c,setFileUploadProgress:s,setUploadedFiles:function(e){h(e),null===n||void 0===n||n()},children:(0,le.jsx)(vn,{children:(0,le.jsxs)(xe.ZP,{center:!0,children:[o&&"Drop to upload",!o&&"Click or drop files and folders to upload"]})})})]})},jn=t(86585),yn=function(e){var n=e[0];return n===h.tf.DBT||n===h.tf.CUSTOM?n:e[0].slice(0,-1)};function kn(){return new RegExp(Object.keys(Ue).map((function(e){return".(".concat(e,")$")})).join("|"))}function Zn(e,n,t){var i,r,l=null===e||void 0===e||null===(i=e.path.match(kn())[0])||void 0===i?void 0:i.split(".")[1],c=t.type===ge.q.INTEGRATION,a=(0,rn.sE)(null===t||void 0===t?void 0:t.blocks,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n})),u=e.path.replace(n,"").split("/"),s=e.path.split("/")[0]===h.tf.DBT,d=(r=u)[0]===h.tf.DBT?r.slice(1).join("/"):function(e){return e.at(-1)}(r).split(".")[0];if(u.length>=3&&!s){var f=u.slice(1,u.length-1).join("/");d="".concat(f,"/").concat(d)}var p=yn(e.path.split("/")),m={configuration:{file_path:s?d:null},language:Ue[l],name:d,type:p};if(p===h.tf.CUSTOM&&(m.color=h.Lq.TEAL),c){var v=(0,rn.sE)(t.blocks,(function(e){var n=e.type;return h.tf.DATA_LOADER===n})),g=(0,rn.sE)(t.blocks,(function(e){var n=e.type;return h.tf.TRANSFORMER===n})),b=[];g?b.push(g.uuid):null!==a&&void 0!==a&&a.upstream_blocks?b.push.apply(b,(0,o.Z)(a.upstream_blocks)):v&&b.push(v.uuid),m.upstream_blocks=b}return m}var _n=t(96510),Cn=t(83608),On=["addNewBlock","blocks","deleteBlockFile","deleteWidget","fetchFileTree","fetchPipeline","files","pipeline","setErrors","setSelectedBlock","widgets"];function wn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Sn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?wn(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):wn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var En,Pn=20*re.iI;function In(e,n){var t=e.addNewBlock,i=e.blocks,r=void 0===i?[]:i,o=e.deleteBlockFile,c=e.deleteWidget,a=e.fetchFileTree,u=e.fetchPipeline,s=e.files,p=e.pipeline,v=e.setErrors,g=e.setSelectedBlock,b=e.widgets,x=void 0===b?[]:b,j=(0,Pe.Z)(e,On),y=(0,d.useRef)(null),k=(0,d.useContext)(Ie.ThemeContext),Z=(0,d.useState)(null),_=Z[0],C=Z[1],O=(0,d.useState)(null),w=O[0],S=O[1],E=(0,d.useState)(null),P=E[0],I=E[1],T=un.ZP.status.list().data,A=(0,d.useMemo)((function(){var e;return null===T||void 0===T||null===(e=T.status)||void 0===e?void 0:e.repo_path}),[T]),R=(0,rn.sE)(null===p||void 0===p?void 0:p.blocks,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n})),D=(0,f.Db)(un.ZP.blocks.pipelines.useUpdate(null===p||void 0===p?void 0:p.uuid,null===R||void 0===R?void 0:R.uuid),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){null===u||void 0===u||u()}})}}),M=(0,l.Z)(D,1)[0],N=(0,d.useCallback)((function(){return I(null)}),[I]);(0,d.useEffect)((function(){var e,i,r,o=function(e){if(clearTimeout(y.current),S(null),w&&p&&t){var i,r,o=(null===n||void 0===n||null===(i=n.current)||void 0===i||null===(r=i.getBoundingClientRect)||void 0===r?void 0:r.call(i))||{},l=o.width,c=o.x;if(e.pageX>c+l){var a=(null===p||void 0===p?void 0:p.type)===ge.q.INTEGRATION,u=Zn(Sn(Sn({},w),{},{path:en(w)}),A,p);null===t||void 0===t||t(u,(function(e){a&&R&&M({block:Sn(Sn({},R),{},{upstream_blocks:[e.uuid]})}),null===g||void 0===g||g(e)}))}}},l=function(e){w&&C({x:e.pageX,y:e.pageY})};return null===(e=document)||void 0===e||e.addEventListener("click",N),null===(i=document)||void 0===i||i.addEventListener("mousemove",l),null===(r=document)||void 0===r||r.addEventListener("mouseup",o),function(){var e,n,t;null===(e=document)||void 0===e||e.removeEventListener("click",N),null===(n=document)||void 0===n||n.removeEventListener("mousemove",l),null===(t=document)||void 0===t||t.removeEventListener("mouseup",o)}}),[t,R,w,N,p,n,A,g,y,M]);var B=(0,d.useMemo)((function(){return r.concat(x).map((function(e){return e.uuid}))}),[r,x]),L=(0,d.useMemo)((function(){return null===s||void 0===s?void 0:s.map((function(e){return(0,d.createElement)(an,Sn(Sn({},j),{},{containerRef:n,file:e,key:e.name,level:0,pipelineBlockUuids:B,setCoordinates:C,setDraggingFile:S,setSelectedFile:I,theme:k,timeout:y}))}))}),[s,B,j,n,k,y]),F=(0,d.useMemo)((function(){return P&&nn(P)}),[P]),H=(0,d.useMemo)((function(){return w&&nn(w)}),[w]),U=(0,d.useMemo)((function(){return P&&"undefined"!==typeof(null===P||void 0===P?void 0:P.children)&&P}),[P]),z=(0,Cn.dd)((function(){return(0,le.jsx)(xn,{fetchFileTree:a,onCancel:Q,selectedFolder:U})}),{},[a,U],{background:!0,uuid:"upload_files"}),G=(0,l.Z)(z,2),W=G[0],Q=G[1],q=(0,Cn.dd)((function(){return(0,le.jsx)(sn,{fetchFileTree:a,onCancel:K,selectedFolder:U,setErrors:v})}),{},[a,U,v],{background:!0,disableClickOutside:!0,uuid:"new_file"}),Y=(0,l.Z)(q,2),V=Y[0],K=Y[1],X=(0,d.useMemo)((function(){var e;if(!F&&!U)return(0,le.jsx)("div",{});var t=(null===n||void 0===n||null===(e=n.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,r=t.width,l=_||{},a=l.x,u=void 0===a?0:a,s=l.y,d=void 0===s?0:s,f=u;u+Pn>=i+r&&(f=i+r-(Pn+re.iI)),f<0&&(f=0);var p=[];return U?p.push.apply(p,[{label:function(){return"Upload files"},onClick:function(){W()},uuid:"upload_files"},{label:function(){return"New file"},onClick:function(){V()},uuid:"new_file"}]):p.push({label:function(){return"Delete file"},onClick:function(){F.type===h.tf.CHART?c(F):o(F)},uuid:"delete_file"}),(0,le.jsx)("div",{style:{left:f,position:"fixed",top:d+re.iI/2,zIndex:jn.bf+100},children:(0,le.jsx)(m.Z,{items:p,open:!0,parentRef:void 0,uuid:"FileBrowser/ContextMenu",width:Pn})})}),[_,o,c,n,W,V,F,U]);return(0,le.jsxs)(We.Nk,{ref:n,children:[L,(F||U)&&X,H&&(0,le.jsx)("div",{style:{left:(null===_||void 0===_?void 0:_.x)-re.iI,position:"fixed",top:(null===_||void 0===_?void 0:_.y)-re.iI,zIndex:jn.bf+100},children:(0,le.jsx)(xe.ZP,{cursor:"grabbing",monospace:!0,children:null===H||void 0===H?void 0:H.uuid})})]})}!function(e){e.BLOCK_FILE="block_file",e.DISABLED="disabled",e.FILE="file",e.FOLDER="folder",e.PIPELINE="pipeline"}(En||(En={}));var Tn=d.forwardRef(In),An=t(93461),Rn=Ie.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),Dn=Ie.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),Mn=function(e){var n=e.children,t=e.divider,i=d.Children.toArray(n).length;return(0,le.jsx)(Rn,{children:(0,le.jsx)(he.Z,{children:d.Children.map(n,(function(e,n){return e&&(0,le.jsxs)(An.Z,{children:[n>=1&&t&&(0,le.jsx)(Dn,{}),d.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))}))})})},Nn=t(57722),Bn=t(82635),Ln=t(33699),Fn=t(94353),Hn=t(28799),Un=t(41150);function zn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Gn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zn(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wn,Qn=function(e){var n,t=e.active,i=e.addNewBlock,r=e.fetchPipeline,o=e.fetchVariables,a=e.filePath,u=e.openSidekickView,p=e.pipeline,m=(e.projectName,e.selectedFilePath),v=e.setFilesTouched,g=e.setSelectedBlock,b=(0,d.useState)(null),x=b[0],j=b[1],y=(0,d.useState)(!1),k=y[0],Z=y[1],_=(0,d.useRef)(null),C=un.ZP.status.list().data,O=null===C||void 0===C||null===(n=C.status)||void 0===n?void 0:n.repo_path,w=un.ZP.file_contents.detail(a).data;(0,d.useEffect)((function(){null!==w&&void 0!==w&&w.file_content&&j(w.file_content)}),[w]);var S=(0,d.useState)(null===x||void 0===x?void 0:x.content),E=S[0],P=S[1],I=(0,d.useState)(!1),T=I[0],A=I[1];(0,d.useEffect)((function(){var e;m&&(null===_||void 0===_||null===(e=_.current)||void 0===e||e.scrollIntoView())}),[m]);var R=(0,f.Db)(un.ZP.file_contents.useUpdate(null===x||void 0===x?void 0:x.path),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){return!0},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),D=(0,l.Z)(R,1)[0],M=(0,d.useCallback)((function(e,n){D({file_content:Gn(Gn({},n),{},{content:e})}).then((function(){decodeURIComponent(a).split("/").pop()===Se.METADATA_YAML&&o()})),v((function(e){return Gn(Gn({},e),{},(0,c.Z)({},null===n||void 0===n?void 0:n.path,!1))})),A(!1)}),[o,a,D]),N=(0,d.useMemo)((function(){return kn()}),[]),B=(0,d.useMemo)((function(){var e;return null===x||void 0===x||null===(e=x.path.match(N)[0])||void 0===e?void 0:e.split(".")[1]}),[N,x]),L=(0,d.useMemo)((function(){if(null!==x&&void 0!==x&&x.path)return(0,le.jsx)(Nn.Z,{autoHeight:!0,language:Ue[B],onSave:function(e){M(e,x)},onChange:function(e){P(e),v((function(e){return Gn(Gn({},e),{},(0,c.Z)({},null===x||void 0===x?void 0:x.path,!0))})),A(!0)},selected:!0,textareaFocused:!0,value:(0,oe.Pb)(null===x||void 0===x?void 0:x.content)?JSON.stringify(JSON.parse(null===x||void 0===x?void 0:x.content),null,2):null===x||void 0===x?void 0:x.content,width:"100%"})}),[x,B,M,v]),F=(0,rn.sE)(null===p||void 0===p?void 0:p.blocks,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n})),H=(0,f.Db)(un.ZP.blocks.pipelines.useUpdate(null===p||void 0===p?void 0:p.uuid,null===F||void 0===F?void 0:F.uuid),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){null===r||void 0===r||r()}})}}),U=(0,l.Z)(H,1)[0],z=(B===we.PY||B===we.SQL||(B===we.YAML||B===we.R)&&tn(x,null===x||void 0===x?void 0:x.path))&&yn(x.path.split("/"))!==h.tf.SCRATCHPAD&&nn(x)&&(0,le.jsx)(de.Z,{onClick:function(){var e=p.type===ge.q.INTEGRATION,n=Zn(x,O,p);i(n,(function(n){e&&F&&U({block:Gn(Gn({},F),{},{upstream_blocks:[n.uuid]})}),g(n)}))},primary:!0,children:"Add to current pipeline"}),G=(0,s.ZP)((0,Hn.Ib)(),{shouldReconnect:function(){return!0}}),W=G.lastJsonMessage,Q=G.sendMessage;(0,d.useEffect)((function(){if(W){var e=W,n=null===e||void 0===e?void 0:e.execution_state;(null===e||void 0===e?void 0:e.uuid)===Ln.y&&(Bn.uF.BUSY===n?Z(!0):Bn.uF.IDLE===n&&Z(!1))}}),[W,Z]);var q=(0,le.jsx)(be.Z,{m:2,children:(0,le.jsx)(me.ZP,{disabled:!O,inline:!0,loading:k,onClick:function(){u(Re.TERMINAL),Q(JSON.stringify({api_key:Fn.l,code:"!pip install -r ".concat(O,"/requirements.txt"),token:(new se.Z).decodedToken.token,uuid:Ln.y}))},title:O?"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"})}),Y="FileEditor/".concat(null===x||void 0===x?void 0:x.path),V=(0,Un.y)(),K=V.registerOnKeyDown,X=V.unregisterOnKeyDown;return(0,d.useEffect)((function(){return function(){X(Y)}}),[X,Y]),K(Y,(function(e,n,i){if(t)if((0,_e.y)([ye.zX,ye.Um],n)||(0,_e.y)([ye.PQ,ye.Um],n))e.preventDefault(),M(E,x);else if(T&&(0,_e.y)([ye.zX,ye.hS],n)){e.preventDefault();var r="".concat(x.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(r)&&location.reload()}}),[t,E,x,M,T]),(0,le.jsxs)("div",{ref:_,children:[(0,le.jsx)(be.Z,{p:2,children:(0,le.jsxs)(Mn,{children:[z,(0,le.jsx)(de.Z,{disabled:!E,onClick:function(e){e.preventDefault(),M(E,x)},title:E?null:"No changes have been made to this file.",children:"Save file content"})]})}),L,a===Se.REQS_TXT&&q]})},qn=t(64318);!function(e){e.ANDROID="Android",e.CHROME_OS="ChromeOS",e.IOS="iOS",e.LINUX="Linux",e.MAC="macOS",e.WINDOWS="Windows"}(Wn||(Wn={}));var Yn=Wn;function Vn(){return function(){var e,n,t,i,r,o,l,c=null===(e=window)||void 0===e||null===(n=e.navigator)||void 0===n?void 0:n.userAgent,a=(null===(t=window)||void 0===t||null===(i=t.navigator)||void 0===i||null===(r=i.userAgentData)||void 0===r?void 0:r.platform)||(null===(o=window)||void 0===o||null===(l=o.navigator)||void 0===l?void 0:l.platform),u=Yn.MAC;return a?["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(a)?u=Yn.MAC:["Win32","Win64","Windows","WinCE"].includes(a)?u=Yn.WINDOWS:["iPhone","iPad","iPod"].includes(a)&&(u=Yn.IOS):c&&(c.includes("Macintosh")?u=Yn.MAC:c.includes("Windows")?u=Yn.WINDOWS:c.includes("Linux")&&c.includes("X11")?u=Yn.LINUX:/(iPhone|iPad)/.test(c)?u=Yn.IOS:c.includes("Android")&&c.includes("Mobi")?u=Yn.ANDROID:c.includes("CrOS")&&(u=Yn.CHROME_OS)),u}()===Yn.MAC}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 Xn(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,c.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 Jn=function(e){var n=e.cancelPipeline,t=e.createPipeline,i=e.executePipeline,r=e.interruptKernel,o=e.isPipelineExecuting,l=e.restartKernel,a=e.savePipelineContent,u=e.setMessages,s=(0,d.useState)(null),f=s[0],p=s[1],h=(0,d.useRef)(null),v=(0,d.useRef)(null),g=[{label:function(){return"New standard pipeline"},onClick:function(){return t({pipeline:{name:(0,oe.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return t({pipeline:{name:(0,oe.Y6)(),type:ge.q.STREAMING}})},uuid:"new_streaming_pipeline"},{label:function(){return"Save pipeline"},keyTextGroups:[[Vn()?ye.RJ:ye.hE,ye.SS]],onClick:function(){return a()},uuid:"save_pipeline"}],b=(0,d.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[ye.kA],[ye.kA]],onClick:function(){return r()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[ye.t_[ye.OC]],[ye.t_[ye.OC]]],onClick:function(){return l()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return u((function(e){return Object.keys(e).reduce((function(e,n){return Xn(Xn({},e),{},(0,c.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return o?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):e.push({label:function(){return"Execute pipeline"},onClick:function(){return i()},uuid:"Execute pipeline"}),e}),[o]),x="FileHeaderMenu/index",j=(0,Un.y)(),y=j.registerOnKeyDown,k=j.unregisterOnKeyDown;return(0,d.useEffect)((function(){return function(){k(x)}}),[k,x]),y(x,(function(e,n,t){null!==f&&(n[ye.QK]?p((function(e){return 0===e?1:e-1})):n[ye.DY]&&p((function(e){return 1===e?0:e+1})))}),[f,p]),(0,le.jsx)(fe.Z,{onClickOutside:function(){return p(null)},open:!0,style:{position:"relative"},children:(0,le.jsxs)(he.Z,{children:[(0,le.jsxs)("div",{style:{position:"relative"},children:[(0,le.jsx)(qn.u,{highlighted:0===f,onClick:function(){return p((function(e){return 0===e?null:0}))},onMouseEnter:function(){return p((function(e){return null!==e?0:null}))},ref:h,children:(0,le.jsx)(xe.ZP,{children:"File"})}),(0,le.jsx)(m.Z,{items:g,onClickCallback:function(){return p(null)},open:0===f,parentRef:h,uuid:"FileHeaderMenu/file_items"})]}),(0,le.jsxs)("div",{style:{position:"relative"},children:[(0,le.jsx)(qn.u,{highlighted:1===f,onClick:function(){return p((function(e){return 1===e?null:1}))},onMouseEnter:function(){return p((function(e){return null!==e?1:null}))},ref:v,children:(0,le.jsx)(xe.ZP,{children:"Run"})}),(0,le.jsx)(m.Z,{items:b,onClickCallback:function(){return p(null)},open:1===f,parentRef:v,uuid:"FileHeaderMenu/run_items"})]})]})})},$n=t(10919),et=t(46261),nt=t(82386),tt=t(37391),it=300,rt=Ie.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;}"],it,it),ot=Ie.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||hn.Z.background).codeArea,";\n ")})),lt=Ie.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],nt.Wi,nt.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||hn.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||hn.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(nt.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,tt.y$)()),ct=Ie.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-left:1px solid transparent;height:100%;padding:","px ","px;"," "," "," ",""],re.iI,re.cd*re.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||hn.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||hn.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&"\n border-color: ".concat((e.theme.borders||hn.Z.borders).light," !important;\n ")}),(function(e){return e.last&&"\n border-right: 1px solid transparent;\n "})),at=t(33766);var ut,st,dt=function(e){var n=e.filePaths,t=e.filesTouched,i=e.savePipelineContent,r=e.selectedFilePath,o=(0,d.useContext)(Ie.ThemeContext),l=(0,d.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]);return(0,le.jsx)(lt,{relativePosition:!0,secondary:!0,children:(0,le.jsx)(he.Z,{alignItems:"center",justifyContent:"flex-start",children:null===l||void 0===l?void 0:l.map((function(e,n){var c=r===encodeURIComponent(e);return(0,le.jsx)(he.Z,{flexDirection:"column",fullHeight:!0,onClick:function(n){n.preventDefault(),c||(i(),(0,at.u)({file_path:encodeURIComponent(e)}))},children:(0,le.jsx)(ct,{last:n===l.length-1,selected:c,children:(0,le.jsxs)(he.Z,{alignItems:"center",fullHeight:!0,children:[!t[e]&&(0,le.jsx)(Ge.iU,{muted:!c,size:1.5*re.iI}),t[e]&&(0,le.jsx)(et.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,le.jsx)("div",{style:{padding:1},children:(0,le.jsx)(Te.Z,{borderColor:(o||hn.Z).borders.danger,size:1.25*re.iI})})}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(xe.ZP,{muted:!c,children:e}),(0,le.jsx)(be.Z,{mr:2}),c&&(0,le.jsx)(et.Z,{appearAbove:!0,label:"Close",size:null,widthFitContent:!0,children:(0,le.jsx)($n.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){var n=(0,rn.Od)(l,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,at.u)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})},preventDefault:!0,children:(0,le.jsx)(Ge.x8,{size:1.25*re.iI})})}),!c&&(0,le.jsx)("div",{style:{width:1.25*re.iI}})]})})},e)}))})})},ft=t(57384);!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(ut||(ut={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(st||(st={}));var pt=t(90686),ht=["bold","defaultColor","description","disableWordBreak","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","tooltipProps","value"];function mt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function vt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mt(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gt=Ie.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*re.iI),bt=Ie.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var xt,jt=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,r=e.description,o=e.disableWordBreak,l=e.inputValue,c=e.inputWidth,a=e.invertedTheme,u=e.label,s=e.labelColor,f=e.menuOpen,p=void 0!==f&&f,h=e.monospace,m=e.muted,v=e.onClick,g=e.notRequired,b=e.selectedTextProps,x=e.small,j=e.stacked,y=e.tooltipProps,k=e.value,Z=(0,Pe.Z)(e,ht),_=(0,d.useRef)(null),C=(0,d.useState)(!1),O=C[0],w=C[1],S=(0,d.useState)(!1),E=S[0],P=S[1],I=u&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(xe.ZP,{bold:t,color:s,inverted:a,lineHeight:20,monospace:h,muted:m,small:x,children:u}),y&&(0,le.jsx)(be.Z,{ml:1,children:(0,le.jsx)(et.Z,vt({muted:!0},y))})]}),T=(0,le.jsxs)(le.Fragment,{children:[k&&(0,le.jsx)($n.Z,{block:!0,danger:null===b||void 0===b?void 0:b.danger,fullWidth:!0,muted:m,onClick:function(){v(),_.current&&_.current.focus(),w(!0)},preventDefault:!0,sameColorAsText:m||!(null!==b&&void 0!==b&&b.primary)&&!(null!==b&&void 0!==b&&b.danger)&&!(null!==b&&void 0!==b&&b.warning),underline:null===b||void 0===b?void 0:b.underline,warning:null===b||void 0===b?void 0:b.warning,children:(0,le.jsx)(xe.ZP,vt(vt({inverted:a,muted:m},b),{},{disableWordBreak:o,monospace:h,small:x,width:c,children:k}))}),(0,le.jsx)(je.Z,vt(vt({},Z),{},{basic:!0,defaultColor:i,invertedTheme:a,monospace:h,onBlur:function(e){w(!1),Z.onBlur&&Z.onBlur(e),E||P(!0)},onFocus:function(e){w(!0),Z.onFocus&&Z.onFocus(e)},ref:_,small:x,value:l,visible:!k}))]}),A=r&&(0,le.jsx)(bt,{children:(0,le.jsx)(xe.ZP,{dangerouslySetInnerHTML:{__html:r},monospace:h,muted:!0,small:x})});return(0,le.jsxs)(le.Fragment,{children:[j&&(0,le.jsxs)(le.Fragment,{children:[I&&(0,le.jsxs)(gt,{children:[(0,le.jsx)(he.Z,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:I}),A]}),T]}),!j&&(0,le.jsxs)(he.Z,{alignItems:"center",fullWidth:!0,children:[I&&(0,le.jsxs)(le.Fragment,{children:[I,(0,le.jsx)(be.Z,{ml:1})]}),(0,le.jsx)(An.Z,{flex:"1",children:T})]}),E&&!O&&!k&&!p&&!g&&(0,le.jsx)(xe.ZP,{danger:!0,small:x,children:"This field is required."})]})};!function(e){e.EMR="emr"}(xt||(xt={}));var yt=t(42305);var kt=function(e){e.filePaths,e.filesTouched;var n,t=e.isBusy,i=e.isPipelineUpdating,r=e.kernel,c=e.pipeline,a=e.pipelineContentTouched,u=e.pipelineLastSaved,s=(e.restartKernel,e.savePipelineContent,e.selectedFilePath),p=e.setErrors,h=e.updatePipelineMetadata,v=(0,d.useContext)(Ie.ThemeContext),g=r||{},b=g.alive,x=(g.name,(0,d.useState)(!1)),j=x[0],y=x[1],k=(0,d.useState)(""),Z=k[0],_=k[1],C=(0,d.useState)(xt.EMR),O=C[0],w=(C[1],(0,d.useState)(!1)),S=w[0],E=w[1],P=(0,d.useState)(!1),I=P[0],T=P[1],A=(0,d.useRef)(null),R=un.ZP.clusters.detail(O),D=R.data,M=R.mutate,N=(0,d.useMemo)((function(){var e;return(null===D||void 0===D||null===(e=D.cluster)||void 0===e?void 0:e.clusters)||[]}),D),B=(0,rn.sE)(N,(function(e){return e.is_active})),L=(0,f.Db)(un.ZP.clusters.useUpdate(O),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(e){M()},onErrorCallback:function(e,n){return p({errors:n,response:e})}})}}),F=(0,l.Z)(L,2),H=F[0];F[1].isLoading,(0,d.useEffect)((function(){null!==c&&void 0!==c&&c.uuid&&_(c.uuid)}),[null===c||void 0===c?void 0:c.uuid]),n=a?"Unsaved changes":i?"Saving changes...":u?"Last saved ".concat((0,yt.JX)(Number(u)/1e3)):"All changes saved";var U="KernelStatus",z=(0,Un.y)(),G=z.registerOnKeyDown,W=z.unregisterOnKeyDown;(0,d.useEffect)((function(){return function(){W(U)}}),[W,U]),G(U,(function(e,n,t){j&&String(t[0])===String(ye.Uq)&&String(t[1])!==String(ye.zX)&&((null===c||void 0===c?void 0:c.uuid)===Z?e.target.blur():(h(Z),y(!1)))}),[j,Z,y,h]);var Q=(0,d.useMemo)((function(){return(0,le.jsx)(jt,{bold:!1,inputValue:Z,notRequired:!0,onBlur:function(){return setTimeout((function(){return y(!1)}),300)},onChange:function(e){_(e.target.value),e.preventDefault()},onClick:function(){return y(!0)},onFocus:function(){return y(!0)},stacked:!0,value:j?null:(null===c||void 0===c?void 0:c.uuid)||""})}),[j,Z,c]),q=(0,d.useMemo)((function(){return(0,le.jsx)("div",{ref:A,style:{position:"relative"},children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(null===c||void 0===c?void 0:c.type)===ge.q.PYSPARK&&(0,le.jsxs)(be.Z,{mr:1,children:[(0,le.jsxs)($n.Z,{muted:!!B,onClick:function(){return E(!0)},preventDefault:!0,sameColorAsText:!B,underline:!B,children:[B&&B.id,!B&&"Select cluster"]}),(0,le.jsx)(fe.Z,{disableEscape:!0,onClickOutside:function(){return E(!1)},open:S,children:(0,le.jsx)(m.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,o.Z)(N.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,le.jsxs)(he.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,le.jsx)(An.Z,{flex:1,children:(0,le.jsx)(xe.ZP,{muted:!t&&st.WAITING!==i,children:n})}),t&&(0,le.jsx)(Ge.Jr,{size:2*re.iI,success:!0}),!t&&(0,le.jsx)(xe.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||st.WAITING!==i?null:function(){return H({cluster:{id:n,is_active:!0}})},uuid:n}})))),onClickCallback:function(){return E(!1)},open:S,parentRef:A,uuid:"KernelStatus/select_cluster",width:40*re.iI})})]}),(0,le.jsx)(me.ZP,{beforeElement:(0,le.jsx)(Te.Z,{color:t?(v||hn.Z).borders.info:b?(v||hn.Z).borders.success:(v||hn.Z).borders.danger,size:re.iI}),blackBorder:!0,compact:!0,inline:!0,onClick:function(){return T(!0)},uuid:"Pipeline/KernelStatus/kernel",children:(null===c||void 0===c?void 0:c.type)||ge.q.PYTHON}),(0,le.jsx)(fe.Z,{disableEscape:!0,onClickOutside:function(){return T(!1)},open:I,children:(0,le.jsx)(m.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,o.Z)(Object.keys(ge.a).filter((function(e){return(null===c||void 0===c?void 0:c.type)!=e})).map((function(e){return{label:function(){return e},onClick:function(){return h(null===c||void 0===c?void 0:c.name,e)},uuid:e}})))),onClickCallback:function(){return T(!1)},open:I,parentRef:A,uuid:"KernelStatus/select_kernel",width:25*re.iI})})]})})}),[b,N,t,c,B,E,T,S,I,v,H]),Y=(0,d.useMemo)((function(){return(0,le.jsxs)(An.Z,{alignItems:"center",children:[(0,le.jsxs)(xe.ZP,{children:["Pipeline:\xa0",s&&(null===c||void 0===c?void 0:c.uuid)]}),!s&&Q,(0,le.jsx)(be.Z,{mr:3})]})}),[b,t,c,Q,s,v]);return(0,le.jsx)(lt,{relativePosition:!0,children:(0,le.jsxs)(he.Z,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,le.jsx)(he.Z,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:(0,le.jsxs)(be.Z,{px:re.cd,children:[s&&(0,le.jsx)($n.Z,{noHoverUnderline:!0,noOutline:!0,onClick:s?function(){return(0,at.u)({file_path:null})}:null,preventDefault:!0,children:Y}),!s&&(0,le.jsxs)(he.Z,{alignItems:"center",children:[Y,j&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(be.Z,{ml:1}),(0,le.jsx)($n.Z,{onClick:function(){h(Z),y(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]})}),(0,le.jsx)(be.Z,{px:re.cd,children:(0,le.jsxs)(An.Z,{alignItems:"center",children:[q,(0,le.jsx)(be.Z,{ml:2}),(0,le.jsx)(et.Z,{appearBefore:!0,block:!0,description:(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(xe.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,le.jsx)(pt.Z,{inline:!0,keyText:Vn()?ye.RJ:ye.hE}),"\xa0",(0,le.jsx)(xe.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,le.jsx)(pt.Z,{inline:!0,keyText:ye.SS}),"\xa0",(0,le.jsx)(xe.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,le.jsx)("br",{})]}),(0,le.jsx)(be.Z,{mt:1,children:(0,le.jsxs)(xe.ZP,{default:!0,children:["Or, go to ",(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,le.jsx)(xe.ZP,{muted:!0,children:n})})]})})]})})},Zt=t(16910);var _t,Ct,Ot,wt,St,Et,Pt=function(e){var n=e.size;return(0,le.jsx)("svg",{fill:"none",height:n,preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",width:n,xmlns:"http://www.w3.org/2000/svg",children:(0,le.jsx)("path",{d:"M245.121138,10.6473813 C251.139129,16.4340053 255.074133,24.0723342 256,32.4050489 C256,35.8769778 255.074133,38.1917867 252.990862,42.5895822 C250.907876,46.9873778 225.215147,91.4286933 217.57696,103.696213 C213.179164,110.871609 210.864356,119.435947 210.864356,127.768462 C210.864356,136.3328 213.179164,144.6656 217.57696,151.840996 C225.215147,164.108516 250.907876,208.781084 252.990862,213.179164 C255.074133,217.57696 256,219.659947 256,223.131876 C255.074133,231.464676 251.370667,239.103147 245.352676,244.658347 C239.565938,250.676338 231.927751,254.611342 223.826489,255.305671 C220.35456,255.305671 218.039751,254.379804 213.873493,252.296533 C209.706951,250.213262 164.340053,225.215147 152.072249,217.57696 C151.146382,217.113884 150.220516,216.419556 149.063396,215.95648 L88.4195556,180.079502 C89.8082133,191.652693 94.9006222,202.763093 103.233138,210.864356 C104.853618,212.484551 106.473813,213.873493 108.325547,215.262151 C106.936604,215.95648 105.316409,216.651093 103.927751,217.57696 C91.6599467,225.215147 46.9873778,250.907876 42.5895822,252.990862 C38.1917867,255.074133 36.1085156,256 32.4050489,256 C24.0723342,255.074133 16.4340053,251.370667 10.8788338,245.352676 C4.86075733,239.565938 0.925858133,231.927751 0,223.594951 C0.231464676,220.123022 1.1573248,216.651093 3.00905244,213.641956 C5.09223822,209.24416 30.7848533,164.571307 38.42304,152.303787 C42.82112,145.128391 45.1356444,136.795591 45.1356444,128.231538 C45.1356444,119.6672 42.82112,111.3344 38.42304,104.159004 C30.7848533,91.4286933 4.86075733,46.75584 3.00905244,42.3580444 C1.1573248,39.3489067 0.231464676,35.8769778 0,32.4050489 C0.925858133,24.0723342 4.62930489,16.4340053 10.6473813,10.6473813 C16.4340053,4.62930489 24.0723342,0.925858133 32.4050489,0 C35.8769778,0.231464676 39.3489067,1.1573248 42.5895822,3.00905244 C46.2930489,4.62930489 78.9293511,23.6094009 96.28928,33.7939911 L100.224284,36.1085156 C101.612942,37.0343822 102.770347,37.7287111 103.696213,38.1917867 L105.547947,39.3489067 L167.348907,75.9204978 C165.960249,62.0324978 158.784853,49.3019022 147.674453,40.7378489 C149.063396,40.04352 150.683591,39.3489067 152.072249,38.42304 C164.340053,30.7848533 209.012622,4.86075733 213.410418,3.00905244 C216.419556,1.1573248 219.891484,0.231464676 223.594951,0 C231.696213,0.925858133 239.334684,4.62930489 245.121138,10.6473813 Z M131.240391,144.434062 L144.434062,131.240391 C146.285796,129.388658 146.285796,126.611342 144.434062,124.759609 L131.240391,111.565938 C129.388658,109.714204 126.611342,109.714204 124.759609,111.565938 L111.565938,124.759609 C109.714204,126.611342 109.714204,129.388658 111.565938,131.240391 L124.759609,144.434062 C126.379804,146.054258 129.388658,146.054258 131.240391,144.434062 Z",fill:"#FF694A"})})},It=t(30264),Tt=t(80906),At=re.cd*re.iI,Rt=Ie.default.div.withConfig({displayName:"indexstyle__IconContainerStyle",componentId:"sc-oyfjzc-0"})(["align-items:center;border-radius:","px;border:1px solid transparent;display:flex;justify-content:center;"," "," "," "," "," ",""],mn.BG,(function(e){return e.border&&"\n border: 1px dotted ".concat((e.theme.content||hn.Z.content).active,";\n ")}),(function(e){return e.blue&&"\n background-color: ".concat((0,Xe.qn)(h.tf.DATA_LOADER,e).accent,";\n ")}),(function(e){return e.purple&&"\n background-color: ".concat((0,Xe.qn)(h.tf.TRANSFORMER,e).accent,";\n ")}),(function(e){return e.yellow&&"\n background-color: ".concat((0,Xe.qn)(h.tf.DATA_EXPORTER,e).accent,";\n ")}),(function(e){return!e.compact&&"\n height: ".concat(At+re.iI/2,"px;\n width: ").concat(At+re.iI/2,"px;\n ")}),(function(e){return e.compact&&"\n height: ".concat(At/2+re.iI,"px;\n width: ").concat(At/2+re.iI,"px;\n ")})),Dt=Ie.default.div.withConfig({displayName:"indexstyle__ButtonWrapper",componentId:"sc-oyfjzc-1"})(["position:relative;margin-bottom:","px;margin-right:","px;",""],re.iI,re.iI,(function(e){return e.increasedZIndex&&"\n z-index: 3;\n "})),Mt=(Tt.Q0.AVERAGE,Tt.Q0.CLEAN_COLUMN_NAME,Tt.Q0.COUNT,Tt.Q0.COUNT_DISTINCT,Tt.Q0.CUSTOM,Tt.Q0.DIFF,Tt.Q0.FIRST,Tt.Q0.FIX_SYNTAX_ERRORS,Tt.Q0.IMPUTE,Tt.Q0.LAST,Tt.Q0.MAX,Tt.Q0.MEDIAN,Tt.Q0.MIN,Tt.Q0.NORMALIZE,Tt.Q0.REFORMAT,Tt.Q0.REMOVE,Tt.Q0.REMOVE_OUTLIERS,Tt.Q0.SELECT,Tt.Q0.SHIFT_DOWN,Tt.Q0.SHIFT_UP,Tt.Q0.STANDARDIZE,Tt.Q0.SUM,[Tt.Q0.DROP_DUPLICATE,Tt.Q0.FILTER,Tt.Q0.SORT,Tt.Q0.REMOVE]);!function(e){e.AGGREGATE="Aggregate",e.FORMATTING="Formatting",e.COLUMN_REMOVAL="Column removal",e.SHIFT_ROWS="Shift rows in a column",e.MISC="Miscellaneous",e.FEATURE_SCALING="Feature Scaling"}(Et||(Et={}));var Nt,Bt,Lt,Ft=(Ct={},(0,c.Z)(Ct,Tt.qs.COLUMN,(_t={},(0,c.Z)(_t,Et.AGGREGATE,[Tt.Q0.AVERAGE,Tt.Q0.COUNT,Tt.Q0.COUNT_DISTINCT,Tt.Q0.FIRST,Tt.Q0.LAST,Tt.Q0.MAX,Tt.Q0.MEDIAN,Tt.Q0.MIN,Tt.Q0.SUM]),(0,c.Z)(_t,Et.FORMATTING,[Tt.Q0.CLEAN_COLUMN_NAME,Tt.Q0.FIX_SYNTAX_ERRORS,Tt.Q0.REFORMAT]),(0,c.Z)(_t,Et.COLUMN_REMOVAL,[Tt.Q0.REMOVE,Tt.Q0.SELECT]),(0,c.Z)(_t,Et.SHIFT_ROWS,[Tt.Q0.SHIFT_DOWN,Tt.Q0.SHIFT_UP]),(0,c.Z)(_t,Et.MISC,[Tt.Q0.DIFF,Tt.Q0.IMPUTE,Tt.Q0.REMOVE_OUTLIERS]),(0,c.Z)(_t,Et.FEATURE_SCALING,[Tt.Q0.NORMALIZE,Tt.Q0.STANDARDIZE]),_t)),(0,c.Z)(Ct,Tt.qs.ROW,(0,c.Z)({},Et.MISC,[].concat(Mt))),Ct),Ht=Object.keys(Ft[Tt.qs.COLUMN]),Ut=[Et.MISC],zt=(St={},(0,c.Z)(St,Tt.qs.COLUMN,(Ot={},(0,c.Z)(Ot,Tt.Q0.ADD,"Add column"),(0,c.Z)(Ot,Tt.Q0.AVERAGE,"Aggregate by average value"),(0,c.Z)(Ot,Tt.Q0.CLEAN_COLUMN_NAME,"Clean column name"),(0,c.Z)(Ot,Tt.Q0.COUNT_DISTINCT,"Aggregate by distinct count"),(0,c.Z)(Ot,Tt.Q0.COUNT,"Aggregate by total count"),(0,c.Z)(Ot,Tt.Q0.DIFF,"Difference"),(0,c.Z)(Ot,Tt.Q0.FIRST,"Aggregate by first value"),(0,c.Z)(Ot,Tt.Q0.FIX_SYNTAX_ERRORS,"Fix syntax errors"),(0,c.Z)(Ot,Tt.Q0.IMPUTE,"Fill in missing values"),(0,c.Z)(Ot,Tt.Q0.NORMALIZE,"Normalize Data"),(0,c.Z)(Ot,Tt.Q0.STANDARDIZE,"Standardize Data"),(0,c.Z)(Ot,Tt.Q0.LAST,"Aggregate by last value"),(0,c.Z)(Ot,Tt.Q0.MAX,"Aggregate by maximum value"),(0,c.Z)(Ot,Tt.Q0.MEDIAN,"Aggregate by median value"),(0,c.Z)(Ot,Tt.Q0.MIN,"Aggregate by mininum value"),(0,c.Z)(Ot,Tt.Q0.REFORMAT,"Reformat"),(0,c.Z)(Ot,Tt.Q0.REMOVE_OUTLIERS,"Remove outliers"),(0,c.Z)(Ot,Tt.Q0.REMOVE,"Remove column(s)"),(0,c.Z)(Ot,Tt.Q0.SELECT,"Keep columns"),(0,c.Z)(Ot,Tt.Q0.SHIFT_DOWN,"Shift rows down in a column"),(0,c.Z)(Ot,Tt.Q0.SHIFT_UP,"Shift rows up in a column"),(0,c.Z)(Ot,Tt.Q0.SUM,"Aggregate by sum of values"),Ot)),(0,c.Z)(St,Tt.qs.ROW,(wt={},(0,c.Z)(wt,Tt.Q0.DROP_DUPLICATE,"Drop duplicates"),(0,c.Z)(wt,Tt.Q0.FILTER,"Filter"),(0,c.Z)(wt,Tt.Q0.SORT,"Sort"),(0,c.Z)(wt,Tt.Q0.REMOVE,"Remove rows"),wt)),St);!function(e){e.API="api",e.AZURE_BLOB_STORAGE="azure_blob_storage",e.AZURE_EVENT_HUB="azure_event_hub",e.BIGQUERY="bigquery",e.FILE="file",e.GENERIC="generic",e.GOOGLE_CLOUD_STORAGE="google_cloud_storage",e.KAFKA="kafka",e.KINESIS="kinesis",e.MYSQL="mysql",e.OPENSEARCH="opensearch",e.POSTGRES="postgres",e.RABBITMQ="rabbitmq",e.REDSHIFT="redshift",e.S3="s3",e.SNOWFLAKE="snowflake"}(Lt||(Lt={}));var Gt=(Nt={},(0,c.Z)(Nt,Lt.API,"API"),(0,c.Z)(Nt,Lt.AZURE_BLOB_STORAGE,"Azure Blob Storage"),(0,c.Z)(Nt,Lt.AZURE_EVENT_HUB,"Azure Event Hub"),(0,c.Z)(Nt,Lt.BIGQUERY,"Google BigQuery"),(0,c.Z)(Nt,Lt.FILE,"Local file"),(0,c.Z)(Nt,Lt.GENERIC,"Generic (no template)"),(0,c.Z)(Nt,Lt.GOOGLE_CLOUD_STORAGE,"Google Cloud Storage"),(0,c.Z)(Nt,Lt.KAFKA,"Kafka"),(0,c.Z)(Nt,Lt.KINESIS,"Kinesis"),(0,c.Z)(Nt,Lt.MYSQL,"MySQL"),(0,c.Z)(Nt,Lt.OPENSEARCH,"OpenSearch"),(0,c.Z)(Nt,Lt.POSTGRES,"PostgreSQL"),(0,c.Z)(Nt,Lt.RABBITMQ,"RabbitMQ"),(0,c.Z)(Nt,Lt.REDSHIFT,"Amazon Redshift"),(0,c.Z)(Nt,Lt.S3,"Amazon S3"),(0,c.Z)(Nt,Lt.SNOWFLAKE,"Snowflake"),Nt),Wt=(Bt={},(0,c.Z)(Bt,h.tf.DATA_LOADER,[Lt.GENERIC,Lt.FILE,Lt.API,Lt.AZURE_BLOB_STORAGE,Lt.BIGQUERY,Lt.GOOGLE_CLOUD_STORAGE,Lt.MYSQL,Lt.POSTGRES,Lt.RABBITMQ,Lt.REDSHIFT,Lt.S3,Lt.SNOWFLAKE]),(0,c.Z)(Bt,h.tf.DATA_EXPORTER,[Lt.GENERIC,Lt.FILE,Lt.AZURE_BLOB_STORAGE,Lt.BIGQUERY,Lt.GOOGLE_CLOUD_STORAGE,Lt.MYSQL,Lt.POSTGRES,Lt.REDSHIFT,Lt.S3,Lt.SNOWFLAKE]),(0,c.Z)(Bt,h.tf.TRANSFORMER,[Lt.BIGQUERY,Lt.POSTGRES,Lt.REDSHIFT,Lt.SNOWFLAKE]),Bt),Qt=Lt,qt=function(e,n,t){var i=t===ge.q.STREAMING&&(e===h.tf.DATA_LOADER||e===h.tf.DATA_EXPORTER);return function(e){var n;return e===ge.q.STREAMING?(n={},(0,c.Z)(n,h.tf.DATA_LOADER,[Qt.AZURE_EVENT_HUB,Qt.KAFKA,Qt.KINESIS,Qt.RABBITMQ]),(0,c.Z)(n,h.tf.DATA_EXPORTER,[Qt.KINESIS,Qt.OPENSEARCH]),(0,c.Z)(n,h.tf.TRANSFORMER,[Qt.GENERIC]),n):Wt}(t)[e].map((function(t){return{indent:e===h.tf.TRANSFORMER,label:function(){return Gt[t]},onClick:function(){n({config:{data_source:t===Qt.GENERIC?null:t},language:i?h.t6.YAML:h.t6.PYTHON,type:e})},uuid:"".concat(e,"/").concat(t)}}))},Yt=function(e,n){return[{label:function(){return"SQL"},onClick:function(){return e({language:h.t6.SQL,type:n})},uuid:"".concat(n,"/sql")},{label:function(){return"R"},onClick:function(){return e({language:h.t6.R,type:n})},uuid:"".concat(n,"/r")}]},Vt=function(e,n,t){var i=Object.fromEntries(h.Ut.map((function(n){return[n,qt(n,e,t)]})));return t===ge.q.PYSPARK||t===ge.q.PYTHON&&n===h.tf.TRANSFORMER||t===ge.q.STREAMING?i[n]:[{items:i[n],label:function(){return"Python"},uuid:"".concat(n,"/python")}].concat((0,o.Z)(Yt(e,n)))};function Kt(e,n,t){return e.map((function(e){return{indent:!0,label:function(){return zt[n][e]},onClick:function(){t({config:{action_type:e,axis:n},language:h.t6.PYTHON,type:h.tf.TRANSFORMER})},uuid:"".concat(n,"_").concat(e)}})).sort((function(e,n){return e.label().localeCompare(n.label())}))}function Xt(e,n,t){var i=[];return e.forEach((function(e){if(e!==Et.MISC)i.push({indent:!0,items:Kt(Ft[n][e],n,t),label:function(){return e},uuid:"".concat(n,"_grouping_").concat((0,oe.RA)(e))});else{var r=Kt(Ft[n][e],n,t);i.push.apply(i,(0,o.Z)(r))}})),i}var Jt=function(e,n,t){return Object.values(h.Lq).map((function(i){return{label:function(){return(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Ge.mm,{fill:(0,Xe.qn)(h.tf.CUSTOM,{blockColor:i}).accent,size:16}),"\xa0",(0,le.jsx)(xe.ZP,{children:(0,oe.kC)(i)})]})},onClick:function(){e({color:i,language:t,type:n})},uuid:"".concat(t,"_").concat(i)}}))},$t=function(e){return"-- Docs: https://docs.mage.ai/guides/sql-blocks\n"+(e||"")};function ei(e,n){var t=n;return h.tf.SCRATCHPAD===e.type&&(t='"""\nNOTE: Scratchpad blocks are used only for experimentation and testing out code.\nThe code written here will not be executed as part of the pipeline.\n"""\n'+(n||"")),t}function ni(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 ti(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ni(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ni(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ii=function(e){var n=e.addNewBlock,t=e.blockIdx,i=e.compact,r=e.hideCustom,l=e.hideDataExporter,c=(e.hideDataLoader,e.hideDbt),a=(e.hideRecommendations,e.hideScratchpad),u=e.hideSensor,s=e.hideTransformer,f=e.hideTransformerDataSources,p=e.onClickAddSingleDBTModel,m=e.pipeline,v=e.setAddNewBlockMenuOpenIdx,g=e.setCreatingNewDBTModel,b=(e.setRecsWindowOpenBlockIdx,(0,d.useState)(null)),x=b[0],j=b[1],y=(0,d.useRef)(null),k=(0,d.useRef)(null),Z=(0,d.useRef)(null),_=(0,d.useRef)(null),C=(0,d.useRef)(null),O={compact:i,inline:!0},w=null===m||void 0===m?void 0:m.type,S=w===ge.q.STREAMING,E=i?At/2:At,P=25*re.iI,I=Xt(Ht,Tt.qs.COLUMN,n),T=[{label:function(){return"Generic (no template)"},onClick:function(){n({language:h.t6.PYTHON,type:h.tf.TRANSFORMER})},uuid:"generic_transformer_action"},{bold:!0,items:Xt(Ut,Tt.qs.ROW,n),label:function(){return"Row actions"},uuid:"row_actions_grouping"},{isGroupingTitle:!0,label:function(){return"Column actions"},uuid:"column_actions_grouping"}].concat((0,o.Z)(I));f||T.splice(1,0,{bold:!0,items:Vt(n,h.tf.TRANSFORMER,w),label:function(){return"Data sources"},uuid:"data_sources_grouping"});var A=(0,d.useCallback)((function(){return j(null)}),[]),R=(0,d.useCallback)((function(e){return null===v||void 0===v?void 0:v((function(n){return null===n||x!==e?t:null}))}),[t,x,v]),D=ge.q.PYSPARK===w;return(0,le.jsx)(he.Z,{flexWrap:"wrap",inline:!0,children:(0,le.jsx)(fe.Z,{onClickOutside:A,open:!0,children:(0,le.jsxs)(he.Z,{flexWrap:"wrap",children:[!l&&(0,le.jsx)(Dt,{increasedZIndex:0===x,children:(0,le.jsx)(It.Z,{disableKeyboardShortcuts:!0,items:Vt(n,h.tf.DATA_LOADER,w),onClickCallback:A,open:0===x,parentRef:y,uuid:"data_loader_button",children:(0,le.jsx)(me.ZP,ti(ti({},O),{},{beforeElement:(0,le.jsx)(Rt,{blue:!0,compact:i,children:(0,le.jsx)(Ge.mm,{size:E})}),onClick:function(e){e.preventDefault(),j((function(e){return 0===e?null:0})),R(0)},uuid:"AddNewBlocks/Data_loader",children:"Data loader"}))})}),!s&&(0,le.jsx)(Dt,{increasedZIndex:1===x,children:(0,le.jsx)(It.Z,{disableKeyboardShortcuts:!0,items:D||ge.q.INTEGRATION===w?T:S?[{items:Vt(n,h.tf.TRANSFORMER,w),label:function(){return"Python"},uuid:"transformers/python"}]:[{items:T,label:function(){return"Python"},uuid:"transformers/python_all"}].concat((0,o.Z)(Yt(n,h.tf.TRANSFORMER))),onClickCallback:A,open:1===x,parentRef:k,uuid:"transformer_button",children:(0,le.jsx)(me.ZP,ti(ti({},O),{},{beforeElement:(0,le.jsx)(Rt,{compact:i,purple:!0,children:(0,le.jsx)(Ge.mm,{size:E})}),onClick:function(e){e.preventDefault(),j((function(e){return 1===e?null:1})),R(1)},uuid:"AddNewBlocks/Transformer",children:"Transformer"}))})}),!l&&(0,le.jsx)(Dt,{increasedZIndex:2===x,children:(0,le.jsx)(It.Z,{disableKeyboardShortcuts:!0,items:Vt(n,h.tf.DATA_EXPORTER,w),onClickCallback:A,open:2===x,parentRef:Z,uuid:"data_exporter_button",children:(0,le.jsx)(me.ZP,ti(ti({},O),{},{beforeElement:(0,le.jsx)(Rt,{compact:i,yellow:!0,children:(0,le.jsx)(Ge.mm,{inverted:!0,size:E})}),onClick:function(e){e.preventDefault(),j((function(e){return 2===e?null:2})),R(2)},uuid:"AddNewBlocks/Data_exporter",children:"Data exporter"}))})}),!c&&(0,le.jsx)(Dt,{increasedZIndex:3===x,children:(0,le.jsx)(It.Z,{disableKeyboardShortcuts:!0,items:[{label:function(){return"New model"},onClick:function(){null===g||void 0===g||g(!0),null===p||void 0===p||p(t)},uuid:"dbt/new_model"},{label:function(){return"Single model (from file)"},onClick:function(){return null===p||void 0===p?void 0:p(t)},uuid:"dbt/single_model"},{label:function(){return"All models (w/ optional exclusion)"},onClick:function(){return n({language:h.t6.YAML,type:h.tf.DBT})},uuid:"dbt/all_models"}],onClickCallback:A,open:3===x,parentRef:_,uuid:"dbt_button",children:(0,le.jsx)(me.ZP,ti(ti({},O),{},{beforeElement:(0,le.jsx)(Pt,{size:At*(i?.75:1.25)}),onClick:function(e){e.preventDefault(),j((function(e){return 3===e?null:3})),R(3)},uuid:"AddNewBlocks/DBT",children:"DBT model"}))})}),!r&&(0,le.jsx)(Dt,{increasedZIndex:4===x,children:(0,le.jsx)(It.Z,{disableKeyboardShortcuts:!0,items:[{items:Jt(n,h.tf.CUSTOM,h.t6.PYTHON),label:function(){return"Python"},uuid:"custom_block_python"},{items:Jt(n,h.tf.CUSTOM,h.t6.SQL),label:function(){return"SQL"},uuid:"custom_block_sql"}],onClickCallback:A,open:4===x,parentRef:C,uuid:"custom_block_button",children:(0,le.jsx)(et.Z,{block:!0,label:"Add a custom code block with a designated color.",maxWidth:P,size:null,children:(0,le.jsx)(me.ZP,ti(ti({},O),{},{beforeElement:(0,le.jsx)(Rt,{compact:i,children:(0,le.jsx)(Ge.I8,{size:E})}),onClick:function(e){e.preventDefault(),j((function(e){return 4===e?null:4})),R(4)},uuid:"AddNewBlocks/Scratchpad",children:"Custom"}))})})}),!a&&(0,le.jsx)(Dt,{children:(0,le.jsx)(et.Z,{block:!0,label:"Write experimental code that doesn\u2019t get executed when you run your pipeline.",maxWidth:P,size:null,children:(0,le.jsx)(me.ZP,ti(ti({},O),{},{beforeElement:(0,le.jsx)(Rt,{border:!0,compact:i,children:(0,le.jsx)(Ge.mm,{size:E})}),onClick:function(e){e.preventDefault(),n({type:h.tf.SCRATCHPAD})},uuid:"AddNewBlocks/Scratchpad",children:"Scratchpad"}))})}),!S&&(0,le.jsx)(Dt,{children:!u&&(0,le.jsx)(le.Fragment,{children:(0,le.jsx)(et.Z,{block:!0,label:"Add a sensor so that other blocks only run when sensor is complete.",maxWidth:P,size:null,children:(0,le.jsx)(me.ZP,ti(ti({},O),{},{beforeElement:(0,le.jsx)(Rt,{compact:i,children:(0,le.jsx)(Ge.LM,{pink:!0,size:At*(i?.75:1.25)})}),onClick:function(e){e.preventDefault(),n({language:h.t6.PYTHON,type:h.tf.SENSOR})},uuid:"AddNewBlocks/Sensor",children:"Sensor"}))})})})]})})})},ri=t(2005),oi=t(31012),li=["children"];function ci(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ai(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ci(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ci(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ui=Ie.default.p.withConfig({displayName:"Badge__BadgeStyle",componentId:"sc-tfqsp0-0"})(["border-radius:","px;display:inline;font-family:",";margin:0;",";"," ",";",";"," "," ",""],mn.BG,ri.ry,oi.iD,(function(e){return e.small&&"\n ".concat(oi.HC,";\n ")}),(function(e){return!e.regular&&"\n padding: 2px 4px;\n "}),(function(e){return e.regular&&"\n padding: ".concat(1*re.iI,"px ").concat(1.25*re.iI,"px;\n ")}),(function(e){return!e.disabled&&"\n background-color: ".concat((e.theme||hn.Z).background.row,";\n color: ").concat((e.theme||hn.Z).content.muted,";\n ")}),(function(e){return e.disabled&&"\n background-color: ".concat((e.theme||hn.Z).feature.disabled,";\n color: ").concat((e.theme||hn.Z).content.disabled,";\n ")}),(function(e){return e.quantifier&&"\n border-radius: 34px;\n line-height: 10px;\n padding: 4px 6px;\n "})),si=function(e){var n=e.children,t=(0,Pe.Z)(e,li);return(0,le.jsx)(ui,ai(ai({},t),{},{children:n}))},di=t(89565),fi=t.n(di),pi=t(62976),hi=t(34744),mi=Ie.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-n38rkq-0"})([""," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;overflow:hidden;"," "," ",""],Xe.Kf,(function(e){return e.addBottomPadding&&"\n padding-bottom: ".concat(2*re.tr,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme.background||hn.Z.background).table,";\n ")}),(function(e){return!e.executedAndIdle&&"\n border-bottom-left-radius: ".concat(mn.n_,"px;\n border-bottom-right-radius: ").concat(mn.n_,"px;\n border-bottom-style: solid;\n border-bottom-width: 2px;\n ")})),vi=Ie.default.div.withConfig({displayName:"indexstyle__OutputRowStyle",componentId:"sc-n38rkq-1"})([""," "," ",""],(function(e){return e.first&&"\n padding-top: ".concat(re.iI*re.cd,"px;\n ")}),(function(e){return e.last&&"\n padding-bottom: ".concat(re.iI*re.cd,"px;\n ")}),(function(e){return e.contained&&"\n padding-left: ".concat(Xe.oh,"px;\n padding-right: ").concat(re.iI*re.cd,"px;\n ")})),gi=Ie.default.div.withConfig({displayName:"indexstyle__HTMLOutputStyle",componentId:"sc-n38rkq-2"})(["table{"," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;}td,th{padding:0 8px;}a{","}"],Xe.Kf,(function(e){return"\n color: ".concat((e.theme.interactive||hn.Z.interactive).linkPrimary,";\n ")})),bi=Ie.default.div.withConfig({displayName:"indexstyle__ExtraInfoStyle",componentId:"sc-n38rkq-3"})([""," border-bottom-style:solid;border-bottom-width:2px;border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;",""],Xe.Kf,(function(e){return"\n background-color: ".concat((e.theme.borders||hn.Z.borders).light,";\n border-bottom-left-radius: ").concat(mn.n_,"px;\n border-bottom-right-radius: ").concat(mn.n_,"px;\n ")})),xi=Ie.default.div.withConfig({displayName:"indexstyle__ExtraInfoContentStyle",componentId:"sc-n38rkq-4"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;"],re.iI,Xe.oh,re.iI*re.cd,re.iI),ji=Ie.default.div.withConfig({displayName:"indexstyle__ExtraInfoBorderStyle",componentId:"sc-n38rkq-5"})(["height:1px;width:100%;",""],(function(e){return"\n border-top: 1px solid ".concat((e.theme.borders||hn.Z.borders).medium,";\n ")})),yi=/\[__internal_output__\]/,ki=/\[__internal_test__\]/;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 _i(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,c.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 Ci(e){var n={},t={};return null===e||void 0===e||e.forEach((function(e){var i=e.content,r=e.outputs,o=e.uuid;(null===r||void 0===r?void 0:r.length)>=1&&(n[o]=r.map((function(e){var n=e||{},t=n.sample_data,i=n.shape,r=n.text_data,o=n.type;return t?{data:_i({shape:i},t),type:o}:r&&(0,oe.Pb)(r)?JSON.parse(r):r}))),t[o]=i})),{content:t,messages:n}}function Oi(e,n,t){e.forEach((function(e){(0,Ze.t8)("".concat(t,"/").concat(e.uuid,"/codeCollapsed"),(0,Ze.Od)("".concat(n,"/").concat(e.uuid,"/codeCollapsed"))),(0,Ze.t8)("".concat(t,"/").concat(e.uuid,"/outputCollapsed"),(0,Ze.Od)("".concat(n,"/").concat(e.uuid,"/outputCollapsed")))}))}function wi(e){return"".concat(e,"/").concat(Ze.kP)}function Si(e){return(0,Ze.U2)(wi(e),[])}function Ei(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Pi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ei(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ei(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ii=function(e){var n=e.block,t=e.collapsed,i=e.contained,r=void 0===i||i,l=e.dynamicBlock,c=e.dynamicChildBlock,a=e.hasError,u=e.hideExtraInfo,s=e.isInProgress,f=e.mainContainerWidth,p=e.messages,m=e.openSidekickView,v=e.pipeline,g=e.runCount,b=e.runEndTime,x=e.runStartTime,j=e.selected,y=e.setCollapsed,k=e.setOutputBlocks,Z=e.setSelectedOutputBlock,_=n.status,C=n.type,O=(0,d.useMemo)((function(){return(null===p||void 0===p?void 0:p.length)||0}),[p]),w=h.DA.EXECUTED===_||!s&&0===g&&O>=1||!s&&g>=1&&b>=x,S=(0,d.useState)(),E=S[0],P=S[1],I=(0,d.useState)(),T=I[0],A=I[1];(0,d.useEffect)((function(){s||A(100)}),[s]);var R=function(e){return Array.isArray(e)?e.join("\n"):e},D=(0,d.useMemo)((function(){return p.reduce((function(e,n){var t=e.at(-1);return Bn.jU.includes(null===t||void 0===t?void 0:t.type)&&(null===t||void 0===t?void 0:t.type)===n.type&&!R(null===n||void 0===n?void 0:n.data).match(yi)?t.data+=R(n.data):Bn.jU.includes(null===n||void 0===n?void 0:n.type)&&!R(null===n||void 0===n?void 0:n.data).match(yi)?e.push(Pi(Pi({},n),{},{data:R(n.data)})):e.push(Pi({},n)),e}),[])}),[p]),M=(0,d.useMemo)((function(){return(0,le.jsx)(fn.Z,{progress:T})}),[T]),N=(0,d.useMemo)((function(){var e=function(e,n){var t=e.columns,i=e.index,r=e.rows,o=e.shape,l=n.borderTop,c=n.selected;return o&&P(o),r.length>=1&&(0,le.jsx)(pi.Z,{columns:t,disableScrolling:!c,index:i,maxHeight:60*re.iI,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!l,rows:r,width:f-(2+re.cd*re.iI*2+2+tt.nn)})},n=[],t=[];return null===D||void 0===D||D.forEach((function(i,o){var l=i.data,c=i.type;if(l&&0!==(null===l||void 0===l?void 0:l.length)){var a=[],u=(a=(a=Array.isArray(l)?l:[l]).filter((function(e){return e}))).length,s=[];a.forEach((function(n,i){var l,a={contained:r,first:0===o&&0===i,last:o===D.length-1&&i===u-1},d=o>=1;if("string"===typeof n&&n.match(ki)){var f=n.split("\n"),p=[];f.forEach((function(e){if(e.match(ki)){var i=e.split("[__internal_test__]"),r=i[i.length-1];(0,oe.Pb)(r)&&t.push(JSON.parse(r))}else p.push(e);n=p.length>=1?p.join("\n"):null}))}if(null!==n){if("string"===typeof n&&n.match(yi)){var h=n.split("[__internal_output__]"),m=h[h.length-1],v=m.split("FloatProgress");if(h.length>=2&&(m=v[0]),(0,oe.Pb)(m)){var g=JSON.parse(m),b=g.data,x=g.type;Bn.Gi.TABLE===x&&(l=e(b,{borderTop:d,selected:j}),!0)}}else if(c===Bn.Gi.TABLE)l=e((0,oe.Pb)(n)?JSON.parse(n):n,{borderTop:d,selected:j}),!0;else if(Bn.jU.includes(c)){var y,k=null===(y=n)||void 0===y?void 0:y.split("\\n");l=(0,le.jsx)(vi,Pi(Pi({},a),{},{children:k.map((function(e){return(0,le.jsx)(xe.ZP,{monospace:!0,preWrap:!0,children:(0,le.jsx)(fi(),{children:e})},e)}))}))}else if(c===Bn.Gi.TEXT_HTML)l=(0,le.jsx)(vi,Pi(Pi({},a),{},{children:(0,le.jsx)(gi,{children:(0,le.jsx)(xe.ZP,{dangerouslySetInnerHTML:{__html:n},monospace:!0})})}));else if(c===Bn.Gi.IMAGE_PNG)l=(0,le.jsx)("div",{style:{backgroundColor:"white"},children:(0,le.jsx)("img",{alt:"Image ".concat(o," from code output"),src:"data:image/png;base64, ".concat(n)})});else if(c===Bn.Gi.PROGRESS){var Z=parseInt(n);A(Z>90?90:Z)}l&&s.push((0,le.jsx)("div",{children:l},"code-output-".concat(o,"-").concat(i)))}})),s.length>=1&&n.push(s)}})),s&&(null===v||void 0===v?void 0:v.type)===ge.q.PYSPARK&&n.unshift([(0,le.jsx)(vi,{contained:!0,children:(0,le.jsx)(be.Z,{mt:1,children:M})},"progress_bar")]),{content:n,testContent:t}}),[D,r,f,T,M,j]),B=N.content,L=N.testContent,F=(null===E||void 0===E?void 0:E[1])||0,H=F>30?" (30 out of ".concat(F," columns displayed)"):"";return(0,le.jsxs)(le.Fragment,{children:[r&&(0,le.jsxs)(mi,{addBottomPadding:s&&(null===v||void 0===v?void 0:v.type)===ge.q.PYSPARK,blockType:C,dynamicBlock:l,dynamicChildBlock:c,executedAndIdle:w,hasError:a,selected:j,children:[!t&&(null===L||void 0===L?void 0:L.length)>=1&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(be.Z,{py:2,children:(0,le.jsx)(vi,{contained:!0,children:L.map((function(e,n){var t=e.error,i=e.message,r=e.stacktrace;return(0,le.jsxs)(be.Z,{mt:n>=1?3:0,children:[(0,le.jsx)(xe.ZP,{monospace:!0,preWrap:!0,children:(0,le.jsx)(fi(),{children:"".concat(i).concat(t?" "+t:"")})}),null===r||void 0===r?void 0:r.map((function(e){return(0,le.jsx)(xe.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:(0,le.jsx)(fi(),{children:e})},e)}))]},i)}))})}),(0,le.jsx)(be.Z,{mb:a?2:0,children:(0,le.jsx)(hi.Z,{medium:!0})})]}),!t&&B]}),!r&&B,w&&!u&&(0,le.jsxs)(bi,{blockType:C,dynamicBlock:l,dynamicChildBlock:c,hasError:a,selected:j,children:[(0,le.jsx)(ji,{}),(0,le.jsxs)(he.Z,{justifyContent:"space-between",children:[y&&(0,le.jsx)(An.Z,{alignItems:"center",px:1,children:(0,le.jsx)(de.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return y(!t)},transparent:!0,children:t?(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Ge._M,{muted:!0,size:2*re.iI}),"\xa0",(0,le.jsx)(xe.ZP,{default:!0,children:"Expand output"})]}):(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Ge.Kh,{muted:!0,size:2*re.iI}),E&&(0,le.jsx)(be.Z,{ml:2,children:(0,le.jsx)(xe.ZP,{children:"".concat(E[0]," rows x ").concat(E[1]," columns").concat(H)})})]})})}),(0,le.jsx)(xi,{children:(0,le.jsxs)(he.Z,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,le.jsx)(et.Z,{appearAbove:!0,appearBefore:!0,block:!0,label:g>=1&&x?"Last run at ".concat(new Date(x.valueOf()).toLocaleString()):a?"Block executed with errors":"Block executed successfully",size:null,widthFitContent:!0,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[g>=1&&Number(b)>Number(x)&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(xe.ZP,{small:!0,children:[(Number(b)-Number(x))/1e3,"s"]}),(0,le.jsx)(be.Z,{mr:1})]}),!a&&(0,le.jsx)(Ge.Jr,{size:2*re.iI,success:!0}),a&&(0,le.jsx)(Te.Z,{danger:!0,size:2*re.iI,children:(0,le.jsx)(xe.ZP,{bold:!0,monospace:!0,small:!0,children:"!"})})]})}),!a&&!h.Qj.includes(C)&&(0,le.jsx)(be.Z,{pl:1,children:(0,le.jsx)(de.Z,{afterIcon:(0,le.jsx)(Ge.M0,{muted:!0,size:1.75*re.iI}),basic:!0,noPadding:!0,onClick:function(){!function(e,n){var t=Si(e);t.includes(n)||(0,Ze.t8)(wi(e),[].concat((0,o.Z)(t),[n]))}(null===v||void 0===v?void 0:v.uuid,n.uuid),m(Re.DATA),k((function(e){return e.find((function(e){return e.uuid===n.uuid}))?e:(Z(n),e.concat(n))}))},transparent:!0,children:(0,le.jsx)(xe.ZP,{default:!0,children:"Expand table"})})})]})})]})]})]})},Ti=t(40656),Ai=Ie.default.svg.withConfig({displayName:"Convert__SVGStyle",componentId:"sc-fmw0vr-0"})([""]),Ri=function(e){var n=e.fill,t=e.opacity,i=e.size,r=void 0===i?Ti.C:i,o=e.style,l=e.viewBox,c=void 0===l?"0 0 12 12":l;return(0,le.jsxs)(Ai,{fill:n,height:r,opacity:t,style:o,viewBox:c,width:r,children:[(0,le.jsx)("path",{clipRule:"evenodd",d:"M2.5 1C1.67157 1 1 1.67157 1 2.5v.0625c0 .27614-.223858.5-.5.5s-.5-.22386-.5-.5V2.5C0 1.11929 1.11929 0 2.5 0h7C10.8807 0 12 1.11929 12 2.5v7c0 1.3807-1.1193 2.5-2.5 2.5h-7C1.11929 12 0 10.8807 0 9.5v-.0625c0-.27614.223858-.5.5-.5s.5.22386.5.5V9.5c0 .8284.67157 1.5 1.5 1.5h7c.8284 0 1.5-.6716 1.5-1.5v-7c0-.82843-.6716-1.5-1.5-1.5h-7z",fill:"url(#paint0_linear_1332_60037)",fillRule:"evenodd"}),(0,le.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.05806 3.55806c.24408-.24408.6398-.24408.88388 0l2 2c.24408.24408.24408.6398 0 .88388l-2 2c-.24408.24408-.6398.24408-.88388 0-.24408-.24408-.24408-.6398 0-.88388l.93306-.93306H1C.654822 6.625.375 6.34518.375 6s.279822-.625.625-.625h5.99112l-.93306-.93306c-.24408-.24408-.24408-.6398 0-.88388z",fill:"#fff"}),(0,le.jsx)("defs",{children:(0,le.jsxs)("linearGradient",{id:"paint0_linear_1332_60037",x1:"-.618557",y1:"-.000001",x2:"10.5709",y2:".83113",gradientUnits:"userSpaceOnUse",children:[(0,le.jsx)("stop",{stopColor:"#FFCC19"}),(0,le.jsx)("stop",{offset:".585938",stopColor:"#2ECDF7"}),(0,le.jsx)("stop",{offset:"1",stopColor:"#9E7BFF"})]})})]})},Di=t(79749),Mi=t(54283);function Ni(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 Bi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ni(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ni(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Li=function(e,n){var t=(null===n||void 0===n?void 0:n.upstream_blocks)||[];return h.tf.CHART===e.type||h.tf.SCRATCHPAD===e.type||h.tf.CHART===(null===n||void 0===n?void 0:n.type)||h.tf.SCRATCHPAD===(null===n||void 0===n?void 0:n.type)||h.tf.DATA_LOADER===(null===n||void 0===n?void 0:n.type)&&h.tf.SENSOR!==e.type||t.push(e.uuid),t},Fi=function(e,n,t,i){for(var r,o=[],l=n.findIndex((function(n){return n.uuid===e.uuid}));!r&&l>=0;){var c;r=n[l-1],h.tf.SCRATCHPAD===(null===(c=r)||void 0===c?void 0:c.type)&&(r=null),l-=1}return r&&o.push(r.uuid),h.Ut.map((function(n){return{label:function(){return"Convert to ".concat((0,oe.wX)(h.V4[n]))},onClick:function(){return i({converted_from:e.uuid,type:n,upstream_blocks:o})},uuid:"".concat(t,"/convert_to/").concat(n)}}))},Hi=function(e,n,t,i,r,o){var l=[{label:function(){return"Execute with upstream blocks"},onClick:function(){return n({block:e,runUpstream:!0})},uuid:"execute_upstream"},{label:function(){return"Execute block and run tests"},onClick:function(){return n({block:e,runTests:!0})},uuid:"run_tests"}],c=e||{},a=c.configuration,u=c.downstream_blocks,s=c.upstream_blocks,d=a||{},f=d.dynamic,p=d.reduce_output,h=o||{},m=h.blocksMapping,v=h.savePipelineContent,g=[];(u.forEach((function(e){var n=null===m||void 0===m?void 0:m[e];n&&n.upstream_blocks.forEach((function(e){var n,t;null!==m&&void 0!==m&&null!==(n=m[e])&&void 0!==n&&null!==(t=n.configuration)&&void 0!==t&&t.dynamic&&g.push(m[e])}))})),v&&(f||0===g.length)&&l.push({label:function(){return f?"Disable block as dynamic":"Set block as dynamic"},onClick:function(){return v({block:Bi(Bi({},e),{},{configuration:Bi(Bi({},a),{},{dynamic:!f})})})},uuid:"dynamic"}),m)&&((null===s||void 0===s?void 0:s.find((function(e){var n,t;return null===m||void 0===m||null===(n=m[e])||void 0===n||null===(t=n.configuration)||void 0===t?void 0:t.dynamic})))&&l.push({label:function(){return p?"Don\u2019t reduce output":"Reduce output"},onClick:function(){return v({block:Bi(Bi({},e),{},{configuration:Bi(Bi({},a),{},{reduce_output:!p})})})},uuid:"reduce_output"}));return l.push({label:function(){return"Delete block"},onClick:function(){t(e),i(!1)},uuid:"delete_block"}),r?[l.pop()]:l};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 zi(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,c.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 Gi,Wi=function(e){var n=e.addNewBlock,t=e.addWidget,i=e.block,r=e.blocks,o=e.deleteBlock,l=e.executionState,c=e.interruptKernel,a=e.pipelineType,u=e.runBlock,s=e.savePipelineContent,f=e.setOutputCollapsed,p=(e.visible,i.all_upstream_blocks_executed),v=void 0===p||p,g=i.color,b=i.type,x=i.uuid,j=(0,d.useRef)(null),y=(0,d.useRef)(null),k=(0,d.useRef)(null),Z=(0,d.useRef)(null),_=(0,d.useState)(!1),C=_[0],O=_[1],w=(0,d.useState)(!1),S=w[0],E=w[1],P=(0,d.useState)(!1),I=P[0],T=P[1],A=(0,d.useState)(!1),R=A[0],D=A[1],M=(0,d.useContext)(Ie.ThemeContext),N=Bn.uF.IDLE!==l,B=(0,Xe.qn)(b,{blockColor:g,theme:M}).accent,L=a===ge.q.STREAMING,F=(0,d.useMemo)((function(){return Fi(i,r,"CommandButtons",n).map((function(e){return zi(zi({},e),{},{onClick:function(){return s().then((function(){return e.onClick()}))}})}))}),[n,i,r,s]),H=(0,d.useMemo)((function(){return(0,rn.HK)(r,(function(e){return e.uuid}))}),[r]);return(0,le.jsxs)(he.Z,{alignItems:"center",children:[Bn.uF.QUEUED===l&&(0,le.jsx)(Mi.Z,{color:(M||hn.Z).content.active,type:"cylon"}),Bn.uF.BUSY===l&&(0,le.jsx)(Mi.Z,{color:(M||hn.Z).content.active}),!N&&!L&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(et.Z,{appearBefore:!0,default:!0,label:(0,le.jsxs)(xe.ZP,{children:["Run block \xa0 \xa0",(0,le.jsx)(Di.Z,{inline:!0,keyTextGroups:[[Vn()?ye.RJ:ye.hE,ye.Lz]],monospace:!0,uuidForKey:x})]}),size:3*re.iI,widthFitContent:!0,children:(0,le.jsx)(de.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){v?u({block:i}):T(!0)},children:(0,le.jsx)(Te.Z,{color:B,size:3*re.iI,children:(0,le.jsx)(Ge.Py,{black:!0,size:1.5*re.iI})})})}),(0,le.jsx)(fe.Z,{disableEscape:!0,onClickOutside:function(){return T(!1)},open:I,children:(0,le.jsx)(m.Z,{items:[{label:function(){return"Execute block"},onClick:function(){return u({block:i})},uuid:"execute_block"},{label:function(){return"Execute with upstream blocks"},onClick:function(){return u({block:i,runUpstream:!0})},uuid:"execute_upstream"}],onClickCallback:function(){return T(!1)},open:I,parentRef:k,rightOffset:13.25*re.iI,topOffset:4.5*re.iI,uuid:"execute_actions",width:25*re.iI})})]}),N&&(0,le.jsx)(be.Z,{ml:re.cd,children:(0,le.jsx)(et.Z,{appearBefore:!0,default:!0,label:(0,le.jsxs)(xe.ZP,{children:["Interrupt kernel \xa0 \xa0",(0,le.jsx)(Di.Z,{inline:!0,keyTextGroups:[[ye.kA],[ye.kA]],monospace:!0,uuidForKey:x})]}),size:2.5*re.iI,widthFitContent:!0,children:(0,le.jsx)(de.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return c()},children:(0,le.jsx)(Te.Z,{borderSize:1.5,size:2.5*re.iI,children:(0,le.jsx)(Ge.x8,{size:1*re.iI})})})})}),h.tf.SCRATCHPAD===i.type&&!L&&(0,le.jsx)(be.Z,{ml:re.cd,children:(0,le.jsx)(It.Z,{items:F,onClickCallback:function(){return E(!1)},onClickOutside:function(){return E(!1)},open:S,parentRef:y,rightOffset:0,topOffset:4,uuid:"CommandButtons/convert_block",children:(0,le.jsx)(et.Z,{appearBefore:!0,default:!0,label:(0,le.jsx)(xe.ZP,{children:"Convert block"}),size:2.5*re.iI,widthFitContent:!0,children:(0,le.jsx)(de.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return E(!S)},ref:y,children:(0,le.jsx)(Ri,{size:2.5*re.iI})})})})}),[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(i.type)&&!L&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(be.Z,{ml:re.cd,ref:j,children:(0,le.jsx)(et.Z,{appearBefore:!0,default:!0,label:"Add chart",size:2.25*re.iI,widthFitContent:!0,children:(0,le.jsx)(de.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return O((function(e){return!e}))},children:(0,le.jsx)(Ge.er,{size:2.25*re.iI})})})}),(0,le.jsx)(fe.Z,{disableEscape:!0,onClickOutside:function(){return O(!1)},open:C,children:(0,le.jsx)(ue,{addWidget:t,block:i,onClickCallback:function(){return O(!1)},open:C,parentRef:j,rightOffset:9*re.iI,runBlock:u,topOffset:2*re.iI})})]}),(0,le.jsx)("div",{ref:Z,children:(0,le.jsx)(be.Z,{ml:re.cd,children:(0,le.jsx)(et.Z,{appearBefore:!0,default:!0,label:(0,le.jsx)(xe.ZP,{children:"More actions"}),size:2.5*re.iI,widthFitContent:!0,children:(0,le.jsx)(de.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return D((function(e){return!e}))},children:(0,le.jsx)(Te.Z,{borderSize:1.5,size:2.5*re.iI,children:(0,le.jsx)(Ge.mH,{size:re.iI})})})})})}),(0,le.jsx)(fe.Z,{disableEscape:!0,onClickOutside:function(){return D(!1)},open:R,children:(0,le.jsx)(m.Z,{items:Hi(i,u,o,f,L,{blocksMapping:H,savePipelineContent:s}),onClickCallback:function(){return D(!1)},open:R,parentRef:Z,rightOffset:4.75*re.iI,topOffset:2*re.iI,uuid:"FileHeaderMenu/file_items"})})]})};!function(e){e.APPEND="append",e.FAIL="fail",e.REPLACE="replace"}(Gi||(Gi={}));var Qi,qi=[Gi.APPEND,Gi.FAIL,Gi.REPLACE];!function(e){e.BIGQUERY="bigquery",e.MYSQL="mysql",e.POSTGRES="postgres",e.REDSHIFT="redshift",e.SNOWFLAKE="snowflake"}(Qi||(Qi={}));var Yi,Vi=t(55378);!function(e){e.DATA_EXPORTER="data_exporter",e.DATA_LOADER="data_loader",e.MAGE_LIBRARY="mage_library",e.TRANSFORMER="transformer",e.USER_LIBRARY="user_library"}(Yi||(Yi={}));var Ki=t(5677);function Xi(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?Xi(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function $i(e,n){var t=e;t.includes("__init__")||t.push("__init__");var i,r=t.length;return(0,rn.w6)(r).forEach((function(e,o){if(i)return i;var l=t.slice(0,r-o).join("/");i=n["".concat(l,".py")]})),i}function er(e,n,t){var i,r,o;return((null===(i=t.outputs)||void 0===i||null===(r=i[0])||void 0===r||null===(o=r.sample_data)||void 0===o?void 0:o.columns)||[]).map((function(t){return{label:"".concat(t," column"),kind:e.languages.CompletionItemKind.Variable,insertText:"'".concat(t,"'"),range:n}}))}function nr(e,n){var t=e.word.split(""),i=new RegExp(t.reduce((function(e,n,i){var r=t[i+1],o=r?"^".concat(r):"";return e+"".concat(n,"[w ").concat(o,"]*")}),""));return n.reduce((function(e,n){return n.label.match(i)?e.concat(n):e}),[])}function tr(e){var n=e.autocompleteItems,t=e.block,i=e.blocks,r=e.pipeline,c=t.type,a=t.upstream_blocks,u=(0,rn.HK)(n,(function(e){return e.id}));return function(t){return function(s,d){var f=[],p=s.getValueInRange({endColumn:d.column,endLineNumber:d.lineNumber,startColumn:1,startLineNumber:1}),m=s.getWordUntilPosition(d),v=m.endColumn,g=m.startColumn,b={endColumn:v,endLineNumber:d.lineNumber,startColumn:g,startLineNumber:d.lineNumber},x=function(e,n,t){var i=(0,Ki.Yn)(e),r=(0,Ki.M4)(e,n),o=i.find((function(e){var n=e.variableName;return r.match(new RegExp(n))}));if(o){var l=o.assignmentValue,c=(0,Ki.S0)(e)[l];if(c){var a,u=$i(c.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t),s=(0,Ki.rW)(c,l);return null===u||void 0===u||null===(a=u.methods_for_class)||void 0===a?void 0:a[s]}}return[]}(p,b,u);if((null===x||void 0===x?void 0:x.length)>=1){var j=nr(m,x.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Method,label:e,range:b}})));if(j.length>=1)return{suggestions:j}}var y=function(e,n,t){var i=(0,Ki.M4)(e,n);if(i=i.match(/([\w_]+)./)){var r=(0,Ki.S0)(e)[i[1]];if(r){var o=$i(r.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t);if(null!==o&&void 0!==o&&o.functions)return null===o||void 0===o?void 0:o.functions}}return[]}(p,b,u);if((null===y||void 0===y?void 0:y.length)>=1){var k=nr(m,y.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Function,label:e,range:b}})));if(k.length>=1)return{suggestions:k}}if((null===a||void 0===a?void 0:a.length)>=1){var Z=new RegExp("\n@".concat(c));p.match(Z)&&f.push.apply(f,(0,o.Z)(nr(m,function(e,n,t){var i=t.block,r=t.blocks,o=i.upstream_blocks,l=(0,rn.HK)(r,(function(e){return e.uuid}));return o.map((function(t,i){var r=l[t].type,o=0===i?"output_0":"args[".concat(i-1,"]");return{label:"df ".concat(t," ").concat(r," block"),kind:e.languages.CompletionItemKind.Variable,documentation:"Variable for ".concat(r," ").concat(t," data."),insertText:o,range:n}}))}(t,b,e))))}if(m.word.match(/i|f/)){var _=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,t=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=(arguments.length>2?arguments[2]:void 0).word,c=new Set,a={};e.forEach((function(e){var n=e.group,t=e.id,i=e.imports;if([Yi.MAGE_LIBRARY,Yi.USER_LIBRARY].includes(n)){var r=t;r.match(/__init__.py/)&&(r=r.replace(/\/__init__.py/,"")),r=r.split(".py")[0].replaceAll("/","."),a[r]=e}var o=t.replace(".py","").replace("/__init__","").split("/");if(1===o.length)c.add("import ".concat(o[0]));else if(o.length>=2){var l=o.slice(0,o.length-1).join(".");c.add("from ".concat(l," import ").concat(o[o.length-1]))}i.forEach((function(e){return c.add(e)}))}));var u,s="i"===r,d="f"===r,f=s?"import":d?"from":"",p=(0,Ki.M4)(n,i);if(s&&p.match(/from/)&&(u=p.match(/from ([A-Za-z0-9_.]+) /)[1]),u&&a[u]){var h=a[u],m=h.classes,v=h.constants,g=h.files,b=h.functions,x=[];return[[v,t.languages.CompletionItemKind.Constant],[m,t.languages.CompletionItemKind.Class],[b,t.languages.CompletionItemKind.Function]].forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],r=n[1];t.forEach((function(e){x.push({filterText:"import ".concat(e),insertText:"import ".concat(e),kind:r,label:e,range:i})}))})),g.forEach((function(e){var n=e.split("/"),r=n[n.length-1].split(".py")[0];x.push({filterText:"import ".concat(r),insertText:"import ".concat(r),kind:t.languages.CompletionItemKind.Variable,label:r,range:i})})),x}return(0,o.Z)(c).map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.File,label:e,range:i}})).concat(Object.entries(a).map((function(e){var n=(0,l.Z)(e,2),r=n[0];return n[1],{filterText:"".concat(f," ").concat(r),insertText:"".concat(f," ").concat(r," "),kind:t.languages.CompletionItemKind.File,label:"".concat(r),range:Ji({},i)}})))}(n,p,m,t,b,e);f.push.apply(f,(0,o.Z)(_))}if(h.tf.CHART===c||h.tf.SCRATCHPAD===c){var C=[];if(h.tf.CHART===c?a.forEach((function(e,n){C.push({block:i.find((function(n){var t=n.uuid;return e===t})),matchIndex:0,variableName:"df_".concat(n+1)})})):h.tf.SCRATCHPAD===c&&function(e,n){return e.map((function(e){return{block:e,regex:new RegExp("([\\w_]+)[ ]*=[ ]*get_variable\\('".concat(n.uuid,"', '").concat(e.uuid,"', 'output_0'\\)"),"g")}}))}(i,r).forEach((function(e){var n=e.block,t=e.regex,i=p.matchAll(t);(0,o.Z)(i).forEach((function(e){var t=null===e||void 0===e?void 0:e.index,i=null===e||void 0===e?void 0:e[1];i&&C.push({block:n,matchIndex:t,variableName:i})}))})),C.length>=1){var O,w=null===(O=p.split("\n")[d.lineNumber-1])||void 0===O?void 0:O.slice(0,m.startColumn-1);if(w){var S=[];if(C.forEach((function(e){var n=e.block,i=e.matchIndex,r=e.variableName,o=new RegExp("".concat(r,"\\["));w.match(o)&&S.push({items:er(t,b,n),matchIndex:i})})),S.length>=1)return{suggestions:nr(m,(0,rn.YC)(S,"matchIndex",{ascending:!1})[0].items)}}}1===g&&(h.tf.CHART===c?f.push.apply(f,(0,o.Z)(nr(m,a.map((function(e,n){var i="df_".concat(n+1);return{label:"".concat(i," ").concat(e," block"),kind:t.languages.CompletionItemKind.Snippet,insertText:i,range:b}}))))):h.tf.SCRATCHPAD===c&&f.push.apply(f,(0,o.Z)(nr(m,function(e,n,t){var i=t.block,r=t.blocks,o=t.pipeline;return r.reduce((function(t,r){var l=r.type,c=r.uuid;return i.uuid!==c&&[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(l)?t.concat({label:"df ".concat(c," ").concat(l," block"),kind:e.languages.CompletionItemKind.Snippet,documentation:"Get the data from ".concat(l," block ").concat(c,"."),insertText:"from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(o.uuid,"', '").concat(c,"', 'output_0')\n"),range:n}):t}),[])}(t,b,e)))))}var E=new Set;i.concat({content:p}).forEach((function(e){var n=e.content;(0,o.Z)(n.matchAll("([A-Za-z_0-9]+)","g")).forEach((function(e){return E.add(e[1])}))}));var P=(0,o.Z)(E);if(P.length){var I=P.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Variable,label:e,range:b}}));f.push.apply(f,(0,o.Z)(nr(m,I)))}return{suggestions:f}}}}var ir=t(66166),rr=t(32365),or=t(80636),lr=t(25958),cr=t(87323);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 ur(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,c.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}function sr(e,n){var t,i,r,a,u,s,p=e.addNewBlock,m=e.addNewBlockMenuOpenIdx,v=e.addWidget,g=e.autocompleteItems,b=e.block,x=e.blockIdx,j=e.blockRefs,y=e.blocks,k=e.dataProviders,Z=e.defaultValue,_=void 0===Z?"":Z,C=e.deleteBlock,O=e.executionState,w=e.fetchFileTree,S=e.fetchPipeline,L=e.height,F=e.interruptKernel,H=e.mainContainerRef,U=e.mainContainerWidth,z=e.messages,G=void 0===z?[]:z,W=e.noDivider,Q=e.onChange,q=e.onClickAddSingleDBTModel,Y=e.openSidekickView,V=e.pipeline,K=e.runBlock,X=e.runningBlocks,J=e.savePipelineContent,$=e.selected,ee=e.setAddNewBlockMenuOpenIdx,ne=e.setAnyInputFocused,te=e.setCreatingNewDBTModel,ie=e.setEditingBlock,ce=e.setOutputBlocks,ae=e.setRecsWindowOpenBlockIdx,ue=e.setSelected,se=e.setSelectedOutputBlock,fe=e.setTextareaFocused,me=e.textareaFocused,ve=e.widgets,ke=(0,d.useContext)(Ie.ThemeContext),Ce=(0,d.useState)(!1),Oe=Ce[0],we=Ce[1],Se=(0,d.useState)(null),Ee=Se[0],Pe=Se[1],Ae=(0,d.useState)(!1),Re=Ae[0],De=Ae[1],Me=(0,d.useState)(!1),Ne=Me[0],Be=Me[1],Le=(0,d.useState)(_),Fe=Le[0],He=Le[1],Ue=(0,d.useState)(null),ze=Ue[0],We=Ue[1],Qe=(0,d.useMemo)((function(){return(null===b||void 0===b?void 0:b.configuration)||{}}),[b]),qe=(0,d.useState)((t={},(0,c.Z)(t,E,Qe.data_provider),(0,c.Z)(t,P,Qe.data_provider_database),(0,c.Z)(t,I,Qe.data_provider_profile),(0,c.Z)(t,T,Qe.data_provider_schema),(0,c.Z)(t,A,Qe.data_provider_table),(0,c.Z)(t,D,Qe.dbt_profile_target),(0,c.Z)(t,R,Qe.dbt_project_name),(0,c.Z)(t,M,Qe.export_write_policy||Gi.APPEND),(0,c.Z)(t,N,Qe.limit),(0,c.Z)(t,B,!!Qe.use_raw_sql),t)),Ye=qe[0],Ve=qe[1],Ke=(0,d.useState)(null),Je=Ke[0],$e=Ke[1],en=(0,d.useState)(!1),nn=en[0],tn=en[1],on=(0,d.useState)(b.uuid),ln=on[0],cn=on[1],an=(0,d.useState)(!1),sn=an[0],dn=an[1],fn=(0,d.useState)(0),pn=fn[0],hn=fn[1],mn=(0,d.useState)(null),vn=mn[0],gn=mn[1],xn=(0,d.useState)(null),jn=xn[0],yn=xn[1],kn=(0,d.useState)(G),Zn=kn[0],Cn=kn[1],On=h.tf.DBT===(null===b||void 0===b?void 0:b.type),wn=(0,ir.Z)(b);(0,d.useEffect)((function(){if(JSON.stringify(b)!=JSON.stringify(wn)){var e=Ci([b]).messages,n=null===e||void 0===e?void 0:e[null===b||void 0===b?void 0:b.uuid];(null===n||void 0===n?void 0:n.length)>=1&&Cn(n)}}),[b,wn,Cn]);var Sn=(0,ir.Z)(G);(0,d.useEffect)((function(){"undefined"!==typeof G&&G.length!==(null===Sn||void 0===Sn?void 0:Sn.length)&&Cn(G)}),[G,Sn,Cn]);var En=(0,d.useMemo)((function(){var e=new Set;return null===k||void 0===k||k.forEach((function(n){var t=n.profiles;e=new Set([].concat((0,o.Z)(e),(0,o.Z)(t)))})),(0,o.Z)(e)}),[k]),Pn=(0,d.useMemo)((function(){return"".concat(null===V||void 0===V?void 0:V.uuid,"/").concat(null===b||void 0===b?void 0:b.uuid,"/codeCollapsed")}),[null===V||void 0===V?void 0:V.uuid,null===b||void 0===b?void 0:b.uuid]),In=(0,d.useMemo)((function(){return"".concat(null===V||void 0===V?void 0:V.uuid,"/").concat(null===b||void 0===b?void 0:b.uuid,"/outputCollapsed")}),[null===V||void 0===V?void 0:V.uuid,null===b||void 0===b?void 0:b.uuid]);(0,d.useEffect)((function(){Be((0,Ze.U2)(Pn,!1)),dn((0,Ze.U2)(In,!1))}),[Pn]);var Tn=(0,d.useRef)(null),Rn=(0,d.useMemo)((function(){return(0,rn.HK)(y,(function(e){return e.uuid}))}),[y]),Dn=(0,d.useMemo)((function(){return!!ve.find((function(e){return e.upstream_blocks.includes(b.uuid)}))}),[b,ve]),Mn=(0,d.useCallback)((function(e){var n=e||{},t=n.block,i=n.code,r=n.disableReset,o=n.runDownstream,l=n.runUpstream,c=n.runTests;if(null===c||"undefined"===typeof c){var a=(t||{}).type;c=[h.tf.DATA_LOADER,h.tf.DATA_EXPORTER,h.tf.TRANSFORMER].includes(a)}K({block:t,code:i||Fe,runDownstream:o||Dn,runTests:c||!1,runUpstream:l||!1}),r||(hn(1+Number(pn)),gn(null),dn(!1))}),[Fe,Dn,pn,K,hn,gn]),Ln=!!X.find((function(e){return e.uuid===b.uuid}))||(null===Zn||void 0===Zn?void 0:Zn.length)>=1&&O!==Bn.uF.IDLE;(0,d.useEffect)((function(){Ln&&yn(Number(new Date))}),[Ln,yn]);var Fn=(0,ir.Z)(O);(0,d.useEffect)((function(){O===Bn.uF.IDLE&&O!==Fn&&gn(Number(new Date))}),[O,Fn,gn]);var Hn=(0,d.useCallback)((function(e){var n=e.editorRect,t=(n.height,n.top),i=e.position.lineNumber;if(null!==H&&void 0!==H&&H.current){var r=H.current.getBoundingClientRect().height,o=i*rr.aU;if(t+o>r){var l=H.current.scrollTop+(o-r+t);H.current.scrollTo(0,l)}else if(o+t<rr.aU){var c=H.current.scrollTop+(o+t-rr.aU);H.current.scrollTo(0,c)}}}),[H]),zn=(0,d.useMemo)((function(){return(null===Je||void 0===Je?void 0:Je.length)>=0?Je.map((function(e){return{data:e,execution_state:Bn.uF.IDLE,type:Bn.Gi.TEXT_PLAIN}})):Zn.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[Je,Zn]),Gn=!!zn.find((function(e){return e.error})),Wn=(0,Xe.qn)(b.type,{blockColor:b.color,theme:ke}).accent,Qn=(null===b||void 0===b||null===(i=b.upstream_blocks)||void 0===i?void 0:i.length)||0,qn=(0,cr.cU)([b],y)[0],Yn=qn.dynamic,Vn=qn.dynamicUpstreamBlock,Kn=qn.reduceOutput,Xn=qn.reduceOutputUpstreamBlock,Jn=(0,d.useMemo)((function(){var e=[];Yn&&e.push({title:"Dynamic",description:"This block will create N blocks for each of its downstream blocks."});var n=Vn&&!Xn;return n&&(e.push({title:"Dynamic child",description:"This block is dynamically created by its upstream parent block that is dynamic."}),Kn&&e.push({title:"Reduce output",description:"Reduce output from all dynamically created blocks into a single array output."})),{borderColorShareProps:{blockColor:null===b||void 0===b?void 0:b.color,blockType:null===b||void 0===b?void 0:b.type,dynamicBlock:Yn,dynamicChildBlock:n,hasError:Gn,selected:$},tags:e}}),[null===b||void 0===b?void 0:b.color,null===b||void 0===b?void 0:b.type,Yn,Vn,Gn,Kn,Xn,$]),nt=Jn.borderColorShareProps,tt=Jn.tags,it=zn.length>=1,rt=(0,d.useCallback)((function(){$||(ne(!1),ue(!0))}),[$,ne,ue]),ot=(0,f.Db)(un.ZP.blocks.pipelines.useUpdate(null===V||void 0===V?void 0:V.uuid,b.uuid),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){tn(!1),S(),w(),He(Fe)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})},onError:function(e){var n=(0,_n.qQ)(e).messages;$e(n)}}),lt=(0,l.Z)(ot,1)[0],ct="CodeBlock/".concat(b.uuid),at=(0,Un.y)(),ut=at.registerOnKeyDown,st=at.unregisterOnKeyDown;(0,d.useEffect)((function(){return function(){st(ct)}}),[st,ct]),ut(ct,(function(e,n,t){nn&&String(t[0])===String(ye.Uq)&&String(t[1])!==String(ye.zX)?b.uuid===ln?e.target.blur():lt({block:ur(ur({},b),{},{name:ln})}):$&&((0,_e.y)([ye.zX,ye.Uq],n)||(0,_e.y)([ye.PQ,ye.Uq],n)?Mn({block:b}):(0,_e.y)([ye.XR,ye.Uq],n)&&(e.preventDefault(),p({language:b.language,type:b.type,upstream_blocks:[b.uuid]}),Mn({block:b})))}),[p,b,nn,ln,Mn,$,lt]),(0,d.useEffect)((function(){var e;return jn&&(e=setInterval((function(){return We(Number(new Date))}),1e3)),function(){return clearInterval(e)}}),[jn]);var dt=(0,d.useCallback)((function(e){return(0,c.Z)({},h.tf.SCRATCHPAD,(0,o.Z)(Fi(e,y,"block_menu/scratchpad",p)).map((function(e){return ur(ur({},e),{},{onClick:function(){return J().then((function(){return e.onClick()}))}})})))[e.type]}),[p,y,J]),ft=(0,d.useMemo)((function(){var e;return(null===b||void 0===b||null===(e=b.metadata)||void 0===e?void 0:e.dbt)||{project:null,projects:{}}}),[b]),pt=(0,d.useMemo)((function(){return ft.projects||{}}),[ft]),ht=(0,d.useMemo)((function(){return ft.project||Ye.dbt_project_name}),[Ye,ft]),mt=(0,d.useMemo)((function(){return pt[ht]||{targets:[]}}),[ht,pt]),vt=(0,d.useMemo)((function(){return(0,le.jsx)(Nn.Z,{autoHeight:!0,autocompleteProviders:Ee,height:L,language:b.language,onChange:function(e){He(e),null===Q||void 0===Q||Q(e)},onDidChangeCursorPosition:Hn,placeholder:h.tf.DBT===b.type&&h.t6.YAML===b.language?"e.g. --select ".concat(ht||"project","/models --exclude ").concat(ht||"project","/models/some_dir"):"Start typing here...",selected:$,setSelected:ue,setTextareaFocused:fe,shortcuts:[function(e,n){return(0,or.Q)(e,(function(){Mn({block:b,code:n.getValue()})}))}],textareaFocused:me,value:Fe,width:"100%"})}),[Ee,b,Fe,ht,L,Q,Hn,Mn,$,He,ue,fe,me]);(0,d.useEffect)((function(){Pe({python:tr({autocompleteItems:g,block:b,blocks:y,pipeline:V})})}),[g,b,y,V]);var gt=(0,d.useMemo)((function(){return(0,le.jsx)(Ii,ur(ur({},nt),{},{block:b,collapsed:sn,isInProgress:Ln,mainContainerWidth:U,messages:zn,openSidekickView:Y,pipeline:V,runCount:pn,runEndTime:vn,runStartTime:jn,selected:$,setCollapsed:function(e){dn((function(){return(0,Ze.t8)(In,e),e}))},setOutputBlocks:ce,setSelectedOutputBlock:se}))}),[b,nt,Ln,U,zn,Y,sn,In,V,pn,vn,jn,$,ce,dn,se]),bt=(0,d.useCallback)((function(){return De(!1)}),[]),xt=(0,d.useCallback)((function(e){Ve((function(n){var t=ur(ur({},n),e);return(t.data_provider&&t.data_provider_profile||t.dbt_profile_target||t.dbt_project_name)&&J({block:{configuration:t,uuid:b.uuid}}),t}))}),[b,J]),yt=Lt.BIGQUERY===Ye.data_provider||Lt.SNOWFLAKE===Ye.data_provider,kt=(0,d.useMemo)((function(){return(null===y||void 0===y?void 0:y.length)||0}),[y]);return(0,le.jsxs)("div",{ref:n,style:{position:"relative",zIndex:x===m?kt+9:null},children:[(0,le.jsx)(Xe.nz,ur(ur({},nt),{},{onClick:function(){return rt()},zIndex:kt+1-(x||0),children:(0,le.jsxs)(he.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,le.jsxs)(An.Z,{alignItems:"center",flex:1,children:[(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(si,{children:h.dO[b.language]}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(Te.Z,{color:Wn,size:1.5*re.iI,square:!0}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(It.Z,{items:dt(b),onClickCallback:bt,onClickOutside:bt,open:Re,parentRef:Tn,uuid:"CodeBlock/block_menu",children:(0,le.jsx)(xe.ZP,{color:Wn,monospace:!0,children:null===(r=On?h.tf.DBT:h.V4[b.type])||void 0===r?void 0:r.toUpperCase()})}),h.tf.SCRATCHPAD===b.type&&(0,le.jsxs)(le.Fragment,{children:["\xa0",(0,le.jsx)(de.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return De(!0)},transparent:!0,children:(0,le.jsx)(Ge.K5,{muted:!0})})]}),(0,le.jsx)(be.Z,{mr:1})]}),(0,le.jsx)(be.Z,{mr:re.cd}),(0,le.jsx)(Ge.iU,{size:1.5*re.iI}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsxs)(he.Z,{alignItems:"center",children:[On&&h.t6.YAML!==b.language&&(0,le.jsx)(xe.ZP,{monospace:!0,muted:!0,children:(0,lr.$)(b,{fullPath:!0})}),(!On||h.t6.YAML===b.language)&&(0,le.jsx)(jt,{bold:!1,inputValue:ln,monospace:!0,muted:!0,notRequired:!0,onBlur:function(){return setTimeout((function(){ne(!1),tn(!1)}),300)},onChange:function(e){cn(e.target.value),e.preventDefault()},onClick:function(){ne(!0),tn(!0)},onFocus:function(){ne(!0),tn(!0)},stacked:!0,value:!nn&&b.uuid}),nn&&!On&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(be.Z,{ml:1}),(0,le.jsx)($n.Z,{onClick:function(){return J({block:{name:ln,uuid:b.uuid}}).then((function(){tn(!1),S(),w()}))},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]}),(0,le.jsx)(be.Z,{mr:2}),!h.iZ.includes(b.type)&&(0,le.jsx)(et.Z,{appearBefore:!0,block:!0,label:"\n ".concat((0,oe._6)("parent block",Qn),". ").concat(0===Qn?"Click to select 1 or more blocks to depend on.":"Edit parent blocks.","\n "),size:null,widthFitContent:Qn>=1,children:(0,le.jsx)(de.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){var e;ue(!0),ie({upstreamBlocks:{block:b,values:null===(e=b.upstream_blocks)||void 0===e?void 0:e.map((function(e){return{uuid:e}}))}})},children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsxs)(xe.ZP,{monospace:Qn>=1,small:Qn>=1,underline:0===Qn,children:[0===Qn&&"Edit parent blocks",Qn>=1&&(0,oe._6)("parent block",Qn)]}),(0,le.jsx)(be.Z,{mr:1}),0===Qn&&(0,le.jsx)(Ge.Jj,{size:3*re.iI}),Qn>=1&&(0,le.jsx)(Ge.eV,{size:3*re.iI})]})})})]}),(0,le.jsx)(Wi,{addNewBlock:p,addWidget:v,block:b,blocks:y,deleteBlock:C,executionState:O,interruptKernel:F,pipelineType:null===V||void 0===V?void 0:V.type,runBlock:Mn,savePipelineContent:J,setOutputCollapsed:dn,visible:$||Ln}),(0,le.jsx)(be.Z,{px:1,children:(0,le.jsx)(de.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){Be((function(e){return(0,Ze.t8)(Pn,!e),!e})),Ne||dn((function(){return(0,Ze.t8)(In,!0),!0}))},transparent:!0,children:Ne?(0,le.jsx)(Ge._M,{muted:!0,size:2*re.iI}):(0,le.jsx)(Ge.Kh,{muted:!0,size:2*re.iI})})})]})})),(0,le.jsxs)(Xe.Nk,{onClick:function(){return rt()},children:[(0,le.jsxs)(Xe.jv,ur(ur({},nt),{},{className:$&&me?"selected":null,hasOutput:it,children:[h.tf.DBT===b.type&&!Ne&&(0,le.jsxs)(Xe.y9,{children:[(0,le.jsxs)(he.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,le.jsxs)(An.Z,{alignItems:"center",children:[h.t6.YAML===b.language&&(0,le.jsxs)(Vi.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){ne(!1)}),300)},onChange:function(e){var n;xt((n={},(0,c.Z)(n,D,""),(0,c.Z)(n,R,e.target.value),n)),e.preventDefault()},onFocus:function(){ne(!0)},placeholder:"Project",small:!0,value:Ye.dbt_project_name||"",children:[(0,le.jsx)("option",{value:""}),Object.keys(pt||{}).map((function(e){return(0,le.jsx)("option",{value:e,children:e},e)}))]}),h.t6.YAML!==b.language&&(0,le.jsx)(xe.ZP,{monospace:!0,small:!0,children:ht}),(0,le.jsx)(be.Z,{mr:2}),(0,le.jsx)(xe.ZP,{monospace:!0,muted:!0,small:!0,children:"Target"}),(0,le.jsx)("span",{children:"\xa0"}),(0,le.jsxs)(Vi.Z,{compact:!0,disabled:!ht,monospace:!0,onBlur:function(){return setTimeout((function(){ne(!1)}),300)},onChange:function(e){xt((0,c.Z)({},D,e.target.value)),e.preventDefault()},onFocus:function(){ne(!0)},placeholder:ht?null:"Select project first",small:!0,value:Ye.dbt_profile_target||"",children:[(0,le.jsx)("option",{value:""}),null===(a=mt.targets)||void 0===a?void 0:a.map((function(e){return(0,le.jsx)("option",{value:e,children:e},e)}))]})]}),h.t6.YAML!==b.language&&(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(et.Z,{appearBefore:!0,block:!0,description:(0,le.jsxs)(xe.ZP,{default:!0,inline:!0,children:["Limit the number of results that are returned when running this block in the notebook.",(0,le.jsx)("br",{}),"This limit won\u2019t affect the number of results returned when running the pipeline end-to-end."]}),size:null,widthFitContent:!0,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Ge.kI,{muted:!0}),(0,le.jsx)("span",{children:"\xa0"}),(0,le.jsx)(xe.ZP,{monospace:!0,muted:!0,small:!0,children:"Sample limit"}),(0,le.jsx)("span",{children:"\xa0"})]})}),(0,le.jsx)(je.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){ne(!1)}),300)},onChange:function(e){xt((0,c.Z)({},N,e.target.value)),e.preventDefault()},onFocus:function(){ne(!0)},small:!0,type:"number",value:Ye.limit||"",width:10*re.iI}),(0,le.jsx)(be.Z,{mr:5})]})]}),h.t6.YAML===b.language&&(0,le.jsx)(be.Z,{mt:1,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsxs)(An.Z,{flex:1,children:[(0,le.jsxs)(xe.ZP,{monospace:!0,default:!0,small:!0,children:["dbt run ",(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,small:!0,children:"[type your --select and --exclude syntax below]"})]}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsxs)(xe.ZP,{monospace:!0,muted:!0,small:!0,children:["(paths start from ",(null===Ye||void 0===Ye?void 0:Ye.dbt_project_name)||"project"," folder)"]})]}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(xe.ZP,{muted:!0,small:!0,children:(0,le.jsx)($n.Z,{href:"https://docs.getdbt.com/reference/node-selection/syntax#examples",openNewWindow:!0,small:!0,children:"Examples"})}),(0,le.jsx)(be.Z,{mr:5})]})})]}),h.t6.SQL===b.language&&!Ne&&h.tf.DBT!==b.type&&(0,le.jsx)(Xe.y9,{children:(0,le.jsxs)(he.Z,{justifyContent:"space-between",children:[(0,le.jsxs)(he.Z,{children:[(0,le.jsxs)(Vi.Z,{compact:!0,label:"Connection",onChange:function(e){return xt((0,c.Z)({},E,e.target.value))},small:!0,value:Ye.data_provider,children:[(0,le.jsx)("option",{value:""}),null===k||void 0===k?void 0:k.map((function(e){var n=e.id,t=e.value;return(0,le.jsx)("option",{value:t,children:n},n)}))]}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsxs)(Vi.Z,{compact:!0,label:"Profile",onChange:function(e){return xt((0,c.Z)({},I,e.target.value))},small:!0,value:Ye.data_provider_profile,children:[(0,le.jsx)("option",{value:""}),null===En||void 0===En?void 0:En.map((function(e){return(0,le.jsx)("option",{value:e,children:e},e)}))]}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(he.Z,{alignItems:"center",children:(0,le.jsx)(et.Z,{block:!0,description:(0,le.jsxs)(xe.ZP,{default:!0,inline:!0,children:["If checked, you\u2019ll have to write your own custom",(0,le.jsx)("br",{}),"CREATE TABLE commands and INSERT commands.",(0,le.jsx)("br",{}),"Separate your commands using a semi-colon: ",(0,le.jsx)(xe.ZP,{default:!0,inline:!0,monospace:!0,children:";"})]}),size:null,widthFitContent:!0,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(pe.Z,{checked:Ye.use_raw_sql,label:(0,le.jsx)(xe.ZP,{muted:!0,small:!0,children:"Use raw SQL"}),onClick:function(){return xt((0,c.Z)({},B,!Ye.use_raw_sql))}}),(0,le.jsx)("span",{children:"\xa0"}),(0,le.jsx)(Ge.kI,{muted:!0})]})})}),!Ye.use_raw_sql&&(0,le.jsxs)(le.Fragment,{children:[yt&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(he.Z,{alignItems:"center",children:(0,le.jsx)(je.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){ne(!1)}),300)},onChange:function(e){xt((0,c.Z)({},P,e.target.value)),e.preventDefault()},onFocus:function(){ne(!0)},label:"Database",small:!0,value:Ye.data_provider_database,width:10*re.iI})})]}),(0,le.jsx)(be.Z,{mr:1}),Ye.data_provider!==Qi.MYSQL&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(et.Z,{block:!0,description:(0,le.jsxs)(xe.ZP,{default:!0,inline:!0,children:["Schema that is used when creating a table and inserting values.",(0,le.jsx)("br",{}),"This field is required."]}),size:null,widthFitContent:!0,children:(0,le.jsx)(he.Z,{alignItems:"center",children:(0,le.jsx)(je.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){ne(!1)}),300)},onChange:function(e){xt((0,c.Z)({},T,e.target.value)),e.preventDefault()},onFocus:function(){ne(!0)},label:"Schema",small:!0,value:Ye.data_provider_schema,width:10*re.iI})})}),(0,le.jsx)(be.Z,{mr:1})]}),(0,le.jsx)(et.Z,{block:!0,description:(0,le.jsxs)(xe.ZP,{default:!0,inline:!0,children:["This value will be used as the table name.",(0,le.jsx)("br",{}),"If blank, the default table name will be:",(0,le.jsx)("br",{}),(0,le.jsxs)(xe.ZP,{inline:!0,monospace:!0,children:[null===V||void 0===V?void 0:V.uuid,"_",null===b||void 0===b?void 0:b.uuid]}),(0,le.jsx)("br",{}),"This field is optional."]}),size:null,widthFitContent:!0,children:(0,le.jsx)(he.Z,{alignItems:"center",children:(0,le.jsx)(je.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){ne(!1)}),300)},onChange:function(e){xt((0,c.Z)({},A,e.target.value)),e.preventDefault()},onFocus:function(){ne(!0)},label:"Table (optional)",small:!0,value:Ye.data_provider_table,width:20*re.iI})})})]})]}),!Ye.use_raw_sql&&(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(et.Z,{appearBefore:!0,block:!0,description:(0,le.jsxs)(xe.ZP,{default:!0,inline:!0,children:["How do you want to handle existing data with the same",yt?" database,":""," schema, and table name?",(0,le.jsx)("br",{}),(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:"Append"}),": add rows to the existing table.",(0,le.jsx)("br",{}),(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:"Replace"}),": delete the existing data.",(0,le.jsx)("br",{}),(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:"Fail"}),": raise an error during execution."]}),size:null,widthFitContent:!0,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Ge.kI,{muted:!0}),(0,le.jsx)("span",{children:"\xa0"}),(0,le.jsx)(xe.ZP,{monospace:!0,muted:!0,small:!0,children:"Write policy:"}),(0,le.jsx)("span",{children:"\xa0"})]})}),(0,le.jsxs)(Vi.Z,{compact:!0,label:"strategy",onChange:function(e){return xt((0,c.Z)({},M,e.target.value))},small:!0,value:Ye.export_write_policy,children:[(0,le.jsx)("option",{value:""}),null===qi||void 0===qi?void 0:qi.map((function(e){return(0,le.jsx)("option",{value:e,children:(0,oe.kC)(e)},e)}))]}),(0,le.jsx)(be.Z,{mr:5})]})]})}),tt.length>=1&&(0,le.jsx)(Xe.y9,{normalPadding:!0,children:(0,le.jsx)(he.Z,{children:tt.map((function(e,n){var t=e.description,i=e.title;return(0,le.jsx)(be.Z,{ml:n>=1?1:0,children:(0,le.jsx)(et.Z,{block:!0,description:t,size:null,widthFitContent:!0,children:(0,le.jsx)(si,{children:i})})},i)}))})}),b.upstream_blocks.length>=1&&!Ne&&h.f2.includes(b.type)&&(null===V||void 0===V?void 0:V.type)!==ge.q.STREAMING&&(0,le.jsxs)(Xe.y9,{children:[(0,le.jsxs)(xe.ZP,{small:!0,children:[h.t6.SQL!==b.language&&"Positional arguments for decorated function:",h.t6.SQL===b.language&&"Tables available in query from upstream blocks:"]}),(0,le.jsxs)(be.Z,{mt:1,children:[h.t6.SQL!==b.language&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(xe.ZP,{monospace:!0,muted:!0,small:!0,children:[h.tf.DATA_EXPORTER===b.type&&"@data_exporter",h.tf.DATA_LOADER===b.type&&"@data_loader",h.tf.TRANSFORMER===b.type&&"@transformer"]}),(0,le.jsxs)(xe.ZP,{monospace:!0,muted:!0,small:!0,children:["def ",(h.tf.DATA_EXPORTER===b.type?"export_data":h.tf.DATA_LOADER===b.type&&"load_data")||h.tf.TRANSFORMER===b.type&&"transform_df","(",b.upstream_blocks.map((function(e,n){return n>=1?"df_".concat(n+1):"df"})).join(", "),"):"]})]}),b.upstream_blocks.map((function(e,n){var t=Rn[e],i=(0,Xe.qn)(null===t||void 0===t?void 0:t.type,{blockColor:null===t||void 0===t?void 0:t.color,theme:ke}).accent;return(0,le.jsxs)("div",{children:[h.t6.SQL!==b.language&&(0,le.jsxs)(xe.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0df",n>=1?"_".concat(n+1):null]}),h.t6.SQL===b.language&&(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"{{ df_".concat(n+1," }}")})," ",(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"\u2192"})," ",(0,le.jsx)($n.Z,{color:i,onClick:function(){var e,n,i=null===j||void 0===j||null===(e=j.current)||void 0===e?void 0:e["".concat(null===t||void 0===t?void 0:t.type,"s/").concat(null===t||void 0===t?void 0:t.uuid,".py")];null===i||void 0===i||null===(n=i.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,le.jsx)(xe.ZP,{color:i,inline:!0,monospace:!0,small:!0,children:e})})]},e)}))]})]}),!(null!==b&&void 0!==b&&b.error)&&(0,le.jsx)(le.Fragment,{children:Ne?(0,le.jsx)(be.Z,{px:1,children:(0,le.jsxs)(xe.ZP,{monospace:!0,muted:!0,children:["(",(0,oe._6)("line",null===Fe||void 0===Fe?void 0:Fe.split(/\r\n|\r|\n/).length)," collapsed)"]})}):vt}),(null===b||void 0===b?void 0:b.error)&&(0,le.jsxs)(be.Z,{p:re.cd,children:[(0,le.jsx)(xe.ZP,{bold:!0,danger:!0,children:null===b||void 0===b||null===(u=b.error)||void 0===u?void 0:u.error}),(0,le.jsx)(xe.ZP,{muted:!0,children:null===b||void 0===b||null===(s=b.error)||void 0===s?void 0:s.message})]}),Ln&&ze&&ze>jn&&(0,le.jsx)(Xe.HC,{children:(0,le.jsxs)(xe.ZP,{muted:!0,children:["".concat(Math.round((ze-jn)/1e3)),"s"]})})]})),it&>]}),!W&&(0,le.jsxs)(Xe.gE,{additionalZIndex:kt-x,onMouseEnter:function(){return we(!0)},onMouseLeave:function(){we(!1),ee(null)},children:[Oe&&(0,le.jsx)(be.Z,{mt:2,children:(0,le.jsx)(ii,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=Li(b,e);return[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(b.type)&&h.tf.SCRATCHPAD===e.type&&(n="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(V.uuid,"', '").concat(b.uuid,"', 'output_0')")),n=ei(e,n),h.t6.SQL===b.language&&(n=$t(n),t=ur(ur({},(0,bn.GL)(b.configuration,[E,P,I,T,M])),t)),p(ur(ur({},e),{},{configuration:t,content:n,upstream_blocks:i}))},blockIdx:x,compact:!0,onClickAddSingleDBTModel:q,pipeline:V,setAddNewBlockMenuOpenIdx:ee,setCreatingNewDBTModel:te,setRecsWindowOpenBlockIdx:ae})}),(0,le.jsx)(Xe.t1,{className:"block-divider-inner"})]})]})}var dr=d.forwardRef(sr),fr=t(90880),pr=6.25*re.iI,hr=(re.iI,100*re.iI),mr=Ie.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%);",""],mn.n_,hr,(function(e){return"\n box-shadow: ".concat((e.theme||hn.Z).shadow.window,";\n background-color: ").concat((e.theme||hn.Z).background.panel,";\n ")})),vr=(0,Ie.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],pr,re.iI,re.cd*re.iI,(function(e){return"\n background-color: ".concat((e.theme||hn.Z).background.output,";\n ")})),gr=Ie.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],vr,mn.n_,mn.n_,(function(e){return"\n border-bottom: ".concat(mn.YF,"px ").concat(mn.M8," ").concat((e.theme||hn.Z).borders.medium,";\n ")})),br=Ie.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],re.iI,tt.w5,(0,fr.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*re.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*pr,"px);\n ")})),xr=Ie.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],vr,mn.n_,mn.n_,(function(e){return"\n border-top: ".concat(mn.YF,"px ").concat(mn.M8," ").concat((e.theme||hn.Z).borders.medium,";\n ")})),jr=Ie.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*re.iI,2*re.iI,(function(e){return"\n border-bottom: ".concat(mn.YF,"px ").concat(mn.M8," ").concat((e.theme||hn.Z).borders.medium,";\n ")}));function yr(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?yr(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Zr,_r,Cr,Or,wr=function(e){var n=e.blocks,t=e.creatingNewDBTModel,i=e.dbtModelName,r=e.files,o=e.onClose,l=e.onOpenFile,c=e.setDbtModelName,a=(0,d.useState)(!1),u=a[0],s=a[1],f=(0,d.useState)(null),p=f[0],m=f[1],v=(0,d.useMemo)((function(){var e,n,t=null===(e=(0,rn.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).filter((function(e){return"models"===e.name}));t.length>=1&&i.push(kr(kr({},e),{},{children:t}))})),i}),[r]),g=(0,d.useMemo)((function(){return(0,rn.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,le.jsxs)(mr,{children:[(0,le.jsxs)(gr,{children:[(0,le.jsx)(An.Z,{alignItems:"center",children:(0,le.jsx)(xe.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new DBT model":"Select DBT model file"})}),(0,le.jsx)(de.Z,{iconOnly:!0,onClick:o,children:(0,le.jsx)(Ge.x8,{muted:!0})})]}),t&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(jr,{children:(0,le.jsx)(jt,{inputValue:i,label:"Model name (cannot be changed):",labelColor:hn.Z.accent.dbt,minWidth:38*re.iI,notRequired:!0,onBlur:function(){s(!1)},onChange:function(e){c(e.target.value),e.preventDefault()},onClick:function(){s(!0)},onFocus:function(){s(!0)},placeholder:"Enter name",required:!0,stacked:!0,value:!u&&i})}),(0,le.jsxs)(jr,{children:[(0,le.jsx)(xe.ZP,{bold:!0,color:hn.Z.accent.dbt,children:"Select folder location:"}),(0,le.jsx)(xe.ZP,{bold:!0,muted:!p,children:p?"dbt/".concat(p):"Choose folder below"})]})]}),(0,le.jsx)(br,{children:(0,le.jsx)(Tn,{allowSelectingFolders:t,disableContextMenu:!0,files:v,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)}))):!!g[e]||!(null!==n&&void 0!==n&&n.length)&&!e.match(new RegExp(".".concat(h.t6.SQL,"$")))},openFile:l,selectFile:m,uncollapsed:!0,useRootFolder:!0})}),t&&(0,le.jsx)(xr,{children:(0,le.jsx)(de.Z,{backgroundColor:i&&p?hn.Z.accent.dbt:hn.Z.monotone.grey500,disabled:!i||!p,onClick:function(){return l(p)},padding:"6px 8px",children:"Create model"})})]})},Sr=t(4804),Er=t(65730),Pr=t(87372);!function(e){e.FULL_TABLE="FULL_TABLE",e.INCREMENTAL="INCREMENTAL",e.LOG_BASED="LOG_BASED"}(_r||(_r={})),function(e){e.IGNORE="IGNORE",e.UPDATE="UPDATE"}(Cr||(Cr={})),function(e){e.DATE_TIME="date-time",e.UUID="uuid"}(Or||(Or={}));var Ir,Tr="datetime",Ar=(Zr={},(0,c.Z)(Zr,Or.DATE_TIME,Tr),(0,c.Z)(Zr,Or.UUID,Or.UUID),Zr);!function(e){e.ARRAY="array",e.BOOLEAN="boolean",e.INTEGER="integer",e.NULL="null",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(Ir||(Ir={}));var Rr,Dr,Mr,Nr,Br,Lr=[Ir.ARRAY,Ir.BOOLEAN,Tr,Ir.INTEGER,Ir.NULL,Ir.NUMBER,Ir.OBJECT,Ir.STRING,Or.UUID];!function(e){e.PROPERTIES="properties"}(Rr||(Rr={})),function(e){e.AUTOMATIC="automatic",e.AVAILABLE="available",e.UNSUPPORTED="unsupported"}(Dr||(Dr={})),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"}(Mr||(Mr={})),function(e){e.AMPLITUDE="amplitude",e.BIGQUERY="bigquery",e.CHARGEBEE="chargebee",e.GOOGLE_SEARCH_CONSOLE="google_search_console",e.GOOGLE_SHEETS="google_sheets",e.INTERCOM="intercom",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.REDSHIFT="redshift",e.SALESFORCE="salesforce",e.STRIPE="stripe"}(Nr||(Nr={})),function(e){e.BIGQUERY="bigquery",e.DELTA_LAKE_S3="delta_lake_s3",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.SNOWFLAKE="snowflake"}(Br||(Br={}));var Fr=t(32316),Hr=Ie.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||hn.Z.background).popup,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.chart||hn.Z.chart).primary,";\n ")}),(function(e){return!e.small&&"\n border-radius: ".concat((re.iI+oi.Al)/2,"px;\n height: ").concat(1.5*re.iI+oi.Al,"px;\n padding: ").concat(re.iI/1.5,"px ").concat(1.25*re.iI,"px;\n ")}),(function(e){return e.small&&"\n border-radius: ".concat((re.iI/2+oi.Al)/2,"px;\n height: ").concat(oi.Al+re.iI/2+2,"px;\n padding: ").concat(re.iI/4,"px ").concat(re.iI,"px;\n ")}),(function(e){return e.border&&"\n border: 1px solid ".concat((e.theme.content||hn.Z.content).muted,";\n ")})),Ur=function(e){var n=e.border,t=e.children,i=e.label,r=e.onClick,o=e.primary,l=e.small;return(0,le.jsx)(Hr,{border:n,primary:o,small:l,children:(0,le.jsx)(de.Z,{basic:!0,noPadding:!0,noBackground:!0,onClick:r,transparent:!0,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[t,i&&(0,le.jsx)(xe.ZP,{small:l,children:i}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(Ge.x8,{default:o,muted:!o,size:l?re.iI:1.25*re.iI})]})})})},zr=t(85307);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 Wr(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,c.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 Qr="4px",qr=[Br.BIGQUERY,Br.DELTA_LAKE_S3];var Yr=function(e){var n=e.destination,t=e.isLoadingLoadSampleData,i=e.loadSampleData,r=e.source,o=e.stream,c=e.streams,a=e.updateAllStreams,u=e.updateMetadataForColumns,s=e.updateSchemaProperty,f=e.updateStream,p=(0,d.useRef)(null),h=o.bookmark_properties,m=o.destination_table,v=void 0===m?"":m,g=o.key_properties,b=o.metadata,x=o.partition_keys,j=o.replication_method,y=o.schema.properties,k=o.tap_stream_id,Z=o.unique_constraints,_=o.unique_conflict_method,C=(0,d.useState)(v),O=C[0],w=C[1],S=(0,d.useState)(!1),E=S[0],P=S[1],I=(0,d.useState)(null),T=I[0],A=I[1],R=(0,ir.Z)(k);(0,d.useEffect)((function(){R!==k&&(w(v),A(null))}),[v,j,k,R,_]);var D=(0,d.useMemo)((function(){return(0,rn.HK)(b,(function(e){return e.breadcrumb.join("/")}))}),[b]),M=(0,d.useMemo)((function(){var e;return null===(e=(0,rn.sE)(b,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[b]),N=(0,d.useMemo)((function(){return M[Mr.KEY_PROPERTIES]||[]}),[M]),B=(0,d.useMemo)((function(){return M[Mr.REPLICATION_KEYS]||[]}),[M]),L=qr.includes(n),F=c.length>1,H=(0,d.useMemo)((function(){var e=[],t=[],i=(0,rn.mr)(Object.entries(y)).map((function(i,r){var o=(0,l.Z)(i,2),c=o[0],d=o[1],p=d.anyOf,m=void 0===p?[]:p,v=d.format,b=d.type,j=void 0===b?[]:b,y=new Set(Array.isArray(j)?j:[j]),_=new Set(y);m.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){y.add(e),_.add(e)})):(y.add(t),_.add(t),n&&_.add(n))}));var C=Array.from(y);v&&_.add(v);var O=(D["properties/".concat(c)]||{}).metadata,w=(O.inclusion,O.selected);e.push(w),t.push(c);var S=Lr.reduce((function(e,n){return C.indexOf(n)>=0||Tr===String(n)&&Or.DATE_TIME===v||Or.UUID===String(n)&&Or.UUID===v?e:e.concat((0,le.jsx)("option",{value:n,children:n},n))}),[]),E=C.findIndex((function(e){return e===Ir.STRING})),P=[(0,le.jsx)(pe.Z,{checked:w,onClick:function(){u(k,[c],{selected:!w})}},"".concat(k,"/").concat(c,"/selected")),(0,le.jsx)(xe.ZP,{children:c},"".concat(k,"/").concat(c,"/name")),(0,le.jsxs)(he.Z,{children:[(0,le.jsx)(An.Z,{flex:1,children:(0,le.jsx)(he.Z,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:C.map((function(e,n){return(0,le.jsx)(be.Z,{mb:1,mr:1,children:(0,le.jsx)(Ur,{border:!0,label:v&&Ir.STRING===e&&E===n?Ar[v]:e,onClick:function(){var n={format:v,type:C.filter((function(n){return n!==e}))};Or.DATE_TIME!==v&&Or.UUID!==v||Ir.STRING!==e||(n.format=null),s(k,c,n)},small:!0})},"".concat(k,"/").concat(c,"/").concat(e,"/").concat(n,"/chip"))}))})}),S.length>=1&&(0,le.jsxs)(Vi.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:v,type:C};Tr===String(n)?(t.format=Or.DATE_TIME,t.type.push(Ir.STRING)):Or.UUID===String(n)?(t.format=Or.UUID,t.type.push(Ir.STRING)):t.type.push(n),s(k,c,t)},primary:!0,small:!0,value:"",width:10*re.iI,children:[(0,le.jsx)("option",{value:""}),S]})]},"".concat(k,"/").concat(c,"/type")),(0,le.jsx)(pe.Z,{checked:!(null===Z||void 0===Z||!Z.includes(c)),disabled:N.length>=1&&!N.includes(c),onClick:N.length>=1&&!N.includes(c)?null:function(){return f(k,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(c)?e.unique_constraints=(0,rn.Od)(e.unique_constraints,(function(e){return c===e})):e.unique_constraints=[c].concat(e.unique_constraints||[]),e}))}},"".concat(k,"/").concat(c,"/unique")),(0,le.jsx)(pe.Z,{checked:!(null===h||void 0===h||!h.includes(c)),disabled:B.length>=1&&!B.includes(c),onClick:B.length>=1&&!B.includes(c)?null:function(){return f(k,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(c)?e.bookmark_properties=(0,rn.Od)(e.bookmark_properties,(function(e){return c===e})):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),e}))}},"".concat(k,"/").concat(c,"/bookmark")),(0,le.jsx)(pe.Z,{checked:!(null===g||void 0===g||!g.includes(c)),onClick:function(){return f(k,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(c)?e.key_properties=(0,rn.Od)(e.key_properties,(function(e){return c===e})):e.key_properties=[c].concat(e.key_properties||[]),e}))}},"".concat(k,"/").concat(c,"/key_property"))];if(L){var I=n!==Br.DELTA_LAKE_S3,R=I&&(N.includes(c)||!_.has(Or.DATE_TIME));P.push((0,le.jsx)(pe.Z,{checked:!(null===x||void 0===x||!x.includes(c)),disabled:R,onClick:R?null:function(){return f(k,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(c)?e.partition_keys=(0,rn.Od)(e.partition_keys,(function(e){return c===e})):I&&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(k,"/").concat(c,"/partition_key")))}if(F){var M=T===r;P.push((0,le.jsx)(de.Z,{compact:!0,disabled:M,onClick:function(){A(r),setTimeout((function(){return A(null)}),2e3),a((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==k&&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,a,u,s,d,f;e.schema.properties[c]={format:v||null,type:C};var p=null===(i=(0,rn.sE)((null===e||void 0===e?void 0:e.metadata)||[],(function(e){return 0===e.breadcrumb.length})))||void 0===i?void 0:i.metadata,m=p[Mr.REPLICATION_KEYS]||[],b=p[Mr.KEY_PROPERTIES]||[];null===Z||void 0===Z||!Z.includes(c)||null!==e&&void 0!==e&&null!==(r=e.unique_constraints)&&void 0!==r&&r.includes(c)||!b.includes(c)?null!==Z&&void 0!==Z&&Z.includes(c)||null===e||void 0===e||null===(o=e.unique_constraints)||void 0===o||!o.includes(c)||(e.unique_constraints=(0,rn.Od)(e.unique_constraints,(function(e){return c===e}))):e.unique_constraints=[c].concat(e.unique_constraints||[]),null===h||void 0===h||!h.includes(c)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(c)||!m.includes(c)?null!==h&&void 0!==h&&h.includes(c)||null===e||void 0===e||null===(a=e.bookmark_properties)||void 0===a||!a.includes(c)||(e.bookmark_properties=(0,rn.Od)(e.bookmark_properties,(function(e){return c===e}))):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),null===g||void 0===g||!g.includes(c)||null!==e&&void 0!==e&&null!==(u=e.key_properties)&&void 0!==u&&u.includes(c)?null!==g&&void 0!==g&&g.includes(c)||null===e||void 0===e||null===(s=e.key_properties)||void 0===s||!s.includes(c)||(e.key_properties=(0,rn.Od)(e.key_properties,(function(e){return c===e}))):e.key_properties=[c].concat(e.key_properties||[]),null===x||void 0===x||!x.includes(c)||null!==e&&void 0!==e&&null!==(d=e.partition_keys)&&void 0!==d&&d.includes(c)?null!==x&&void 0!==x&&x.includes(c)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(c)||(e.partition_keys=(0,rn.Od)(e.partition_keys,(function(e){return c===e}))):e.partition_keys=[c].concat(e.partition_keys||[])}return Wr({},e)}))},pill:!0,secondary:!0,children:(0,le.jsx)(xe.ZP,{success:M,children:M?"Applied!":"Apply"})}))}return P})),r=e.every((function(e){return e})),o=[null,2,1,null,null,null],c=[{label:function(){return(0,le.jsx)(pe.Z,{checked:r,onClick:function(){u(k,t,{selected:!r})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{uuid:"Unique"},{uuid:"Bookmark"},{uuid:"Key prop"}];return L&&(o.push(null),c.push({uuid:"Partition key"})),F&&(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,le.jsx)(zr.cl,{children:(0,le.jsx)(pn.Z,{alignTop:!0,columnFlex:o,columns:c,rows:i,stickyHeader:!0})})}),[h,n,F,T,g,D,x,y,L,k,Z,a,u,s,f,N,B]);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(Pr.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,le.jsx)(Pr.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:k})," schema"]}),(0,le.jsx)(be.Z,{mb:3,children:(0,le.jsx)(ve.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(xe.ZP,{children:"Destination table name"}),(0,le.jsx)(be.Z,{ml:Qr}),(0,le.jsx)(et.Z,{label:(0,le.jsxs)(xe.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:k}),". To change the table name, enter in a different value."]}),lightBackground:!0,primary:!0}),(0,le.jsx)(be.Z,{ml:1}),(0,le.jsx)(je.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;w(n),clearTimeout(p.current),p.current=setTimeout((function(){f(k,(function(e){return Wr(Wr({},e),{},{destination_table:n})}))}),300)},value:O||"",width:45*re.iI})]})})}),(0,le.jsx)(be.Z,{mb:3,children:(0,le.jsx)(ve.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,le.jsxs)(he.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,le.jsxs)(An.Z,{alignItems:"center",children:[(0,le.jsx)(xe.ZP,{children:"Replication method"}),(0,le.jsx)(be.Z,{ml:Qr}),(0,le.jsx)(et.Z,{label:(0,le.jsxs)(xe.ZP,{children:["Do you want to synchronize the entire stream (",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:_r.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:_r.INCREMENTAL}),")?",r===Nr.POSTGRESQL&&(0,le.jsxs)(xe.ZP,{children:["Log-based incremental replication (",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:_r.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0,primary:!0}),(0,le.jsx)(be.Z,{ml:1}),(0,le.jsxs)(Vi.Z,{compact:!0,onChange:function(e){f(k,(function(n){return Wr(Wr({},n),{},{replication_method:e.target.value})}))},primary:!0,value:j,children:[(0,le.jsx)("option",{value:""}),Object.values(_r).filter((function(e){return r===Nr.POSTGRESQL||e!==_r.LOG_BASED})).map((function(e){return(0,le.jsx)("option",{value:e,children:e},e)}))]}),(0,le.jsx)(be.Z,{ml:3}),(0,le.jsx)(xe.ZP,{children:"Unique conflict method"}),(0,le.jsx)(be.Z,{ml:Qr}),(0,le.jsx)(et.Z,{label:(0,le.jsxs)(xe.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,oe._6)("column",null===Z||void 0===Z?void 0:Z.length),(null===Z||void 0===Z?void 0:Z.length)>0&&(0,le.jsx)(le.Fragment,{children:"\xa0"}),null===Z||void 0===Z?void 0:Z.sort().map((function(e,n){return(0,le.jsxs)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===Z||void 0===Z?void 0:Z.length)&&n===(null===Z||void 0===Z?void 0:Z.length)-1?(0,le.jsx)(xe.ZP,{inline:!0,children:" and "},e):n>=1&&(0,le.jsx)(le.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:Cr.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:Cr.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0,primary:!0}),(0,le.jsx)(be.Z,{ml:1}),(0,le.jsxs)(Vi.Z,{compact:!0,inputWidth:11*re.iI,onChange:function(e){f(k,(function(n){return Wr(Wr({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:_,children:[(0,le.jsx)("option",{value:""}),(0,le.jsx)("option",{value:Cr.IGNORE,children:Cr.IGNORE}),(0,le.jsx)("option",{value:Cr.UPDATE,children:Cr.UPDATE})]})]}),F&&(0,le.jsxs)(An.Z,{alignItems:"center",children:[(0,le.jsx)(xe.ZP,{default:!0,children:"All streams"}),(0,le.jsx)(be.Z,{ml:Qr}),(0,le.jsx)(et.Z,{appearBefore:!0,label:(0,le.jsx)(xe.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."}),lightBackground:!0,primary:!0}),(0,le.jsx)(be.Z,{ml:1}),(0,le.jsx)(de.Z,{compact:!0,disabled:E,onClick:function(){P(!0),setTimeout((function(){return P(!1)}),2e3),a((function(e){return Wr(Wr({},e),{},{replication_method:j,unique_conflict_method:_})}))},pill:!0,secondary:!0,children:(0,le.jsx)(xe.ZP,{bold:!E,success:E,children:E?"Applied!":"Apply"})})]})]})})}),(0,le.jsx)(ve.Z,{headerTitle:"Features",noPadding:!0,children:H}),(0,le.jsx)(be.Z,{mt:2,children:(0,le.jsx)(de.Z,{loading:t,onClick:function(){return i(k)},primary:!0,small:!0,children:"Load sample data"})}),(0,le.jsxs)(be.Z,{mt:5,children:[(0,le.jsx)(Pr.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),_r.INCREMENTAL===j&&(0,le.jsxs)(be.Z,{mb:5,children:[(0,le.jsxs)(be.Z,{mb:1,children:[(0,le.jsx)(xe.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,le.jsxs)(xe.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,le.jsx)("br",{}),"On the next run, the synchronization will start after the bookmarked record."]})]}),(0,le.jsxs)(he.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==h&&void 0!==h&&h.length)&&(0,le.jsxs)(xe.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===h||void 0===h?void 0:h.sort().map((function(e){return(0,le.jsx)(be.Z,{mb:1,mr:1,children:(0,le.jsx)(Ur,{label:e,onClick:function(){f(k,(function(n){return Wr(Wr({},n),{},{bookmark_properties:(0,rn.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]})]}),(0,le.jsxs)(be.Z,{mb:5,children:[(0,le.jsxs)(be.Z,{mb:1,children:[(0,le.jsx)(xe.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,le.jsx)(xe.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,le.jsxs)(he.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==Z&&void 0!==Z&&Z.length)&&(0,le.jsxs)(xe.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===Z||void 0===Z?void 0:Z.sort().map((function(e){return(0,le.jsx)(be.Z,{mb:1,mr:1,children:(0,le.jsx)(Ur,{label:e,onClick:function(){f(k,(function(n){return Wr(Wr({},n),{},{unique_constraints:(0,rn.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,le.jsxs)(be.Z,{mb:5,children:[(0,le.jsxs)(be.Z,{mb:1,children:[(0,le.jsx)(xe.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,le.jsx)(xe.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,le.jsxs)(he.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==g&&void 0!==g&&g.length)&&(0,le.jsxs)(xe.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===g||void 0===g?void 0:g.sort().map((function(e){return(0,le.jsx)(be.Z,{mb:1,mr:1,children:(0,le.jsx)(Ur,{label:e,onClick:function(){f(k,(function(n){return Wr(Wr({},n),{},{key_properties:(0,rn.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),L&&(0,le.jsxs)(be.Z,{mb:3,children:[(0,le.jsxs)(be.Z,{mb:1,children:[(0,le.jsx)(xe.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,le.jsx)(xe.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,le.jsxs)(he.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==x&&void 0!==x&&x.length)&&(0,le.jsxs)(xe.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===x||void 0===x?void 0:x.sort().map((function(e){return(0,le.jsx)(be.Z,{mb:1,mr:1,children:(0,le.jsx)(Ur,{label:e,onClick:function(){f(k,(function(n){return Wr(Wr({},n),{},{partition_keys:(0,rn.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Vr=["catalog","setSelectedStream"];function Kr(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 Xr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kr(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Jr=function(e){var n=e.catalog,t=e.setSelectedStream,i=(0,Pe.Z)(e,Vr),r=(0,d.useState)(null),o=r[0],l=r[1],c=(0,d.useMemo)((function(){return(null===n||void 0===n?void 0:n.streams)||[]}),[n]),a=(0,d.useMemo)((function(){return(0,rn.YC)(c,"stream").map((function(e){return{uuid:e.stream}}))}),[c]),u=(0,d.useMemo)((function(){return(0,rn.HK)(c,(function(e){return e.stream}))}),[c]),s=(0,d.useMemo)((function(){return u[null===o||void 0===o?void 0:o.uuid]}),[o,u]);(0,d.useEffect)((function(){a.length>0&&(o&&(0,rn.sE)(a,(function(e){var n=e.uuid;return o.uuid===n}))||l(a[0]))}),[o,l,a]);var f=(0,d.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,le.jsx)(zr.cl,{children:(0,le.jsx)(pn.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:c.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,a=e.partition_keys,u=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,le.jsx)(xe.ZP,{children:"".concat(s.selectedCount," of ").concat(s.totalCount," total")},"".concat(u,"_col_selected")),f=[u,n,t,i,r,l,c,a].map((function(e,n){return(0,le.jsx)(xe.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(u,"_cell_").concat(n))}));return f.slice(0,1).concat(d).concat(f.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[c]);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(Fr.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){l(e),t(e.uuid)},selectedTabUUID:null===o||void 0===o?void 0:o.uuid,tabs:a}),s&&(0,le.jsx)(be.Z,{mt:1,children:(0,le.jsx)(zr.dE,{children:(0,le.jsx)(Yr,Xr(Xr({},i),{},{stream:s,streams:c}))})}),c.length>=1&&(0,le.jsx)(be.Z,{mt:1,children:(0,le.jsxs)(zr.dE,{children:[(0,le.jsx)(Pr.Z,{level:4,children:"Streams Summary"}),(0,le.jsx)(be.Z,{mt:1}),f]})})]})},$r=Ie.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;width:100%;",""],mn.n_,(function(e){return"\n background-color: ".concat((e.theme.background||hn.Z.background).panel,";\n ")}));var eo,no=function(e){var n=e.children;return(0,le.jsx)($r,{children:n})};function to(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function io(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ro(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?io(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):io(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"}(eo||(eo={}));var oo=45*re.iI;var lo=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,r=e.streams,o=(0,rn.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),l=(0,d.useState)(o),a=l[0],u=l[1],s=(0,d.useState)(null),f=s[0],p=s[1],h=(0,d.useState)(!1),m=h[0],v=h[1],g=(0,d.useState)(eo.ALL),b=g[0],x=g[1],j=(0,d.useRef)(null),y=to(a),k=(0,d.useMemo)((function(){var e=r;return e=e.filter((function(e){var n=e.tap_stream_id;return b===eo.SELECTED?y.includes(n):b!==eo.NOT_SELECTED||!y.includes(n)})),f?e.filter((function(e){var n=e.tap_stream_id;return null===n||void 0===n?void 0:n.toLowerCase().includes(null===f||void 0===f?void 0:f.toLowerCase())})):e}),[b,f,y,r]),Z=(0,d.useMemo)((function(){return r.every((function(e){var n=e.stream;return!!a[n]}))}),[a,r]);return(0,le.jsxs)(no,{children:[(0,le.jsx)(zr.cv,{rounded:!0,children:(0,le.jsx)(xe.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,le.jsx)(zr.cv,{padding:1.25*re.iI,children:(0,le.jsxs)(he.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,le.jsx)(je.Z,{beforeIcon:(0,le.jsx)(Ge.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return p(e.target.value)},placeholder:"Search",value:f}),(0,le.jsx)(be.Z,{pr:1,children:(0,le.jsx)(It.Z,{items:[{label:function(){return eo.ALL},onClick:function(){return x(eo.ALL)},uuid:"all_streams"},{label:function(){return eo.SELECTED},onClick:function(){return x(eo.SELECTED)},uuid:"selected"},{label:function(){return eo.NOT_SELECTED},onClick:function(){return x(eo.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return v(!1)},onClickOutside:function(){return v(!1)},open:m,parentRef:j,uuid:"SelectStreams/filter",children:(0,le.jsx)(de.Z,{beforeIcon:(0,le.jsx)(Ge.wn,{}),noBackground:!0,onClick:function(){return v((function(e){return!e}))},ref:j,children:(0,le.jsx)(xe.ZP,{children:b})})})})]})}),(0,le.jsx)(zr.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(oo,"px"),children:(0,le.jsx)(pn.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,le.jsx)(pe.Z,{checked:Z,onClick:function(){var e=(0,rn.HK)(r||[],(function(e){return e.stream}));u(Z?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:k.map((function(e){var n=e.stream,t=!!a[n];return[(0,le.jsx)(pe.Z,{checked:t,onClick:function(){u((function(i){return ro(ro({},i),{},(0,c.Z)({},n,t?null:e))}))}},"selected-".concat(n)),(0,le.jsx)(xe.ZP,{children:n},"stream-".concat(n))]})),stickyHeader:!0})}),(0,le.jsx)(hi.Z,{medium:!0}),(0,le.jsxs)(be.Z,{p:2,children:[(null===y||void 0===y?void 0:y.length)>50&&(0,le.jsx)(be.Z,{pb:2,children:(0,le.jsxs)(xe.ZP,{danger:!0,maxWidth:oo-4*re.iI,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,le.jsx)("br",{}),"may cause app performance issues."]})}),(0,le.jsx)(he.Z,{justifyContent:"flex-end",children:(0,le.jsx)(de.Z,{loading:t,onClick:function(){return i(a)},primary:!0,children:"Confirm ".concat(to(a).length," streams")})})]})]})};function co(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ao(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?co(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):co(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var uo=function(e){var n=e.api,t=e.block,i=e.blockContent,r=e.onChangeCodeBlock,o=e.pipeline,a=(0,d.useState)(null),u=a[0],s=a[1];(0,d.useEffect)((function(){i&&!u&&s((0,Sr.Pz)(null===i||void 0===i?void 0:i.config))}),[u,i]);var p=(0,d.useState)(null),m=p[0],v=p[1],g=(0,d.useState)(),b=g[0],x=g[1],j=(0,f.Db)(un.ZP[n].useCreate(),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(e){var t,i,r=(0,oe.C5)(n);v(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)}})}}),y=(0,l.Z)(j,2),k=y[0],Z=y[1].isLoading;return t?(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(zr.$W,{children:(0,le.jsx)(Nn.Z,{autoHeight:!0,language:h.t6.YAML,onChange:function(e){s(e),r(t.uuid,(0,Sr.Pz)(ao(ao({},i),{},{config:(0,Sr.Qc)(e)})))},tabSize:2,value:u||void 0,width:"100%"})}),(0,le.jsxs)(be.Z,{mt:1,children:[(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(de.Z,{onClick:function(){k((0,c.Z)({},(0,oe.C5)(n),{action_type:"test_connection",config:u,pipeline_uuid:o.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,le.jsx)(be.Z,{ml:1,children:Z?(0,le.jsx)(Mi.Z,{color:"white",small:!0}):(0,le.jsxs)(le.Fragment,{children:[m&&(0,le.jsx)(xe.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===m&&(0,le.jsx)(xe.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),b&&(0,le.jsx)(be.Z,{mt:1,children:(0,le.jsx)(xe.ZP,{small:!0,warning:!0,children:b})})]})]}):null},so=t(70902);function fo(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 po(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fo(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ho=function(e){var n,t,i,r=e.addNewBlockAtIndex,o=e.blocks,c=e.codeBlocks,a=e.fetchFileTree,u=e.fetchPipeline,s=e.fetchSampleData,p=e.globalVariables,m=e.onChangeCodeBlock,v=e.openSidekickView,g=e.pipeline,b=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,y=e.setOutputBlocks,k=e.setSelectedBlock,Z=e.setSelectedOutputBlock,_=e.setSelectedStream,C=(0,d.useState)(!0),O=C[0],w=C[1],S=(0,d.useState)(!0),E=S[0],P=S[1],I=(0,d.useState)(!0),T=I[0],A=I[1],R=un.ZP.integration_sources.list().data,D=(0,d.useMemo)((function(){return(null===R||void 0===R?void 0:R.integration_sources)||[]}),[R]),M=(0,d.useMemo)((function(){return(0,rn.HK)(D,(function(e){return e.uuid}))}),[D]),N=un.ZP.integration_destinations.list().data,B=(0,d.useMemo)((function(){return(null===N||void 0===N?void 0:N.integration_destinations)||[]}),[N]),L=(0,d.useMemo)((function(){return(0,rn.HK)(B,(function(e){return e.uuid}))}),[B]),F=(0,d.useMemo)((function(){return(0,rn.sE)(o,(function(e){var n=e.type;return h.tf.DATA_LOADER===n}))}),[o]),H=(0,d.useMemo)((function(){return F?(0,Sr.Qc)(F.content):{}}),[F]),U=(0,d.useMemo)((function(){return(0,le.jsx)(uo,{api:"integration_sources",block:F,blockContent:H,onChangeCodeBlock:m,pipeline:g})}),[F,H]),z=(0,d.useMemo)((function(){return(0,rn.sE)(o,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n}))}),[o]),G=(0,d.useMemo)((function(){return z?(0,Sr.Qc)(z.content):{}}),[z]),W=(0,d.useMemo)((function(){return(0,le.jsx)(uo,{api:"integration_destinations",block:z,blockContent:G,onChangeCodeBlock:m,pipeline:g})}),[z,G]),Q=(0,d.useMemo)((function(){var e;return(0,bn.Qr)(null===H||void 0===H?void 0:H.catalog)?null===g||void 0===g||null===(e=g.data_integration)||void 0===e?void 0:e.catalog:null===H||void 0===H?void 0:H.catalog}),[H,null===g||void 0===g||null===(n=g.data_integration)||void 0===n?void 0:n.catalog]),q=((null===Q||void 0===Q?void 0:Q.streams)||[]).every((function(e){return e.auto_add_new_fields})),Y=((null===Q||void 0===Q?void 0:Q.streams)||[]).every((function(e){return e.disable_column_type_check})),V=(0,ir.Z)(Q);(0,d.useEffect)((function(){!V&&Q&&(y((function(){return Z(F),[F]})),j((function(e){var n;return e||(null===Q||void 0===Q||null===(n=Q.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[Q]);var K=(0,d.useState)(),X=K[0],J=K[1],$=(0,f.Db)(un.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];y((function(){return Z(F),[F]})),t.length>0&&_(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),v(Re.DATA),s()}else J(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),ee=(0,l.Z)($,2),ne=ee[0],te=ee[1].isLoading,ie=(0,f.Db)(un.ZP.integration_sources.useUpdate(null===g||void 0===g?void 0:g.uuid),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,r=((null===Q||void 0===Q?void 0:Q.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(Dr.UNSUPPORTED!==i.inclusion){var r;if(e.replication_method||(e.replication_method=_r.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=Cr.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]=po(po({},n),{},{metadata:po(po({},i),{},{selected:!0})})}}))}));var c={streams:r.concat(l)};j(Se.map((function(e){return e.tap_stream_id})));var s=null===H||void 0===H?void 0:H.catalog;(0,bn.Qr)(s)||m(F.uuid,(0,Sr.Pz)(po(po({},H),{},{catalog:{}})));var d={pipeline:po(po({},g),{},{data_integration:po(po({},(null===g||void 0===g?void 0:g.data_integration)||{}),{},{catalog:c})})};b(d).then((function(){u(),a()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),oe=(0,l.Z)(ie,2),ce=oe[0],ae=oe[1].isLoading,ue=(0,d.useState)(null),se=ue[0],fe=ue[1],pe=(0,f.Db)(un.ZP.integration_source_streams.useUpdate(null===g||void 0===g?void 0:g.uuid),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(e){fe(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),me=(0,l.Z)(pe,2),ve=me[0],ge=me[1].isLoading,je=(0,d.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}}(Q,e),i=t.stream,r=t.streams,o=po(po({},Q),{},{streams:r.concat(n(i))}),l=null===H||void 0===H?void 0:H.catalog;(0,bn.Qr)(l)||m(F.uuid,(0,Sr.Pz)(po(po({},H),{},{catalog:{}})));var c={pipeline:po(po({},g),{},{data_integration:po(po({},(null===g||void 0===g?void 0:g.data_integration)||{}),{},{catalog:o})})};b(c).then((function(){return u()}))}),[Q,F,H,u,m,g,b]),ye=(0,d.useCallback)((function(e){if(null!==Q&&void 0!==Q&&Q.streams){var n=po(po({},Q),{},{streams:Q.streams.map((function(n){return e(n)}))}),t=null===H||void 0===H?void 0:H.catalog;(0,bn.Qr)(t)||m(F.uuid,(0,Sr.Pz)(po(po({},H),{},{catalog:{}})));var i={pipeline:po(po({},g),{},{data_integration:po(po({},(null===g||void 0===g?void 0:g.data_integration)||{}),{},{catalog:n})})};b(i).then((function(){return u()}))}}),[Q,F,H,u,m,g,b]),ke=(0,d.useCallback)((function(e,n,t){je(e,(function(e){return e.schema.properties[n]=t,e}))}),[je]),Ze=(0,d.useCallback)((function(e,n,t){je(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=po(po({},o),t)}})),e}))}),[je]),_e=(0,f.Db)(un.ZP.blocks.pipelines.useUpdate(null===g||void 0===g?void 0:g.uuid,null===z||void 0===z?void 0:z.uuid),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){null===u||void 0===u||u()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),Ce=(0,l.Z)(_e,1)[0],Oe=(0,d.useMemo)((function(){var e=[];return null===p||void 0===p||p.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,le.jsx)(xe.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,le.jsx)(xe.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,le.jsx)(xe.ZP,{monospace:!0,children:r},"variable-uuid-".concat(t,"-{value}-code")),(0,le.jsx)(Er.Z,{copiedText:r,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,le.jsx)(pn.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[p]),we=(0,d.useCallback)((function(e){return(0,le.jsxs)(be.Z,{mt:2,children:[(0,le.jsxs)(xe.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,le.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,le.jsx)("br",{}),"For more information, check out the ",(0,le.jsx)($n.Z,{href:e,openNewWindow:!0,children:"documentation"}),"."]}),(0,le.jsx)(be.Z,{mt:1,children:Oe})]})}),[Oe]),Se=(0,d.useMemo)((function(){return(null===se||void 0===se?void 0:se.streams)||[]}),[se]),Ee=(0,Cn.dd)((function(){return(0,le.jsx)(lo,{catalog:Q,isLoading:ae,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)ce({integration_source:{streams:n}}),Te();else{var t=null===H||void 0===H?void 0:H.catalog;(0,bn.Qr)(t)||m(F.uuid,(0,Sr.Pz)(po(po({},H),{},{catalog:{}}))),b({pipeline:po(po({},g),{},{data_integration:po(po({},(null===g||void 0===g?void 0:g.data_integration)||{}),{},{catalog:null})})}).then((function(){return u()})),Te()}},streams:Se})}),{},[Q,F,H,u,ae,m,b,Se],{background:!0,uuid:"select_streams"}),Pe=(0,l.Z)(Ee,2),Ie=Pe[0],Te=Pe[1];return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(be.Z,{mb:1,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(de.Z,{iconOnly:!0,onClick:function(){return P((function(e){return!e}))},children:(0,le.jsxs)(le.Fragment,{children:[E&&(0,le.jsx)(Ge.Kh,{size:1.5*re.iI}),!E&&(0,le.jsx)(Ge._M,{size:1.5*re.iI})]})}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Pr.Z,{children:"Source"}),!E&&(0,le.jsxs)(Pr.Z,{default:!0,inline:!0,children:["\xa0",null===(t=M[null===H||void 0===H?void 0:H.source])||void 0===t?void 0:t.name]})]})]})}),E&&(0,le.jsxs)(be.Z,{mb:5,children:[(0,le.jsxs)(zr.dE,{children:[(0,le.jsxs)(be.Z,{mb:5,children:[(0,le.jsx)(Pr.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(0,le.jsxs)(Vi.Z,{onChange:function(e){var n,t,i=e.target.value;if(i){var o=null===(n=M[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})),F?m(F.uuid,(0,Sr.Pz)(po(po({},H),{},{catalog:{},config:o,source:i}))):r({content:(0,Sr.Pz)({source:i,config:o}),language:h.t6.YAML,type:h.tf.DATA_LOADER},0,k),fe(null),b().then((function(){u()}))}},primary:!0,value:null===H||void 0===H?void 0:H.source,children:[(0,le.jsx)("option",{value:""}),D.map((function(e){var n=e.name,t=e.uuid;return(0,le.jsx)("option",{value:t,children:n},t)}))]})]}),F&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(be.Z,{mb:5,children:[(0,le.jsx)(Pr.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===H||void 0===H?void 0:H.source)&&(0,le.jsxs)(be.Z,{mb:2,children:[(0,le.jsxs)(xe.ZP,{default:!0,children:["For more information on how to configure this source, read the ",(0,le.jsxs)($n.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/sources/".concat(H.source,"/README.md"),openNewWindow:!0,children:[H.source," documentation"]})]}),we("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),U]}),(0,le.jsxs)("div",{children:[(0,le.jsx)(Pr.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,le.jsx)(de.Z,{loading:ge,onClick:function(){b().then((function(){ve().then((function(){return Ie()})),u()}))},primary:!0,small:!0,children:"View and select streams"})]}),X&&(0,le.jsx)(xe.ZP,{warning:!0,children:X})]})]}),ae&&(0,le.jsx)(be.Z,{p:2,children:(0,le.jsx)(Mi.Z,{})}),!ae&&(0,le.jsx)(be.Z,{mt:3,children:(0,le.jsx)(Jr,{catalog:Q,destination:null===G||void 0===G?void 0:G.destination,isLoadingLoadSampleData:te,loadSampleData:function(e){return ne({integration_source:{action_type:"sample_data",pipeline_uuid:null===g||void 0===g?void 0:g.uuid,streams:[e]}})},setSelectedStream:_,source:null===H||void 0===H?void 0:H.source,updateAllStreams:ye,updateMetadataForColumns:Ze,updateSchemaProperty:ke,updateStream:je})})]}),(0,le.jsx)(be.Z,{mb:1,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(de.Z,{disabled:!F,iconOnly:!0,onClick:function(){return A((function(e){return!e}))},children:(0,le.jsxs)(le.Fragment,{children:[T&&F&&(0,le.jsx)(Ge.Kh,{size:1.5*re.iI}),(!T||!F)&&(0,le.jsx)(Ge._M,{disabled:!F,size:1.5*re.iI})]})}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(he.Z,{alignItems:"center",children:(0,le.jsx)(Pr.Z,{children:"Transformers"})})]})}),T&&F&&(0,le.jsx)(be.Z,{mb:5,children:(0,le.jsxs)(zr.dE,{children:[c.length>0&&(0,le.jsx)(be.Z,{mb:1,children:c.map((function(e,n){return(0,le.jsx)(be.Z,{mb:1,children:e},n)}))}),(0,le.jsx)(be.Z,{mt:1,children:(0,le.jsx)(ii,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return F&&i.push(F.uuid),r(po(po({},e),{},{configuration:t,content:n,upstream_blocks:i}),o.length-1,(function(e){z&&(Ce({block:po(po({},z),{},{upstream_blocks:[e.uuid]})}),k(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideRecommendations:!0,hideScratchpad:!0,hideSensor:!0,hideTransformerDataSources:!0,pipeline:g})})]})}),(0,le.jsx)(be.Z,{mb:1,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(de.Z,{disabled:!F,iconOnly:!0,onClick:function(){return w((function(e){return!e}))},children:(0,le.jsxs)(le.Fragment,{children:[O&&F&&(0,le.jsx)(Ge.Kh,{size:1.5*re.iI}),(!O||!F)&&(0,le.jsx)(Ge._M,{disabled:!F,size:1.5*re.iI})]})}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Pr.Z,{children:"Destination"}),!O&&(0,le.jsxs)(Pr.Z,{default:!0,inline:!0,children:["\xa0",null===(i=L[null===G||void 0===G?void 0:G.destination])||void 0===i?void 0:i.name]})]})]})}),O&&F&&(0,le.jsxs)(zr.dE,{children:[(0,le.jsxs)(be.Z,{mb:5,children:[(0,le.jsx)(Pr.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(0,le.jsxs)(Vi.Z,{onChange:function(e){var n=e.target.value;if(n){if(z)m(z.uuid,(0,Sr.Pz)(po(po({},G),{},{destination:n})));else{var t,i,l=null===(t=L[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 a=o.find((function(e){var n=e.uuid;return(null===F||void 0===F?void 0:F.uuid)!==n}));a&&c.push(a.uuid)}else F&&c.push(F.uuid);r({content:(0,Sr.Pz)({config:l,destination:n}),language:h.t6.YAML,type:h.tf.DATA_EXPORTER,upstream_blocks:c},1,k)}b().then((function(){u()}))}},primary:!0,value:null===G||void 0===G?void 0:G.destination,children:[(0,le.jsx)("option",{value:""}),B.map((function(e){var n=e.name,t=e.uuid;return(0,le.jsx)("option",{value:t,children:n},t)}))]})]}),z&&(0,le.jsxs)(be.Z,{mb:5,children:[(0,le.jsx)(Pr.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===G||void 0===G?void 0:G.destination)&&(0,le.jsx)(le.Fragment,{children:(0,le.jsxs)(be.Z,{mb:2,children:[(0,le.jsxs)(xe.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,le.jsxs)($n.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(G.destination,"/README.md"),openNewWindow:!0,children:[G.destination," documentation"]}),".",(0,le.jsx)("br",{}),(0,le.jsx)("br",{}),"If your configuration contains a key named ",(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,le.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,le.jsx)(xe.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),we("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),W,(0,le.jsx)(be.Z,{mt:3,children:(0,le.jsxs)(he.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,le.jsxs)(be.Z,{mr:2,children:[(0,le.jsx)(xe.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,le.jsx)(xe.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,le.jsx)(so.Z,{checked:!!q,disabled:!(null!==Q&&void 0!==Q&&Q.streams),onCheck:function(){return ye((function(e){return po(po({},e),{},{auto_add_new_fields:!q})}))}})]})}),(0,le.jsx)(be.Z,{mt:3,children:(0,le.jsxs)(he.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,le.jsxs)(be.Z,{mr:2,children:[(0,le.jsx)(xe.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,le.jsxs)(xe.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,le.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,le.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,le.jsx)(so.Z,{checked:!!Y,disabled:!(null!==Q&&void 0!==Q&&Q.streams),onCheck:function(){return ye((function(e){return po(po({},e),{},{disable_column_type_check:!Y})}))}})]})})]})]})]})},mo=t(66653);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 go(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,c.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}var bo=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.anyInputFocused,r=e.autocompleteItems,o=e.blockRefs,l=e.blocks,a=void 0===l?[]:l,u=e.dataProviders,s=e.deleteBlock,f=e.fetchFileTree,p=e.fetchPipeline,m=e.fetchSampleData,v=e.files,g=e.globalVariables,b=e.interruptKernel,x=(e.isPipelineUpdating,e.kernel,e.mainContainerRef),j=e.mainContainerWidth,y=e.messages,k=e.onChangeCodeBlock,Z=e.openSidekickView,_=e.pipeline,C=e.pipelineContentTouched,O=(e.pipelineLastSaved,e.restartKernel),w=e.runBlock,S=e.runningBlocks,A=void 0===S?[]:S,R=e.savePipelineContent,D=e.selectedBlock,N=e.setAnyInputFocused,B=e.setEditingBlock,L=e.setErrors,F=e.setIntegrationStreams,H=(e.setMessages,e.setOutputBlocks),U=e.setPipelineContentTouched,z=e.setRecsWindowOpenBlockIdx,G=(e.setRunningBlocks,e.setSelectedBlock),W=e.setSelectedOutputBlock,Q=e.setSelectedStream,q=e.setTextareaFocused,Y=e.textareaFocused,V=e.widgets,K=(0,d.useState)(!1),X=K[0],J=K[1],$=(0,d.useState)(!1),ee=$[0],ne=$[1],te=(0,d.useState)(!0),ie=te[0],ce=te[1],ae=(0,d.useState)(null),ue=ae[0],se=ae[1],de=(0,d.useState)(null),pe=de[0],he=de[1],me=(0,d.useState)(!1),ve=me[0],xe=me[1],je=(0,d.useState)(""),ke=je[0],Ze=je[1],Ce=(0,d.useMemo)((function(){return A.reduce((function(e,n,t){return go(go({},e),{},(0,c.Z)({},n.uuid,go(go({},n),{},{priority:t})))}),{})}),[A]),Oe=(0,ir.Z)(D),Se=(0,d.useMemo)((function(){return a.length}),[a]),Ee=(0,d.useMemo)((function(){return ge.q.INTEGRATION===(null===_||void 0===_?void 0:_.type)}),[_]),Pe="PipelineDetail/index",Ie=(0,Un.y)(),Te=Ie.disableGlobalKeyboardShortcuts,Ae=Ie.registerOnKeyDown,Re=Ie.unregisterOnKeyDown;(0,d.useEffect)((function(){return function(){Re(Pe)}}),[Re,Pe]),Ae(Pe,(function(e,t,r){if(Te)(0,mo.j)(e);else if(C&&(0,_e.y)([ye.zX,ye.hS],t)){e.preventDefault();"undefined"!==typeof location&&window.confirm("You have changes that are unsaved. Click cancel and save your changes before reloading page.")&&location.reload()}else if((0,_e.y)([ye.zX,ye.Um],t)||(0,_e.y)([ye.PQ,ye.Um],t))e.preventDefault(),R();else if(Y)t[ye.vP]?q(!1):C||ye.Z1.find((function(e){return t[e]}))||U(!0);else if(!Ee){if(D){var l=a.findIndex((function(e){var n=e.uuid;return D.uuid===n}));if(t[ye.vP])G(null),z(null);else if(r[0]===ye.xD&&r[1]===ye.xD)b();else if(r[0]===ye.l1&&r[1]===ye.l1&&-1!==l)s(D).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){l===a.length-1?G(a[l-1]):a.length>=0?G(a[l+1]):G(null)}),100)}));else if(t[ye.Bu]&&l>=1){var c=a[l-1];if(c){var u,d;G(c);var f="".concat(c.type,"s/").concat(c.uuid,".py");null===(u=o.current[f])||void 0===u||null===(d=u.current)||void 0===d||d.scrollIntoView()}}else if(t[ye.kD]&&l<=Se-2){var p=a[l+1];if(p){var m,v;G(p);var g="".concat(p.type,"s/").concat(p.uuid,".py");null===(m=o.current[g])||void 0===m||null===(v=m.current)||void 0===v||v.scrollIntoView()}}else(0,_e.y)([ye.Uq],t)?q(!0):!i&&(0,_e.y)([ye.zH],t)?n({type:h.tf.SCRATCHPAD},l,G):!i&&(0,_e.y)([ye.Fv],t)&&n({type:h.tf.SCRATCHPAD},l+1,G)}else Oe&&t[ye.Uq]&&G(Oe);r[0]===ye.OC&&r[1]===ye.OC&&O()}}),[n,i,o.current,a,b,Ee,Se,C,O,R,D,Oe,U,G,q,Y]),(0,d.useEffect)((function(){var e=setInterval((function(){C&&R()}),5e3);return function(){clearInterval(e)}}),[C,R]),(0,d.useEffect)((function(){setTimeout((function(){return ne(!0)}),600)}),[_]);var De=(0,d.useCallback)((function(e){J(!0),he(e)}),[J,he]),Me=(0,d.useCallback)((function(){J(!1),xe(!1),Ze("")}),[]),Ne=(0,d.useMemo)((function(){return a.filter((function(e){var n=e.type;return!Ee||h.tf.TRANSFORMER===n})).map((function(e,i){var l=e.type,c=e.uuid,h=(null===D||void 0===D?void 0:D.uuid)===c,m=Ce[c],v=m?0===m.priority?Bn.uF.BUSY:Bn.uF.QUEUED:Bn.uF.IDLE,g="".concat(l,"s/").concat(c,".py");return o.current[g]=(0,d.createRef)(),(0,le.jsx)(dr,{addNewBlock:function(e){return q(!0),n(e,i+1,G)},addNewBlockMenuOpenIdx:ue,addWidget:t,autocompleteItems:r,block:e,blockIdx:i,blockRefs:o,blocks:a,dataProviders:u,defaultValue:e.content,deleteBlock:function(e){s(e),N(!1)},executionState:v,fetchFileTree:f,fetchPipeline:p,interruptKernel:b,mainContainerRef:x,mainContainerWidth:j,messages:y[c],noDivider:i===Se-1||Ee,onChange:function(e){return k(c,e)},onClickAddSingleDBTModel:De,openSidekickView:Z,pipeline:_,ref:o.current[g],runBlock:w,runningBlocks:A,savePipelineContent:R,selected:h,setAddNewBlockMenuOpenIdx:se,setAnyInputFocused:N,setCreatingNewDBTModel:xe,setEditingBlock:B,setOutputBlocks:H,setRecsWindowOpenBlockIdx:z,setSelected:function(n){return G(!0===n?e:null)},setSelectedOutputBlock:W,setTextareaFocused:q,textareaFocused:h&&Y,widgets:V},c)}))}),[n,ue,t,r,o,a,s,f,p,b,Ee,x,j,y,Se,k,De,Z,_,w,A,Ce,R,D,se,N,B,H,z,G,W,q,Y,V]),Be=(0,d.useMemo)((function(){return(0,le.jsx)(ho,{addNewBlockAtIndex:n,blocks:a,codeBlocks:Ne,fetchFileTree:f,fetchPipeline:p,fetchSampleData:m,globalVariables:g,onChangeCodeBlock:k,openSidekickView:Z,pipeline:_,savePipelineContent:R,setErrors:L,setIntegrationStreams:F,setOutputBlocks:H,setSelectedBlock:G,setSelectedOutputBlock:W,setSelectedStream:Q})}),[n,a,Ne,p,g,k,k,_,R,L,G]),Le=(0,d.useMemo)((function(){return(0,le.jsx)(ii,{addNewBlock:function(e){var t=a[a.length-1],i=null,r={},o=t?Li(t,e):[];t&&([h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(t.type)&&h.tf.SCRATCHPAD===e.type&&(i="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(_.uuid,"', '").concat(t.uuid,"', 'output_0')\n")),h.t6.SQL===t.language&&(r=go(go({},(0,bn.GL)(t.configuration,[E,P,I,T,M])),r))),h.t6.SQL===e.language&&(i=$t(i)),i=ei(e,i),n(go(go({},e),{},{configuration:r,content:i,upstream_blocks:o}),Se,G),q(!0)},hideCustom:Ee,hideDataExporter:Ee,hideDataLoader:Ee,hideDbt:Ee||ge.q.STREAMING===(null===_||void 0===_?void 0:_.type),hideRecommendations:Ee,hideScratchpad:Ee,hideSensor:Ee,onClickAddSingleDBTModel:De,pipeline:_,setCreatingNewDBTModel:xe,setRecsWindowOpenBlockIdx:z})}),[a,Ee,_,De,z]);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(rt,{children:ie&&(0,le.jsx)(Zt.Z,{classNames:"pipeline-detail",in:ee,onEntered:function(){return setTimeout((function(){return ce(!1)}),it)},timeout:1,children:(0,le.jsx)(ot,{})})}),(0,le.jsxs)(be.Z,{mt:1,px:re.cd,children:[Ee&&Be,!Ee&&(0,le.jsxs)(le.Fragment,{children:[Ne,(0,le.jsx)(be.Z,{mt:re.cd,children:Le})]}),X&&(0,le.jsx)(fe.Z,{onClickOutside:Me,open:!0,children:(0,le.jsx)(wr,{blocks:a,creatingNewDBTModel:ve,dbtModelName:ke,files:v,onClose:Me,onOpenFile:function(e){var t=ve?"".concat(e,"/").concat((0,oe.RA)(ke||(0,oe.Y6)()),".").concat(we.SQL):e,i={configuration:{file_path:t},language:h.t6.SQL,name:t,type:h.tf.DBT};ve&&(i.content="--Docs: https://docs.mage.ai/dbt/sources\n");var r="undefined"===typeof pe||null===pe,o=a[r?a.length-1:pe],l=o?Li(o,i):[];n(go(go({},i),{},{upstream_blocks:l}),r?Se:pe+1,G),Me(),q(!0)},setDbtModelName:Ze})})]})]})},xo=t(28358),jo=t(19767),yo=t(32063),ko=t(70543),Zo=t(24141);function _o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Co(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_o(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Oo=function(e){var n=e.after,t=e.afterHeader,i=e.afterHidden,r=e.afterSubheader,o=e.before,c=e.beforeHeader,a=e.children,u=e.errors,s=e.headerOffset,f=e.mainContainerHeader,p=e.mainContainerRef,h=e.page,m=e.pipeline,v=e.projectName,g=e.setAfterHidden,b=e.setAfterWidthForChildren,x=e.setErrors,j=e.setMainContainerWidth,y=(0,Zo.i)().width,k=(0,d.useState)((0,Ze.U2)(Ze.L8,nt.Zt)),Z=k[0],_=k[1],C=(0,d.useState)((0,Ze.U2)(Ze.J3,nt.ve)),O=C[0],w=C[1],S=(0,d.useState)(!!(0,Ze.U2)(Ze.Uu)),E=S[0],P=S[1],I=(0,d.useState)(!1),T=I[0],A=I[1],R=(0,d.useState)(!1),D=R[0],M=R[1],N=i,B=g;if(!B){var L=(0,d.useState)(!!(0,Ze.U2)(Ze.zg)),F=(0,l.Z)(L,2);N=F[0],B=F[1]}(0,d.useEffect)((function(){null===p||void 0===p||!p.current||T||D||null===j||void 0===j||j(p.current.getBoundingClientRect().width)}),[T,D,N,Z,E,O,null===p||void 0===p?void 0:p.current,j,y]),(0,d.useEffect)((function(){T||(null===b||void 0===b||b(Z),(0,Ze.t8)(Ze.L8,Z))}),[T,Z,b]),(0,d.useEffect)((function(){D||(0,Ze.t8)(Ze.J3,O)}),[D,O]);var H=un.ZP.projects.list({},{revalidateOnFocus:!1}).data,U=null===H||void 0===H?void 0:H.projects,z=(0,d.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{href:"/pipelines",as:"/pipelines"}}];return m&&(n.push.apply(n,[{bold:ko.b!==h,label:function(){return null===m||void 0===m?void 0:m.name},linkProps:{href:"/pipelines/[pipeline]",as:"/pipelines/".concat(null===m||void 0===m?void 0:m.uuid)}}]),ko.b===h&&n.push.apply(n,[{bold:!0,label:function(){return(0,oe.kC)(h)}}])),(0,le.jsx)(jo.Z,{breadcrumbs:n,project:null===U||void 0===U?void 0:U[0],version:null===U||void 0===U||null===(e=U[0])||void 0===e?void 0:e.version})}),[h,m,v,U]);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(ft.Z,{title:null===m||void 0===m?void 0:m.name}),(0,le.jsx)(yo.Z,{after:n,afterHeader:t,afterHidden:N,afterMousedownActive:T,afterSubheader:r,afterWidth:Z,before:o,beforeHeader:c,beforeHidden:E,beforeMousedownActive:D,beforeWidth:O,header:z,headerOffset:s,mainContainerHeader:f,mainContainerRef:p,setAfterHidden:B,setAfterMousedownActive:A,setAfterWidth:_,setBeforeHidden:P,setBeforeMousedownActive:M,setBeforeWidth:w,children:a}),u&&(0,le.jsx)(fe.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return x(null)},children:(0,le.jsx)(xo.Z,Co(Co({},u),{},{onClose:function(){return x(null)}}))})]})},wo=t(41788),So=t(70001),Eo=t(26226),Po=t(29989),Io=t(53655),To=t(84181),Ao=t(31969);function Ro(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Do(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ro(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ro(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Mo=Ie.default.div.withConfig({displayName:"HeatMap__YAxisLabelContainer",componentId:"sc-h2irj-0"})(["-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-o-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);white-space:nowrap;"]);function No(e,n){return Math.max.apply(Math,(0,o.Z)(e.map(n)))}function Bo(e,n){return Math.min.apply(Math,(0,o.Z)(e.map(n)))}var Lo=function(e){return e.bins},Fo=function(e){return e.count},Ho={top:0,left:0,right:0,bottom:0};function Uo(e){var n=e.countMidpoint,t=e.data,i=(e.events,e.height),r=e.margin,o=void 0===r?{}:r,l=e.minCount,c=e.width,a=(e.yLabels,(0,d.useContext)(Ie.ThemeContext)),u=(a.monotone||Ao.Z.monotone).grey300,s=(a.brand||Ao.Z.brand).wind400,f=(a.content||Ao.Z.content).default,p=(a.monotone||Ao.Z.monotone).white,h=Do(Do({},Ho),o),m=[];t[0].forEach((function(e,n){var i=t.map((function(e){return e[n]}));m.push({bin:n,bins:i.reverse().map((function(e,n){return{bin:n,count:e}}))})}));var v=No(m,(function(e){return No(Lo(e),Fo)})),g=Bo(m,(function(e){return Bo(Lo(e),Fo)})),b=No(m,(function(e){return Lo(e).length})),x="undefined"!==typeof n?n:0,j="undefined"!==typeof l?l:g,y=(0,To.Z)({domain:[0,m.length]}),k=(0,To.Z)({domain:[0,b]}),Z=(0,To.Z)({range:[u,s],domain:[x,v]}),_=(0,To.Z)({range:[.1,1],domain:[x,v]}),C=(0,To.Z)({range:[u,s],domain:[j,x]}),O=(0,To.Z)({range:[1,.1],domain:[j,x]}),w=c-(h.left+h.right),S=i-(h.bottom+h.top),E=w/m.length,P=S/b;return y.range([0,w]),k.range([S,0]),c<10?null:(0,le.jsx)(le.Fragment,{children:(0,le.jsx)("svg",{width:c,height:i,children:(0,le.jsx)(Po.Z,{left:h.left,top:h.top,children:(0,le.jsx)(Io.Z,{data:m,xScale:y,yScale:k,colorScale:Z,opacityScale:_,binWidth:E,binHeight:E,gap:0,children:function(e){return e.map((function(e){return e.map((function(e){var t=e.opacity,i=e.color;return"undefined"!==typeof n&&e.count<n&&(t=O(e.count),i=C(e.count)),(0,le.jsxs)("svg",{height:P,width:E,x:e.x,y:e.y-P,children:[(0,le.jsx)("rect",{className:"visx-heatmap-rect",fill:i,fillOpacity:t,height:P,width:E}),(0,le.jsx)("text",{alignmentBaseline:"middle",fill:e.count>=.8*v?p:f,fontFamily:ri.ry,fontSize:14,textAnchor:"middle",x:"50%",y:"50%",children:e.count})]},"heatmap-rect-".concat(e.row,"-").concat(e.column))}))}))}})})})})}var zo=function(e){var n=e.countMidpoint,t=e.data,i=e.height,r=e.margin,o=e.minCount,l=e.xAxisLabel,c=e.xLabels,a=e.yAxisLabel,u=e.yLabels,s=function(e){return e.length>12?"".concat(e.substring(0,12),"..."):e},d=4*re.iI,f=8*re.iI,p=0;return a&&(p+=d+1*re.iI),u&&(p+=f+1*re.iI),(0,le.jsxs)(le.Fragment,{children:[(l||c)&&(0,le.jsx)("div",{style:{marginBottom:null===r||void 0===r?void 0:r.bottom,marginLeft:null===r||void 0===r?void 0:r.left,marginRight:null===r||void 0===r?void 0:r.right,marginTop:null===r||void 0===r?void 0:r.top,paddingLeft:p},children:(0,le.jsxs)(be.Z,{mb:{xs:1},children:[l&&(0,le.jsx)(be.Z,{mb:1,children:(0,le.jsx)(xe.ZP,{center:!0,muted:!0,xsmall:!0,children:l})}),c&&(0,le.jsx)(he.Z,{children:c.map((function(e){var n=e.label,t=e.linkProps;return(0,le.jsx)(An.Z,{flex:"1",justifyContent:"center",children:t?(0,le.jsx)($n.Z,{bold:!0,centerAlign:!0,minWidth:70,onClick:t.onClick,xsmall:!0,children:n}):(0,le.jsx)(xe.ZP,{bold:!0,center:!0,minWidth:70,title:String(n),xsmall:!0,children:s(String(n))})},n)}))})]})}),(0,le.jsxs)("div",{style:{height:i,display:"flex",width:"100%"},children:[a&&(0,le.jsx)("div",{style:{marginRight:1*re.iI,width:d},children:(0,le.jsx)(he.Z,{alignItems:"center",justifyContent:"center",children:(0,le.jsx)(Mo,{children:(0,le.jsx)(xe.ZP,{center:!0,muted:!0,xsmall:!0,children:a})})})}),u&&(0,le.jsx)("div",{style:{marginRight:1*re.iI},children:(0,le.jsx)(he.Z,{alignItems:"center",flexDirection:"column",fullHeight:!0,width:f,children:u.map((function(e){var n=e.label,t=e.linkProps;return(0,le.jsx)(An.Z,{alignItems:"center",flex:"1",children:t?(0,le.jsx)($n.Z,{bold:!0,centerAlign:!0,onClick:t.onClick,xsmall:!0,children:n}):(0,le.jsx)(xe.ZP,{bold:!0,center:!0,title:String(n),xsmall:!0,children:s(String(n))})},n)}))})}),(0,le.jsx)("div",{style:{height:i,width:"100%"},children:(0,le.jsx)(Eo.Z,{children:function(e){var i=e.width,l=e.height;return(0,le.jsx)(Uo,{countMidpoint:n,data:t,height:l,margin:r,minCount:o,width:i,yLabels:u})}})})]})]})},Go=t(11754);var Wo=function(e){var n=e.afterWidth,t=e.features,i=e.insightsOverview,r=e.statistics,o=i.correlations,c=void 0===o?[]:o,a=n-(2*re.cd*re.iI+tt.nn),u=function(e){var n=[];return{heatmapData:null===e||void 0===e?void 0:e.map((function(e,t){var i=e.correlations,r=e.feature.uuid;n.push({label:r});var o=i[0].y.map((function(e){var n=e.value;return(0,oe.QV)(n)}));return o.splice(t,0,1),o})),xyLabels:n}}(c),s=u.heatmapData,d=u.xyLabels,f=function(e,n){return(0,rn.YC)(null===e||void 0===e?void 0:e.map((function(e){return{feature:e,value:1-n["".concat(e.uuid,"/null_value_rate")]}})),"value")}(t,r),p=function(e,n){return(0,rn.YC)(null===e||void 0===e?void 0:e.map((function(e){return{feature:e,value:n["".concat(e.uuid,"/count_distinct")]}})),"value")}(t,r),h=function(e,n){return(0,rn.YC)(null===e||void 0===e?void 0:e.map((function(e){var t=Object.entries(n["".concat(e.uuid,"/value_counts")]||{})[0]||[],i=(0,l.Z)(t,2),r=i[0],o=i[1];return{feature:e,percentage:Number(o)/n.count,value:r}})),"percentage")}(t,r);return(0,le.jsxs)(he.Z,{flexDirection:"column",children:[(null===f||void 0===f?void 0:f.length)>=1&&(0,le.jsx)(Go.Z,{headerTitle:"Data completion",width:a,children:(0,le.jsx)(So.Z,{data:f.map((function(e){var n=e.feature;return{x:e.value,y:n.uuid}})),height:Math.max(3*f.length*re.iI,50*re.iI),renderTooltipContent:function(e){var n=e.x;return"".concat((0,oe.T3)(n)," of rows have a value")},xNumTicks:2,ySerialize:function(e){return e.y}})}),(null===p||void 0===p?void 0:p.length)>=1&&(0,le.jsx)(Go.Z,{headerTitle:"Number of unique values",width:a,children:(0,le.jsx)(So.Z,{data:p.map((function(e){var n=e.feature;return{x:e.value,y:n.uuid}})),height:Math.max(3*f.length*re.iI,50*re.iI),renderTooltipContent:function(e){var n=e.x;return"".concat(n," unique values")},xNumTicks:2,ySerialize:function(e){return e.y}})}),h.length>=1&&(0,le.jsx)(Go.Z,{headerTitle:"Distribution of values",width:a,children:(0,le.jsx)(So.Z,{data:h.map((function(e){var n=e.feature,t=e.percentage;return{feature:n,value:e.value,x:t,y:n.uuid}})),height:Math.max(3*h.length*re.iI,50*re.iI),renderTooltipContent:function(e){var n=e.value,t=e.x;return"".concat(n," is ").concat((0,oe.T3)(t)," of all rows")},xNumTicks:2,ySerialize:function(e){return e.y}})}),c&&(null===s||void 0===s?void 0:s.length)>=1&&(0,le.jsx)(Go.Z,{headerTitle:"Correlations",children:(0,le.jsx)(be.Z,{p:1,children:(0,le.jsx)(zo,{countMidpoint:0,data:s,height:8*re.iI*d.length,minCount:-1,xLabels:d,yLabels:d})})})]})},Qo=t(92083),qo=t.n(Qo),Yo=t(84969),Vo=t(90948),Ko=t(65743),Xo=t(39048),Jo=t(79487),$o=t(61655),el=t(16853),nl=t(65376),tl=t(52359),il=t(48072),rl=t(24903),ol=t(98677),ll=t(73899);function cl(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 al(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?cl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ul={bottom:re.iI*(3+re.cd),left:re.iI*re.cd,right:re.iI*re.cd,top:re.iI*re.cd};function sl(e,n){return Math.max.apply(Math,(0,o.Z)(e.map(n)))}function dl(e){var n=e.data,t=e.height,i=e.keyForYData,r=e.large,l=e.margin,c=void 0===l?{}:l,a=e.orientationVertical,u=void 0!==a&&a,s=e.showTooltip,f=e.width,p=e.yLabelFormat,h=(0,d.useContext)(Ie.ThemeContext),m=(0,d.useCallback)((function(e){return e[i]}),[i]),v=p;v||(v=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var g=r?oi.iD:oi.J5,b=al(al({},ul),c),x=n.slice(Math.max(0,n.length-50)),j=(0,d.useMemo)((function(){return Object.keys((null===x||void 0===x?void 0:x[0])||{}).filter((function(e){return e!==i}))}),[x,i]),y=(0,rl.Z)({domain:j,range:[ll.a$,ll.Ej,ll.hM,ll.ZA,ll.$R,ll.X_,ll.er,ll.hl,ll.nQ]}),k=(0,d.useMemo)((function(){return x.map(m)}),[x,m]),Z=(0,ol.Z)({domain:k,padding:.1}),_=(0,ol.Z)({domain:j,padding:.1}),C=(0,To.Z)({domain:[0,sl(x,(function(e){return sl(j,(function(n){return Number(e[n])}))}))]}),O={active:(null===h||void 0===h?void 0:h.content.default)||hn.Z.content.default,backgroundPrimary:(null===h||void 0===h?void 0:h.chart.backgroundPrimary)||hn.Z.chart.backgroundPrimary,backgroundSecondary:(null===h||void 0===h?void 0:h.chart.backgroundSecondary)||hn.Z.chart.backgroundSecondary,muted:(null===h||void 0===h?void 0:h.content.muted)||hn.Z.content.muted,primary:(null===h||void 0===h?void 0:h.chart.primary)||hn.Z.chart.primary,tooltipBackground:(null===h||void 0===h?void 0:h.background.navigation)||hn.Z.background.navigation},w=k;u&&(w=x.reduce((function(e,n){return e.concat(j.map((function(e){var t=n[e];return(0,oe.HW)(t)?parseInt(String(t)):t})))}),[]));var S=Math.min(Math.max.apply(Math,(0,o.Z)(w.map((function(e){return String(e).length})))),20);b.left+=7*S;var E=f-(b.left+b.right),P=t-(b.top+b.bottom);u?(Z.rangeRound([0,E]),C.rangeRound([P,0])):(Z.rangeRound([P,0]),C.rangeRound([0,E])),_.rangeRound([0,Z.bandwidth()]);var I=x.map(m).length,T=0;u||(T=Z(w[I-1]));var A=(0,d.useCallback)((function(e){var n=(0,il.Z)(e)||{x:0,y:0},t=n.x,i=n.y,r=t-b.left,o=i-b.top,l=0;l=u?(r-T/2)/(E-T):1-(o-T/2)/(P-T);var c=Math.floor(l*I),a=x[c];"undefined"===typeof a&&(a=x[c-1]),u?r>T&&r<E+b.left-T&&s({tooltipData:a,tooltipLeft:t,tooltipTop:i}):o>T&&o<P-T&&s({tooltipData:a,tooltipLeft:t,tooltipTop:i})}),[x,I,b.left,b.top,u,s,T,E,P]);return{colorScale:y,colors:O,data:x,fontSize:g,handleTooltip:A,margin:b,tempScale:C,tickValues:w,xKeys:j,xMax:E,y1Scale:_,yLabelFormat:v,yMax:P,yScale:Z,ySerialize:m}}var fl=["height","width","xAxisLabel","yAxisLabel"];function pl(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 hl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}re.iI,re.iI,re.iI;var ml=(0,$o.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,a=e.margin,u=void 0===a?{}:a,s=e.renderNoDataText,d=e.renderTooltipContent,f=e.showTooltip,p=e.tooltipData,h=e.tooltipLeft,m=e.tooltipOpen,v=e.tooltipTop,g=e.width,b=e.xAxisLabel,x=e.xNumTicks,j=e.yLabelFormat,y=dl({data:n,height:t,keyForYData:o,large:c,margin:u,showTooltip:f,width:g,yLabelFormat:j}),k=y.colorScale,Z=y.colors,_=y.data,C=y.fontSize,O=y.handleTooltip,w=y.margin,S=y.tempScale,E=y.tickValues,P=y.xKeys,I=y.xMax,T=y.y1Scale,A=y.yLabelFormat,R=y.yMax,D=y.yScale,M=y.ySerialize;return g<10?null:(0,le.jsxs)("div",{children:[(0,le.jsxs)("svg",{height:t,width:g,children:[s&&!(null!==_&&void 0!==_&&_.length)&&(0,le.jsx)("text",{fill:Z.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:ri.ry,fontSize:C,x:"50%",y:"50%",children:s()}),(0,le.jsx)(Ko.Z,{fill:"transparent",height:t-(w.top+w.bottom),onMouseLeave:function(){return i()},onMouseMove:O,onTouchMove:O,onTouchStart:O,rx:14,width:g-(w.left+w.right),x:w.left,y:w.top}),(null===_||void 0===_?void 0:_.length)&&(0,le.jsxs)(Po.Z,{left:w.left,top:w.top,children:[(0,le.jsx)(Xo.Z,{color:k,data:_,keys:P,width:I,xScale:S,y0:M,y0Scale:D,y1Scale:T,children:function(e){return e.map((function(e){return(0,le.jsx)(Po.Z,{top:e.y0,children:e.bars.map((function(n){return(0,le.jsx)("g",{children:(0,le.jsx)(le.Fragment,{children:(0,le.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,le.jsx)(Yo.Z,{hideTicks:!0,scale:D,stroke:Z.muted,tickFormat:function(e){return A(e)},tickLabelProps:function(){return{fill:Z.active,fontFamily:ri.ry,fontSize:C,style:{width:"10px"},textAnchor:"end"}},tickStroke:Z.muted,tickValues:E,top:2}),(0,le.jsx)(Vo.Z,{label:b,labelProps:{fill:Z.muted,fontFamily:ri.ry,fontSize:C,textAnchor:"middle"},numTicks:x,scale:S,stroke:Z.muted,tickLabelProps:function(){return{fill:Z.active,fontFamily:ri.ry,fontSize:C,textAnchor:"middle"}},tickStroke:Z.muted,top:R})]}),p&&(0,le.jsx)("g",{children:(0,le.jsx)(Jo.Z,{from:{x:w.left,y:v},pointerEvents:"none",stroke:Z.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:I+w.left,y:v}})})]}),m&&p&&(0,le.jsxs)(el.Z,{left:h,style:hl(hl({},nl.j),{},{backgroundColor:Z.tooltipBackground}),top:v,children:[d&&d(p),!d&&Object.entries(p).map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];if(o!==t){var r=i;return(0,oe.HW)(r)&&String(r).split(".").length>=2&&(r=r.toFixed(4)),(0,le.jsxs)(xe.ZP,{inverted:!0,small:!0,children:[t,": ",r]},t)}}))]})]})}));var vl=function(e){var n,t=e.height,i=e.width,r=e.xAxisLabel,o=e.yAxisLabel,l=(0,Pe.Z)(e,fl);return n="undefined"===typeof i?"100%":o?0===i?i:i-28:i,(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)("div",{style:{display:"flex",height:t,marginBottom:r?re.iI:null,width:"100%"},children:[o&&(0,le.jsx)(he.Z,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,le.jsx)(tl.Z,{children:(0,le.jsx)(xe.ZP,{center:!0,muted:!0,small:!0,children:o})})}),(0,le.jsx)("div",{style:{height:t,width:n},children:(0,le.jsx)(Eo.Z,{children:function(e){var n=e.width,t=e.height;return(0,le.jsx)(ml,hl(hl({},l),{},{height:t,width:n}))}})})]}),r&&(0,le.jsx)("div",{style:{paddingLeft:o?36:0,paddingTop:4},children:(0,le.jsx)(xe.ZP,{center:!0,muted:!0,small:!0,children:r})})]})},gl=t(95422),bl=["keyForYData"],xl=["height","width","xAxisLabel","yAxisLabel"];function jl(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 yl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?jl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var kl=(0,$o.Z)((function(e){var n=e.keyForYData,t=void 0===n?"__y":n,i=(0,Pe.Z)(e,bl),r=i.height,o=i.hideTooltip,c=i.renderNoDataText,a=i.renderTooltipContent,u=i.tooltipData,s=i.tooltipLeft,d=i.tooltipOpen,f=i.tooltipTop,p=i.width,h=i.xLabelFormat,m=i.xNumTicks,v=i.yNumTicks,g=dl(yl(yl({},i),{},{keyForYData:t,orientationVertical:!0})),b=g.colorScale,x=g.colors,j=g.data,y=g.fontSize,k=g.handleTooltip,Z=g.margin,_=g.tempScale,C=(g.tickValues,g.xKeys),O=(g.xMax,g.y1Scale),w=g.yLabelFormat,S=g.yMax,E=g.yScale,P=g.ySerialize;return p<10?null:(0,le.jsxs)("div",{children:[(0,le.jsxs)("svg",{height:r,width:p,children:[c&&!(null!==j&&void 0!==j&&j.length)&&(0,le.jsx)("text",{fill:x.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:ri.ry,fontSize:y,x:"50%",y:"50%",children:c()}),(null===j||void 0===j?void 0:j.length)&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(Ko.Z,{fill:"transparent",height:r-(Z.top+Z.bottom),onMouseLeave:function(){return o()},onMouseMove:k,onTouchMove:k,onTouchStart:k,rx:14,width:p-(Z.left+Z.right),x:Z.left,y:2*Z.top}),(0,le.jsxs)(Po.Z,{top:Z.top,children:[(0,le.jsx)(gl.Z,{color:b,data:j,height:S,keys:C,x0:P,x0Scale:E,x1Scale:O,yScale:_,children:function(e){return e.map((function(e){return(0,le.jsx)(Po.Z,{left:e.x0+Z.left,top:Z.top,children:e.bars.map((function(n){return(0,le.jsx)("g",{children:(0,le.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,le.jsx)(Yo.Z,{left:Z.left,numTicks:v,scale:_,stroke:x.muted,tickFormat:function(e){return w(e)},tickLabelProps:function(){return{fill:x.active,fontFamily:ri.ry,fontSize:y,textAnchor:"end",transform:"translate(-2,2.5)"}},tickStroke:x.muted,top:Z.top}),(0,le.jsx)(Vo.Z,{hideTicks:!0,left:Z.left,numTicks:m,scale:E,stroke:x.muted,tickFormat:h,tickLabelProps:function(){return{fill:x.active,fontFamily:ri.ry,fontSize:y,textAnchor:"middle"}},tickStroke:x.muted,top:S+Z.top})]})]}),u&&(0,le.jsx)("g",{children:(0,le.jsx)(Jo.Z,{from:{x:s,y:2*Z.top},pointerEvents:"none",stroke:x.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:s,y:S+2*Z.top}})})]}),d&&u&&(0,le.jsxs)(el.Z,{left:s,style:yl(yl({},nl.j),{},{backgroundColor:x.tooltipBackground}),top:f,children:[a&&a(u),!a&&Object.entries(u).map((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];if(t!==i){var o=r;return(0,oe.HW)(o)&&String(o).split(".").length>=2&&(o=o.toFixed(4)),(0,le.jsxs)(xe.ZP,{inverted:!0,small:!0,children:[i,": ",o]},i)}})),(0,le.jsx)("br",{}),(0,le.jsxs)(xe.ZP,{inverted:!0,small:!0,children:[h&&h(P(u)),!h&&P(u)]})]})]})}));var Zl=function(e){var n=e.height,t=e.width,i=e.xAxisLabel,r=e.yAxisLabel,o=(0,Pe.Z)(e,xl);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)("div",{style:{display:"flex",height:n,marginBottom:i?re.iI:null,width:"100%"},children:[r&&(0,le.jsx)(he.Z,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,le.jsx)(tl.Z,{children:(0,le.jsx)(xe.ZP,{center:!0,muted:!0,small:!0,children:r})})}),(0,le.jsx)("div",{style:{height:n,width:r?0===t?t:t-28:t},children:(0,le.jsx)(Eo.Z,{children:function(e){var n=e.height,t=e.width;return(0,le.jsx)(kl,yl(yl({},o),{},{height:n,width:t}))}})})]}),i&&(0,le.jsx)("div",{style:{paddingLeft:r?36:0,paddingTop:4},children:(0,le.jsx)(xe.ZP,{center:!0,muted:!0,small:!0,children:i})})]})},_l=t(66872),Cl=t(68735),Ol=t(320),wl=40*re.iI,Sl=Ie.default.div.withConfig({displayName:"indexstyle__ChartBlockStyle",componentId:"sc-1c3ufnj-0"})(["border-radius:","px;margin-left:","px;margin-right:","px;margin-top:","px;",""],mn.n_,.5*re.iI,.5*re.iI,1*re.iI,(function(e){return"\n background-color: ".concat((e.theme.background||hn.Z.background).chartBlock,";\n ")})),El=Ie.default.div.withConfig({displayName:"indexstyle__ConfigurationOptionsStyle",componentId:"sc-1c3ufnj-1"})(["flex:4;padding-left:","px;padding-right:","px;"],1*re.iI,1*re.iI),Pl=Ie.default.div.withConfig({displayName:"indexstyle__CodeStyle",componentId:"sc-1c3ufnj-2"})(["padding-top:","px;",""],re.iI/2,(function(e){return"\n background-color: ".concat((e.theme.background||hn.Z.background).codeTextarea,";\n ")})),Il=Ie.default.div.withConfig({displayName:"indexstyle__CodeHelperStyle",componentId:"sc-1c3ufnj-3"})(["margin-bottom:","px;padding-bottom:","px;padding-left:","px;",""],re.cd*re.iI,re.iI,re.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||hn.Z.borders).medium,";\n ")}));function Tl(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 Al(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Tl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Tl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Rl=function(e){var n,t=e.block,r=e.data,o=e.width,a=t.configuration,u=void 0===a?{}:a,s=u||{},d=s.chart_style,f=s.chart_type,p=s.y_sort_order,h=u.height||wl,m=(null===u||void 0===u||null===(n=u.metrics)||void 0===n?void 0:n.map((function(e){return"".concat((n=e).aggregation,"(").concat(n.column,")");var n})))||[],v=yt.n1,g=u.time_interval;if([G.HOUR,G.MINUTE,G.SECOND].includes(g)&&(v=yt.OC),i.BAR_CHART===f||i.TIME_SERIES_BAR_CHART===f){var b=r.x,x=r.y,j=i.TIME_SERIES_BAR_CHART===f;if(b&&x&&Array.isArray(b)&&Array.isArray(x)){var y,k=null===(y=u.group_by)||void 0===y?void 0:y.join(", "),Z=null===m||void 0===m?void 0:m.join(", ");m.length||m.push(w);var _=m[0],C=b.map((function(e,n){return Al({__y:e},m.reduce((function(e,t,i){var r,o=null===x||void 0===x||null===(r=x[i])||void 0===r?void 0:r[n];return"undefined"===typeof o?e:Al(Al({},e),{},(0,c.Z)({},t,o))}),{}))}));z.ASCENDING===p?C=(0,rn.YC)(C,(function(e){return e[_]}),{ascending:!1}):z.DESCENDING===p&&(C=(0,rn.YC)(C,(function(e){return e[_]}),{ascending:!0}));var O={data:C,height:h,renderNoDataText:function(){return"No data matching query"},width:o,xNumTicks:3};return F.HORIZONTAL===d?(0,le.jsx)(vl,Al(Al({},O),{},{xAxisLabel:Z||u.y,yAxisLabel:k||u.x})):(0,le.jsx)(Zl,Al(Al({},O),{},{xAxisLabel:k,xLabelFormat:function(e){return j?qo()(1e3*e).format(yt.n1):e},xNumTicks:C.length,yAxisLabel:Z,yNumTicks:5}))}}else if(i.HISTOGRAM===f){var S,E=r.x,P=r.y,I=null===(S=u.group_by)||void 0===S?void 0:S.join(", ");if(E&&P&&Array.isArray(E))return(0,le.jsx)(_l.Z,{data:E.map((function(e,n){var t,i=e.max,r=e.min;return[i,null===P||void 0===P||null===(t=P[n])||void 0===t?void 0:t.value,r]})),height:h,width:o,large:!0,margin:{left:5*re.iI,right:1*re.iI,top:3*re.iI},noPadding:!0,renderTooltipContent:function(e){var n=(0,l.Z)(e,3),t=n[0],i=n[1],r=n[2];return(0,le.jsxs)(xe.ZP,{inverted:!0,monospace:!0,small:!0,children:["Count : ",i,(0,le.jsx)("br",{}),"Bucket: ",r,"-",t]})},showAxisLabels:!0,showYAxisLabels:!0,showZeroes:!0,sortData:function(e){return(0,rn.YC)(e,"[0]")},xAxisLabel:I||u.x,yAxisLabel:I?"count(".concat(I,")"):u.y})}else if(i.LINE_CHART===f||i.TIME_SERIES_LINE_CHART===f){var T=r.x,A=r.y,R=i.TIME_SERIES_LINE_CHART===f;if(T&&A&&Array.isArray(T)&&Array.isArray(A)&&Array.isArray(null===A||void 0===A?void 0:A[0])){var D,M=m;u.legend_labels&&(M=u.legend_labels.split(",").map((function(e){return e.trim()})));var N=T.map((function(e,n){return{x:e,y:(0,rn.w6)(A.length).map((function(e,t){var i=A[t][n];return"undefined"===typeof i||null===i?0:i}))}})),B=null===(D=u.group_by)||void 0===D?void 0:D.join(", "),L=m.join(", ");return(0,le.jsx)(Cl.Z,{data:N,height:h,lineLegendNames:M,margin:{bottom:8*re.iI,left:5*re.iI},noCurve:!0,renderXTooltipContent:function(e){e.index;var n=e.x,t=u.x,i=n;return u.group_by&&(t=u.group_by.map(String).join(", ")),R&&(i=qo()(1e3*n).format(v)),(0,le.jsxs)(xe.ZP,{inverted:!0,small:!0,children:[t,": ",i]})},renderYTooltipContent:function(e,n){var t=e.y;return(0,le.jsxs)(xe.ZP,{inverted:!0,small:!0,children:[M&&M[n]&&"".concat(M[n],": "),t&&(0,oe.x6)((0,oe.QV)(t[n],4))]})},width:o?o-3*re.iI:o,xAxisLabel:B||String(u.x),xLabelFormat:function(e){return R?qo()(1e3*e).format(yt.n1):e},yAxisLabel:L||String(u.y),yLabelFormat:function(e){return e}})}}else if(i.PIE_CHART===f){var H,U=r[String(u.x)],W=null===(H=u.group_by)||void 0===H?void 0:H.join(", ");if(U)return(0,le.jsx)(Ol.Z,{data:Object.entries(U),getX:function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return"".concat(t," (").concat((0,oe.x6)(i),")")},getY:function(e){return(0,l.Z)(e,2)[1]},height:h,width:o,xAxisLabel:W||String(u.x)})}else if(i.TABLE===f){var Q=r.index,q=r.x,Y=r.y;return Array.isArray(q)&&Array.isArray(Y)&&Array.isArray(Y[0])&&(0,le.jsx)(pi.Z,{columns:q,index:Q,height:u.height?null:h,maxHeight:u.height?h:null,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,rows:Y,width:o})}return(0,le.jsx)("div",{})},Dl=t(76096);var Ml=function(e){var n=e.children,t=e.onChange,i=(0,d.useState)(d.Children.map(n,(function(){return null}))),r=i[0],o=i[1],l=(0,d.useState)(0),c=l[0],a=l[1];return(0,le.jsx)(he.Z,{children:d.Children.map(n,(function(e,n){return(0,le.jsx)(be.Z,{ml:n>=1?1:0,style:{display:"flex",flex:1},children:d.cloneElement(e,{onChange:function(e){o((function(i){return i[n]=e.target.value,t(i,{resetValues:function(){return a((function(e){return e+1}))},setValues:o}),i}))},value:r[n]})},"multi-select-child-".concat(n,"-").concat(c))}))})};function Nl(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 Bl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Nl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Nl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Ll(e,n){var t,r,o,a,u=e.autocompleteItems,s=e.block,p=e.blockRefs,m=e.blocks,v=e.deleteWidget,g=e.executionState,b=e.fetchPipeline,x=e.fetchFileTree,j=e.messages,y=void 0===j?[]:j,k=e.onChangeContent,Z=e.pipeline,_=e.runBlock,O=e.runningBlocks,w=e.savePipelineContent,S=e.selected,E=e.setAnyInputFocused,P=e.setSelectedBlock,I=e.setTextareaFocused,T=e.textareaFocused,A=e.updateWidget,R=e.width,D=(0,d.useRef)(null),M=(0,d.useContext)(Ie.ThemeContext),N=un.ZP.blocks.pipelines.detail(null===Z||void 0===Z?void 0:Z.uuid,null===s||void 0===s?void 0:s.upstream_blocks[0]).data,B=(null===N||void 0===N||null===(t=N.block)||void 0===t?void 0:t.outputs)||(null===s||void 0===s?void 0:s.outputs)||[],F=(0,d.useState)(null),H=F[0],z=F[1],G=(0,d.useState)(null===(r=s.configuration)||void 0===r?void 0:r.chart_type),W=G[0],Q=G[1],q=(0,d.useState)(s.configuration),Y=q[0],V=q[1],K=(0,d.useState)(s.content),$=K[0],ie=K[1],ce=(0,d.useState)(!W||0===B.length),ae=ce[0],ue=ce[1],se=(0,d.useState)(!1),de=se[0],fe=se[1],pe=(0,d.useState)(null),ve=pe[0],ge=pe[1],ke=(0,d.useState)(null===s||void 0===s?void 0:s.upstream_blocks),Ze=ke[0],_e=ke[1],Ce=(0,d.useState)((null===B||void 0===B?void 0:B.length)||0),Oe=Ce[0],we=Ce[1],Se=(0,d.useState)(s.uuid),Ee=Se[0],Pe=Se[1],Te=ee[W],Ae=ne[W],Re=(0,d.useMemo)((function(){return null===m||void 0===m?void 0:m.filter((function(e){var n=e.type;return[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(n)}))}),[m]),De=(0,d.useMemo)((function(){return(0,rn.HK)(Re,(function(e){return e.uuid}))}),[Re]),Me=!!O.find((function(e){return e.uuid===s.uuid}))||(null===y||void 0===y?void 0:y.length)>=1&&g!==Bn.uF.IDLE,Ne=(0,d.useMemo)((function(){return null===y||void 0===y?void 0:y.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[y]),Be=!!Ne.find((function(e){return e.error})),Le=Ne.length>=1,Fe=(0,d.useMemo)((function(){return{blockType:s.type,hasError:Be,selected:S}}),[s.type,Be,S]);if(null!==Ne&&void 0!==Ne&&Ne.length){var He,Ue,ze=Ne.length-1;a=null===Ne||void 0===Ne||null===(He=Ne[ze])||void 0===He||null===(Ue=He.data)||void 0===Ue?void 0:Ue[0]}a?(a=(a=a.slice(1,a.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,oe.Pb)(a)&&(o=JSON.parse(a))):(null===B||void 0===B?void 0:B.length)>=1&&(o={},B.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,r=n.variable_uuid;Bn.Gi.TEXT===i&&(0,oe.Pb)(t)&&(o[r]=JSON.parse(t))})));var We=(0,d.useCallback)((function(e){var n=Bl(Bl(Bl({},s),e),{},{configuration:Bl(Bl({},s.configuration),e.configuration)});w().then((function(){_({block:n,code:$,ignoreAlreadyRunning:!0,runUpstream:!!Ze.find((function(e){var n;return![h.DA.EXECUTED,h.DA.UPDATED].includes(null===(n=De[e])||void 0===n?void 0:n.status)}))})})),we((function(e){return e+1}))}),[s,De,$,we,Ze]),Qe=(0,d.useCallback)((function(e){ie(e),k(e)}),[k,ie]),qe=(0,d.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;V((function(n){return Bl(Bl({},n),e)}));var i=Bl(Bl({},s),{},{configuration:Bl(Bl(Bl({},Y),e),{},{chart_type:W})});A(i);Object.keys(e);Oe&&t&&We(i)}),[s,W,Y,Oe,We,V,A]);(0,d.useEffect)((function(){z({python:tr({autocompleteItems:u,block:s,blocks:m,pipeline:Z})})}),[u,s,m,Z]);var Ye=(0,d.useMemo)((function(){return(0,le.jsx)(Nn.Z,{autoHeight:!0,autocompleteProviders:H,onChange:Qe,selected:S,setSelected:function(e){return P(!0===e?s:null)},setTextareaFocused:I,showLineNumbers:!1,textareaFocused:T||i.TABLE===W&&!ae,value:$,width:"100%"})}),[H,W,$,ae,S,P,I,T,Qe]),Ve=(0,d.useMemo)((function(){return Be&&Le&&(0,le.jsx)(Ii,Bl(Bl({},Fe),{},{block:s,contained:!1,hideExtraInfo:!0,isInProgress:Me,messages:Ne,selected:S}))}),[s,Fe,Be,Le,Me,Ne,S]),Ke=(0,ir.Z)(ae),Je=(0,ir.Z)(R);(0,d.useEffect)((function(){var e,n=null===D||void 0===D||null===(e=D.current)||void 0===e?void 0:e.getBoundingClientRect();Ke!==ae||Je!==R?(ge(0),setTimeout((function(){var e,n,t=null===D||void 0===D||null===(e=D.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&ge(t)}),100)):n&&ge(n.width)}),[ae,Ke,D.current,ge,R,Je]);var $e=(0,d.useMemo)((function(){var e=[];return Ze.forEach((function(n,t){var i=De[n],r=(0,Xe.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:M}).accent;e.push((0,le.jsxs)(be.Z,{ml:2,children:[(0,le.jsxs)(xe.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,le.jsx)($n.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,le.jsx)(xe.ZP,{color:r,monospace:!0,small:!0,children:n})})]},n))})),e}),[De,Ze]),en=(0,d.useMemo)((function(){var e,n=[],t=null===Te||void 0===Te||null===(e=Te.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return L.includes(t)?e.concat(t):e}),[]);null===t||void 0===t||t.length;return null===t||void 0===t||t.forEach((function(e,t){var i=Y[e];if(i){var r,o,l=null===(r=te[W])||void 0===r||null===(o=r[e])||void 0===o?void 0:o.call(r);n.push((0,le.jsxs)(be.Z,{ml:2,children:[(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:i})," ",l&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,le.jsx)(xe.ZP,{default:!0,inline:!0,small:!0,children:l})]})]},i))}})),n}),[Y,Te]),nn=(0,ir.Z)(W),tn=(0,ir.Z)(Ze);(0,d.useEffect)((function(){if((!nn&&W&&null!==Ze&&void 0!==Ze&&Ze.length||(null===tn||void 0===tn||!tn.length)&&(null===Ze||void 0===Ze?void 0:Ze.length)>=1&&W)&&!$&&(0,bn.Qr)(Y)&&Ae){var e=Bl(Bl({},s),{},{upstream_blocks:Ze});Ae.configuration&&qe(Ae.configuration(e)),Ae.content&&Qe(Ae.content(e))}}),[s,W,nn,Y,$,qe,Qe,Ze,tn]);var on=(0,d.useMemo)((function(){return Y.width_percentage||1}),[Y]),ln=(0,d.useMemo)((function(){return Object.entries(Te||{}).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0],r=t[1];return Bl(Bl({},e),{},(0,c.Z)({},i,r.map((function(e){var n,t=e.autoRun,i=e.label,r=e.monospace,o=e.options,l=e.settings,a=void 0===l?{}:l,u=e.type,d=e.uuid,f={fullWidth:!0,key:d,label:(0,oe.kC)(i()),monospace:r,onBlur:function(){return P(s)},onChange:function(e){return qe((0,c.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return P(s)},value:(null===Y||void 0===Y?void 0:Y[d])||""},p=(null!==N&&void 0!==N&&N.block?[N.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(X.COLUMNS===u){var h=Y[d]||[];n=(0,le.jsxs)(le.Fragment,{children:[(!a.maxValues||h.length<a.maxValues)&&(0,le.jsxs)(Vi.Z,Bl(Bl({},f),{},{onChange:function(e){var n=Y[d]||[],i=e.target.value;n.includes(i)?n=(0,rn.Od)(n,(function(e){return e===i})):n.push(i),qe((0,c.Z)({},d,n),{autoRun:t})},value:null,children:[(0,le.jsx)("option",{value:""}),(0,rn.YC)(p.filter((function(e){return!h.includes(e)})),(function(e){return e})).map((function(e){return(0,le.jsx)("option",{value:e,children:e},e)}))]})),h.map((function(e){return(0,le.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,le.jsx)(Ur,{label:e,onClick:function(){qe((0,c.Z)({},d,(0,rn.Od)(h,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(X.METRICS===u){var m=Y[d]||[];n=(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(xe.ZP,{bold:!0,children:"Metrics"}),(0,le.jsx)(xe.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,le.jsxs)(Ml,{onChange:function(e,n){var i=n.resetValues,r=n.setValues;2===e.filter((function(e){return!!e})).length&&(m.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||(qe((0,c.Z)({},d,m.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),r([null,null]),i()))},children:[(0,le.jsxs)(Vi.Z,Bl(Bl({},f),{},{label:"aggregation",children:[(0,le.jsx)("option",{value:""}),(0,rn.YC)(J,(function(e){return e})).map((function(e){return(0,le.jsx)("option",{value:e,children:e},e)}))]})),(0,le.jsxs)(Vi.Z,Bl(Bl({},f),{},{label:"column",children:[(0,le.jsx)("option",{value:""}),(0,rn.YC)(p,(function(e){return e})).map((function(e){return(0,le.jsx)("option",{value:e,children:e},e)}))]}))]}),m.map((function(e){var n=e.aggregation,i=e.column;return(0,le.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,le.jsx)(Ur,{label:(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(xe.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,le.jsx)(xe.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){qe((0,c.Z)({},d,(0,rn.Od)(m,(function(e){var t=e.aggregation,r=e.column;return n===t&&i===r}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=o?(0,le.jsx)(Vi.Z,Bl(Bl({},f),{},{children:o.map((function(e){return(0,le.jsx)("option",{value:e,children:e},e)}))})):(0,le.jsx)(je.Z,Bl(Bl({},f),{},{type:u}));return(0,le.jsx)(be.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[De,Y,Te,B,P,qe,Ze]),cn=ln.code,an=ln.noCode,sn=(0,f.Db)(un.ZP.widgets.pipelines.useUpdate(null===Z||void 0===Z?void 0:Z.uuid,s.uuid),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){fe(!1),b(),x()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})},onError:function(e){(0,_n.qQ)(e).messages}}),dn=(0,l.Z)(sn,1)[0],fn="ChartBlock/".concat(s.uuid),pn=(0,Un.y)(),mn=pn.registerOnKeyDown,vn=pn.unregisterOnKeyDown;return(0,d.useEffect)((function(){return function(){vn(fn)}}),[vn,fn]),mn(fn,(function(e,n,t){de&&String(t[0])===String(ye.Uq)&&String(t[1])!==String(ye.zX)&&dn({widget:Bl(Bl({},s),{},{name:Ee})})}),[s,de,Ee,dn]),(0,le.jsx)(Dl.Z,{sm:12,md:12*on,children:(0,le.jsxs)(Sl,{ref:n,children:[(0,le.jsx)(be.Z,{mt:1,pt:1,px:1,children:(0,le.jsxs)(he.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,le.jsxs)(An.Z,{flex:1,style:{position:"relative"},children:[(0,le.jsx)(jt,{bold:!1,fullWidth:!0,inputValue:Ee,notRequired:!0,onBlur:function(){return setTimeout((function(){return fe(!1)}),300)},onChange:function(e){Pe(e.target.value),e.preventDefault()},onClick:function(){E(!0),fe(!0)},onFocus:function(){E(!0),fe(!0)},small:!0,stacked:!0,value:!de&&s.uuid}),de&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(be.Z,{ml:1}),(0,le.jsx)($n.Z,{noWrapping:!0,onClick:function(){return dn({widget:Bl(Bl({},s),{},{name:Ee})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Vi.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Bl(Bl({},s),{},{upstream_blocks:n});A(t),We(t),_e(n)},placeholder:"Source block",small:!0,value:(null===Ze||void 0===Ze?void 0:Ze[0])||"",children:null===Re||void 0===Re?void 0:Re.map((function(e){var n=e.uuid;return(0,le.jsx)("option",{value:n,children:n},n)}))}),(0,le.jsx)(be.Z,{mr:1}),!Me&&(0,le.jsx)(et.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,le.jsx)(me.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return We(s)},uuid:"ChartBlock/run/".concat(s.uuid),children:(0,le.jsx)(Ge.Py,{size:2*re.iI})})}),Bn.uF.QUEUED===g&&(0,le.jsx)(Mi.Z,{color:(M||hn.Z).content.active,small:!0,type:"cylon"}),Bn.uF.BUSY===g&&(0,le.jsx)(Mi.Z,{color:(M||hn.Z).content.active,small:!0}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(et.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,le.jsx)(me.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return ue((function(e){return!e}))},selected:ae,uuid:"ChartBlock/edit/".concat(s.uuid),children:(0,le.jsx)(Ge.I8,{size:2*re.iI})})}),(0,le.jsx)(be.Z,{mr:1}),(0,le.jsx)(et.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,le.jsx)(me.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return v(s)},uuid:"ChartBlock/delete/".concat(s.uuid),children:(0,le.jsx)(Ge.rF,{size:2*re.iI})})})]})]})}),(0,le.jsx)(be.Z,{mt:1}),(0,le.jsxs)(he.Z,{justifyContent:"space-between",fullWidth:!0,children:[(0,le.jsx)(An.Z,{flex:6,ref:D,children:o&&!(0,bn.Qr)(o)&&(0,le.jsx)(be.Z,{pb:3,children:(0,le.jsx)(Rl,{block:Bl(Bl({},s),{},{configuration:Bl(Bl({},s.configuration),Y)}),data:o,width:ve})})}),ae&&(0,le.jsx)(El,{children:(0,le.jsxs)(he.Z,{flexDirection:"column",fullWidth:!0,children:[(0,le.jsx)(be.Z,{mb:1,children:(0,le.jsx)(Vi.Z,{onChange:function(e){var n=e.target.value,t=Bl(Bl({},s),{},{configuration:Bl(Bl({},Y),{},{chart_type:n})});A(t),We(t),Q(n)},placeholder:"Select chart type",value:W,children:U.map((function(e){return(0,le.jsx)("option",{value:e,children:(0,oe.kC)(e)},e)}))})}),(0,le.jsx)(be.Z,{mb:1,children:(0,le.jsx)(Vi.Z,{onChange:function(e){return qe((0,c.Z)({},C,e.target.value))},placeholder:"Chart width",value:(null===Y||void 0===Y?void 0:Y.width_percentage)||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,le.jsx)("option",{value:i,children:t},t)}))})}),an]})})]}),ae&&!(null===cn||void 0===cn||!cn.length)&&h.t6.SQL!==s.language&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(be.Z,{my:1,px:1,children:[(0,le.jsx)(xe.ZP,{bold:!0,children:"Custom chart code"}),(0,le.jsxs)(xe.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,le.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,le.jsxs)(Pl,{children:[Ze.length>=1&&(0,le.jsxs)(Il,{children:[(0,le.jsxs)(xe.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",$e]}),(0,le.jsxs)(xe.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",en]})]}),Ye]})]}),Ve&&(0,le.jsx)(be.Z,{px:1,children:Ve})]})})}var Fl=d.forwardRef(Ll),Hl=t(97361),Ul=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function zl(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 Gl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wl=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,r=e.deleteWidget,o=e.messages,l=e.onChangeChartBlock,a=e.runBlock,u=e.runningBlocks,s=e.savePipelineContent,f=e.selectedBlock,p=e.setAnyInputFocused,h=e.setSelectedBlock,m=e.setTextareaFocused,v=e.textareaFocused,g=e.updateWidget,b=e.widgets,x=e.width,j=(0,Pe.Z)(e,Ul),y=(0,d.useMemo)((function(){return u.reduce((function(e,n,t){return Gl(Gl({},e),{},(0,c.Z)({},n.uuid,Gl(Gl({},n),{},{priority:t})))}),{})}),[u]);return(0,le.jsxs)(he.Z,{flexDirection:"column",fullWidth:!0,children:[(0,le.jsx)(Hl.Z,{fullHeight:!0,style:{marginLeft:.5*re.iI,marginRight:.5*re.iI},children:null===b||void 0===b?void 0:b.map((function(e){var c=e.uuid,b=y[c],k=b?0===b.priority?Bn.uF.BUSY:Bn.uF.QUEUED:Bn.uF.IDLE;return i.current[c]=(0,d.createRef)(),(0,d.createElement)(Fl,Gl(Gl({},j),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:r,executionState:k,key:c,messages:o[c],onChangeContent:function(e){return l(c,e)},ref:i.current[c],runBlock:a,runningBlocks:u,savePipelineContent:s,selected:(null===f||void 0===f?void 0:f.uuid)===c,setAnyInputFocused:p,setSelectedBlock:h,setTextareaFocused:m,textareaFocused:v,updateWidget:g,width:x}))}))}),(0,le.jsx)("div",{style:{height:"80vh"}})]})},Ql=t(86532),ql=Ie.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),Yl=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,le.jsxs)(ql,{height:t*(305/358),viewBox:r,width:t,children:[(0,le.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,le.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,le.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,le.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,le.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,le.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,le.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,le.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,le.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,le.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,le.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,le.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,le.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,le.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,le.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,le.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,le.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,le.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,le.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"})]})},Vl=t(88560),Kl=(Ie.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-43nc8t-0"})(["border-radius:","px;",""],mn.TR,(function(e){return"\n border: 1px solid ".concat((e.theme.interactive||Ao.Z.interactive).defaultBorder,";\n ")})),Ie.default.div.withConfig({displayName:"indexstyle__ColumnProfileStyle",componentId:"sc-43nc8t-1"})(["",""],(function(e){return"\n background: ".concat((e.theme.background||Ao.Z.background).table,";\n border-bottom: 1px solid ").concat((e.theme.interactive||Ao.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||Ao.Z.interactive).defaultBorder,";\n ")}))),Xl=(Ie.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-43nc8t-2"})(["background:",";padding:","px ","px;"," border-top-left-radius:","px;border-top-right-radius:","px;"],ll.Uq,1.75*re.iI,re.tr,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.interactive||Ao.Z.interactive).defaultBorder,";\n ")}),mn.TR,mn.TR),Ie.default.div.withConfig({displayName:"indexstyle__FeatureProfileStyle",componentId:"sc-43nc8t-3"})(["",""],(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.interactive||Ao.Z.interactive).defaultBorder,";\n ")}))),Jl=(Ie.default.div.withConfig({displayName:"indexstyle__BodyStyle",componentId:"sc-43nc8t-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;overflow-y:scroll;"],mn.TR,mn.TR),Ie.default.div.withConfig({displayName:"indexstyle__CellStyle",componentId:"sc-43nc8t-5"})([""," padding:","px;"],(function(e){return e.backgroundColor&&"\n background-color: ".concat(e.backgroundColor,";\n ")}),re.iI)),$l=Ie.default.div.withConfig({displayName:"indexstyle__ScrollOverflowStyle",componentId:"sc-43nc8t-6"})([""," overflow-x:auto;"],tt.w5);function ec(e,n){return{average:e["".concat(n,"/average")],avg_string_length:e["".concat(n,"/avg_string_length")],avg_word_count:e["".concat(n,"/avg_word_count")],completeness:e["".concat(n,"/completeness")],count:e["".concat(n,"/count")],count_distinct:e["".concat(n,"/count_distinct")],invalid_indices:e["".concat(n,"/invalid_indices")],invalid_value_count:e["".concat(n,"/invalid_value_count")],invalid_value_rate:e["".concat(n,"/invalid_value_rate")],invalid_values:e["".concat(n,"/invalid_values")],max:e["".concat(n,"/max")],max_character_count:e["".concat(n,"/max_character_count")],max_null_seq:e["".concat(n,"/max_null_seq")],max_word_count:e["".concat(n,"/max_word_count")],median:e["".concat(n,"/median")],min:e["".concat(n,"/min")],min_character_count:e["".concat(n,"/min_character_count")],min_word_count:e["".concat(n,"/min_word_count")],mode:e["".concat(n,"/mode")],null_value_count:e["".concat(n,"/null_value_count")],null_value_rate:e["".concat(n,"/null_value_rate")],outlier_count:e["".concat(n,"/outlier_count")],outlier_ratio:e["".concat(n,"/outlier_ratio")],outliers:e["".concat(n,"/outliers")],quality:e["".concat(n,"/quality")],skew:e["".concat(n,"/skew")],std:e["".concat(n,"/std")],sum:e["".concat(n,"/sum")],unique_value_rate:e["".concat(n,"/unique_value_rate")],validity:e["".concat(n,"/validity")],value_counts:e["".concat(n,"/value_counts")]}}var nc=["Type","Missing","Unique","Min","Max","Mean","Median","Mode","Invalid","Outliers","Skewness","Std dev"],tc={Missing:0,Invalid:0,Outliers:0,Unique:.9};function ic(e){var n=e.columns,t=e.feature,i=e.shouldLink,r=e.statistics,o=(0,d.useContext)(Ie.ThemeContext),l=t.columnType,c=t.uuid,a=ec(r,c),u=a.average,s=a.avg_string_length,f=a.avg_word_count,p=a.count,h=a.count_distinct,m=a.invalid_value_count,v=a.invalid_value_rate,g=a.max,b=a.max_character_count,x=a.max_word_count,j=a.min,y=a.min_character_count,k=a.min_word_count,Z=a.median,_=a.mode,C=a.null_value_count,O=a.null_value_rate,w=a.outlier_count,S=a.skew,E=a.std,P=a.unique_value_rate,I=[l,C,h,j,g,u,Z,_,m,w,S,E],T={Min:k,Max:x,Mean:f},A={Min:"".concat((0,oe._6)("character",y)),Max:"".concat((0,oe._6)("character",b)),Mean:"".concat((0,oe._6)("character",(0,oe.QV)(s)))},R={Invalid:(0,oe.T3)(v),Missing:(0,oe.T3)(O),Unique:(0,oe.T3)(P)},D=jn.T5[l],M=[o.background.row,o.background.row2],N=M[0],B=M[1],L=i?$n.Z:xe.ZP;return(0,le.jsxs)(An.Z,{flexDirection:"column",children:[(0,le.jsx)(Xl,{children:(0,le.jsx)(be.Z,{px:1,py:2,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[D&&(0,le.jsxs)(An.Z,{title:Vl.Rp[l],children:[(0,le.jsx)(D,{size:2*re.iI}),"\xa0"]}),(0,le.jsx)(L,{inline:!0,onClick:i?function(){return(0,at.u)({column:n.indexOf(c)},{pushHistory:!0})}:void 0,preventDefault:!0,secondary:!0,children:(0,le.jsx)(xe.ZP,{bold:!0,default:!i,maxWidth:25*re.iI,monospace:!0,secondary:i,textOverflow:!0,title:c,children:c})})]})})}),I.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"-",n=arguments.length>1?arguments[1]:void 0,t=nc[n],i=l===Vl.RL.TEXT&&t in T,r=i?T[t]:e,o=isNaN(r)?r:(0,oe.QV)(r),c=t in tc&&o/p>tc[t];return(0,le.jsx)(Jl,{backgroundColor:n%2===0?N:B,children:(0,le.jsxs)(xe.ZP,{bold:c,danger:c,default:!0,textOverflow:!0,title:i?A[t]:"",children:[i?"".concat((0,oe._6)("word",o)):o,t in R&&" (".concat(R[t],")")]})},n)}))]})}var rc=function(e){var n=e.features,t=void 0===n?[]:n,i=e.shouldLink,r=e.statistics,o=(0,d.useContext)(Ie.ThemeContext),l=(0,d.useMemo)((function(){return t.map((function(e){return e.uuid}))}),[t]);return(0,le.jsx)(Go.Z,{headerTitle:"Feature profiles",children:(0,le.jsxs)(he.Z,{children:[(0,le.jsx)(Kl,{children:(0,le.jsxs)(An.Z,{flex:1,flexDirection:"column",style:{background:o.background.table},children:[(0,le.jsx)(be.Z,{mr:1.25*re.iI,mt:"".concat(53,"px")}),nc.map((function(e,n){return(0,le.jsx)(Jl,{children:(0,le.jsx)(xe.ZP,{default:!i,secondary:i,children:e})},"".concat(e,"-").concat(n))}))]})}),(0,le.jsx)($l,{children:(0,le.jsx)(he.Z,{children:t.map((function(e,n){return(0,le.jsx)(Xl,{children:(0,le.jsx)(ic,{columns:l,feature:e,shouldLink:i,statistics:r})},"".concat(e,"-").concat(n))}))})})]})})},oc=t(21764),lc=t(22673),cc=t(1286),ac=(re.iI,cc.O$,re.iI,oi.dN,Ie.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],nt.Wi,tt.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),Ie.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*re.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),Ie.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),uc=Ie.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*re.iI,"px;\n ")})),sc=t(19963);var dc=function(e){var n=e.copyText,t=e.deleteVariable,i=e.fetchVariables,r=e.hideEdit,o=e.obfuscate,c=e.pipelineUUID,a=e.variable,u=a.uuid,s=(a.type,a.value),p=(0,d.useRef)(null),h=(0,d.useState)(!1),m=h[0],v=h[1],g=(0,d.useState)(u),b=g[0],x=g[1],j=(0,d.useState)(s),y=j[0],k=j[1],Z=(0,d.useState)(!1),_=Z[0],C=Z[1],O=(0,f.Db)(un.ZP.variables.pipelines.useUpdate(c,u),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){C(!1),i()}})}}),w=(0,l.Z)(O,1)[0],S=(0,d.useCallback)((function(e){if("Enter"===e.key){var n=y;try{n=JSON.parse(y)}catch(t){}w({variable:{name:b,value:n}})}else"Escape"===e.key&&C(!1)}),[b,y]);(0,d.useEffect)((function(){var e;_&&(null===p||void 0===p||null===(e=p.current)||void 0===e||e.focus())}),[_,p]);var E=n||"kwargs['".concat(u,"']");return(0,le.jsx)("div",{onMouseEnter:function(){return v(!0)},onMouseLeave:function(){return v(!1)},children:(0,le.jsxs)(Hl.Z,{children:[(0,le.jsx)(Dl.Z,{md:1,hiddenSmDown:!0,children:(0,le.jsx)(uc,{noPadding:!0,children:(0,le.jsx)(me.ZP,{backgroundColor:sc.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(E),oc.Am.success("Successfully copied to clipboard.",{position:oc.Am.POSITION.BOTTOM_RIGHT,toastId:u})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(u),withIcon:!0,children:(0,le.jsx)(Ge.CK,{size:2.5*re.iI})})})}),(0,le.jsx)(Dl.Z,{md:4,children:_?(0,le.jsx)(uc,{children:(0,le.jsx)(je.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:S,paddingHorizontal:0,placeholder:"variable",small:!0,value:b})}):(0,le.jsx)(uc,{children:(0,le.jsx)(xe.ZP,{color:ll.Or,monospace:!0,small:!0,textOverflow:!0,children:u})})}),(0,le.jsx)(Dl.Z,{md:7,children:_?(0,le.jsx)(uc,{children:(0,le.jsx)(je.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){k(e.target.value),e.preventDefault()},onKeyDown:S,paddingHorizontal:0,placeholder:"enter value",ref:p,small:!0,value:y})}):(0,le.jsxs)(uc,{children:[o?(0,le.jsx)(xe.ZP,{monospace:!0,small:!0,children:"********"}):(0,le.jsx)(xe.ZP,{monospace:!0,small:!0,children:s}),(0,le.jsxs)(An.Z,{children:[!r&&m&&(0,le.jsx)(me.ZP,{backgroundColor:sc.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){C(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(u),withIcon:!0,children:(0,le.jsx)(Ge.I8,{size:2.5*re.iI})}),t&&m&&(0,le.jsx)(me.ZP,{backgroundColor:sc.qJ,borderless:!0,inline:!0,muted:!0,onClick:t,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(u),withIcon:!0,children:(0,le.jsx)(Ge.rF,{size:2.5*re.iI})})]})]})})]})})},fc=t(93348),pc=t(58122);var hc=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,r=e.setErrorMessages,o=e.variables,c=e.width,a=(0,d.useState)(!1),u=a[0],s=a[1],p=(0,d.useState)(),m=p[0],v=p[1],g=(0,d.useState)(),b=g[0],x=g[1],j=null===t||void 0===t?void 0:t.uuid,y=(0,f.Db)(un.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,_n.wD)(e,{onErrorCallback:function(e){var n=e.error.exception;r((function(e){return e.concat(n)}))}})}}),k=(0,l.Z)(y,1)[0],Z=(0,f.Db)((function(e){return un.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),_=(0,l.Z)(Z,1)[0],C=(0,d.useCallback)((function(e){if("Enter"===e.key){var t=b;try{t=JSON.parse(b)}catch(i){}k({variable:{name:m,value:t}}).then((function(){n(),v(null),x(null)})),s(!1)}else"Escape"===e.key&&s(!1)}),[k,n,m,b]),O=(0,d.useMemo)((function(){return c-4*re.iI}),[c]),w=(0,d.useMemo)((function(){return(0,pc.wx)(o,(function(e){return"global"===e.uuid}))}),[o]),S=(0,d.useMemo)((function(){return(0,pc.wx)(o,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,o]),E=(0,d.useMemo)((function(){return(0,le.jsxs)(ac,{width:O,children:[u&&(0,le.jsxs)(Hl.Z,{children:[(0,le.jsx)(Dl.Z,{md:1,children:(0,le.jsx)(uc,{noPadding:!0,children:(0,le.jsx)(me.ZP,{backgroundColor:sc.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(m),oc.Am.success("Successfully copied to clipboard.",{position:oc.Am.POSITION.BOTTOM_RIGHT,toastId:m})},uuid:"Sidekick/GlobalVariables/".concat(m),withIcon:!0,children:(0,le.jsx)(Ge.CK,{size:2.5*re.iI})})})}),(0,le.jsx)(Dl.Z,{md:4,children:(0,le.jsx)(uc,{children:(0,le.jsx)(je.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){v(e.target.value),e.preventDefault()},onKeyDown:C,paddingHorizontal:0,placeholder:"variable",small:!0,value:m})})}),(0,le.jsx)(Dl.Z,{md:7,children:(0,le.jsx)(uc,{children:(0,le.jsx)(je.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:C,paddingHorizontal:0,placeholder:"enter value",small:!0,value:b})})})]}),null===w||void 0===w?void 0:w.map((function(e){return(0,le.jsx)(dc,{deleteVariable:function(){return _(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e})}))]})}),[_,w,m,b,j,v,x,s,u,O]),P=(0,d.useMemo)((function(){return(0,le.jsx)(ac,{width:O,children:null===S||void 0===S?void 0:S.map((function(e){return(0,le.jsx)(dc,{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});var n}))})}),[S,i,O]);return(0,le.jsxs)(be.Z,{p:re.cd,children:[(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Pr.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,le.jsx)(be.Z,{ml:2}),(0,le.jsx)(me.ZP,{Icon:Ge.mm,blackBorder:!0,inline:!0,onClick:function(){return s((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsxs)(xe.ZP,{muted:!0,children:["Press ",(0,le.jsx)(xe.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,le.jsx)(xe.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,le.jsx)(be.Z,{mb:re.cd,children:E}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(xe.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments. To load a global variable, use the following syntax:"})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(lc.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})}),(0,le.jsxs)(be.Z,{mb:re.cd,children:[(0,le.jsx)(Pr.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,le.jsx)(be.Z,{mb:re.cd}),(0,le.jsx)(xe.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(fc.Xm).map((function(e){var n;return(0,le.jsxs)(be.Z,{mb:re.cd,children:[(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(xe.ZP,{large:!0,monospace:!0,children:(0,oe.vg)(null===(n=fc.Z4[e])||void 0===n?void 0:n.call(fc.Z4))})}),(0,pc.JZ)([],e).map((function(e){return(0,le.jsx)(dc,{hideEdit:!0,variable:e,pipelineUUID:j})}))]})})),S&&S.length>0&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(be.Z,{my:2,children:(0,le.jsx)(Pr.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,le.jsx)(be.Z,{mb:2,children:P}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsxs)(xe.ZP,{children:["Output variables can be used in any ",(0,le.jsx)(xe.ZP,{bold:!0,inline:!0,monospace:!0,children:h.tf.SCRATCHPAD})," block."]})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(xe.ZP,{children:"To load the variable, use the following syntax:"})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(lc.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"})})]})]})},mc=Ie.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-0"})([""," overflow-y:scroll;"," ",""],tt.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return!e.height&&"\n height: ".concat(300,"px;\n ")}));function vc(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 gc(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vc(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vc(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var bc=function(e){var n=e.cancelPipeline,t=e.executePipeline,i=e.isPipelineExecuting,r=e.pipelineMessages,o=(0,d.useMemo)((function(){return(null===r||void 0===r?void 0:r.length)||0}),[r]);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(he.Z,{children:[(0,le.jsx)(de.Z,{beforeIcon:(0,le.jsx)(Ge.JM,{inverted:!0,size:2*re.iI}),loading:i,onClick:t,success:!0,children:(0,le.jsx)(xe.ZP,{bold:!0,inverted:!0,primary:!1,children:"Execute pipeline"})}),(0,le.jsx)(be.Z,{ml:1}),i&&(0,le.jsx)(de.Z,{beforeIcon:(0,le.jsx)(Ge.x8,{inverted:!0,size:2*re.iI}),onClick:n,success:!0,children:(0,le.jsx)(xe.ZP,{bold:!0,inverted:!0,primary:!1,children:"Cancel Pipeline"})})]}),(0,le.jsx)(mc,{noScrollbarTrackBackground:!0,children:(0,le.jsx)(mi,{executedAndIdle:!0,hasError:!1,selected:!0,children:r.map((function(e,n){var t=e.data,i=e.type,r=[],l=(r=(r=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return r.map((function(e,t){var r,c={first:0===n&&0===t,last:n===o-1&&t===l-1};return Bn.jU.includes(i)?r=(0,le.jsx)(vi,gc(gc({},c),{},{children:(0,le.jsx)(xe.ZP,{monospace:!0,preWrap:!0,children:(0,le.jsx)(fi(),{children:e})})})):i===Bn.Gi.IMAGE_PNG&&(r=(0,le.jsx)("div",{style:{backgroundColor:"white"},children:(0,le.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,le.jsx)("div",{children:r},"code-output-".concat(n,"-").concat(t))}))}))})})]})};var xc=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,r=e.setErrorMessages,o=e.width,c=(0,d.useState)(!1),a=c[0],u=c[1],s=(0,d.useState)(),p=s[0],h=s[1],m=(0,d.useState)(),v=m[0],g=m[1],b=(0,d.useMemo)((function(){return o-4*re.iI}),[o]),x=(0,f.Db)(un.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,_n.wD)(e,{onErrorCallback:function(e){var n=e.error.exception;r((function(e){return e.concat(n)}))}})}}),j=(0,l.Z)(x,1)[0],y=(0,f.Db)((function(e){return un.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),k=(0,l.Z)(y,1)[0],Z=(0,d.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:p,value:v}}).then((function(){n(),h(null),g(null)})),u(!1)):"Escape"===e.key&&u(!1)}),[j,n,p,v]);return(0,le.jsxs)(be.Z,{p:re.cd,children:[(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsxs)(he.Z,{alignItems:"center",children:[(0,le.jsx)(Pr.Z,{level:4,monospace:!0,children:"Secrets"}),(0,le.jsx)(be.Z,{ml:2}),(0,le.jsx)(me.ZP,{Icon:Ge.mm,blackBorder:!0,inline:!0,onClick:function(){return u((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsxs)(xe.ZP,{children:[(0,le.jsx)(xe.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."]})}),a&&(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsxs)(xe.ZP,{muted:!0,children:["Press ",(0,le.jsx)(xe.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,le.jsx)(xe.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsxs)(ac,{width:b,children:[a&&(0,le.jsxs)(Hl.Z,{children:[(0,le.jsx)(Dl.Z,{md:1,children:(0,le.jsx)(uc,{noPadding:!0,children:(0,le.jsx)(me.ZP,{backgroundColor:sc.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(p,") }}")),oc.Am.success("Successfully copied to clipboard.",{position:oc.Am.POSITION.BOTTOM_RIGHT,toastId:p})},uuid:"Sidekick/Secrets/".concat(p),withIcon:!0,children:(0,le.jsx)(Ge.CK,{size:2.5*re.iI})})})}),(0,le.jsx)(Dl.Z,{md:4,children:(0,le.jsx)(uc,{children:(0,le.jsx)(je.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){h(e.target.value),e.preventDefault()},onKeyDown:Z,paddingHorizontal:0,placeholder:"secret name",small:!0,value:p})})}),(0,le.jsx)(Dl.Z,{md:7,children:(0,le.jsx)(uc,{children:(0,le.jsx)(je.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){g(e.target.value),e.preventDefault()},onKeyDown:Z,paddingHorizontal:0,placeholder:"secret value",small:!0,value:v})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,le.jsx)(dc,{deleteVariable:function(){return k(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}})}))]})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(xe.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,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(lc.Z,{language:"yaml",small:!0,source:"\n {{ mage_secret_var('<secret_name>') }}\n "})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(xe.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,le.jsx)(be.Z,{mb:re.cd,children:(0,le.jsx)(lc.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 "})})]})},jc=t(66607),yc=t(64155);var kc=function(e){var n=e.activeView,t=e.afterWidth,i=e.autocompleteItems,r=e.blockRefs,o=e.blocks,l=e.cancelPipeline,c=e.chartRefs,a=e.deleteWidget,u=e.editingBlock,s=e.executePipeline,f=e.fetchFileTree,p=e.fetchPipeline,h=e.fetchSecrets,m=e.fetchVariables,v=e.globalVariables,g=e.insights,b=e.interruptKernel,x=e.isPipelineExecuting,j=e.messages,y=e.metadata,k=e.onChangeChartBlock,Z=e.pipeline,_=e.pipelineMessages,C=e.runBlock,O=e.runningBlocks,w=e.sampleData,S=e.savePipelineContent,E=e.secrets,P=e.selectedBlock,I=e.setAnyInputFocused,T=e.setEditingBlock,A=e.setErrors,R=e.setSelectedBlock,D=e.setTextareaFocused,M=e.statistics,N=e.textareaFocused,B=e.updateWidget,L=e.widgets,F=(0,Zo.i)().height,H=nt.uX,U=(0,d.useState)([]),z=U[0],G=U[1],W=((null===u||void 0===u?void 0:u.upstreamBlocks)||{}).block,Q=((null===w||void 0===w?void 0:w.columns)||[]).slice(0,100),q=(null===w||void 0===w?void 0:w.rows)||[],Y=(null===y||void 0===y?void 0:y.column_types)||{},V=null===Q||void 0===Q?void 0:Q.map((function(e){return{columnType:Y[e],uuid:e}})),K=(null===g||void 0===g?void 0:g[1])||{},X=(0,d.useMemo)((function(){return(0,rn.HK)((null===g||void 0===g?void 0:g[0])||[],(function(e){return e.feature.uuid}))}),[g]),J=(0,pc.v0)({statistics:M}),$=(0,pc.CL)({columnTypes:Y,statistics:M}),ee=!!w,ne=(0,d.useMemo)((function(){return ge.q.INTEGRATION===(null===Z||void 0===Z?void 0:Z.type)}),[Z]),te=(0,d.useCallback)((0,cc.Fk)({columnTypes:Y,columns:Q,insightsByFeatureUUID:X,insightsOverview:K,noColumnLinks:!0,statistics:M}),[Y,Q,X,K,M]),ie=(0,d.useMemo)((function(){return(0,le.jsx)(hc,{blocks:o,fetchVariables:m,pipeline:Z,selectedBlock:P,setErrorMessages:G,variables:v,width:t})}),[t,null===r||void 0===r?void 0:r.current,o,m,v,Z,P,R]),oe=(0,d.useMemo)((function(){return(0,le.jsx)(xc,{fetchSecrets:h,pipelineUUID:null===Z||void 0===Z?void 0:Z.uuid,secrets:E,setErrorMessages:G,width:t})}),[t,h,Z,E]);return(0,d.useMemo)((function(){return(0,le.jsx)(pi.Z,{columnHeaderHeight:yc.Eh,columns:Q,height:F-H-nt.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:te,rows:q,width:t})}),[Q,q]),(0,le.jsxs)(le.Fragment,{children:[(null===z||void 0===z?void 0:z.length)>=1&&(0,le.jsxs)(be.Z,{mb:3,mt:2,mx:2,children:[(0,le.jsxs)(he.Z,{justifyContent:"space-between",children:[(0,le.jsx)(xe.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,le.jsx)(de.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return G([])},transparent:!0,children:(0,le.jsx)(Ge.x8,{muted:!0})})]}),null===z||void 0===z?void 0:z.map((function(e){return(0,le.jsx)(be.Z,{pb:1,children:(0,le.jsx)(xe.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,le.jsxs)(yc.t0,{fullWidth:qe.includes(n),heightOffset:Re.TERMINAL===n?0:tt.nn,children:[n===Re.TREE&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(Ql.Z,{blockRefs:r,editingBlock:u,enablePorts:!ne,fetchPipeline:p,height:F-H-300,pipeline:Z,runningBlocks:O,selectedBlock:P,setEditingBlock:T,setErrors:A,setSelectedBlock:R}),!W&&ge.q.INTEGRATION!==(null===Z||void 0===Z?void 0:Z.type)&&(0,le.jsx)(be.Z,{p:2,children:(0,le.jsx)(bc,{cancelPipeline:l,executePipeline:s,isPipelineExecuting:x,pipelineMessages:_})})]}),n===Re.DATA&&Q.length>0&&(0,le.jsx)(pi.Z,{columnHeaderHeight:(0,bn.Qr)(Y)&&(0,bn.Qr)(X)&&(0,bn.Qr)(K)?0:yc.Eh,columns:Q,height:F-H-nt.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:te,rows:q,width:t}),n===Re.REPORTS&&(0,le.jsx)(yc.ht,{noPadding:!P||!ee,children:(0,le.jsxs)(he.Z,{flexDirection:"column",fullWidth:!0,children:[J&&(0,le.jsx)(jc.Z,{stats:J,title:"Quality metrics"}),$&&(0,le.jsx)(be.Z,{mt:re.cd,children:(0,le.jsx)(jc.Z,{stats:$,title:"Statistics"})}),V.length>0&&(0,le.jsx)(be.Z,{mt:re.cd,children:(0,le.jsx)(rc,{features:V,statistics:M})})]})}),n===Re.GRAPHS&&(0,le.jsx)(yc.ht,{noPadding:!P||!ee,children:(0,le.jsx)(Wo,{afterWidth:t,features:V,insightsOverview:K,statistics:M})}),Re.SECRETS===n&&oe,Re.VARIABLES===n&&ie,ne||P&&ee||!P&&ee&&n===Re.DATA?null:Ye.includes(n)&&(0,le.jsx)(he.Z,{alignItems:"center",justifyContent:"center",verticalHeight:90,verticalHeightOffset:H,width:t,children:(0,le.jsx)(xe.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:P?!ee&&"No data or insights available":"Select a block for insights"})}),Re.CHARTS===n&&(L.length>0?(0,le.jsx)(Wl,{autocompleteItems:i,blockRefs:r,blocks:o,chartRefs:c,deleteWidget:a,fetchFileTree:f,fetchPipeline:p,messages:j,onChangeChartBlock:k,pipeline:Z,runBlock:C,runningBlocks:O,savePipelineContent:S,selectedBlock:P,setAnyInputFocused:I,setSelectedBlock:R,setTextareaFocused:D,textareaFocused:N,updateWidget:B,widgets:L,width:t}):(0,le.jsxs)(he.Z,{alignItems:"center",justifyContent:"center",verticalHeight:90,verticalHeightOffset:H,width:t,children:[(0,le.jsx)(be.Z,{pl:1}),(0,le.jsx)(Yl,{size:358}),(0,le.jsx)(be.Z,{pr:1})]})),Re.TERMINAL===n&&(0,le.jsx)(Ln.Z,{interruptKernel:b,onFocus:function(){return R(null)},width:t})]})]})},Zc=t(59e3);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 Cc(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,c.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}function Oc(e){var n,t,i,r=e.page,a=e.pipeline,u=(0,p.useRouter)(),m=(0,Zo.i)().height,v=(0,d.useState)(!!(0,Ze.U2)(Ze.zg)),g=v[0],b=v[1],x=(0,d.useState)(null),j=x[0],y=x[1],k=(0,d.useState)(null),Z=k[0],_=k[1],C=(0,d.useState)(null),O=C[0],w=C[1],S=(0,d.useState)(null),E=S[0],P=S[1],I=(0,d.useState)([]),T=I[0],A=I[1],R=(0,d.useState)(!1),D=R[0],M=R[1],N=(0,d.useState)({}),B=N[0],L=N[1],F=(0,d.useState)(!1),H=F[0],U=F[1],z=(0,d.useState)(!1),G=z[0],W=z[1],Q=(0,d.useRef)(null),q=(0,d.useState)({}),Y=q[0],V=q[1],K=(0,d.useState)([]),X=K[0],J=K[1],$=un.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),ee=$.data,ne=$.mutate,te=null===ee||void 0===ee?void 0:ee.kernels,ie=(null===te||void 0===te?void 0:te.find((function(e){return e.name===ge.a[null===we||void 0===we?void 0:we.type]})))||(null===te||void 0===te?void 0:te[0]),ce=a.uuid,ae=(0,ir.Z)(ce),pe=un.ZP.pipelines.detail(ce,{includes_outputs:(0,bn.Qr)(Y)}),ve=pe.data,xe=pe.mutate,je=un.ZP.files.list(),ye=je.data,_e=je.mutate,Ce=(0,d.useMemo)((function(){return(null===ye||void 0===ye?void 0:ye.files)||[]}),[ye]),Oe=(0,d.useMemo)((function(){var e;return null===Ce||void 0===Ce||null===(e=Ce[0])||void 0===e?void 0:e.name}),[Ce]),we=null===ve||void 0===ve?void 0:ve.pipeline,Pe=(0,d.useMemo)((function(){return ge.q.INTEGRATION===(null===we||void 0===we?void 0:we.type)}),[we]);(0,d.useEffect)((function(){null!==ve&&void 0!==ve&&ve.error&&_({errors:(0,_n.QZ)(ve),response:ve})}),[ve]);var Ie=(0,d.useState)(null),Te=Ie[0],Ae=Ie[1],De=(0,d.useState)(!1),Me=De[0],Ne=De[1],Be=(0,Zc.iV)(),Le=Be.sideview,Fe=Be.block_uuid,He=Be.file_path,Ue=(0,d.useMemo)((function(){var e=Be["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Be]),We=(0,d.useCallback)((function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];(0,Zc.iV)().sideview!==e&&(0,at.u)((0,c.Z)({},Qe,e),{pushHistory:n})}),[]);(0,d.useEffect)((function(){Le||We(Re.TREE,!1)}),[Le]);var qe=(0,d.useCallback)((function(e,n){We(e,n),b(!1)}),[We]),Ye=(0,d.useRef)(null),Xe=(0,d.useRef)({}),Je=(0,d.useRef)({}),$e=(0,d.useRef)({}),en=(0,d.useRef)({}),nn=(0,d.useCallback)((function(e){$e.current=Cc(Cc({},$e.current),e)}),[$e]),tn=(0,d.useCallback)((function(e,n){nn((0,c.Z)({},e,n)),Ne(!0)}),[nn,Ne]),on=(0,d.useCallback)((function(e){en.current=Cc(Cc({},en.current),e)}),[en]),ln=(0,d.useCallback)((function(e,n){on((0,c.Z)({},e,n)),Ne(!0)}),[on,Ne]),cn=(0,d.useState)(null),an=cn[0],sn=cn[1],dn=un.ZP.data_providers.list({},{revalidateOnFocus:!0}).data,fn=null===dn||void 0===dn?void 0:dn.data_providers,pn=un.ZP.variables.pipelines.list(ce),hn=pn.data,mn=pn.mutate,vn=null===hn||void 0===hn?void 0:hn.variables,gn=un.ZP.secrets.list(),xn=gn.data,jn=gn.mutate,yn=null===xn||void 0===xn?void 0:xn.secrets,kn=(0,d.useState)([]),Zn=kn[0],On=kn[1],wn=(0,d.useState)([]),Sn=wn[0],En=wn[1],Pn=(0,d.useRef)({}),In=(0,d.useCallback)((function(e){var n;Ne(!0);var t=Pn.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),Pn.current[e.uuid]=Cc(Cc(Cc({},t),e),{},{configuration:Cc(Cc({},t.configuration),e.configuration),upstream_blocks:i})}),[Ne,Pn]),Rn=(0,d.useState)(!1),Dn=Rn[0],Mn=Rn[1],Nn=(0,d.useState)({upstreamBlocks:null}),Ln=Nn[0],Un=Nn[1],zn=(0,d.useState)([]),Gn=zn[0],Wn=zn[1],qn=(0,d.useState)(null),Yn=qn[0],Vn=qn[1],Kn=(0,d.useState)(null),Xn=Kn[0],$n=Kn[1],et=function(e,n){var t=(0,rn.HK)(n,(function(e){return e.uuid}));return e.map((function(e){return t[e]})).filter((function(e){return!!e}))}(Si(ce),Zn),nt=(0,d.useState)(et),tt=nt[0],it=nt[1],rt=(0,d.useState)(),ot=rt[0],lt=rt[1],ct=(0,d.useState)(),ut=ct[0],st=ct[1],pt=(0,d.useState)(null),ht=pt[0],mt=pt[1],vt=(0,ir.Z)(tt),gt=(0,d.useCallback)((function(){Un({upstreamBlocks:{block:null,values:[]}}),V({}),Ne(!1),Ae(null),Wn([]),Vn(null)}),[]);(0,d.useEffect)((function(){ce!==ae&&($e.current={})}),[ce,ae]);var bt=un.ZP.blocks.pipelines.outputs.detail(!g&&ce,(null===ht||void 0===ht?void 0:ht.type)!==h.tf.SCRATCHPAD&&(null===ht||void 0===ht?void 0:ht.type)!==h.tf.CHART&&(null===ht||void 0===ht?void 0:ht.uuid)&&encodeURIComponent(null===ht||void 0===ht?void 0:ht.uuid)),xt=bt.data,jt=bt.mutate,yt=(0,d.useMemo)((function(){var e,n,t;return Pe?null===(e=(0,rn.sE)(null===xt||void 0===xt?void 0:xt.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat(ut)})))||void 0===e?void 0:e.sample_data:null===xt||void 0===xt||null===(n=xt.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[xt,Pe,ut]),Zt=un.ZP.blocks.pipelines.analyses.detail(!g&&ce,(null===ht||void 0===ht?void 0:ht.type)!==h.tf.SCRATCHPAD&&(null===ht||void 0===ht?void 0:ht.type)!==h.tf.CHART&&(null===ht||void 0===ht?void 0:ht.uuid)&&encodeURIComponent(null===ht||void 0===ht?void 0:ht.uuid)),_t=Zt.data,Ct=Zt.mutate,Ot=(null===_t||void 0===_t||null===(n=_t.analyses)||void 0===n?void 0:n[0])||{},wt=Ot.insights,St=void 0===wt?{}:wt,Et=Ot.metadata,Pt=void 0===Et?{}:Et,It=Ot.statistics,Tt=void 0===It?{}:It,At=un.ZP.blocks.pipelines.analyses.detail(ce,(null===Yn||void 0===Yn?void 0:Yn.type)!==h.tf.CHART&&null!==Xn&&(null===Yn||void 0===Yn?void 0:Yn.uuid)),Rt=At.data;At.mutate,null===Rt||void 0===Rt||null===(t=Rt.analyses)||void 0===t||null===(i=t[0])||void 0===i||i.suggestions;(0,d.useEffect)((function(){0===Gn.length&&(Ct(),jt(),mn())}),[Ct,jt,mn,Gn]),(0,d.useEffect)((function(){if(0===tt.length)mt(null);else if((null===vt||void 0===vt?void 0:vt.length)!==(null===tt||void 0===tt?void 0:tt.length)&&(null===tt||void 0===tt?void 0:tt.length)<(null===vt||void 0===vt?void 0:vt.length)){var e=vt.findIndex((function(e){return e.uuid===(null===ht||void 0===ht?void 0:ht.uuid)})),n=vt.length-1===e?e-1:e+1;mt(vt[Math.max(0,n)])}}),[tt,vt,null===ht||void 0===ht?void 0:ht.uuid]),(0,d.useEffect)((function(){var e;null!==(e=Ln.upstreamBlocks)&&void 0!==e&&e.block&&(b(!1),We(Re.TREE))}),[Ln.upstreamBlocks]);var Dt=un.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!0}),Mt=Dt.data,Nt=Dt.mutate,Bt=null===Mt||void 0===Mt?void 0:Mt.autocomplete_items;(0,d.useEffect)((function(){P(He)}),[He]),(0,d.useEffect)((function(){(0,rn.fS)(Ue,T)||A(Ue)}),[Ue]);var Lt=(0,f.Db)(un.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(e){var n=e.pipeline.uuid;u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),_e()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),Ft=(0,l.Z)(Lt,1)[0],Ht=(0,f.Db)(un.ZP.pipelines.useUpdate(ce,{update_content:!0}),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){return Ne(!1)},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}}),Ut=(0,l.Z)(Ht,2),zt=Ut[0],Gt=Ut[1].isLoading,Wt=(0,d.useCallback)((function(e,n){var t=e||{},i=t.block,r=t.pipeline,o=void 0===r?{}:r,c=(n||{}).contentOnly;return Ae(new Date),zt({pipeline:Cc(Cc(Cc({},we),o),{},{blocks:Zn.map((function(e){var n,t,r=$e.current[e.uuid];"undefined"===typeof r&&(r=e.content);var o=null===(n=Y[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),a=null===o||void 0===o?void 0:o.find((function(e){return e.error}));if(o){var u=[];o.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||a||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(yi)?e:e.concat(n)}),[])),u.push(n))})),t=u.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}var s=Cc(Cc({},e),{},{content:r,outputs:t});return(null===i||void 0===i?void 0:i.uuid)===e.uuid&&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];s[t]||(s[t]={}),s[t][i]=r})):s[t]=i})),c?{content:s.content,outputs:s.outputs,uuid:s.uuid}:s})),widgets:Sn.map((function(e){var n,t,i=en.current[e.uuid],r=Pn.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var o=null===(n=Y[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===o||void 0===o?void 0:o.find((function(e){return e.error}));if(o){var c=[];o.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(yi)?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 Cc(Cc(Cc({},e),r),{},{configuration:Cc(Cc({},e.configuration),r.configuration),content:i,outputs:t})}))})})}),[Zn,$e.current,en.current,Y,we,Ae,zt,Pn.current,Sn]),Qt=(0,d.useCallback)((function(e){Wt();var n=encodeURIComponent(e),t=(0,Zc.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n),(0,at.u)({"file_paths[]":t,file_path:n})}),[Wt]),qt=(0,d.useCallback)((function(e,n){return Wt({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;ce!==r?window.location.href="/pipelines/".concat(r,"/edit"):(_e(),n!==(null===we||void 0===we?void 0:we.type)&&xe(),Oi(Zn,ce,r))}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&_((function(e){return Cc(Cc({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){Qt("pipelines/".concat(ce,"/").concat(Se.METADATA_YAML)),_(null)}}]})}))}))}),[Zn,_e,ce,Wt,Oi]),Yt=(0,f.Db)((function(e){var n=e.uuid;return un.ZP.blocks.pipelines.useDelete(ce,encodeURIComponent(n))()}),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;On((function(e){return(0,rn.oM)(e,e.findIndex((function(e){var n=e.uuid;return i===n})))})),xe(),Vn(null),t===h.tf.SCRATCHPAD&&_e()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;V((function(e){return Cc(Cc({},e),{},(0,c.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Bn.Gi.TEXT_PLAIN}}))))}))}})}}),Vt=(0,l.Z)(Yt,1)[0],Kt=(0,f.Db)((function(e){var n=e.uuid;return un.ZP.widgets.pipelines.useDelete(ce,n)()}),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(e){var n=e.widget.uuid;En((function(e){return(0,rn.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),xe(),_e()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;V((function(e){return Cc(Cc({},e),{},(0,c.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Bn.Gi.TEXT_PLAIN}}))))}))}})}}),Xt=(0,l.Z)(Kt,1)[0],Jt=(0,f.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,r="".concat(t,"/").concat(i);return n&&ze[n]&&(r="".concat(r,".").concat(ze[n].toLowerCase())),un.ZP.blocks.useDelete(encodeURIComponent(r))()}),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){Nt(),xe(),_e()},onErrorCallback:function(e,n){return _({displayMessage:"Error deleting block file. Check that there are no downstream blocks, then try again.",errors:n,response:e})}})}}),$t=(0,l.Z)(Jt,1)[0],ei=(0,f.Db)(un.ZP.kernels.useUpdate(null===ie||void 0===ie?void 0:ie.id),{onSuccess:function(e){return(0,_n.wD)(e,{callback:function(){return ne()},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}}),ni=(0,l.Z)(ei,1)[0],ti=(0,d.useCallback)((function(){return ni({kernel:{action_type:"restart"}})}),[ni]),ii=(0,d.useCallback)((function(){return ni({kernel:{action_type:"interrupt"}})}),[ni]),ri=((0,d.useCallback)((function(){window.confirm("Do you want to restart the kernel? All variables will be cleared.")&&ti()}),[ti]),(0,f.Db)(un.ZP.blocks.pipelines.useCreate(ce))),oi=(0,l.Z)(ri,1)[0],li=(0,d.useCallback)((function(e,n,t){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,oe.Y6)();e.converted_from&&(i=$e.current[e.converted_from]);var o=e.language,l=e.type;if(Pe){var c=(0,rn.HK)((null===we||void 0===we?void 0:we.blocks)||[],(function(e){return e.type})),a=c[h.tf.DATA_EXPORTER],u=c[h.tf.DATA_LOADER],s=c[h.tf.TRANSFORMER];if(h.tf.DATA_LOADER===l){if(h.t6.YAML!==o)return void _({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(o,".")});if(u)return void _({displayMessage:"Pipeline ".concat(null===we||void 0===we?void 0:we.uuid," already has a source: ").concat(null===u||void 0===u?void 0:u.uuid,".")})}else if(h.tf.TRANSFORMER===l){if(s)return void _({displayMessage:"Pipeline ".concat(null===we||void 0===we?void 0:we.uuid," already has a transformer: ").concat(null===s||void 0===s?void 0:s.uuid,".")})}else if(h.tf.DATA_EXPORTER===l){if(h.t6.YAML!==o)return void _({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(o,".")});if(a)return void _({displayMessage:"Pipeline ".concat(null===we||void 0===we?void 0:we.uuid," already has a destination: ").concat(null===a||void 0===a?void 0:a.uuid,".")})}}return oi({block:Cc({content:i,name:r,priority:n},e)}).then((function(e){(0,_n.wD)(e,{callback:function(){var n=e.data.block;null===t||void 0===t||t(n),$n(null),_e(),xe().then((function(e){var n=e.pipeline.blocks;return On(n)}))},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}))}),[$e.current,oi,Pe,On,_,we]),ci=(0,d.useState)(!1),ai=ci[0],ui=ci[1];(0,d.useEffect)((function(){ui(!!(0,Ze.U2)(ke.k))}),[]);var si=(0,Cn.dd)((function(e){var n=e.block,t=e.idx,i=e.name,r=void 0===i?(0,oe.Y6)():i,o=e.onCreateCallback;return(0,le.jsx)(Ee,{block:n,defaultName:r,onClose:pi,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return li(n,t,o,null===e||void 0===e?void 0:e.name).then((function(){return pi()}))},pipeline:we})}),{},[li,we],{background:!0,uuid:"configure_block_name_and_create"}),di=(0,l.Z)(si,2),fi=di[0],pi=di[1],hi=un.ZP.widgets.pipelines.list(!g&&ce),mi=(hi.data,hi.mutate,(0,f.Db)(un.ZP.widgets.pipelines.useCreate(ce))),vi=(0,l.Z)(mi,1)[0],gi=(0,d.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,oe.Y6)();return vi({widget:Cc({name:i,priority:n,type:h.tf.CHART},e)}).then((function(e){return(0,_n.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),_e(),xe(),We(Re.CHARTS),w(n)},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}))}),[Le,Je.current,vi,We]);(0,d.useEffect)((function(){if(O){var e,n=null===(e=Je.current[O.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),w(null))}}),[Je.current[null===O||void 0===O?void 0:O.uuid],w]),(0,d.useEffect)((function(){ae!==ce&&(On([]),En([]),it([]),J([]))}),[ce,ae]),(0,d.useEffect)((function(){"undefined"!==typeof(null===we||void 0===we?void 0:we.blocks)&&On(we.blocks)}),[null===we||void 0===we?void 0:we.blocks]),(0,d.useEffect)((function(){"undefined"!==typeof(null===we||void 0===we?void 0:we.widgets)&&En(we.widgets)}),[null===we||void 0===we?void 0:we.widgets]),(0,d.useEffect)((function(){(null===et||void 0===et?void 0:et.length)>0&&0===(null===tt||void 0===tt?void 0:tt.length)&&(it(et),mt(et[0]))}),[null===tt||void 0===tt?void 0:tt.length,null===et||void 0===et?void 0:et.length]);var bi=(0,ir.Z)(Zn);(0,d.useEffect)((function(){if("undefined"!==typeof(null===we||void 0===we?void 0:we.blocks)&&(!Zn.length||(null===bi||void 0===bi?void 0:bi.map((function(e){return e.uuid})).sort())!==(null===Zn||void 0===Zn?void 0:Zn.map((function(e){return e.uuid})).sort()))){var e=Ci(we.blocks),n=e.content,t=e.messages;$e.current=n,V((function(e){return Cc(Cc({},t),e)}))}}),[Zn,bi,null===we||void 0===we?void 0:we.blocks,On,V]),(0,d.useEffect)((function(){if(!Sn.length&&"undefined"!==typeof(null===we||void 0===we?void 0:we.widgets)){var e=Ci(we.widgets),n=e.content,t=e.messages;en.current=n,V((function(e){return Cc(Cc({},t),e)}))}}),[null===we||void 0===we?void 0:we.widgets,On,V,Sn]);var xi=(0,d.useCallback)((function(e,n,t){var i=Zn.find((function(t){var i=t.type,r=t.uuid;return i===n&&r===e}));if(i){if(Vn(i),null!==Xe&&void 0!==Xe&&Xe.current){var r,o=Xe.current["".concat(i.type,"s/").concat(i.uuid,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}(0,at.u)({file_path:null,"file_paths[]":[]})}else if(n===h.tf.CHART){var l=Sn.find((function(n){return n.uuid===e}));if(l&&(Vn(l),null!==Je&&void 0!==Je&&Je.current)){var c,a=Je.current[l.uuid];null===a||void 0===a||null===(c=a.current)||void 0===c||c.scrollIntoView()}}else t&&Qt(t)}),[Zn]);(0,d.useEffect)((function(){if(Fe&&!Yn){var e=Zn.find((function(e){var n=e.uuid;return Fe===n}));e&&xi(e.uuid,e.type,null)}else(null===bi||void 0===bi?void 0:bi.length)!==(null===Zn||void 0===Zn?void 0:Zn.length)&&Yn&&xi(Yn.uuid,Yn.type,null)}),[Fe,null===bi||void 0===bi?void 0:bi.length,Zn,xi,Yn]);var ji=new se.Z,ki=(0,d.useMemo)((function(){return{api_key:Fn.l,token:ji.decodedToken.token}}),[Fn.l,ji]),Zi=(0,s.ZP)((0,Hn.Ib)(),{onOpen:function(){return console.log("socketUrlPublish opened")},shouldReconnect:function(e){return console.log("Attempting to reconnect..."),!0}}),_i=Zi.lastMessage,Ei=(Zi.readyState,Zi.sendMessage);(0,d.useEffect)((function(){if(_i){var e=JSON.parse(_i.data),n=e.execution_state,t=e.msg_type,i=e.uuid,r=Zn.find((function(e){var n=e.uuid;return i===n}));"stream_pipeline"!==t?V((function(n){var t=n[i]||[];return Cc(Cc({},n),{},(0,c.Z)({},i,t.concat(e)))})):(J((function(n){return[].concat((0,o.Z)(n),[e])})),Bn.uF.IDLE===n&&(Wn([]),xe(),i||Mn(!1))),Bn.uF.BUSY===n?Wn((function(e){return e.find((function(e){var n=e.uuid;return i===n}))||!r?e:e.concat(r)})):Bn.uF.IDLE===n&&Wn((function(e){return e.filter((function(e){var n=e.uuid;return i!==n}))})),Ne(!0)}}),[_i]);var Pi=(0,d.useCallback)((function(){Wt().then((function(){Mn(!0),J([]),Ei(JSON.stringify(Cc(Cc({},ki),{},{execute_pipeline:!0,pipeline_uuid:ce})))}))}),[ce,ki]),Ii=(0,d.useCallback)((function(){Ei(JSON.stringify(Cc(Cc({},ki),{},{cancel_pipeline:!0,pipeline_uuid:ce})))}),[ce,Ei,ki]),Ti=(0,d.useCallback)((function(e){var n=e.block,t=e.code,i=e.ignoreAlreadyRunning,r=e.runDownstream,o=void 0!==r&&r,l=e.runUpstream,c=void 0!==l&&l,a=e.runTests,u=void 0!==a&&a,s=n.uuid;Gn.find((function(e){var n=e.uuid;return s===n}))&&!i||(Ei(JSON.stringify(Cc(Cc({},ki),{},{code:t,pipeline_uuid:null===we||void 0===we?void 0:we.uuid,run_downstream:o,run_tests:u,run_upstream:c,type:n.type,uuid:s}))),V((function(e){return delete e[s],e})),U(!1),Wn((function(e){return e.find((function(e){var n=e.uuid;return s===n}))?e:e.concat(n)}))),xe()}),[xe,we,Gn,Ei,V,Wn,U,ki]),Ai=(0,d.useCallback)((function(e){var n=e.block;return Wt({block:{outputs:[],uuid:n.uuid}},{contentOnly:!0}).then((function(){return Ti(e)}))}),[Ti,Wt]),Ri=(null===tt||void 0===tt?void 0:tt.length)>0?Ve:Ve.filter((function(e){return e.key!==Re.DATA})),Di=(0,d.useMemo)((function(){return(0,le.jsx)(kc,{activeView:Le,afterWidth:j,autocompleteItems:Bt,blockRefs:Xe,blocks:Zn,cancelPipeline:Ii,chartRefs:Je,deleteWidget:Xt,editingBlock:Ln,executePipeline:Pi,fetchFileTree:_e,fetchPipeline:xe,fetchSecrets:jn,fetchVariables:mn,globalVariables:vn,insights:St,interruptKernel:ii,isPipelineExecuting:Dn,messages:Y,metadata:Pt,onChangeChartBlock:ln,pipeline:we,pipelineMessages:X,runBlock:Ai,runningBlocks:Gn,sampleData:yt,savePipelineContent:Wt,secrets:yn,selectedBlock:Yn,setAnyInputFocused:W,setEditingBlock:Un,setErrors:_,setSelectedBlock:Vn,setTextareaFocused:U,statistics:Tt,textareaFocused:H,updateWidget:In,widgets:Sn})}),[Le,j,Bt,Xe,Zn,Xt,Ln,_e,xe,jn,mn,vn,St,ii,Y,Pt,ln,we,X,Ai,Gn,yt,Wt,yn,Yn,Ei,W,Un,_,J,U,Tt,H,In,Sn]),Mi=(0,d.useMemo)((function(){return(0,le.jsx)(bo,{addNewBlockAtIndex:ai?li:function(e,n,t,i){return new Promise((function(r,o){h.tf.DBT===(null===e||void 0===e?void 0:e.type)&&h.t6.SQL===(null===e||void 0===e?void 0:e.language)?li(e,n,t,i):fi({block:e,idx:n,name:i,onCreateCallback:t})}))},addWidget:function(e,n){var t=n.onCreateCallback;return gi(e,Sn.length,t)},anyInputFocused:G,autocompleteItems:Bt,blockRefs:Xe,blocks:Zn,dataProviders:fn,deleteBlock:Vt,fetchFileTree:_e,fetchPipeline:xe,fetchSampleData:jt,files:Ce,globalVariables:vn,interruptKernel:ii,isPipelineUpdating:Gt,kernel:ie,mainContainerRef:Q,mainContainerWidth:an,messages:Y,onChangeCodeBlock:tn,openSidekickView:qe,pipeline:we,pipelineContentTouched:Me,pipelineLastSaved:Te,restartKernel:ti,runBlock:Ai,runningBlocks:Gn,savePipelineContent:Wt,selectedBlock:Yn,setAnyInputFocused:W,setEditingBlock:Un,setErrors:_,setIntegrationStreams:lt,setMessages:V,setOutputBlocks:it,setPipelineContentTouched:Ne,setRecsWindowOpenBlockIdx:$n,setRunningBlocks:Wn,setSelectedBlock:Vn,setSelectedOutputBlock:mt,setSelectedStream:st,setTextareaFocused:U,textareaFocused:H,widgets:Sn})}),[li,gi,ai,G,Bt,Xe,Zn,fn,Vt,_e,xe,Ce,vn,ii,Gt,ie,Q,an,Y,tn,we,Me,Te,ti,Ai,Gn,Wt,Yn,W,Un,_,V,Ne,Wn,Vn,U,fi,H,Sn]),Ni=(0,d.useMemo)((function(){if(r===ko.b)return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(kt,{filePaths:T,filesTouched:B,isBusy:Gn.length>=1,isPipelineUpdating:Gt,kernel:ie,pipeline:we,pipelineContentTouched:Me,pipelineLastSaved:Te,restartKernel:ti,savePipelineContent:Wt,selectedFilePath:E,setErrors:_,updatePipelineMetadata:qt}),(null===T||void 0===T?void 0:T.length)>0&&(0,le.jsx)(dt,{filePaths:T,filesTouched:B,savePipelineContent:Wt,selectedFilePath:E})]})}),[B,Gt,ie,r,we,Me,Te,ti,Gn,Wt,E,T,_,qt]),Bi=(0,d.useMemo)((function(){var e=null===Zn||void 0===Zn?void 0:Zn.filter((function(e){var n=e.type;return h.tf.SCRATCHPAD!==n}));return(0,le.jsxs)(he.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,le.jsx)(An.Z,{children:Ri.map((function(e){var n=e.key,t=e.label,i=n===Le,r=Ke[n];return(0,le.jsx)(be.Z,{pl:1,children:(0,le.jsx)(me.ZP,{beforeElement:r&&(0,le.jsx)(r,{}),blackBorder:!0,compact:!0,onClick:function(){return We(n)},selected:i,uuid:n,children:t})},n)}))}),(0,le.jsxs)(be.Z,{px:1,ref:Ye,style:{position:"relative"},children:[(0,le.jsx)(me.ZP,{beforeElement:(0,le.jsx)(Ge.mm,{}),blackBorder:!0,compact:!0,disabled:0===(null===e||void 0===e?void 0:e.length),onClick:function(){return M(!0)},primaryGradient:!0,uuid:"Pipeline/afterHeader/add_chart",children:"Add chart"}),(0,le.jsx)(fe.Z,{disableEscape:!0,onClickOutside:function(){return M(!1)},open:D,children:(0,le.jsx)(ue,{addWidget:function(e,n){var t=n.onCreateCallback;return gi(e,Sn.length,t)},block:e[e.length-1],onClickCallback:function(){return M(!1)},open:D,parentRef:Ye,rightOffset:2*re.iI,runBlock:Ai})})]})]})}),[gi,Zn,Ri,Ye,Ai,M,D,Sn]),Li=(0,d.useMemo)((function(){var e;return null===ot||void 0===ot||null===(e=ot.filter((function(e){return(0,rn.sE)(null===xt||void 0===xt?void 0:xt.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat(e)}))})))||void 0===e?void 0:e.map((function(e){return(0,le.jsx)(be.Z,{pl:1,children:(0,le.jsx)(me.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return st(e)},selected:ut===e,uuid:e,children:e})},e)}))}),[xt,ot,ut]),Fi=(0,d.useRef)(null),Hi=(0,d.useMemo)((function(){return(0,le.jsx)(Tn,{addNewBlock:function(e,n){li(e,Zn.length,n,e.name),(null===Ue||void 0===Ue?void 0:Ue.length)>=1&&u.push("/pipelines/".concat(ce,"/edit"))},blocks:Zn,deleteBlockFile:$t,deleteWidget:Xt,fetchFileTree:_e,fetchPipeline:xe,files:Ce,onSelectBlockFile:xi,openFile:Qt,openPipeline:function(e){gt(),u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:qe,pipeline:we,ref:Fi,setErrors:_,setSelectedBlock:Vn,widgets:Sn})}),[li,Zn,$t,Xt,_e,xe,null===Ue||void 0===Ue?void 0:Ue.length,Ce,xi,Qt,qe,we,ce,gt,u,_,Vn,Sn]),Ui=(0,d.useMemo)((function(){if(r===ko.b)return(0,le.jsx)(Jn,{cancelPipeline:Ii,createPipeline:Ft,executePipeline:Pi,interruptKernel:ii,isPipelineExecuting:Dn,restartKernel:ti,savePipelineContent:Wt,setMessages:V})}),[Ii,Ft,Pi,ii,Dn,r,ti,Wt,V]);return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(ft.Z,{title:null===we||void 0===we?void 0:we.name}),(0,le.jsxs)(Oo,{after:Di,afterHeader:Bi,afterHidden:g,afterSubheader:(null===tt||void 0===tt?void 0:tt.length)>0&&Le===Re.DATA&&(0,le.jsxs)(he.Z,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!Pe&&tt.map((function(e){var n=e.uuid,t=(null===ht||void 0===ht?void 0:ht.uuid)===n;return(0,le.jsx)(be.Z,{pl:1,children:(0,le.jsx)(me.ZP,{afterElement:t?(0,le.jsx)(de.Z,{basic:!0,highlightOnHover:!0,onClick:function(){!function(e,n){var t=Si(e).filter((function(e){return e!==n}));(0,Ze.t8)(wi(e),t)}(ce,e.uuid),it((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,le.jsx)(Ge.x8,{muted:!0,size:1.25*re.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return mt(e)},selected:t,uuid:n,children:n})},n)})),Pe&&Li]}),before:Hi,beforeHeader:Ui,errors:Z,headerOffset:(null===T||void 0===T?void 0:T.length)>0?36:0,mainContainerHeader:Ni,mainContainerRef:Q,page:r,pipeline:we,projectName:Oe,setAfterHidden:b,setAfterWidthForChildren:y,setErrors:_,setMainContainerWidth:sn,children:[(0,le.jsx)("div",{style:{height:E?0:null,visibility:E?"hidden":null,opacity:E?0:null},children:Mi}),null===Ue||void 0===Ue?void 0:Ue.map((function(e){return(0,le.jsx)("div",{style:{display:E===e?null:"none"},children:(0,le.jsx)(Qn,{active:E===e,addNewBlock:function(e,n){li(e,Zn.length,n,e.name),u.push("/pipelines/".concat(ce,"/edit"))},fetchPipeline:xe,fetchVariables:mn,filePath:e,openSidekickView:qe,pipeline:we,projectName:Oe,selectedFilePath:E,setFilesTouched:L,setSelectedBlock:Vn})},e)})),(0,le.jsx)(be.Z,{pb:He?0:Math.max(Math.floor(m*(2/3)/re.iI),0)})]})]})}Oc.getInitialProps=function(){var e=(0,r.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=ko.b,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 wc=(0,wo.Z)(Oc)},11366:function(e,n,t){"use strict";t.d(n,{k:function(){return i}});var i="automatically_name_blocks"},42305:function(e,n,t){"use strict";t.d(n,{A5:function(){return d},AY:function(){return f},BP:function(){return s},JX:function(){return u},OC:function(){return o},Pc:function(){return p},d$:function(){return a},lJ:function(){return h},n1:function(){return c}});var i=t(92083),r=t.n(i),o="YYYY-MM-DD HH:mm:SS",l="YYYY-MM-DD HH:mm",c="YYYY-MM-DD";function a(e,n){var t=n.utcFormat,i=n.dayAgo,o=r()(e);return t&&(o=o.utc()),i&&(o=o.subtract(1,"days")),o.format(l)}function u(e){return r().unix(e).format(l)}function s(e,n,t){return r()(e).utc().hours(+n).minutes(+t).format()}function d(e){return r()(e).unix()}function f(e,n,t){return"".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t)}function p(e){var n=r().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function h(e){return e.padStart(2,"0")}},51504:function(e,n,t){"use strict";t.d(n,{y:function(){return o}});var i=t(75582),r=t(16115);function o(e,n){var t=e.map((function(e){return String(e)})),o=e.includes(r.PQ),l=e.includes(r.zX),c=e.includes(r.XR),a=r.xU.map((function(e){return String(e)})),u=r.vk.map((function(e){return String(e)})),s=r.Tr.map((function(e){return String(e)})),d=Object.entries(n).find((function(e){var n=(0,i.Z)(e,2),r=n[0];return n[1]&&!t.includes(String(r))&&(!l||!u.includes(String(r)))&&(!o||!a.includes(String(r)))&&(!c||!s.includes(String(r)))}));return e.every((function(e){return n[e]}))&&!d}},33766:function(e,n,t){"use strict";t.d(n,{u:function(){return s}});var i=t(75582),r=t(82394),o=t(34376),l=t.n(o),c=t(59e3);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 u(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,r.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}function s(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.replaceParams,o=t.pushHistory,a=r?{}:(0,c.iV)();n=window.location.pathname;var s=o?l().push:l().replace,d=u(u({},a),e);Object.entries(e).forEach((function(e){var n=(0,i.Z)(e,2),t=n[0],r=n[1];"undefined"!==typeof r&&null!==r||delete d[t]}));var f=(0,c.uM)(d);f.length>=1&&(f="?".concat(f));var p="".concat(n.split("?")[0]).concat(f);return s(l().router.pathname,p,{shallow:!0})}},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(46714)}])}},function(e){e.O(0,[3662,3850,2083,5896,4804,1774,5872,2524,9565,2714,2125,7011,6085,8789,704,9767,6579,9898,1830,4463,6532,1286,2426,6641,9774,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|