notebook 7.1.2__py3-none-any.whl → 7.2.0__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 notebook might be problematic. Click here for more details.
- notebook/_version.py +1 -1
- notebook/static/113.bundle.js +1 -0
- notebook/static/1198.bundle.js +1 -1
- notebook/static/131.bundle.js +1 -1
- notebook/static/134.bundle.js +1 -1
- notebook/static/1408.bundle.js +1 -1
- notebook/static/1496.bundle.js +1 -1
- notebook/static/1584.bundle.js +1 -1
- notebook/static/1647.bundle.js +1 -1
- notebook/static/1650.bundle.js +1 -1
- notebook/static/1684.bundle.js +1 -1
- notebook/static/1809.bundle.js +1 -1
- notebook/static/1827.bundle.js +1 -1
- notebook/static/1828.bundle.js +1 -0
- notebook/static/1833.bundle.js +1 -1
- notebook/static/1846.bundle.js +1 -1
- notebook/static/1884.bundle.js +386 -0
- notebook/static/1958.bundle.js +1 -1
- notebook/static/1962.bundle.js +1 -0
- notebook/static/2007.bundle.js +1 -1
- notebook/static/2088.bundle.js +1 -1
- notebook/static/2089.bundle.js +1 -1
- notebook/static/2122.bundle.js +1 -1
- notebook/static/2167.bundle.js +1 -1
- notebook/static/2184.bundle.js +1 -1
- notebook/static/2311.bundle.js +1 -1
- notebook/static/2323.bundle.js +1 -1
- notebook/static/2401.bundle.js +1 -1
- notebook/static/2479.bundle.js +1 -1
- notebook/static/2489.bundle.js +1 -1
- notebook/static/2552.bundle.js +1 -1
- notebook/static/2607.bundle.js +1 -1
- notebook/static/2615.bundle.js +1 -1
- notebook/static/2636.bundle.js +1 -0
- notebook/static/2866.bundle.js +1 -1
- notebook/static/2924.bundle.js +1 -1
- notebook/static/2944.bundle.js +1 -1
- notebook/static/2955.bundle.js +1 -1
- notebook/static/3129.bundle.js +1 -1
- notebook/static/3146.bundle.js +1 -1
- notebook/static/3154.bundle.js +1 -1
- notebook/static/3187.bundle.js +1 -1
- notebook/static/3213.bundle.js +1 -1
- notebook/static/3301.bundle.js +1 -1
- notebook/static/3340.bundle.js +1 -1
- notebook/static/3360.bundle.js +1 -1
- notebook/static/3462.bundle.js +1 -0
- notebook/static/3466.bundle.js +1 -1
- notebook/static/3512.bundle.js +1 -1
- notebook/static/3676.bundle.js +1 -1
- notebook/static/3680.bundle.js +1 -1
- notebook/static/374.bundle.js +1 -0
- notebook/static/3768.bundle.js +1 -1
- notebook/static/377.bundle.js +1 -1
- notebook/static/3797.bundle.js +1 -1
- notebook/static/3863.bundle.js +1 -1
- notebook/static/3881.bundle.js +1 -1
- notebook/static/4042.bundle.js +1 -1
- notebook/static/4058.bundle.js +1 -1
- notebook/static/4212.bundle.js +1 -1
- notebook/static/4382.bundle.js +1 -1
- notebook/static/4430.bundle.js +1 -0
- notebook/static/4588.bundle.js +1 -1
- notebook/static/4630.bundle.js +1 -1
- notebook/static/4645.bundle.js +1 -1
- notebook/static/4670.bundle.js +1 -1
- notebook/static/4708.bundle.js +1 -0
- notebook/static/4810.bundle.js +1 -1
- notebook/static/4811.bundle.js +1 -1
- notebook/static/4837.bundle.js +1 -1
- notebook/static/5099.bundle.js +1 -1
- notebook/static/5135.bundle.js +1 -1
- notebook/static/5166.bundle.js +1 -0
- notebook/static/5254.bundle.js +1 -0
- notebook/static/5261.bundle.js +1 -1
- notebook/static/5263.bundle.js +1 -1
- notebook/static/5313.bundle.js +1 -1
- notebook/static/5325.bundle.js +1 -1
- notebook/static/5346.bundle.js +1 -1
- notebook/static/5425.bundle.js +1 -1
- notebook/static/5426.bundle.js +1 -1
- notebook/static/545.bundle.js +1 -0
- notebook/static/5573.bundle.js +1 -1
- notebook/static/5601.bundle.js +1 -1
- notebook/static/5649.bundle.js +3 -3
- notebook/static/5733.bundle.js +1 -1
- notebook/static/5828.bundle.js +1 -1
- notebook/static/5850.bundle.js +1 -1
- notebook/static/5912.bundle.js +1 -1
- notebook/static/5921.bundle.js +1 -1
- notebook/static/6017.bundle.js +1 -1
- notebook/static/6061.bundle.js +1 -1
- notebook/static/{1053.bundle.js → 6078.bundle.js} +1 -1
- notebook/static/6139.bundle.js +1 -1
- notebook/static/62.bundle.js +1 -1
- notebook/static/6271.bundle.js +1 -1
- notebook/static/6281.bundle.js +1 -1
- notebook/static/6345.bundle.js +1 -1
- notebook/static/6417.bundle.js +1 -1
- notebook/static/6521.bundle.js +1 -0
- notebook/static/6604.bundle.js +1 -1
- notebook/static/6621.bundle.js +1 -1
- notebook/static/6627.bundle.js +1 -1
- notebook/static/6731.bundle.js +1 -1
- notebook/static/6748.bundle.js +1 -0
- notebook/static/6815.bundle.js +1 -1
- notebook/static/6853.bundle.js +1 -0
- notebook/static/6893.bundle.js +1 -1
- notebook/static/690.bundle.js +1 -1
- notebook/static/6962.bundle.js +1 -1
- notebook/static/6972.bundle.js +1 -1
- notebook/static/6999.bundle.js +1 -1
- notebook/static/7153.bundle.js +1 -1
- notebook/static/7226.bundle.js +1 -1
- notebook/static/7252.bundle.js +1 -1
- notebook/static/7302.bundle.js +1 -1
- notebook/static/7386.bundle.js +1 -1
- notebook/static/7391.bundle.js +1 -1
- notebook/static/7450.bundle.js +1 -1
- notebook/static/7506.bundle.js +703 -0
- notebook/static/7543.bundle.js +1 -0
- notebook/static/755.bundle.js +1 -1
- notebook/static/7603.bundle.js +1 -1
- notebook/static/7639.bundle.js +1 -1
- notebook/static/7655.bundle.js +1 -0
- notebook/static/7674.bundle.js +1 -1
- notebook/static/7684.bundle.js +1 -1
- notebook/static/7812.bundle.js +1 -1
- notebook/static/7819.bundle.js +1 -1
- notebook/static/7854.bundle.js +1 -0
- notebook/static/7866.bundle.js +1 -1
- notebook/static/7884.bundle.js +1 -0
- notebook/static/7900.bundle.js +1 -1
- notebook/static/7906.bundle.js +1 -1
- notebook/static/7995.bundle.js +1 -1
- notebook/static/7997.bundle.js +1 -1
- notebook/static/8010.bundle.js +1 -1
- notebook/static/8032.bundle.js +1 -1
- notebook/static/8471.bundle.js +1 -0
- notebook/static/8579.bundle.js +1 -1
- notebook/static/8633.bundle.js +1 -1
- notebook/static/8771.bundle.js +1 -1
- notebook/static/8781.bundle.js +1 -1
- notebook/static/8845.bundle.js +1 -1
- notebook/static/8875.bundle.js +1 -1
- notebook/static/8907.bundle.js +1 -1
- notebook/static/8928.bundle.js +1 -1
- notebook/static/8929.bundle.js +1 -1
- notebook/static/893.bundle.js +1 -1
- notebook/static/901.bundle.js +1 -1
- notebook/static/9068.bundle.js +1 -1
- notebook/static/911.bundle.js +1 -1
- notebook/static/9136.bundle.js +1 -0
- notebook/static/9151.bundle.js +1 -1
- notebook/static/9161.bundle.js +1 -1
- notebook/static/9239.bundle.js +1 -1
- notebook/static/9268.bundle.js +1 -1
- notebook/static/9335.bundle.js +1 -1
- notebook/static/9341.bundle.js +1 -1
- notebook/static/9380.bundle.js +1 -1
- notebook/static/9605.bundle.js +1 -1
- notebook/static/9638.bundle.js +1 -1
- notebook/static/9680.bundle.js +1 -1
- notebook/static/9685.bundle.js +1 -1
- notebook/static/9752.bundle.js +1 -1
- notebook/static/9799.bundle.js +1 -1
- notebook/static/9821.bundle.js +1 -1
- notebook/static/9852.bundle.js +1 -1
- notebook/static/bundle.js +1 -1
- notebook/static/third-party-licenses.json +173 -161
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +15 -15
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +10 -10
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +17 -17
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +12 -12
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +11 -11
- notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/246.7bfc2ac5bb3d27d6e0b9.js → notebook-7.2.0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/302.8a8d0af0376cb309e580.js +1 -1
- notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.6e8d43b976f4be45b3d2.js → notebook-7.2.0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.aff74c88f76bc9000e65.js +1 -1
- notebook-7.2.0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.76f40c4b4ee1c8583ca3.js +1 -0
- notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.832d780237fca436ff92.js → notebook-7.2.0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.eced2d228ddfce366f36.js +1 -1
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
- {notebook-7.1.2.dist-info → notebook-7.2.0.dist-info}/METADATA +5 -5
- {notebook-7.1.2.dist-info → notebook-7.2.0.dist-info}/RECORD +208 -206
- {notebook-7.1.2.dist-info → notebook-7.2.0.dist-info}/WHEEL +1 -1
- notebook/static/1337.bundle.js +0 -1
- notebook/static/1664.bundle.js +0 -743
- notebook/static/1682.bundle.js +0 -1
- notebook/static/1835.bundle.js +0 -1
- notebook/static/1950.bundle.js +0 -1
- notebook/static/2067.bundle.js +0 -1
- notebook/static/2094.bundle.js +0 -1
- notebook/static/2512.bundle.js +0 -1
- notebook/static/2577.bundle.js +0 -1
- notebook/static/2758.bundle.js +0 -1
- notebook/static/3654.bundle.js +0 -1
- notebook/static/4558.bundle.js +0 -1
- notebook/static/4928.bundle.js +0 -1
- notebook/static/4997.bundle.js +0 -1
- notebook/static/5088.bundle.js +0 -1
- notebook/static/514.bundle.js +0 -1
- notebook/static/6256.bundle.js +0 -1
- notebook/static/6467.bundle.js +0 -1
- notebook/static/7394.bundle.js +0 -1
- notebook/static/853.bundle.js +0 -1
- notebook-7.1.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.65b9457e7bb7d428c0a7.js +0 -1
- /notebook/static/{1664.bundle.js.LICENSE.txt → 7506.bundle.js.LICENSE.txt} +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/applications/jupyter-notebook.desktop +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
- {notebook-7.1.2.data → notebook-7.2.0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
- {notebook-7.1.2.dist-info → notebook-7.2.0.dist-info}/entry_points.txt +0 -0
- {notebook-7.1.2.dist-info → notebook-7.2.0.dist-info}/licenses/LICENSE +0 -0
notebook/static/1682.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1682,5135],{21682:(n,e,t)=>{t.r(e),t.d(e,{CommandIDs:()=>h,default:()=>p});var s=t(3053),o=t(13589),i=t(71677),l=t(68239),a=t(38639),r=t(97934),d=t(81997);const c="jp-mod-kernel";var u;!function(n){n.RunningKernel=class{constructor(n){this.className=c,this.commands=n.commands,this.kernel=n.kernel,this.context=this.kernel.id,this.kernels=n.kernels,this.sessions=n.sessions,this.spec=n.spec||null,this.trans=n.trans}get children(){var n;const e=[],t=h.kernelOpenSession,{commands:s}=this;for(const o of this.sessions.running())if(this.kernel.id===(null===(n=o.kernel)||void 0===n?void 0:n.id)){const{name:n,path:i,type:a}=o;e.push({className:c,context:this.kernel.id,open:()=>{s.execute(t,{name:n,path:i,type:a})},icon:()=>"console"===a?l.consoleIcon:"notebook"===a?l.notebookIcon:l.jupyterIcon,label:()=>n,labelTitle:()=>i})}return e}shutdown(){return this.kernels.shutdown(this.kernel.id)}icon(){const{spec:n}=this;return n&&n.resources?n.resources["logo-svg"]||n.resources["logo-64x64"]||n.resources["logo-32x32"]:l.jupyterIcon}label(){const{kernel:n,spec:e}=this;return(null==e?void 0:e.display_name)||n.name}labelTitle(){var n;const{trans:e}=this,{id:t}=this.kernel,s=[`${this.label()}: ${t}`];for(const t of this.sessions.running())if(this.kernel.id===(null===(n=t.kernel)||void 0===n?void 0:n.id)){const{path:n,type:o}=t;s.push(e.__("%1\nPath: %2",o,n))}return s.join("\n\n")}},n.runningChanged=new d.Signal({})}(u||(u={}));var h,g=t(35312);class m{constructor(n){this._tabsChanged=new d.Signal(this),this._widgets=[],this._labShell=n,this._labShell.layoutModified.connect(this._emitTabsChanged,this)}get tabsChanged(){return this._tabsChanged}addWidget(n){n.title.changed.connect(this._emitTabsChanged,this),this._widgets.push(n)}_emitTabsChanged(){this._widgets.forEach((n=>{n.title.changed.disconnect(this._emitTabsChanged,this)})),this._widgets=[],this._tabsChanged.emit(void 0)}}!function(n){n.kernelNewConsole="running:kernel-new-console",n.kernelNewNotebook="running:kernel-new-notebook",n.kernelOpenSession="running:kernel-open-session",n.kernelShutDown="running:kernel-shut-down",n.showPanel="running:show-panel"}(h||(h={}));const p={activate:function(n,e,t,s){const i=e.load("jupyterlab"),d=new o.RunningSessionManagers,p=new o.RunningSessions(d,e);return p.id="jp-running-sessions",p.title.caption=i.__("Running Terminals and Kernels"),p.title.icon=l.runningIcon,p.node.setAttribute("role","region"),p.node.setAttribute("aria-label",i.__("Running Sessions section")),t&&t.add(p,"running-sessions"),s&&function(n,e,t){const s=new m(t),o=e.load("jupyterlab");n.add({name:o.__("Open Tabs"),running:()=>Array.from(t.widgets("main")).map((n=>(s.addWidget(n),new i(n)))),shutdownAll:()=>{for(const n of t.widgets("main"))n.close()},refreshRunning:()=>{},runningChanged:s.tabsChanged,shutdownLabel:o.__("Close"),shutdownAllLabel:o.__("Close All"),shutdownAllConfirmationText:o.__("Are you sure you want to close all open tabs?")});class i{constructor(n){this._widget=n}open(){t.activateById(this._widget.id)}shutdown(){this._widget.close()}icon(){const n=this._widget.title.icon;return n instanceof l.LabIcon?n:l.fileIcon}label(){return this._widget.title.label}labelTitle(){let n;return n=this._widget instanceof g.DocumentWidget?this._widget.context.path:this._widget.title.label,n}}}(d,e,s),async function(n,e,t){const{commands:s,contextMenu:o,serviceManager:i}=t,{kernels:d,kernelspecs:g,sessions:m}=i,{runningChanged:p,RunningKernel:w}=u,_=new r.Throttler((()=>p.emit(void 0)),100),b=e.load("jupyterlab");d.runningChanged.connect((()=>{_.invoke()})),m.runningChanged.connect((()=>{_.invoke()})),await Promise.all([d.ready,g.ready,m.ready]),n.add({name:b.__("Kernels"),running:()=>Array.from(d.running()).map((n=>{var e;return new w({commands:s,kernel:n,kernels:d,sessions:m,spec:null===(e=g.specs)||void 0===e?void 0:e.kernelspecs[n.name],trans:b})})),shutdownAll:()=>d.shutdownAll(),refreshRunning:()=>Promise.all([d.refreshRunning(),m.refreshRunning()]),runningChanged:p,shutdownLabel:b.__("Shut Down Kernel"),shutdownAllLabel:b.__("Shut Down All"),shutdownAllConfirmationText:b.__("Are you sure you want to permanently shut down all running kernels?")});const k=n=>n.classList.contains(c);s.addCommand(h.kernelNewConsole,{icon:l.consoleIcon,label:b.__("New Console for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("console:create",{kernelPreference:{id:i}})}}),s.addCommand(h.kernelNewNotebook,{icon:l.notebookIcon,label:b.__("New Notebook for Kernel"),execute:n=>{var e;const o=t.contextMenuHitTest(k),i=null!==(e=n.id)&&void 0!==e?e:null==o?void 0:o.dataset.context;if(i)return s.execute("notebook:create-new",{kernelId:i})}}),s.addCommand(h.kernelOpenSession,{icon:n=>"console"===n.type?l.consoleIcon:"notebook"===n.type?l.notebookIcon:void 0,isEnabled:({path:n,type:e})=>!!e||void 0!==n,label:({name:n,path:e})=>n||a.PathExt.basename(e||b.__("Unknown Session")),execute:({path:n,type:e})=>{if(!e||void 0===n)return;const t="console"===e?"console:open":"docmanager:open";return s.execute(t,{path:n})}}),s.addCommand(h.kernelShutDown,{icon:l.closeIcon,label:b.__("Shut Down Kernel"),execute:n=>{var e;const s=t.contextMenuHitTest(k),o=null!==(e=n.id)&&void 0!==e?e:null==s?void 0:s.dataset.context;if(o)return d.shutdown(o)}});const v=[];o.opened.connect((async()=>{var n,e,s;const i=null!==(e=null===(n=o.menu.items.find((n=>{var e;return"submenu"===n.type&&"jp-contextmenu-connected-sessions"===(null===(e=n.submenu)||void 0===e?void 0:e.id)})))||void 0===n?void 0:n.submenu)&&void 0!==e?e:null;if(!i)return;v.forEach((n=>n.dispose())),v.length=0,i.clearItems();const l=t.contextMenuHitTest(k),a=null==l?void 0:l.dataset.context;if(!a)return;const r=h.kernelOpenSession;for(const n of m.running())if(a===(null===(s=n.kernel)||void 0===s?void 0:s.id)){const{name:e,path:t,type:s}=n;v.push(i.addItem({command:r,args:{name:e,path:t,type:s}}))}}))}(d,e,n),n.shell.add(p,"left",{rank:200,type:"Sessions and Tabs"}),n.commands.addCommand(h.showPanel,{label:i.__("Sessions and Tabs"),execute:()=>{n.shell.activateById(p.id)}}),d},id:"@jupyterlab/running-extension:plugin",description:"Provides the running session managers.",provides:o.IRunningSessionManagers,requires:[i.ITranslator],optional:[s.ILayoutRestorer,s.ILabShell],autoStart:!0}}}]);
|
notebook/static/1835.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1835],{11835:(e,t,n)=>{n.r(t),n.d(t,{ToolbarItems:()=>F,default:()=>W,downloadPlugin:()=>D,openBrowserTabPlugin:()=>k,pathStatusPlugin:()=>x,savingStatusPlugin:()=>C});var o,a=n(3053),r=n(12982),i=n(38639),l=n(90157),d=n(36768),s=n(34276),c=n(71677),u=n(68239),m=n(33625),g=n(20998),p=n(81997),h=n(31516),v=n(78156);!function(e){e.clone="docmanager:clone",e.deleteFile="docmanager:delete-file",e.newUntitled="docmanager:new-untitled",e.open="docmanager:open",e.openBrowserTab="docmanager:open-browser-tab",e.reload="docmanager:reload",e.rename="docmanager:rename",e.del="docmanager:delete",e.duplicate="docmanager:duplicate",e.restoreCheckpoint="docmanager:restore-checkpoint",e.save="docmanager:save",e.saveAll="docmanager:save-all",e.saveAs="docmanager:save-as",e.download="docmanager:download",e.toggleAutosave="docmanager:toggle-autosave",e.showInFileBrowser="docmanager:show-in-file-browser"}(o||(o={}));const f="@jupyterlab/docmanager-extension:plugin",w={id:"@jupyterlab/docmanager-extension:opener",description:"Provides the widget opener.",autoStart:!0,provides:l.IDocumentWidgetOpener,activate:e=>{const{shell:t}=e;return new class{constructor(){this._opened=new p.Signal(this)}open(e,n){e.id||(e.id="document-manager-"+ ++S.id),e.title.dataset={type:"document-title",...e.title.dataset},e.isAttached||t.add(e,"main",n||{}),t.activateById(e.id),this._opened.emit(e)}get opened(){return this._opened}}}},_={id:"@jupyterlab/docmanager-extension:contexts",description:"Adds the handling of opened documents dirty state.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener],optional:[a.ILabStatus],activate:(e,t,n,o)=>{const a=new WeakSet;n.opened.connect(((e,n)=>{const r=t.contextForWidget(n);r&&!a.has(r)&&(o&&function(e,t){let n=null;const o=(t,o)=>{"dirty"===o.name&&(!0===o.newValue?n||(n=e.setDirty()):n&&(n.dispose(),n=null))};t.ready.then((()=>{t.model.stateChanged.connect(o),t.model.dirty&&(n=e.setDirty())})),t.disposed.connect((()=>{n&&n.dispose()}))}(o,r),a.add(r))}))}},b={id:"@jupyterlab/docmanager-extension:manager",description:"Provides the document manager.",provides:l.IDocumentManager,requires:[l.IDocumentWidgetOpener],optional:[c.ITranslator,a.ILabStatus,r.ISessionContextDialogs,a.JupyterLab.IInfo],activate:(e,t,n,o,a,i)=>{var d;const{serviceManager:s,docRegistry:u}=e,m=null!=n?n:c.nullTranslator,g=null!=a?a:new r.SessionContextDialogs({translator:m}),p=e.restored.then((()=>{}));return new l.DocumentManager({registry:u,manager:s,opener:t,when:p,setBusy:null!==(d=o&&(()=>o.setBusy()))&&void 0!==d?d:void 0,sessionDialogs:g,translator:null!=m?m:c.nullTranslator,isConnectedCallback:()=>!i||i.isConnected})}},y={id:f,description:"Adds commands and settings to the document manager.",autoStart:!0,requires:[l.IDocumentManager,l.IDocumentWidgetOpener,d.ISettingRegistry],optional:[c.ITranslator,r.ICommandPalette,a.ILabShell],activate:(e,t,n,a,d,s,p)=>{const h=(d=null!=d?d:c.nullTranslator).load("jupyterlab"),v=e.docRegistry;!function(e,t,n,a,d,s,c){const g=d.load("jupyterlab"),{commands:p,shell:h}=e,v=g.__("File Operations"),w=()=>{const{currentWidget:e}=h;return!(!e||!t.contextForWidget(e))},_=()=>{var e;const{currentWidget:n}=h;if(!n)return!1;const o=t.contextForWidget(n);return!!(null===(e=null==o?void 0:o.contentsModel)||void 0===e?void 0:e.writable)},b=e=>r.Notification.warning(g.__('%1 is permissioned as read-only. Use "save as..." instead.',e),{autoClose:5e3});s&&function(e,t,n,a,i){const d=i.load("jupyterlab"),{commands:s}=e,c=()=>{var o;const a=/[Pp]ath:\s?(.*)\n?/,r=e.contextMenuHitTest((e=>{var t;return!!(null===(t=e.title)||void 0===t?void 0:t.match(a))})),i=null==r?void 0:r.title.match(a);return null!==(o=i&&t.findWidget(i[1],null))&&void 0!==o?o:n.currentWidget},u=()=>{const{currentWidget:e}=n;return!(!e||!t.contextForWidget(e))};s.addCommand(o.clone,{label:()=>d.__("New View for %1",T(c(),t)),isEnabled:u,execute:e=>{const n=c(),o=e.options||{mode:"split-right"};if(!n)return;const r=t.cloneWidget(n);r&&a.open(r,o)}}),s.addCommand(o.rename,{label:()=>{let e=T(c(),t);return e&&(e=" "+e),d.__("Rename%1…",e)},isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());return(0,l.renameDialog)(t,e)}}}),s.addCommand(o.duplicate,{label:()=>d.__("Duplicate %1",T(c(),t)),isEnabled:u,execute:()=>{if(u()){const e=t.contextForWidget(c());if(!e)return;return t.duplicate(e.path)}}}),s.addCommand(o.del,{label:()=>d.__("Delete %1",T(c(),t)),isEnabled:u,execute:async()=>{if(u()){const n=t.contextForWidget(c());if(!n)return;(await(0,r.showDialog)({title:d.__("Delete"),body:d.__("Are you sure you want to delete %1",n.path),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:d.__("Delete")})]})).button.accept&&await e.commands.execute("docmanager:delete-file",{path:n.path})}}}),s.addCommand(o.showInFileBrowser,{label:()=>d.__("Show in File Browser"),isEnabled:u,execute:async()=>{const e=c(),n=e&&t.contextForWidget(e);n&&(await s.execute("filebrowser:activate",{path:n.path}),await s.execute("filebrowser:go-to-path",{path:n.path}))}})}(e,t,s,n,d),p.addCommand(o.deleteFile,{label:()=>`Delete ${T(h.currentWidget,t)}`,execute:e=>{const n=void 0===e.path?"":e.path;if(!n){const e=o.deleteFile;throw new Error(`A non-empty path is required for ${e}.`)}return t.deleteFile(n)}}),p.addCommand(o.newUntitled,{execute:e=>{const n=e.error||g.__("Error"),o=void 0===e.path?"":e.path,a={type:e.type,path:o};return"file"===e.type&&(a.ext=e.ext||".txt"),t.services.contents.newUntitled(a).catch((e=>(0,r.showErrorMessage)(n,e)))},label:e=>e.label||`New ${e.type}`}),p.addCommand(o.open,{execute:e=>{const n=void 0===e.path?"":e.path,o=e.factory||void 0,a=null==e?void 0:e.kernel,r=e.options||void 0;return t.services.contents.get(n,{content:!1}).then((()=>t.openOrReveal(n,o,a,r)))},iconClass:e=>e.icon||"",label:e=>{var t;return null!==(t=e.label||e.factory)&&void 0!==t?t:g.__("Open the provided `path`.")},mnemonic:e=>e.mnemonic||-1}),p.addCommand(o.reload,{label:()=>g.__("Reload %1 from Disk",T(h.currentWidget,t)),caption:g.__("Reload contents from disk"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget),n=T(h.currentWidget,t);return e?e.model.dirty?(0,r.showDialog)({title:g.__("Reload %1 from Disk",n),body:g.__("Are you sure you want to reload the %1 from the disk?",n),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Reload")})]}).then((t=>{if(t.button.accept&&!e.isDisposed)return e.revert()})):e.isDisposed?void 0:e.revert():(0,r.showDialog)({title:g.__("Cannot Reload"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}),p.addCommand(o.restoreCheckpoint,{label:()=>g.__("Revert %1 to Checkpoint…",T(h.currentWidget,t)),caption:g.__("Revert contents to previous checkpoint"),isEnabled:w,execute:()=>{if(!w())return;const e=t.contextForWidget(h.currentWidget);return e?e.listCheckpoints().then((async n=>{const o=T(h.currentWidget,t);if(n.length<1)return void await(0,r.showErrorMessage)(g.__("No checkpoints"),g.__("No checkpoints are available for this %1.",o));const a=1===n.length?n[0]:await S.getTargetCheckpoint(n.reverse(),g);return a?(0,r.showDialog)({title:g.__("Revert %1 to checkpoint",o),body:new I(a,g,o),buttons:[r.Dialog.cancelButton(),r.Dialog.warnButton({label:g.__("Revert"),ariaLabel:g.__("Revert to Checkpoint")})]}).then((t=>{if(!e.isDisposed)return t.button.accept?e.model.readOnly?e.revert():e.restoreCheckpoint(a.id).then((()=>e.revert())):void 0})):void 0})):(0,r.showDialog)({title:g.__("Cannot Revert"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}});const y=new WeakSet;p.addCommand(o.save,{label:()=>g.__("Save %1",T(h.currentWidget,t)),caption:()=>{if(h.currentWidget){const e=t.contextForWidget(h.currentWidget);if(null==e?void 0:e.model.collaborative)return g.__("In collaborative mode, the document is saved automatically after every change");if(!_())return g.__('document is permissioned readonly; "save" is disabled, use "save as..." instead')}return g.__("Save and create checkpoint")},icon:e=>e.toolbar?u.saveIcon:void 0,isEnabled:e=>e._luminoEvent&&"keybinding"===e._luminoEvent.type||_(),execute:async e=>{var n,o,l,d,s;const c=h.currentWidget,u=t.contextForWidget(c);if(w()){if(!u)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});{if(y.has(u))return;if(!(null===(n=u.contentsModel)||void 0===n?void 0:n.writable)&&!u.model.collaborative){let t=null===(o=e._luminoEvent)||void 0===o?void 0:o.type;return e._luminoEvent&&"keybinding"===t?void b(u.path):(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("Document is read-only"),buttons:[r.Dialog.okButton()]})}y.add(u);const m=i.PathExt.basename(null!==(d=null===(l=u.contentsModel)||void 0===l?void 0:l.path)&&void 0!==d?d:"");let p=m;if(t.renameUntitledFileOnSave&&!0===c.isUntitled){const e=await r.InputDialog.getText({title:g.__("Rename file"),okLabel:g.__("Rename"),placeholder:g.__("File name"),text:m,selectionRange:m.length-i.PathExt.extname(m).length,checkbox:{label:g.__("Do not ask me again."),caption:g.__("If checked, you will not be asked to rename future untitled files when saving them.")}});if(e.button.accept&&(p=null!==(s=e.value)&&void 0!==s?s:m,c.isUntitled=!1,"boolean"==typeof e.isChecked)){const t=(await a.get(f,"renameUntitledFileOnSave")).composite;e.isChecked===t&&a.set(f,"renameUntitledFileOnSave",!e.isChecked).catch((e=>{console.error(`Fail to set 'renameUntitledFileOnSave:\n${e}`)}))}}try{if(await u.save(),!(null==c?void 0:c.isDisposed))return u.createCheckpoint()}catch(e){if("ModalCancelError"===e.name)return;throw e}finally{y.delete(u),p!==m&&await u.rename(p)}}}}}),p.addCommand(o.saveAll,{label:()=>g.__("Save All"),caption:g.__("Save all open documents"),isEnabled:()=>(0,m.some)(h.widgets("main"),(e=>{var n,o,a;return null!==(a=null===(o=null===(n=t.contextForWidget(e))||void 0===n?void 0:n.contentsModel)||void 0===o?void 0:o.writable)&&void 0!==a&&a})),execute:()=>{var e;const n=[],o=new Set;for(const a of h.widgets("main")){const r=t.contextForWidget(a);r&&!o.has(r.path)&&((null===(e=r.contentsModel)||void 0===e?void 0:e.writable)?(o.add(r.path),n.push(r.save())):b(r.path))}return Promise.all(n)}}),p.addCommand(o.saveAs,{label:()=>g.__("Save %1 As…",T(h.currentWidget,t)),caption:g.__("Save with new path"),isEnabled:w,execute:()=>{if(w()){const e=t.contextForWidget(h.currentWidget);if(!e)return(0,r.showDialog)({title:g.__("Cannot Save"),body:g.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]});const n=(n,a)=>{"save"===a.type&&a.newValue&&a.newValue.path!==e.path&&(t.closeFile(e.path),p.execute(o.open,{path:a.newValue.path}))};t.services.contents.fileChanged.connect(n),e.saveAs().finally((()=>t.services.contents.fileChanged.disconnect(n)))}}}),p.addCommand(o.toggleAutosave,{label:g.__("Autosave Documents"),isToggled:()=>t.autosave,execute:()=>{const e=!t.autosave,n="autosave";return a.set(f,n,e).catch((e=>{console.error(`Failed to set ${f}:${n} - ${e.message}`)}))}}),c&&[o.reload,o.restoreCheckpoint,o.save,o.saveAs,o.toggleAutosave,o.duplicate].forEach((e=>{c.addItem({command:e,category:v})}))}(e,t,n,a,d,p,s);const w=n=>{const a=n.get("autosave").composite;t.autosave=!0!==a&&!1!==a||a,e.commands.notifyCommandChanged(o.toggleAutosave);const r=n.get("confirmClosingDocument").composite;t.confirmClosingDocument=null==r||r;const i=n.get("autosaveInterval").composite;t.autosaveInterval=i||120;const l=n.get("lastModifiedCheckMargin").composite;t.lastModifiedCheckMargin=l||500;const d=n.get("renameUntitledFileOnSave").composite;t.renameUntitledFileOnSave=null==d||d;const s=n.get("defaultViewers").composite,c={};Object.keys(s).forEach((e=>{v.getFileType(e)?(v.getWidgetFactory(s[e])||console.warn(`Document viewer ${s[e]} not found`),c[e]=s[e]):console.warn(`File Type ${e} not found`)}));for(const e of v.fileTypes())try{v.setDefaultWidgetFactory(e.name,c[e.name])}catch(t){console.warn(`Failed to set default viewer ${c[e.name]} for file type ${e.name}`)}};Promise.all([a.load(f),e.restored]).then((([e])=>{e.changed.connect(w),w(e),t.stateChanged.connect(((t,n)=>{["autosave","autosaveInterval","confirmClosingDocument","lastModifiedCheckMargin","renameUntitledFileOnSave"].includes(n.name)&&e.get(n.name).composite!==n.newValue&&e.set(n.name,n.newValue).catch((e=>{console.error(`Failed to set the setting '${n.name}':\n${e}`)}))}))})).catch((e=>{console.error(e.message)})),a.transform(f,{fetch:e=>{const t=Array.from(v.fileTypes()).map((e=>e.name)).join(" \n"),n=Array.from(v.widgetFactories()).map((e=>e.name)).join(" \n"),o=h.__('Overrides for the default viewers for file types.\nSpecify a mapping from file type name to document viewer name, for example:\n\ndefaultViewers: {\n markdown: "Markdown Preview"\n}\n\nIf you specify non-existent file types or viewers, or if a viewer cannot\nopen a given file type, the override will not function.\n\nAvailable viewers:\n%1\n\nAvailable file types:\n%2',n,t),a=g.JSONExt.deepCopy(e.schema);return a.properties.defaultViewers.description=o,{...e,schema:a}}}),v.changed.connect((()=>a.load(f,!0)))}},C={id:"@jupyterlab/docmanager-extension:saving-status",description:"Adds a saving status indicator.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[c.ITranslator,s.IStatusBar],activate:(e,t,n,o,a)=>{if(!a)return;const r=new l.SavingStatus({docManager:t,translator:null!=o?o:c.nullTranslator});r.model.widget=n.currentWidget,n.currentChanged.connect((()=>{r.model.widget=n.currentWidget})),a.registerStatusItem(C.id,{item:r,align:"middle",isActive:()=>null!==r.model&&null!==r.model.status,activeStateChanged:r.model.stateChanged})}},x={id:"@jupyterlab/docmanager-extension:path-status",description:"Adds a file path indicator in the status bar.",autoStart:!0,requires:[l.IDocumentManager,a.ILabShell],optional:[s.IStatusBar],activate:(e,t,n,o)=>{if(!o)return;const a=new l.PathStatus({docManager:t});a.model.widget=n.currentWidget,n.currentChanged.connect((()=>{a.model.widget=n.currentWidget})),o.registerStatusItem(x.id,{item:a,align:"right",rank:0})}},D={id:"@jupyterlab/docmanager-extension:download",description:"Adds command to download files.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator,r.ICommandPalette],activate:(e,t,n,a)=>{const i=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:l,shell:d}=e,s=()=>{const{currentWidget:e}=d;return!(!e||!t.contextForWidget(e))};l.addCommand(o.download,{label:i.__("Download"),caption:i.__("Download the file to your computer"),isEnabled:s,execute:()=>{if(s()){const e=t.contextForWidget(d.currentWidget);return e?e.download():(0,r.showDialog)({title:i.__("Cannot Download"),body:i.__("No context found for current widget!"),buttons:[r.Dialog.okButton()]})}}});const u=i.__("File Operations");a&&a.addItem({command:o.download,category:u})}},k={id:"@jupyterlab/docmanager-extension:open-browser-tab",description:"Adds command to open a browser tab.",autoStart:!0,requires:[l.IDocumentManager],optional:[c.ITranslator],activate:(e,t,n)=>{const a=(null!=n?n:c.nullTranslator).load("jupyterlab"),{commands:r}=e;r.addCommand(o.openBrowserTab,{execute:e=>{const n=void 0===e.path?"":e.path;if(n)return t.services.contents.getDownloadUrl(n).then((e=>{const t=window.open();if(!t)throw new Error("Failed to open new browser tab.");t.opener=null,t.location.href=e}))},iconClass:e=>e.icon||"",label:()=>a.__("Open in New Browser Tab")})}},W=[b,y,_,x,C,D,k,w];var F,S;!function(e){e.createSaveButton=function(e,t){return(0,r.addCommandToolbarButtonClass)(r.ReactWidget.create(v.createElement(r.UseSignal,{signal:t},(()=>v.createElement(r.CommandToolbarButtonComponent,{commands:e,id:o.save,label:"",args:{toolbar:!0}})))))}}(F||(F={}));class I extends h.Widget{constructor(e,t,n="notebook"){super({node:S.createRevertConfirmNode(e,n,t)})}}function T(e,t){if(!e)return"File";const n=t.contextForWidget(e);if(!n)return"";const o=t.registry.getFileTypesForPath(n.path);return o.length&&o[0].displayName?o[0].displayName:"File"}!function(e){e.id=0,e.createRevertConfirmNode=function(e,t,n){const o=document.createElement("div"),a=document.createElement("p"),r=document.createTextNode(n.__("Are you sure you want to revert the %1 to checkpoint? ",t)),l=document.createElement("strong");l.textContent=n.__("This cannot be undone."),a.appendChild(r),a.appendChild(l);const d=document.createElement("p"),s=document.createTextNode(n.__("The checkpoint was last updated at: ")),c=document.createElement("p"),u=new Date(e.last_modified);return c.style.textAlign="center",c.textContent=i.Time.format(u)+" ("+i.Time.formatHuman(u)+")",d.appendChild(s),d.appendChild(c),o.appendChild(a),o.appendChild(d),o},e.getTargetCheckpoint=async function(e,t){const n=e.map(((e,t)=>`${t}. ${i.Time.format(e.last_modified)} (${i.Time.formatHuman(e.last_modified)})`)),o=(await r.InputDialog.getItem({items:n,title:t.__("Choose a checkpoint")})).value;if(!o)return;const a=o.split(".",1)[0];return e[parseInt(a,10)]}}(S||(S={}))}}]);
|
notebook/static/1950.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1950],{31950:(e,t,r)=>{r.r(t),r.d(t,{default:()=>I,lineColItem:()=>R});var o=r(3053),i=r(31536),n=r(34276),a=r(71677),s=r(7201),d=r(52337),l=r(36768),c=r(68239),u=r(20998),g=r(27478),m=r.n(g),p=r(78156),h=r.n(p);const y="@jupyterlab/codemirror-extension:plugin",f={id:"@jupyterlab/codemirror-extension:languages",description:"Provides the CodeMirror languages registry.",provides:d.IEditorLanguageRegistry,optional:[a.ITranslator],activate:(e,t)=>{const o=new d.EditorLanguageRegistry;for(const e of d.EditorLanguageRegistry.getDefaultLanguages(t))o.addLanguage(e);return o.addLanguage({name:"ipythongfm",mime:"text/x-ipythongfm",load:async()=>{const[e,t,i]=await Promise.all([r.e(252).then(r.t.bind(r,252,23)),Promise.all([r.e(9799),r.e(2552),r.e(890),r.e(459),r.e(3887),r.e(6361)]).then(r.bind(r,12552)),r.e(311).then(r.bind(r,60311))]),n=e.markdown({base:e.markdownLanguage,codeLanguages:e=>o.findBest(e),extensions:[(0,d.parseMathIPython)(s.StreamLanguage.define(i.stexMath).parser)]});return new s.LanguageSupport(n.language,[n.support,(0,d.pythonBuiltin)(t.pythonLanguage)])}}),o}},v={id:"@jupyterlab/codemirror-extension:themes",description:"Provides the CodeMirror theme registry",provides:d.IEditorThemeRegistry,optional:[a.ITranslator],activate:(e,t)=>{const r=new d.EditorThemeRegistry;for(const e of d.EditorThemeRegistry.getDefaultThemes(t))r.addTheme(e);return r}},E={id:"@jupyterlab/codemirror-extension:extensions",description:"Provides the CodeMirror extension factory registry.",provides:d.IEditorExtensionRegistry,requires:[d.IEditorThemeRegistry],optional:[a.ITranslator,l.ISettingRegistry,c.IFormRendererRegistry],activate:(e,t,r,o,i)=>{const n=new d.EditorExtensionRegistry;for(const e of d.EditorExtensionRegistry.getDefaultExtensions({themes:t,translator:r}))n.addExtension(e);if(o){const t=e=>{var t;n.baseConfiguration=null!==(t=e.get("defaultConfig").composite)&&void 0!==t?t:{}};Promise.all([o.load(y),e.restored]).then((([e])=>{t(e),e.changed.connect(t)})),null==i||i.addRenderer(`${y}.defaultConfig`,{fieldRenderer:e=>{const t=h().useMemo((()=>n.settingsSchema),[]),o={};for(const[e,r]of Object.entries(n.defaultConfiguration))void 0!==t[e]&&(o[e]=r);return h().createElement("div",{className:"jp-FormGroup-contentNormal"},h().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.schema.title),e.schema.description&&h().createElement("div",{className:"jp-FormGroup-description"},e.schema.description),h().createElement(c.FormComponent,{schema:{title:e.schema.title,description:e.schema.description,type:"object",properties:t,additionalProperties:!1},validator:m(),formData:{...o,...e.formData},formContext:{defaultFormData:o},liveValidate:!0,onChange:t=>{var r;const i={};for(const[e,n]of Object.entries(null!==(r=t.formData)&&void 0!==r?r:{})){const t=o[e];void 0!==t&&u.JSONExt.deepEqual(n,t)||(i[e]=n)}e.onChange(i)},tagName:"div",translator:null!=r?r:a.nullTranslator}))}})}return n}},x={id:"@jupyterlab/codemirror-extension:binding",description:"Register the CodeMirror extension factory binding the editor and the shared model.",autoStart:!0,requires:[d.IEditorExtensionRegistry],activate:(e,t)=>{t.addExtension({name:"shared-model-binding",factory:e=>{var t;const r=e.model.sharedModel;return d.EditorExtensionRegistry.createImmutableExtension((0,d.ybinding)({ytext:r.ysource,undoManager:null!==(t=r.undoManager)&&void 0!==t?t:void 0}))}})}},b={id:"@jupyterlab/codemirror-extension:services",description:"Provides the service to instantiate CodeMirror editors.",provides:i.IEditorServices,requires:[d.IEditorLanguageRegistry,d.IEditorExtensionRegistry],optional:[a.ITranslator],activate:(e,t,r,o)=>({factoryService:new d.CodeMirrorEditorFactory({extensions:r,languages:t,translator:null!=o?o:a.nullTranslator}),mimeTypeService:new d.CodeMirrorMimeTypeService(t)})},R={id:"@jupyterlab/codemirror-extension:line-col-status",description:"Provides the code editor cursor position model.",autoStart:!0,requires:[a.ITranslator],optional:[o.ILabShell,n.IStatusBar],provides:i.IPositionModel,activate:(e,t,r,o)=>{const n=new i.LineCol(t),a=new Set;function s(e,t){Promise.all([...a].map((e=>e(t.newValue)))).then((e=>{var t;n.model.editor=null!==(t=e.filter((e=>null!==e))[0])&&void 0!==t?t:null})).catch((e=>{console.error("Get editors",e)}))}return o&&o.registerStatusItem(R.id,{priority:1,item:n,align:"right",rank:2,isActive:()=>!!n.model.editor}),r&&r.currentChanged.connect(s),{addEditorProvider:t=>{a.add(t),e.shell.currentWidget&&s(e.shell,{newValue:e.shell.currentWidget,oldValue:null})},update:()=>{s(e.shell,{oldValue:e.shell.currentWidget,newValue:e.shell.currentWidget})}}}},I=[f,v,x,E,b,R]}}]);
|
notebook/static/2067.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2067],{32067:(e,t,s)=>{s.r(t),s.d(t,{CodeConsole:()=>x,ConsoleHistory:()=>l,ConsolePanel:()=>k,ForeignHandler:()=>i,IConsoleTracker:()=>S});var o,n=s(81997);class i{constructor(e){this._enabled=!1,this._isDisposed=!1,this.sessionContext=e.sessionContext,this.sessionContext.iopubMessage.connect(this.onIOPubMessage,this),this._parent=e.parent}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get parent(){return this._parent}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,n.Signal.clearData(this))}onIOPubMessage(e,t){var s;if(!this._enabled)return!1;const o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel;if(!o)return!1;const n=this._parent;if(t.parent_header.session===o.clientId)return!1;const i=t.header.msg_type,l=t.parent_header.msg_id;let r;switch(i){case"execute_input":{const e=t;r=this._newCell(l);const s=r.model;return s.executionCount=e.content.execution_count,s.sharedModel.setSource(e.content.code),s.trusted=!0,n.update(),!0}case"execute_result":case"display_data":case"stream":case"error":{if(r=this._parent.getCell(l),!r)return!1;const e={...t.content,output_type:i};return r.model.outputs.add(e),n.update(),!0}case"clear_output":{const e=t.content.wait;return r=this._parent.getCell(l),r&&r.model.outputs.clear(e),!0}default:return!1}}_newCell(e){const t=this.parent.createCodeCell();return t.addClass("jp-CodeConsole-foreignCell"),this._parent.addCell(t,e),t}}class l{constructor(e){this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[];const{sessionContext:t}=e;t&&(this.sessionContext=t,this._handleKernel(),this.sessionContext.kernelChanged.connect(this._handleKernel,this))}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&(t.edgeRequested.disconnect(this.onEdgeRequest,this),t.model.sharedModel.changed.disconnect(this.onTextChange,this)),this._editor=e,e&&(e.edgeRequested.connect(this.onEdgeRequest,this),e.model.sharedModel.changed.connect(this.onTextChange,this))}get placeholder(){return this._placeholder}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,n.Signal.clearData(this)}back(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length-1),--this._cursor,this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}forward(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}push(e){e&&e!==this._history[this._history.length-1]&&this._history.push(e),this.reset()}reset(){this._cursor=this._history.length,this._hasSession=!1,this._placeholder=""}onHistory(e){this._history.length=0;let t="",s="";if("ok"===e.content.status)for(let o=0;o<e.content.history.length;o++)s=e.content.history[o][2],s!==t&&this._history.push(t=s);this._cursor=this._history.length}onTextChange(){this._setByHistory?this._setByHistory=!1:this.reset()}onEdgeRequest(e,t){const s=e.model.sharedModel,o=s.getSource();"top"===t||"topLine"===t?this.back(o).then((t=>{if(this.isDisposed||!t)return;if(s.getSource()===t)return;this._setByHistory=!0,s.setSource(t);let o=0;o=t.indexOf("\n"),o<0&&(o=t.length),e.setCursorPosition({line:0,column:o})})):this.forward(o).then((t=>{if(this.isDisposed)return;const o=t||this.placeholder;if(s.getSource()===o)return;this._setByHistory=!0,s.setSource(o);const n=e.getPositionAt(o.length);n&&e.setCursorPosition(n)}))}async _handleKernel(){var e,t;const s=null===(t=null===(e=this.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel;if(s)return s.requestHistory(o.initialRequest).then((e=>{this.onHistory(e)}));this._history.length=0}setFilter(e=""){this._filtered.length=0;let t="",s="";for(let o=0;o<this._history.length;o++)s=this._history[o],s!==t&&e===s.slice(0,e.length)&&this._filtered.push(t=s);this._filtered.push(e)}}!function(e){e.initialRequest={output:!1,raw:!0,hist_access_type:"tail",n:500}}(o||(o={}));var r=s(12982),a=s(38639),h=s(70856),d=s(71677),c=s(68239),u=s(20998),p=s(31516),_=s(17811),C=s(30890),m=s(23781),g=s(24912),y=s(11351),f=s(99615);const v="jp-Console-cell",w="jp-CodeConsole-promptCell";class x extends p.Widget{constructor(e){var t,s;super(),this.editorConfig=x.defaultEditorConfig,this._banner=null,this._executed=new n.Signal(this),this._mimetype="text/x-ipython",this._msgIds=new Map,this._msgIdCells=new Map,this._promptCellCreated=new n.Signal(this),this._dragData=null,this._drag=null,this._focusedCell=null,this._translator=null!==(t=e.translator)&&void 0!==t?t:d.nullTranslator,this.addClass("jp-CodeConsole"),this.node.dataset.jpKernelUser="true",this.node.dataset.jpCodeRunner="true",this.node.dataset.jpUndoer="true",this.node.tabIndex=-1;const o=this.layout=new p.PanelLayout;this._cells=new y.ObservableList,this._content=new p.Panel,this._input=new p.Panel,this.contentFactory=e.contentFactory,this.modelFactory=null!==(s=e.modelFactory)&&void 0!==s?s:x.defaultModelFactory,this.rendermime=e.rendermime,this.sessionContext=e.sessionContext,this._mimeTypeService=e.mimeTypeService,this._content.addClass("jp-CodeConsole-content"),this._input.addClass("jp-CodeConsole-input"),o.addWidget(this._content),o.addWidget(this._input),this._history=new l({sessionContext:this.sessionContext}),this._onKernelChanged(),this.sessionContext.kernelChanged.connect(this._onKernelChanged,this),this.sessionContext.statusChanged.connect(this._onKernelStatusChanged,this)}get executed(){return this._executed}get promptCellCreated(){return this._promptCellCreated}get cells(){return this._cells}get promptCell(){return this._input.layout.widgets[0]||null}addCell(e,t){e.addClass(v),this._content.addWidget(e),this._cells.push(e),t&&(this._msgIds.set(t,e),this._msgIdCells.set(e,t)),e.disposed.connect(this._onCellDisposed,this),this.update()}addBanner(){if(this._banner){const e=this._banner;this._cells.push(this._banner),e.disposed.connect(this._onCellDisposed,this)}const e=this.modelFactory.createRawCell({sharedModel:(0,m.createStandaloneCell)({cell_type:"raw",source:"..."})}),t=(this._banner=new g.RawCell({model:e,contentFactory:this.contentFactory,placeholder:!1,editorConfig:{autoClosingBrackets:!1,codeFolding:!1,highlightActiveLine:!1,highlightTrailingWhitespace:!1,highlightWhitespace:!1,indentUnit:"4",lineNumbers:!1,lineWrap:!0,matchBrackets:!1,readOnly:!0,rulers:[],scrollPastEnd:!1,smartIndent:!1,tabSize:4,theme:"jupyter"}})).initializeState();t.addClass("jp-CodeConsole-banner"),t.readOnly=!0,this._content.addWidget(t)}clear(){const e=this._cells;for(;e.length>0;)e.get(0).dispose()}createCodeCell(){const e=this.contentFactory,t=this._createCodeCellOptions(),s=e.createCodeCell(t);return s.readOnly=!0,s.model.mimeType=this._mimetype,s}dispose(){this.isDisposed||(this._msgIdCells=null,this._msgIds=null,this._history.dispose(),super.dispose())}async execute(e=!1,t=250){var s,o;if("dead"===(null===(o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel)||void 0===o?void 0:o.status))return;const n=this.promptCell;if(!n)throw new Error("Cannot execute without a prompt cell");if(n.model.trusted=!0,e)return this.newPromptCell(),void await this._execute(n);const i=await this._shouldExecute(t);this.isDisposed||(i?(this.newPromptCell(),this.promptCell.editor.focus(),await this._execute(n)):n.editor.newIndentedLine())}getCell(e){return this._msgIds.get(e)}inject(e,t={}){const s=this.createCodeCell();s.model.sharedModel.setSource(e);for(const e of Object.keys(t))s.model.setMetadata(e,t[e]);return this.addCell(s),this._execute(s)}insertLinebreak(){const e=this.promptCell;e&&e.editor.newIndentedLine()}replaceSelection(e){var t,s;const o=this.promptCell;o&&(null===(s=(t=o.editor).replaceSelection)||void 0===s||s.call(t,e))}serialize(){const e=[];for(const t of this._cells){const s=t.model;(0,g.isCodeCellModel)(s)&&e.push(s.toJSON())}return this.promptCell&&e.push(this.promptCell.model.toJSON()),e}_evtMouseDown(e){const{button:t,shiftKey:s}=e;if(0!==t&&2!==t||s&&2===t)return;let o=e.target;const n=e=>e.classList.contains(v);let i=g.CellDragUtils.findCell(o,this._cells,n);if(-1===i&&(o=document.elementFromPoint(e.clientX,e.clientY),i=g.CellDragUtils.findCell(o,this._cells,n)),-1===i)return;const l=this._cells.get(i);"prompt"===g.CellDragUtils.detectTargetArea(l,e.target)&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:i},this._focusedCell=l,document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),e.preventDefault())}_evtMouseMove(e){const t=this._dragData;t&&g.CellDragUtils.shouldStartDrag(t.pressX,t.pressY,e.clientX,e.clientY)&&this._startDrag(t.index,e.clientX,e.clientY)}_startDrag(e,t,s){const o=this._focusedCell.model,n=[o.toJSON()],i=g.CellDragUtils.createCellDragImage(this._focusedCell,n);this._drag=new f.Drag({mimeData:new u.MimeData,dragImage:i,proposedAction:"copy",supportedActions:"copy",source:this}),this._drag.mimeData.setData("application/vnd.jupyter.cells",n);const l=o.sharedModel.getSource();return this._drag.mimeData.setData("text/plain",l),this._focusedCell=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._drag.start(t,s).then((()=>{this.isDisposed||(this._drag=null,this._dragData=null)}))}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"focusin":this._evtFocusIn(e);break;case"focusout":this._evtFocusOut(e)}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,!0),t.addEventListener("click",this),t.addEventListener("mousedown",this),t.addEventListener("focusin",this),t.addEventListener("focusout",this),this.promptCell?(this.promptCell.editor.focus(),this.update()):this.newPromptCell()}onBeforeDetach(e){const t=this.node;t.removeEventListener("keydown",this,!0),t.removeEventListener("click",this),t.removeEventListener("focusin",this),t.removeEventListener("focusout",this)}onActivateRequest(e){const t=this.promptCell&&this.promptCell.editor;t&&t.focus(),this.update()}newPromptCell(){var e;let t=this.promptCell;const s=this._input;if(t){t.readOnly=!0,t.removeClass(w);const o=t;requestIdleCallback((()=>{n.Signal.clearData(o.editor)})),null===(e=t.editor)||void 0===e||e.blur(),s.widgets[0].parent=null,this.addCell(t)}const o=this.contentFactory,i=this._createCodeCellOptions();t=o.createCodeCell(i),t.model.mimeType=this._mimetype,t.addClass(w),this._input.addWidget(t),this._history.editor=t.editor,this._promptCellCreated.emit(t)}onUpdateRequest(e){D.scrollToBottom(this._content.node)}_evtKeyDown(e){const t=this.promptCell&&this.promptCell.editor;t&&(13!==e.keyCode||t.hasFocus()?27===e.keyCode&&t.hasFocus()&&(e.preventDefault(),e.stopPropagation(),this.node.focus()):(e.preventDefault(),t.focus()))}_evtMouseUp(e){this.promptCell&&this.promptCell.node.contains(e.target)&&this.promptCell.editor.focus()}_evtFocusIn(e){this._updateReadWrite()}_evtFocusOut(e){this._updateReadWrite()}_execute(e){const t=e.model.sharedModel.getSource();return this._history.push(t),"clear"===t||"%clear"===t?(this.clear(),Promise.resolve(void 0)):(e.model.contentChanged.connect(this.update,this),g.CodeCell.execute(e,this.sessionContext).then((t=>{if(!this.isDisposed){if(t&&"ok"===t.content.status){const s=t.content;if(s.payload&&s.payload.length){const t=s.payload.filter((e=>"set_next_input"===e.source))[0];if(t){const s=t.text;e.model.sharedModel.setSource(s)}}}else if(t&&"error"===t.content.status)for(const e of this._cells)null===e.model.executionCount&&e.setPrompt("");e.model.contentChanged.disconnect(this.update,this),this.update(),this._executed.emit(new Date)}}),(()=>{this.isDisposed||(e.model.contentChanged.disconnect(this.update,this),this.update())})))}_handleInfo(e){if("ok"!==e.status)return void this._banner.model.sharedModel.setSource("Error in getting kernel banner");this._banner.model.sharedModel.setSource(e.banner);const t=e.language_info;this._mimetype=this._mimeTypeService.getMimeTypeByLanguage(t),this.promptCell&&(this.promptCell.model.mimeType=this._mimetype)}_createCodeCellOptions(){const{node:e}=this,t=this.contentFactory,s=this.modelFactory.createCodeCell({}),o=this.rendermime,n=this.editorConfig,i=C.EditorView.domEventHandlers({keydown:(t,s)=>13===t.keyCode&&"terminal"===e.dataset.jpInteractionMode&&(t.preventDefault(),!0)});return{model:s,rendermime:o,contentFactory:t,editorConfig:n,editorExtensions:[_.Prec.high(i)],placeholder:!1,translator:this._translator}}_onCellDisposed(e,t){if(!this.isDisposed){this._cells.removeValue(e);const t=this._msgIdCells.get(e);t&&(this._msgIdCells.delete(e),this._msgIds.delete(t))}}_shouldExecute(e){const t=this.promptCell;if(!t)return Promise.resolve(!1);const s=t.model.sharedModel.getSource();return new Promise(((t,o)=>{var n;const i=setTimeout((()=>{t(!0)}),e),l=null===(n=this.sessionContext.session)||void 0===n?void 0:n.kernel;l?l.requestIsComplete({code:s}).then((e=>{clearTimeout(i),this.isDisposed&&t(!1),"incomplete"===e.content.status?t(!1):t(!0)})).catch((()=>{t(!0)})):t(!1)}))}async _onKernelChanged(){var e;this.clear(),this._banner&&(this._banner.dispose(),this._banner=null),this.addBanner(),(null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel)&&this._handleInfo(await this.sessionContext.session.kernel.info)}async _onKernelStatusChanged(){var e;const t=null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel;"restarting"===(null==t?void 0:t.status)&&(this.addBanner(),this._handleInfo(await(null==t?void 0:t.info)))}_updateReadWrite(){const e=r.DOMUtils.hasActiveEditableElement(this.node);this.node.classList.toggle("jp-mod-readWrite",e)}}var D,b;!function(e){e.defaultEditorConfig={codeFolding:!1,lineNumbers:!1};class t extends g.Cell.ContentFactory{createCodeCell(e){return new g.CodeCell(e).initializeState()}createRawCell(e){return new g.RawCell(e).initializeState()}}e.ContentFactory=t;class s{constructor(e={}){this.codeCellContentFactory=e.codeCellContentFactory||g.CodeCellModel.defaultContentFactory}createCodeCell(e={}){return e.contentFactory||(e.contentFactory=this.codeCellContentFactory),new g.CodeCellModel(e)}createRawCell(e){return new g.RawCellModel(e)}}e.ModelFactory=s,e.defaultModelFactory=new s({})}(x||(x={})),function(e){e.scrollToBottom=function(e){e.scrollTop=e.scrollHeight-e.clientHeight}}(D||(D={}));class k extends r.MainAreaWidget{constructor(e){super({content:new p.Panel}),this._executed=null,this._connected=null,this.addClass("jp-ConsolePanel");let{rendermime:t,mimeTypeService:s,path:o,basePath:n,name:i,manager:l,modelFactory:_,sessionContext:C,translator:m}=e;this.translator=null!=m?m:d.nullTranslator;const g=this.translator.load("jupyterlab"),y=this.contentFactory=e.contentFactory,f=b.count++;o||(o=a.PathExt.join(n||"",`console-${f}-${u.UUID.uuid4()}`)),C=this._sessionContext=null!=C?C:new r.SessionContext({sessionManager:l.sessions,specsManager:l.kernelspecs,path:l.contents.localPath(o),name:i||g.__("Console %1",f),type:"console",kernelPreference:e.kernelPreference,setBusy:e.setBusy});const v=new h.RenderMimeRegistry.UrlResolver({path:o,contents:l.contents});t=t.clone({resolver:v}),this.console=y.createConsole({rendermime:t,sessionContext:C,mimeTypeService:s,contentFactory:y,modelFactory:_,translator:m}),this.content.addWidget(this.console),C.initialize().then((async t=>{var s;t&&await(null!==(s=e.sessionDialogs)&&void 0!==s?s:new r.SessionContextDialogs({translator:m})).selectKernel(C),this._connected=new Date,this._updateTitlePanel()})),this.console.executed.connect(this._onExecuted,this),this._updateTitlePanel(),C.kernelChanged.connect(this._updateTitlePanel,this),C.propertyChanged.connect(this._updateTitlePanel,this),this.title.icon=c.consoleIcon,this.title.closable=!0,this.id=`console-${f}`}get sessionContext(){return this._sessionContext}dispose(){this.sessionContext.dispose(),this.console.dispose(),super.dispose()}onActivateRequest(e){const t=this.console.promptCell;t&&t.editor.focus()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}_onExecuted(e,t){this._executed=t,this._updateTitlePanel()}_updateTitlePanel(){b.updateTitle(this,this._connected,this._executed,this.translator)}}!function(e){class t extends x.ContentFactory{createConsole(e){return new x(e)}}e.ContentFactory=t,e.IContentFactory=new u.Token("@jupyterlab/console:IContentFactory","A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.")}(k||(k={})),function(e){e.count=1,e.updateTitle=function(e,t,s,o){const n=(o=o||d.nullTranslator).load("jupyterlab"),i=e.console.sessionContext.session;if(i){let o=n.__("Name: %1\n",i.name)+n.__("Directory: %1\n",a.PathExt.dirname(i.path))+n.__("Kernel: %1",e.console.sessionContext.kernelDisplayName);t&&(o+=n.__("\nConnected: %1",a.Time.format(t.toISOString()))),s&&(o+=n.__("\nLast Execution: %1")),e.title.label=i.name,e.title.caption=o}else e.title.label=n.__("Console"),e.title.caption=""}}(b||(b={}));const S=new u.Token("@jupyterlab/console:IConsoleTracker","A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application.")}}]);
|
notebook/static/2094.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2094],{12094:e=>{self,e.exports=(()=>{"use strict";var e={903:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const s=i(503),r=i(627),o=i(237),n=i(860),a=i(374),h=i(296),l=i(855),c=i(274),d=i(859),_=i(399),u=i(345);class g extends d.Disposable{constructor(e,t,i,r,o,n,a,l,_,g){super(),this._terminal=e,this._container=t,this._alpha=o,this._themeService=n,this._bufferService=a,this._optionsService=l,this._decorationService=_,this._coreBrowserService=g,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,h.createSelectionRenderModel)(),this._bitmapGenerator=[],this._onAddTextureAtlasCanvas=this.register(new u.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new c.CellColorResolver(this._terminal,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((e=>{this._refreshCharAtlas(e),this.reset()}))),this.register((0,d.toDisposable)((()=>{var e;(0,s.removeElementFromParent)(this._canvas),null===(e=this._charAtlas)||void 0===e||e.dispose()})))}get canvas(){return this._canvas}get cacheCanvas(){var e;return null===(e=this._charAtlas)||void 0===e?void 0:e.pages[0].canvas}_initCanvas(){this._ctx=(0,a.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(e,t){}handleSelectionChanged(e,t,i=!1){this._selectionModel.update(this._terminal,e,t,i)}_setTransparency(e){if(e===this._alpha)return;const t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(e){var t;if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){null===(t=this._charAtlasDisposable)||void 0===t||t.dispose(),this._charAtlas=(0,r.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable=(0,u.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let e=0;e<this._charAtlas.pages.length;e++)this._bitmapGenerator[e]=new f(this._charAtlas.pages[e].canvas)}}resize(e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var e;null===(e=this._charAtlas)||void 0===e||e.clearTexture()}_fillCells(e,t,i,s){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight)}_fillMiddleLineAtCells(e,t,i=1){const s=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-s-this._coreBrowserService.dpr,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(e,t,i=1,s=0){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight+s-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(e,t,i=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const s=this._coreBrowserService.dpr;this._ctx.lineWidth=s;for(let r=0;r<i;r++){const i=(e+r)*this._deviceCellWidth,o=(e+r+.5)*this._deviceCellWidth,n=(e+r+1)*this._deviceCellWidth,a=(t+1)*this._deviceCellHeight-s-1,h=a-s,l=a+s;this._ctx.moveTo(i,a),this._ctx.bezierCurveTo(i,h,o,h,o,a),this._ctx.bezierCurveTo(o,l,n,l,n,a)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(e,t,i=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const s=this._coreBrowserService.dpr;this._ctx.lineWidth=s,this._ctx.setLineDash([2*s,s]);const r=e*this._deviceCellWidth,o=(t+1)*this._deviceCellHeight-s-1;this._ctx.moveTo(r,o);for(let t=0;t<i;t++){const s=(e+i+t)*this._deviceCellWidth;this._ctx.lineTo(s,o)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(e,t,i=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const s=this._coreBrowserService.dpr;this._ctx.lineWidth=s,this._ctx.setLineDash([4*s,3*s]);const r=e*this._deviceCellWidth,o=(e+i)*this._deviceCellWidth,n=(t+1)*this._deviceCellHeight-s-1;this._ctx.moveTo(r,n),this._ctx.lineTo(o,n),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(e,t,i){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,this._coreBrowserService.dpr*i,this._deviceCellHeight)}_strokeRectAtCell(e,t,i,s){const r=this._coreBrowserService.dpr;this._ctx.lineWidth=r,this._ctx.strokeRect(e*this._deviceCellWidth+r/2,t*this._deviceCellHeight+r/2,i*this._deviceCellWidth-r,s*this._deviceCellHeight-r)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=o.TEXT_BASELINE,this._clipRow(i);let s=!1;!1!==this._optionsService.rawOptions.customGlyphs&&(s=(0,n.tryDrawCustomChar)(this._ctx,e.getChars(),t*this._deviceCellWidth,i*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),s||this._ctx.fillText(e.getChars(),t*this._deviceCellWidth+this._deviceCharLeft,i*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(e,t,i){var s,r;const o=e.getChars();let n;this._cellColorResolver.resolve(e,t,this._bufferService.buffer.ydisp+i),n=o&&o.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(o,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext):this._charAtlas.getRasterizedGlyph(e.getCode()||l.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext),n.size.x&&n.size.y&&(this._ctx.save(),this._clipRow(i),this._charAtlas.pages[n.texturePage].version!==(null===(s=this._bitmapGenerator[n.texturePage])||void 0===s?void 0:s.version)&&(this._bitmapGenerator[n.texturePage]||(this._bitmapGenerator[n.texturePage]=new f(this._charAtlas.pages[n.texturePage].canvas)),this._bitmapGenerator[n.texturePage].refresh(),this._bitmapGenerator[n.texturePage].version=this._charAtlas.pages[n.texturePage].version),this._ctx.drawImage((null===(r=this._bitmapGenerator[n.texturePage])||void 0===r?void 0:r.bitmap)||this._charAtlas.pages[n.texturePage].canvas,n.texturePosition.x,n.texturePosition.y,n.size.x,n.size.y,t*this._deviceCellWidth+this._deviceCharLeft-n.offset.x,i*this._deviceCellHeight+this._deviceCharTop-n.offset.y,n.size.x,n.size.y),this._ctx.restore())}_clipRow(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t){return`${t?"italic":""} ${e?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}t.BaseRenderLayer=g;class f{constructor(e){this._canvas=e,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}get bitmap(){return this._bitmap}refresh(){this._bitmap=void 0,_.isSafari||(void 0===this._commitTimeout&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),1===this._state&&(this._state=2))}_generate(){0===this._state&&(this._bitmap=void 0,this._state=1,window.createImageBitmap(this._canvas).then((e=>{2===this._state?this.refresh():this._bitmap=e,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;const s=i(627),r=i(56),o=i(374),n=i(345),a=i(859),h=i(873),l=i(43),c=i(630),d=i(744);class _ extends a.Disposable{constructor(e,t,i,_,u,g,f,v,C,p,m){super(),this._terminal=e,this._screenElement=t,this._bufferService=_,this._charSizeService=u,this._optionsService=g,this._coreBrowserService=C,this._themeService=m,this._onRequestRedraw=this.register(new n.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const w=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new d.TextRenderLayer(this._terminal,this._screenElement,0,w,this._bufferService,this._optionsService,f,p,this._coreBrowserService,m),new c.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,p,this._optionsService,m),new l.LinkRenderLayer(this._terminal,this._screenElement,2,i,this._bufferService,this._optionsService,p,this._coreBrowserService,m),new h.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,v,this._coreBrowserService,p,m)];for(const e of this._renderLayers)(0,n.forwardEvent)(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,o.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this.register((0,r.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((e,t)=>this._setCanvasDevicePixelDimensions(e,t)))),this.register((0,a.toDisposable)((()=>{for(const e of this._renderLayers)e.dispose();(0,s.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(e,t){this._updateDimensions();for(const e of this._renderLayers)e.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((e=>e.handleBlur()))}handleFocus(){this._runOperation((e=>e.handleFocus()))}handleSelectionChanged(e,t,i=!1){this._runOperation((s=>s.handleSelectionChanged(e,t,i))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((e=>e.handleCursorMove()))}clear(){this._runOperation((e=>e.reset()))}_runOperation(e){for(const t of this._renderLayers)e(t)}renderRows(e,t){for(const i of this._renderLayers)i.handleGridChanged(e,t)}clearTextureAtlas(){for(const e of this._renderLayers)e.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const e=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*e),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(e,t){this.dimensions.device.canvas.height=t,this.dimensions.device.canvas.width=e;for(const e of this._renderLayers)e.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}t.CanvasRenderer=_},873:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;const s=i(903),r=i(782),o=i(859);class n extends s.BaseRenderLayer{constructor(e,t,i,s,n,a,h,l,c,d){super(e,t,"cursor",i,!0,d,n,a,c,l),this._onRequestRedraw=s,this._coreService=h,this._cell=new r.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this)},this.register(a.onOptionChange((()=>this._handleOptionsChanged()))),this.register((0,o.toDisposable)((()=>{var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0})))}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),null===(e=this._cursorBlinkStateManager)||void 0===e||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){var e;this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new a(this._coreBrowserService.isFocused,(()=>{this._render(!0)}),this._coreBrowserService)):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.restartBlinkAnimation()}handleGridChanged(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=t-this._bufferService.buffer.ydisp;if(i<0||i>=this._bufferService.rows)return void this._clearCursor();const s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(s,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const e=this._optionsService.rawOptions.cursorStyle;return e&&"block"!==e?this._cursorRenderers[e](s,i,this._cell):this._renderBlurCursor(s,i,this._cell),this._ctx.restore(),this._state.x=s,this._state.y=i,this._state.isFocused=!1,this._state.style=e,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===s&&this._state.y===i&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](s,i,this._cell),this._ctx.restore(),this._state.x=s,this._state.y=i,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,t,i.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(i,e,t),this._ctx.restore()}_renderUnderlineCursor(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()}_renderBlurCursor(e,t,i){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,t,i.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=n;class a{constructor(e,t,i){this._renderCallback=t,this._coreBrowserService=i,this.isCursorVisible=!0,e&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(e=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const e=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0)return void this._restartInterval(e)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const e=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(e)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0,t.GridCache=class{constructor(){this.cache=[]}resize(e,t){for(let i=0;i<e;i++){this.cache.length<=i&&this.cache.push([]);for(let e=this.cache[i].length;e<t;e++)this.cache[i].push(void 0);this.cache[i].length=t}this.cache.length=e}clear(){for(let e=0;e<this.cache.length;e++)for(let t=0;t<this.cache[e].length;t++)this.cache[e][t]=void 0}}},43:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const s=i(903),r=i(237),o=i(197);class n extends s.BaseRenderLayer{constructor(e,t,i,s,r,o,n,a,h){super(e,t,"link",i,!0,h,r,o,n,a),this.register(s.onShowLinkUnderline((e=>this._handleShowLinkUnderline(e)))),this.register(s.onHideLinkUnderline((e=>this._handleHideLinkUnderline(e))))}resize(e){super.resize(e),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===r.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg&&(0,o.is256Color)(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}}t.LinkRenderLayer=n},630:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;const s=i(903);class r extends s.BaseRenderLayer{constructor(e,t,i,s,r,o,n,a){super(e,t,"selection",i,!0,a,s,n,o,r),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(e){super.resize(e),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(e,t,i){super.handleSelectionChanged(e,t,i),this._redrawSelection(e,t,i)}_redrawSelection(e,t,i){if(!this._didStateChange(e,t,i,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!e||!t)return void this._clearState();const s=e[1]-this._bufferService.buffer.ydisp,r=t[1]-this._bufferService.buffer.ydisp,o=Math.max(s,0),n=Math.min(r,this._bufferService.rows-1);if(o>=this._bufferService.rows||n<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,i){const i=e[0],s=t[0]-i,r=n-o+1;this._fillCells(i,o,s,r)}else{const i=s===o?e[0]:0,a=o===r?t[0]:this._bufferService.cols;this._fillCells(i,o,a-i,1);const h=Math.max(n-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,h),o!==n){const e=r===n?t[0]:this._bufferService.cols;this._fillCells(0,n,e,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=i,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(e,t,i,s){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||s!==this._state.ydisp}_areCoordinatesEqual(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]}}t.SelectionRenderLayer=r},744:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;const s=i(574),r=i(903),o=i(147),n=i(855),a=i(782),h=i(577),l=i(160);class c extends r.BaseRenderLayer{constructor(e,t,i,r,o,n,h,l,c,d){super(e,t,"text",i,r,d,o,n,l,c),this._characterJoinerService=h,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new a.CellData,this._state=new s.GridCache,this.register(n.onSpecificOptionChange("allowTransparency",(e=>this._setTransparency(e))))}resize(e){super.resize(e);const t=this._getFont(!1,!1);this._characterWidth===e.device.char.width&&this._characterFont===t||(this._characterWidth=e.device.char.width,this._characterFont=t,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(e,t,i){for(let s=e;s<=t;s++){const e=s+this._bufferService.buffer.ydisp,t=this._bufferService.buffer.lines.get(e),r=this._characterJoinerService.getJoinedCharacters(e);for(let e=0;e<this._bufferService.cols;e++){t.loadCell(e,this._workCell);let o=this._workCell,a=!1,l=e;if(0===o.getWidth())continue;const c=o.getCode();if(0!==c&&32!==c){if(r.length>0&&e===r[0][0]){a=!0;const e=r.shift();o=new h.JoinedCellData(this._workCell,t.translateToString(!0,e[0],e[1]),e[1]-e[0]),l=e[1]-1}!a&&this._isOverlapping(o)&&l<t.length-1&&t.getCodePoint(l+1)===n.NULL_CELL_CODE&&(o.content&=-12582913,o.content|=2<<22),i(o,e,s),e=l}}}}_drawBackground(e,t){const i=this._ctx,s=this._bufferService.cols;let r=0,n=0,a=null;i.save(),this._forEachCell(e,t,((e,t,h)=>{let c=null;e.isInverse()?c=e.isFgDefault()?this._themeService.colors.foreground.css:e.isFgRGB()?`rgb(${o.AttributeData.toColorRGB(e.getFgColor()).join(",")})`:this._themeService.colors.ansi[e.getFgColor()].css:e.isBgRGB()?c=`rgb(${o.AttributeData.toColorRGB(e.getBgColor()).join(",")})`:e.isBgPalette()&&(c=this._themeService.colors.ansi[e.getBgColor()].css),c&&e.isDim()&&(c=l.color.multiplyOpacity(l.css.toColor(c),.5).css);let d=!1;this._decorationService.forEachDecorationAtCell(t,this._bufferService.buffer.ydisp+h,void 0,(e=>{"top"!==e.options.layer&&d||(e.backgroundColorRGB&&(c=e.backgroundColorRGB.css),d="top"===e.options.layer)})),null===a&&(r=t,n=h),h!==n?(i.fillStyle=a||"",this._fillCells(r,n,s-r,1),r=t,n=h):a!==c&&(i.fillStyle=a||"",this._fillCells(r,n,t-r,1),r=t,n=h),a=c})),null!==a&&(i.fillStyle=a,this._fillCells(r,n,s-r,1)),i.restore()}_drawForeground(e,t){this._forEachCell(e,t,((e,t,i)=>this._drawChars(e,t,i)))}handleGridChanged(e,t){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,t-e+1),this._drawBackground(e,t),this._drawForeground(e,t))}_isOverlapping(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;const t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;const i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i,i}}t.TextRenderLayer=c},503:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(...e){var t;for(const i of e)null===(t=null==i?void 0:i.parentElement)||void 0===t||t.removeChild(i)}},274:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let i,s=0,r=0,o=!1,n=!1,a=!1;t.CellColorResolver=class{constructor(e,t,i,s,r){this._terminal=e,this._selectionRenderModel=t,this._decorationService=i,this._coreBrowserService=s,this._themeService=r,this.result={fg:0,bg:0,ext:0}}resolve(e,t,h){this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=268435456&e.bg?e.extended.ext:0,r=0,s=0,n=!1,o=!1,a=!1,i=this._themeService.colors,this._decorationService.forEachDecorationAtCell(t,h,"bottom",(e=>{e.backgroundColorRGB&&(r=e.backgroundColorRGB.rgba>>8&16777215,n=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,o=!0)})),a=this._selectionRenderModel.isCellSelected(this._terminal,t,h),a&&(r=(this._coreBrowserService.isFocused?i.selectionBackgroundOpaque:i.selectionInactiveBackgroundOpaque).rgba>>8&16777215,n=!0,i.selectionForeground&&(s=i.selectionForeground.rgba>>8&16777215,o=!0)),this._decorationService.forEachDecorationAtCell(t,h,"top",(e=>{e.backgroundColorRGB&&(r=e.backgroundColorRGB.rgba>>8&16777215,n=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,o=!0)})),n&&(r=a?-16777216&e.bg&-134217729|r|50331648:-16777216&e.bg|r|50331648),o&&(s=-16777216&e.fg&-67108865|s|50331648),67108864&this.result.fg&&(n&&!o&&(s=0==(50331648&this.result.bg)?-134217728&this.result.fg|16777215&i.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!n&&o&&(r=0==(50331648&this.result.fg)?-67108864&this.result.bg|16777215&i.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),i=void 0,this.result.bg=n?r:this.result.bg,this.result.fg=o?s:this.result.fg}}},627:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const s=i(509),r=i(197),o=[];t.acquireTextureAtlas=function(e,t,i,n,a,h,l,c){const d=(0,r.generateConfig)(n,a,h,l,t,i,c);for(let t=0;t<o.length;t++){const i=o[t],s=i.ownedBy.indexOf(e);if(s>=0){if((0,r.configEquals)(i.config,d))return i.atlas;1===i.ownedBy.length?(i.atlas.dispose(),o.splice(t,1)):i.ownedBy.splice(s,1);break}}for(let t=0;t<o.length;t++){const i=o[t];if((0,r.configEquals)(i.config,d))return i.ownedBy.push(e),i.atlas}const _=e._core,u={atlas:new s.TextureAtlas(document,d,_.unicodeService),config:d,ownedBy:[e]};return o.push(u),u.atlas},t.removeTerminalFromCache=function(e){for(let t=0;t<o.length;t++){const i=o[t].ownedBy.indexOf(e);if(-1!==i){1===o[t].ownedBy.length?(o[t].atlas.dispose(),o.splice(t,1)):o[t].ownedBy.splice(i,1);break}}}},197:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const s=i(160);t.generateConfig=function(e,t,i,r,o,n,a){const h={foreground:n.foreground,background:n.background,cursor:s.NULL_COLOR,cursorAccent:s.NULL_COLOR,selectionForeground:s.NULL_COLOR,selectionBackgroundTransparent:s.NULL_COLOR,selectionBackgroundOpaque:s.NULL_COLOR,selectionInactiveBackgroundTransparent:s.NULL_COLOR,selectionInactiveBackgroundOpaque:s.NULL_COLOR,ansi:n.ansi.slice(),contrastCache:n.contrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:a,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:i,deviceCharHeight:r,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:h}},t.configEquals=function(e,t){for(let i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.customGlyphs===t.customGlyphs&&e.lineHeight===t.lineHeight&&e.letterSpacing===t.letterSpacing&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.deviceCharWidth===t.deviceCharWidth&&e.deviceCharHeight===t.deviceCharHeight&&e.drawBoldTextInBrightColors===t.drawBoldTextInBrightColors&&e.minimumContrastRatio===t.minimumContrastRatio&&e.colors.foreground.rgba===t.colors.foreground.rgba&&e.colors.background.rgba===t.colors.background.rgba},t.is256Color=function(e){return 16777216==(50331648&e)||33554432==(50331648&e)}},237:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const s=i(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},860:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const s=i(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const r={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.tryDrawCustomChar=function(e,i,n,l,c,d,_,u){const g=t.blockElementDefinitions[i];if(g)return function(e,t,i,s,r,o){for(let n=0;n<t.length;n++){const a=t[n],h=r/8,l=o/8;e.fillRect(i+a.x*h,s+a.y*l,a.w*h,a.h*l)}}(e,g,n,l,c,d),!0;const f=r[i];if(f)return function(e,t,i,r,n,a){let h=o.get(t);h||(h=new Map,o.set(t,h));const l=e.fillStyle;if("string"!=typeof l)throw new Error(`Unexpected fillStyle type "${l}"`);let c=h.get(l);if(!c){const i=t[0].length,r=t.length,o=document.createElement("canvas");o.width=i,o.height=r;const n=(0,s.throwIfFalsy)(o.getContext("2d")),a=new ImageData(i,r);let d,_,u,g;if(l.startsWith("#"))d=parseInt(l.slice(1,3),16),_=parseInt(l.slice(3,5),16),u=parseInt(l.slice(5,7),16),g=l.length>7&&parseInt(l.slice(7,9),16)||1;else{if(!l.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);[d,_,u,g]=l.substring(5,l.length-1).split(",").map((e=>parseFloat(e)))}for(let e=0;e<r;e++)for(let s=0;s<i;s++)a.data[4*(e*i+s)]=d,a.data[4*(e*i+s)+1]=_,a.data[4*(e*i+s)+2]=u,a.data[4*(e*i+s)+3]=t[e][s]*(255*g);n.putImageData(a,0,0),c=(0,s.throwIfFalsy)(e.createPattern(o,null)),h.set(l,c)}e.fillStyle=c,e.fillRect(i,r,n,a)}(e,f,n,l,c,d),!0;const v=t.boxDrawingDefinitions[i];if(v)return function(e,t,i,s,r,o,n){e.strokeStyle=e.fillStyle;for(const[l,c]of Object.entries(t)){let t;e.beginPath(),e.lineWidth=n*Number.parseInt(l),t="function"==typeof c?c(.15,.15/o*r):c;for(const l of t.split(" ")){const t=l[0],c=a[t];if(!c){console.error(`Could not find drawing instructions for "${t}"`);continue}const d=l.substring(1).split(",");d[0]&&d[1]&&c(e,h(d,r,o,i,s,!0,n))}e.stroke(),e.closePath()}}(e,v,n,l,c,d,u),!0;const C=t.powerlineDefinitions[i];return!!C&&(function(e,t,i,s,r,o,n,l){var c,d;const _=new Path2D;_.rect(i,s,r,o),e.clip(_),e.beginPath();const u=n/12;e.lineWidth=l*u;for(const n of t.d.split(" ")){const _=n[0],g=a[_];if(!g){console.error(`Could not find drawing instructions for "${_}"`);continue}const f=n.substring(1).split(",");f[0]&&f[1]&&g(e,h(f,r,o,i,s,!1,l,(null!==(c=t.leftPadding)&&void 0!==c?c:0)*(u/2),(null!==(d=t.rightPadding)&&void 0!==d?d:0)*(u/2)))}1===t.type?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}(e,C,n,l,c,d,_,u),!0)};const o=new Map;function n(e,t,i=0){return Math.max(Math.min(e,t),i)}const a={C:(e,t)=>e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function h(e,t,i,s,r,o,a,h=0,l=0){const c=e.map((e=>parseFloat(e)||parseInt(e)));if(c.length<2)throw new Error("Too few arguments for instruction");for(let e=0;e<c.length;e+=2)c[e]*=t-h*a-l*a,o&&0!==c[e]&&(c[e]=n(Math.round(c[e]+.5)-.5,t,0)),c[e]+=s+h*a;for(let e=1;e<c.length;e+=2)c[e]*=i,o&&0!==c[e]&&(c[e]=n(Math.round(c[e]+.5)-.5,i,0)),c[e]+=r;return c}},56:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const s=i(859);t.observeDevicePixelDimensions=function(e,t,i){let r=new t.ResizeObserver((t=>{const s=t.find((t=>t.target===e));if(!s)return;if(!("devicePixelContentBoxSize"in s))return null==r||r.disconnect(),void(r=void 0);const o=s.devicePixelContentBoxSize[0].inlineSize,n=s.devicePixelContentBoxSize[0].blockSize;o>0&&n>0&&i(o,n)}));try{r.observe(e,{box:["device-pixel-content-box"]})}catch(e){r.disconnect(),r=void 0}return(0,s.toDisposable)((()=>null==r?void 0:r.disconnect()))}},374:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class i{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1])return void this.clear();const r=t[1]-e.buffer.active.viewportY,o=i[1]-e.buffer.active.viewportY,n=Math.max(r,0),a=Math.min(o,e.rows-1);n>=e.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=r,this.viewportEndRow=o,this.viewportCappedStartRow=n,this.viewportCappedEndRow=a,this.startCol=t[0],this.endCol=i[0])}isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol)}}t.createSelectionRenderModel=function(){return new i}},509:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const s=i(237),r=i(855),o=i(147),n=i(160),a=i(860),h=i(374),l=i(485),c=i(385),d=i(345),_={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let u;class g{constructor(e,t,i){this._document=e,this._config=t,this._unicodeService=i,this._didWarmUp=!1,this._cacheMap=new l.FourKeyMap,this._cacheMapCombined=new l.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new o.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new d.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new d.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=C(e,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,h.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){for(const e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const e=new c.IdleTaskQueue;for(let t=33;t<126;t++)e.enqueue((()=>{if(!this._cacheMap.get(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT)){const e=this._drawToCache(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT);this._cacheMap.set(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT,e)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(0!==this._pages[0].currentRow.x||0!==this._pages[0].currentRow.y){for(const e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){g.maxAtlasPages&&this._pages.length>=Math.max(4,g.maxAtlasPages/2)&&queueMicrotask((()=>{const e=this._pages.filter((e=>2*e.canvas.width<=(g.maxTextureSize||4096))).sort(((e,t)=>t.canvas.width!==e.canvas.width?t.canvas.width-e.canvas.width:t.percentageUsed-e.percentageUsed));let t=-1,i=0;for(let s=0;s<e.length;s++)if(e[s].canvas.width!==i)t=s,i=e[s].canvas.width;else if(s-t==3)break;const s=e.slice(t,t+4),r=s.map((e=>e.glyphs[0].texturePage)).sort(((e,t)=>e>t?1:-1)),o=r[0],n=this._mergePages(s,o);n.version++,this._pages[o]=n;for(let e=r.length-1;e>=1;e--)this._deletePage(r[e]);this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(n.canvas)}));const e=new f(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,t){const i=2*e[0].canvas.width,s=new f(this._document,i,e);for(const[r,o]of e.entries()){const e=r*o.canvas.width%i,n=Math.floor(r/2)*o.canvas.height;s.ctx.drawImage(o.canvas,e,n);for(const s of o.glyphs)s.texturePage=t,s.sizeClipSpace.x=s.size.x/i,s.sizeClipSpace.y=s.size.y/i,s.texturePosition.x+=e,s.texturePosition.y+=n,s.texturePositionClipSpace.x=s.texturePosition.x/i,s.texturePositionClipSpace.y=s.texturePosition.y/i;this._onRemoveTextureAtlasCanvas.fire(o.canvas);const a=this._activePages.indexOf(o);-1!==a&&this._activePages.splice(a,1)}return s}_deletePage(e){this._pages.splice(e,1);for(let t=e;t<this._pages.length;t++){const e=this._pages[t];for(const t of e.glyphs)t.texturePage--;e.version++}}getRasterizedGlyphCombinedChar(e,t,i,s){return this._getFromCacheMap(this._cacheMapCombined,e,t,i,s)}getRasterizedGlyph(e,t,i,s){return this._getFromCacheMap(this._cacheMap,e,t,i,s)}_getFromCacheMap(e,t,i,s,r){return u=e.get(t,i,s,r),u||(u=this._drawToCache(t,i,s,r),e.set(t,i,s,r,u)),u}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,t,i,r){if(this._config.allowTransparency)return n.NULL_COLOR;let a;switch(e){case 16777216:case 33554432:a=this._getColorFromAnsiIndex(t);break;case 50331648:const e=o.AttributeData.toColorRGB(t);a=n.rgba.toColor(e[0],e[1],e[2]);break;default:a=i?this._config.colors.foreground:this._config.colors.background}return r&&(a=n.color.blend(this._config.colors.background,n.color.multiplyOpacity(a,s.DIM_OPACITY))),a}_getForegroundColor(e,t,i,r,a,h,l,c,d,_){const u=this._getMinimumContrastColor(e,t,i,r,a,h,!1,d,_);if(u)return u;let g;switch(a){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&h<8&&(h+=8),g=this._getColorFromAnsiIndex(h);break;case 50331648:const e=o.AttributeData.toColorRGB(h);g=n.rgba.toColor(e[0],e[1],e[2]);break;default:g=l?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(g=n.color.opaque(g)),c&&(g=n.color.multiplyOpacity(g,s.DIM_OPACITY)),g}_resolveBackgroundRgba(e,t,i){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return i?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,t,i,s){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return i?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,t,i,s,r,o,a,h,l){if(1===this._config.minimumContrastRatio||l)return;const c=this._config.colors.contrastCache.getColor(e,s);if(void 0!==c)return c||void 0;const d=this._resolveBackgroundRgba(t,i,a),_=this._resolveForegroundRgba(r,o,a,h),u=n.rgba.ensureContrastRatio(d,_,this._config.minimumContrastRatio);if(!u)return void this._config.colors.contrastCache.setColor(e,s,null);const g=n.rgba.toColor(u>>24&255,u>>16&255,u>>8&255);return this._config.colors.contrastCache.setColor(e,s,g),g}_drawToCache(e,t,i,r){const n="number"==typeof e?String.fromCharCode(e):e,l=this._config.deviceCellWidth*Math.max(n.length,2)+4;this._tmpCanvas.width<l&&(this._tmpCanvas.width=l);const c=this._config.deviceCellHeight+8;if(this._tmpCanvas.height<c&&(this._tmpCanvas.height=c),this._tmpCtx.save(),this._workAttributeData.fg=i,this._workAttributeData.bg=t,this._workAttributeData.extended.ext=r,this._workAttributeData.isInvisible())return _;const d=!!this._workAttributeData.isBold(),u=!!this._workAttributeData.isInverse(),g=!!this._workAttributeData.isDim(),f=!!this._workAttributeData.isItalic(),C=!!this._workAttributeData.isUnderline(),p=!!this._workAttributeData.isStrikethrough();let m=this._workAttributeData.getFgColor(),w=this._workAttributeData.getFgColorMode(),x=this._workAttributeData.getBgColor(),L=this._workAttributeData.getBgColorMode();if(u){const e=m;m=x,x=e;const t=w;w=L,L=t}const b=this._getBackgroundColor(L,x,u,g);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=b.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const M=d?this._config.fontWeightBold:this._config.fontWeight,y=f?"italic":"";this._tmpCtx.font=`${y} ${M} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=s.TEXT_BASELINE;const S=1===n.length&&(0,h.isPowerlineGlyph)(n.charCodeAt(0)),R=1===n.length&&(0,h.isRestrictedPowerlineGlyph)(n.charCodeAt(0)),A=this._getForegroundColor(t,L,x,i,w,m,u,g,d,(0,h.excludeFromContrastRatioDemands)(n.charCodeAt(0)));this._tmpCtx.fillStyle=A.css;const T=R?0:4;let D=!1;!1!==this._config.customGlyphs&&(D=(0,a.tryDrawCustomChar)(this._tmpCtx,n,T,T,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let k,$=!S;if(k="number"==typeof e?this._unicodeService.wcwidth(e):this._unicodeService.getStringCellWidth(e),C){this._tmpCtx.save();const e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),t=e%2==1?.5:0;if(this._tmpCtx.lineWidth=e,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())$=!1,this._tmpCtx.strokeStyle=`rgb(${o.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{$=!1;let e=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&e<8&&(e+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(e).css}this._tmpCtx.beginPath();const i=T,s=Math.ceil(T+this._config.deviceCharHeight)-t,r=T+this._config.deviceCharHeight+e-t,a=Math.ceil(T+this._config.deviceCharHeight+2*e)-t;for(let o=0;o<k;o++){this._tmpCtx.save();const n=i+o*this._config.deviceCellWidth,h=i+(o+1)*this._config.deviceCellWidth,l=n+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(h,s),this._tmpCtx.moveTo(n,a),this._tmpCtx.lineTo(h,a);break;case 3:const i=e<=1?a:Math.ceil(T+this._config.deviceCharHeight-e/2)-t,o=e<=1?s:Math.ceil(T+this._config.deviceCharHeight+e/2)-t,c=new Path2D;c.rect(n,s,this._config.deviceCellWidth,a-s),this._tmpCtx.clip(c),this._tmpCtx.moveTo(n-this._config.deviceCellWidth/2,r),this._tmpCtx.bezierCurveTo(n-this._config.deviceCellWidth/2,o,n,o,n,r),this._tmpCtx.bezierCurveTo(n,i,l,i,l,r),this._tmpCtx.bezierCurveTo(l,o,h,o,h,r),this._tmpCtx.bezierCurveTo(h,i,h+this._config.deviceCellWidth/2,i,h+this._config.deviceCellWidth/2,r);break;case 4:this._tmpCtx.setLineDash([2*this._config.devicePixelRatio,this._config.devicePixelRatio]),this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(h,s);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(h,s);break;default:this._tmpCtx.moveTo(n,s),this._tmpCtx.lineTo(h,s)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!D&&this._config.fontSize>=12&&!this._config.allowTransparency&&" "!==n){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const t=this._tmpCtx.measureText(n);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in t&&t.actualBoundingBoxDescent>0){this._tmpCtx.save();const t=new Path2D;t.rect(i,s-Math.ceil(e/2),this._config.deviceCellWidth,a-s+Math.ceil(e/2)),this._tmpCtx.clip(t),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=b.css,this._tmpCtx.strokeText(n,T,T+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(D||this._tmpCtx.fillText(n,T,T+this._config.deviceCharHeight),"_"===n&&!this._config.allowTransparency){let e=v(this._tmpCtx.getImageData(T,T,this._config.deviceCellWidth,this._config.deviceCellHeight),b,A,$);if(e)for(let t=1;t<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=b.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(n,T,T+this._config.deviceCharHeight-t),e=v(this._tmpCtx.getImageData(T,T,this._config.deviceCellWidth,this._config.deviceCellHeight),b,A,$),e);t++);}if(p){const e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),t=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(T,T+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.lineTo(T+this._config.deviceCharWidth*k,T+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.stroke()}this._tmpCtx.restore();const B=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let E;if(E=this._config.allowTransparency?function(e){for(let t=0;t<e.data.length;t+=4)if(e.data[t+3]>0)return!1;return!0}(B):v(B,b,A,$),E)return _;const P=this._findGlyphBoundingBox(B,this._workBoundingBox,l,R,D,T);let I,O;for(;;){if(0===this._activePages.length){const e=this._createNewPage();I=e,O=e.currentRow,O.height=P.size.y;break}I=this._activePages[this._activePages.length-1],O=I.currentRow;for(const e of this._activePages)P.size.y<=e.currentRow.height&&(I=e,O=e.currentRow);for(let e=this._activePages.length-1;e>=0;e--)for(const t of this._activePages[e].fixedRows)t.height<=O.height&&P.size.y<=t.height&&(I=this._activePages[e],O=t);if(O.y+P.size.y>=I.canvas.height||O.height>P.size.y+2){let e=!1;if(I.currentRow.y+I.currentRow.height+P.size.y>=I.canvas.height){let t;for(const e of this._activePages)if(e.currentRow.y+e.currentRow.height+P.size.y<e.canvas.height){t=e;break}if(t)I=t;else{const t=this._createNewPage();I=t,O=t.currentRow,O.height=P.size.y,e=!0}}e||(I.currentRow.height>0&&I.fixedRows.push(I.currentRow),O={x:0,y:I.currentRow.y+I.currentRow.height,height:P.size.y},I.fixedRows.push(O),I.currentRow={x:0,y:O.y+O.height,height:0})}if(O.x+P.size.x<=I.canvas.width)break;O===I.currentRow?(O.x=0,O.y+=O.height,O.height=0):I.fixedRows.splice(I.fixedRows.indexOf(O),1)}return P.texturePage=this._pages.indexOf(I),P.texturePosition.x=O.x,P.texturePosition.y=O.y,P.texturePositionClipSpace.x=O.x/I.canvas.width,P.texturePositionClipSpace.y=O.y/I.canvas.height,P.sizeClipSpace.x/=I.canvas.width,P.sizeClipSpace.y/=I.canvas.height,O.height=Math.max(O.height,P.size.y),O.x+=P.size.x,I.ctx.putImageData(B,P.texturePosition.x-this._workBoundingBox.left,P.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,P.size.x,P.size.y),I.addGlyph(P),I.version++,P}_findGlyphBoundingBox(e,t,i,s,r,o){t.top=0;const n=s?this._config.deviceCellHeight:this._tmpCanvas.height,a=s?this._config.deviceCellWidth:i;let h=!1;for(let i=0;i<n;i++){for(let s=0;s<a;s++){const r=i*this._tmpCanvas.width*4+4*s+3;if(0!==e.data[r]){t.top=i,h=!0;break}}if(h)break}t.left=0,h=!1;for(let i=0;i<o+a;i++){for(let s=0;s<n;s++){const r=s*this._tmpCanvas.width*4+4*i+3;if(0!==e.data[r]){t.left=i,h=!0;break}}if(h)break}t.right=a,h=!1;for(let i=o+a-1;i>=o;i--){for(let s=0;s<n;s++){const r=s*this._tmpCanvas.width*4+4*i+3;if(0!==e.data[r]){t.right=i,h=!0;break}}if(h)break}t.bottom=n,h=!1;for(let i=n-1;i>=0;i--){for(let s=0;s<a;s++){const r=i*this._tmpCanvas.width*4+4*s+3;if(0!==e.data[r]){t.bottom=i,h=!0;break}}if(h)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:t.right-t.left+1,y:t.bottom-t.top+1},sizeClipSpace:{x:t.right-t.left+1,y:t.bottom-t.top+1},offset:{x:-t.left+o+(s||r?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-t.top+o+(s||r?1===this._config.lineHeight?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=g;class f{constructor(e,t,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(const e of i)this._glyphs.push(...e.glyphs),this._usedPixels+=e._usedPixels;this.canvas=C(e,t,t),this.ctx=(0,h.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function v(e,t,i,s){const r=t.rgba>>>24,o=t.rgba>>>16&255,n=t.rgba>>>8&255,a=i.rgba>>>24,h=i.rgba>>>16&255,l=i.rgba>>>8&255,c=Math.floor((Math.abs(r-a)+Math.abs(o-h)+Math.abs(n-l))/12);let d=!0;for(let t=0;t<e.data.length;t+=4)e.data[t]===r&&e.data[t+1]===o&&e.data[t+2]===n||s&&Math.abs(e.data[t]-r)+Math.abs(e.data[t+1]-o)+Math.abs(e.data[t+2]-n)<c?e.data[t+3]=0:d=!1;return d}function C(e,t,i){const s=e.createElement("canvas");return s.width=t,s.height=i,s}},577:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,o=arguments.length,n=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const o=i(147),n=i(855),a=i(782),h=i(97);class l extends o.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let c=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(0===this._characterJoiners.length)return[];const t=this._bufferService.buffer.lines.get(e);if(!t||0===t.length)return[];const i=[],s=t.translateToString(!0);let r=0,o=0,a=0,h=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==h||this._workCell.bg!==l){if(e-r>1){const e=this._getJoinedRanges(s,a,o,t,r);for(let t=0;t<e.length;t++)i.push(e[t])}r=e,a=o,h=this._workCell.fg,l=this._workCell.bg}o+=this._workCell.getChars().length||n.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1){const e=this._getJoinedRanges(s,a,o,t,r);for(let t=0;t<e.length;t++)i.push(e[t])}return i}_getJoinedRanges(t,i,s,r,o){const n=t.substring(i,s);let a=[];try{a=this._characterJoiners[0].handler(n)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{const i=this._characterJoiners[t].handler(n);for(let t=0;t<i.length;t++)e._mergeRanges(a,i[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(a,r,o),a}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,o=0,a=e[s];if(a){for(let h=i;h<this._bufferService.cols;h++){const i=t.getWidth(h),l=t.getString(h).length||n.WHITESPACE_CELL_CHAR.length;if(0!==i){if(!r&&a[0]<=o&&(a[0]=h,r=!0),a[1]<=o){if(a[1]=h,a=e[++s],!a)break;a[0]<=o?(a[0]=h,r=!0):r=!1}o+=l}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){const r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0)}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};c=s([r(0,h.IBufferService)],c),t.CharacterJoinerService=c},160:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;const s=i(399);let r=0,o=0,n=0,a=0;var h,l,c;function d(e){const t=e.toString(16);return t.length<2?"0"+t:t}function _(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(e){e.toCss=function(e,t,i,s){return void 0!==s?`#${d(e)}${d(t)}${d(i)}${d(s)}`:`#${d(e)}${d(t)}${d(i)}`},e.toRgba=function(e,t,i,s=255){return(e<<24|t<<16|i<<8|s)>>>0}}(h=t.channels||(t.channels={})),function(e){function t(e,t){return a=Math.round(255*t),[r,o,n]=c.toChannels(e.rgba),{css:h.toCss(r,o,n,a),rgba:h.toRgba(r,o,n,a)}}e.blend=function(e,t){if(a=(255&t.rgba)/255,1===a)return{css:t.css,rgba:t.rgba};const i=t.rgba>>24&255,s=t.rgba>>16&255,l=t.rgba>>8&255,c=e.rgba>>24&255,d=e.rgba>>16&255,_=e.rgba>>8&255;return r=c+Math.round((i-c)*a),o=d+Math.round((s-d)*a),n=_+Math.round((l-_)*a),{css:h.toCss(r,o,n),rgba:h.toRgba(r,o,n)}},e.isOpaque=function(e){return 255==(255&e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=c.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return c.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0;return[r,o,n]=c.toChannels(t),{css:h.toCss(r,o,n),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return a=255&e.rgba,t(e,a*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(t.color||(t.color={})),function(e){let t,i;if(!s.isNode){const e=document.createElement("canvas");e.width=1,e.height=1;const s=e.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return r=parseInt(e.slice(1,2).repeat(2),16),o=parseInt(e.slice(2,3).repeat(2),16),n=parseInt(e.slice(3,4).repeat(2),16),c.toColor(r,o,n);case 5:return r=parseInt(e.slice(1,2).repeat(2),16),o=parseInt(e.slice(2,3).repeat(2),16),n=parseInt(e.slice(3,4).repeat(2),16),a=parseInt(e.slice(4,5).repeat(2),16),c.toColor(r,o,n,a);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const s=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return r=parseInt(s[1]),o=parseInt(s[2]),n=parseInt(s[3]),a=Math.round(255*(void 0===s[5]?1:parseFloat(s[5]))),c.toColor(r,o,n,a);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=e,"string"!=typeof t.fillStyle)throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[r,o,n,a]=t.getImageData(0,0,1,1).data,255!==a)throw new Error("css.toColor: Unsupported css format");return{rgba:h.toRgba(r,o,n,a),css:e}}}(t.css||(t.css={})),function(e){function t(e,t,i){const s=e/255,r=t/255,o=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(l=t.rgb||(t.rgb={})),function(e){function t(e,t,i){const s=e>>24&255,r=e>>16&255,o=e>>8&255;let n=t>>24&255,a=t>>16&255,h=t>>8&255,c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));for(;c<i&&(n>0||a>0||h>0);)n-=Math.max(0,Math.ceil(.1*n)),a-=Math.max(0,Math.ceil(.1*a)),h-=Math.max(0,Math.ceil(.1*h)),c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));return(n<<24|a<<16|h<<8|255)>>>0}function i(e,t,i){const s=e>>24&255,r=e>>16&255,o=e>>8&255;let n=t>>24&255,a=t>>16&255,h=t>>8&255,c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));for(;c<i&&(n<255||a<255||h<255);)n=Math.min(255,n+Math.ceil(.1*(255-n))),a=Math.min(255,a+Math.ceil(.1*(255-a))),h=Math.min(255,h+Math.ceil(.1*(255-h))),c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));return(n<<24|a<<16|h<<8|255)>>>0}e.ensureContrastRatio=function(e,s,r){const o=l.relativeLuminance(e>>8),n=l.relativeLuminance(s>>8);if(_(o,n)<r){if(n<o){const n=t(e,s,r),a=_(o,l.relativeLuminance(n>>8));if(a<r){const t=i(e,s,r);return a>_(o,l.relativeLuminance(t>>8))?n:t}return n}const a=i(e,s,r),h=_(o,l.relativeLuminance(a>>8));if(h<r){const i=t(e,s,r);return h>_(o,l.relativeLuminance(i>>8))?a:i}return a}},e.reduceLuminance=t,e.increaseLuminance=i,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,i,s){return{css:h.toCss(e,t,i,s),rgba:h.toRgba(e,t,i,s)}}}(c=t.rgba||(t.rgba={})),t.toPaddedHex=d,t.contrastRatio=_},345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}})),this._event}fire(e,t){const i=[];for(let e=0;e<this._listeners.length;e++)i.push(this._listeners[e]);for(let s=0;s<i.length;s++)i[s].call(void 0,e,t)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))}},859:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},485:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,o){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,o)}get(e,t,i,s){var r;return null===(r=this._data.get(e,t))||void 0===r?void 0:r.get(i,s)}clear(){this._data.clear()}}},399:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode="undefined"==typeof navigator;const i=t.isNode?"node":navigator.userAgent,s=t.isNode?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isLegacyEdge=i.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.getSafariVersion=function(){if(!t.isSafari)return 0;const e=i.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(s),t.isLinux=s.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(i)},385:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const s=i(399);class r{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),i=Math.max(t,i),r=e.timeRemaining(),1.5*i>r)return s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),void this._start();s=r}this.clear()}}class o extends r{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=o,t.IdleTaskQueue=!s.isNode&&"requestIdleCallback"in window?class extends r{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:o,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},147:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=i;class s{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},782:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(133),r=i(855),o=i(147);class n extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new n;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=n},855:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let t=e[r];t>65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let o=r;o<i;++o){const r=e.charCodeAt(o);if(55296<=r&&r<=56319){if(++o>=i)return this._interim=r,s;const n=e.charCodeAt(o);56320<=n&&n<=57343?t[s++]=1024*(r-55296)+n-56320+65536:(t[s++]=r,t[s++]=n)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,o,n,a=0,h=0,l=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let o,n=0;for(;(o=63&this.interim[++n])&&n<4;)r<<=6,r|=o;const h=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,c=h-n;for(;l<c;){if(l>=i)return 0;if(o=e[l++],128!=(192&o)){l--,s=!0;break}this.interim[n++]=o,r<<=6,r|=63&o}s||(2===h?r<128?l--:t[a++]=r:3===h?r<2048||r>=55296&&r<=57343||65279===r||(t[a++]=r):r<65536||r>1114111||(t[a++]=r)),this.interim.fill(0)}const c=i-4;let d=l;for(;d<i;){for(;!(!(d<c)||128&(s=e[d])||128&(r=e[d+1])||128&(o=e[d+2])||128&(n=e[d+3]));)t[a++]=s,t[a++]=r,t[a++]=o,t[a++]=n,d+=4;if(s=e[d++],s<128)t[a++]=s;else if(192==(224&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(h=(31&s)<<6|63&r,h<128){d--;continue}t[a++]=h}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=e[d++],128!=(192&o)){d--;continue}if(h=(15&s)<<12|(63&r)<<6|63&o,h<2048||h>=55296&&h<=57343||65279===h)continue;t[a++]=h}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=e[d++],128!=(192&o)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=o,a;if(n=e[d++],128!=(192&n)){d--;continue}if(h=(7&s)<<18|(63&r)<<12|(63&o)<<6|63&n,h<65536||h>1114111)continue;t[a++]=h}}return a}}},726:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const i=function(e,t,s){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t.di$target===t?t.di$dependencies.push({id:e,index:i}):(t.di$dependencies=[{id:e,index:i}],t.di$target=t)}(i,e,s)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},97:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(726);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,i),o.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasAddon=void 0;const t=i(949),r=i(345),o=i(859);class n extends o.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var e;return null===(e=this._renderer)||void 0===e?void 0:e.textureAtlas}activate(e){const i=e._core;if(!e.element)return void this.register(i.onWillOpen((()=>this.activate(e))));this._terminal=e;const s=i.coreService,n=i.optionsService,a=i.screenElement,h=i.linkifier2,l=i,c=l._bufferService,d=l._renderService,_=l._characterJoinerService,u=l._charSizeService,g=l._coreBrowserService,f=l._decorationService,v=l._themeService;this._renderer=new t.CanvasRenderer(e,a,h,c,u,n,_,s,g,f,v),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),d.setRenderer(this._renderer),d.handleResize(c.cols,c.rows),this.register((0,o.toDisposable)((()=>{var t;d.setRenderer(this._terminal._core._createRenderer()),d.handleResize(e.cols,e.rows),null===(t=this._renderer)||void 0===t||t.dispose(),this._renderer=void 0})))}}e.CanvasAddon=n})(),s})()}}]);
|
notebook/static/2512.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2512],{32512:(e,t,o)=>{o.r(t),o.d(t,{commandEditItem:()=>Y,default:()=>be,executionIndicator:()=>G,exportPlugin:()=>X,notebookTrustItem:()=>Q});var n=o(3053),l=o(12982),a=o(24912),r=o(31536),d=o(38639),i=o(52337),s=o(76867),c=o(90157),u=o(96313),b=o(3486),m=o(97713),p=o(389),g=o(12729),C=o(97104),k=o(55721),v=o(43833),h=o(98037),f=o(70856),w=o(36768),x=o(66853),_=o(34276),A=o(87749),y=o(71677),S=o(68239),E=o(33625),N=o(20998),I=o(2549),M=o(49503),T=o(31516),R=o(51537),O=o(16954);const B={activate:function(e,t,o){function n(e){function t(t,n,l){if(O.KernelMessage.isDisplayDataMsg(t)||O.KernelMessage.isStreamMsg(t)||O.KernelMessage.isErrorMsg(t)||O.KernelMessage.isExecuteResultMsg(t)){const a=o.getLogger(e.context.path);a.rendermime=e.content.rendermime;const r={...t.content,output_type:t.header.msg_type};let d=n;(O.KernelMessage.isErrorMsg(t)||O.KernelMessage.isStreamMsg(t)&&"stderr"===t.content.name)&&(d=l),a.log({type:"output",data:r,level:d})}}e.context.sessionContext.iopubMessage.connect(((e,o)=>t(o,"info","info"))),e.context.sessionContext.unhandledMessage.connect(((e,o)=>t(o,"warning","error")))}o&&(t.forEach((e=>n(e))),t.widgetAdded.connect(((e,t)=>n(t))))},id:"@jupyterlab/notebook-extension:log-output",description:"Adds cell outputs log to the application logger.",requires:[v.INotebookTracker],optional:[R.ILoggerRegistry],autoStart:!0};var P=o(78156),H=o.n(P),j=o(97934);class L extends v.NotebookTools.Tool{constructor(e){super();const{languages:t}=e;this._tracker=e.tracker,this.addClass("jp-ActiveCellTool"),this.layout=new T.PanelLayout,this._inputPrompt=new a.InputPrompt,this.layout.addWidget(this._inputPrompt);const o=document.createElement("div");o.classList.add("jp-ActiveCellTool-Content");const n=o.appendChild(document.createElement("div")),l=n.appendChild(document.createElement("pre"));n.className="jp-ActiveCellTool-CellContent",this._editorEl=l,this.layout.addWidget(new T.Widget({node:o})),this._refreshDebouncer=new j.Debouncer((async()=>{var e,o;this._editorEl.innerHTML="","code"===(null===(e=this._cellModel)||void 0===e?void 0:e.type)?(this._inputPrompt.executionCount=`${null!==(o=this._cellModel.executionCount)&&void 0!==o?o:""}`,this._inputPrompt.show()):(this._inputPrompt.executionCount=null,this._inputPrompt.hide()),this._cellModel&&await t.highlight(this._cellModel.sharedModel.getSource().split("\n")[0],t.findByMIME(this._cellModel.mimeType),this._editorEl)}),150)}render(e){var t,o;const n=this._tracker.activeCell;return n&&(this._cellModel=(null==n?void 0:n.model)||null),(null===(t=this._cellModel)||void 0===t?void 0:t.sharedModel).changed.connect(this.refresh,this),null===(o=this._cellModel)||void 0===o||o.mimeTypeChanged.connect(this.refresh,this),this.refresh().then((()=>{})).catch((()=>{})),H().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)})}async refresh(){await this._refreshDebouncer.invoke()}}var D,W=o(11351);class K extends v.NotebookTools.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e;this.editor.source&&(null===(e=this._tracker.activeCell)||void 0===e||e.model.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var t;const o=this._tracker.activeCell;return this.editor.source=o?new W.ObservableJSON({values:o.model.metadata}):null,null===(t=this.editor.source)||void 0===t||t.changed.connect(this._onSourceChanged,this),H().createElement("div",{className:"jp-CellMetadataEditor"},H().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)}))}}class F extends v.NotebookTools.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,t;this.editor.source&&(null===(t=null===(e=this._tracker.currentWidget)||void 0===e?void 0:e.model)||void 0===t||t.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var t,o;const n=this._tracker.currentWidget;return this.editor.source=n?new W.ObservableJSON({values:null===(t=n.model)||void 0===t?void 0:t.metadata}):null,null===(o=this.editor.source)||void 0===o||o.changed.connect(this._onSourceChanged,this),H().createElement("div",{className:"jp-NotebookMetadataEditor"},H().createElement("div",{ref:e=>null==e?void 0:e.appendChild(this.node)}))}}!function(e){e.createNew="notebook:create-new",e.interrupt="notebook:interrupt-kernel",e.restart="notebook:restart-kernel",e.restartClear="notebook:restart-clear-output",e.restartAndRunToSelected="notebook:restart-and-run-to-selected",e.restartRunAll="notebook:restart-run-all",e.reconnectToKernel="notebook:reconnect-to-kernel",e.changeKernel="notebook:change-kernel",e.getKernel="notebook:get-kernel",e.createConsole="notebook:create-console",e.createOutputView="notebook:create-output-view",e.clearAllOutputs="notebook:clear-all-cell-outputs",e.shutdown="notebook:shutdown-kernel",e.closeAndShutdown="notebook:close-and-shutdown",e.trust="notebook:trust",e.exportToFormat="notebook:export-to-format",e.run="notebook:run-cell",e.runAndAdvance="notebook:run-cell-and-select-next",e.runAndInsert="notebook:run-cell-and-insert-below",e.runInConsole="notebook:run-in-console",e.runAll="notebook:run-all-cells",e.runAllAbove="notebook:run-all-above",e.runAllBelow="notebook:run-all-below",e.renderAllMarkdown="notebook:render-all-markdown",e.toCode="notebook:change-cell-to-code",e.toMarkdown="notebook:change-cell-to-markdown",e.toRaw="notebook:change-cell-to-raw",e.cut="notebook:cut-cell",e.copy="notebook:copy-cell",e.pasteAbove="notebook:paste-cell-above",e.pasteBelow="notebook:paste-cell-below",e.duplicateBelow="notebook:duplicate-below",e.pasteAndReplace="notebook:paste-and-replace-cell",e.moveUp="notebook:move-cell-up",e.moveDown="notebook:move-cell-down",e.clearOutputs="notebook:clear-cell-output",e.deleteCell="notebook:delete-cell",e.insertAbove="notebook:insert-cell-above",e.insertBelow="notebook:insert-cell-below",e.selectAbove="notebook:move-cursor-up",e.selectBelow="notebook:move-cursor-down",e.selectHeadingAboveOrCollapse="notebook:move-cursor-heading-above-or-collapse",e.selectHeadingBelowOrExpand="notebook:move-cursor-heading-below-or-expand",e.insertHeadingAbove="notebook:insert-heading-above",e.insertHeadingBelow="notebook:insert-heading-below",e.extendAbove="notebook:extend-marked-cells-above",e.extendTop="notebook:extend-marked-cells-top",e.extendBelow="notebook:extend-marked-cells-below",e.extendBottom="notebook:extend-marked-cells-bottom",e.selectAll="notebook:select-all",e.deselectAll="notebook:deselect-all",e.editMode="notebook:enter-edit-mode",e.merge="notebook:merge-cells",e.mergeAbove="notebook:merge-cell-above",e.mergeBelow="notebook:merge-cell-below",e.split="notebook:split-cell-at-cursor",e.commandMode="notebook:enter-command-mode",e.toggleAllLines="notebook:toggle-all-cell-line-numbers",e.undoCellAction="notebook:undo-cell-action",e.redoCellAction="notebook:redo-cell-action",e.redo="notebook:redo",e.undo="notebook:undo",e.markdown1="notebook:change-cell-to-heading-1",e.markdown2="notebook:change-cell-to-heading-2",e.markdown3="notebook:change-cell-to-heading-3",e.markdown4="notebook:change-cell-to-heading-4",e.markdown5="notebook:change-cell-to-heading-5",e.markdown6="notebook:change-cell-to-heading-6",e.hideCode="notebook:hide-cell-code",e.showCode="notebook:show-cell-code",e.hideAllCode="notebook:hide-all-cell-code",e.showAllCode="notebook:show-all-cell-code",e.hideOutput="notebook:hide-cell-outputs",e.showOutput="notebook:show-cell-outputs",e.hideAllOutputs="notebook:hide-all-cell-outputs",e.showAllOutputs="notebook:show-all-cell-outputs",e.toggleRenderSideBySideCurrentNotebook="notebook:toggle-render-side-by-side-current",e.setSideBySideRatio="notebook:set-side-by-side-ratio",e.enableOutputScrolling="notebook:enable-output-scrolling",e.disableOutputScrolling="notebook:disable-output-scrolling",e.selectLastRunCell="notebook:select-last-run-cell",e.replaceSelection="notebook:replace-selection",e.autoClosingBrackets="notebook:toggle-autoclosing-brackets",e.toggleCollapseCmd="notebook:toggle-heading-collapse",e.collapseAllCmd="notebook:collapse-all-headings",e.expandAllCmd="notebook:expand-all-headings",e.copyToClipboard="notebook:copy-to-clipboard",e.invokeCompleter="completer:invoke-notebook",e.selectCompleter="completer:select-notebook",e.tocRunCells="toc:run-cells",e.accessPreviousHistory="notebook:access-previous-history-entry",e.accessNextHistory="notebook:access-next-history-entry",e.virtualScrollbar="notebook:toggle-virtual-scrollbar"}(D||(D={}));const U="Notebook",q=["notebook","python","custom"],V="jp-NotebookExtension-sideBySideMargins",$={id:"@jupyterlab/notebook-extension:tracker",description:"Provides the notebook widget tracker.",provides:v.INotebookTracker,requires:[v.INotebookWidgetFactory,i.IEditorExtensionRegistry],optional:[l.ICommandPalette,m.IDefaultFileBrowser,p.ILauncher,n.ILayoutRestorer,C.IMainMenu,n.IRouter,w.ISettingRegistry,l.ISessionContextDialogs,y.ITranslator,S.IFormRendererRegistry,m.IFileBrowserFactory],activate:function(e,t,o,n,a,r,d,i,s,c,u,b,m,p){const g=null!=b?b:y.nullTranslator,C=null!=u?u:new l.SessionContextDialogs({translator:g}),k=g.load("jupyterlab"),h=e.serviceManager,{commands:f,shell:w}=e,x=new v.NotebookTracker({namespace:"notebook"});null==s||s.routed.connect((function(e,t){t.hash&&x.currentWidget&&x.currentWidget.setFragment(t.hash)}));const _=()=>ge.isEnabled(w,x),A=e=>document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`);if((c?c.load($.id):Promise.reject(new Error(`No setting registry for ${$.id}`))).then((t=>{B(t),t.changed.connect((()=>{B(t),f.notifyCommandChanged(D.virtualScrollbar)}));const n=(e,o)=>{const{newValue:n,oldValue:l}=o,a=n.autoStartDefault;"boolean"==typeof a&&a!==l.autoStartDefault&&a!==t.get("autoStartDefaultKernel").composite&&t.set("autoStartDefaultKernel",a).catch((e=>{console.error(`Failed to set ${t.id}.autoStartDefaultKernel`)}))},a=new WeakSet,r=e=>{const t=e.context.sessionContext;t.isDisposed||a.has(t)||(a.add(t),t.kernelPreferenceChanged.connect(n),t.disposed.connect((()=>{t.kernelPreferenceChanged.disconnect(n)})))};x.forEach(r),x.widgetAdded.connect(((e,t)=>{r(t)})),f.addCommand(D.autoClosingBrackets,{execute:e=>{var o;const n=t.get("codeCellConfig").composite,l=t.get("markdownCellConfig").composite,a=t.get("rawCellConfig").composite,r=n.autoClosingBrackets||l.autoClosingBrackets||a.autoClosingBrackets,d=!!(null!==(o=e.force)&&void 0!==o?o:!r);[n.autoClosingBrackets,l.autoClosingBrackets,a.autoClosingBrackets]=[d,d,d],t.set("codeCellConfig",n),t.set("markdownCellConfig",l),t.set("rawCellConfig",a)},label:k.__("Auto Close Brackets for All Notebook Cell Types"),isToggled:()=>["codeCellConfig","markdownCellConfig","rawCellConfig"].some((e=>{var n;return!0===(null!==(n=t.get(e).composite.autoClosingBrackets)&&void 0!==n?n:o.baseConfiguration.autoClosingBrackets)}))}),f.addCommand(D.setSideBySideRatio,{label:k.__("Set side-by-side ratio"),execute:e=>{l.InputDialog.getNumber({title:k.__("Width of the output in side-by-side mode"),value:t.get("sideBySideOutputRatio").composite}).then((e=>{A(e.value),e.value&&t.set("sideBySideOutputRatio",e.value)})).catch(console.error)}}),pe(e,x,g,C,t,_)})).catch((o=>{console.warn(o.message),O({editorConfig:t.editorConfig,notebookConfig:t.notebookConfig,kernelShutdown:t.shutdownOnClose,autoStartDefault:t.autoStartDefault}),pe(e,x,g,C,null,_)})),m){const e=m.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");e&&(m.addRenderer("@jupyterlab/notebook-extension:tracker.codeCellConfig",e),m.addRenderer("@jupyterlab/notebook-extension:tracker.markdownCellConfig",e),m.addRenderer("@jupyterlab/notebook-extension:tracker.rawCellConfig",e))}d&&d.restore(x,{command:"docmanager:open",args:e=>({path:e.context.path,factory:U}),name:e=>e.context.path,when:h.ready});const E=e.docRegistry,M=new v.NotebookModelFactory({disableDocumentWideUndoRedo:t.notebookConfig.disableDocumentWideUndoRedo,collaborative:!0});E.addModelFactory(M),n&&function(e,t){const o=t.load("jupyterlab");let n=o.__("Notebook Operations");[D.interrupt,D.restart,D.restartClear,D.restartRunAll,D.runAll,D.renderAllMarkdown,D.runAllAbove,D.runAllBelow,D.restartAndRunToSelected,D.selectAll,D.deselectAll,D.clearAllOutputs,D.toggleAllLines,D.editMode,D.commandMode,D.changeKernel,D.reconnectToKernel,D.createConsole,D.closeAndShutdown,D.trust,D.toggleCollapseCmd,D.collapseAllCmd,D.expandAllCmd,D.accessPreviousHistory,D.accessNextHistory].forEach((t=>{e.addItem({command:t,category:n})})),e.addItem({command:D.createNew,category:n,args:{isPalette:!0}}),n=o.__("Notebook Cell Operations"),[D.run,D.runAndAdvance,D.runAndInsert,D.runInConsole,D.clearOutputs,D.toCode,D.toMarkdown,D.toRaw,D.cut,D.copy,D.pasteBelow,D.pasteAbove,D.pasteAndReplace,D.deleteCell,D.split,D.merge,D.mergeAbove,D.mergeBelow,D.insertAbove,D.insertBelow,D.selectAbove,D.selectBelow,D.selectHeadingAboveOrCollapse,D.selectHeadingBelowOrExpand,D.insertHeadingAbove,D.insertHeadingBelow,D.extendAbove,D.extendTop,D.extendBelow,D.extendBottom,D.moveDown,D.moveUp,D.undoCellAction,D.redoCellAction,D.markdown1,D.markdown2,D.markdown3,D.markdown4,D.markdown5,D.markdown6,D.hideCode,D.showCode,D.hideAllCode,D.showAllCode,D.hideOutput,D.showOutput,D.hideAllOutputs,D.showAllOutputs,D.toggleRenderSideBySideCurrentNotebook,D.setSideBySideRatio,D.enableOutputScrolling,D.disableOutputScrolling].forEach((t=>{e.addItem({command:t,category:n})}))}(n,g);let T=0;const R=e.docRegistry.getFileType("notebook");function O(e){x.forEach((t=>{t.setConfig(e)})),"full"!==e.notebookConfig.windowingMode&&x.forEach((e=>{e.content.scrollbar&&(e.content.scrollbar=!1)}))}function B(e){const o={...v.StaticNotebook.defaultEditorConfig.code,...e.get("codeCellConfig").composite},n={...v.StaticNotebook.defaultEditorConfig.markdown,...e.get("markdownCellConfig").composite},l={...v.StaticNotebook.defaultEditorConfig.raw,...e.get("rawCellConfig").composite};t.editorConfig={code:o,markdown:n,raw:l},t.notebookConfig={enableKernelInitNotification:e.get("enableKernelInitNotification").composite,showHiddenCellsButton:e.get("showHiddenCellsButton").composite,scrollPastEnd:e.get("scrollPastEnd").composite,defaultCell:e.get("defaultCell").composite,recordTiming:e.get("recordTiming").composite,overscanCount:e.get("overscanCount").composite,inputHistoryScope:e.get("inputHistoryScope").composite,maxNumberOutputs:e.get("maxNumberOutputs").composite,showEditorForReadOnlyMarkdown:e.get("showEditorForReadOnlyMarkdown").composite,disableDocumentWideUndoRedo:!e.get("documentWideUndoRedo").composite,renderingLayout:e.get("renderingLayout").composite,sideBySideLeftMarginOverride:e.get("sideBySideLeftMarginOverride").composite,sideBySideRightMarginOverride:e.get("sideBySideRightMarginOverride").composite,sideBySideOutputRatio:e.get("sideBySideOutputRatio").composite,windowingMode:e.get("windowingMode").composite,accessKernelHistory:e.get("accessKernelHistory").composite},A(t.notebookConfig.sideBySideOutputRatio);const a=`.jp-mod-sideBySide.jp-Notebook .jp-Notebook-cell {\n margin-left: ${t.notebookConfig.sideBySideLeftMarginOverride} !important;\n margin-right: ${t.notebookConfig.sideBySideRightMarginOverride} !important;`,r=document.getElementById(V);r?r.innerText=a:document.head.insertAdjacentHTML("beforeend",`<style id="${V}">${a}}</style>`),t.autoStartDefault=e.get("autoStartDefaultKernel").composite,t.shutdownOnClose=e.get("kernelShutdown").composite,M.disableDocumentWideUndoRedo=!e.get("documentWideUndoRedo").composite,O({editorConfig:t.editorConfig,notebookConfig:t.notebookConfig,kernelShutdown:t.shutdownOnClose,autoStartDefault:t.autoStartDefault})}return t.widgetCreated.connect(((e,t)=>{var o,n;t.id=t.id||"notebook-"+ ++T,t.title.icon=null==R?void 0:R.icon,t.title.iconClass=null!==(o=null==R?void 0:R.iconClass)&&void 0!==o?o:"",t.title.iconLabel=null!==(n=null==R?void 0:R.iconLabel)&&void 0!==n?n:"",t.context.pathChanged.connect((()=>{x.save(t)})),x.add(t)})),i&&function(e,t){e.editMenu.undoers.redo.add({id:D.redo,isEnabled:t}),e.editMenu.undoers.undo.add({id:D.undo,isEnabled:t}),e.editMenu.clearers.clearAll.add({id:D.clearAllOutputs,isEnabled:t}),e.editMenu.clearers.clearCurrent.add({id:D.clearOutputs,isEnabled:t}),e.fileMenu.consoleCreators.add({id:D.createConsole,isEnabled:t}),e.fileMenu.closeAndCleaners.add({id:D.closeAndShutdown,isEnabled:t}),e.kernelMenu.kernelUsers.changeKernel.add({id:D.changeKernel,isEnabled:t}),e.kernelMenu.kernelUsers.clearWidget.add({id:D.clearAllOutputs,isEnabled:t}),e.kernelMenu.kernelUsers.interruptKernel.add({id:D.interrupt,isEnabled:t}),e.kernelMenu.kernelUsers.reconnectToKernel.add({id:D.reconnectToKernel,isEnabled:t}),e.kernelMenu.kernelUsers.restartKernel.add({id:D.restart,isEnabled:t}),e.kernelMenu.kernelUsers.shutdownKernel.add({id:D.shutdown,isEnabled:t}),e.viewMenu.editorViewers.toggleLineNumbers.add({id:D.toggleAllLines,isEnabled:t}),e.runMenu.codeRunners.restart.add({id:D.restart,isEnabled:t}),e.runMenu.codeRunners.run.add({id:D.runAndAdvance,isEnabled:t}),e.runMenu.codeRunners.runAll.add({id:D.runAll,isEnabled:t}),e.helpMenu.getKernel.add({id:D.getKernel,isEnabled:t})}(i,_),f.addCommand(D.createNew,{label:e=>{var t,o,n;const l=e.kernelName||"";return e.isLauncher&&e.kernelName&&h.kernelspecs?null!==(n=null===(o=null===(t=h.kernelspecs.specs)||void 0===t?void 0:t.kernelspecs[l])||void 0===o?void 0:o.display_name)&&void 0!==n?n:"":e.isPalette||e.isContextMenu?k.__("New Notebook"):k.__("Notebook")},caption:k.__("Create a new notebook"),icon:e=>e.isPalette?void 0:S.notebookIcon,execute:e=>{var t,o;const n=null!==(t=null==p?void 0:p.tracker.currentWidget)&&void 0!==t?t:a;return(async(e,t,o)=>{const n=await f.execute("docmanager:new-untitled",{path:e,type:"notebook"});if(void 0!==n){const e=await f.execute("docmanager:open",{path:n.path,factory:U,kernel:{id:t,name:o}});return e.isUntitled=!0,e}})(e.cwd||(null!==(o=null==n?void 0:n.model.path)&&void 0!==o?o:""),e.kernelId||"",e.kernelName||"")}}),r&&h.ready.then((()=>{let e=null;const t=()=>{e&&(e.dispose(),e=null);const t=h.kernelspecs.specs;if(t){e=new I.DisposableSet;for(const o in t.kernelspecs){const n=o===t.default?0:1/0,l=t.kernelspecs[o],a=l.resources["logo-svg"]||l.resources["logo-64x64"];e.add(r.add({command:D.createNew,args:{isLauncher:!0,kernelName:o},category:k.__("Notebook"),rank:n,kernelIconUrl:a,metadata:{kernel:N.JSONExt.deepCopy(l.metadata||{})}}))}}};t(),h.kernelspecs.specsChanged.connect(t)})),x},autoStart:!0},J={id:"@jupyterlab/notebook-extension:factory",description:"Provides the notebook cell factory.",provides:v.NotebookPanel.IContentFactory,requires:[r.IEditorServices],autoStart:!0,activate:(e,t)=>{const o=t.factoryService.newInlineEditor;return new v.NotebookPanel.ContentFactory({editorFactory:o})}},z={activate:function(e,t,o,n,l,a,r){const d=a.load("jupyterlab"),i="notebook-tools",s=new v.NotebookTools({tracker:t,translator:a});return s.title.icon=S.buildIcon,s.title.caption=d.__("Notebook Tools"),s.id=i,M.MessageLoop.installMessageHook(s,((e,t)=>{switch(t.type){case"activate-request":l.save(i,{open:!0});break;case"after-hide":case"close-request":l.remove(i)}return!0})),r&&t.widgetAdded.connect(((e,t)=>{r.register(t).render(s)})),s},provides:v.INotebookTools,id:"@jupyterlab/notebook-extension:tools",description:"Provides the notebook tools.",autoStart:!0,requires:[v.INotebookTracker,r.IEditorServices,i.IEditorLanguageRegistry,x.IStateDB,y.ITranslator],optional:[h.IPropertyInspectorProvider]},Y={id:"@jupyterlab/notebook-extension:mode-status",description:"Adds a notebook mode status widget.",autoStart:!0,requires:[v.INotebookTracker,y.ITranslator],optional:[_.IStatusBar],activate:(e,t,o,n)=>{if(!n)return;const{shell:l}=e,a=new v.CommandEditStatus(o);t.currentChanged.connect((()=>{const e=t.currentWidget;a.model.notebook=e&&e.content})),n.registerStatusItem("@jupyterlab/notebook-extension:mode-status",{priority:1,item:a,align:"right",rank:4,isActive:()=>!!l.currentWidget&&!!t.currentWidget&&l.currentWidget===t.currentWidget})}},G={id:"@jupyterlab/notebook-extension:execution-indicator",description:"Adds a notebook execution status widget.",autoStart:!0,requires:[v.INotebookTracker,n.ILabShell,y.ITranslator],optional:[_.IStatusBar,w.ISettingRegistry],activate:(e,t,o,n,l,a)=>{let r,d,i;const s=e=>{var a,s;let{showOnToolBar:c,showProgress:u}=e;if(c)i&&(o.currentChanged.disconnect(d),i.dispose());else{if(!l)return;(null==r?void 0:r.model)||(r=new v.ExecutionIndicator(n),d=(e,o)=>{const{newValue:n}=o;if(n&&t.has(n)){const e=n;r.model.attachNotebook({content:e.content,context:e.sessionContext})}},i=l.registerStatusItem("@jupyterlab/notebook-extension:execution-indicator",{item:r,align:"left",rank:3,isActive:()=>{const e=o.currentWidget;return!!e&&t.has(e)}}),r.model.attachNotebook({content:null===(a=t.currentWidget)||void 0===a?void 0:a.content,context:null===(s=t.currentWidget)||void 0===s?void 0:s.sessionContext}),o.currentChanged.connect(d),r.disposed.connect((()=>{o.currentChanged.disconnect(d)}))),r.model.displayOption={showOnToolBar:c,showProgress:u}}};if(a){const t=a.load($.id);Promise.all([t,e.restored]).then((([e])=>{s(v.ExecutionIndicator.getSettingValue(e)),e.changed.connect((e=>s(v.ExecutionIndicator.getSettingValue(e))))})).catch((e=>{console.error(e.message)}))}}},X={id:"@jupyterlab/notebook-extension:export",description:"Adds the export notebook commands.",autoStart:!0,requires:[y.ITranslator,v.INotebookTracker],optional:[C.IMainMenu,l.ICommandPalette],activate:(e,t,o,n,l)=>{var a;const r=t.load("jupyterlab"),{commands:i,shell:s}=e,c=e.serviceManager;let u;i.addCommand(D.exportToFormat,{label:e=>{if(void 0===e.label)return r.__("Save and Export Notebook to the given `format`.");const t=e.label;return e.isPalette?r.__("Save and Export Notebook: %1",t):t},execute:e=>{const t=me(o,s,e);if(!t)return;const n=d.PageConfig.getNBConvertURL({format:e.format,download:!0,path:t.context.path}),{context:l}=t;return l.model.dirty&&!l.model.readOnly?l.save().then((()=>{window.open(n,"_blank","noopener")})):new Promise((e=>{window.open(n,"_blank","noopener"),e(void 0)}))},isEnabled:()=>ge.isEnabled(s,o)}),n&&(u=null===(a=n.fileMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-file-notebookexport"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===a?void 0:a.submenu);let b=!1;const m=async()=>{if(b)return;o.widgetAdded.disconnect(m),b=!0;const e=await c.nbconvert.getExportFormats(!1);if(!e)return;const n=ge.getFormatLabels(t);Object.keys(e).forEach((function(e){const t=r.__(e[0].toUpperCase()+e.substr(1)),o=n[e]?n[e]:t;let a={format:e,label:o,isPalette:!1};if(-1===q.indexOf(e)&&(u&&u.addItem({command:D.exportToFormat,args:a}),l)){a={format:e,label:o,isPalette:!0};const t=r.__("Notebook Operations");l.addItem({command:D.exportToFormat,category:t,args:a})}}))};o.widgetAdded.connect(m)}},Q={id:"@jupyterlab/notebook-extension:trust-status",description:"Adds the notebook trusted status widget.",autoStart:!0,requires:[v.INotebookTracker,y.ITranslator],optional:[_.IStatusBar],activate:(e,t,o,n)=>{if(!n)return;const{shell:l}=e,a=new v.NotebookTrustStatus(o);t.currentChanged.connect((()=>{const e=t.currentWidget;a.model.notebook=e&&e.content})),n.registerStatusItem("@jupyterlab/notebook-extension:trust-status",{item:a,align:"right",rank:3,isActive:()=>!!l.currentWidget&&!!t.currentWidget&&l.currentWidget===t.currentWidget})}},Z={id:"@jupyterlab/notebook-extension:widget-factory",description:"Provides the notebook widget factory.",provides:v.INotebookWidgetFactory,requires:[v.NotebookPanel.IContentFactory,r.IEditorServices,f.IRenderMimeRegistry,l.IToolbarWidgetRegistry],optional:[w.ISettingRegistry,l.ISessionContextDialogs,y.ITranslator],activate:function(e,t,o,n,a,r,i,s){const c=null!=s?s:y.nullTranslator,b=null!=i?i:new l.SessionContextDialogs({translator:c}),m=d.PageConfig.getOption("notebookStartsKernel"),p=""===m||"true"===m.toLowerCase(),{commands:g}=e;let C;a.addFactory(U,"save",(e=>u.ToolbarItems.createSaveButton(g,e.context.fileChanged))),a.addFactory(U,"cellType",(e=>v.ToolbarItems.createCellTypeItem(e,c))),a.addFactory(U,"kernelName",(e=>l.Toolbar.createKernelNameItem(e.sessionContext,b,c))),a.addFactory(U,"executionProgress",(e=>{const t=null==r?void 0:r.load($.id),o=v.ExecutionIndicator.createExecutionIndicatorItem(e,c,t);return null==t||t.then((t=>{e.disposed.connect((()=>{t.dispose()}))})),o})),r&&(C=(0,l.createToolbarFactory)(a,r,U,"@jupyterlab/notebook-extension:panel",c));const k=c.load("jupyterlab"),h=new v.NotebookWidgetFactory({name:U,label:k.__("Notebook"),fileTypes:["notebook"],modelName:"notebook",defaultFor:["notebook"],preferKernel:p,canStartKernel:!0,rendermime:n,contentFactory:t,editorConfig:v.StaticNotebook.defaultEditorConfig,notebookConfig:v.StaticNotebook.defaultNotebookConfig,mimeTypeService:o.mimeTypeService,toolbarFactory:C,translator:c});return e.docRegistry.addWidgetFactory(h),h},autoStart:!0},ee={id:"@jupyterlab/notebook-extension:cloned-outputs",description:"Adds the clone output feature.",requires:[c.IDocumentManager,v.INotebookTracker,y.ITranslator],optional:[n.ILayoutRestorer],activate:function(e,t,o,n,a){const r=n.load("jupyterlab"),d=new l.WidgetTracker({namespace:"cloned-outputs"});a&&a.restore(d,{command:D.createOutputView,args:e=>({path:e.content.path,index:e.content.index}),name:e=>`${e.content.path}:${e.content.index}`,when:o.restored});const{commands:i,shell:s}=e;i.addCommand(D.createOutputView,{label:r.__("Create New View for Cell Output"),execute:async e=>{var a;let r,i;const s=e.path;let c=e.index;if(s&&null!=c){if(i=t.findWidget(s,U),!i)return}else{if(i=o.currentWidget,!i)return;r=i.content.activeCell,c=i.content.activeCellIndex}const u=new ge.ClonedOutputArea({notebook:i,cell:r,index:c,translator:n}),b=new l.MainAreaWidget({content:u});i.context.addSibling(b,{ref:i.id,mode:"split-bottom",type:"Cloned Output"});const m=()=>{d.save(b)};i.context.pathChanged.connect(m),null===(a=i.context.model)||void 0===a||a.cells.changed.connect(m),d.add(b),i.content.disposed.connect((()=>{var e;i.context.pathChanged.disconnect(m),null===(e=i.context.model)||void 0===e||e.cells.changed.disconnect(m),b.dispose()}))},isEnabled:()=>ge.isEnabledAndSingleSelected(s,o)})},autoStart:!0},te={id:"@jupyterlab/notebook-extension:code-console",description:"Adds the notebook code consoles features.",requires:[v.INotebookTracker,y.ITranslator],activate:function(e,t,o){const n=o.load("jupyterlab"),{commands:l,shell:a}=e,r=()=>ge.isEnabled(a,t);l.addCommand(D.createConsole,{label:n.__("New Console for Notebook"),execute:e=>{const o=t.currentWidget;if(o)return ge.createConsole(l,o,e.activate)},isEnabled:r}),l.addCommand(D.runInConsole,{label:n.__("Run Selected Text or Current Line in Console"),execute:async e=>{var o,n;const a=t.currentWidget;if(!a)return;const{context:r,content:d}=a,i=d.activeCell,s=null==i?void 0:i.model.metadata,c=r.path;if(!i||"code"!==i.model.type)return;let u;const b=i.editor;if(!b)return;const m=b.getSelection(),{start:p,end:g}=m;if(p.column!==g.column||p.line!==g.line){const e=b.getOffsetAt(m.start),t=b.getOffsetAt(m.end);u=b.model.sharedModel.getSource().substring(e,t)}else{const e=b.getCursorPosition(),t=b.model.sharedModel.getSource().split("\n");let l=m.start.line;for(;l<b.lineCount&&!t[l].replace(/\s/g,"").length;)l+=1;let r=l>0,d=0,i=d+1;for(;;){u=t.slice(d,i).join("\n");const s=await(null===(n=null===(o=a.context.sessionContext.session)||void 0===o?void 0:o.kernel)||void 0===n?void 0:n.requestIsComplete({code:u+"\n\n"}));if("complete"===(null==s?void 0:s.content.status)){if(l<i){for(;i<b.lineCount&&!t[i].replace(/\s/g,"").length;)i+=1;b.setCursorPosition({line:i,column:e.column});break}d=i,i=d+1}else if(i<b.lineCount)i+=1;else{if(!r){for(u=t[l];l+1<b.lineCount&&!t[l+1].replace(/\s/g,"").length;)l+=1;b.setCursorPosition({line:l+1,column:e.column});break}d=l,i=l+1,r=!1}}}u&&(await l.execute("console:open",{activate:!1,insertMode:"split-bottom",path:c}),await l.execute("console:inject",{activate:!1,code:u,path:c,metadata:s}))},isEnabled:r})},autoStart:!0},oe={id:"@jupyterlab/notebook-extension:copy-output",description:"Adds the copy cell outputs feature.",activate:function(e,t,o){const n=t.load("jupyterlab");e.commands.addCommand(D.copyToClipboard,{label:n.__("Copy Output to Clipboard"),execute:e=>{var t;const n=null===(t=o.currentWidget)||void 0===t?void 0:t.content.activeCell;if(null==n)return;const l=n.outputArea.outputTracker.currentWidget;if(null==l)return;const a=l.node.getElementsByClassName("jp-OutputArea-output");a.length>0&&function(e){const t=window.getSelection();if(null==t)return;const o=[];for(let e=0;e<t.rangeCount;++e)o[e]=t.getRangeAt(e).cloneRange();const n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),document.execCommand("copy"),t.removeAllRanges(),o.forEach((e=>t.addRange(e)))}(a[0])}}),e.contextMenu.addItem({command:D.copyToClipboard,selector:".jp-OutputArea-child",rank:0})},requires:[y.ITranslator,v.INotebookTracker],autoStart:!0},ne={id:"@jupyterlab/notebook-extension:kernel-status",description:"Adds the notebook kernel status.",activate:(e,t,o)=>{o.addSessionProvider((e=>e&&t.has(e)?e.sessionContext:null))},requires:[v.INotebookTracker,l.IKernelStatusModel],autoStart:!0},le={id:"@jupyterlab/notebook-extension:cursor-position",description:"Adds the notebook cursor position status.",activate:(e,t,o)=>{let n=null;o.addEditorProvider((async e=>{let l=null;if(e!==n){if(null==n||n.content.activeCellChanged.disconnect(o.update),n=null,e&&t.has(e)){e.content.activeCellChanged.connect(o.update);const t=e.content.activeCell;l=null,t&&(await t.ready,l=t.editor),n=e}}else if(e){const t=e.content.activeCell;l=null,t&&(await t.ready,l=t.editor)}return l}))},requires:[v.INotebookTracker,r.IPositionModel],autoStart:!0},ae={id:"@jupyterlab/notebook-extension:completer",description:"Adds the code completion capability to notebooks.",requires:[v.INotebookTracker],optional:[s.ICompletionProviderManager,y.ITranslator,l.ISanitizer],activate:function(e,t,o,n,a){if(!o)return;const r=(null!=n?n:y.nullTranslator).load("jupyterlab"),d=null!=a?a:new l.Sanitizer;e.commands.addCommand(D.invokeCompleter,{label:r.__("Display the completion helper."),execute:e=>{var n;const l=t.currentWidget;l&&"code"===(null===(n=l.content.activeCell)||void 0===n?void 0:n.model.type)&&o.invoke(l.id)}}),e.commands.addCommand(D.selectCompleter,{label:r.__("Select the completion suggestion."),execute:()=>{const e=t.currentWidget&&t.currentWidget.id;if(e)return o.select(e)}}),e.commands.addKeyBinding({command:D.selectCompleter,keys:["Enter"],selector:".jp-Notebook .jp-mod-completer-active"});const i=async(e,t)=>{var n,l;const a={editor:null!==(l=null===(n=t.content.activeCell)||void 0===n?void 0:n.editor)&&void 0!==l?l:null,session:t.sessionContext.session,widget:t,sanitizer:d};await o.updateCompleter(a),t.content.activeCellChanged.connect(((e,n)=>{null==n||n.ready.then((()=>{const e={editor:n.editor,session:t.sessionContext.session,widget:t,sanitizer:d};return o.updateCompleter(e)})).catch(console.error)})),t.sessionContext.sessionChanged.connect((()=>{var e;null===(e=t.content.activeCell)||void 0===e||e.ready.then((()=>{var e,n;const l={editor:null!==(n=null===(e=t.content.activeCell)||void 0===e?void 0:e.editor)&&void 0!==n?n:null,session:t.sessionContext.session,widget:t};return o.updateCompleter(l)})).catch(console.error)}))};t.widgetAdded.connect(i),o.activeProvidersChanged.connect((()=>{t.forEach((e=>{i(0,e).catch((e=>console.error(e)))}))}))},autoStart:!0},re={id:"@jupyterlab/notebook-extension:search",description:"Adds search capability to notebooks.",requires:[b.ISearchProviderRegistry],autoStart:!0,activate:(e,t)=>{t.add("jp-notebookSearchProvider",v.NotebookSearchProvider)}},de={id:"@jupyterlab/notebook-extension:toc",description:"Adds table of content capability to the notebooks",requires:[v.INotebookTracker,A.ITableOfContentsRegistry,l.ISanitizer],optional:[f.IMarkdownParser,w.ISettingRegistry],autoStart:!0,activate:(e,t,o,n,l,a)=>{const r=new v.NotebookToCFactory(t,l,n);o.add(r),a&&Promise.all([e.restored,a.load($.id)]).then((([e,t])=>{const o=()=>{var e;r.scrollToTop=null===(e=t.composite.scrollHeadingToTop)||void 0===e||e};o(),t.changed.connect(o)})).catch((e=>{console.error("Failed to load notebook table of content settings.",e)}))}},ie={id:"@jupyterlab/notebook-extension:language-server",description:"Adds language server capability to the notebooks.",requires:[v.INotebookTracker,g.ILSPDocumentConnectionManager,g.ILSPFeatureManager,g.ILSPCodeExtractorsManager,g.IWidgetLSPAdapterTracker],activate:function(e,t,o,n,l,a){t.widgetAdded.connect((async(e,t)=>{const r=new v.NotebookAdapter(t,{connectionManager:o,featureManager:n,foreignCodeExtractorsManager:l});a.add(r)}))},autoStart:!0},se={id:"@jupyterlab/notebook-extension:update-raw-mimetype",description:"Adds metadata form editor for raw cell mimetype.",autoStart:!0,requires:[v.INotebookTracker,k.IMetadataFormProvider,y.ITranslator],activate:(e,t,o,n)=>{const l=n.load("jupyterlab");let a=!1;t.widgetAdded.connect((async function r(){if(a)return;if(!o.get("commonToolsSection"))return;const d=o.get("commonToolsSection").getProperties("/raw_mimetype");if(!d)return;t.widgetAdded.disconnect(r),a=!0;const i=e.serviceManager,s=await i.nbconvert.getExportFormats(!1);if(!s)return;const c=Object.keys(s),u=ge.getFormatLabels(n);c.forEach((function(e){var t;if(!((null===(t=d.oneOf)||void 0===t?void 0:t.filter((t=>t.const===e)).length)>0)){const t=l.__(e[0].toUpperCase()+e.substr(1)),o=u[e]?u[e]:t,n=s[e].output_mimetype;d.oneOf.push({const:n,title:o})}})),o.get("commonToolsSection").setProperties("/raw_mimetype",d)}))}},ce={id:"@jupyterlab/notebook-extension:metadata-editor",description:"Adds metadata form for full metadata editor.",autoStart:!0,requires:[v.INotebookTracker,r.IEditorServices,S.IFormRendererRegistry],optional:[y.ITranslator],activate:(e,t,o,n,l)=>{const a=e=>o.factoryService.newInlineEditor(e),r={fieldRenderer:e=>new K({editorFactory:a,tracker:t,label:"Cell metadata",translator:l}).render(e)};n.addRenderer("@jupyterlab/notebook-extension:metadata-editor.cell-metadata",r);const d={fieldRenderer:e=>new F({editorFactory:a,tracker:t,label:"Notebook metadata",translator:l}).render(e)};n.addRenderer("@jupyterlab/notebook-extension:metadata-editor.notebook-metadata",d)}},ue={id:"@jupyterlab/notebook-extension:active-cell-tool",description:"Adds active cell field in the metadata editor tab.",autoStart:!0,requires:[v.INotebookTracker,S.IFormRendererRegistry,i.IEditorLanguageRegistry],activate:(e,t,o,n)=>{const l={fieldRenderer:e=>new L({tracker:t,languages:n}).render(e)};o.addRenderer("@jupyterlab/notebook-extension:active-cell-tool.renderer",l)}},be=[J,$,G,X,z,Y,Q,Z,B,ee,te,oe,ne,le,ae,re,de,ie,se,ce,ue];function me(e,t,o){const n=e.currentWidget;return!1!==o.activate&&n&&t.activateById(n.id),n}function pe(e,t,o,n,r,d){const i=o.load("jupyterlab"),{commands:s,shell:c}=e,u=()=>ge.isEnabledAndSingleSelected(c,t);t.currentChanged.connect(((e,t)=>{var o,n;(null===(n=null===(o=null==t?void 0:t.content)||void 0===o?void 0:o.model)||void 0===n?void 0:n.cells)&&(t.content.model.cells.changed.connect(((e,o)=>{(e=>{var t,o;for(const n of e.widgets)n instanceof a.MarkdownCell&&n.headingCollapsed&&v.NotebookActions.setHeadingCollapse(n,!0,e),n.model.id===(null===(o=null===(t=e.activeCell)||void 0===t?void 0:t.model)||void 0===o?void 0:o.id)&&v.NotebookActions.expandParent(n,e)})(t.content)})),t.content.activeCellChanged.connect(((e,t)=>{v.NotebookActions.expandParent(t,e)})))})),t.selectionChanged.connect((()=>{s.notifyCommandChanged(D.duplicateBelow),s.notifyCommandChanged(D.deleteCell),s.notifyCommandChanged(D.copy),s.notifyCommandChanged(D.cut),s.notifyCommandChanged(D.pasteBelow),s.notifyCommandChanged(D.pasteAbove),s.notifyCommandChanged(D.pasteAndReplace),s.notifyCommandChanged(D.moveUp),s.notifyCommandChanged(D.moveDown),s.notifyCommandChanged(D.run),s.notifyCommandChanged(D.runAll),s.notifyCommandChanged(D.runAndAdvance),s.notifyCommandChanged(D.runAndInsert)})),t.activeCellChanged.connect((()=>{s.notifyCommandChanged(D.moveUp),s.notifyCommandChanged(D.moveDown)})),s.addCommand(D.runAndAdvance,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Run Selected Cell","Run Selected Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Run this cell and advance","Run these %1 cells and advance",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=me(t,c,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAndAdvance(t,e.sessionContext,n,o)}},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.runIcon:void 0}),s.addCommand(D.run,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Run Selected Cell and Do not Advance","Run Selected Cells and Do not Advance",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=me(t,c,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.run(t,e.sessionContext,n,o)}},isEnabled:d}),s.addCommand(D.runAndInsert,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Run Selected Cell and Insert Below","Run Selected Cells and Insert Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const l=me(t,c,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAndInsert(t,e.sessionContext,n,o)}},isEnabled:d}),s.addCommand(D.runAll,{label:i.__("Run All Cells"),caption:i.__("Run all cells"),execute:e=>{const l=me(t,c,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAll(t,e.sessionContext,n,o)}},isEnabled:d}),s.addCommand(D.runAllAbove,{label:i.__("Run All Above Selected Cell"),execute:e=>{const l=me(t,c,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAllAbove(t,e.sessionContext,n,o)}},isEnabled:()=>u()&&0!==t.currentWidget.content.activeCellIndex}),s.addCommand(D.runAllBelow,{label:i.__("Run Selected Cell and All Below"),execute:e=>{const l=me(t,c,e);if(l){const{context:e,content:t}=l;return v.NotebookActions.runAllBelow(t,e.sessionContext,n,o)}},isEnabled:()=>u()&&t.currentWidget.content.activeCellIndex!==t.currentWidget.content.widgets.length-1}),s.addCommand(D.renderAllMarkdown,{label:i.__("Render All Markdown Cells"),execute:e=>{const o=me(t,c,e);if(o){const{content:e}=o;return v.NotebookActions.renderAllMarkdown(e)}},isEnabled:d}),s.addCommand(D.restart,{label:i.__("Restart Kernel…"),caption:i.__("Restart the kernel"),execute:e=>{const o=me(t,c,e);if(o)return n.restart(o.sessionContext)},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.refreshIcon:void 0}),s.addCommand(D.shutdown,{label:i.__("Shut Down Kernel"),execute:e=>{const o=me(t,c,e);if(o)return o.context.sessionContext.shutdown()},isEnabled:d}),s.addCommand(D.closeAndShutdown,{label:i.__("Close and Shut Down Notebook"),execute:e=>{const o=me(t,c,e);if(!o)return;const n=o.title.label;return(0,l.showDialog)({title:i.__("Shut down the notebook?"),body:i.__('Are you sure you want to close "%1"?',n),buttons:[l.Dialog.cancelButton(),l.Dialog.warnButton()]}).then((e=>{if(e.button.accept)return s.execute(D.shutdown,{activate:!1}).then((()=>{o.dispose()}))}))},isEnabled:d}),s.addCommand(D.trust,{label:()=>i.__("Trust Notebook"),execute:e=>{const o=me(t,c,e);if(o){const{context:e,content:t}=o;return v.NotebookActions.trust(t).then((()=>e.save()))}},isEnabled:d}),s.addCommand(D.restartClear,{label:i.__("Restart Kernel and Clear Outputs of All Cells…"),caption:i.__("Restart the kernel and clear all outputs of all cells"),execute:async()=>{await s.execute(D.restart,{activate:!1})&&await s.execute(D.clearAllOutputs)},isEnabled:d}),s.addCommand(D.restartAndRunToSelected,{label:i.__("Restart Kernel and Run up to Selected Cell…"),execute:async e=>{const l=me(t,c,{activate:!1,...e});if(!l)return;const{context:a,content:r}=l,d=r.widgets.slice(0,r.activeCellIndex+1);return await n.restart(l.sessionContext)?v.NotebookActions.runCells(r,d,a.sessionContext,n,o):void 0},isEnabled:u}),s.addCommand(D.restartRunAll,{label:i.__("Restart Kernel and Run All Cells…"),caption:i.__("Restart the kernel and run all cells"),execute:async e=>{const l=me(t,c,{activate:!1,...e});if(!l)return;const{context:a,content:r}=l,d=r.widgets;return await n.restart(l.sessionContext)?v.NotebookActions.runCells(r,d,a.sessionContext,n,o):void 0},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.fastForwardIcon:void 0}),s.addCommand(D.clearAllOutputs,{label:i.__("Clear Outputs of All Cells"),caption:i.__("Clear all outputs of all cells"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.clearAllOutputs(o.content)},isEnabled:d}),s.addCommand(D.clearOutputs,{label:i.__("Clear Cell Output"),caption:i.__("Clear outputs for the selected cells"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.clearOutputs(o.content)},isEnabled:d}),s.addCommand(D.interrupt,{label:i.__("Interrupt Kernel"),caption:i.__("Interrupt the kernel"),execute:e=>{var o;const n=me(t,c,e);if(!n)return;const l=null===(o=n.context.sessionContext.session)||void 0===o?void 0:o.kernel;return l?l.interrupt():void 0},isEnabled:e=>!!e.toolbar||d(),icon:e=>e.toolbar?S.stopIcon:void 0}),s.addCommand(D.toCode,{label:i.__("Change to Code Cell Type"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.changeCellType(o.content,"code")},isEnabled:d}),s.addCommand(D.toMarkdown,{label:i.__("Change to Markdown Cell Type"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.changeCellType(o.content,"markdown")},isEnabled:d}),s.addCommand(D.toRaw,{label:i.__("Change to Raw Cell Type"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.changeCellType(o.content,"raw")},isEnabled:d}),s.addCommand(D.cut,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Cut Cell","Cut Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Cut this cell","Cut these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.cut(o.content)},icon:e=>e.toolbar?S.cutIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),s.addCommand(D.copy,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Copy Cell","Copy Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Copy this cell","Copy these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.copy(o.content)},icon:e=>e.toolbar?S.copyIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),s.addCommand(D.pasteBelow,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Paste Cell Below","Paste Cells Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.paste(o.content,"below")},icon:e=>e.toolbar?S.pasteIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),s.addCommand(D.pasteAbove,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Paste Cell Above","Paste Cells Above",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.paste(o.content,"above")},isEnabled:d}),s.addCommand(D.duplicateBelow,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Duplicate Cell Below","Duplicate Cells Below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Create a duplicate of this cell below","Create duplicates of %1 cells below",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);o&&v.NotebookActions.duplicate(o.content,"belowSelected")},icon:e=>e.toolbar?S.duplicateIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),s.addCommand(D.pasteAndReplace,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Paste Cell and Replace","Paste Cells and Replace",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.paste(o.content,"replace")},isEnabled:d}),s.addCommand(D.deleteCell,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Delete Cell","Delete Cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Delete this cell","Delete these %1 cells",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.deleteCells(o.content)},isEnabled:e=>!!e.toolbar||d()}),s.addCommand(D.split,{label:i.__("Split Cell"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.splitCell(o.content)},isEnabled:d}),s.addCommand(D.merge,{label:i.__("Merge Selected Cells"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.mergeCells(o.content)},isEnabled:d}),s.addCommand(D.mergeAbove,{label:i.__("Merge Cell Above"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.mergeCells(o.content,!0)},isEnabled:d}),s.addCommand(D.mergeBelow,{label:i.__("Merge Cell Below"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.mergeCells(o.content,!1)},isEnabled:d}),s.addCommand(D.insertAbove,{label:i.__("Insert Cell Above"),caption:i.__("Insert a cell above"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.insertAbove(o.content)},icon:e=>e.toolbar?S.addAboveIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),s.addCommand(D.insertBelow,{label:i.__("Insert Cell Below"),caption:i.__("Insert a cell below"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.insertBelow(o.content)},icon:e=>e.toolbar?S.addBelowIcon:void 0,isEnabled:e=>!!e.toolbar||d()}),s.addCommand(D.selectAbove,{label:i.__("Select Cell Above"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.selectAbove(o.content)},isEnabled:d}),s.addCommand(D.selectBelow,{label:i.__("Select Cell Below"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.selectBelow(o.content)},isEnabled:d}),s.addCommand(D.insertHeadingAbove,{label:i.__("Insert Heading Above Current Heading"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.insertSameLevelHeadingAbove(o.content)},isEnabled:d}),s.addCommand(D.insertHeadingBelow,{label:i.__("Insert Heading Below Current Heading"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.insertSameLevelHeadingBelow(o.content)},isEnabled:d}),s.addCommand(D.selectHeadingAboveOrCollapse,{label:i.__("Select Heading Above or Collapse Heading"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.selectHeadingAboveOrCollapseHeading(o.content)},isEnabled:d}),s.addCommand(D.selectHeadingBelowOrExpand,{label:i.__("Select Heading Below or Expand Heading"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.selectHeadingBelowOrExpandHeading(o.content)},isEnabled:d}),s.addCommand(D.extendAbove,{label:i.__("Extend Selection Above"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.extendSelectionAbove(o.content)},isEnabled:d}),s.addCommand(D.extendTop,{label:i.__("Extend Selection to Top"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.extendSelectionAbove(o.content,!0)},isEnabled:d}),s.addCommand(D.extendBelow,{label:i.__("Extend Selection Below"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.extendSelectionBelow(o.content)},isEnabled:d}),s.addCommand(D.extendBottom,{label:i.__("Extend Selection to Bottom"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.extendSelectionBelow(o.content,!0)},isEnabled:d}),s.addCommand(D.selectAll,{label:i.__("Select All Cells"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.selectAll(o.content)},isEnabled:d}),s.addCommand(D.deselectAll,{label:i.__("Deselect All Cells"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.deselectAll(o.content)},isEnabled:d}),s.addCommand(D.moveUp,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Move Cell Up","Move Cells Up",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Move this cell up","Move these %1 cells up",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);o&&(v.NotebookActions.moveUp(o.content),ge.raiseSilentNotification(i.__("Notebook cell shifted up successfully"),o.node))},isEnabled:e=>{const o=me(t,c,{...e,activate:!1});return!!o&&o.content.activeCellIndex>=1},icon:e=>e.toolbar?S.moveUpIcon:void 0}),s.addCommand(D.moveDown,{label:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Move Cell Down","Move Cells Down",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},caption:e=>{var o;const n=me(t,c,{...e,activate:!1});return i._n("Move this cell down","Move these %1 cells down",null!==(o=null==n?void 0:n.content.selectedCells.length)&&void 0!==o?o:1)},execute:e=>{const o=me(t,c,e);o&&(v.NotebookActions.moveDown(o.content),ge.raiseSilentNotification(i.__("Notebook cell shifted down successfully"),o.node))},isEnabled:e=>{const o=me(t,c,{...e,activate:!1});if(!o||!o.content.model)return!1;const n=o.content.model.cells.length;return o.content.activeCellIndex<n-1},icon:e=>e.toolbar?S.moveDownIcon:void 0}),s.addCommand(D.toggleAllLines,{label:i.__("Show Line Numbers"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.toggleAllLineNumbers(o.content)},isEnabled:d,isToggled:e=>{const o=me(t,c,{...e,activate:!1});if(o){const e=o.content.editorConfig;return!!(e.code.lineNumbers&&e.markdown.lineNumbers&&e.raw.lineNumbers)}return!1}}),s.addCommand(D.commandMode,{label:i.__("Enter Command Mode"),execute:e=>{const o=me(t,c,e);o&&(o.content.mode="command")},isEnabled:d}),s.addCommand(D.editMode,{label:i.__("Enter Edit Mode"),execute:e=>{const o=me(t,c,e);o&&(o.content.mode="edit")},isEnabled:d}),s.addCommand(D.undoCellAction,{label:i.__("Undo Cell Operation"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.undo(o.content)},isEnabled:d}),s.addCommand(D.redoCellAction,{label:i.__("Redo Cell Operation"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.redo(o.content)},isEnabled:d}),s.addCommand(D.redo,{label:i.__("Redo"),execute:e=>{var o;const n=me(t,c,e);if(n){const e=n.content.activeCell;if(e)return e.inputHidden=!1,null===(o=e.editor)||void 0===o?void 0:o.redo()}}}),s.addCommand(D.undo,{label:i.__("Undo"),execute:e=>{var o;const n=me(t,c,e);if(n){const e=n.content.activeCell;if(e)return e.inputHidden=!1,null===(o=e.editor)||void 0===o?void 0:o.undo()}}}),s.addCommand(D.changeKernel,{label:i.__("Change Kernel…"),execute:e=>{const o=me(t,c,e);if(o)return n.selectKernel(o.context.sessionContext)},isEnabled:d}),s.addCommand(D.getKernel,{label:i.__("Get Kernel"),execute:e=>{var o;const n=me(t,c,{activate:!1,...e});if(n)return null===(o=n.sessionContext.session)||void 0===o?void 0:o.kernel},isEnabled:d}),s.addCommand(D.reconnectToKernel,{label:i.__("Reconnect to Kernel"),execute:e=>{var o;const n=me(t,c,e);if(!n)return;const l=null===(o=n.context.sessionContext.session)||void 0===o?void 0:o.kernel;return l?l.reconnect():void 0},isEnabled:d}),s.addCommand(D.markdown1,{label:i.__("Change to Heading 1"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.setMarkdownHeader(o.content,1)},isEnabled:d}),s.addCommand(D.markdown2,{label:i.__("Change to Heading 2"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.setMarkdownHeader(o.content,2)},isEnabled:d}),s.addCommand(D.markdown3,{label:i.__("Change to Heading 3"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.setMarkdownHeader(o.content,3)},isEnabled:d}),s.addCommand(D.markdown4,{label:i.__("Change to Heading 4"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.setMarkdownHeader(o.content,4)},isEnabled:d}),s.addCommand(D.markdown5,{label:i.__("Change to Heading 5"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.setMarkdownHeader(o.content,5)},isEnabled:d}),s.addCommand(D.markdown6,{label:i.__("Change to Heading 6"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.setMarkdownHeader(o.content,6)},isEnabled:d}),s.addCommand(D.hideCode,{label:i.__("Collapse Selected Code"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.hideCode(o.content)},isEnabled:d}),s.addCommand(D.showCode,{label:i.__("Expand Selected Code"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.showCode(o.content)},isEnabled:d}),s.addCommand(D.hideAllCode,{label:i.__("Collapse All Code"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.hideAllCode(o.content)},isEnabled:d}),s.addCommand(D.showAllCode,{label:i.__("Expand All Code"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.showAllCode(o.content)},isEnabled:d}),s.addCommand(D.hideOutput,{label:i.__("Collapse Selected Outputs"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.hideOutput(o.content)},isEnabled:d}),s.addCommand(D.showOutput,{label:i.__("Expand Selected Outputs"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.showOutput(o.content)},isEnabled:d}),s.addCommand(D.hideAllOutputs,{label:i.__("Collapse All Outputs"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.hideAllOutputs(o.content)},isEnabled:d}),s.addCommand(D.toggleRenderSideBySideCurrentNotebook,{label:i.__("Render Side-by-Side"),execute:e=>{const o=me(t,c,e);if(o)return"side-by-side"===o.content.renderingLayout?v.NotebookActions.renderDefault(o.content):v.NotebookActions.renderSideBySide(o.content)},isEnabled:d,isToggled:e=>{const o=me(t,c,{...e,activate:!1});return!!o&&"side-by-side"===o.content.renderingLayout}}),s.addCommand(D.showAllOutputs,{label:i.__("Expand All Outputs"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.showAllOutputs(o.content)},isEnabled:d}),s.addCommand(D.enableOutputScrolling,{label:i.__("Enable Scrolling for Outputs"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.enableOutputScrolling(o.content)},isEnabled:d}),s.addCommand(D.disableOutputScrolling,{label:i.__("Disable Scrolling for Outputs"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.disableOutputScrolling(o.content)},isEnabled:d}),s.addCommand(D.selectLastRunCell,{label:i.__("Select current running or last run cell"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.selectLastRunCell(o.content)},isEnabled:d}),s.addCommand(D.replaceSelection,{label:i.__("Replace Selection in Notebook Cell"),execute:e=>{const o=me(t,c,e),n=e.text||"";if(o)return v.NotebookActions.replaceSelection(o.content,n)},isEnabled:d}),s.addCommand(D.toggleCollapseCmd,{label:i.__("Toggle Collapse Notebook Heading"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.toggleCurrentHeadingCollapse(o.content)},isEnabled:()=>ge.isEnabledAndHeadingSelected(c,t)}),s.addCommand(D.collapseAllCmd,{label:i.__("Collapse All Headings"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.collapseAllHeadings(o.content)}}),s.addCommand(D.expandAllCmd,{label:i.__("Expand All Headings"),execute:e=>{const o=me(t,c,e);if(o)return v.NotebookActions.expandAllHeadings(o.content)}}),s.addCommand(D.tocRunCells,{label:i.__("Select and Run Cell(s) for this Heading"),execute:e=>{const l=me(t,c,{activate:!1,...e});if(null===l)return;const r=l.content.activeCell;let d=l.content.activeCellIndex;if(r instanceof a.MarkdownCell){const e=l.content.widgets,t=r.headingInfo.level;for(let o=l.content.activeCellIndex+1;o<e.length;o++){const n=e[o];if(n instanceof a.MarkdownCell&&n.headingInfo.level>=0&&n.headingInfo.level<=t)break;d=o}}l.content.extendContiguousSelectionTo(d),v.NotebookActions.run(l.content,l.sessionContext,n,o)}}),s.addCommand(D.accessPreviousHistory,{label:i.__("Access Previous Kernel History Entry"),execute:async e=>{const o=me(t,c,e);if(o)return await v.NotebookActions.accessPreviousHistory(o.content)}}),s.addCommand(D.accessNextHistory,{label:i.__("Access Next Kernel History Entry"),execute:async e=>{const o=me(t,c,e);if(o)return await v.NotebookActions.accessNextHistory(o.content)}}),s.addCommand(D.virtualScrollbar,{label:i.__("Virtual Scrollbar"),caption:i.__("Toggle virtual scrollbar (enabled with windowing mode: full)"),execute:e=>{const o=me(t,c,e);o&&(o.content.scrollbar=!o.content.scrollbar)},icon:e=>e.toolbar?S.tableRowsIcon:void 0,isEnabled:e=>{var t;return(!!e.toolbar||d())&&null!==(t="full"===(null==r?void 0:r.composite.windowingMode))&&void 0!==t&&t},isVisible:e=>{var t;return(!!e.toolbar||d())&&null!==(t="full"===(null==r?void 0:r.composite.windowingMode))&&void 0!==t&&t}})}var ge;!function(e){e.createConsole=function(e,t,o){const n={path:t.context.path,preferredLanguage:t.context.model.defaultKernelLanguage,activate:o,ref:t.id,insertMode:"split-bottom",type:"Linked Console"};return e.execute("console:create",n)},e.isEnabled=function(e,t){return null!==t.currentWidget&&t.currentWidget===e.currentWidget},e.isEnabledAndSingleSelected=function(t,o){if(!e.isEnabled(t,o))return!1;const{content:n}=o.currentWidget,l=n.activeCellIndex;for(let e=0;e<n.widgets.length;++e)if(n.isSelected(n.widgets[e])&&e!==l)return!1;return!0},e.isEnabledAndHeadingSelected=function(t,o){if(!e.isEnabled(t,o))return!1;const{content:n}=o.currentWidget,l=n.activeCellIndex;if(!(n.activeCell instanceof a.MarkdownCell))return!1;for(let e=0;e<n.widgets.length;++e)if(n.isSelected(n.widgets[e])&&e!==l)return!1;return!0},e.getFormatLabels=function(e){const t=(e=e||y.nullTranslator).load("jupyterlab");return{html:t.__("HTML"),latex:t.__("LaTeX"),markdown:t.__("Markdown"),pdf:t.__("PDF"),rst:t.__("ReStructured Text"),script:t.__("Executable Script"),slides:t.__("Reveal.js Slides")}},e.raiseSilentNotification=function(e,t){const o=`sr-message-container-${t.id}`,n=document.getElementById(o)||document.createElement("div");n.getAttribute("id")!==o&&(n.classList.add("sr-only"),n.setAttribute("id",o),n.setAttribute("role","alert"),n.hidden=!0,t.appendChild(n)),n.innerText=e};class t extends T.Panel{constructor(e){super(),this._cell=null;const t=(e.translator||y.nullTranslator).load("jupyterlab");this._notebook=e.notebook,this._index=void 0!==e.index?e.index:-1,this._cell=e.cell||null,this.id=`LinkedOutputView-${N.UUID.uuid4()}`,this.title.label="Output View",this.title.icon=S.notebookIcon,this.title.caption=this._notebook.title.label?t.__("For Notebook: %1",this._notebook.title.label):t.__("For Notebook:"),this.addClass("jp-LinkedOutputView"),this._notebook.context.ready.then((()=>{if(this._cell||(this._cell=this._notebook.content.widgets[this._index]),!this._cell||"code"!==this._cell.model.type)return void this.dispose();const e=this._cell.cloneOutputArea();this.addWidget(e)}))}get index(){return this._cell?E.ArrayExt.findFirstIndex(this._notebook.content.widgets,(e=>e===this._cell)):this._index}get path(){return this._notebook.context.path}}e.ClonedOutputArea=t}(ge||(ge={}))}}]);
|