"use strict";(self.webpackChunkgennaker_tools=self.webpackChunkgennaker_tools||[]).push([[509],{509:(e,t,a)=>{a.r(t),a.d(t,{default:()=>b,reloadPlugin:()=>u,snippetsPlugin:()=>d,statelessRunPlugin:()=>p});var n,o=a(389),r=a(827),s=a(591),l=a(460),i=a(505);!function(e){e.restartRunStateless="gennaker-tools:restart-run-stateless",e.resetJupyterLab="gennaker-tools:reset-jupyterlab"}(n||(n={}));const p={id:"gennaker-tools:stateless-run",description:"A JupyterLab extension.",autoStart:!0,requires:[r.ICommandPalette,o.INotebookTracker],optional:[s.ITranslator],activate:(e,t,a,o)=>{const r=(null!=o?o:s.nullTranslator).load("jupyterlab"),{commands:l,shell:i}=e;console.log("JupyterLab plugin gennaker-tools:stateless-run is activated!"),l.addCommand(n.restartRunStateless,{label:"Restart Kernel, Clear Outputs, and Run All Above Selected Cell",caption:"Clear all outputs, restart kernel, and run all cells above the selected cell",isEnabled:()=>null!==a.currentWidget&&a.currentWidget===i.currentWidget,execute:async e=>{const t=e.origin;console.log(`${n.restartRunStateless} has been called from... ${t}.`),"init"!==t&&await l.execute("apputils:run-all-enabled",{commands:["notebook:clear-all-cell-outputs","notebook:restart-and-run-to-selected"]})}});const p=r.__("Notebook Operations");t.addItem({command:n.restartRunStateless,category:p,args:{origin:"from palette"}})}},u={id:"gennaker-tools:reload",description:"A JupyterLab extension.",autoStart:!0,requires:[r.ICommandPalette],optional:[s.ITranslator],activate:(e,t,a)=>{console.log("JupyterLab plugin gennaker-tools:reload is activated!");const{commands:o}=e,r=(null!=a?a:s.nullTranslator).load("jupyterlab");o.addCommand(n.resetJupyterLab,{label:"Reset JupyterLab",caption:"Reset JupyterLab",isEnabled:()=>!0,execute:e=>{"init"!==e.origin&&window.location.reload()}});const l=r.__("Reset");t.addItem({command:n.resetJupyterLab,category:l,args:{origin:"from palette"}})}},c={properties:{snippets:{type:"array",title:"Codemirror snippets",description:"Snippets of the form accepted by Codemirrors snippetCompletion",items:{type:"object",properties:{type:{type:"string",enum:["class","constant","enum","function","interface","keyword","method","namespace","property","text","type","variable"]},body:{type:"string"},label:{type:"string"}},required:["type","body","label"]}}},additionalProperties:!1,type:"object"},d={id:"gennaker-tools:snippets",description:"A JupyterLab extension.",autoStart:!0,requires:[l.IEditorExtensionRegistry],optional:[],activate:(e,t)=>{console.log("JupyterLab plugin gennaker-tools:snippets is activated!"),t.addExtension(Object.freeze({name:"gennaker-tools:snippets",factory:()=>l.EditorExtensionRegistry.createConfigurableExtension(e=>(0,i.autocompletion)({override:[(0,i.completeFromList)(e.snippets.map(e=>{const{body:t,...a}=e;return(0,i.snippetCompletion)(t,a)}))]})),default:{snippets:[]},schema:c}))}},b=[p,u,d]}}]);