mage-ai 0.8.91__py3-none-any.whl → 0.8.93__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (103) hide show
  1. mage_ai/api/policies/BlockPolicy.py +1 -0
  2. mage_ai/api/policies/PipelinePolicy.py +6 -0
  3. mage_ai/api/presenters/BlockPresenter.py +1 -0
  4. mage_ai/api/presenters/PipelinePresenter.py +2 -0
  5. mage_ai/data_preparation/decorators.py +4 -0
  6. mage_ai/data_preparation/executors/block_executor.py +68 -3
  7. mage_ai/data_preparation/models/block/__init__.py +212 -67
  8. mage_ai/data_preparation/models/block/constants.py +3 -1
  9. mage_ai/data_preparation/models/constants.py +8 -8
  10. mage_ai/data_preparation/models/pipeline.py +83 -5
  11. mage_ai/data_preparation/repo_manager.py +5 -2
  12. mage_ai/data_preparation/shared/constants.py +2 -1
  13. mage_ai/data_preparation/templates/conditionals/base.jinja +11 -0
  14. mage_ai/data_preparation/templates/constants.py +7 -0
  15. mage_ai/io/mssql.py +11 -1
  16. mage_ai/io/sql.py +8 -1
  17. mage_ai/orchestration/db/migrations/versions/dfe49d040487_add_condition_failed_status_to_block_.py +39 -0
  18. mage_ai/orchestration/db/models/schedules.py +5 -1
  19. mage_ai/orchestration/pipeline_scheduler.py +27 -17
  20. mage_ai/server/api/downloads.py +64 -0
  21. mage_ai/server/constants.py +1 -1
  22. mage_ai/server/execution_manager.py +3 -2
  23. mage_ai/server/frontend_dist/404.html +2 -2
  24. mage_ai/server/frontend_dist/404.html.html +2 -2
  25. mage_ai/server/frontend_dist/_next/static/chunks/1424-321c8c08a2b05c19.js +1 -0
  26. mage_ai/server/frontend_dist/_next/static/chunks/2786-2b3ad2cf216fae42.js +1 -0
  27. mage_ai/server/frontend_dist/_next/static/chunks/3714-3bd2a8c979d6d820.js +1 -0
  28. mage_ai/server/frontend_dist/_next/static/chunks/3752-8f15fe0ca9c23cf4.js +1 -0
  29. mage_ai/server/frontend_dist/_next/static/chunks/{4476-cdae7a65db573bb7.js → 4476-c1a62e69cd8e14d5.js} +1 -1
  30. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-8aaee96edc252aa3.js +1 -0
  31. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-88c03376d807012e.js +1 -0
  32. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-915825c19bf42fa1.js +1 -0
  33. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-bf2d83dabe1bd25a.js +1 -0
  34. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-f0940870ff5a17f6.js +1 -0
  35. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-8ee12ce8362ed576.js +1 -0
  36. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-a64f7a0aba0f481d.js +1 -0
  37. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-3a3a115ab1a86e2f.js +1 -0
  38. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-160881dab5ef66d8.js +1 -0
  39. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-69d63c14abf8cf68.js +1 -0
  40. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-6092226e191dd720.js +1 -0
  41. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-549f4708f2912a7a.js +1 -0
  42. mage_ai/server/frontend_dist/_next/static/zlCBBK90aKYZtPlYLj9_T/_buildManifest.js +1 -0
  43. mage_ai/server/frontend_dist/files.html +2 -2
  44. mage_ai/server/frontend_dist/index.html +2 -2
  45. mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
  46. mage_ai/server/frontend_dist/manage/users.html +2 -2
  47. mage_ai/server/frontend_dist/manage.html +2 -2
  48. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  49. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  50. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  51. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  52. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  53. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  54. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  55. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  56. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  57. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  58. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
  59. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  60. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  61. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  62. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  63. mage_ai/server/frontend_dist/pipelines.html +2 -2
  64. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  65. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  66. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
  67. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  68. mage_ai/server/frontend_dist/settings.html +2 -2
  69. mage_ai/server/frontend_dist/sign-in.html +2 -2
  70. mage_ai/server/frontend_dist/terminal.html +2 -2
  71. mage_ai/server/frontend_dist/test.html +2 -2
  72. mage_ai/server/frontend_dist/triggers.html +2 -2
  73. mage_ai/server/server.py +8 -0
  74. mage_ai/server/websocket_server.py +3 -2
  75. mage_ai/services/spark/config.py +8 -2
  76. mage_ai/services/spark/spark.py +64 -22
  77. mage_ai/shared/environments.py +4 -8
  78. mage_ai/tests/api/operations/test_syncs.py +1 -1
  79. mage_ai/tests/data_preparation/models/test_pipeline.py +11 -1
  80. {mage_ai-0.8.91.dist-info → mage_ai-0.8.93.dist-info}/METADATA +1 -1
  81. {mage_ai-0.8.91.dist-info → mage_ai-0.8.93.dist-info}/RECORD +87 -83
  82. mage_ai/server/frontend_dist/_next/static/chunks/1424-c6b0d89ffb4a10b9.js +0 -1
  83. mage_ai/server/frontend_dist/_next/static/chunks/3714-c70e815b08e3d9be.js +0 -1
  84. mage_ai/server/frontend_dist/_next/static/chunks/3752-bd78037feb0a755f.js +0 -1
  85. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-aa11738683e2250f.js +0 -1
  86. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-06aa8a8f1ca2e8d8.js +0 -1
  87. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-3260a2dac8df672e.js +0 -1
  88. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-f08b51d9dc56eab5.js +0 -1
  89. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-43e71712d3fc0299.js +0 -1
  90. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-264439be4f197741.js +0 -1
  91. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-91ba61b9030eff1f.js +0 -1
  92. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-0bbae5456b0e6e82.js +0 -1
  93. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-86d1477c6671ea30.js +0 -1
  94. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-4b0c098074dd3e6d.js +0 -1
  95. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-891c3d3f7a2b634b.js +0 -1
  96. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-f4d470fe28b74de7.js +0 -1
  97. mage_ai/server/frontend_dist/_next/static/j-J6532RA0pcVgjHCeKSz/_buildManifest.js +0 -1
  98. /mage_ai/server/frontend_dist/_next/static/{j-J6532RA0pcVgjHCeKSz → zlCBBK90aKYZtPlYLj9_T}/_middlewareManifest.js +0 -0
  99. /mage_ai/server/frontend_dist/_next/static/{j-J6532RA0pcVgjHCeKSz → zlCBBK90aKYZtPlYLj9_T}/_ssgManifest.js +0 -0
  100. {mage_ai-0.8.91.dist-info → mage_ai-0.8.93.dist-info}/LICENSE +0 -0
  101. {mage_ai-0.8.91.dist-info → mage_ai-0.8.93.dist-info}/WHEEL +0 -0
  102. {mage_ai-0.8.91.dist-info → mage_ai-0.8.93.dist-info}/entry_points.txt +0 -0
  103. {mage_ai-0.8.91.dist-info → mage_ai-0.8.93.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4476],{48591:function(e,n,t){var i=t(21831),o=t(75582),r=t(82684),l=t(37958);n.Z=function(e){var n=e.children,t=e.uuid,u=e.uuids,c=void 0===u?[]:u,a=(0,l.j)("apiReloads"),d=(0,o.Z)(a,1)[0],s=(0,i.Z)(c);t&&s.push(t);var f=s.map((function(e){return String(d[e])||"-"})).join("_");return r.cloneElement(n,{key:f})}},43032:function(e,n,t){t.d(n,{Cl:function(){return u},Nk:function(){return c},ZG:function(){return l}});var i=t(9518),o=t(23831),r=t(49125),l=1.5*r.iI,u=1*l+r.iI/2,c=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-uvd91-0"})([".row:hover{","}"],(function(e){return"\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverBackground,";\n ")}))},46299:function(e,n,t){t.d(n,{Z:function(){return le}});var i=t(82394),o=t(75582),r=t(26304),l=t(82684),u=t(9518),c=t(83455),a=t(86422),d=t(62084),s=t(16634),f=t(73828),p=t(19711),v=t(10503),h=t(43032),m=t(49125),b=t(60701),g=t(91427),y=t(44162),x=t(32821),j=t(24224),C=t(90211),w=t(28598);function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Z="default_repo";var P=function e(n){var t=n.allowSelectingFolders,i=n.containerRef,o=n.disableContextMenu,r=n.file,u=n.isFileDisabled,c=n.level,d=n.onClickFile,k=n.onClickFolder,P=n.onSelectBlockFile,S=n.onlyShowChildren,D=n.openFile,I=n.openPipeline,_=n.openSidekickView,E=n.pipelineBlockUuids,R=n.selectFile,T=n.setContextItem,M=n.setCoordinates,F=n.setDraggingFile,N=n.setSelectedFile,A=n.theme,L=n.timeout,U=n.uncollapsed,Y=n.useRootFolder,B=r.children,H=r.disabled,W=r.name,V=r.parent;W||(r.name=Z);var z,G=Y?(0,x.a9)(r):(0,x.jN)(r),X=(null===V||void 0===V?void 0:V.name)===f.oy,Q=(0,l.useMemo)((function(){return B?(0,j.YC)(B,(function(e){return e.children?0:1})):B}),[B]),q=u?u(G,Q):H||"__init__.py"===W||!(null===W||void 0===W||!W.match(/^\./))||!W.match(f.d2)&&!B,J=u?u(G,Q):H||"__init__.py"===W||!(null===W||void 0===W||!W.match(/^\./))&&!Q||!W.match(f.d2)&&!B,$="".concat(c,"/").concat(W),K=(E.includes((0,x.dq)(r)),(0,l.useState)("undefined"===typeof U?(0,g.U2)($,!1):!U)),ee=K[0],ne=K[1],te=v.iU;1===c&&W===f.oy?te=v.B_:W===f.PF?te=v.er:Q&&(te=v.gt),Q&&a.$W.includes((0,C.C5)(W))&&(0,C.C5)(W)!==a.tf.CHART&&(z=(0,y.qn)((0,C.C5)(W),{theme:A}).accent);var ie=(0,l.useMemo)((function(){return null===Q||void 0===Q?void 0:Q.map((function(n){return(0,w.jsx)(e,{allowSelectingFolders:t,containerRef:i,disableContextMenu:o,file:O(O({},n),{},{parent:r}),isFileDisabled:u,level:S?c:c+1,onClickFile:d,onClickFolder:k,onSelectBlockFile:P,openFile:D,openPipeline:I,openSidekickView:_,pipelineBlockUuids:E,selectFile:R,setContextItem:T,setCoordinates:M,setDraggingFile:F,setSelectedFile:N,theme:A,timeout:L,uncollapsed:U,useRootFolder:Y},"".concat($,"/").concat((null===n||void 0===n?void 0:n.name)||Z))}))}),[t,Q,i,o,r,u,c,d,k,P,S,D,I,_,E,R,T,M,F,N,A,L,U,Y,$]),oe=(0,l.useMemo)((function(){var e=[];return(0,j.w6)(c).forEach((function(n,t){var i,o=h.Cl-1;e.push((0,w.jsx)("div",{style:{borderLeft:"1px solid ".concat(null===A||void 0===A||null===(i=A.content)||void 0===i?void 0:i.disabled),height:22,marginLeft:o/2-2,paddingLeft:o/2+2}},"line-".concat($,"-").concat(t)))})),e}),[c,A,$]);return(0,w.jsxs)(w.Fragment,{children:[!S&&(0,w.jsxs)("div",{className:"row",onClick:function(e){if(e.preventDefault(),!J){if((null===V||void 0===V?void 0:V.name)===f.PF){null===_||void 0===_||_(b.cH.CHARTS);var n=(0,x.lr)(r);n&&(null===P||void 0===P||P(n.uuid,n.type,(0,x.jN)(r)))}var i=(0,x.V3)(r);if(Q)t?R(G):ne((function(e){return(0,g.t8)($,!e),!e})),null===k||void 0===k||k(G);else if(d)d(G);else if(i)null===P||void 0===P||P(i.uuid,i.type,(0,x.jN)(r));else if(W.match(f.xF))null===D||void 0===D||D(G);else{var o=(0,x.lr)(r);o&&(null===P||void 0===P||P(o.uuid,o.type,(0,x.jN)(r)))}}},onContextMenu:function(e){var n;clearTimeout(L.current),null!==i&&void 0!==i&&null!==(n=i.current)&&void 0!==n&&n.contains(e.target)&&!o&&(e.preventDefault(),M({x:e.pageX,y:e.pageY}),F(null),N(r))},onMouseDown:function(e){var n,t=r?(0,x.lr)(r):null;null===i||void 0===i||null===(n=i.current)||void 0===n||!n.contains(e.target)||!t||(null===Q||void 0===Q?void 0:Q.length)>=1||o||J||X||(e.preventDefault(),clearTimeout(L.current),L.current=setTimeout((function(){M({x:e.pageX,y:e.pageY}),F(r),N(null)}),300))},style:{alignItems:"center",cursor:"default",display:"flex",minWidth:c*h.Cl+r.name.length*m.Fo+2*m.iI,paddingRight:m.iI/4},children:[oe,Q&&!ee&&(0,w.jsx)(v._M,{muted:!0,size:h.ZG}),Q&&ee&&(0,w.jsx)(v._Q,{muted:!0,size:h.ZG}),!Q&&(0,w.jsx)("div",{style:{width:h.ZG}}),(0,w.jsxs)("div",{style:{marginLeft:m.iI/2,marginRight:m.iI/2},children:[!z&&(0,w.jsx)(te,{disabled:q,size:h.ZG}),z&&(0,w.jsx)(s.Z,{color:z,size:h.ZG,square:!0})]}),(0,w.jsx)(p.ZP,{color:z,default:!z&&!J,disabled:J,monospace:!0,small:!0,children:W})]}),(0,w.jsx)("div",{style:{display:ee?"none":"block"},children:ie})]})},S=t(60328),D=t(67971),I=t(11135),_=t(29237),E=t(86673),R=t(82944),T=t(82531),M=t(16115),F=t(7715),N=t(96510),A=t(51504);var L=function(e){var n=e.fetchFileTree,t=e.file,i=e.moveFile,r=e.onCancel,u=e.onCreateFile,a=e.selectedFolder,d=e.setErrors,s=(0,l.useRef)(null),f=(0,F.Qr)(t)?null:t,p=(0,l.useState)(f?(0,x.jN)(f,null,!0):""),v=p[0],h=p[1],m=(0,l.useState)(f?null===f||void 0===f?void 0:f.name:""),b=m[0],g=m[1];(0,l.useEffect)((function(){var e;null===s||void 0===s||null===(e=s.current)||void 0===e||e.focus()}),[]),(0,l.useEffect)((function(){a&&h((0,x.jN)(a))}),[a]);var y=(0,c.Db)(T.ZP.files.useCreate(),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(e){var t=e.file;null===n||void 0===n||n(),r(),null===u||void 0===u||u(t)},onErrorCallback:function(e,n){return d({errors:n,response:e})}})}}),j=(0,o.Z)(y,1)[0],C=(0,c.Db)(T.ZP.files.useUpdate(f&&encodeURIComponent((0,x.jN)(f))),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===n||void 0===n||n(),r()},onErrorCallback:function(e,n){return d({errors:n,response:e})}})}}),k=(0,o.Z)(C,1)[0];return(0,w.jsxs)(_.Z,{footer:(0,w.jsxs)(D.Z,{children:[(0,w.jsxs)(I.ZP,{bold:!0,disabled:!b,inline:!0,keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,A.y)([M.Uq],n)},onClick:function(){return f?k({file:{dir_path:v,name:b},file_json_only:!0}):j({file:{dir_path:v,name:b,overwrite:!1},file_json_only:!0})},primary:!0,tabIndex:0,uuid:"NewFile/create_file",children:[f?i?"Move":"Rename":"Create"," file"]}),(0,w.jsx)(E.Z,{ml:1,children:(0,w.jsx)(S.Z,{onClick:function(){return r()},tabIndex:0,children:"Cancel"})})]}),headerTitle:f?i?"Move file":"Rename file":"New file",children:[(0,w.jsx)(R.Z,{disabled:!!f&&!i,label:"Directory",monospace:!0,onChange:function(e){return h(e.target.value)},setContentOnMount:!0,value:v}),(0,w.jsx)(E.Z,{mt:2,children:(0,w.jsx)(R.Z,{disabled:!!i,label:"Filename",monospace:!0,onChange:function(e){return g(e.target.value)},ref:s,required:!0,value:b})})]})};var U=function(e){var n=e.fetchFileTree,t=e.file,i=e.moveFile,r=e.onCancel,u=e.onCreateFile,a=e.selectedFolder,d=e.setErrors,s=(0,l.useRef)(null),f=(0,F.Qr)(t)?null:t,p=(0,l.useState)(f?(0,x.jN)(f,null,!0):""),v=p[0],h=p[1],m=(0,l.useState)(f?null===f||void 0===f?void 0:f.name:""),b=m[0],g=m[1];(0,l.useEffect)((function(){var e;null===s||void 0===s||null===(e=s.current)||void 0===e||e.focus()}),[]),(0,l.useEffect)((function(){a&&h((0,x.jN)(a,null,!0))}),[a]);var y=(0,c.Db)(T.ZP.folders.useCreate(),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(e){var t=e.file;null===n||void 0===n||n(),r(),null===u||void 0===u||u(t)},onErrorCallback:function(e,n){return d({errors:n,response:e})}})}}),j=(0,o.Z)(y,1)[0],C=(0,c.Db)(T.ZP.folders.useUpdate(f&&encodeURIComponent((0,x.jN)(f))),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===n||void 0===n||n(),r()},onErrorCallback:function(e,n){return d({errors:n,response:e})}})}}),k=(0,o.Z)(C,1)[0];return(0,w.jsxs)(_.Z,{footer:(0,w.jsxs)(D.Z,{children:[(0,w.jsxs)(I.ZP,{bold:!0,disabled:!b,inline:!0,keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,A.y)([M.Uq],n)},onClick:function(){return f?k({folder:{name:b,path:v}}):j({folder:{name:b,overwrite:!1,path:v}})},primary:!0,tabIndex:0,uuid:"NewFolder/create_folder",children:[f?i?"Move":"Rename":"Create"," folder"]}),(0,w.jsx)(E.Z,{ml:1,children:(0,w.jsx)(S.Z,{onClick:function(){return r()},tabIndex:0,children:"Cancel"})})]}),headerTitle:f?i?"Move folder":"Rename folder":"New folder",children:[(0,w.jsx)(R.Z,{disabled:!!f&&!i,label:"Directory",monospace:!0,onChange:function(e){return h(e.target.value)},setContentOnMount:!0,value:v}),(0,w.jsx)(E.Z,{mt:2,children:(0,w.jsx)(R.Z,{disabled:!!i,label:"Folder name",monospace:!0,onChange:function(e){return g(e.target.value)},ref:s,required:!0,value:b})})]})},Y=t(98781),B=t(62609),H=t(55106),W=t(66176),V=t(58180),z=t(23831),G=t(73942),X=(m.iI,u.default.div.withConfig({displayName:"indexstyle__DropZoneStyle",componentId:"sc-1g3zz7z-0"})(["border-radius:","px;padding:","px;max-width:","px;min-width:","px;",""],G.n_,8*m.iI,100*m.iI,55*m.iI,(function(e){return"\n border: 1px dashed ".concat((e.theme.borders||z.Z.borders).contrast,";\n ")}))),Q=u.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-1g3zz7z-1"})(["max-width:","px;min-width:","px;"],100*m.iI,55*m.iI);var q=function(e){var n=e.fetchFileTree,t=e.onCancel,i=e.selectedFolder,r=(0,l.useState)(!1),u=r[0],c=r[1],a=(0,l.useState)({}),d=a[0],s=a[1],f=(0,l.useState)({}),v=f[0],h=f[1],m=!(0,F.Qr)(d),b=(0,l.useMemo)((function(){var e=[];return(0,j.YC)(Object.entries(d),(function(e){var n=(0,o.Z)(e,2),t=n[0];n[1];return t})).forEach((function(n){var t=(0,o.Z)(n,2),i=t[0],r=t[1],l=v[i],u=null===l||void 0===l?void 0:l.message;e.push([(0,w.jsxs)("div",{children:[(0,w.jsx)(p.ZP,{overflowWrap:!0,preWrap:!0,children:i}),u&&(0,w.jsx)(E.Z,{mt:1,children:(0,w.jsx)(p.ZP,{danger:!0,small:!0,children:u})})]},"name-".concat(i)),(0,w.jsx)(W.Z,{danger:!!u,progress:100*r},"progress-".concat(i))])})),(0,w.jsx)(V.Z,{columnFlex:[1,4],columns:[{uuid:"Filename"},{uuid:"Upload progress"}],rows:e,uuid:"block-runs"})}),[d,v]);return(0,w.jsxs)(_.Z,{footer:(0,w.jsxs)(D.Z,{fullWidth:!0,children:[(0,w.jsx)(S.Z,{onClick:function(){return t()},children:"Close"}),m&&(0,w.jsx)(E.Z,{ml:1,children:(0,w.jsx)(S.Z,{onClick:function(){s({}),h({})},children:"Clear files and retry"})})]}),headerTitle:"Upload files",children:[m&&(0,w.jsx)(Q,{children:b}),!m&&(0,w.jsx)(H.Z,{directoryPath:i?(0,x.jN)(i):"",onDragActiveChange:c,setFileUploadProgress:s,setUploadedFiles:function(e){h(e),null===n||void 0===n||n()},children:(0,w.jsx)(X,{children:(0,w.jsxs)(p.ZP,{center:!0,children:[u&&"Drop to upload",!u&&"Click or drop files and folders to upload"]})})})]})},J=t(86585),$=t(55512),K=t(99497),ee=["addNewBlock","blocks","deleteWidget","fetchAutocompleteItems","fetchFileTree","fetchPipeline","files","onCreateFile","pipeline","setErrors","setSelectedBlock","widgets"];function ne(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ne(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ne(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ie,oe=20*m.iI;function re(e,n){var t=e.addNewBlock,i=e.blocks,s=void 0===i?[]:i,v=e.deleteWidget,b=e.fetchAutocompleteItems,g=e.fetchFileTree,y=e.fetchPipeline,C=e.files,k=e.onCreateFile,O=e.pipeline,Z=e.setErrors,S=e.setSelectedBlock,D=e.widgets,I=void 0===D?[]:D,_=(0,r.Z)(e,ee),E=(0,l.useRef)(null),R=(0,l.useContext)(u.ThemeContext),M=(0,l.useState)(null),F=M[0],A=M[1],H=(0,l.useState)(null),W=H[0],V=H[1],z=(0,l.useState)(null),G=z[0],X=z[1],Q=T.ZP.statuses.list().data,ne=(0,l.useMemo)((function(){var e,n;return null===Q||void 0===Q||null===(e=Q.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[Q]),ie=(0,c.Db)((function(e){return T.ZP.files.useDelete(e)()}),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===g||void 0===g||g()},onErrorCallback:function(e,n){return Z({errors:n,response:e})}})}}),re=(0,o.Z)(ie,1)[0],le=(0,c.Db)((function(e){return T.ZP.folders.useDelete(e)()}),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===g||void 0===g||g()},onErrorCallback:function(e,n){return Z({errors:n,response:e})}})}}),ue=(0,o.Z)(le,1)[0],ce=(0,K.dd)((function(e){var n=e.block;return(0,w.jsx)(B.Z,{centerOnScreen:!0,danger:!0,onCancel:se,onClick:function(){return pe({block:n,force:!0}).then((function(){return se()}))},subtitle:"Deleting this block file is dangerous. This block may have dependencies in active pipelines. Press confirm to delete this block anyway and remove it as a dependency from downstream blocks.",title:"Delete ".concat(n.uuid," anyway?"),width:34*m.iI})})),ae=(0,o.Z)(ce,2),de=ae[0],se=ae[1],fe=(0,c.Db)((function(e){var n=e.block,t=n.language,i=n.type,o=n.uuid,r=e.force,l=void 0!==r&&r,u="".concat(i,"/").concat(o);return t&&f.JD[t]&&(u="".concat(u,".").concat(f.JD[t].toLowerCase())),T.ZP.blocks.useDelete(encodeURIComponent(u),{force:l})()}),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){b(),y(),g()},onErrorCallback:function(e){var n=e.error,t=n.exception;n.message.includes("raise HasDownstreamDependencies")&&de({block:xe,exception:t})}})}}),pe=(0,o.Z)(fe,1)[0],ve=(0,j.sE)(null===O||void 0===O?void 0:O.blocks,(function(e){var n=e.type;return a.tf.DATA_EXPORTER===n})),he=(0,c.Db)(T.ZP.blocks.pipelines.useUpdate(null===O||void 0===O?void 0:O.uuid,null===ve||void 0===ve?void 0:ve.uuid),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===y||void 0===y||y()},onErrorCallback:function(e,n){return Z({errors:n,response:e})}})}}),me=(0,o.Z)(he,1)[0],be=(0,l.useCallback)((function(){return X(null)}),[X]);(0,l.useEffect)((function(){var e,i,o,r=function(e){if(clearTimeout(E.current),V(null),W&&O&&t){var i,o,r=(null===n||void 0===n||null===(i=n.current)||void 0===i||null===(o=i.getBoundingClientRect)||void 0===o?void 0:o.call(i))||{},l=r.width,u=r.x;if(e.pageX>u+l){var c=(null===O||void 0===O?void 0:O.type)===Y.qL.INTEGRATION,a=(0,$.TU)(te(te({},W),{},{path:(0,x.jN)(W)}),ne,O);null===t||void 0===t||t(a,(function(e){c&&ve&&me({block:te(te({},ve),{},{upstream_blocks:[e.uuid]})}),null===S||void 0===S||S(e)}))}}},l=function(e){W&&A({x:e.pageX,y:e.pageY})};return null===(e=document)||void 0===e||e.addEventListener("click",be),null===(i=document)||void 0===i||i.addEventListener("mousemove",l),null===(o=document)||void 0===o||o.addEventListener("mouseup",r),function(){var e,n,t;null===(e=document)||void 0===e||e.removeEventListener("click",be),null===(n=document)||void 0===n||n.removeEventListener("mousemove",l),null===(t=document)||void 0===t||t.removeEventListener("mouseup",r)}}),[t,ve,W,be,O,n,ne,S,E,me]);var ge=(0,l.useMemo)((function(){return s.concat(I).map((function(e){return e.uuid}))}),[s,I]),ye=(0,l.useMemo)((function(){return null===C||void 0===C?void 0:C.map((function(e){return(0,l.createElement)(P,te(te({},_),{},{containerRef:n,file:e,key:e.name,level:0,pipelineBlockUuids:ge,setCoordinates:A,setDraggingFile:V,setSelectedFile:X,theme:R,timeout:E}))}))}),[C,ge,_,n,R,E]),xe=(0,l.useMemo)((function(){return G&&(0,x.lr)(G)}),[G]),je=(0,l.useMemo)((function(){return W&&(0,x.lr)(W)}),[W]),Ce=(0,l.useMemo)((function(){return G&&"undefined"!==typeof(null===G||void 0===G?void 0:G.children)&&G}),[G]),we=(0,K.dd)((function(){return(0,w.jsx)(q,{fetchFileTree:g,onCancel:Ze,selectedFolder:Ce})}),{},[g,Ce],{background:!0,uuid:"upload_files"}),ke=(0,o.Z)(we,2),Oe=ke[0],Ze=ke[1],Pe=(0,K.dd)((function(e){return(0,w.jsx)(L,{fetchFileTree:g,file:null===e||void 0===e?void 0:e.file,moveFile:null===e||void 0===e?void 0:e.moveFile,onCancel:Ie,onCreateFile:k,selectedFolder:Ce,setErrors:Z})}),{},[g,k,Ce,Z],{background:!0,disableClickOutside:!0,uuid:"new_file"}),Se=(0,o.Z)(Pe,2),De=Se[0],Ie=Se[1],_e=(0,K.dd)((function(e){return(0,w.jsx)(U,{fetchFileTree:g,file:null===e||void 0===e?void 0:e.file,moveFile:null===e||void 0===e?void 0:e.moveFile,onCancel:Te,selectedFolder:Ce,setErrors:Z})}),{},[g,Ce,Z],{background:!0,disableClickOutside:!0,uuid:"new_folder"}),Ee=(0,o.Z)(_e,2),Re=Ee[0],Te=Ee[1],Me=(0,l.useMemo)((function(){var e;if(!xe&&!G&&!Ce)return(0,w.jsx)("div",{});var t=(null===n||void 0===n||null===(e=n.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,o=t.width,r=F||{},l=r.x,u=void 0===l?0:l,c=r.y,s=void 0===c?0:c,f=u;u+oe>=i+o&&(f=i+o-(oe+m.iI)),f<0&&(f=0);var p=[];return Ce?p.push.apply(p,[{label:function(){return"New folder"},onClick:function(){Re()},uuid:"new_folder"},{label:function(){return"Rename folder"},onClick:function(){Re({file:Ce})},uuid:"rename_folder"},{label:function(){return"Move folder"},onClick:function(){Re({file:Ce,moveFile:!0})},uuid:"Move_folder"},{label:function(){return"Delete folder"},onClick:function(){var e=(0,x.jN)(Ce);window.confirm("Are you sure you want to delete folder ".concat(e," and all its subfolders and files?"))&&ue(encodeURIComponent(e))},uuid:"Delete_folder"},{label:function(){return"New file"},onClick:function(){De({file:{}})},uuid:"new_file"},{label:function(){return"Upload files"},onClick:function(){Oe()},uuid:"upload_files"}]):G&&(p.push.apply(p,[{label:function(){return"Rename file"},onClick:function(){De({file:G})},uuid:"rename_file"},{label:function(){return"Move file"},onClick:function(){De({file:G,moveFile:!0})},uuid:"move_file"}]),xe?p.push({label:function(){return"Delete block file"},onClick:function(){xe.type===a.tf.CHART?window.confirm("Are you sure you want to delete widget ".concat(xe.uuid,"?"))&&v(xe):window.confirm("Are you sure you want to delete block ".concat(xe.uuid,"?"))&&pe({block:xe})},uuid:"delete_block_file"}):p.push({label:function(){return"Delete file"},onClick:function(){var e=(0,x.jN)(G);window.confirm("Are you sure you want to delete file ".concat(e,"?"))&&re(encodeURIComponent(e))},uuid:"delete_file"})),(0,w.jsx)("div",{style:{left:f,position:"fixed",top:s+m.iI/2,zIndex:J.bf+100},children:(0,w.jsx)(d.Z,{items:p,open:!0,parentRef:void 0,uuid:"FileBrowser/ContextMenu",width:oe})})}),[F,pe,re,ue,v,n,Oe,De,Re,xe,G,Ce]);return(0,w.jsxs)(h.Nk,{ref:n,children:[ye,(xe||G||Ce)&&Me,je&&(0,w.jsx)("div",{style:{left:(null===F||void 0===F?void 0:F.x)-m.iI,position:"fixed",top:(null===F||void 0===F?void 0:F.y)-m.iI,zIndex:J.bf+100},children:(0,w.jsx)(p.ZP,{cursor:"grabbing",monospace:!0,children:null===je||void 0===je?void 0:je.uuid})})]})}!function(e){e.BLOCK_FILE="block_file",e.DISABLED="disabled",e.FILE="file",e.FOLDER="folder",e.PIPELINE="pipeline"}(ie||(ie={}));var le=l.forwardRef(re)},32821:function(e,n,t){t.d(n,{V3:function(){return s},a9:function(){return u},dq:function(){return f},jN:function(){return a},lr:function(){return d}});var i=t(17717),o=t(86422),r=t(73828),l=t(90211);function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n||(t?null:null===e||void 0===e?void 0:e.name);if(null!==e&&void 0!==e&&e.parent){var r=[e.parent.name];return(null===o||void 0===o?void 0:o.length)>=1&&r.push(o),u(e.parent,r.join(i.sep))}return o}function c(e){return null===e||void 0===e?void 0:e.split(i.sep).slice(1).join(i.sep)}function a(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=u(e,n,t);return c(i)}function d(e){var n,t,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=u(e,c).split(i.sep);if(!a)return null;if(1===a.length)(a=null===e||void 0===e||null===(t=e.path)||void 0===t?void 0:t.split(i.sep))&&(n=a[0]===o.tf.CUSTOM?a[0]:(0,l.C5)(a[0]||""));else if(a[1]===o.tf.CUSTOM)n=a[1];else{var d=a[1];n=o.tf.DBT===d?d:(0,l.C5)(d||"")}if(!a||o.tf.DBT===n)return null;var s="";s=a.length>=3?a.slice(2,a.length).join(i.sep):a[a.length-1];var f=["\\.".concat(r.Lu.PY),"\\.".concat(r.Lu.R),"\\.".concat(r.Lu.SQL),"\\.".concat(r.Lu.YAML),"\\.".concat(r.Lu.YML)].join("|"),p=new RegExp("".concat(f,"$"));if(o.$W.concat(o.tf.DBT).includes(n)&&s.match(p)){var v=s.lastIndexOf("."),h=s.slice(v+1);return{language:r.nB[h],type:n,uuid:s.slice(0,v)}}}function s(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=u(e,n).split(i.sep);if(t[1]){var c=(0,l.C5)(t[n?0:1]);t[1]===o.tf.DBT&&(c=o.tf.DBT);var a=t[t.length-1],d=new RegExp(".".concat(r.Lu.YAML,"$")),s=new RegExp(".".concat(r.Lu.R,"$")),f=new RegExp(".".concat(r.Lu.SQL,"$")),p=new RegExp(".".concat(r.Lu.MD,"$"));if(a.match(d)&&o.VZ.includes(c))return{type:c,uuid:a.replace(d,"")};if(a.match(s)&&o.J8.includes(c))return{type:c,uuid:a.replace(s,"")};if(a.match(f)&&o.HX.includes(c)){var v=a.replace(/[.]/g,"_"),h=c===o.tf.DBT?t.slice(2,-1).join("_").concat("_".concat(v)):a.replace(f,"");return{type:c,uuid:h}}return a.match(p)&&c===o.tf.MARKDOWN?{type:c,uuid:a.replace(p,"")}:void 0}}function f(e){var n=e.name.split("."),t=n[n.length-1];return r.n6.includes(t)&&n.pop(),n.join("")}},91207:function(e,n,t){t.d(n,{Z:function(){return N}});var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(37958),c=t(83455),a=t(35490),d=t(86422),s=t(60328),f=t(9518),p=t(93461),v=t(67971),h=t(28598),m=f.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),b=f.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),g=function(e){var n=e.children,t=e.divider,i=l.Children.toArray(n).length;return(0,h.jsx)(m,{children:(0,h.jsx)(v.Z,{children:l.Children.map(n,(function(e,n){return e&&(0,h.jsxs)(p.Z,{children:[n>=1&&t&&(0,h.jsx)(b,{}),l.cloneElement(e,{borderRadiusLeft:i>=2&&0===n,borderRadiusRight:i>=2&&n===i-1,halfPaddingLeft:i>=2&&0!==n,halfPaddingRight:i>=2&&n!==i-1,noBorder:i>=2&&n>0&&n<i-1,noBorderRight:i>=2&&n!==i-1})]},"button-group-child-".concat(n))}))})})},y=t(57722),x=t(73828),j=t(11135),C=t(98781),w=t(86673),k=t(82531),O=t(16115),Z=t(94353),P=t(60701),S=t(55512),D=t(24224),I=t(32821),_=t(90211),E=t(96510),R=t(51504),T=t(41150);function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function F(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 N=function(e){var n=e.active,t=e.addNewBlock,f=e.disableRefreshWarning,p=e.fetchPipeline,m=e.fetchVariables,b=e.filePath,M=e.hideHeaderButtons,N=e.onContentChange,A=e.openSidekickView,L=e.pipeline,U=e.saveFile,Y=e.selectedFilePath,B=e.sendTerminalMessage,H=e.setDisableShortcuts,W=e.setErrors,V=e.setFilesTouched,z=e.setSelectedBlock,G=(0,u.j)("apiReloads"),X=(0,o.Z)(G,2)[1],Q=(0,l.useState)(null),q=Q[0],J=Q[1],$=(0,l.useState)(!1),K=$[0],ee=($[1],(0,l.useRef)(null)),ne=(0,l.useMemo)((function(){return new a.Z}),[]),te=(0,l.useMemo)((function(){return{api_key:Z.l,token:ne.decodedToken.token}}),[ne]),ie=k.ZP.statuses.list().data,oe=(0,l.useMemo)((function(){var e,n;return null===ie||void 0===ie||null===(e=ie.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[ie]),re=k.ZP.file_contents.detail(b).data;(0,l.useEffect)((function(){null!==re&&void 0!==re&&re.file_content&&J(re.file_content)}),[re]);var le=(0,l.useState)(null===q||void 0===q?void 0:q.content),ue=le[0],ce=le[1],ae=(0,l.useCallback)((function(e){ce(e),N&&(null===N||void 0===N||N(e))}),[N]),de=(0,l.useState)(!1),se=de[0],fe=de[1];(0,l.useEffect)((function(){n&&H&&(null===H||void 0===H||H(!0))}),[n,H]),(0,l.useEffect)((function(){var e;Y&&(null===ee||void 0===ee||null===(e=ee.current)||void 0===e||e.scrollIntoView())}),[Y]);var pe=(0,c.Db)(k.ZP.file_contents.useUpdate((null===q||void 0===q?void 0:q.path)&&encodeURIComponent(null===q||void 0===q?void 0:q.path)),{onSuccess:function(e){return(0,E.wD)(e,{callback:function(){X((function(e){return F(F({},e),{},(0,i.Z)({},"FileVersions/".concat(null===q||void 0===q?void 0:q.path),Number(new Date)))}))},onErrorCallback:function(e,n){return null===W||void 0===W?void 0:W({errors:n,response:e})}})}}),ve=(0,o.Z)(pe,1)[0],he=(0,l.useCallback)((function(e,n){if(U)return U(e,n);ve({file_content:F(F({},n),{},{content:e})}).then((function(){decodeURIComponent(b).split(r.sep).pop()===x.dT.METADATA_YAML&&m&&(null===m||void 0===m||m())})),V((function(e){return F(F({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),fe(!1)}),[m,b,U,V,ve]),me=(0,l.useMemo)((function(){return(0,S.lU)()}),[]),be=(0,l.useMemo)((function(){var e;return null===q||void 0===q||null===(e=q.path.match(me)[0])||void 0===e?void 0:e.split(".")[1]}),[me,q]),ge=(0,l.useMemo)((function(){if(null!==q&&void 0!==q&&q.path)return(0,h.jsx)(y.Z,{autoHeight:!0,language:x.nB[be],onChange:function(e){ae(e),V((function(e){return F(F({},e),{},(0,i.Z)({},null===q||void 0===q?void 0:q.path,!0))})),fe(!0)},onSave:function(e){he(e,q)},selected:!0,textareaFocused:!0,value:(0,_.Pb)(null===q||void 0===q?void 0:q.content)?JSON.stringify(JSON.parse(null===q||void 0===q?void 0:q.content),null,2):null===q||void 0===q?void 0:q.content,width:"100%"})}),[q,be,he,ae,V]),ye=null!==L&&void 0!==L&&L.blocks?(0,D.sE)(null===L||void 0===L?void 0:L.blocks,(function(e){var n=e.type;return d.tf.DATA_EXPORTER===n})):null,xe=(0,c.Db)(k.ZP.blocks.pipelines.useUpdate(null===L||void 0===L?void 0:L.uuid,null===ye||void 0===ye?void 0:ye.uuid),{onSuccess:function(e){return(0,E.wD)(e,{callback:function(){null===p||void 0===p||p()}})}}),je=(0,o.Z)(xe,1)[0],Ce=t&&L&&(be===x.Lu.PY||be===x.Lu.SQL||(be===x.Lu.YAML||be===x.Lu.R)&&(0,I.V3)(q,null===q||void 0===q?void 0:q.path))&&(0,S.ck)(q.path.split(r.sep))!==d.tf.SCRATCHPAD&&(0,I.lr)(q)&&(0,h.jsx)(s.Z,{onClick:function(){var e=(null===L||void 0===L?void 0:L.type)===C.qL.INTEGRATION,n=(0,S.TU)(q,oe,L);t(n,(function(n){e&&ye&&je({block:F(F({},ye),{},{upstream_blocks:[n.uuid]})}),null===z||void 0===z||z(n)}))},primary:!0,children:"Add to current pipeline"}),we=B&&(0,h.jsx)(w.Z,{m:2,children:(0,h.jsx)(j.ZP,{disabled:!oe,inline:!0,loading:K,onClick:function(){null===A||void 0===A||A(P.cH.TERMINAL),null===B||void 0===B||B(JSON.stringify(F(F({},te),{},{command:["stdin","pip install -r ".concat(oe,"/requirements.txt\r")]})))},title:oe?"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"})}),ke="FileEditor/".concat(null===q||void 0===q?void 0:q.path),Oe=(0,T.y)(),Ze=Oe.registerOnKeyDown,Pe=Oe.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){Pe(ke)}}),[Pe,ke]),Ze(ke,(function(e,t){if(n&&!f)if((0,R.y)([O.zX,O.Um],t)||(0,R.y)([O.PQ,O.Um],t))e.preventDefault(),he(ue,q);else if(se&&(0,R.y)([O.zX,O.hS],t)){e.preventDefault();var i="".concat(q.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[n,ue,f,q,he,se]),(0,h.jsxs)("div",{ref:ee,children:[!M&&(0,h.jsx)(w.Z,{p:2,children:(0,h.jsxs)(v.Z,{justifyContent:"space-between",children:[(0,h.jsxs)(g,{children:[Ce,(0,h.jsx)(s.Z,{disabled:!ue,onClick:function(e){e.preventDefault(),he(ue,q)},title:ue?null:"No changes have been made to this file.",children:"Save file content"})]}),A&&(0,h.jsx)(g,{children:(0,h.jsx)(s.Z,{compact:!0,onClick:function(){A(P.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),ge,b===x.dT.REQS_TXT&&we]})}},55512:function(e,n,t){t.d(n,{TU:function(){return f},ck:function(){return d},lU:function(){return s}});var i=t(21831),o=t(17717),r=t(86422),l=t(98781),u=t(73828),c=t(24224),a=t(90211),d=function(e){var n=e[0];return n===r.tf.DBT||n===r.tf.CUSTOM?n:e[0].slice(0,-1)};function s(){return new RegExp(Object.keys(u.nB).map((function(e){return".(".concat(e,")$")})).join("|"))}function f(e,n,t){var f,p,v=null===e||void 0===e||null===(f=e.path.match(s())[0])||void 0===f?void 0:f.split(".")[1],h=t.type===l.qL.INTEGRATION,m=(0,c.sE)(null===t||void 0===t?void 0:t.blocks,(function(e){var n=e.type;return r.tf.DATA_EXPORTER===n})),b=e.path.replace(n,"").split(o.sep),g=e.path.split(o.sep)[0]===r.tf.DBT,y=(p=b)[0]===r.tf.DBT?p.slice(1).join(o.sep):function(e){return e.at(-1)}(p).split(".")[0];if(b.length>=3&&!g){var x=b.slice(1,b.length-1).join(o.sep);y="".concat(x,"/").concat(y)}var j=d(e.path.split(o.sep)),C={configuration:{file_path:g?y:null},language:u.nB[v],name:(0,a.wE)(y),type:j};if(j===r.tf.CUSTOM&&(C.color=r.Lq.TEAL),h){var w=(0,c.sE)(t.blocks,(function(e){var n=e.type;return r.tf.DATA_LOADER===n})),k=(0,c.sE)(t.blocks,(function(e){var n=e.type;return r.tf.TRANSFORMER===n})),O=[];k?O.push(k.uuid):null!==m&&void 0!==m&&m.upstream_blocks?O.push.apply(O,(0,i.Z)(m.upstream_blocks)):w&&O.push(w.uuid),C.upstream_blocks=O}return C}},55106:function(e,n,t){t.d(n,{Z:function(){return g}});var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(83455),c=t(9518),a=t(77011),d=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 f(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=c.default.div.withConfig({displayName:"MultiFileInput__DropzoneStyle",componentId:"sc-1l6yd2y-0"})(["&:hover{cursor:pointer;}"]);var v=function(e){var n=e.children,t=e.inputOnChange,i=e.inputProps,o=e.onDragActiveChange,r=e.setFiles,u=(0,l.useCallback)((function(e){r(e)}),[r]),c=(0,a.uI)({onDrop:u}),s=c.getInputProps,v=c.getRootProps,h=c.isDragActive,m=s(),b=m.accept,g=m.autoComplete,y=m.multiple,x=m.onChange,j=m.onClick,C=m.ref,w=m.style,k=m.tabIndex,O=m.type,Z=f(f({},i),{},{accept:b,autoComplete:g,multiple:y,onChange:function(e){null===t||void 0===t||t(e),null===i||void 0===i||i.onChange(e),x(e)},onClick:j,ref:C,style:w,tabIndex:k,type:O});return(0,l.useEffect)((function(){null===o||void 0===o||o(h)}),[h,o]),(0,d.jsxs)(p,f(f({},v()),{},{children:[(0,d.jsx)("input",f(f({},Z),{},{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 b(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?m(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var g=function(e){var n=e.children,t=e.directoryPath,c=e.onDragActiveChange,a=e.setFileUploadProgress,s=e.setUploadedFiles,f=(0,u.Db)(h.ZP.files.useCreate({onUploadProgress:function(e,n){var t,o=n.body,l=[null===o||void 0===o?void 0:o.dir_path,null===o||void 0===o||null===(t=o.file)||void 0===t?void 0:t.name].filter((function(e){return(null===e||void 0===e?void 0:e.length)>=1})).join(r.sep);null===a||void 0===a||a((function(n){return b(b({},n),{},(0,i.Z)({},l,e.loaded/e.total))}))}})),p=(0,o.Z)(f,1)[0],m=(0,l.useCallback)((function(e){e.forEach((function(e){var n=e.name,o=e.path,l=[t],u=o.split(r.sep).filter((function(e){return e&&e!==n})).join(r.sep);u&&l.push(u);var c=[],d=l.join(r.sep);(null===d||void 0===d?void 0:d.length)>=1&&l.push(d),c.push(n);var f=c.join(r.sep);p({dir_path:d,file:e,overwrite:!1}).then((function(e){var n=e.data,t=n.error,o=n.file;s((function(e){return b(b({},e),{},(0,i.Z)({},f,o||t))}))})),a((function(e){return b(b({},e),{},(0,i.Z)({},f,0))}))}))}),[p,t,a,s]);return(0,d.jsx)(v,{onDragActiveChange:c,setFiles:m,children:n})}},23351:function(e,n,t){var i=t(82394),o=t(75582),r=t(17717),l=t(37958),u=t(82684),c=t(83455),a=t(60328),d=t(57722),s=t(73828),f=t(93461),p=t(67971),v=t(87372),h=t(86673),m=t(54283),b=t(58180),g=t(19711),y=t(82531),x=t(49125),j=t(55512),C=t(42305),w=t(90211),k=t(96510),O=t(66653),Z=t(24224),P=t(28598);function S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function D(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?S(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):S(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.onActionCallback,t=e.selectedBlock,S=e.selectedFilePath,I=e.setErrors,_=e.width,E=(0,l.j)("apiReloads"),R=(0,o.Z)(E,2)[1],T=y.ZP.file_versions.files.list(S&&encodeURIComponent(S)),M=T.data,F=T.mutate,N=(0,u.useMemo)((function(){return(null===M||void 0===M?void 0:M.file_versions)||[]}),[M]),A=(0,u.useState)(null),L=A[0],U=A[1],Y=(0,u.useMemo)((function(){return null===N||void 0===N?void 0:N[L]}),[L,N]),B=y.ZP.file_contents.detail(Y?encodeURIComponent(Y.path):null).data,H=(0,u.useMemo)((function(){return null===B||void 0===B?void 0:B.file_content}),[B]),W=(0,u.useMemo)((function(){return(0,j.lU)()}),[]),V=(0,u.useMemo)((function(){var e,n,t;return null===S||void 0===S||null===(e=S.match(W))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[S,W]),z=(0,c.Db)(y.ZP.file_contents.useUpdate(S&&encodeURIComponent(S)),{onSuccess:function(e){return(0,k.wD)(e,{callback:function(e){var t;S&&F();var o=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(o);if(o){var u=o.split(r.sep);if("pipelines"===u[0]){var c=u.slice(1,u.length-1).join(r.sep);l="PipelineDetail/".concat(c)}}R((function(e){return D(D({},e),{},(0,i.Z)({},l,Number(new Date)))})),U((function(e){return e+1})),null===n||void 0===n||n(e)},onErrorCallback:function(e,n){return I({errors:n,response:e})}})}}),G=(0,o.Z)(z,2),X=G[0],Q=G[1].isLoading,q=(0,u.useMemo)((function(){var e=N.map((function(e){var n=e.name,t=e.path;return[(0,P.jsxs)(p.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,P.jsxs)(f.Z,{flex:1,children:[(0,P.jsx)(g.ZP,{default:!0,monospace:!0,children:(0,C.JX)(n,{withSeconds:!0})}),(0,P.jsx)(h.Z,{px:2*x.cd,children:(0,P.jsx)(g.ZP,{monospace:!0,children:n})})]}),Y&&(null===Y||void 0===Y?void 0:Y.path)===t&&(0,P.jsx)(a.Z,{compact:!0,loading:Q,onClick:function(e){(0,O.j)(e),X({file_content:{version:n}})},small:!0,children:"Replace with this version"})]},n)]}));if(Y){var n=(0,P.jsx)(h.Z,{p:x.cd,children:(0,P.jsx)(m.Z,{},"spinner")});if(H&&(null===H||void 0===H?void 0:H.path)===(null===Y||void 0===Y?void 0:Y.path)){var t=H.content,i=void 0===t?"":t;n=(0,P.jsx)(d.Z,{autoHeight:!0,language:s.nB[V],padding:!0,readOnly:!0,value:(0,w.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:_})}e=(0,Z.Hk)([n],L+1,e)}return e}),[H,V,N,Q,Y,L,X,_]);return(0,P.jsxs)("div",{style:{width:_},children:[(0,P.jsxs)(h.Z,{p:x.cd,children:[(0,P.jsx)(v.Z,{level:5,children:"File versions"}),(0,P.jsx)(g.ZP,{inline:!0,monospace:!0,children:S?decodeURIComponent(S):null===t||void 0===t?void 0:t.uuid})]}),(0,P.jsx)(b.Z,{buildRowProps:function(e){if(Y&&L+1===e)return{renderCell:function(e){return e},renderRow:function(e){return e}}},columnFlex:[1],columns:[{uuid:"Version"}],isSelectedRow:function(e){var n;return(null===(n=N[e])||void 0===n?void 0:n.name)===(null===Y||void 0===Y?void 0:Y.name)},onClickRow:function(e){Y?e===L?U(null):e<L?U(e):e>L+1&&U(e-1):U(e)},rows:q})]})}},38488:function(e,n,t){t.d(n,{Z:function(){return O}});var i=t(82394),o=t(26304),r=t(82684),l=t(9518),u=t(16634),c=t(67971),a=t(10919),d=t(86673),s=t(19711),f=t(46261),p=t(23831),v=t(10503),h=t(28347),m=t(49125),b=t(33766),g=t(66653),y=t(28598);var x=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,o=e.isLast,l=e.onClickTab,x=e.onClickTabClose,j=e.renderTabTitle,C=e.savePipelineContent,w=e.selected,k=e.themeContext,O=(0,r.useState)(!1),Z=O[0],P=O[1];return(0,y.jsx)(c.Z,{flexDirection:"column",fullHeight:!0,onClick:function(e){e.preventDefault(),w||(l?l(n):(null===C||void 0===C||C(),(0,b.u7)({file_path:encodeURIComponent(n)})))},onMouseEnter:function(){return P(!0)},onMouseLeave:function(){return P(!1)},children:(0,y.jsx)(h.Gb,{last:o,selected:w,children:(0,y.jsxs)(c.Z,{alignItems:"center",fullHeight:!0,children:[(0,y.jsx)(f.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,y.jsxs)(c.Z,{alignItems:"center",fullHeight:!0,children:[!i[n]&&(0,y.jsx)(v.iU,{muted:!w,size:1.5*m.iI}),i[n]&&(0,y.jsx)(f.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,y.jsx)("div",{style:{padding:1},children:(0,y.jsx)(u.Z,{borderColor:(k||p.Z).borders.danger,size:1.25*m.iI})})}),(0,y.jsx)(d.Z,{mr:1}),(0,y.jsx)(s.ZP,{muted:!w,children:j?j(n):n})]})}),(0,y.jsx)(d.Z,{mr:2}),(0,y.jsx)(f.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,y.jsxs)(a.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(e){(0,g.j)(e),null===x||void 0===x||x(n)},preventDefault:!0,children:[(Z||w)&&(0,y.jsx)(v.x8,{muted:!w,size:1.25*m.iI}),!Z&&!w&&(0,y.jsx)("div",{style:{width:1.25*m.iI}})]})})]})})})},j=t(24224),C=["filePaths","isSelectedFilePath","onClickTabClose","selectedFilePath"];function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function k(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var O=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTabClose,u=e.selectedFilePath,a=(0,o.Z)(e,C),d=(0,r.useContext)(l.ThemeContext),s=(0,r.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),f=(0,r.useMemo)((function(){return null===s||void 0===s?void 0:s.length}),[s]);return(0,y.jsx)(c.Z,{alignItems:"center",justifyContent:"flex-start",children:null===s||void 0===s?void 0:s.map((function(e,n){var o=t?t(e,u):u===encodeURIComponent(e);return(0,r.createElement)(x,k(k({},a),{},{filePath:e,isLast:n===f-1,key:e,onClickTabClose:function(e){if(i)i(e);else{var n=(0,j.Od)(s,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,b.u7)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})}},selected:o,themeContext:d}))}))})}},28347:function(e,n,t){t.d(n,{Gb:function(){return f},fm:function(){return d},lO:function(){return a},rK:function(){return s},zn:function(){return c}});var i=t(9518),o=t(23831),r=t(82386),l=t(49125),u=t(37391),c=300,a=i.default.div.withConfig({displayName:"indexstyle__PipelineContainerStyle",componentId:"sc-1sv9513-0"})([".pipeline-detail-enter-active{opacity:1;transition:opacity ","ms linear;}.pipeline-detail-enter-done{opacity:0;transition:opacity ","ms linear;}"],c,c),d=i.default.div.withConfig({displayName:"indexstyle__OverlayStyle",componentId:"sc-1sv9513-1"})(["height:100vh;opacity:1;position:fixed;width:100vw;z-index:9999;",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeArea,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],r.Wi,r.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||o.Z.borders).medium,";\n ")}),(function(e){return e.relativePosition&&"\n position: relative;\n "}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(r.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,u.y$)()),f=i.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-right:1px solid transparent;height:100%;padding:","px ","px;"," "," ",""],l.iI,l.cd*l.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||o.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||o.Z.borders).light," !important;\n ")}))},73828:function(e,n,t){t.d(n,{JD:function(){return m},Lu:function(){return r},PF:function(){return p},d2:function(){return f},dT:function(){return l},n6:function(){return a},nB:function(){return h},oy:function(){return v},xF:function(){return s}});var i,o,r,l,u=t(82394),c=t(86422);!function(e){e.JSON="json",e.MD="md",e.PY="py",e.R="r",e.SQL="sql",e.TXT="txt",e.YAML="yaml",e.YML="yml"}(r||(r={})),function(e){e.INIT_PY="__init__.py",e.METADATA_YAML="metadata.yaml",e.REQS_TXT="requirements.txt"}(l||(l={}));var a=[r.PY,r.SQL],d=[r.JSON,r.MD,r.PY,r.R,r.SQL,r.TXT,r.YAML,r.YML],s=new RegExp(d.map((function(e){return".".concat(e,"$")})).join("|")),f=new RegExp(d.map((function(e){return".".concat(e,"$")})).join("|")),p="charts",v="pipelines",h=(i={},(0,u.Z)(i,r.MD,c.t6.MARKDOWN),(0,u.Z)(i,r.JSON,r.JSON),(0,u.Z)(i,r.PY,c.t6.PYTHON),(0,u.Z)(i,r.R,c.t6.R),(0,u.Z)(i,r.SQL,c.t6.SQL),(0,u.Z)(i,r.TXT,"text"),(0,u.Z)(i,r.YAML,c.t6.YAML),(0,u.Z)(i,r.YML,c.t6.YAML),i),m=(o={},(0,u.Z)(o,c.t6.MARKDOWN,r.MD),(0,u.Z)(o,c.t6.PYTHON,r.PY),(0,u.Z)(o,c.t6.R,r.R),(0,u.Z)(o,c.t6.SQL,r.SQL),(0,u.Z)(o,c.t6.YAML,r.YAML),(0,u.Z)(o,"text",r.TXT),o)},98781:function(e,n,t){t.d(n,{$1:function(){return c},G7:function(){return d},QK:function(){return u},a_:function(){return s},qL:function(){return r},r0:function(){return a}});var i,o,r,l=t(82394);!function(e){e.INTEGRATION="integration",e.PYTHON="python",e.PYSPARK="pyspark",e.STREAMING="streaming"}(r||(r={}));var u,c,a,d=(i={},(0,l.Z)(i,r.INTEGRATION,"Integration"),(0,l.Z)(i,r.PYTHON,"Standard"),(0,l.Z)(i,r.PYSPARK,"PySpark"),(0,l.Z)(i,r.STREAMING,"Streaming"),i);!function(e){e.ACTIVE="active",e.INACTIVE="inactive",e.NO_SCHEDULES="no_schedules",e.RETRY="retry"}(u||(u={})),function(e){e.GROUP="group_by",e.STATUS="status[]",e.TYPE="type[]"}(c||(c={})),function(e){e.STATUS="status",e.TYPE="type"}(a||(a={}));var s=(o={},(0,l.Z)(o,r.PYTHON,"python3"),(0,l.Z)(o,r.PYSPARK,"pysparkkernel"),o)},29237:function(e,n,t){var i=t(9518),o=t(67971),r=t(86673),l=t(19711),u=t(23831),c=t(73942),a=t(37391),d=t(49125),s=t(28598),f=(0,i.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*d.iI,1.5*d.iI,1.5*d.iI),p=i.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],c.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return!e.borderless&&"\n border: 1px solid ".concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||u.Z.background).successLight,";\n ")}),(function(e){return e.success&&!e.borderless&&"\n border: 1px solid ".concat((e.theme.background||u.Z.background).success,";\n ")}),(function(e){return!e.dark&&!e.success&&"\n background-color: ".concat((e.theme.background||u.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||u.Z.background).content,";\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.maxWidth&&"\n max-width: ".concat(e.maxWidth,"px;\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 "})),v=i.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],c.n_,c.n_,(function(e){return"\n background-color: ".concat((e.theme.background||u.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),f,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),h=i.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*d.iI,a.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*d.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),m=i.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],c.M8,c.YF,1.75*d.iI);n.Z=function(e){var n=e.borderless,t=e.children,i=e.containerRef,u=e.contentContainerRef,c=e.dark,a=e.footer,d=e.fullHeight,f=void 0===d||d,b=e.fullWidth,g=void 0===b||b,y=e.header,x=e.headerHeight,j=e.headerIcon,C=e.headerPaddingVertical,w=e.headerTitle,k=e.maxHeight,O=e.maxWidth,Z=e.minWidth,P=e.noPadding,S=e.overflowVisible,D=e.subtitle,I=e.success;return(0,s.jsxs)(p,{borderless:n,dark:c,fullHeight:f,fullWidth:g,maxHeight:k,maxWidth:O,minWidth:Z,overflowVisible:S,ref:i,success:I,children:[(y||w)&&(0,s.jsxs)(v,{headerPaddingVertical:C,height:x,children:[y&&y,w&&(0,s.jsx)(o.Z,{alignItems:"center",justifyContent:"space-between",children:(0,s.jsxs)(o.Z,{alignItems:"center",children:[j&&j,(0,s.jsx)(r.Z,{ml:j?1:0,children:(0,s.jsx)(l.ZP,{bold:!0,default:!0,children:w})})]})})]}),(0,s.jsxs)(h,{maxHeight:k,noPadding:P,overflowVisible:S,ref:u,children:[D&&(0,s.jsx)(r.Z,{mb:2,children:(0,s.jsx)(l.ZP,{default:!0,children:D})}),t]}),a&&(0,s.jsx)(m,{children:a})]})}},37958:function(e,n,t){t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},42305:function(e,n,t){t.d(n,{A5:function(){return f},AY:function(){return p},BP:function(){return s},JX:function(){return d},OC:function(){return r},Pc:function(){return v},Tz:function(){return a},d$:function(){return c},lJ:function(){return h},n1:function(){return u}});var i=t(92083),o=t.n(i),r="YYYY-MM-DD HH:mm:ss",l="YYYY-MM-DD HH:mm",u="YYYY-MM-DD";function c(e,n){var t=n.dayAgo,i=n.includeSeconds,u=n.utcFormat,c=o()(e),a=l;return u&&(c=c.utc()),t&&(c=c.subtract(1,"days")),i&&(a=r),c.format(a)}function a(e){var n=c((new Date).toISOString(),{includeSeconds:!0,utcFormat:!0});return null!==e&&void 0!==e&&e.dateObj?new Date(n):n}function d(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o().unix(e).format(null!==n&&void 0!==n&&n.withSeconds?r:l)}function s(e,n,t){return o()(e).utc().hours(+n).minutes(+t).format()}function f(e){return o()(e).unix()}function p(e,n,t,i){var o="".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t);return i?"".concat(o,":").concat(i):o}function v(e){var n=o().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function h(e){return e.padStart(2,"0")}},54405:function(e,n,t){var i;t.d(n,{V5:function(){return r}}),function(e){e.ANDROID="Android",e.CHROME_OS="ChromeOS",e.IOS="iOS",e.LINUX="Linux",e.MAC="macOS",e.WINDOWS="Windows"}(i||(i={}));var o=i;function r(){return function(){var e,n,t,i,r,l,u,c=o.MAC,a=null===(e=window)||void 0===e||null===(n=e.navigator)||void 0===n?void 0:n.userAgent,d=(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===(l=window)||void 0===l||null===(u=l.navigator)||void 0===u?void 0:u.platform);return d?["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(d)?c=o.MAC:["Win32","Win64","Windows","WinCE"].includes(d)?c=o.WINDOWS:["iPhone","iPad","iPod"].includes(d)&&(c=o.IOS):a&&(a.includes("Macintosh")?c=o.MAC:a.includes("Windows")?c=o.WINDOWS:a.includes("Linux")&&a.includes("X11")?c=o.LINUX:/(iPhone|iPad)/.test(a)?c=o.IOS:a.includes("Android")&&a.includes("Mobi")?c=o.ANDROID:a.includes("CrOS")&&(c=o.CHROME_OS)),c}()===o.MAC}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4476],{48591:function(e,n,t){var i=t(21831),o=t(75582),r=t(82684),l=t(37958);n.Z=function(e){var n=e.children,t=e.uuid,u=e.uuids,c=void 0===u?[]:u,a=(0,l.j)("apiReloads"),d=(0,o.Z)(a,1)[0],s=(0,i.Z)(c);t&&s.push(t);var f=s.map((function(e){return String(d[e])||"-"})).join("_");return r.cloneElement(n,{key:f})}},43032:function(e,n,t){t.d(n,{Cl:function(){return u},Nk:function(){return c},ZG:function(){return l}});var i=t(9518),o=t(23831),r=t(49125),l=1.5*r.iI,u=1*l+r.iI/2,c=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-uvd91-0"})([".row:hover{","}"],(function(e){return"\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverBackground,";\n ")}))},46299:function(e,n,t){t.d(n,{Z:function(){return le}});var i=t(82394),o=t(75582),r=t(26304),l=t(82684),u=t(9518),c=t(83455),a=t(86422),d=t(62084),s=t(16634),f=t(73828),p=t(19711),v=t(10503),h=t(43032),m=t(49125),b=t(60701),g=t(91427),y=t(44162),x=t(32821),j=t(24224),C=t(90211),w=t(28598);function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Z="default_repo";var P=function e(n){var t=n.allowSelectingFolders,i=n.containerRef,o=n.disableContextMenu,r=n.file,u=n.isFileDisabled,c=n.level,d=n.onClickFile,k=n.onClickFolder,P=n.onSelectBlockFile,S=n.onlyShowChildren,D=n.openFile,I=n.openPipeline,_=n.openSidekickView,E=n.pipelineBlockUuids,R=n.selectFile,T=n.setContextItem,M=n.setCoordinates,F=n.setDraggingFile,N=n.setSelectedFile,A=n.theme,L=n.timeout,U=n.uncollapsed,Y=n.useRootFolder,B=r.children,H=r.disabled,W=r.name,V=r.parent;W||(r.name=Z);var z,G=Y?(0,x.a9)(r):(0,x.jN)(r),X=(null===V||void 0===V?void 0:V.name)===f.oy,Q=(0,l.useMemo)((function(){return B?(0,j.YC)(B,(function(e){return e.children?0:1})):B}),[B]),q=u?u(G,Q):H||"__init__.py"===W||!(null===W||void 0===W||!W.match(/^\./))||!W.match(f.d2)&&!B,J=u?u(G,Q):H||"__init__.py"===W||!(null===W||void 0===W||!W.match(/^\./))&&!Q||!W.match(f.d2)&&!B,$="".concat(c,"/").concat(W),K=(E.includes((0,x.dq)(r)),(0,l.useState)("undefined"===typeof U?(0,g.U2)($,!1):!U)),ee=K[0],ne=K[1],te=v.iU;1===c&&W===f.oy?te=v.B_:W===f.PF?te=v.er:Q&&(te=v.gt),Q&&a.$W.includes((0,C.C5)(W))&&(0,C.C5)(W)!==a.tf.CHART&&(z=(0,y.qn)((0,C.C5)(W),{theme:A}).accent);var ie=(0,l.useMemo)((function(){return null===Q||void 0===Q?void 0:Q.map((function(n){return(0,w.jsx)(e,{allowSelectingFolders:t,containerRef:i,disableContextMenu:o,file:O(O({},n),{},{parent:r}),isFileDisabled:u,level:S?c:c+1,onClickFile:d,onClickFolder:k,onSelectBlockFile:P,openFile:D,openPipeline:I,openSidekickView:_,pipelineBlockUuids:E,selectFile:R,setContextItem:T,setCoordinates:M,setDraggingFile:F,setSelectedFile:N,theme:A,timeout:L,uncollapsed:U,useRootFolder:Y},"".concat($,"/").concat((null===n||void 0===n?void 0:n.name)||Z))}))}),[t,Q,i,o,r,u,c,d,k,P,S,D,I,_,E,R,T,M,F,N,A,L,U,Y,$]),oe=(0,l.useMemo)((function(){var e=[];return(0,j.w6)(c).forEach((function(n,t){var i,o=h.Cl-1;e.push((0,w.jsx)("div",{style:{borderLeft:"1px solid ".concat(null===A||void 0===A||null===(i=A.content)||void 0===i?void 0:i.disabled),height:22,marginLeft:o/2-2,paddingLeft:o/2+2}},"line-".concat($,"-").concat(t)))})),e}),[c,A,$]);return(0,w.jsxs)(w.Fragment,{children:[!S&&(0,w.jsxs)("div",{className:"row",onClick:function(e){if(e.preventDefault(),!J){if((null===V||void 0===V?void 0:V.name)===f.PF){null===_||void 0===_||_(b.cH.CHARTS);var n=(0,x.lr)(r);n&&(null===P||void 0===P||P(n.uuid,n.type,(0,x.jN)(r)))}var i=(0,x.V3)(r);if(Q)t?R(G):ne((function(e){return(0,g.t8)($,!e),!e})),null===k||void 0===k||k(G);else if(d)d(G);else if(i)null===P||void 0===P||P(i.uuid,i.type,(0,x.jN)(r));else if(W.match(f.xF))null===D||void 0===D||D(G);else{var o=(0,x.lr)(r);o&&(null===P||void 0===P||P(o.uuid,o.type,(0,x.jN)(r)))}}},onContextMenu:function(e){var n;clearTimeout(L.current),null!==i&&void 0!==i&&null!==(n=i.current)&&void 0!==n&&n.contains(e.target)&&!o&&(e.preventDefault(),M({x:e.pageX,y:e.pageY}),F(null),N(r))},onMouseDown:function(e){var n,t=r?(0,x.lr)(r):null;null===i||void 0===i||null===(n=i.current)||void 0===n||!n.contains(e.target)||!t||(null===Q||void 0===Q?void 0:Q.length)>=1||o||J||X||(e.preventDefault(),clearTimeout(L.current),L.current=setTimeout((function(){M({x:e.pageX,y:e.pageY}),F(r),N(null)}),300))},style:{alignItems:"center",cursor:"default",display:"flex",minWidth:c*h.Cl+r.name.length*m.Fo+2*m.iI,paddingRight:m.iI/4},children:[oe,Q&&!ee&&(0,w.jsx)(v._M,{muted:!0,size:h.ZG}),Q&&ee&&(0,w.jsx)(v._Q,{muted:!0,size:h.ZG}),!Q&&(0,w.jsx)("div",{style:{width:h.ZG}}),(0,w.jsxs)("div",{style:{marginLeft:m.iI/2,marginRight:m.iI/2},children:[!z&&(0,w.jsx)(te,{disabled:q,size:h.ZG}),z&&(0,w.jsx)(s.Z,{color:z,size:h.ZG,square:!0})]}),(0,w.jsx)(p.ZP,{color:z,default:!z&&!J,disabled:J,monospace:!0,small:!0,children:W})]}),(0,w.jsx)("div",{style:{display:ee?"none":"block"},children:ie})]})},S=t(60328),D=t(67971),I=t(11135),_=t(29237),E=t(86673),R=t(82944),T=t(82531),M=t(16115),F=t(7715),N=t(96510),A=t(51504);var L=function(e){var n=e.fetchFileTree,t=e.file,i=e.moveFile,r=e.onCancel,u=e.onCreateFile,a=e.selectedFolder,d=e.setErrors,s=(0,l.useRef)(null),f=(0,F.Qr)(t)?null:t,p=(0,l.useState)(f?(0,x.jN)(f,null,!0):""),v=p[0],h=p[1],m=(0,l.useState)(f?null===f||void 0===f?void 0:f.name:""),b=m[0],g=m[1];(0,l.useEffect)((function(){var e;null===s||void 0===s||null===(e=s.current)||void 0===e||e.focus()}),[]),(0,l.useEffect)((function(){a&&h((0,x.jN)(a))}),[a]);var y=(0,c.Db)(T.ZP.files.useCreate(),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(e){var t=e.file;null===n||void 0===n||n(),r(),null===u||void 0===u||u(t)},onErrorCallback:function(e,n){return d({errors:n,response:e})}})}}),j=(0,o.Z)(y,1)[0],C=(0,c.Db)(T.ZP.files.useUpdate(f&&encodeURIComponent((0,x.jN)(f))),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===n||void 0===n||n(),r()},onErrorCallback:function(e,n){return d({errors:n,response:e})}})}}),k=(0,o.Z)(C,1)[0];return(0,w.jsxs)(_.Z,{footer:(0,w.jsxs)(D.Z,{children:[(0,w.jsxs)(I.ZP,{bold:!0,disabled:!b,inline:!0,keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,A.y)([M.Uq],n)},onClick:function(){return f?k({file:{dir_path:v,name:b},file_json_only:!0}):j({file:{dir_path:v,name:b,overwrite:!1},file_json_only:!0})},primary:!0,tabIndex:0,uuid:"NewFile/create_file",children:[f?i?"Move":"Rename":"Create"," file"]}),(0,w.jsx)(E.Z,{ml:1,children:(0,w.jsx)(S.Z,{onClick:function(){return r()},tabIndex:0,children:"Cancel"})})]}),headerTitle:f?i?"Move file":"Rename file":"New file",children:[(0,w.jsx)(R.Z,{disabled:!!f&&!i,label:"Directory",monospace:!0,onChange:function(e){return h(e.target.value)},setContentOnMount:!0,value:v}),(0,w.jsx)(E.Z,{mt:2,children:(0,w.jsx)(R.Z,{disabled:!!i,label:"Filename",monospace:!0,onChange:function(e){return g(e.target.value)},ref:s,required:!0,value:b})})]})};var U=function(e){var n=e.fetchFileTree,t=e.file,i=e.moveFile,r=e.onCancel,u=e.onCreateFile,a=e.selectedFolder,d=e.setErrors,s=(0,l.useRef)(null),f=(0,F.Qr)(t)?null:t,p=(0,l.useState)(f?(0,x.jN)(f,null,!0):""),v=p[0],h=p[1],m=(0,l.useState)(f?null===f||void 0===f?void 0:f.name:""),b=m[0],g=m[1];(0,l.useEffect)((function(){var e;null===s||void 0===s||null===(e=s.current)||void 0===e||e.focus()}),[]),(0,l.useEffect)((function(){a&&h((0,x.jN)(a,null,!0))}),[a]);var y=(0,c.Db)(T.ZP.folders.useCreate(),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(e){var t=e.file;null===n||void 0===n||n(),r(),null===u||void 0===u||u(t)},onErrorCallback:function(e,n){return d({errors:n,response:e})}})}}),j=(0,o.Z)(y,1)[0],C=(0,c.Db)(T.ZP.folders.useUpdate(f&&encodeURIComponent((0,x.jN)(f))),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===n||void 0===n||n(),r()},onErrorCallback:function(e,n){return d({errors:n,response:e})}})}}),k=(0,o.Z)(C,1)[0];return(0,w.jsxs)(_.Z,{footer:(0,w.jsxs)(D.Z,{children:[(0,w.jsxs)(I.ZP,{bold:!0,disabled:!b,inline:!0,keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,A.y)([M.Uq],n)},onClick:function(){return f?k({folder:{name:b,path:v}}):j({folder:{name:b,overwrite:!1,path:v}})},primary:!0,tabIndex:0,uuid:"NewFolder/create_folder",children:[f?i?"Move":"Rename":"Create"," folder"]}),(0,w.jsx)(E.Z,{ml:1,children:(0,w.jsx)(S.Z,{onClick:function(){return r()},tabIndex:0,children:"Cancel"})})]}),headerTitle:f?i?"Move folder":"Rename folder":"New folder",children:[(0,w.jsx)(R.Z,{disabled:!!f&&!i,label:"Directory",monospace:!0,onChange:function(e){return h(e.target.value)},setContentOnMount:!0,value:v}),(0,w.jsx)(E.Z,{mt:2,children:(0,w.jsx)(R.Z,{disabled:!!i,label:"Folder name",monospace:!0,onChange:function(e){return g(e.target.value)},ref:s,required:!0,value:b})})]})},Y=t(98781),B=t(62609),H=t(55106),W=t(66176),V=t(58180),z=t(23831),G=t(73942),X=(m.iI,u.default.div.withConfig({displayName:"indexstyle__DropZoneStyle",componentId:"sc-1g3zz7z-0"})(["border-radius:","px;padding:","px;max-width:","px;min-width:","px;",""],G.n_,8*m.iI,100*m.iI,55*m.iI,(function(e){return"\n border: 1px dashed ".concat((e.theme.borders||z.Z.borders).contrast,";\n ")}))),Q=u.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-1g3zz7z-1"})(["max-width:","px;min-width:","px;"],100*m.iI,55*m.iI);var q=function(e){var n=e.fetchFileTree,t=e.onCancel,i=e.selectedFolder,r=(0,l.useState)(!1),u=r[0],c=r[1],a=(0,l.useState)({}),d=a[0],s=a[1],f=(0,l.useState)({}),v=f[0],h=f[1],m=!(0,F.Qr)(d),b=(0,l.useMemo)((function(){var e=[];return(0,j.YC)(Object.entries(d),(function(e){var n=(0,o.Z)(e,2),t=n[0];n[1];return t})).forEach((function(n){var t=(0,o.Z)(n,2),i=t[0],r=t[1],l=v[i],u=null===l||void 0===l?void 0:l.message;e.push([(0,w.jsxs)("div",{children:[(0,w.jsx)(p.ZP,{overflowWrap:!0,preWrap:!0,children:i}),u&&(0,w.jsx)(E.Z,{mt:1,children:(0,w.jsx)(p.ZP,{danger:!0,small:!0,children:u})})]},"name-".concat(i)),(0,w.jsx)(W.Z,{danger:!!u,progress:100*r},"progress-".concat(i))])})),(0,w.jsx)(V.Z,{columnFlex:[1,4],columns:[{uuid:"Filename"},{uuid:"Upload progress"}],rows:e,uuid:"block-runs"})}),[d,v]);return(0,w.jsxs)(_.Z,{footer:(0,w.jsxs)(D.Z,{fullWidth:!0,children:[(0,w.jsx)(S.Z,{onClick:function(){return t()},children:"Close"}),m&&(0,w.jsx)(E.Z,{ml:1,children:(0,w.jsx)(S.Z,{onClick:function(){s({}),h({})},children:"Clear files and retry"})})]}),headerTitle:"Upload files",children:[m&&(0,w.jsx)(Q,{children:b}),!m&&(0,w.jsx)(H.Z,{directoryPath:i?(0,x.jN)(i):"",onDragActiveChange:c,setFileUploadProgress:s,setUploadedFiles:function(e){h(e),null===n||void 0===n||n()},children:(0,w.jsx)(X,{children:(0,w.jsxs)(p.ZP,{center:!0,children:[u&&"Drop to upload",!u&&"Click or drop files and folders to upload"]})})})]})},J=t(86585),$=t(55512),K=t(99497),ee=["addNewBlock","blocks","deleteWidget","fetchAutocompleteItems","fetchFileTree","fetchPipeline","files","onCreateFile","pipeline","setErrors","setSelectedBlock","widgets"];function ne(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ne(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ne(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ie,oe=20*m.iI;function re(e,n){var t=e.addNewBlock,i=e.blocks,s=void 0===i?[]:i,v=e.deleteWidget,b=e.fetchAutocompleteItems,g=e.fetchFileTree,y=e.fetchPipeline,C=e.files,k=e.onCreateFile,O=e.pipeline,Z=e.setErrors,S=e.setSelectedBlock,D=e.widgets,I=void 0===D?[]:D,_=(0,r.Z)(e,ee),E=(0,l.useRef)(null),R=(0,l.useContext)(u.ThemeContext),M=(0,l.useState)(null),F=M[0],A=M[1],H=(0,l.useState)(null),W=H[0],V=H[1],z=(0,l.useState)(null),G=z[0],X=z[1],Q=T.ZP.statuses.list().data,ne=(0,l.useMemo)((function(){var e,n;return null===Q||void 0===Q||null===(e=Q.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[Q]),ie=(0,c.Db)((function(e){return T.ZP.files.useDelete(e)()}),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===g||void 0===g||g()},onErrorCallback:function(e,n){return Z({errors:n,response:e})}})}}),re=(0,o.Z)(ie,1)[0],le=(0,c.Db)((function(e){return T.ZP.folders.useDelete(e)()}),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===g||void 0===g||g()},onErrorCallback:function(e,n){return Z({errors:n,response:e})}})}}),ue=(0,o.Z)(le,1)[0],ce=(0,K.dd)((function(e){var n=e.block;return(0,w.jsx)(B.Z,{centerOnScreen:!0,danger:!0,onCancel:se,onClick:function(){return pe({block:n,force:!0}).then((function(){return se()}))},subtitle:"Deleting this block file is dangerous. This block may have dependencies in active pipelines. Press confirm to delete this block anyway and remove it as a dependency from downstream blocks.",title:"Delete ".concat(n.uuid," anyway?"),width:34*m.iI})})),ae=(0,o.Z)(ce,2),de=ae[0],se=ae[1],fe=(0,c.Db)((function(e){var n=e.block,t=n.language,i=n.type,o=n.uuid,r=e.force,l=void 0!==r&&r,u="".concat(i,"/").concat(o);return t&&f.JD[t]&&(u="".concat(u,".").concat(f.JD[t].toLowerCase())),T.ZP.blocks.useDelete(encodeURIComponent(u),{force:l})()}),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){b(),y(),g()},onErrorCallback:function(e){var n=e.error,t=n.exception;n.message.includes("raise HasDownstreamDependencies")&&de({block:xe,exception:t})}})}}),pe=(0,o.Z)(fe,1)[0],ve=(0,j.sE)(null===O||void 0===O?void 0:O.blocks,(function(e){var n=e.type;return a.tf.DATA_EXPORTER===n})),he=(0,c.Db)(T.ZP.blocks.pipelines.useUpdate(null===O||void 0===O?void 0:O.uuid,null===ve||void 0===ve?void 0:ve.uuid),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(){null===y||void 0===y||y()},onErrorCallback:function(e,n){return Z({errors:n,response:e})}})}}),me=(0,o.Z)(he,1)[0],be=(0,l.useCallback)((function(){return X(null)}),[X]);(0,l.useEffect)((function(){var e,i,o,r=function(e){if(clearTimeout(E.current),V(null),W&&O&&t){var i,o,r=(null===n||void 0===n||null===(i=n.current)||void 0===i||null===(o=i.getBoundingClientRect)||void 0===o?void 0:o.call(i))||{},l=r.width,u=r.x;if(e.pageX>u+l){var c=(null===O||void 0===O?void 0:O.type)===Y.qL.INTEGRATION,a=(0,$.TU)(te(te({},W),{},{path:(0,x.jN)(W)}),ne,O);null===t||void 0===t||t(a,(function(e){c&&ve&&me({block:te(te({},ve),{},{upstream_blocks:[e.uuid]})}),null===S||void 0===S||S(e)}))}}},l=function(e){W&&A({x:e.pageX,y:e.pageY})};return null===(e=document)||void 0===e||e.addEventListener("click",be),null===(i=document)||void 0===i||i.addEventListener("mousemove",l),null===(o=document)||void 0===o||o.addEventListener("mouseup",r),function(){var e,n,t;null===(e=document)||void 0===e||e.removeEventListener("click",be),null===(n=document)||void 0===n||n.removeEventListener("mousemove",l),null===(t=document)||void 0===t||t.removeEventListener("mouseup",r)}}),[t,ve,W,be,O,n,ne,S,E,me]);var ge=(0,l.useMemo)((function(){return s.concat(I).map((function(e){return e.uuid}))}),[s,I]),ye=(0,l.useMemo)((function(){return null===C||void 0===C?void 0:C.map((function(e){return(0,l.createElement)(P,te(te({},_),{},{containerRef:n,file:e,key:e.name,level:0,pipelineBlockUuids:ge,setCoordinates:A,setDraggingFile:V,setSelectedFile:X,theme:R,timeout:E}))}))}),[C,ge,_,n,R,E]),xe=(0,l.useMemo)((function(){return G&&(0,x.lr)(G)}),[G]),je=(0,l.useMemo)((function(){return W&&(0,x.lr)(W)}),[W]),Ce=(0,l.useMemo)((function(){return G&&"undefined"!==typeof(null===G||void 0===G?void 0:G.children)&&G}),[G]),we=(0,K.dd)((function(){return(0,w.jsx)(q,{fetchFileTree:g,onCancel:Ze,selectedFolder:Ce})}),{},[g,Ce],{background:!0,uuid:"upload_files"}),ke=(0,o.Z)(we,2),Oe=ke[0],Ze=ke[1],Pe=(0,K.dd)((function(e){return(0,w.jsx)(L,{fetchFileTree:g,file:null===e||void 0===e?void 0:e.file,moveFile:null===e||void 0===e?void 0:e.moveFile,onCancel:Ie,onCreateFile:k,selectedFolder:Ce,setErrors:Z})}),{},[g,k,Ce,Z],{background:!0,disableClickOutside:!0,uuid:"new_file"}),Se=(0,o.Z)(Pe,2),De=Se[0],Ie=Se[1],_e=(0,K.dd)((function(e){return(0,w.jsx)(U,{fetchFileTree:g,file:null===e||void 0===e?void 0:e.file,moveFile:null===e||void 0===e?void 0:e.moveFile,onCancel:Te,selectedFolder:Ce,setErrors:Z})}),{},[g,Ce,Z],{background:!0,disableClickOutside:!0,uuid:"new_folder"}),Ee=(0,o.Z)(_e,2),Re=Ee[0],Te=Ee[1],Me=(0,l.useMemo)((function(){var e;if(!xe&&!G&&!Ce)return(0,w.jsx)("div",{});var t=(null===n||void 0===n||null===(e=n.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,o=t.width,r=F||{},l=r.x,u=void 0===l?0:l,c=r.y,s=void 0===c?0:c,f=u;u+oe>=i+o&&(f=i+o-(oe+m.iI)),f<0&&(f=0);var p=[];return Ce?p.push.apply(p,[{label:function(){return"New folder"},onClick:function(){Re()},uuid:"new_folder"},{label:function(){return"Rename folder"},onClick:function(){Re({file:Ce})},uuid:"rename_folder"},{label:function(){return"Move folder"},onClick:function(){Re({file:Ce,moveFile:!0})},uuid:"Move_folder"},{label:function(){return"Delete folder"},onClick:function(){var e=(0,x.jN)(Ce);window.confirm("Are you sure you want to delete folder ".concat(e," and all its subfolders and files?"))&&ue(encodeURIComponent(e))},uuid:"Delete_folder"},{label:function(){return"New file"},onClick:function(){De({file:{}})},uuid:"new_file"},{label:function(){return"Upload files"},onClick:function(){Oe()},uuid:"upload_files"}]):G&&(p.push.apply(p,[{label:function(){return"Rename file"},onClick:function(){De({file:G})},uuid:"rename_file"},{label:function(){return"Move file"},onClick:function(){De({file:G,moveFile:!0})},uuid:"move_file"}]),xe?p.push({label:function(){return"Delete block file"},onClick:function(){xe.type===a.tf.CHART?window.confirm("Are you sure you want to delete widget ".concat(xe.uuid,"?"))&&v(xe):window.confirm("Are you sure you want to delete block ".concat(xe.uuid,"?"))&&pe({block:xe})},uuid:"delete_block_file"}):p.push({label:function(){return"Delete file"},onClick:function(){var e=(0,x.jN)(G);window.confirm("Are you sure you want to delete file ".concat(e,"?"))&&re(encodeURIComponent(e))},uuid:"delete_file"})),(0,w.jsx)("div",{style:{left:f,position:"fixed",top:s+m.iI/2,zIndex:J.bf+100},children:(0,w.jsx)(d.Z,{items:p,open:!0,parentRef:void 0,uuid:"FileBrowser/ContextMenu",width:oe})})}),[F,pe,re,ue,v,n,Oe,De,Re,xe,G,Ce]);return(0,w.jsxs)(h.Nk,{ref:n,children:[ye,(xe||G||Ce)&&Me,je&&(0,w.jsx)("div",{style:{left:(null===F||void 0===F?void 0:F.x)-m.iI,position:"fixed",top:(null===F||void 0===F?void 0:F.y)-m.iI,zIndex:J.bf+100},children:(0,w.jsx)(p.ZP,{cursor:"grabbing",monospace:!0,children:null===je||void 0===je?void 0:je.uuid})})]})}!function(e){e.BLOCK_FILE="block_file",e.DISABLED="disabled",e.FILE="file",e.FOLDER="folder",e.PIPELINE="pipeline"}(ie||(ie={}));var le=l.forwardRef(re)},32821:function(e,n,t){t.d(n,{V3:function(){return s},a9:function(){return u},dq:function(){return f},jN:function(){return a},lr:function(){return d}});var i=t(17717),o=t(86422),r=t(73828),l=t(90211);function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n||(t?null:null===e||void 0===e?void 0:e.name);if(null!==e&&void 0!==e&&e.parent){var r=[e.parent.name];return(null===o||void 0===o?void 0:o.length)>=1&&r.push(o),u(e.parent,r.join(i.sep))}return o}function c(e){return null===e||void 0===e?void 0:e.split(i.sep).slice(1).join(i.sep)}function a(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=u(e,n,t);return c(i)}function d(e){var n,t,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=u(e,c).split(i.sep);if(!a)return null;if(1===a.length)(a=null===e||void 0===e||null===(t=e.path)||void 0===t?void 0:t.split(i.sep))&&(n=a[0]===o.tf.CUSTOM?a[0]:(0,l.C5)(a[0]||""));else if(a[1]===o.tf.CUSTOM)n=a[1];else{var d=a[1];n=o.tf.DBT===d?d:(0,l.C5)(d||"")}if(!a||o.tf.DBT===n)return null;var s="";s=a.length>=3?a.slice(2,a.length).join(i.sep):a[a.length-1];var f=["\\.".concat(r.Lu.PY),"\\.".concat(r.Lu.R),"\\.".concat(r.Lu.SQL),"\\.".concat(r.Lu.YAML),"\\.".concat(r.Lu.YML)].join("|"),p=new RegExp("".concat(f,"$"));if(o.$W.concat(o.tf.DBT).includes(n)&&s.match(p)){var v=s.lastIndexOf("."),h=s.slice(v+1);return{language:r.nB[h],type:n,uuid:s.slice(0,v)}}}function s(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=u(e,n).split(i.sep);if(t[1]){var c=(0,l.C5)(t[n?0:1]);t[1]===o.tf.DBT&&(c=o.tf.DBT);var a=t[t.length-1],d=new RegExp(".".concat(r.Lu.YAML,"$")),s=new RegExp(".".concat(r.Lu.R,"$")),f=new RegExp(".".concat(r.Lu.SQL,"$")),p=new RegExp(".".concat(r.Lu.MD,"$"));if(a.match(d)&&o.VZ.includes(c))return{type:c,uuid:a.replace(d,"")};if(a.match(s)&&o.J8.includes(c))return{type:c,uuid:a.replace(s,"")};if(a.match(f)&&o.HX.includes(c)){var v=a.replace(/[.]/g,"_"),h=c===o.tf.DBT?t.slice(2,-1).join("_").concat("_".concat(v)):a.replace(f,"");return{type:c,uuid:h}}return a.match(p)&&c===o.tf.MARKDOWN?{type:c,uuid:a.replace(p,"")}:void 0}}function f(e){var n=e.name.split("."),t=n[n.length-1];return r.n6.includes(t)&&n.pop(),n.join("")}},91207:function(e,n,t){t.d(n,{Z:function(){return N}});var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(37958),c=t(83455),a=t(35490),d=t(86422),s=t(60328),f=t(9518),p=t(93461),v=t(67971),h=t(28598),m=f.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),b=f.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),g=function(e){var n=e.children,t=e.divider,i=l.Children.toArray(n).length;return(0,h.jsx)(m,{children:(0,h.jsx)(v.Z,{children:l.Children.map(n,(function(e,n){return e&&(0,h.jsxs)(p.Z,{children:[n>=1&&t&&(0,h.jsx)(b,{}),l.cloneElement(e,{borderRadiusLeft:i>=2&&0===n,borderRadiusRight:i>=2&&n===i-1,halfPaddingLeft:i>=2&&0!==n,halfPaddingRight:i>=2&&n!==i-1,noBorder:i>=2&&n>0&&n<i-1,noBorderRight:i>=2&&n!==i-1})]},"button-group-child-".concat(n))}))})})},y=t(57722),x=t(73828),j=t(11135),C=t(98781),w=t(86673),k=t(82531),O=t(16115),Z=t(94353),P=t(60701),S=t(55512),D=t(24224),I=t(32821),_=t(90211),E=t(96510),R=t(51504),T=t(41150);function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function F(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 N=function(e){var n=e.active,t=e.addNewBlock,f=e.disableRefreshWarning,p=e.fetchPipeline,m=e.fetchVariables,b=e.filePath,M=e.hideHeaderButtons,N=e.onContentChange,A=e.openSidekickView,L=e.pipeline,U=e.saveFile,Y=e.selectedFilePath,B=e.sendTerminalMessage,H=e.setDisableShortcuts,W=e.setErrors,V=e.setFilesTouched,z=e.setSelectedBlock,G=(0,u.j)("apiReloads"),X=(0,o.Z)(G,2)[1],Q=(0,l.useState)(null),q=Q[0],J=Q[1],$=(0,l.useState)(!1),K=$[0],ee=($[1],(0,l.useRef)(null)),ne=(0,l.useMemo)((function(){return new a.Z}),[]),te=(0,l.useMemo)((function(){return{api_key:Z.l,token:ne.decodedToken.token}}),[ne]),ie=k.ZP.statuses.list().data,oe=(0,l.useMemo)((function(){var e,n;return null===ie||void 0===ie||null===(e=ie.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[ie]),re=k.ZP.file_contents.detail(b).data;(0,l.useEffect)((function(){null!==re&&void 0!==re&&re.file_content&&J(re.file_content)}),[re]);var le=(0,l.useState)(null===q||void 0===q?void 0:q.content),ue=le[0],ce=le[1],ae=(0,l.useCallback)((function(e){ce(e),N&&(null===N||void 0===N||N(e))}),[N]),de=(0,l.useState)(!1),se=de[0],fe=de[1];(0,l.useEffect)((function(){n&&H&&(null===H||void 0===H||H(!0))}),[n,H]),(0,l.useEffect)((function(){var e;Y&&(null===ee||void 0===ee||null===(e=ee.current)||void 0===e||e.scrollIntoView())}),[Y]);var pe=(0,c.Db)(k.ZP.file_contents.useUpdate((null===q||void 0===q?void 0:q.path)&&encodeURIComponent(null===q||void 0===q?void 0:q.path)),{onSuccess:function(e){return(0,E.wD)(e,{callback:function(){X((function(e){return F(F({},e),{},(0,i.Z)({},"FileVersions/".concat(null===q||void 0===q?void 0:q.path),Number(new Date)))}))},onErrorCallback:function(e,n){return null===W||void 0===W?void 0:W({errors:n,response:e})}})}}),ve=(0,o.Z)(pe,1)[0],he=(0,l.useCallback)((function(e,n){if(U)return U(e,n);ve({file_content:F(F({},n),{},{content:e})}).then((function(){decodeURIComponent(b).split(r.sep).pop()===x.dT.METADATA_YAML&&m&&(null===m||void 0===m||m())})),V((function(e){return F(F({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),fe(!1)}),[m,b,U,V,ve]),me=(0,l.useMemo)((function(){return(0,S.lU)()}),[]),be=(0,l.useMemo)((function(){var e;return null===q||void 0===q||null===(e=q.path.match(me)[0])||void 0===e?void 0:e.split(".")[1]}),[me,q]),ge=(0,l.useMemo)((function(){if(null!==q&&void 0!==q&&q.path)return(0,h.jsx)(y.Z,{autoHeight:!0,language:x.nB[be],onChange:function(e){ae(e),V((function(e){return F(F({},e),{},(0,i.Z)({},null===q||void 0===q?void 0:q.path,!0))})),fe(!0)},onSave:function(e){he(e,q)},selected:!0,textareaFocused:!0,value:(0,_.Pb)(null===q||void 0===q?void 0:q.content)?JSON.stringify(JSON.parse(null===q||void 0===q?void 0:q.content),null,2):null===q||void 0===q?void 0:q.content,width:"100%"})}),[q,be,he,ae,V]),ye=null!==L&&void 0!==L&&L.blocks?(0,D.sE)(null===L||void 0===L?void 0:L.blocks,(function(e){var n=e.type;return d.tf.DATA_EXPORTER===n})):null,xe=(0,c.Db)(k.ZP.blocks.pipelines.useUpdate(null===L||void 0===L?void 0:L.uuid,null===ye||void 0===ye?void 0:ye.uuid),{onSuccess:function(e){return(0,E.wD)(e,{callback:function(){null===p||void 0===p||p()}})}}),je=(0,o.Z)(xe,1)[0],Ce=t&&L&&(be===x.Lu.PY||be===x.Lu.SQL||(be===x.Lu.YAML||be===x.Lu.R)&&(0,I.V3)(q,null===q||void 0===q?void 0:q.path))&&(0,S.ck)(q.path.split(r.sep))!==d.tf.SCRATCHPAD&&(0,I.lr)(q)&&(0,h.jsx)(s.Z,{onClick:function(){var e=(null===L||void 0===L?void 0:L.type)===C.qL.INTEGRATION,n=(0,S.TU)(q,oe,L);t(n,(function(n){e&&ye&&je({block:F(F({},ye),{},{upstream_blocks:[n.uuid]})}),null===z||void 0===z||z(n)}))},primary:!0,children:"Add to current pipeline"}),we=B&&(0,h.jsx)(w.Z,{m:2,children:(0,h.jsx)(j.ZP,{disabled:!oe,inline:!0,loading:K,onClick:function(){null===A||void 0===A||A(P.cH.TERMINAL),null===B||void 0===B||B(JSON.stringify(F(F({},te),{},{command:["stdin","pip install -r ".concat(oe,"/requirements.txt\r")]})))},title:oe?"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"})}),ke="FileEditor/".concat(null===q||void 0===q?void 0:q.path),Oe=(0,T.y)(),Ze=Oe.registerOnKeyDown,Pe=Oe.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){Pe(ke)}}),[Pe,ke]),Ze(ke,(function(e,t){if(n&&!f)if((0,R.y)([O.zX,O.Um],t)||(0,R.y)([O.PQ,O.Um],t))e.preventDefault(),he(ue,q);else if(se&&(0,R.y)([O.zX,O.hS],t)){e.preventDefault();var i="".concat(q.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[n,ue,f,q,he,se]),(0,h.jsxs)("div",{ref:ee,children:[!M&&(0,h.jsx)(w.Z,{p:2,children:(0,h.jsxs)(v.Z,{justifyContent:"space-between",children:[(0,h.jsxs)(g,{children:[Ce,(0,h.jsx)(s.Z,{disabled:!ue,onClick:function(e){e.preventDefault(),he(ue,q)},title:ue?null:"No changes have been made to this file.",children:"Save file content"})]}),A&&(0,h.jsx)(g,{children:(0,h.jsx)(s.Z,{compact:!0,onClick:function(){A(P.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),ge,b===x.dT.REQS_TXT&&we]})}},55512:function(e,n,t){t.d(n,{TU:function(){return f},ck:function(){return d},lU:function(){return s}});var i=t(21831),o=t(17717),r=t(86422),l=t(98781),u=t(73828),c=t(24224),a=t(90211),d=function(e){var n=e[0];return n===r.tf.DBT||n===r.tf.CUSTOM?n:e[0].slice(0,-1)};function s(){return new RegExp(Object.keys(u.nB).map((function(e){return".(".concat(e,")$")})).join("|"))}function f(e,n,t){var f,p,v=null===e||void 0===e||null===(f=e.path.match(s())[0])||void 0===f?void 0:f.split(".")[1],h=t.type===l.qL.INTEGRATION,m=(0,c.sE)(null===t||void 0===t?void 0:t.blocks,(function(e){var n=e.type;return r.tf.DATA_EXPORTER===n})),b=e.path.replace(n,"").split(o.sep),g=e.path.split(o.sep)[0]===r.tf.DBT,y=(p=b)[0]===r.tf.DBT?p.slice(1).join(o.sep):function(e){return e.at(-1)}(p).split(".")[0];if(b.length>=3&&!g){var x=b.slice(1,b.length-1).join(o.sep);y="".concat(x,"/").concat(y)}var j=d(e.path.split(o.sep)),C={configuration:{file_path:g?y:null},language:u.nB[v],name:(0,a.wE)(y),type:j};if(j===r.tf.CUSTOM&&(C.color=r.Lq.TEAL),h){var w=(0,c.sE)(t.blocks,(function(e){var n=e.type;return r.tf.DATA_LOADER===n})),k=(0,c.sE)(t.blocks,(function(e){var n=e.type;return r.tf.TRANSFORMER===n})),O=[];k?O.push(k.uuid):null!==m&&void 0!==m&&m.upstream_blocks?O.push.apply(O,(0,i.Z)(m.upstream_blocks)):w&&O.push(w.uuid),C.upstream_blocks=O}return C}},55106:function(e,n,t){t.d(n,{Z:function(){return g}});var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(83455),c=t(9518),a=t(77011),d=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 f(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=c.default.div.withConfig({displayName:"MultiFileInput__DropzoneStyle",componentId:"sc-1l6yd2y-0"})(["&:hover{cursor:pointer;}"]);var v=function(e){var n=e.children,t=e.inputOnChange,i=e.inputProps,o=e.onDragActiveChange,r=e.setFiles,u=(0,l.useCallback)((function(e){r(e)}),[r]),c=(0,a.uI)({onDrop:u}),s=c.getInputProps,v=c.getRootProps,h=c.isDragActive,m=s(),b=m.accept,g=m.autoComplete,y=m.multiple,x=m.onChange,j=m.onClick,C=m.ref,w=m.style,k=m.tabIndex,O=m.type,Z=f(f({},i),{},{accept:b,autoComplete:g,multiple:y,onChange:function(e){null===t||void 0===t||t(e),null===i||void 0===i||i.onChange(e),x(e)},onClick:j,ref:C,style:w,tabIndex:k,type:O});return(0,l.useEffect)((function(){null===o||void 0===o||o(h)}),[h,o]),(0,d.jsxs)(p,f(f({},v()),{},{children:[(0,d.jsx)("input",f(f({},Z),{},{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 b(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?m(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var g=function(e){var n=e.children,t=e.directoryPath,c=e.onDragActiveChange,a=e.setFileUploadProgress,s=e.setUploadedFiles,f=(0,u.Db)(h.ZP.files.useCreate({onUploadProgress:function(e,n){var t,o=n.body,l=[null===o||void 0===o?void 0:o.dir_path,null===o||void 0===o||null===(t=o.file)||void 0===t?void 0:t.name].filter((function(e){return(null===e||void 0===e?void 0:e.length)>=1})).join(r.sep);null===a||void 0===a||a((function(n){return b(b({},n),{},(0,i.Z)({},l,e.loaded/e.total))}))}})),p=(0,o.Z)(f,1)[0],m=(0,l.useCallback)((function(e){e.forEach((function(e){var n=e.name,o=e.path,l=[t],u=o.split(r.sep).filter((function(e){return e&&e!==n})).join(r.sep);u&&l.push(u);var c=[],d=l.join(r.sep);(null===d||void 0===d?void 0:d.length)>=1&&l.push(d),c.push(n);var f=c.join(r.sep);p({dir_path:d,file:e,overwrite:!1}).then((function(e){var n=e.data,t=n.error,o=n.file;s((function(e){return b(b({},e),{},(0,i.Z)({},f,o||t))}))})),a((function(e){return b(b({},e),{},(0,i.Z)({},f,0))}))}))}),[p,t,a,s]);return(0,d.jsx)(v,{onDragActiveChange:c,setFiles:m,children:n})}},23351:function(e,n,t){var i=t(82394),o=t(75582),r=t(17717),l=t(37958),u=t(82684),c=t(83455),a=t(60328),d=t(57722),s=t(73828),f=t(93461),p=t(67971),v=t(87372),h=t(86673),m=t(54283),b=t(58180),g=t(19711),y=t(82531),x=t(49125),j=t(55512),C=t(42305),w=t(90211),k=t(96510),O=t(66653),Z=t(24224),P=t(28598);function S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function D(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?S(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):S(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.onActionCallback,t=e.selectedBlock,S=e.selectedFilePath,I=e.setErrors,_=e.width,E=(0,l.j)("apiReloads"),R=(0,o.Z)(E,2)[1],T=y.ZP.file_versions.files.list(S&&encodeURIComponent(S)),M=T.data,F=T.mutate,N=(0,u.useMemo)((function(){return(null===M||void 0===M?void 0:M.file_versions)||[]}),[M]),A=(0,u.useState)(null),L=A[0],U=A[1],Y=(0,u.useMemo)((function(){return null===N||void 0===N?void 0:N[L]}),[L,N]),B=y.ZP.file_contents.detail(Y?encodeURIComponent(Y.path):null).data,H=(0,u.useMemo)((function(){return null===B||void 0===B?void 0:B.file_content}),[B]),W=(0,u.useMemo)((function(){return(0,j.lU)()}),[]),V=(0,u.useMemo)((function(){var e,n,t;return null===S||void 0===S||null===(e=S.match(W))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[S,W]),z=(0,c.Db)(y.ZP.file_contents.useUpdate(S&&encodeURIComponent(S)),{onSuccess:function(e){return(0,k.wD)(e,{callback:function(e){var t;S&&F();var o=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(o);if(o){var u=o.split(r.sep);if("pipelines"===u[0]){var c=u.slice(1,u.length-1).join(r.sep);l="PipelineDetail/".concat(c)}}R((function(e){return D(D({},e),{},(0,i.Z)({},l,Number(new Date)))})),U((function(e){return e+1})),null===n||void 0===n||n(e)},onErrorCallback:function(e,n){return I({errors:n,response:e})}})}}),G=(0,o.Z)(z,2),X=G[0],Q=G[1].isLoading,q=(0,u.useMemo)((function(){var e=N.map((function(e){var n=e.name,t=e.path;return[(0,P.jsxs)(p.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,P.jsxs)(f.Z,{flex:1,children:[(0,P.jsx)(g.ZP,{default:!0,monospace:!0,children:(0,C.JX)(n,{withSeconds:!0})}),(0,P.jsx)(h.Z,{px:2*x.cd,children:(0,P.jsx)(g.ZP,{monospace:!0,children:n})})]}),Y&&(null===Y||void 0===Y?void 0:Y.path)===t&&(0,P.jsx)(a.Z,{compact:!0,loading:Q,onClick:function(e){(0,O.j)(e),X({file_content:{version:n}})},small:!0,children:"Replace with this version"})]},n)]}));if(Y){var n=(0,P.jsx)(h.Z,{p:x.cd,children:(0,P.jsx)(m.Z,{},"spinner")});if(H&&(null===H||void 0===H?void 0:H.path)===(null===Y||void 0===Y?void 0:Y.path)){var t=H.content,i=void 0===t?"":t;n=(0,P.jsx)(d.Z,{autoHeight:!0,language:s.nB[V],padding:!0,readOnly:!0,value:(0,w.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:_})}e=(0,Z.Hk)([n],L+1,e)}return e}),[H,V,N,Q,Y,L,X,_]);return(0,P.jsxs)("div",{style:{width:_},children:[(0,P.jsxs)(h.Z,{p:x.cd,children:[(0,P.jsx)(v.Z,{level:5,children:"File versions"}),(0,P.jsx)(g.ZP,{inline:!0,monospace:!0,children:S?decodeURIComponent(S):null===t||void 0===t?void 0:t.uuid})]}),(0,P.jsx)(b.Z,{buildRowProps:function(e){if(Y&&L+1===e)return{renderCell:function(e){return e},renderRow:function(e){return e}}},columnFlex:[1],columns:[{uuid:"Version"}],isSelectedRow:function(e){var n;return(null===(n=N[e])||void 0===n?void 0:n.name)===(null===Y||void 0===Y?void 0:Y.name)},onClickRow:function(e){Y?e===L?U(null):e<L?U(e):e>L+1&&U(e-1):U(e)},rows:q})]})}},38488:function(e,n,t){t.d(n,{Z:function(){return O}});var i=t(82394),o=t(26304),r=t(82684),l=t(9518),u=t(16634),c=t(67971),a=t(10919),d=t(86673),s=t(19711),f=t(46261),p=t(23831),v=t(10503),h=t(28347),m=t(49125),b=t(33766),g=t(66653),y=t(28598);var x=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,o=e.isLast,l=e.onClickTab,x=e.onClickTabClose,j=e.renderTabTitle,C=e.savePipelineContent,w=e.selected,k=e.themeContext,O=(0,r.useState)(!1),Z=O[0],P=O[1];return(0,y.jsx)(c.Z,{flexDirection:"column",fullHeight:!0,onClick:function(e){e.preventDefault(),w||(l?l(n):(null===C||void 0===C||C(),(0,b.u7)({file_path:encodeURIComponent(n)})))},onMouseEnter:function(){return P(!0)},onMouseLeave:function(){return P(!1)},children:(0,y.jsx)(h.Gb,{last:o,selected:w,children:(0,y.jsxs)(c.Z,{alignItems:"center",fullHeight:!0,children:[(0,y.jsx)(f.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,y.jsxs)(c.Z,{alignItems:"center",fullHeight:!0,children:[!i[n]&&(0,y.jsx)(v.iU,{muted:!w,size:1.5*m.iI}),i[n]&&(0,y.jsx)(f.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,y.jsx)("div",{style:{padding:1},children:(0,y.jsx)(u.Z,{borderColor:(k||p.Z).borders.danger,size:1.25*m.iI})})}),(0,y.jsx)(d.Z,{mr:1}),(0,y.jsx)(s.ZP,{muted:!w,children:j?j(n):n})]})}),(0,y.jsx)(d.Z,{mr:2}),(0,y.jsx)(f.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,y.jsxs)(a.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(e){(0,g.j)(e),null===x||void 0===x||x(n)},preventDefault:!0,children:[(Z||w)&&(0,y.jsx)(v.x8,{muted:!w,size:1.25*m.iI}),!Z&&!w&&(0,y.jsx)("div",{style:{width:1.25*m.iI}})]})})]})})})},j=t(24224),C=["filePaths","isSelectedFilePath","onClickTabClose","selectedFilePath"];function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function k(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var O=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTabClose,u=e.selectedFilePath,a=(0,o.Z)(e,C),d=(0,r.useContext)(l.ThemeContext),s=(0,r.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),f=(0,r.useMemo)((function(){return null===s||void 0===s?void 0:s.length}),[s]);return(0,y.jsx)(c.Z,{alignItems:"center",justifyContent:"flex-start",children:null===s||void 0===s?void 0:s.map((function(e,n){var o=t?t(e,u):u===encodeURIComponent(e);return(0,r.createElement)(x,k(k({},a),{},{filePath:e,isLast:n===f-1,key:e,onClickTabClose:function(e){if(i)i(e);else{var n=(0,j.Od)(s,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,b.u7)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})}},selected:o,themeContext:d}))}))})}},28347:function(e,n,t){t.d(n,{Gb:function(){return f},fm:function(){return d},lO:function(){return a},rK:function(){return s},zn:function(){return c}});var i=t(9518),o=t(23831),r=t(82386),l=t(49125),u=t(37391),c=300,a=i.default.div.withConfig({displayName:"indexstyle__PipelineContainerStyle",componentId:"sc-1sv9513-0"})([".pipeline-detail-enter-active{opacity:1;transition:opacity ","ms linear;}.pipeline-detail-enter-done{opacity:0;transition:opacity ","ms linear;}"],c,c),d=i.default.div.withConfig({displayName:"indexstyle__OverlayStyle",componentId:"sc-1sv9513-1"})(["height:100vh;opacity:1;position:fixed;width:100vw;z-index:9999;",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeArea,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],r.Wi,r.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||o.Z.borders).medium,";\n ")}),(function(e){return e.relativePosition&&"\n position: relative;\n "}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(r.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,u.y$)()),f=i.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-right:1px solid transparent;height:100%;padding:","px ","px;"," "," ",""],l.iI,l.cd*l.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||o.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||o.Z.borders).light," !important;\n ")}))},73828:function(e,n,t){t.d(n,{JD:function(){return m},Lu:function(){return r},PF:function(){return p},d2:function(){return f},dT:function(){return l},n6:function(){return a},nB:function(){return h},oy:function(){return v},xF:function(){return s}});var i,o,r,l,u=t(82394),c=t(86422);!function(e){e.CSV="csv",e.JSON="json",e.MD="md",e.PY="py",e.R="r",e.SQL="sql",e.TXT="txt",e.YAML="yaml",e.YML="yml"}(r||(r={})),function(e){e.INIT_PY="__init__.py",e.METADATA_YAML="metadata.yaml",e.REQS_TXT="requirements.txt"}(l||(l={}));var a=[r.PY,r.SQL],d=[r.JSON,r.MD,r.PY,r.R,r.SQL,r.TXT,r.YAML,r.YML],s=new RegExp(d.map((function(e){return".".concat(e,"$")})).join("|")),f=new RegExp(d.map((function(e){return".".concat(e,"$")})).join("|")),p="charts",v="pipelines",h=(i={},(0,u.Z)(i,r.MD,c.t6.MARKDOWN),(0,u.Z)(i,r.JSON,r.JSON),(0,u.Z)(i,r.PY,c.t6.PYTHON),(0,u.Z)(i,r.R,c.t6.R),(0,u.Z)(i,r.SQL,c.t6.SQL),(0,u.Z)(i,r.TXT,"text"),(0,u.Z)(i,r.YAML,c.t6.YAML),(0,u.Z)(i,r.YML,c.t6.YAML),i),m=(o={},(0,u.Z)(o,c.t6.MARKDOWN,r.MD),(0,u.Z)(o,c.t6.PYTHON,r.PY),(0,u.Z)(o,c.t6.R,r.R),(0,u.Z)(o,c.t6.SQL,r.SQL),(0,u.Z)(o,c.t6.YAML,r.YAML),(0,u.Z)(o,"text",r.TXT),o)},98781:function(e,n,t){t.d(n,{$1:function(){return c},G7:function(){return d},QK:function(){return u},a_:function(){return s},qL:function(){return r},r0:function(){return a}});var i,o,r,l=t(82394);!function(e){e.INTEGRATION="integration",e.PYTHON="python",e.PYSPARK="pyspark",e.STREAMING="streaming"}(r||(r={}));var u,c,a,d=(i={},(0,l.Z)(i,r.INTEGRATION,"Integration"),(0,l.Z)(i,r.PYTHON,"Standard"),(0,l.Z)(i,r.PYSPARK,"PySpark"),(0,l.Z)(i,r.STREAMING,"Streaming"),i);!function(e){e.ACTIVE="active",e.INACTIVE="inactive",e.NO_SCHEDULES="no_schedules",e.RETRY="retry"}(u||(u={})),function(e){e.GROUP="group_by",e.STATUS="status[]",e.TYPE="type[]"}(c||(c={})),function(e){e.STATUS="status",e.TYPE="type"}(a||(a={}));var s=(o={},(0,l.Z)(o,r.PYTHON,"python3"),(0,l.Z)(o,r.PYSPARK,"pysparkkernel"),o)},29237:function(e,n,t){var i=t(9518),o=t(67971),r=t(86673),l=t(19711),u=t(23831),c=t(73942),a=t(37391),d=t(49125),s=t(28598),f=(0,i.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*d.iI,1.5*d.iI,1.5*d.iI),p=i.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],c.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return!e.borderless&&"\n border: 1px solid ".concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||u.Z.background).successLight,";\n ")}),(function(e){return e.success&&!e.borderless&&"\n border: 1px solid ".concat((e.theme.background||u.Z.background).success,";\n ")}),(function(e){return!e.dark&&!e.success&&"\n background-color: ".concat((e.theme.background||u.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||u.Z.background).content,";\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.maxWidth&&"\n max-width: ".concat(e.maxWidth,"px;\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 "})),v=i.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],c.n_,c.n_,(function(e){return"\n background-color: ".concat((e.theme.background||u.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),f,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),h=i.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*d.iI,a.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*d.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),m=i.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],c.M8,c.YF,1.75*d.iI);n.Z=function(e){var n=e.borderless,t=e.children,i=e.containerRef,u=e.contentContainerRef,c=e.dark,a=e.footer,d=e.fullHeight,f=void 0===d||d,b=e.fullWidth,g=void 0===b||b,y=e.header,x=e.headerHeight,j=e.headerIcon,C=e.headerPaddingVertical,w=e.headerTitle,k=e.maxHeight,O=e.maxWidth,Z=e.minWidth,P=e.noPadding,S=e.overflowVisible,D=e.subtitle,I=e.success;return(0,s.jsxs)(p,{borderless:n,dark:c,fullHeight:f,fullWidth:g,maxHeight:k,maxWidth:O,minWidth:Z,overflowVisible:S,ref:i,success:I,children:[(y||w)&&(0,s.jsxs)(v,{headerPaddingVertical:C,height:x,children:[y&&y,w&&(0,s.jsx)(o.Z,{alignItems:"center",justifyContent:"space-between",children:(0,s.jsxs)(o.Z,{alignItems:"center",children:[j&&j,(0,s.jsx)(r.Z,{ml:j?1:0,children:(0,s.jsx)(l.ZP,{bold:!0,default:!0,children:w})})]})})]}),(0,s.jsxs)(h,{maxHeight:k,noPadding:P,overflowVisible:S,ref:u,children:[D&&(0,s.jsx)(r.Z,{mb:2,children:(0,s.jsx)(l.ZP,{default:!0,children:D})}),t]}),a&&(0,s.jsx)(m,{children:a})]})}},37958:function(e,n,t){t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},42305:function(e,n,t){t.d(n,{A5:function(){return f},AY:function(){return p},BP:function(){return s},JX:function(){return d},OC:function(){return r},Pc:function(){return v},Tz:function(){return a},d$:function(){return c},lJ:function(){return h},n1:function(){return u}});var i=t(92083),o=t.n(i),r="YYYY-MM-DD HH:mm:ss",l="YYYY-MM-DD HH:mm",u="YYYY-MM-DD";function c(e,n){var t=n.dayAgo,i=n.includeSeconds,u=n.utcFormat,c=o()(e),a=l;return u&&(c=c.utc()),t&&(c=c.subtract(1,"days")),i&&(a=r),c.format(a)}function a(e){var n=c((new Date).toISOString(),{includeSeconds:!0,utcFormat:!0});return null!==e&&void 0!==e&&e.dateObj?new Date(n):n}function d(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o().unix(e).format(null!==n&&void 0!==n&&n.withSeconds?r:l)}function s(e,n,t){return o()(e).utc().hours(+n).minutes(+t).format()}function f(e){return o()(e).unix()}function p(e,n,t,i){var o="".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t);return i?"".concat(o,":").concat(i):o}function v(e){var n=o().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function h(e){return e.padStart(2,"0")}},54405:function(e,n,t){var i;t.d(n,{V5:function(){return r}}),function(e){e.ANDROID="Android",e.CHROME_OS="ChromeOS",e.IOS="iOS",e.LINUX="Linux",e.MAC="macOS",e.WINDOWS="Windows"}(i||(i={}));var o=i;function r(){return function(){var e,n,t,i,r,l,u,c=o.MAC,a=null===(e=window)||void 0===e||null===(n=e.navigator)||void 0===n?void 0:n.userAgent,d=(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===(l=window)||void 0===l||null===(u=l.navigator)||void 0===u?void 0:u.platform);return d?["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(d)?c=o.MAC:["Win32","Win64","Windows","WinCE"].includes(d)?c=o.WINDOWS:["iPhone","iPad","iPod"].includes(d)&&(c=o.IOS):a&&(a.includes("Macintosh")?c=o.MAC:a.includes("Windows")?c=o.WINDOWS:a.includes("Linux")&&a.includes("X11")?c=o.LINUX:/(iPhone|iPad)/.test(a)?c=o.IOS:a.includes("Android")&&a.includes("Mobi")?c=o.ANDROID:a.includes("CrOS")&&(c=o.CHROME_OS)),c}()===o.MAC}}}]);