notebook 7.3.0a1__py3-none-any.whl → 7.3.0b1__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 (239) hide show
  1. notebook/_version.py +1 -1
  2. notebook/app.py +10 -2
  3. notebook/static/1088.bundle.js +1 -1
  4. notebook/static/113.bundle.js +1 -1
  5. notebook/static/1198.bundle.js +1 -1
  6. notebook/static/131.bundle.js +1 -1
  7. notebook/static/1326.bundle.js +1 -1
  8. notebook/static/134.bundle.js +1 -1
  9. notebook/static/1408.bundle.js +1 -1
  10. notebook/static/1496.bundle.js +1 -1
  11. notebook/static/1584.bundle.js +1 -1
  12. notebook/static/1647.bundle.js +1 -1
  13. notebook/static/1650.bundle.js +1 -1
  14. notebook/static/1684.bundle.js +1 -1
  15. notebook/static/170.bundle.js +1 -1
  16. notebook/static/1809.bundle.js +1 -1
  17. notebook/static/1827.bundle.js +1 -1
  18. notebook/static/1828.bundle.js +1 -1
  19. notebook/static/1833.bundle.js +1 -1
  20. notebook/static/1958.bundle.js +1 -1
  21. notebook/static/1962.bundle.js +1 -1
  22. notebook/static/2007.bundle.js +1 -1
  23. notebook/static/2065.bundle.js +1 -1
  24. notebook/static/2088.bundle.js +1 -1
  25. notebook/static/2089.bundle.js +1 -1
  26. notebook/static/2122.bundle.js +1 -1
  27. notebook/static/2167.bundle.js +1 -1
  28. notebook/static/2184.bundle.js +1 -1
  29. notebook/static/2311.bundle.js +1 -1
  30. notebook/static/{3030.bundle.js → 2323.bundle.js} +1 -1
  31. notebook/static/2401.bundle.js +1 -1
  32. notebook/static/2424.bundle.js +377 -0
  33. notebook/static/2479.bundle.js +1 -1
  34. notebook/static/2489.bundle.js +1 -1
  35. notebook/static/2607.bundle.js +1 -1
  36. notebook/static/2615.bundle.js +1 -1
  37. notebook/static/2636.bundle.js +1 -1
  38. notebook/static/2756.bundle.js +1 -1
  39. notebook/static/2813.bundle.js +1 -1
  40. notebook/static/2866.bundle.js +1 -1
  41. notebook/static/2924.bundle.js +1 -1
  42. notebook/static/2944.bundle.js +1 -1
  43. notebook/static/2955.bundle.js +1 -0
  44. notebook/static/3129.bundle.js +1 -1
  45. notebook/static/3146.bundle.js +1 -1
  46. notebook/static/3187.bundle.js +1 -1
  47. notebook/static/3213.bundle.js +1 -1
  48. notebook/static/3301.bundle.js +1 -1
  49. notebook/static/3325.bundle.js +1 -1
  50. notebook/static/3340.bundle.js +1 -1
  51. notebook/static/3360.bundle.js +1 -1
  52. notebook/static/3466.bundle.js +1 -1
  53. notebook/static/35.bundle.js +1 -1
  54. notebook/static/3512.bundle.js +1 -1
  55. notebook/static/3676.bundle.js +1 -1
  56. notebook/static/3680.bundle.js +1 -1
  57. notebook/static/374.bundle.js +1 -1
  58. notebook/static/3768.bundle.js +1 -1
  59. notebook/static/377.bundle.js +1 -1
  60. notebook/static/3863.bundle.js +1 -1
  61. notebook/static/3881.bundle.js +1 -1
  62. notebook/static/4042.bundle.js +1 -1
  63. notebook/static/4058.bundle.js +1 -1
  64. notebook/static/409.bundle.js +1 -1
  65. notebook/static/4212.bundle.js +1 -1
  66. notebook/static/4242.bundle.js +79 -0
  67. notebook/static/4271.bundle.js +1 -1
  68. notebook/static/4291.bundle.js +1 -1
  69. notebook/static/4382.bundle.js +1 -1
  70. notebook/static/4499.bundle.js +1 -1
  71. notebook/static/4526.bundle.js +1 -1
  72. notebook/static/4588.bundle.js +1 -1
  73. notebook/static/4630.bundle.js +1 -1
  74. notebook/static/4645.bundle.js +1 -1
  75. notebook/static/4811.bundle.js +1 -1
  76. notebook/static/4837.bundle.js +1 -1
  77. notebook/static/5099.bundle.js +1 -1
  78. notebook/static/5135.bundle.js +1 -1
  79. notebook/static/5166.bundle.js +1 -1
  80. notebook/static/5234.bundle.js +1 -1
  81. notebook/static/5254.bundle.js +1 -1
  82. notebook/static/5261.bundle.js +1 -1
  83. notebook/static/5263.bundle.js +1 -0
  84. notebook/static/5313.bundle.js +1 -1
  85. notebook/static/5325.bundle.js +1 -1
  86. notebook/static/5346.bundle.js +1 -1
  87. notebook/static/5426.bundle.js +1 -1
  88. notebook/static/5430.bundle.js +653 -0
  89. notebook/static/545.bundle.js +1 -1
  90. notebook/static/5451.bundle.js +1 -1
  91. notebook/static/5573.bundle.js +1 -1
  92. notebook/static/5601.bundle.js +1 -1
  93. notebook/static/5649.bundle.js +2 -2
  94. notebook/static/5733.bundle.js +1 -1
  95. notebook/static/5850.bundle.js +1 -1
  96. notebook/static/5912.bundle.js +1 -1
  97. notebook/static/5952.bundle.js +1 -0
  98. notebook/static/6017.bundle.js +1 -1
  99. notebook/static/6061.bundle.js +1 -1
  100. notebook/static/6139.bundle.js +1 -1
  101. notebook/static/62.bundle.js +1 -1
  102. notebook/static/6271.bundle.js +1 -1
  103. notebook/static/6345.bundle.js +1 -1
  104. notebook/static/6604.bundle.js +1 -1
  105. notebook/static/6621.bundle.js +1 -1
  106. notebook/static/6627.bundle.js +1 -1
  107. notebook/static/6648.bundle.js +1 -0
  108. notebook/static/6731.bundle.js +1 -1
  109. notebook/static/6748.bundle.js +1 -1
  110. notebook/static/677.bundle.js +1 -1
  111. notebook/static/6815.bundle.js +1 -1
  112. notebook/static/6853.bundle.js +1 -1
  113. notebook/static/6893.bundle.js +1 -1
  114. notebook/static/690.bundle.js +1 -1
  115. notebook/static/6962.bundle.js +1 -1
  116. notebook/static/6999.bundle.js +1 -1
  117. notebook/static/7226.bundle.js +1 -1
  118. notebook/static/7252.bundle.js +1 -1
  119. notebook/static/7302.bundle.js +1 -1
  120. notebook/static/7369.bundle.js +1 -1
  121. notebook/static/7386.bundle.js +1 -1
  122. notebook/static/7391.bundle.js +1 -1
  123. notebook/static/7543.bundle.js +1 -1
  124. notebook/static/755.bundle.js +1 -1
  125. notebook/static/7603.bundle.js +1 -1
  126. notebook/static/7639.bundle.js +1 -1
  127. notebook/static/7655.bundle.js +1 -1
  128. notebook/static/7684.bundle.js +1 -1
  129. notebook/static/7811.bundle.js +1 -1
  130. notebook/static/7812.bundle.js +1 -1
  131. notebook/static/7819.bundle.js +1 -1
  132. notebook/static/7821.bundle.js +1 -1
  133. notebook/static/7854.bundle.js +1 -1
  134. notebook/static/7866.bundle.js +1 -0
  135. notebook/static/7900.bundle.js +1 -1
  136. notebook/static/7906.bundle.js +1 -1
  137. notebook/static/8010.bundle.js +1 -1
  138. notebook/static/8032.bundle.js +1 -1
  139. notebook/static/8285.bundle.js +1 -1
  140. notebook/static/8471.bundle.js +1 -1
  141. notebook/static/8579.bundle.js +1 -1
  142. notebook/static/8633.bundle.js +1 -1
  143. notebook/static/8635.bundle.js +41 -0
  144. notebook/static/8771.bundle.js +1 -1
  145. notebook/static/8781.bundle.js +1 -1
  146. notebook/static/8875.bundle.js +1 -1
  147. notebook/static/8907.bundle.js +1 -1
  148. notebook/static/8928.bundle.js +1 -1
  149. notebook/static/8929.bundle.js +1 -1
  150. notebook/static/893.bundle.js +1 -1
  151. notebook/static/901.bundle.js +1 -1
  152. notebook/static/9068.bundle.js +1 -1
  153. notebook/static/9136.bundle.js +1 -1
  154. notebook/static/9151.bundle.js +1 -1
  155. notebook/static/9161.bundle.js +1 -1
  156. notebook/static/9268.bundle.js +1 -1
  157. notebook/static/9335.bundle.js +1 -1
  158. notebook/static/9341.bundle.js +1 -1
  159. notebook/static/9357.bundle.js +1 -0
  160. notebook/static/9380.bundle.js +1 -1
  161. notebook/static/9605.bundle.js +1 -1
  162. notebook/static/9638.bundle.js +1 -1
  163. notebook/static/9672.bundle.js +352 -0
  164. notebook/static/9680.bundle.js +1 -1
  165. notebook/static/9685.bundle.js +1 -1
  166. notebook/static/9752.bundle.js +1 -1
  167. notebook/static/9799.bundle.js +1 -0
  168. notebook/static/9821.bundle.js +1 -1
  169. notebook/static/9852.bundle.js +1 -1
  170. notebook/static/bundle.js +1 -1
  171. notebook/static/third-party-licenses.json +124 -130
  172. notebook/templates/consoles.html +1 -1
  173. notebook/templates/edit.html +1 -1
  174. notebook/templates/error.html +1 -1
  175. notebook/templates/notebooks.html +1 -1
  176. notebook/templates/terminals.html +1 -1
  177. notebook/templates/tree.html +1 -1
  178. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +17 -17
  179. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
  180. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  181. notebook-7.3.0b1.data/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/full-width-notebook.json +27 -0
  182. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +11 -11
  183. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +18 -18
  184. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +6 -1
  185. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +13 -13
  186. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +12 -12
  187. notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/466.16ad54314911066edf9c.js +1 -0
  188. notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.963a302c93b1c86218b2.js +1 -0
  189. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.b94c92715d631efb4a8f.js → notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.2635b6a9fd871a610e32.js +1 -1
  190. notebook-7.3.0b1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.c690bcb5ab5c38794e5d.js +1 -0
  191. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  192. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/METADATA +2 -2
  193. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/RECORD +216 -223
  194. notebook/static/1226.bundle.js +0 -1
  195. notebook/static/1750.bundle.js +0 -1
  196. notebook/static/1884.bundle.js +0 -386
  197. notebook/static/4045.bundle.js +0 -1
  198. notebook/static/4434.bundle.js +0 -1
  199. notebook/static/5018.bundle.js +0 -1
  200. notebook/static/5712.bundle.js +0 -1
  201. notebook/static/5921.bundle.js +0 -1
  202. notebook/static/6164.bundle.js +0 -1
  203. notebook/static/6318.bundle.js +0 -1
  204. notebook/static/6619.bundle.js +0 -1
  205. notebook/static/6898.bundle.js +0 -1
  206. notebook/static/7506.bundle.js +0 -703
  207. notebook/static/7579.bundle.js +0 -1
  208. notebook/static/8054.bundle.js +0 -1
  209. notebook/static/8647.bundle.js +0 -1
  210. notebook/static/8723.bundle.js +0 -1
  211. notebook/static/911.bundle.js +0 -1
  212. notebook/static/9734.bundle.js +0 -1
  213. notebook/static/9906.bundle.js +0 -1
  214. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.45e1d3167710e94c3d26.js +0 -1
  215. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/600.25341cef1598f2727482.js +0 -1
  216. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.8ca922abea871b34db72.js +0 -1
  217. /notebook/static/{7506.bundle.js.LICENSE.txt → 4242.bundle.js.LICENSE.txt} +0 -0
  218. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  219. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  220. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  221. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  222. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  223. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  224. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  225. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  226. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  227. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  228. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  229. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  230. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  231. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  232. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  233. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  234. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  235. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  236. {notebook-7.3.0a1.data → notebook-7.3.0b1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  237. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/WHEEL +0 -0
  238. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/entry_points.txt +0 -0
  239. {notebook-7.3.0a1.dist-info → notebook-7.3.0b1.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[9341],{39341:(e,t,s)=>{s.r(t),s.d(t,{BreadCrumbs:()=>y,CHUNK_SIZE:()=>ee,DirListing:()=>$,FileBrowser:()=>G,FileBrowserModel:()=>te,FileDialog:()=>re,FileUploadStatus:()=>fe,FilterFileBrowserModel:()=>ie,IDefaultFileBrowser:()=>le,IFileBrowserCommands:()=>de,IFileBrowserFactory:()=>ae,LARGE_FILE_SIZE:()=>Q,TogglableHiddenFileBrowserModel:()=>se,Uploader:()=>he});var i=s(15465),r=s(44548),n=s(60211),o=s(25291),a=s(12668),l=s(63485),d=s(94624),h=s(33625),c=s(20998),m=s(18395);const u="jp-BreadCrumbs-home",p="jp-BreadCrumbs-preferred",_="jp-BreadCrumbs-item",f=["/","../../","../",""],g="application/x-jupyter-icontents",v="jp-mod-dropTarget";class y extends l.Widget{constructor(e){super(),this._previousState=null,this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._model=e.model,this._fullPath=e.fullPath||!1,this.addClass("jp-BreadCrumbs"),this._crumbs=w.createCrumbs(),this._crumbSeps=w.createCrumbSeparators();const t=r.PageConfig.getOption("preferredPath");this._hasPreferred=!(!t||"/"===t),this._hasPreferred&&this.node.appendChild(this._crumbs[w.Crumb.Preferred]),this.node.appendChild(this._crumbs[w.Crumb.Home]),this._model.refreshed.connect(this.update,this)}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;default:return}}get fullPath(){return this._fullPath}set fullPath(e){this._fullPath=e}onAfterAttach(e){super.onAfterAttach(e),this.update();const t=this.node;t.addEventListener("click",this),t.addEventListener("lm-dragenter",this),t.addEventListener("lm-dragleave",this),t.addEventListener("lm-dragover",this),t.addEventListener("lm-drop",this)}onBeforeDetach(e){super.onBeforeDetach(e);const t=this.node;t.removeEventListener("click",this),t.removeEventListener("lm-dragenter",this),t.removeEventListener("lm-dragleave",this),t.removeEventListener("lm-dragover",this),t.removeEventListener("lm-drop",this)}onUpdateRequest(e){const t={path:this._model.manager.services.contents.localPath(this._model.path),hasPreferred:this._hasPreferred,fullPath:this._fullPath};this._previousState&&c.JSONExt.deepEqual(t,this._previousState)||(this._previousState=t,w.updateCrumbs(this._crumbs,this._crumbSeps,t))}_evtClick(e){if(0!==e.button)return;let t=e.target;for(;t&&t!==this.node;){if(t.classList.contains(p))return this._model.cd(r.PageConfig.getOption("preferredPath")).catch((e=>(0,i.showErrorMessage)(this._trans.__("Open Error"),e))),e.preventDefault(),void e.stopPropagation();if(t.classList.contains(_)||t.classList.contains(u)){let s=h.ArrayExt.findFirstIndex(this._crumbs,(e=>e===t)),r=f[s];return this._fullPath&&s<0&&!t.classList.contains(u)&&(r=t.title),this._model.cd(r).catch((e=>(0,i.showErrorMessage)(this._trans.__("Open Error"),e))),e.preventDefault(),void e.stopPropagation()}t=t.parentElement}}_evtDragEnter(e){if(e.mimeData.hasData(g)){const t=h.ArrayExt.findFirstIndex(this._crumbs,(t=>m.ElementExt.hitTest(t,e.clientX,e.clientY)));-1!==t&&t!==w.Crumb.Current&&(this._crumbs[t].classList.add(v),e.preventDefault(),e.stopPropagation())}}_evtDragLeave(e){e.preventDefault(),e.stopPropagation();const t=i.DOMUtils.findElement(this.node,v);t&&t.classList.remove(v)}_evtDragOver(e){e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction;const t=i.DOMUtils.findElement(this.node,v);t&&t.classList.remove(v);const s=h.ArrayExt.findFirstIndex(this._crumbs,(t=>m.ElementExt.hitTest(t,e.clientX,e.clientY)));-1!==s&&this._crumbs[s].classList.add(v)}_evtDrop(e){if(e.preventDefault(),e.stopPropagation(),"none"===e.proposedAction)return void(e.dropAction="none");if(!e.mimeData.hasData(g))return;e.dropAction=e.proposedAction;let t=e.target;for(;t&&t.parentElement;){if(t.classList.contains(v)){t.classList.remove(v);break}t=t.parentElement}const s=h.ArrayExt.findFirstIndex(this._crumbs,(e=>e===t));if(-1===s)return;const n=this._model,o=r.PathExt.resolve(n.path,f[s]),a=n.manager,l=[],c=e.mimeData.getData(g);for(const e of c){const t=a.services.contents.localPath(e),s=r.PathExt.basename(t),i=r.PathExt.join(o,s);l.push((0,d.renameFile)(a,e,i))}Promise.all(l).catch((e=>(0,i.showErrorMessage)(this._trans.__("Move Error"),e)))}}var w;!function(e){let t;!function(e){e[e.Home=0]="Home",e[e.Ellipsis=1]="Ellipsis",e[e.Parent=2]="Parent",e[e.Current=3]="Current",e[e.Preferred=4]="Preferred"}(t=e.Crumb||(e.Crumb={})),e.updateCrumbs=function(e,s,i){const r=e[0].parentNode,n=r.firstChild;for(;n&&n.nextSibling;)r.removeChild(n.nextSibling);i.hasPreferred?(r.appendChild(e[t.Home]),r.appendChild(s[0])):r.appendChild(s[0]);const o=i.path.split("/");if(!i.fullPath&&o.length>2){r.appendChild(e[t.Ellipsis]);const i=o.slice(0,o.length-2).join("/");e[t.Ellipsis].title=i,r.appendChild(s[1])}if(i.path)if(i.fullPath)for(let e=0;e<o.length;e++){const t=document.createElement("span");t.className=_,t.textContent=o[e];const s=`/${o.slice(0,e+1).join("/")}`;t.title=s,r.appendChild(t);const i=document.createElement("span");i.textContent="/",r.appendChild(i)}else{if(o.length>=2){e[t.Parent].textContent=o[o.length-2],r.appendChild(e[t.Parent]);const i=o.slice(0,o.length-1).join("/");e[t.Parent].title=i,r.appendChild(s[2])}e[t.Current].textContent=o[o.length-1],r.appendChild(e[t.Current]),e[t.Current].title=i.path,r.appendChild(s[3])}},e.createCrumbs=function(){const e=a.folderIcon.element({className:u,tag:"span",title:r.PageConfig.getOption("serverRoot")||"Jupyter Server Root",stylesheet:"breadCrumb"}),t=a.ellipsesIcon.element({className:_,tag:"span",stylesheet:"breadCrumb"}),s=document.createElement("span");s.className=_;const i=document.createElement("span");return i.className=_,[e,t,s,i,a.homeIcon.element({className:p,tag:"span",title:r.PageConfig.getOption("preferredPath")||"Jupyter Preferred Path",stylesheet:"breadCrumb"})]},e.createCrumbSeparators=function(){const e=[];for(let t=0;t<4;t++){const t=document.createElement("span");t.textContent="/",e.push(t)}return e}}(w||(w={}));var b=s(71120),C=s(99615),E=s(49503),D=s(81997),L=s(24475);const I="jp-DirListing-header",x="jp-DirListing-headerItem",k="jp-DirListing-headerItemText",P="jp-DirListing-headerItemIcon",N="jp-DirListing-content",F="jp-DirListing-itemText",M="jp-DirListing-itemIcon",S="jp-DirListing-itemModified",j="jp-DirListing-itemFileSize",T="jp-DirListing-checkboxWrapper",A="jp-id-name",O="jp-id-modified",B="jp-id-filesize",U="jp-LastModified-hidden",R="jp-FileSize-hidden",z="application/x-jupyter-icontents",V="jp-mod-dropTarget",K="jp-mod-selected",H="jp-mod-cut",W="jp-mod-multiSelected",Y="jp-mod-running",q="jp-mod-descending",X=!!navigator.platform.match(/Mac/i);class $ extends l.Widget{constructor(e){super({node:(e.renderer||$.defaultRenderer).createNode()}),this._items=[],this._sortedItems=[],this._sortState={direction:"ascending",key:"name"},this._onItemOpened=new D.Signal(this),this._drag=null,this._dragData=null,this._selectTimer=-1,this._isCut=!1,this._prevPath="",this._clipboard=[],this._softSelection="",this.selection=Object.create(null),this._searchPrefix="",this._searchPrefixTimer=-1,this._inRename=!1,this._isDirty=!1,this._hiddenColumns=new Set,this._sortNotebooksFirst=!1,this._focusIndex=0,this.addClass("jp-DirListing"),this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._model=e.model,this._model.fileChanged.connect(this._onFileChanged,this),this._model.refreshed.connect(this._onModelRefreshed,this),this._model.pathChanged.connect(this._onPathChanged,this),this._editNode=document.createElement("input"),this._editNode.className="jp-DirListing-editor",this._manager=this._model.manager,this._renderer=e.renderer||$.defaultRenderer,this._updateModifiedSize(this.node);const t=i.DOMUtils.findElement(this.node,I);this._hiddenColumns.add("file_size"),this._renderer.populateHeaderNode(t,this.translator,this._hiddenColumns),this._manager.activateRequested.connect(this._onActivateRequested,this)}dispose(){this._items.length=0,this._sortedItems.length=0,this._clipboard.length=0,super.dispose()}get model(){return this._model}get headerNode(){return i.DOMUtils.findElement(this.node,I)}get contentNode(){return i.DOMUtils.findElement(this.node,N)}get renderer(){return this._renderer}get sortState(){return this._sortState}get onItemOpened(){return this._onItemOpened}selectedItems(){const e=this._sortedItems;return(0,h.filter)(e,(e=>this.selection[e.path]))}sortedItems(){return this._sortedItems[Symbol.iterator]()}sort(e){this._sortedItems=J.sort(this.model.items(),e,this._sortNotebooksFirst),this._sortState=e,this.update()}rename(){return this._doRename()}cut(){this._isCut=!0,this._copy(),this.update()}copy(){this._copy()}paste(){if(!this._clipboard.length)return this._isCut=!1,Promise.resolve(void 0);const e=this._model.path,t=[];for(const s of this._clipboard)if(this._isCut){const i=this._manager.services.contents.localPath(s).split("/"),n=i[i.length-1],o=r.PathExt.join(e,n);t.push(this._model.manager.rename(s,o))}else t.push(this._model.manager.copy(s,e));for(const e of this._items)e.classList.remove(H);return this._clipboard.length=0,this._isCut=!1,this.removeClass("jp-mod-clipboard"),Promise.all(t).then((()=>{})).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Paste Error"),e)}))}async delete(){const e=this._sortedItems.filter((e=>this.selection[e.path]));if(!e.length)return;const t=1===e.length?this._trans.__("Are you sure you want to permanently delete: %1?",e[0].name):this._trans._n("Are you sure you want to permanently delete the %1 selected item?","Are you sure you want to permanently delete the %1 selected items?",e.length),s=await(0,i.showDialog)({title:this._trans.__("Delete"),body:t,buttons:[i.Dialog.cancelButton({label:this._trans.__("Cancel")}),i.Dialog.warnButton({label:this._trans.__("Delete")})],defaultButton:0});!this.isDisposed&&s.button.accept&&await this._delete(e.map((e=>e.path)));let r=this._focusIndex;const n=this._sortedItems.length-e.length-1;r>n&&(r=Math.max(0,n)),this._focusItem(r)}duplicate(){const e=this._model.path,t=[];for(const s of this.selectedItems())"directory"!==s.type&&t.push(this._model.manager.copy(s.path,e));return Promise.all(t).then((()=>{})).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Duplicate file"),e)}))}async download(){await Promise.all(Array.from(this.selectedItems()).filter((e=>"directory"!==e.type)).map((e=>this._model.download(e.path))))}shutdownKernels(){const e=this._model,t=this._sortedItems,s=t.map((e=>e.path)),r=Array.from(this._model.sessions()).filter((e=>{const i=h.ArrayExt.firstIndexOf(s,e.path);return this.selection[t[i].path]})).map((t=>e.manager.services.sessions.shutdown(t.id)));return Promise.all(r).then((()=>{})).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Shut down kernel"),e)}))}selectNext(e=!1){let t=-1;const s=Object.keys(this.selection),i=this._sortedItems;if(1===s.length||e){const e=s[s.length-1];t=h.ArrayExt.findFirstIndex(i,(t=>t.path===e)),t+=1,t===this._items.length&&(t=0)}else if(0===s.length)t=0;else{const e=s[s.length-1];t=h.ArrayExt.findFirstIndex(i,(t=>t.path===e))}-1!==t&&(this._selectItem(t,e),m.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[t]))}selectPrevious(e=!1){let t=-1;const s=Object.keys(this.selection),i=this._sortedItems;if(1===s.length||e){const e=s[0];t=h.ArrayExt.findFirstIndex(i,(t=>t.path===e)),t-=1,-1===t&&(t=this._items.length-1)}else if(0===s.length)t=this._items.length-1;else{const e=s[0];t=h.ArrayExt.findFirstIndex(i,(t=>t.path===e))}-1!==t&&(this._selectItem(t,e),m.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[t]))}selectByPrefix(){const e=this._searchPrefix.toLowerCase(),t=this._sortedItems,s=h.ArrayExt.findFirstIndex(t,(t=>t.name.toLowerCase().substr(0,e.length)===e));-1!==s&&(this._selectItem(s,!1),m.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[s]))}isSelected(e){const t=this._sortedItems;return 0!==Array.from((0,h.filter)(t,(t=>t.name===e&&this.selection[t.path]))).length}modelForClick(e){const t=this._sortedItems,s=J.hitTestNodes(this._items,e);if(-1!==s)return t[s]}clearSelectedItems(){this.selection=Object.create(null)}async selectItemByName(e,t=!1){return this._selectItemByName(e,t)}async _selectItemByName(e,t=!1,s=!1){if(!s&&this.isSelected(e))return;if(await this.model.refresh(),this.isDisposed)throw new Error("File browser is disposed.");const i=this._sortedItems,r=h.ArrayExt.findFirstIndex(i,(t=>t.name===e));if(-1===r)throw new Error("Item does not exist.");this._selectItem(r,!1,t),E.MessageLoop.sendMessage(this,l.Widget.Msg.UpdateRequest),m.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[r])}handleEvent(e){switch(e.type){case"mousedown":this._evtMousedown(e);break;case"mouseup":this._evtMouseup(e);break;case"mousemove":this._evtMousemove(e);break;case"keydown":this.evtKeydown(e);break;case"click":this._evtClick(e);break;case"dblclick":this.evtDblClick(e);break;case"dragenter":case"dragover":this.addClass("jp-mod-native-drop"),e.preventDefault();break;case"dragleave":case"dragend":this.removeClass("jp-mod-native-drop");break;case"drop":this.removeClass("jp-mod-native-drop"),this.evtNativeDrop(e);break;case"scroll":this._evtScroll(e);break;case"lm-dragenter":this.evtDragEnter(e);break;case"lm-dragleave":this.evtDragLeave(e);break;case"lm-dragover":this.evtDragOver(e);break;case"lm-drop":this.evtDrop(e)}}onAfterAttach(e){super.onAfterAttach(e);const t=this.node,s=i.DOMUtils.findElement(t,N);t.addEventListener("mousedown",this),t.addEventListener("keydown",this),t.addEventListener("click",this),t.addEventListener("dblclick",this),s.addEventListener("dragenter",this),s.addEventListener("dragover",this),s.addEventListener("dragleave",this),s.addEventListener("dragend",this),s.addEventListener("drop",this),s.addEventListener("scroll",this),s.addEventListener("lm-dragenter",this),s.addEventListener("lm-dragleave",this),s.addEventListener("lm-dragover",this),s.addEventListener("lm-drop",this)}onBeforeDetach(e){super.onBeforeDetach(e);const t=this.node,s=i.DOMUtils.findElement(t,N);t.removeEventListener("mousedown",this),t.removeEventListener("keydown",this),t.removeEventListener("click",this),t.removeEventListener("dblclick",this),s.removeEventListener("scroll",this),s.removeEventListener("dragover",this),s.removeEventListener("dragover",this),s.removeEventListener("dragleave",this),s.removeEventListener("dragend",this),s.removeEventListener("drop",this),s.removeEventListener("lm-dragenter",this),s.removeEventListener("lm-dragleave",this),s.removeEventListener("lm-dragover",this),s.removeEventListener("lm-drop",this),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0)}onAfterShow(e){this._isDirty&&(this.sort(this.sortState),this.update())}_updateModifiedSize(e){var t;const s=i.DOMUtils.findElement(e,O);this._modifiedWidth=null!==(t=null==s?void 0:s.getBoundingClientRect().width)&&void 0!==t?t:83,this._modifiedStyle=this._modifiedWidth<100?"narrow":this._modifiedWidth>120?"long":"short"}updateModified(e,t){e.forEach(((e,s)=>{const r=t[s];if(r&&e.last_modified){const t=i.DOMUtils.findElement(r,S);void 0!==this.renderer.updateItemModified?this.renderer.updateItemModified(t,e.last_modified,this._modifiedStyle):$.defaultRenderer.updateItemModified(t,e.last_modified,this._modifiedStyle)}}))}updateNodes(e,t){var s;e.forEach(((e,s)=>{const i=t[s],r=this._manager.registry.getFileTypeForModel(e);this.renderer.updateItemNode(i,e,r,this.translator,this._hiddenColumns,this.selection[e.path],this._modifiedStyle),this.selection[e.path]&&this._isCut&&this._model.path===this._prevPath&&i.classList.add(H),i.setAttribute("data-isdir","directory"===e.type?"true":"false")}));const i=Object.keys(this.selection).length;i&&(this.addClass(K),i>1&&this.addClass(W));const r=e.map((e=>e.path));for(const e of this._model.sessions()){const i=h.ArrayExt.firstIndexOf(r,e.path),n=t[i];if(n){let t=null===(s=e.kernel)||void 0===s?void 0:s.name;const i=this._model.specs;if(n.classList.add(Y),i&&t){const e=i.kernelspecs[t];t=e?e.display_name:this._trans.__("unknown")}n.title=this._trans.__("%1\nKernel: %2",n.title,t)}}}onUpdateRequest(e){this._isDirty=!1;const t=this._sortedItems,s=this._items,r=i.DOMUtils.findElement(this.node,N),n=this._renderer;for(this.removeClass(W),this.removeClass(K);s.length>t.length;)r.removeChild(s.pop());for(;s.length<t.length;){const e=n.createItemNode(this._hiddenColumns);e.classList.add("jp-DirListing-item"),s.push(e),r.appendChild(e)}s.forEach(((e,t)=>{e.classList.remove(K),e.classList.remove(Y),e.classList.remove(H);const s=n.getCheckboxNode(e);s&&(s.checked=!1);const i=n.getNameNode(e);i&&(i.tabIndex=t===this._focusIndex?0:-1)}));const o=n.getCheckboxNode(this.headerNode);if(o){const e=Object.keys(this.selection).length,s=t.length>0&&e===t.length,i=!s&&e>0;o.checked=s,o.indeterminate=i,o.dataset.checked=String(s),o.dataset.indeterminate=String(i);const r=this.translator.load("jupyterlab");null==o||o.setAttribute("aria-label",s||i?r.__("Deselect all files and directories"):r.__("Select all files and directories"))}this.updateNodes(t,s),this._prevPath=this._model.path}onResize(e){const{width:t}=-1===e.width?this.node.getBoundingClientRect():e;this.toggleClass("jp-DirListing-narrow",t<250);const s=this._modifiedStyle;this._updateModifiedSize(this.node),s!==this._modifiedStyle&&this.updateModified(this._sortedItems,this._items)}setColumnVisibility(e,t){t?this._hiddenColumns.delete(e):this._hiddenColumns.add(e),this.headerNode.innerHTML="",this._renderer.populateHeaderNode(this.headerNode,this.translator,this._hiddenColumns)}setNotebooksFirstSorting(e){let t=this._sortNotebooksFirst;this._sortNotebooksFirst=e,this._sortNotebooksFirst!==t&&this.sort(this._sortState)}isWithinCheckboxHitArea(e){let t=e.target;for(;t;){if(t.classList.contains(T))return!0;t=t.parentElement}return!1}_evtClick(e){const t=e.target,s=this.headerNode,i=this._renderer;if(s.contains(t)){const t=i.getCheckboxNode(s);if(t&&this.isWithinCheckboxHitArea(e))"false"===t.dataset.indeterminate&&"false"===t.dataset.checked?this._sortedItems.forEach((e=>this.selection[e.path]=!0)):this.clearSelectedItems(),this.update();else{const t=this.renderer.handleHeaderClick(s,e);t&&this.sort(t)}}else this._focusItem(this._focusIndex)}_evtScroll(e){this.headerNode.scrollLeft=this.contentNode.scrollLeft}_evtMousedown(e){if(e.target===this._editNode)return;if(this._editNode.parentNode){if(this._editNode===e.target)return;this._editNode.focus(),this._editNode.blur(),clearTimeout(this._selectTimer)}let t=J.hitTestNodes(this._items,e);-1!==t&&(this.handleFileSelect(e),0!==e.button&&clearTimeout(this._selectTimer),X&&e.ctrlKey||2===e.button||0===e.button&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:t},document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0)))}_evtMouseup(e){if(this._softSelection&&(e.metaKey||e.shiftKey||e.ctrlKey||0!==e.button||(this.clearSelectedItems(),this.selection[this._softSelection]=!0,this.update()),this._softSelection=""),0===e.button&&this._focusItem(this._focusIndex),0!==e.button||!this._drag)return document.removeEventListener("mousemove",this,!0),void document.removeEventListener("mouseup",this,!0);e.preventDefault(),e.stopPropagation()}_evtMousemove(e){if(e.preventDefault(),e.stopPropagation(),this._drag||!this._dragData)return;const t=this._dragData,s=Math.abs(e.clientX-t.pressX),i=Math.abs(e.clientY-t.pressY);s<5&&i<5||this._startDrag(t.index,e.clientX,e.clientY)}handleOpen(e){if(this._onItemOpened.emit(e),"directory"===e.type){const t=this._manager.services.contents.localPath(e.path);this._model.cd(`/${t}`).catch((e=>(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Open directory"),e)))}else{const t=e.path;this._manager.openOrReveal(t)}}_getNextFocusIndex(e,t){const s=e+t;return-1===s||s===this._items.length?e:s}_handleArrowY(e,t){if(e.altKey||e.metaKey)return;if(!this._items.length)return;if(!e.target.classList.contains(F))return;e.stopPropagation(),e.preventDefault();const s=this._focusIndex;let i=this._getNextFocusIndex(s,t);t>0&&0===s&&!e.ctrlKey&&0===Object.keys(this.selection).length&&(i=0),e.shiftKey?this._handleMultiSelect(i):e.ctrlKey||this._selectItem(i,e.shiftKey,!1),this._focusItem(i),this.update()}async goUp(){const e=this.model;if(e.path!==e.rootPath)try{await e.cd("..")}catch(t){console.warn(`Failed to go to parent directory of ${e.path}`,t)}}evtKeydown(e){if(!this._inRename){switch(e.keyCode){case 13:if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation();for(const e of this.selectedItems())this.handleOpen(e);return;case 38:return void this._handleArrowY(e,-1);case 40:return void this._handleArrowY(e,1);case 32:if(e.ctrlKey){if(e.metaKey||e.shiftKey||e.altKey)return;const t=this._items[this._focusIndex];if(!t.contains(e.target)||!t.contains(document.activeElement))return;e.stopPropagation(),e.preventDefault();const{path:s}=this._sortedItems[this._focusIndex];return this.selection[s]?delete this.selection[s]:this.selection[s]=!0,void this.update()}}if(void 0!==e.key&&1===e.key.length&&(" "!==e.key&&32!==e.keyCode||"checkbox"!==e.target.type)){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;this._searchPrefix+=e.key,clearTimeout(this._searchPrefixTimer),this._searchPrefixTimer=window.setTimeout((()=>{this._searchPrefix=""}),1e3),this.selectByPrefix(),e.stopPropagation(),e.preventDefault()}}}evtDblClick(e){if(0!==e.button)return;if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(this.isWithinCheckboxHitArea(e))return;e.preventDefault(),e.stopPropagation(),clearTimeout(this._selectTimer),this._editNode.blur();const t=e.target,s=h.ArrayExt.findFirstIndex(this._items,(e=>e.contains(t)));if(-1===s)return;const i=this._sortedItems[s];this.handleOpen(i)}evtNativeDrop(e){var t,s,r;const n=null===(t=e.dataTransfer)||void 0===t?void 0:t.files;if(!n||0===n.length)return;const o=null===(s=e.dataTransfer)||void 0===s?void 0:s.items.length;if(o){for(let t=0;t<o;t++){let s=null===(r=e.dataTransfer)||void 0===r?void 0:r.items[t].webkitGetAsEntry();(null==s?void 0:s.isDirectory)&&(console.log("currently not supporting drag + drop for folders"),(0,i.showDialog)({title:this._trans.__("Error Uploading Folder"),body:this._trans.__("Drag and Drop is currently not supported for folders"),buttons:[i.Dialog.cancelButton({label:this._trans.__("Close")})]}))}e.preventDefault();for(let e=0;e<n.length;e++)this._model.upload(n[e])}}evtDragEnter(e){if(e.mimeData.hasData(z)){const t=J.hitTestNodes(this._items,e);if(-1===t)return;const s=this._sortedItems[t];if("directory"!==s.type||this.selection[s.path])return;e.target.classList.add(V),e.preventDefault(),e.stopPropagation()}}evtDragLeave(e){e.preventDefault(),e.stopPropagation();const t=i.DOMUtils.findElement(this.node,V);t&&t.classList.remove(V)}evtDragOver(e){e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction;const t=i.DOMUtils.findElement(this.node,V);t&&t.classList.remove(V);const s=J.hitTestNodes(this._items,e);this._items[s].classList.add(V)}evtDrop(e){if(e.preventDefault(),e.stopPropagation(),clearTimeout(this._selectTimer),"none"===e.proposedAction)return void(e.dropAction="none");if(!e.mimeData.hasData(z))return;let t=e.target;for(;t&&t.parentElement;){if(t.classList.contains(V)){t.classList.remove(V);break}t=t.parentElement}const s=h.ArrayExt.firstIndexOf(this._items,t),n=this._sortedItems;let o=this._model.path;"directory"===n[s].type&&(o=r.PathExt.join(o,n[s].name));const a=this._manager,l=[],c=e.mimeData.getData(z);e.ctrlKey&&"move"===e.proposedAction?e.dropAction="copy":e.dropAction=e.proposedAction;for(const t of c){const s=a.services.contents.localPath(t),i=r.PathExt.basename(s),n=r.PathExt.join(o,i);n!==t&&("copy"===e.dropAction?l.push(a.copy(t,o)):l.push((0,d.renameFile)(a,t,n)))}Promise.all(l).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Error while copying/moving files"),e)}))}_startDrag(e,t,s){let i=Object.keys(this.selection);const r=this._items[e],n=this._sortedItems;let o,a;if(r.classList.contains(K)){const e=i[0];a=n.find((t=>t.path===e)),o=this.selectedItems()}else a=n[e],i=[a.path],o=[a];if(!a)return;const l=this._manager.registry.getFileTypeForModel(a),d=this.renderer.createDragImage(r,i.length,this._trans,l);this._drag=new C.Drag({dragImage:d,mimeData:new c.MimeData,supportedActions:"move",proposedAction:"move"}),this._drag.mimeData.setData(z,i);const h=this.model.manager.services;for(const e of o)this._drag.mimeData.setData("application/x-jupyter-icontentsrich",{model:e,withContent:async()=>await h.contents.get(e.path)});if(a&&"directory"!==a.type){const e=i.slice(1).reverse();this._drag.mimeData.setData("application/vnd.lumino.widget-factory",(()=>{if(!a)return;const t=a.path;let s=this._manager.findWidget(t);if(s||(s=this._manager.open(a.path)),e.length){const t=new c.PromiseDelegate;t.promise.then((()=>{let t=s;e.forEach((e=>{const s={ref:null==t?void 0:t.id,mode:"tab-after"};t=this._manager.openOrReveal(e,void 0,void 0,s),this._manager.openOrReveal(a.path)}))})),t.resolve(void 0)}return s}))}document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),clearTimeout(this._selectTimer),this._drag.start(t,s).then((e=>{this._drag=null,clearTimeout(this._selectTimer)}))}handleFileSelect(e){const t=this._sortedItems,s=J.hitTestNodes(this._items,e);if(clearTimeout(this._selectTimer),-1===s)return;this._softSelection="";const i=t[s].path,r=Object.keys(this.selection),n=0===e.button&&!(X&&e.ctrlKey)&&this.isWithinCheckboxHitArea(e);if(X&&e.metaKey||!X&&e.ctrlKey||n)this.selection[i]?delete this.selection[i]:this.selection[i]=!0,this._focusItem(s);else if(e.shiftKey)this._handleMultiSelect(s),this._focusItem(s);else{if(!(i in this.selection&&r.length>1))return this._selectItem(s,!1,!0);this._softSelection=i}this.update()}_focusItem(e){const t=this._items;if(0===t.length)return this._focusIndex=0,void this.node.focus();this._focusIndex=e;const s=t[e],i=this.renderer.getNameNode(s);i&&(i.tabIndex=0,i.focus())}_allSelectedBetween(e,t){if(e===t)return;const[s,i]=e<t?[e+1,t]:[t+1,e];return this._sortedItems.slice(s,i).reduce(((e,t)=>e&&this.selection[t.path]),!0)}_handleMultiSelect(e){const t=this._sortedItems,s=this._focusIndex,i=t[e];let r=!0;if(e===s)return void(this.selection[i.path]=!0);if(this.selection[i.path])if(1===Math.abs(e-s)){const i=t[s],r=t[s+(e<s?1:-1)];!this.selection[i.path]||r&&this.selection[r.path]||delete this.selection[i.path]}else this._allSelectedBetween(s,e)&&(r=!1);const n=s<e?1:-1;for(let i=s;i!==e+n;i+=n)if(r){if(i===s)continue;this.selection[t[i].path]=!0}else{if(i===e)continue;delete this.selection[t[i].path]}}_copy(){this._clipboard.length=0;for(const e of this.selectedItems())this._clipboard.push(e.path)}async _delete(e){await Promise.all(e.map((e=>this._model.manager.deleteFile(e).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Delete Failed"),e)})))))}async _doRename(){this._inRename=!0;const e=Object.keys(this.selection);if(0===e.length)return this._inRename=!1,Promise.resolve("");const t=this._sortedItems;let{path:s}=t[this._focusIndex];this.selection[s]||(s=e.slice(-1)[0]);const n=h.ArrayExt.findFirstIndex(t,(e=>e.path===s)),o=this._items[n],a=t[n],l=this.renderer.getNameNode(o),c=a.name;this._editNode.value=c,this._selectItem(n,!1,!0);const m=await J.userInputForRename(l,this._editNode,c);if(this.isDisposed)throw this._inRename=!1,new Error("File browser is disposed.");let u=m;if(m&&m!==c)if((0,d.isValidFileName)(m)){const e=this._manager,t=r.PathExt.join(this._model.path,c),s=r.PathExt.join(this._model.path,m);try{await(0,d.renameFile)(e,t,s)}catch(e){"File not renamed"!==e&&(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Rename Error"),e),u=c}if(this.isDisposed)throw this._inRename=!1,new Error("File browser is disposed.")}else(0,i.showErrorMessage)(this._trans.__("Rename Error"),Error(this._trans._p("showErrorMessage",'"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"',m))),u=c;else u=c;if(!this.isDisposed&&1===Object.keys(this.selection).length&&this.selection[a.path])try{await this._selectItemByName(u,!0,!0)}catch(e){console.warn("After rename, failed to select file",u)}return this._inRename=!1,u}_selectItem(e,t,s=!0){const i=this._sortedItems;t||this.clearSelectedItems();const r=i[e].path;this.selection[r]=!0,s&&this._focusItem(e),this.update()}_onModelRefreshed(){const e=Object.keys(this.selection);this.clearSelectedItems();for(const t of this._model.items()){const s=t.path;-1!==e.indexOf(s)&&(this.selection[s]=!0)}this.isVisible?this.sort(this.sortState):this._isDirty=!0}_onPathChanged(){this.clearSelectedItems(),this.sort(this.sortState),requestAnimationFrame((()=>{this._focusItem(0)}))}_onFileChanged(e,t){const s=t.newValue;if(!s)return;const i=s.name;"new"===t.type&&i&&this.selectItemByName(i).catch((()=>{}))}_onActivateRequested(e,t){if(r.PathExt.dirname(t)!==this._model.path)return;const s=r.PathExt.basename(t);this.selectItemByName(s).catch((()=>{}))}}var J;!function(e){class t{createNode(){const e=document.createElement("div"),t=document.createElement("div"),s=document.createElement("ul");return s.setAttribute("data-lm-dragscroll","true"),s.className=N,t.className=I,e.appendChild(t),e.appendChild(s),e.tabIndex=-1,e}populateHeaderNode(e,t,s){const r=(t=t||o.nullTranslator).load("jupyterlab"),n=this.createHeaderItemNode(r.__("Name")),a=document.createElement("div"),l=this._createHeaderItemNodeWithSizes({small:r.__("Modified"),large:r.__("Last Modified")}),d=this.createHeaderItemNode(r.__("File Size"));if(n.classList.add(A),n.classList.add(K),l.classList.add(O),d.classList.add(B),a.classList.add("jp-id-narrow"),a.textContent="...",!(null==s?void 0:s.has("is_selected"))){const t=this.createCheckboxWrapperNode({alwaysVisible:!0,headerNode:!0});e.appendChild(t)}e.appendChild(n),e.appendChild(a),e.appendChild(l),e.appendChild(d),(null==s?void 0:s.has("last_modified"))?l.classList.add(U):l.classList.remove(U),(null==s?void 0:s.has("file_size"))?d.classList.add(R):d.classList.remove(R),J.updateCaret(i.DOMUtils.findElement(n,P),"right","up")}handleHeaderClick(e,t){const s=i.DOMUtils.findElement(e,A),r=i.DOMUtils.findElement(e,O),n=i.DOMUtils.findElement(e,B),o={direction:"ascending",key:"name"},a=t.target,l=i.DOMUtils.findElement(r,P),d=i.DOMUtils.findElement(n,P),h=i.DOMUtils.findElement(s,P);return s.contains(a)?(s.classList.contains(K)?s.classList.contains(q)?(s.classList.remove(q),J.updateCaret(h,"right","up")):(o.direction="descending",s.classList.add(q),J.updateCaret(h,"right","down")):(s.classList.remove(q),J.updateCaret(h,"right","up")),s.classList.add(K),r.classList.remove(K),r.classList.remove(q),n.classList.remove(K),n.classList.remove(q),J.updateCaret(l,"left"),J.updateCaret(d,"left"),o):r.contains(a)?(o.key="last_modified",r.classList.contains(K)?r.classList.contains(q)?(r.classList.remove(q),J.updateCaret(l,"left","up")):(o.direction="descending",r.classList.add(q),J.updateCaret(l,"left","down")):(r.classList.remove(q),J.updateCaret(l,"left","up")),r.classList.add(K),s.classList.remove(K),s.classList.remove(q),n.classList.remove(K),n.classList.remove(q),J.updateCaret(h,"right"),J.updateCaret(d,"left"),o):n.contains(a)?(o.key="file_size",n.classList.contains(K)?n.classList.contains(q)?(n.classList.remove(q),J.updateCaret(d,"left","up")):(o.direction="descending",n.classList.add(q),J.updateCaret(d,"left","down")):(n.classList.remove(q),J.updateCaret(d,"left","up")),n.classList.add(K),s.classList.remove(K),s.classList.remove(q),r.classList.remove(K),r.classList.remove(q),J.updateCaret(h,"right"),J.updateCaret(l,"left"),o):o}createItemNode(e){const t=document.createElement("li"),s=document.createElement("span"),i=document.createElement("span"),r=document.createElement("span"),n=document.createElement("span");if(s.className=M,i.className=F,r.className=S,n.className=j,!(null==e?void 0:e.has("is_selected"))){const e=this.createCheckboxWrapperNode();t.appendChild(e)}return t.appendChild(s),t.appendChild(i),t.appendChild(r),t.appendChild(n),(null==e?void 0:e.has("last_modified"))?r.classList.add(U):r.classList.remove(U),(null==e?void 0:e.has("file_size"))?n.classList.add(R):n.classList.remove(R),t}createCheckboxWrapperNode(e){const t=document.createElement("label");t.classList.add(T);const s=document.createElement("input");return s.type="checkbox",(null==e?void 0:e.headerNode)||s.addEventListener("click",(e=>{e.preventDefault()})),(null==e?void 0:e.alwaysVisible)?t.classList.add("jp-mod-visible"):s.tabIndex=-1,t.appendChild(s),t}updateItemModified(e,t,s){let i="",n="";const o=new Date(t);i=r.Time.formatHuman(o,s),n=r.Time.format(o),e.textContent=i,e.title=n}updateItemNode(e,t,s,n,l,d,c){d&&e.classList.add(K),s=s||b.DocumentRegistry.getDefaultTextFileType(n);const{icon:m,iconClass:u,name:p}=s,_=(n=n||o.nullTranslator).load("jupyterlab"),f=i.DOMUtils.findElement(e,M),g=i.DOMUtils.findElement(e,F),v=i.DOMUtils.findElement(e,S),y=i.DOMUtils.findElement(e,j),w=i.DOMUtils.findElement(e,T),C=!(null==l?void 0:l.has("is_selected"));if(w&&!C)e.removeChild(w);else if(C&&!w){const t=this.createCheckboxWrapperNode();e.insertBefore(t,f)}(null==l?void 0:l.has("last_modified"))?v.classList.add(U):v.classList.remove(U),(null==l?void 0:l.has("file_size"))?y.classList.add(R):y.classList.remove(R),a.LabIcon.resolveElement({icon:m,iconClass:(0,a.classes)(u,"jp-Icon"),container:f,className:M,stylesheet:"listing"});let E=_.__("Name: %1",t.name);if(null!==t.size&&void 0!==t.size){const e=J.formatFileSize(t.size,1,1024);y.textContent=e,E+=_.__("\nSize: %1",J.formatFileSize(t.size,1,1024))}else y.textContent="";if(t.path){const e=r.PathExt.dirname(t.path);e&&(E+=_.__("\nPath: %1",e.substr(0,50)),e.length>50&&(E+="..."))}t.created&&(E+=_.__("\nCreated: %1",r.Time.format(new Date(t.created)))),t.last_modified&&(E+=_.__("\nModified: %1",r.Time.format(new Date(t.last_modified)))),E+=_.__("\nWritable: %1",t.writable),e.title=E,e.setAttribute("data-file-type",p),t.name.startsWith(".")?e.setAttribute("data-is-dot","true"):e.removeAttribute("data-is-dot");const D=t.indices?t.indices:[];let I=h.StringExt.highlight(t.name,D,L.h.mark);g&&L.VirtualDOM.render(L.h.span(I),g);const x=null==w?void 0:w.querySelector('input[type="checkbox"]');if(x){let e;e="directory"===s.contentType?d?_.__('Deselect directory "%1"',I):_.__('Select directory "%1"',I):d?_.__('Deselect file "%1"',I):_.__('Select file "%1"',I),x.setAttribute("aria-label",e),x.checked=null!=d&&d}t.last_modified&&this.updateItemModified(v,t.last_modified,null!=c?c:"short")}getNameNode(e){return i.DOMUtils.findElement(e,F)}getCheckboxNode(e){return e.querySelector(`.${T} input[type=checkbox]`)}createDragImage(e,t,s,r){const n=e.cloneNode(!0),o=i.DOMUtils.findElement(n,S),a=i.DOMUtils.findElement(n,M);return n.removeChild(o),r?(a.textContent=r.iconLabel||"",a.className=r.iconClass||""):(a.textContent="",a.className=""),a.classList.add("jp-DragIcon"),t>1&&(i.DOMUtils.findElement(n,F).textContent=s._n("%1 Item","%1 Items",t)),n}createHeaderItemNode(e){const t=document.createElement("div"),s=document.createElement("span"),i=document.createElement("span");return t.className=x,s.className=k,i.className=P,s.textContent=e,t.appendChild(s),t.appendChild(i),t}_createHeaderItemNodeWithSizes(e){const t=document.createElement("div");t.className=x;const s=document.createElement("span");s.className=P;for(let s of Object.keys(e)){const i=document.createElement("span");i.classList.add(k,k+"-"+s),i.textContent=e[s],t.appendChild(i)}return t.appendChild(s),t}}e.Renderer=t,e.defaultRenderer=new t}($||($={})),function(e){e.userInputForRename=function(e,t,s){const i=e.parentElement;i.replaceChild(t,e),t.focus();const r=t.value.lastIndexOf(".");return-1===r?t.setSelectionRange(0,t.value.length):t.setSelectionRange(0,r),new Promise((r=>{t.onblur=()=>{i.replaceChild(e,t),r(t.value)},t.onkeydown=i=>{switch(i.keyCode){case 13:i.stopPropagation(),i.preventDefault(),t.blur();break;case 27:i.stopPropagation(),i.preventDefault(),t.value=s,t.blur(),e.focus()}}}))},e.sort=function(e,t,s=!1){const i=Array.from(e),r="descending"===t.direction?1:-1;function n(e){return"directory"===e.type?2:"notebook"===e.type&&s?1:0}function o(e){return(t,i)=>{if(function(e,t){return s?e.type!==t.type:"directory"===e.type!=("directory"===t.type)}(t,i))return n(i)-n(t);const o=e(t,i);return 0!==o?o*r:t.name.localeCompare(i.name)}}return"last_modified"===t.key?i.sort(o(((e,t)=>new Date(e.last_modified).getTime()-new Date(t.last_modified).getTime()))):"file_size"===t.key?i.sort(o(((e,t)=>{var s,i;return(null!==(s=e.size)&&void 0!==s?s:0)-(null!==(i=t.size)&&void 0!==i?i:0)}))):i.sort(o(((e,t)=>t.name.localeCompare(e.name)))),i},e.hitTestNodes=function(e,t){return h.ArrayExt.findFirstIndex(e,(e=>m.ElementExt.hitTest(e,t.clientX,t.clientY)||t.target===e))},e.formatFileSize=function(e,t,s){if(0===e)return"0 B";const i=t||2,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.floor(Math.log(e)/Math.log(s));return n>=0&&n<r.length?parseFloat((e/Math.pow(s,n)).toFixed(i))+" "+r[n]:String(e)},e.updateCaret=function(e,t,s){s?("down"===s?a.caretDownIcon:a.caretUpIcon).element({container:e,tag:"span",stylesheet:"listingHeaderItem",float:t}):(a.LabIcon.remove(e),e.className=P)}}(J||(J={}));class G extends a.SidePanel{constructor(e){var t;super({content:new l.Panel,translator:e.translator}),this._directoryPending=null,this._filePending=null,this._showLastModifiedColumn=!0,this._showFileSizeColumn=!1,this._showHiddenFiles=!1,this._showFileCheckboxes=!1,this._sortNotebooksFirst=!1,this.addClass("jp-FileBrowser"),this.toolbar.addClass("jp-FileBrowser-toolbar"),this.id=e.id;const s=this.translator=null!==(t=e.translator)&&void 0!==t?t:o.nullTranslator,i=this.model=e.model,r=e.renderer;i.connectionFailure.connect(this._onConnectionFailure,this),this._manager=i.manager,this.toolbar.node.setAttribute("aria-label",this._trans.__("file browser")),this.mainPanel=new l.Panel,this.mainPanel.addClass("jp-FileBrowser-Panel"),this.mainPanel.title.label=this._trans.__("File Browser"),this.crumbs=new y({model:i,translator:s}),this.crumbs.addClass("jp-FileBrowser-crumbs"),this.listing=this.createDirListing({model:i,renderer:r,translator:s}),this.listing.addClass("jp-FileBrowser-listing"),this.mainPanel.addWidget(this.crumbs),this.mainPanel.addWidget(this.listing),this.addWidget(this.mainPanel),!1!==e.restore&&i.restore(this.id)}get navigateToCurrentDirectory(){return this._navigateToCurrentDirectory}set navigateToCurrentDirectory(e){this._navigateToCurrentDirectory=e}get showLastModifiedColumn(){return this._showLastModifiedColumn}set showLastModifiedColumn(e){this.listing.setColumnVisibility?(this.listing.setColumnVisibility("last_modified",e),this._showLastModifiedColumn=e):console.warn("Listing does not support toggling column visibility")}get showFullPath(){return this.crumbs.fullPath}set showFullPath(e){this.crumbs.fullPath=e}get showFileSizeColumn(){return this._showFileSizeColumn}set showFileSizeColumn(e){this.listing.setColumnVisibility?(this.listing.setColumnVisibility("file_size",e),this._showFileSizeColumn=e):console.warn("Listing does not support toggling column visibility")}get showHiddenFiles(){return this._showHiddenFiles}set showHiddenFiles(e){this.model.showHiddenFiles(e),this._showHiddenFiles=e}get showFileCheckboxes(){return this._showFileCheckboxes}set showFileCheckboxes(e){this.listing.setColumnVisibility?(this.listing.setColumnVisibility("is_selected",e),this._showFileCheckboxes=e):console.warn("Listing does not support toggling column visibility")}get sortNotebooksFirst(){return this._sortNotebooksFirst}set sortNotebooksFirst(e){this.listing.setNotebooksFirstSorting?(this.listing.setNotebooksFirstSorting(e),this._sortNotebooksFirst=e):console.warn("Listing does not support sorting notebooks first")}selectedItems(){return this.listing.selectedItems()}async selectItemByName(e){await this.listing.selectItemByName(e)}clearSelectedItems(){this.listing.clearSelectedItems()}rename(){return this.listing.rename()}cut(){this.listing.cut()}copy(){this.listing.copy()}paste(){return this.listing.paste()}async _createNew(e){if(e.path){const t=this._manager.services.contents.localPath(e.path);e.path=this._toDrivePath(this.model.driveName,t)}try{const t=await this._manager.newUntitled(e);return await this.listing.selectItemByName(t.name,!0),await this.rename(),t}catch(e){throw(0,i.showErrorMessage)(this._trans.__("Error"),e),e}}async createNewDirectory(){if(this._directoryPending)return this._directoryPending;this._directoryPending=this._createNew({path:this.model.path,type:"directory"});try{return await this._directoryPending}finally{this._directoryPending=null}}async createNewFile(e){if(this._filePending)return this._filePending;this._filePending=this._createNew({path:this.model.path,type:"file",ext:e.ext});try{return await this._filePending}finally{this._filePending=null}}delete(){return this.listing.delete()}duplicate(){return this.listing.duplicate()}download(){return this.listing.download()}async goUp(){return this.listing.goUp()}shutdownKernels(){return this.listing.shutdownKernels()}selectNext(){this.listing.selectNext()}selectPrevious(){this.listing.selectPrevious()}modelForClick(e){return this.listing.modelForClick(e)}createDirListing(e){return new $(e)}_onConnectionFailure(e,t){if(t instanceof n.ServerConnection.ResponseError&&404===t.response.status){const e=this._trans.__("Directory not found");t.message=this._trans.__('Directory not found: "%1"',this.model.path),(0,i.showErrorMessage)(e,t)}}_toDrivePath(e,t){return""===e?t:`${e}:${r.PathExt.removeSlash(t)}`}}var Z=s(97934);const Q=15728640,ee=1048576;class te{constructor(e){var t;this._connectionFailure=new D.Signal(this),this._fileChanged=new D.Signal(this),this._items=[],this._key="",this._pathChanged=new D.Signal(this),this._paths=new Set,this._pending=null,this._pendingPath=null,this._refreshed=new D.Signal(this),this._sessions=[],this._state=null,this._isDisposed=!1,this._restored=new c.PromiseDelegate,this._uploads=[],this._uploadChanged=new D.Signal(this),this.manager=e.manager,this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._driveName=e.driveName||"",this._model={path:this.rootPath,name:r.PathExt.basename(this.rootPath),type:"directory",content:void 0,writable:!1,created:"unknown",last_modified:"unknown",mimetype:"text/plain",format:"text"},this._state=e.state||null;const s=e.refreshInterval||1e4,{services:i}=e.manager;i.contents.fileChanged.connect(this.onFileChanged,this),i.sessions.runningChanged.connect(this.onRunningChanged,this),this._unloadEventListener=e=>{if(this._uploads.length>0){const t=this._trans.__("Files still uploading");return e.returnValue=t,t}},window.addEventListener("beforeunload",this._unloadEventListener),this._poll=new Z.Poll({auto:null===(t=e.auto)||void 0===t||t,name:"@jupyterlab/filebrowser:Model",factory:()=>this.cd("."),frequency:{interval:s,backoff:!0,max:3e5},standby:e.refreshStandby||"when-hidden"})}get connectionFailure(){return this._connectionFailure}get driveName(){return this._driveName}get restored(){return this._restored.promise}get fileChanged(){return this._fileChanged}get path(){return this._model?this._model.path:""}get rootPath(){return this._driveName?this._driveName+":":""}get pathChanged(){return this._pathChanged}get refreshed(){return this._refreshed}get specs(){return this.manager.services.kernelspecs.specs}get isDisposed(){return this._isDisposed}get uploadChanged(){return this._uploadChanged}uploads(){return this._uploads[Symbol.iterator]()}dispose(){this.isDisposed||(window.removeEventListener("beforeunload",this._unloadEventListener),this._isDisposed=!0,this._poll.dispose(),this._sessions.length=0,this._items.length=0,D.Signal.clearData(this))}items(){return this._items[Symbol.iterator]()}sessions(){return this._sessions[Symbol.iterator]()}async refresh(){await this._poll.refresh(),await this._poll.tick,this._refreshed.emit(void 0)}async cd(e="."){if(e="."!==e?this.manager.services.contents.resolvePath(this._model.path,e):this._pendingPath||this._model.path,this._pending){if(e===this._pendingPath)return this._pending;await this._pending}const t=this.path;this._pendingPath=e,t!==e&&(this._sessions.length=0);const s=this.manager.services;return this._pending=s.contents.get(e,{content:!0}).then((i=>{this.isDisposed||(this.handleContents(i),this._pendingPath=null,this._pending=null,t!==e&&(this._state&&this._key&&this._state.save(this._key,{path:e}),this._pathChanged.emit({name:"path",oldValue:t,newValue:e})),this.onRunningChanged(s.sessions,s.sessions.running()),this._refreshed.emit(void 0))})).catch((t=>{if(this._pendingPath=null,this._pending=null,t.response&&404===t.response.status&&"/"!==e)return t.message=this._trans.__('Directory not found: "%1"',this._model.path),console.error(t),this._connectionFailure.emit(t),this.cd("/");this._connectionFailure.emit(t)})),this._pending}async download(e){const t=await this.manager.services.contents.getDownloadUrl(e),s=document.createElement("a");s.href=t,s.download="",document.body.appendChild(s),s.click(),document.body.removeChild(s)}async restore(e,t=!0){const{manager:s}=this,i=`file-browser-${e}:cwd`,r=this._state;if(!this._key)if(this._key=i,t&&r){await s.services.ready;try{const e=await r.fetch(i);if(!e)return void this._restored.resolve(void 0);const t=e.path;t&&await this.cd("/");const n=s.services.contents.localPath(t);await s.services.contents.get(t),await this.cd(n)}catch(e){await r.remove(i)}this._restored.resolve(void 0)}else this._restored.resolve(void 0)}async upload(e){const t=r.PageConfig.getNotebookVersion(),s=t<[4,0,0]||t>=[5,1,0],i=e.size>Q;if(i&&!s){const t=this._trans.__("Cannot upload file (>%1 MB). %2",Q/1048576,e.name);throw console.warn(t),t}if(i&&!await this._shouldUploadLarge(e))throw"Cancelled large file upload";if(await this._uploadCheckDisposed(),await this.refresh(),await this._uploadCheckDisposed(),this._items.find((t=>t.name===e.name))&&!await(0,d.shouldOverwrite)(e.name))throw"File not uploaded";await this._uploadCheckDisposed();const n=s&&e.size>ee;return await this._upload(e,n)}async _shouldUploadLarge(e){const{button:t}=await(0,i.showDialog)({title:this._trans.__("Large file size warning"),body:this._trans.__("The file size is %1 MB. Do you still want to upload it?",Math.round(e.size/1048576)),buttons:[i.Dialog.cancelButton({label:this._trans.__("Cancel")}),i.Dialog.warnButton({label:this._trans.__("Upload")})]});return t.accept}async _upload(e,t){let s=this._model.path;s=s?s+"/"+e.name:e.name;const i=e.name,r=async(t,r)=>{await this._uploadCheckDisposed();const n=new FileReader;n.readAsDataURL(t),await new Promise(((t,s)=>{n.onload=t,n.onerror=t=>s(`Failed to upload "${e.name}":`+t)})),await this._uploadCheckDisposed();const o=n.result.split(",")[1],a={type:"file",format:"base64",name:i,chunk:r,content:o};return await this.manager.services.contents.save(s,a)};if(!t)try{return await r(e)}catch(t){throw h.ArrayExt.removeFirstWhere(this._uploads,(t=>e.name===t.path)),t}let n,o={path:s,progress:0};this._uploadChanged.emit({name:"start",newValue:o,oldValue:null});for(let t=0;!n;t+=ee){const i=t+ee,a=i>=e.size,l=a?-1:i/ee,d={path:s,progress:t/e.size};let c;this._uploads.splice(this._uploads.indexOf(o)),this._uploads.push(d),this._uploadChanged.emit({name:"update",newValue:d,oldValue:o}),o=d;try{c=await r(e.slice(t,i),l)}catch(t){throw h.ArrayExt.removeFirstWhere(this._uploads,(t=>e.name===t.path)),this._uploadChanged.emit({name:"failure",newValue:o,oldValue:null}),t}a&&(n=c)}return this._uploads.splice(this._uploads.indexOf(o)),this._uploadChanged.emit({name:"finish",newValue:null,oldValue:o}),n}_uploadCheckDisposed(){return this.isDisposed?Promise.reject("Filemanager disposed. File upload canceled"):Promise.resolve()}handleContents(e){this._model={name:e.name,path:e.path,type:e.type,content:void 0,writable:e.writable,created:e.created,last_modified:e.last_modified,size:e.size,mimetype:e.mimetype,format:e.format},this._items=e.content,this._paths.clear(),e.content.forEach((e=>{this._paths.add(e.path)}))}onRunningChanged(e,t){this._populateSessions(t),this._refreshed.emit(void 0)}onFileChanged(e,t){const s=this._model.path,{sessions:i}=this.manager.services,{oldValue:n,newValue:o}=t;if(n&&n.path&&r.PathExt.dirname(n.path)===s?n:o&&o.path&&r.PathExt.dirname(o.path)===s?o:void 0)return this._poll.refresh(),this._populateSessions(i.running()),void this._fileChanged.emit(t)}_populateSessions(e){this._sessions.length=0;for(const t of e)this._paths.has(t.path)&&this._sessions.push(t)}}class se extends te{constructor(e){super(e),this._includeHiddenFiles=e.includeHiddenFiles||!1}items(){return this._includeHiddenFiles?super.items():(0,h.filter)(super.items(),(e=>!e.name.startsWith(".")))}showHiddenFiles(e){this._includeHiddenFiles=e,this.refresh()}}class ie extends se{constructor(e){var t,s;super(e),this._filter=null!==(t=e.filter)&&void 0!==t?t:e=>({}),this._filterDirectories=null===(s=e.filterDirectories)||void 0===s||s}get filterDirectories(){return this._filterDirectories}set filterDirectories(e){this._filterDirectories=e}items(){return(0,h.filter)(super.items(),(e=>{if(this._filterDirectories||"directory"!==e.type){const t=this._filter(e);return e.indices=null==t?void 0:t.indices,!!t}return!0}))}setFilter(e){this._filter=e,this.refresh()}}var re,ne;!function(e){async function t(e){const t=e.translator||o.nullTranslator,s=t.load("jupyterlab"),r=new oe(e.manager,e.filter,t,e.defaultPath,e.label),n={title:e.title,buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:s.__("Select")})],focusNodeSelector:e.focusNodeSelector,host:e.host,renderer:e.renderer,body:r};return await r.ready,new i.Dialog(n).launch()}e.getOpenFiles=t,e.getExistingDirectory=function(e){return t({...e,filter:e=>"directory"===e.type?{}:null})}}(re||(re={}));class oe extends l.Widget{constructor(e,t,s,r,n,d){super(),this._ready=new c.PromiseDelegate;const h=(s=null!=s?s:o.nullTranslator).load("jupyterlab");this.addClass("jp-Open-Dialog"),ne.createFilteredFileBrowser("filtered-file-browser-dialog",e,t,{},s,r,d).then((e=>{this._browser=e,(0,i.setToolbar)(this._browser,(e=>[{name:"new-folder",widget:new i.ToolbarButton({icon:a.newFolderIcon,onClick:()=>{e.createNewDirectory()},tooltip:h.__("New Folder")})},{name:"refresher",widget:new i.ToolbarButton({icon:a.refreshIcon,onClick:()=>{e.model.refresh().catch((e=>{console.error("Failed to refresh file browser in open dialog.",e)}))},tooltip:h.__("Refresh File List")})}]));const t=new l.PanelLayout;if(n){const e=new l.Widget;e.addClass("jp-Open-Dialog-label"),e.node.textContent=n,t.addWidget(e)}t.addWidget(this._browser),this.dispose=()=>{this.isDisposed||(this._browser.model.dispose(),super.dispose())},this.layout=t,this._ready.resolve()})).catch((e=>{console.error("Error while creating file browser in open dialog",e),this._ready.reject(void 0)}))}getValue(){const e=Array.from(this._browser.selectedItems());return 0===e.length?[{path:this._browser.model.path,name:r.PathExt.basename(this._browser.model.path),type:"directory",content:void 0,writable:!1,created:"unknown",last_modified:"unknown",mimetype:"text/plain",format:"text"}]:e}get ready(){return this._ready.promise}}!function(e){e.createFilteredFileBrowser=async(e,t,s,i={},r,n,a)=>{r=r||o.nullTranslator;const l=new ie({manager:t,filter:s,translator:r,driveName:i.driveName,refreshInterval:i.refreshInterval,filterDirectories:a}),d=new G({id:e,model:l,translator:r});return n&&await d.model.cd(n),d}}(ne||(ne={}));const ae=new c.Token("@jupyterlab/filebrowser:IFileBrowserFactory","A factory object that creates file browsers.\n Use this if you want to create your own file browser (e.g., for a custom storage backend),\n or to interact with other file browsers that have been created by extensions."),le=new c.Token("@jupyterlab/filebrowser:IDefaultFileBrowser","A service for the default file browser."),de=new c.Token("@jupyterlab/filebrowser:IFileBrowserCommands","A token to ensure file browser commands are loaded.");class he extends a.ToolbarButton{constructor(e){super({icon:a.fileUploadIcon,label:e.label,onClick:()=>{this._input.click()},tooltip:ce.translateToolTip(e.translator)}),this._onInputChanged=()=>{const e=Array.prototype.slice.call(this._input.files).map((e=>this.fileBrowserModel.upload(e)));Promise.all(e).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Upload Error"),e)}))},this._onInputClicked=()=>{this._input.value=""},this._input=ce.createUploadInput(),this.fileBrowserModel=e.model,this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._input.onclick=this._onInputClicked,this._input.onchange=this._onInputChanged,this.addClass("jp-id-upload")}}var ce;!function(e){e.createUploadInput=function(){const e=document.createElement("input");return e.type="file",e.multiple=!0,e},e.translateToolTip=function(e){return(e=e||o.nullTranslator).load("jupyterlab").__("Upload Files")}}(ce||(ce={}));var me=s(54252),ue=s(78156),pe=s.n(ue);function _e(e){const t=(e.translator||o.nullTranslator).load("jupyterlab");return pe().createElement(me.GroupItem,{spacing:4},pe().createElement(me.TextItem,{source:t.__("Uploading…")}),pe().createElement(me.ProgressBar,{percentage:e.upload}))}class fe extends a.VDomRenderer{constructor(e){super(new fe.Model(e.tracker.currentWidget&&e.tracker.currentWidget.model)),this._onBrowserChange=(e,t)=>{this.model.browserModel=null===t?null:t.model},this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._tracker=e.tracker,this._tracker.currentChanged.connect(this._onBrowserChange)}render(){return this.model.items.length>0?this.model.items[0].complete?pe().createElement(me.TextItem,{source:this._trans.__("Complete!")}):pe().createElement(_e,{upload:this.model.items[0].progress,translator:this.translator}):pe().createElement(_e,{upload:100,translator:this.translator})}dispose(){super.dispose(),this._tracker.currentChanged.disconnect(this._onBrowserChange)}}!function(e){class t extends a.VDomModel{constructor(e){super(),this._uploadChanged=(e,t)=>{if("start"===t.name)this._items.push({path:t.newValue.path,progress:100*t.newValue.progress,complete:!1});else if("update"===t.name){const e=h.ArrayExt.findFirstIndex(this._items,(e=>e.path===t.oldValue.path));-1!==e&&(this._items[e].progress=100*t.newValue.progress)}else if("finish"===t.name){const e=h.ArrayExt.findFirstValue(this._items,(e=>e.path===t.oldValue.path));e&&(e.complete=!0,setTimeout((()=>{h.ArrayExt.removeFirstOf(this._items,e),this.stateChanged.emit(void 0)}),2e3))}else"failure"===t.name&&h.ArrayExt.removeFirstWhere(this._items,(e=>e.path===t.newValue.path));this.stateChanged.emit(void 0)},this._items=[],this._browserModel=null,this.browserModel=e}get items(){return this._items}get browserModel(){return this._browserModel}set browserModel(e){const t=this._browserModel;t&&t.uploadChanged.disconnect(this._uploadChanged),this._browserModel=e,this._items=[],null!==this._browserModel&&this._browserModel.uploadChanged.connect(this._uploadChanged),this.stateChanged.emit(void 0)}}e.Model=t}(fe||(fe={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[9341],{39341:(e,t,s)=>{s.r(t),s.d(t,{BreadCrumbs:()=>b,CHUNK_SIZE:()=>ie,DirListing:()=>Z,FileBrowser:()=>ee,FileBrowserModel:()=>ne,FileDialog:()=>ae,FileUploadStatus:()=>ge,FilterFileBrowserModel:()=>oe,IDefaultFileBrowser:()=>ce,IFileBrowserCommands:()=>me,IFileBrowserFactory:()=>he,LARGE_FILE_SIZE:()=>se,TogglableHiddenFileBrowserModel:()=>re,Uploader:()=>ue});var i=s(20911),n=s(77075),r=s(68086),o=s(66649),a=s(7258),l=s(2260),d=s(78156),h=s.n(d),c=s(20780),m=s(14931),u=s(21961),p=s(47392);const _="jp-BreadCrumbs-home",f="jp-BreadCrumbs-preferred",g="jp-BreadCrumbs-item",v=["/","../../","../",""],w="application/x-jupyter-icontents",y="jp-mod-dropTarget";class b extends l.Widget{constructor(e){super(),this._previousState=null,this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._model=e.model,this._fullPath=e.fullPath||!1,this.addClass("jp-BreadCrumbs"),this._crumbs=C.createCrumbs(),this._crumbSeps=C.createCrumbSeparators();const t=n.PageConfig.getOption("preferredPath");this._hasPreferred=!(!t||"/"===t),this._hasPreferred&&this.node.appendChild(this._crumbs[C.Crumb.Preferred]),this.node.appendChild(this._crumbs[C.Crumb.Home]),this._model.refreshed.connect(this.update,this)}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;default:return}}get fullPath(){return this._fullPath}set fullPath(e){this._fullPath=e}onAfterAttach(e){super.onAfterAttach(e),this.update();const t=this.node;t.addEventListener("click",this),t.addEventListener("lm-dragenter",this),t.addEventListener("lm-dragleave",this),t.addEventListener("lm-dragover",this),t.addEventListener("lm-drop",this)}onBeforeDetach(e){super.onBeforeDetach(e);const t=this.node;t.removeEventListener("click",this),t.removeEventListener("lm-dragenter",this),t.removeEventListener("lm-dragleave",this),t.removeEventListener("lm-dragover",this),t.removeEventListener("lm-drop",this)}onUpdateRequest(e){const t={path:this._model.manager.services.contents.localPath(this._model.path),hasPreferred:this._hasPreferred,fullPath:this._fullPath};this._previousState&&u.JSONExt.deepEqual(t,this._previousState)||(this._previousState=t,C.updateCrumbs(this._crumbs,this._crumbSeps,t))}_evtClick(e){if(0!==e.button)return;let t=e.target;for(;t&&t!==this.node;){if(t.classList.contains(f))return this._model.cd(n.PageConfig.getOption("preferredPath")).catch((e=>(0,i.showErrorMessage)(this._trans.__("Open Error"),e))),e.preventDefault(),void e.stopPropagation();if(t.classList.contains(g)||t.classList.contains(_)){let s=m.ArrayExt.findFirstIndex(this._crumbs,(e=>e===t)),n=v[s];return this._fullPath&&s<0&&!t.classList.contains(_)&&(n=t.title),this._model.cd(n).catch((e=>(0,i.showErrorMessage)(this._trans.__("Open Error"),e))),e.preventDefault(),void e.stopPropagation()}t=t.parentElement}}_evtDragEnter(e){if(e.mimeData.hasData(w)){const t=m.ArrayExt.findFirstIndex(this._crumbs,(t=>p.ElementExt.hitTest(t,e.clientX,e.clientY)));-1!==t&&t!==C.Crumb.Current&&(this._crumbs[t].classList.add(y),e.preventDefault(),e.stopPropagation())}}_evtDragLeave(e){e.preventDefault(),e.stopPropagation();const t=i.DOMUtils.findElement(this.node,y);t&&t.classList.remove(y)}_evtDragOver(e){e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction;const t=i.DOMUtils.findElement(this.node,y);t&&t.classList.remove(y);const s=m.ArrayExt.findFirstIndex(this._crumbs,(t=>p.ElementExt.hitTest(t,e.clientX,e.clientY)));-1!==s&&this._crumbs[s].classList.add(y)}_evtDrop(e){if(e.preventDefault(),e.stopPropagation(),"none"===e.proposedAction)return void(e.dropAction="none");if(!e.mimeData.hasData(w))return;e.dropAction=e.proposedAction;let t=e.target;for(;t&&t.parentElement;){if(t.classList.contains(y)){t.classList.remove(y);break}t=t.parentElement}const s=m.ArrayExt.findFirstIndex(this._crumbs,(e=>e===t));if(-1===s)return;const r=this._model,o=n.PathExt.resolve(r.path,v[s]),a=r.manager,l=[],d=e.mimeData.getData(w);for(const e of d){const t=a.services.contents.localPath(e),s=n.PathExt.basename(t),i=n.PathExt.join(o,s);l.push((0,c.renameFile)(a,e,i))}Promise.all(l).catch((e=>(0,i.showErrorMessage)(this._trans.__("Move Error"),e)))}}var C;!function(e){let t;!function(e){e[e.Home=0]="Home",e[e.Ellipsis=1]="Ellipsis",e[e.Parent=2]="Parent",e[e.Current=3]="Current",e[e.Preferred=4]="Preferred"}(t=e.Crumb||(e.Crumb={})),e.updateCrumbs=function(e,s,i){const n=e[0].parentNode,r=n.firstChild;for(;r&&r.nextSibling;)n.removeChild(r.nextSibling);i.hasPreferred?(n.appendChild(e[t.Home]),n.appendChild(s[0])):n.appendChild(s[0]);const o=i.path.split("/");if(!i.fullPath&&o.length>2){n.appendChild(e[t.Ellipsis]);const i=o.slice(0,o.length-2).join("/");e[t.Ellipsis].title=i,n.appendChild(s[1])}if(i.path)if(i.fullPath)for(let e=0;e<o.length;e++){const t=document.createElement("span");t.className=g,t.textContent=o[e];const s=`/${o.slice(0,e+1).join("/")}`;t.title=s,n.appendChild(t);const i=document.createElement("span");i.textContent="/",n.appendChild(i)}else{if(o.length>=2){e[t.Parent].textContent=o[o.length-2],n.appendChild(e[t.Parent]);const i=o.slice(0,o.length-1).join("/");e[t.Parent].title=i,n.appendChild(s[2])}e[t.Current].textContent=o[o.length-1],n.appendChild(e[t.Current]),e[t.Current].title=i.path,n.appendChild(s[3])}},e.createCrumbs=function(){const e=a.folderIcon.element({className:_,tag:"span",title:n.PageConfig.getOption("serverRoot")||"Jupyter Server Root",stylesheet:"breadCrumb"}),t=a.ellipsesIcon.element({className:g,tag:"span",stylesheet:"breadCrumb"}),s=document.createElement("span");s.className=g;const i=document.createElement("span");return i.className=g,[e,t,s,i,a.homeIcon.element({className:f,tag:"span",title:n.PageConfig.getOption("preferredPath")||"Jupyter Preferred Path",stylesheet:"breadCrumb"})]},e.createCrumbSeparators=function(){const e=[];for(let t=0;t<4;t++){const t=document.createElement("span");t.textContent="/",e.push(t)}return e}}(C||(C={}));var E=s(21428),D=s(49901),I=s(23246),F=s(62633),S=s(2159),x=s(47087);const k="jp-DirListing-header",N="jp-DirListing-headerItem",P="jp-DirListing-headerItemText",L="jp-DirListing-headerItemIcon",M="jp-DirListing-content",z="jp-DirListing-itemText",j="jp-DirListing-itemName",A="jp-DirListing-itemIcon",T="jp-DirListing-itemModified",O="jp-DirListing-itemFileSize",B="jp-DirListing-checkboxWrapper",R="jp-id-name",U="jp-id-modified",W="application/x-jupyter-icontents",V="jp-mod-dropTarget",K="jp-mod-selected",H="jp-DirListing-resizeHandle",q="jp-mod-cut",Y="jp-mod-multiSelected",$="jp-mod-running",X="jp-mod-active",G="jp-mod-descending",J=!!navigator.platform.match(/Mac/i);class Z extends l.Widget{constructor(e){super({node:(e.renderer||Z.defaultRenderer).createNode()}),this._items=[],this._sortedItems=[],this._sortState={direction:"ascending",key:"name"},this._onItemOpened=new S.Signal(this),this._drag=null,this._dragData=null,this._resizeData=null,this._selectTimer=-1,this._isCut=!1,this._prevPath="",this._clipboard=[],this._softSelection="",this.selection=Object.create(null),this._searchPrefix="",this._searchPrefixTimer=-1,this._inRename=!1,this._isDirty=!1,this._hiddenColumns=new Set,this._columnSizes={name:null,file_size:null,is_selected:null,last_modified:null},this._sortNotebooksFirst=!1,this._allowSingleClick=!1,this._focusIndex=0,this._allUploaded=new S.Signal(this),this._width=null,this._state=null,this._contentScrollbarWidth=0,this._contentSizeObserver=new ResizeObserver(this._onContentResize.bind(this)),this._paddingWidth=0,this._handleWidth=5,this.addClass("jp-DirListing"),this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._model=e.model,this._model.fileChanged.connect(this._onFileChanged,this),this._model.refreshed.connect(this._onModelRefreshed,this),this._model.pathChanged.connect(this._onPathChanged,this),this._editNode=document.createElement("input"),this._editNode.className="jp-DirListing-editor",this._manager=this._model.manager,this._renderer=e.renderer||Z.defaultRenderer,this._state=e.state||null,this._updateModifiedSize(this.node);const t=i.DOMUtils.findElement(this.node,k);this._hiddenColumns.add("file_size"),this._renderer.populateHeaderNode(t,this.translator,this._hiddenColumns,this._columnSizes),this._manager.activateRequested.connect(this._onActivateRequested,this)}dispose(){this._items.length=0,this._sortedItems.length=0,this._clipboard.length=0,super.dispose()}get model(){return this._model}get headerNode(){return i.DOMUtils.findElement(this.node,k)}get contentNode(){return i.DOMUtils.findElement(this.node,M)}get renderer(){return this._renderer}get sortState(){return this._sortState}get onItemOpened(){return this._onItemOpened}selectedItems(){const e=this._sortedItems;return(0,m.filter)(e,(e=>this.selection[e.path]))}sortedItems(){return this._sortedItems[Symbol.iterator]()}sort(e){this._sortedItems=Q.sort(this.model.items(),e,this._sortNotebooksFirst),this._sortState=e,this.update()}rename(){return this._doRename()}cut(){this._isCut=!0,this._copy(),this.update()}copy(){this._copy()}paste(){if(!this._clipboard.length)return this._isCut=!1,Promise.resolve(void 0);const e=this._model.path,t=[];for(const s of this._clipboard)if(this._isCut){const i=this._manager.services.contents.localPath(s).split("/"),r=i[i.length-1],o=n.PathExt.join(e,r);t.push(this._model.manager.rename(s,o))}else t.push(this._model.manager.copy(s,e));for(const e of this._items)e.classList.remove(q);return this._clipboard.length=0,this._isCut=!1,this.removeClass("jp-mod-clipboard"),Promise.all(t).then((()=>{})).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Paste Error"),e)}))}async delete(){const e=this._sortedItems.filter((e=>this.selection[e.path]));if(!e.length)return;const t=1===e.length?this._trans.__("Are you sure you want to permanently delete: %1?",e[0].name):this._trans._n("Are you sure you want to permanently delete the %1 selected item?","Are you sure you want to permanently delete the %1 selected items?",e.length),s=await(0,i.showDialog)({title:this._trans.__("Delete"),body:t,buttons:[i.Dialog.cancelButton({label:this._trans.__("Cancel")}),i.Dialog.warnButton({label:this._trans.__("Delete")})],defaultButton:0});!this.isDisposed&&s.button.accept&&await this._delete(e.map((e=>e.path)));let n=this._focusIndex;const r=this._sortedItems.length-e.length-1;n>r&&(n=Math.max(0,r)),this._focusItem(n)}duplicate(){const e=this._model.path,t=[];for(const s of this.selectedItems())"directory"!==s.type&&t.push(this._model.manager.copy(s.path,e));return Promise.all(t).then((()=>{})).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Duplicate file"),e)}))}async download(){await Promise.all(Array.from(this.selectedItems()).filter((e=>"directory"!==e.type)).map((e=>this._model.download(e.path))))}async restore(e){const t=`file-browser-${e}:columns`,s=this._state;if(this._stateColumnsKey=t,s)try{const e=await s.fetch(t);if(!e)return;const i=e.sizes;if(!i)return;for(const[e,t]of Object.entries(i))this._columnSizes[e]=t;this._updateColumnSizes()}catch(e){await s.remove(t)}}shutdownKernels(){const e=this._model,t=this._sortedItems,s=t.map((e=>e.path)),n=Array.from(this._model.sessions()).filter((e=>{const i=m.ArrayExt.firstIndexOf(s,e.path);return this.selection[t[i].path]})).map((t=>e.manager.services.sessions.shutdown(t.id)));return Promise.all(n).then((()=>{})).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Shut down kernel"),e)}))}selectNext(e=!1){let t=-1;const s=Object.keys(this.selection),i=this._sortedItems;if(1===s.length||e){const e=s[s.length-1];t=m.ArrayExt.findFirstIndex(i,(t=>t.path===e)),t+=1,t===this._items.length&&(t=0)}else if(0===s.length)t=0;else{const e=s[s.length-1];t=m.ArrayExt.findFirstIndex(i,(t=>t.path===e))}-1!==t&&(this._selectItem(t,e),p.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[t]))}selectPrevious(e=!1){let t=-1;const s=Object.keys(this.selection),i=this._sortedItems;if(1===s.length||e){const e=s[0];t=m.ArrayExt.findFirstIndex(i,(t=>t.path===e)),t-=1,-1===t&&(t=this._items.length-1)}else if(0===s.length)t=this._items.length-1;else{const e=s[0];t=m.ArrayExt.findFirstIndex(i,(t=>t.path===e))}-1!==t&&(this._selectItem(t,e),p.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[t]))}selectByPrefix(){const e=this._searchPrefix.toLowerCase(),t=this._sortedItems,s=m.ArrayExt.findFirstIndex(t,(t=>t.name.toLowerCase().substr(0,e.length)===e));-1!==s&&(this._selectItem(s,!1),p.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[s]))}isSelected(e){const t=this._sortedItems;return 0!==Array.from((0,m.filter)(t,(t=>t.name===e&&this.selection[t.path]))).length}modelForClick(e){const t=this._sortedItems,s=Q.hitTestNodes(this._items,e);if(-1!==s)return t[s]}clearSelectedItems(){this.selection=Object.create(null)}async selectItemByName(e,t=!1){return this._selectItemByName(e,t)}async _selectItemByName(e,t=!1,s=!1){if(!s&&this.isSelected(e))return;if(await this.model.refresh(),this.isDisposed)throw new Error("File browser is disposed.");const i=this._sortedItems,n=m.ArrayExt.findFirstIndex(i,(t=>t.name===e));if(-1===n)throw new Error("Item does not exist.");this._selectItem(n,!1,t),F.MessageLoop.sendMessage(this,l.Widget.Msg.UpdateRequest),p.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[n])}handleEvent(e){switch(e.type){case"mousedown":this._evtMousedown(e);break;case"mouseup":this._evtMouseup(e);break;case"mousemove":this._evtMousemove(e);break;case"keydown":this.evtKeydown(e);break;case"click":this._evtClick(e);break;case"dblclick":this.evtDblClick(e);break;case"dragenter":case"dragover":this.addClass("jp-mod-native-drop"),e.preventDefault();break;case"dragleave":case"dragend":this.removeClass("jp-mod-native-drop");break;case"drop":this.removeClass("jp-mod-native-drop"),this.evtNativeDrop(e);break;case"scroll":this._evtScroll(e);break;case"lm-dragenter":this.evtDragEnter(e);break;case"lm-dragleave":this.evtDragLeave(e);break;case"lm-dragover":this.evtDragOver(e);break;case"lm-drop":this.evtDrop(e)}}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;this._width=this._computeContentWidth();const s=i.DOMUtils.findElement(t,M);t.addEventListener("mousedown",this),t.addEventListener("keydown",this),t.addEventListener("click",this),t.addEventListener("dblclick",this),this._contentSizeObserver.observe(s),s.addEventListener("dragenter",this),s.addEventListener("dragover",this),s.addEventListener("dragleave",this),s.addEventListener("dragend",this),s.addEventListener("drop",this),s.addEventListener("scroll",this),s.addEventListener("lm-dragenter",this),s.addEventListener("lm-dragleave",this),s.addEventListener("lm-dragover",this),s.addEventListener("lm-drop",this)}onBeforeDetach(e){super.onBeforeDetach(e);const t=this.node,s=i.DOMUtils.findElement(t,M);t.removeEventListener("mousedown",this),t.removeEventListener("keydown",this),t.removeEventListener("click",this),t.removeEventListener("dblclick",this),this._contentSizeObserver.disconnect(),s.removeEventListener("scroll",this),s.removeEventListener("dragover",this),s.removeEventListener("dragover",this),s.removeEventListener("dragleave",this),s.removeEventListener("dragend",this),s.removeEventListener("drop",this),s.removeEventListener("lm-dragenter",this),s.removeEventListener("lm-dragleave",this),s.removeEventListener("lm-dragover",this),s.removeEventListener("lm-drop",this),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0)}onAfterShow(e){this._isDirty&&(this.sort(this.sortState),this.update())}_onContentResize(){const e=i.DOMUtils.findElement(this.node,M),t=e.offsetWidth-e.clientWidth;t!=this._contentScrollbarWidth&&(this._contentScrollbarWidth=t,this._width=this._computeContentWidth(),this._updateColumnSizes())}_computeContentWidth(e=null){e||(e=this.node.getBoundingClientRect().width),this._paddingWidth=parseFloat(window.getComputedStyle(this.node).getPropertyValue("--jp-dirlisting-padding-width"));const t=this.node.querySelector(`.${H}`);return this._handleWidth=t?t.getBoundingClientRect().width:5,e-2*this._paddingWidth-this._contentScrollbarWidth}_updateModifiedSize(e){var t,s;const n=i.DOMUtils.findElement(e,U);this._modifiedWidth=null!==(s=null!==(t=this._columnSizes.last_modified)&&void 0!==t?t:null==n?void 0:n.getBoundingClientRect().width)&&void 0!==s?s:83,this._modifiedStyle=this._modifiedWidth<100?"narrow":this._modifiedWidth>120?"long":"short"}_updateModifiedStyleAndSize(){const e=this._modifiedStyle;this._updateModifiedSize(this.node),e!==this._modifiedStyle&&this.updateModified(this._sortedItems,this._items)}updateModified(e,t){e.forEach(((e,s)=>{const n=t[s];if(n&&e.last_modified){const t=i.DOMUtils.findElement(n,T);void 0!==this.renderer.updateItemModified?this.renderer.updateItemModified(t,e.last_modified,this._modifiedStyle):Z.defaultRenderer.updateItemModified(t,e.last_modified,this._modifiedStyle)}}))}updateNodes(e,t,s=!1){var i;e.forEach(((e,i)=>{const n=t[i];if(s&&this.renderer.updateItemSize){if(!n)return;return this.renderer.updateItemSize(n,e,this._modifiedStyle,this._columnSizes)}const r=this._manager.registry.getFileTypeForModel(e);this.renderer.updateItemNode(n,e,r,this.translator,this._hiddenColumns,this.selection[e.path],this._modifiedStyle,this._columnSizes),this.selection[e.path]&&this._isCut&&this._model.path===this._prevPath&&n.classList.add(q),n.setAttribute("data-isdir","directory"===e.type?"true":"false")}));const n=Object.keys(this.selection).length;n&&(this.addClass(K),n>1&&this.addClass(Y));const r=e.map((e=>e.path));for(const e of this._model.sessions()){const s=m.ArrayExt.firstIndexOf(r,e.path),n=t[s];if(n){let t=null===(i=e.kernel)||void 0===i?void 0:i.name;const s=this._model.specs;if(n.classList.add($),s&&t){const e=s.kernelspecs[t];t=e?e.display_name:this._trans.__("unknown")}n.title=this._trans.__("%1\nKernel: %2",n.title,t)}}}onUpdateRequest(e){this._isDirty=!1;const t=this._sortedItems,s=this._items,n=i.DOMUtils.findElement(this.node,M),r=this._renderer;for(this.removeClass(Y),this.removeClass(K);s.length>t.length;)n.removeChild(s.pop());for(;s.length<t.length;){const e=r.createItemNode(this._hiddenColumns,this._columnSizes);e.classList.add("jp-DirListing-item"),s.push(e),n.appendChild(e)}s.forEach(((e,t)=>{e.classList.remove(K),e.classList.remove($),e.classList.remove(q);const s=r.getCheckboxNode(e);s&&(s.checked=!1);const i=r.getNameNode(e);i&&(i.tabIndex=t===this._focusIndex?0:-1)}));const o=r.getCheckboxNode(this.headerNode);if(o){const e=Object.keys(this.selection).length,s=t.length>0&&e===t.length,i=!s&&e>0;o.checked=s,o.indeterminate=i,o.dataset.checked=String(s),o.dataset.indeterminate=String(i);const n=this.translator.load("jupyterlab");null==o||o.setAttribute("aria-label",s||i?n.__("Deselect all files and directories"):n.__("Select all files and directories"))}this.updateNodes(t,s),this._prevPath=this._model.path}onResize(e){const{width:t}=-1===e.width?this.node.getBoundingClientRect():e;this._width=this._computeContentWidth(t),this._updateColumnSizes()}setColumnVisibility(e,t){t?this._hiddenColumns.delete(e):this._hiddenColumns.add(e),this.headerNode.innerHTML="",this._renderer.populateHeaderNode(this.headerNode,this.translator,this._hiddenColumns,this._columnSizes),this._updateColumnSizes()}_updateColumnSizes(e=null){const t=this._visibleColumns.map((e=>({...e,element:i.DOMUtils.findElement(this.node,e.className)}))).filter((e=>e.element));let s=0;for(const e of t){let i=this._columnSizes[e.id];if(null===i&&(i=e.element.getBoundingClientRect().width),i=Math.max(i,e.minWidth),this._width){let s=0;for(const i of t)i.id!==e.id&&(s+=i.minWidth);i=Math.min(i,this._width-s)}this._columnSizes[e.id]=i,s+=i}if(this._width){const i=this._width-s;let n=null===e;const r=t.filter((t=>!!n||(t.id===e&&(n=!0),!1))),o=r.map((e=>e.grow)).reduce(((e,t)=>e+t),0);for(const e of r){const t=i*e.grow/o;this._columnSizes[e.id]=this._columnSizes[e.id]+t}}const n=this.node.getElementsByClassName(H),r=t.map((e=>Q.isResizable(e)));let o=0;for(const e of t){let t=this._columnSizes[e.id];Q.isResizable(e)&&t&&(t-=this._handleWidth*n.length/r.length,0!==o&&o!==r.length-1||(t+=this._paddingWidth),o+=1),e.element.style.width=null===t?"":t+"px"}this._updateModifiedStyleAndSize(),this.isVisible&&0!==this._items.length&&this.updateNodes(this._sortedItems,this._items,!0),this._state&&this._stateColumnsKey&&this._state.save(this._stateColumnsKey,{sizes:this._columnSizes})}get _visibleColumns(){return Z.columns.filter((e=>{var t;return"name"===e.id||!(null===(t=this._hiddenColumns)||void 0===t?void 0:t.has(e.id))}))}_setColumnSize(e,t){var s;const n=this._columnSizes[e];if(n&&t&&t>n){let n=0,r=!0;for(const o of this._visibleColumns)if(o.id!==e)if(r){const e=i.DOMUtils.findElement(this.node,o.className);n+=null!==(s=this._columnSizes[o.id])&&void 0!==s?s:e.getBoundingClientRect().width}else n+=o.minWidth;else n+=t,r=!1;if(this._width&&n>this._width)return}this._columnSizes[e]=t,this._updateColumnSizes(e)}setNotebooksFirstSorting(e){let t=this._sortNotebooksFirst;this._sortNotebooksFirst=e,this._sortNotebooksFirst!==t&&this.sort(this._sortState)}setAllowSingleClickNavigation(e){this._allowSingleClick=e}isWithinCheckboxHitArea(e){let t=e.target;for(;t;){if(t.classList.contains(B))return!0;t=t.parentElement}return!1}_evtClick(e){const t=e.target,s=this.headerNode,i=this._renderer;if(s.contains(t)){const t=i.getCheckboxNode(s);if(t&&this.isWithinCheckboxHitArea(e))"false"===t.dataset.indeterminate&&"false"===t.dataset.checked?this._sortedItems.forEach((e=>this.selection[e.path]=!0)):this.clearSelectedItems(),this.update();else{const t=this.renderer.handleHeaderClick(s,e);t&&this.sort(t)}}else this._focusItem(this._focusIndex)}_evtScroll(e){this.headerNode.scrollLeft=this.contentNode.scrollLeft}_evtMousedown(e){if(e.target===this._editNode)return;if(this._editNode.parentNode){if(this._editNode===e.target)return;this._editNode.focus(),this._editNode.blur(),clearTimeout(this._selectTimer)}let t=Q.hitTestNodes(this._items,e);if(-1!==t)this.handleFileSelect(e),0!==e.button&&clearTimeout(this._selectTimer),J&&e.ctrlKey||2===e.button||(0===e.button&&(this._dragData={pressX:e.clientX,pressY:e.clientY,index:t},document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0)),this._allowSingleClick&&this.evtDblClick(e));else if(0===e.button){const t=e.target;if(t instanceof HTMLElement&&t.classList.contains(H)){const s=t.dataset.column;if(!s)throw Error("Column resize handle is missing data-column attribute");const n=Z.columns.find((e=>e.id===s));if(!n)throw Error(`Column with identifier ${s} not found`);const r=i.DOMUtils.findElement(this.node,n.className);t.classList.add(X);const o=I.Drag.overrideCursor("col-resize");return this._resizeData={pressX:e.clientX,column:s,initialSize:r.getBoundingClientRect().width,overrides:new D.DisposableDelegate((()=>{o.dispose(),t.classList.remove(X)}))},document.addEventListener("mouseup",this,!0),void document.addEventListener("mousemove",this,!0)}}}_evtMouseup(e){return this._softSelection&&(e.metaKey||e.shiftKey||e.ctrlKey||0!==e.button||(this.clearSelectedItems(),this.selection[this._softSelection]=!0,this.update()),this._softSelection=""),0===e.button&&this._focusItem(this._focusIndex),this._resizeData?(this._resizeData.overrides.dispose(),document.removeEventListener("mousemove",this,!0),void document.removeEventListener("mouseup",this,!0)):0===e.button&&this._drag?(e.preventDefault(),void e.stopPropagation()):(document.removeEventListener("mousemove",this,!0),void document.removeEventListener("mouseup",this,!0))}_evtMousemove(e){if(e.preventDefault(),e.stopPropagation(),this._resizeData){const{initialSize:t,column:s,pressX:i}=this._resizeData;return void this._setColumnSize(s,t+e.clientX-i)}if(this._drag||!this._dragData)return;const t=this._dragData,s=Math.abs(e.clientX-t.pressX),i=Math.abs(e.clientY-t.pressY);s<5&&i<5||this._startDrag(t.index,e.clientX,e.clientY)}handleOpen(e){if(this._onItemOpened.emit(e),"directory"===e.type){const t=this._manager.services.contents.localPath(e.path);this._model.cd(`/${t}`).catch((e=>(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Open directory"),e)))}else{const t=e.path;this._manager.openOrReveal(t)}}_getNextFocusIndex(e,t){const s=e+t;return-1===s||s===this._items.length?e:s}_handleArrowY(e,t){if(e.altKey||e.metaKey)return;if(!this._items.length)return;if(!e.target.classList.contains(z))return;e.stopPropagation(),e.preventDefault();const s=this._focusIndex;let i=this._getNextFocusIndex(s,t);t>0&&0===s&&!e.ctrlKey&&0===Object.keys(this.selection).length&&(i=0),e.shiftKey?this._handleMultiSelect(i):e.ctrlKey||this._selectItem(i,e.shiftKey,!1),this._focusItem(i),this.update()}async goUp(){const e=this.model;if(e.path!==e.rootPath)try{await e.cd("..")}catch(t){console.warn(`Failed to go to parent directory of ${e.path}`,t)}}evtKeydown(e){if(!this._inRename){switch(e.keyCode){case 13:if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation();for(const e of this.selectedItems())this.handleOpen(e);return;case 38:return void this._handleArrowY(e,-1);case 40:return void this._handleArrowY(e,1);case 32:if(e.ctrlKey){if(e.metaKey||e.shiftKey||e.altKey)return;const t=this._items[this._focusIndex];if(!t.contains(e.target)||!t.contains(document.activeElement))return;e.stopPropagation(),e.preventDefault();const{path:s}=this._sortedItems[this._focusIndex];return this.selection[s]?delete this.selection[s]:this.selection[s]=!0,void this.update()}}if(void 0!==e.key&&1===e.key.length&&(" "!==e.key&&32!==e.keyCode||"checkbox"!==e.target.type)){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;this._searchPrefix+=e.key,clearTimeout(this._searchPrefixTimer),this._searchPrefixTimer=window.setTimeout((()=>{this._searchPrefix=""}),1e3),this.selectByPrefix(),e.stopPropagation(),e.preventDefault()}}}evtDblClick(e){if(0!==e.button)return;if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(this.isWithinCheckboxHitArea(e))return;e.preventDefault(),e.stopPropagation(),clearTimeout(this._selectTimer),this._editNode.blur();const t=e.target,s=m.ArrayExt.findFirstIndex(this._items,(e=>e.contains(t)));if(-1===s)return;const i=this._sortedItems[s];this.handleOpen(i)}evtNativeDrop(e){var t,s,i;e.preventDefault();const n=null===(t=e.dataTransfer)||void 0===t?void 0:t.items;if(!n){const t=null===(s=e.dataTransfer)||void 0===s?void 0:s.files;if(!t||0===t.length)return;const i=[];for(const e of t){const t=this._model.upload(e);i.push(t)}return void Promise.all(i).then((()=>this._allUploaded.emit())).catch((e=>{console.error("Error while uploading files: ",e)}))}const r=async(e,t)=>{if(Q.isDirectoryEntry(e)){const s=await Q.createDirectory(this._model.manager,t,e.name),i=e.createReader(),n=await Q.collectEntries(i);for(const e of n)await r(e,s)}else if(Q.isFileEntry(e)){const s=await Q.readFile(e);await this._model.upload(s,t)}},o=[];for(const e of n){const t=Q.defensiveGetAsEntry(e);if(!t)continue;const s=r(t,null!==(i=this._model.path)&&void 0!==i?i:"/");o.push(s)}Promise.all(o).then((()=>this._allUploaded.emit())).catch((e=>{console.error("Error while uploading files: ",e)}))}get allUploaded(){return this._allUploaded}evtDragEnter(e){if(e.mimeData.hasData(W)){const t=Q.hitTestNodes(this._items,e);if(-1===t)return;const s=this._sortedItems[t];if("directory"!==s.type||this.selection[s.path])return;e.target.classList.add(V),e.preventDefault(),e.stopPropagation()}}evtDragLeave(e){e.preventDefault(),e.stopPropagation();const t=i.DOMUtils.findElement(this.node,V);t&&t.classList.remove(V)}evtDragOver(e){e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction;const t=i.DOMUtils.findElement(this.node,V);t&&t.classList.remove(V);const s=Q.hitTestNodes(this._items,e);this._items[s].classList.add(V)}evtDrop(e){if(e.preventDefault(),e.stopPropagation(),clearTimeout(this._selectTimer),"none"===e.proposedAction)return void(e.dropAction="none");if(!e.mimeData.hasData(W))return;let t=e.target;for(;t&&t.parentElement;){if(t.classList.contains(V)){t.classList.remove(V);break}t=t.parentElement}const s=m.ArrayExt.firstIndexOf(this._items,t),r=this._sortedItems;let o=this._model.path;"directory"===r[s].type&&(o=n.PathExt.join(o,r[s].name));const a=this._manager,l=[],d=e.mimeData.getData(W);e.ctrlKey&&"move"===e.proposedAction?e.dropAction="copy":e.dropAction=e.proposedAction;for(const t of d){const s=a.services.contents.localPath(t),i=n.PathExt.basename(s),r=n.PathExt.join(o,i);r!==t&&("copy"===e.dropAction?l.push(a.copy(t,o)):l.push((0,c.renameFile)(a,t,r)))}Promise.all(l).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Error while copying/moving files"),e)}))}_startDrag(e,t,s){let i=Object.keys(this.selection);const n=this._items[e],r=this._sortedItems;let o,a;if(n.classList.contains(K)){const e=i[0];a=r.find((t=>t.path===e)),o=this.selectedItems()}else a=r[e],i=[a.path],o=[a];if(!a)return;const l=this._manager.registry.getFileTypeForModel(a),d=this.renderer.createDragImage(n,i.length,this._trans,l);this._drag=new I.Drag({dragImage:d,mimeData:new u.MimeData,supportedActions:"move",proposedAction:"move"}),this._drag.mimeData.setData(W,i);const h=this.model.manager.services;for(const e of o)this._drag.mimeData.setData("application/x-jupyter-icontentsrich",{model:e,withContent:async()=>await h.contents.get(e.path)});if(a&&"directory"!==a.type){const e=i.slice(1).reverse();this._drag.mimeData.setData("application/vnd.lumino.widget-factory",(()=>{if(!a)return;const t=a.path;let s=this._manager.findWidget(t);if(s||(s=this._manager.open(a.path)),e.length){const t=new u.PromiseDelegate;t.promise.then((()=>{let t=s;e.forEach((e=>{const s={ref:null==t?void 0:t.id,mode:"tab-after"};t=this._manager.openOrReveal(e,void 0,void 0,s),this._manager.openOrReveal(a.path)}))})),t.resolve(void 0)}return s}))}document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),clearTimeout(this._selectTimer),this._drag.start(t,s).then((e=>{this._drag=null,clearTimeout(this._selectTimer)}))}handleFileSelect(e){const t=this._sortedItems,s=Q.hitTestNodes(this._items,e);if(clearTimeout(this._selectTimer),-1===s)return;this._softSelection="";const i=t[s].path,n=Object.keys(this.selection),r=0===e.button&&!(J&&e.ctrlKey)&&this.isWithinCheckboxHitArea(e);if(J&&e.metaKey||!J&&e.ctrlKey||r)this.selection[i]?delete this.selection[i]:this.selection[i]=!0,this._focusItem(s);else if(e.shiftKey)this._handleMultiSelect(s),this._focusItem(s);else{if(!(i in this.selection&&n.length>1))return this._selectItem(s,!1,!0);this._softSelection=i}this.update()}_focusItem(e){const t=this._items;if(0===t.length)return this._focusIndex=0,void this.node.focus();this._focusIndex=e;const s=t[e],i=this.renderer.getNameNode(s);i&&(i.tabIndex=0,i.focus())}_allSelectedBetween(e,t){if(e===t)return;const[s,i]=e<t?[e+1,t]:[t+1,e];return this._sortedItems.slice(s,i).reduce(((e,t)=>e&&this.selection[t.path]),!0)}_handleMultiSelect(e){const t=this._sortedItems,s=this._focusIndex,i=t[e];let n=!0;if(e===s)return void(this.selection[i.path]=!0);if(this.selection[i.path])if(1===Math.abs(e-s)){const i=t[s],n=t[s+(e<s?1:-1)];!this.selection[i.path]||n&&this.selection[n.path]||delete this.selection[i.path]}else this._allSelectedBetween(s,e)&&(n=!1);const r=s<e?1:-1;for(let i=s;i!==e+r;i+=r)if(n){if(i===s)continue;this.selection[t[i].path]=!0}else{if(i===e)continue;delete this.selection[t[i].path]}}_copy(){this._clipboard.length=0;for(const e of this.selectedItems())this._clipboard.push(e.path)}async _delete(e){await Promise.all(e.map((e=>this._model.manager.deleteFile(e).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Delete Failed"),e)})))))}async _doRename(){this._inRename=!0;const e=Object.keys(this.selection);if(0===e.length)return this._inRename=!1,Promise.resolve("");const t=this._sortedItems;let{path:s}=t[this._focusIndex];this.selection[s]||(s=e.slice(-1)[0]);const r=m.ArrayExt.findFirstIndex(t,(e=>e.path===s)),o=this._items[r],a=t[r],l=this.renderer.getNameNode(o),d=a.name;this._editNode.value=d,this._selectItem(r,!1,!0);const h=await Q.userInputForRename(l,this._editNode,d);if(this.isDisposed)throw this._inRename=!1,new Error("File browser is disposed.");let u=h;if(h&&h!==d)if((0,c.isValidFileName)(h)){const e=this._manager,t=n.PathExt.join(this._model.path,d),s=n.PathExt.join(this._model.path,h);try{await(0,c.renameFile)(e,t,s)}catch(e){"File not renamed"!==e&&(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Rename Error"),e),u=d}if(this.isDisposed)throw this._inRename=!1,new Error("File browser is disposed.")}else(0,i.showErrorMessage)(this._trans.__("Rename Error"),Error(this._trans._p("showErrorMessage",'"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"',h))),u=d;else u=d;if(!this.isDisposed&&1===Object.keys(this.selection).length&&this.selection[a.path])try{await this._selectItemByName(u,!0,!0)}catch(e){console.warn("After rename, failed to select file",u)}return this._inRename=!1,u}_selectItem(e,t,s=!0){const i=this._sortedItems;t||this.clearSelectedItems();const n=i[e].path;this.selection[n]=!0,s&&this._focusItem(e),this.update()}_onModelRefreshed(){const e=Object.keys(this.selection);this.clearSelectedItems();for(const t of this._model.items()){const s=t.path;-1!==e.indexOf(s)&&(this.selection[s]=!0)}this.isVisible?this.sort(this.sortState):this._isDirty=!0}_onPathChanged(){this.clearSelectedItems(),this.sort(this.sortState),requestAnimationFrame((()=>{this._focusItem(0)}))}_onFileChanged(e,t){const s=t.newValue;if(!s)return;const i=s.name;"new"===t.type&&i&&this.selectItemByName(i).catch((()=>{}))}_onActivateRequested(e,t){if(n.PathExt.dirname(t)!==this._model.path)return;const s=n.PathExt.basename(t);this.selectItemByName(s).catch((()=>{}))}}var Q;!function(e){e.columns=[{id:"is_selected",className:B,itemClassName:B,minWidth:18,resizable:!1,sortable:!1,grow:0},{id:"name",className:R,itemClassName:j,minWidth:60,resizable:!0,sortable:!0,caretSide:"right",grow:3},{id:"last_modified",className:U,itemClassName:T,minWidth:60,resizable:!0,sortable:!0,caretSide:"left",grow:1},{id:"file_size",className:"jp-id-filesize",itemClassName:O,minWidth:60,resizable:!0,sortable:!0,caretSide:"left",grow:.5}];class t{constructor(){this.itemFactories={name:()=>{const e=document.createElement("span"),t=document.createElement("span"),s=document.createElement("span");return t.className=A,s.className=z,e.className=j,e.appendChild(t),e.appendChild(s),e},last_modified:()=>{const e=document.createElement("span");return e.className=T,e},file_size:()=>{const e=document.createElement("span");return e.className=O,e},is_selected:()=>this.createCheckboxWrapperNode()},this._modifiedColumnLastUpdate=new WeakMap}createNode(){const e=document.createElement("div"),t=document.createElement("div"),s=document.createElement("ul");return s.setAttribute("data-lm-dragscroll","true"),s.className=M,t.className=k,e.appendChild(t),e.appendChild(s),e.tabIndex=-1,e}populateHeaderNode(t,s,n,r){const a=(s=s||o.nullTranslator).load("jupyterlab"),l={name:()=>this.createHeaderItemNode(a.__("Name")),last_modified:()=>this._createHeaderItemNodeWithSizes({small:a.__("Modified"),large:a.__("Last Modified")}),file_size:()=>this._createHeaderItemNodeWithSizes({small:a.__("Size"),large:a.__("File Size")}),is_selected:()=>this.createCheckboxWrapperNode({alwaysVisible:!0,headerNode:!0})},d=e.columns.filter((e=>"name"===e.id||!(null==n?void 0:n.has(e.id))));for(const e of d){const s=(0,l[e.id])();s.classList.add(e.className);const i=e.id===d[d.length-1].id;if(r){const t=r[e.id];i||(s.style.width=t+"px")}if(t.appendChild(s),Q.isResizable(e)&&!i){const s=document.createElement("div");s.classList.add(H),s.dataset.column=e.id,t.appendChild(s)}}const h=i.DOMUtils.findElement(t,R);h.classList.add(K),Q.updateCaret(i.DOMUtils.findElement(h,L),"right","up")}handleHeaderClick(t,s){const n={direction:"ascending",key:"name"},r=s.target,o=e.columns.filter(Q.isSortable);for(const e of o){const s=t.querySelector(`.${e.className}`);if(s&&s.contains(r)){n.key=e.id;const r=i.DOMUtils.findElement(s,L);s.classList.contains(K)?s.classList.contains(G)?(s.classList.remove(G),Q.updateCaret(r,e.caretSide,"up")):(n.direction="descending",s.classList.add(G),Q.updateCaret(r,e.caretSide,"down")):(s.classList.remove(G),Q.updateCaret(r,e.caretSide,"up")),s.classList.add(K);for(const s of o){if(s.id===e.id)continue;const n=t.querySelector(`.${s.className}`);if(!n)continue;n.classList.remove(K),n.classList.remove(G);const r=i.DOMUtils.findElement(n,L);Q.updateCaret(r,s.caretSide)}return n}}return n}createItemNode(t,s){const i=document.createElement("li");for(const n of e.columns){if("name"!=n.id&&(null==t?void 0:t.has(n.id)))continue;const e=(0,this.itemFactories[n.id])();if(i.appendChild(e),s){const t=s[n.id];e.style.width=t+"px"}}return i}createCheckboxWrapperNode(e){const t=document.createElement("label");t.classList.add(B);const s=document.createElement("input");return s.type="checkbox",(null==e?void 0:e.headerNode)||s.addEventListener("click",(e=>{e.preventDefault()})),(null==e?void 0:e.alwaysVisible)?t.classList.add("jp-mod-visible"):s.tabIndex=-1,t.appendChild(s),t}updateItemModified(e,t,s){const i=this._modifiedColumnLastUpdate.get(e);if((null==i?void 0:i.date)===t&&(null==i?void 0:i.style)===s)return;const r=new Date(t),o=n.Time.formatHuman(r,s),a=n.Time.format(r);e.textContent=o,e.title=a,this._modifiedColumnLastUpdate.set(e,{date:t,style:s})}updateItemNode(e,t,s,r,l,d,h,c){d&&e.classList.add(K),s=s||E.DocumentRegistry.getDefaultTextFileType(r);const{icon:u,iconClass:p,name:_}=s,f=(r=r||o.nullTranslator).load("jupyterlab"),g=i.DOMUtils.findElement(e,A),v=i.DOMUtils.findElement(e,z),w=i.DOMUtils.findElement(e,j);let y=i.DOMUtils.findElement(e,T),b=i.DOMUtils.findElement(e,O);const C=i.DOMUtils.findElement(e,B),D=!(null==l?void 0:l.has("is_selected"));if(C&&!D)e.removeChild(C);else if(D&&!C){const e=this.createCheckboxWrapperNode();w.insertAdjacentElement("beforebegin",e)}const I=!(null==l?void 0:l.has("last_modified"));y&&!I?e.removeChild(y):I&&!y&&(y=this.itemFactories.last_modified(),w.insertAdjacentElement("afterend",y));const F=!(null==l?void 0:l.has("file_size"));b&&!F?e.removeChild(b):F&&!b&&(b=this.itemFactories.file_size(),(null!=y?y:w).insertAdjacentElement("afterend",b)),a.LabIcon.resolveElement({icon:u,iconClass:(0,a.classes)(p,"jp-Icon"),container:g,className:A,stylesheet:"listing"});let S=f.__("Name: %1",t.name);if(null!==t.size&&void 0!==t.size){const e=Q.formatFileSize(t.size,1,1024);b&&(b.textContent=e),S+=f.__("\nSize: %1",Q.formatFileSize(t.size,1,1024))}else b&&(b.textContent="");if(t.path){const e=n.PathExt.dirname(t.path);e&&(S+=f.__("\nPath: %1",e.substr(0,50)),e.length>50&&(S+="..."))}t.created&&(S+=f.__("\nCreated: %1",n.Time.format(new Date(t.created)))),t.last_modified&&(S+=f.__("\nModified: %1",n.Time.format(new Date(t.last_modified)))),S+=f.__("\nWritable: %1",t.writable),e.title=S,e.setAttribute("data-file-type",_),t.name.startsWith(".")?e.setAttribute("data-is-dot","true"):e.removeAttribute("data-is-dot");const k=t.indices?t.indices:[];let N=m.StringExt.highlight(t.name,k,x.h.mark);v&&x.VirtualDOM.render(x.h.span(N),v);const P=null==C?void 0:C.querySelector('input[type="checkbox"]');if(P){let e;e="directory"===s.contentType?d?f.__('Deselect directory "%1"',N):f.__('Select directory "%1"',N):d?f.__('Deselect file "%1"',N):f.__('Select file "%1"',N),P.setAttribute("aria-label",e),P.checked=null!=d&&d}this.updateItemSize(e,t,h,c)}updateItemSize(t,s,n,r){if(r)for(const s of e.columns){const e=i.DOMUtils.findElement(t,s.itemClassName);if(!e)continue;const n=r[s.id],o=null===n?"":n+"px";o!==e.style.width&&(e.style.width=o)}let o=i.DOMUtils.findElement(t,T);s.last_modified&&o&&this.updateItemModified(o,s.last_modified,null!=n?n:"short")}getNameNode(e){return i.DOMUtils.findElement(e,z)}getCheckboxNode(e){return e.querySelector(`.${B} input[type=checkbox]`)}createDragImage(e,t,s,n){const r=e.cloneNode(!0),o=i.DOMUtils.findElement(r,T),a=i.DOMUtils.findElement(r,A);return r.removeChild(o),n?(a.textContent=n.iconLabel||"",a.className=n.iconClass||""):(a.textContent="",a.className=""),a.classList.add("jp-DragIcon"),t>1&&(i.DOMUtils.findElement(r,z).textContent=s._n("%1 Item","%1 Items",t)),r}createHeaderItemNode(e){const t=document.createElement("div"),s=document.createElement("span"),i=document.createElement("span");return t.className=N,s.className=P,i.className=L,s.textContent=e,t.appendChild(s),t.appendChild(i),t}_createHeaderItemNodeWithSizes(e){const t=document.createElement("div");t.className=N;const s=document.createElement("span");s.className=L;for(let s of Object.keys(e)){const i=document.createElement("span");i.classList.add(P,P+"-"+s),i.textContent=e[s],t.appendChild(i)}return t.appendChild(s),t}}e.Renderer=t,e.defaultRenderer=new t}(Z||(Z={})),function(e){function t(e){return new Promise(((t,s)=>e.readEntries(t,s)))}e.userInputForRename=function(e,t,s){const i=e.parentElement;i.replaceChild(t,e),t.focus();const n=t.value.lastIndexOf(".");return-1===n?t.setSelectionRange(0,t.value.length):t.setSelectionRange(0,n),new Promise((n=>{t.onblur=()=>{i.replaceChild(e,t),n(t.value)},t.onkeydown=i=>{switch(i.keyCode){case 13:i.stopPropagation(),i.preventDefault(),t.blur();break;case 27:i.stopPropagation(),i.preventDefault(),t.value=s,t.blur(),e.focus()}}}))},e.sort=function(e,t,s=!1){const i=Array.from(e),n="descending"===t.direction?1:-1;function r(e){return"directory"===e.type?2:"notebook"===e.type&&s?1:0}function o(e){return(t,i)=>{if(function(e,t){return s?e.type!==t.type:"directory"===e.type!=("directory"===t.type)}(t,i))return r(i)-r(t);const o=e(t,i);return 0!==o?o*n:t.name.localeCompare(i.name)}}return"last_modified"===t.key?i.sort(o(((e,t)=>new Date(e.last_modified).getTime()-new Date(t.last_modified).getTime()))):"file_size"===t.key?i.sort(o(((e,t)=>{var s,i;return(null!==(s=t.size)&&void 0!==s?s:0)-(null!==(i=e.size)&&void 0!==i?i:0)}))):i.sort(o(((e,t)=>t.name.localeCompare(e.name)))),i},e.isResizable=e=>"resizable"in e&&e.resizable,e.isSortable=e=>"sortable"in e&&e.sortable,e.hitTestNodes=function(e,t){return m.ArrayExt.findFirstIndex(e,(e=>p.ElementExt.hitTest(e,t.clientX,t.clientY)||t.target===e))},e.formatFileSize=function(e,t,s){if(0===e)return"0 B";const i=t||2,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.floor(Math.log(e)/Math.log(s));return r>=0&&r<n.length?parseFloat((e/Math.pow(s,r)).toFixed(i))+" "+n[r]:String(e)},e.updateCaret=function(e,t,s){s?(("down"===s?a.caretDownIcon:a.caretUpIcon).element({container:e,tag:"span",stylesheet:"listingHeaderItem"}),e.style.order="left"===t?"-1":""):(a.LabIcon.remove(e),e.className=L)},e.createDirectory=async function(e,t,s){const i=await e.newUntitled({path:t,type:"directory"}),r=n.PathExt.join(t,i.name),o=n.PathExt.join(t,s);try{await e.rename(r,o)}catch(t){await e.deleteFile(r)}return o},e.isDirectoryEntry=function(e){return e.isDirectory},e.isFileEntry=function(e){return e.isFile},e.defensiveGetAsEntry=function(e){return e.webkitGetAsEntry?e.webkitGetAsEntry():"getAsEntry"in e?e.getAsEntry():null},e.readFile=function(e){return new Promise(((t,s)=>e.file(t,s)))},e.collectEntries=async function(e){const s=[];let i=!1;for(;!i;){const n=await t(e);0===n.length?i=!0:s.push(...n)}return s}}(Q||(Q={}));class ee extends a.SidePanel{constructor(e){var t;super({content:new l.Panel,translator:e.translator}),this._directoryPending=null,this._filePending=null,this._fileFilterRef=(0,d.createRef)(),this._allowSingleClick=!1,this._showFileCheckboxes=!1,this._showFileFilter=!1,this._showFileSizeColumn=!1,this._showHiddenFiles=!1,this._showLastModifiedColumn=!0,this._sortNotebooksFirst=!1,this.addClass("jp-FileBrowser"),this.toolbar.addClass("jp-FileBrowser-toolbar"),this.id=e.id;const s=this.translator=null!==(t=e.translator)&&void 0!==t?t:o.nullTranslator,i=this.model=e.model,n=e.renderer;i.connectionFailure.connect(this._onConnectionFailure,this),this._manager=i.manager,this.toolbar.node.setAttribute("aria-label",this._trans.__("file browser")),this.mainPanel=new l.Panel,this.mainPanel.addClass("jp-FileBrowser-Panel"),this.mainPanel.title.label=this._trans.__("File Browser"),this.crumbs=new b({model:i,translator:s}),this.crumbs.addClass("jp-FileBrowser-crumbs");const r=(0,a.FilenameSearcher)({updateFilter:(e,t)=>{this.model.setFilter((t=>e(t.name.toLowerCase())))},useFuzzyFilter:!0,placeholder:this._trans.__("Filter files by name"),forceRefresh:!1,showIcon:!1,inputRef:this._fileFilterRef});r.addClass("jp-FileBrowser-filterBox"),this.filterToolbar=new a.Toolbar,this.filterToolbar.addClass("jp-FileBrowser-filterToolbar"),this.filterToolbar.addItem("fileNameSearcher",r),this.filterToolbar.setHidden(!this.showFileFilter),this.listing=this.createDirListing({model:i,renderer:n,translator:s,state:e.state}),this.listing.addClass("jp-FileBrowser-listing"),this.mainPanel.addWidget(this.crumbs),this.mainPanel.addWidget(this.filterToolbar),this.mainPanel.addWidget(this.listing),this.addWidget(this.mainPanel),!1!==e.restore&&i.restore(this.id),this.listing.restore(this.id)}get navigateToCurrentDirectory(){return this._navigateToCurrentDirectory}set navigateToCurrentDirectory(e){this._navigateToCurrentDirectory=e}get showLastModifiedColumn(){return this._showLastModifiedColumn}set showLastModifiedColumn(e){this.listing.setColumnVisibility?(this.listing.setColumnVisibility("last_modified",e),this._showLastModifiedColumn=e):console.warn("Listing does not support toggling column visibility")}get showFullPath(){return this.crumbs.fullPath}set showFullPath(e){this.crumbs.fullPath=e}get showFileSizeColumn(){return this._showFileSizeColumn}set showFileSizeColumn(e){this.listing.setColumnVisibility?(this.listing.setColumnVisibility("file_size",e),this._showFileSizeColumn=e):console.warn("Listing does not support toggling column visibility")}get showHiddenFiles(){return this._showHiddenFiles}set showHiddenFiles(e){this.model.showHiddenFiles(e),this._showHiddenFiles=e}get showFileCheckboxes(){return this._showFileCheckboxes}set showFileCheckboxes(e){this.listing.setColumnVisibility?(this.listing.setColumnVisibility("is_selected",e),this._showFileCheckboxes=e):console.warn("Listing does not support toggling column visibility")}get showFileFilter(){return this._showFileFilter}set showFileFilter(e){var t;this.showFileFilter&&!e&&(this._fileFilterRef.current&&(this._fileFilterRef.current.value=""),this.model.setFilter((e=>({}))),this.model.refresh().catch(console.warn)),this._showFileFilter=e,this.filterToolbar.setHidden(!this.showFileFilter),this.showFileFilter&&(null===(t=this._fileFilterRef.current)||void 0===t||t.focus())}get sortNotebooksFirst(){return this._sortNotebooksFirst}set sortNotebooksFirst(e){this.listing.setNotebooksFirstSorting?(this.listing.setNotebooksFirstSorting(e),this._sortNotebooksFirst=e):console.warn("Listing does not support sorting notebooks first")}get singleClickNavigation(){return this._allowSingleClick}set singleClickNavigation(e){this.listing.setAllowSingleClickNavigation?(this.listing.setAllowSingleClickNavigation(e),this._allowSingleClick=e):console.warn("Listing does not support single click navigation")}selectedItems(){return this.listing.selectedItems()}async selectItemByName(e){await this.listing.selectItemByName(e)}clearSelectedItems(){this.listing.clearSelectedItems()}rename(){return this.listing.rename()}cut(){this.listing.cut()}copy(){this.listing.copy()}paste(){return this.listing.paste()}async _createNew(e){if(e.path){const t=this._manager.services.contents.localPath(e.path);e.path=this._toDrivePath(this.model.driveName,t)}try{const t=await this._manager.newUntitled(e);return await this.listing.selectItemByName(t.name,!0),await this.rename(),t}catch(e){throw(0,i.showErrorMessage)(this._trans.__("Error"),e),e}}async createNewDirectory(){if(this._directoryPending)return this._directoryPending;this._directoryPending=this._createNew({path:this.model.path,type:"directory"});try{return await this._directoryPending}finally{this._directoryPending=null}}async createNewFile(e){if(this._filePending)return this._filePending;this._filePending=this._createNew({path:this.model.path,type:"file",ext:e.ext});try{return await this._filePending}finally{this._filePending=null}}delete(){return this.listing.delete()}duplicate(){return this.listing.duplicate()}download(){return this.listing.download()}async goUp(){return this.listing.goUp()}shutdownKernels(){return this.listing.shutdownKernels()}selectNext(){this.listing.selectNext()}selectPrevious(){this.listing.selectPrevious()}modelForClick(e){return this.listing.modelForClick(e)}createDirListing(e){return new Z(e)}_onConnectionFailure(e,t){if(t instanceof r.ServerConnection.ResponseError&&404===t.response.status){const e=this._trans.__("Directory not found");t.message=this._trans.__('Directory not found: "%1"',this.model.path),(0,i.showErrorMessage)(e,t)}}_toDrivePath(e,t){return""===e?t:`${e}:${n.PathExt.removeSlash(t)}`}}var te=s(32406);const se=15728640,ie=1048576;class ne{constructor(e){var t;this._connectionFailure=new S.Signal(this),this._fileChanged=new S.Signal(this),this._items=[],this._key="",this._pathChanged=new S.Signal(this),this._paths=new Set,this._pending=null,this._pendingPath=null,this._refreshed=new S.Signal(this),this._sessions=[],this._state=null,this._isDisposed=!1,this._restored=new u.PromiseDelegate,this._uploads=[],this._uploadChanged=new S.Signal(this),this.manager=e.manager,this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._driveName=e.driveName||"",this._model={path:this.rootPath,name:n.PathExt.basename(this.rootPath),type:"directory",content:void 0,writable:!1,created:"unknown",last_modified:"unknown",mimetype:"text/plain",format:"text"},this._state=e.state||null;const s=e.refreshInterval||1e4,{services:i}=e.manager;i.contents.fileChanged.connect(this.onFileChanged,this),i.sessions.runningChanged.connect(this.onRunningChanged,this),this._unloadEventListener=e=>{if(this._uploads.length>0){const t=this._trans.__("Files still uploading");return e.returnValue=t,t}},window.addEventListener("beforeunload",this._unloadEventListener),this._poll=new te.Poll({auto:null===(t=e.auto)||void 0===t||t,name:"@jupyterlab/filebrowser:Model",factory:()=>this.cd("."),frequency:{interval:s,backoff:!0,max:3e5},standby:e.refreshStandby||"when-hidden"})}get connectionFailure(){return this._connectionFailure}get driveName(){return this._driveName}get restored(){return this._restored.promise}get fileChanged(){return this._fileChanged}get path(){return this._model?this._model.path:""}get rootPath(){return this._driveName?this._driveName+":":""}get pathChanged(){return this._pathChanged}get refreshed(){return this._refreshed}get specs(){return this.manager.services.kernelspecs.specs}get isDisposed(){return this._isDisposed}get uploadChanged(){return this._uploadChanged}uploads(){return this._uploads[Symbol.iterator]()}dispose(){this.isDisposed||(window.removeEventListener("beforeunload",this._unloadEventListener),this._isDisposed=!0,this._poll.dispose(),this._sessions.length=0,this._items.length=0,S.Signal.clearData(this))}items(){return this._items[Symbol.iterator]()}sessions(){return this._sessions[Symbol.iterator]()}async refresh(){await this._poll.refresh(),await this._poll.tick,this._refreshed.emit(void 0)}async cd(e="."){if(e="."!==e?this.manager.services.contents.resolvePath(this._model.path,e):this._pendingPath||this._model.path,this._pending){if(e===this._pendingPath)return this._pending;await this._pending}const t=this.path;this._pendingPath=e,t!==e&&(this._sessions.length=0);const s=this.manager.services;return this._pending=s.contents.get(e,{content:!0}).then((i=>{this.isDisposed||(this.handleContents(i),this._pendingPath=null,this._pending=null,t!==e&&(this._state&&this._key&&this._state.save(this._key,{path:e}),this._pathChanged.emit({name:"path",oldValue:t,newValue:e})),this.onRunningChanged(s.sessions,s.sessions.running()),this._refreshed.emit(void 0))})).catch((t=>{if(this._pendingPath=null,this._pending=null,t.response&&404===t.response.status&&"/"!==e)return t.message=this._trans.__('Directory not found: "%1"',this._model.path),console.error(t),this._connectionFailure.emit(t),this.cd("/");this._connectionFailure.emit(t)})),this._pending}async download(e){const t=await this.manager.services.contents.getDownloadUrl(e),s=document.createElement("a");s.href=t,s.download="",document.body.appendChild(s),s.click(),document.body.removeChild(s)}async restore(e,t=!0){const{manager:s}=this,i=`file-browser-${e}:cwd`,n=this._state;if(!this._key)if(this._key=i,t&&n){await s.services.ready;try{const e=await n.fetch(i);if(!e)return void this._restored.resolve(void 0);const t=e.path;t&&await this.cd("/");const r=s.services.contents.localPath(t);await s.services.contents.get(t),await this.cd(r)}catch(e){await n.remove(i)}this._restored.resolve(void 0)}else this._restored.resolve(void 0)}async upload(e,t){const s=n.PageConfig.getNotebookVersion(),i=s<[4,0,0]||s>=[5,1,0],r=e.size>se;if(r&&!i){const t=this._trans.__("Cannot upload file (>%1 MB). %2",se/1048576,e.name);throw console.warn(t),t}if(r&&!await this._shouldUploadLarge(e))throw"Cancelled large file upload";if(await this._uploadCheckDisposed(),await this.refresh(),await this._uploadCheckDisposed(),this._items.find((t=>t.name===e.name))&&!await(0,c.shouldOverwrite)(e.name))throw"File not uploaded";await this._uploadCheckDisposed();const o=i&&e.size>ie;return await this._upload(e,o,t)}async _shouldUploadLarge(e){const{button:t}=await(0,i.showDialog)({title:this._trans.__("Large file size warning"),body:this._trans.__("The file size is %1 MB. Do you still want to upload it?",Math.round(e.size/1048576)),buttons:[i.Dialog.cancelButton({label:this._trans.__("Cancel")}),i.Dialog.warnButton({label:this._trans.__("Upload")})]});return t.accept}async _upload(e,t,s){let i=void 0===s?this._model.path:s;i=i?i+"/"+e.name:e.name;const n=e.name,r=async(t,s)=>{await this._uploadCheckDisposed();const r=new FileReader;r.readAsDataURL(t),await new Promise(((t,s)=>{r.onload=t,r.onerror=t=>s(`Failed to upload "${e.name}":`+t)})),await this._uploadCheckDisposed();const o=r.result.split(",")[1],a={type:"file",format:"base64",name:n,chunk:s,content:o};return await this.manager.services.contents.save(i,a)};if(!t)try{return await r(e)}catch(t){throw m.ArrayExt.removeFirstWhere(this._uploads,(t=>e.name===t.path)),t}let o,a={path:i,progress:0};this._uploadChanged.emit({name:"start",newValue:a,oldValue:null});for(let t=0;!o;t+=ie){const s=t+ie,n=s>=e.size,l=n?-1:s/ie,d={path:i,progress:t/e.size};let h;this._uploads.splice(this._uploads.indexOf(a)),this._uploads.push(d),this._uploadChanged.emit({name:"update",newValue:d,oldValue:a}),a=d;try{h=await r(e.slice(t,s),l)}catch(t){throw m.ArrayExt.removeFirstWhere(this._uploads,(t=>e.name===t.path)),this._uploadChanged.emit({name:"failure",newValue:a,oldValue:null}),t}n&&(o=h)}return this._uploads.splice(this._uploads.indexOf(a)),this._uploadChanged.emit({name:"finish",newValue:null,oldValue:a}),o}_uploadCheckDisposed(){return this.isDisposed?Promise.reject("Filemanager disposed. File upload canceled"):Promise.resolve()}handleContents(e){this._model={name:e.name,path:e.path,type:e.type,content:void 0,writable:e.writable,created:e.created,last_modified:e.last_modified,size:e.size,mimetype:e.mimetype,format:e.format},this._items=e.content,this._paths.clear(),e.content.forEach((e=>{this._paths.add(e.path)}))}onRunningChanged(e,t){this._populateSessions(t),this._refreshed.emit(void 0)}onFileChanged(e,t){const s=this._model.path,{sessions:i}=this.manager.services,{oldValue:r,newValue:o}=t;if(r&&r.path&&n.PathExt.dirname(r.path)===s?r:o&&o.path&&n.PathExt.dirname(o.path)===s?o:void 0)return this._poll.refresh(),this._populateSessions(i.running()),void this._fileChanged.emit(t)}_populateSessions(e){this._sessions.length=0;for(const t of e)this._paths.has(t.path)&&this._sessions.push(t)}}class re extends ne{constructor(e){super(e),this._includeHiddenFiles=e.includeHiddenFiles||!1}items(){return this._includeHiddenFiles?super.items():(0,m.filter)(super.items(),(e=>!e.name.startsWith(".")))}showHiddenFiles(e){this._includeHiddenFiles=e,this.refresh()}}class oe extends re{constructor(e){var t,s;super(e),this._filter=null!==(t=e.filter)&&void 0!==t?t:e=>({}),this._filterDirectories=null===(s=e.filterDirectories)||void 0===s||s}get filterDirectories(){return this._filterDirectories}set filterDirectories(e){this._filterDirectories=e}items(){return(0,m.filter)(super.items(),(e=>{if(this._filterDirectories||"directory"!==e.type){const t=this._filter(e);return e.indices=null==t?void 0:t.indices,!!t}return!0}))}setFilter(e){this._filter=e,this.refresh()}}var ae,le;!function(e){async function t(e){const t=e.translator||o.nullTranslator,s=t.load("jupyterlab"),n=new de(e.manager,e.filter,t,e.defaultPath,e.label),r={title:e.title,buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:s.__("Select")})],focusNodeSelector:e.focusNodeSelector,host:e.host,renderer:e.renderer,body:n};return await n.ready,new i.Dialog(r).launch()}e.getOpenFiles=t,e.getExistingDirectory=function(e){return t({...e,filter:e=>"directory"===e.type?{}:null})}}(ae||(ae={}));class de extends l.Widget{constructor(e,t,s,n,r,d){super(),this._ready=new u.PromiseDelegate;const h=(s=null!=s?s:o.nullTranslator).load("jupyterlab");this.addClass("jp-Open-Dialog"),le.createFilteredFileBrowser("filtered-file-browser-dialog",e,t,{},s,n,d).then((e=>{this._browser=e,(0,i.setToolbar)(this._browser,(e=>[{name:"new-folder",widget:new i.ToolbarButton({icon:a.newFolderIcon,onClick:()=>{e.createNewDirectory()},tooltip:h.__("New Folder")})},{name:"refresher",widget:new i.ToolbarButton({icon:a.refreshIcon,onClick:()=>{e.model.refresh().catch((e=>{console.error("Failed to refresh file browser in open dialog.",e)}))},tooltip:h.__("Refresh File List")})}]));const t=new l.PanelLayout;if(r){const e=new l.Widget;e.addClass("jp-Open-Dialog-label"),e.node.textContent=r,t.addWidget(e)}t.addWidget(this._browser),this.dispose=()=>{this.isDisposed||(this._browser.model.dispose(),super.dispose())},this.layout=t,this._ready.resolve()})).catch((e=>{console.error("Error while creating file browser in open dialog",e),this._ready.reject(void 0)}))}getValue(){const e=Array.from(this._browser.selectedItems());return 0===e.length?[{path:this._browser.model.path,name:n.PathExt.basename(this._browser.model.path),type:"directory",content:void 0,writable:!1,created:"unknown",last_modified:"unknown",mimetype:"text/plain",format:"text"}]:e}get ready(){return this._ready.promise}}!function(e){e.createFilteredFileBrowser=async(e,t,s,i={},n,r,a)=>{n=n||o.nullTranslator;const l=new oe({manager:t,filter:s,translator:n,driveName:i.driveName,refreshInterval:i.refreshInterval,filterDirectories:a}),d=new ee({id:e,model:l,translator:n});return r&&await d.model.cd(r),d}}(le||(le={}));const he=new u.Token("@jupyterlab/filebrowser:IFileBrowserFactory","A factory object that creates file browsers.\n Use this if you want to create your own file browser (e.g., for a custom storage backend),\n or to interact with other file browsers that have been created by extensions."),ce=new u.Token("@jupyterlab/filebrowser:IDefaultFileBrowser","A service for the default file browser."),me=new u.Token("@jupyterlab/filebrowser:IFileBrowserCommands","A token to ensure file browser commands are loaded.");class ue extends a.ToolbarButton{constructor(e){super({icon:a.fileUploadIcon,label:e.label,onClick:()=>{this._input.click()},tooltip:pe.translateToolTip(e.translator)}),this._onInputChanged=()=>{const e=Array.prototype.slice.call(this._input.files).map((e=>this.fileBrowserModel.upload(e)));Promise.all(e).catch((e=>{(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Upload Error"),e)}))},this._onInputClicked=()=>{this._input.value=""},this._input=pe.createUploadInput(),this.fileBrowserModel=e.model,this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._input.onclick=this._onInputClicked,this._input.onchange=this._onInputChanged,this.addClass("jp-id-upload")}}var pe;!function(e){e.createUploadInput=function(){const e=document.createElement("input");return e.type="file",e.multiple=!0,e},e.translateToolTip=function(e){return(e=e||o.nullTranslator).load("jupyterlab").__("Upload Files")}}(pe||(pe={}));var _e=s(15603);function fe(e){const t=(e.translator||o.nullTranslator).load("jupyterlab");return h().createElement(_e.GroupItem,{spacing:4},h().createElement(_e.TextItem,{source:t.__("Uploading…")}),h().createElement(_e.ProgressBar,{percentage:e.upload}))}class ge extends a.VDomRenderer{constructor(e){super(new ge.Model(e.tracker.currentWidget&&e.tracker.currentWidget.model)),this._onBrowserChange=(e,t)=>{this.model.browserModel=null===t?null:t.model},this.translator=e.translator||o.nullTranslator,this._trans=this.translator.load("jupyterlab"),this._tracker=e.tracker,this._tracker.currentChanged.connect(this._onBrowserChange)}render(){return this.model.items.length>0?this.model.items[0].complete?h().createElement(_e.TextItem,{source:this._trans.__("Complete!")}):h().createElement(fe,{upload:this.model.items[0].progress,translator:this.translator}):h().createElement(fe,{upload:100,translator:this.translator})}dispose(){super.dispose(),this._tracker.currentChanged.disconnect(this._onBrowserChange)}}!function(e){class t extends a.VDomModel{constructor(e){super(),this._uploadChanged=(e,t)=>{if("start"===t.name)this._items.push({path:t.newValue.path,progress:100*t.newValue.progress,complete:!1});else if("update"===t.name){const e=m.ArrayExt.findFirstIndex(this._items,(e=>e.path===t.oldValue.path));-1!==e&&(this._items[e].progress=100*t.newValue.progress)}else if("finish"===t.name){const e=m.ArrayExt.findFirstValue(this._items,(e=>e.path===t.oldValue.path));e&&(e.complete=!0,setTimeout((()=>{m.ArrayExt.removeFirstOf(this._items,e),this.stateChanged.emit(void 0)}),2e3))}else"failure"===t.name&&m.ArrayExt.removeFirstWhere(this._items,(e=>e.path===t.newValue.path));this.stateChanged.emit(void 0)},this._items=[],this._browserModel=null,this.browserModel=e}get items(){return this._items}get browserModel(){return this._browserModel}set browserModel(e){const t=this._browserModel;t&&t.uploadChanged.disconnect(this._uploadChanged),this._browserModel=e,this._items=[],null!==this._browserModel&&this._browserModel.uploadChanged.connect(this._uploadChanged),this.stateChanged.emit(void 0)}}e.Model=t}(ge||(ge={}))}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[9357],{75921:(e,t,n)=>{n.r(t),n.d(t,{ITableOfContentsRegistry:()=>c,ITableOfContentsTracker:()=>d,TableOfContents:()=>u,TableOfContentsFactory:()=>r,TableOfContentsItem:()=>C,TableOfContentsModel:()=>g,TableOfContentsPanel:()=>w,TableOfContentsRegistry:()=>H,TableOfContentsTracker:()=>y,TableOfContentsTree:()=>T,TableOfContentsUtils:()=>i,TableOfContentsWidget:()=>b});var s={};n.r(s),n.d(s,{getHeadingId:()=>D,getHeadings:()=>I,isMarkdown:()=>L});var i={};n.r(i),n.d(i,{Markdown:()=>s,NUMBERING_CLASS:()=>A,addPrefix:()=>S,clearNumbering:()=>P,filterHeadings:()=>k,getHTMLHeadings:()=>O,getPrefix:()=>M,isHTML:()=>E});var a=n(77075);class r{constructor(e){this.tracker=e}isApplicable(e){return!!this.tracker.has(e)}createNew(e,t){const n=this._createNew(e,t),s=e.context,i=()=>{n.refresh().catch((e=>{console.error("Failed to update the table of contents.",e)}))},r=new a.ActivityMonitor({signal:s.model.contentChanged,timeout:1e3});r.activityStopped.connect(i);const l=()=>{n.title=a.PathExt.basename(s.localPath)};return s.pathChanged.connect(l),s.ready.then((()=>{l(),i()})).catch((e=>{console.error(`Failed to initiate headings for ${s.localPath}.`)})),e.disposed.connect((()=>{r.activityStopped.disconnect(i),s.pathChanged.disconnect(l)})),n}}var l=n(7258),o=n(21961),h=n(2159);const c=new o.Token("@jupyterlab/toc:ITableOfContentsRegistry","A service to register table of content factory."),d=new o.Token("@jupyterlab/toc:ITableOfContentsTracker","A widget tracker for table of contents.");var u;!function(e){e.defaultConfig={baseNumbering:1,maximalDepth:4,numberingH1:!0,numberHeaders:!1,includeOutput:!0,syncCollapseState:!1}}(u||(u={}));class g extends l.VDomModel{constructor(e,t){super(),this.widget=e,this._activeHeading=null,this._activeHeadingChanged=new h.Signal(this),this._collapseChanged=new h.Signal(this),this._configuration=null!=t?t:{...u.defaultConfig},this._headings=new Array,this._headingsChanged=new h.Signal(this),this._isActive=!1,this._isRefreshing=!1,this._needsRefreshing=!1}get activeHeading(){return this._activeHeading}get activeHeadingChanged(){return this._activeHeadingChanged}get collapseChanged(){return this._collapseChanged}get configuration(){return this._configuration}get headings(){return this._headings}get headingsChanged(){return this._headingsChanged}get isActive(){return this._isActive}set isActive(e){this._isActive=e,this._isActive&&!this.isAlwaysActive&&this.refresh().catch((e=>{console.error("Failed to refresh ToC model.",e)}))}get isAlwaysActive(){return!1}get supportedOptions(){return["maximalDepth"]}get title(){return this._title}set title(e){e!==this._title&&(this._title=e,this.stateChanged.emit())}async refresh(){if(this._isRefreshing)return this._needsRefreshing=!0,Promise.resolve();this._isRefreshing=!0;try{const e=await this.getHeadings();if(this._needsRefreshing)return this._needsRefreshing=!1,this._isRefreshing=!1,this.refresh();e&&!this._areHeadingsEqual(e,this._headings)&&(this._headings=e,this.stateChanged.emit(),this._headingsChanged.emit())}finally{this._isRefreshing=!1}}setActiveHeading(e,t=!0){this._activeHeading!==e&&(this._activeHeading=e,this.stateChanged.emit()),t&&this._activeHeadingChanged.emit(this._activeHeading)}setConfiguration(e){const t={...this._configuration,...e};o.JSONExt.deepEqual(this._configuration,t)||(this._configuration=t,this.refresh().catch((e=>{console.error("Failed to update the table of contents.",e)})))}toggleCollapse(e){var t,n;if(e.heading)e.heading.collapsed=null!==(t=e.collapsed)&&void 0!==t?t:!e.heading.collapsed,this.stateChanged.emit(),this._collapseChanged.emit(e.heading);else{const t=null!==(n=e.collapsed)&&void 0!==n?n:!this.headings.some((e=>{var t;return!(null!==(t=e.collapsed)&&void 0!==t&&t)}));this.headings.forEach((e=>e.collapsed=t)),this.stateChanged.emit(),this._collapseChanged.emit(null)}}isHeadingEqual(e,t){return e.level===t.level&&e.text===t.text&&e.prefix===t.prefix}_areHeadingsEqual(e,t){if(e.length===t.length){for(let n=0;n<e.length;n++)if(!this.isHeadingEqual(e[n],t[n]))return!1;return!0}return!1}}var p,f=n(2260),m=n(78156),_=n(55947),v=n(63956);class C extends m.PureComponent{render(){const{children:e,isActive:t,heading:n,onCollapse:s,onMouseDown:i}=this.props;return m.createElement(v.k,{className:"jp-tocItem jp-TreeItem nested",selected:t,expanded:!n.collapsed,onExpand:e=>{e.defaultPrevented||e.target.expanded===!n.collapsed||(e.preventDefault(),s(n))},onMouseDown:e=>{e.defaultPrevented||(e.preventDefault(),i(n))},onKeyUp:e=>{e.defaultPrevented||"Enter"!==e.key||t||(e.preventDefault(),i(n))}},m.createElement("div",{className:"jp-tocItem-heading"},m.createElement("span",{className:"jp-tocItem-content",title:n.text,...n.dataset},n.prefix,n.text)),e)}}class T extends m.PureComponent{render(){const{documentType:e}=this.props;return m.createElement(_.L,{className:"jp-TableOfContents-content jp-TreeView","data-document-type":e},this.buildTree())}buildTree(){if(0===this.props.headings.length)return[];const e=t=>{const n=this.props.headings,s=new Array,i=n[t];let a=t+1;for(;a<n.length&&!(n[a].level<=i.level);){const[t,n]=e(a);s.push(t),a=n}return[m.createElement(C,{key:`${i.level}-${t}-${i.text}`,isActive:!!this.props.activeHeading&&i===this.props.activeHeading,heading:i,onMouseDown:this.props.setActiveHeading,onCollapse:this.props.onCollapseChange},s.length?s:null),a]},t=new Array;let n=0;for(;n<this.props.headings.length;){const[s,i]=e(n);t.push(s),n=i}return t}}class b extends l.VDomRenderer{constructor(e){super(e.model),this._placeholderHeadline=e.placeholderHeadline,this._placeholderText=e.placeholderText}render(){return this.model&&0!==this.model.headings.length?m.createElement(T,{activeHeading:this.model.activeHeading,documentType:this.model.documentType,headings:this.model.headings,onCollapseChange:e=>{this.model.toggleCollapse({heading:e})},setActiveHeading:e=>{this.model.setActiveHeading(e)}}):m.createElement("div",{className:"jp-TableOfContents-placeholder"},m.createElement("div",{className:"jp-TableOfContents-placeholderContent"},m.createElement("h3",null,this._placeholderHeadline),m.createElement("p",null,this._placeholderText)))}}class w extends l.SidePanel{constructor(e){super({content:new f.Panel,translator:e}),this._model=null,this.addClass("jp-TableOfContents"),this._title=new p.Header(this._trans.__("Table of Contents")),this.header.addWidget(this._title),this._treeview=new b({placeholderHeadline:this._trans.__("No Headings"),placeholderText:this._trans.__("The table of contents shows headings in notebooks and supported files.")}),this._treeview.addClass("jp-TableOfContents-tree"),this.content.addWidget(this._treeview)}get model(){return this._model}set model(e){var t,n;this._model!==e&&(null===(t=this._model)||void 0===t||t.stateChanged.disconnect(this._onTitleChanged,this),this._model=e,this._model&&(this._model.isActive=this.isVisible),null===(n=this._model)||void 0===n||n.stateChanged.connect(this._onTitleChanged,this),this._onTitleChanged(),this._treeview.model=this._model)}onAfterHide(e){super.onAfterHide(e),this._model&&(this._model.isActive=!1)}onBeforeShow(e){super.onBeforeShow(e),this._model&&(this._model.isActive=!0)}_onTitleChanged(){var e,t;this._title.setTitle(null!==(t=null===(e=this._model)||void 0===e?void 0:e.title)&&void 0!==t?t:this._trans.__("Table of Contents"))}}!function(e){class t extends f.Widget{constructor(e){const t=document.createElement("h2");t.textContent=e,t.classList.add("jp-text-truncated"),super({node:t}),this._title=t}setTitle(e){this._title.textContent=e}}e.Header=t}(p||(p={}));var x=n(49901);class H{constructor(){this._generators=new Map,this._idCounter=0}getModel(e,t){for(const n of this._generators.values())if(n.isApplicable(e))return n.createNew(e,t)}add(e){const t=this._idCounter++;return this._generators.set(t,e),new x.DisposableDelegate((()=>{this._generators.delete(t)}))}}class y{constructor(){this.modelMapping=new WeakMap}add(e,t){this.modelMapping.set(e,t)}get(e){const t=this.modelMapping.get(e);return!t||t.isDisposed?null:t}}const A="numbering-entry";function k(e,t,n=[]){const s={...u.defaultConfig,...t},i=n;let a=i.length;const r=new Array;for(const t of e){if(t.skip)continue;const e=t.level;if(e>0&&e<=s.maximalDepth){const n=M(e,a,i,s);a=e,r.push({...t,prefix:n})}}return r}function E(e){return"text/html"===e}function O(e,t=!0){var n;const s=document.createElement("div");s.innerHTML=e;const i=new Array,a=s.querySelectorAll("h1, h2, h3, h4, h5, h6");for(const e of a){const t=parseInt(e.tagName[1],10);i.push({text:null!==(n=e.textContent)&&void 0!==n?n:"",level:t,id:null==e?void 0:e.getAttribute("id"),skip:e.classList.contains("jp-toc-ignore")||e.classList.contains("tocSkip")})}return i}function S(e,t,n){let s=e.querySelector(t);if(!s)return null;if(s.querySelector(`span.${A}`)){const i=e.querySelectorAll(t);for(const e of i)if(!e.querySelector(`span.${A}`)){s=e,j(e,n);break}}else j(s,n);return s}function M(e,t,n,s){const{baseNumbering:i,numberingH1:a,numberHeaders:r}=s;let l="";if(r){const s=a?1:2;if(e>t){for(let s=t;s<e-1;s++)n[s]=0;n[e-1]=e===s?i:1}else n[e-1]+=1,e<t&&n.splice(e);a?l=n.map((e=>null!=e?e:0)).join(".")+". ":n.length>1&&(l=n.slice(1).map((e=>null!=e?e:0)).join(".")+". ")}return l}function j(e,t){e.insertAdjacentHTML("afterbegin",`<span class="${A}">${t}</span>`)}function P(e){null==e||e.querySelectorAll(`span.${A}`).forEach((e=>{e.remove()}))}var R=n(20911),N=n(95704);async function D(e,t,n,s){try{const i=document.createElement("div");await(0,N.renderMarkdown)({markdownParser:e,host:i,source:t,trusted:!1,sanitizer:null!=s?s:new R.Sanitizer,shouldTypeset:!1,resolver:null,linkHandler:null,latexTypesetter:null});const a=i.querySelector(`h${n}`);return a?a.id:null}catch(e){console.error("Failed to parse a heading.",e)}return null}function I(e){const t=e.split("\n"),n=new Array;let s,i,a=0,r=0;if("---"===t[r])for(let e=r+1;e<t.length;e++)if("---"===t[e]){r=e+1;break}for(;r<t.length;r++){const e=t[r];if(""===e)continue;if(e.startsWith("```")||e.startsWith("~~~")){const t=q(e);if(0===t)continue;if(0===a){i=e.charAt(0),s=!s,a=t;continue}i===e.charAt(0)&&t>=a&&(s=!s,a=0,i="")}if(s)continue;const l=U(e,t[r+1]);l&&n.push({...l,line:r})}return n}function q(e){let t;return t=e.startsWith("`")?e.match(/^(`{3,})/):e.match(/^(~{3,})/),t?t[0].length:0}const $=["text/x-ipythongfm","text/x-markdown","text/x-gfm","text/markdown"];function L(e){return $.includes(e)}function U(e,t){let n=e.match(/^([#]{1,6}) (.*)/);return n?{text:W(n[2]),level:n[1].length,raw:e,skip:F.test(n[0])}:t&&(n=t.match(/^ {0,3}([=]{2,}|[-]{2,})\s*$/),n)?{text:W(e),level:"="===n[1][0]?1:2,raw:[e,t].join("\n"),skip:F.test(e)}:(n=e.match(/<h([1-6]).*>(.*)<\/h\1>/i),n?{text:n[2],level:parseInt(n[1],10),skip:F.test(n[0]),raw:e}:null)}function W(e){return e.replace(/\[(.+)\]\(.+\)/g,"$1")}const F=/<\w+\s(.*?\s)?class="(.*?\s)?(jp-toc-ignore|tocSkip)(\s.*?)?"(\s.*?)?>/}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[9380],{19380:(e,t,o)=>{o.r(t),o.d(t,{default:()=>c});var a=o(15465),n=o(2646),r=o(25291),u=o(16971),l=o(78156);const s=[{text:"About Jupyter",url:"https://jupyter.org"},{text:"Markdown Reference",url:"https://commonmark.org/help/"},{text:"Documentation",url:"https://jupyter-notebook.readthedocs.io/en/stable/"}];var p;!function(e){e.open="help:open",e.about="help:about"}(p||(p={}));const c=[{id:"@jupyter-notebook/help-extension:open",autoStart:!0,description:"A plugin to open the about section with resources",activate:e=>{const{commands:t}=e;t.addCommand(p.open,{label:e=>e.text,execute:e=>{const t=e.url;window.open(t)}})}},{id:"@jupyter-notebook/help-extension:about",autoStart:!0,requires:[r.ITranslator],optional:[n.IMainMenu,a.ICommandPalette],description:"Plugin to add a command to show an About Jupyter Notebook and Markdown Reference",activate:(e,t,o,n)=>{const{commands:r}=e,c=t.load("notebook"),b=c.__("Help");r.addCommand(p.about,{label:c.__("About %1",e.name),execute:()=>{const t=l.createElement(l.Fragment,null,l.createElement("span",{className:"jp-AboutNotebook-header"},l.createElement(u.jupyterIcon.react,{width:"196px",height:"auto"}))),o=c.__("JUPYTER NOTEBOOK ON GITHUB"),n=c.__("CONTRIBUTOR LIST"),r=l.createElement("span",null,l.createElement("a",{href:"https://github.com/jupyter/notebook",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat jp-AboutNotebook-about-externalLinks"},o),l.createElement("a",{href:"https://github.com/jupyter/notebook/pulse",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat jp-AboutNotebook-about-externalLinks"},n)),s=c.__("Version: %1",e.version),p=c.__("© 2021-2023 Jupyter Notebook Contributors"),b=l.createElement(l.Fragment,null,l.createElement("span",{className:"jp-AboutNotebook-version"},s),l.createElement("div",null,r),l.createElement("span",{className:"jp-AboutNotebook-about-copyright"},p)),m=new a.Dialog({title:t,body:b,buttons:[a.Dialog.createButton({label:c.__("Dismiss"),className:"jp-AboutNotebook-about-button jp-mod-reject jp-mod-styled"})]});m.addClass("jp-AboutNotebook"),m.launch()}}),n&&n.addItem({command:p.about,category:b});const m=s.map((e=>({args:e,command:p.open})));o&&o.helpMenu.addGroup(m,30)}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[9380],{19380:(e,t,o)=>{o.r(t),o.d(t,{default:()=>c});var a=o(20911),n=o(68567),r=o(66649),u=o(98977),l=o(78156);const s=[{text:"About Jupyter",url:"https://jupyter.org"},{text:"Markdown Reference",url:"https://commonmark.org/help/"},{text:"Documentation",url:"https://jupyter-notebook.readthedocs.io/en/stable/"}];var p;!function(e){e.open="help:open",e.about="help:about"}(p||(p={}));const c=[{id:"@jupyter-notebook/help-extension:open",autoStart:!0,description:"A plugin to open the about section with resources",activate:e=>{const{commands:t}=e;t.addCommand(p.open,{label:e=>e.text,execute:e=>{const t=e.url;window.open(t)}})}},{id:"@jupyter-notebook/help-extension:about",autoStart:!0,requires:[r.ITranslator],optional:[n.IMainMenu,a.ICommandPalette],description:"Plugin to add a command to show an About Jupyter Notebook and Markdown Reference",activate:(e,t,o,n)=>{const{commands:r}=e,c=t.load("notebook"),b=c.__("Help");r.addCommand(p.about,{label:c.__("About %1",e.name),execute:()=>{const t=l.createElement(l.Fragment,null,l.createElement("span",{className:"jp-AboutNotebook-header"},l.createElement(u.jupyterIcon.react,{width:"196px",height:"auto"}))),o=c.__("JUPYTER NOTEBOOK ON GITHUB"),n=c.__("CONTRIBUTOR LIST"),r=l.createElement("span",null,l.createElement("a",{href:"https://github.com/jupyter/notebook",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat jp-AboutNotebook-about-externalLinks"},o),l.createElement("a",{href:"https://github.com/jupyter/notebook/pulse",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat jp-AboutNotebook-about-externalLinks"},n)),s=c.__("Version: %1",e.version),p=c.__("© 2021-2023 Jupyter Notebook Contributors"),b=l.createElement(l.Fragment,null,l.createElement("span",{className:"jp-AboutNotebook-version"},s),l.createElement("div",null,r),l.createElement("span",{className:"jp-AboutNotebook-about-copyright"},p)),m=new a.Dialog({title:t,body:b,buttons:[a.Dialog.createButton({label:c.__("Dismiss"),className:"jp-AboutNotebook-about-button jp-mod-reject jp-mod-styled"})]});m.addClass("jp-AboutNotebook"),m.launch()}}),n&&n.addItem({command:p.about,category:b});const m=s.map((e=>({args:e,command:p.open})));o&&o.helpMenu.addGroup(m,30)}}]}}]);