(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[9853,3844],{23844:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>b});var a=n(12908),s=n(56901),o=n(56123),r=n(22645),l=n(51507),i=n(20850),c=n(12221),d=n(39462),u=n(36735);const p="jp-RetroKernelStatus-error",C="jp-RetroKernelStatus-warn",h="jp-RetroKernelStatus-info",k="jp-RetroKernelStatus-fade",g={id:"@retrolab/application-extension:checkpoints",autoStart:!0,requires:[r.IDocumentManager,i.ITranslator],optional:[c.IRetroShell],activate:(e,t,n,a)=>{const{shell:r}=e,l=n.load("retrolab"),i=new u.Widget;i.id=s.DOMUtils.createDomID(),i.addClass("jp-RetroCheckpoint"),e.shell.add(i,"top",{rank:100});const c=async()=>{const e=r.currentWidget;if(!e)return;const n=t.contextForWidget(e);null==n||n.fileChanged.disconnect(c),null==n||n.fileChanged.connect(c);const a=await(null==n?void 0:n.listCheckpoints());if(!a)return;const s=a[a.length-1];i.node.textContent=l.__("Last Checkpoint: %1",o.Time.formatHuman(new Date(s.last_modified)))};a&&a.currentChanged.connect(c),new d.Poll({auto:!0,factory:()=>c(),frequency:{interval:2e3,backoff:!1},standby:"when-hidden"})}},f={id:"@retrolab/application-extension:kernel-logo",autoStart:!0,requires:[c.IRetroShell],activate:(e,t)=>{const{serviceManager:n}=e,a=o.PageConfig.getBaseUrl();let s;const r=async()=>{var o,i,c,d,p;s&&(s.dispose(),s.parent=null);const C=t.currentWidget;if(!(C instanceof l.NotebookPanel))return;await C.sessionContext.ready,C.sessionContext.kernelChanged.disconnect(r),C.sessionContext.kernelChanged.connect(r);const h=null!==(c=null===(i=null===(o=C.sessionContext.session)||void 0===o?void 0:o.kernel)||void 0===i?void 0:i.name)&&void 0!==c?c:"",k=null===(p=null===(d=n.kernelspecs)||void 0===d?void 0:d.specs)||void 0===p?void 0:p.kernelspecs[h];if(!k)return;let g=k.resources["logo-64x64"];if(!g)return;const f=g.indexOf("kernelspecs");g=a+g.slice(f);const v=document.createElement("div"),m=document.createElement("img");m.src=g,m.title=k.display_name,v.appendChild(m),s=new u.Widget({node:v}),s.addClass("jp-RetroKernelLogo"),e.shell.add(s,"top",{rank:10010})};e.started.then((()=>{t.currentChanged.connect(r)}))}},v={id:"@retrolab/application-extension:kernel-status",autoStart:!0,requires:[c.IRetroShell],activate:(e,t)=>{const n=new u.Widget;n.addClass("jp-RetroKernelStatus"),e.shell.add(n,"menu",{rank:10010});const a=e=>{const t=e.kernelDisplayStatus;let a=`Kernel ${o.Text.titleCase(t)}`;switch(n.removeClass(p),n.removeClass(C),n.removeClass(h),n.removeClass(k),t){case"busy":case"idle":a="",n.addClass(k);break;case"dead":case"terminating":n.addClass(p);break;case"unknown":n.addClass(C);break;default:n.addClass(h),n.addClass(k)}n.node.textContent=a};t.currentChanged.connect((async()=>{const e=t.currentWidget;e instanceof l.NotebookPanel&&e.sessionContext.statusChanged.connect(a)}))}},m={id:"@retrolab/application-extension:paths",activate:e=>{if(!(e instanceof c.RetroApp))throw new Error(`${m.id} must be activated in RetroLab.`);return e.paths},autoStart:!0,provides:a.JupyterFrontEnd.IPaths},b=[g,f,v]}}]);