notebook 7.1.3__py3-none-any.whl → 7.2.0a0__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/1053.bundle.js +1 -1
- 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/1950.bundle.js +1 -1
- notebook/static/1958.bundle.js +1 -1
- notebook/static/2007.bundle.js +1 -1
- notebook/static/2065.bundle.js +1 -1
- notebook/static/2067.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/2512.bundle.js +1 -1
- notebook/static/2552.bundle.js +1 -1
- notebook/static/2557.bundle.js +743 -0
- notebook/static/2577.bundle.js +1 -1
- notebook/static/2607.bundle.js +1 -1
- notebook/static/2615.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/3466.bundle.js +1 -1
- notebook/static/3512.bundle.js +1 -1
- notebook/static/3654.bundle.js +1 -1
- notebook/static/3676.bundle.js +1 -1
- notebook/static/3680.bundle.js +1 -1
- 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/4588.bundle.js +1 -1
- notebook/static/4645.bundle.js +1 -1
- notebook/static/4670.bundle.js +1 -1
- 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/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/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/6139.bundle.js +1 -1
- notebook/static/62.bundle.js +1 -1
- notebook/static/6256.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/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/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/7394.bundle.js +1 -1
- notebook/static/7450.bundle.js +1 -1
- notebook/static/7543.bundle.js +1 -0
- notebook/static/7603.bundle.js +1 -1
- notebook/static/7639.bundle.js +1 -1
- 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/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/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/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 +134 -128
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +15 -15
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +10 -10
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +17 -17
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +12 -12
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +11 -11
- notebook-7.2.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.7788635067bbb0f78314.js +1 -0
- notebook-7.1.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.a1f037cc55c9ffb2e994.js → notebook-7.2.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.1e2ca839fc49c8dc7f13.js +1 -1
- notebook-7.2.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/993.b8375a7b921d370031f6.js +1 -0
- notebook-7.2.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.e5cd5d0bbfa59d2e79c6.js +1 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
- {notebook-7.1.3.dist-info → notebook-7.2.0a0.dist-info}/METADATA +2 -2
- {notebook-7.1.3.dist-info → notebook-7.2.0a0.dist-info}/RECORD +197 -197
- {notebook-7.1.3.dist-info → notebook-7.2.0a0.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/4558.bundle.js +0 -1
- notebook/static/5088.bundle.js +0 -1
- notebook/static/514.bundle.js +0 -1
- notebook/static/853.bundle.js +0 -1
- notebook-7.1.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/419.e980232a56ae53a39be0.js +0 -1
- notebook-7.1.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1a379d1d7dc566a197da.js +0 -1
- notebook-7.1.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.a1a4e0e795dca61023d3.js +0 -1
- /notebook/static/{1664.bundle.js.LICENSE.txt → 2557.bundle.js.LICENSE.txt} +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/applications/jupyter-notebook.desktop +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
- {notebook-7.1.3.data → notebook-7.2.0a0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
- {notebook-7.1.3.dist-info → notebook-7.2.0a0.dist-info}/entry_points.txt +0 -0
- {notebook-7.1.3.dist-info → notebook-7.2.0a0.dist-info}/licenses/LICENSE +0 -0
notebook/static/6139.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6139],{56139:(e,t,o)=>{o.r(t),o.d(t,{default:()=>g});var i,a=o(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6139],{56139:(e,t,o)=>{o.r(t),o.d(t,{default:()=>g});var i,a=o(11510),n=o(23051),r=o(9357),l=o(31721);!function(e){e.resetImage="imageviewer:reset-image",e.zoomIn="imageviewer:zoom-in",e.zoomOut="imageviewer:zoom-out",e.flipHorizontal="imageviewer:flip-horizontal",e.flipVertical="imageviewer:flip-vertical",e.rotateClockwise="imageviewer:rotate-clockwise",e.rotateCounterclockwise="imageviewer:rotate-counterclockwise",e.invertColors="imageviewer:invert-colors"}(i||(i={}));const c=["png","gif","jpeg","bmp","ico","tiff"],d="Image",s="Image (Text)",m=["svg","xbm"],u=new RegExp(`[.](${m.join("|")})$`),g={activate:function(e,t,o,a){const l=t.load("jupyterlab");function g(t,o){var i,a;o.context.pathChanged.connect((()=>{v.save(o)})),v.add(o);const n=e.docRegistry.getFileTypesForPath(o.context.path);n.length>0&&(o.title.icon=n[0].icon,o.title.iconClass=null!==(i=n[0].iconClass)&&void 0!==i?i:"",o.title.iconLabel=null!==(a=n[0].iconLabel)&&void 0!==a?a:"")}[new r.ImageViewerFactory({name:d,label:l.__("Image"),modelName:"base64",fileTypes:[...c,...m],defaultFor:c,readOnly:!0}),new r.ImageViewerFactory({name:s,label:l.__("Image (Text)"),modelName:"text",fileTypes:m,defaultFor:m,readOnly:!0})].forEach((t=>{e.docRegistry.addWidgetFactory(t),t.widgetCreated.connect(g)}));const v=new n.WidgetTracker({namespace:"image-widget"});if(a&&a.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:u.test(e.context.path)?s:d}),name:e=>e.context.path}),function(e,t,o){const i=o.load("jupyterlab"),{commands:a,shell:n}=e;function r(){return null!==t.currentWidget&&t.currentWidget===n.currentWidget}a.addCommand("imageviewer:zoom-in",{execute:function(){var e;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.content;o&&(o.scale=o.scale>1?o.scale+.5:2*o.scale)},label:i.__("Zoom In"),isEnabled:r}),a.addCommand("imageviewer:zoom-out",{execute:function(){var e;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.content;o&&(o.scale=o.scale>1?o.scale-.5:o.scale/2)},label:i.__("Zoom Out"),isEnabled:r}),a.addCommand("imageviewer:reset-image",{execute:function(){var e;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.content;o&&(o.scale=1,o.colorinversion=0,o.resetRotationFlip())},label:i.__("Reset Image"),isEnabled:r}),a.addCommand("imageviewer:rotate-clockwise",{execute:function(){var e;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.content;o&&o.rotateClockwise()},label:i.__("Rotate Clockwise"),isEnabled:r}),a.addCommand("imageviewer:rotate-counterclockwise",{execute:function(){var e;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.content;o&&o.rotateCounterclockwise()},label:i.__("Rotate Counterclockwise"),isEnabled:r}),a.addCommand("imageviewer:flip-horizontal",{execute:function(){var e;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.content;o&&o.flipHorizontal()},label:i.__("Flip image horizontally"),isEnabled:r}),a.addCommand("imageviewer:flip-vertical",{execute:function(){var e;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.content;o&&o.flipVertical()},label:i.__("Flip image vertically"),isEnabled:r}),a.addCommand("imageviewer:invert-colors",{execute:function(){var e;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.content;o&&(o.colorinversion+=1,o.colorinversion%=2)},label:i.__("Invert Colors"),isEnabled:r})}(e,v,t),o){const e=l.__("Image Viewer");[i.zoomIn,i.zoomOut,i.resetImage,i.rotateClockwise,i.rotateCounterclockwise,i.flipHorizontal,i.flipVertical,i.invertColors].forEach((t=>{o.addItem({command:t,category:e})}))}return v},description:"Adds image viewer and provide its tracker.",id:"@jupyterlab/imageviewer-extension:plugin",provides:r.IImageTracker,requires:[l.ITranslator],optional:[n.ICommandPalette,a.ILayoutRestorer],autoStart:!0}}}]);
|
notebook/static/62.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[62],{40062:(e,o,n)=>{n.r(o),n.d(o,{default:()=>c});var t,l=n(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[62],{40062:(e,o,n)=>{n.r(o),n.d(o,{default:()=>c});var t,l=n(11510),a=n(13532),d=n(9452),i=n(31721),s=n(36478);!function(e){e.displayNumbering="toc:display-numbering",e.displayH1Numbering="toc:display-h1-numbering",e.displayOutputNumbering="toc:display-outputs-numbering",e.showPanel="toc:show-panel",e.toggleCollapse="toc:toggle-collapse"}(t||(t={}));const r={id:"@jupyterlab/toc-extension:registry",description:"Provides the table of contents registry.",autoStart:!0,provides:d.ITableOfContentsRegistry,activate:()=>new d.TableOfContentsRegistry},u={id:"@jupyterlab/toc-extension:tracker",description:"Adds the table of content widget and provides its tracker.",autoStart:!0,provides:d.ITableOfContentsTracker,requires:[d.ITableOfContentsRegistry],optional:[i.ITranslator,l.ILayoutRestorer,l.ILabShell,a.ISettingRegistry],activate:async function(e,o,n,l,a,u){const c=(null!=n?n:i.nullTranslator).load("jupyterlab");let m={...d.TableOfContents.defaultConfig};const g=new d.TableOfContentsPanel(null!=n?n:void 0);function b(e){return e.headings.some((e=>{var o;return!(null!==(o=e.collapsed)&&void 0!==o&&o)}))}g.title.icon=s.tocIcon,g.title.caption=c.__("Table of Contents"),g.id="table-of-contents",g.node.setAttribute("role","region"),g.node.setAttribute("aria-label",c.__("Table of Contents section")),e.commands.addCommand(t.displayH1Numbering,{label:c.__("Show first-level heading number"),execute:()=>{g.model&&g.model.setConfiguration({numberingH1:!g.model.configuration.numberingH1})},isEnabled:()=>{var e,o;return null!==(o=null===(e=g.model)||void 0===e?void 0:e.supportedOptions.includes("numberingH1"))&&void 0!==o&&o},isToggled:()=>{var e,o;return null!==(o=null===(e=g.model)||void 0===e?void 0:e.configuration.numberingH1)&&void 0!==o&&o}}),e.commands.addCommand(t.displayNumbering,{label:c.__("Show heading number in the document"),icon:e=>e.toolbar?s.numberingIcon:void 0,execute:()=>{g.model&&(g.model.setConfiguration({numberHeaders:!g.model.configuration.numberHeaders}),e.commands.notifyCommandChanged(t.displayNumbering))},isEnabled:()=>{var e,o;return null!==(o=null===(e=g.model)||void 0===e?void 0:e.supportedOptions.includes("numberHeaders"))&&void 0!==o&&o},isToggled:()=>{var e,o;return null!==(o=null===(e=g.model)||void 0===e?void 0:e.configuration.numberHeaders)&&void 0!==o&&o}}),e.commands.addCommand(t.displayOutputNumbering,{label:c.__("Show output headings"),execute:()=>{g.model&&g.model.setConfiguration({includeOutput:!g.model.configuration.includeOutput})},isEnabled:()=>{var e,o;return null!==(o=null===(e=g.model)||void 0===e?void 0:e.supportedOptions.includes("includeOutput"))&&void 0!==o&&o},isToggled:()=>{var e,o;return null!==(o=null===(e=g.model)||void 0===e?void 0:e.configuration.includeOutput)&&void 0!==o&&o}}),e.commands.addCommand(t.showPanel,{label:c.__("Table of Contents"),execute:()=>{e.shell.activateById(g.id)}}),e.commands.addCommand(t.toggleCollapse,{label:()=>g.model&&!b(g.model)?c.__("Expand All Headings"):c.__("Collapse All Headings"),icon:e=>e.toolbar?g.model&&!b(g.model)?s.expandAllIcon:s.collapseAllIcon:void 0,execute:()=>{g.model&&(b(g.model)?g.model.toggleCollapse({collapsed:!0}):g.model.toggleCollapse({collapsed:!1}))},isEnabled:()=>null!==g.model});const p=new d.TableOfContentsTracker;let C;if(l&&l.add(g,"@jupyterlab/toc:plugin"),u)try{C=await u.load(r.id);const o=o=>{const n=o.composite;for(const e of[...Object.keys(m)]){const o=n[e];void 0!==o&&(m[e]=o)}if(a)for(const e of a.widgets("main")){const o=p.get(e);o&&o.setConfiguration(m)}else if(e.shell.currentWidget){const o=p.get(e.shell.currentWidget);o&&o.setConfiguration(m)}};C&&(C.changed.connect(o),o(C))}catch(e){console.error(`Failed to load settings for the Table of Contents extension.\n\n${e}`)}const f=new s.CommandToolbarButton({commands:e.commands,id:t.displayNumbering,args:{toolbar:!0},label:""});f.addClass("jp-toc-numberingButton"),g.toolbar.addItem("display-numbering",f),g.toolbar.addItem("spacer",s.Toolbar.createSpacerItem()),g.toolbar.addItem("collapse-all",new s.CommandToolbarButton({commands:e.commands,id:t.toggleCollapse,args:{toolbar:!0},label:""}));const v=new s.MenuSvg({commands:e.commands});v.addItem({command:t.displayH1Numbering}),v.addItem({command:t.displayOutputNumbering});const h=new s.ToolbarButton({tooltip:c.__("More actions…"),icon:s.ellipsesIcon,actualOnClick:!0,onClick:()=>{const e=h.node.getBoundingClientRect();v.open(e.x,e.bottom)}});return g.toolbar.addItem("submenu",h),e.shell.add(g,"left",{rank:400,type:"Table of Contents"}),a&&a.currentChanged.connect(y),e.restored.then((()=>{y()})),p;function y(){var n;let l=e.shell.currentWidget;if(!l)return;let a=p.get(l);a||(a=null!==(n=o.getModel(l,m))&&void 0!==n?n:null,a&&p.add(l,a),l.disposed.connect((()=>{null==a||a.dispose()}))),g.model&&(g.model.headingsChanged.disconnect(T),g.model.collapseChanged.disconnect(T)),g.model=a,g.model&&(g.model.headingsChanged.connect(T),g.model.collapseChanged.connect(T)),e.commands.notifyCommandChanged(t.displayNumbering),e.commands.notifyCommandChanged(t.toggleCollapse)}function T(){e.commands.notifyCommandChanged(t.toggleCollapse)}}},c=[r,u]}}]);
|
notebook/static/6256.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6256],{86256:(e,n,o)=>{o.r(n),o.d(n,{default:()=>S});var t=o(3053),r=o(12982),l=o(31536),s=o(76867),a=o(46122),i=o(97713),d=o(389),c=o(97104),u=o(70856),p=o(36768),m=o(71677),C=o(68239),v=o(33625),g=o(20998),h=o(2549),b=o(14421);const f={id:"@jupyterlab/console-extension:foreign",description:"Add foreign handler of IOPub messages to the console.",requires:[a.IConsoleTracker,p.ISettingRegistry,m.ITranslator],optional:[r.ICommandPalette],activate:function(e,n,o,t,r){const l=t.load("jupyterlab"),{shell:s}=e;n.widgetAdded.connect(((e,n)=>{const t=n.console,r=new a.ForeignHandler({sessionContext:t.sessionContext,parent:t});k.foreignHandlerProperty.set(t,r),o.get("@jupyterlab/console-extension:tracker","showAllKernelActivity").then((({composite:e})=>{const n=e;r.enabled=n})),t.disposed.connect((()=>{r.dispose()}))}));const{commands:i}=e,d=l.__("Console"),c="console:toggle-show-all-kernel-activity";i.addCommand(c,{label:e=>l.__("Show All Kernel Activity"),execute:e=>{const o=function(e){const o=n.currentWidget;return!1!==e.activate&&o&&s.activateById(o.id),o}(e);if(!o)return;const t=k.foreignHandlerProperty.get(o.console);t&&(t.enabled=!t.enabled)},isToggled:()=>{var e;return null!==n.currentWidget&&!!(null===(e=k.foreignHandlerProperty.get(n.currentWidget.console))||void 0===e?void 0:e.enabled)},isEnabled:()=>null!==n.currentWidget&&n.currentWidget===s.currentWidget}),r&&r.addItem({command:c,category:d,args:{isPalette:!0}})},autoStart:!0},y=f;var k,_;!function(e){e.foreignHandlerProperty=new b.AttachedProperty({name:"foreignHandler",create:()=>{}})}(k||(k={})),function(e){e.autoClosingBrackets="console:toggle-autoclosing-brackets",e.create="console:create",e.clear="console:clear",e.runUnforced="console:run-unforced",e.runForced="console:run-forced",e.linebreak="console:linebreak",e.interrupt="console:interrupt-kernel",e.restart="console:restart-kernel",e.closeAndShutdown="console:close-and-shutdown",e.open="console:open",e.inject="console:inject",e.changeKernel="console:change-kernel",e.getKernel="console:get-kernel",e.enterToExecute="console:enter-to-execute",e.shiftEnterToExecute="console:shift-enter-to-execute",e.interactionMode="console:interaction-mode",e.redo="console:redo",e.replaceSelection="console:replace-selection",e.shutdown="console:shutdown",e.undo="console:undo",e.invokeCompleter="completer:invoke-console",e.selectCompleter="completer:select-console"}(_||(_={}));const x={id:"@jupyterlab/console-extension:tracker",description:"Provides the console widget tracker.",provides:a.IConsoleTracker,requires:[a.ConsolePanel.IContentFactory,l.IEditorServices,u.IRenderMimeRegistry,p.ISettingRegistry],optional:[t.ILayoutRestorer,i.IDefaultFileBrowser,c.IMainMenu,r.ICommandPalette,d.ILauncher,t.ILabStatus,r.ISessionContextDialogs,C.IFormRendererRegistry,m.ITranslator],activate:async function(e,n,o,t,l,s,i,d,c,u,p,b,f,y){const k=null!=y?y:m.nullTranslator,x=k.load("jupyterlab"),w=e.serviceManager,{commands:I,shell:E}=e,S=x.__("Console"),P=null!=b?b:new r.SessionContextDialogs({translator:k}),M=new r.WidgetTracker({namespace:"console"});async function j(e){var r,s;await w.ready;const i=new a.ConsolePanel({manager:w,contentFactory:n,mimeTypeService:o.mimeTypeService,rendermime:t,sessionDialogs:P,translator:k,setBusy:null!==(r=p&&(()=>p.setBusy()))&&void 0!==r?r:void 0,...e}),d=(await l.get("@jupyterlab/console-extension:tracker","interactionMode")).composite;return i.console.node.dataset.jpInteractionMode=d,await M.add(i),i.sessionContext.propertyChanged.connect((()=>{M.save(i)})),E.add(i,"main",{ref:e.ref,mode:e.insertMode,activate:!1!==e.activate,type:null!==(s=e.type)&&void 0!==s?s:"Console"}),i}s&&s.restore(M,{command:_.create,args:e=>{const{path:n,name:o,kernelPreference:t}=e.console.sessionContext;return{path:n,name:o,kernelPreference:{...t}}},name:e=>{var n;return null!==(n=e.console.sessionContext.path)&&void 0!==n?n:g.UUID.uuid4()},when:w.ready}),u&&w.ready.then((()=>{let e=null;const n=()=>{e&&(e.dispose(),e=null);const n=w.kernelspecs.specs;if(n){e=new h.DisposableSet;for(const o in n.kernelspecs){const t=o===n.default?0:1/0,r=n.kernelspecs[o],l=r.resources["logo-svg"]||r.resources["logo-64x64"];e.add(u.add({command:_.create,args:{isLauncher:!0,kernelPreference:{name:o}},category:x.__("Console"),rank:t,kernelIconUrl:l,metadata:{kernel:g.JSONExt.deepCopy(r.metadata||{})}}))}}};n(),w.kernelspecs.specsChanged.connect(n)}));const T="@jupyterlab/console-extension:tracker";let A,K={};async function R(e){A=(await l.get(T,"interactionMode")).composite,K=(await l.get(T,"promptCellConfig")).composite;const n=e=>{var n,o;e.console.node.dataset.jpInteractionMode=A,e.console.editorConfig=K,null===(o=null===(n=e.console.promptCell)||void 0===n?void 0:n.editor)||void 0===o||o.setOptions(K)};e?n(e):M.forEach(n)}if(l.pluginChanged.connect(((e,n)=>{n===T&&R()})),await R(),f){const e=f.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");e&&f.addRenderer("@jupyterlab/console-extension:tracker.promptCellConfig",e)}function B(){return null!==M.currentWidget&&M.currentWidget===E.currentWidget}M.widgetAdded.connect(((e,n)=>{R(n)})),I.addCommand(_.autoClosingBrackets,{execute:async e=>{var n;K.autoClosingBrackets=!!(null!==(n=e.force)&&void 0!==n?n:!K.autoClosingBrackets),await l.set(T,"promptCellConfig",K)},label:x.__("Auto Close Brackets for Code Console Prompt"),isToggled:()=>K.autoClosingBrackets});let U=_.open;function W(e){const n=M.currentWidget;return!1!==e.activate&&n&&E.activateById(n.id),null!=n?n:null}I.addCommand(U,{label:x.__("Open a console for the provided `path`."),execute:e=>{const n=e.path,o=M.find((e=>{var o;return(null===(o=e.console.sessionContext.session)||void 0===o?void 0:o.path)===n}));return o?(!1!==e.activate&&E.activateById(o.id),o):w.ready.then((()=>(0,v.find)(w.sessions.running(),(e=>e.path===n))?j(e):Promise.reject(`No running kernel session for path: ${n}`)))}}),U=_.create,I.addCommand(U,{label:e=>{var n,o,t,r;if(e.isPalette)return x.__("New Console");if(e.isLauncher&&e.kernelPreference){const l=e.kernelPreference;return null!==(r=null===(t=null===(o=null===(n=w.kernelspecs)||void 0===n?void 0:n.specs)||void 0===o?void 0:o.kernelspecs[l.name||""])||void 0===t?void 0:t.display_name)&&void 0!==r?r:""}return x.__("Console")},icon:e=>e.isPalette?void 0:C.consoleIcon,execute:e=>{var n;return j({basePath:null!==(n=e.basePath||e.cwd||(null==i?void 0:i.model.path))&&void 0!==n?n:"",...e})}}),I.addCommand(_.undo,{execute:e=>{var n;const o=W(e);if(!o)return;const t=null===(n=o.console.promptCell)||void 0===n?void 0:n.editor;t&&t.undo()},isEnabled:e=>{var n,o,t;if(!B())return!1;const r=null===(t=null===(o=null===(n=W(e))||void 0===n?void 0:n.console)||void 0===o?void 0:o.promptCell)||void 0===t?void 0:t.editor;return!!r&&r.model.sharedModel.canUndo()},icon:C.undoIcon.bindprops({stylesheet:"menuItem"}),label:x.__("Undo")}),I.addCommand(_.redo,{execute:e=>{var n;const o=W(e);if(!o)return;const t=null===(n=o.console.promptCell)||void 0===n?void 0:n.editor;t&&t.redo()},isEnabled:e=>{var n,o,t;if(!B())return!1;const r=null===(t=null===(o=null===(n=W(e))||void 0===n?void 0:n.console)||void 0===o?void 0:o.promptCell)||void 0===t?void 0:t.editor;return!!r&&r.model.sharedModel.canRedo()},icon:C.redoIcon.bindprops({stylesheet:"menuItem"}),label:x.__("Redo")}),I.addCommand(_.clear,{label:x.__("Clear Console Cells"),execute:e=>{const n=W(e);n&&n.console.clear()},isEnabled:B}),I.addCommand(_.runUnforced,{label:x.__("Run Cell (unforced)"),execute:e=>{const n=W(e);if(n)return n.console.execute()},isEnabled:B}),I.addCommand(_.runForced,{label:x.__("Run Cell (forced)"),execute:e=>{const n=W(e);if(n)return n.console.execute(!0)},isEnabled:B}),I.addCommand(_.linebreak,{label:x.__("Insert Line Break"),execute:e=>{const n=W(e);n&&n.console.insertLinebreak()},isEnabled:B}),I.addCommand(_.replaceSelection,{label:x.__("Replace Selection in Console"),execute:e=>{const n=W(e);if(!n)return;const o=e.text||"";n.console.replaceSelection(o)},isEnabled:B}),I.addCommand(_.interrupt,{label:x.__("Interrupt Kernel"),execute:e=>{var n;const o=W(e);if(!o)return;const t=null===(n=o.console.sessionContext.session)||void 0===n?void 0:n.kernel;return t?t.interrupt():void 0},isEnabled:B}),I.addCommand(_.restart,{label:x.__("Restart Kernel…"),execute:e=>{const n=W(e);if(n)return P.restart(n.console.sessionContext)},isEnabled:B}),I.addCommand(_.shutdown,{label:x.__("Shut Down"),execute:e=>{const n=W(e);if(n)return n.console.sessionContext.shutdown()}}),I.addCommand(_.closeAndShutdown,{label:x.__("Close and Shut Down…"),execute:e=>{const n=W(e);if(n)return(0,r.showDialog)({title:x.__("Shut down the console?"),body:x.__('Are you sure you want to close "%1"?',n.title.label),buttons:[r.Dialog.cancelButton({ariaLabel:x.__("Cancel console Shut Down")}),r.Dialog.warnButton({ariaLabel:x.__("Confirm console Shut Down")})]}).then((e=>!!e.button.accept&&I.execute(_.shutdown,{activate:!1}).then((()=>(n.dispose(),!0)))))},isEnabled:B}),I.addCommand(_.inject,{label:x.__("Inject some code in a console."),execute:e=>{const n=e.path;M.find((o=>{var t;return(null===(t=o.console.sessionContext.session)||void 0===t?void 0:t.path)===n&&(!1!==e.activate&&E.activateById(o.id),o.console.inject(e.code,e.metadata),!0)}))},isEnabled:B}),I.addCommand(_.changeKernel,{label:x.__("Change Kernel…"),execute:e=>{const n=W(e);if(n)return P.selectKernel(n.console.sessionContext)},isEnabled:B}),I.addCommand(_.getKernel,{label:x.__("Get Kernel"),execute:e=>{var n;const o=W({activate:!1,...e});if(o)return null===(n=o.sessionContext.session)||void 0===n?void 0:n.kernel},isEnabled:B}),c&&[_.create,_.linebreak,_.clear,_.runUnforced,_.runForced,_.restart,_.interrupt,_.changeKernel,_.closeAndShutdown].forEach((e=>{c.addItem({command:e,category:S,args:{isPalette:!0}})})),d&&(d.fileMenu.closeAndCleaners.add({id:_.closeAndShutdown,isEnabled:B}),d.kernelMenu.kernelUsers.changeKernel.add({id:_.changeKernel,isEnabled:B}),d.kernelMenu.kernelUsers.clearWidget.add({id:_.clear,isEnabled:B}),d.kernelMenu.kernelUsers.interruptKernel.add({id:_.interrupt,isEnabled:B}),d.kernelMenu.kernelUsers.restartKernel.add({id:_.restart,isEnabled:B}),d.kernelMenu.kernelUsers.shutdownKernel.add({id:_.shutdown,isEnabled:B}),d.runMenu.codeRunners.run.add({id:_.runForced,isEnabled:B}),d.editMenu.clearers.clearCurrent.add({id:_.clear,isEnabled:B}),d.editMenu.undoers.redo.add({id:_.redo,isEnabled:B}),d.editMenu.undoers.undo.add({id:_.undo,isEnabled:B}),d.helpMenu.getKernel.add({id:_.getKernel,isEnabled:B}));const D={notebook:x.__("Execute with Shift+Enter"),terminal:x.__("Execute with Enter")};return I.addCommand(_.interactionMode,{label:e=>{var n;return null!==(n=D[e.interactionMode])&&void 0!==n?n:"Set the console interaction mode."},execute:async e=>{try{await l.set(T,"interactionMode",e.interactionMode)}catch(e){console.error(`Failed to set ${T}:keyMap - ${e.message}`)}},isToggled:e=>e.interactionMode===A}),M},autoStart:!0},w={id:"@jupyterlab/console-extension:factory",description:"Provides the console widget content factory.",provides:a.ConsolePanel.IContentFactory,requires:[l.IEditorServices],autoStart:!0,activate:(e,n)=>{const o=n.factoryService.newInlineEditor;return new a.ConsolePanel.ContentFactory({editorFactory:o})}},I={id:"@jupyterlab/console-extension:kernel-status",description:"Adds the console to the kernel status indicator model.",autoStart:!0,requires:[a.IConsoleTracker,r.IKernelStatusModel],activate:(e,n,o)=>{o.addSessionProvider((e=>e&&n.has(e)?e.sessionContext:null))}},E={id:"@jupyterlab/console-extension:cursor-position",description:"Adds the console to the code editor cursor position model.",autoStart:!0,requires:[a.IConsoleTracker,l.IPositionModel],activate:(e,n,o)=>{let t=null;o.addEditorProvider((async e=>{let r=null;if(e!==t){if(null==t||t.console.promptCellCreated.disconnect(o.update),t=null,e&&n.has(e)){e.console.promptCellCreated.connect(o.update);const n=e.console.promptCell;r=null,n&&(await n.ready,r=n.editor),t=e}}else if(e){const n=e.console.promptCell;r=null,n&&(await n.ready,r=n.editor)}return r}))}},S=[w,x,y,I,E,{id:"@jupyterlab/console-extension:completer",description:"Adds completion to the console.",autoStart:!0,requires:[a.IConsoleTracker],optional:[s.ICompletionProviderManager,m.ITranslator,r.ISanitizer],activate:function(e,n,o,t,l){if(!o)return;const s=(null!=t?t:m.nullTranslator).load("jupyterlab"),a=null!=l?l:new r.Sanitizer;e.commands.addCommand(_.invokeCompleter,{label:s.__("Display the completion helper."),execute:()=>{const e=n.currentWidget&&n.currentWidget.id;if(e)return o.invoke(e)}}),e.commands.addCommand(_.selectCompleter,{label:s.__("Select the completion suggestion."),execute:()=>{const e=n.currentWidget&&n.currentWidget.id;if(e)return o.select(e)}}),e.commands.addKeyBinding({command:_.selectCompleter,keys:["Enter"],selector:".jp-ConsolePanel .jp-mod-completer-active"});const i=async(e,n)=>{var t,r;const l={editor:null!==(r=null===(t=n.console.promptCell)||void 0===t?void 0:t.editor)&&void 0!==r?r:null,session:n.console.sessionContext.session,widget:n};await o.updateCompleter(l),n.console.promptCellCreated.connect(((e,t)=>{const r={editor:t.editor,session:e.sessionContext.session,widget:n,sanitzer:a};o.updateCompleter(r).catch(console.error)})),n.console.sessionContext.sessionChanged.connect((()=>{var e,t;const r={editor:null!==(t=null===(e=n.console.promptCell)||void 0===e?void 0:e.editor)&&void 0!==t?t:null,session:n.console.sessionContext.session,widget:n,sanitizer:a};o.updateCompleter(r).catch(console.error)}))};n.widgetAdded.connect(i),o.activeProvidersChanged.connect((()=>{n.forEach((e=>{i(0,e).catch((e=>console.error(e)))}))}))}}]}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6256],{86256:(e,n,o)=>{o.r(n),o.d(n,{default:()=>S});var t=o(11510),r=o(23051),l=o(93150),s=o(59492),a=o(23716),i=o(60546),d=o(74031),c=o(93954),u=o(1678),p=o(13532),m=o(31721),C=o(36478),v=o(33625),g=o(20998),h=o(2549),b=o(14421);const f={id:"@jupyterlab/console-extension:foreign",description:"Add foreign handler of IOPub messages to the console.",requires:[a.IConsoleTracker,p.ISettingRegistry,m.ITranslator],optional:[r.ICommandPalette],activate:function(e,n,o,t,r){const l=t.load("jupyterlab"),{shell:s}=e;n.widgetAdded.connect(((e,n)=>{const t=n.console,r=new a.ForeignHandler({sessionContext:t.sessionContext,parent:t});k.foreignHandlerProperty.set(t,r),o.get("@jupyterlab/console-extension:tracker","showAllKernelActivity").then((({composite:e})=>{const n=e;r.enabled=n})),t.disposed.connect((()=>{r.dispose()}))}));const{commands:i}=e,d=l.__("Console"),c="console:toggle-show-all-kernel-activity";i.addCommand(c,{label:e=>l.__("Show All Kernel Activity"),execute:e=>{const o=function(e){const o=n.currentWidget;return!1!==e.activate&&o&&s.activateById(o.id),o}(e);if(!o)return;const t=k.foreignHandlerProperty.get(o.console);t&&(t.enabled=!t.enabled)},isToggled:()=>{var e;return null!==n.currentWidget&&!!(null===(e=k.foreignHandlerProperty.get(n.currentWidget.console))||void 0===e?void 0:e.enabled)},isEnabled:()=>null!==n.currentWidget&&n.currentWidget===s.currentWidget}),r&&r.addItem({command:c,category:d,args:{isPalette:!0}})},autoStart:!0},y=f;var k,_;!function(e){e.foreignHandlerProperty=new b.AttachedProperty({name:"foreignHandler",create:()=>{}})}(k||(k={})),function(e){e.autoClosingBrackets="console:toggle-autoclosing-brackets",e.create="console:create",e.clear="console:clear",e.runUnforced="console:run-unforced",e.runForced="console:run-forced",e.linebreak="console:linebreak",e.interrupt="console:interrupt-kernel",e.restart="console:restart-kernel",e.closeAndShutdown="console:close-and-shutdown",e.open="console:open",e.inject="console:inject",e.changeKernel="console:change-kernel",e.getKernel="console:get-kernel",e.enterToExecute="console:enter-to-execute",e.shiftEnterToExecute="console:shift-enter-to-execute",e.interactionMode="console:interaction-mode",e.redo="console:redo",e.replaceSelection="console:replace-selection",e.shutdown="console:shutdown",e.undo="console:undo",e.invokeCompleter="completer:invoke-console",e.selectCompleter="completer:select-console"}(_||(_={}));const x={id:"@jupyterlab/console-extension:tracker",description:"Provides the console widget tracker.",provides:a.IConsoleTracker,requires:[a.ConsolePanel.IContentFactory,l.IEditorServices,u.IRenderMimeRegistry,p.ISettingRegistry],optional:[t.ILayoutRestorer,i.IDefaultFileBrowser,c.IMainMenu,r.ICommandPalette,d.ILauncher,t.ILabStatus,r.ISessionContextDialogs,C.IFormRendererRegistry,m.ITranslator],activate:async function(e,n,o,t,l,s,i,d,c,u,p,b,f,y){const k=null!=y?y:m.nullTranslator,x=k.load("jupyterlab"),w=e.serviceManager,{commands:I,shell:E}=e,S=x.__("Console"),P=null!=b?b:new r.SessionContextDialogs({translator:k}),M=new r.WidgetTracker({namespace:"console"});async function j(e){var r,s;await w.ready;const i=new a.ConsolePanel({manager:w,contentFactory:n,mimeTypeService:o.mimeTypeService,rendermime:t,sessionDialogs:P,translator:k,setBusy:null!==(r=p&&(()=>p.setBusy()))&&void 0!==r?r:void 0,...e}),d=(await l.get("@jupyterlab/console-extension:tracker","interactionMode")).composite;return i.console.node.dataset.jpInteractionMode=d,await M.add(i),i.sessionContext.propertyChanged.connect((()=>{M.save(i)})),E.add(i,"main",{ref:e.ref,mode:e.insertMode,activate:!1!==e.activate,type:null!==(s=e.type)&&void 0!==s?s:"Console"}),i}s&&s.restore(M,{command:_.create,args:e=>{const{path:n,name:o,kernelPreference:t}=e.console.sessionContext;return{path:n,name:o,kernelPreference:{...t}}},name:e=>{var n;return null!==(n=e.console.sessionContext.path)&&void 0!==n?n:g.UUID.uuid4()},when:w.ready}),u&&w.ready.then((()=>{let e=null;const n=()=>{e&&(e.dispose(),e=null);const n=w.kernelspecs.specs;if(n){e=new h.DisposableSet;for(const o in n.kernelspecs){const t=o===n.default?0:1/0,r=n.kernelspecs[o],l=r.resources["logo-svg"]||r.resources["logo-64x64"];e.add(u.add({command:_.create,args:{isLauncher:!0,kernelPreference:{name:o}},category:x.__("Console"),rank:t,kernelIconUrl:l,metadata:{kernel:g.JSONExt.deepCopy(r.metadata||{})}}))}}};n(),w.kernelspecs.specsChanged.connect(n)}));const T="@jupyterlab/console-extension:tracker";let A,K={};async function R(e){A=(await l.get(T,"interactionMode")).composite,K=(await l.get(T,"promptCellConfig")).composite;const n=e=>{var n,o;e.console.node.dataset.jpInteractionMode=A,e.console.editorConfig=K,null===(o=null===(n=e.console.promptCell)||void 0===n?void 0:n.editor)||void 0===o||o.setOptions(K)};e?n(e):M.forEach(n)}if(l.pluginChanged.connect(((e,n)=>{n===T&&R()})),await R(),f){const e=f.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");e&&f.addRenderer("@jupyterlab/console-extension:tracker.promptCellConfig",e)}function B(){return null!==M.currentWidget&&M.currentWidget===E.currentWidget}M.widgetAdded.connect(((e,n)=>{R(n)})),I.addCommand(_.autoClosingBrackets,{execute:async e=>{var n;K.autoClosingBrackets=!!(null!==(n=e.force)&&void 0!==n?n:!K.autoClosingBrackets),await l.set(T,"promptCellConfig",K)},label:x.__("Auto Close Brackets for Code Console Prompt"),isToggled:()=>K.autoClosingBrackets});let U=_.open;function W(e){const n=M.currentWidget;return!1!==e.activate&&n&&E.activateById(n.id),null!=n?n:null}I.addCommand(U,{label:x.__("Open a console for the provided `path`."),execute:e=>{const n=e.path,o=M.find((e=>{var o;return(null===(o=e.console.sessionContext.session)||void 0===o?void 0:o.path)===n}));return o?(!1!==e.activate&&E.activateById(o.id),o):w.ready.then((()=>(0,v.find)(w.sessions.running(),(e=>e.path===n))?j(e):Promise.reject(`No running kernel session for path: ${n}`)))}}),U=_.create,I.addCommand(U,{label:e=>{var n,o,t,r;if(e.isPalette)return x.__("New Console");if(e.isLauncher&&e.kernelPreference){const l=e.kernelPreference;return null!==(r=null===(t=null===(o=null===(n=w.kernelspecs)||void 0===n?void 0:n.specs)||void 0===o?void 0:o.kernelspecs[l.name||""])||void 0===t?void 0:t.display_name)&&void 0!==r?r:""}return x.__("Console")},icon:e=>e.isPalette?void 0:C.consoleIcon,execute:e=>{var n;return j({basePath:null!==(n=e.basePath||e.cwd||(null==i?void 0:i.model.path))&&void 0!==n?n:"",...e})}}),I.addCommand(_.undo,{execute:e=>{var n;const o=W(e);if(!o)return;const t=null===(n=o.console.promptCell)||void 0===n?void 0:n.editor;t&&t.undo()},isEnabled:e=>{var n,o,t;if(!B())return!1;const r=null===(t=null===(o=null===(n=W(e))||void 0===n?void 0:n.console)||void 0===o?void 0:o.promptCell)||void 0===t?void 0:t.editor;return!!r&&r.model.sharedModel.canUndo()},icon:C.undoIcon.bindprops({stylesheet:"menuItem"}),label:x.__("Undo")}),I.addCommand(_.redo,{execute:e=>{var n;const o=W(e);if(!o)return;const t=null===(n=o.console.promptCell)||void 0===n?void 0:n.editor;t&&t.redo()},isEnabled:e=>{var n,o,t;if(!B())return!1;const r=null===(t=null===(o=null===(n=W(e))||void 0===n?void 0:n.console)||void 0===o?void 0:o.promptCell)||void 0===t?void 0:t.editor;return!!r&&r.model.sharedModel.canRedo()},icon:C.redoIcon.bindprops({stylesheet:"menuItem"}),label:x.__("Redo")}),I.addCommand(_.clear,{label:x.__("Clear Console Cells"),execute:e=>{const n=W(e);n&&n.console.clear()},isEnabled:B}),I.addCommand(_.runUnforced,{label:x.__("Run Cell (unforced)"),execute:e=>{const n=W(e);if(n)return n.console.execute()},isEnabled:B}),I.addCommand(_.runForced,{label:x.__("Run Cell (forced)"),execute:e=>{const n=W(e);if(n)return n.console.execute(!0)},isEnabled:B}),I.addCommand(_.linebreak,{label:x.__("Insert Line Break"),execute:e=>{const n=W(e);n&&n.console.insertLinebreak()},isEnabled:B}),I.addCommand(_.replaceSelection,{label:x.__("Replace Selection in Console"),execute:e=>{const n=W(e);if(!n)return;const o=e.text||"";n.console.replaceSelection(o)},isEnabled:B}),I.addCommand(_.interrupt,{label:x.__("Interrupt Kernel"),execute:e=>{var n;const o=W(e);if(!o)return;const t=null===(n=o.console.sessionContext.session)||void 0===n?void 0:n.kernel;return t?t.interrupt():void 0},isEnabled:B}),I.addCommand(_.restart,{label:x.__("Restart Kernel…"),execute:e=>{const n=W(e);if(n)return P.restart(n.console.sessionContext)},isEnabled:B}),I.addCommand(_.shutdown,{label:x.__("Shut Down"),execute:e=>{const n=W(e);if(n)return n.console.sessionContext.shutdown()}}),I.addCommand(_.closeAndShutdown,{label:x.__("Close and Shut Down…"),execute:e=>{const n=W(e);if(n)return(0,r.showDialog)({title:x.__("Shut down the console?"),body:x.__('Are you sure you want to close "%1"?',n.title.label),buttons:[r.Dialog.cancelButton({ariaLabel:x.__("Cancel console Shut Down")}),r.Dialog.warnButton({ariaLabel:x.__("Confirm console Shut Down")})]}).then((e=>!!e.button.accept&&I.execute(_.shutdown,{activate:!1}).then((()=>(n.dispose(),!0)))))},isEnabled:B}),I.addCommand(_.inject,{label:x.__("Inject some code in a console."),execute:e=>{const n=e.path;M.find((o=>{var t;return(null===(t=o.console.sessionContext.session)||void 0===t?void 0:t.path)===n&&(!1!==e.activate&&E.activateById(o.id),o.console.inject(e.code,e.metadata),!0)}))},isEnabled:B}),I.addCommand(_.changeKernel,{label:x.__("Change Kernel…"),execute:e=>{const n=W(e);if(n)return P.selectKernel(n.console.sessionContext)},isEnabled:B}),I.addCommand(_.getKernel,{label:x.__("Get Kernel"),execute:e=>{var n;const o=W({activate:!1,...e});if(o)return null===(n=o.sessionContext.session)||void 0===n?void 0:n.kernel},isEnabled:B}),c&&[_.create,_.linebreak,_.clear,_.runUnforced,_.runForced,_.restart,_.interrupt,_.changeKernel,_.closeAndShutdown].forEach((e=>{c.addItem({command:e,category:S,args:{isPalette:!0}})})),d&&(d.fileMenu.closeAndCleaners.add({id:_.closeAndShutdown,isEnabled:B}),d.kernelMenu.kernelUsers.changeKernel.add({id:_.changeKernel,isEnabled:B}),d.kernelMenu.kernelUsers.clearWidget.add({id:_.clear,isEnabled:B}),d.kernelMenu.kernelUsers.interruptKernel.add({id:_.interrupt,isEnabled:B}),d.kernelMenu.kernelUsers.restartKernel.add({id:_.restart,isEnabled:B}),d.kernelMenu.kernelUsers.shutdownKernel.add({id:_.shutdown,isEnabled:B}),d.runMenu.codeRunners.run.add({id:_.runForced,isEnabled:B}),d.editMenu.clearers.clearCurrent.add({id:_.clear,isEnabled:B}),d.editMenu.undoers.redo.add({id:_.redo,isEnabled:B}),d.editMenu.undoers.undo.add({id:_.undo,isEnabled:B}),d.helpMenu.getKernel.add({id:_.getKernel,isEnabled:B}));const D={notebook:x.__("Execute with Shift+Enter"),terminal:x.__("Execute with Enter")};return I.addCommand(_.interactionMode,{label:e=>{var n;return null!==(n=D[e.interactionMode])&&void 0!==n?n:"Set the console interaction mode."},execute:async e=>{try{await l.set(T,"interactionMode",e.interactionMode)}catch(e){console.error(`Failed to set ${T}:keyMap - ${e.message}`)}},isToggled:e=>e.interactionMode===A}),M},autoStart:!0},w={id:"@jupyterlab/console-extension:factory",description:"Provides the console widget content factory.",provides:a.ConsolePanel.IContentFactory,requires:[l.IEditorServices],autoStart:!0,activate:(e,n)=>{const o=n.factoryService.newInlineEditor;return new a.ConsolePanel.ContentFactory({editorFactory:o})}},I={id:"@jupyterlab/console-extension:kernel-status",description:"Adds the console to the kernel status indicator model.",autoStart:!0,requires:[a.IConsoleTracker,r.IKernelStatusModel],activate:(e,n,o)=>{o.addSessionProvider((e=>e&&n.has(e)?e.sessionContext:null))}},E={id:"@jupyterlab/console-extension:cursor-position",description:"Adds the console to the code editor cursor position model.",autoStart:!0,requires:[a.IConsoleTracker,l.IPositionModel],activate:(e,n,o)=>{let t=null;o.addEditorProvider((async e=>{let r=null;if(e!==t){if(null==t||t.console.promptCellCreated.disconnect(o.update),t=null,e&&n.has(e)){e.console.promptCellCreated.connect(o.update);const n=e.console.promptCell;r=null,n&&(await n.ready,r=n.editor),t=e}}else if(e){const n=e.console.promptCell;r=null,n&&(await n.ready,r=n.editor)}return r}))}},S=[w,x,y,I,E,{id:"@jupyterlab/console-extension:completer",description:"Adds completion to the console.",autoStart:!0,requires:[a.IConsoleTracker],optional:[s.ICompletionProviderManager,m.ITranslator,r.ISanitizer],activate:function(e,n,o,t,l){if(!o)return;const s=(null!=t?t:m.nullTranslator).load("jupyterlab"),a=null!=l?l:new r.Sanitizer;e.commands.addCommand(_.invokeCompleter,{label:s.__("Display the completion helper."),execute:()=>{const e=n.currentWidget&&n.currentWidget.id;if(e)return o.invoke(e)}}),e.commands.addCommand(_.selectCompleter,{label:s.__("Select the completion suggestion."),execute:()=>{const e=n.currentWidget&&n.currentWidget.id;if(e)return o.select(e)}}),e.commands.addKeyBinding({command:_.selectCompleter,keys:["Enter"],selector:".jp-ConsolePanel .jp-mod-completer-active"});const i=async(e,n)=>{var t,r;const l={editor:null!==(r=null===(t=n.console.promptCell)||void 0===t?void 0:t.editor)&&void 0!==r?r:null,session:n.console.sessionContext.session,widget:n};await o.updateCompleter(l),n.console.promptCellCreated.connect(((e,t)=>{const r={editor:t.editor,session:e.sessionContext.session,widget:n,sanitzer:a};o.updateCompleter(r).catch(console.error)})),n.console.sessionContext.sessionChanged.connect((()=>{var e,t;const r={editor:null!==(t=null===(e=n.console.promptCell)||void 0===e?void 0:e.editor)&&void 0!==t?t:null,session:n.console.sessionContext.session,widget:n,sanitizer:a};o.updateCompleter(r).catch(console.error)}))};n.widgetAdded.connect(i),o.activeProvidersChanged.connect((()=>{n.forEach((e=>{i(0,e).catch((e=>console.error(e)))}))}))}}]}}]);
|
notebook/static/6271.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6271],{76271:(e,t,n)=>{n.r(t),n.d(t,{commonmarkLanguage:()=>je,deleteMarkupBackward:()=>et,insertNewlineContinueMarkup:()=>Ye,markdown:()=>rt,markdownKeymap:()=>tt,markdownLanguage:()=>Qe});var r,s=n(17811),i=n(30890),o=n(7201),a=n(56318),l=n(73887),h=n(66361);class f{static create(e,t,n,r,s){return new f(e,t,n,r+(r<<8)+e+(t<<4)|0,s,[],[])}constructor(e,t,n,r,s,i,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=s,this.children=i,this.positions=o,this.hashProp=[[l.NodeProp.contextHash,r]]}addChild(e,t){e.prop(l.NodeProp.contextHash)!=this.hash&&(e=new l.Tree(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new l.Tree(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new l.Tree(l.NodeType.none,e,t,n,this.hashProp)})}}!function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.URL=33]="URL",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel"}(r||(r={}));class c{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class d{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return m(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=9==this.text.charCodeAt(r)?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=9==this.text.charCodeAt(t)?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function u(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let s=(e.type==r.OrderedList?y:C)(n,t,!1);return s>0&&(e.type!=r.BulletList||L(n,t,!1)<0)&&n.text.charCodeAt(n.pos+s-1)==e.value}const p={[r.Blockquote]:(e,t,n)=>62==n.next&&(n.markers.push(J(r.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(g(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0),[r.ListItem]:(e,t,n)=>!(n.indent<n.baseIndent+e.value&&n.next>-1||(n.moveBaseColumn(n.baseIndent+e.value),0)),[r.OrderedList]:u,[r.BulletList]:u,[r.Document]:()=>!0};function g(e){return 32==e||9==e||10==e||13==e}function m(e,t=0){for(;t<e.length&&g(e.charCodeAt(t));)t++;return t}function k(e,t,n){for(;t>n&&g(e.charCodeAt(t-1));)t--;return t}function x(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(96==e.next)for(let n=t;n<e.text.length;n++)if(96==e.text.charCodeAt(n))return-1;return t}function b(e){return 62!=e.next?-1:32==e.text.charCodeAt(e.pos+1)?2:1}function L(e,t,n){if(42!=e.next&&45!=e.next&&95!=e.next)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!g(n))return-1}return n&&45==e.next&&T(e)>-1&&e.depth==t.stack.length||r<3?-1:1}function S(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function C(e,t,n){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!g(e.text.charCodeAt(e.pos+1))||!(!n||S(t,r.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?-1:1}function y(e,t,n){let s=e.pos,i=e.next;for(;i>=48&&i<=57;){if(s++,s==e.text.length)return-1;i=e.text.charCodeAt(s)}return s==e.pos||s>e.pos+9||46!=i&&41!=i||s<e.text.length-1&&!g(e.text.charCodeAt(s+1))||n&&!S(t,r.OrderedList)&&(e.skipSpace(s+1)==e.text.length||s>e.pos+1||49!=e.next)?-1:s+1-e.pos}function w(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&35==e.text.charCodeAt(t);)t++;if(t<e.text.length&&32!=e.text.charCodeAt(t))return-1;let n=t-e.pos;return n>6?-1:n}function T(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&g(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}const A=/^[ \t]*$/,I=/-->/,B=/\?>/,E=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,I],[/^\s*<\?/,B],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,A],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,A]];function P(e,t,n){if(60!=e.next)return-1;let r=e.text.slice(e.pos);for(let e=0,t=E.length-(n?1:0);e<t;e++)if(E[e][0].test(r))return e;return-1}function M(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function H(e,t,n){let s=e.length-1;s>=0&&e[s].to==t&&e[s].type==r.CodeText?e[s].to=n:e.push(J(r.CodeText,t,n))}const v={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let s=t.findColumn(n),i=e.lineStart+s,o=e.lineStart+t.text.length,a=[],l=[];for(H(a,i,o);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){H(l,e.lineStart-1,e.lineStart);for(let e of t.markers)l.push(e)}else{if(t.indent<n)break;{if(l.length){for(let e of l)e.type==r.CodeText?H(a,e.from,e.to):a.push(e);l=[]}H(a,e.lineStart-1,e.lineStart);for(let e of t.markers)a.push(e);o=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<o&&H(a,n,o)}}return l.length&&(l=l.filter((e=>e.type!=r.CodeText)),l.length&&(t.markers=l.concat(t.markers))),e.addNode(e.buffer.writeElements(a,-i).finish(r.CodeBlock,o-i),i),!0},FencedCode(e,t){let n=x(t);if(n<0)return!1;let s=e.lineStart+t.pos,i=t.next,o=n-t.pos,a=t.skipSpace(n),l=k(t.text,t.text.length,a),h=[J(r.CodeMark,s,s+o)];a<l&&h.push(J(r.CodeInfo,e.lineStart+a,e.lineStart+l));for(let n=!0;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=o&&t.skipSpace(s)==t.text.length){for(let e of t.markers)h.push(e);h.push(J(r.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{n||H(h,e.lineStart-1,e.lineStart);for(let e of t.markers)h.push(e);let r=e.lineStart+t.basePos,s=e.lineStart+t.text.length;r<s&&H(h,r,s)}}return e.addNode(e.buffer.writeElements(h,-s).finish(r.FencedCode,e.prevLineEnd()-s),s),!0},Blockquote(e,t){let n=b(t);return!(n<0)&&(e.startContext(r.Blockquote,t.pos),e.addNode(r.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(L(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(r.HorizontalRule,n),!0},BulletList(e,t){let n=C(t,e,!1);if(n<0)return!1;e.block.type!=r.BulletList&&e.startContext(r.BulletList,t.basePos,t.next);let s=M(t,t.pos+1);return e.startContext(r.ListItem,t.basePos,s-t.baseIndent),e.addNode(r.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(s),null},OrderedList(e,t){let n=y(t,e,!1);if(n<0)return!1;e.block.type!=r.OrderedList&&e.startContext(r.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let s=M(t,t.pos+n);return e.startContext(r.ListItem,t.basePos,s-t.baseIndent),e.addNode(r.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(s),null},ATXHeading(e,t){let n=w(t);if(n<0)return!1;let s=t.pos,i=e.lineStart+s,o=k(t.text,t.text.length,s),a=o;for(;a>s&&t.text.charCodeAt(a-1)==t.next;)a--;a!=o&&a!=s&&g(t.text.charCodeAt(a-1))||(a=t.text.length);let l=e.buffer.write(r.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(s+n+1,a),i+n+1),-i);a<t.text.length&&l.write(r.HeaderMark,a-s,o-s);let h=l.finish(r.ATXHeading1-1+n,t.text.length-s);return e.nextLine(),e.addNode(h,i),!0},HTMLBlock(e,t){let n=P(t,0,!1);if(n<0)return!1;let s=e.lineStart+t.pos,i=E[n][1],o=[],a=i!=A;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){a=!1;break}for(let e of t.markers)o.push(e)}a&&e.nextLine();let l=i==I?r.CommentBlock:i==B?r.ProcessingInstructionBlock:r.HTMLBlock,h=e.prevLineEnd();return e.addNode(e.buffer.writeElements(o,-s).finish(l,h-s),s),!0},SetextHeading:void 0};class N{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(-1==this.stage)return!1;let r=n.content+"\n"+t.scrub(),s=this.advance(r);return s>-1&&s<r.length&&this.complete(e,n,s)}finish(e,t){return(2==this.stage||3==this.stage)&&m(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,J(r.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(!1===e&&(this.stage=-1),!1)}advance(e){for(;;){if(-1==this.stage)return-1;if(0==this.stage){if(!this.nextStage(le(e,this.pos,this.start,!0)))return-1;if(58!=e.charCodeAt(this.pos))return this.stage=-1;this.elts.push(J(r.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else{if(1!=this.stage){if(2==this.stage){let t=m(e,this.pos),n=0;if(t>this.pos){let r=ae(e,t,this.start);if(r){let t=O(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||(n=O(e,this.pos)),n>0&&n<e.length?n:-1}return O(e,this.pos)}if(!this.nextStage(oe(e,m(e,this.pos),this.start)))return-1}}}}function O(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(10==n)break;if(!g(n))return-1}return t}class R{nextLine(e,t,n){let s=t.depth<e.stack.length?-1:T(t),i=t.next;if(s<0)return!1;let o=J(r.HeaderMark,e.lineStart+t.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(n,J(61==i?r.SetextHeading1:r.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const X={LinkReference:(e,t)=>91==t.content.charCodeAt(0)?new N(t):null,SetextHeading:()=>new R},D=[(e,t)=>w(t)>=0,(e,t)=>x(t)>=0,(e,t)=>b(t)>=0,(e,t)=>C(t,e,!0)>=0,(e,t)=>y(t,e,!0)>=0,(e,t)=>L(t,e,!0)>=0,(e,t)=>P(t,0,!0)>=0],z={text:"",end:0};class ${constructor(e,t,n,s){this.parser=e,this.input=t,this.ranges=s,this.line=new d,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=f.create(r.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new de(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(null!=this.stoppedAt&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(;e.depth<this.stack.length;)this.finishContext();for(let t of e.markers)this.addNode(t.type,t.from,t.to);if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(0!=n){if(1==n)return null;e.forward();continue e}}break}let t=new c(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4)for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e;for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+="\n"+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return!!t&&(this.absoluteLineStart+=t,this.lineStart=ue(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0)}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=z;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,s=this.lineChunkAt(r);t.end=r+s.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+s,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw new Error("Unhandled block context "+r[t.type]);if(!n(t,this,e))break;e.forward()}}lineChunkAt(e){let t,n=this.input.chunk(e);if(this.input.lineChunks)t="\n"==n?"":n;else{let e=n.indexOf("\n");t=e<0?n:n.slice(0,e)}return e+t.length>this.to?t.slice(0,this.to-e):t}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=f.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){"number"==typeof e&&(e=new l.Tree(this.parser.nodeSet.types[e],Z,Z,(null!=n?n:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(fe(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?U(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=fe(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(r.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return"string"==typeof e?J(this.parser.getNodeType(e),t,n,r):new G(e,t)}get buffer(){return new K(this.parser.nodeSet)}}function U(e,t,n,r,s){let i=e[t].to,o=[],a=[],h=n.from+r;function f(n,s){for(;s?n>=i:n>i;){let s=e[t+1].from-i;r+=s,n+=s,t++,i=e[t].to}}for(let l=n.firstChild;l;l=l.nextSibling){f(l.from+r,!0);let n,c=l.from+r,d=s.get(l.tree);d?n=d:l.to+r>i?(n=U(e,t,l,r,s),f(l.to+r,!1)):n=l.toTree(),o.push(n),a.push(c-h)}return f(n.to+r,!1),new l.Tree(n.type,o,a,n.to+r-h,n.tree?n.tree.propValues:void 0)}class F extends l.Parser{constructor(e,t,n,r,s,i,o,a,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=i,this.inlineParsers=o,this.inlineNames=a,this.wrappers=l,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new $(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let t=q(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:s}=this,i=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),f=this.inlineParsers.slice(),c=this.inlineNames.slice(),d=this.endLeafBlock.slice(),u=this.wrappers;if(_(t.defineNodes)){s=Object.assign({},s);let e,i=n.types.slice();for(let n of t.defineNodes){let{name:t,block:o,composite:a,style:f}="string"==typeof n?{name:n}:n;if(i.some((e=>e.name==t)))continue;a&&(s[i.length]=(e,t,n)=>a(t,n,e.value));let c=i.length,d=a?["Block","BlockContext"]:o?c>=r.ATXHeading1&&c<=r.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;i.push(l.NodeType.define({id:c,name:t,props:d&&[[l.NodeProp.group,d]]})),f&&(e||(e={}),Array.isArray(f)||f instanceof h.Tag?e[t]=f:Object.assign(e,f))}n=new l.NodeSet(i),e&&(n=n.extend((0,h.styleTags)(e)))}if(_(t.props)&&(n=n.extend(...t.props)),_(t.remove))for(let e of t.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(i[t]=o[t]=void 0),n>-1&&(f[n]=void 0)}if(_(t.parseBlock))for(let e of t.parseBlock){let t=a.indexOf(e.name);if(t>-1)i[t]=e.parse,o[t]=e.leaf;else{let t=e.before?j(a,e.before):e.after?j(a,e.after)+1:a.length-1;i.splice(t,0,e.parse),o.splice(t,0,e.leaf),a.splice(t,0,e.name)}e.endLeaf&&d.push(e.endLeaf)}if(_(t.parseInline))for(let e of t.parseInline){let t=c.indexOf(e.name);if(t>-1)f[t]=e.parse;else{let t=e.before?j(c,e.before):e.after?j(c,e.after)+1:c.length-1;f.splice(t,0,e.parse),c.splice(t,0,e.name)}}return t.wrap&&(u=u.concat(t.wrap)),new F(n,i,o,a,d,s,f,c,u)}getNodeType(e){let t=this.nodeTypes[e];if(null==t)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new he(this,e,t);e:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let s=r(n,t,e);if(s>=0){e=s;continue e}}e++}return n.resolveMarkers(0)}}function _(e){return null!=e&&e.length>0}function q(e){if(!Array.isArray(e))return e;if(0==e.length)return null;let t=q(e[0]);if(1==e.length)return t;let n=q(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||Z).concat(t||Z),s=t.wrap,i=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:s?i?(e,t,n,r)=>s(i(e,t,n,r),t,n,r):s:i}}function j(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let Q=[l.NodeType.none];for(let e,t=1;e=r[t];t++)Q[t]=l.NodeType.define({id:t,name:e,props:t>=r.Escape?[]:[[l.NodeProp.group,t in p?["Block","BlockContext"]:["Block","LeafBlock"]]],top:"Document"==e});const Z=[];class K{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+4*r),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return l.Tree.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}class V{constructor(e,t,n,r=Z){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new K(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}}class G{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Z}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function J(e,t,n,r){return new V(e,t,n,r)}const Y={resolve:"Emphasis",mark:"EmphasisMark"},W={resolve:"Emphasis",mark:"EmphasisMark"},ee={},te={};class ne{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}}let re=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{re=new RegExp("[\\p{Pc}|\\p{Pd}|\\p{Pe}|\\p{Pf}|\\p{Pi}|\\p{Po}|\\p{Ps}]","u")}catch(e){}const se={Escape(e,t,n){if(92!=t||n==e.end-1)return-1;let s=e.char(n+1);for(let t=0;t<32;t++)if("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".charCodeAt(t)==s)return e.append(J(r.Escape,n,n+2));return-1},Entity(e,t,n){if(38!=t)return-1;let s=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return s?e.append(J(r.Entity,n,n+1+s[0].length)):-1},InlineCode(e,t,n){if(96!=t||n&&96==e.char(n-1))return-1;let s=n+1;for(;s<e.end&&96==e.char(s);)s++;let i=s-n,o=0;for(;s<e.end;s++)if(96==e.char(s)){if(o++,o==i&&96!=e.char(s+1))return e.append(J(r.InlineCode,n,s+1,[J(r.CodeMark,n,n+i),J(r.CodeMark,s+1-i,s+1)]))}else o=0;return-1},HTMLTag(e,t,n){if(60!=t||n==e.end-1)return-1;let s=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(s);if(i)return e.append(J(r.URL,n,n+1+i[0].length));let o=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(s);if(o)return e.append(J(r.Comment,n,n+1+o[0].length));let a=/^\?[^]*?\?>/.exec(s);if(a)return e.append(J(r.ProcessingInstruction,n,n+1+a[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(s);return l?e.append(J(r.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(95!=t&&42!=t)return-1;let r=n+1;for(;e.char(r)==t;)r++;let s=e.slice(n-1,n),i=e.slice(r,r+1),o=re.test(s),a=re.test(i),l=/\s|^$/.test(s),h=/\s|^$/.test(i),f=!h&&(!a||l||o),c=!l&&(!o||h||a),d=f&&(42==t||!c||o),u=c&&(42==t||!f||a);return e.append(new ne(95==t?Y:W,n,r,(d?1:0)|(u?2:0)))},HardBreak(e,t,n){if(92==t&&10==e.char(n+1))return e.append(J(r.HardBreak,n,n+2));if(32==t){let t=n+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=n+2)return e.append(J(r.HardBreak,n,t+1))}return-1},Link:(e,t,n)=>91==t?e.append(new ne(ee,n,n+1,1)):-1,Image:(e,t,n)=>33==t&&91==e.char(n+1)?e.append(new ne(te,n,n+2,1)):-1,LinkEnd(e,t,n){if(93!=t)return-1;for(let t=e.parts.length-1;t>=0;t--){let s=e.parts[t];if(s instanceof ne&&(s.type==ee||s.type==te)){if(!s.side||e.skipSpace(s.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),o=e.parts[t]=ie(e,i,s.type==ee?r.Link:r.Image,s.from,n+1);if(s.type==ee)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof ne&&t.type==ee&&(t.side=0)}return o.to}}return-1}};function ie(e,t,n,s,i){let{text:o}=e,a=e.char(i),l=i;if(t.unshift(J(r.LinkMark,s,s+(n==r.Image?2:1))),t.push(J(r.LinkMark,i-1,i)),40==a){let n,s=e.skipSpace(i+1),a=oe(o,s-e.offset,e.offset);a&&(s=e.skipSpace(a.to),n=ae(o,s-e.offset,e.offset),n&&(s=e.skipSpace(n.to))),41==e.char(s)&&(t.push(J(r.LinkMark,i,i+1)),l=s+1,a&&t.push(a),n&&t.push(n),t.push(J(r.LinkMark,s,l)))}else if(91==a){let n=le(o,i-e.offset,e.offset,!1);n&&(t.push(n),l=n.to)}return J(n,s,l,t)}function oe(e,t,n){if(60==e.charCodeAt(t)){for(let s=t+1;s<e.length;s++){let i=e.charCodeAt(s);if(62==i)return J(r.URL,t+n,s+1+n);if(60==i||10==i)return!1}return null}{let s=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(g(n))break;if(t)t=!1;else if(40==n)s++;else if(41==n){if(!s)break;s--}else 92==n&&(t=!0)}return i>t?J(r.URL,t+n,i+n):i==e.length&&null}}function ae(e,t,n){let s=e.charCodeAt(t);if(39!=s&&34!=s&&40!=s)return!1;let i=40==s?41:s;for(let s=t+1,o=!1;s<e.length;s++){let a=e.charCodeAt(s);if(o)o=!1;else{if(a==i)return J(r.LinkTitle,t+n,s+1+n);92==a&&(o=!0)}}return null}function le(e,t,n,s){for(let i=!1,o=t+1,a=Math.min(e.length,o+999);o<a;o++){let a=e.charCodeAt(o);if(i)i=!1;else{if(93==a)return!s&&J(r.LinkLabel,t+n,o+1+n);if(s&&!g(a)&&(s=!1),91==a)return!1;92==a&&(i=!0)}}return null}class he{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new ne(e,t,n,(r?1:0)|(s?2:0)))}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof ne&&n.type.resolve&&2&n.side))continue;let r,s=n.type==Y||n.type==W,i=n.to-n.from,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof ne&&1&e.side&&e.type==n.type&&!(s&&(1&n.side||2&e.side)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){r=e;break}}if(!r)continue;let a=n.type.resolve,l=[],h=r.from,f=n.to;if(s){let e=Math.min(2,r.to-r.from,i);h=r.to-e,f=n.from+e,a=1==e?"Emphasis":"StrongEmphasis"}r.type.mark&&l.push(this.elt(r.type.mark,h,r.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof V&&l.push(this.parts[e]),this.parts[e]=null;n.type.mark&&l.push(this.elt(n.type.mark,n.from,f));let c=this.elt(a,h,f,l);this.parts[o]=s&&r.from!=h?new ne(r.type,r.from,h,r.side):null,(this.parts[t]=s&&n.to!=f?new ne(n.type,f,n.to,n.side):null)?this.parts.splice(t,0,c):this.parts[t]=c}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof V&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof ne&&n.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return m(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return"string"==typeof e?J(this.parser.getNodeType(e),t,n,r):new G(e,t)}}function fe(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof V&&(n[r]=new V(t.type,t.from,t.to,fe(t.children,[e])))}else n.splice(r++,0,e)}return n}const ce=[r.CodeBlock,r.ListItem,r.OrderedList,r.BulletList];class de{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(l.NodeProp.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,o=i,a=e.block.children.length,h=o,f=a;for(;;){if(t.to-n>s){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=ue(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new l.Tree(e.parser.nodeSet.types[r.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is("Block")&&(ce.indexOf(t.type.id)<0?(o=t.to-n,a=e.block.children.length):(o=h,a=f,h=t.to-n,f=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-i}}function ue(e,t){let n=e;for(let r=1;r<t.length;r++){let s=t[r-1].to,i=t[r].from;s<e&&(n-=i-s)}return n}const pe=(0,h.styleTags)({"Blockquote/...":h.tags.quote,HorizontalRule:h.tags.contentSeparator,"ATXHeading1/... SetextHeading1/...":h.tags.heading1,"ATXHeading2/... SetextHeading2/...":h.tags.heading2,"ATXHeading3/...":h.tags.heading3,"ATXHeading4/...":h.tags.heading4,"ATXHeading5/...":h.tags.heading5,"ATXHeading6/...":h.tags.heading6,"Comment CommentBlock":h.tags.comment,Escape:h.tags.escape,Entity:h.tags.character,"Emphasis/...":h.tags.emphasis,"StrongEmphasis/...":h.tags.strong,"Link/... Image/...":h.tags.link,"OrderedList/... BulletList/...":h.tags.list,"BlockQuote/...":h.tags.quote,"InlineCode CodeText":h.tags.monospace,URL:h.tags.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":h.tags.processingInstruction,"CodeInfo LinkLabel":h.tags.labelName,LinkTitle:h.tags.string,Paragraph:h.tags.content}),ge=new F(new l.NodeSet(Q).extend(pe),Object.keys(v).map((e=>v[e])),Object.keys(v).map((e=>X[e])),Object.keys(v),D,p,Object.keys(se).map((e=>se[e])),Object.keys(se),[]);function me(e,t,n){let r=[];for(let s=e.firstChild,i=t;;s=s.nextSibling){let e=s?s.from:n;if(e>i&&r.push({from:i,to:e}),!s)break;i=s.to}return r}const ke={resolve:"Strikethrough",mark:"StrikethroughMark"},xe={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":h.tags.strikethrough}},{name:"StrikethroughMark",style:h.tags.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(126!=t||126!=e.char(n+1)||126==e.char(n+2))return-1;let r=e.slice(n-1,n),s=e.slice(n+2,n+3),i=/\s|^$/.test(r),o=/\s|^$/.test(s),a=re.test(r),l=re.test(s);return e.addDelimiter(ke,n,n+2,!o&&(!l||i||a),!i&&(!a||o||l))},after:"Emphasis"}]};function be(e,t,n=0,r,s=0){let i=0,o=!0,a=-1,l=-1,h=!1,f=()=>{r.push(e.elt("TableCell",s+a,s+l,e.parser.parseInline(t.slice(a,l),s+a)))};for(let c=n;c<t.length;c++){let n=t.charCodeAt(c);124!=n||h?(h||32!=n&&9!=n)&&(a<0&&(a=c),l=c+1):((!o||a>-1)&&i++,o=!1,r&&(a>-1&&f(),r.push(e.elt("TableDelimiter",c+s,c+s+1))),a=l=-1),h=!h&&92==n}return a>-1&&(i++,r&&f()),i}function Le(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(124==t)return!0;92==t&&n++}return!1}const Se=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Ce{constructor(){this.rows=null}nextLine(e,t,n){if(null==this.rows){let r;if(this.rows=!1,(45==t.next||58==t.next||124==t.next)&&Se.test(r=t.text.slice(t.pos))){let s=[];be(e,n.content,0,s,n.start)==be(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];be(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return!!this.rows&&(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0)}}const ye={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":h.tags.heading}},"TableRow",{name:"TableCell",style:h.tags.content},{name:"TableDelimiter",style:h.tags.processingInstruction}],parseBlock:[{name:"Table",leaf:(e,t)=>Le(t.content,0)?new Ce:null,endLeaf(e,t,n){if(n.parsers.some((e=>e instanceof Ce))||!Le(t.text,t.basePos))return!1;let r=e.scanLine(e.absoluteLineEnd+1).text;return Se.test(r)&&be(e,t.text,t.basePos)==be(e,r,t.basePos)},before:"SetextHeading"}]};class we{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const Te={defineNodes:[{name:"Task",block:!0,style:h.tags.list},{name:"TaskMarker",style:h.tags.atom}],parseBlock:[{name:"TaskList",leaf:(e,t)=>/^\[[ xX]\][ \t]/.test(t.content)&&"ListItem"==e.parentType().name?new we:null,after:"SetextHeading"}]},Ae=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,Ie=/[\w-]+(\.\w+(\.\w+)?)(\/[^\s<]*)?/gy,Be=/[\w.+-]+@[\w-]+\.[\w.-]+/gy,Ee=/\/[a-zA-Z\d@.]+/gy;function Pe(e,t,n,r){let s=0;for(let i=t;i<n;i++)e[i]==r&&s++;return s}function Me(e,t){Be.lastIndex=t;let n=Be.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return"_"==r||"-"==r?-1:t+n[0].length-("."==r?1:0)}const He=[ye,Te,xe,{parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;Ae.lastIndex=r;let s=Ae.exec(e.text),i=-1;return s?(s[1]||s[2]?i=function(e,t){Ie.lastIndex=t;let n=Ie.exec(e);if(!n)return-1;let r=t+n[0].length;for(;;){let n,s=e[r-1];if(/[?!.,:*_~]/.test(s)||")"==s&&Pe(e,t,r,")")>Pe(e,t,r,"("))r--;else{if(";"!=s||!(n=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))break;r=t+n.index}}return r}(e.text,r+s[0].length):s[3]?i=Me(e.text,r):(i=Me(e.text,r+s[0].length),i>-1&&"xmpp:"==s[0]&&(Ee.lastIndex=i,s=Ee.exec(e.text),s&&(i=s.index+s[0].length))),i<0?-1:(e.addElement(e.elt("URL",n,i+e.offset)),i+e.offset)):-1}}]}];function ve(e,t,n){return(r,s,i)=>{if(s!=e||r.char(i+1)==e)return-1;let o=[r.elt(n,i,i+1)];for(let s=i+1;s<r.end;s++){let a=r.char(s);if(a==e)return r.addElement(r.elt(t,i,s+1,o.concat(r.elt(n,s,s+1))));if(92==a&&o.push(r.elt("Escape",s,2+s++)),g(a))break}return-1}}const Ne={defineNodes:[{name:"Superscript",style:h.tags.special(h.tags.content)},{name:"SuperscriptMark",style:h.tags.processingInstruction}],parseInline:[{name:"Superscript",parse:ve(94,"Superscript","SuperscriptMark")}]},Oe={defineNodes:[{name:"Subscript",style:h.tags.special(h.tags.content)},{name:"SubscriptMark",style:h.tags.processingInstruction}],parseInline:[{name:"Subscript",parse:ve(126,"Subscript","SubscriptMark")}]},Re={defineNodes:[{name:"Emoji",style:h.tags.character}],parseInline:[{name:"Emoji",parse(e,t,n){let r;return 58==t&&(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?e.addElement(e.elt("Emoji",n,n+1+r[0].length)):-1}}]};var Xe=n(77866);const De=(0,o.defineLanguageFacet)({commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}}}),ze=new l.NodeProp,$e=ge.configure({props:[o.foldNodeProp.add((e=>!e.is("Block")||e.is("Document")||null!=Ue(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to}))),ze.add(Ue),o.indentNodeProp.add({Document:()=>null}),o.languageDataProp.add({Document:De})]});function Ue(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Fe(e,t){let n=e;for(;;){let e,r=n.nextSibling;if(!r||null!=(e=Ue(r.type))&&e<=t)break;n=r}return n.to}const _e=o.foldService.of(((e,t,n)=>{for(let r=(0,o.syntaxTree)(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(ze);if(null==e)continue;let t=Fe(r,e);if(t>n)return{from:n,to:t}}return null}));function qe(e){return new o.Language(De,e,[_e],"markdown")}const je=qe($e),Qe=qe($e.configure([He,Oe,Ne,Re]));class Ze{constructor(e,t,n,r,s,i,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=i,this.item=o}blank(e,t=!0){let n=this.spaceBefore+("Blockquote"==this.node.name?">":"");if(null!=e){for(;n.length<e;)n+=" ";return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=" ";return n+(t?this.spaceAfter:"")}marker(e,t){let n="OrderedList"==this.node.name?String(+Ve(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Ke(e,t){let n=[];for(let t=e;t&&"Document"!=t.name;t=t.parent)"ListItem"!=t.name&&"Blockquote"!=t.name&&"FencedCode"!=t.name||n.push(t);let r=[];for(let e=n.length-1;e>=0;e--){let s,i=n[e],o=t.lineAt(i.from),a=i.from-o.from;if("FencedCode"==i.name)r.push(new Ze(i,a,a,"","","",null));else if("Blockquote"==i.name&&(s=/^ *>( ?)/.exec(o.text.slice(a))))r.push(new Ze(i,a,a+s[0].length,"",s[1],">",null));else if("ListItem"==i.name&&"OrderedList"==i.parent.name&&(s=/^( *)\d+([.)])( *)/.exec(o.text.slice(a)))){let e=s[3],t=s[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new Ze(i.parent,a,a+t,s[1],e,s[2],i))}else if("ListItem"==i.name&&"BulletList"==i.parent.name&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(a)))){let e=s[4],t=s[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=s[2];s[3]&&(n+=s[3].replace(/[xX]/," ")),r.push(new Ze(i.parent,a,a+t,s[1],e,n,i))}}return r}function Ve(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Ge(e,t,n,r=0){for(let s=-1,i=e;;){if("ListItem"==i.name){let e=Ve(i,t),o=+e[2];if(s>=0){if(o!=s+1)return;n.push({from:i.from+e[1].length,to:i.from+e[0].length,insert:String(s+2+r)})}s=o}let e=i.nextSibling;if(!e)break;i=e}}function Je(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||"\t"!=t.facet(o.indentUnit))return e;let r="";for(let t=(0,s.countColumn)(e,4,n);t>0;)t>=4?(r+="\t",t-=4):(r+=" ",t--);return r+e.slice(n)}const Ye=({state:e,dispatch:t})=>{let n=(0,o.syntaxTree)(e),{doc:r}=e,i=null,a=e.changeByRange((t=>{if(!t.empty||!Qe.isActiveAt(e,t.from))return i={range:t};let o=t.from,a=r.lineAt(o),l=Ke(n.resolveInner(o,-1),r);for(;l.length&&l[l.length-1].from>o-a.from;)l.pop();if(!l.length)return i={range:t};let h=l[l.length-1];if(h.to-h.spaceAfter.length>o-a.from)return i={range:t};let f=o>=h.to-h.spaceAfter.length&&!/\S/.test(a.text.slice(h.to));if(h.item&&f){if(h.node.firstChild.to>=o||a.from>0&&!/[^\s>]/.test(r.lineAt(a.from-1).text)){let e,t=l.length>1?l[l.length-2]:null,n="";t&&t.item?(e=a.from+t.from,n=t.marker(r,1)):e=a.from+(t?t.to:0);let i=[{from:e,to:o,insert:n}];return"OrderedList"==h.node.name&&Ge(h.item,r,i,-2),t&&"OrderedList"==t.node.name&&Ge(t.item,r,i),{range:s.EditorSelection.cursor(e+n.length),changes:i}}{let t="";for(let e=0,n=l.length-2;e<=n;e++)t+=l[e].blank(e<n?(0,s.countColumn)(a.text,4,l[e+1].from)-t.length:null,e<n);return t=Je(t,e),{range:s.EditorSelection.cursor(o+t.length+1),changes:{from:a.from,insert:t+e.lineBreak}}}}if("Blockquote"==h.node.name&&f&&a.from){let n=r.lineAt(a.from-1),s=/>\s*$/.exec(n.text);if(s&&s.index==h.from){let r=e.changes([{from:n.from+s.index,to:n.to},{from:a.from+h.from,to:a.to}]);return{range:t.map(r),changes:r}}}let c=[];"OrderedList"==h.node.name&&Ge(h.item,r,c);let d=h.item&&h.item.from<a.from,u="";if(!d||/^[\s\d.)\-+*>]*/.exec(a.text)[0].length>=h.to)for(let e=0,t=l.length-1;e<=t;e++)u+=e!=t||d?l[e].blank(e<t?(0,s.countColumn)(a.text,4,l[e+1].from)-u.length:null):l[e].marker(r,1);let p=o;for(;p>a.from&&/\s/.test(a.text.charAt(p-a.from-1));)p--;return u=Je(u,e),c.push({from:p,to:o,insert:e.lineBreak+u}),{range:s.EditorSelection.cursor(p+u.length+1),changes:c}}));return!i&&(t(e.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)};function We(e){return"QuoteMark"==e.name||"ListMark"==e.name}const et=({state:e,dispatch:t})=>{let n=(0,o.syntaxTree)(e),r=null,i=e.changeByRange((t=>{let i=t.from,{doc:o}=e;if(t.empty&&Qe.isActiveAt(e,t.from)){let t=o.lineAt(i),r=Ke(function(e,t){let n=e.resolveInner(t,-1),r=t;We(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(We(e))r=e.from;else{if("OrderedList"!=e.name&&"BulletList"!=e.name)break;n=e.lastChild,r=n.to}return n}(n,i),o);if(r.length){let n=r[r.length-1],o=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(i-t.from>o&&!/\S/.test(t.text.slice(o,i-t.from)))return{range:s.EditorSelection.cursor(t.from+o),changes:{from:t.from+o,to:i}};if(i-t.from==o&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank((0,s.countColumn)(t.text,4,n.to)-(0,s.countColumn)(t.text,4,n.from));return r==t.from&&(i=Je(i,e)),{range:s.EditorSelection.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:s.EditorSelection.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}}));return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},tt=[{key:"Enter",run:Ye},{key:"Backspace",run:et}],nt=(0,Xe.html)({matchClosingTags:!1});function rt(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:a=!0,base:{parser:h}=je,completeHTMLTags:f=!0}=e;if(!(h instanceof F))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c,d=e.extensions?[e.extensions]:[],u=[nt.support];n instanceof o.LanguageSupport?(u.push(n.support),c=n.language):n&&(c=n);let p=t||c?(g=t,m=c,e=>{if(e&&g){let t=null;if(e=/\S*/.exec(e)[0],t="function"==typeof g?g(e):o.LanguageDescription.matchLanguageName(g,e,!0),t instanceof o.LanguageDescription)return t.support?t.support.language.parser:o.ParseContext.getSkippingParser(t.load());if(t)return t.parser}return m?m.parser:null}):void 0;var g,m;d.push(function(e){let{codeParser:t,htmlParser:n}=e,s=(0,l.parseMixed)(((e,s)=>{let i=e.type.id;if(!t||i!=r.CodeBlock&&i!=r.FencedCode){if(n&&(i==r.HTMLBlock||i==r.HTMLTag))return{parser:n,overlay:me(e.node,e.from,e.to)}}else{let n="";if(i==r.FencedCode){let t=e.node.getChild(r.CodeInfo);t&&(n=s.read(t.from,t.to))}let o=t(n);if(o)return{parser:o,overlay:e=>e.type.id==r.CodeText}}return null}));return{wrap:s}}({codeParser:p,htmlParser:nt.language.parser})),a&&u.push(s.Prec.high(i.keymap.of(tt)));let k=qe(h.configure(d));return f&&u.push(k.data.of({autocomplete:st})),new o.LanguageSupport(k,u)}function st(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=(0,o.syntaxTree)(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if("CodeBlock"==s.name||"FencedCode"==s.name||"ProcessingInstructionBlock"==s.name||"CommentBlock"==s.name||"Link"==s.name||"Image"==s.name)return null;s=s.parent}return{from:n-r[0].length,to:n,options:ot(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let it=null;function ot(){if(it)return it;let e=(0,Xe.htmlCompletionSource)(new a.TK(s.EditorState.create({extensions:nt}),0,!0));return it=e?e.options:[]}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6271],{76271:(e,t,n)=>{n.r(t),n.d(t,{commonmarkLanguage:()=>Qe,deleteMarkupBackward:()=>nt,insertNewlineContinueMarkup:()=>We,markdown:()=>it,markdownKeymap:()=>rt,markdownLanguage:()=>Ze});var r,s=n(89843),i=n(3546),o=n(17592),a=n(56318),l=n(79352),h=n(92209);class f{static create(e,t,n,r,s){return new f(e,t,n,r+(r<<8)+e+(t<<4)|0,s,[],[])}constructor(e,t,n,r,s,i,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=s,this.children=i,this.positions=o,this.hashProp=[[l.NodeProp.contextHash,r]]}addChild(e,t){e.prop(l.NodeProp.contextHash)!=this.hash&&(e=new l.Tree(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new l.Tree(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new l.Tree(l.NodeType.none,e,t,n,this.hashProp)})}}!function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"}(r||(r={}));class d{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class c{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return m(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=9==this.text.charCodeAt(r)?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=9==this.text.charCodeAt(t)?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function u(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let s=(e.type==r.OrderedList?y:C)(n,t,!1);return s>0&&(e.type!=r.BulletList||b(n,t,!1)<0)&&n.text.charCodeAt(n.pos+s-1)==e.value}const p={[r.Blockquote]:(e,t,n)=>62==n.next&&(n.markers.push(J(r.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(g(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0),[r.ListItem]:(e,t,n)=>!(n.indent<n.baseIndent+e.value&&n.next>-1||(n.moveBaseColumn(n.baseIndent+e.value),0)),[r.OrderedList]:u,[r.BulletList]:u,[r.Document]:()=>!0};function g(e){return 32==e||9==e||10==e||13==e}function m(e,t=0){for(;t<e.length&&g(e.charCodeAt(t));)t++;return t}function k(e,t,n){for(;t>n&&g(e.charCodeAt(t-1));)t--;return t}function x(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(96==e.next)for(let n=t;n<e.text.length;n++)if(96==e.text.charCodeAt(n))return-1;return t}function L(e){return 62!=e.next?-1:32==e.text.charCodeAt(e.pos+1)?2:1}function b(e,t,n){if(42!=e.next&&45!=e.next&&95!=e.next)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!g(n))return-1}return n&&45==e.next&&T(e)>-1&&e.depth==t.stack.length||r<3?-1:1}function S(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function C(e,t,n){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!g(e.text.charCodeAt(e.pos+1))||!(!n||S(t,r.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?-1:1}function y(e,t,n){let s=e.pos,i=e.next;for(;i>=48&&i<=57;){if(s++,s==e.text.length)return-1;i=e.text.charCodeAt(s)}return s==e.pos||s>e.pos+9||46!=i&&41!=i||s<e.text.length-1&&!g(e.text.charCodeAt(s+1))||n&&!S(t,r.OrderedList)&&(e.skipSpace(s+1)==e.text.length||s>e.pos+1||49!=e.next)?-1:s+1-e.pos}function w(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&35==e.text.charCodeAt(t);)t++;if(t<e.text.length&&32!=e.text.charCodeAt(t))return-1;let n=t-e.pos;return n>6?-1:n}function T(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&g(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}const A=/^[ \t]*$/,I=/-->/,B=/\?>/,E=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,I],[/^\s*<\?/,B],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,A],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,A]];function P(e,t,n){if(60!=e.next)return-1;let r=e.text.slice(e.pos);for(let e=0,t=E.length-(n?1:0);e<t;e++)if(E[e][0].test(r))return e;return-1}function M(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function H(e,t,n){let s=e.length-1;s>=0&&e[s].to==t&&e[s].type==r.CodeText?e[s].to=n:e.push(J(r.CodeText,t,n))}const v={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let s=t.findColumn(n),i=e.lineStart+s,o=e.lineStart+t.text.length,a=[],l=[];for(H(a,i,o);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){H(l,e.lineStart-1,e.lineStart);for(let e of t.markers)l.push(e)}else{if(t.indent<n)break;{if(l.length){for(let e of l)e.type==r.CodeText?H(a,e.from,e.to):a.push(e);l=[]}H(a,e.lineStart-1,e.lineStart);for(let e of t.markers)a.push(e);o=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<o&&H(a,n,o)}}return l.length&&(l=l.filter((e=>e.type!=r.CodeText)),l.length&&(t.markers=l.concat(t.markers))),e.addNode(e.buffer.writeElements(a,-i).finish(r.CodeBlock,o-i),i),!0},FencedCode(e,t){let n=x(t);if(n<0)return!1;let s=e.lineStart+t.pos,i=t.next,o=n-t.pos,a=t.skipSpace(n),l=k(t.text,t.text.length,a),h=[J(r.CodeMark,s,s+o)];a<l&&h.push(J(r.CodeInfo,e.lineStart+a,e.lineStart+l));for(let n=!0;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=o&&t.skipSpace(s)==t.text.length){for(let e of t.markers)h.push(e);h.push(J(r.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{n||H(h,e.lineStart-1,e.lineStart);for(let e of t.markers)h.push(e);let r=e.lineStart+t.basePos,s=e.lineStart+t.text.length;r<s&&H(h,r,s)}}return e.addNode(e.buffer.writeElements(h,-s).finish(r.FencedCode,e.prevLineEnd()-s),s),!0},Blockquote(e,t){let n=L(t);return!(n<0)&&(e.startContext(r.Blockquote,t.pos),e.addNode(r.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(b(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(r.HorizontalRule,n),!0},BulletList(e,t){let n=C(t,e,!1);if(n<0)return!1;e.block.type!=r.BulletList&&e.startContext(r.BulletList,t.basePos,t.next);let s=M(t,t.pos+1);return e.startContext(r.ListItem,t.basePos,s-t.baseIndent),e.addNode(r.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(s),null},OrderedList(e,t){let n=y(t,e,!1);if(n<0)return!1;e.block.type!=r.OrderedList&&e.startContext(r.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let s=M(t,t.pos+n);return e.startContext(r.ListItem,t.basePos,s-t.baseIndent),e.addNode(r.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(s),null},ATXHeading(e,t){let n=w(t);if(n<0)return!1;let s=t.pos,i=e.lineStart+s,o=k(t.text,t.text.length,s),a=o;for(;a>s&&t.text.charCodeAt(a-1)==t.next;)a--;a!=o&&a!=s&&g(t.text.charCodeAt(a-1))||(a=t.text.length);let l=e.buffer.write(r.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(s+n+1,a),i+n+1),-i);a<t.text.length&&l.write(r.HeaderMark,a-s,o-s);let h=l.finish(r.ATXHeading1-1+n,t.text.length-s);return e.nextLine(),e.addNode(h,i),!0},HTMLBlock(e,t){let n=P(t,0,!1);if(n<0)return!1;let s=e.lineStart+t.pos,i=E[n][1],o=[],a=i!=A;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){a=!1;break}for(let e of t.markers)o.push(e)}a&&e.nextLine();let l=i==I?r.CommentBlock:i==B?r.ProcessingInstructionBlock:r.HTMLBlock,h=e.prevLineEnd();return e.addNode(e.buffer.writeElements(o,-s).finish(l,h-s),s),!0},SetextHeading:void 0};class N{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(-1==this.stage)return!1;let r=n.content+"\n"+t.scrub(),s=this.advance(r);return s>-1&&s<r.length&&this.complete(e,n,s)}finish(e,t){return(2==this.stage||3==this.stage)&&m(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,J(r.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(!1===e&&(this.stage=-1),!1)}advance(e){for(;;){if(-1==this.stage)return-1;if(0==this.stage){if(!this.nextStage(le(e,this.pos,this.start,!0)))return-1;if(58!=e.charCodeAt(this.pos))return this.stage=-1;this.elts.push(J(r.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else{if(1!=this.stage){if(2==this.stage){let t=m(e,this.pos),n=0;if(t>this.pos){let r=ae(e,t,this.start);if(r){let t=O(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||(n=O(e,this.pos)),n>0&&n<e.length?n:-1}return O(e,this.pos)}if(!this.nextStage(oe(e,m(e,this.pos),this.start)))return-1}}}}function O(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(10==n)break;if(!g(n))return-1}return t}class R{nextLine(e,t,n){let s=t.depth<e.stack.length?-1:T(t),i=t.next;if(s<0)return!1;let o=J(r.HeaderMark,e.lineStart+t.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(n,J(61==i?r.SetextHeading1:r.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const X={LinkReference:(e,t)=>91==t.content.charCodeAt(0)?new N(t):null,SetextHeading:()=>new R},D=[(e,t)=>w(t)>=0,(e,t)=>x(t)>=0,(e,t)=>L(t)>=0,(e,t)=>C(t,e,!0)>=0,(e,t)=>y(t,e,!0)>=0,(e,t)=>b(t,e,!0)>=0,(e,t)=>P(t,0,!0)>=0],z={text:"",end:0};class ${constructor(e,t,n,s){this.parser=e,this.input=t,this.ranges=s,this.line=new c,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=f.create(r.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new ce(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(null!=this.stoppedAt&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(0!=n){if(1==n)return null;e.forward();continue e}}break}let t=new d(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4)for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e;for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+="\n"+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return!!t&&(this.absoluteLineStart+=t,this.lineStart=ue(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0)}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=z;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,s=this.lineChunkAt(r);t.end=r+s.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+s,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw new Error("Unhandled block context "+r[t.type]);if(!n(t,this,e))break;e.forward()}}lineChunkAt(e){let t,n=this.input.chunk(e);if(this.input.lineChunks)t="\n"==n?"":n;else{let e=n.indexOf("\n");t=e<0?n:n.slice(0,e)}return e+t.length>this.to?t.slice(0,this.to-e):t}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=f.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){"number"==typeof e&&(e=new l.Tree(this.parser.nodeSet.types[e],Z,Z,(null!=n?n:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(fe(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?U(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=fe(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(r.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return"string"==typeof e?J(this.parser.getNodeType(e),t,n,r):new G(e,t)}get buffer(){return new K(this.parser.nodeSet)}}function U(e,t,n,r,s){let i=e[t].to,o=[],a=[],h=n.from+r;function f(n,s){for(;s?n>=i:n>i;){let s=e[t+1].from-i;r+=s,n+=s,t++,i=e[t].to}}for(let l=n.firstChild;l;l=l.nextSibling){f(l.from+r,!0);let n,d=l.from+r,c=s.get(l.tree);c?n=c:l.to+r>i?(n=U(e,t,l,r,s),f(l.to+r,!1)):n=l.toTree(),o.push(n),a.push(d-h)}return f(n.to+r,!1),new l.Tree(n.type,o,a,n.to+r-h,n.tree?n.tree.propValues:void 0)}class F extends l.Parser{constructor(e,t,n,r,s,i,o,a,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=i,this.inlineParsers=o,this.inlineNames=a,this.wrappers=l,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new $(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let t=q(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:s}=this,i=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),f=this.inlineParsers.slice(),d=this.inlineNames.slice(),c=this.endLeafBlock.slice(),u=this.wrappers;if(_(t.defineNodes)){s=Object.assign({},s);let e,i=n.types.slice();for(let n of t.defineNodes){let{name:t,block:o,composite:a,style:f}="string"==typeof n?{name:n}:n;if(i.some((e=>e.name==t)))continue;a&&(s[i.length]=(e,t,n)=>a(t,n,e.value));let d=i.length,c=a?["Block","BlockContext"]:o?d>=r.ATXHeading1&&d<=r.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;i.push(l.NodeType.define({id:d,name:t,props:c&&[[l.NodeProp.group,c]]})),f&&(e||(e={}),Array.isArray(f)||f instanceof h.Tag?e[t]=f:Object.assign(e,f))}n=new l.NodeSet(i),e&&(n=n.extend((0,h.styleTags)(e)))}if(_(t.props)&&(n=n.extend(...t.props)),_(t.remove))for(let e of t.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(i[t]=o[t]=void 0),n>-1&&(f[n]=void 0)}if(_(t.parseBlock))for(let e of t.parseBlock){let t=a.indexOf(e.name);if(t>-1)i[t]=e.parse,o[t]=e.leaf;else{let t=e.before?j(a,e.before):e.after?j(a,e.after)+1:a.length-1;i.splice(t,0,e.parse),o.splice(t,0,e.leaf),a.splice(t,0,e.name)}e.endLeaf&&c.push(e.endLeaf)}if(_(t.parseInline))for(let e of t.parseInline){let t=d.indexOf(e.name);if(t>-1)f[t]=e.parse;else{let t=e.before?j(d,e.before):e.after?j(d,e.after)+1:d.length-1;f.splice(t,0,e.parse),d.splice(t,0,e.name)}}return t.wrap&&(u=u.concat(t.wrap)),new F(n,i,o,a,c,s,f,d,u)}getNodeType(e){let t=this.nodeTypes[e];if(null==t)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new he(this,e,t);e:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let s=r(n,t,e);if(s>=0){e=s;continue e}}e++}return n.resolveMarkers(0)}}function _(e){return null!=e&&e.length>0}function q(e){if(!Array.isArray(e))return e;if(0==e.length)return null;let t=q(e[0]);if(1==e.length)return t;let n=q(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||Z).concat(t||Z),s=t.wrap,i=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:s?i?(e,t,n,r)=>s(i(e,t,n,r),t,n,r):s:i}}function j(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let Q=[l.NodeType.none];for(let e,t=1;e=r[t];t++)Q[t]=l.NodeType.define({id:t,name:e,props:t>=r.Escape?[]:[[l.NodeProp.group,t in p?["Block","BlockContext"]:["Block","LeafBlock"]]],top:"Document"==e});const Z=[];class K{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+4*r),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return l.Tree.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}class V{constructor(e,t,n,r=Z){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new K(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}}class G{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Z}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function J(e,t,n,r){return new V(e,t,n,r)}const Y={resolve:"Emphasis",mark:"EmphasisMark"},W={resolve:"Emphasis",mark:"EmphasisMark"},ee={},te={};class ne{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}}let re=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{re=new RegExp("[\\p{Pc}|\\p{Pd}|\\p{Pe}|\\p{Pf}|\\p{Pi}|\\p{Po}|\\p{Ps}]","u")}catch(e){}const se={Escape(e,t,n){if(92!=t||n==e.end-1)return-1;let s=e.char(n+1);for(let t=0;t<32;t++)if("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".charCodeAt(t)==s)return e.append(J(r.Escape,n,n+2));return-1},Entity(e,t,n){if(38!=t)return-1;let s=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return s?e.append(J(r.Entity,n,n+1+s[0].length)):-1},InlineCode(e,t,n){if(96!=t||n&&96==e.char(n-1))return-1;let s=n+1;for(;s<e.end&&96==e.char(s);)s++;let i=s-n,o=0;for(;s<e.end;s++)if(96==e.char(s)){if(o++,o==i&&96!=e.char(s+1))return e.append(J(r.InlineCode,n,s+1,[J(r.CodeMark,n,n+i),J(r.CodeMark,s+1-i,s+1)]))}else o=0;return-1},HTMLTag(e,t,n){if(60!=t||n==e.end-1)return-1;let s=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(s);if(i)return e.append(J(r.Autolink,n,n+1+i[0].length,[J(r.LinkMark,n,n+1),J(r.URL,n+1,n+i[0].length),J(r.LinkMark,n+i[0].length,n+1+i[0].length)]));let o=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(s);if(o)return e.append(J(r.Comment,n,n+1+o[0].length));let a=/^\?[^]*?\?>/.exec(s);if(a)return e.append(J(r.ProcessingInstruction,n,n+1+a[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(s);return l?e.append(J(r.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(95!=t&&42!=t)return-1;let r=n+1;for(;e.char(r)==t;)r++;let s=e.slice(n-1,n),i=e.slice(r,r+1),o=re.test(s),a=re.test(i),l=/\s|^$/.test(s),h=/\s|^$/.test(i),f=!h&&(!a||l||o),d=!l&&(!o||h||a),c=f&&(42==t||!d||o),u=d&&(42==t||!f||a);return e.append(new ne(95==t?Y:W,n,r,(c?1:0)|(u?2:0)))},HardBreak(e,t,n){if(92==t&&10==e.char(n+1))return e.append(J(r.HardBreak,n,n+2));if(32==t){let t=n+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=n+2)return e.append(J(r.HardBreak,n,t+1))}return-1},Link:(e,t,n)=>91==t?e.append(new ne(ee,n,n+1,1)):-1,Image:(e,t,n)=>33==t&&91==e.char(n+1)?e.append(new ne(te,n,n+2,1)):-1,LinkEnd(e,t,n){if(93!=t)return-1;for(let t=e.parts.length-1;t>=0;t--){let s=e.parts[t];if(s instanceof ne&&(s.type==ee||s.type==te)){if(!s.side||e.skipSpace(s.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),o=e.parts[t]=ie(e,i,s.type==ee?r.Link:r.Image,s.from,n+1);if(s.type==ee)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof ne&&t.type==ee&&(t.side=0)}return o.to}}return-1}};function ie(e,t,n,s,i){let{text:o}=e,a=e.char(i),l=i;if(t.unshift(J(r.LinkMark,s,s+(n==r.Image?2:1))),t.push(J(r.LinkMark,i-1,i)),40==a){let n,s=e.skipSpace(i+1),a=oe(o,s-e.offset,e.offset);a&&(s=e.skipSpace(a.to),s!=a.to&&(n=ae(o,s-e.offset,e.offset),n&&(s=e.skipSpace(n.to)))),41==e.char(s)&&(t.push(J(r.LinkMark,i,i+1)),l=s+1,a&&t.push(a),n&&t.push(n),t.push(J(r.LinkMark,s,l)))}else if(91==a){let n=le(o,i-e.offset,e.offset,!1);n&&(t.push(n),l=n.to)}return J(n,s,l,t)}function oe(e,t,n){if(60==e.charCodeAt(t)){for(let s=t+1;s<e.length;s++){let i=e.charCodeAt(s);if(62==i)return J(r.URL,t+n,s+1+n);if(60==i||10==i)return!1}return null}{let s=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(g(n))break;if(t)t=!1;else if(40==n)s++;else if(41==n){if(!s)break;s--}else 92==n&&(t=!0)}return i>t?J(r.URL,t+n,i+n):i==e.length&&null}}function ae(e,t,n){let s=e.charCodeAt(t);if(39!=s&&34!=s&&40!=s)return!1;let i=40==s?41:s;for(let s=t+1,o=!1;s<e.length;s++){let a=e.charCodeAt(s);if(o)o=!1;else{if(a==i)return J(r.LinkTitle,t+n,s+1+n);92==a&&(o=!0)}}return null}function le(e,t,n,s){for(let i=!1,o=t+1,a=Math.min(e.length,o+999);o<a;o++){let a=e.charCodeAt(o);if(i)i=!1;else{if(93==a)return!s&&J(r.LinkLabel,t+n,o+1+n);if(s&&!g(a)&&(s=!1),91==a)return!1;92==a&&(i=!0)}}return null}class he{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new ne(e,t,n,(r?1:0)|(s?2:0)))}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof ne&&n.type.resolve&&2&n.side))continue;let r,s=n.type==Y||n.type==W,i=n.to-n.from,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof ne&&1&e.side&&e.type==n.type&&!(s&&(1&n.side||2&e.side)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){r=e;break}}if(!r)continue;let a=n.type.resolve,l=[],h=r.from,f=n.to;if(s){let e=Math.min(2,r.to-r.from,i);h=r.to-e,f=n.from+e,a=1==e?"Emphasis":"StrongEmphasis"}r.type.mark&&l.push(this.elt(r.type.mark,h,r.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof V&&l.push(this.parts[e]),this.parts[e]=null;n.type.mark&&l.push(this.elt(n.type.mark,n.from,f));let d=this.elt(a,h,f,l);this.parts[o]=s&&r.from!=h?new ne(r.type,r.from,h,r.side):null,(this.parts[t]=s&&n.to!=f?new ne(n.type,f,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof V&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof ne&&n.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return m(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return"string"==typeof e?J(this.parser.getNodeType(e),t,n,r):new G(e,t)}}function fe(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof V&&(n[r]=new V(t.type,t.from,t.to,fe(t.children,[e])))}else n.splice(r++,0,e)}return n}const de=[r.CodeBlock,r.ListItem,r.OrderedList,r.BulletList];class ce{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(l.NodeProp.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,o=i,a=e.block.children.length,h=o,f=a;for(;;){if(t.to-n>s){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=ue(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new l.Tree(e.parser.nodeSet.types[r.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is("Block")&&(de.indexOf(t.type.id)<0?(o=t.to-n,a=e.block.children.length):(o=h,a=f,h=t.to-n,f=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-i}}function ue(e,t){let n=e;for(let r=1;r<t.length;r++){let s=t[r-1].to,i=t[r].from;s<e&&(n-=i-s)}return n}const pe=(0,h.styleTags)({"Blockquote/...":h.tags.quote,HorizontalRule:h.tags.contentSeparator,"ATXHeading1/... SetextHeading1/...":h.tags.heading1,"ATXHeading2/... SetextHeading2/...":h.tags.heading2,"ATXHeading3/...":h.tags.heading3,"ATXHeading4/...":h.tags.heading4,"ATXHeading5/...":h.tags.heading5,"ATXHeading6/...":h.tags.heading6,"Comment CommentBlock":h.tags.comment,Escape:h.tags.escape,Entity:h.tags.character,"Emphasis/...":h.tags.emphasis,"StrongEmphasis/...":h.tags.strong,"Link/... Image/...":h.tags.link,"OrderedList/... BulletList/...":h.tags.list,"BlockQuote/...":h.tags.quote,"InlineCode CodeText":h.tags.monospace,"URL Autolink":h.tags.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":h.tags.processingInstruction,"CodeInfo LinkLabel":h.tags.labelName,LinkTitle:h.tags.string,Paragraph:h.tags.content}),ge=new F(new l.NodeSet(Q).extend(pe),Object.keys(v).map((e=>v[e])),Object.keys(v).map((e=>X[e])),Object.keys(v),D,p,Object.keys(se).map((e=>se[e])),Object.keys(se),[]);function me(e,t,n){let r=[];for(let s=e.firstChild,i=t;;s=s.nextSibling){let e=s?s.from:n;if(e>i&&r.push({from:i,to:e}),!s)break;i=s.to}return r}const ke={resolve:"Strikethrough",mark:"StrikethroughMark"},xe={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":h.tags.strikethrough}},{name:"StrikethroughMark",style:h.tags.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(126!=t||126!=e.char(n+1)||126==e.char(n+2))return-1;let r=e.slice(n-1,n),s=e.slice(n+2,n+3),i=/\s|^$/.test(r),o=/\s|^$/.test(s),a=re.test(r),l=re.test(s);return e.addDelimiter(ke,n,n+2,!o&&(!l||i||a),!i&&(!a||o||l))},after:"Emphasis"}]};function Le(e,t,n=0,r,s=0){let i=0,o=!0,a=-1,l=-1,h=!1,f=()=>{r.push(e.elt("TableCell",s+a,s+l,e.parser.parseInline(t.slice(a,l),s+a)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);124!=n||h?(h||32!=n&&9!=n)&&(a<0&&(a=d),l=d+1):((!o||a>-1)&&i++,o=!1,r&&(a>-1&&f(),r.push(e.elt("TableDelimiter",d+s,d+s+1))),a=l=-1),h=!h&&92==n}return a>-1&&(i++,r&&f()),i}function be(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(124==t)return!0;92==t&&n++}return!1}const Se=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Ce{constructor(){this.rows=null}nextLine(e,t,n){if(null==this.rows){let r;if(this.rows=!1,(45==t.next||58==t.next||124==t.next)&&Se.test(r=t.text.slice(t.pos))){let s=[];Le(e,n.content,0,s,n.start)==Le(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];Le(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return!!this.rows&&(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0)}}const ye={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":h.tags.heading}},"TableRow",{name:"TableCell",style:h.tags.content},{name:"TableDelimiter",style:h.tags.processingInstruction}],parseBlock:[{name:"Table",leaf:(e,t)=>be(t.content,0)?new Ce:null,endLeaf(e,t,n){if(n.parsers.some((e=>e instanceof Ce))||!be(t.text,t.basePos))return!1;let r=e.scanLine(e.absoluteLineEnd+1).text;return Se.test(r)&&Le(e,t.text,t.basePos)==Le(e,r,t.basePos)},before:"SetextHeading"}]};class we{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const Te={defineNodes:[{name:"Task",block:!0,style:h.tags.list},{name:"TaskMarker",style:h.tags.atom}],parseBlock:[{name:"TaskList",leaf:(e,t)=>/^\[[ xX]\][ \t]/.test(t.content)&&"ListItem"==e.parentType().name?new we:null,after:"SetextHeading"}]},Ae=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,Ie=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Be=/[\w-]+\.[\w-]+($|\/)/,Ee=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Pe=/\/[a-zA-Z\d@.]+/gy;function Me(e,t,n,r){let s=0;for(let i=t;i<n;i++)e[i]==r&&s++;return s}function He(e,t){Ee.lastIndex=t;let n=Ee.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return"_"==r||"-"==r?-1:t+n[0].length-("."==r?1:0)}const ve=[ye,Te,xe,{parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;Ae.lastIndex=r;let s=Ae.exec(e.text),i=-1;return s?(s[1]||s[2]?i=function(e,t){Ie.lastIndex=t;let n=Ie.exec(e);if(!n||Be.exec(n[0])[0].indexOf("_")>-1)return-1;let r=t+n[0].length;for(;;){let n,s=e[r-1];if(/[?!.,:*_~]/.test(s)||")"==s&&Me(e,t,r,")")>Me(e,t,r,"("))r--;else{if(";"!=s||!(n=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))break;r=t+n.index}}return r}(e.text,r+s[0].length):s[3]?i=He(e.text,r):(i=He(e.text,r+s[0].length),i>-1&&"xmpp:"==s[0]&&(Pe.lastIndex=i,s=Pe.exec(e.text),s&&(i=s.index+s[0].length))),i<0?-1:(e.addElement(e.elt("URL",n,i+e.offset)),i+e.offset)):-1}}]}];function Ne(e,t,n){return(r,s,i)=>{if(s!=e||r.char(i+1)==e)return-1;let o=[r.elt(n,i,i+1)];for(let s=i+1;s<r.end;s++){let a=r.char(s);if(a==e)return r.addElement(r.elt(t,i,s+1,o.concat(r.elt(n,s,s+1))));if(92==a&&o.push(r.elt("Escape",s,2+s++)),g(a))break}return-1}}const Oe={defineNodes:[{name:"Superscript",style:h.tags.special(h.tags.content)},{name:"SuperscriptMark",style:h.tags.processingInstruction}],parseInline:[{name:"Superscript",parse:Ne(94,"Superscript","SuperscriptMark")}]},Re={defineNodes:[{name:"Subscript",style:h.tags.special(h.tags.content)},{name:"SubscriptMark",style:h.tags.processingInstruction}],parseInline:[{name:"Subscript",parse:Ne(126,"Subscript","SubscriptMark")}]},Xe={defineNodes:[{name:"Emoji",style:h.tags.character}],parseInline:[{name:"Emoji",parse(e,t,n){let r;return 58==t&&(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?e.addElement(e.elt("Emoji",n,n+1+r[0].length)):-1}}]};var De=n(77866);const ze=(0,o.defineLanguageFacet)({commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}}}),$e=new l.NodeProp,Ue=ge.configure({props:[o.foldNodeProp.add((e=>!e.is("Block")||e.is("Document")||null!=Fe(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to}))),$e.add(Fe),o.indentNodeProp.add({Document:()=>null}),o.languageDataProp.add({Document:ze})]});function Fe(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function _e(e,t){let n=e;for(;;){let e,r=n.nextSibling;if(!r||null!=(e=Fe(r.type))&&e<=t)break;n=r}return n.to}const qe=o.foldService.of(((e,t,n)=>{for(let r=(0,o.syntaxTree)(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop($e);if(null==e)continue;let t=_e(r,e);if(t>n)return{from:n,to:t}}return null}));function je(e){return new o.Language(ze,e,[qe],"markdown")}const Qe=je(Ue),Ze=je(Ue.configure([ve,Re,Oe,Xe,{props:[o.foldNodeProp.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));class Ke{constructor(e,t,n,r,s,i,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=i,this.item=o}blank(e,t=!0){let n=this.spaceBefore+("Blockquote"==this.node.name?">":"");if(null!=e){for(;n.length<e;)n+=" ";return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=" ";return n+(t?this.spaceAfter:"")}marker(e,t){let n="OrderedList"==this.node.name?String(+Ge(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Ve(e,t){let n=[];for(let t=e;t&&"Document"!=t.name;t=t.parent)"ListItem"!=t.name&&"Blockquote"!=t.name&&"FencedCode"!=t.name||n.push(t);let r=[];for(let e=n.length-1;e>=0;e--){let s,i=n[e],o=t.lineAt(i.from),a=i.from-o.from;if("FencedCode"==i.name)r.push(new Ke(i,a,a,"","","",null));else if("Blockquote"==i.name&&(s=/^ *>( ?)/.exec(o.text.slice(a))))r.push(new Ke(i,a,a+s[0].length,"",s[1],">",null));else if("ListItem"==i.name&&"OrderedList"==i.parent.name&&(s=/^( *)\d+([.)])( *)/.exec(o.text.slice(a)))){let e=s[3],t=s[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new Ke(i.parent,a,a+t,s[1],e,s[2],i))}else if("ListItem"==i.name&&"BulletList"==i.parent.name&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(a)))){let e=s[4],t=s[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=s[2];s[3]&&(n+=s[3].replace(/[xX]/," ")),r.push(new Ke(i.parent,a,a+t,s[1],e,n,i))}}return r}function Ge(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Je(e,t,n,r=0){for(let s=-1,i=e;;){if("ListItem"==i.name){let e=Ge(i,t),o=+e[2];if(s>=0){if(o!=s+1)return;n.push({from:i.from+e[1].length,to:i.from+e[0].length,insert:String(s+2+r)})}s=o}let e=i.nextSibling;if(!e)break;i=e}}function Ye(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||"\t"!=t.facet(o.indentUnit))return e;let r="";for(let t=(0,s.countColumn)(e,4,n);t>0;)t>=4?(r+="\t",t-=4):(r+=" ",t--);return r+e.slice(n)}const We=({state:e,dispatch:t})=>{let n=(0,o.syntaxTree)(e),{doc:r}=e,i=null,a=e.changeByRange((t=>{if(!t.empty||!Ze.isActiveAt(e,t.from))return i={range:t};let o=t.from,a=r.lineAt(o),l=Ve(n.resolveInner(o,-1),r);for(;l.length&&l[l.length-1].from>o-a.from;)l.pop();if(!l.length)return i={range:t};let h=l[l.length-1];if(h.to-h.spaceAfter.length>o-a.from)return i={range:t};let f=o>=h.to-h.spaceAfter.length&&!/\S/.test(a.text.slice(h.to));if(h.item&&f){let t=h.node.firstChild,n=h.node.getChild("ListItem","ListItem");if(t.to>=o||n&&n.to<o||a.from>0&&!/[^\s>]/.test(r.lineAt(a.from-1).text)){let e,t=l.length>1?l[l.length-2]:null,n="";t&&t.item?(e=a.from+t.from,n=t.marker(r,1)):e=a.from+(t?t.to:0);let i=[{from:e,to:o,insert:n}];return"OrderedList"==h.node.name&&Je(h.item,r,i,-2),t&&"OrderedList"==t.node.name&&Je(t.item,r,i),{range:s.EditorSelection.cursor(e+n.length),changes:i}}{let t=tt(l,e,a);return{range:s.EditorSelection.cursor(o+t.length+1),changes:{from:a.from,insert:t+e.lineBreak}}}}if("Blockquote"==h.node.name&&f&&a.from){let n=r.lineAt(a.from-1),s=/>\s*$/.exec(n.text);if(s&&s.index==h.from){let r=e.changes([{from:n.from+s.index,to:n.to},{from:a.from+h.from,to:a.to}]);return{range:t.map(r),changes:r}}}let d=[];"OrderedList"==h.node.name&&Je(h.item,r,d);let c=h.item&&h.item.from<a.from,u="";if(!c||/^[\s\d.)\-+*>]*/.exec(a.text)[0].length>=h.to)for(let e=0,t=l.length-1;e<=t;e++)u+=e!=t||c?l[e].blank(e<t?(0,s.countColumn)(a.text,4,l[e+1].from)-u.length:null):l[e].marker(r,1);let p=o;for(;p>a.from&&/\s/.test(a.text.charAt(p-a.from-1));)p--;return u=Ye(u,e),function(e,t){if("OrderedList"!=e.name&&"BulletList"!=e.name)return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),i=t.lineAt(r.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<i.number}(h.node,e.doc)&&(u=tt(l,e,a)+e.lineBreak+u),d.push({from:p,to:o,insert:e.lineBreak+u}),{range:s.EditorSelection.cursor(p+u.length+1),changes:d}}));return!i&&(t(e.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)};function et(e){return"QuoteMark"==e.name||"ListMark"==e.name}function tt(e,t,n){let r="";for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?(0,s.countColumn)(n.text,4,e[t+1].from)-r.length:null,t<i);return Ye(r,t)}const nt=({state:e,dispatch:t})=>{let n=(0,o.syntaxTree)(e),r=null,i=e.changeByRange((t=>{let i=t.from,{doc:o}=e;if(t.empty&&Ze.isActiveAt(e,t.from)){let t=o.lineAt(i),r=Ve(function(e,t){let n=e.resolveInner(t,-1),r=t;et(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(et(e))r=e.from;else{if("OrderedList"!=e.name&&"BulletList"!=e.name)break;n=e.lastChild,r=n.to}return n}(n,i),o);if(r.length){let n=r[r.length-1],o=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(i-t.from>o&&!/\S/.test(t.text.slice(o,i-t.from)))return{range:s.EditorSelection.cursor(t.from+o),changes:{from:t.from+o,to:i}};if(i-t.from==o&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank((0,s.countColumn)(t.text,4,n.to)-(0,s.countColumn)(t.text,4,n.from));return r==t.from&&(i=Ye(i,e)),{range:s.EditorSelection.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:s.EditorSelection.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}}));return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},rt=[{key:"Enter",run:We},{key:"Backspace",run:nt}],st=(0,De.html)({matchClosingTags:!1});function it(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:a=!0,base:{parser:h}=Qe,completeHTMLTags:f=!0}=e;if(!(h instanceof F))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let d,c=e.extensions?[e.extensions]:[],u=[st.support];n instanceof o.LanguageSupport?(u.push(n.support),d=n.language):n&&(d=n);let p=t||d?(g=t,m=d,e=>{if(e&&g){let t=null;if(e=/\S*/.exec(e)[0],t="function"==typeof g?g(e):o.LanguageDescription.matchLanguageName(g,e,!0),t instanceof o.LanguageDescription)return t.support?t.support.language.parser:o.ParseContext.getSkippingParser(t.load());if(t)return t.parser}return m?m.parser:null}):void 0;var g,m;c.push(function(e){let{codeParser:t,htmlParser:n}=e,s=(0,l.parseMixed)(((e,s)=>{let i=e.type.id;if(!t||i!=r.CodeBlock&&i!=r.FencedCode){if(n&&(i==r.HTMLBlock||i==r.HTMLTag))return{parser:n,overlay:me(e.node,e.from,e.to)}}else{let n="";if(i==r.FencedCode){let t=e.node.getChild(r.CodeInfo);t&&(n=s.read(t.from,t.to))}let o=t(n);if(o)return{parser:o,overlay:e=>e.type.id==r.CodeText}}return null}));return{wrap:s}}({codeParser:p,htmlParser:st.language.parser})),a&&u.push(s.Prec.high(i.keymap.of(rt)));let k=je(h.configure(c));return f&&u.push(k.data.of({autocomplete:ot})),new o.LanguageSupport(k,u)}function ot(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=(0,o.syntaxTree)(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if("CodeBlock"==s.name||"FencedCode"==s.name||"ProcessingInstructionBlock"==s.name||"CommentBlock"==s.name||"Link"==s.name||"Image"==s.name)return null;s=s.parent}return{from:n-r[0].length,to:n,options:lt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let at=null;function lt(){if(at)return at;let e=(0,De.htmlCompletionSource)(new a.TK(s.EditorState.create({extensions:st}),0,!0));return at=e?e.options:[]}}}]);
|
notebook/static/6281.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6281],{58038:(e,t,n)=>{n.d(t,{c:()=>l});var r=n(52307),i=n(47853);const a=function(e){return(0,i.Z)(e,4)};var d=n(12930);function l(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:s(e)};return r.Z(e.graph())||(t.value=a(e.graph())),t}function o(e){return d.Z(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),a={v:t};return r.Z(n)||(a.value=n),r.Z(i)||(a.parent=i),a}))}function s(e){return d.Z(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.Z(t.name)||(i.name=t.name),r.Z(n)||(i.value=n),i}))}n(7303)},86281:(e,t,n)=>{n.d(t,{r:()=>N});var r=n(7259),i=n(58038),a=n(98443),d=n(24028),l=n(67406),o=n(14780),s=n(23617);let c={},h={},g={};const f=(e,t)=>(d.l.trace("In isDecendant",t," ",e," = ",h[t].includes(e)),!!h[t].includes(e)),u=(e,t,n,r)=>{d.l.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),d.l.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach((i=>{if(t.children(i).length>0)u(i,t,n,r);else{const a=t.node(i);d.l.info("cp ",i," to ",r," with parent ",e),n.setNode(i,a),r!==t.parent(i)&&(d.l.warn("Setting parent",i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(d.l.debug("Setting parent",i,e),n.setParent(i,e)):(d.l.info("In copy ",e,"root",r,"data",t.node(e),r),d.l.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const l=t.edges(i);d.l.debug("Copying Edges",l),l.forEach((i=>{d.l.info("Edge",i);const a=t.edge(i.v,i.w,i.name);d.l.info("Edge data",a,r);try{((e,t)=>(d.l.info("Decendants of ",t," is ",h[t]),d.l.info("Edge is ",e),e.v!==t&&e.w!==t&&(h[t]?h[t].includes(e.v)||f(e.v,t)||f(e.w,t)||h[t].includes(e.w):(d.l.debug("Tilt, ",t,",not in decendants"),!1))))(i,r)?(d.l.info("Copying as ",i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),d.l.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):d.l.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",e)}catch(e){d.l.error(e)}}))}d.l.debug("Removing node",i),t.removeNode(i)}))},w=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)g[i]=e,r=[...r,...w(i,t)];return r},p=(e,t)=>{d.l.trace("Searching",e);const n=t.children(e);if(d.l.trace("Searching children of id ",e,n),n.length<1)return d.l.trace("This is a valid node",e),e;for(const r of n){const n=p(r,t);if(n)return d.l.trace("Found replacement for",e," => ",n),n}},v=e=>c[e]&&c[e].externalConnections&&c[e]?c[e].id:e,y=(e,t)=>{if(d.l.warn("extractor - ",t,i.c(e),e.children("D")),t>10)return void d.l.error("Bailing out");let n=e.nodes(),r=!1;for(const t of n){const n=e.children(t);r=r||n.length>0}if(r){d.l.debug("Nodes = ",n,t);for(const r of n)if(d.l.debug("Extracting node",r,c,c[r]&&!c[r].externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),c[r])if(!c[r].externalConnections&&e.children(r)&&e.children(r).length>0){d.l.warn("Cluster without external connections, without a parent and with children",r,t);let n="TB"===e.graph().rankdir?"LR":"TB";c[r]&&c[r].clusterData&&c[r].clusterData.dir&&(n=c[r].clusterData.dir,d.l.warn("Fixing dir",c[r].clusterData.dir,n));const a=new l.k({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));d.l.warn("Old graph before copy",i.c(e)),u(r,e,a,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:c[r].clusterData,labelText:c[r].labelText,graph:a}),d.l.warn("New graph after copy node: (",r,")",i.c(a)),d.l.debug("Old graph after copy",i.c(e))}else d.l.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!c[r].externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),d.l.debug(c);else d.l.debug("Not a cluster",r,t);n=e.nodes(),d.l.warn("New list of nodes",n);for(const r of n){const n=e.node(r);d.l.warn(" Now next level",r,n),n.clusterNode&&y(n.graph,t+1)}}else d.l.debug("Done, no node has children",e.nodes())},m=(e,t)=>{if(0===t.length)return[];let n=Object.assign(t);return t.forEach((t=>{const r=e.children(t),i=m(e,r);n=[...n,...i]})),n},x={rect:(e,t)=>{d.l.info("Creating subgraph rect for ",t.id,t);const n=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),r=n.insert("rect",":first-child"),i=(0,d.m)((0,d.c)().flowchart.htmlLabels),l=n.insert("g").attr("class","cluster-label"),c="markdown"===t.labelType?(0,o.a)(l,t.labelText,{style:t.labelStyle,useHtmlLabels:i}):l.node().appendChild((0,a.c)(t.labelText,t.labelStyle,void 0,!0));let h=c.getBBox();if((0,d.m)((0,d.c)().flowchart.htmlLabels)){const e=c.children[0],t=(0,s.Ys)(c);h=e.getBoundingClientRect(),t.attr("width",h.width),t.attr("height",h.height)}const g=0*t.padding,f=g/2,u=t.width<=h.width+g?h.width+g:t.width;t.width<=h.width+g?t.diff=(h.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,d.l.trace("Data ",t,JSON.stringify(t)),r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-u/2).attr("y",t.y-t.height/2-f).attr("width",u).attr("height",t.height+g),i?l.attr("transform","translate("+(t.x-h.width/2)+", "+(t.y-t.height/2)+")"):l.attr("transform","translate("+t.x+", "+(t.y-t.height/2)+")");const w=r.node().getBBox();return t.width=w.width,t.height=w.height,t.intersect=function(e){return(0,a.i)(t,e)},n},roundedWithTitle:(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=n.insert("g").attr("class","cluster-label"),l=n.append("rect"),o=i.node().appendChild((0,a.c)(t.labelText,t.labelStyle,void 0,!0));let c=o.getBBox();if((0,d.m)((0,d.c)().flowchart.htmlLabels)){const e=o.children[0],t=(0,s.Ys)(o);c=e.getBoundingClientRect(),t.attr("width",c.width),t.attr("height",c.height)}c=o.getBBox();const h=0*t.padding,g=h/2,f=t.width<=c.width+t.padding?c.width+t.padding:t.width;t.width<=c.width+t.padding?t.diff=(c.width+0*t.padding-t.width)/2:t.diff=-t.padding/2,r.attr("class","outer").attr("x",t.x-f/2-g).attr("y",t.y-t.height/2-g).attr("width",f+h).attr("height",t.height+h),l.attr("class","inner").attr("x",t.x-f/2-g).attr("y",t.y-t.height/2-g+c.height-1).attr("width",f+h).attr("height",t.height+h-c.height-3),i.attr("transform","translate("+(t.x-c.width/2)+", "+(t.y-t.height/2-t.padding/3+((0,d.m)((0,d.c)().flowchart.htmlLabels)?5:3))+")");const u=r.node().getBBox();return t.height=u.height,t.intersect=function(e){return(0,a.i)(t,e)},n},noteGroup:(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,d=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-d).attr("y",t.y-t.height/2-d).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const l=r.node().getBBox();return t.width=l.width,t.height=l.height,t.intersect=function(e){return(0,a.i)(t,e)},n},divider:(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,d=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-d).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const l=r.node().getBBox();return t.width=l.width,t.height=l.height,t.diff=-t.padding/2,t.intersect=function(e){return(0,a.i)(t,e)},n}};let b={};const E=async(e,t,n,l,o)=>{d.l.info("Graph in recursive render: XXX",i.c(t),o);const s=t.graph().rankdir;d.l.trace("Dir in recursive render - dir:",s);const h=e.insert("g").attr("class","root");t.nodes()?d.l.info("Recursive render XXX",t.nodes()):d.l.info("No nodes found for",t),t.edges().length>0&&d.l.trace("Recursive edges",t.edge(t.edges()[0]));const g=h.insert("g").attr("class","clusters"),f=h.insert("g").attr("class","edgePaths"),u=h.insert("g").attr("class","edgeLabels"),w=h.insert("g").attr("class","nodes");await Promise.all(t.nodes().map((async function(e){const r=t.node(e);if(void 0!==o){const n=JSON.parse(JSON.stringify(o.clusterData));d.l.info("Setting data for cluster XXX (",e,") ",n,o),t.setNode(o.id,n),t.parent(e)||(d.l.trace("Setting parent",e,o.id),t.setParent(e,o.id,n))}if(d.l.info("(Insert) Node XXX"+e+": "+JSON.stringify(t.node(e))),r&&r.clusterNode){d.l.info("Cluster identified",e,r.width,t.node(e));const i=await E(w,r.graph,n,l,t.node(e)),o=i.elem;(0,a.u)(r,o),r.diff=i.diff||0,d.l.info("Node bounds (abc123)",e,r,r.width,r.x,r.y),(0,a.s)(o,r),d.l.warn("Recursive render complete ",o,r)}else t.children(e).length>0?(d.l.info("Cluster - the non recursive path XXX",e,r.id,r,t),d.l.info(p(r.id,t)),c[r.id]={id:p(r.id,t),node:r}):(d.l.info("Node - the non recursive path",e,r.id,r),await(0,a.e)(w,t.node(e),s))}))),t.edges().forEach((function(e){const n=t.edge(e.v,e.w,e.name);d.l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),d.l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),d.l.info("Fix",c,"ids:",e.v,e.w,"Translateing: ",c[e.v],c[e.w]),(0,a.f)(u,n)})),t.edges().forEach((function(e){d.l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e))})),d.l.info("#############################################"),d.l.info("### Layout ###"),d.l.info("#############################################"),d.l.info(t),(0,r.bK)(t),d.l.info("Graph after layout:",i.c(t));let v=0;return(e=>m(e,e.children()))(t).forEach((function(e){const n=t.node(e);d.l.info("Position "+e+": "+JSON.stringify(t.node(e))),d.l.info("Position "+e+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n&&n.clusterNode?(0,a.p)(n):t.children(e).length>0?(((e,t)=>{d.l.trace("Inserting cluster");const n=t.shape||"rect";b[t.id]=x[n](e,t)})(g,n),c[n.id].node=n):(0,a.p)(n)})),t.edges().forEach((function(e){const r=t.edge(e);d.l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(r),r);const i=(0,a.g)(f,e,r,c,n,t,l);(0,a.h)(r,i)})),t.nodes().forEach((function(e){const n=t.node(e);d.l.info(e,n.type,n.diff),"group"===n.type&&(v=n.diff)})),{elem:h,diff:v}},N=async(e,t,n,r,l)=>{(0,a.a)(e,n,r,l),(0,a.b)(),(0,a.d)(),b={},h={},g={},c={},d.l.warn("Graph at first:",JSON.stringify(i.c(t))),((e,t)=>{e?(d.l.debug("Opting in, graph "),e.nodes().forEach((function(t){e.children(t).length>0&&(d.l.warn("Cluster identified",t," Replacement id in edges: ",p(t,e)),h[t]=w(t,e),c[t]={id:p(t,e),clusterData:e.node(t)})})),e.nodes().forEach((function(t){const n=e.children(t),r=e.edges();n.length>0?(d.l.debug("Cluster identified",t,h),r.forEach((e=>{e.v!==t&&e.w!==t&&f(e.v,t)^f(e.w,t)&&(d.l.warn("Edge: ",e," leaves cluster ",t),d.l.warn("Decendants of XXX ",t,": ",h[t]),c[t].externalConnections=!0)}))):d.l.debug("Not a cluster ",t,h)})),e.edges().forEach((function(t){const n=e.edge(t);d.l.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),d.l.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(d.l.warn("Fix XXX",c,"ids:",t.v,t.w,"Translating: ",c[t.v]," --- ",c[t.w]),c[t.v]&&c[t.w]&&c[t.v]===c[t.w]){d.l.warn("Fixing and trixing link to self - removing XXX",t.v,t.w,t.name),d.l.warn("Fixing and trixing - removing XXX",t.v,t.w,t.name),r=v(t.v),i=v(t.w),e.removeEdge(t.v,t.w,t.name);const a=t.w+"---"+t.v;e.setNode(a,{domId:a,id:a,labelStyle:"",labelText:n.label,padding:0,shape:"labelRect",style:""});const l=structuredClone(n),o=structuredClone(n);l.label="",l.arrowTypeEnd="none",o.label="",l.fromCluster=t.v,o.toCluster=t.v,e.setEdge(r,a,l,t.name+"-cyclic-special"),e.setEdge(a,i,o,t.name+"-cyclic-special")}else(c[t.v]||c[t.w])&&(d.l.warn("Fixing and trixing - removing XXX",t.v,t.w,t.name),r=v(t.v),i=v(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v&&(n.fromCluster=t.v),i!==t.w&&(n.toCluster=t.w),d.l.warn("Fix Replacing with XXX",r,i,t.name),e.setEdge(r,i,n,t.name))})),d.l.warn("Adjusted Graph",i.c(e)),y(e,0),d.l.trace(c)):d.l.debug("Opting out, no graph ")})(t),d.l.warn("Graph after:",JSON.stringify(i.c(t))),await E(e,t,r,l)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6281],{81779:(e,t,n)=>{n.d(t,{c:()=>l});var r=n(52307),i=n(47853);const a=function(e){return(0,i.Z)(e,4)};var d=n(12930);function l(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:s(e)};return r.Z(e.graph())||(t.value=a(e.graph())),t}function o(e){return d.Z(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),a={v:t};return r.Z(n)||(a.value=n),r.Z(i)||(a.parent=i),a}))}function s(e){return d.Z(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.Z(t.name)||(i.name=t.name),r.Z(n)||(i.value=n),i}))}n(7303)},86281:(e,t,n)=>{n.d(t,{r:()=>N});var r=n(7259),i=n(81779),a=n(98443),d=n(24028),l=n(67406),o=n(14780),s=n(23617);let c={},h={},g={};const f=(e,t)=>(d.l.trace("In isDecendant",t," ",e," = ",h[t].includes(e)),!!h[t].includes(e)),u=(e,t,n,r)=>{d.l.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),d.l.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach((i=>{if(t.children(i).length>0)u(i,t,n,r);else{const a=t.node(i);d.l.info("cp ",i," to ",r," with parent ",e),n.setNode(i,a),r!==t.parent(i)&&(d.l.warn("Setting parent",i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(d.l.debug("Setting parent",i,e),n.setParent(i,e)):(d.l.info("In copy ",e,"root",r,"data",t.node(e),r),d.l.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const l=t.edges(i);d.l.debug("Copying Edges",l),l.forEach((i=>{d.l.info("Edge",i);const a=t.edge(i.v,i.w,i.name);d.l.info("Edge data",a,r);try{((e,t)=>(d.l.info("Decendants of ",t," is ",h[t]),d.l.info("Edge is ",e),e.v!==t&&e.w!==t&&(h[t]?h[t].includes(e.v)||f(e.v,t)||f(e.w,t)||h[t].includes(e.w):(d.l.debug("Tilt, ",t,",not in decendants"),!1))))(i,r)?(d.l.info("Copying as ",i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),d.l.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):d.l.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",e)}catch(e){d.l.error(e)}}))}d.l.debug("Removing node",i),t.removeNode(i)}))},w=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)g[i]=e,r=[...r,...w(i,t)];return r},p=(e,t)=>{d.l.trace("Searching",e);const n=t.children(e);if(d.l.trace("Searching children of id ",e,n),n.length<1)return d.l.trace("This is a valid node",e),e;for(const r of n){const n=p(r,t);if(n)return d.l.trace("Found replacement for",e," => ",n),n}},v=e=>c[e]&&c[e].externalConnections&&c[e]?c[e].id:e,y=(e,t)=>{if(d.l.warn("extractor - ",t,i.c(e),e.children("D")),t>10)return void d.l.error("Bailing out");let n=e.nodes(),r=!1;for(const t of n){const n=e.children(t);r=r||n.length>0}if(r){d.l.debug("Nodes = ",n,t);for(const r of n)if(d.l.debug("Extracting node",r,c,c[r]&&!c[r].externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),c[r])if(!c[r].externalConnections&&e.children(r)&&e.children(r).length>0){d.l.warn("Cluster without external connections, without a parent and with children",r,t);let n="TB"===e.graph().rankdir?"LR":"TB";c[r]&&c[r].clusterData&&c[r].clusterData.dir&&(n=c[r].clusterData.dir,d.l.warn("Fixing dir",c[r].clusterData.dir,n));const a=new l.k({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));d.l.warn("Old graph before copy",i.c(e)),u(r,e,a,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:c[r].clusterData,labelText:c[r].labelText,graph:a}),d.l.warn("New graph after copy node: (",r,")",i.c(a)),d.l.debug("Old graph after copy",i.c(e))}else d.l.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!c[r].externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),d.l.debug(c);else d.l.debug("Not a cluster",r,t);n=e.nodes(),d.l.warn("New list of nodes",n);for(const r of n){const n=e.node(r);d.l.warn(" Now next level",r,n),n.clusterNode&&y(n.graph,t+1)}}else d.l.debug("Done, no node has children",e.nodes())},m=(e,t)=>{if(0===t.length)return[];let n=Object.assign(t);return t.forEach((t=>{const r=e.children(t),i=m(e,r);n=[...n,...i]})),n},x={rect:(e,t)=>{d.l.info("Creating subgraph rect for ",t.id,t);const n=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),r=n.insert("rect",":first-child"),i=(0,d.m)((0,d.c)().flowchart.htmlLabels),l=n.insert("g").attr("class","cluster-label"),c="markdown"===t.labelType?(0,o.a)(l,t.labelText,{style:t.labelStyle,useHtmlLabels:i}):l.node().appendChild((0,a.c)(t.labelText,t.labelStyle,void 0,!0));let h=c.getBBox();if((0,d.m)((0,d.c)().flowchart.htmlLabels)){const e=c.children[0],t=(0,s.Ys)(c);h=e.getBoundingClientRect(),t.attr("width",h.width),t.attr("height",h.height)}const g=0*t.padding,f=g/2,u=t.width<=h.width+g?h.width+g:t.width;t.width<=h.width+g?t.diff=(h.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,d.l.trace("Data ",t,JSON.stringify(t)),r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-u/2).attr("y",t.y-t.height/2-f).attr("width",u).attr("height",t.height+g),i?l.attr("transform","translate("+(t.x-h.width/2)+", "+(t.y-t.height/2)+")"):l.attr("transform","translate("+t.x+", "+(t.y-t.height/2)+")");const w=r.node().getBBox();return t.width=w.width,t.height=w.height,t.intersect=function(e){return(0,a.i)(t,e)},n},roundedWithTitle:(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=n.insert("g").attr("class","cluster-label"),l=n.append("rect"),o=i.node().appendChild((0,a.c)(t.labelText,t.labelStyle,void 0,!0));let c=o.getBBox();if((0,d.m)((0,d.c)().flowchart.htmlLabels)){const e=o.children[0],t=(0,s.Ys)(o);c=e.getBoundingClientRect(),t.attr("width",c.width),t.attr("height",c.height)}c=o.getBBox();const h=0*t.padding,g=h/2,f=t.width<=c.width+t.padding?c.width+t.padding:t.width;t.width<=c.width+t.padding?t.diff=(c.width+0*t.padding-t.width)/2:t.diff=-t.padding/2,r.attr("class","outer").attr("x",t.x-f/2-g).attr("y",t.y-t.height/2-g).attr("width",f+h).attr("height",t.height+h),l.attr("class","inner").attr("x",t.x-f/2-g).attr("y",t.y-t.height/2-g+c.height-1).attr("width",f+h).attr("height",t.height+h-c.height-3),i.attr("transform","translate("+(t.x-c.width/2)+", "+(t.y-t.height/2-t.padding/3+((0,d.m)((0,d.c)().flowchart.htmlLabels)?5:3))+")");const u=r.node().getBBox();return t.height=u.height,t.intersect=function(e){return(0,a.i)(t,e)},n},noteGroup:(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,d=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-d).attr("y",t.y-t.height/2-d).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const l=r.node().getBBox();return t.width=l.width,t.height=l.height,t.intersect=function(e){return(0,a.i)(t,e)},n},divider:(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,d=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-d).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const l=r.node().getBBox();return t.width=l.width,t.height=l.height,t.diff=-t.padding/2,t.intersect=function(e){return(0,a.i)(t,e)},n}};let b={};const E=async(e,t,n,l,o)=>{d.l.info("Graph in recursive render: XXX",i.c(t),o);const s=t.graph().rankdir;d.l.trace("Dir in recursive render - dir:",s);const h=e.insert("g").attr("class","root");t.nodes()?d.l.info("Recursive render XXX",t.nodes()):d.l.info("No nodes found for",t),t.edges().length>0&&d.l.trace("Recursive edges",t.edge(t.edges()[0]));const g=h.insert("g").attr("class","clusters"),f=h.insert("g").attr("class","edgePaths"),u=h.insert("g").attr("class","edgeLabels"),w=h.insert("g").attr("class","nodes");await Promise.all(t.nodes().map((async function(e){const r=t.node(e);if(void 0!==o){const n=JSON.parse(JSON.stringify(o.clusterData));d.l.info("Setting data for cluster XXX (",e,") ",n,o),t.setNode(o.id,n),t.parent(e)||(d.l.trace("Setting parent",e,o.id),t.setParent(e,o.id,n))}if(d.l.info("(Insert) Node XXX"+e+": "+JSON.stringify(t.node(e))),r&&r.clusterNode){d.l.info("Cluster identified",e,r.width,t.node(e));const i=await E(w,r.graph,n,l,t.node(e)),o=i.elem;(0,a.u)(r,o),r.diff=i.diff||0,d.l.info("Node bounds (abc123)",e,r,r.width,r.x,r.y),(0,a.s)(o,r),d.l.warn("Recursive render complete ",o,r)}else t.children(e).length>0?(d.l.info("Cluster - the non recursive path XXX",e,r.id,r,t),d.l.info(p(r.id,t)),c[r.id]={id:p(r.id,t),node:r}):(d.l.info("Node - the non recursive path",e,r.id,r),await(0,a.e)(w,t.node(e),s))}))),t.edges().forEach((function(e){const n=t.edge(e.v,e.w,e.name);d.l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),d.l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),d.l.info("Fix",c,"ids:",e.v,e.w,"Translateing: ",c[e.v],c[e.w]),(0,a.f)(u,n)})),t.edges().forEach((function(e){d.l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e))})),d.l.info("#############################################"),d.l.info("### Layout ###"),d.l.info("#############################################"),d.l.info(t),(0,r.bK)(t),d.l.info("Graph after layout:",i.c(t));let v=0;return(e=>m(e,e.children()))(t).forEach((function(e){const n=t.node(e);d.l.info("Position "+e+": "+JSON.stringify(t.node(e))),d.l.info("Position "+e+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n&&n.clusterNode?(0,a.p)(n):t.children(e).length>0?(((e,t)=>{d.l.trace("Inserting cluster");const n=t.shape||"rect";b[t.id]=x[n](e,t)})(g,n),c[n.id].node=n):(0,a.p)(n)})),t.edges().forEach((function(e){const r=t.edge(e);d.l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(r),r);const i=(0,a.g)(f,e,r,c,n,t,l);(0,a.h)(r,i)})),t.nodes().forEach((function(e){const n=t.node(e);d.l.info(e,n.type,n.diff),"group"===n.type&&(v=n.diff)})),{elem:h,diff:v}},N=async(e,t,n,r,l)=>{(0,a.a)(e,n,r,l),(0,a.b)(),(0,a.d)(),b={},h={},g={},c={},d.l.warn("Graph at first:",JSON.stringify(i.c(t))),((e,t)=>{e?(d.l.debug("Opting in, graph "),e.nodes().forEach((function(t){e.children(t).length>0&&(d.l.warn("Cluster identified",t," Replacement id in edges: ",p(t,e)),h[t]=w(t,e),c[t]={id:p(t,e),clusterData:e.node(t)})})),e.nodes().forEach((function(t){const n=e.children(t),r=e.edges();n.length>0?(d.l.debug("Cluster identified",t,h),r.forEach((e=>{e.v!==t&&e.w!==t&&f(e.v,t)^f(e.w,t)&&(d.l.warn("Edge: ",e," leaves cluster ",t),d.l.warn("Decendants of XXX ",t,": ",h[t]),c[t].externalConnections=!0)}))):d.l.debug("Not a cluster ",t,h)})),e.edges().forEach((function(t){const n=e.edge(t);d.l.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),d.l.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(d.l.warn("Fix XXX",c,"ids:",t.v,t.w,"Translating: ",c[t.v]," --- ",c[t.w]),c[t.v]&&c[t.w]&&c[t.v]===c[t.w]){d.l.warn("Fixing and trixing link to self - removing XXX",t.v,t.w,t.name),d.l.warn("Fixing and trixing - removing XXX",t.v,t.w,t.name),r=v(t.v),i=v(t.w),e.removeEdge(t.v,t.w,t.name);const a=t.w+"---"+t.v;e.setNode(a,{domId:a,id:a,labelStyle:"",labelText:n.label,padding:0,shape:"labelRect",style:""});const l=structuredClone(n),o=structuredClone(n);l.label="",l.arrowTypeEnd="none",o.label="",l.fromCluster=t.v,o.toCluster=t.v,e.setEdge(r,a,l,t.name+"-cyclic-special"),e.setEdge(a,i,o,t.name+"-cyclic-special")}else(c[t.v]||c[t.w])&&(d.l.warn("Fixing and trixing - removing XXX",t.v,t.w,t.name),r=v(t.v),i=v(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v&&(n.fromCluster=t.v),i!==t.w&&(n.toCluster=t.w),d.l.warn("Fix Replacing with XXX",r,i,t.name),e.setEdge(r,i,n,t.name))})),d.l.warn("Adjusted Graph",i.c(e)),y(e,0),d.l.trace(c)):d.l.debug("Opting out, no graph ")})(t),d.l.warn("Graph after:",JSON.stringify(i.c(t))),await E(e,t,r,l)}}}]);
|
notebook/static/6345.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6345,4645],{94645:(e,t,o)=>{o.r(t),o.d(t,{default:()=>p});var n=o(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6345,4645],{94645:(e,t,o)=>{o.r(t),o.d(t,{default:()=>p});var n=o(11510),s=o(23716),a=o(92972),r=o(25206),c=o(33625);const i={id:"@jupyter-notebook/console-extension:opener",requires:[n.IRouter],autoStart:!0,description:"A plugin to open consoles in a new tab",activate:(e,t)=>{const{commands:o}=e,n=new RegExp("/consoles/(.*)"),s="router:console";o.addCommand(s,{execute:e=>{const t=e.path.match(n);if(!t)return;const[,s]=t;if(!s)return;const a=decodeURIComponent(s);o.execute("console:create",{path:a})}}),t.register({command:s,pattern:n})}},d={id:"@jupyter-notebook/console-extension:redirect",requires:[s.IConsoleTracker],optional:[r.INotebookPathOpener],autoStart:!0,description:"Open consoles in a new tab",activate:(e,t,o)=>{const n=a.PageConfig.getBaseUrl(),s=null!=o?o:r.defaultNotebookPathOpener;t.widgetAdded.connect((async(t,o)=>{const{sessionContext:r}=o;await r.ready,(0,c.find)(e.shell.widgets("main"),(e=>e.id===o.id))||(s.open({prefix:a.URLExt.join(n,"consoles"),path:r.path,target:"_blank"}),o.dispose())}))}},p=[i,d]}}]);
|
notebook/static/6417.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6417],{74193:(e,t,n)=>{n.d(t,{a:()=>l});var r=n(51723);function l(e,t){var n=e.append("foreignObject").attr("width","100000"),l=n.append("xhtml:div");l.attr("xmlns","http://www.w3.org/1999/xhtml");var o=t.label;switch(typeof o){case"function":l.insert(o);break;case"object":l.insert((function(){return o}));break;default:l.html(o)}r.bg(l,t.labelStyle),l.style("display","inline-block"),l.style("white-space","nowrap");var a=l.node().getBoundingClientRect();return n.attr("width",a.width).attr("height",a.height),n}},51723:(e,t,n)=>{n.d(t,{$p:()=>d,O1:()=>a,WR:()=>p,bF:()=>o,bg:()=>c});var r=n(53541),l=n(48489);function o(e,t){return!!e.children(t).length}function a(e){return i(e.v)+":"+i(e.w)+":"+i(e.name)}var s=/:/g;function i(e){return e?String(e).replace(s,"\\:"):""}function c(e,t){t&&e.attr("style",t)}function d(e,t,n){t&&e.attr("class",t).attr("class",n+" "+e.attr("class"))}function p(e,t){var n=t.graph();if(r.Z(n)){var o=n.transition;if(l.Z(o))return o(e)}return e}},66417:(e,t,n)=>{n.d(t,{diagram:()=>s});var r=n(31261),l=(n(67406),n(23617));n(24028),n(36004),n(65479),n(21845),n(7259),n(51723),n(74193),n(12451),n(36735),n(87768),l.c_6;var o=n(3675);n(27693),n(7608),n(31699),n(58038);const a={},s={parser:r.p,db:r.f,renderer:o.f,styles:o.a,init:e=>{e.flowchart||(e.flowchart={}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,function(e){const t=Object.keys(e);for(const n of t)a[n]=e[n]}(e.flowchart),r.f.clear(),r.f.setGen("gen-1")}}},3675:(e,t,n)=>{n.d(t,{a:()=>h,f:()=>u});var r=n(67406),l=n(23617),o=n(24028),a=n(86281),s=n(74193),i=n(90267),c=n(42528);const d=(e,t)=>i.Z.lang.round(c.Z.parse(e)[t]);var p=n(14728);const b={},f=function(e,t,n,r,l,a){const i=r.select(`[id="${n}"]`);Object.keys(e).forEach((function(n){const r=e[n];let c="default";r.classes.length>0&&(c=r.classes.join(" ")),c+=" flowchart-label";const d=(0,o.k)(r.styles);let p,b=void 0!==r.text?r.text:r.id;if(o.l.info("vertex",r,r.labelType),"markdown"===r.labelType)o.l.info("vertex",r,r.labelType);else if((0,o.m)((0,o.c)().flowchart.htmlLabels)){const e={label:b.replace(/fa[blrs]?:fa-[\w-]+/g,(e=>`<i class='${e.replace(":"," ")}'></i>`))};p=(0,s.a)(i,e).node(),p.parentNode.removeChild(p)}else{const e=l.createElementNS("http://www.w3.org/2000/svg","text");e.setAttribute("style",d.labelStyle.replace("color:","fill:"));const t=b.split(o.e.lineBreakRegex);for(const n of t){const t=l.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.setAttribute("dy","1em"),t.setAttribute("x","1"),t.textContent=n,e.appendChild(t)}p=e}let f=0,w="";switch(r.type){case"round":f=5,w="rect";break;case"square":case"group":default:w="rect";break;case"diamond":w="question";break;case"hexagon":w="hexagon";break;case"odd":case"odd_right":w="rect_left_inv_arrow";break;case"lean_right":w="lean_right";break;case"lean_left":w="lean_left";break;case"trapezoid":w="trapezoid";break;case"inv_trapezoid":w="inv_trapezoid";break;case"circle":w="circle";break;case"ellipse":w="ellipse";break;case"stadium":w="stadium";break;case"subroutine":w="subroutine";break;case"cylinder":w="cylinder";break;case"doublecircle":w="doublecircle"}t.setNode(r.id,{labelStyle:d.labelStyle,shape:w,labelText:b,labelType:r.labelType,rx:f,ry:f,class:c,style:d.style,id:r.id,link:r.link,linkTarget:r.linkTarget,tooltip:a.db.getTooltip(r.id)||"",domId:a.db.lookUpDomId(r.id),haveCallback:r.haveCallback,width:"group"===r.type?500:void 0,dir:r.dir,type:r.type,props:r.props,padding:(0,o.c)().flowchart.padding}),o.l.info("setNode",{labelStyle:d.labelStyle,labelType:r.labelType,shape:w,labelText:b,rx:f,ry:f,class:c,style:d.style,id:r.id,domId:a.db.lookUpDomId(r.id),width:"group"===r.type?500:void 0,type:r.type,dir:r.dir,props:r.props,padding:(0,o.c)().flowchart.padding})}))},w=function(e,t,n){o.l.info("abc78 edges = ",e);let r,a,s=0,i={};if(void 0!==e.defaultStyle){const t=(0,o.k)(e.defaultStyle);r=t.style,a=t.labelStyle}e.forEach((function(n){s++;const c="L-"+n.start+"-"+n.end;void 0===i[c]?(i[c]=0,o.l.info("abc78 new entry",c,i[c])):(i[c]++,o.l.info("abc78 new entry",c,i[c]));let d=c+"-"+i[c];o.l.info("abc78 new link id to be used is",c,d,i[c]);const p="LS-"+n.start,f="LE-"+n.end,w={style:"",labelStyle:""};switch(w.minlen=n.length||1,"arrow_open"===n.type?w.arrowhead="none":w.arrowhead="normal",w.arrowTypeStart="arrow_open",w.arrowTypeEnd="arrow_open",n.type){case"double_arrow_cross":w.arrowTypeStart="arrow_cross";case"arrow_cross":w.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":w.arrowTypeStart="arrow_point";case"arrow_point":w.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":w.arrowTypeStart="arrow_circle";case"arrow_circle":w.arrowTypeEnd="arrow_circle"}let u="",h="";switch(n.stroke){case"normal":u="fill:none;",void 0!==r&&(u=r),void 0!==a&&(h=a),w.thickness="normal",w.pattern="solid";break;case"dotted":w.thickness="normal",w.pattern="dotted",w.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":w.thickness="thick",w.pattern="solid",w.style="stroke-width: 3.5px;fill:none;";break;case"invisible":w.thickness="invisible",w.pattern="solid",w.style="stroke-width: 0;fill:none;"}if(void 0!==n.style){const e=(0,o.k)(n.style);u=e.style,h=e.labelStyle}w.style=w.style+=u,w.labelStyle=w.labelStyle+=h,void 0!==n.interpolate?w.curve=(0,o.n)(n.interpolate,l.c_6):void 0!==e.defaultInterpolate?w.curve=(0,o.n)(e.defaultInterpolate,l.c_6):w.curve=(0,o.n)(b.curve,l.c_6),void 0===n.text?void 0!==n.style&&(w.arrowheadStyle="fill: #333"):(w.arrowheadStyle="fill: #333",w.labelpos="c"),w.labelType=n.labelType,w.label=n.text.replace(o.e.lineBreakRegex,"\n"),void 0===n.style&&(w.style=w.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),w.labelStyle=w.labelStyle.replace("color:","fill:"),w.id=d,w.classes="flowchart-link "+p+" "+f,t.setEdge(n.start,n.end,w,s)}))},u={setConf:function(e){const t=Object.keys(e);for(const n of t)b[n]=e[n]},addVertices:f,addEdges:w,getClasses:function(e,t){return t.db.getClasses()},draw:async function(e,t,n,s){o.l.info("Drawing flowchart");let i=s.db.getDirection();void 0===i&&(i="TD");const{securityLevel:c,flowchart:d}=(0,o.c)(),p=d.nodeSpacing||50,b=d.rankSpacing||50;let u;"sandbox"===c&&(u=(0,l.Ys)("#i"+t));const h="sandbox"===c?(0,l.Ys)(u.nodes()[0].contentDocument.body):(0,l.Ys)("body"),g="sandbox"===c?u.nodes()[0].contentDocument:document,y=new r.k({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:p,ranksep:b,marginx:0,marginy:0}).setDefaultEdgeLabel((function(){return{}}));let k;const x=s.db.getSubGraphs();o.l.info("Subgraphs - ",x);for(let e=x.length-1;e>=0;e--)k=x[e],o.l.info("Subgraph - ",k),s.db.addVertex(k.id,{text:k.title,type:k.labelType},"group",void 0,k.classes,k.dir);const v=s.db.getVertices(),m=s.db.getEdges();o.l.info("Edges",m);let T=0;for(T=x.length-1;T>=0;T--){k=x[T],(0,l.td_)("cluster").append("text");for(let e=0;e<k.nodes.length;e++)o.l.info("Setting up subgraphs",k.nodes[e],k.id),y.setParent(k.nodes[e],k.id)}f(v,y,t,h,g,s),w(m,y);const S=h.select(`[id="${t}"]`),_=h.select("#"+t+" g");if(await(0,a.r)(_,y,["point","circle","cross"],"flowchart",t),o.u.insertTitle(S,"flowchartTitleText",d.titleTopMargin,s.db.getDiagramTitle()),(0,o.o)(y,S,d.diagramPadding,d.useMaxWidth),s.db.indexNodes("subGraph"+T),!d.htmlLabels){const e=g.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const t of e){const e=t.getBBox(),n=g.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("rx",0),n.setAttribute("ry",0),n.setAttribute("width",e.width),n.setAttribute("height",e.height),t.insertBefore(n,t.firstChild)}}Object.keys(v).forEach((function(e){const n=v[e];if(n.link){const r=(0,l.Ys)("#"+t+' [id="'+e+'"]');if(r){const e=g.createElementNS("http://www.w3.org/2000/svg","a");e.setAttributeNS("http://www.w3.org/2000/svg","class",n.classes.join(" ")),e.setAttributeNS("http://www.w3.org/2000/svg","href",n.link),e.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===c?e.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):n.linkTarget&&e.setAttributeNS("http://www.w3.org/2000/svg","target",n.linkTarget);const t=r.insert((function(){return e}),":first-child"),l=r.select(".label-container");l&&t.append((function(){return l.node()}));const o=r.select(".label");o&&t.append((function(){return o.node()}))}}}))}},h=e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${((e,t)=>{const n=d,r=n(e,"r"),l=n(e,"g"),o=n(e,"b");return p.Z(r,l,o,.5)})(e.edgeLabelBackground)};\n // background-color: \n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6417],{74193:(e,t,n)=>{n.d(t,{a:()=>l});var r=n(51723);function l(e,t){var n=e.append("foreignObject").attr("width","100000"),l=n.append("xhtml:div");l.attr("xmlns","http://www.w3.org/1999/xhtml");var o=t.label;switch(typeof o){case"function":l.insert(o);break;case"object":l.insert((function(){return o}));break;default:l.html(o)}r.bg(l,t.labelStyle),l.style("display","inline-block"),l.style("white-space","nowrap");var a=l.node().getBoundingClientRect();return n.attr("width",a.width).attr("height",a.height),n}},51723:(e,t,n)=>{n.d(t,{$p:()=>d,O1:()=>a,WR:()=>p,bF:()=>o,bg:()=>c});var r=n(53541),l=n(48489);function o(e,t){return!!e.children(t).length}function a(e){return i(e.v)+":"+i(e.w)+":"+i(e.name)}var s=/:/g;function i(e){return e?String(e).replace(s,"\\:"):""}function c(e,t){t&&e.attr("style",t)}function d(e,t,n){t&&e.attr("class",t).attr("class",n+" "+e.attr("class"))}function p(e,t){var n=t.graph();if(r.Z(n)){var o=n.transition;if(l.Z(o))return o(e)}return e}},66417:(e,t,n)=>{n.d(t,{diagram:()=>s});var r=n(31261),l=(n(67406),n(23617));n(24028),n(36004),n(65479),n(21845),n(7259),n(51723),n(74193),n(12451),n(36735),n(87768),l.c_6;var o=n(3675);n(27693),n(7608),n(31699),n(81779);const a={},s={parser:r.p,db:r.f,renderer:o.f,styles:o.a,init:e=>{e.flowchart||(e.flowchart={}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,function(e){const t=Object.keys(e);for(const n of t)a[n]=e[n]}(e.flowchart),r.f.clear(),r.f.setGen("gen-1")}}},3675:(e,t,n)=>{n.d(t,{a:()=>h,f:()=>u});var r=n(67406),l=n(23617),o=n(24028),a=n(86281),s=n(74193),i=n(90267),c=n(42528);const d=(e,t)=>i.Z.lang.round(c.Z.parse(e)[t]);var p=n(14728);const b={},f=function(e,t,n,r,l,a){const i=r.select(`[id="${n}"]`);Object.keys(e).forEach((function(n){const r=e[n];let c="default";r.classes.length>0&&(c=r.classes.join(" ")),c+=" flowchart-label";const d=(0,o.k)(r.styles);let p,b=void 0!==r.text?r.text:r.id;if(o.l.info("vertex",r,r.labelType),"markdown"===r.labelType)o.l.info("vertex",r,r.labelType);else if((0,o.m)((0,o.c)().flowchart.htmlLabels)){const e={label:b.replace(/fa[blrs]?:fa-[\w-]+/g,(e=>`<i class='${e.replace(":"," ")}'></i>`))};p=(0,s.a)(i,e).node(),p.parentNode.removeChild(p)}else{const e=l.createElementNS("http://www.w3.org/2000/svg","text");e.setAttribute("style",d.labelStyle.replace("color:","fill:"));const t=b.split(o.e.lineBreakRegex);for(const n of t){const t=l.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.setAttribute("dy","1em"),t.setAttribute("x","1"),t.textContent=n,e.appendChild(t)}p=e}let f=0,w="";switch(r.type){case"round":f=5,w="rect";break;case"square":case"group":default:w="rect";break;case"diamond":w="question";break;case"hexagon":w="hexagon";break;case"odd":case"odd_right":w="rect_left_inv_arrow";break;case"lean_right":w="lean_right";break;case"lean_left":w="lean_left";break;case"trapezoid":w="trapezoid";break;case"inv_trapezoid":w="inv_trapezoid";break;case"circle":w="circle";break;case"ellipse":w="ellipse";break;case"stadium":w="stadium";break;case"subroutine":w="subroutine";break;case"cylinder":w="cylinder";break;case"doublecircle":w="doublecircle"}t.setNode(r.id,{labelStyle:d.labelStyle,shape:w,labelText:b,labelType:r.labelType,rx:f,ry:f,class:c,style:d.style,id:r.id,link:r.link,linkTarget:r.linkTarget,tooltip:a.db.getTooltip(r.id)||"",domId:a.db.lookUpDomId(r.id),haveCallback:r.haveCallback,width:"group"===r.type?500:void 0,dir:r.dir,type:r.type,props:r.props,padding:(0,o.c)().flowchart.padding}),o.l.info("setNode",{labelStyle:d.labelStyle,labelType:r.labelType,shape:w,labelText:b,rx:f,ry:f,class:c,style:d.style,id:r.id,domId:a.db.lookUpDomId(r.id),width:"group"===r.type?500:void 0,type:r.type,dir:r.dir,props:r.props,padding:(0,o.c)().flowchart.padding})}))},w=function(e,t,n){o.l.info("abc78 edges = ",e);let r,a,s=0,i={};if(void 0!==e.defaultStyle){const t=(0,o.k)(e.defaultStyle);r=t.style,a=t.labelStyle}e.forEach((function(n){s++;const c="L-"+n.start+"-"+n.end;void 0===i[c]?(i[c]=0,o.l.info("abc78 new entry",c,i[c])):(i[c]++,o.l.info("abc78 new entry",c,i[c]));let d=c+"-"+i[c];o.l.info("abc78 new link id to be used is",c,d,i[c]);const p="LS-"+n.start,f="LE-"+n.end,w={style:"",labelStyle:""};switch(w.minlen=n.length||1,"arrow_open"===n.type?w.arrowhead="none":w.arrowhead="normal",w.arrowTypeStart="arrow_open",w.arrowTypeEnd="arrow_open",n.type){case"double_arrow_cross":w.arrowTypeStart="arrow_cross";case"arrow_cross":w.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":w.arrowTypeStart="arrow_point";case"arrow_point":w.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":w.arrowTypeStart="arrow_circle";case"arrow_circle":w.arrowTypeEnd="arrow_circle"}let u="",h="";switch(n.stroke){case"normal":u="fill:none;",void 0!==r&&(u=r),void 0!==a&&(h=a),w.thickness="normal",w.pattern="solid";break;case"dotted":w.thickness="normal",w.pattern="dotted",w.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":w.thickness="thick",w.pattern="solid",w.style="stroke-width: 3.5px;fill:none;";break;case"invisible":w.thickness="invisible",w.pattern="solid",w.style="stroke-width: 0;fill:none;"}if(void 0!==n.style){const e=(0,o.k)(n.style);u=e.style,h=e.labelStyle}w.style=w.style+=u,w.labelStyle=w.labelStyle+=h,void 0!==n.interpolate?w.curve=(0,o.n)(n.interpolate,l.c_6):void 0!==e.defaultInterpolate?w.curve=(0,o.n)(e.defaultInterpolate,l.c_6):w.curve=(0,o.n)(b.curve,l.c_6),void 0===n.text?void 0!==n.style&&(w.arrowheadStyle="fill: #333"):(w.arrowheadStyle="fill: #333",w.labelpos="c"),w.labelType=n.labelType,w.label=n.text.replace(o.e.lineBreakRegex,"\n"),void 0===n.style&&(w.style=w.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),w.labelStyle=w.labelStyle.replace("color:","fill:"),w.id=d,w.classes="flowchart-link "+p+" "+f,t.setEdge(n.start,n.end,w,s)}))},u={setConf:function(e){const t=Object.keys(e);for(const n of t)b[n]=e[n]},addVertices:f,addEdges:w,getClasses:function(e,t){return t.db.getClasses()},draw:async function(e,t,n,s){o.l.info("Drawing flowchart");let i=s.db.getDirection();void 0===i&&(i="TD");const{securityLevel:c,flowchart:d}=(0,o.c)(),p=d.nodeSpacing||50,b=d.rankSpacing||50;let u;"sandbox"===c&&(u=(0,l.Ys)("#i"+t));const h="sandbox"===c?(0,l.Ys)(u.nodes()[0].contentDocument.body):(0,l.Ys)("body"),g="sandbox"===c?u.nodes()[0].contentDocument:document,y=new r.k({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:p,ranksep:b,marginx:0,marginy:0}).setDefaultEdgeLabel((function(){return{}}));let k;const x=s.db.getSubGraphs();o.l.info("Subgraphs - ",x);for(let e=x.length-1;e>=0;e--)k=x[e],o.l.info("Subgraph - ",k),s.db.addVertex(k.id,{text:k.title,type:k.labelType},"group",void 0,k.classes,k.dir);const v=s.db.getVertices(),m=s.db.getEdges();o.l.info("Edges",m);let T=0;for(T=x.length-1;T>=0;T--){k=x[T],(0,l.td_)("cluster").append("text");for(let e=0;e<k.nodes.length;e++)o.l.info("Setting up subgraphs",k.nodes[e],k.id),y.setParent(k.nodes[e],k.id)}f(v,y,t,h,g,s),w(m,y);const S=h.select(`[id="${t}"]`),_=h.select("#"+t+" g");if(await(0,a.r)(_,y,["point","circle","cross"],"flowchart",t),o.u.insertTitle(S,"flowchartTitleText",d.titleTopMargin,s.db.getDiagramTitle()),(0,o.o)(y,S,d.diagramPadding,d.useMaxWidth),s.db.indexNodes("subGraph"+T),!d.htmlLabels){const e=g.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const t of e){const e=t.getBBox(),n=g.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("rx",0),n.setAttribute("ry",0),n.setAttribute("width",e.width),n.setAttribute("height",e.height),t.insertBefore(n,t.firstChild)}}Object.keys(v).forEach((function(e){const n=v[e];if(n.link){const r=(0,l.Ys)("#"+t+' [id="'+e+'"]');if(r){const e=g.createElementNS("http://www.w3.org/2000/svg","a");e.setAttributeNS("http://www.w3.org/2000/svg","class",n.classes.join(" ")),e.setAttributeNS("http://www.w3.org/2000/svg","href",n.link),e.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===c?e.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):n.linkTarget&&e.setAttributeNS("http://www.w3.org/2000/svg","target",n.linkTarget);const t=r.insert((function(){return e}),":first-child"),l=r.select(".label-container");l&&t.append((function(){return l.node()}));const o=r.select(".label");o&&t.append((function(){return o.node()}))}}}))}},h=e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${((e,t)=>{const n=d,r=n(e,"r"),l=n(e,"g"),o=n(e,"b");return p.Z(r,l,o,.5)})(e.edgeLabelBackground)};\n // background-color: \n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`}}]);
|
notebook/static/6604.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6604,2088],{6604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>b});var n,i=t(
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6604,2088],{6604:(e,o,t)=>{t.r(o),t.d(o,{default:()=>b});var n,i=t(23716),r=t(92972),l=t(55752),s=t(31735),a=t(1678),d=t(91623),c=t(31721),u=t(33625),p=t(63485);!function(e){e.dismiss="tooltip:dismiss",e.launchConsole="tooltip:launch-console",e.launchNotebook="tooltip:launch-notebook",e.launchFile="tooltip:launch-file"}(n||(n={}));const m={id:"@jupyterlab/tooltip-extension:manager",description:"Provides the tooltip manager.",autoStart:!0,optional:[c.ITranslator],provides:d.ITooltipManager,activate:(e,o)=>{const t=(null!=o?o:c.nullTranslator).load("jupyterlab");let i=null;return e.commands.addCommand(n.dismiss,{label:t.__("Dismiss the tooltip"),execute:()=>{i&&(i.dispose(),i=null)}}),{invoke(e){const{anchor:o,editor:t,kernel:n,rendermime:r}=e;return i&&(i.dispose(),i=null),T.fetch({detail:0,editor:t,kernel:n}).then((e=>{i=new d.Tooltip({anchor:o,bundle:e,editor:t,rendermime:r}),p.Widget.attach(i,document.body)})).catch((()=>{}))}}}},h={id:"@jupyterlab/tooltip-extension:consoles",description:"Adds the tooltip capability to consoles.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,i.IConsoleTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchConsole,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.console,l=null===(e=r.promptCell)||void 0===e?void 0:e.editor,s=null===(n=r.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},v={id:"@jupyterlab/tooltip-extension:notebooks",description:"Adds the tooltip capability to notebooks.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,s.INotebookTracker],activate:(e,o,t,i)=>{const r=(null!=i?i:c.nullTranslator).load("jupyterlab");e.commands.addCommand(n.launchNotebook,{label:r.__("Open the tooltip"),execute:()=>{var e,n;const i=t.currentWidget;if(!i)return;const r=i.content,l=null===(e=r.activeCell)||void 0===e?void 0:e.editor,s=null===(n=i.sessionContext.session)||void 0===n?void 0:n.kernel,a=r.rendermime;return l&&s&&a?o.invoke({anchor:r,editor:l,kernel:s,rendermime:a}):void 0}})}},k={id:"@jupyterlab/tooltip-extension:files",description:"Adds the tooltip capability to file editors.",autoStart:!0,optional:[c.ITranslator],requires:[d.ITooltipManager,l.IEditorTracker,a.IRenderMimeRegistry],activate:(e,o,t,i,r)=>{const l=(null!=r?r:c.nullTranslator).load("jupyterlab"),s={},a=e.serviceManager.sessions,d=(e,o)=>{t.forEach((e=>{const t=(0,u.find)(o,(o=>e.context.path===o.path));if(t){const o=s[e.id];if(o&&o.id===t.id)return;o&&(delete s[e.id],o.dispose());const n=a.connectTo({model:t});s[e.id]=n}else{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}}))};d(0,a.running()),a.runningChanged.connect(d),t.widgetAdded.connect(((e,o)=>{o.disposed.connect((e=>{const o=s[e.id];o&&(o.dispose(),delete s[e.id])}))})),e.commands.addCommand(n.launchFile,{label:l.__("Open the tooltip"),execute:async()=>{const e=t.currentWidget,n=e&&s[e.id]&&s[e.id].kernel;if(!n)return;const r=e.content,l=null==r?void 0:r.editor;return l&&n&&i?o.invoke({anchor:r,editor:l,kernel:n,rendermime:i}):void 0}})}},b=[m,h,v,k];var T;!function(e){let o=0;e.fetch=function(e){const{detail:t,editor:n,kernel:i}=e,l=n.model.sharedModel.getSource(),s=n.getCursorPosition(),a=r.Text.jsIndexToCharIndex(n.getOffsetAt(s),l);if(!l||!i)return Promise.reject(void 0);const d={code:l,cursor_pos:a,detail_level:t||0},c=++o;return i.requestInspect(d).then((e=>{const t=e.content;return c!==o?Promise.reject(void 0):"ok"===t.status&&t.found?Promise.resolve(t.data):Promise.reject(void 0)}))}}(T||(T={}))}}]);
|