mage-ai 0.8.98__py3-none-any.whl → 0.8.99__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 (83) hide show
  1. mage_ai/api/policies/OauthPolicy.py +15 -0
  2. mage_ai/api/policies/SessionPolicy.py +2 -0
  3. mage_ai/api/presenters/PipelinePresenter.py +1 -0
  4. mage_ai/api/presenters/SyncPresenter.py +1 -0
  5. mage_ai/api/resources/OauthResource.py +28 -2
  6. mage_ai/api/resources/PipelineResource.py +5 -1
  7. mage_ai/api/resources/SessionResource.py +18 -0
  8. mage_ai/api/resources/WorkspaceResource.py +3 -2
  9. mage_ai/authentication/oauth/active_directory.py +17 -0
  10. mage_ai/authentication/oauth/constants.py +9 -0
  11. mage_ai/cli/main.py +56 -49
  12. mage_ai/cluster_manager/kubernetes/workload_manager.py +46 -9
  13. mage_ai/data_preparation/git/__init__.py +1 -1
  14. mage_ai/data_preparation/models/block/dbt/utils/__init__.py +32 -0
  15. mage_ai/data_preparation/models/block/sql/__init__.py +3 -2
  16. mage_ai/data_preparation/models/pipeline.py +4 -1
  17. mage_ai/data_preparation/preferences.py +4 -2
  18. mage_ai/data_preparation/repo_manager.py +5 -1
  19. mage_ai/data_preparation/sync/__init__.py +1 -0
  20. mage_ai/data_preparation/sync/git_sync.py +2 -5
  21. mage_ai/data_preparation/templates/utils.py +2 -0
  22. mage_ai/orchestration/pipeline_scheduler.py +19 -8
  23. mage_ai/orchestration/queue/process_queue.py +15 -12
  24. mage_ai/server/api/clusters.py +1 -1
  25. mage_ai/server/constants.py +1 -1
  26. mage_ai/server/frontend_dist/404.html +2 -2
  27. mage_ai/server/frontend_dist/404.html.html +2 -2
  28. mage_ai/server/frontend_dist/_next/static/{-1TwyIVv18EeGuJPahFzG → WRxCTOtmZhTqQws_7OJZD}/_buildManifest.js +1 -1
  29. mage_ai/server/frontend_dist/_next/static/chunks/{9350-1ff50f1d7b9ee754.js → 9350-5191c83a8d0cf454.js} +1 -1
  30. mage_ai/server/frontend_dist/_next/static/chunks/pages/{_app-1a7dd14f59bb82dc.js → _app-171846e16d26855a.js} +1 -1
  31. mage_ai/server/frontend_dist/_next/static/chunks/pages/{manage-3f5032353f15dd3c.js → manage-af11f9cf94024ac0.js} +1 -1
  32. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{sync-data-513e80a872b783a7.js → sync-data-90f8830890036eb2.js} +1 -1
  33. mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-a1871b8a537d823c.js +1 -0
  34. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-48859b4e9c846212.js +1 -0
  35. mage_ai/server/frontend_dist/files.html +2 -2
  36. mage_ai/server/frontend_dist/index.html +2 -2
  37. mage_ai/server/frontend_dist/manage/settings.html +2 -2
  38. mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
  39. mage_ai/server/frontend_dist/manage/users/new.html +2 -2
  40. mage_ai/server/frontend_dist/manage/users.html +2 -2
  41. mage_ai/server/frontend_dist/manage.html +2 -2
  42. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  43. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  44. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  45. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  46. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  47. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  48. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  49. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  50. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  51. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  52. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
  53. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  54. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  55. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  56. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  57. mage_ai/server/frontend_dist/pipelines.html +2 -2
  58. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  59. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  60. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
  61. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  62. mage_ai/server/frontend_dist/settings.html +2 -2
  63. mage_ai/server/frontend_dist/sign-in.html +2 -2
  64. mage_ai/server/frontend_dist/terminal.html +2 -2
  65. mage_ai/server/frontend_dist/test.html +2 -2
  66. mage_ai/server/frontend_dist/triggers.html +2 -2
  67. mage_ai/server/frontend_dist/version-control.html +2 -2
  68. mage_ai/server/scheduler_manager.py +7 -2
  69. mage_ai/server/server.py +21 -0
  70. mage_ai/services/newrelic/__init__.py +21 -0
  71. mage_ai/settings/__init__.py +10 -1
  72. mage_ai/shared/hash.py +2 -0
  73. mage_ai/tests/data_preparation/models/test_pipeline.py +5 -0
  74. {mage_ai-0.8.98.dist-info → mage_ai-0.8.99.dist-info}/METADATA +4 -1
  75. {mage_ai-0.8.98.dist-info → mage_ai-0.8.99.dist-info}/RECORD +81 -79
  76. mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-2925c2c1b0c5559a.js +0 -1
  77. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-63fbd3334e4509d7.js +0 -1
  78. /mage_ai/server/frontend_dist/_next/static/{-1TwyIVv18EeGuJPahFzG → WRxCTOtmZhTqQws_7OJZD}/_middlewareManifest.js +0 -0
  79. /mage_ai/server/frontend_dist/_next/static/{-1TwyIVv18EeGuJPahFzG → WRxCTOtmZhTqQws_7OJZD}/_ssgManifest.js +0 -0
  80. {mage_ai-0.8.98.dist-info → mage_ai-0.8.99.dist-info}/LICENSE +0 -0
  81. {mage_ai-0.8.98.dist-info → mage_ai-0.8.99.dist-info}/WHEEL +0 -0
  82. {mage_ai-0.8.98.dist-info → mage_ai-0.8.99.dist-info}/entry_points.txt +0 -0
  83. {mage_ai-0.8.98.dist-info → mage_ai-0.8.99.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1312],{76096:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=(t(82684),t(33591)),c=t(28598),l=["children","fullHeight","gutter","style"];function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,r=e.gutter,a=e.style,s=void 0===a?{}:a,f=(0,i.Z)(e,l),d=u({},s);return r&&(d.paddingLeft=r,d.paddingRight=d.paddingLeft),t&&(d.height="100%"),(0,c.jsx)(o.Col,u(u({},f),{},{style:d,children:n}))}},97361:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=t(82684),c=t(33591),l=t(28598),a=["children","fullHeight","gutter","justifyContent","style"];function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,r=e.gutter,u=e.justifyContent,f=e.style,d=void 0===f?{}:f,p=(0,i.Z)(e,a),h=s({},d);return r&&(h.marginLeft=-1*r,h.marginRight=h.marginLeft),t&&(h.height="100%"),(0,l.jsx)(c.Row,s(s({},p),{},{justifyContent:u,style:h,children:o.Children.map(n,(function(e,n){return e&&o.cloneElement(e,{gutter:r,key:n})}))}))}},87372:function(e,n,t){"use strict";var r,i,o,c,l,a,u,s,f=t(82394),d=t(26304),p=t(26653),h=t(38626),g=t(33591),m=t(23831),y=t(2005),b=t(31012),j=t(19711),O=t(49125),w=t(86673),x=t(28598),v=["children","condensed","inline","level","marketing","spacingBelow"];function P(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Z(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?P(Object(t),!0).forEach((function(n){(0,f.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var S=(0,h.css)([""," margin:0;"," "," "," "," "," "," "," "," "," "," "," "," ",""],j.IH,(function(e){return e.color&&"\n color: ".concat(e.color,"\n ")}),(function(e){return e.yellow&&"\n color: ".concat((e.theme.accent||m.Z.accent).yellow,";\n ")}),(function(e){return e.center&&"\n text-align: center;\n "}),(function(e){return!e.monospace&&0===Number(e.weightStyle)&&"\n font-family: ".concat(y.iI,";\n ")}),(function(e){return!e.monospace&&1===Number(e.weightStyle)&&"\n font-family: ".concat(y.LX,";\n ")}),(function(e){return!e.monospace&&2===Number(e.weightStyle)&&"\n font-family: ".concat(y.LX,";\n ")}),(function(e){return!e.monospace&&3===Number(e.weightStyle)&&"\n font-family: ".concat(y.ry,";\n ")}),(function(e){return!e.monospace&&4===Number(e.weightStyle)&&"\n font-family: ".concat(y.YC,";\n ")}),(function(e){return!e.monospace&&5===Number(e.weightStyle)&&"\n font-family: ".concat(y.nF,";\n ")}),(function(e){return!e.monospace&&(6===Number(e.weightStyle)||e.bold)&&"\n font-family: ".concat(y.nF,";\n ")}),(function(e){return!e.monospace&&7===Number(e.weightStyle)&&"\n font-family: ".concat(y.nF,";\n ")}),(function(e){return!e.monospace&&8===Number(e.weightStyle)&&"\n font-family: ".concat(y.nF,";\n ")}),(function(e){return e.lineHeightAuto&&"\n line-height: normal !important;\n "})),C=h.default.div.withConfig({displayName:"Headline__HeadlineContainerStyle",componentId:"sc-12jzt2e-0"})(["",""],(function(e){return"\n color: ".concat((e.theme.content||m.Z.content).active,";\n ")})),_=h.default.h1.withConfig({displayName:"Headline__H1HeroStyle",componentId:"sc-12jzt2e-1"})([""," font-size:42px;line-height:56px;"," "," ",""],S,g.media.md(r||(r=(0,p.Z)(["\n ","\n "])),b.aQ),g.media.lg(i||(i=(0,p.Z)(["\n ","\n "])),b.aQ),g.media.xl(o||(o=(0,p.Z)(["\n ","\n "])),b.aQ)),N=h.default.h1.withConfig({displayName:"Headline__H1Style",componentId:"sc-12jzt2e-2"})([""," ",""],S,b.MJ),k=h.default.h1.withConfig({displayName:"Headline__H1MarketingStyle",componentId:"sc-12jzt2e-3"})([""," "," "," "," "," ",""],S,g.media.xs(c||(c=(0,p.Z)(["\n font-size: ","px;\n line-height: ","px;\n "])),6*O.iI,7*O.iI),g.media.sm(l||(l=(0,p.Z)(["\n font-size: ","px;\n line-height: ","px;\n "])),6*O.iI,7*O.iI),g.media.md(a||(a=(0,p.Z)(["\n font-size: ","px;\n line-height: ","px;\n "])),6*O.iI,7*O.iI),g.media.lg(u||(u=(0,p.Z)(["\n font-size: ","px;\n line-height: ","px;\n "])),6*O.iI,7*O.iI),g.media.xl(s||(s=(0,p.Z)(["\n font-size: ","px;\n line-height: ","px;\n "])),6*O.iI,7*O.iI)),z=h.default.h2.withConfig({displayName:"Headline__H2Style",componentId:"sc-12jzt2e-4"})([""," ",""],S,b.BL),H=h.default.h3.withConfig({displayName:"Headline__H3Style",componentId:"sc-12jzt2e-5"})([""," font-size:24px;line-height:32px;"],S),I=h.default.h4.withConfig({displayName:"Headline__H4Style",componentId:"sc-12jzt2e-6"})([""," font-size:20px;line-height:28px;"],S),D=h.default.h5.withConfig({displayName:"Headline__H5Style",componentId:"sc-12jzt2e-7"})([""," font-size:18px;line-height:26px;"],S),E=h.default.span.withConfig({displayName:"Headline__SpanStyle",componentId:"sc-12jzt2e-8"})([""," "," "," "," ",""],S,(function(e){return 1===e.level&&"\n ".concat(b.MJ,"\n ")}),(function(e){return 2===e.level&&"\n ".concat(b.BL,"\n ")}),(function(e){return 3===e.level&&"\n font-size: 24px;\n line-height: 32px;\n "}),(function(e){return 4===e.level&&"\n font-size: 20px;\n line-height: 28px;\n "})),L=function(e){var n,t=e.children,r=e.condensed,i=e.inline,o=e.level,c=e.marketing,l=e.spacingBelow,a=(0,d.Z)(e,v);i?n=E:0===Number(o)?n=_:1===Number(o)?n=c?k:N:2===Number(o)?n=z:3===Number(o)?n=H:4===Number(o)?n=I:5===Number(o)&&(n=D);var u=(0,x.jsxs)(n,Z(Z({},a),{},{level:o,children:[l&&(0,x.jsx)(w.Z,{mb:r?2:3,children:t}),!l&&t]}));return i?u:(0,x.jsx)(C,{children:u})};L.defaultProps={level:3,weightStyle:6},n.Z=L},71208:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Y}});var r=t(77837),i=t(38860),o=t.n(i),c=t(82394),l=t(57384),a=t(41424),u=t(33591),s=t(86673),f=t(49125),d=t(28598);var p=function(e){var n=e.children,t=e.width,r=void 0===t?12:t;return(0,d.jsx)(s.Z,{px:f.zC,children:(0,d.jsx)(u.Row,{children:(0,d.jsx)(u.Col,{lg:r,md:Math.min(12,Math.round(1.5*(12-r))),sm:Math.min(12,Math.round(1.75*(12-r))),xs:12,children:n})})})},h=t(38626),g=t(3055),m=h.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-jcgu5l-0"})(["padding-top:","px;",""],g.Mz,(function(e){return e.fullHeight&&"\n height: calc(100vh);\n "}));function y(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function b(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?y(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var j=function(e){var n=e.children,t=e.headerProps,r=e.title;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.Z,{title:r}),(0,d.jsx)(a.Z,b({},t)),(0,d.jsx)(p,{children:(0,d.jsx)(m,{fullHeight:!0,children:n})})]})},O=t(75582),w=t(82684),x=t(83455),v=t(34376),P=t(35490),Z=t(67971),S=t(87372),C=t(11135),_=t(19711),N=t(82944),k=t(82531),z=t(23831),H=t(73942),I=h.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-641xul-0"})(["border-radius:","px;padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;width:100%;",""],H.TR,21*f.iI,f.Vj,f.Vj,f.Vj,(function(e){return"\n background-color: ".concat((e.theme.background||z.Z.background).panel,";\n ")})),D=h.default.div.withConfig({displayName:"indexstyle__BackgroundImageStyle",componentId:"sc-641xul-1"})(["border-radius:","px;font-size:0;overflow:hidden;",""],H.D7,(function(e){return e.src&&"\n background-image: url(".concat(e.src,");\n background-size: cover;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n ")})),E=t(76096),L=t(97361),M=E.Z,R=L.Z,F=t(16115),B=t(7715),T=t(96510),V=t(51504),X=t(59e3),Q=t(9736);function J(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function U(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?J(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var W="email",q="password";var A=function(e){var n=e.title,t=(0,v.useRouter)(),r=(0,w.useState)(null),i=r[0],o=r[1],l=(0,w.useState)({}),a=l[0],u=l[1],p=(0,x.Db)(k.ZP.sessions.useCreate(),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(e){var n=e.session,r=n.token,i=n.user;(0,Q.av)(i),P.Z.storeToken(r,(function(){var e="/",n=(0,X.iV)(window.location.href);n.redirect_url&&(e="".concat(n.redirect_url,"?").concat((0,X.uM)((0,B.gR)(n,["redirect_url"])))),t.push(e)}))},onErrorCallback:function(e){var n=e.error;o(n)}})}}),h=(0,O.Z)(p,2),g=h[0],m=h[1].isLoading,y=(0,w.useCallback)((function(e){return P.Z.logout((function(){return g(e)}))}),[g]);return(0,d.jsxs)(R,{fullHeight:!0,children:[(0,d.jsx)(M,{lg:6,md:12,children:(0,d.jsx)(Z.Z,{flexDirection:"column",fullHeight:!0,fullWidth:!0,justifyContent:"center",children:(0,d.jsx)(s.Z,{px:{xl:5*f.zC,xs:f.zC},py:f.zC,children:(0,d.jsxs)(I,{children:[(0,d.jsx)(S.Z,{yellow:!0,children:n}),(0,d.jsxs)("form",{children:[(0,d.jsxs)(s.Z,{mt:3,children:[(0,d.jsx)(N.Z,{autoComplete:"username",label:"Email",large:!0,meta:{error:" ",touched:!!i},onChange:function(e){return u((function(n){return U(U({},n),{},(0,c.Z)({},W,e.target.value))}))},primary:!i,value:a.email}),(0,d.jsx)(s.Z,{mt:2,children:(0,d.jsx)(N.Z,{autoComplete:"current-password",label:"Password",large:!0,meta:{error:" ",touched:!!i},onChange:function(e){return u((function(n){return U(U({},n),{},(0,c.Z)({},q,e.target.value))}))},primary:!i,type:"password",value:a.password})})]}),i&&(0,d.jsx)(s.Z,{mt:2,children:(0,d.jsx)(_.ZP,{danger:!0,children:i.message})}),(0,d.jsx)(s.Z,{mt:3,children:(0,d.jsx)(C.ZP,{bold:!0,inline:!0,keyTextGroups:[[F.Lz]],keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,V.y)([F.Uq],n)},large:!0,loading:m,noHoverUnderline:!0,onClick:function(){return y({session:a})},selected:!0,uuid:"SignForm/action",wind:!0,children:"Sign into Mage"})})]})]})})})}),(0,d.jsx)(M,{hiddenLgDown:!0,lg:6,style:{flex:1},children:(0,d.jsx)(s.Z,{fullHeight:!0,fullWidth:!0,px:f.zC,py:f.zC+8,children:(0,d.jsx)(D,{src:"/images/sessions/abstract.png",children:"Sign in abstract image"})})})]})};function G(){return(0,d.jsx)(j,{title:"Sign in",children:(0,d.jsx)(A,{title:"\ud83d\udc4b Sign in"})})}G.getInitialProps=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var Y=G},6821:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sign-in",function(){return t(71208)}])}},function(e){e.O(0,[844,1424,9774,2888,179],(function(){return n=6821,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2858],{1210:function(e,n,r){"use strict";r.d(n,{Z:function(){return y}});var o=r(82394),t=r(21831),i=r(82684),l=r(47999),c=r(49894),s=r(93461),d=r(57384),u=r(41424),a=r(72454),h=r(28598);function f(e,n){var r=e.children;return(0,h.jsx)(a.HS,{ref:n,children:r})}var m=i.forwardRef(f),v=r(32063),j=r(85019),x=r(82531),b=r(66166),g=r(3055),p=r(49125),Z=r(91427),w=r(24141);function C(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,o)}return r}function k(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?C(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var y=function(e){var n,r=e.after,o=e.afterHidden,f=e.afterWidth,C=e.afterWidthOverride,y=e.before,P=e.beforeWidth,_=e.breadcrumbs,I=e.children,O=e.errors,S=e.headerMenuItems,M=e.headerOffset,D=e.mainContainerHeader,B=e.navigationItems,F=e.setErrors,E=e.subheaderChildren,H=e.title,N=e.uuid,U=(0,w.i)().width,A="dashboard_after_width_".concat(N),T="dashboard_before_width_".concat(N),R=(0,i.useRef)(null),G=(0,i.useState)(C?f:(0,Z.U2)(A,f)),q=G[0],z=G[1],L=(0,i.useState)(!1),V=L[0],W=L[1],Q=(0,i.useState)(y?Math.max((0,Z.U2)(T,P),13*p.iI):null),K=Q[0],X=Q[1],Y=(0,i.useState)(!1),J=Y[0],$=Y[1],ee=(0,i.useState)(null)[1],ne=x.ZP.projects.list({},{revalidateOnFocus:!1}).data,re=null===ne||void 0===ne?void 0:ne.projects,oe=[];_?oe.push.apply(oe,(0,t.Z)(_)):(null===re||void 0===re?void 0:re.length)>=1&&oe.push.apply(oe,[{label:function(){var e;return null===(e=re[0])||void 0===e?void 0:e.name},linkProps:{href:"/"}},{bold:!0,label:function(){return H}}]),(0,i.useEffect)((function(){null===R||void 0===R||!R.current||V||J||null===ee||void 0===ee||ee(R.current.getBoundingClientRect().width)}),[V,q,J,K,R,ee,U]),(0,i.useEffect)((function(){V||(0,Z.t8)(A,q)}),[o,V,q,A]),(0,i.useEffect)((function(){J||(0,Z.t8)(T,K)}),[J,K,T]);var te=(0,b.Z)(f);return(0,i.useEffect)((function(){C&&te!==f&&z(f)}),[C,f,te]),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.Z,{title:H}),(0,h.jsx)(u.Z,{breadcrumbs:oe,menuItems:S,project:null===re||void 0===re?void 0:re[0],version:null===re||void 0===re||null===(n=re[0])||void 0===n?void 0:n.version}),(0,h.jsxs)(a.Nk,{children:[0!==(null===B||void 0===B?void 0:B.length)&&(0,h.jsx)(a.lm,{showMore:!0,children:(0,h.jsx)(j.Z,{navigationItems:B,showMore:!0})}),(0,h.jsx)(s.Z,{flex:1,flexDirection:"column",children:(0,h.jsxs)(v.Z,{after:r,afterHeightOffset:g.Mz,afterHidden:o,afterMousedownActive:V,afterWidth:q,before:y,beforeHeightOffset:g.Mz,beforeMousedownActive:J,beforeWidth:a.k1+(y?K:0),headerOffset:M,hideAfterCompletely:!0,leftOffset:y?a.k1:null,mainContainerHeader:D,mainContainerRef:R,setAfterMousedownActive:W,setAfterWidth:z,setBeforeMousedownActive:$,setBeforeWidth:X,children:[E&&(0,h.jsx)(m,{children:E}),I]})})]}),O&&(0,h.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===F||void 0===F?void 0:F(null)},children:(0,h.jsx)(c.Z,k(k({},O),{},{onClose:function(){return null===F||void 0===F?void 0:F(null)}}))})]})}},32316:function(e,n,r){"use strict";r.d(n,{Z:function(){return j}});var o=r(82684),t=r(60328),i=r(67971),l=r(882),c=r(86673),s=r(19711),d=r(99994),u=r(38626),a=r(49125),h=r(37391),f=u.default.div.withConfig({displayName:"indexstyle__TabsContainerStyle",componentId:"sc-segf7l-0"})(["padding-left:","px;padding-right:","px;"," "," ",""],a.cd*a.iI,a.cd*a.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.allowScroll&&"\n overflow: auto;\n "}),h.w5),m=r(66653),v=r(28598);var j=function(e){var n=e.allowScroll,r=e.compact,u=e.contained,h=e.noPadding,j=e.onClickTab,x=e.selectedTabUUID,b=e.small,g=e.tabs,p=(0,o.useMemo)((function(){var e=g.length,n=[];return g.forEach((function(o,u){var h=o.Icon,f=o.IconSelected,g=o.label,p=o.uuid,Z=p===x,w=Z&&f||h,C=g?g():p,k=(0,v.jsxs)(i.Z,{alignItems:"center",children:[w&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(w,{default:!Z,size:2*a.iI}),(0,v.jsx)(c.Z,{mr:1})]}),(0,v.jsx)(s.ZP,{bold:!0,default:!Z,noWrapping:!0,small:!0,children:C})]});u>=1&&e>=2&&n.push((0,v.jsx)("div",{style:{marginLeft:1.5*a.iI}},"spacing-".concat(p))),Z?n.push((0,v.jsx)(l.Z,{backgroundGradient:d.yr,backgroundPanel:!0,borderLess:!0,borderWidth:2,compact:r||b,onClick:function(e){(0,m.j)(e),j(o)},paddingUnitsHorizontal:1.75,paddingUnitsVertical:1.25,small:b,children:k},p)):n.push((0,v.jsx)("div",{style:{padding:2},children:(0,v.jsx)(t.Z,{borderLess:!0,compact:r||b,default:!0,onClick:function(e){(0,m.j)(e),j(o)},outline:!0,small:b,children:k})},"button-tab-".concat(p)))})),n}),[r,j,x,b,g]),Z=(0,v.jsx)(i.Z,{alignItems:"center",children:p});return u?Z:(0,v.jsx)(f,{allowScroll:n,noPadding:h,children:Z})}},83243:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return Pe}});var o=r(77837),t=r(38860),i=r.n(t),l=r(41788),c=r(82394),s=r(75582),d=r(54407),u=r.n(d),a=r(82684),h=r(83455),f=r(60328),m=r(34744),v=r(67971),j=r(87372),x=r(55378),b=r(86673),g=r(54283),p=r(19711),Z=r(38435),w=r(82944),C=r(46261),k=r(82531),y=r(10503),P="delete",_="merge",I="pull",O="push",S="rebase",M="git_remote_name",D="git_repository_name",B={uuid:"Branches"},F={uuid:"Files"},E={uuid:"Push"},H={uuid:"Setup"},N=[H,B,F,E],U=r(49125),A=r(90211),T=r(91427),R=r(96510),G=r(28598);var q=function(e){var n=e.branch,r=e.branches,o=e.fetchBranch,t=e.fetchBranches,i=e.remotes,l=e.showError,d=(0,a.useState)(""),u=d[0],I=d[1],O=(0,a.useState)(null),D=O[0],B=O[1],E=(0,a.useState)(null),N=E[0],q=E[1],z=(0,a.useState)((0,T.U2)(M,"")),L=z[0],V=z[1],W=(0,a.useCallback)((function(e){(0,T.t8)(M,e),V(e)}),[]),Q=(0,a.useState)(null),K=Q[0],X=Q[1],Y=(0,a.useState)(""),J=Y[0],$=Y[1],ee=(0,a.useMemo)((function(){return null===i||void 0===i?void 0:i.find((function(e){return e.name===L}))}),[L,i]),ne=(0,a.useMemo)((function(){return(null===r||void 0===r?void 0:r.concat((null===ee||void 0===ee?void 0:ee.refs)||[]))||[]}),[r,ee]),re=(0,h.Db)(k.ZP.git_branches.useCreate(),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(){o(),t(),$("")},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),oe=(0,s.Z)(re,2),te=oe[0],ie=oe[1].isLoading,le=(0,h.Db)(k.ZP.git_branches.useCreate(),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(){o()},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),ce=(0,s.Z)(le,2),se=ce[0],de=ce[1].isLoading,ue=(0,h.Db)(k.ZP.git_branches.useUpdate(null===n||void 0===n?void 0:n.name),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.git_branch.progress;o(),I(""),B(""),q(n),X("")},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),ae=(0,s.Z)(ue,2),he=ae[0],fe=ae[1].isLoading;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsxs)(j.Z,{children:["Branches",ne?" (".concat(null===ne||void 0===ne?void 0:ne.length,")"):""]}),(0,G.jsx)(b.Z,{mt:U.Mq,children:(0,G.jsxs)(v.Z,{children:[(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Remote"})}),(0,G.jsx)(x.Z,{beforeIcon:(0,G.jsx)(y.VW,{}),beforeIconSize:1.5*U.iI,monospace:!0,onChange:function(e){return W(e.target.value)},placeholder:"Choose a remote",value:L||"",children:null===i||void 0===i?void 0:i.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))})]}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Current branch"})}),(0,G.jsxs)(v.Z,{alignItems:"center",children:[(0,G.jsx)(C.Z,{fullSize:!0,label:"Choose a different branch to switch branches",widthFitContent:!0,children:(0,G.jsx)(x.Z,{beforeIcon:(0,G.jsx)(y.I0,{muted:!1}),beforeIconSize:2*U.iI,monospace:!0,onChange:function(e){return se({git_branch:{name:e.target.value}})},value:null===n||void 0===n?void 0:n.name,children:(null===n||void 0===n?void 0:n.name)&&(null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)})))})}),(0,G.jsx)(b.Z,{mr:U.cd}),de&&(0,G.jsx)(g.Z,{inverted:!0})]})]})]})}),(0,G.jsx)(b.Z,{mt:U.Mq,children:(0,G.jsxs)(v.Z,{alignItems:"center",children:[(0,G.jsx)(w.Z,{label:"New branch name",monospace:!0,onChange:function(e){var n;return $(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:J||""}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.mm,{size:2*U.iI}),disabled:!J,loading:ie,onClick:function(){te({git_branch:{name:J}})},primary:!0,children:"Create new branch"})]})})]}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(j.Z,{children:"Actions"}),(0,G.jsxs)(b.Z,{mt:U.Mq,children:[(0,G.jsxs)(b.Z,{mb:U.Mq,children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Compare branch"})}),(null===n||void 0===n?void 0:n.name)&&(0,G.jsx)(p.ZP,{monospace:!0,children:null===n||void 0===n?void 0:n.name})]}),(0,G.jsxs)(v.Z,{alignItems:"center",children:[(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Base branch"})}),(0,G.jsx)(x.Z,{beforeIcon:(0,G.jsx)(y.I0,{}),beforeIconSize:1.5*U.iI,monospace:!0,onChange:function(e){return X(e.target.value)},placeholder:"Choose a branch",value:K,children:null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))})]}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Action"})}),(0,G.jsxs)(x.Z,{onChange:function(e){return B(e.target.value)},placeholder:"Choose action",value:D||"",children:[(0,G.jsx)("option",{value:_,children:(0,A.vg)(_)}),(0,G.jsx)("option",{value:S,children:(0,A.vg)(S)}),(0,G.jsx)("option",{value:P,children:(0,A.vg)(P)})]})]})]}),D&&[_,S].includes(D)&&(0,G.jsxs)(b.Z,{mt:U.cd,children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsxs)(p.ZP,{bold:!0,muted:!0,children:["Message for ",D]})}),(0,G.jsx)(Z.Z,{monospace:!0,onChange:function(e){return I(e.target.value)},value:u||""})]}),(0,G.jsxs)(b.Z,{mt:U.cd,children:[(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.Bf,{size:2*U.iI}),disabled:!D||!K,loading:fe,onClick:function(){(P!==D||"undefined"!==typeof location&&window.confirm("Are you sure you want to delete branch ".concat(K,"?")))&&he({git_branch:(0,c.Z)({action_type:D,message:u},D,{base_branch:K})})},primary:!0,children:D?(0,A.vg)(D):"Execute action"}),N&&(0,G.jsx)(b.Z,{mt:U.cd,children:(0,G.jsx)(p.ZP,{default:!0,monospace:!0,preWrap:!0,children:N})})]})]})]}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(b.Z,{mb:U.HN,children:(0,G.jsx)(m.Z,{light:!0})}),(0,G.jsxs)(v.Z,{children:[(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.Hd,{}),linkProps:{href:"/version-control?tab=".concat(H.uuid)},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:H.uuid}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)(f.Z,{afterIcon:(0,G.jsx)(y.Kw,{}),linkProps:{href:"/version-control?tab=".concat(F.uuid)},noHoverUnderline:!0,sameColorAsText:!0,secondary:!0,children:["Next: ",F.uuid]})]})]})]})},z=r(32316),L=r(44182),V=r(25880),W=r(10919),Q=r(87815),K=r(24224);function X(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,o)}return r}function Y(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?X(Object(r),!0).forEach((function(n){(0,c.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var J={base_branch:null,body:null,compare_branch:null,repository:null,title:null};var $=function(e){var n=e.branch,r=e.branches,o=e.fetchBranch,t=e.loading,i=e.remotes,l=e.showError,d=(0,a.useState)((null===n||void 0===n?void 0:n.name)||""),u=d[0],C=d[1],P=(0,a.useState)(null),_=P[0],I=P[1],S=(0,a.useState)(null),B=S[0],E=S[1],H=(0,a.useState)((0,T.U2)(M,"")),N=H[0],q=H[1],z=(0,a.useCallback)((function(e){(0,T.t8)(M,e),q(e)}),[]),X=(0,a.useState)(J),$=X[0],ee=X[1],ne=(0,a.useState)((0,T.U2)(D,"")),re=ne[0],oe=ne[1],te=(0,a.useCallback)((function(e){(0,T.t8)(D,e),oe(e)}),[]),ie=(0,h.Db)(k.ZP.git_branches.useUpdate(null===n||void 0===n?void 0:n.name),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.git_branch,r=n.error,t=n.progress;r?(I(r),E(null)):(o(),I(null),E(t))},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),le=(0,s.Z)(ie,2),ce=le[0],se=le[1].isLoading,de=(0,a.useMemo)((function(){return(0,K.Tw)(i.reduce((function(e,n){var r;return e.concat((null===n||void 0===n||null===(r=n.repository_names)||void 0===r?void 0:r.map((function(e){var r;return{name:e,url:null===n||void 0===n||null===(r=n.urls)||void 0===r?void 0:r[0]}})))||[])}),[]),(function(e){return e.name}))}),[i]),ue=k.ZP.pull_requests.list({repository:re},{},{pauseFetch:!re}),ae=ue.data,he=ue.mutate,fe=(0,a.useMemo)((function(){return(null===ae||void 0===ae?void 0:ae.pull_requests)||[]}),[ae]),me=(0,a.useMemo)((function(){return(0,G.jsx)(Q.Z,{columnFlex:[null,null,null,null],columns:[{uuid:"Title"},{uuid:"Author"},{uuid:"Created"},{uuid:"Last modified"}],onClickRow:function(e){var n,r=null===fe||void 0===fe||null===(n=fe[e])||void 0===n?void 0:n.url;r&&window.open(r,"_blank")},rows:null===fe||void 0===fe?void 0:fe.map((function(e){var n=e.created_at,r=e.last_modified,o=e.title,t=e.url,i=e.user;return[(0,G.jsx)(W.Z,{default:!0,href:t,monospace:!0,openNewWindow:!0,small:!0,children:o},"title"),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:i},"user"),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:n},"createdAt"),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:r||"-"},"lastModified")]})),uuid:"pull-requests"})}),[fe]),ve=k.ZP.git_branches.list({repository:re},{},{pauseFetch:!re}).data,je=(0,a.useMemo)((function(){return(null===ve||void 0===ve?void 0:ve.git_branches)||[]}),[ve]);(0,a.useEffect)((function(){null!==$&&void 0!==$&&$.compare_branch||null===je||void 0===je||!je.find((function(e){return e.name===(null===n||void 0===n?void 0:n.name)}))||ee((function(e){return Y(Y({},e),{},{compare_branch:null===n||void 0===n?void 0:n.name})}))}),[n,je,$]);var xe=(0,h.Db)(k.ZP.pull_requests.useCreate(),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(){he(),ee(J)},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),be=(0,s.Z)(xe,2),ge=be[0],pe=be[1].isLoading;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(j.Z,{children:(0,A.vg)(O)})}),(0,G.jsxs)(b.Z,{mt:U.Mq,children:[(0,G.jsxs)(v.Z,{children:[(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Remote"})}),t&&(0,G.jsx)(g.Z,{inverted:!0}),!t&&(0,G.jsx)(x.Z,{beforeIcon:(0,G.jsx)(y.VW,{}),beforeIconSize:1.5*U.iI,monospace:!0,onChange:function(e){return z(e.target.value)},placeholder:"Choose remote",value:N||"",children:null===i||void 0===i?void 0:i.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))})]}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Branch"})}),(0,G.jsxs)(x.Z,{beforeIcon:(0,G.jsx)(y.I0,{}),beforeIconSize:1.5*U.iI,monospace:!0,onChange:function(e){return C(e.target.value)},placeholder:"Choose branch",value:u||"",children:[(0,G.jsx)("option",{value:""}),null===r||void 0===r?void 0:r.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))]})]})]}),(0,G.jsx)(b.Z,{mt:U.cd,children:(0,G.jsxs)(f.Z,{beforeIcon:(0,G.jsx)(y.Bf,{size:2*U.iI}),disabled:!N||!u,loading:se,onClick:function(){E(null),ce({git_branch:(0,c.Z)({action_type:O},O,{branch:u,remote:N})})},primary:!0,children:[(0,A.vg)(O)," ",N," ",N&&u]})}),(B||_)&&(0,G.jsx)(b.Z,{mt:U.cd,children:(0,G.jsx)(p.ZP,{danger:!!_,default:!!B,monospace:!0,preWrap:!0,children:B||_})})]})]}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(j.Z,{children:"Create pull request"})}),(0,G.jsxs)(b.Z,{mt:U.Mq,children:[t&&(0,G.jsx)(g.Z,{inverted:!0}),!t&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(v.Z,{children:[(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Repository"})}),(0,G.jsx)(x.Z,{beforeIcon:(0,G.jsx)(y.fy,{}),beforeIconSize:1.5*U.iI,monospace:!0,onChange:function(e){return te(e.target.value)},placeholder:"Choose repository",value:re||"",children:null===de||void 0===de?void 0:de.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))})]}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Base branch"})}),re&&!ve&&(0,G.jsx)(g.Z,{inverted:!0}),(!re||ve)&&(0,G.jsx)(x.Z,{beforeIcon:(0,G.jsx)(y.I0,{}),beforeIconSize:1.5*U.iI,disabled:!re,monospace:!0,onChange:function(e){return ee((function(n){return Y(Y({},n),{},{base_branch:e.target.value})}))},placeholder:"Choose branch",value:(null===$||void 0===$?void 0:$.base_branch)||"",children:null===je||void 0===je?void 0:je.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))})]}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)("div",{children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Compare branch"})}),re&&!ve&&(0,G.jsx)(g.Z,{inverted:!0}),(!re||ve||(null===$||void 0===$?void 0:$.compare_branch))&&(0,G.jsxs)(x.Z,{beforeIcon:(0,G.jsx)(y.I0,{}),beforeIconSize:1.5*U.iI,disabled:!re,monospace:!0,onChange:function(e){return ee((function(n){return Y(Y({},n),{},{compare_branch:e.target.value})}))},placeholder:"Choose branch",value:(null===$||void 0===$?void 0:$.compare_branch)||"",children:[!(null!==je&&void 0!==je&&je.length)&&(null===$||void 0===$?void 0:$.compare_branch)&&(0,G.jsx)("option",{value:null===$||void 0===$?void 0:$.compare_branch,children:null===$||void 0===$?void 0:$.compare_branch}),null===je||void 0===je?void 0:je.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))]})]})]}),(0,G.jsx)(b.Z,{mt:1,children:(0,G.jsx)(w.Z,{label:"Title",monospace:!0,onChange:function(e){return ee((function(n){return Y(Y({},n),{},{title:e.target.value})}))},value:(null===$||void 0===$?void 0:$.title)||""})}),(0,G.jsx)(b.Z,{mt:1,children:(0,G.jsx)(Z.Z,{label:"Description",monospace:!0,onChange:function(e){return ee((function(n){return Y(Y({},n),{},{body:e.target.value})}))},value:(null===$||void 0===$?void 0:$.body)||""})}),(0,G.jsx)(b.Z,{mt:U.cd,children:(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.Bf,{size:2*U.iI}),disabled:!re||!(null!==$&&void 0!==$&&$.title)||!(null!==$&&void 0!==$&&$.base_branch)||!(null!==$&&void 0!==$&&$.compare_branch),loading:pe,onClick:function(){ge({pull_request:Y(Y({},$),{},{repository:re})})},primary:!0,children:"Create new pull request"})})]})]}),(0,G.jsx)(b.Z,{mt:U.Mq,children:(0,G.jsx)(L.Z,{visibleMapping:{0:!re},children:(0,G.jsxs)(V.Z,{noPaddingContent:!0,title:ae?"Pull requests (".concat(null===fe||void 0===fe?void 0:fe.length,")"):"Pull requests",children:[!re&&(0,G.jsx)(b.Z,{p:U.cd,children:(0,G.jsx)(p.ZP,{muted:!0,children:"Please select a repository to view open pull requests."})}),re&&(0,G.jsxs)(G.Fragment,{children:[!ae&&(0,G.jsx)(b.Z,{p:U.cd,children:(0,G.jsx)(g.Z,{inverted:!0})}),ae&&me]})]})})})]}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(b.Z,{mb:U.HN,children:(0,G.jsx)(m.Z,{light:!0})}),(0,G.jsx)(v.Z,{children:(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.Hd,{}),linkProps:{href:"/version-control?tab=".concat(F.uuid)},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:F.uuid})})]})]})},ee=r(1210),ne=r(46299),re=r(38341),oe=r(93461),te=r(38626),ie=te.default.div.withConfig({displayName:"indexstyle__SpacingStyle",componentId:"sc-el09vr-0"})(["margin-top:","px;"],.5*U.iI),le=r(7715);function ce(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,o)}return r}function se(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?ce(Object(r),!0).forEach((function(n){(0,c.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var de,ue=function(e){var n=e.branch,r=e.fetchBranch,o=e.modifiedFiles,t=e.setSelectedFilePath,i=e.showError,l=e.stagedFiles,c=e.untrackedFiles,d=(0,a.useRef)(null),u=(0,a.useState)(""),x=u[0],w=u[1],C=(0,a.useState)({}),P=C[0],_=C[1],I=(0,a.useState)({}),O=I[0],S=I[1],M=(0,a.useMemo)((function(){return Object.keys(o).concat(Object.keys(c)).sort()}),[o,c]),D=(0,a.useMemo)((function(){return Object.keys(l||{})}),[l]),F=(0,a.useMemo)((function(){return D.length}),[D]),H=(0,a.useMemo)((function(){return Object.keys(P).length===(null===M||void 0===M?void 0:M.length)}),[P,M]),N=(0,a.useMemo)((function(){return Object.keys(O).length===(null===D||void 0===D?void 0:D.length)}),[O,D]),T=(0,a.useMemo)((function(){return{onErrorCallback:function(e,n){return i({errors:n,response:e})}}}),[i]),q=(0,a.useMemo)((function(){return{onSuccess:function(e){return(0,R.wD)(e,se({callback:function(){r(),_({})}},T))}}}),[r,T]),z=(0,a.useMemo)((function(){return k.ZP.git_branches.useUpdate(null===n||void 0===n?void 0:n.name)}),[n]),K=(0,h.Db)(z,q),X=(0,s.Z)(K,2),Y=X[0],J=X[1].isLoading,$=(0,h.Db)(z,q),ee=(0,s.Z)($,2),ne=ee[0],te=ee[1].isLoading,ce=(0,h.Db)(z,{onSuccess:function(e){return(0,R.wD)(e,se({callback:function(){r(),S({})}},T))}}),de=(0,s.Z)(ce,2),ue=de[0],ae=de[1].isLoading,he=(0,a.useCallback)((function(e,n,r,o,t){var i=(null===e||void 0===e?void 0:e.length)>=1;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(W.Z,{block:!0,noHoverUnderline:!0,onClick:function(){r(t?{}:o)},preventDefault:!0,children:(0,G.jsxs)(v.Z,{alignItems:"center",flexDirection:"row",children:[(0,G.jsx)(re.Z,{checked:i&&t,disabled:!i}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(p.ZP,{bold:!0,children:i&&t?"Unselect all":"Select all"})]})}),e.map((function(e){return(0,G.jsx)(ie,{children:(0,G.jsx)(W.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return r((function(n){var r=se({},n);return!(null!==r&&void 0!==r&&r[e])?r[e]=!0:delete r[e],r}))},preventDefault:!0,children:(0,G.jsxs)(v.Z,{alignItems:"center",flexDirection:"row",children:[(0,G.jsx)(re.Z,{checked:!(null===n||void 0===n||!n[e])}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,children:e})]})})},e)}))]})}),[]),fe=(0,a.useMemo)((function(){return(0,le.Qr)(P)}),[P]),me=k.ZP.git_branches.detail("with_logs",{_format:"with_logs"}),ve=me.data,je=me.mutate,xe=(0,a.useMemo)((function(){var e;return(null===ve||void 0===ve||null===(e=ve.git_branch)||void 0===e?void 0:e.logs)||[]}),[ve]),be=(0,h.Db)(k.ZP.git_branches.useUpdate(null===n||void 0===n?void 0:n.name),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(){je(),r(),w("")},onErrorCallback:function(e,n){return i({errors:n,response:e})}})}}),ge=(0,s.Z)(be,2),pe=ge[0],Ze=ge[1].isLoading,we=(0,a.useMemo)((function(){return(0,G.jsx)(Q.Z,{columnFlex:[1,1,1],columns:[{uuid:"Author"},{uuid:"Date"},{uuid:"Message"}],rows:xe.map((function(e){var n=e.author,r=e.date,o=e.message;return[(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:null===n||void 0===n?void 0:n.name},"author"),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:r},"date"),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:o},"message")]})),uuid:"git-branch-logs"})}),[xe]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(b.Z,{mb:U.HN,children:(0,G.jsxs)(v.Z,{children:[(0,G.jsxs)(oe.Z,{flex:1,flexDirection:"column",children:[(0,G.jsxs)(j.Z,{children:["Not staged ",(null===M||void 0===M?void 0:M.length)>=1&&"(".concat(null===M||void 0===M?void 0:M.length,")")]}),(0,G.jsx)(b.Z,{my:U.cd,children:(0,G.jsx)(m.Z,{light:!0})}),(0,G.jsx)(b.Z,{mb:U.cd,children:(0,G.jsxs)(v.Z,{flexDirection:"row",children:[(0,G.jsx)(f.Z,{compact:!0,disabled:fe||ae||te,loading:J,onClick:function(){Y({git_branch:{action_type:"add",files:Object.keys(P)}}).then((function(e){var n,r=e.data;null!==r&&void 0!==r&&r.git_branch&&(null===d||void 0===d||null===(n=d.current)||void 0===n||n.focus())}))},primary:!0,children:"Add files"}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(f.Z,{compact:!0,disabled:fe||J||ae,loading:te,noBackground:!0,onClick:function(){"undefined"!==typeof location&&window.confirm("Are you sure you want to undo all changes in the selected files?")&&ne({git_branch:{action_type:"checkout",files:Object.keys(P)}})},children:"Checkout files"})]})}),he(M,P,_,se(se({},o),c),H)]}),(0,G.jsx)(b.Z,{mr:U.cd}),(0,G.jsxs)(oe.Z,{flex:1,flexDirection:"column",children:[(0,G.jsxs)(j.Z,{children:["Staged files ",(null===D||void 0===D?void 0:D.length)>=1&&"(".concat(null===D||void 0===D?void 0:D.length,")")]}),(0,G.jsx)(b.Z,{my:U.cd,children:(0,G.jsx)(m.Z,{light:!0})}),(0,G.jsx)(b.Z,{mb:U.cd,children:(0,G.jsx)(v.Z,{flexDirection:"row",children:(0,G.jsx)(f.Z,{compact:!0,disabled:(0,le.Qr)(O)||J||te,loading:ae,onClick:function(){ue({git_branch:{action_type:"reset",files:Object.keys(O)}})},secondary:!0,children:"Reset files"})})}),he(D,O,S,l,N)]})]})}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(j.Z,{children:"Commit"})}),(0,G.jsx)(b.Z,{mb:U.cd,children:(0,G.jsx)(L.Z,{children:(0,G.jsx)(V.Z,{noPaddingContent:!0,title:F>=1?"Staged files (".concat(F,")"):"No staged files",children:null===D||void 0===D?void 0:D.map((function(e){return(0,G.jsx)(b.Z,{my:1,px:U.cd,children:(0,G.jsxs)(v.Z,{justifyContent:"space-between",children:[(0,G.jsx)(W.Z,{default:!0,monospace:!0,onClick:function(){return t((function(n){return n===e?null:e}))},warning:null===o||void 0===o?void 0:o[e],children:e}),(0,G.jsx)(b.Z,{mr:1}),(null===o||void 0===o?void 0:o[e])&&(0,G.jsx)(p.ZP,{warning:!0,children:"Modified after staging"})]})},e)}))})})}),(0,G.jsx)(Z.Z,{label:"Commit message",monospace:!0,onChange:function(e){return w(e.target.value)},ref:d,value:x||""}),(0,G.jsx)(b.Z,{mt:U.cd,children:(0,G.jsxs)(v.Z,{alignItems:"center",children:[(0,G.jsxs)(f.Z,{disabled:0===F||!((null===x||void 0===x?void 0:x.length)>=1),loading:Ze,onClick:function(){pe({git_branch:{action_type:"commit",files:D,message:x}})},primary:!0,children:["Commit ",(0,A._6)("file",F,!0)," with message"]}),0===F&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(p.ZP,{danger:!0,small:!0,children:"Please stage at least 1 file before committing."})]})]})})]}),(0,G.jsx)(b.Z,{mb:U.HN,children:(0,G.jsx)(L.Z,{children:(0,G.jsxs)(V.Z,{noPaddingContent:!0,title:"Logs",children:[!ve&&(0,G.jsx)(b.Z,{p:U.cd,children:(0,G.jsx)(g.Z,{inverted:!0})}),ve&&we]})})}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(b.Z,{mb:U.HN,children:(0,G.jsx)(m.Z,{light:!0})}),(0,G.jsxs)(v.Z,{children:[(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.Hd,{}),linkProps:{href:"/version-control?tab=".concat(B.uuid)},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:B.uuid}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)(f.Z,{afterIcon:(0,G.jsx)(y.Kw,{}),linkProps:fe?{href:"/version-control?tab=".concat(E.uuid)}:null,noHoverUnderline:!0,primary:fe,sameColorAsText:!0,secondary:!fe,children:["Next: ",E.uuid]})]})]})]})},ae=r(12691),he=r.n(ae),fe=r(34376);!function(e){e.GITHUB="github"}(de||(de={}));var me=r(59e3);var ve=function(e){var n=e.branch,r=e.fetchBranch,o=e.loading,t=e.remotes,i=e.showError,l=(0,fe.useRouter)(),c=(0,a.useRef)(null),d=(0,a.useState)(null),u=d[0],Z=d[1],C=(0,a.useState)(null),P=C[0],_=C[1],O=(0,a.useState)(null),S=O[0],D=O[1],F=(0,a.useState)(null),E=F[0],H=F[1],N=(0,a.useState)((0,T.U2)(M,"")),q=N[0],z=N[1],K=(0,a.useCallback)((function(e){(0,T.t8)(M,e),z(e)}),[]),X=(0,a.useState)(!1),Y=X[0],J=X[1],$=(0,a.useState)(null),ee=$[0],ne=$[1],re=(0,a.useState)(""),te=re[0],ie=re[1],le=(0,a.useState)(""),ce=le[0],se=le[1],ue=(0,a.useState)(null),ae=ue[0],ve=ue[1];(0,a.useEffect)((function(){var e,r;null!==n&&void 0!==n&&null!==(e=n.sync_config)&&void 0!==e&&e.repo_path&&null===ae&&ve(null===n||void 0===n||null===(r=n.sync_config)||void 0===r?void 0:r.repo_path)}),[n,ae]);var je=(0,a.useMemo)((function(){var e,n;return null===t||void 0===t||null===(e=t.find((function(e){return e.name===q})))||void 0===e||null===(n=e.refs)||void 0===n?void 0:n.map((function(e){var n=e.name.split("/");return{name:n[n.length-1]}}))}),[q,t]),xe=(0,h.Db)(k.ZP.syncs.useCreate(),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(){r(),J(!1)},onErrorCallback:function(e,n){return i({errors:n,response:e})}})}}),be=(0,s.Z)(xe,2),ge=be[0],pe=be[1].isLoading,Ze=(0,h.Db)(k.ZP.git_branches.useUpdate(null===n||void 0===n?void 0:n.name),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.git_branch,o=n.error,t=n.progress;o?(_(o),H(null)):(r(),Z(null),_(null),D(null),H(t))},onErrorCallback:function(e,n){return i({errors:n,response:e})}})}}),we=(0,s.Z)(Ze,2),Ce=we[0],ke=we[1].isLoading,ye=(0,h.Db)(k.ZP.git_branches.useUpdate(null===n||void 0===n?void 0:n.name),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(){r(),ie(""),se("")},onErrorCallback:function(e,n){return i({errors:n,response:e})}})}}),Pe=(0,s.Z)(ye,2),_e=Pe[0],Ie=Pe[1].isLoading,Oe=(0,h.Db)(k.ZP.git_branches.useUpdate(null===n||void 0===n?void 0:n.name),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(){r(),ne(null)},onErrorCallback:function(e,n){ne(null),i({errors:n,response:e})}})}}),Se=(0,s.Z)(Oe,2),Me=Se[0],De=Se[1].isLoading,Be=k.ZP.oauths.detail(de.GITHUB,{redirect_uri:encodeURIComponent(window.location.href)}),Fe=Be.data,Ee=Be.mutate,He=(0,a.useMemo)((function(){return(null===Fe||void 0===Fe?void 0:Fe.oauth)||{}}),[Fe]),Ne=(0,h.Db)(k.ZP.oauths.useCreate(),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(){Ee()},onErrorCallback:function(e,n){i({errors:n,response:e})}})}}),Ue=(0,s.Z)(Ne,2),Ae=Ue[0],Te=Ue[1].isLoading,Re=((0,me.iV)()||{}).access_token;(0,a.useEffect)((function(){!He||null!==He&&void 0!==He&&He.authenticated||!Re||Ae({oauth:{provider:de.GITHUB,token:Re}})}),[Re,Ae,He]);var Ge=(0,a.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e){var n=e.name,r=e.refs,o=e.urls;return(0,G.jsxs)(b.Z,{mt:U.Mq,children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsxs)(v.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,G.jsxs)(oe.Z,{alignItems:"center",children:[(0,G.jsx)(p.ZP,{bold:!0,children:n}),(0,G.jsx)(b.Z,{mx:1,children:(0,G.jsx)(y._Q,{muted:!0})}),null===o||void 0===o?void 0:o.map((function(e){return(0,G.jsx)(b.Z,{mr:1,children:(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:e})},e)}))]}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(f.Z,{compact:!0,disabled:De&&ee!==n,iconOnly:!0,loading:De&&ee===n,noBackground:!0,onClick:function(){"undefined"!==typeof location&&window.confirm("Are you sure you want to remove remote ".concat(n,"?"))&&(ne(n),Me({git_branch:{action_type:"remove_remote",remote:{name:n}}}).then((function(){q===n&&K(null)})))},small:!0,title:"Remote remote ".concat(n),children:(0,G.jsx)(y.rF,{})})]})}),(0,G.jsx)(L.Z,{children:(0,G.jsxs)(V.Z,{noPaddingContent:!0,smallTitle:!0,title:"Refs (".concat(null===r||void 0===r?void 0:r.length,")"),children:[0===(null===r||void 0===r?void 0:r.length)&&(0,G.jsx)(b.Z,{p:U.cd,children:(0,G.jsx)(p.ZP,{muted:!0,children:"This remote has no refs."})}),(null===r||void 0===r?void 0:r.length)>=1&&(0,G.jsx)(Q.Z,{columnFlex:[1,1,1],columns:[{uuid:"Ref"},{uuid:"Author"},{uuid:"Date"},{uuid:"Message"}],rows:r.map((function(e){var n,r=e.commit,o=e.name;return[(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:o},"ref-name"),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:null===r||void 0===r||null===(n=r.author)||void 0===n?void 0:n.name},"author"),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:null===r||void 0===r?void 0:r.date},"date"),(0,G.jsx)(p.ZP,{default:!0,monospace:!0,small:!0,children:null===r||void 0===r?void 0:r.message},"message")]})),uuid:"git-branch-remotes-refs"})]})}),(0,G.jsx)(b.Z,{mt:U.Mq,children:(0,G.jsx)(m.Z,{light:!0})})]},n)}))}),[De,ee,t,Me]);return(0,G.jsxs)(G.Fragment,{children:[Fe&&(0,G.jsxs)(b.Z,{mb:U.HN,children:[(null===He||void 0===He?void 0:He.authenticated)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.fy,{size:2*U.iI}),disabled:!0,children:"Successfully authenticated with GitHub"}),(0,G.jsx)(b.Z,{mt:1,children:(0,G.jsx)(p.ZP,{muted:!0,children:"You can pull, push, and create pull requests on GitHub."})})]}),!(null!==He&&void 0!==He&&He.authenticated)&&(null===He||void 0===He?void 0:He.url)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.fy,{size:2*U.iI}),loading:Te,onClick:function(){return l.push(null===He||void 0===He?void 0:He.url)},primary:!0,children:"Authenticate with GitHub"}),(0,G.jsx)(b.Z,{mt:1,children:(0,G.jsx)(p.ZP,{muted:!0,children:"Authenticating with GitHub will allow you to pull, push, and create pull requests on GitHub."})})]})]}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(j.Z,{children:"Setup"}),(0,G.jsxs)(b.Z,{mt:U.Mq,children:[(0,G.jsxs)(b.Z,{mb:1,children:[(0,G.jsx)(p.ZP,{bold:!0,large:!0,children:"Git init directory"}),(0,G.jsxs)(p.ZP,{muted:!0,children:["If the directory below is blank, then the current working directory will be used to initialize git.",(0,G.jsx)("br",{}),"If git hasn\u2019t been initialized in the directory below, Mage will automatically run git init for you."]})]}),(0,G.jsxs)(v.Z,{alignItems:"center",children:[(0,G.jsx)(w.Z,{disabled:!Y,label:"Git directory",monospace:!0,onChange:function(e){return ve(e.target.value)},ref:c,value:ae||""}),(0,G.jsx)(b.Z,{mr:1}),Y&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(f.Z,{compact:!0,loading:pe,onClick:function(){ge({sync:{repo_path:ae}})},primary:!0,small:!0,children:"Save"}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(W.Z,{onClick:function(){return J(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Cancel"})]}),!Y&&(0,G.jsx)(W.Z,{onClick:function(){J(!0),setTimeout((function(){var e;return null===c||void 0===c||null===(e=c.current)||void 0===e?void 0:e.focus()}),1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Edit"})]})]})]}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsxs)(j.Z,{children:["Remotes",!o&&t?" (".concat(null===t||void 0===t?void 0:t.length,")"):""]}),o&&(0,G.jsx)(b.Z,{mt:U.Mq,children:(0,G.jsx)(g.Z,{inverted:!0})}),!o&&Ge,(0,G.jsx)(b.Z,{mt:U.Mq,children:(0,G.jsxs)(v.Z,{alignItems:"flex-start",children:[(0,G.jsx)(w.Z,{label:"New remote name",monospace:!0,onChange:function(e){var n;return ie(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:te||""}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)(v.Z,{flexDirection:"column",children:[(0,G.jsx)(w.Z,{label:"Remote URL",monospace:!0,onChange:function(e){var n;return se(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:ce||""}),(0,G.jsx)(b.Z,{mt:1,children:(0,G.jsxs)(p.ZP,{muted:!0,small:!0,children:["Use the https URL if you",(0,G.jsx)("br",{}),"authenticated with GitHub above."]})})]}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.mm,{size:2*U.iI}),disabled:!te||!ce,loading:Ie,onClick:function(){_e({git_branch:{action_type:"add_remote",remote:{name:te,url:ce}}})},primary:!0,children:"Create new remote"})]})})]}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(j.Z,{children:"Actions"}),(0,G.jsxs)(b.Z,{mt:U.Mq,children:[(0,G.jsxs)(b.Z,{mb:U.Mq,children:[(0,G.jsx)(b.Z,{mb:1,children:(0,G.jsx)(p.ZP,{bold:!0,muted:!0,children:"Current branch"})}),(null===n||void 0===n?void 0:n.name)&&(0,G.jsxs)(v.Z,{alignItems:"center",children:[(0,G.jsx)(p.ZP,{monospace:!0,children:null===n||void 0===n?void 0:n.name}),(0,G.jsx)(b.Z,{mr:U.cd}),(0,G.jsx)(he(),{href:"/version-control?tab=".concat(B.uuid),passHref:!0,children:(0,G.jsx)(W.Z,{small:!0,children:"Switch branch"})})]})]}),(0,G.jsxs)(v.Z,{children:[(0,G.jsx)(x.Z,{onChange:function(e){return D(e.target.value)},placeholder:"Action",value:S||"",children:(0,G.jsx)("option",{value:I,children:(0,A.vg)(I)})}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsx)(x.Z,{beforeIcon:(0,G.jsx)(y.VW,{}),beforeIconSize:1.5*U.iI,monospace:!0,onChange:function(e){return K(e.target.value)},placeholder:"Remote",value:q||"",children:null===t||void 0===t?void 0:t.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))}),(0,G.jsx)(b.Z,{mr:1}),(0,G.jsxs)(x.Z,{beforeIcon:(0,G.jsx)(y.I0,{}),beforeIconSize:1.5*U.iI,monospace:!0,onChange:function(e){return Z(e.target.value)},value:u||"",children:[(0,G.jsx)("option",{value:"",children:"All branches"}),null===je||void 0===je?void 0:je.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))]})]}),(0,G.jsxs)(b.Z,{mt:U.cd,children:[(0,G.jsx)(f.Z,{beforeIcon:(0,G.jsx)(y.Bf,{size:2*U.iI}),disabled:!S||!q,loading:ke,onClick:function(){H(null),Ce({git_branch:{action_type:S,pull:{branch:u,remote:q}}})},primary:!0,children:S?(0,A.vg)(S):"Execute action"}),(E||P)&&(0,G.jsx)(b.Z,{mt:U.cd,children:(0,G.jsx)(p.ZP,{danger:!!P,default:!!E,monospace:!0,preWrap:!0,children:E||P})})]})]})]}),(0,G.jsxs)(b.Z,{mb:U.HN,children:[(0,G.jsx)(b.Z,{mb:U.HN,children:(0,G.jsx)(m.Z,{light:!0})}),(0,G.jsx)(v.Z,{children:(0,G.jsxs)(f.Z,{afterIcon:(0,G.jsx)(y.Kw,{}),linkProps:{href:"/version-control?tab=".concat(B.uuid)},noHoverUnderline:!0,sameColorAsText:!0,secondary:!0,children:["Next: ",B.uuid]})})]})]})},je=r(2005),xe=te.default.div.withConfig({displayName:"indexstyle__DiffContainerStyle",componentId:"sc-1fo4nus-0"})(["pre{font-family:",";}"],je.Vp),be={codeFoldGutter:{},content:{},contentText:{},diffAdded:{},diffContainer:{},diffRemoved:{},emptyGutter:{},emptyLine:{},gutter:{},highlightedGutter:{},highlightedLine:{},line:{},lineNumber:{},marker:{},splitView:{},titleBlock:{},variables:{dark:{addedBackground:"#044B53",addedColor:"white",addedGutterBackground:"#034148",addedGutterColor:"#8c8c8c",codeFoldBackground:"#262831",codeFoldContentColor:"#555a7b",codeFoldGutterBackground:"#21232b",diffViewerBackground:"#2e303c",diffViewerColor:"#FFF",diffViewerTitleBackground:"#2f323e",diffViewerTitleBorderColor:"#353846",diffViewerTitleColor:"#555a7b",emptyLineBackground:"#363946",gutterBackground:"#2c2f3a",gutterBackgroundDark:"#262933",gutterColor:"#464c67",highlightBackground:"#2a3967",highlightGutterBackground:"#2d4077",removedBackground:"#632F34",removedColor:"white",removedGutterBackground:"#632b30",removedGutterColor:"#8c8c8c",wordAddedBackground:"#055d67",wordRemovedBackground:"#7d383f"},light:{addedBackground:"#e6ffed",addedColor:"#24292e",addedGutterBackground:"#cdffd8",addedGutterColor:"#212529",codeFoldBackground:"#f1f8ff",codeFoldContentColor:"#212529",codeFoldGutterBackground:"#dbedff",diffViewerBackground:"#fff",diffViewerColor:"212529",diffViewerTitleBackground:"#fafbfc",diffViewerTitleBorderColor:"#eee",diffViewerTitleColor:"#212529",emptyLineBackground:"#fafbfc",gutterBackground:"#f7f7f7",gutterBackgroundDark:"#f3f1f1",gutterColor:"#212529",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1",removedBackground:"#ffeef0",removedColor:"#24292e",removedGutterBackground:"#ffdce0",removedGutterColor:"#212529",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0"}},wordAdded:{},wordDiff:{},wordRemoved:{}},ge=r(32821),pe=r(33766),Ze=r(9728);function we(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,o)}return r}function Ce(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?we(Object(r),!0).forEach((function(n){(0,c.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):we(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var ke=function(){var e=(0,a.useRef)(null),n=(0,a.useRef)(null),r=(0,Ze.VI)(null,{},[],{uuid:"VersionControlPage"}),o=(0,s.Z)(r,1)[0],t=(0,a.useState)(null),i=t[0],l=t[1],h=(0,a.useState)(null),f=h[0],v=h[1],j=(0,a.useState)(N[0]),Z=j[0],w=j[1],y=(0,me.iV)();(0,a.useEffect)((function(){null!==y&&void 0!==y&&y.tab&&w(N.find((function(e){return e.uuid===(null===y||void 0===y?void 0:y.tab)})))}),[y]);var P=k.ZP.git_branches.list({include_remote_branches:1}),_=P.data,I=P.mutate,O=(0,a.useMemo)((function(){return null===_||void 0===_?void 0:_.git_branches}),[_]),S=k.ZP.git_branches.detail("current"),M=S.data,D=S.mutate,A=(0,a.useMemo)((function(){return(null===M||void 0===M?void 0:M.git_branch)||{}}),[M]),T=(0,a.useMemo)((function(){return(null===A||void 0===A?void 0:A.files)||[]}),[A]),R=k.ZP.git_branches.detail("with_remotes",{_format:"with_remotes"}),L=R.data,V=R.mutate,W=(0,a.useMemo)((function(){return null===L||void 0===L?void 0:L.git_branch}),[L]),Q=(0,a.useMemo)((function(){return(null===W||void 0===W?void 0:W.remotes)||[]}),[W]),K=k.ZP.git_files.detail(f?encodeURIComponent(f):null,{base_branch:i}),X=K.data,Y=K.mutate,J=(0,a.useMemo)((function(){return null===X||void 0===X?void 0:X.git_file}),[X]);(0,a.useEffect)((function(){i&&Y()}),[i,Y]),(0,a.useEffect)((function(){null!==X&&void 0!==X&&X.error&&o({errors:null===X||void 0===X?void 0:X.error,response:X})}),[X,o]);var re=(0,a.useMemo)((function(){var e,n,r;return{modifiedFiles:null===A||void 0===A||null===(e=A.modified_files)||void 0===e?void 0:e.reduce((function(e,n){return Ce(Ce({},e),{},(0,c.Z)({},n,!0))}),{}),stagedFiles:null===A||void 0===A||null===(n=A.staged_files)||void 0===n?void 0:n.reduce((function(e,n){return Ce(Ce({},e),{},(0,c.Z)({},n,!0))}),{}),untrackedFiles:null===A||void 0===A||null===(r=A.untracked_files)||void 0===r?void 0:r.reduce((function(e,n){return Ce(Ce({},e),{},(0,c.Z)({},n,!0))}),{})}}),[A]),oe=re.modifiedFiles,te=void 0===oe?{}:oe,ie=re.stagedFiles,ce=void 0===ie?{}:ie,se=re.untrackedFiles,de=void 0===se?{}:se;(0,a.useEffect)((function(){f&&(0,le.Qr)(te)&&(0,le.Qr)(ce)&&(0,le.Qr)(de)&&v(null)}),[te,f,ce,de]);var ae=(0,a.useMemo)((function(){return(null===T||void 0===T?void 0:T.length)>=1?(0,G.jsx)(ne.Z,{allowEmptyFolders:!0,disableContextMenu:!0,fetchFileTree:D,files:T,isFileDisabled:function(){return!1},onClickFile:function(e){v((function(r){if(!r||r!==e){var o;if(!i)null===n||void 0===n||null===(o=n.current)||void 0===o||o.focus();return e}return null}))},ref:e,renderAfterContent:function(e){var n,r,o=e.children,t=(null===o||void 0===o?void 0:o.length)>=1,i=(0,ge.a9)(e);t&&(i="".concat(i,"/"));var l={};return null!==te&&void 0!==te&&te[i]?(n="M",r="Modified",l.warning=!0):null!==de&&void 0!==de&&de[i]?(n="U",r="Untracked",l.danger=!0):null!==ce&&void 0!==ce&&ce[i]&&(n="S",r="Staged",l.success=!0),t&&!n?null:(0,G.jsx)(b.Z,{mx:1,children:(0,G.jsx)(C.Z,{appearBefore:!0,label:r,widthFitContent:!0,children:(0,G.jsx)(p.ZP,Ce(Ce({},l),{},{monospace:!0,rightAligned:!0,small:!0,children:n}))})})},useRootFolder:!0}):(0,G.jsx)(b.Z,{p:U.cd,children:(0,G.jsx)(p.ZP,{monospace:!0,muted:!0,children:"No files modified"})})}),[i,D,e,T,te,n,v,ce,de]),he=(0,a.useMemo)((function(){return!X||!J||f&&(null===J||void 0===J?void 0:J.filename)!==f}),[X,J,f]),fe=(0,a.useMemo)((function(){if(!f)return null;var e=J||{},n=e.content,r=e.content_from_base;return(0,G.jsxs)(xe,{children:[!i&&(0,G.jsx)(b.Z,{p:U.cd,children:(0,G.jsx)(p.ZP,{muted:!0,children:"Please select a base branch to see the file diffs."})}),(null===J||void 0===J?void 0:J.error)&&(0,G.jsx)(b.Z,{p:U.cd,children:(0,G.jsx)(p.ZP,{danger:!0,monospace:!0,preWrap:!0,children:null===J||void 0===J?void 0:J.error})}),i&&!(null!==J&&void 0!==J&&J.error)&&(0,G.jsxs)(G.Fragment,{children:[he&&(0,G.jsx)(b.Z,{p:U.cd,children:(0,G.jsx)(g.Z,{inverted:!0})}),!he&&(0,G.jsx)(u(),{compareMethod:d.DiffMethod.WORDS,newValue:n||"",oldValue:r||"",renderContent:function(e){return(0,G.jsx)(p.ZP,{monospace:!0,children:e})},splitView:!0,styles:be,useDarkTheme:!0})]})]})}),[i,J,he,f]),je=(0,a.useMemo)((function(){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("div",{style:{marginBottom:.5*U.iI,marginTop:.5*U.iI},children:(0,G.jsx)(z.Z,{compact:!0,onClickTab:function(e){var n=e.uuid;(0,pe.u7)({tab:n})},selectedTabUUID:null===Z||void 0===Z?void 0:Z.uuid,tabs:N})}),(0,G.jsx)(m.Z,{light:!0})]})}),[Z]),we=(0,a.useMemo)((function(){return(0,G.jsx)(ve,{branch:A,fetchBranch:V,loading:!L,remotes:Q,showError:o})}),[A,L,V,Q,o]),ke=(0,a.useMemo)((function(){return(0,G.jsx)(q,{branch:A,branches:O,fetchBranch:D,fetchBranches:I,remotes:Q,showError:o})}),[A,O,D,I,Q,o]),ye=(0,a.useMemo)((function(){return(0,G.jsx)(ue,{branch:A,fetchBranch:D,modifiedFiles:te,setSelectedFilePath:v,showError:o,stagedFiles:ce,untrackedFiles:de})}),[A,D,te,v,o,ce,de]),Pe=(0,a.useMemo)((function(){return(0,G.jsx)($,{branch:A,branches:O,fetchBranch:D,loading:!L,modifiedFiles:te,remotes:Q,showError:o,stagedFiles:ce})}),[A,O,L,D,te,Q,o,ce]);return(0,G.jsx)(ee.Z,{after:fe,afterHidden:!f,afterWidth:40*U.iI,before:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(b.Z,{p:1,children:(0,G.jsx)(x.Z,{compact:!0,label:"Base branch",onChange:function(e){return l(e.target.value)},ref:n,small:!0,value:i||"",children:null===O||void 0===O?void 0:O.map((function(e){var n=e.name;return(0,G.jsx)("option",{value:n,children:n},n)}))})}),ae]}),mainContainerHeader:je,title:"Version control",uuid:"Version control/index",children:(0,G.jsxs)(b.Z,{p:U.cd,children:[!M&&(0,G.jsx)(g.Z,{inverted:!0}),M&&(0,G.jsxs)(G.Fragment,{children:[H.uuid===(null===Z||void 0===Z?void 0:Z.uuid)&&we,B.uuid===(null===Z||void 0===Z?void 0:Z.uuid)&&ke,F.uuid===(null===Z||void 0===Z?void 0:Z.uuid)&&ye,E.uuid===(null===Z||void 0===Z?void 0:Z.uuid)&&Pe]})]})})};function ye(){return(0,G.jsx)(ke,{})}ye.getInitialProps=(0,o.Z)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var Pe=(0,l.Z)(ye)},75302:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/version-control",function(){return r(83243)}])}},function(e){e.O(0,[844,7607,7011,4407,1424,1005,7815,6694,551,9774,2888,179],(function(){return n=75302,e(e.s=n);var n}));var n=e.O();_N_E=n}]);