notebook 7.3.0a0__py3-none-any.whl → 7.3.0b0__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.

Files changed (233) hide show
  1. notebook/_version.py +1 -1
  2. notebook/app.py +10 -2
  3. notebook/static/113.bundle.js +1 -1
  4. notebook/static/1198.bundle.js +1 -1
  5. notebook/static/131.bundle.js +1 -1
  6. notebook/static/134.bundle.js +1 -1
  7. notebook/static/1408.bundle.js +1 -1
  8. notebook/static/1496.bundle.js +1 -1
  9. notebook/static/1584.bundle.js +1 -1
  10. notebook/static/1647.bundle.js +1 -1
  11. notebook/static/1650.bundle.js +1 -1
  12. notebook/static/1684.bundle.js +1 -1
  13. notebook/static/170.bundle.js +1 -1
  14. notebook/static/1809.bundle.js +1 -1
  15. notebook/static/1827.bundle.js +1 -1
  16. notebook/static/1828.bundle.js +1 -1
  17. notebook/static/1833.bundle.js +1 -1
  18. notebook/static/1958.bundle.js +1 -1
  19. notebook/static/1962.bundle.js +1 -1
  20. notebook/static/2007.bundle.js +1 -1
  21. notebook/static/2065.bundle.js +1 -1
  22. notebook/static/2088.bundle.js +1 -1
  23. notebook/static/2089.bundle.js +1 -1
  24. notebook/static/2122.bundle.js +1 -1
  25. notebook/static/2167.bundle.js +1 -1
  26. notebook/static/2184.bundle.js +1 -1
  27. notebook/static/2311.bundle.js +1 -1
  28. notebook/static/2401.bundle.js +1 -1
  29. notebook/static/2424.bundle.js +377 -0
  30. notebook/static/2479.bundle.js +1 -1
  31. notebook/static/2489.bundle.js +1 -1
  32. notebook/static/2607.bundle.js +1 -1
  33. notebook/static/2615.bundle.js +1 -1
  34. notebook/static/2636.bundle.js +1 -1
  35. notebook/static/2756.bundle.js +1 -1
  36. notebook/static/2813.bundle.js +1 -1
  37. notebook/static/2866.bundle.js +1 -1
  38. notebook/static/2924.bundle.js +1 -1
  39. notebook/static/2944.bundle.js +1 -1
  40. notebook/static/2955.bundle.js +1 -0
  41. notebook/static/3129.bundle.js +1 -1
  42. notebook/static/3146.bundle.js +1 -1
  43. notebook/static/3187.bundle.js +1 -1
  44. notebook/static/3213.bundle.js +1 -1
  45. notebook/static/3301.bundle.js +1 -1
  46. notebook/static/3325.bundle.js +1 -1
  47. notebook/static/3340.bundle.js +1 -1
  48. notebook/static/3360.bundle.js +1 -1
  49. notebook/static/{1261.bundle.js → 3463.bundle.js} +1 -1
  50. notebook/static/3466.bundle.js +1 -1
  51. notebook/static/35.bundle.js +1 -1
  52. notebook/static/3512.bundle.js +1 -1
  53. notebook/static/3676.bundle.js +1 -1
  54. notebook/static/3680.bundle.js +1 -1
  55. notebook/static/374.bundle.js +1 -1
  56. notebook/static/3768.bundle.js +1 -1
  57. notebook/static/377.bundle.js +1 -1
  58. notebook/static/3863.bundle.js +1 -1
  59. notebook/static/3881.bundle.js +1 -1
  60. notebook/static/4042.bundle.js +1 -1
  61. notebook/static/4058.bundle.js +1 -1
  62. notebook/static/409.bundle.js +1 -1
  63. notebook/static/4212.bundle.js +1 -1
  64. notebook/static/4242.bundle.js +79 -0
  65. notebook/static/4271.bundle.js +1 -1
  66. notebook/static/4291.bundle.js +1 -1
  67. notebook/static/4382.bundle.js +1 -1
  68. notebook/static/4526.bundle.js +1 -1
  69. notebook/static/4588.bundle.js +1 -1
  70. notebook/static/4630.bundle.js +1 -1
  71. notebook/static/4645.bundle.js +1 -1
  72. notebook/static/4811.bundle.js +1 -1
  73. notebook/static/4837.bundle.js +1 -1
  74. notebook/static/5099.bundle.js +1 -1
  75. notebook/static/5135.bundle.js +1 -1
  76. notebook/static/5166.bundle.js +1 -1
  77. notebook/static/5234.bundle.js +1 -1
  78. notebook/static/5254.bundle.js +1 -1
  79. notebook/static/5261.bundle.js +1 -1
  80. notebook/static/5263.bundle.js +1 -0
  81. notebook/static/5313.bundle.js +1 -1
  82. notebook/static/5325.bundle.js +1 -1
  83. notebook/static/5346.bundle.js +1 -1
  84. notebook/static/5426.bundle.js +1 -1
  85. notebook/static/5430.bundle.js +653 -0
  86. notebook/static/545.bundle.js +1 -1
  87. notebook/static/5451.bundle.js +1 -1
  88. notebook/static/5573.bundle.js +1 -1
  89. notebook/static/5601.bundle.js +1 -1
  90. notebook/static/5649.bundle.js +3 -3
  91. notebook/static/5733.bundle.js +1 -1
  92. notebook/static/5828.bundle.js +1 -1
  93. notebook/static/5850.bundle.js +1 -1
  94. notebook/static/5912.bundle.js +1 -1
  95. notebook/static/5921.bundle.js +1 -1
  96. notebook/static/6017.bundle.js +1 -1
  97. notebook/static/6061.bundle.js +1 -1
  98. notebook/static/6139.bundle.js +1 -1
  99. notebook/static/62.bundle.js +1 -1
  100. notebook/static/6271.bundle.js +1 -1
  101. notebook/static/6345.bundle.js +1 -1
  102. notebook/static/6604.bundle.js +1 -1
  103. notebook/static/6621.bundle.js +1 -1
  104. notebook/static/6627.bundle.js +1 -1
  105. notebook/static/6648.bundle.js +1 -0
  106. notebook/static/6731.bundle.js +1 -1
  107. notebook/static/6748.bundle.js +1 -1
  108. notebook/static/677.bundle.js +1 -1
  109. notebook/static/6815.bundle.js +1 -1
  110. notebook/static/6853.bundle.js +1 -1
  111. notebook/static/6893.bundle.js +1 -1
  112. notebook/static/690.bundle.js +1 -1
  113. notebook/static/6962.bundle.js +1 -1
  114. notebook/static/6999.bundle.js +1 -1
  115. notebook/static/7226.bundle.js +1 -1
  116. notebook/static/7252.bundle.js +1 -1
  117. notebook/static/7302.bundle.js +1 -1
  118. notebook/static/7386.bundle.js +1 -1
  119. notebook/static/7391.bundle.js +1 -1
  120. notebook/static/7450.bundle.js +1 -1
  121. notebook/static/7543.bundle.js +1 -1
  122. notebook/static/755.bundle.js +1 -1
  123. notebook/static/7603.bundle.js +1 -1
  124. notebook/static/7639.bundle.js +1 -1
  125. notebook/static/7655.bundle.js +1 -1
  126. notebook/static/{4427.bundle.js → 7674.bundle.js} +1 -1
  127. notebook/static/7684.bundle.js +1 -1
  128. notebook/static/7812.bundle.js +1 -1
  129. notebook/static/7819.bundle.js +1 -1
  130. notebook/static/7821.bundle.js +1 -1
  131. notebook/static/7854.bundle.js +1 -1
  132. notebook/static/7866.bundle.js +1 -0
  133. notebook/static/7900.bundle.js +1 -1
  134. notebook/static/7906.bundle.js +1 -1
  135. notebook/static/7995.bundle.js +1 -1
  136. notebook/static/8010.bundle.js +1 -1
  137. notebook/static/8032.bundle.js +1 -1
  138. notebook/static/8471.bundle.js +1 -1
  139. notebook/static/8579.bundle.js +1 -1
  140. notebook/static/8633.bundle.js +1 -1
  141. notebook/static/8635.bundle.js +41 -0
  142. notebook/static/8771.bundle.js +1 -1
  143. notebook/static/8781.bundle.js +1 -1
  144. notebook/static/8875.bundle.js +1 -1
  145. notebook/static/8907.bundle.js +1 -1
  146. notebook/static/8928.bundle.js +1 -1
  147. notebook/static/8929.bundle.js +1 -1
  148. notebook/static/893.bundle.js +1 -1
  149. notebook/static/901.bundle.js +1 -1
  150. notebook/static/9068.bundle.js +1 -1
  151. notebook/static/911.bundle.js +1 -1
  152. notebook/static/9136.bundle.js +1 -1
  153. notebook/static/9151.bundle.js +1 -1
  154. notebook/static/9161.bundle.js +1 -1
  155. notebook/static/9268.bundle.js +1 -1
  156. notebook/static/9335.bundle.js +1 -1
  157. notebook/static/9341.bundle.js +1 -1
  158. notebook/static/9380.bundle.js +1 -1
  159. notebook/static/9605.bundle.js +1 -1
  160. notebook/static/9638.bundle.js +1 -1
  161. notebook/static/9672.bundle.js +352 -0
  162. notebook/static/9680.bundle.js +1 -1
  163. notebook/static/9685.bundle.js +1 -1
  164. notebook/static/9752.bundle.js +1 -1
  165. notebook/static/9799.bundle.js +1 -0
  166. notebook/static/9821.bundle.js +1 -1
  167. notebook/static/9852.bundle.js +1 -1
  168. notebook/static/bundle.js +1 -1
  169. notebook/static/third-party-licenses.json +127 -133
  170. notebook/templates/consoles.html +1 -1
  171. notebook/templates/edit.html +1 -1
  172. notebook/templates/error.html +1 -1
  173. notebook/templates/notebooks.html +1 -1
  174. notebook/templates/terminals.html +1 -1
  175. notebook/templates/tree.html +1 -1
  176. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +17 -17
  177. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
  178. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  179. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +11 -11
  180. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +18 -18
  181. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -1
  182. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +13 -13
  183. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +12 -12
  184. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.6d49b092e49dc147dc54.js → notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.67f8b11d2af855286118.js +1 -1
  185. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/646.57a345a80ce9f0e64830.js → notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/907.767373e59d0c0e33ef12.js +1 -1
  186. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.7bcc163b9139ecb2b25b.js → notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.50419fa0a72e54064396.js +1 -1
  187. notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.fd0956ebf15f666a19f8.js +1 -0
  188. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  189. {notebook-7.3.0a0.dist-info → notebook-7.3.0b0.dist-info}/METADATA +2 -2
  190. {notebook-7.3.0a0.dist-info → notebook-7.3.0b0.dist-info}/RECORD +213 -222
  191. {notebook-7.3.0a0.dist-info → notebook-7.3.0b0.dist-info}/WHEEL +1 -1
  192. notebook/static/1226.bundle.js +0 -1
  193. notebook/static/1750.bundle.js +0 -1
  194. notebook/static/1884.bundle.js +0 -386
  195. notebook/static/4045.bundle.js +0 -1
  196. notebook/static/4434.bundle.js +0 -1
  197. notebook/static/5018.bundle.js +0 -1
  198. notebook/static/5712.bundle.js +0 -1
  199. notebook/static/6164.bundle.js +0 -1
  200. notebook/static/6318.bundle.js +0 -1
  201. notebook/static/6619.bundle.js +0 -1
  202. notebook/static/6898.bundle.js +0 -1
  203. notebook/static/7506.bundle.js +0 -703
  204. notebook/static/7579.bundle.js +0 -1
  205. notebook/static/8054.bundle.js +0 -1
  206. notebook/static/8647.bundle.js +0 -1
  207. notebook/static/8723.bundle.js +0 -1
  208. notebook/static/9092.bundle.js +0 -1
  209. notebook/static/9734.bundle.js +0 -1
  210. notebook/static/9906.bundle.js +0 -1
  211. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.9381fdb35e72f41d8af1.js +0 -1
  212. /notebook/static/{7506.bundle.js.LICENSE.txt → 4242.bundle.js.LICENSE.txt} +0 -0
  213. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  214. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  215. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  216. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  217. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  218. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  219. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  220. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  221. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  222. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  223. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  224. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  225. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  226. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  227. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  228. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  229. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  230. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  231. {notebook-7.3.0a0.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  232. {notebook-7.3.0a0.dist-info → notebook-7.3.0b0.dist-info}/entry_points.txt +0 -0
  233. {notebook-7.3.0a0.dist-info → notebook-7.3.0b0.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2489],{72489:(e,t,i)=>{i.r(t),i.d(t,{ABCWidgetFactory:()=>F,Base64ModelFactory:()=>f,Context:()=>_,DocumentModel:()=>p,DocumentRegistry:()=>E,DocumentWidget:()=>w,MimeContent:()=>b,MimeDocument:()=>C,MimeDocumentFactory:()=>D,TextModelFactory:()=>y,createReadonlyLabel:()=>g});var s,a=i(72703),n=i(65848),o=i(62514),r=i(70858),l=i(20998),h=i(2549),d=i(81997),c=i(63485);class _{constructor(e){var t,i;this._isReady=!1,this._isDisposed=!1,this._isPopulated=!1,this._path="",this._lineEnding=null,this._contentsModel=null,this._populatedPromise=new l.PromiseDelegate,this._pathChanged=new d.Signal(this),this._fileChanged=new d.Signal(this),this._saveState=new d.Signal(this),this._disposed=new d.Signal(this),this._lastModifiedCheckMargin=500,this._conflictModalIsOpen=!1;const h=this._manager=e.manager;this.translator=e.translator||r.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._factory=e.factory,this._dialogs=null!==(t=e.sessionDialogs)&&void 0!==t?t:new a.SessionContextDialogs({translator:e.translator}),this._opener=e.opener||s.noOp,this._path=this._manager.contents.normalize(e.path),this._lastModifiedCheckMargin=e.lastModifiedCheckMargin||500;const c=this._manager.contents.localPath(this._path),_=this._factory.preferredLanguage(n.PathExt.basename(c)),m=this._manager.contents.getSharedModelFactory(this._path),u=null==m?void 0:m.createNew({path:c,format:this._factory.fileFormat,contentType:this._factory.contentType,collaborative:this._factory.collaborative});this._model=this._factory.createNew({languagePreference:_,sharedModel:u,collaborationEnabled:null!==(i=null==m?void 0:m.collaborative)&&void 0!==i&&i}),this._readyPromise=h.ready.then((()=>this._populatedPromise.promise));const g=n.PathExt.extname(this._path);this.sessionContext=new a.SessionContext({sessionManager:h.sessions,specsManager:h.kernelspecs,path:c,type:".ipynb"===g?"notebook":"file",name:n.PathExt.basename(c),kernelPreference:e.kernelPreference||{shouldStart:!1},setBusy:e.setBusy}),this.sessionContext.propertyChanged.connect(this._onSessionChanged,this),h.contents.fileChanged.connect(this._onFileChanged,this),this.urlResolver=new o.RenderMimeRegistry.UrlResolver({path:this._path,contents:h.contents})}get pathChanged(){return this._pathChanged}get fileChanged(){return this._fileChanged}get saveState(){return this._saveState}get disposed(){return this._disposed}get lastModifiedCheckMargin(){return this._lastModifiedCheckMargin}set lastModifiedCheckMargin(e){this._lastModifiedCheckMargin=e}get model(){return this._model}get path(){return this._path}get localPath(){return this._manager.contents.localPath(this._path)}get contentsModel(){return this._contentsModel?{...this._contentsModel}:null}get factoryName(){return this.isDisposed?"":this._factory.name}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.sessionContext.dispose(),this._model.dispose(),this._model.sharedModel.dispose(),this._disposed.emit(void 0),d.Signal.clearData(this))}get isReady(){return this._isReady}get ready(){return this._readyPromise}get canSave(){var e;return!(!(null===(e=this._contentsModel)||void 0===e?void 0:e.writable)||this._model.collaborative)}async initialize(e){e?await this._save():await this._revert(),this.model.sharedModel.clearUndoHistory()}rename(e){return this.ready.then((()=>this._manager.ready.then((()=>this._rename(e)))))}async save(){await this.ready,await this._save()}async saveAs(){await this.ready;const e=this._manager.contents.localPath(this.path),t=await s.getSavePath(e);if(this.isDisposed||!t)return;const i=this._manager.contents.driveName(this.path),a=""==i?t:`${i}:${t}`;if(a===this._path)return this.save();try{await this._manager.ready,await this._manager.contents.get(a),await this._maybeOverWrite(a)}catch(e){if(!e.response||404!==e.response.status)throw e;await this._finishSaveAs(a)}}async download(){const e=await this._manager.contents.getDownloadUrl(this._path),t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t)}async revert(){await this.ready,await this._revert()}createCheckpoint(){const e=this._manager.contents;return this._manager.ready.then((()=>e.createCheckpoint(this._path)))}deleteCheckpoint(e){const t=this._manager.contents;return this._manager.ready.then((()=>t.deleteCheckpoint(this._path,e)))}restoreCheckpoint(e){const t=this._manager.contents,i=this._path;return this._manager.ready.then((()=>e?t.restoreCheckpoint(i,e):this.listCheckpoints().then((s=>{if(!this.isDisposed&&s.length)return e=s[s.length-1].id,t.restoreCheckpoint(i,e)}))))}listCheckpoints(){const e=this._manager.contents;return this._manager.ready.then((()=>e.listCheckpoints(this._path)))}addSibling(e,t={}){const i=this._opener;return i&&i(e,t),new h.DisposableDelegate((()=>{e.close()}))}_onFileChanged(e,t){var i;if("rename"!==t.type)return;let s=t.oldValue&&t.oldValue.path,a=t.newValue&&t.newValue.path;if(a&&0===this._path.indexOf(s||"")){let e=t.newValue;s!==this._path&&(a=this._path.replace(new RegExp(`^${s}/`),`${a}/`),s=this._path,e={last_modified:null===(i=t.newValue)||void 0===i?void 0:i.created,path:a}),this._updateContentsModel({...this._contentsModel,...e}),this._updatePath(a)}}_onSessionChanged(e,t){if("path"!==t)return;const i=this._manager.contents.driveName(this.path);let s=this.sessionContext.session.path;i&&(s=`${i}:${s}`),this._updatePath(s)}_updateContentsModel(e){var t,i,s,a;const n=e.writable&&!this._model.collaborative,o={path:e.path,name:e.name,type:e.type,writable:n,created:e.created,last_modified:e.last_modified,mimetype:e.mimetype,format:e.format,hash:e.hash,hash_algorithm:e.hash_algorithm},r=null!==(i=null===(t=this._contentsModel)||void 0===t?void 0:t.last_modified)&&void 0!==i?i:null,l=null!==(a=null===(s=this._contentsModel)||void 0===s?void 0:s.hash)&&void 0!==a?a:null;this._contentsModel=o,(!r&&!l||!l&&o.last_modified!==r||l&&o.hash!==l)&&this._fileChanged.emit(o)}_updatePath(e){var t,i,s,a;if(this._path===e)return;this._path=e;const o=this._manager.contents.localPath(e),r=n.PathExt.basename(o);if((null===(t=this.sessionContext.session)||void 0===t?void 0:t.path)!==o&&(null===(i=this.sessionContext.session)||void 0===i||i.setPath(o)),(null===(s=this.sessionContext.session)||void 0===s?void 0:s.name)!==r&&(null===(a=this.sessionContext.session)||void 0===a||a.setName(r)),this.urlResolver.path!==e&&(this.urlResolver.path=e),this._contentsModel&&(this._contentsModel.path!==e||this._contentsModel.name!==r)){const t={...this._contentsModel,name:r,path:e};this._updateContentsModel(t)}this._pathChanged.emit(e)}async _populate(){if(this._isPopulated=!0,this._isReady=!0,this._populatedPromise.resolve(void 0),await this._maybeCheckpoint(!1),this.isDisposed)return;const e=this._model.defaultKernelName||this.sessionContext.kernelPreference.name;this.sessionContext.kernelPreference={...this.sessionContext.kernelPreference,name:e,language:this._model.defaultKernelLanguage},this.sessionContext.initialize().then((e=>{e&&this._dialogs.selectKernel(this.sessionContext)}))}async _rename(e){const t=this.localPath.split("/");t[t.length-1]=e;let i=n.PathExt.join(...t);const s=this._manager.contents.driveName(this.path);s&&(i=`${s}:${i}`),await this._manager.contents.rename(this.path,i)}async _save(){this._saveState.emit("started");const e=this._createSaveOptions();try{await this._manager.ready;const t=await this._maybeSave(e);if(this.isDisposed)return;this._model.dirty=!1,this._updateContentsModel(t),this._isPopulated||await this._populate(),this._saveState.emit("completed")}catch(e){const{name:t}=e;if("ModalCancelError"===t||"ModalDuplicateError"===t)throw e;const i=this._manager.contents.localPath(this._path),s=n.PathExt.basename(i);throw this._handleError(e,this._trans.__("File Save Error for %1",s)),this._saveState.emit("failed"),e}}_revert(e=!1){const t={type:this._factory.contentType,content:null!==this._factory.fileFormat,hash:null!==this._factory.fileFormat,...null!==this._factory.fileFormat?{format:this._factory.fileFormat}:{}},i=this._path,s=this._model;return this._manager.ready.then((()=>this._manager.contents.get(i,t))).then((e=>{if(!this.isDisposed){if(e.content)if("json"===e.format)s.fromJSON(e.content);else{let t=e.content;-1!==t.indexOf("\r\n")?(this._lineEnding="\r\n",t=t.replace(/\r\n/g,"\n")):-1!==t.indexOf("\r")?(this._lineEnding="\r",t=t.replace(/\r/g,"\n")):this._lineEnding=null,s.fromString(t)}return this._updateContentsModel(e),s.dirty=!1,this._isPopulated?void 0:this._populate()}})).catch((async e=>{const t=this._manager.contents.localPath(this._path),i=n.PathExt.basename(t);throw this._handleError(e,this._trans.__("File Load Error for %1",i)),e}))}_maybeSave(e){const t=this._path;return this._manager.contents.get(t,{content:!1,hash:!0}).then((i=>{var s,a,n,o;if(this.isDisposed)return Promise.reject(new Error("Disposed"));const r=void 0!==(null===(s=this.contentsModel)||void 0===s?void 0:s.hash)&&null!==(null===(a=this.contentsModel)||void 0===a?void 0:a.hash)&&void 0!==i.hash&&null!==i.hash,l=null===(n=this.contentsModel)||void 0===n?void 0:n.hash,h=i.hash;if(r&&l!==h)return console.warn(`Different hash found for ${this.path}`),this._raiseConflict(i,e);const d=this._lastModifiedCheckMargin,c=null===(o=this.contentsModel)||void 0===o?void 0:o.last_modified,_=c?new Date(c):new Date,m=new Date(i.last_modified);return!r&&c&&m.getTime()-_.getTime()>d?(console.warn(`Last saving performed ${_} while the current file seems to have been saved ${m}`),this._raiseConflict(i,e)):this._manager.contents.save(t,e).then((async e=>{const i=await this._manager.contents.get(t,{content:!1,hash:!0});return{...e,hash:i.hash,hash_algorithm:i.hash_algorithm}}))}),(i=>{if(i.response&&404===i.response.status)return this._manager.contents.save(t,e).then((async e=>{const i=await this._manager.contents.get(t,{content:!1,hash:!0});return{...e,hash:i.hash,hash_algorithm:i.hash_algorithm}}));throw i}))}async _handleError(e,t){await(0,a.showErrorMessage)(t,e)}_maybeCheckpoint(e){let t=Promise.resolve(void 0);return this.canSave?(t=e?this.createCheckpoint().then():this.listCheckpoints().then((e=>{if(!this.isDisposed&&!e.length&&this.canSave)return this.createCheckpoint().then()})),t.catch((e=>{if(!e.response||403!==e.response.status)throw e}))):t}_raiseConflict(e,t){if(this._conflictModalIsOpen){const e=new Error("Modal is already displayed");return e.name="ModalDuplicateError",Promise.reject(e)}const i=this._trans.__('"%1" has changed on disk since the last time it was opened or saved.\nDo you want to overwrite the file on disk with the version open here,\nor load the version on disk (revert)?',this.path),s=a.Dialog.okButton({label:this._trans.__("Revert"),actions:["revert"]}),n=a.Dialog.warnButton({label:this._trans.__("Overwrite"),actions:["overwrite"]});return this._conflictModalIsOpen=!0,(0,a.showDialog)({title:this._trans.__("File Changed"),body:i,buttons:[a.Dialog.cancelButton(),s,n]}).then((i=>{if(this._conflictModalIsOpen=!1,this.isDisposed)return Promise.reject(new Error("Disposed"));if(i.button.actions.includes("overwrite"))return this._manager.contents.save(this._path,t);if(i.button.actions.includes("revert"))return this.revert().then((()=>e));const s=new Error("Cancel");return s.name="ModalCancelError",Promise.reject(s)}))}_maybeOverWrite(e){const t=this._trans.__('"%1" already exists. Do you want to replace it?',e),i=a.Dialog.warnButton({label:this._trans.__("Overwrite"),accept:!0});return(0,a.showDialog)({title:this._trans.__("File Overwrite?"),body:t,buttons:[a.Dialog.cancelButton(),i]}).then((t=>this.isDisposed?Promise.reject(new Error("Disposed")):t.button.accept?this._manager.contents.delete(e).then((()=>this._finishSaveAs(e))):void 0))}async _finishSaveAs(e){this._saveState.emit("started");try{await this._manager.ready;const t=this._createSaveOptions();await this._manager.contents.save(e,t),await this._maybeCheckpoint(!0),this._saveState.emit("completed")}catch(e){if("Cancel"===e.message||"Modal is already displayed"===e.message)throw e;const t=this._manager.contents.localPath(this._path),i=n.PathExt.basename(t);return this._handleError(e,this._trans.__("File Save Error for %1",i)),void this._saveState.emit("failed")}}_createSaveOptions(){let e=null;return"json"===this._factory.fileFormat?e=this._model.toJSON():(e=this._model.toString(),this._lineEnding&&(e=e.replace(/\n/g,this._lineEnding))),{type:this._factory.contentType,format:this._factory.fileFormat,content:e}}}!function(e){e.getSavePath=function(e,i){const s=(i=i||r.nullTranslator).load("jupyterlab"),n=a.Dialog.okButton({label:s.__("Save"),accept:!0});return(0,a.showDialog)({title:s.__("Save File As…"),body:new t(e),buttons:[a.Dialog.cancelButton(),n]}).then((e=>{var t;if(e.button.accept)return null!==(t=e.value)&&void 0!==t?t:void 0}))},e.noOp=function(){};class t extends c.Widget{constructor(e){super({node:i(e)})}getValue(){return this.node.value}}function i(e){const t=document.createElement("input");return t.value=e,t}}(s||(s={}));var m=i(63242),u=i(78156);function g(e,t){var i;let s=(null!=t?t:r.nullTranslator).load("jupyterlab");return a.ReactWidget.create(u.createElement("div",null,u.createElement("span",{className:"jp-ToolbarLabelComponent",title:s.__('Document is read-only. "Save" is disabled; use "Save as…" instead')},s.__("%1 is read-only",null===(i=e.context.contentsModel)||void 0===i?void 0:i.type))))}class p extends m.CodeEditor.Model{constructor(e={}){var t;super({sharedModel:e.sharedModel}),this._defaultLang="",this._dirty=!1,this._readOnly=!1,this._contentChanged=new d.Signal(this),this._stateChanged=new d.Signal(this),this._defaultLang=null!==(t=e.languagePreference)&&void 0!==t?t:"",this._collaborationEnabled=!!e.collaborationEnabled,this.sharedModel.changed.connect(this._onStateChanged,this)}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get dirty(){return this._dirty}set dirty(e){const t=this._dirty;e!==t&&(this._dirty=e,this.triggerStateChange({name:"dirty",oldValue:t,newValue:e}))}get readOnly(){return this._readOnly}set readOnly(e){if(e===this._readOnly)return;const t=this._readOnly;this._readOnly=e,this.triggerStateChange({name:"readOnly",oldValue:t,newValue:e})}get defaultKernelName(){return""}get defaultKernelLanguage(){return this._defaultLang}get collaborative(){return this._collaborationEnabled}toString(){return this.sharedModel.getSource()}fromString(e){this.sharedModel.setSource(e)}toJSON(){return JSON.parse(this.sharedModel.getSource()||"null")}fromJSON(e){this.fromString(JSON.stringify(e))}initialize(){}triggerStateChange(e){this._stateChanged.emit(e)}triggerContentChange(){this._contentChanged.emit(void 0),this.dirty=!0}_onStateChanged(e,t){t.sourceChange&&this.triggerContentChange(),t.stateChange&&t.stateChange.forEach((e=>{"dirty"===e.name?this.dirty=e.newValue:e.oldValue!==e.newValue&&this.triggerStateChange({newValue:void 0,oldValue:void 0,...e})}))}}class y{constructor(e){this._isDisposed=!1,this._collaborative=null==e||e}get name(){return"text"}get contentType(){return"file"}get fileFormat(){return"text"}get collaborative(){return this._collaborative}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0}createNew(e={}){const t=e.collaborationEnabled&&this.collaborative;return new p({...e,collaborationEnabled:t})}preferredLanguage(e){return""}}class f extends y{get name(){return"base64"}get contentType(){return"file"}get fileFormat(){return"base64"}}class F{constructor(e){this._isDisposed=!1,this._widgetCreated=new d.Signal(this),this._translator=e.translator||r.nullTranslator,this._name=e.name,this._label=e.label||e.name,this._readOnly=void 0!==e.readOnly&&e.readOnly,this._defaultFor=e.defaultFor?e.defaultFor.slice():[],this._defaultRendered=(e.defaultRendered||[]).slice(),this._fileTypes=e.fileTypes.slice(),this._modelName=e.modelName||"text",this._preferKernel=!!e.preferKernel,this._canStartKernel=!!e.canStartKernel,this._shutdownOnClose=!!e.shutdownOnClose,this._autoStartDefault=!!e.autoStartDefault,this._toolbarFactory=e.toolbarFactory}get widgetCreated(){return this._widgetCreated}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,d.Signal.clearData(this))}get readOnly(){return this._readOnly}get name(){return this._name}get label(){return this._label}get fileTypes(){return this._fileTypes.slice()}get modelName(){return this._modelName}get defaultFor(){return this._defaultFor.slice()}get defaultRendered(){return this._defaultRendered.slice()}get preferKernel(){return this._preferKernel}get canStartKernel(){return this._canStartKernel}get translator(){return this._translator}get shutdownOnClose(){return this._shutdownOnClose}set shutdownOnClose(e){this._shutdownOnClose=e}get autoStartDefault(){return this._autoStartDefault}set autoStartDefault(e){this._autoStartDefault=e}createNew(e,t){var i;const s=this.createNewWidget(e,t);return(0,a.setToolbar)(s,null!==(i=this._toolbarFactory)&&void 0!==i?i:this.defaultToolbarFactory.bind(this)),this._widgetCreated.emit(s),s}defaultToolbarFactory(e){return[]}}const v="jp-mod-dirty";class w extends a.MainAreaWidget{constructor(e){var t;e.reveal=Promise.all([e.reveal,e.context.ready]),super(e),this._trans=(null!==(t=e.translator)&&void 0!==t?t:r.nullTranslator).load("jupyterlab"),this.context=e.context,this.context.pathChanged.connect(this._onPathChanged,this),this._onPathChanged(this.context,this.context.path),this.context.model.stateChanged.connect(this._onModelStateChanged,this),this.context.ready.then((()=>{this._handleDirtyState()})),this.title.changed.connect(this._onTitleChanged,this)}setFragment(e){}async _onTitleChanged(e){const t=this.title.label,i=this.context.localPath.split("/").pop()||this.context.localPath;if(t!==i){if(t.length>0&&!/[\/\\:]/.test(t)){const e=this.context.path;if(await this.context.rename(t),this.context.path!==e)return}this.title.label=i}}_onPathChanged(e,t){this.title.label=n.PathExt.basename(e.localPath),this.isUntitled=!1}_onModelStateChanged(e,t){var i;if("dirty"===t.name&&this._handleDirtyState(),!this.context.model.dirty&&!this.context.model.collaborative&&!(null===(i=this.context.contentsModel)||void 0===i?void 0:i.writable)){const e=g(this);this.toolbar.insertBefore("kernelName","read-only-indicator",e)||this.toolbar.addItem("read-only-indicator",e)}}_handleDirtyState(){this.context.model.dirty&&!this.title.className.includes(v)?this.title.className+=` ${v}`:this.title.className=this.title.className.replace(v,"")}}var x,T=i(49503);class b extends c.Widget{constructor(e){super(),this._changeCallback=e=>{if(!e.data||!e.data[this.mimeType])return;const t=e.data[this.mimeType];"string"==typeof t?t!==this._context.model.toString()&&this._context.model.fromString(t):null==t||l.JSONExt.deepEqual(t,this._context.model.toJSON())||this._context.model.fromJSON(t)},this._fragment="",this._ready=new l.PromiseDelegate,this._isRendering=!1,this._renderRequested=!1,this.addClass("jp-MimeDocument"),this.translator=e.translator||r.nullTranslator,this._trans=this.translator.load("jupyterlab"),this.mimeType=e.mimeType,this._dataType=e.dataType||"string",this._context=e.context,this.renderer=e.renderer,(this.layout=new c.StackedLayout).addWidget(this.renderer),this._context.ready.then((()=>this._render())).then((()=>{this.node===document.activeElement&&T.MessageLoop.sendMessage(this.renderer,c.Widget.Msg.ActivateRequest),this._monitor=new n.ActivityMonitor({signal:this._context.model.contentChanged,timeout:e.renderTimeout}),this._monitor.activityStopped.connect(this.update,this),this._ready.resolve(void 0)})).catch((e=>{requestAnimationFrame((()=>{this.dispose()})),(0,a.showErrorMessage)(this._trans.__("Renderer Failure: %1",this._context.path),e)}))}[a.Printing.symbol](){return a.Printing.getPrintFunction(this.renderer)}get ready(){return this._ready.promise}setFragment(e){this._fragment=e,this.update()}dispose(){this.isDisposed||(this._monitor&&this._monitor.dispose(),this._monitor=null,super.dispose())}onUpdateRequest(e){this._context.isReady&&(this._render(),this._fragment="")}async _render(){if(this.isDisposed)return;if(this._isRendering)return void(this._renderRequested=!0);this._renderRequested=!1;const e=this._context,t=e.model,i={};"string"===this._dataType?i[this.mimeType]=t.toString():i[this.mimeType]=t.toJSON();const s=new o.MimeModel({data:i,callback:this._changeCallback,metadata:{fragment:this._fragment}});try{if(this._isRendering=!0,await this.renderer.renderModel(s),this._isRendering=!1,this._renderRequested)return this._render()}catch(t){requestAnimationFrame((()=>{this.dispose()})),(0,a.showErrorMessage)(this._trans.__("Renderer Failure: %1",e.path),t)}}}class C extends w{setFragment(e){this.content.setFragment(e)}}class D extends F{constructor(e){super(x.createRegistryOptions(e)),this._rendermime=e.rendermime,this._renderTimeout=e.renderTimeout||1e3,this._dataType=e.dataType||"string",this._fileType=e.primaryFileType,this._factory=e.factory}createNewWidget(e){var t,i;const s=this._fileType,a=(null==s?void 0:s.mimeTypes.length)?s.mimeTypes[0]:m.IEditorMimeTypeService.defaultMimeType,n=this._rendermime.clone({resolver:e.urlResolver});let o;o=this._factory&&this._factory.mimeTypes.includes(a)?this._factory.createRenderer({mimeType:a,resolver:n.resolver,sanitizer:n.sanitizer,linkHandler:n.linkHandler,latexTypesetter:n.latexTypesetter,markdownParser:n.markdownParser}):n.createRenderer(a);const r=new b({context:e,renderer:o,mimeType:a,renderTimeout:this._renderTimeout,dataType:this._dataType});return r.title.icon=null==s?void 0:s.icon,r.title.iconClass=null!==(t=null==s?void 0:s.iconClass)&&void 0!==t?t:"",r.title.iconLabel=null!==(i=null==s?void 0:s.iconLabel)&&void 0!==i?i:"",new C({content:r,context:e})}}!function(e){e.createRegistryOptions=function(e){return{...e,readOnly:!0}}}(x||(x={}));var S,M=i(95291),O=i(33625);class E{constructor(e={}){this._modelFactories=Object.create(null),this._widgetFactories=Object.create(null),this._defaultWidgetFactory="",this._defaultWidgetFactoryOverrides=Object.create(null),this._defaultWidgetFactories=Object.create(null),this._defaultRenderedWidgetFactories=Object.create(null),this._widgetFactoriesForFileType=Object.create(null),this._fileTypes=[],this._extenders=Object.create(null),this._changed=new d.Signal(this),this._isDisposed=!1;const t=e.textModelFactory;if(this.translator=e.translator||r.nullTranslator,t&&"text"!==t.name)throw new Error("Text model factory must have the name `text`");this._modelFactories.text=t||new y(!0),(e.initialFileTypes||E.getDefaultFileTypes(this.translator)).forEach((e=>{const t={...E.getFileTypeDefaults(this.translator),...e};this._fileTypes.push(t)}))}get changed(){return this._changed}get isDisposed(){return this._isDisposed}dispose(){if(!this.isDisposed){this._isDisposed=!0;for(const e in this._modelFactories)this._modelFactories[e].dispose();for(const e in this._widgetFactories)this._widgetFactories[e].dispose();for(const e in this._extenders)this._extenders[e].length=0;this._fileTypes.length=0,d.Signal.clearData(this)}}addWidgetFactory(e){const t=e.name.toLowerCase();if(!t||"default"===t)throw Error("Invalid factory name");if(this._widgetFactories[t])return console.warn(`Duplicate registered factory ${t}`),new h.DisposableDelegate(S.noOp);this._widgetFactories[t]=e;for(const i of e.defaultFor||[])-1!==e.fileTypes.indexOf(i)&&("*"===i?this._defaultWidgetFactory=t:this._defaultWidgetFactories[i]=t);for(const i of e.defaultRendered||[])-1!==e.fileTypes.indexOf(i)&&(this._defaultRenderedWidgetFactories[i]=t);for(const i of e.fileTypes)this._widgetFactoriesForFileType[i]||(this._widgetFactoriesForFileType[i]=[]),this._widgetFactoriesForFileType[i].push(t);return this._changed.emit({type:"widgetFactory",name:t,change:"added"}),new h.DisposableDelegate((()=>{delete this._widgetFactories[t],this._defaultWidgetFactory===t&&(this._defaultWidgetFactory="");for(const e of Object.keys(this._defaultWidgetFactories))this._defaultWidgetFactories[e]===t&&delete this._defaultWidgetFactories[e];for(const e of Object.keys(this._defaultRenderedWidgetFactories))this._defaultRenderedWidgetFactories[e]===t&&delete this._defaultRenderedWidgetFactories[e];for(const e of Object.keys(this._widgetFactoriesForFileType))O.ArrayExt.removeFirstOf(this._widgetFactoriesForFileType[e],t),0===this._widgetFactoriesForFileType[e].length&&delete this._widgetFactoriesForFileType[e];for(const e of Object.keys(this._defaultWidgetFactoryOverrides))this._defaultWidgetFactoryOverrides[e]===t&&delete this._defaultWidgetFactoryOverrides[e];this._changed.emit({type:"widgetFactory",name:t,change:"removed"})}))}addModelFactory(e){const t=e.name.toLowerCase();return this._modelFactories[t]?(console.warn(`Duplicate registered factory ${t}`),new h.DisposableDelegate(S.noOp)):(this._modelFactories[t]=e,this._changed.emit({type:"modelFactory",name:t,change:"added"}),new h.DisposableDelegate((()=>{delete this._modelFactories[t],this._changed.emit({type:"modelFactory",name:t,change:"removed"})})))}addWidgetExtension(e,t){(e=e.toLowerCase())in this._extenders||(this._extenders[e]=[]);const i=this._extenders[e];return-1!==O.ArrayExt.firstIndexOf(i,t)?(console.warn(`Duplicate registered extension for ${e}`),new h.DisposableDelegate(S.noOp)):(this._extenders[e].push(t),this._changed.emit({type:"widgetExtension",name:e,change:"added"}),new h.DisposableDelegate((()=>{O.ArrayExt.removeFirstOf(this._extenders[e],t),this._changed.emit({type:"widgetExtension",name:e,change:"removed"})})))}addFileType(e,t){const i={...E.getFileTypeDefaults(this.translator),...e,...!(e.icon||e.iconClass)&&{icon:M.fileIcon}};if(this._fileTypes.push(i),t){const e=i.name.toLowerCase();t.map((e=>e.toLowerCase())).forEach((t=>{this._widgetFactoriesForFileType[e]||(this._widgetFactoriesForFileType[e]=[]),this._widgetFactoriesForFileType[e].includes(t)||this._widgetFactoriesForFileType[e].push(t)})),this._defaultWidgetFactories[e]||(this._defaultWidgetFactories[e]=this._widgetFactoriesForFileType[e][0])}return this._changed.emit({type:"fileType",name:i.name,change:"added"}),new h.DisposableDelegate((()=>{if(O.ArrayExt.removeFirstOf(this._fileTypes,i),t){const e=i.name.toLowerCase();for(const i of t.map((e=>e.toLowerCase())))O.ArrayExt.removeFirstOf(this._widgetFactoriesForFileType[e],i);this._defaultWidgetFactories[e]===t[0].toLowerCase()&&delete this._defaultWidgetFactories[e]}this._changed.emit({type:"fileType",name:e.name,change:"removed"})}))}preferredWidgetFactories(e){const t=new Set,i=this.getFileTypesForPath(n.PathExt.basename(e));i.forEach((e=>{e.name in this._defaultWidgetFactoryOverrides&&t.add(this._defaultWidgetFactoryOverrides[e.name])})),i.forEach((e=>{e.name in this._defaultWidgetFactories&&t.add(this._defaultWidgetFactories[e.name])})),i.forEach((e=>{e.name in this._defaultRenderedWidgetFactories&&t.add(this._defaultRenderedWidgetFactories[e.name])})),this._defaultWidgetFactory&&t.add(this._defaultWidgetFactory);for(const e of i)if(e.name in this._widgetFactoriesForFileType)for(const i of this._widgetFactoriesForFileType[e.name])t.add(i);if("*"in this._widgetFactoriesForFileType)for(const e of this._widgetFactoriesForFileType["*"])t.add(e);const s=[];for(const e of t){const t=this._widgetFactories[e];t&&((t.modelName||"text")in this._modelFactories&&s.push(t))}return s}defaultRenderedWidgetFactory(e){const t=this.getFileTypesForPath(n.PathExt.basename(e)).map((e=>e.name));for(const e in t)if(e in this._defaultWidgetFactoryOverrides)return this._widgetFactories[this._defaultWidgetFactoryOverrides[e]];for(const e in t)if(e in this._defaultRenderedWidgetFactories)return this._widgetFactories[this._defaultRenderedWidgetFactories[e]];return this.defaultWidgetFactory(e)}defaultWidgetFactory(e){return e?this.preferredWidgetFactories(e)[0]:this._widgetFactories[this._defaultWidgetFactory]}setDefaultWidgetFactory(e,t){if(e=e.toLowerCase(),!this.getFileType(e))throw Error(`Cannot find file type ${e}`);if(!t)return void(this._defaultWidgetFactoryOverrides[e]&&delete this._defaultWidgetFactoryOverrides[e]);if(!this.getWidgetFactory(t))throw Error(`Cannot find widget factory ${t}`);t=t.toLowerCase();const i=this._widgetFactoriesForFileType[e];if(!(t===this._defaultWidgetFactory||i&&i.includes(t)))throw Error(`Factory ${t} cannot view file type ${e}`);this._defaultWidgetFactoryOverrides[e]=t}*widgetFactories(){for(const e in this._widgetFactories)yield this._widgetFactories[e]}*modelFactories(){for(const e in this._modelFactories)yield this._modelFactories[e]}*widgetExtensions(e){if((e=e.toLowerCase())in this._extenders)for(const t of this._extenders[e])yield t}*fileTypes(){for(const e of this._fileTypes)yield e}getWidgetFactory(e){return this._widgetFactories[e.toLowerCase()]}getModelFactory(e){return this._modelFactories[e.toLowerCase()]}getFileType(e){return e=e.toLowerCase(),(0,O.find)(this._fileTypes,(t=>t.name.toLowerCase()===e))}getKernelPreference(e,t,i){t=t.toLowerCase();const s=this._widgetFactories[t];if(!s)return;const a=this.getModelFactory(s.modelName||"text");if(!a)return;const o=a.preferredLanguage(n.PathExt.basename(e)),r=i&&i.name;return{id:i&&i.id,name:r,language:o,shouldStart:s.preferKernel,canStart:s.canStartKernel,shutdownOnDispose:s.shutdownOnClose,autoStartDefault:s.autoStartDefault}}getFileTypeForModel(e){let t=null;if(e.name||e.path){const i=e.name||n.PathExt.basename(e.path),s=this.getFileTypesForPath(i);s.length>0&&(t=s[0])}switch(e.type){case"directory":return null!==t&&"directory"===t.contentType?t:(0,O.find)(this._fileTypes,(e=>"directory"===e.contentType))||E.getDefaultDirectoryFileType(this.translator);case"notebook":return null!==t&&"notebook"===t.contentType?t:(0,O.find)(this._fileTypes,(e=>"notebook"===e.contentType))||E.getDefaultNotebookFileType(this.translator);default:return null!==t?t:this.getFileType("text")||E.getDefaultTextFileType(this.translator)}}getFileTypesForPath(e){const t=[],i=n.PathExt.basename(e);let s=(0,O.find)(this._fileTypes,(e=>!(!e.pattern||null===i.match(e.pattern))));s&&t.push(s);let a=S.extname(i);for(;a.length>1;){const e=this._fileTypes.filter((e=>e.extensions.map((e=>e.toLowerCase())).includes(a)));t.push(...e),a="."+a.split(".").slice(2).join(".")}return t}}!function(e){function t(e){return{name:"default",displayName:(null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab")).__("default"),extensions:[],mimeTypes:[],contentType:"file",fileFormat:"text"}}function i(e){const i=null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab");return{...t(e),name:"text",displayName:i.__("Text"),mimeTypes:["text/plain"],extensions:[".txt"],icon:M.fileIcon}}function s(e){const i=null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab");return{...t(e),name:"notebook",displayName:i.__("Notebook"),mimeTypes:["application/x-ipynb+json"],extensions:[".ipynb"],contentType:"notebook",fileFormat:"json",icon:M.notebookIcon}}function a(e){const i=null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab");return{...t(e),name:"directory",displayName:i.__("Directory"),extensions:[],mimeTypes:["text/directory"],contentType:"directory",icon:M.folderIcon}}e.getFileTypeDefaults=t,e.getDefaultTextFileType=i,e.getDefaultNotebookFileType=s,e.getDefaultDirectoryFileType=a,e.getDefaultFileTypes=function(e){const t=null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab");return[i(e),s(e),a(e),{name:"markdown",displayName:t.__("Markdown File"),extensions:[".md"],mimeTypes:["text/markdown"],icon:M.markdownIcon},{name:"PDF",displayName:t.__("PDF File"),extensions:[".pdf"],mimeTypes:["application/pdf"],icon:M.pdfIcon},{name:"python",displayName:t.__("Python File"),extensions:[".py"],mimeTypes:["text/x-python"],icon:M.pythonIcon},{name:"json",displayName:t.__("JSON File"),extensions:[".json"],mimeTypes:["application/json"],icon:M.jsonIcon},{name:"jsonl",displayName:t.__("JSONLines File"),extensions:[".jsonl",".ndjson"],mimeTypes:["text/jsonl","application/jsonl","application/json-lines"],icon:M.jsonIcon},{name:"julia",displayName:t.__("Julia File"),extensions:[".jl"],mimeTypes:["text/x-julia"],icon:M.juliaIcon},{name:"csv",displayName:t.__("CSV File"),extensions:[".csv"],mimeTypes:["text/csv"],icon:M.spreadsheetIcon},{name:"tsv",displayName:t.__("TSV File"),extensions:[".tsv"],mimeTypes:["text/csv"],icon:M.spreadsheetIcon},{name:"r",displayName:t.__("R File"),mimeTypes:["text/x-rsrc"],extensions:[".R"],icon:M.rKernelIcon},{name:"yaml",displayName:t.__("YAML File"),mimeTypes:["text/x-yaml","text/yaml"],extensions:[".yaml",".yml"],icon:M.yamlIcon},{name:"svg",displayName:t.__("Image"),mimeTypes:["image/svg+xml"],extensions:[".svg"],icon:M.imageIcon,fileFormat:"base64"},{name:"tiff",displayName:t.__("Image"),mimeTypes:["image/tiff"],extensions:[".tif",".tiff"],icon:M.imageIcon,fileFormat:"base64"},{name:"jpeg",displayName:t.__("Image"),mimeTypes:["image/jpeg"],extensions:[".jpg",".jpeg"],icon:M.imageIcon,fileFormat:"base64"},{name:"gif",displayName:t.__("Image"),mimeTypes:["image/gif"],extensions:[".gif"],icon:M.imageIcon,fileFormat:"base64"},{name:"png",displayName:t.__("Image"),mimeTypes:["image/png"],extensions:[".png"],icon:M.imageIcon,fileFormat:"base64"},{name:"bmp",displayName:t.__("Image"),mimeTypes:["image/bmp"],extensions:[".bmp"],icon:M.imageIcon,fileFormat:"base64"},{name:"webp",displayName:t.__("Image"),mimeTypes:["image/webp"],extensions:[".webp"],icon:M.imageIcon,fileFormat:"base64"}]}}(E||(E={})),function(e){e.extname=function(e){const t=n.PathExt.basename(e).split(".");return t.shift(),("."+t.join(".")).toLowerCase()},e.noOp=function(){}}(S||(S={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2489],{72489:(e,t,i)=>{i.r(t),i.d(t,{ABCWidgetFactory:()=>F,Base64ModelFactory:()=>f,Context:()=>_,DocumentModel:()=>g,DocumentRegistry:()=>E,DocumentWidget:()=>w,MimeContent:()=>b,MimeDocument:()=>C,MimeDocumentFactory:()=>D,TextModelFactory:()=>y,createReadonlyLabel:()=>p});var s,a=i(53876),n=i(20754),o=i(58194),r=i(93050),l=i(21961),h=i(49901),d=i(2159),c=i(2260);class _{constructor(e){var t,i;this._isReady=!1,this._isDisposed=!1,this._isPopulated=!1,this._path="",this._lineEnding=null,this._contentsModel=null,this._populatedPromise=new l.PromiseDelegate,this._pathChanged=new d.Signal(this),this._fileChanged=new d.Signal(this),this._saveState=new d.Signal(this),this._disposed=new d.Signal(this),this._lastModifiedCheckMargin=500,this._conflictModalIsOpen=!1;const h=this._manager=e.manager;this.translator=e.translator||r.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._factory=e.factory,this._dialogs=null!==(t=e.sessionDialogs)&&void 0!==t?t:new a.SessionContextDialogs({translator:e.translator}),this._opener=e.opener||s.noOp,this._path=this._manager.contents.normalize(e.path),this._lastModifiedCheckMargin=e.lastModifiedCheckMargin||500;const c=this._manager.contents.localPath(this._path),_=this._factory.preferredLanguage(n.PathExt.basename(c)),m=this._manager.contents.getSharedModelFactory(this._path),u=null==m?void 0:m.createNew({path:c,format:this._factory.fileFormat,contentType:this._factory.contentType,collaborative:this._factory.collaborative});this._model=this._factory.createNew({languagePreference:_,sharedModel:u,collaborationEnabled:null!==(i=null==m?void 0:m.collaborative)&&void 0!==i&&i}),this._readyPromise=h.ready.then((()=>this._populatedPromise.promise));const p=n.PathExt.extname(this._path);this.sessionContext=new a.SessionContext({kernelManager:h.kernels,sessionManager:h.sessions,specsManager:h.kernelspecs,path:c,type:".ipynb"===p?"notebook":"file",name:n.PathExt.basename(c),kernelPreference:e.kernelPreference||{shouldStart:!1},setBusy:e.setBusy}),this.sessionContext.propertyChanged.connect(this._onSessionChanged,this),h.contents.fileChanged.connect(this._onFileChanged,this),this.urlResolver=new o.RenderMimeRegistry.UrlResolver({path:this._path,contents:h.contents})}get pathChanged(){return this._pathChanged}get fileChanged(){return this._fileChanged}get saveState(){return this._saveState}get disposed(){return this._disposed}get lastModifiedCheckMargin(){return this._lastModifiedCheckMargin}set lastModifiedCheckMargin(e){this._lastModifiedCheckMargin=e}get model(){return this._model}get path(){return this._path}get localPath(){return this._manager.contents.localPath(this._path)}get contentsModel(){return this._contentsModel?{...this._contentsModel}:null}get factoryName(){return this.isDisposed?"":this._factory.name}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.sessionContext.dispose(),this._model.dispose(),this._model.sharedModel.dispose(),this._disposed.emit(void 0),d.Signal.clearData(this))}get isReady(){return this._isReady}get ready(){return this._readyPromise}get canSave(){var e;return!(!(null===(e=this._contentsModel)||void 0===e?void 0:e.writable)||this._model.collaborative)}async initialize(e){e?await this._save():await this._revert(),this.model.sharedModel.clearUndoHistory()}rename(e){return this.ready.then((()=>this._manager.ready.then((()=>this._rename(e)))))}async save(){await this.ready,await this._save()}async saveAs(){await this.ready;const e=this._manager.contents.localPath(this.path),t=await s.getSavePath(e);if(this.isDisposed||!t)return;const i=this._manager.contents.driveName(this.path),a=""==i?t:`${i}:${t}`;if(a===this._path)return this.save();try{await this._manager.ready,await this._manager.contents.get(a),await this._maybeOverWrite(a)}catch(e){if(!e.response||404!==e.response.status)throw e;await this._finishSaveAs(a)}}async download(){const e=await this._manager.contents.getDownloadUrl(this._path),t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t)}async revert(){await this.ready,await this._revert()}createCheckpoint(){const e=this._manager.contents;return this._manager.ready.then((()=>e.createCheckpoint(this._path)))}deleteCheckpoint(e){const t=this._manager.contents;return this._manager.ready.then((()=>t.deleteCheckpoint(this._path,e)))}restoreCheckpoint(e){const t=this._manager.contents,i=this._path;return this._manager.ready.then((()=>e?t.restoreCheckpoint(i,e):this.listCheckpoints().then((s=>{if(!this.isDisposed&&s.length)return e=s[s.length-1].id,t.restoreCheckpoint(i,e)}))))}listCheckpoints(){const e=this._manager.contents;return this._manager.ready.then((()=>e.listCheckpoints(this._path)))}addSibling(e,t={}){const i=this._opener;return i&&i(e,t),new h.DisposableDelegate((()=>{e.close()}))}_onFileChanged(e,t){var i;if("save"===t.type&&this._model.collaborative)return void this._updateContentsModel({...this._contentsModel,...t.newValue});if("rename"!==t.type)return;let s=t.oldValue&&t.oldValue.path,a=t.newValue&&t.newValue.path;if(a&&0===this._path.indexOf(s||"")){let e=t.newValue;s!==this._path&&(a=this._path.replace(new RegExp(`^${s}/`),`${a}/`),s=this._path,e={last_modified:null===(i=t.newValue)||void 0===i?void 0:i.created,path:a}),this._updateContentsModel({...this._contentsModel,...e}),this._updatePath(a)}}_onSessionChanged(e,t){if("path"!==t)return;const i=this._manager.contents.driveName(this.path);let s=this.sessionContext.session.path;i&&(s=`${i}:${s}`),this._updatePath(s)}_updateContentsModel(e){var t,i,s,a;const n=e.writable&&!this._model.collaborative,o={path:e.path,name:e.name,type:e.type,writable:n,created:e.created,last_modified:e.last_modified,mimetype:e.mimetype,format:e.format,hash:e.hash,hash_algorithm:e.hash_algorithm},r=null!==(i=null===(t=this._contentsModel)||void 0===t?void 0:t.last_modified)&&void 0!==i?i:null,l=null!==(a=null===(s=this._contentsModel)||void 0===s?void 0:s.hash)&&void 0!==a?a:null;this._contentsModel=o,(!r&&!l||!l&&o.last_modified!==r||l&&o.hash!==l)&&this._fileChanged.emit(o)}_updatePath(e){var t,i,s,a;if(this._path===e)return;this._path=e;const o=this._manager.contents.localPath(e),r=n.PathExt.basename(o);if((null===(t=this.sessionContext.session)||void 0===t?void 0:t.path)!==o&&(null===(i=this.sessionContext.session)||void 0===i||i.setPath(o)),(null===(s=this.sessionContext.session)||void 0===s?void 0:s.name)!==r&&(null===(a=this.sessionContext.session)||void 0===a||a.setName(r)),this.urlResolver.path!==e&&(this.urlResolver.path=e),this._contentsModel&&(this._contentsModel.path!==e||this._contentsModel.name!==r)){const t={...this._contentsModel,name:r,path:e};this._updateContentsModel(t)}this._pathChanged.emit(e)}async _populate(){if(this._isPopulated=!0,this._isReady=!0,this._populatedPromise.resolve(void 0),await this._maybeCheckpoint(!1),this.isDisposed)return;const e=this._model.defaultKernelName||this.sessionContext.kernelPreference.name;this.sessionContext.kernelPreference={...this.sessionContext.kernelPreference,name:e,language:this._model.defaultKernelLanguage},this.sessionContext.initialize().then((e=>{e&&this._dialogs.selectKernel(this.sessionContext)}))}async _rename(e){const t=this.localPath.split("/");t[t.length-1]=e;let i=n.PathExt.join(...t);const s=this._manager.contents.driveName(this.path);s&&(i=`${s}:${i}`),await this._manager.contents.rename(this.path,i)}async _save(){this._saveState.emit("started");const e=this._createSaveOptions();try{await this._manager.ready;const t=await this._maybeSave(e);if(this.isDisposed)return;this._model.dirty=!1,this._updateContentsModel(t),this._isPopulated||await this._populate(),this._saveState.emit("completed")}catch(e){const{name:t}=e;if("ModalCancelError"===t||"ModalDuplicateError"===t)throw e;const i=this._manager.contents.localPath(this._path),s=n.PathExt.basename(i);throw this._handleError(e,this._trans.__("File Save Error for %1",s)),this._saveState.emit("failed"),e}}_revert(e=!1){const t={type:this._factory.contentType,content:null!==this._factory.fileFormat,hash:null!==this._factory.fileFormat,...null!==this._factory.fileFormat?{format:this._factory.fileFormat}:{}},i=this._path,s=this._model;return this._manager.ready.then((()=>this._manager.contents.get(i,t))).then((e=>{if(!this.isDisposed){if(e.content)if("json"===e.format)s.fromJSON(e.content);else{let t=e.content;-1!==t.indexOf("\r\n")?(this._lineEnding="\r\n",t=t.replace(/\r\n/g,"\n")):-1!==t.indexOf("\r")?(this._lineEnding="\r",t=t.replace(/\r/g,"\n")):this._lineEnding=null,s.fromString(t)}return this._updateContentsModel(e),s.dirty=!1,this._isPopulated?void 0:this._populate()}})).catch((async e=>{const t=this._manager.contents.localPath(this._path),i=n.PathExt.basename(t);throw this._handleError(e,this._trans.__("File Load Error for %1",i)),e}))}_maybeSave(e){const t=this._path;return this._manager.contents.get(t,{content:!1,hash:!0}).then((i=>{var s,a,n,o;if(this.isDisposed)return Promise.reject(new Error("Disposed"));const r=void 0!==(null===(s=this.contentsModel)||void 0===s?void 0:s.hash)&&null!==(null===(a=this.contentsModel)||void 0===a?void 0:a.hash)&&void 0!==i.hash&&null!==i.hash,l=null===(n=this.contentsModel)||void 0===n?void 0:n.hash,h=i.hash;if(r&&l!==h)return console.warn(`Different hash found for ${this.path}`),this._raiseConflict(i,e);const d=this._lastModifiedCheckMargin,c=null===(o=this.contentsModel)||void 0===o?void 0:o.last_modified,_=c?new Date(c):new Date,m=new Date(i.last_modified);return!r&&c&&m.getTime()-_.getTime()>d?(console.warn(`Last saving performed ${_} while the current file seems to have been saved ${m}`),this._raiseConflict(i,e)):this._manager.contents.save(t,e).then((async e=>{const i=await this._manager.contents.get(t,{content:!1,hash:!0});return{...e,hash:i.hash,hash_algorithm:i.hash_algorithm}}))}),(i=>{if(i.response&&404===i.response.status)return this._manager.contents.save(t,e).then((async e=>{const i=await this._manager.contents.get(t,{content:!1,hash:!0});return{...e,hash:i.hash,hash_algorithm:i.hash_algorithm}}));throw i}))}async _handleError(e,t){await(0,a.showErrorMessage)(t,e)}_maybeCheckpoint(e){let t=Promise.resolve(void 0);return this.canSave?(t=e?this.createCheckpoint().then():this.listCheckpoints().then((e=>{if(!this.isDisposed&&!e.length&&this.canSave)return this.createCheckpoint().then()})),t.catch((e=>{if(!e.response||403!==e.response.status)throw e}))):t}_raiseConflict(e,t){if(this._conflictModalIsOpen){const e=new Error("Modal is already displayed");return e.name="ModalDuplicateError",Promise.reject(e)}const i=this._trans.__('"%1" has changed on disk since the last time it was opened or saved.\nDo you want to overwrite the file on disk with the version open here,\nor load the version on disk (revert)?',this.path),s=a.Dialog.okButton({label:this._trans.__("Revert"),actions:["revert"]}),n=a.Dialog.warnButton({label:this._trans.__("Overwrite"),actions:["overwrite"]});return this._conflictModalIsOpen=!0,(0,a.showDialog)({title:this._trans.__("File Changed"),body:i,buttons:[a.Dialog.cancelButton(),s,n]}).then((i=>{if(this._conflictModalIsOpen=!1,this.isDisposed)return Promise.reject(new Error("Disposed"));if(i.button.actions.includes("overwrite"))return this._manager.contents.save(this._path,t);if(i.button.actions.includes("revert"))return this.revert().then((()=>e));const s=new Error("Cancel");return s.name="ModalCancelError",Promise.reject(s)}))}_maybeOverWrite(e){const t=this._trans.__('"%1" already exists. Do you want to replace it?',e),i=a.Dialog.warnButton({label:this._trans.__("Overwrite"),accept:!0});return(0,a.showDialog)({title:this._trans.__("File Overwrite?"),body:t,buttons:[a.Dialog.cancelButton(),i]}).then((t=>this.isDisposed?Promise.reject(new Error("Disposed")):t.button.accept?this._manager.contents.delete(e).then((()=>this._finishSaveAs(e))):void 0))}async _finishSaveAs(e){this._saveState.emit("started");try{await this._manager.ready;const t=this._createSaveOptions();await this._manager.contents.save(e,t),await this._maybeCheckpoint(!0),this._saveState.emit("completed")}catch(e){if("Cancel"===e.message||"Modal is already displayed"===e.message)throw e;const t=this._manager.contents.localPath(this._path),i=n.PathExt.basename(t);return this._handleError(e,this._trans.__("File Save Error for %1",i)),void this._saveState.emit("failed")}}_createSaveOptions(){let e=null;return"json"===this._factory.fileFormat?e=this._model.toJSON():(e=this._model.toString(),this._lineEnding&&(e=e.replace(/\n/g,this._lineEnding))),{type:this._factory.contentType,format:this._factory.fileFormat,content:e}}}!function(e){e.getSavePath=function(e,i){const s=(i=i||r.nullTranslator).load("jupyterlab"),n=a.Dialog.okButton({label:s.__("Save"),accept:!0});return(0,a.showDialog)({title:s.__("Save File As…"),body:new t(e),buttons:[a.Dialog.cancelButton(),n]}).then((e=>{var t;if(e.button.accept)return null!==(t=e.value)&&void 0!==t?t:void 0}))},e.noOp=function(){};class t extends c.Widget{constructor(e){super({node:i(e)})}getValue(){return this.node.value}}function i(e){const t=document.createElement("input");return t.value=e,t}}(s||(s={}));var m=i(983),u=i(78156);function p(e,t){var i;let s=(null!=t?t:r.nullTranslator).load("jupyterlab");return a.ReactWidget.create(u.createElement("div",null,u.createElement("span",{className:"jp-ToolbarLabelComponent",title:s.__('Document is read-only. "Save" is disabled; use "Save as…" instead')},s.__("%1 is read-only",null===(i=e.context.contentsModel)||void 0===i?void 0:i.type))))}class g extends m.CodeEditor.Model{constructor(e={}){var t;super({sharedModel:e.sharedModel}),this._defaultLang="",this._dirty=!1,this._readOnly=!1,this._contentChanged=new d.Signal(this),this._stateChanged=new d.Signal(this),this._defaultLang=null!==(t=e.languagePreference)&&void 0!==t?t:"",this._collaborationEnabled=!!e.collaborationEnabled,this.sharedModel.changed.connect(this._onStateChanged,this)}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get dirty(){return this._dirty}set dirty(e){const t=this._dirty;e!==t&&(this._dirty=e,this.triggerStateChange({name:"dirty",oldValue:t,newValue:e}))}get readOnly(){return this._readOnly}set readOnly(e){if(e===this._readOnly)return;const t=this._readOnly;this._readOnly=e,this.triggerStateChange({name:"readOnly",oldValue:t,newValue:e})}get defaultKernelName(){return""}get defaultKernelLanguage(){return this._defaultLang}get collaborative(){return this._collaborationEnabled}toString(){return this.sharedModel.getSource()}fromString(e){this.sharedModel.setSource(e)}toJSON(){return JSON.parse(this.sharedModel.getSource()||"null")}fromJSON(e){this.fromString(JSON.stringify(e))}initialize(){}triggerStateChange(e){this._stateChanged.emit(e)}triggerContentChange(){this._contentChanged.emit(void 0),this.dirty=!0}_onStateChanged(e,t){t.sourceChange&&this.triggerContentChange(),t.stateChange&&t.stateChange.forEach((e=>{"dirty"===e.name?this.dirty=e.newValue:e.oldValue!==e.newValue&&this.triggerStateChange({newValue:void 0,oldValue:void 0,...e})}))}}class y{constructor(e){this._isDisposed=!1,this._collaborative=null==e||e}get name(){return"text"}get contentType(){return"file"}get fileFormat(){return"text"}get collaborative(){return this._collaborative}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0}createNew(e={}){const t=e.collaborationEnabled&&this.collaborative;return new g({...e,collaborationEnabled:t})}preferredLanguage(e){return""}}class f extends y{get name(){return"base64"}get contentType(){return"file"}get fileFormat(){return"base64"}}class F{constructor(e){this._isDisposed=!1,this._widgetCreated=new d.Signal(this),this._translator=e.translator||r.nullTranslator,this._name=e.name,this._label=e.label||e.name,this._readOnly=void 0!==e.readOnly&&e.readOnly,this._defaultFor=e.defaultFor?e.defaultFor.slice():[],this._defaultRendered=(e.defaultRendered||[]).slice(),this._fileTypes=e.fileTypes.slice(),this._modelName=e.modelName||"text",this._preferKernel=!!e.preferKernel,this._canStartKernel=!!e.canStartKernel,this._shutdownOnClose=!!e.shutdownOnClose,this._autoStartDefault=!!e.autoStartDefault,this._toolbarFactory=e.toolbarFactory}get widgetCreated(){return this._widgetCreated}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,d.Signal.clearData(this))}get readOnly(){return this._readOnly}get name(){return this._name}get label(){return this._label}get fileTypes(){return this._fileTypes.slice()}get modelName(){return this._modelName}get defaultFor(){return this._defaultFor.slice()}get defaultRendered(){return this._defaultRendered.slice()}get preferKernel(){return this._preferKernel}get canStartKernel(){return this._canStartKernel}get translator(){return this._translator}get shutdownOnClose(){return this._shutdownOnClose}set shutdownOnClose(e){this._shutdownOnClose=e}get autoStartDefault(){return this._autoStartDefault}set autoStartDefault(e){this._autoStartDefault=e}createNew(e,t){var i;const s=this.createNewWidget(e,t);return(0,a.setToolbar)(s,null!==(i=this._toolbarFactory)&&void 0!==i?i:this.defaultToolbarFactory.bind(this)),this._widgetCreated.emit(s),s}defaultToolbarFactory(e){return[]}}const v="jp-mod-dirty";class w extends a.MainAreaWidget{constructor(e){var t;e.reveal=Promise.all([e.reveal,e.context.ready]),super(e),this._trans=(null!==(t=e.translator)&&void 0!==t?t:r.nullTranslator).load("jupyterlab"),this.context=e.context,this.context.pathChanged.connect(this._onPathChanged,this),this._onPathChanged(this.context,this.context.path),this.context.model.stateChanged.connect(this._onModelStateChanged,this),this.context.ready.then((()=>{this._handleDirtyState()})),this.title.changed.connect(this._onTitleChanged,this)}setFragment(e){}async _onTitleChanged(e){const t=this.title.label,i=this.context.localPath.split("/").pop()||this.context.localPath;if(t!==i){if(t.length>0&&!/[\/\\:]/.test(t)){const e=this.context.path;if(await this.context.rename(t),this.context.path!==e)return}this.title.label=i}}_onPathChanged(e,t){this.title.label=n.PathExt.basename(e.localPath),this.isUntitled=!1}_onModelStateChanged(e,t){var i;if("dirty"===t.name&&this._handleDirtyState(),!this.context.model.dirty&&!this.context.model.collaborative&&!(null===(i=this.context.contentsModel)||void 0===i?void 0:i.writable)){const e=p(this);this.toolbar.insertBefore("kernelName","read-only-indicator",e)||this.toolbar.addItem("read-only-indicator",e)}}_handleDirtyState(){this.context.model.dirty&&!this.title.className.includes(v)?this.title.className+=` ${v}`:this.title.className=this.title.className.replace(v,"")}}var x,T=i(62633);class b extends c.Widget{constructor(e){super(),this._changeCallback=e=>{if(!e.data||!e.data[this.mimeType])return;const t=e.data[this.mimeType];"string"==typeof t?t!==this._context.model.toString()&&this._context.model.fromString(t):null==t||l.JSONExt.deepEqual(t,this._context.model.toJSON())||this._context.model.fromJSON(t)},this._fragment="",this._ready=new l.PromiseDelegate,this._isRendering=!1,this._renderRequested=!1,this.addClass("jp-MimeDocument"),this.translator=e.translator||r.nullTranslator,this._trans=this.translator.load("jupyterlab"),this.mimeType=e.mimeType,this._dataType=e.dataType||"string",this._context=e.context,this.renderer=e.renderer,(this.layout=new c.StackedLayout).addWidget(this.renderer),this._context.ready.then((()=>this._render())).then((()=>{this.node===document.activeElement&&T.MessageLoop.sendMessage(this.renderer,c.Widget.Msg.ActivateRequest),this._monitor=new n.ActivityMonitor({signal:this._context.model.contentChanged,timeout:e.renderTimeout}),this._monitor.activityStopped.connect(this.update,this),this._ready.resolve(void 0)})).catch((e=>{requestAnimationFrame((()=>{this.dispose()})),(0,a.showErrorMessage)(this._trans.__("Renderer Failure: %1",this._context.path),e)}))}[a.Printing.symbol](){return a.Printing.getPrintFunction(this.renderer)}get ready(){return this._ready.promise}setFragment(e){this._fragment=e,this.update()}dispose(){this.isDisposed||(this._monitor&&this._monitor.dispose(),this._monitor=null,super.dispose())}onUpdateRequest(e){this._context.isReady&&(this._render(),this._fragment="")}async _render(){if(this.isDisposed)return;if(this._isRendering)return void(this._renderRequested=!0);this._renderRequested=!1;const e=this._context,t=e.model,i={};"string"===this._dataType?i[this.mimeType]=t.toString():i[this.mimeType]=t.toJSON();const s=new o.MimeModel({data:i,callback:this._changeCallback,metadata:{fragment:this._fragment}});try{if(this._isRendering=!0,await this.renderer.renderModel(s),this._isRendering=!1,this._renderRequested)return this._render()}catch(t){requestAnimationFrame((()=>{this.dispose()})),(0,a.showErrorMessage)(this._trans.__("Renderer Failure: %1",e.path),t)}}}class C extends w{setFragment(e){this.content.setFragment(e)}}class D extends F{constructor(e){super(x.createRegistryOptions(e)),this._rendermime=e.rendermime,this._renderTimeout=e.renderTimeout||1e3,this._dataType=e.dataType||"string",this._fileType=e.primaryFileType,this._factory=e.factory}createNewWidget(e){var t,i;const s=this._fileType,a=(null==s?void 0:s.mimeTypes.length)?s.mimeTypes[0]:m.IEditorMimeTypeService.defaultMimeType,n=this._rendermime.clone({resolver:e.urlResolver});let o;o=this._factory&&this._factory.mimeTypes.includes(a)?this._factory.createRenderer({mimeType:a,resolver:n.resolver,sanitizer:n.sanitizer,linkHandler:n.linkHandler,latexTypesetter:n.latexTypesetter,markdownParser:n.markdownParser}):n.createRenderer(a);const r=new b({context:e,renderer:o,mimeType:a,renderTimeout:this._renderTimeout,dataType:this._dataType});return r.title.icon=null==s?void 0:s.icon,r.title.iconClass=null!==(t=null==s?void 0:s.iconClass)&&void 0!==t?t:"",r.title.iconLabel=null!==(i=null==s?void 0:s.iconLabel)&&void 0!==i?i:"",new C({content:r,context:e})}}!function(e){e.createRegistryOptions=function(e){return{...e,readOnly:!0}}}(x||(x={}));var S,M=i(76878),O=i(14931);class E{constructor(e={}){this._modelFactories=Object.create(null),this._widgetFactories=Object.create(null),this._defaultWidgetFactory="",this._defaultWidgetFactoryOverrides=Object.create(null),this._defaultWidgetFactories=Object.create(null),this._defaultRenderedWidgetFactories=Object.create(null),this._widgetFactoriesForFileType=Object.create(null),this._fileTypes=[],this._extenders=Object.create(null),this._changed=new d.Signal(this),this._isDisposed=!1;const t=e.textModelFactory;if(this.translator=e.translator||r.nullTranslator,t&&"text"!==t.name)throw new Error("Text model factory must have the name `text`");this._modelFactories.text=t||new y(!0),(e.initialFileTypes||E.getDefaultFileTypes(this.translator)).forEach((e=>{const t={...E.getFileTypeDefaults(this.translator),...e};this._fileTypes.push(t)}))}get changed(){return this._changed}get isDisposed(){return this._isDisposed}dispose(){if(!this.isDisposed){this._isDisposed=!0;for(const e in this._modelFactories)this._modelFactories[e].dispose();for(const e in this._widgetFactories)this._widgetFactories[e].dispose();for(const e in this._extenders)this._extenders[e].length=0;this._fileTypes.length=0,d.Signal.clearData(this)}}addWidgetFactory(e){const t=e.name.toLowerCase();if(!t||"default"===t)throw Error("Invalid factory name");if(this._widgetFactories[t])return console.warn(`Duplicate registered factory ${t}`),new h.DisposableDelegate(S.noOp);this._widgetFactories[t]=e;for(const i of e.defaultFor||[])-1!==e.fileTypes.indexOf(i)&&("*"===i?this._defaultWidgetFactory=t:this._defaultWidgetFactories[i]=t);for(const i of e.defaultRendered||[])-1!==e.fileTypes.indexOf(i)&&(this._defaultRenderedWidgetFactories[i]=t);for(const i of e.fileTypes)this._widgetFactoriesForFileType[i]||(this._widgetFactoriesForFileType[i]=[]),this._widgetFactoriesForFileType[i].push(t);return this._changed.emit({type:"widgetFactory",name:t,change:"added"}),new h.DisposableDelegate((()=>{delete this._widgetFactories[t],this._defaultWidgetFactory===t&&(this._defaultWidgetFactory="");for(const e of Object.keys(this._defaultWidgetFactories))this._defaultWidgetFactories[e]===t&&delete this._defaultWidgetFactories[e];for(const e of Object.keys(this._defaultRenderedWidgetFactories))this._defaultRenderedWidgetFactories[e]===t&&delete this._defaultRenderedWidgetFactories[e];for(const e of Object.keys(this._widgetFactoriesForFileType))O.ArrayExt.removeFirstOf(this._widgetFactoriesForFileType[e],t),0===this._widgetFactoriesForFileType[e].length&&delete this._widgetFactoriesForFileType[e];for(const e of Object.keys(this._defaultWidgetFactoryOverrides))this._defaultWidgetFactoryOverrides[e]===t&&delete this._defaultWidgetFactoryOverrides[e];this._changed.emit({type:"widgetFactory",name:t,change:"removed"})}))}addModelFactory(e){const t=e.name.toLowerCase();return this._modelFactories[t]?(console.warn(`Duplicate registered factory ${t}`),new h.DisposableDelegate(S.noOp)):(this._modelFactories[t]=e,this._changed.emit({type:"modelFactory",name:t,change:"added"}),new h.DisposableDelegate((()=>{delete this._modelFactories[t],this._changed.emit({type:"modelFactory",name:t,change:"removed"})})))}addWidgetExtension(e,t){(e=e.toLowerCase())in this._extenders||(this._extenders[e]=[]);const i=this._extenders[e];return-1!==O.ArrayExt.firstIndexOf(i,t)?(console.warn(`Duplicate registered extension for ${e}`),new h.DisposableDelegate(S.noOp)):(this._extenders[e].push(t),this._changed.emit({type:"widgetExtension",name:e,change:"added"}),new h.DisposableDelegate((()=>{O.ArrayExt.removeFirstOf(this._extenders[e],t),this._changed.emit({type:"widgetExtension",name:e,change:"removed"})})))}addFileType(e,t){const i={...E.getFileTypeDefaults(this.translator),...e,...!(e.icon||e.iconClass)&&{icon:M.fileIcon}};if(this._fileTypes.push(i),t){const e=i.name.toLowerCase();t.map((e=>e.toLowerCase())).forEach((t=>{this._widgetFactoriesForFileType[e]||(this._widgetFactoriesForFileType[e]=[]),this._widgetFactoriesForFileType[e].includes(t)||this._widgetFactoriesForFileType[e].push(t)})),this._defaultWidgetFactories[e]||(this._defaultWidgetFactories[e]=this._widgetFactoriesForFileType[e][0])}return this._changed.emit({type:"fileType",name:i.name,change:"added"}),new h.DisposableDelegate((()=>{if(O.ArrayExt.removeFirstOf(this._fileTypes,i),t){const e=i.name.toLowerCase();for(const i of t.map((e=>e.toLowerCase())))O.ArrayExt.removeFirstOf(this._widgetFactoriesForFileType[e],i);this._defaultWidgetFactories[e]===t[0].toLowerCase()&&delete this._defaultWidgetFactories[e]}this._changed.emit({type:"fileType",name:e.name,change:"removed"})}))}preferredWidgetFactories(e){const t=new Set,i=this.getFileTypesForPath(n.PathExt.basename(e));i.forEach((e=>{e.name in this._defaultWidgetFactoryOverrides&&t.add(this._defaultWidgetFactoryOverrides[e.name])})),i.forEach((e=>{e.name in this._defaultWidgetFactories&&t.add(this._defaultWidgetFactories[e.name])})),i.forEach((e=>{e.name in this._defaultRenderedWidgetFactories&&t.add(this._defaultRenderedWidgetFactories[e.name])})),this._defaultWidgetFactory&&t.add(this._defaultWidgetFactory);for(const e of i)if(e.name in this._widgetFactoriesForFileType)for(const i of this._widgetFactoriesForFileType[e.name])t.add(i);if("*"in this._widgetFactoriesForFileType)for(const e of this._widgetFactoriesForFileType["*"])t.add(e);const s=[];for(const e of t){const t=this._widgetFactories[e];t&&((t.modelName||"text")in this._modelFactories&&s.push(t))}return s}defaultRenderedWidgetFactory(e){const t=this.getFileTypesForPath(n.PathExt.basename(e)).map((e=>e.name));for(const e in t)if(e in this._defaultWidgetFactoryOverrides)return this._widgetFactories[this._defaultWidgetFactoryOverrides[e]];for(const e in t)if(e in this._defaultRenderedWidgetFactories)return this._widgetFactories[this._defaultRenderedWidgetFactories[e]];return this.defaultWidgetFactory(e)}defaultWidgetFactory(e){return e?this.preferredWidgetFactories(e)[0]:this._widgetFactories[this._defaultWidgetFactory]}setDefaultWidgetFactory(e,t){if(e=e.toLowerCase(),!this.getFileType(e))throw Error(`Cannot find file type ${e}`);if(!t)return void(this._defaultWidgetFactoryOverrides[e]&&delete this._defaultWidgetFactoryOverrides[e]);if(!this.getWidgetFactory(t))throw Error(`Cannot find widget factory ${t}`);t=t.toLowerCase();const i=this._widgetFactoriesForFileType[e];if(!(t===this._defaultWidgetFactory||i&&i.includes(t)))throw Error(`Factory ${t} cannot view file type ${e}`);this._defaultWidgetFactoryOverrides[e]=t}*widgetFactories(){for(const e in this._widgetFactories)yield this._widgetFactories[e]}*modelFactories(){for(const e in this._modelFactories)yield this._modelFactories[e]}*widgetExtensions(e){if((e=e.toLowerCase())in this._extenders)for(const t of this._extenders[e])yield t}*fileTypes(){for(const e of this._fileTypes)yield e}getWidgetFactory(e){return this._widgetFactories[e.toLowerCase()]}getModelFactory(e){return this._modelFactories[e.toLowerCase()]}getFileType(e){return e=e.toLowerCase(),(0,O.find)(this._fileTypes,(t=>t.name.toLowerCase()===e))}getKernelPreference(e,t,i){t=t.toLowerCase();const s=this._widgetFactories[t];if(!s)return;const a=this.getModelFactory(s.modelName||"text");if(!a)return;const o=a.preferredLanguage(n.PathExt.basename(e)),r=i&&i.name;return{id:i&&i.id,name:r,language:o,shouldStart:s.preferKernel,canStart:s.canStartKernel,shutdownOnDispose:s.shutdownOnClose,autoStartDefault:s.autoStartDefault}}getFileTypeForModel(e){let t=null;if(e.name||e.path){const i=e.name||n.PathExt.basename(e.path),s=this.getFileTypesForPath(i);s.length>0&&(t=s[0])}switch(e.type){case"directory":return null!==t&&"directory"===t.contentType?t:(0,O.find)(this._fileTypes,(e=>"directory"===e.contentType))||E.getDefaultDirectoryFileType(this.translator);case"notebook":return null!==t&&"notebook"===t.contentType?t:(0,O.find)(this._fileTypes,(e=>"notebook"===e.contentType))||E.getDefaultNotebookFileType(this.translator);default:return null!==t?t:this.getFileType("text")||E.getDefaultTextFileType(this.translator)}}getFileTypesForPath(e){const t=[],i=n.PathExt.basename(e);let s=(0,O.find)(this._fileTypes,(e=>!(!e.pattern||null===i.match(e.pattern))));s&&t.push(s);let a=S.extname(i);for(;a.length>1;){const e=this._fileTypes.filter((e=>e.extensions.map((e=>e.toLowerCase())).includes(a)));t.push(...e),a="."+a.split(".").slice(2).join(".")}return t}}!function(e){function t(e){return{name:"default",displayName:(null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab")).__("default"),extensions:[],mimeTypes:[],contentType:"file",fileFormat:"text"}}function i(e){const i=null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab");return{...t(e),name:"text",displayName:i.__("Text"),mimeTypes:["text/plain"],extensions:[".txt"],icon:M.fileIcon}}function s(e){const i=null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab");return{...t(e),name:"notebook",displayName:i.__("Notebook"),mimeTypes:["application/x-ipynb+json"],extensions:[".ipynb"],contentType:"notebook",fileFormat:"json",icon:M.notebookIcon}}function a(e){const i=null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab");return{...t(e),name:"directory",displayName:i.__("Directory"),extensions:[],mimeTypes:["text/directory"],contentType:"directory",icon:M.folderIcon}}e.getFileTypeDefaults=t,e.getDefaultTextFileType=i,e.getDefaultNotebookFileType=s,e.getDefaultDirectoryFileType=a,e.getDefaultFileTypes=function(e){const t=null==(e=e||r.nullTranslator)?void 0:e.load("jupyterlab");return[i(e),s(e),a(e),{name:"markdown",displayName:t.__("Markdown File"),extensions:[".md"],mimeTypes:["text/markdown"],icon:M.markdownIcon},{name:"PDF",displayName:t.__("PDF File"),extensions:[".pdf"],mimeTypes:["application/pdf"],icon:M.pdfIcon},{name:"python",displayName:t.__("Python File"),extensions:[".py"],mimeTypes:["text/x-python"],icon:M.pythonIcon},{name:"json",displayName:t.__("JSON File"),extensions:[".json"],mimeTypes:["application/json"],icon:M.jsonIcon},{name:"jsonl",displayName:t.__("JSONLines File"),extensions:[".jsonl",".ndjson"],mimeTypes:["text/jsonl","application/jsonl","application/json-lines"],icon:M.jsonIcon},{name:"julia",displayName:t.__("Julia File"),extensions:[".jl"],mimeTypes:["text/x-julia"],icon:M.juliaIcon},{name:"csv",displayName:t.__("CSV File"),extensions:[".csv"],mimeTypes:["text/csv"],icon:M.spreadsheetIcon},{name:"tsv",displayName:t.__("TSV File"),extensions:[".tsv"],mimeTypes:["text/csv"],icon:M.spreadsheetIcon},{name:"r",displayName:t.__("R File"),mimeTypes:["text/x-rsrc"],extensions:[".R"],icon:M.rKernelIcon},{name:"yaml",displayName:t.__("YAML File"),mimeTypes:["text/x-yaml","text/yaml"],extensions:[".yaml",".yml"],icon:M.yamlIcon},{name:"svg",displayName:t.__("Image"),mimeTypes:["image/svg+xml"],extensions:[".svg"],icon:M.imageIcon,fileFormat:"base64"},{name:"tiff",displayName:t.__("Image"),mimeTypes:["image/tiff"],extensions:[".tif",".tiff"],icon:M.imageIcon,fileFormat:"base64"},{name:"jpeg",displayName:t.__("Image"),mimeTypes:["image/jpeg"],extensions:[".jpg",".jpeg"],icon:M.imageIcon,fileFormat:"base64"},{name:"gif",displayName:t.__("Image"),mimeTypes:["image/gif"],extensions:[".gif"],icon:M.imageIcon,fileFormat:"base64"},{name:"png",displayName:t.__("Image"),mimeTypes:["image/png"],extensions:[".png"],icon:M.imageIcon,fileFormat:"base64"},{name:"bmp",displayName:t.__("Image"),mimeTypes:["image/bmp"],extensions:[".bmp"],icon:M.imageIcon,fileFormat:"base64"},{name:"webp",displayName:t.__("Image"),mimeTypes:["image/webp"],extensions:[".webp"],icon:M.imageIcon,fileFormat:"base64"}]}}(E||(E={})),function(e){e.extname=function(e){const t=n.PathExt.basename(e).split(".");return t.shift(),("."+t.join(".")).toLowerCase()},e.noOp=function(){}}(S||(S={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2607,2007],{12007:(e,n,s)=>{s.r(n),s.d(n,{EditMenu:()=>d,FileMenu:()=>m,HelpMenu:()=>o,IMainMenu:()=>k,KernelMenu:()=>c,MainMenu:()=>p,RunMenu:()=>l,SettingsMenu:()=>M,TabsMenu:()=>h,ViewMenu:()=>_});var t,r=s(95291),i=s(33625),a=s(63485),u=s(72703);class d extends r.RankedMenu{constructor(e){super(e),this.undoers={redo:new u.SemanticCommand,undo:new u.SemanticCommand},this.clearers={clearAll:new u.SemanticCommand,clearCurrent:new u.SemanticCommand},this.goToLiners=new u.SemanticCommand}}class m extends r.RankedMenu{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new u.SemanticCommand,this.consoleCreators=new u.SemanticCommand}get newMenu(){var e,n;return this._newMenu||(this._newMenu=null!==(n=null===(e=(0,i.find)(this.items,(e=>{var n;return"jp-mainmenu-file-new"===(null===(n=e.submenu)||void 0===n?void 0:n.id)})))||void 0===e?void 0:e.submenu)&&void 0!==n?n:new r.RankedMenu({commands:this.commands})),this._newMenu}dispose(){var e;null===(e=this._newMenu)||void 0===e||e.dispose(),super.dispose()}}class o extends r.RankedMenu{constructor(e){super(e),this.getKernel=new u.SemanticCommand}}class c extends r.RankedMenu{constructor(e){super(e),this.kernelUsers={changeKernel:new u.SemanticCommand,clearWidget:new u.SemanticCommand,interruptKernel:new u.SemanticCommand,reconnectToKernel:new u.SemanticCommand,restartKernel:new u.SemanticCommand,shutdownKernel:new u.SemanticCommand}}}class l extends r.RankedMenu{constructor(e){super(e),this.codeRunners={restart:new u.SemanticCommand,run:new u.SemanticCommand,runAll:new u.SemanticCommand}}}class M extends r.RankedMenu{constructor(e){super(e)}}class h extends r.RankedMenu{constructor(e){super(e)}}class _ extends r.RankedMenu{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new u.SemanticCommand,toggleMatchBrackets:new u.SemanticCommand,toggleWordWrap:new u.SemanticCommand}}}class p extends a.MenuBar{constructor(e){super({forceItemsPosition:{forceX:!1,forceY:!0}}),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new d({commands:this._commands,rank:2,renderer:r.MenuSvg.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new m({commands:this._commands,rank:1,renderer:r.MenuSvg.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new o({commands:this._commands,rank:1e3,renderer:r.MenuSvg.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new c({commands:this._commands,rank:5,renderer:r.MenuSvg.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new l({commands:this._commands,rank:4,renderer:r.MenuSvg.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new M({commands:this._commands,rank:999,renderer:r.MenuSvg.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new _({commands:this._commands,rank:3,renderer:r.MenuSvg.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new h({commands:this._commands,rank:500,renderer:r.MenuSvg.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,s={}){if(i.ArrayExt.firstIndexOf(this.menus,e)>-1)return;r.MenuSvg.overrideDefaultRenderer(e);const a={menu:e,rank:"rank"in s?s.rank:"rank"in e?e.rank:r.IRankedMenu.DEFAULT_RANK},u=i.ArrayExt.upperBound(this._items,a,t.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),i.ArrayExt.insert(this._items,u,a),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof m&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof d&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof _&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof l&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof c&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof h&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof M&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof o&&(this._helpMenu=e)}}dispose(){var e,n,s,t,r,i,a,u;null===(e=this._editMenu)||void 0===e||e.dispose(),null===(n=this._fileMenu)||void 0===n||n.dispose(),null===(s=this._helpMenu)||void 0===s||s.dispose(),null===(t=this._kernelMenu)||void 0===t||t.dispose(),null===(r=this._runMenu)||void 0===r||r.dispose(),null===(i=this._settingsMenu)||void 0===i||i.dispose(),null===(a=this._viewMenu)||void 0===a||a.dispose(),null===(u=this._tabsMenu)||void 0===u||u.dispose(),super.dispose()}static generateMenu(e,n,s){let t;const{id:i,label:a,rank:u}=n;switch(i){case"jp-mainmenu-file":t=new m({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-edit":t=new d({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-view":t=new _({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-run":t=new l({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-kernel":t=new c({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-tabs":t=new h({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-settings":t=new M({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-help":t=new o({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;default:t=new r.RankedMenu({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer})}return a&&(t.title.label=s._p("menu",a)),t}_onMenuDisposed(e){this.removeMenu(e);const n=i.ArrayExt.findFirstIndex(this._items,(n=>n.menu===e));-1!==n&&i.ArrayExt.removeAt(this._items,n)}}!function(e){e.itemCmp=function(e,n){return e.rank-n.rank}}(t||(t={}));const k=new(s(20998).Token)("@jupyterlab/mainmenu:IMainMenu","A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2607,2007],{12007:(e,n,s)=>{s.r(n),s.d(n,{EditMenu:()=>d,FileMenu:()=>m,HelpMenu:()=>o,IMainMenu:()=>k,KernelMenu:()=>c,MainMenu:()=>p,RunMenu:()=>l,SettingsMenu:()=>M,TabsMenu:()=>h,ViewMenu:()=>_});var t,r=s(76878),i=s(14931),a=s(2260),u=s(53876);class d extends r.RankedMenu{constructor(e){super(e),this.undoers={redo:new u.SemanticCommand,undo:new u.SemanticCommand},this.clearers={clearAll:new u.SemanticCommand,clearCurrent:new u.SemanticCommand},this.goToLiners=new u.SemanticCommand}}class m extends r.RankedMenu{constructor(e){super(e),this.quitEntry=!1,this.closeAndCleaners=new u.SemanticCommand,this.consoleCreators=new u.SemanticCommand}get newMenu(){var e,n;return this._newMenu||(this._newMenu=null!==(n=null===(e=(0,i.find)(this.items,(e=>{var n;return"jp-mainmenu-file-new"===(null===(n=e.submenu)||void 0===n?void 0:n.id)})))||void 0===e?void 0:e.submenu)&&void 0!==n?n:new r.RankedMenu({commands:this.commands})),this._newMenu}dispose(){var e;null===(e=this._newMenu)||void 0===e||e.dispose(),super.dispose()}}class o extends r.RankedMenu{constructor(e){super(e),this.getKernel=new u.SemanticCommand}}class c extends r.RankedMenu{constructor(e){super(e),this.kernelUsers={changeKernel:new u.SemanticCommand,clearWidget:new u.SemanticCommand,interruptKernel:new u.SemanticCommand,reconnectToKernel:new u.SemanticCommand,restartKernel:new u.SemanticCommand,shutdownKernel:new u.SemanticCommand}}}class l extends r.RankedMenu{constructor(e){super(e),this.codeRunners={restart:new u.SemanticCommand,run:new u.SemanticCommand,runAll:new u.SemanticCommand}}}class M extends r.RankedMenu{constructor(e){super(e)}}class h extends r.RankedMenu{constructor(e){super(e)}}class _ extends r.RankedMenu{constructor(e){super(e),this.editorViewers={toggleLineNumbers:new u.SemanticCommand,toggleMatchBrackets:new u.SemanticCommand,toggleWordWrap:new u.SemanticCommand}}}class p extends a.MenuBar{constructor(e){super({forceItemsPosition:{forceX:!1,forceY:!0}}),this._items=[],this._commands=e}get editMenu(){return this._editMenu||(this._editMenu=new d({commands:this._commands,rank:2,renderer:r.MenuSvg.defaultRenderer})),this._editMenu}get fileMenu(){return this._fileMenu||(this._fileMenu=new m({commands:this._commands,rank:1,renderer:r.MenuSvg.defaultRenderer})),this._fileMenu}get helpMenu(){return this._helpMenu||(this._helpMenu=new o({commands:this._commands,rank:1e3,renderer:r.MenuSvg.defaultRenderer})),this._helpMenu}get kernelMenu(){return this._kernelMenu||(this._kernelMenu=new c({commands:this._commands,rank:5,renderer:r.MenuSvg.defaultRenderer})),this._kernelMenu}get runMenu(){return this._runMenu||(this._runMenu=new l({commands:this._commands,rank:4,renderer:r.MenuSvg.defaultRenderer})),this._runMenu}get settingsMenu(){return this._settingsMenu||(this._settingsMenu=new M({commands:this._commands,rank:999,renderer:r.MenuSvg.defaultRenderer})),this._settingsMenu}get viewMenu(){return this._viewMenu||(this._viewMenu=new _({commands:this._commands,rank:3,renderer:r.MenuSvg.defaultRenderer})),this._viewMenu}get tabsMenu(){return this._tabsMenu||(this._tabsMenu=new h({commands:this._commands,rank:500,renderer:r.MenuSvg.defaultRenderer})),this._tabsMenu}addMenu(e,n=!0,s={}){if(i.ArrayExt.firstIndexOf(this.menus,e)>-1)return;r.MenuSvg.overrideDefaultRenderer(e);const a={menu:e,rank:"rank"in s?s.rank:"rank"in e?e.rank:r.IRankedMenu.DEFAULT_RANK},u=i.ArrayExt.upperBound(this._items,a,t.itemCmp);switch(e.disposed.connect(this._onMenuDisposed,this),i.ArrayExt.insert(this._items,u,a),this.insertMenu(u,e),e.id){case"jp-mainmenu-file":!this._fileMenu&&e instanceof m&&(this._fileMenu=e);break;case"jp-mainmenu-edit":!this._editMenu&&e instanceof d&&(this._editMenu=e);break;case"jp-mainmenu-view":!this._viewMenu&&e instanceof _&&(this._viewMenu=e);break;case"jp-mainmenu-run":!this._runMenu&&e instanceof l&&(this._runMenu=e);break;case"jp-mainmenu-kernel":!this._kernelMenu&&e instanceof c&&(this._kernelMenu=e);break;case"jp-mainmenu-tabs":!this._tabsMenu&&e instanceof h&&(this._tabsMenu=e);break;case"jp-mainmenu-settings":!this._settingsMenu&&e instanceof M&&(this._settingsMenu=e);break;case"jp-mainmenu-help":!this._helpMenu&&e instanceof o&&(this._helpMenu=e)}}dispose(){var e,n,s,t,r,i,a,u;null===(e=this._editMenu)||void 0===e||e.dispose(),null===(n=this._fileMenu)||void 0===n||n.dispose(),null===(s=this._helpMenu)||void 0===s||s.dispose(),null===(t=this._kernelMenu)||void 0===t||t.dispose(),null===(r=this._runMenu)||void 0===r||r.dispose(),null===(i=this._settingsMenu)||void 0===i||i.dispose(),null===(a=this._viewMenu)||void 0===a||a.dispose(),null===(u=this._tabsMenu)||void 0===u||u.dispose(),super.dispose()}static generateMenu(e,n,s){let t;const{id:i,label:a,rank:u}=n;switch(i){case"jp-mainmenu-file":t=new m({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-edit":t=new d({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-view":t=new _({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-run":t=new l({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-kernel":t=new c({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-tabs":t=new h({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-settings":t=new M({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;case"jp-mainmenu-help":t=new o({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer});break;default:t=new r.RankedMenu({commands:e,rank:u,renderer:r.MenuSvg.defaultRenderer})}return a&&(t.title.label=s._p("menu",a)),t}_onMenuDisposed(e){this.removeMenu(e);const n=i.ArrayExt.findFirstIndex(this._items,(n=>n.menu===e));-1!==n&&i.ArrayExt.removeAt(this._items,n)}}!function(e){e.itemCmp=function(e,n){return e.rank-n.rank}}(t||(t={}));const k=new(s(21961).Token)("@jupyterlab/mainmenu:IMainMenu","A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2615],{92615:(e,t,a)=>{a.r(t),a.d(t,{DETAILS_CLASS:()=>u,IMermaidManager:()=>h,IMermaidMarkdown:()=>M,MERMAID_CLASS:()=>l,MERMAID_CODE_CLASS:()=>c,MERMAID_DARK_THEME:()=>m,MERMAID_DEFAULT_THEME:()=>d,MERMAID_FILE_EXTENSIONS:()=>s,MERMAID_MIME_TYPE:()=>i,MermaidManager:()=>p,MermaidMarkdown:()=>_,RenderedMermaid:()=>w,SUMMARY_CLASS:()=>g,WARNING_CLASS:()=>o,rendererFactory:()=>T});var r=a(20998),n=a(65848);const i="text/vnd.mermaid",s=[".mmd",".mermaid"],d="default",m="dark",l="jp-RenderedMermaid",c="mermaid",o="jp-mod-warning",u="jp-RenderedMermaid-Details",g="jp-RenderedMermaid-Summary",h=new r.Token("@jupyterlab/mermaid:IMermaidManager","a manager for rendering mermaid text-based diagrams"),M=new r.Token("@jupyterlab/mermaid:IMermaidMarkdown","a manager for rendering mermaid text-based diagrams in markdown fenced code blocks");class p{constructor(e={}){this._diagrams=new n.LruCache({maxSize:e.maxCacheSize||null}),e.themes&&(E.initThemes(e.themes||null),e.themes.themeChanged.connect(this.initialize,this))}static cleanMermaidSvg(e){return e.replace(E.RE_VOID_ELEMENT,E.replaceVoidElement)}initialize(){this._diagrams.clear(),E.initMermaid()}async getMermaid(){return await E.ensureMermaid()}getMermaidVersion(){return E.version()}getCachedFigure(e){return this._diagrams.get(e)}async renderSvg(e){const t=await this.getMermaid(),a=`jp-mermaid-${E.nextMermaidId()}`,r=document.createElement("div");document.body.appendChild(r);try{let{svg:n}=await t.render(a,e,r);n=p.cleanMermaidSvg(n);const i=(new DOMParser).parseFromString(n,"image/svg+xml"),s={text:e,svg:n},d=i.querySelector("svg"),{maxWidth:m}=(null==d?void 0:d.style)||{};s.width=m?parseFloat(m):null;const l=i.querySelector("title"),c=i.querySelector("desc");return l&&(s.accessibleTitle=l.textContent),c&&(s.accessibleDescription=c.textContent),s}finally{r.remove()}}async renderFigure(e){let t=this._diagrams.get(e);if(null!=t)return t;let a=l,r=null;t=document.createElement("div"),t.className=a;try{const t=await this.renderSvg(e);r=this.makeMermaidFigure(t)}catch(a){t.classList.add(o),r=await this.makeMermaidError(e)}let n=this.getMermaidVersion();return n&&(r.dataset.jpMermaidVersion=n),t.appendChild(r),this._diagrams.set(e,t),t}makeMermaidCode(e){const t=document.createElement("pre"),a=document.createElement("code");return a.innerText=e,t.appendChild(a),a.className=c,a.textContent=e,t}async makeMermaidError(e){const t=await this.getMermaid();let a="";try{await t.parse(e)}catch(e){a=`${e}`}const r=document.createElement("details");r.className=u;const n=document.createElement("summary");n.className=g,n.appendChild(this.makeMermaidCode(e)),r.appendChild(n);const i=document.createElement("pre");return i.innerText=a,r.appendChild(i),r}makeMermaidFigure(e){const t=document.createElement("figure"),a=document.createElement("img");if(t.appendChild(a),a.setAttribute("src",`data:image/svg+xml,${encodeURIComponent(e.svg)}`),e.width&&(a.width=e.width),e.accessibleTitle&&a.setAttribute("alt",e.accessibleTitle),t.appendChild(this.makeMermaidCode(e.text)),e.accessibleDescription){const a=document.createElement("figcaption");a.className="sr-only",a.textContent=e.accessibleDescription,t.appendChild(a)}return t}}var E;!function(e){let t=null,n=null,i=null,s=0,l=null;function c(){if(!n)return!1;let e=d;if(t){const a=t.theme;e=a&&t.isLight(a)?d:m}const a=window.getComputedStyle(document.body).getPropertyValue("--jp-ui-font-family");return n.mermaidAPI.globalReset(),n.mermaidAPI.initialize({theme:e,fontFamily:a,securityLevel:"strict",maxTextSize:1e5,maxEdges:1e5,startOnLoad:!1}),!0}e.initThemes=function(e){t=e},e.version=function(){return l},e.initMermaid=c,e.getMermaid=function(){return n},e.nextMermaidId=function(){return s++},e.ensureMermaid=async function(){return null!=n?n:i?i.promise:(i=new r.PromiseDelegate,l=(await a.e(1169).then(a.t.bind(a,21169,19))).version,n=(await Promise.all([a.e(4499),a.e(4630)]).then(a.bind(a,84630))).default,c(),i.resolve(n),n)},e.RE_VOID_ELEMENT=/<\s*(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)\s*([^>]*?)\s*>/gi,e.replaceVoidElement=function(e,t,a){return(a=a.trim()).endsWith("/")||(a=`${a} /`),`<${t} ${a}>`}}(E||(E={}));class _{constructor(e){this.languages=["mermaid"],this.rank=100,this._mermaid=e.mermaid}async walk(e){await this._mermaid.renderFigure(e)}render(e){let t=this._mermaid.getCachedFigure(e);return t?t.outerHTML:null}}var y=a(63485);const C="image/svg+xml";class w extends y.Widget{constructor(e){super(),this._lastRendered=null,this._mimeType=e.mimeType,this.addClass(l)}static set manager(e){w._manager?console.warn("Mermaid manager may only be set once, and is already set."):(w._manager=e,w._managerReady.resolve(e))}async renderModel(e){const t=await w._managerReady.promise,a=e.data[this._mimeType];if(null==a||a===this._lastRendered)return;this._lastRendered=a;const r=await t.renderFigure(a);if(r.classList.contains(o)?this.node.classList.add(o):this.node.classList.remove(o),!r.firstChild)return;this.node.innerHTML!==r.innerHTML&&(this.node.innerHTML=r.innerHTML);const n=t.getMermaidVersion(),s={...e.metadata[i]||{},version:n},d={...e.metadata,[i]:s},m=r.querySelector("img");if(m){const t=decodeURIComponent(m.src.split(",")[1]);t!==e.data[C]&&e.setData({data:{...e.data,[C]:t},metadata:d})}else{const t={...e.data};delete t[C],e.setData({data:t,metadata:d})}}}w._manager=null,w._managerReady=new r.PromiseDelegate;const T={safe:!0,mimeTypes:[i],createRenderer:e=>new w(e)}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2615],{92615:(e,t,a)=>{a.r(t),a.d(t,{DETAILS_CLASS:()=>u,IMermaidManager:()=>h,IMermaidMarkdown:()=>M,MERMAID_CLASS:()=>l,MERMAID_CODE_CLASS:()=>c,MERMAID_DARK_THEME:()=>m,MERMAID_DEFAULT_THEME:()=>d,MERMAID_FILE_EXTENSIONS:()=>s,MERMAID_MIME_TYPE:()=>i,MermaidManager:()=>p,MermaidMarkdown:()=>_,RenderedMermaid:()=>w,SUMMARY_CLASS:()=>g,WARNING_CLASS:()=>o,rendererFactory:()=>T});var r=a(21961),n=a(20754);const i="text/vnd.mermaid",s=[".mmd",".mermaid"],d="default",m="dark",l="jp-RenderedMermaid",c="mermaid",o="jp-mod-warning",u="jp-RenderedMermaid-Details",g="jp-RenderedMermaid-Summary",h=new r.Token("@jupyterlab/mermaid:IMermaidManager","a manager for rendering mermaid text-based diagrams"),M=new r.Token("@jupyterlab/mermaid:IMermaidMarkdown","a manager for rendering mermaid text-based diagrams in markdown fenced code blocks");class p{constructor(e={}){this._diagrams=new n.LruCache({maxSize:e.maxCacheSize||null}),e.themes&&(E.initThemes(e.themes||null),e.themes.themeChanged.connect(this.initialize,this))}static cleanMermaidSvg(e){return e.replace(E.RE_VOID_ELEMENT,E.replaceVoidElement)}initialize(){this._diagrams.clear(),E.initMermaid()}async getMermaid(){return await E.ensureMermaid()}getMermaidVersion(){return E.version()}getCachedFigure(e){return this._diagrams.get(e)}async renderSvg(e){const t=await this.getMermaid(),a=`jp-mermaid-${E.nextMermaidId()}`,r=document.createElement("div");document.body.appendChild(r);try{let{svg:n}=await t.render(a,e,r);n=p.cleanMermaidSvg(n);const i=(new DOMParser).parseFromString(n,"image/svg+xml"),s={text:e,svg:n},d=i.querySelector("svg"),{maxWidth:m}=(null==d?void 0:d.style)||{};s.width=m?parseFloat(m):null;const l=i.querySelector("title"),c=i.querySelector("desc");return l&&(s.accessibleTitle=l.textContent),c&&(s.accessibleDescription=c.textContent),s}finally{r.remove()}}async renderFigure(e){let t=this._diagrams.get(e);if(null!=t)return t;let a=l,r=null;t=document.createElement("div"),t.className=a;try{const t=await this.renderSvg(e);r=this.makeMermaidFigure(t)}catch(a){t.classList.add(o),r=await this.makeMermaidError(e)}let n=this.getMermaidVersion();return n&&(r.dataset.jpMermaidVersion=n),t.appendChild(r),this._diagrams.set(e,t),t}makeMermaidCode(e){const t=document.createElement("pre"),a=document.createElement("code");return a.innerText=e,t.appendChild(a),a.className=c,a.textContent=e,t}async makeMermaidError(e){const t=await this.getMermaid();let a="";try{await t.parse(e)}catch(e){a=`${e}`}const r=document.createElement("details");r.className=u;const n=document.createElement("summary");n.className=g,n.appendChild(this.makeMermaidCode(e)),r.appendChild(n);const i=document.createElement("pre");return i.innerText=a,r.appendChild(i),r}makeMermaidFigure(e){const t=document.createElement("figure"),a=document.createElement("img");if(t.appendChild(a),a.setAttribute("src",`data:image/svg+xml,${encodeURIComponent(e.svg)}`),e.width&&(a.width=e.width),e.accessibleTitle&&a.setAttribute("alt",e.accessibleTitle),t.appendChild(this.makeMermaidCode(e.text)),e.accessibleDescription){const a=document.createElement("figcaption");a.className="sr-only",a.textContent=e.accessibleDescription,t.appendChild(a)}return t}}var E;!function(e){let t=null,n=null,i=null,s=0,l=null;function c(){if(!n)return!1;let e=d;if(t){const a=t.theme;e=a&&t.isLight(a)?d:m}const a=window.getComputedStyle(document.body).getPropertyValue("--jp-ui-font-family");return n.mermaidAPI.globalReset(),n.mermaidAPI.initialize({theme:e,fontFamily:a,securityLevel:"strict",maxTextSize:1e5,maxEdges:1e5,startOnLoad:!1}),!0}e.initThemes=function(e){t=e},e.version=function(){return l},e.initMermaid=c,e.getMermaid=function(){return n},e.nextMermaidId=function(){return s++},e.ensureMermaid=async function(){return null!=n?n:i?i.promise:(i=new r.PromiseDelegate,l=(await a.e(1169).then(a.t.bind(a,21169,19))).version,n=(await Promise.all([a.e(4499),a.e(4630)]).then(a.bind(a,84630))).default,c(),i.resolve(n),n)},e.RE_VOID_ELEMENT=/<\s*(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)\s*([^>]*?)\s*>/gi,e.replaceVoidElement=function(e,t,a){return(a=a.trim()).endsWith("/")||(a=`${a} /`),`<${t} ${a}>`}}(E||(E={}));class _{constructor(e){this.languages=["mermaid"],this.rank=100,this._mermaid=e.mermaid}async walk(e){await this._mermaid.renderFigure(e)}render(e){let t=this._mermaid.getCachedFigure(e);return t?t.outerHTML:null}}var y=a(2260);const C="image/svg+xml";class w extends y.Widget{constructor(e){super(),this._lastRendered=null,this._mimeType=e.mimeType,this.addClass(l)}static set manager(e){w._manager?console.warn("Mermaid manager may only be set once, and is already set."):(w._manager=e,w._managerReady.resolve(e))}async renderModel(e){const t=await w._managerReady.promise,a=e.data[this._mimeType];if(null==a||a===this._lastRendered)return;this._lastRendered=a;const r=await t.renderFigure(a);if(r.classList.contains(o)?this.node.classList.add(o):this.node.classList.remove(o),!r.firstChild)return;this.node.innerHTML!==r.innerHTML&&(this.node.innerHTML=r.innerHTML);const n=t.getMermaidVersion(),s={...e.metadata[i]||{},version:n},d={...e.metadata,[i]:s},m=r.querySelector("img");if(m){const t=decodeURIComponent(m.src.split(",")[1]);t!==e.data[C]&&e.setData({data:{...e.data,[C]:t},metadata:d})}else{const t={...e.data};delete t[C],e.setData({data:t,metadata:d})}}}w._manager=null,w._managerReady=new r.PromiseDelegate;const T={safe:!0,mimeTypes:[i],createRenderer:e=>new w(e)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2636],{72636:(e,t,s)=>{s.r(t),s.d(t,{CodeConsole:()=>x,ConsoleHistory:()=>a,ConsolePanel:()=>b,ForeignHandler:()=>r,IConsoleCellExecutor:()=>S,IConsoleTracker:()=>k,runCell:()=>n});var o=s(19816);async function n({cell:e,onCellExecuted:t,sessionContext:s}){return o.CodeCell.execute(e,s).then((s=>{if(s&&"ok"===s.content.status){const o=s.content;if(o.payload&&o.payload.length){const t=o.payload.filter((e=>"set_next_input"===e.source))[0];if(t){const s=t.text;e.model.sharedModel.setSource(s)}}return t({cell:e,executionDate:new Date,success:!0}),!0}if(s&&"error"===s.content.status){const o=s.content.ename,n=s.content.evalue;return t({cell:e,executionDate:new Date,success:!1,error:new Error(`KernelReplyNotOK: ${o} ${n}`)}),!1}return t({cell:e,executionDate:new Date,success:!1}),!1}),(s=>(t({cell:e,executionDate:new Date,success:!1,error:new Error(s)}),!1)))}var i,l=s(81997);class r{constructor(e){this._enabled=!1,this._isDisposed=!1,this.sessionContext=e.sessionContext,this.sessionContext.iopubMessage.connect(this.onIOPubMessage,this),this._parent=e.parent}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get parent(){return this._parent}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,l.Signal.clearData(this))}onIOPubMessage(e,t){var s;if(!this._enabled)return!1;const o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel;if(!o)return!1;const n=this._parent;if(t.parent_header.session===o.clientId)return!1;const i=t.header.msg_type,l=t.parent_header.msg_id;let r;switch(i){case"execute_input":{const e=t;r=this._newCell(l);const s=r.model;return s.executionCount=e.content.execution_count,s.sharedModel.setSource(e.content.code),s.trusted=!0,n.update(),!0}case"execute_result":case"display_data":case"stream":case"error":{if(r=this._parent.getCell(l),!r)return!1;const e={...t.content,output_type:i};return r.model.outputs.add(e),n.update(),!0}case"clear_output":{const e=t.content.wait;return r=this._parent.getCell(l),r&&r.model.outputs.clear(e),!0}default:return!1}}_newCell(e){const t=this.parent.createCodeCell();return t.addClass("jp-CodeConsole-foreignCell"),this._parent.addCell(t,e),t}}class a{constructor(e){this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[];const{sessionContext:t}=e;t&&(this.sessionContext=t,this._handleKernel(),this.sessionContext.kernelChanged.connect(this._handleKernel,this))}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&(t.edgeRequested.disconnect(this.onEdgeRequest,this),t.model.sharedModel.changed.disconnect(this.onTextChange,this)),this._editor=e,e&&(e.edgeRequested.connect(this.onEdgeRequest,this),e.model.sharedModel.changed.connect(this.onTextChange,this))}get placeholder(){return this._placeholder}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,l.Signal.clearData(this)}back(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length-1),--this._cursor,this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}forward(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}push(e){e&&e!==this._history[this._history.length-1]&&this._history.push(e),this.reset()}reset(){this._cursor=this._history.length,this._hasSession=!1,this._placeholder=""}onHistory(e){this._history.length=0;let t="",s="";if("ok"===e.content.status)for(let o=0;o<e.content.history.length;o++)s=e.content.history[o][2],s!==t&&this._history.push(t=s);this._cursor=this._history.length}onTextChange(){this._setByHistory?this._setByHistory=!1:this.reset()}onEdgeRequest(e,t){const s=e.model.sharedModel,o=s.getSource();"top"===t||"topLine"===t?this.back(o).then((t=>{if(this.isDisposed||!t)return;if(s.getSource()===t)return;this._setByHistory=!0,s.setSource(t);let o=0;o=t.indexOf("\n"),o<0&&(o=t.length),e.setCursorPosition({line:0,column:o})})):this.forward(o).then((t=>{if(this.isDisposed)return;const o=t||this.placeholder;if(s.getSource()===o)return;this._setByHistory=!0,s.setSource(o);const n=e.getPositionAt(o.length);n&&e.setCursorPosition(n)}))}async _handleKernel(){var e,t;const s=null===(t=null===(e=this.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel;if(s)return s.requestHistory(i.initialRequest).then((e=>{this.onHistory(e)}));this._history.length=0}setFilter(e=""){this._filtered.length=0;let t="",s="";for(let o=0;o<this._history.length;o++)s=this._history[o],s!==t&&e===s.slice(0,e.length)&&this._filtered.push(t=s);this._filtered.push(e)}}!function(e){e.initialRequest={output:!1,raw:!0,hist_access_type:"tail",n:500}}(i||(i={}));var c=s(72703),h=s(65848),d=s(62514),u=s(70858),p=s(95291),_=s(20998),C=s(63485),m=s(57508),g=s(83978),y=s(99615);const f="jp-Console-cell",v="jp-CodeConsole-promptCell";class x extends C.Widget{constructor(e){var t,s,o;super(),this.editorConfig=x.defaultEditorConfig,this._banner=null,this._executed=new l.Signal(this),this._mimetype="text/x-ipython",this._msgIds=new Map,this._msgIdCells=new Map,this._promptCellCreated=new l.Signal(this),this._dragData=null,this._drag=null,this._focusedCell=null,this._translator=null!==(t=e.translator)&&void 0!==t?t:u.nullTranslator,this._executor=null!==(s=e.executor)&&void 0!==s?s:Object.freeze({runCell:n}),this.addClass("jp-CodeConsole"),this.node.dataset.jpKernelUser="true",this.node.dataset.jpCodeRunner="true",this.node.dataset.jpUndoer="true",this.node.tabIndex=-1;const i=this.layout=new C.PanelLayout;this._cells=new g.ObservableList,this._content=new C.Panel,this._input=new C.Panel,this.contentFactory=e.contentFactory,this.modelFactory=null!==(o=e.modelFactory)&&void 0!==o?o:x.defaultModelFactory,this.rendermime=e.rendermime,this.sessionContext=e.sessionContext,this._mimeTypeService=e.mimeTypeService,this._content.addClass("jp-CodeConsole-content"),this._input.addClass("jp-CodeConsole-input"),i.addWidget(this._content),i.addWidget(this._input),this._history=new a({sessionContext:this.sessionContext}),this._onKernelChanged(),this.sessionContext.kernelChanged.connect(this._onKernelChanged,this),this.sessionContext.statusChanged.connect(this._onKernelStatusChanged,this)}get executed(){return this._executed}get promptCellCreated(){return this._promptCellCreated}get cells(){return this._cells}get promptCell(){return this._input.layout.widgets[0]||null}addCell(e,t){e.addClass(f),this._content.addWidget(e),this._cells.push(e),t&&(this._msgIds.set(t,e),this._msgIdCells.set(e,t)),e.disposed.connect(this._onCellDisposed,this),this.update()}addBanner(){if(this._banner){const e=this._banner;this._cells.push(this._banner),e.disposed.connect(this._onCellDisposed,this)}const e=this.modelFactory.createRawCell({sharedModel:(0,m.createStandaloneCell)({cell_type:"raw",source:"..."})}),t=(this._banner=new o.RawCell({model:e,contentFactory:this.contentFactory,placeholder:!1,editorConfig:{autoClosingBrackets:!1,codeFolding:!1,highlightActiveLine:!1,highlightTrailingWhitespace:!1,highlightWhitespace:!1,indentUnit:"4",lineNumbers:!1,lineWrap:!0,matchBrackets:!1,readOnly:!0,rulers:[],scrollPastEnd:!1,smartIndent:!1,tabSize:4,theme:"jupyter"}})).initializeState();t.addClass("jp-CodeConsole-banner"),t.readOnly=!0,this._content.addWidget(t)}clear(){const e=this._cells;for(;e.length>0;)e.get(0).dispose()}createCodeCell(){const e=this.contentFactory,t=this._createCodeCellOptions(),s=e.createCodeCell(t);return s.readOnly=!0,s.model.mimeType=this._mimetype,s}dispose(){this.isDisposed||(this._msgIdCells=null,this._msgIds=null,this._history.dispose(),super.dispose())}async execute(e=!1,t=250){var s,o;if("dead"===(null===(o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel)||void 0===o?void 0:o.status))return;const n=this.promptCell;if(!n)throw new Error("Cannot execute without a prompt cell");if(n.model.trusted=!0,e)return this.newPromptCell(),void await this._execute(n);const i=await this._shouldExecute(t);this.isDisposed||(i?(this.newPromptCell(),this.promptCell.editor.focus(),await this._execute(n)):n.editor.newIndentedLine())}getCell(e){return this._msgIds.get(e)}inject(e,t={}){const s=this.createCodeCell();s.model.sharedModel.setSource(e);for(const e of Object.keys(t))s.model.setMetadata(e,t[e]);return this.addCell(s),this._execute(s)}insertLinebreak(){const e=this.promptCell;e&&e.editor.newIndentedLine()}replaceSelection(e){var t,s;const o=this.promptCell;o&&(null===(s=(t=o.editor).replaceSelection)||void 0===s||s.call(t,e))}serialize(){const e=[];for(const t of this._cells){const s=t.model;(0,o.isCodeCellModel)(s)&&e.push(s.toJSON())}return this.promptCell&&e.push(this.promptCell.model.toJSON()),e}_evtMouseDown(e){const{button:t,shiftKey:s}=e;if(0!==t&&2!==t||s&&2===t)return;let n=e.target;const i=e=>e.classList.contains(f);let l=o.CellDragUtils.findCell(n,this._cells,i);if(-1===l&&(n=document.elementFromPoint(e.clientX,e.clientY),l=o.CellDragUtils.findCell(n,this._cells,i)),-1===l)return;const r=this._cells.get(l);"prompt"===o.CellDragUtils.detectTargetArea(r,e.target)&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:l},this._focusedCell=r,document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),e.preventDefault())}_evtMouseMove(e){const t=this._dragData;t&&o.CellDragUtils.shouldStartDrag(t.pressX,t.pressY,e.clientX,e.clientY)&&this._startDrag(t.index,e.clientX,e.clientY)}_startDrag(e,t,s){const n=this._focusedCell.model,i=[n.toJSON()],l=o.CellDragUtils.createCellDragImage(this._focusedCell,i);this._drag=new y.Drag({mimeData:new _.MimeData,dragImage:l,proposedAction:"copy",supportedActions:"copy",source:this}),this._drag.mimeData.setData("application/vnd.jupyter.cells",i);const r=n.sharedModel.getSource();return this._drag.mimeData.setData("text/plain",r),this._focusedCell=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._drag.start(t,s).then((()=>{this.isDisposed||(this._drag=null,this._dragData=null)}))}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"focusin":this._evtFocusIn(e);break;case"focusout":this._evtFocusOut(e)}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,!0),t.addEventListener("click",this),t.addEventListener("mousedown",this),t.addEventListener("focusin",this),t.addEventListener("focusout",this),this.promptCell?(this.promptCell.editor.focus(),this.update()):this.newPromptCell()}onBeforeDetach(e){const t=this.node;t.removeEventListener("keydown",this,!0),t.removeEventListener("click",this),t.removeEventListener("focusin",this),t.removeEventListener("focusout",this)}onActivateRequest(e){const t=this.promptCell&&this.promptCell.editor;t&&t.focus(),this.update()}newPromptCell(){var e;let t=this.promptCell;const s=this._input;if(t){t.readOnly=!0,t.removeClass(v);const o=t;requestIdleCallback((()=>{l.Signal.clearData(o.editor)})),null===(e=t.editor)||void 0===e||e.blur(),s.widgets[0].parent=null,this.addCell(t)}const o=this.contentFactory,n=this._createCodeCellOptions();t=o.createCodeCell(n),t.model.mimeType=this._mimetype,t.addClass(v),this._input.addWidget(t),this._history.editor=t.editor,this._promptCellCreated.emit(t)}onUpdateRequest(e){w.scrollToBottom(this._content.node)}_evtKeyDown(e){const t=this.promptCell&&this.promptCell.editor;t&&(13!==e.keyCode||t.hasFocus()?27===e.keyCode&&t.hasFocus()&&(e.preventDefault(),e.stopPropagation(),this.node.focus()):(e.preventDefault(),t.focus()))}_evtMouseUp(e){this.promptCell&&this.promptCell.node.contains(e.target)&&this.promptCell.editor.focus()}_evtFocusIn(e){this._updateReadWrite()}_evtFocusOut(e){this._updateReadWrite()}async _execute(e){const t=e.model.sharedModel.getSource();if(this._history.push(t),"clear"===t||"%clear"===t)return this.clear(),Promise.resolve(void 0);e.model.contentChanged.connect(this.update,this);const s={cell:e,sessionContext:this.sessionContext,onCellExecuted:e=>{if(this._executed.emit(e.executionDate),e.error)for(const e of this._cells)null===e.model.executionCount&&e.setPrompt("")}};try{await this._executor.runCell(s)}finally{this.isDisposed||(e.model.contentChanged.disconnect(this.update,this),this.update())}}_handleInfo(e){if("ok"!==e.status)return void this._banner.model.sharedModel.setSource("Error in getting kernel banner");this._banner.model.sharedModel.setSource(e.banner);const t=e.language_info;this._mimetype=this._mimeTypeService.getMimeTypeByLanguage(t),this.promptCell&&(this.promptCell.model.mimeType=this._mimetype)}_createCodeCellOptions(){const e=this.contentFactory;return{model:this.modelFactory.createCodeCell({}),rendermime:this.rendermime,contentFactory:e,editorConfig:this.editorConfig,placeholder:!1,translator:this._translator}}_onCellDisposed(e,t){if(!this.isDisposed){this._cells.removeValue(e);const t=this._msgIdCells.get(e);t&&(this._msgIdCells.delete(e),this._msgIds.delete(t))}}_shouldExecute(e){const t=this.promptCell;if(!t)return Promise.resolve(!1);const s=t.model.sharedModel.getSource();return new Promise(((t,o)=>{var n;const i=setTimeout((()=>{t(!0)}),e),l=null===(n=this.sessionContext.session)||void 0===n?void 0:n.kernel;l?l.requestIsComplete({code:s}).then((e=>{clearTimeout(i),this.isDisposed&&t(!1),"incomplete"===e.content.status?t(!1):t(!0)})).catch((()=>{t(!0)})):t(!1)}))}async _onKernelChanged(){var e;this.clear(),this._banner&&(this._banner.dispose(),this._banner=null),this.addBanner(),(null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel)&&this._handleInfo(await this.sessionContext.session.kernel.info)}async _onKernelStatusChanged(){var e;const t=null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel;"restarting"===(null==t?void 0:t.status)&&(this.addBanner(),this._handleInfo(await(null==t?void 0:t.info)))}_updateReadWrite(){const e=c.DOMUtils.hasActiveEditableElement(this.node);this.node.classList.toggle("jp-mod-readWrite",e)}}var w,D;!function(e){e.defaultEditorConfig={codeFolding:!1,lineNumbers:!1};class t extends o.Cell.ContentFactory{createCodeCell(e){return new o.CodeCell(e).initializeState()}createRawCell(e){return new o.RawCell(e).initializeState()}}e.ContentFactory=t;class s{constructor(e={}){this.codeCellContentFactory=e.codeCellContentFactory||o.CodeCellModel.defaultContentFactory}createCodeCell(e={}){return e.contentFactory||(e.contentFactory=this.codeCellContentFactory),new o.CodeCellModel(e)}createRawCell(e){return new o.RawCellModel(e)}}e.ModelFactory=s,e.defaultModelFactory=new s({})}(x||(x={})),function(e){e.scrollToBottom=function(e){e.scrollTop=e.scrollHeight-e.clientHeight}}(w||(w={}));class b extends c.MainAreaWidget{constructor(e){super({content:new C.Panel}),this._executed=null,this._connected=null,this.addClass("jp-ConsolePanel");let{executor:t,rendermime:s,mimeTypeService:o,path:n,basePath:i,name:l,manager:r,modelFactory:a,sessionContext:m,translator:g}=e;this.translator=null!=g?g:u.nullTranslator;const y=this.translator.load("jupyterlab"),f=this.contentFactory=e.contentFactory,v=D.count++;n||(n=h.PathExt.join(i||"",`console-${v}-${_.UUID.uuid4()}`)),m=this._sessionContext=null!=m?m:new c.SessionContext({sessionManager:r.sessions,specsManager:r.kernelspecs,path:r.contents.localPath(n),name:l||y.__("Console %1",v),type:"console",kernelPreference:e.kernelPreference,setBusy:e.setBusy});const x=new d.RenderMimeRegistry.UrlResolver({path:n,contents:r.contents});s=s.clone({resolver:x}),this.console=f.createConsole({executor:t,rendermime:s,sessionContext:m,mimeTypeService:o,contentFactory:f,modelFactory:a,translator:g}),this.content.addWidget(this.console),m.initialize().then((async t=>{var s;t&&await(null!==(s=e.sessionDialogs)&&void 0!==s?s:new c.SessionContextDialogs({translator:g})).selectKernel(m),this._connected=new Date,this._updateTitlePanel()})),this.console.executed.connect(this._onExecuted,this),this._updateTitlePanel(),m.kernelChanged.connect(this._updateTitlePanel,this),m.propertyChanged.connect(this._updateTitlePanel,this),this.title.icon=p.consoleIcon,this.title.closable=!0,this.id=`console-${v}`}get sessionContext(){return this._sessionContext}dispose(){this.sessionContext.dispose(),this.console.dispose(),super.dispose()}onActivateRequest(e){const t=this.console.promptCell;t&&t.editor.focus()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}_onExecuted(e,t){this._executed=t,this._updateTitlePanel()}_updateTitlePanel(){D.updateTitle(this,this._connected,this._executed,this.translator)}}!function(e){class t extends x.ContentFactory{createConsole(e){return new x(e)}}e.ContentFactory=t,e.IContentFactory=new _.Token("@jupyterlab/console:IContentFactory","A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.")}(b||(b={})),function(e){e.count=1,e.updateTitle=function(e,t,s,o){const n=(o=o||u.nullTranslator).load("jupyterlab"),i=e.console.sessionContext.session;if(i){let o=n.__("Name: %1\n",i.name)+n.__("Directory: %1\n",h.PathExt.dirname(i.path))+n.__("Kernel: %1",e.console.sessionContext.kernelDisplayName);t&&(o+=n.__("\nConnected: %1",h.Time.format(t.toISOString()))),s&&(o+=n.__("\nLast Execution: %1")),e.title.label=i.name,e.title.caption=o}else e.title.label=n.__("Console"),e.title.caption=""}}(D||(D={}));const k=new _.Token("@jupyterlab/console:IConsoleTracker","A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application."),S=new _.Token("@jupyterlab/console:IConsoleCellExecutor","The console cell executor")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2636],{72636:(e,t,s)=>{s.r(t),s.d(t,{CodeConsole:()=>x,ConsoleHistory:()=>a,ConsolePanel:()=>b,ForeignHandler:()=>r,IConsoleCellExecutor:()=>S,IConsoleTracker:()=>k,runCell:()=>n});var o=s(6532);async function n({cell:e,onCellExecuted:t,sessionContext:s}){return o.CodeCell.execute(e,s).then((s=>{if(s&&"ok"===s.content.status){const o=s.content;if(o.payload&&o.payload.length){const t=o.payload.filter((e=>"set_next_input"===e.source))[0];if(t){const s=t.text;e.model.sharedModel.setSource(s)}}return t({cell:e,executionDate:new Date,success:!0}),!0}if(s&&"error"===s.content.status){const o=s.content.ename,n=s.content.evalue;return t({cell:e,executionDate:new Date,success:!1,error:new Error(`KernelReplyNotOK: ${o} ${n}`)}),!1}return t({cell:e,executionDate:new Date,success:!1}),!1}),(s=>(t({cell:e,executionDate:new Date,success:!1,error:new Error(s)}),!1)))}var i,l=s(2159);class r{constructor(e){this._enabled=!1,this._isDisposed=!1,this.sessionContext=e.sessionContext,this.sessionContext.iopubMessage.connect(this.onIOPubMessage,this),this._parent=e.parent}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get parent(){return this._parent}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,l.Signal.clearData(this))}onIOPubMessage(e,t){var s;if(!this._enabled)return!1;const o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel;if(!o)return!1;const n=this._parent;if(t.parent_header.session===o.clientId)return!1;const i=t.header.msg_type,l=t.parent_header.msg_id;let r;switch(i){case"execute_input":{const e=t;r=this._newCell(l);const s=r.model;return s.executionCount=e.content.execution_count,s.sharedModel.setSource(e.content.code),s.trusted=!0,n.update(),!0}case"execute_result":case"display_data":case"stream":case"error":{if(r=this._parent.getCell(l),!r)return!1;const e={...t.content,output_type:i};return r.model.outputs.add(e),n.update(),!0}case"clear_output":{const e=t.content.wait;return r=this._parent.getCell(l),r&&r.model.outputs.clear(e),!0}default:return!1}}_newCell(e){const t=this.parent.createCodeCell();return t.addClass("jp-CodeConsole-foreignCell"),this._parent.addCell(t,e),t}}class a{constructor(e){this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[];const{sessionContext:t}=e;t&&(this.sessionContext=t,this._handleKernel(),this.sessionContext.kernelChanged.connect(this._handleKernel,this))}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&(t.edgeRequested.disconnect(this.onEdgeRequest,this),t.model.sharedModel.changed.disconnect(this.onTextChange,this)),this._editor=e,e&&(e.edgeRequested.connect(this.onEdgeRequest,this),e.model.sharedModel.changed.connect(this.onTextChange,this))}get placeholder(){return this._placeholder}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,l.Signal.clearData(this)}back(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length-1),--this._cursor,this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}forward(e){this._hasSession||(this._hasSession=!0,this._placeholder=e,this.setFilter(e),this._cursor=this._filtered.length),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}push(e){e&&e!==this._history[this._history.length-1]&&this._history.push(e),this.reset()}reset(){this._cursor=this._history.length,this._hasSession=!1,this._placeholder=""}onHistory(e){this._history.length=0;let t="",s="";if("ok"===e.content.status)for(let o=0;o<e.content.history.length;o++)s=e.content.history[o][2],s!==t&&this._history.push(t=s);this._cursor=this._history.length}onTextChange(){this._setByHistory?this._setByHistory=!1:this.reset()}onEdgeRequest(e,t){const s=e.model.sharedModel,o=s.getSource();"top"===t||"topLine"===t?this.back(o).then((t=>{if(this.isDisposed||!t)return;if(s.getSource()===t)return;this._setByHistory=!0,s.setSource(t);let o=0;o=t.indexOf("\n"),o<0&&(o=t.length),e.setCursorPosition({line:0,column:o})})):this.forward(o).then((t=>{if(this.isDisposed)return;const o=t||this.placeholder;if(s.getSource()===o)return;this._setByHistory=!0,s.setSource(o);const n=e.getPositionAt(o.length);n&&e.setCursorPosition(n)}))}async _handleKernel(){var e,t;const s=null===(t=null===(e=this.sessionContext)||void 0===e?void 0:e.session)||void 0===t?void 0:t.kernel;if(s)return s.requestHistory(i.initialRequest).then((e=>{this.onHistory(e)}));this._history.length=0}setFilter(e=""){this._filtered.length=0;let t="",s="";for(let o=0;o<this._history.length;o++)s=this._history[o],s!==t&&e===s.slice(0,e.length)&&this._filtered.push(t=s);this._filtered.push(e)}}!function(e){e.initialRequest={output:!1,raw:!0,hist_access_type:"tail",n:500}}(i||(i={}));var c=s(53876),h=s(20754),d=s(58194),u=s(93050),p=s(76878),_=s(21961),C=s(2260),m=s(42763),g=s(71370),y=s(23246);const f="jp-Console-cell",v="jp-CodeConsole-promptCell";class x extends C.Widget{constructor(e){var t,s,o;super(),this.editorConfig=x.defaultEditorConfig,this._banner=null,this._executed=new l.Signal(this),this._mimetype="text/x-ipython",this._msgIds=new Map,this._msgIdCells=new Map,this._promptCellCreated=new l.Signal(this),this._dragData=null,this._drag=null,this._focusedCell=null,this._translator=null!==(t=e.translator)&&void 0!==t?t:u.nullTranslator,this._executor=null!==(s=e.executor)&&void 0!==s?s:Object.freeze({runCell:n}),this.addClass("jp-CodeConsole"),this.node.dataset.jpKernelUser="true",this.node.dataset.jpCodeRunner="true",this.node.dataset.jpUndoer="true",this.node.tabIndex=-1;const i=this.layout=new C.PanelLayout;this._cells=new g.ObservableList,this._content=new C.Panel,this._input=new C.Panel,this.contentFactory=e.contentFactory,this.modelFactory=null!==(o=e.modelFactory)&&void 0!==o?o:x.defaultModelFactory,this.rendermime=e.rendermime,this.sessionContext=e.sessionContext,this._mimeTypeService=e.mimeTypeService,this._content.addClass("jp-CodeConsole-content"),this._input.addClass("jp-CodeConsole-input"),i.addWidget(this._content),i.addWidget(this._input),this._history=new a({sessionContext:this.sessionContext}),this._onKernelChanged(),this.sessionContext.kernelChanged.connect(this._onKernelChanged,this),this.sessionContext.statusChanged.connect(this._onKernelStatusChanged,this)}get executed(){return this._executed}get promptCellCreated(){return this._promptCellCreated}get cells(){return this._cells}get promptCell(){return this._input.layout.widgets[0]||null}addCell(e,t){e.addClass(f),this._content.addWidget(e),this._cells.push(e),t&&(this._msgIds.set(t,e),this._msgIdCells.set(e,t)),e.disposed.connect(this._onCellDisposed,this),this.update()}addBanner(){if(this._banner){const e=this._banner;this._cells.push(this._banner),e.disposed.connect(this._onCellDisposed,this)}const e=this.modelFactory.createRawCell({sharedModel:(0,m.createStandaloneCell)({cell_type:"raw",source:"..."})}),t=(this._banner=new o.RawCell({model:e,contentFactory:this.contentFactory,placeholder:!1,editorConfig:{autoClosingBrackets:!1,codeFolding:!1,highlightActiveLine:!1,highlightTrailingWhitespace:!1,highlightWhitespace:!1,indentUnit:"4",lineNumbers:!1,lineWrap:!0,matchBrackets:!1,readOnly:!0,rulers:[],scrollPastEnd:!1,smartIndent:!1,tabSize:4,theme:"jupyter"}})).initializeState();t.addClass("jp-CodeConsole-banner"),t.readOnly=!0,this._content.addWidget(t)}clear(){const e=this._cells;for(;e.length>0;)e.get(0).dispose()}createCodeCell(){const e=this.contentFactory,t=this._createCodeCellOptions(),s=e.createCodeCell(t);return s.readOnly=!0,s.model.mimeType=this._mimetype,s}dispose(){this.isDisposed||(this._msgIdCells=null,this._msgIds=null,this._history.dispose(),super.dispose())}async execute(e=!1,t=250){var s,o;if("dead"===(null===(o=null===(s=this.sessionContext.session)||void 0===s?void 0:s.kernel)||void 0===o?void 0:o.status))return;const n=this.promptCell;if(!n)throw new Error("Cannot execute without a prompt cell");if(n.model.trusted=!0,e)return this.newPromptCell(),void await this._execute(n);const i=await this._shouldExecute(t);this.isDisposed||(i?(this.newPromptCell(),this.promptCell.editor.focus(),await this._execute(n)):n.editor.newIndentedLine())}getCell(e){return this._msgIds.get(e)}inject(e,t={}){const s=this.createCodeCell();s.model.sharedModel.setSource(e);for(const e of Object.keys(t))s.model.setMetadata(e,t[e]);return this.addCell(s),this._execute(s)}insertLinebreak(){const e=this.promptCell;e&&e.editor.newIndentedLine()}replaceSelection(e){var t,s;const o=this.promptCell;o&&(null===(s=(t=o.editor).replaceSelection)||void 0===s||s.call(t,e))}serialize(){const e=[];for(const t of this._cells){const s=t.model;(0,o.isCodeCellModel)(s)&&e.push(s.toJSON())}return this.promptCell&&e.push(this.promptCell.model.toJSON()),e}_evtMouseDown(e){const{button:t,shiftKey:s}=e;if(0!==t&&2!==t||s&&2===t)return;let n=e.target;const i=e=>e.classList.contains(f);let l=o.CellDragUtils.findCell(n,this._cells,i);if(-1===l&&(n=document.elementFromPoint(e.clientX,e.clientY),l=o.CellDragUtils.findCell(n,this._cells,i)),-1===l)return;const r=this._cells.get(l);"prompt"===o.CellDragUtils.detectTargetArea(r,e.target)&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:l},this._focusedCell=r,document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),e.preventDefault())}_evtMouseMove(e){const t=this._dragData;t&&o.CellDragUtils.shouldStartDrag(t.pressX,t.pressY,e.clientX,e.clientY)&&this._startDrag(t.index,e.clientX,e.clientY)}_startDrag(e,t,s){const n=this._focusedCell.model,i=[n.toJSON()],l=o.CellDragUtils.createCellDragImage(this._focusedCell,i);this._drag=new y.Drag({mimeData:new _.MimeData,dragImage:l,proposedAction:"copy",supportedActions:"copy",source:this}),this._drag.mimeData.setData("application/vnd.jupyter.cells",i);const r=n.sharedModel.getSource();return this._drag.mimeData.setData("text/plain",r),this._focusedCell=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),this._drag.start(t,s).then((()=>{this.isDisposed||(this._drag=null,this._dragData=null)}))}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"focusin":this._evtFocusIn(e);break;case"focusout":this._evtFocusOut(e)}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,!0),t.addEventListener("click",this),t.addEventListener("mousedown",this),t.addEventListener("focusin",this),t.addEventListener("focusout",this),this.promptCell?(this.promptCell.editor.focus(),this.update()):this.newPromptCell()}onBeforeDetach(e){const t=this.node;t.removeEventListener("keydown",this,!0),t.removeEventListener("click",this),t.removeEventListener("focusin",this),t.removeEventListener("focusout",this)}onActivateRequest(e){const t=this.promptCell&&this.promptCell.editor;t&&t.focus(),this.update()}newPromptCell(){var e;let t=this.promptCell;const s=this._input;if(t){t.readOnly=!0,t.removeClass(v);const o=t;requestIdleCallback((()=>{l.Signal.clearData(o.editor)})),null===(e=t.editor)||void 0===e||e.blur(),s.widgets[0].parent=null,this.addCell(t)}const o=this.contentFactory,n=this._createCodeCellOptions();t=o.createCodeCell(n),t.model.mimeType=this._mimetype,t.addClass(v),this._input.addWidget(t),this._history.editor=t.editor,this._promptCellCreated.emit(t)}onUpdateRequest(e){w.scrollToBottom(this._content.node)}_evtKeyDown(e){const t=this.promptCell&&this.promptCell.editor;t&&(13!==e.keyCode||t.hasFocus()?27===e.keyCode&&t.hasFocus()&&(e.preventDefault(),e.stopPropagation(),this.node.focus()):(e.preventDefault(),t.focus()))}_evtMouseUp(e){this.promptCell&&this.promptCell.node.contains(e.target)&&this.promptCell.editor.focus()}_evtFocusIn(e){this._updateReadWrite()}_evtFocusOut(e){this._updateReadWrite()}async _execute(e){const t=e.model.sharedModel.getSource();if(this._history.push(t),"clear"===t||"%clear"===t)return this.clear(),Promise.resolve(void 0);e.model.contentChanged.connect(this.update,this);const s={cell:e,sessionContext:this.sessionContext,onCellExecuted:e=>{if(this._executed.emit(e.executionDate),e.error)for(const e of this._cells)null===e.model.executionCount&&(e.model.executionState="idle")}};try{await this._executor.runCell(s)}finally{this.isDisposed||(e.model.contentChanged.disconnect(this.update,this),this.update())}}_handleInfo(e){if("ok"!==e.status)return void this._banner.model.sharedModel.setSource("Error in getting kernel banner");this._banner.model.sharedModel.setSource(e.banner);const t=e.language_info;this._mimetype=this._mimeTypeService.getMimeTypeByLanguage(t),this.promptCell&&(this.promptCell.model.mimeType=this._mimetype)}_createCodeCellOptions(){const e=this.contentFactory;return{model:this.modelFactory.createCodeCell({}),rendermime:this.rendermime,contentFactory:e,editorConfig:this.editorConfig,placeholder:!1,translator:this._translator}}_onCellDisposed(e,t){if(!this.isDisposed){this._cells.removeValue(e);const t=this._msgIdCells.get(e);t&&(this._msgIdCells.delete(e),this._msgIds.delete(t))}}_shouldExecute(e){const t=this.promptCell;if(!t)return Promise.resolve(!1);const s=t.model.sharedModel.getSource();return new Promise(((t,o)=>{var n;const i=setTimeout((()=>{t(!0)}),e),l=null===(n=this.sessionContext.session)||void 0===n?void 0:n.kernel;l?l.requestIsComplete({code:s}).then((e=>{clearTimeout(i),this.isDisposed&&t(!1),"incomplete"===e.content.status?t(!1):t(!0)})).catch((()=>{t(!0)})):t(!1)}))}async _onKernelChanged(){var e;this.clear(),this._banner&&(this._banner.dispose(),this._banner=null),this.addBanner(),(null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel)&&this._handleInfo(await this.sessionContext.session.kernel.info)}async _onKernelStatusChanged(){var e;const t=null===(e=this.sessionContext.session)||void 0===e?void 0:e.kernel;"restarting"===(null==t?void 0:t.status)&&(this.addBanner(),this._handleInfo(await(null==t?void 0:t.info)))}_updateReadWrite(){const e=c.DOMUtils.hasActiveEditableElement(this.node);this.node.classList.toggle("jp-mod-readWrite",e)}}var w,D;!function(e){e.defaultEditorConfig={codeFolding:!1,lineNumbers:!1};class t extends o.Cell.ContentFactory{createCodeCell(e){return new o.CodeCell(e).initializeState()}createRawCell(e){return new o.RawCell(e).initializeState()}}e.ContentFactory=t;class s{constructor(e={}){this.codeCellContentFactory=e.codeCellContentFactory||o.CodeCellModel.defaultContentFactory}createCodeCell(e={}){return e.contentFactory||(e.contentFactory=this.codeCellContentFactory),new o.CodeCellModel(e)}createRawCell(e){return new o.RawCellModel(e)}}e.ModelFactory=s,e.defaultModelFactory=new s({})}(x||(x={})),function(e){e.scrollToBottom=function(e){e.scrollTop=e.scrollHeight-e.clientHeight}}(w||(w={}));class b extends c.MainAreaWidget{constructor(e){super({content:new C.Panel}),this._executed=null,this._connected=null,this.addClass("jp-ConsolePanel");let{executor:t,rendermime:s,mimeTypeService:o,path:n,basePath:i,name:l,manager:r,modelFactory:a,sessionContext:m,translator:g}=e;this.translator=null!=g?g:u.nullTranslator;const y=this.translator.load("jupyterlab"),f=this.contentFactory=e.contentFactory,v=D.count++;n||(n=h.PathExt.join(i||"",`console-${v}-${_.UUID.uuid4()}`)),m=this._sessionContext=null!=m?m:new c.SessionContext({kernelManager:r.kernels,sessionManager:r.sessions,specsManager:r.kernelspecs,path:r.contents.localPath(n),name:l||y.__("Console %1",v),type:"console",kernelPreference:e.kernelPreference,setBusy:e.setBusy});const x=new d.RenderMimeRegistry.UrlResolver({path:n,contents:r.contents});s=s.clone({resolver:x}),this.console=f.createConsole({executor:t,rendermime:s,sessionContext:m,mimeTypeService:o,contentFactory:f,modelFactory:a,translator:g}),this.content.addWidget(this.console),m.initialize().then((async t=>{var s;t&&await(null!==(s=e.sessionDialogs)&&void 0!==s?s:new c.SessionContextDialogs({translator:g})).selectKernel(m),this._connected=new Date,this._updateTitlePanel()})),this.console.executed.connect(this._onExecuted,this),this._updateTitlePanel(),m.kernelChanged.connect(this._updateTitlePanel,this),m.propertyChanged.connect(this._updateTitlePanel,this),this.title.icon=p.consoleIcon,this.title.closable=!0,this.id=`console-${v}`}get sessionContext(){return this._sessionContext}dispose(){this.sessionContext.dispose(),this.console.dispose(),super.dispose()}onActivateRequest(e){const t=this.console.promptCell;t&&t.editor.focus()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}_onExecuted(e,t){this._executed=t,this._updateTitlePanel()}_updateTitlePanel(){D.updateTitle(this,this._connected,this._executed,this.translator)}}!function(e){class t extends x.ContentFactory{createConsole(e){return new x(e)}}e.ContentFactory=t,e.IContentFactory=new _.Token("@jupyterlab/console:IContentFactory","A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.")}(b||(b={})),function(e){e.count=1,e.updateTitle=function(e,t,s,o){const n=(o=o||u.nullTranslator).load("jupyterlab"),i=e.console.sessionContext.session;if(i){let o=n.__("Name: %1\n",i.name)+n.__("Directory: %1\n",h.PathExt.dirname(i.path))+n.__("Kernel: %1",e.console.sessionContext.kernelDisplayName);t&&(o+=n.__("\nConnected: %1",h.Time.format(t.toISOString()))),s&&(o+=n.__("\nLast Execution: %1")),e.title.label=i.name,e.title.caption=o}else e.title.label=n.__("Console"),e.title.caption=""}}(D||(D={}));const k=new _.Token("@jupyterlab/console:IConsoleTracker","A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application."),S=new _.Token("@jupyterlab/console:IConsoleCellExecutor","The console cell executor")}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2756],{12756:function(t,e){!function(t){"use strict";t.JSONExt=void 0,function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function n(t){return Array.isArray(t)}function r(t,i){if(t===i)return!0;if(e(t)||e(i))return!1;let o=n(t),s=n(i);return o===s&&(o&&s?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;++n)if(!r(t[n],e[n]))return!1;return!0}(t,i):function(t,e){if(t===e)return!0;for(let n in t)if(void 0!==t[n]&&!(n in e))return!1;for(let n in e)if(void 0!==e[n]&&!(n in t))return!1;for(let n in t){let i=t[n],o=e[n];if(void 0!==i||void 0!==o){if(void 0===i||void 0===o)return!1;if(!r(i,o))return!1}}return!0}(t,i))}function i(t){return e(t)?t:n(t)?function(t){let e=new Array(t.length);for(let n=0,r=t.length;n<r;++n)e[n]=i(t[n]);return e}(t):function(t){let e={};for(let n in t){let r=t[n];void 0!==r&&(e[n]=i(r))}return e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=function(t){return!e(t)&&!n(t)},t.deepEqual=r,t.deepCopy=i}(t.JSONExt||(t.JSONExt={}));function e(t){let e=0;for(let n=0,r=t.length;n<r;++n)n%4==0&&(e=4294967295*Math.random()>>>0),t[n]=255&e,e>>>=8}t.Random=void 0,(t.Random||(t.Random={})).getRandomValues=(()=>{const t="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return t&&"function"==typeof t.getRandomValues?function(e){return t.getRandomValues(e)}:e})(),t.UUID=void 0,(t.UUID||(t.UUID={})).uuid4=function(t){const e=new Uint8Array(16),n=new Array(256);for(let t=0;t<16;++t)n[t]="0"+t.toString(16);for(let t=16;t<256;++t)n[t]=t.toString(16);return function(){return t(e),e[6]=64|15&e[6],e[8]=128|63&e[8],n[e[0]]+n[e[1]]+n[e[2]]+n[e[3]]+"-"+n[e[4]]+n[e[5]]+"-"+n[e[6]]+n[e[7]]+"-"+n[e[8]]+n[e[9]]+"-"+n[e[10]]+n[e[11]]+n[e[12]]+n[e[13]]+n[e[14]]+n[e[15]]}}(t.Random.getRandomValues),t.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(t){return-1!==this._types.indexOf(t)}getData(t){let e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0}setData(t,e){this.clearData(t),this._types.push(t),this._values.push(e)}clearData(t){let e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))}clear(){this._types.length=0,this._values.length=0}},t.PromiseDelegate=class{constructor(){this.promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}resolve(t){(0,this._resolve)(t)}reject(t){(0,this._reject)(t)}},t.Token=class{constructor(t,e){this.name=t,this.description=null!=e?e:"",this._tokenStructuralPropertyT=null}}}(e)}}]);
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2756],{12756:function(t,e,i){!function(t,e){"use strict";t.JSONExt=void 0,function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function i(t){return Array.isArray(t)}function r(t,n){if(t===n)return!0;if(e(t)||e(n))return!1;let s=i(t),o=i(n);return s===o&&(s&&o?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;++i)if(!r(t[i],e[i]))return!1;return!0}(t,n):function(t,e){if(t===e)return!0;for(let i in t)if(void 0!==t[i]&&!(i in e))return!1;for(let i in e)if(void 0!==e[i]&&!(i in t))return!1;for(let i in t){let n=t[i],s=e[i];if(void 0!==n||void 0!==s){if(void 0===n||void 0===s)return!1;if(!r(n,s))return!1}}return!0}(t,n))}function n(t){return e(t)?t:i(t)?function(t){let e=new Array(t.length);for(let i=0,r=t.length;i<r;++i)e[i]=n(t[i]);return e}(t):function(t){let e={};for(let i in t){let r=t[i];void 0!==r&&(e[i]=n(r))}return e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=i,t.isObject=function(t){return!e(t)&&!i(t)},t.deepEqual=r,t.deepCopy=n}(t.JSONExt||(t.JSONExt={}));var i;!function(t){class i{constructor(t){var e,i,r,n;this._activated=!1,this._promise=null,this._service=null,this.id=t.id,this.description=null!==(e=t.description)&&void 0!==e?e:"",this.activate=t.activate,this.deactivate=null!==(i=t.deactivate)&&void 0!==i?i:null,this.provides=null!==(r=t.provides)&&void 0!==r?r:null,this.autoStart=null!==(n=t.autoStart)&&void 0!==n&&n,this.requires=t.requires?t.requires.slice():[],this.optional=t.optional?t.optional.slice():[]}get activated(){return this._activated}set activated(t){this._activated=t}get service(){return this._service}set service(t){this._service=t}get promise(){return this._promise}set promise(t){this._promise=t}}t.createPluginData=function(t){return new i(t)},t.ensureNoCycle=function(t,e,i){const r=[...t.requires,...t.optional],n=r=>{if(r===t.provides)return!0;const o=i.get(r);if(!o)return!1;const a=e.get(o),l=[...a.requires,...a.optional];return 0!==l.length&&(s.push(o),!!l.some(n)||(s.pop(),!1))};if(!t.provides||0===r.length)return;const s=[t.id];if(r.some(n))throw new ReferenceError(`Cycle detected: ${s.join(" -> ")}.`)},t.findDependents=function(t,i,r){const n=new Array,s=t=>{const e=i.get(t),s=[...e.requires,...e.optional];n.push(...s.reduce(((e,i)=>{const n=r.get(i);return n&&e.push([t,n]),e}),[]))};for(const t of i.keys())s(t);const o=n.filter((e=>e[1]===t));let a=0;for(;o.length>a;){const t=o.length,e=new Set(o.map((t=>t[0])));for(const t of e)n.filter((e=>e[1]===t)).forEach((t=>{o.includes(t)||o.push(t)}));a=t}const l=e.topologicSort(o),u=l.findIndex((e=>e===t));return-1===u?[t]:l.slice(0,u+1)},t.collectStartupPlugins=function(t,e){const i=new Set;for(const e of t.keys())!0===t.get(e).autoStart&&i.add(e);if(e.startPlugins)for(const t of e.startPlugins)i.add(t);if(e.ignorePlugins)for(const t of e.ignorePlugins)i.delete(t);return Array.from(i)}}(i||(i={}));function r(t){let e=0;for(let i=0,r=t.length;i<r;++i)i%4==0&&(e=4294967295*Math.random()>>>0),t[i]=255&e,e>>>=8}t.Random=void 0,(t.Random||(t.Random={})).getRandomValues=(()=>{const t="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return t&&"function"==typeof t.getRandomValues?function(e){return t.getRandomValues(e)}:r})(),t.UUID=void 0,(t.UUID||(t.UUID={})).uuid4=function(t){const e=new Uint8Array(16),i=new Array(256);for(let t=0;t<16;++t)i[t]="0"+t.toString(16);for(let t=16;t<256;++t)i[t]=t.toString(16);return function(){return t(e),e[6]=64|15&e[6],e[8]=128|63&e[8],i[e[0]]+i[e[1]]+i[e[2]]+i[e[3]]+"-"+i[e[4]]+i[e[5]]+"-"+i[e[6]]+i[e[7]]+"-"+i[e[8]]+i[e[9]]+"-"+i[e[10]]+i[e[11]]+i[e[12]]+i[e[13]]+i[e[14]]+i[e[15]]}}(t.Random.getRandomValues),t.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(t){return-1!==this._types.indexOf(t)}getData(t){let e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0}setData(t,e){this.clearData(t),this._types.push(t),this._values.push(e)}clearData(t){let e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))}clear(){this._types.length=0,this._values.length=0}},t.PluginRegistry=class{constructor(t={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,t.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=t.validatePlugin)}get application(){return this._application}set application(t){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=t}get deferredPlugins(){return Array.from(this._plugins).filter((([t,e])=>"defer"===e.autoStart)).map((([t,e])=>t))}getPluginDescription(t){var e,i;return null!==(i=null===(e=this._plugins.get(t))||void 0===e?void 0:e.description)&&void 0!==i?i:""}hasPlugin(t){return this._plugins.has(t)}isPluginActivated(t){var e,i;return null!==(i=null===(e=this._plugins.get(t))||void 0===e?void 0:e.activated)&&void 0!==i&&i}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(t){if(this._plugins.has(t.id))throw new TypeError(`Plugin '${t.id}' is already registered.`);if(!this._validatePlugin(t))throw new Error(`Plugin '${t.id}' is not valid.`);const e=i.createPluginData(t);i.ensureNoCycle(e,this._plugins,this._services),e.provides&&this._services.set(e.provides,e.id),this._plugins.set(e.id,e)}registerPlugins(t){for(const e of t)this.registerPlugin(e)}deregisterPlugin(t,e){const i=this._plugins.get(t);if(i){if(i.activated&&!e)throw new Error(`Plugin '${t}' is still active.`);this._plugins.delete(t)}}async activatePlugin(t){const e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(e.activated)return;if(e.promise)return e.promise;const i=e.requires.map((t=>this.resolveRequiredService(t))),r=e.optional.map((t=>this.resolveOptionalService(t)));return e.promise=Promise.all([...i,...r]).then((t=>e.activate.apply(void 0,[this.application,...t]))).then((t=>{e.service=t,e.activated=!0,e.promise=null})).catch((t=>{throw e.promise=null,t})),e.promise}async activatePlugins(t,e={}){switch(t){case"defer":{const t=this.deferredPlugins.filter((t=>this._plugins.get(t).autoStart)).map((t=>this.activatePlugin(t)));await Promise.all(t);break}case"startUp":{const t=i.collectStartupPlugins(this._plugins,e).map((async t=>{try{return await this.activatePlugin(t)}catch(e){console.error(`Plugin '${t}' failed to activate.`,e)}}));await Promise.all(t);break}}}async deactivatePlugin(t){const e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(!e.activated)return[];if(!e.deactivate)throw new TypeError(`Plugin '${t}'#deactivate() method missing`);const r=i.findDependents(t,this._plugins,this._services),n=r.map((t=>this._plugins.get(t)));for(const e of n)if(!e.deactivate)throw new TypeError(`Plugin ${e.id}#deactivate() method missing (depends on ${t})`);for(const t of n){const e=[...t.requires,...t.optional].map((t=>{const e=this._services.get(t);return e?this._plugins.get(e).service:null}));await t.deactivate(this.application,...e),t.service=null,t.activated=!1}return r.pop(),r}async resolveRequiredService(t){const e=this._services.get(t);if(!e)throw new TypeError(`No provider for: ${t.name}.`);const i=this._plugins.get(e);return i.activated||await this.activatePlugin(e),i.service}async resolveOptionalService(t){const e=this._services.get(t);if(!e)return null;const i=this._plugins.get(e);if(!i.activated)try{await this.activatePlugin(e)}catch(t){return console.error(t),null}return i.service}},t.PromiseDelegate=class{constructor(){this.promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}resolve(t){(0,this._resolve)(t)}reject(t){(0,this._reject)(t)}},t.Token=class{constructor(t,e){this.name=t,this.description=null!=e?e:"",this._tokenStructuralPropertyT=null}}}(e,i(14931))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2813,3325],{23325:(t,e,r)=>{r.r(e),r.d(e,{MAJOR_VERSION:()=>u,MINOR_VERSION:()=>i,isCode:()=>c,isDisplayData:()=>l,isDisplayUpdate:()=>_,isError:()=>f,isExecuteResult:()=>s,isMarkdown:()=>p,isRaw:()=>o,isStream:()=>y,validateMimeValue:()=>a});var n=r(20998);const u=4,i=4;function a(t,e){const r="application/json"===t||/^application\/.+\+json$/.test(t),u=t=>"[object String]"===Object.prototype.toString.call(t);if(Array.isArray(e)){if(r)return!1;let t=!0;return e.forEach((e=>{u(e)||(t=!1)})),t}return u(e)?!r:!!r&&n.JSONExt.isObject(e)}function o(t){return"raw"===t.cell_type}function p(t){return"markdown"===t.cell_type}function c(t){return"code"===t.cell_type}function s(t){return"execute_result"===t.output_type}function l(t){return"display_data"===t.output_type}function _(t){return"update_display_data"===t.output_type}function y(t){return"stream"===t.output_type}function f(t){return"error"===t.output_type}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2813,3325],{23325:(t,e,r)=>{r.r(e),r.d(e,{MAJOR_VERSION:()=>u,MINOR_VERSION:()=>i,isCode:()=>c,isDisplayData:()=>l,isDisplayUpdate:()=>_,isError:()=>f,isExecuteResult:()=>s,isMarkdown:()=>p,isRaw:()=>o,isStream:()=>y,validateMimeValue:()=>a});var n=r(21961);const u=4,i=4;function a(t,e){const r="application/json"===t||/^application\/.+\+json$/.test(t),u=t=>"[object String]"===Object.prototype.toString.call(t);if(Array.isArray(e)){if(r)return!1;let t=!0;return e.forEach((e=>{u(e)||(t=!1)})),t}return u(e)?!r:!!r&&n.JSONExt.isObject(e)}function o(t){return"raw"===t.cell_type}function p(t){return"markdown"===t.cell_type}function c(t){return"code"===t.cell_type}function s(t){return"execute_result"===t.output_type}function l(t){return"display_data"===t.output_type}function _(t){return"update_display_data"===t.output_type}function y(t){return"stream"===t.output_type}function f(t){return"error"===t.output_type}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2866],{24598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const o=n(81997);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new o.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,o.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},2866:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(24598),t),r(n(51632),t),r(n(79844),t),r(n(94741),t),r(n(86083),t),r(n(12361),t),r(n(82053),t),r(n(84157),t),r(n(59635),t),r(n(34410),t)},51632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79844:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LruCache=void 0,t.LruCache=class{constructor(e={}){this._map=new Map,this._maxSize=(null==e?void 0:e.maxSize)||128}get size(){return this._map.size}clear(){this._map.clear()}get(e){const t=this._map.get(e)||null;return null!=t&&(this._map.delete(e),this._map.set(e,t)),t}set(e,t){this._map.size>=this._maxSize&&this._map.delete(this._map.keys().next().value),this._map.set(e,t)}}},94741:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const o=t.split("\n"),r=[];let i=null;for(let t=0;t<o.length;t++){const s=o[t],a=0===s.indexOf(e.CODE_BLOCK_MARKER),c=null!=i;if(a||c)if(c)i&&(a?(i.endLine=t-1,r.push(i),i=null):i.code+=s+"\n");else{i=new n(t);const o=s.indexOf(e.CODE_BLOCK_MARKER),a=s.lastIndexOf(e.CODE_BLOCK_MARKER);o!==a&&(i.code=s.substring(o+e.CODE_BLOCK_MARKER.length,a),i.endLine=t,r.push(i),i=null)}}return r}}(n||(t.MarkdownCodeBlocks=n={}))},86083:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var process=__webpack_require__(27061),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageConfig=void 0;const coreutils_1=__webpack_require__(20998),minimist_1=__importDefault(__webpack_require__(66161)),url_1=__webpack_require__(34410);var PageConfig;(function(PageConfig){function getOption(name){if(configData)return configData[name]||getBodyData(name);configData=Object.create(null);let found=!1;if("undefined"!=typeof document&&document){const e=document.getElementById("jupyter-config-data");e&&(configData=JSON.parse(e.textContent||""),found=!0)}if(!found&&void 0!==process&&process.argv)try{const cli=(0,minimist_1.default)(process.argv.slice(2)),path=__webpack_require__(67425);let fullPath="";"jupyter-config-data"in cli?fullPath=path.resolve(cli["jupyter-config-data"]):"JUPYTER_CONFIG_DATA"in process.env&&(fullPath=path.resolve(process.env.JUPYTER_CONFIG_DATA)),fullPath&&(configData=eval("require")(fullPath))}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(const e in configData)"string"!=typeof configData[e]&&(configData[e]=JSON.stringify(configData[e]));else configData=Object.create(null);return configData[name]||getBodyData(name)}function setOption(e,t){const n=getOption(e);return configData[e]=t,n}function getBaseUrl(){return url_1.URLExt.normalize(getOption("baseUrl")||"/")}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("treeUrl"))}function getShareUrl(){return url_1.URLExt.normalize(getOption("shareUrl")||getBaseUrl())}function getTreeShareUrl(){return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(),getOption("treeUrl")))}function getUrl(e){var t,n,o,r;let i=e.toShare?getShareUrl():getBaseUrl();const s=null!==(t=e.mode)&&void 0!==t?t:getOption("mode"),a=null!==(n=e.workspace)&&void 0!==n?n:getOption("workspace"),c="single-document"===s?"doc":"lab";i=url_1.URLExt.join(i,c),a!==PageConfig.defaultWorkspace&&(i=url_1.URLExt.join(i,"workspaces",encodeURIComponent(null!==(o=getOption("workspace"))&&void 0!==o?o:PageConfig.defaultWorkspace)));const l=null!==(r=e.treePath)&&void 0!==r?r:getOption("treePath");return l&&(i=url_1.URLExt.join(i,"tree",url_1.URLExt.encodeParts(l))),i}function getWsUrl(e){let t=getOption("wsUrl");if(!t){if(0!==(e=e?url_1.URLExt.normalize(e):getBaseUrl()).indexOf("http"))return"";t="ws"+e.slice(4)}return url_1.URLExt.normalize(t)}function getNBConvertURL({path:e,format:t,download:n}){const o=url_1.URLExt.encodeParts(e),r=url_1.URLExt.join(getBaseUrl(),"nbconvert",t,o);return n?r+"?download=true":r}function getToken(){return getOption("token")||getBodyData("jupyterApiToken")}function getNotebookVersion(){const e=getOption("notebookVersion");return""===e?[0,0,0]:JSON.parse(e)}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getShareUrl=getShareUrl,PageConfig.getTreeShareUrl=getTreeShareUrl,PageConfig.getUrl=getUrl,PageConfig.defaultWorkspace="default",PageConfig.getWsUrl=getWsUrl,PageConfig.getNBConvertURL=getNBConvertURL,PageConfig.getToken=getToken,PageConfig.getNotebookVersion=getNotebookVersion;let configData=null,Extension;function getBodyData(e){if("undefined"==typeof document||!document.body)return"";const t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}!function(e){function t(e){try{const t=getOption(e);if(t)return JSON.parse(t)}catch(t){console.warn(`Unable to parse ${e}.`,t)}return[]}e.deferred=t("deferredExtensions"),e.disabled=t("disabledExtensions"),e.isDeferred=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.deferred.some((e=>e===t||o&&e===o))},e.isDisabled=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.disabled.some((e=>e===t||o&&e===o))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig||(exports.PageConfig=PageConfig={}))},12361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const o=n(67425);var r;!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=o.posix.join(...e);return"."===n?"":t(n)},e.joinWithLeadingSlash=function(...e){const t=o.posix.join(...e);return"."===t?"":t},e.basename=function(e,t){return o.posix.basename(e,t)},e.dirname=function(e){const n=t(o.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return o.posix.extname(e)},e.normalize=function(e){return""===e?"":t(o.posix.normalize(e))},e.resolve=function(...e){return t(o.posix.resolve(...e))},e.relative=function(e,n){return t(o.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(r||(t.PathExt=r={}))},82053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const o=n(20998);t.signalToPromise=function(e,t){const n=new o.PromiseDelegate;function r(){e.disconnect(i)}function i(e,t){r(),n.resolve([e,t])}return e.connect(i),(null!=t?t:0)>0&&setTimeout((()=>{r(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},84157:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){e.jsIndexToCharIndex=function(e,t){return e},e.charIndexToJsIndex=function(e,t){return e},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,o){return o?o.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(n||(t.Text=n={}))},59635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var o;!function(e){e.formatHuman=function(e,t="long"){const o=document.documentElement.lang||"en",r=new Intl.RelativeTimeFormat(o,{numeric:"auto",style:t}),i=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(i/e.milliseconds);if(0!==t)return r.format(t,e.name)}return r.format(0,"seconds")},e.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}}(o||(t.Time=o={}))},34410:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const r=n(67425),i=o(n(80899));var s;!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,i.default)(e)}function n(...e){let t=(0,i.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,i.default)(e[0],"https:"+e[0]));const o=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,s=r.posix.join(`${o&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${o}${"."===s?"":s}`}e.parse=t,e.getHostName=function(e){return(0,i.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(o||"")),e}),{})},e.isLocal=function(e,n=!1){const{protocol:o}=t(e);return(!o||0!==e.toLowerCase().indexOf(o))&&(n?0!==e.indexOf("//"):0!==e.indexOf("/"))}}(s||(t.URLExt=s={}))},66161:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,o){o||(o={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof o.unknown&&(r.unknownFn=o.unknown),"boolean"==typeof o.boolean&&o.boolean?r.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var i={};function s(e){return i[e].some((function(e){return r.bools[e]}))}Object.keys(o.alias||{}).forEach((function(e){i[e]=[].concat(o.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(o.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,i[e]&&[].concat(i[e]).forEach((function(e){r.strings[e]=!0}))}));var a=o.default||{},c={_:[]};function l(e,t,o){for(var i=e,s=0;s<t.length-1;s++){var a=t[s];if(n(i,a))return;void 0===i[a]&&(i[a]={}),i[a]!==Object.prototype&&i[a]!==Number.prototype&&i[a]!==String.prototype||(i[a]={}),i[a]===Array.prototype&&(i[a]=[]),i=i[a]}var c=t[t.length-1];n(i,c)||(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[c]||r.bools[c]||"boolean"==typeof i[c]?i[c]=o:Array.isArray(i[c])?i[c].push(o):i[c]=[i[c],o])}function u(e,n,o){if(!o||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||i[e]}(e,o)||!1!==r.unknownFn(o)){var s=!r.strings[e]&&t(n)?Number(n):n;l(c,e.split("."),s),(i[e]||[]).forEach((function(e){l(c,e.split("."),s)}))}}Object.keys(r.bools).forEach((function(e){u(e,void 0!==a[e]&&a[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var p=0;p<e.length;p++){var h,d,g=e[p];if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);h=m[1];var _=m[2];r.bools[h]&&(_="false"!==_),u(h,_,g)}else if(/^--no-.+/.test(g))u(h=g.match(/^--no-(.+)/)[1],!1,g);else if(/^--.+/.test(g))h=g.match(/^--(.+)/)[1],void 0===(d=e[p+1])||/^(-|--)[^-]/.test(d)||r.bools[h]||r.allBools||i[h]&&s(h)?/^(true|false)$/.test(d)?(u(h,"true"===d,g),p+=1):u(h,!r.strings[h]||"",g):(u(h,d,g),p+=1);else if(/^-[^-]+/.test(g)){for(var v=g.slice(1,-1).split(""),y=!1,b=0;b<v.length;b++)if("-"!==(d=g.slice(b+2))){if(/[A-Za-z]/.test(v[b])&&"="===d[0]){u(v[b],d.slice(1),g),y=!0;break}if(/[A-Za-z]/.test(v[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){u(v[b],d,g),y=!0;break}if(v[b+1]&&v[b+1].match(/\W/)){u(v[b],g.slice(b+2),g),y=!0;break}u(v[b],!r.strings[v[b]]||"",g)}else u(v[b],d,g);h=g.slice(-1)[0],y||"-"===h||(!e[p+1]||/^(-|--)[^-]/.test(e[p+1])||r.bools[h]||i[h]&&s(h)?e[p+1]&&/^(true|false)$/.test(e[p+1])?(u(h,"true"===e[p+1],g),p+=1):u(h,!r.strings[h]||"",g):(u(h,e[p+1],g),p+=1))}else if(r.unknownFn&&!1===r.unknownFn(g)||c._.push(r.strings._||!t(g)?g:Number(g)),o.stopEarly){c._.push.apply(c._,e.slice(p+1));break}}return Object.keys(a).forEach((function(e){var t,n,o;t=c,n=e.split("."),o=t,n.slice(0,-1).forEach((function(e){o=o[e]||{}})),n[n.length-1]in o||(l(c,e.split("."),a[e]),(i[e]||[]).forEach((function(t){l(c,t.split("."),a[e])})))})),o["--"]?c["--"]=f.slice():f.forEach((function(e){c._.push(e)})),c}},67425:(e,t,n)=>{"use strict";var o=n(27061);function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,o="",r=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(o.length<2||2!==r||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var c=o.lastIndexOf("/");if(c!==o.length-1){-1===c?(o="",r=0):r=(o=o.slice(0,c)).length-1-o.lastIndexOf("/"),i=a,s=0;continue}}else if(2===o.length||1===o.length){o="",r=0,i=a,s=0;continue}t&&(o.length>0?o+="/..":o="..",r=2)}else o.length>0?o+="/"+e.slice(i+1,a):o=e.slice(i+1,a),r=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return o}var s={resolve:function(){for(var e,t="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=o.cwd()),a=e),r(a),0!==a.length&&(t=a+"/"+t,n=47===a.charCodeAt(0))}return t=i(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var o=e.length,i=o-n,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var c=t.length-a,l=i<c?i:c,u=-1,f=0;f<=l;++f){if(f===l){if(c>l){if(47===t.charCodeAt(a+f))return t.slice(a+f+1);if(0===f)return t.slice(a+f)}else i>l&&(47===e.charCodeAt(n+f)?u=f:0===f&&(u=0));break}var p=e.charCodeAt(n+f);if(p!==t.charCodeAt(a+f))break;47===p&&(u=f)}var h="";for(f=n+u+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(a+u):(a+=u,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,i=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!s){o=n+1;break}}else-1===c&&(s=!1,c=n+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(i=n):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){n=a+1;break}}return-1===t||-1===o||0===s||1===s&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,o=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+o:n+"/"+o:o}(0,e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),i=47===o;i?(t.root="/",n=1):n=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,f=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c)),t.ext=e.slice(s,c)),a>0?t.dir=e.slice(0,a-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s},27061:e=>{var t,n,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,c=[],l=!1,u=-1;function f(){l&&a&&(l=!1,a.length?c=a.concat(c):u=-1,c.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(a=c,c=[];++u<t;)a&&a[u].run();u=-1,t=c.length}a=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function d(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=d,o.addListener=d,o.once=d,o.off=d,o.removeListener=d,o.removeAllListeners=d,o.emit=d,o.prependListener=d,o.prependOnceListener=d,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},88157:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;s.push(i+"="+o)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),s=o(t[2]);null===i||null===s||i in r||(r[i]=s)}return r}},53096:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},80899:(e,t,n)=>{"use strict";var o=n(53096),r=n(88157),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var p=[["#","hash"],["?","query"],function(e,t){return g(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(e){var t,o=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},r={},i=typeof(e=e||o);if("blob:"===e.protocol)r=new _(unescape(e.pathname),{});else if("string"===i)for(t in r=new _(e,{}),h)delete r[t];else if("object"===i){for(t in e)t in h||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=a.test(e.href))}return r}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function m(e,t){e=(e=f(e)).replace(s,""),t=t||{};var n,o=l.exec(e),r=o[1]?o[1].toLowerCase():"",i=!!o[2],a=!!o[3],c=0;return i?a?(n=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(n=o[2]+o[4],c=o[2].length):a?(n=o[3]+o[4],c=o[3].length):n=o[4],"file:"===r?c>=2&&(n=n.slice(2)):g(r)?n=o[4]:r?i&&(n=n.slice(2)):c>=2&&g(t.protocol)&&(n=o[4]),{protocol:r,slashes:i||g(r),slashesCount:c,rest:n}}function _(e,t,n){if(e=(e=f(e)).replace(s,""),!(this instanceof _))return new _(e,t,n);var i,a,c,l,h,v,y=p.slice(),b=typeof t,w=this,C=0;for("object"!==b&&"string"!==b&&(n=t,t=null),n&&"function"!=typeof n&&(n=r.parse),i=!(a=m(e||"",t=d(t))).protocol&&!a.slashes,w.slashes=a.slashes||i&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(y[3]=[/(.*)/,"pathname"]);C<y.length;C++)"function"!=typeof(l=y[C])?(c=l[0],v=l[1],c!=c?w[v]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof l[2]?(w[v]=e.slice(0,h),e=e.slice(h+l[2])):(w[v]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[v]=h[1],e=e.slice(0,h.index)),w[v]=w[v]||i&&l[3]&&t[v]||"",l[4]&&(w[v]=w[v].toLowerCase())):e=l(e,w);n&&(w.query=n(w.query)),i&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,s=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),s++):s&&(0===o&&(i=!0),n.splice(o,1),s--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&g(w.protocol)&&(w.pathname="/"+w.pathname),o(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}_.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,c.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<p.length;l++){var u=p[l];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&g(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=r.stringify);var t,n=this,o=n.host,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(n.protocol&&n.slashes||g(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&g(n.protocol)&&!o&&"/"!==n.pathname&&(s+="@"),(":"===o[o.length-1]||c.test(n.hostname)&&!n.port)&&(o+=":"),s+=o+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(s+=n.hash),s}},_.extractProtocol=m,_.location=d,_.trimLeft=f,_.qs=r,e.exports=_}}]);
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2866],{24598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const o=n(2159);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new o.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,o.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},2866:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(24598),t),r(n(51632),t),r(n(79844),t),r(n(94741),t),r(n(86083),t),r(n(12361),t),r(n(82053),t),r(n(84157),t),r(n(59635),t),r(n(34410),t)},51632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79844:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LruCache=void 0,t.LruCache=class{constructor(e={}){this._map=new Map,this._maxSize=(null==e?void 0:e.maxSize)||128}get size(){return this._map.size}clear(){this._map.clear()}get(e){const t=this._map.get(e)||null;return null!=t&&(this._map.delete(e),this._map.set(e,t)),t}set(e,t){this._map.size>=this._maxSize&&this._map.delete(this._map.keys().next().value),this._map.set(e,t)}}},94741:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const o=t.split("\n"),r=[];let i=null;for(let t=0;t<o.length;t++){const s=o[t],a=0===s.indexOf(e.CODE_BLOCK_MARKER),c=null!=i;if(a||c)if(c)i&&(a?(i.endLine=t-1,r.push(i),i=null):i.code+=s+"\n");else{i=new n(t);const o=s.indexOf(e.CODE_BLOCK_MARKER),a=s.lastIndexOf(e.CODE_BLOCK_MARKER);o!==a&&(i.code=s.substring(o+e.CODE_BLOCK_MARKER.length,a),i.endLine=t,r.push(i),i=null)}}return r}}(n||(t.MarkdownCodeBlocks=n={}))},86083:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var process=__webpack_require__(27061),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageConfig=void 0;const coreutils_1=__webpack_require__(21961),minimist_1=__importDefault(__webpack_require__(66161)),url_1=__webpack_require__(34410);var PageConfig;(function(PageConfig){function getOption(name){if(configData)return configData[name]||getBodyData(name);configData=Object.create(null);let found=!1;if("undefined"!=typeof document&&document){const e=document.getElementById("jupyter-config-data");e&&(configData=JSON.parse(e.textContent||""),found=!0)}if(!found&&void 0!==process&&process.argv)try{const cli=(0,minimist_1.default)(process.argv.slice(2)),path=__webpack_require__(67425);let fullPath="";"jupyter-config-data"in cli?fullPath=path.resolve(cli["jupyter-config-data"]):"JUPYTER_CONFIG_DATA"in process.env&&(fullPath=path.resolve(process.env.JUPYTER_CONFIG_DATA)),fullPath&&(configData=eval("require")(fullPath))}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(const e in configData)"string"!=typeof configData[e]&&(configData[e]=JSON.stringify(configData[e]));else configData=Object.create(null);return configData[name]||getBodyData(name)}function setOption(e,t){const n=getOption(e);return configData[e]=t,n}function getBaseUrl(){return url_1.URLExt.normalize(getOption("baseUrl")||"/")}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("treeUrl"))}function getShareUrl(){return url_1.URLExt.normalize(getOption("shareUrl")||getBaseUrl())}function getTreeShareUrl(){return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(),getOption("treeUrl")))}function getUrl(e){var t,n,o,r;let i=e.toShare?getShareUrl():getBaseUrl();const s=null!==(t=e.mode)&&void 0!==t?t:getOption("mode"),a=null!==(n=e.workspace)&&void 0!==n?n:getOption("workspace"),c="single-document"===s?"doc":"lab";i=url_1.URLExt.join(i,c),a!==PageConfig.defaultWorkspace&&(i=url_1.URLExt.join(i,"workspaces",encodeURIComponent(null!==(o=getOption("workspace"))&&void 0!==o?o:PageConfig.defaultWorkspace)));const l=null!==(r=e.treePath)&&void 0!==r?r:getOption("treePath");return l&&(i=url_1.URLExt.join(i,"tree",url_1.URLExt.encodeParts(l))),i}function getWsUrl(e){let t=getOption("wsUrl");if(!t){if(0!==(e=e?url_1.URLExt.normalize(e):getBaseUrl()).indexOf("http"))return"";t="ws"+e.slice(4)}return url_1.URLExt.normalize(t)}function getNBConvertURL({path:e,format:t,download:n}){const o=url_1.URLExt.encodeParts(e),r=url_1.URLExt.join(getBaseUrl(),"nbconvert",t,o);return n?r+"?download=true":r}function getToken(){return getOption("token")||getBodyData("jupyterApiToken")}function getNotebookVersion(){const e=getOption("notebookVersion");return""===e?[0,0,0]:JSON.parse(e)}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getShareUrl=getShareUrl,PageConfig.getTreeShareUrl=getTreeShareUrl,PageConfig.getUrl=getUrl,PageConfig.defaultWorkspace="default",PageConfig.getWsUrl=getWsUrl,PageConfig.getNBConvertURL=getNBConvertURL,PageConfig.getToken=getToken,PageConfig.getNotebookVersion=getNotebookVersion;let configData=null,Extension;function getBodyData(e){if("undefined"==typeof document||!document.body)return"";const t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}!function(e){function t(e){try{const t=getOption(e);if(t)return JSON.parse(t)}catch(t){console.warn(`Unable to parse ${e}.`,t)}return[]}e.deferred=t("deferredExtensions"),e.disabled=t("disabledExtensions"),e.isDeferred=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.deferred.some((e=>e===t||o&&e===o))},e.isDisabled=function(t){const n=t.indexOf(":");let o="";return-1!==n&&(o=t.slice(0,n)),e.disabled.some((e=>e===t||o&&e===o))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig||(exports.PageConfig=PageConfig={}))},12361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const o=n(67425);var r;!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=o.posix.join(...e);return"."===n?"":t(n)},e.joinWithLeadingSlash=function(...e){const t=o.posix.join(...e);return"."===t?"":t},e.basename=function(e,t){return o.posix.basename(e,t)},e.dirname=function(e){const n=t(o.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return o.posix.extname(e)},e.normalize=function(e){return""===e?"":t(o.posix.normalize(e))},e.resolve=function(...e){return t(o.posix.resolve(...e))},e.relative=function(e,n){return t(o.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(r||(t.PathExt=r={}))},82053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const o=n(21961);t.signalToPromise=function(e,t){const n=new o.PromiseDelegate;function r(){e.disconnect(i)}function i(e,t){r(),n.resolve([e,t])}return e.connect(i),(null!=t?t:0)>0&&setTimeout((()=>{r(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},84157:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){e.jsIndexToCharIndex=function(e,t){return e},e.charIndexToJsIndex=function(e,t){return e},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,o){return o?o.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(n||(t.Text=n={}))},59635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var o;!function(e){e.formatHuman=function(e,t="long"){const o=document.documentElement.lang||"en",r=new Intl.RelativeTimeFormat(o,{numeric:"auto",style:t}),i=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(i/e.milliseconds);if(0!==t)return r.format(t,e.name)}return r.format(0,"seconds")},e.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}}(o||(t.Time=o={}))},34410:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const r=n(67425),i=o(n(80899));var s;!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,i.default)(e)}function n(...e){let t=(0,i.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,i.default)(e[0],"https:"+e[0]));const o=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,s=r.posix.join(`${o&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${o}${"."===s?"":s}`}e.parse=t,e.getHostName=function(e){return(0,i.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,o]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(o||"")),e}),{})},e.isLocal=function(e,n=!1){const{protocol:o}=t(e);return(!o||0!==e.toLowerCase().indexOf(o))&&(n?0!==e.indexOf("//"):0!==e.indexOf("/"))}}(s||(t.URLExt=s={}))},66161:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,o){o||(o={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof o.unknown&&(r.unknownFn=o.unknown),"boolean"==typeof o.boolean&&o.boolean?r.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var i={};function s(e){return i[e].some((function(e){return r.bools[e]}))}Object.keys(o.alias||{}).forEach((function(e){i[e]=[].concat(o.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(o.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,i[e]&&[].concat(i[e]).forEach((function(e){r.strings[e]=!0}))}));var a=o.default||{},c={_:[]};function l(e,t,o){for(var i=e,s=0;s<t.length-1;s++){var a=t[s];if(n(i,a))return;void 0===i[a]&&(i[a]={}),i[a]!==Object.prototype&&i[a]!==Number.prototype&&i[a]!==String.prototype||(i[a]={}),i[a]===Array.prototype&&(i[a]=[]),i=i[a]}var c=t[t.length-1];n(i,c)||(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[c]||r.bools[c]||"boolean"==typeof i[c]?i[c]=o:Array.isArray(i[c])?i[c].push(o):i[c]=[i[c],o])}function u(e,n,o){if(!o||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||i[e]}(e,o)||!1!==r.unknownFn(o)){var s=!r.strings[e]&&t(n)?Number(n):n;l(c,e.split("."),s),(i[e]||[]).forEach((function(e){l(c,e.split("."),s)}))}}Object.keys(r.bools).forEach((function(e){u(e,void 0!==a[e]&&a[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var p=0;p<e.length;p++){var h,d,g=e[p];if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);h=m[1];var _=m[2];r.bools[h]&&(_="false"!==_),u(h,_,g)}else if(/^--no-.+/.test(g))u(h=g.match(/^--no-(.+)/)[1],!1,g);else if(/^--.+/.test(g))h=g.match(/^--(.+)/)[1],void 0===(d=e[p+1])||/^(-|--)[^-]/.test(d)||r.bools[h]||r.allBools||i[h]&&s(h)?/^(true|false)$/.test(d)?(u(h,"true"===d,g),p+=1):u(h,!r.strings[h]||"",g):(u(h,d,g),p+=1);else if(/^-[^-]+/.test(g)){for(var v=g.slice(1,-1).split(""),y=!1,b=0;b<v.length;b++)if("-"!==(d=g.slice(b+2))){if(/[A-Za-z]/.test(v[b])&&"="===d[0]){u(v[b],d.slice(1),g),y=!0;break}if(/[A-Za-z]/.test(v[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){u(v[b],d,g),y=!0;break}if(v[b+1]&&v[b+1].match(/\W/)){u(v[b],g.slice(b+2),g),y=!0;break}u(v[b],!r.strings[v[b]]||"",g)}else u(v[b],d,g);h=g.slice(-1)[0],y||"-"===h||(!e[p+1]||/^(-|--)[^-]/.test(e[p+1])||r.bools[h]||i[h]&&s(h)?e[p+1]&&/^(true|false)$/.test(e[p+1])?(u(h,"true"===e[p+1],g),p+=1):u(h,!r.strings[h]||"",g):(u(h,e[p+1],g),p+=1))}else if(r.unknownFn&&!1===r.unknownFn(g)||c._.push(r.strings._||!t(g)?g:Number(g)),o.stopEarly){c._.push.apply(c._,e.slice(p+1));break}}return Object.keys(a).forEach((function(e){var t,n,o;t=c,n=e.split("."),o=t,n.slice(0,-1).forEach((function(e){o=o[e]||{}})),n[n.length-1]in o||(l(c,e.split("."),a[e]),(i[e]||[]).forEach((function(t){l(c,t.split("."),a[e])})))})),o["--"]?c["--"]=f.slice():f.forEach((function(e){c._.push(e)})),c}},67425:(e,t,n)=>{"use strict";var o=n(27061);function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,o="",r=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(o.length<2||2!==r||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var c=o.lastIndexOf("/");if(c!==o.length-1){-1===c?(o="",r=0):r=(o=o.slice(0,c)).length-1-o.lastIndexOf("/"),i=a,s=0;continue}}else if(2===o.length||1===o.length){o="",r=0,i=a,s=0;continue}t&&(o.length>0?o+="/..":o="..",r=2)}else o.length>0?o+="/"+e.slice(i+1,a):o=e.slice(i+1,a),r=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return o}var s={resolve:function(){for(var e,t="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=o.cwd()),a=e),r(a),0!==a.length&&(t=a+"/"+t,n=47===a.charCodeAt(0))}return t=i(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var o=e.length,i=o-n,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var c=t.length-a,l=i<c?i:c,u=-1,f=0;f<=l;++f){if(f===l){if(c>l){if(47===t.charCodeAt(a+f))return t.slice(a+f+1);if(0===f)return t.slice(a+f)}else i>l&&(47===e.charCodeAt(n+f)?u=f:0===f&&(u=0));break}var p=e.charCodeAt(n+f);if(p!==t.charCodeAt(a+f))break;47===p&&(u=f)}var h="";for(f=n+u+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(a+u):(a+=u,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,i=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!s){o=n+1;break}}else-1===c&&(s=!1,c=n+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(i=n):(a=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===o&&(i=!1,o=a+1),46===c?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){n=a+1;break}}return-1===t||-1===o||0===s||1===s&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,o=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+o:n+"/"+o:o}(0,e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),i=47===o;i?(t.root="/",n=1):n=0;for(var s=-1,a=0,c=-1,l=!0,u=e.length-1,f=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!l){a=u+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=0===a&&i?e.slice(1,c):e.slice(a,c)):(0===a&&i?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c)),t.ext=e.slice(s,c)),a>0?t.dir=e.slice(0,a-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s},27061:e=>{var t,n,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,c=[],l=!1,u=-1;function f(){l&&a&&(l=!1,a.length?c=a.concat(c):u=-1,c.length&&p())}function p(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(a=c,c=[];++u<t;)a&&a[u].run();u=-1,t=c.length}a=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function d(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=d,o.addListener=d,o.once=d,o.off=d,o.removeListener=d,o.removeAllListeners=d,o.emit=d,o.prependListener=d,o.prependOnceListener=d,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},88157:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function r(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=r(i),o=r(o),null===i||null===o)continue;s.push(i+"="+o)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var i=o(t[1]),s=o(t[2]);null===i||null===s||i in r||(r[i]=s)}return r}},53096:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},80899:(e,t,n)=>{"use strict";var o=n(53096),r=n(88157),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var p=[["#","hash"],["?","query"],function(e,t){return g(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(e){var t,o=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},r={},i=typeof(e=e||o);if("blob:"===e.protocol)r=new _(unescape(e.pathname),{});else if("string"===i)for(t in r=new _(e,{}),h)delete r[t];else if("object"===i){for(t in e)t in h||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=a.test(e.href))}return r}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function m(e,t){e=(e=f(e)).replace(s,""),t=t||{};var n,o=l.exec(e),r=o[1]?o[1].toLowerCase():"",i=!!o[2],a=!!o[3],c=0;return i?a?(n=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(n=o[2]+o[4],c=o[2].length):a?(n=o[3]+o[4],c=o[3].length):n=o[4],"file:"===r?c>=2&&(n=n.slice(2)):g(r)?n=o[4]:r?i&&(n=n.slice(2)):c>=2&&g(t.protocol)&&(n=o[4]),{protocol:r,slashes:i||g(r),slashesCount:c,rest:n}}function _(e,t,n){if(e=(e=f(e)).replace(s,""),!(this instanceof _))return new _(e,t,n);var i,a,c,l,h,v,y=p.slice(),b=typeof t,w=this,C=0;for("object"!==b&&"string"!==b&&(n=t,t=null),n&&"function"!=typeof n&&(n=r.parse),i=!(a=m(e||"",t=d(t))).protocol&&!a.slashes,w.slashes=a.slashes||i&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(y[3]=[/(.*)/,"pathname"]);C<y.length;C++)"function"!=typeof(l=y[C])?(c=l[0],v=l[1],c!=c?w[v]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof l[2]?(w[v]=e.slice(0,h),e=e.slice(h+l[2])):(w[v]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[v]=h[1],e=e.slice(0,h.index)),w[v]=w[v]||i&&l[3]&&t[v]||"",l[4]&&(w[v]=w[v].toLowerCase())):e=l(e,w);n&&(w.query=n(w.query)),i&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=n.length,r=n[o-1],i=!1,s=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),s++):s&&(0===o&&(i=!0),n.splice(o,1),s--);return i&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&g(w.protocol)&&(w.pathname="/"+w.pathname),o(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&g(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}_.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||r.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,c.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<p.length;l++){var u=p[l];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&g(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=r.stringify);var t,n=this,o=n.host,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(n.protocol&&n.slashes||g(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&g(n.protocol)&&!o&&"/"!==n.pathname&&(s+="@"),(":"===o[o.length-1]||c.test(n.hostname)&&!n.port)&&(o+=":"),s+=o+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(s+=n.hash),s}},_.extractProtocol=m,_.location=d,_.trimLeft=f,_.qs=r,e.exports=_}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2924,9852],{22924:(t,e,o)=>{o.r(e),o.d(e,{FormWidget:()=>r,IMetadataFormProvider:()=>g,MetadataFormProvider:()=>v,MetadataFormWidget:()=>_});var a=o(72703),i=o(95291),s=o(27478),l=o.n(s),d=o(78156),n=o.n(d);class r extends a.ReactWidget{constructor(t){super(),this.addClass("jp-FormWidget"),this._props=t}render(){const t={defaultFormData:this._props.settings.default(),updateMetadata:this._props.metadataFormWidget.updateMetadata};return n().createElement(i.FormComponent,{validator:l(),schema:this._props.properties,formData:this._props.formData,formContext:t,uiSchema:this._props.uiSchema,liveValidate:!0,idPrefix:`jp-MetadataForm-${this._props.pluginId}`,onChange:t=>{this._props.metadataFormWidget.updateMetadata(t.formData||{})},compact:!0,showModifiedFromDefault:this._props.showModified,translator:this._props.translator})}}var h,m=o(38855),p=o(89150),c=o(70858),u=o(20998),f=o(63485);class _ extends m.NotebookTools.Tool{constructor(t){super(),this.updateMetadata=(t,e)=>{var o,a,i,s,l,d,n,r;if(null==this.notebookTools)return;const m=this.notebookTools.activeNotebookPanel,p=this.notebookTools.activeCell;if(null==p)return;this._updatingMetadata=!0;const c={},u={};for(let[e,f]of Object.entries(t)){if(!this.metadataKeys.includes(e))continue;if("notebook"===(null===(o=this._metaInformation[e])||void 0===o?void 0:o.level)&&this._notebookModelNull)continue;if((null===(a=this._metaInformation[e])||void 0===a?void 0:a.cellTypes)&&!(null===(s=null===(i=this._metaInformation[e])||void 0===i?void 0:i.cellTypes)||void 0===s?void 0:s.includes(p.model.type)))continue;let t,_;"notebook"===(null===(l=this._metaInformation[e])||void 0===l?void 0:l.level)?(t=m.model.metadata,_=u):(t=p.model.metadata,_=c);let v=e.replace(/^\/+/,"").replace(/\/+$/,"").split("/"),g=v[0];if(null==g)continue;let b=void 0!==f&&(null===(n=null===(d=this._metaInformation[e])||void 0===d?void 0:d.writeDefault)||void 0===n||n||f!==(null===(r=this._metaInformation[e])||void 0===r?void 0:r.default));if(1==v.length){_[g]=b?f:void 0;continue}let M=v.slice(1,-1),k=v[v.length-1];g in _||(_[g]=t[g]),void 0===_[g]&&(_[g]={});let C=_[g],w=!0;for(let t of M){if(!(t in C)){if(!b){w=!1;break}C[t]={}}C=C[t]}w&&(b?C[k]=f:delete C[k]),b||(_[g]=h.deleteEmptyNested(_[g],v.slice(1)),Object.keys(_[g]).length||(_[g]=void 0))}for(let[t,e]of Object.entries(c))void 0===e?p.model.deleteMetadata(t):p.model.setMetadata(t,e);if(!this._notebookModelNull)for(let[t,e]of Object.entries(u))void 0===e?m.model.deleteMetadata(t):m.model.setMetadata(t,e);this._updatingMetadata=!1,e&&this._update()},this._notebookModelNull=!1,this._metadataSchema=t.metadataSchema,this._metaInformation=t.metaInformation,this._uiSchema=t.uiSchema||{},this._pluginId=t.pluginId,this._showModified=t.showModified||!1,this.translator=t.translator||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._updatingMetadata=!1;const e=this.layout=new f.SingletonLayout,o=document.createElement("div"),a=document.createElement("div");a.textContent=this._trans.__("No metadata."),a.className="jp-MetadataForm-placeholderContent",o.appendChild(a),this._placeholder=new f.Widget({node:o}),this._placeholder.addClass("jp-MetadataForm-placeholder"),e.widget=this._placeholder}get form(){return this._form}get metadataKeys(){var t;const e=[];for(let t of Object.keys(this._metadataSchema.properties))e.push(t);return null===(t=this._metadataSchema.allOf)||void 0===t||t.forEach((t=>{if(void 0!==t.then&&void 0!==t.then.properties){let o=t.then.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}if(void 0!==t.else&&void 0!==t.else.properties){let o=t.else.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}})),e}getProperties(t){return u.JSONExt.deepCopy(this._metadataSchema.properties[t])||null}setProperties(t,e){Object.entries(e).forEach((([e,o])=>{this._metadataSchema.properties[t][e]=o}))}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-MetadataForm-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-MetadataForm-content"),e.widget=t}buildWidget(t){this._form=new r(t),this._form.addClass("jp-MetadataForm"),this.setContent(this._form)}onAfterShow(t){this._update()}onActiveCellChanged(t){this.isVisible&&this._update()}onActiveCellMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelChanged(t){const e=this.notebookTools.activeNotebookPanel;this._notebookModelNull=null===e||null===e.model,!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}_update(){var t,e,o,a,i;const s=this.notebookTools.activeNotebookPanel,l=this.notebookTools.activeCell;if(null==l)return;const d=u.JSONExt.deepCopy(this._metadataSchema),n={};for(let r of Object.keys(this._metadataSchema.properties||u.JSONExt.emptyObject)){if("notebook"===(null===(t=this._metaInformation[r])||void 0===t?void 0:t.level)&&this._notebookModelNull){delete d.properties[r];continue}if((null===(e=this._metaInformation[r])||void 0===e?void 0:e.cellTypes)&&!(null===(a=null===(o=this._metaInformation[r])||void 0===o?void 0:o.cellTypes)||void 0===a?void 0:a.includes(l.model.type))){delete d.properties[r];continue}let h,m=r.replace(/^\/+/,"").replace(/\/+$/,"").split("/");h="notebook"===(null===(i=this._metaInformation[r])||void 0===i?void 0:i.level)?s.model.metadata:l.model.metadata;let p=!0;for(let t of m){if(!(t in h)){p=!1;break}h=h[t]}p&&(n[r]=h)}this.buildWidget({properties:d,settings:new p.BaseSettings({schema:this._metadataSchema}),uiSchema:this._uiSchema,translator:this.translator||null,formData:n,metadataFormWidget:this,showModified:this._showModified,pluginId:this._pluginId})}}!function(t){t.deleteEmptyNested=function t(e,o){let a=o.shift();return void 0!==a&&a in e&&(Object.keys(e[a]).length&&(e[a]=t(e[a],o)),Object.keys(e[a]).length||delete e[a]),e}}(h||(h={}));class v{constructor(){this._items={}}add(t,e){this._items[t]?console.warn(`A MetadataformWidget is already registered with id ${t}`):this._items[t]=e}get(t){if(this._items[t])return this._items[t];console.warn(`There is no MetadataformWidget registered with id ${t}`)}}const g=new u.Token("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2924,9852],{22924:(t,e,o)=>{o.r(e),o.d(e,{FormWidget:()=>r,IMetadataFormProvider:()=>g,MetadataFormProvider:()=>v,MetadataFormWidget:()=>_});var a=o(53876),i=o(76878),s=o(27478),l=o.n(s),d=o(78156),n=o.n(d);class r extends a.ReactWidget{constructor(t){super(),this.addClass("jp-FormWidget"),this._props=t}render(){const t={defaultFormData:this._props.settings.default(),updateMetadata:this._props.metadataFormWidget.updateMetadata};return n().createElement(i.FormComponent,{validator:l(),schema:this._props.properties,formData:this._props.formData,formContext:t,uiSchema:this._props.uiSchema,liveValidate:!0,idPrefix:`jp-MetadataForm-${this._props.pluginId}`,onChange:t=>{this._props.metadataFormWidget.updateMetadata(t.formData||{})},compact:!0,showModifiedFromDefault:this._props.showModified,translator:this._props.translator})}}var h,m=o(33729),p=o(3012),c=o(93050),u=o(21961),f=o(2260);class _ extends m.NotebookTools.Tool{constructor(t){super(),this.updateMetadata=(t,e)=>{var o,a,i,s,l,d,n,r;if(null==this.notebookTools)return;const m=this.notebookTools.activeNotebookPanel,p=this.notebookTools.activeCell;if(null==p)return;this._updatingMetadata=!0;const c={},u={};for(let[e,f]of Object.entries(t)){if(!this.metadataKeys.includes(e))continue;if("notebook"===(null===(o=this._metaInformation[e])||void 0===o?void 0:o.level)&&this._notebookModelNull)continue;if((null===(a=this._metaInformation[e])||void 0===a?void 0:a.cellTypes)&&!(null===(s=null===(i=this._metaInformation[e])||void 0===i?void 0:i.cellTypes)||void 0===s?void 0:s.includes(p.model.type)))continue;let t,_;"notebook"===(null===(l=this._metaInformation[e])||void 0===l?void 0:l.level)?(t=m.model.metadata,_=u):(t=p.model.metadata,_=c);let v=e.replace(/^\/+/,"").replace(/\/+$/,"").split("/"),g=v[0];if(null==g)continue;let b=void 0!==f&&(null===(n=null===(d=this._metaInformation[e])||void 0===d?void 0:d.writeDefault)||void 0===n||n||f!==(null===(r=this._metaInformation[e])||void 0===r?void 0:r.default));if(1==v.length){_[g]=b?f:void 0;continue}let M=v.slice(1,-1),k=v[v.length-1];g in _||(_[g]=t[g]),void 0===_[g]&&(_[g]={});let C=_[g],w=!0;for(let t of M){if(!(t in C)){if(!b){w=!1;break}C[t]={}}C=C[t]}w&&(b?C[k]=f:delete C[k]),b||(_[g]=h.deleteEmptyNested(_[g],v.slice(1)),Object.keys(_[g]).length||(_[g]=void 0))}for(let[t,e]of Object.entries(c))void 0===e?p.model.deleteMetadata(t):p.model.setMetadata(t,e);if(!this._notebookModelNull)for(let[t,e]of Object.entries(u))void 0===e?m.model.deleteMetadata(t):m.model.setMetadata(t,e);this._updatingMetadata=!1,e&&this._update()},this._notebookModelNull=!1,this._metadataSchema=t.metadataSchema,this._metaInformation=t.metaInformation,this._uiSchema=t.uiSchema||{},this._pluginId=t.pluginId,this._showModified=t.showModified||!1,this.translator=t.translator||c.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._updatingMetadata=!1;const e=this.layout=new f.SingletonLayout,o=document.createElement("div"),a=document.createElement("div");a.textContent=this._trans.__("No metadata."),a.className="jp-MetadataForm-placeholderContent",o.appendChild(a),this._placeholder=new f.Widget({node:o}),this._placeholder.addClass("jp-MetadataForm-placeholder"),e.widget=this._placeholder}get form(){return this._form}get metadataKeys(){var t;const e=[];for(let t of Object.keys(this._metadataSchema.properties))e.push(t);return null===(t=this._metadataSchema.allOf)||void 0===t||t.forEach((t=>{if(void 0!==t.then&&void 0!==t.then.properties){let o=t.then.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}if(void 0!==t.else&&void 0!==t.else.properties){let o=t.else.properties;for(let t of Object.keys(o))e.includes(t)||e.push(t)}})),e}getProperties(t){return u.JSONExt.deepCopy(this._metadataSchema.properties[t])||null}setProperties(t,e){Object.entries(e).forEach((([e,o])=>{this._metadataSchema.properties[t][e]=o}))}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-MetadataForm-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-MetadataForm-content"),e.widget=t}buildWidget(t){this._form=new r(t),this._form.addClass("jp-MetadataForm"),this.setContent(this._form)}onAfterShow(t){this._update()}onActiveCellChanged(t){this.isVisible&&this._update()}onActiveCellMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelChanged(t){const e=this.notebookTools.activeNotebookPanel;this._notebookModelNull=null===e||null===e.model,!this._updatingMetadata&&this.isVisible&&this._update()}onActiveNotebookPanelMetadataChanged(t){!this._updatingMetadata&&this.isVisible&&this._update()}_update(){var t,e,o,a,i;const s=this.notebookTools.activeNotebookPanel,l=this.notebookTools.activeCell;if(null==l)return;const d=u.JSONExt.deepCopy(this._metadataSchema),n={};for(let r of Object.keys(this._metadataSchema.properties||u.JSONExt.emptyObject)){if("notebook"===(null===(t=this._metaInformation[r])||void 0===t?void 0:t.level)&&this._notebookModelNull){delete d.properties[r];continue}if((null===(e=this._metaInformation[r])||void 0===e?void 0:e.cellTypes)&&!(null===(a=null===(o=this._metaInformation[r])||void 0===o?void 0:o.cellTypes)||void 0===a?void 0:a.includes(l.model.type))){delete d.properties[r];continue}let h,m=r.replace(/^\/+/,"").replace(/\/+$/,"").split("/");h="notebook"===(null===(i=this._metaInformation[r])||void 0===i?void 0:i.level)?s.model.metadata:l.model.metadata;let p=!0;for(let t of m){if(!(t in h)){p=!1;break}h=h[t]}p&&(n[r]=h)}this.buildWidget({properties:d,settings:new p.BaseSettings({schema:this._metadataSchema}),uiSchema:this._uiSchema,translator:this.translator||null,formData:n,metadataFormWidget:this,showModified:this._showModified,pluginId:this._pluginId})}}!function(t){t.deleteEmptyNested=function t(e,o){let a=o.shift();return void 0!==a&&a in e&&(Object.keys(e[a]).length&&(e[a]=t(e[a],o)),Object.keys(e[a]).length||delete e[a]),e}}(h||(h={}));class v{constructor(){this._items={}}add(t,e){this._items[t]?console.warn(`A MetadataformWidget is already registered with id ${t}`):this._items[t]=e}get(t){if(this._items[t])return this._items[t];console.warn(`There is no MetadataformWidget registered with id ${t}`)}}const g=new u.Token("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets.")}}]);