notebook 7.3.0a1__py3-none-any.whl → 7.3.0b0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of notebook might be problematic. Click here for more details.

Files changed (231) hide show
  1. notebook/_version.py +1 -1
  2. notebook/app.py +10 -2
  3. notebook/static/113.bundle.js +1 -1
  4. notebook/static/1198.bundle.js +1 -1
  5. notebook/static/134.bundle.js +1 -1
  6. notebook/static/1408.bundle.js +1 -1
  7. notebook/static/1496.bundle.js +1 -1
  8. notebook/static/1584.bundle.js +1 -1
  9. notebook/static/1647.bundle.js +1 -1
  10. notebook/static/1650.bundle.js +1 -1
  11. notebook/static/1684.bundle.js +1 -1
  12. notebook/static/170.bundle.js +1 -1
  13. notebook/static/1809.bundle.js +1 -1
  14. notebook/static/1827.bundle.js +1 -1
  15. notebook/static/1828.bundle.js +1 -1
  16. notebook/static/1833.bundle.js +1 -1
  17. notebook/static/1958.bundle.js +1 -1
  18. notebook/static/1962.bundle.js +1 -1
  19. notebook/static/2007.bundle.js +1 -1
  20. notebook/static/2065.bundle.js +1 -1
  21. notebook/static/2088.bundle.js +1 -1
  22. notebook/static/2089.bundle.js +1 -1
  23. notebook/static/2122.bundle.js +1 -1
  24. notebook/static/2167.bundle.js +1 -1
  25. notebook/static/2184.bundle.js +1 -1
  26. notebook/static/2311.bundle.js +1 -1
  27. notebook/static/{3030.bundle.js → 2323.bundle.js} +1 -1
  28. notebook/static/2401.bundle.js +1 -1
  29. notebook/static/2424.bundle.js +377 -0
  30. notebook/static/2479.bundle.js +1 -1
  31. notebook/static/2489.bundle.js +1 -1
  32. notebook/static/2607.bundle.js +1 -1
  33. notebook/static/2615.bundle.js +1 -1
  34. notebook/static/2636.bundle.js +1 -1
  35. notebook/static/2756.bundle.js +1 -1
  36. notebook/static/2813.bundle.js +1 -1
  37. notebook/static/2866.bundle.js +1 -1
  38. notebook/static/2924.bundle.js +1 -1
  39. notebook/static/2944.bundle.js +1 -1
  40. notebook/static/2955.bundle.js +1 -0
  41. notebook/static/3129.bundle.js +1 -1
  42. notebook/static/3146.bundle.js +1 -1
  43. notebook/static/3187.bundle.js +1 -1
  44. notebook/static/3213.bundle.js +1 -1
  45. notebook/static/3301.bundle.js +1 -1
  46. notebook/static/3325.bundle.js +1 -1
  47. notebook/static/3340.bundle.js +1 -1
  48. notebook/static/3360.bundle.js +1 -1
  49. notebook/static/{1261.bundle.js → 3463.bundle.js} +1 -1
  50. notebook/static/3466.bundle.js +1 -1
  51. notebook/static/35.bundle.js +1 -1
  52. notebook/static/3512.bundle.js +1 -1
  53. notebook/static/3676.bundle.js +1 -1
  54. notebook/static/3680.bundle.js +1 -1
  55. notebook/static/374.bundle.js +1 -1
  56. notebook/static/3768.bundle.js +1 -1
  57. notebook/static/377.bundle.js +1 -1
  58. notebook/static/3863.bundle.js +1 -1
  59. notebook/static/3881.bundle.js +1 -1
  60. notebook/static/4042.bundle.js +1 -1
  61. notebook/static/4058.bundle.js +1 -1
  62. notebook/static/409.bundle.js +1 -1
  63. notebook/static/4212.bundle.js +1 -1
  64. notebook/static/4242.bundle.js +79 -0
  65. notebook/static/4271.bundle.js +1 -1
  66. notebook/static/4291.bundle.js +1 -1
  67. notebook/static/4382.bundle.js +1 -1
  68. notebook/static/4526.bundle.js +1 -1
  69. notebook/static/4588.bundle.js +1 -1
  70. notebook/static/4630.bundle.js +1 -1
  71. notebook/static/4645.bundle.js +1 -1
  72. notebook/static/4811.bundle.js +1 -1
  73. notebook/static/4837.bundle.js +1 -1
  74. notebook/static/5099.bundle.js +1 -1
  75. notebook/static/5135.bundle.js +1 -1
  76. notebook/static/5166.bundle.js +1 -1
  77. notebook/static/5234.bundle.js +1 -1
  78. notebook/static/5254.bundle.js +1 -1
  79. notebook/static/5261.bundle.js +1 -1
  80. notebook/static/5263.bundle.js +1 -0
  81. notebook/static/5313.bundle.js +1 -1
  82. notebook/static/5325.bundle.js +1 -1
  83. notebook/static/5346.bundle.js +1 -1
  84. notebook/static/5426.bundle.js +1 -1
  85. notebook/static/5430.bundle.js +653 -0
  86. notebook/static/545.bundle.js +1 -1
  87. notebook/static/5451.bundle.js +1 -1
  88. notebook/static/5573.bundle.js +1 -1
  89. notebook/static/5601.bundle.js +1 -1
  90. notebook/static/5649.bundle.js +3 -3
  91. notebook/static/5733.bundle.js +1 -1
  92. notebook/static/5850.bundle.js +1 -1
  93. notebook/static/5912.bundle.js +1 -1
  94. notebook/static/5921.bundle.js +1 -1
  95. notebook/static/6017.bundle.js +1 -1
  96. notebook/static/6061.bundle.js +1 -1
  97. notebook/static/6139.bundle.js +1 -1
  98. notebook/static/62.bundle.js +1 -1
  99. notebook/static/6271.bundle.js +1 -1
  100. notebook/static/6345.bundle.js +1 -1
  101. notebook/static/6604.bundle.js +1 -1
  102. notebook/static/6621.bundle.js +1 -1
  103. notebook/static/6627.bundle.js +1 -1
  104. notebook/static/6648.bundle.js +1 -0
  105. notebook/static/6731.bundle.js +1 -1
  106. notebook/static/6748.bundle.js +1 -1
  107. notebook/static/677.bundle.js +1 -1
  108. notebook/static/6815.bundle.js +1 -1
  109. notebook/static/6853.bundle.js +1 -1
  110. notebook/static/6893.bundle.js +1 -1
  111. notebook/static/690.bundle.js +1 -1
  112. notebook/static/6962.bundle.js +1 -1
  113. notebook/static/6999.bundle.js +1 -1
  114. notebook/static/7226.bundle.js +1 -1
  115. notebook/static/7252.bundle.js +1 -1
  116. notebook/static/7302.bundle.js +1 -1
  117. notebook/static/7369.bundle.js +1 -1
  118. notebook/static/7386.bundle.js +1 -1
  119. notebook/static/7391.bundle.js +1 -1
  120. notebook/static/7543.bundle.js +1 -1
  121. notebook/static/7603.bundle.js +1 -1
  122. notebook/static/7639.bundle.js +1 -1
  123. notebook/static/7655.bundle.js +1 -1
  124. notebook/static/7684.bundle.js +1 -1
  125. notebook/static/7812.bundle.js +1 -1
  126. notebook/static/7819.bundle.js +1 -1
  127. notebook/static/7821.bundle.js +1 -1
  128. notebook/static/7854.bundle.js +1 -1
  129. notebook/static/7866.bundle.js +1 -0
  130. notebook/static/7900.bundle.js +1 -1
  131. notebook/static/7906.bundle.js +1 -1
  132. notebook/static/8010.bundle.js +1 -1
  133. notebook/static/8032.bundle.js +1 -1
  134. notebook/static/8285.bundle.js +1 -1
  135. notebook/static/8471.bundle.js +1 -1
  136. notebook/static/8579.bundle.js +1 -1
  137. notebook/static/8633.bundle.js +1 -1
  138. notebook/static/8635.bundle.js +41 -0
  139. notebook/static/8771.bundle.js +1 -1
  140. notebook/static/8781.bundle.js +1 -1
  141. notebook/static/8875.bundle.js +1 -1
  142. notebook/static/8907.bundle.js +1 -1
  143. notebook/static/8928.bundle.js +1 -1
  144. notebook/static/8929.bundle.js +1 -1
  145. notebook/static/893.bundle.js +1 -1
  146. notebook/static/901.bundle.js +1 -1
  147. notebook/static/9068.bundle.js +1 -1
  148. notebook/static/911.bundle.js +1 -1
  149. notebook/static/9136.bundle.js +1 -1
  150. notebook/static/9151.bundle.js +1 -1
  151. notebook/static/9161.bundle.js +1 -1
  152. notebook/static/9268.bundle.js +1 -1
  153. notebook/static/9335.bundle.js +1 -1
  154. notebook/static/9341.bundle.js +1 -1
  155. notebook/static/9380.bundle.js +1 -1
  156. notebook/static/9605.bundle.js +1 -1
  157. notebook/static/9638.bundle.js +1 -1
  158. notebook/static/9672.bundle.js +352 -0
  159. notebook/static/9680.bundle.js +1 -1
  160. notebook/static/9685.bundle.js +1 -1
  161. notebook/static/9752.bundle.js +1 -1
  162. notebook/static/9799.bundle.js +1 -0
  163. notebook/static/9821.bundle.js +1 -1
  164. notebook/static/9852.bundle.js +1 -1
  165. notebook/static/bundle.js +1 -1
  166. notebook/static/third-party-licenses.json +124 -130
  167. notebook/templates/consoles.html +1 -1
  168. notebook/templates/edit.html +1 -1
  169. notebook/templates/error.html +1 -1
  170. notebook/templates/notebooks.html +1 -1
  171. notebook/templates/terminals.html +1 -1
  172. notebook/templates/tree.html +1 -1
  173. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +17 -17
  174. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +5 -5
  175. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  176. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +11 -11
  177. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +18 -18
  178. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -1
  179. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +13 -13
  180. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +12 -12
  181. notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.67f8b11d2af855286118.js +1 -0
  182. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/600.25341cef1598f2727482.js → notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/907.767373e59d0c0e33ef12.js +1 -1
  183. notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.50419fa0a72e54064396.js +1 -0
  184. notebook-7.3.0b0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.fd0956ebf15f666a19f8.js +1 -0
  185. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  186. {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/METADATA +2 -2
  187. {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/RECORD +210 -218
  188. notebook/static/1226.bundle.js +0 -1
  189. notebook/static/1750.bundle.js +0 -1
  190. notebook/static/1884.bundle.js +0 -386
  191. notebook/static/4045.bundle.js +0 -1
  192. notebook/static/4434.bundle.js +0 -1
  193. notebook/static/5018.bundle.js +0 -1
  194. notebook/static/5712.bundle.js +0 -1
  195. notebook/static/6164.bundle.js +0 -1
  196. notebook/static/6318.bundle.js +0 -1
  197. notebook/static/6619.bundle.js +0 -1
  198. notebook/static/6898.bundle.js +0 -1
  199. notebook/static/7506.bundle.js +0 -703
  200. notebook/static/7579.bundle.js +0 -1
  201. notebook/static/8054.bundle.js +0 -1
  202. notebook/static/8647.bundle.js +0 -1
  203. notebook/static/8723.bundle.js +0 -1
  204. notebook/static/9734.bundle.js +0 -1
  205. notebook/static/9906.bundle.js +0 -1
  206. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.45e1d3167710e94c3d26.js +0 -1
  207. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.b94c92715d631efb4a8f.js +0 -1
  208. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.8ca922abea871b34db72.js +0 -1
  209. /notebook/static/{7506.bundle.js.LICENSE.txt → 4242.bundle.js.LICENSE.txt} +0 -0
  210. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  211. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  212. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  213. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  214. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  215. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  216. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  217. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  218. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  219. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  220. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  221. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  222. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  223. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  224. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  225. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  226. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  227. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  228. {notebook-7.3.0a1.data → notebook-7.3.0b0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  229. {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/WHEEL +0 -0
  230. {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/entry_points.txt +0 -0
  231. {notebook-7.3.0a1.dist-info → notebook-7.3.0b0.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3768,7302],{83768:(e,t,o)=>{o.r(t),o.d(t,{default:()=>F});var n=o(15465),r=o(44548),i=o(73684),a=o(87844),s=o(44262),l=o(62159),d=o(25291),c=o(12668),g=o(81997),u=o(63485),w=o(70747),h=o(78156),b=o.n(h);class p{constructor(e){this._onSelectionChanged=()=>{var e,t,o,n,r,i;const a=Array.from(this._browser.selectedItems()),s=a.length>0,l=a.some((e=>"directory"===e.type));null===(e=this._widgets.get("placeholder"))||void 0===e||e.setHidden(s),null===(t=this._widgets.get("delete"))||void 0===t||t.setHidden(!s),null===(o=this._widgets.get("duplicate"))||void 0===o||o.setHidden(!s||l),null===(n=this._widgets.get("download"))||void 0===n||n.setHidden(!s||l),null===(r=this._widgets.get("open"))||void 0===r||r.setHidden(!s||l),null===(i=this._widgets.get("rename"))||void 0===i||i.setHidden(1!==a.length)},this._widgets=new Map,this._browser=e.browser;const{commands:t,selectionChanged:o,translator:r}=e,i=r.load("notebook"),a=n.ReactWidget.create(b().createElement("div",{key:"placeholder"},i.__("Select items to perform actions on them.")));a.id="fileAction-placeholder",this._widgets.set("placeholder",a),["open","download","rename","duplicate","delete"].forEach((e=>{const o=n.ReactWidget.create(b().createElement(n.CommandToolbarButtonComponent,{key:e,commands:t,id:`filebrowser:${e}`,args:{toolbar:!0},icon:void 0}));o.id=`fileAction-${e}`,o.addClass("jp-ToolbarButton"),o.addClass("jp-FileAction"),this._widgets.set(e,o)})),o.connect(this._onSelectionChanged,this),this._onSelectionChanged()}get widgets(){return this._widgets.values()}}const m="FileBrowser";var f;!function(e){e.activate="filebrowser:activate"}(f||(f={}));const _={id:"@jupyter-notebook/tree-extension:new",description:"Plugin to add extra commands to the file browser to create new notebooks, files, consoles and terminals.",requires:[d.ITranslator],optional:[n.IToolbarWidgetRegistry],autoStart:!0,activate:(e,t,o)=>{var n;const{commands:r,serviceManager:i}=e,a=t.load("notebook"),s={overflowMenuOptions:{isVisible:!1}},l=new u.MenuBar(s),d=new u.Menu({commands:r});d.title.label=a.__("New"),d.title.icon=c.caretDownIcon,l.addMenu(d);const g=()=>{var e,t;const o=null===(t=null===(e=i.kernelspecs)||void 0===e?void 0:e.specs)||void 0===t?void 0:t.kernelspecs;for(const e in o)d.addItem({args:{kernelName:e,isLauncher:!0},command:"notebook:create-new"});["terminal:create-new","console:create","filebrowser:create-new-file","filebrowser:create-new-directory"].forEach((e=>{d.addItem({command:e})}))};null===(n=i.kernelspecs)||void 0===n||n.specsChanged.connect((()=>{d.clearItems(),g()})),g(),o&&o.addFactory(m,"new-dropdown",(e=>{const t=new u.MenuBar(s);return t.addMenu(d),t.addClass("jp-DropdownMenu"),t}))}},v={id:"@jupyter-notebook/tree-extension:file-actions",description:"A plugin to add file browser actions to the file browser toolbar.",autoStart:!0,requires:[i.IDefaultFileBrowser,n.IToolbarWidgetRegistry,d.ITranslator],activate:(e,t,o,n)=>{const r=new g.Signal(t);["_selectItem","_handleMultiSelect","handleFileSelect"].forEach((e=>{const o=t.listing[e];t.listing[e]=(...e)=>{o.call(t.listing,...e),r.emit(void 0)}}));const{commands:i}=e,a=new p({commands:i,browser:t,selectionChanged:r,translator:n});for(const e of a.widgets)o.addFactory(m,e.id,(()=>e))}},y={id:"@jupyter-notebook/tree-extension:load-plugins",description:"Plugin to load the default plugins that are loaded on all the Notebook pages (tree, edit, view, etc.) so they are visible in the settings editor.",autoStart:!0,requires:[a.ISettingRegistry],activate(e,t){const{isDisabled:o}=r.PageConfig.Extension,n=t.connector,i=r.PageConfig.getOption("allPlugins");if(!i)return;const a=JSON.parse(i),s=new Set;Object.keys(a).forEach((e=>{const t=a[e];Object.keys(t).forEach((e=>{const o=t[e];"boolean"==typeof o&&o?s.add(e):Array.isArray(o)&&o.forEach((e=>{s.add(e)}))}))})),e.restored.then((async()=>{(await n.list("all")).ids.forEach((async e=>{const[n]=e.split(":");if((s.has(n)||s.has(e))&&!o(e)&&!(e in t.plugins))try{await t.load(e)}catch(t){console.warn(`Settings failed to load for (${e})`,t)}}))}))}},k={id:"@jupyter-notebook/tree-extension:open-file-browser",description:"A plugin to add file browser commands for the tree view.",requires:[w.INotebookTree,i.IDefaultFileBrowser],autoStart:!0,activate:(e,t,o)=>{const{commands:n}=e;n.addCommand(f.activate,{execute:()=>{t.currentWidget=o}})}},S={id:"@jupyter-notebook/tree-extension:widget",description:"A plugin to add the file browser widget to an INotebookShell.",requires:[i.IDefaultFileBrowser,d.ITranslator,a.ISettingRegistry,n.IToolbarWidgetRegistry,i.IFileBrowserFactory],optional:[s.IRunningSessionManagers,l.ISettingEditorTracker,l.IJSONSettingEditorTracker],autoStart:!0,provides:w.INotebookTree,activate:(e,t,o,r,a,l,d,g,u)=>{const h=new w.NotebookTreeWidget,b=o.load("notebook");if(t.title.label=b.__("Files"),t.node.setAttribute("role","region"),t.node.setAttribute("aria-label",b.__("File Browser Section")),t.title.icon=c.folderIcon,h.addWidget(t),h.tabBar.addTab(t.title),h.tabsMovable=!1,a.addFactory(m,"uploader",(e=>new i.Uploader({model:e.model,translator:o,label:b.__("Upload")}))),a.addFactory(m,"fileNameSearcher",(e=>{const t=(0,c.FilenameSearcher)({updateFilter:(t,o)=>{e.model.setFilter((e=>t(e.name.toLowerCase())))},useFuzzyFilter:!0,placeholder:b.__("Filter files by name"),forceRefresh:!0});return t.addClass("jp-FileBrowser-filterBox"),t})),(0,n.setToolbar)(t,(0,n.createToolbarFactory)(a,r,m,S.id,o)),d){const e=new s.RunningSessions(d,o);e.id="jp-running-sessions-tree",e.title.label=b.__("Running"),e.title.icon=c.runningIcon,h.addWidget(e),h.tabBar.addTab(e.title)}const p=r.load("@jupyterlab/filebrowser-extension:browser");Promise.all([p,e.restored]).then((([e])=>{["showFileCheckboxes","showFileSizeColumn","sortNotebooksFirst","showFullPath"].forEach((t=>{void 0===e.user[t]&&e.set(t,!0)}))})).catch((e=>{console.error(e.message)})),e.shell.add(h,"main",{rank:100}),[g,u].forEach((e=>{e&&e.widgetAdded.connect(((e,t)=>{h.addWidget(t),h.tabBar.addTab(t.title),h.currentWidget=t}))}));const{tracker:f}=l,_=()=>{f._pool.current=t};return f.widgetAdded.connect(((e,t)=>_())),_(),h}},F=[_,v,y,k,S]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3768,7302],{83768:(e,t,o)=>{o.r(t),o.d(t,{default:()=>T});var n=o(53876),i=o(20754),r=o(58427),a=o(3012),s=o(26537),l=o(23470),d=o(93050),c=o(76878),g=o(2159),u=o(2260),w=o(21261),b=o(78156),h=o.n(b);class p{constructor(e){this._onSelectionChanged=()=>{var e,t,o,n,i,r;const a=Array.from(this._browser.selectedItems()),s=a.length>0,l=a.some((e=>"directory"===e.type));null===(e=this._widgets.get("placeholder"))||void 0===e||e.setHidden(s),null===(t=this._widgets.get("delete"))||void 0===t||t.setHidden(!s),null===(o=this._widgets.get("duplicate"))||void 0===o||o.setHidden(!s||l),null===(n=this._widgets.get("download"))||void 0===n||n.setHidden(!s||l),null===(i=this._widgets.get("open"))||void 0===i||i.setHidden(!s||l),null===(r=this._widgets.get("rename"))||void 0===r||r.setHidden(1!==a.length)},this._widgets=new Map,this._browser=e.browser;const{commands:t,selectionChanged:o,translator:i}=e,r=i.load("notebook"),a=n.ReactWidget.create(h().createElement("div",{key:"placeholder"},r.__("Select items to perform actions on them.")));a.id="fileAction-placeholder",this._widgets.set("placeholder",a),["open","download","rename","duplicate","delete"].forEach((e=>{const o=n.ReactWidget.create(h().createElement(n.CommandToolbarButtonComponent,{key:e,commands:t,id:`filebrowser:${e}`,args:{toolbar:!0},icon:void 0}));o.id=`fileAction-${e}`,o.addClass("jp-ToolbarButton"),o.addClass("jp-FileAction"),this._widgets.set(e,o)})),o.connect(this._onSelectionChanged,this),this._onSelectionChanged()}get widgets(){return this._widgets.values()}}var f=o(45556);const m="FileBrowser";var v;!function(e){e.activate="filebrowser:activate",e.toggleFileFilter="filebrowser:toggle-file-filter"}(v||(v={}));const _={id:"@jupyter-notebook/tree-extension:new",description:"Plugin to add extra commands to the file browser to create new notebooks, files, consoles and terminals.",requires:[d.ITranslator],optional:[n.IToolbarWidgetRegistry],autoStart:!0,activate:(e,t,o)=>{var n;const{commands:i,serviceManager:r}=e,a=t.load("notebook"),s={overflowMenuOptions:{isVisible:!1}},l=new u.MenuBar(s),d=new u.Menu({commands:i});d.title.label=a.__("New"),d.title.icon=c.caretDownIcon,l.addMenu(d);const g=()=>{var e,t;const o=null===(t=null===(e=r.kernelspecs)||void 0===e?void 0:e.specs)||void 0===t?void 0:t.kernelspecs;for(const e in o)d.addItem({args:{kernelName:e,isLauncher:!0},command:"notebook:create-new"});["terminal:create-new","console:create","filebrowser:create-new-file","filebrowser:create-new-directory"].forEach((e=>{d.addItem({command:e})}))};null===(n=r.kernelspecs)||void 0===n||n.specsChanged.connect((()=>{d.clearItems(),g()})),g(),o&&o.addFactory(m,"new-dropdown",(e=>{const t=new u.MenuBar(s);return t.addMenu(d),t.addClass("jp-DropdownMenu"),t}))}},k={id:"@jupyter-notebook/tree-extension:file-actions",description:"A plugin to add file browser actions to the file browser toolbar.",autoStart:!0,requires:[r.IDefaultFileBrowser,n.IToolbarWidgetRegistry,d.ITranslator],activate:(e,t,o,n)=>{const i=new g.Signal(t);["_selectItem","_handleMultiSelect","handleFileSelect"].forEach((e=>{const o=t.listing[e];t.listing[e]=(...e)=>{o.call(t.listing,...e),i.emit(void 0)}}));const{commands:r}=e,a=new p({commands:r,browser:t,selectionChanged:i,translator:n});for(const e of a.widgets)o.addFactory(m,e.id,(()=>e))}},y={id:"@jupyter-notebook/tree-extension:load-plugins",description:"Plugin to load the default plugins that are loaded on all the Notebook pages (tree, edit, view, etc.) so they are visible in the settings editor.",autoStart:!0,requires:[a.ISettingRegistry],activate(e,t){const{isDisabled:o}=i.PageConfig.Extension,n=t.connector,r=i.PageConfig.getOption("allPlugins");if(!r)return;const a=JSON.parse(r),s=new Set;Object.keys(a).forEach((e=>{const t=a[e];Object.keys(t).forEach((e=>{const o=t[e];"boolean"==typeof o&&o?s.add(e):Array.isArray(o)&&o.forEach((e=>{s.add(e)}))}))})),e.restored.then((async()=>{(await n.list("all")).ids.forEach((async e=>{const[n]=e.split(":");if((s.has(n)||s.has(e))&&!o(e)&&!(e in t.plugins))try{await t.load(e)}catch(t){console.warn(`Settings failed to load for (${e})`,t)}}))}))}},I={id:"@jupyter-notebook/tree-extension:open-file-browser",description:"A plugin to add file browser commands for the tree view.",requires:[w.INotebookTree,r.IDefaultFileBrowser],autoStart:!0,activate:(e,t,o)=>{const{commands:n}=e;n.addCommand(v.activate,{execute:()=>{t.currentWidget=o}})}},S={id:"@jupyter-notebook/tree-extension:widget",description:"A plugin to add the file browser widget to an INotebookShell.",requires:[r.IDefaultFileBrowser,d.ITranslator,a.ISettingRegistry,n.IToolbarWidgetRegistry,r.IFileBrowserFactory,f.IStateDB],optional:[s.IRunningSessionManagers,l.ISettingEditorTracker,l.IJSONSettingEditorTracker],autoStart:!0,provides:w.INotebookTree,activate:(e,t,o,i,a,l,d,g,u,b)=>{const h=new w.NotebookTreeWidget,p=o.load("notebook");if(t.title.label=p.__("Files"),t.node.setAttribute("role","region"),t.node.setAttribute("aria-label",p.__("File Browser Section")),t.title.icon=c.folderIcon,h.addWidget(t),h.tabBar.addTab(t.title),h.tabsMovable=!1,a.addFactory(m,"uploader",(e=>new r.Uploader({model:e.model,translator:o,label:p.__("Upload")}))),(0,n.setToolbar)(t,(0,n.createToolbarFactory)(a,i,m,S.id,o)),g){const e=new s.RunningSessions(g,o);e.id="jp-running-sessions-tree",e.title.label=p.__("Running"),e.title.icon=c.runningIcon,h.addWidget(e),h.tabBar.addTab(e.title)}const f=i.load("@jupyterlab/filebrowser-extension:browser");Promise.all([f,e.restored]).then((([e])=>{["showFileCheckboxes","showFileSizeColumn","sortNotebooksFirst","showFullPath"].forEach((t=>{void 0===e.user[t]&&e.set(t,!0)}))})).catch((e=>{console.error(e.message)})),e.shell.add(h,"main",{rank:100}),[u,b].forEach((e=>{e&&e.widgetAdded.connect(((e,t)=>{h.addWidget(t),h.tabBar.addTab(t.title),h.currentWidget=t}))}));const{tracker:v}=l,_=()=>{v._pool.current=t};return v.widgetAdded.connect(((e,t)=>{_()})),_(),h}},T=[_,k,y,I,S]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[377,5325],{35325:(t,e,n)=>{n.r(e),n.d(e,{HTMLViewer:()=>h,HTMLViewerFactory:()=>m,IHTMLViewerTracker:()=>r,ToolbarItems:()=>o});const r=new(n(20998).Token)("@jupyterlab/htmlviewer:IHTMLViewerTracker","A widget tracker for rendered HTML documents.\n Use this if you want to be able to iterate over and interact with HTML documents\n viewed by the application.");var o,a,s=n(44548),i=n(71120),l=n(25291),u=n(12668),c=n(81997),d=n(78156);class h extends i.DocumentWidget{constructor(t){super({...t,content:new u.IFrame({sandbox:["allow-same-origin"],loading:"lazy"})}),this._renderPending=!1,this._parser=new DOMParser,this._monitor=null,this._objectUrl="",this._trustedChanged=new c.Signal(this),this.translator=t.translator||l.nullTranslator,this.content.addClass("jp-HTMLViewer"),this.context.ready.then((()=>{this.update(),this._monitor=new s.ActivityMonitor({signal:this.context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this.update,this)}))}get trusted(){return-1!==this.content.sandbox.indexOf("allow-scripts")}set trusted(t){this.trusted!==t&&(this.content.sandbox=t?a.trusted:a.untrusted,this.update(),this._trustedChanged.emit(t))}get trustedChanged(){return this._trustedChanged}dispose(){if(this._objectUrl)try{URL.revokeObjectURL(this._objectUrl)}catch(t){}super.dispose()}onUpdateRequest(){this._renderPending||(this._renderPending=!0,this._renderModel().then((()=>this._renderPending=!1)))}async _renderModel(){let t=this.context.model.toString();t=await this._setupDocument(t);const e=new Blob([t],{type:"text/html"}),n=this._objectUrl;if(this._objectUrl=URL.createObjectURL(e),this.content.url=this._objectUrl,n)try{URL.revokeObjectURL(n)}catch(t){}}async _setupDocument(t){const e=this._parser.parseFromString(t,"text/html");let n=e.querySelector("base");n||(n=e.createElement("base"),e.head.insertBefore(n,e.head.firstChild));const r=this.context.path,o=await this.context.urlResolver.getDownloadUrl(r);if(n.href=o,n.target="_self",!this.trusted){const t=this.translator.load("jupyterlab").__("Action disabled as the file is not trusted.");e.body.insertAdjacentHTML("beforeend",`<style>\na[target="_blank"],\narea[target="_blank"],\nform[target="_blank"],\nbutton[formtarget="_blank"],\ninput[formtarget="_blank"][type="image"],\ninput[formtarget="_blank"][type="submit"] {\n cursor: not-allowed !important;\n}\na[target="_blank"]:hover::after,\narea[target="_blank"]:hover::after,\nform[target="_blank"]:hover::after,\nbutton[formtarget="_blank"]:hover::after,\ninput[formtarget="_blank"][type="image"]:hover::after,\ninput[formtarget="_blank"][type="submit"]:hover::after {\n content: "${{warning:t}.warning}";\n box-sizing: border-box;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1000;\n border: 2px solid #e65100;\n background-color: #ffb74d;\n color: black;\n font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', helvetica, arial, sans-serif;\n text-align: center;\n}\n</style>`)}return e.documentElement.innerHTML}}class m extends i.ABCWidgetFactory{createNewWidget(t){return new h({context:t})}defaultToolbarFactory(t){return[{name:"refresh",widget:o.createRefreshButton(t,this.translator)},{name:"trust",widget:o.createTrustButton(t,this.translator)}]}}!function(t){t.createRefreshButton=function(t,e){const n=(null!=e?e:l.nullTranslator).load("jupyterlab");return new u.ToolbarButton({icon:u.refreshIcon,onClick:async()=>{t.context.model.dirty||(await t.context.revert(),t.update())},tooltip:n.__("Rerender HTML Document")})},t.createTrustButton=function(t,e){return u.ReactWidget.create(d.createElement(a.TrustButtonComponent,{htmlDocument:t,translator:e}))}}(o||(o={})),function(t){t.untrusted=[],t.trusted=["allow-scripts","allow-popups"],t.TrustButtonComponent=function(t){const e=(t.translator||l.nullTranslator).load("jupyterlab");return d.createElement(u.UseSignal,{signal:t.htmlDocument.trustedChanged,initialSender:t.htmlDocument},(()=>d.createElement(u.ToolbarButtonComponent,{className:"",onClick:()=>t.htmlDocument.trusted=!t.htmlDocument.trusted,tooltip:e.__("Whether the HTML file is trusted.\nTrusting the file allows opening pop-ups and running scripts\nwhich may result in security risks.\nOnly enable for files you trust."),label:t.htmlDocument.trusted?e.__("Distrust HTML"):e.__("Trust HTML")})))}}(a||(a={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[377,5325],{35325:(t,e,n)=>{n.r(e),n.d(e,{HTMLViewer:()=>h,HTMLViewerFactory:()=>m,IHTMLViewerTracker:()=>r,ToolbarItems:()=>o});const r=new(n(21961).Token)("@jupyterlab/htmlviewer:IHTMLViewerTracker","A widget tracker for rendered HTML documents.\n Use this if you want to be able to iterate over and interact with HTML documents\n viewed by the application.");var o,a,s=n(20754),i=n(23764),l=n(93050),u=n(76878),c=n(2159),d=n(78156);class h extends i.DocumentWidget{constructor(t){super({...t,content:new u.IFrame({sandbox:["allow-same-origin"],loading:"lazy"})}),this._renderPending=!1,this._parser=new DOMParser,this._monitor=null,this._objectUrl="",this._trustedChanged=new c.Signal(this),this.translator=t.translator||l.nullTranslator,this.content.addClass("jp-HTMLViewer"),this.context.ready.then((()=>{this.update(),this._monitor=new s.ActivityMonitor({signal:this.context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this.update,this)}))}get trusted(){return-1!==this.content.sandbox.indexOf("allow-scripts")}set trusted(t){this.trusted!==t&&(this.content.sandbox=t?a.trusted:a.untrusted,this.update(),this._trustedChanged.emit(t))}get trustedChanged(){return this._trustedChanged}dispose(){if(this._objectUrl)try{URL.revokeObjectURL(this._objectUrl)}catch(t){}super.dispose()}onUpdateRequest(){this._renderPending||(this._renderPending=!0,this._renderModel().then((()=>this._renderPending=!1)))}async _renderModel(){let t=this.context.model.toString();t=await this._setupDocument(t);const e=new Blob([t],{type:"text/html"}),n=this._objectUrl;if(this._objectUrl=URL.createObjectURL(e),this.content.url=this._objectUrl,n)try{URL.revokeObjectURL(n)}catch(t){}}async _setupDocument(t){const e=this._parser.parseFromString(t,"text/html");let n=e.querySelector("base");n||(n=e.createElement("base"),e.head.insertBefore(n,e.head.firstChild));const r=this.context.path,o=await this.context.urlResolver.getDownloadUrl(r);if(n.href=o,n.target="_self",!this.trusted){const t=this.translator.load("jupyterlab").__("Action disabled as the file is not trusted.");e.body.insertAdjacentHTML("beforeend",`<style>\na[target="_blank"],\narea[target="_blank"],\nform[target="_blank"],\nbutton[formtarget="_blank"],\ninput[formtarget="_blank"][type="image"],\ninput[formtarget="_blank"][type="submit"] {\n cursor: not-allowed !important;\n}\na[target="_blank"]:hover::after,\narea[target="_blank"]:hover::after,\nform[target="_blank"]:hover::after,\nbutton[formtarget="_blank"]:hover::after,\ninput[formtarget="_blank"][type="image"]:hover::after,\ninput[formtarget="_blank"][type="submit"]:hover::after {\n content: "${{warning:t}.warning}";\n box-sizing: border-box;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1000;\n border: 2px solid #e65100;\n background-color: #ffb74d;\n color: black;\n font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', helvetica, arial, sans-serif;\n text-align: center;\n}\n</style>`)}return e.documentElement.innerHTML}}class m extends i.ABCWidgetFactory{createNewWidget(t){return new h({context:t})}defaultToolbarFactory(t){return[{name:"refresh",widget:o.createRefreshButton(t,this.translator)},{name:"trust",widget:o.createTrustButton(t,this.translator)}]}}!function(t){t.createRefreshButton=function(t,e){const n=(null!=e?e:l.nullTranslator).load("jupyterlab");return new u.ToolbarButton({icon:u.refreshIcon,onClick:async()=>{t.context.model.dirty||(await t.context.revert(),t.update())},tooltip:n.__("Rerender HTML Document")})},t.createTrustButton=function(t,e){return u.ReactWidget.create(d.createElement(a.TrustButtonComponent,{htmlDocument:t,translator:e}))}}(o||(o={})),function(t){t.untrusted=[],t.trusted=["allow-scripts","allow-popups"],t.TrustButtonComponent=function(t){const e=(t.translator||l.nullTranslator).load("jupyterlab");return d.createElement(u.UseSignal,{signal:t.htmlDocument.trustedChanged,initialSender:t.htmlDocument},(()=>d.createElement(u.ToolbarButtonComponent,{className:"",onClick:()=>t.htmlDocument.trusted=!t.htmlDocument.trusted,tooltip:e.__("Whether the HTML file is trusted.\nTrusting the file allows opening pop-ups and running scripts\nwhich may result in security risks.\nOnly enable for files you trust."),label:t.htmlDocument.trusted?e.__("Distrust HTML"):e.__("Trust HTML")})))}}(a||(a={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3863],{73863:(e,r,t)=>{t.r(r),t.d(r,{default:()=>i});var n=t(12668);const i=[{id:"@jupyterlab/ui-components-extension:labicon-manager",description:"Provides the icon manager.",provides:n.ILabIconManager,autoStart:!0,activate:e=>Object.create(null)},{id:"@jupyterlab/ui-components-extension:form-renderer-registry",description:"Provides the settings form renderer registry.",provides:n.IFormRendererRegistry,autoStart:!0,activate:e=>new n.FormRendererRegistry}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3863],{73863:(e,r,t)=>{t.r(r),t.d(r,{default:()=>i});var n=t(76878);const i=[{id:"@jupyterlab/ui-components-extension:labicon-manager",description:"Provides the icon manager.",provides:n.ILabIconManager,autoStart:!0,activate:e=>Object.create(null)},{id:"@jupyterlab/ui-components-extension:form-renderer-registry",description:"Provides the settings form renderer registry.",provides:n.IFormRendererRegistry,autoStart:!0,activate:e=>new n.FormRendererRegistry}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3881],{92871:(e,t,a)=>{a.r(t),a.d(t,{DEFAULT_CONTEXT_ITEM_RANK:()=>f,default:()=>D});var o=a(27961),i=a(15465),n=a(44548),r=a(48678),l=a(87844),s=a(93223),d=a(54252),c=a(25291),u=a(12668),p=a(33625),g=a(20998),m=a(16934),b=a(2549),h=a(63485),v=a(78156);const y={id:"@jupyterlab/application-extension:top-bar",description:"Adds a toolbar to the top area (next to the main menu bar).",autoStart:!0,requires:[l.ISettingRegistry,i.IToolbarWidgetRegistry],optional:[c.ITranslator],activate:(e,t,a,o)=>{const n=new u.Toolbar;n.id="jp-top-bar",(0,i.setToolbar)(n,(0,i.createToolbarFactory)(a,t,"TopBar",y.id,null!=o?o:c.nullTranslator),n),e.shell.add(n,"top",{rank:900})}},f=100;var _;!function(e){e.activateNextTab="application:activate-next-tab",e.activatePreviousTab="application:activate-previous-tab",e.activateNextTabBar="application:activate-next-tab-bar",e.activatePreviousTabBar="application:activate-previous-tab-bar",e.close="application:close",e.closeOtherTabs="application:close-other-tabs",e.closeRightTabs="application:close-right-tabs",e.closeAll="application:close-all",e.setMode="application:set-mode",e.showPropertyPanel="property-inspector:show-panel",e.resetLayout="application:reset-layout",e.toggleHeader="application:toggle-header",e.toggleMode="application:toggle-mode",e.toggleLeftArea="application:toggle-left-area",e.toggleRightArea="application:toggle-right-area",e.toggleSideTabBar="application:toggle-side-tabbar",e.toggleSidebarWidget="application:toggle-sidebar-widget",e.togglePresentationMode="application:toggle-presentation-mode",e.tree="router:tree",e.switchSidebar="sidebar:switch"}(_||(_={}));const x={id:"@jupyterlab/application-extension:commands",description:"Adds commands related to the shell.",autoStart:!0,requires:[c.ITranslator],optional:[o.ILabShell,i.ICommandPalette],activate:(e,t,a,i)=>{var r;const{commands:l,shell:s}=e,d=t.load("jupyterlab"),c=d.__("Main Area");l.addCommand(o.JupyterFrontEndContextMenu.contextMenu,{label:d.__("Shift+Right Click for Browser Menu"),isEnabled:()=>!1,execute:()=>{}});const u=()=>{const t=e.contextMenuHitTest((e=>!!e.dataset.id));return t&&(0,p.find)(s.widgets("main"),(e=>e.id===t.dataset.id))||s.currentWidget},g=(e,t)=>{if("tab-area"===e.type)return e.widgets.includes(t)?e:null;if("split-area"===e.type)for(const a of e.children){const e=g(a,t);if(e)return e}return null},m=e=>{const{id:t}=e,o=(e=>{var t;const o=null==a?void 0:a.saveLayout(),i=null==o?void 0:o.mainArea;if(!i||"multiple-document"!==n.PageConfig.getOption("mode"))return null;const r=null===(t=i.dock)||void 0===t?void 0:t.main;return r?g(r,e):null})(e),i=o&&o.widgets||[],r=i.findIndex((e=>e.id===t));return r<0?[]:i.slice(r+1)};function b(e){e&&e.focus()}l.addCommand(_.close,{label:()=>d.__("Close Tab"),isEnabled:()=>{const e=u();return!!e&&e.title.closable},execute:()=>{const e=u();e&&e.close()}}),l.addCommand(_.closeOtherTabs,{label:()=>d.__("Close All Other Tabs"),isEnabled:()=>(0,p.some)(s.widgets("main"),((e,t)=>1===t)),execute:()=>{const e=u();if(!e)return;const{id:t}=e;for(const e of s.widgets("main"))e.id!==t&&e.close()}}),l.addCommand(_.closeRightTabs,{label:()=>d.__("Close Tabs to Right"),isEnabled:()=>!!u()&&m(u()).length>0,execute:()=>{const e=u();e&&m(e).forEach((e=>e.close()))}}),null===(r=s.currentChanged)||void 0===r||r.connect((()=>{[_.close,_.closeOtherTabs,_.closeRightTabs].forEach((e=>l.notifyCommandChanged(e)))})),a&&(l.addCommand(_.activateNextTab,{label:d.__("Activate Next Tab"),execute:()=>{a.activateNextTab()}}),l.addCommand(_.activatePreviousTab,{label:d.__("Activate Previous Tab"),execute:()=>{a.activatePreviousTab()}}),l.addCommand(_.activateNextTabBar,{label:d.__("Activate Next Tab Bar"),execute:()=>{a.activateNextTabBar()}}),l.addCommand(_.activatePreviousTabBar,{label:d.__("Activate Previous Tab Bar"),execute:()=>{a.activatePreviousTabBar()}}),l.addCommand(_.closeAll,{label:d.__("Close All Tabs"),execute:()=>{a.closeAll()}}),l.addCommand(_.toggleHeader,{label:d.__("Show Header"),execute:()=>{"single-document"===a.mode&&a.toggleTopInSimpleModeVisibility()},isToggled:()=>a.isTopInSimpleModeVisible(),isVisible:()=>"single-document"===a.mode}),l.addCommand(_.toggleLeftArea,{label:d.__("Show Left Sidebar"),execute:()=>{a.leftCollapsed?a.expandLeft():(a.collapseLeft(),a.currentWidget&&a.activateById(a.currentWidget.id))},isToggled:()=>!a.leftCollapsed,isEnabled:()=>!a.isEmpty("left")}),l.addCommand(_.toggleRightArea,{label:d.__("Show Right Sidebar"),execute:()=>{a.rightCollapsed?a.expandRight():(a.collapseRight(),a.currentWidget&&a.activateById(a.currentWidget.id))},isToggled:()=>!a.rightCollapsed,isEnabled:()=>!a.isEmpty("right")}),l.addCommand(_.toggleSidebarWidget,{label:e=>void 0===e||void 0===e.side||void 0===e.index?d.__("Toggle Sidebar Element"):"right"===e.side?d.__("Toggle Element %1 in Right Sidebar",parseInt(e.index,10)+1):d.__("Toggle Element %1 in Left Sidebar",parseInt(e.index,10)+1),execute:e=>{const t=parseInt(e.index,10);if("left"!=e.side&&"right"!=e.side)throw Error(`Unsupported sidebar: ${e.side}`);const o=Array.from(a.widgets(e.side));if(t>=o.length)return;const i=o[t].id,n=document.querySelector("[data-id='"+i+"']");(e=>{let t;if("left"!=e&&"right"!=e)throw Error(`Unsupported sidebar: ${e}`);if("left"===e)t=document.querySelector(".lm-TabBar-tab.lm-mod-current");else{const e=document.querySelectorAll(".lm-TabBar-tab.lm-mod-current");t=e[e.length-1]}const a=null==t?void 0:t.getAttribute("data-id");return a?null==a?void 0:a.toString():""})(e.side)===i?("left"==e.side&&(a.collapseLeft(),b(n)),"right"==e.side&&(a.collapseRight(),b(n))):(a.activateById(i),b(n))}}),l.addCommand(_.toggleSideTabBar,{label:e=>"right"===e.side?d.__("Show Right Activity Bar"):d.__("Show Left Activity Bar"),execute:e=>{"right"===e.side?a.toggleSideTabBarVisibility("right"):a.toggleSideTabBarVisibility("left")},isToggled:e=>"right"===e.side?a.isSideTabBarVisible("right"):a.isSideTabBarVisible("left"),isEnabled:e=>"right"===e.side?!a.isEmpty("right"):!a.isEmpty("left")}),l.addCommand(_.togglePresentationMode,{label:()=>d.__("Presentation Mode"),execute:()=>{a.presentationMode=!a.presentationMode},isToggled:()=>a.presentationMode,isVisible:()=>!0}),l.addCommand(_.setMode,{label:e=>e.mode?d.__("Set %1 mode.",e.mode):d.__("Set the layout `mode`."),caption:d.__('The layout `mode` can be "single-document" or "multiple-document".'),isVisible:e=>{const t=e.mode;return"single-document"===t||"multiple-document"===t},execute:e=>{const t=e.mode;if("single-document"!==t&&"multiple-document"!==t)throw new Error(`Unsupported application shell mode: ${t}`);a.mode=t}}),l.addCommand(_.toggleMode,{label:d.__("Simple Interface"),isToggled:()=>"single-document"===a.mode,execute:()=>{const e="multiple-document"===a.mode?{mode:"single-document"}:{mode:"multiple-document"};return l.execute(_.setMode,e)}}),l.addCommand(_.resetLayout,{label:d.__("Reset Default Layout"),execute:()=>{a.presentationMode&&l.execute(_.togglePresentationMode).catch((e=>{console.error("Failed to undo presentation mode.",e)})),"single-document"!==a.mode||a.isTopInSimpleModeVisible()||l.execute(_.toggleHeader).catch((e=>{console.error("Failed to display title header.",e)})),["left","right"].forEach((e=>{a.isSideTabBarVisible(e)||a.isEmpty(e)||l.execute(_.toggleSideTabBar,{side:e}).catch((t=>{console.error(`Failed to show ${e} activity bar.`,t)}))}))}})),i&&([_.activateNextTab,_.activatePreviousTab,_.activateNextTabBar,_.activatePreviousTabBar,_.close,_.closeAll,_.closeOtherTabs,_.closeRightTabs,_.toggleHeader,_.toggleLeftArea,_.toggleRightArea,_.togglePresentationMode,_.toggleMode,_.resetLayout].forEach((e=>i.addItem({command:e,category:c}))),["right","left"].forEach((e=>{i.addItem({command:_.toggleSideTabBar,category:c,args:{side:e}})})))}},S={id:"@jupyterlab/application-extension:main",description:"Initializes the application and provides the URL tree path handler.",requires:[o.IRouter,i.IWindowResolver,c.ITranslator,o.JupyterFrontEnd.ITreeResolver],optional:[o.IConnectionLost],provides:o.ITreePathUpdater,activate:(e,t,a,r,l,s)=>{const d=r.load("jupyterlab");if(!(e instanceof o.JupyterLab))throw new Error(`${S.id} must be activated in JupyterLab.`);let c="",u="";const p=a.name;if(console.debug(`Starting application in workspace: "${p}"`),0!==e.registerPluginErrors.length){const t=v.createElement("pre",null,e.registerPluginErrors.map((e=>e.message)).join("\n"));(0,i.showErrorMessage)(d.__("Error Registering Plugins"),{message:t})}e.shell.modeChanged.connect(((e,a)=>{const o=n.PageConfig.getUrl({mode:a}),i=n.URLExt.parse(o).pathname;t.navigate(i,{skipRouting:!0}),n.PageConfig.setOption("mode",a)})),l.paths.then((()=>{e.shell.currentPathChanged.connect(((e,a)=>{const o=a.newValue,i=o||u,r=n.PageConfig.getUrl({treePath:i}),l=n.URLExt.parse(r).pathname;t.navigate(l,{skipRouting:!0}),n.PageConfig.setOption("treePath",i),c=o}))})),s=s||o.ConnectionLost,e.serviceManager.connectionFailure.connect(((e,t)=>s(e,t,r)));const g=e.serviceManager.builder,m=()=>g.build().then((()=>(0,i.showDialog)({title:d.__("Build Complete"),body:v.createElement("div",null,d.__("Build successfully completed, reload page?"),v.createElement("br",null),d.__("You will lose any unsaved changes.")),buttons:[i.Dialog.cancelButton({label:d.__("Reload Without Saving"),actions:["reload"]}),i.Dialog.okButton({label:d.__("Save and Reload")})],hasClose:!0}))).then((({button:{accept:a,actions:o}})=>{a?e.commands.execute("docmanager:save").then((()=>{t.reload()})).catch((e=>{(0,i.showErrorMessage)(d.__("Save Failed"),{message:v.createElement("pre",null,e.message)})})):o.includes("reload")&&t.reload()})).catch((e=>{(0,i.showErrorMessage)(d.__("Build Failed"),{message:v.createElement("pre",null,e.message)})}));return g.isAvailable&&g.shouldCheck&&g.getStatus().then((e=>{if("building"===e.status)return m();if("needed"!==e.status)return;const t=v.createElement("div",null,d.__("JupyterLab build is suggested:"),v.createElement("br",null),v.createElement("pre",null,e.message));(0,i.showDialog)({title:d.__("Build Recommended"),body:t,buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:d.__("Build")})]}).then((e=>e.button.accept?m():void 0))})),function(e){l.paths.then((()=>{if(u=e,!c){const a=n.PageConfig.getUrl({treePath:e}),o=n.URLExt.parse(a).pathname;t.navigate(o,{skipRouting:!0}),n.PageConfig.setOption("treePath",e)}}))}},autoStart:!0},w={id:"@jupyterlab/application-extension:context-menu",description:"Populates the context menu.",autoStart:!0,requires:[l.ISettingRegistry,c.ITranslator],activate:(e,t,a)=>{const o=a.load("jupyterlab");function i(t){const a=new u.RankedMenu({...t,commands:e.commands});return t.label&&(a.title.label=o.__(t.label)),a}e.started.then((()=>O.loadSettingsContextMenu(e.contextMenu,t,i,a))).catch((e=>{console.error("Failed to load context menu items from settings registry.",e)}))}},T={id:"@jupyterlab/application-extension:dirty",description:"Adds safeguard dialog when closing the browser tab with unsaved modifications.",autoStart:!0,requires:[c.ITranslator],activate:(e,t)=>{if(!(e instanceof o.JupyterLab))throw new Error(`${T.id} must be activated in JupyterLab.`);const a=t.load("jupyterlab").__("Are you sure you want to exit JupyterLab?\n\nAny unsaved changes will be lost.");window.addEventListener("beforeunload",(t=>{if(e.status.isDirty)return t.returnValue=a}))}},I={id:"@jupyterlab/application-extension:layout",description:"Provides the shell layout restorer.",requires:[s.IStateDB,o.ILabShell,l.ISettingRegistry],optional:[c.ITranslator],activate:(e,t,a,r,l)=>{const s=(null!=l?l:c.nullTranslator).load("jupyterlab"),d=e.started,u=e.commands,p=n.PageConfig.getOption("mode"),m=new o.LayoutRestorer({connector:t,first:d,registry:u,mode:p});return r.load(R.id).then((t=>{var o,i;const n=t.composite.layout;a.restoreLayout(p,m,{"multiple-document":null!==(o=n.multiple)&&void 0!==o?o:{},"single-document":null!==(i=n.single)&&void 0!==i?i:{}}).then((()=>{a.layoutModified.connect((()=>{m.save(a.saveLayout())})),t.changed.connect(b),O.activateSidebarSwitcher(e,a,t,s)}))})).catch((e=>{console.error("Fail to load settings for the layout restorer."),console.error(e)})),m;async function b(e){g.JSONExt.deepEqual(e.composite.layout,{single:a.userLayout["single-document"],multiple:a.userLayout["multiple-document"]})||(await(0,i.showDialog)({title:s.__("Information"),body:s.__("User layout customization has changed. You may need to reload JupyterLab to see the changes."),buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:s.__("Reload")})]})).button.accept&&location.reload()}},autoStart:!0,provides:o.ILayoutRestorer},E={id:"@jupyterlab/application-extension:router",description:"Provides the URL router",requires:[o.JupyterFrontEnd.IPaths],activate:(e,t)=>{const{commands:a}=e,i=t.urls.base,n=new o.Router({base:i,commands:a});return e.started.then((()=>{n.route(),window.addEventListener("popstate",(()=>{n.route()}))})),n},autoStart:!0,provides:o.IRouter},C={id:"@jupyterlab/application-extension:tree-resolver",description:"Provides the tree route resolver",autoStart:!0,requires:[o.IRouter],provides:o.JupyterFrontEnd.ITreeResolver,activate:(e,t)=>{const{commands:a}=e,o=new b.DisposableSet,i=new g.PromiseDelegate,r=new RegExp("/(lab|doc)(/workspaces/[a-zA-Z0-9-_]+)?(/tree/.*)?");o.add(a.addCommand(_.tree,{execute:async e=>{var t;if(o.isDisposed)return;const a=n.URLExt.queryStringToObject(null!==(t=e.search)&&void 0!==t?t:""),r=a["file-browser-path"]||"";delete a["file-browser-path"],o.dispose(),i.resolve({browser:r,file:n.PageConfig.getOption("treePath")})}})),o.add(t.register({command:_.tree,pattern:r}));const l=()=>{o.isDisposed||(o.dispose(),i.resolve(null))};return t.routed.connect(l),o.add(new b.DisposableDelegate((()=>{t.routed.disconnect(l)}))),{paths:i.promise}}},P={id:"@jupyterlab/application-extension:notfound",description:"Defines the behavior for not found URL (aka route).",requires:[o.JupyterFrontEnd.IPaths,o.IRouter,c.ITranslator],activate:(e,t,a,o)=>{const n=o.load("jupyterlab"),r=t.urls.notFound;if(!r)return;const l=a.base,s=n.__("The path: %1 was not found. JupyterLab redirected to: %2",r,l);a.navigate(""),(0,i.showErrorMessage)(n.__("Path Not Found"),{message:s})},autoStart:!0},L={id:"@jupyterlab/application-extension:faviconbusy",description:"Handles the favicon depending on the application status.",requires:[o.ILabStatus],activate:async(e,t)=>{t.busySignal.connect(((e,t)=>{const a=document.querySelector('link[rel="icon"]'+(t?".idle.favicon":".busy.favicon"));if(!a)return;const o=document.querySelector("link"+(t?".busy.favicon":".idle.favicon"));o&&a!==o&&(a.rel="",o.rel="icon",o.parentNode.replaceChild(o,o))}))},autoStart:!0},R={id:"@jupyterlab/application-extension:shell",description:"Provides the JupyterLab shell. It has an extended API compared to `app.shell`.",optional:[l.ISettingRegistry],activate:(e,t)=>{if(!(e.shell instanceof o.LabShell))throw new Error(`${R.id} did not find a LabShell instance.`);return t&&t.load(R.id).then((t=>{e.shell.updateConfig(t.composite),t.changed.connect((()=>{e.shell.updateConfig(t.composite)}))})),e.shell},autoStart:!0,provides:o.ILabShell},B={id:"@jupyterlab/application-extension:status",description:"Provides the application status.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${B.id} must be activated in JupyterLab.`);return e.status},autoStart:!0,provides:o.ILabStatus},M={id:"@jupyterlab/application-extension:info",description:"Provides the application information.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${M.id} must be activated in JupyterLab.`);return e.info},autoStart:!0,provides:o.JupyterLab.IInfo},j={id:"@jupyterlab/application-extension:paths",description:"Provides the application paths.",activate:e=>{if(!(e instanceof o.JupyterLab))throw new Error(`${j.id} must be activated in JupyterLab.`);return e.paths},autoStart:!0,provides:o.JupyterFrontEnd.IPaths},A={id:"@jupyterlab/application-extension:property-inspector",description:"Provides the property inspector.",autoStart:!0,requires:[o.ILabShell,c.ITranslator],optional:[o.ILayoutRestorer],provides:r.IPropertyInspectorProvider,activate:(e,t,a,o)=>{const i=a.load("jupyterlab"),n=new r.SideBarPropertyInspectorProvider({shell:t,translator:a});return n.title.icon=u.buildIcon,n.title.caption=i.__("Property Inspector"),n.id="jp-property-inspector",t.add(n,"right",{rank:100,type:"Property Inspector"}),e.commands.addCommand(_.showPropertyPanel,{label:i.__("Property Inspector"),execute:()=>{t.activateById(n.id)}}),o&&o.add(n,"jp-property-inspector"),n}},k={id:"@jupyterlab/application-extension:logo",description:"Sets the application logo.",autoStart:!0,requires:[o.ILabShell],activate:(e,t)=>{const a=new h.Widget;u.jupyterIcon.element({container:a.node,elementPosition:"center",margin:"2px 2px 2px 8px",height:"auto",width:"16px"}),a.id="jp-MainLogo",t.add(a,"top",{rank:0})}},J={id:"@jupyterlab/application-extension:mode-switch",description:"Adds the interface mode switch",requires:[o.ILabShell,c.ITranslator],optional:[d.IStatusBar,l.ISettingRegistry],activate:(e,t,a,o,i)=>{if(null===o)return;const n=a.load("jupyterlab"),r=new u.Switch;if(r.id="jp-single-document-mode",r.valueChanged.connect(((e,a)=>{t.mode=a.newValue?"single-document":"multiple-document"})),t.modeChanged.connect(((e,t)=>{r.value="single-document"===t})),i){const a=i.load(R.id),o=e=>{const a=e.get("startMode").composite;a&&(t.mode="single"===a?"single-document":"multiple-document")};Promise.all([a,e.restored]).then((([e])=>{o(e)})).catch((e=>{console.error(e.message)}))}const l=()=>{const t=e.commands.keyBindings.find((e=>"application:toggle-mode"===e.command));if(t){const e=t.keys.map(m.CommandRegistry.formatKeystroke).join(", ");r.caption=n.__("Simple Interface (%1)",e)}else r.caption=n.__("Simple Interface")};l(),e.commands.keyBindingChanged.connect((()=>{l()})),r.label=n.__("Simple"),o.registerStatusItem(J.id,{priority:1,item:r,align:"left",rank:-1})},autoStart:!0},D=[w,T,S,x,I,E,C,P,L,R,B,M,J,j,A,k,y];var O;!function(e){async function t(e){(await(0,i.showDialog)({title:e.__("Information"),body:e.__("Context menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:e.__("Reload")})]})).button.accept&&location.reload()}e.loadSettingsContextMenu=async function(e,a,o,n){var r;const s=n.load("jupyterlab"),d=w.id;let c=null,u={};function p(e){var t,o;u={};const i=Object.keys(a.plugins).map((e=>{var t,o;const i=null!==(o=null===(t=a.plugins[e].schema["jupyter.lab.menus"])||void 0===t?void 0:t.context)&&void 0!==o?o:[];return u[e]=i,i})).concat([null!==(o=null===(t=e["jupyter.lab.menus"])||void 0===t?void 0:t.context)&&void 0!==o?o:[]]).reduceRight(((e,t)=>l.SettingRegistry.reconcileItems(e,t,!0)),[]);e.properties.contextMenu.default=l.SettingRegistry.reconcileItems(i,e.properties.contextMenu.default,!0).sort(((e,t)=>{var a,o;return(null!==(a=e.rank)&&void 0!==a?a:1/0)-(null!==(o=t.rank)&&void 0!==o?o:1/0)}))}a.transform(d,{compose:e=>{var t,a,o,i;c||(c=g.JSONExt.deepCopy(e.schema),p(c));const n=null!==(o=null===(a=null===(t=c.properties)||void 0===t?void 0:t.contextMenu)||void 0===a?void 0:a.default)&&void 0!==o?o:[],r={...e.data.user,contextMenu:null!==(i=e.data.user.contextMenu)&&void 0!==i?i:[]},s={...e.data.composite,contextMenu:l.SettingRegistry.reconcileItems(n,r.contextMenu,!1)};return e.data={composite:s,user:r},e},fetch:e=>(c||(c=g.JSONExt.deepCopy(e.schema),p(c)),{data:e.data,id:e.id,raw:e.raw,schema:c,version:e.version})});const m=await a.load(d),b=null!==(r=m.composite.contextMenu)&&void 0!==r?r:[];l.SettingRegistry.filterDisabledItems(b).forEach((t=>{i.MenuFactory.addContextItem({rank:f,...t},e,o)})),m.changed.connect((()=>{var e;const a=null!==(e=m.composite.contextMenu)&&void 0!==e?e:[];g.JSONExt.deepEqual(b,a)||t(s)})),a.pluginChanged.connect((async(n,r)=>{var c,p,m,h;if(r!==d){const n=null!==(c=u[r])&&void 0!==c?c:[],d=null!==(m=null===(p=a.plugins[r].schema["jupyter.lab.menus"])||void 0===p?void 0:p.context)&&void 0!==m?m:[];if(!g.JSONExt.deepEqual(n,d))if(u[r])await t(s);else{u[r]=g.JSONExt.deepCopy(d);const t=null!==(h=l.SettingRegistry.reconcileItems(d,b,!1,!1))&&void 0!==h?h:[];l.SettingRegistry.filterDisabledItems(t).forEach((t=>{i.MenuFactory.addContextItem({rank:f,...t},e,o)}))}}}))},e.activateSidebarSwitcher=function(e,t,a,o){e.commands.addCommand(_.switchSidebar,{label:o.__("Switch Sidebar Side"),execute:()=>{const o=e.contextMenuHitTest((e=>!!e.dataset.id));if(!o)return;const i=o.dataset.id,n=document.getElementById("jp-left-stack"),r=document.getElementById(i);let l=null;if(n&&r&&n.contains(r)){const e=(0,p.find)(t.widgets("left"),(e=>e.id===i));e&&(l=t.move(e,"right"),t.activateById(e.id))}else{const e=(0,p.find)(t.widgets("right"),(e=>e.id===i));e&&(l=t.move(e,"left"),t.activateById(e.id))}l&&a.set("layout",{single:l["single-document"],multiple:l["multiple-document"]}).catch((e=>{console.error("Failed to save user layout customization.",e)}))}}),e.commands.commandExecuted.connect(((e,t)=>{t.id===_.resetLayout&&a.remove("layout").catch((e=>{console.error("Failed to remove user layout customization.",e)}))}))}}(O||(O={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3881],{92871:(e,t,o)=>{o.r(t),o.d(t,{DEFAULT_CONTEXT_ITEM_RANK:()=>f,default:()=>J});var a=o(73852),n=o(53876),i=o(20754),r=o(62005),l=o(3012),s=o(45556),d=o(33441),c=o(93050),u=o(76878),p=o(14931),g=o(21961),m=o(86072),b=o(49901),h=o(2260),v=o(78156);const y={id:"@jupyterlab/application-extension:top-bar",description:"Adds a toolbar to the top area (next to the main menu bar).",autoStart:!0,requires:[l.ISettingRegistry,n.IToolbarWidgetRegistry],optional:[c.ITranslator],activate:(e,t,o,a)=>{const i=new u.Toolbar;i.id="jp-top-bar",(0,n.setToolbar)(i,(0,n.createToolbarFactory)(o,t,"TopBar",y.id,null!=a?a:c.nullTranslator),i),e.shell.add(i,"top",{rank:900})}},f=100;var _;!function(e){e.activateNextTab="application:activate-next-tab",e.activatePreviousTab="application:activate-previous-tab",e.activateNextTabBar="application:activate-next-tab-bar",e.activatePreviousTabBar="application:activate-previous-tab-bar",e.close="application:close",e.closeOtherTabs="application:close-other-tabs",e.closeRightTabs="application:close-right-tabs",e.closeAll="application:close-all",e.setMode="application:set-mode",e.showPropertyPanel="property-inspector:show-panel",e.resetLayout="application:reset-layout",e.toggleHeader="application:toggle-header",e.toggleMode="application:toggle-mode",e.toggleLeftArea="application:toggle-left-area",e.toggleRightArea="application:toggle-right-area",e.toggleSideTabBar="application:toggle-side-tabbar",e.toggleSidebarWidget="application:toggle-sidebar-widget",e.togglePresentationMode="application:toggle-presentation-mode",e.toggleFullscreenMode="application:toggle-fullscreen-mode",e.tree="router:tree",e.switchSidebar="sidebar:switch"}(_||(_={}));const x={id:"@jupyterlab/application-extension:commands",description:"Adds commands related to the shell.",autoStart:!0,requires:[c.ITranslator],optional:[a.ILabShell,n.ICommandPalette],activate:(e,t,o,n)=>{var r;const{commands:l,shell:s}=e,d=t.load("jupyterlab"),c=d.__("Main Area");l.addCommand(a.JupyterFrontEndContextMenu.contextMenu,{label:d.__("Shift+Right Click for Browser Menu"),isEnabled:()=>!1,execute:()=>{}});const u=()=>{const t=e.contextMenuHitTest((e=>!!e.dataset.id));return t&&(0,p.find)(s.widgets("main"),(e=>e.id===t.dataset.id))||s.currentWidget},g=(e,t)=>{if("tab-area"===e.type)return e.widgets.includes(t)?e:null;if("split-area"===e.type)for(const o of e.children){const e=g(o,t);if(e)return e}return null},m=e=>{const{id:t}=e,a=(e=>{var t;const a=null==o?void 0:o.saveLayout(),n=null==a?void 0:a.mainArea;if(!n||"multiple-document"!==i.PageConfig.getOption("mode"))return null;const r=null===(t=n.dock)||void 0===t?void 0:t.main;return r?g(r,e):null})(e),n=a&&a.widgets||[],r=n.findIndex((e=>e.id===t));return r<0?[]:n.slice(r+1)};function b(e){e&&e.focus()}l.addCommand(_.close,{label:()=>d.__("Close Tab"),isEnabled:()=>{const e=u();return!!e&&e.title.closable},execute:()=>{const e=u();e&&e.close()}}),l.addCommand(_.closeOtherTabs,{label:()=>d.__("Close All Other Tabs"),isEnabled:()=>(0,p.some)(s.widgets("main"),((e,t)=>1===t)),execute:()=>{const e=u();if(!e)return;const{id:t}=e;for(const e of s.widgets("main"))e.id!==t&&e.close()}}),l.addCommand(_.closeRightTabs,{label:()=>d.__("Close Tabs to Right"),isEnabled:()=>!!u()&&m(u()).length>0,execute:()=>{const e=u();e&&m(e).forEach((e=>e.close()))}}),null===(r=s.currentChanged)||void 0===r||r.connect((()=>{[_.close,_.closeOtherTabs,_.closeRightTabs].forEach((e=>l.notifyCommandChanged(e)))})),o&&(l.addCommand(_.activateNextTab,{label:d.__("Activate Next Tab"),execute:()=>{o.activateNextTab()}}),l.addCommand(_.activatePreviousTab,{label:d.__("Activate Previous Tab"),execute:()=>{o.activatePreviousTab()}}),l.addCommand(_.activateNextTabBar,{label:d.__("Activate Next Tab Bar"),execute:()=>{o.activateNextTabBar()}}),l.addCommand(_.activatePreviousTabBar,{label:d.__("Activate Previous Tab Bar"),execute:()=>{o.activatePreviousTabBar()}}),l.addCommand(_.closeAll,{label:d.__("Close All Tabs"),execute:()=>{o.closeAll()}}),l.addCommand(_.toggleHeader,{label:d.__("Show Header"),execute:()=>{"single-document"===o.mode&&o.toggleTopInSimpleModeVisibility()},isToggled:()=>o.isTopInSimpleModeVisible(),isVisible:()=>"single-document"===o.mode}),l.addCommand(_.toggleLeftArea,{label:d.__("Show Left Sidebar"),execute:()=>{o.leftCollapsed?o.expandLeft():(o.collapseLeft(),o.currentWidget&&o.activateById(o.currentWidget.id))},isToggled:()=>!o.leftCollapsed,isEnabled:()=>!o.isEmpty("left")}),l.addCommand(_.toggleRightArea,{label:d.__("Show Right Sidebar"),execute:()=>{o.rightCollapsed?o.expandRight():(o.collapseRight(),o.currentWidget&&o.activateById(o.currentWidget.id))},isToggled:()=>!o.rightCollapsed,isEnabled:()=>!o.isEmpty("right")}),l.addCommand(_.toggleSidebarWidget,{label:e=>void 0===e||void 0===e.side||void 0===e.index?d.__("Toggle Sidebar Element"):"right"===e.side?d.__("Toggle Element %1 in Right Sidebar",parseInt(e.index,10)+1):d.__("Toggle Element %1 in Left Sidebar",parseInt(e.index,10)+1),execute:e=>{const t=parseInt(e.index,10);if("left"!=e.side&&"right"!=e.side)throw Error(`Unsupported sidebar: ${e.side}`);const a=Array.from(o.widgets(e.side));if(t>=a.length)return;const n=a[t].id,i=document.querySelector("[data-id='"+n+"']");(e=>{let t;if("left"!=e&&"right"!=e)throw Error(`Unsupported sidebar: ${e}`);if("left"===e)t=document.querySelector(".lm-TabBar-tab.lm-mod-current");else{const e=document.querySelectorAll(".lm-TabBar-tab.lm-mod-current");t=e[e.length-1]}const o=null==t?void 0:t.getAttribute("data-id");return o?null==o?void 0:o.toString():""})(e.side)===n?("left"==e.side&&(o.collapseLeft(),b(i)),"right"==e.side&&(o.collapseRight(),b(i))):(o.activateById(n),b(i))}}),l.addCommand(_.toggleSideTabBar,{label:e=>"right"===e.side?d.__("Show Right Activity Bar"):d.__("Show Left Activity Bar"),execute:e=>{"right"===e.side?o.toggleSideTabBarVisibility("right"):o.toggleSideTabBarVisibility("left")},isToggled:e=>"right"===e.side?o.isSideTabBarVisible("right"):o.isSideTabBarVisible("left"),isEnabled:e=>"right"===e.side?!o.isEmpty("right"):!o.isEmpty("left")}),l.addCommand(_.togglePresentationMode,{label:()=>d.__("Presentation Mode"),execute:()=>{o.presentationMode=!o.presentationMode},isToggled:()=>o.presentationMode,isVisible:()=>!0}),l.addCommand(_.toggleFullscreenMode,{label:d.__("Fullscreen Mode"),execute:()=>{null===document.fullscreenElement||void 0===document.fullscreenElement?document.documentElement.requestFullscreen().catch((e=>{console.error("Failed to enter fullscreen mode.",e)})):null!==document.fullscreenElement&&document.exitFullscreen().catch((e=>{console.error("Failed to exit fullscreen mode.",e)}))},isToggled:()=>null!==document.fullscreenElement}),l.addCommand(_.setMode,{label:e=>e.mode?d.__("Set %1 mode.",e.mode):d.__("Set the layout `mode`."),caption:d.__('The layout `mode` can be "single-document" or "multiple-document".'),isVisible:e=>{const t=e.mode;return"single-document"===t||"multiple-document"===t},execute:e=>{const t=e.mode;if("single-document"!==t&&"multiple-document"!==t)throw new Error(`Unsupported application shell mode: ${t}`);o.mode=t}}),l.addCommand(_.toggleMode,{label:d.__("Simple Interface"),isToggled:()=>"single-document"===o.mode,execute:()=>{const e="multiple-document"===o.mode?{mode:"single-document"}:{mode:"multiple-document"};return l.execute(_.setMode,e)}}),l.addCommand(_.resetLayout,{label:d.__("Reset Default Layout"),execute:()=>{o.presentationMode&&l.execute(_.togglePresentationMode).catch((e=>{console.error("Failed to undo presentation mode.",e)})),null===document.fullscreenElement&&void 0===document.fullscreenElement||l.execute(_.toggleFullscreenMode).catch((e=>{console.error("Failed to exit fullscreen mode.",e)})),"single-document"!==o.mode||o.isTopInSimpleModeVisible()||l.execute(_.toggleHeader).catch((e=>{console.error("Failed to display title header.",e)})),["left","right"].forEach((e=>{o.isSideTabBarVisible(e)||o.isEmpty(e)||l.execute(_.toggleSideTabBar,{side:e}).catch((t=>{console.error(`Failed to show ${e} activity bar.`,t)}))}))}})),n&&([_.activateNextTab,_.activatePreviousTab,_.activateNextTabBar,_.activatePreviousTabBar,_.close,_.closeAll,_.closeOtherTabs,_.closeRightTabs,_.toggleHeader,_.toggleLeftArea,_.toggleRightArea,_.togglePresentationMode,_.toggleFullscreenMode,_.toggleMode,_.resetLayout].forEach((e=>n.addItem({command:e,category:c}))),["right","left"].forEach((e=>{n.addItem({command:_.toggleSideTabBar,category:c,args:{side:e}})})))}},S={id:"@jupyterlab/application-extension:main",description:"Initializes the application and provides the URL tree path handler.",requires:[a.IRouter,n.IWindowResolver,c.ITranslator,a.JupyterFrontEnd.ITreeResolver],optional:[a.IConnectionLost],provides:a.ITreePathUpdater,activate:(e,t,o,r,l,s)=>{const d=r.load("jupyterlab");if(!(e instanceof a.JupyterLab))throw new Error(`${S.id} must be activated in JupyterLab.`);let c="",u="";const p=o.name;if(console.debug(`Starting application in workspace: "${p}"`),0!==e.registerPluginErrors.length){const t=v.createElement("pre",null,e.registerPluginErrors.map((e=>e.message)).join("\n"));(0,n.showErrorMessage)(d.__("Error Registering Plugins"),{message:t})}e.shell.modeChanged.connect(((e,o)=>{const a=i.PageConfig.getUrl({mode:o}),n=i.URLExt.parse(a).pathname;t.navigate(n,{skipRouting:!0}),i.PageConfig.setOption("mode",o)})),l.paths.then((()=>{e.shell.currentPathChanged.connect(((e,o)=>{const a=o.newValue,n=a||u,r=i.PageConfig.getUrl({treePath:n}),l=i.URLExt.parse(r).pathname;t.navigate(l,{skipRouting:!0}),i.PageConfig.setOption("treePath",n),c=a}))})),s=s||a.ConnectionLost,e.serviceManager.connectionFailure.connect(((e,t)=>s(e,t,r)));const g=e.serviceManager.builder,m=()=>g.build().then((()=>(0,n.showDialog)({title:d.__("Build Complete"),body:v.createElement("div",null,d.__("Build successfully completed, reload page?"),v.createElement("br",null),d.__("You will lose any unsaved changes.")),buttons:[n.Dialog.cancelButton({label:d.__("Reload Without Saving"),actions:["reload"]}),n.Dialog.okButton({label:d.__("Save and Reload")})],hasClose:!0}))).then((({button:{accept:o,actions:a}})=>{o?e.commands.execute("docmanager:save").then((()=>{t.reload()})).catch((e=>{(0,n.showErrorMessage)(d.__("Save Failed"),{message:v.createElement("pre",null,e.message)})})):a.includes("reload")&&t.reload()})).catch((e=>{(0,n.showErrorMessage)(d.__("Build Failed"),{message:v.createElement("pre",null,e.message)})}));return g.isAvailable&&g.shouldCheck&&g.getStatus().then((e=>{if("building"===e.status)return m();if("needed"!==e.status)return;const t=v.createElement("div",null,d.__("JupyterLab build is suggested:"),v.createElement("br",null),v.createElement("pre",null,e.message));(0,n.showDialog)({title:d.__("Build Recommended"),body:t,buttons:[n.Dialog.cancelButton(),n.Dialog.okButton({label:d.__("Build")})]}).then((e=>e.button.accept?m():void 0))})),function(e){l.paths.then((()=>{if(u=e,!c){const o=i.PageConfig.getUrl({treePath:e}),a=i.URLExt.parse(o).pathname;t.navigate(a,{skipRouting:!0}),i.PageConfig.setOption("treePath",e)}}))}},autoStart:!0},w={id:"@jupyterlab/application-extension:context-menu",description:"Populates the context menu.",autoStart:!0,requires:[l.ISettingRegistry,c.ITranslator],activate:(e,t,o)=>{const a=o.load("jupyterlab");function n(t){const o=new u.RankedMenu({...t,commands:e.commands});return t.label&&(o.title.label=a.__(t.label)),o}e.started.then((()=>D.loadSettingsContextMenu(e.contextMenu,t,n,o))).catch((e=>{console.error("Failed to load context menu items from settings registry.",e)}))}},T={id:"@jupyterlab/application-extension:dirty",description:"Adds safeguard dialog when closing the browser tab with unsaved modifications.",autoStart:!0,requires:[c.ITranslator],activate:(e,t)=>{if(!(e instanceof a.JupyterLab))throw new Error(`${T.id} must be activated in JupyterLab.`);const o=t.load("jupyterlab").__("Are you sure you want to exit JupyterLab?\n\nAny unsaved changes will be lost.");window.addEventListener("beforeunload",(t=>{if(e.status.isDirty)return t.returnValue=o}))}},E={id:"@jupyterlab/application-extension:layout",description:"Provides the shell layout restorer.",requires:[s.IStateDB,a.ILabShell,l.ISettingRegistry],optional:[c.ITranslator],activate:(e,t,o,r,l)=>{const s=(null!=l?l:c.nullTranslator).load("jupyterlab"),d=e.started,u=e.commands,p=i.PageConfig.getOption("mode"),m=new a.LayoutRestorer({connector:t,first:d,registry:u,mode:p});return r.load(R.id).then((t=>{var a,n;const i=t.composite.layout;o.restoreLayout(p,m,{"multiple-document":null!==(a=i.multiple)&&void 0!==a?a:{},"single-document":null!==(n=i.single)&&void 0!==n?n:{}}).then((()=>{o.layoutModified.connect((()=>{m.save(o.saveLayout())})),t.changed.connect(b),D.activateSidebarSwitcher(e,o,t,s)}))})).catch((e=>{console.error("Fail to load settings for the layout restorer."),console.error(e)})),m;async function b(e){g.JSONExt.deepEqual(e.composite.layout,{single:o.userLayout["single-document"],multiple:o.userLayout["multiple-document"]})||(await(0,n.showDialog)({title:s.__("Information"),body:s.__("User layout customization has changed. You may need to reload JupyterLab to see the changes."),buttons:[n.Dialog.cancelButton(),n.Dialog.okButton({label:s.__("Reload")})]})).button.accept&&location.reload()}},autoStart:!0,provides:a.ILayoutRestorer},I={id:"@jupyterlab/application-extension:router",description:"Provides the URL router",requires:[a.JupyterFrontEnd.IPaths],activate:(e,t)=>{const{commands:o}=e,n=t.urls.base,i=new a.Router({base:n,commands:o});return e.started.then((()=>{i.route(),window.addEventListener("popstate",(()=>{i.route()}))})),i},autoStart:!0,provides:a.IRouter},C={id:"@jupyterlab/application-extension:tree-resolver",description:"Provides the tree route resolver",autoStart:!0,requires:[a.IRouter],provides:a.JupyterFrontEnd.ITreeResolver,activate:(e,t)=>{const{commands:o}=e,a=new b.DisposableSet,n=new g.PromiseDelegate,r=new RegExp("/(lab|doc)(/workspaces/[a-zA-Z0-9-_]+)?(/tree/.*)?");a.add(o.addCommand(_.tree,{execute:async e=>{var t;if(a.isDisposed)return;const o=i.URLExt.queryStringToObject(null!==(t=e.search)&&void 0!==t?t:""),r=o["file-browser-path"]||"";delete o["file-browser-path"],a.dispose(),n.resolve({browser:r,file:i.PageConfig.getOption("treePath")})}})),a.add(t.register({command:_.tree,pattern:r}));const l=()=>{a.isDisposed||(a.dispose(),n.resolve(null))};return t.routed.connect(l),a.add(new b.DisposableDelegate((()=>{t.routed.disconnect(l)}))),{paths:n.promise}}},P={id:"@jupyterlab/application-extension:notfound",description:"Defines the behavior for not found URL (aka route).",requires:[a.JupyterFrontEnd.IPaths,a.IRouter,c.ITranslator],activate:(e,t,o,a)=>{const i=a.load("jupyterlab"),r=t.urls.notFound;if(!r)return;const l=o.base,s=i.__("The path: %1 was not found. JupyterLab redirected to: %2",r,l);o.navigate(""),(0,n.showErrorMessage)(i.__("Path Not Found"),{message:s})},autoStart:!0},L={id:"@jupyterlab/application-extension:faviconbusy",description:"Handles the favicon depending on the application status.",requires:[a.ILabStatus],activate:async(e,t)=>{t.busySignal.connect(((e,t)=>{const o=document.querySelector('link[rel="icon"]'+(t?".idle.favicon":".busy.favicon"));if(!o)return;const a=document.querySelector("link"+(t?".busy.favicon":".idle.favicon"));a&&o!==a&&(o.rel="",a.rel="icon",a.parentNode.replaceChild(a,a))}))},autoStart:!0},R={id:"@jupyterlab/application-extension:shell",description:"Provides the JupyterLab shell. It has an extended API compared to `app.shell`.",optional:[l.ISettingRegistry],activate:(e,t)=>{if(!(e.shell instanceof a.LabShell))throw new Error(`${R.id} did not find a LabShell instance.`);return t&&t.load(R.id).then((t=>{e.shell.updateConfig(t.composite),t.changed.connect((()=>{e.shell.updateConfig(t.composite)}))})),e.shell},autoStart:!0,provides:a.ILabShell},M={id:"@jupyterlab/application-extension:status",description:"Provides the application status.",activate:e=>{if(!(e instanceof a.JupyterLab))throw new Error(`${M.id} must be activated in JupyterLab.`);return e.status},autoStart:!0,provides:a.ILabStatus},B={id:"@jupyterlab/application-extension:info",description:"Provides the application information.",activate:e=>{if(!(e instanceof a.JupyterLab))throw new Error(`${B.id} must be activated in JupyterLab.`);return e.info},autoStart:!0,provides:a.JupyterLab.IInfo},j={id:"@jupyterlab/application-extension:paths",description:"Provides the application paths.",activate:e=>{if(!(e instanceof a.JupyterLab))throw new Error(`${j.id} must be activated in JupyterLab.`);return e.paths},autoStart:!0,provides:a.JupyterFrontEnd.IPaths},A={id:"@jupyterlab/application-extension:property-inspector",description:"Provides the property inspector.",autoStart:!0,requires:[a.ILabShell,c.ITranslator],optional:[a.ILayoutRestorer],provides:r.IPropertyInspectorProvider,activate:(e,t,o,a)=>{const n=o.load("jupyterlab"),i=new r.SideBarPropertyInspectorProvider({shell:t,translator:o});return i.title.icon=u.buildIcon,i.title.caption=n.__("Property Inspector"),i.id="jp-property-inspector",t.add(i,"right",{rank:100,type:"Property Inspector"}),e.commands.addCommand(_.showPropertyPanel,{label:n.__("Property Inspector"),execute:()=>{t.activateById(i.id)}}),a&&a.add(i,"jp-property-inspector"),i}},k={id:"@jupyterlab/application-extension:logo",description:"Sets the application logo.",autoStart:!0,requires:[a.ILabShell],activate:(e,t)=>{const o=new h.Widget;u.jupyterIcon.element({container:o.node,elementPosition:"center",margin:"2px 2px 2px 8px",height:"auto",width:"16px"}),o.id="jp-MainLogo",t.add(o,"top",{rank:0})}},F={id:"@jupyterlab/application-extension:mode-switch",description:"Adds the interface mode switch",requires:[a.ILabShell,c.ITranslator],optional:[d.IStatusBar,l.ISettingRegistry],activate:(e,t,o,a,n)=>{if(null===a)return;const i=o.load("jupyterlab"),r=new u.Switch;if(r.id="jp-single-document-mode",r.valueChanged.connect(((e,o)=>{t.mode=o.newValue?"single-document":"multiple-document"})),t.modeChanged.connect(((e,t)=>{r.value="single-document"===t})),n){const o=n.load(R.id),a=e=>{const o=e.get("startMode").composite;o&&(t.mode="single"===o?"single-document":"multiple-document")};Promise.all([o,e.restored]).then((([e])=>{a(e)})).catch((e=>{console.error(e.message)}))}const l=()=>{const t=e.commands.keyBindings.find((e=>"application:toggle-mode"===e.command));if(t){const e=t.keys.map(m.CommandRegistry.formatKeystroke).join(", ");r.caption=i.__("Simple Interface (%1)",e)}else r.caption=i.__("Simple Interface")};l(),e.commands.keyBindingChanged.connect((()=>{l()})),r.label=i.__("Simple"),a.registerStatusItem(F.id,{priority:1,item:r,align:"left",rank:-1})},autoStart:!0},J=[w,T,S,x,E,I,C,P,L,R,M,B,F,j,A,k,y];var D;!function(e){async function t(e){(await(0,n.showDialog)({title:e.__("Information"),body:e.__("Context menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[n.Dialog.cancelButton(),n.Dialog.okButton({label:e.__("Reload")})]})).button.accept&&location.reload()}e.loadSettingsContextMenu=async function(e,o,a,i){var r;const s=i.load("jupyterlab"),d=w.id;let c=null,u={};function p(e){var t,a;u={};const n=Object.keys(o.plugins).map((e=>{var t,a;const n=null!==(a=null===(t=o.plugins[e].schema["jupyter.lab.menus"])||void 0===t?void 0:t.context)&&void 0!==a?a:[];return u[e]=n,n})).concat([null!==(a=null===(t=e["jupyter.lab.menus"])||void 0===t?void 0:t.context)&&void 0!==a?a:[]]).reduceRight(((e,t)=>l.SettingRegistry.reconcileItems(e,t,!0)),[]);e.properties.contextMenu.default=l.SettingRegistry.reconcileItems(n,e.properties.contextMenu.default,!0).sort(((e,t)=>{var o,a;return(null!==(o=e.rank)&&void 0!==o?o:1/0)-(null!==(a=t.rank)&&void 0!==a?a:1/0)}))}o.transform(d,{compose:e=>{var t,o,a,n;c||(c=g.JSONExt.deepCopy(e.schema),p(c));const i=null!==(a=null===(o=null===(t=c.properties)||void 0===t?void 0:t.contextMenu)||void 0===o?void 0:o.default)&&void 0!==a?a:[],r={...e.data.user,contextMenu:null!==(n=e.data.user.contextMenu)&&void 0!==n?n:[]},s={...e.data.composite,contextMenu:l.SettingRegistry.reconcileItems(i,r.contextMenu,!1)};return e.data={composite:s,user:r},e},fetch:e=>(c||(c=g.JSONExt.deepCopy(e.schema),p(c)),{data:e.data,id:e.id,raw:e.raw,schema:c,version:e.version})});const m=await o.load(d),b=null!==(r=m.composite.contextMenu)&&void 0!==r?r:[];l.SettingRegistry.filterDisabledItems(b).forEach((t=>{n.MenuFactory.addContextItem({rank:f,...t},e,a)})),m.changed.connect((()=>{var e;const o=null!==(e=m.composite.contextMenu)&&void 0!==e?e:[];g.JSONExt.deepEqual(b,o)||t(s)})),o.pluginChanged.connect((async(i,r)=>{var c,p,m,h;if(r!==d){const i=null!==(c=u[r])&&void 0!==c?c:[],d=null!==(m=null===(p=o.plugins[r].schema["jupyter.lab.menus"])||void 0===p?void 0:p.context)&&void 0!==m?m:[];if(!g.JSONExt.deepEqual(i,d))if(u[r])await t(s);else{u[r]=g.JSONExt.deepCopy(d);const t=null!==(h=l.SettingRegistry.reconcileItems(d,b,!1,!1))&&void 0!==h?h:[];l.SettingRegistry.filterDisabledItems(t).forEach((t=>{n.MenuFactory.addContextItem({rank:f,...t},e,a)}))}}}))},e.activateSidebarSwitcher=function(e,t,o,a){e.commands.addCommand(_.switchSidebar,{label:a.__("Switch Sidebar Side"),execute:()=>{const a=e.contextMenuHitTest((e=>!!e.dataset.id));if(!a)return;const n=a.dataset.id,i=document.getElementById("jp-left-stack"),r=document.getElementById(n);let l=null;if(i&&r&&i.contains(r)){const e=(0,p.find)(t.widgets("left"),(e=>e.id===n));e&&(l=t.move(e,"right"),t.activateById(e.id))}else{const e=(0,p.find)(t.widgets("right"),(e=>e.id===n));e&&(l=t.move(e,"left"),t.activateById(e.id))}l&&o.set("layout",{single:l["single-document"],multiple:l["multiple-document"]}).catch((e=>{console.error("Failed to save user layout customization.",e)}))}}),e.commands.commandExecuted.connect(((e,t)=>{t.id===_.resetLayout&&o.remove("layout").catch((e=>{console.error("Failed to remove user layout customization.",e)}))}))}}(D||(D={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4042,134],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(81417),n=s(50102),i=s(81997);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4042,134],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(71370),n=s(58194),i=s(2159);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4058],{84058:(e,t,s)=>{s.r(t),s.d(t,{RenderedPDF:()=>d,default:()=>c,rendererFactory:()=>r});var a=s(20998),o=s(2549),i=s(63485);const n="application/pdf";class d extends i.Widget{constructor(){super(),this._base64="",this._disposable=null,this._ready=new a.PromiseDelegate,this.addClass("jp-PDFContainer");const e=document.createElement("iframe");e.setAttribute("loading","lazy"),this.node.appendChild(e),e.onload=()=>{const t=e.contentWindow.document.createElement("body");t.style.margin="0px",e.contentWindow.document.body=t,this._object=e.contentWindow.document.createElement("object"),window.safari||(this._object.type=n),this._object.width="100%",this._object.height="100%",t.appendChild(this._object),this._ready.resolve(void 0)}}async renderModel(e){await this._ready.promise;const t=e.data[n];if(!t||t.length===this._base64.length&&t===this._base64){if(e.metadata.fragment&&this._object.data){const t=this._object.data;this._object.data=`${t.split("#")[0]}${e.metadata.fragment}`}return l.IS_FIREFOX&&(this._object.data=this._object.data),Promise.resolve(void 0)}this._base64=t;const s=l.b64toBlob(t,n);this._disposable&&this._disposable.dispose();let a=URL.createObjectURL(s);e.metadata.fragment&&(a+=e.metadata.fragment),this._object.data=a,this._disposable=new o.DisposableDelegate((()=>{try{URL.revokeObjectURL(a)}catch(e){}}))}onBeforeHide(){l.IS_FIREFOX&&(this._object.data=this._object.data.split("#")[0])}dispose(){this._disposable&&this._disposable.dispose(),super.dispose()}}const r={safe:!1,mimeTypes:[n],defaultRank:100,createRenderer:e=>new d},c=[{id:"@jupyterlab/pdf-extension:factory",description:"Adds renderer for PDF content.",rendererFactory:r,dataType:"string",documentWidgetFactoryOptions:{name:"PDF",modelName:"base64",primaryFileType:"PDF",fileTypes:["PDF"],defaultFor:["PDF"]}}];var l;!function(e){e.IS_FIREFOX=/Firefox/.test(navigator.userAgent),e.b64toBlob=function(e,t="",s=512){const a=atob(e),o=[];for(let e=0;e<a.length;e+=s){const t=a.slice(e,e+s),i=new Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);const n=new Uint8Array(i);o.push(n)}return new Blob(o,{type:t})}}(l||(l={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4058],{84058:(e,t,s)=>{s.r(t),s.d(t,{RenderedPDF:()=>d,default:()=>c,rendererFactory:()=>r});var a=s(21961),o=s(49901),i=s(2260);const n="application/pdf";class d extends i.Widget{constructor(){super(),this._base64="",this._disposable=null,this._ready=new a.PromiseDelegate,this.addClass("jp-PDFContainer");const e=document.createElement("iframe");e.setAttribute("loading","lazy"),this.node.appendChild(e),e.onload=()=>{const t=e.contentWindow.document.createElement("body");t.style.margin="0px",e.contentWindow.document.body=t,this._object=e.contentWindow.document.createElement("object"),window.safari||(this._object.type=n),this._object.width="100%",this._object.height="100%",t.appendChild(this._object),this._ready.resolve(void 0)}}async renderModel(e){await this._ready.promise;const t=e.data[n];if(!t||t.length===this._base64.length&&t===this._base64){if(e.metadata.fragment&&this._object.data){const t=this._object.data;this._object.data=`${t.split("#")[0]}${e.metadata.fragment}`}return l.IS_FIREFOX&&(this._object.data=this._object.data),Promise.resolve(void 0)}this._base64=t;const s=l.b64toBlob(t,n);this._disposable&&this._disposable.dispose();let a=URL.createObjectURL(s);e.metadata.fragment&&(a+=e.metadata.fragment),this._object.data=a,this._disposable=new o.DisposableDelegate((()=>{try{URL.revokeObjectURL(a)}catch(e){}}))}onBeforeHide(){l.IS_FIREFOX&&(this._object.data=this._object.data.split("#")[0])}dispose(){this._disposable&&this._disposable.dispose(),super.dispose()}}const r={safe:!1,mimeTypes:[n],defaultRank:100,createRenderer:e=>new d},c=[{id:"@jupyterlab/pdf-extension:factory",description:"Adds renderer for PDF content.",rendererFactory:r,dataType:"string",documentWidgetFactoryOptions:{name:"PDF",modelName:"base64",primaryFileType:"PDF",fileTypes:["PDF"],defaultFor:["PDF"]}}];var l;!function(e){e.IS_FIREFOX=/Firefox/.test(navigator.userAgent),e.b64toBlob=function(e,t="",s=512){const a=atob(e),o=[];for(let e=0;e<a.length;e+=s){const t=a.slice(e,e+s),i=new Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);const n=new Uint8Array(i);o.push(n)}return new Blob(o,{type:t})}}(l||(l={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[409],{40409:(e,n,t)=>{t.r(n),t.d(n,{Signal:()=>o,Stream:()=>r});var i,c=t(33625),s=t(20998);class o{constructor(e){this.sender=e}connect(e,n){return i.connect(this,e,n)}disconnect(e,n){return i.disconnect(this,e,n)}emit(e){i.emit(this,e)}}!function(e){e.disconnectBetween=function(e,n){i.disconnectBetween(e,n)},e.disconnectSender=function(e){i.disconnectSender(e)},e.disconnectReceiver=function(e){i.disconnectReceiver(e)},e.disconnectAll=function(e){i.disconnectAll(e)},e.clearData=function(e){i.disconnectAll(e)},e.getExceptionHandler=function(){return i.exceptionHandler},e.setExceptionHandler=function(e){let n=i.exceptionHandler;return i.exceptionHandler=e,n}}(o||(o={}));class r extends o{constructor(){super(...arguments),this._pending=new s.PromiseDelegate}async*[Symbol.asyncIterator](){let e=this._pending;for(;;)try{const{args:n,next:t}=await e.promise;e=t,yield n}catch(e){return}}emit(e){const n=this._pending,t=this._pending=new s.PromiseDelegate;n.resolve({args:e,next:t}),super.emit(e)}stop(){this._pending.promise.catch((()=>{})),this._pending.reject("stop"),this._pending=new s.PromiseDelegate}}!function(e){function n(e){let n=i.get(e);if(n&&0!==n.length){for(const e of n){if(!e.signal)continue;let n=e.thisArg||e.slot;e.signal=null,u(s.get(n))}u(n)}}function t(e){let n=s.get(e);if(n&&0!==n.length){for(const e of n){if(!e.signal)continue;let n=e.signal.sender;e.signal=null,u(i.get(n))}u(n)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,n,t){t=t||void 0;let c=i.get(e.sender);if(c||(c=[],i.set(e.sender,c)),l(c,e,n,t))return!1;let o=t||n,r=s.get(o);r||(r=[],s.set(o,r));let a={signal:e,slot:n,thisArg:t};return c.push(a),r.push(a),!0},e.disconnect=function(e,n,t){t=t||void 0;let c=i.get(e.sender);if(!c||0===c.length)return!1;let o=l(c,e,n,t);if(!o)return!1;let r=t||n,a=s.get(r);return o.signal=null,u(c),u(a),!0},e.disconnectBetween=function(e,n){let t=i.get(e);if(!t||0===t.length)return;let c=s.get(n);if(c&&0!==c.length){for(const n of c)n.signal&&n.signal.sender===e&&(n.signal=null);u(t),u(c)}},e.disconnectSender=n,e.disconnectReceiver=t,e.disconnectAll=function(e){n(e),t(e)},e.emit=function(e,n){let t=i.get(e.sender);if(t&&0!==t.length)for(let i=0,c=t.length;i<c;++i){let c=t[i];c.signal===e&&a(c,n)}};const i=new WeakMap,s=new WeakMap,o=new Set,r="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function l(e,n,t,i){return(0,c.find)(e,(e=>e.signal===n&&e.slot===t&&e.thisArg===i))}function a(n,t){let{signal:i,slot:c,thisArg:s}=n;try{c.call(s,i.sender,t)}catch(n){e.exceptionHandler(n)}}function u(e){0===o.size&&r(d),o.add(e)}function d(){o.forEach(g),o.clear()}function g(e){c.ArrayExt.removeAllWhere(e,f)}function f(e){return null===e.signal}}(i||(i={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[409],{40409:(e,n,t)=>{t.r(n),t.d(n,{Signal:()=>o,Stream:()=>r});var i,c=t(14931),s=t(21961);class o{constructor(e){this.sender=e}connect(e,n){return i.connect(this,e,n)}disconnect(e,n){return i.disconnect(this,e,n)}emit(e){i.emit(this,e)}}!function(e){e.disconnectBetween=function(e,n){i.disconnectBetween(e,n)},e.disconnectSender=function(e){i.disconnectSender(e)},e.disconnectReceiver=function(e){i.disconnectReceiver(e)},e.disconnectAll=function(e){i.disconnectAll(e)},e.clearData=function(e){i.disconnectAll(e)},e.getExceptionHandler=function(){return i.exceptionHandler},e.setExceptionHandler=function(e){let n=i.exceptionHandler;return i.exceptionHandler=e,n}}(o||(o={}));class r extends o{constructor(){super(...arguments),this._pending=new s.PromiseDelegate}async*[Symbol.asyncIterator](){let e=this._pending;for(;;)try{const{args:n,next:t}=await e.promise;e=t,yield n}catch(e){return}}emit(e){const n=this._pending,t=this._pending=new s.PromiseDelegate;n.resolve({args:e,next:t}),super.emit(e)}stop(){this._pending.promise.catch((()=>{})),this._pending.reject("stop"),this._pending=new s.PromiseDelegate}}!function(e){function n(e){let n=i.get(e);if(n&&0!==n.length){for(const e of n){if(!e.signal)continue;let n=e.thisArg||e.slot;e.signal=null,u(s.get(n))}u(n)}}function t(e){let n=s.get(e);if(n&&0!==n.length){for(const e of n){if(!e.signal)continue;let n=e.signal.sender;e.signal=null,u(i.get(n))}u(n)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,n,t){t=t||void 0;let c=i.get(e.sender);if(c||(c=[],i.set(e.sender,c)),l(c,e,n,t))return!1;let o=t||n,r=s.get(o);r||(r=[],s.set(o,r));let a={signal:e,slot:n,thisArg:t};return c.push(a),r.push(a),!0},e.disconnect=function(e,n,t){t=t||void 0;let c=i.get(e.sender);if(!c||0===c.length)return!1;let o=l(c,e,n,t);if(!o)return!1;let r=t||n,a=s.get(r);return o.signal=null,u(c),u(a),!0},e.disconnectBetween=function(e,n){let t=i.get(e);if(!t||0===t.length)return;let c=s.get(n);if(c&&0!==c.length){for(const n of c)n.signal&&n.signal.sender===e&&(n.signal=null);u(t),u(c)}},e.disconnectSender=n,e.disconnectReceiver=t,e.disconnectAll=function(e){n(e),t(e)},e.emit=function(e,n){let t=i.get(e.sender);if(t&&0!==t.length)for(let i=0,c=t.length;i<c;++i){let c=t[i];c.signal===e&&a(c,n)}};const i=new WeakMap,s=new WeakMap,o=new Set,r="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function l(e,n,t,i){return(0,c.find)(e,(e=>e.signal===n&&e.slot===t&&e.thisArg===i))}function a(n,t){let{signal:i,slot:c,thisArg:s}=n;try{c.call(s,i.sender,t)}catch(n){e.exceptionHandler(n)}}function u(e){0===o.size&&r(d),o.add(e)}function d(){o.forEach(g),o.clear()}function g(e){c.ArrayExt.removeAllWhere(e,f)}function f(e){return null===e.signal}}(i||(i={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4212],{24212:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var i=n(27961),c=n(15465),s=n(57342),a=n(87844),d=n(25291),o=n(63485);const r="jp-mod-searchable",l="jp-mod-search-active";var h;!function(e){e.search="documentsearch:start",e.searchAndReplace="documentsearch:startWithReplace",e.findNext="documentsearch:highlightNext",e.findPrevious="documentsearch:highlightPrevious",e.end="documentsearch:end",e.toggleSearchInSelection="documentsearch:toggleSearchInSelection"}(h||(h={}));const u={id:"@jupyterlab/documentsearch-extension:labShellWidgetListener",description:"Active search on valid document",requires:[i.ILabShell,s.ISearchProviderRegistry],autoStart:!0,activate:(e,t,n)=>{const i=e=>{e&&(n.hasProvider(e)?e.addClass(r):e.removeClass(r))};n.changed.connect((()=>i(t.activeWidget))),t.activeChanged.connect(((e,t)=>{const n=t.oldValue;n&&n.removeClass(r),i(t.newValue)}))}};class g{constructor(e){this._commandRegistry=e,this._cache=this._buildCache(),this._commandRegistry.keyBindingChanged.connect(this._rebuildCache,this)}get next(){return this._cache.next}get previous(){return this._cache.previous}get toggleSearchInSelection(){return this._cache.toggleSearchInSelection}_rebuildCache(){this._cache=this._buildCache()}_buildCache(){return{next:this._commandRegistry.keyBindings.find((e=>e.command===h.findNext)),previous:this._commandRegistry.keyBindings.find((e=>e.command===h.findPrevious)),toggleSearchInSelection:this._commandRegistry.keyBindings.find((e=>e.command===h.toggleSearchInSelection))}}dispose(){this._commandRegistry.keyBindingChanged.disconnect(this._rebuildCache,this)}}const m={id:"@jupyterlab/documentsearch-extension:plugin",description:"Provides the document search registry.",provides:s.ISearchProviderRegistry,requires:[d.ITranslator],optional:[c.ICommandPalette,a.ISettingRegistry],autoStart:!0,activate:(e,t,n,i)=>{var a;const d=t.load("jupyterlab");let r=500,u="never";const v=new s.SearchProviderRegistry(t),p=new Map;if(i){const t=i.load(m.id),n=e=>{r=e.get("searchDebounceTime").composite,u=e.get("autoSearchInSelection").composite};Promise.all([t,e.restored]).then((([e])=>{n(e),e.changed.connect((e=>{n(e)}))})).catch((e=>{console.error(e.message)}))}const S=()=>{const t=e.shell.currentWidget;return!!t&&v.hasProvider(t)},f=n=>{if(!n)return;const i=n.id;let a=p.get(i);if(!a){const c=v.getProvider(n);if(!c)return;const d=new s.SearchDocumentModel(c,r),o=new g(e.commands),u=new s.SearchDocumentView(d,t,o);p.set(i,u),[h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)})),u.closed.connect((()=>{n.isDisposed||(n.activate(),n.removeClass(l))})),u.disposed.connect((()=>{n.isDisposed||(n.activate(),n.removeClass(l)),p.delete(i),[h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)}))})),n.disposed.connect((()=>{u.dispose(),d.dispose(),c.dispose(),o.dispose()})),a=u}return a.isAttached||(o.Widget.attach(a,n.node),n.addClass(l),n instanceof c.MainAreaWidget&&(a.node.style.top=`${n.toolbar.node.getBoundingClientRect().height+n.contentHeader.node.getBoundingClientRect().height}px`),a.model.searchExpression&&a.model.refresh()),a};return e.commands.addCommand(h.search,{label:d.__("Find…"),isEnabled:S,execute:async t=>{const n=f(e.shell.currentWidget);if(n){const e=t.searchText;e?n.setSearchText(e):n.setSearchText(n.model.suggestedInitialQuery);const i=n.model.selectionState;let c=!1;switch(u){case"multiple-selected":c="multiple"===i;break;case"any-selected":c="multiple"===i||"single"===i}c&&await n.model.setFilter("selection",!0),n.focusSearchInput()}}}),e.commands.addCommand(h.searchAndReplace,{label:d.__("Find and Replace…"),isEnabled:S,execute:t=>{const n=f(e.shell.currentWidget);if(n){const e=t.searchText;e?n.setSearchText(e):n.setSearchText(n.model.suggestedInitialQuery);const i=t.replaceText;i&&n.setReplaceText(i),n.showReplace(),n.focusSearchInput()}}}),e.commands.addCommand(h.findNext,{label:d.__("Find Next"),isEnabled:()=>!!e.shell.currentWidget&&p.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&await(null===(t=p.get(n.id))||void 0===t?void 0:t.model.highlightNext())}}),e.commands.addCommand(h.findPrevious,{label:d.__("Find Previous"),isEnabled:()=>!!e.shell.currentWidget&&p.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&await(null===(t=p.get(n.id))||void 0===t?void 0:t.model.highlightPrevious())}}),e.commands.addCommand(h.end,{label:d.__("End Search"),isEnabled:()=>!!e.shell.currentWidget&&p.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&(null===(t=p.get(n.id))||void 0===t||t.close())}}),e.commands.addCommand(h.toggleSearchInSelection,{label:d.__("Search in Selection"),isEnabled:()=>!!e.shell.currentWidget&&p.has(e.shell.currentWidget.id)&&"selection"in p.get(e.shell.currentWidget.id).model.filtersDefinition,execute:async()=>{var t;const n=e.shell.currentWidget;if(!n)return;const i=null===(t=p.get(n.id))||void 0===t?void 0:t.model;if(!i)return;const c=i.filters.selection;return i.setFilter("selection",!c)}}),null===(a=e.shell.currentChanged)||void 0===a||a.connect((()=>{Object.values(h).forEach((t=>{e.commands.notifyCommandChanged(t)}))})),n&&[h.search,h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((e=>{n.addItem({command:e,category:d.__("Main Area")})})),v}},v=[m,u]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4212],{24212:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var i=n(73852),c=n(53876),s=n(95514),a=n(3012),d=n(93050),o=n(2260);const r="jp-mod-searchable",l="jp-mod-search-active";var h;!function(e){e.search="documentsearch:start",e.searchAndReplace="documentsearch:startWithReplace",e.findNext="documentsearch:highlightNext",e.findPrevious="documentsearch:highlightPrevious",e.end="documentsearch:end",e.toggleSearchInSelection="documentsearch:toggleSearchInSelection"}(h||(h={}));const u={id:"@jupyterlab/documentsearch-extension:labShellWidgetListener",description:"Active search on valid document",requires:[i.ILabShell,s.ISearchProviderRegistry],autoStart:!0,activate:(e,t,n)=>{const i=e=>{e&&(n.hasProvider(e)?e.addClass(r):e.removeClass(r))};n.changed.connect((()=>i(t.activeWidget))),t.activeChanged.connect(((e,t)=>{const n=t.oldValue;n&&n.removeClass(r),i(t.newValue)}))}};class g{constructor(e){this._commandRegistry=e,this._cache=this._buildCache(),this._commandRegistry.keyBindingChanged.connect(this._rebuildCache,this)}get next(){return this._cache.next}get previous(){return this._cache.previous}get toggleSearchInSelection(){return this._cache.toggleSearchInSelection}_rebuildCache(){this._cache=this._buildCache()}_buildCache(){return{next:this._commandRegistry.keyBindings.find((e=>e.command===h.findNext)),previous:this._commandRegistry.keyBindings.find((e=>e.command===h.findPrevious)),toggleSearchInSelection:this._commandRegistry.keyBindings.find((e=>e.command===h.toggleSearchInSelection))}}dispose(){this._commandRegistry.keyBindingChanged.disconnect(this._rebuildCache,this)}}const m={id:"@jupyterlab/documentsearch-extension:plugin",description:"Provides the document search registry.",provides:s.ISearchProviderRegistry,requires:[d.ITranslator],optional:[c.ICommandPalette,a.ISettingRegistry],autoStart:!0,activate:(e,t,n,i)=>{var a;const d=t.load("jupyterlab");let r=500,u="never";const v=new s.SearchProviderRegistry(t),p=new Map;if(i){const t=i.load(m.id),n=e=>{r=e.get("searchDebounceTime").composite,u=e.get("autoSearchInSelection").composite};Promise.all([t,e.restored]).then((([e])=>{n(e),e.changed.connect((e=>{n(e)}))})).catch((e=>{console.error(e.message)}))}const S=()=>{const t=e.shell.currentWidget;return!!t&&v.hasProvider(t)},f=n=>{if(!n)return;const i=n.id;let a=p.get(i);if(!a){const c=v.getProvider(n);if(!c)return;const d=new s.SearchDocumentModel(c,r),o=new g(e.commands),u=new s.SearchDocumentView(d,t,o);p.set(i,u),[h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)})),u.closed.connect((()=>{n.isDisposed||(n.activate(),n.removeClass(l))})),u.disposed.connect((()=>{n.isDisposed||(n.activate(),n.removeClass(l)),p.delete(i),[h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)}))})),n.disposed.connect((()=>{u.dispose(),d.dispose(),c.dispose(),o.dispose()})),a=u}return a.isAttached||(o.Widget.attach(a,n.node),n.addClass(l),n instanceof c.MainAreaWidget&&(a.node.style.top=`${n.toolbar.node.getBoundingClientRect().height+n.contentHeader.node.getBoundingClientRect().height}px`),a.model.searchExpression&&a.model.refresh()),a};return e.commands.addCommand(h.search,{label:d.__("Find…"),isEnabled:S,execute:async t=>{const n=f(e.shell.currentWidget);if(n){const e=t.searchText;e?n.setSearchText(e):n.setSearchText(n.model.suggestedInitialQuery);const i=n.model.selectionState;let c=!1;switch(u){case"multiple-selected":c="multiple"===i;break;case"any-selected":c="multiple"===i||"single"===i}c&&await n.model.setFilter("selection",!0),n.focusSearchInput()}}}),e.commands.addCommand(h.searchAndReplace,{label:d.__("Find and Replace…"),isEnabled:S,execute:t=>{const n=f(e.shell.currentWidget);if(n){const e=t.searchText;e?n.setSearchText(e):n.setSearchText(n.model.suggestedInitialQuery);const i=t.replaceText;i&&n.setReplaceText(i),n.showReplace(),n.focusSearchInput()}}}),e.commands.addCommand(h.findNext,{label:d.__("Find Next"),isEnabled:()=>!!e.shell.currentWidget&&p.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&await(null===(t=p.get(n.id))||void 0===t?void 0:t.model.highlightNext())}}),e.commands.addCommand(h.findPrevious,{label:d.__("Find Previous"),isEnabled:()=>!!e.shell.currentWidget&&p.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&await(null===(t=p.get(n.id))||void 0===t?void 0:t.model.highlightPrevious())}}),e.commands.addCommand(h.end,{label:d.__("End Search"),isEnabled:()=>!!e.shell.currentWidget&&p.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;n&&(null===(t=p.get(n.id))||void 0===t||t.close())}}),e.commands.addCommand(h.toggleSearchInSelection,{label:d.__("Search in Selection"),isEnabled:()=>!!e.shell.currentWidget&&p.has(e.shell.currentWidget.id)&&"selection"in p.get(e.shell.currentWidget.id).model.filtersDefinition,execute:async()=>{var t;const n=e.shell.currentWidget;if(!n)return;const i=null===(t=p.get(n.id))||void 0===t?void 0:t.model;if(!i)return;const c=i.filters.selection;return i.setFilter("selection",!c)}}),null===(a=e.shell.currentChanged)||void 0===a||a.connect((()=>{Object.values(h).forEach((t=>{e.commands.notifyCommandChanged(t)}))})),n&&[h.search,h.findNext,h.findPrevious,h.end,h.toggleSearchInSelection].forEach((e=>{n.addItem({command:e,category:d.__("Main Area")})})),v}},v=[m,u]}}]);