(self.webpackChunk_retrolab_lab_extension=self.webpackChunk_retrolab_lab_extension||[]).push([[568],{568:(e,o,a)=>{"use strict";a.r(o),a.d(o,{default:()=>p});var t,n=a(631),r=a(727),l=a(218),c=a(243),d=a(426),i=a(492),b=a(12),m=a(356),u=a(295);!function(e){e.launchRetroTree="retrolab:launch-tree",e.openRetro="retrolab:open-retro",e.openClassic="retrolab:open-classic",e.openLab="retrolab:open-lab"}(t||(t={}));const s={id:"@retrolab/lab-extension:interface-switcher",autoStart:!0,requires:[i.ITranslator],optional:[d.INotebookTracker,r.ICommandPalette,c.IMainMenu,m.IRetroShell,n.ILabShell],activate:(e,o,a,t,n,c,d)=>{if(!a)return;const{commands:i,shell:m}=e,s=l.PageConfig.getBaseUrl(),p=o.load("retrolab"),h=()=>null!==a.currentWidget&&a.currentWidget===m.currentWidget,L=e=>{const{command:o,icon:l,buttonLabel:c,commandLabel:d,urlPrefix:b}=e;i.addCommand(o,{label:e=>e.noLabel?"":d,caption:d,icon:l,execute:()=>{const e=a.currentWidget;e&&window.open(`${b}${e.context.path}`)},isEnabled:h}),t&&t.addItem({command:o,category:"Other"}),n&&n.viewMenu.addGroup([{command:o}],1),a.widgetAdded.connect((async(e,a)=>{a.toolbar.insertBefore("kernelName",c,new r.CommandToolbarButton({commands:i,id:o,args:{noLabel:1}})),await a.context.ready,i.notifyCommandChanged()}))};L({command:"retrolab:open-classic",commandLabel:p.__("Open With %1","Classic Notebook"),buttonLabel:"openClassic",icon:b.jupyterIcon,urlPrefix:`${s}tree/`}),c||L({command:"retrolab:open-retro",commandLabel:p.__("Open With %1","RetroLab"),buttonLabel:"openRetro",icon:u.retroSunIcon,urlPrefix:`${s}retro/tree/`}),d||L({command:"retrolab:open-lab",commandLabel:p.__("Open With %1","JupyterLab"),buttonLabel:"openLab",icon:b.jupyterFaviconIcon,urlPrefix:`${s}doc/tree/`})}},p=[{id:"@retrolab/lab-extension:launch-retrotree",autoStart:!0,requires:[i.ITranslator],optional:[c.IMainMenu,r.ICommandPalette],activate:(e,o,a,n)=>{const{commands:r}=e,c=o.load("retrolab"),d=c.__("Help");r.addCommand(t.launchRetroTree,{label:c.__("Launch RetroLab File Browser"),execute:()=>{window.open(l.PageConfig.getBaseUrl()+"retro/tree")}}),a&&a.helpMenu.addGroup([{command:t.launchRetroTree}],1),n&&n.addItem({command:t.launchRetroTree,category:d})}},s]}}]);