(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4841],{1210:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(82394),i=n(21831),o=n(82684),u=n(47999),s=n(49894),l=n(93461),c=n(57384),a=n(12344),f=n(72454),d=n(28598);function h(e,t){var n=e.children;return(0,d.jsx)(f.HS,{ref:t,children:n})}var v=o.forwardRef(h),p=n(32063),b=n(15270),j=n(82531),O=n(66166),m=n(3055),w=n(49125),g=n(91427),_=n(24141);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=function(e){var t,n=e.after,r=e.afterHidden,h=e.afterWidth,k=e.afterWidthOverride,x=e.before,y=e.beforeWidth,P=e.breadcrumbs,M=e.children,E=e.errors,C=e.headerMenuItems,S=e.navigationItems,A=e.setErrors,D=e.subheaderChildren,I=e.title,N=e.uuid,W=(0,_.i)().width,H="dashboard_after_width_".concat(N),R="dashboard_before_width_".concat(N),T=(0,o.useRef)(null),B=(0,o.useState)(k?h:(0,g.U2)(H,h)),U=B[0],q=B[1],z=(0,o.useState)(!1),F=z[0],X=z[1],K=(0,o.useState)(x?Math.max((0,g.U2)(R,y),13*w.iI):null),L=K[0],Y=K[1],G=(0,o.useState)(!1),J=G[0],Q=G[1],V=(0,o.useState)(null)[1],$=j.ZP.projects.list({},{revalidateOnFocus:!1}).data,ee=null===$||void 0===$?void 0:$.projects,te=[];P?te.push.apply(te,(0,i.Z)(P)):(null===ee||void 0===ee?void 0:ee.length)>=1&&te.push.apply(te,[{label:function(){var e;return null===(e=ee[0])||void 0===e?void 0:e.name},linkProps:{href:"/"}},{bold:!0,label:function(){return I}}]),(0,o.useEffect)((function(){null===T||void 0===T||!T.current||F||J||null===V||void 0===V||V(T.current.getBoundingClientRect().width)}),[F,U,J,L,T,V,W]),(0,o.useEffect)((function(){F||(0,g.t8)(H,U)}),[r,F,U,H]),(0,o.useEffect)((function(){J||(0,g.t8)(R,L)}),[J,L,R]);var ne=(0,O.Z)(h);return(0,o.useEffect)((function(){k&&ne!==h&&q(h)}),[k,h,ne]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(c.Z,{title:I}),(0,d.jsx)(a.Z,{breadcrumbs:te,menuItems:C,project:null===ee||void 0===ee?void 0:ee[0],version:null===ee||void 0===ee||null===(t=ee[0])||void 0===t?void 0:t.version}),(0,d.jsxs)(f.Nk,{children:[0!==(null===S||void 0===S?void 0:S.length)&&(0,d.jsx)(f.lm,{children:(0,d.jsx)(b.Z,{navigationItems:S})}),(0,d.jsx)(l.Z,{flex:1,flexDirection:"column",children:(0,d.jsxs)(p.Z,{after:n,afterHeightOffset:m.Mz,afterHidden:r,afterMousedownActive:F,afterWidth:U,before:x,beforeHeightOffset:m.Mz,beforeMousedownActive:J,beforeWidth:f.k1+(x?L:0),hideAfterCompletely:!0,leftOffset:x?f.k1:null,mainContainerRef:T,setAfterMousedownActive:X,setAfterWidth:q,setBeforeMousedownActive:Q,setBeforeWidth:Y,children:[D&&(0,d.jsx)(v,{children:D}),M]})})]}),E&&(0,d.jsx)(u.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===A||void 0===A?void 0:A(null)},children:(0,d.jsx)(s.Z,Z(Z({},E),{},{onClose:function(){return null===A||void 0===A?void 0:A(null)}}))})]})}},72433:function(e,t,n){"use strict";n.r(t);var r=n(77837),i=n(75582),o=n(38860),u=n.n(o),s=n(82684),l=n(56085),c=n(83455),a=n(35490),f=n(1210),d=n(41788),h=n(33699),v=n(82531),p=n(94353),b=n(98781),j=n(28799),O=n(96510),m=n(28598);function w(){var e=(0,c.Db)(v.ZP.kernels.useUpdate(b.a_[b.qL.PYTHON]),{onSuccess:function(e){return(0,O.wD)(e,{onErrorCallback:function(e,t){console.log(e),alert(t)}})}}),t=(0,i.Z)(e,1)[0],n=(0,s.useCallback)((function(){return t({kernel:{action_type:"interrupt"}})}),[t]),r=(0,s.useMemo)((function(){return new a.Z}),[]),o=(0,s.useMemo)((function(){return{api_key:p.l,token:r.decodedToken.token}}),[r]),u=(0,l.ZP)((0,j.Ib)("terminal"),{shouldReconnect:function(){return!0},queryParams:o}),d=u.lastMessage,w=u.sendMessage;return(0,m.jsx)(f.Z,{title:"Terminal",uuid:"terminal/index",children:(0,m.jsx)(h.Z,{interruptKernel:n,lastMessage:d,sendMessage:w})})}w.getInitialProps=(0,r.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)}))),t.default=(0,d.Z)(w)},27271:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/terminal",function(){return n(72433)}])}},function(e){e.O(0,[3850,9565,6085,2344,9386,5141,9774,2888,179],(function(){return t=27271,e(e.s=t);var t}));var t=e.O();_N_E=t}]);