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([[170],{10170:(e,t,s)=>{s.r(t),s.d(t,{ModelDB:()=>m,ObservableJSON:()=>d,ObservableList:()=>c,ObservableMap:()=>o,ObservableString:()=>l,ObservableUndoableList:()=>p,ObservableValue:()=>g});var i,n=s(20998),a=s(2549),r=s(81997),h=s(49503);class o{constructor(e={}){if(this._map=new Map,this._changed=new r.Signal(this),this._isDisposed=!1,this._itemCmp=e.itemCmp||i.itemCmp,e.values)for(const t in e.values)this._map.set(t,e.values[t])}get type(){return"Map"}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get size(){return this._map.size}set(e,t){const s=this._map.get(e);if(void 0===t)throw Error("Cannot set an undefined value, use remove");const i=this._itemCmp;return void 0!==s&&i(s,t)||(this._map.set(e,t),this._changed.emit({type:s?"change":"add",key:e,oldValue:s,newValue:t})),s}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){const e=[];return this._map.forEach(((t,s)=>{e.push(s)})),e}values(){const e=[];return this._map.forEach(((t,s)=>{e.push(t)})),e}delete(e){const t=this._map.get(e);return this._map.delete(e)&&this._changed.emit({type:"remove",key:e,oldValue:t,newValue:void 0}),t}clear(){const e=this.keys();for(let t=0;t<e.length;t++)this.delete(e[t])}dispose(){this.isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this._map.clear())}}!function(e){e.itemCmp=function(e,t){return e===t}}(i||(i={}));class d extends o{constructor(e={}){super({itemCmp:n.JSONExt.deepEqual,values:e.values})}toJSON(){const e=Object.create(null),t=this.keys();for(const s of t){const t=this.get(s);void 0!==t&&(e[s]=n.JSONExt.deepCopy(t))}return e}}!function(e){class t extends h.Message{constructor(e,t){super(e),this.args=t}}e.ChangeMessage=t}(d||(d={}));class l{constructor(e=""){this._text="",this._isDisposed=!1,this._changed=new r.Signal(this),this._text=e}get type(){return"String"}get changed(){return this._changed}set text(e){e.length===this._text.length&&e===this._text||(this._text=e,this._changed.emit({type:"set",start:0,end:e.length,value:e}))}get text(){return this._text}insert(e,t){this._text=this._text.slice(0,e)+t+this._text.slice(e),this._changed.emit({type:"insert",start:e,end:e+t.length,value:t})}remove(e,t){const s=this._text.slice(e,t);this._text=this._text.slice(0,e)+this._text.slice(t),this._changed.emit({type:"remove",start:e,end:t,value:s})}clear(){this.text=""}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())}}var _,u=s(33625);class c{constructor(e={}){if(this._array=[],this._isDisposed=!1,this._changed=new r.Signal(this),e.values)for(const t of e.values)this._array.push(t);this._itemCmp=e.itemCmp||_.itemCmp}get type(){return"List"}get changed(){return this._changed}get length(){return this._array.length}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())}[Symbol.iterator](){return this._array[Symbol.iterator]()}get(e){return this._array[e]}set(e,t){const s=this._array[e];if(void 0===t)throw new Error("Cannot set an undefined item");(0,this._itemCmp)(s,t)||(this._array[e]=t,this._changed.emit({type:"set",oldIndex:e,newIndex:e,oldValues:[s],newValues:[t]}))}push(e){const t=this._array.push(e);return this._changed.emit({type:"add",oldIndex:-1,newIndex:this.length-1,oldValues:[],newValues:[e]}),t}insert(e,t){e===this._array.length?this._array.push(t):u.ArrayExt.insert(this._array,e,t),this._changed.emit({type:"add",oldIndex:-2,newIndex:e,oldValues:[],newValues:[t]})}removeValue(e){const t=this._itemCmp,s=u.ArrayExt.findFirstIndex(this._array,(s=>t(s,e)));return this.remove(s),s}remove(e){const t=u.ArrayExt.removeAt(this._array,e);if(void 0!==t)return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,newValues:[],oldValues:[t]}),t}clear(){const e=this._array.slice();this._array.length=0,this._changed.emit({type:"remove",oldIndex:0,newIndex:0,newValues:[],oldValues:e})}move(e,t){if(this.length<=1||e===t)return;const s=[this._array[e]];u.ArrayExt.move(this._array,e,t),this._changed.emit({type:"move",oldIndex:e,newIndex:t,oldValues:s,newValues:s})}pushAll(e){const t=this.length;for(const t of e)this._array.push(t);return this._changed.emit({type:"add",oldIndex:-1,newIndex:t,oldValues:[],newValues:Array.from(e)}),this.length}insertAll(e,t){const s=e;for(const s of t)u.ArrayExt.insert(this._array,e++,s);this._changed.emit({type:"add",oldIndex:-2,newIndex:s,oldValues:[],newValues:Array.from(t)})}removeRange(e,t){const s=this._array.slice(e,t);for(let s=e;s<t;s++)u.ArrayExt.removeAt(this._array,e);return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,oldValues:s,newValues:[]}),this.length}}!function(e){e.itemCmp=function(e,t){return e===t}}(_||(_={}));class p extends c{constructor(e){super(),this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange=!1,this._index=-1,this._stack=[],this._serializer=e,this.changed.connect(this._onListChanged,this)}get canRedo(){return this._index<this._stack.length-1}get canUndo(){return this._index>=0}beginCompoundOperation(e){this._inCompound=!0,this._isUndoable=!1!==e,this._madeCompoundChange=!1}endCompoundOperation(){this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange&&this._index++}undo(){if(!this.canUndo)return;const e=this._stack[this._index];this._isUndoable=!1;for(const t of e.reverse())this._undoChange(t);this._isUndoable=!0,this._index--}redo(){if(!this.canRedo)return;this._index++;const e=this._stack[this._index];this._isUndoable=!1;for(const t of e)this._redoChange(t);this._isUndoable=!0}clearUndo(){this._index=-1,this._stack=[]}_onListChanged(e,t){if(this.isDisposed||!this._isUndoable)return;this._inCompound&&this._madeCompoundChange||(this._stack=this._stack.slice(0,this._index+1));const s=this._copyChange(t);this._stack[this._index+1]?this._stack[this._index+1].push(s):this._stack.push([s]),this._inCompound?this._madeCompoundChange=!0:this._index++}_undoChange(e){let t=0;const s=this._serializer;switch(e.type){case"add":for(let t=e.newValues.length;t>0;t--)this.remove(e.newIndex);break;case"set":t=e.oldIndex;for(const i of e.oldValues)this.set(t++,s.fromJSON(i));break;case"remove":t=e.oldIndex;for(const i of e.oldValues)this.insert(t++,s.fromJSON(i));break;case"move":this.move(e.newIndex,e.oldIndex);break;default:return}}_redoChange(e){let t=0;const s=this._serializer;switch(e.type){case"add":t=e.newIndex;for(const i of e.newValues)this.insert(t++,s.fromJSON(i));break;case"set":t=e.newIndex;for(const t of e.newValues)this.set(e.newIndex++,s.fromJSON(t));break;case"remove":for(let t=e.oldValues.length;t>0;t--)this.remove(e.oldIndex);break;case"move":this.move(e.oldIndex,e.newIndex);break;default:return}}_copyChange(e){const t=[];for(const s of e.oldValues)t.push(this._serializer.toJSON(s));const s=[];for(const t of e.newValues)s.push(this._serializer.toJSON(t));return{type:e.type,oldIndex:e.oldIndex,newIndex:e.newIndex,oldValues:t,newValues:s}}}!function(e){e.IdentitySerializer=class{toJSON(e){return e}fromJSON(e){return e}}}(p||(p={}));class g{constructor(e=null){this._value=null,this._changed=new r.Signal(this),this._isDisposed=!1,this._value=e}get type(){return"Value"}get isDisposed(){return this._isDisposed}get changed(){return this._changed}get(){return this._value}set(e){const t=this._value;n.JSONExt.deepEqual(t,e)||(this._value=e,this._changed.emit({oldValue:t,newValue:e}))}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this._value=null)}}!function(e){e.IChangedArgs=class{}}(g||(g={}));class m{constructor(e={}){this.isPrepopulated=!1,this.isCollaborative=!1,this.connected=Promise.resolve(void 0),this._toDispose=!1,this._isDisposed=!1,this._disposables=new a.DisposableSet,this._basePath=e.basePath||"",e.baseDB?this._db=e.baseDB:(this._db=new o,this._toDispose=!0)}get basePath(){return this._basePath}get isDisposed(){return this._isDisposed}get(e){return this._db.get(this._resolvePath(e))}has(e){return this._db.has(this._resolvePath(e))}createString(e){const t=new l;return this._disposables.add(t),this.set(e,t),t}createList(e){const t=new p(new p.IdentitySerializer);return this._disposables.add(t),this.set(e,t),t}createMap(e){const t=new d;return this._disposables.add(t),this.set(e,t),t}createValue(e){const t=new g;return this._disposables.add(t),this.set(e,t),t}getValue(e){const t=this.get(e);if(!t||"Value"!==t.type)throw Error("Can only call getValue for an ObservableValue");return t.get()}setValue(e,t){const s=this.get(e);if(!s||"Value"!==s.type)throw Error("Can only call setValue on an ObservableValue");s.set(t)}view(e){const t=new m({basePath:e,baseDB:this});return this._disposables.add(t),t}set(e,t){this._db.set(this._resolvePath(e),t)}dispose(){this.isDisposed||(this._isDisposed=!0,this._toDispose&&this._db.dispose(),this._disposables.dispose())}_resolvePath(e){return this._basePath&&(e=this._basePath+"."+e),e}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[170],{10170:(e,t,s)=>{s.r(t),s.d(t,{ModelDB:()=>m,ObservableJSON:()=>d,ObservableList:()=>c,ObservableMap:()=>o,ObservableString:()=>l,ObservableUndoableList:()=>p,ObservableValue:()=>g});var i,n=s(21961),a=s(49901),r=s(2159),h=s(62633);class o{constructor(e={}){if(this._map=new Map,this._changed=new r.Signal(this),this._isDisposed=!1,this._itemCmp=e.itemCmp||i.itemCmp,e.values)for(const t in e.values)this._map.set(t,e.values[t])}get type(){return"Map"}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get size(){return this._map.size}set(e,t){const s=this._map.get(e);if(void 0===t)throw Error("Cannot set an undefined value, use remove");const i=this._itemCmp;return void 0!==s&&i(s,t)||(this._map.set(e,t),this._changed.emit({type:s?"change":"add",key:e,oldValue:s,newValue:t})),s}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){const e=[];return this._map.forEach(((t,s)=>{e.push(s)})),e}values(){const e=[];return this._map.forEach(((t,s)=>{e.push(t)})),e}delete(e){const t=this._map.get(e);return this._map.delete(e)&&this._changed.emit({type:"remove",key:e,oldValue:t,newValue:void 0}),t}clear(){const e=this.keys();for(let t=0;t<e.length;t++)this.delete(e[t])}dispose(){this.isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this._map.clear())}}!function(e){e.itemCmp=function(e,t){return e===t}}(i||(i={}));class d extends o{constructor(e={}){super({itemCmp:n.JSONExt.deepEqual,values:e.values})}toJSON(){const e=Object.create(null),t=this.keys();for(const s of t){const t=this.get(s);void 0!==t&&(e[s]=n.JSONExt.deepCopy(t))}return e}}!function(e){class t extends h.Message{constructor(e,t){super(e),this.args=t}}e.ChangeMessage=t}(d||(d={}));class l{constructor(e=""){this._text="",this._isDisposed=!1,this._changed=new r.Signal(this),this._text=e}get type(){return"String"}get changed(){return this._changed}set text(e){e.length===this._text.length&&e===this._text||(this._text=e,this._changed.emit({type:"set",start:0,end:e.length,value:e}))}get text(){return this._text}insert(e,t,s){this._text=this._text.slice(0,e)+t+this._text.slice(e),this._changed.emit({type:"insert",start:e,end:e+t.length,value:t,options:s})}remove(e,t,s){const i=this._text.slice(e,t);this._text=this._text.slice(0,e)+this._text.slice(t),this._changed.emit({type:"remove",start:e,end:t,value:i,options:s})}clear(){this.text=""}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())}}var _,u=s(14931);class c{constructor(e={}){if(this._array=[],this._isDisposed=!1,this._changed=new r.Signal(this),e.values)for(const t of e.values)this._array.push(t);this._itemCmp=e.itemCmp||_.itemCmp}get type(){return"List"}get changed(){return this._changed}get length(){return this._array.length}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this.clear())}[Symbol.iterator](){return this._array[Symbol.iterator]()}get(e){return this._array[e]}set(e,t){const s=this._array[e];if(void 0===t)throw new Error("Cannot set an undefined item");(0,this._itemCmp)(s,t)||(this._array[e]=t,this._changed.emit({type:"set",oldIndex:e,newIndex:e,oldValues:[s],newValues:[t]}))}push(e){const t=this._array.push(e);return this._changed.emit({type:"add",oldIndex:-1,newIndex:this.length-1,oldValues:[],newValues:[e]}),t}insert(e,t){e===this._array.length?this._array.push(t):u.ArrayExt.insert(this._array,e,t),this._changed.emit({type:"add",oldIndex:-2,newIndex:e,oldValues:[],newValues:[t]})}removeValue(e){const t=this._itemCmp,s=u.ArrayExt.findFirstIndex(this._array,(s=>t(s,e)));return this.remove(s),s}remove(e){const t=u.ArrayExt.removeAt(this._array,e);if(void 0!==t)return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,newValues:[],oldValues:[t]}),t}clear(){const e=this._array.slice();this._array.length=0,this._changed.emit({type:"remove",oldIndex:0,newIndex:0,newValues:[],oldValues:e})}move(e,t){if(this.length<=1||e===t)return;const s=[this._array[e]];u.ArrayExt.move(this._array,e,t),this._changed.emit({type:"move",oldIndex:e,newIndex:t,oldValues:s,newValues:s})}pushAll(e){const t=this.length;for(const t of e)this._array.push(t);return this._changed.emit({type:"add",oldIndex:-1,newIndex:t,oldValues:[],newValues:Array.from(e)}),this.length}insertAll(e,t){const s=e;for(const s of t)u.ArrayExt.insert(this._array,e++,s);this._changed.emit({type:"add",oldIndex:-2,newIndex:s,oldValues:[],newValues:Array.from(t)})}removeRange(e,t){const s=this._array.slice(e,t);for(let s=e;s<t;s++)u.ArrayExt.removeAt(this._array,e);return this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,oldValues:s,newValues:[]}),this.length}}!function(e){e.itemCmp=function(e,t){return e===t}}(_||(_={}));class p extends c{constructor(e){super(),this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange=!1,this._index=-1,this._stack=[],this._serializer=e,this.changed.connect(this._onListChanged,this)}get canRedo(){return this._index<this._stack.length-1}get canUndo(){return this._index>=0}beginCompoundOperation(e){this._inCompound=!0,this._isUndoable=!1!==e,this._madeCompoundChange=!1}endCompoundOperation(){this._inCompound=!1,this._isUndoable=!0,this._madeCompoundChange&&this._index++}undo(){if(!this.canUndo)return;const e=this._stack[this._index];this._isUndoable=!1;for(const t of e.reverse())this._undoChange(t);this._isUndoable=!0,this._index--}redo(){if(!this.canRedo)return;this._index++;const e=this._stack[this._index];this._isUndoable=!1;for(const t of e)this._redoChange(t);this._isUndoable=!0}clearUndo(){this._index=-1,this._stack=[]}_onListChanged(e,t){if(this.isDisposed||!this._isUndoable)return;this._inCompound&&this._madeCompoundChange||(this._stack=this._stack.slice(0,this._index+1));const s=this._copyChange(t);this._stack[this._index+1]?this._stack[this._index+1].push(s):this._stack.push([s]),this._inCompound?this._madeCompoundChange=!0:this._index++}_undoChange(e){let t=0;const s=this._serializer;switch(e.type){case"add":for(let t=e.newValues.length;t>0;t--)this.remove(e.newIndex);break;case"set":t=e.oldIndex;for(const i of e.oldValues)this.set(t++,s.fromJSON(i));break;case"remove":t=e.oldIndex;for(const i of e.oldValues)this.insert(t++,s.fromJSON(i));break;case"move":this.move(e.newIndex,e.oldIndex);break;default:return}}_redoChange(e){let t=0;const s=this._serializer;switch(e.type){case"add":t=e.newIndex;for(const i of e.newValues)this.insert(t++,s.fromJSON(i));break;case"set":t=e.newIndex;for(const t of e.newValues)this.set(e.newIndex++,s.fromJSON(t));break;case"remove":for(let t=e.oldValues.length;t>0;t--)this.remove(e.oldIndex);break;case"move":this.move(e.oldIndex,e.newIndex);break;default:return}}_copyChange(e){const t=[];for(const s of e.oldValues)t.push(this._serializer.toJSON(s));const s=[];for(const t of e.newValues)s.push(this._serializer.toJSON(t));return{type:e.type,oldIndex:e.oldIndex,newIndex:e.newIndex,oldValues:t,newValues:s}}}!function(e){e.IdentitySerializer=class{toJSON(e){return e}fromJSON(e){return e}}}(p||(p={}));class g{constructor(e=null){this._value=null,this._changed=new r.Signal(this),this._isDisposed=!1,this._value=e}get type(){return"Value"}get isDisposed(){return this._isDisposed}get changed(){return this._changed}get(){return this._value}set(e){const t=this._value;n.JSONExt.deepEqual(t,e)||(this._value=e,this._changed.emit({oldValue:t,newValue:e}))}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this),this._value=null)}}!function(e){e.IChangedArgs=class{}}(g||(g={}));class m{constructor(e={}){this.isPrepopulated=!1,this.isCollaborative=!1,this.connected=Promise.resolve(void 0),this._toDispose=!1,this._isDisposed=!1,this._disposables=new a.DisposableSet,this._basePath=e.basePath||"",e.baseDB?this._db=e.baseDB:(this._db=new o,this._toDispose=!0)}get basePath(){return this._basePath}get isDisposed(){return this._isDisposed}get(e){return this._db.get(this._resolvePath(e))}has(e){return this._db.has(this._resolvePath(e))}createString(e){const t=new l;return this._disposables.add(t),this.set(e,t),t}createList(e){const t=new p(new p.IdentitySerializer);return this._disposables.add(t),this.set(e,t),t}createMap(e){const t=new d;return this._disposables.add(t),this.set(e,t),t}createValue(e){const t=new g;return this._disposables.add(t),this.set(e,t),t}getValue(e){const t=this.get(e);if(!t||"Value"!==t.type)throw Error("Can only call getValue for an ObservableValue");return t.get()}setValue(e,t){const s=this.get(e);if(!s||"Value"!==s.type)throw Error("Can only call setValue on an ObservableValue");s.set(t)}view(e){const t=new m({basePath:e,baseDB:this});return this._disposables.add(t),t}set(e,t){this._db.set(this._resolvePath(e),t)}dispose(){this.isDisposed||(this._isDisposed=!0,this._toDispose&&this._db.dispose(),this._disposables.dispose())}_resolvePath(e){return this._basePath&&(e=this._basePath+"."+e),e}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809],{1809:(t,e,s)=>{s.r(e),s.d(e,{IRunningSessionManagers:()=>C,IRunningSessionSidebar:()=>y,RunningSessionManagers:()=>I,RunningSessions:()=>L,SearchableSessions:()=>D,SearchableSessionsList:()=>B});var n=s(15465),i=s(25291),a=s(12668),o=s(20998),l=s(2549),r=s(18395),d=s(81997),h=s(63485),c=s(78156),u=s.n(c);const g="jp-RunningSessions",p="jp-RunningSessions-sectionList",_="jp-RunningSessions-item",m="jp-RunningSessions-itemLabel",w="jp-RunningSessions-itemDetail",b="jp-RunningSessions-itemShutdown",f="jp-RunningSessions-caret",S="jp-RunningSessions-icon",v="jp-running-sessions",C=new o.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers."),y=new o.Token("@jupyterlab/running:IRunningSessionsSidebar","A token allowing to modify the running sessions sidebar.");class I{constructor(){this._added=new d.Signal(this),this._managers=[]}get added(){return this._added}add(t){return this._managers.push(t),this._added.emit(t),new l.DisposableDelegate((()=>{const e=this._managers.indexOf(t);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function T(t){var e,s;const{runningItem:n}=t,o=[_],l=null===(e=n.detail)||void 0===e?void 0:e.call(n),r=n.icon(),d=n.labelTitle?n.labelTitle():"",h=t.translator||i.nullTranslator,c=h.load("jupyterlab");let g=!1;const p=t.shutdownItemIcon||a.closeIcon,v=null!==(s="function"==typeof t.shutdownLabel?t.shutdownLabel(n):t.shutdownLabel)&&void 0!==s?s:c.__("Shut Down"),C=n.children,[y,I]=u().useState(!1),T=!!(null==C?void 0:C.length),E=T?()=>!g&&I(!y):void 0;return t.collapseToggled.connect(((t,e)=>I(e))),n.className&&o.push(n.className),t.child&&o.push("jp-mod-running-child"),t.child&&!C&&o.push("jp-mod-running-leaf"),u().createElement(u().Fragment,null,u().createElement("li",null,u().createElement("div",{className:o.join(" "),onClick:E,"data-context":n.context||""},T&&(y?u().createElement(a.caretRightIcon.react,{tag:"span",className:f}):u().createElement(a.caretDownIcon.react,{tag:"span",className:f})),r?"string"==typeof r?u().createElement("img",{src:r,className:S}):u().createElement(r.react,{tag:"span",className:S}):void 0,u().createElement("span",{className:m,title:d,onClick:n.open&&(()=>n.open())},n.label()),l&&u().createElement("span",{className:w},l),n.shutdown&&u().createElement(a.ToolbarButtonComponent,{className:b,icon:p,onClick:()=>{var t;g=!0,null===(t=n.shutdown)||void 0===t||t.call(n)},tooltip:v})),T&&!y&&u().createElement(j,{child:!0,runningItems:C,shutdownItemIcon:p,translator:h,collapseToggled:t.collapseToggled})))}function j(t){const e=t.filter,s=e?t.runningItems.map((t=>({item:t,score:e(t)}))).filter((({score:t})=>null!==t)).sort(((t,e)=>t.score.score-e.score.score)).map((({item:t})=>t)):t.runningItems;return u().createElement("ul",{className:p},s.map(((e,s)=>u().createElement(T,{child:t.child,key:s,runningItem:e,shutdownLabel:t.shutdownLabel,shutdownItemIcon:t.shutdownItemIcon,translator:t.translator,collapseToggled:t.collapseToggled}))))}class E extends a.ReactWidget{constructor(t){super(),this._filterFn=t=>({score:0}),this._filterChanged=new d.Signal(this),this.filter=this.filter.bind(this),this._updateFilter=this._updateFilter.bind(this),this._trans=t.load("jupyterlab"),this.addClass("jp-SearchableSessions-filter")}get filterChanged(){return this._filterChanged}render(){return u().createElement(a.FilterBox,{placeholder:this._trans.__("Search"),updateFilter:this._updateFilter,useFuzzyFilter:!1,caseSensitive:!1})}filter(t){var e;const s=[this._getTextContent(t.label())];for(const n of null!==(e=t.children)&&void 0!==e?e:[])s.push(this._getTextContent(n.label()));return this._filterFn(s.join(" "))}_getTextContent(t){return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?""+t:Array.isArray(t)?t.map((t=>this._getTextContent(t))).join(" "):t&&(0,c.isValidElement)(t)?t.props.children.map((t=>this._getTextContent(t))).join(" "):""}_updateFilter(t){this._filterFn=t,this._filterChanged.emit()}}class x extends a.ReactWidget{constructor(t){super(),this._options=t,this._update=new d.Signal(this),t.manager.runningChanged.connect(this._emitUpdate,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._emitUpdate,this)}dispose(){d.Signal.clearData(this),super.dispose()}onBeforeShow(t){super.onBeforeShow(t),this._update.emit()}render(){const t=this._options;let e=!0;return u().createElement(a.UseSignal,{signal:this._update},(()=>{var s;return e?e=!1:t.runningItems=t.manager.running(),u().createElement("div",{className:"jp-RunningSessions-sectionContainer"},u().createElement(j,{runningItems:t.runningItems,shutdownLabel:t.manager.shutdownLabel,shutdownItemIcon:t.manager.shutdownItemIcon,filter:null===(s=t.filterProvider)||void 0===s?void 0:s.filter,translator:t.translator,collapseToggled:t.collapseToggled}))}))}_isAnyHidden(){let t=this.isHidden;if(t)return t;let e=this.parent;for(;null!=e;){if(e.isHidden){t=!0;break}e=e.parent}return t}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class A extends a.PanelWithToolbar{constructor(t){super(),this._buttons=null,this._listView=!1,this._collapseToggled=new d.Signal(this),this._viewChanged=new d.Signal(this),this._manager=t.manager,this._filterProvider=t.filterProvider;const e=t.translator||i.nullTranslator;this._trans=e.load("jupyterlab"),this.addClass("jp-RunningSessions-section"),this.title.label=t.manager.name,this._manager.runningChanged.connect(this._onListChanged,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._onListChanged,this),this._updateEmptyClass();let s=t.manager.running();!1!==t.showToolbar&&this._initializeToolbar(s),this.addWidget(new x({runningItems:s,collapseToggled:this._collapseToggled,...t}))}toggleListView(t){const e=void 0!==t?t:!this._listView;this._listView=e,this._buttons&&(this._buttons["switch-view"].pressed=e),this._collapseToggled.emit(!1),this.toggleClass("jp-mod-running-list-view",e),this._updateButtons(),this._viewChanged.emit({mode:e?"list":"tree"})}dispose(){this.isDisposed||(d.Signal.clearData(this),super.dispose())}get _shutdownAllLabel(){return this._manager.shutdownAllLabel||this._trans.__("Shut Down All")}_initializeToolbar(t){const e=t.length>0,s=this._shutdownAllLabel,i=`${s}?`,o=this._manager.shutdownAllConfirmationText||`${s} ${this._manager.name}`,l=new a.ToolbarButton({label:s,className:"jp-RunningSessions-shutdownAll"+(e?"":" jp-mod-disabled"),enabled:e,onClick:(()=>{(0,n.showDialog)({title:i,body:o,buttons:[n.Dialog.cancelButton(),n.Dialog.warnButton({label:s})]}).then((t=>{t.button.accept&&this._manager.shutdownAll()}))}).bind(this)}),r=new a.ToolbarButton({className:"jp-RunningSessions-viewButton",enabled:e,icon:a.tableRowsIcon,pressedIcon:a.treeViewIcon,onClick:()=>this.toggleListView(),tooltip:this._trans.__("Switch to List View"),pressedTooltip:this._trans.__("Switch to Tree View")}),d=new a.ToolbarButton({className:"jp-RunningSessions-collapseButton",enabled:e,icon:a.collapseAllIcon,pressedIcon:a.expandAllIcon,onClick:()=>{const t=!d.pressed;this._collapseToggled.emit(t),d.pressed=t},tooltip:this._trans.__("Collapse All"),pressedTooltip:this._trans.__("Expand All")});this._buttons={"switch-view":r,"collapse-expand":d,"shutdown-all":l},this._updateButtons(),this._manager.runningChanged.connect(this._updateButtons,this);for(const t of["collapse-expand","switch-view","shutdown-all"])this.toolbar.addItem(t,this._buttons[t]);this.toolbar.addClass("jp-RunningSessions-toolbar")}_onListChanged(){this._updateButtons(),this._updateEmptyClass()}_updateEmptyClass(){this._filterProvider&&(0===this._manager.running().filter(this._filterProvider.filter).length?this.node.classList.toggle("jp-mod-empty",!0):this.node.classList.toggle("jp-mod-empty",!1))}get viewChanged(){return this._viewChanged}_updateButtons(){if(!this._buttons)return;let t=this._manager.running();const e=t.length>0,s=0!==t.filter((t=>t.children)).length,n=s&&!this._buttons["switch-view"].pressed;this._buttons["switch-view"].node.style.display=s?"block":"none",this._buttons["collapse-expand"].node.style.display=n?"block":"none",this._buttons["collapse-expand"].enabled=e,this._buttons["switch-view"].enabled=e,this._buttons["shutdown-all"].enabled=e}}class L extends a.SidePanel{constructor(t,e,s){super(),this.managers=t,this._stateDB=null!=s?s:null,this.translator=null!=e?e:i.nullTranslator;const n=this.translator.load("jupyterlab");this.addClass(g),this.toolbar.addItem("refresh",new a.ToolbarButton({tooltip:n.__("Refresh List"),icon:a.refreshIcon,onClick:()=>t.items().forEach((t=>t.refreshRunning()))})),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}async addSection(t,e){const s=new A({manager:e,translator:this.translator});this.addWidget(s);const n=(await this._getState()).listViewSections,i=e.name;n&&n.includes(i)&&s.toggleListView(!0),s.viewChanged.connect((async(t,e)=>{await this._updateState(i,e.mode)}))}async _updateState(t,e){var s;let n=null!==(s=(await this._getState()).listViewSections)&&void 0!==s?s:[];"list"!==e||n.includes(t)?n=n.filter((e=>e!==t)):n.push(t);const i={listViewSections:n};this._stateDB&&await this._stateDB.save(v,i)}async _getState(){var t;return this._stateDB&&null!==(t=await this._stateDB.fetch(v))&&void 0!==t?t:{}}}class R extends A{constructor(t){super(t);const e=document.createElement("h3");e.className="jp-SearchableSessions-title";const s=e.appendChild(document.createElement("span"));s.className="jp-SearchableSessions-titleLabel",s.textContent=this.title.label,this.node.insertAdjacentElement("afterbegin",e)}}class k extends h.Widget{constructor(t){super();const e=t.load("jupyterlab");this.addClass("jp-SearchableSessions-emptyIndicator"),this.node.textContent=e.__("No matches")}}class D extends h.Panel{constructor(t,e){super(),this._activeIndex=0,this._translator=null!=e?e:i.nullTranslator,this.addClass(g),this.addClass("jp-SearchableSessions"),this._filterWidget=new E(this._translator),this.addWidget(this._filterWidget),this._list=new B(t,this._filterWidget,e),this.addWidget(this._list),this._filterWidget.filterChanged.connect((()=>{this._activeIndex=0,this._updateActive(0)}),this)}dispose(){this.isDisposed||(d.Signal.clearData(this),super.dispose())}getValue(){const t=[...this.node.querySelectorAll("."+m)];t[Math.min(Math.max(this._activeIndex,0),t.length-1)].click()}handleEvent(t){"keydown"===t.type&&this._evtKeydown(t)}onAfterAttach(t){this._forceFocusInput(),this.node.addEventListener("keydown",this),setTimeout((()=>{this._updateActive(0)}),0)}onAfterDetach(t){this.node.removeEventListener("keydown",this)}_forceFocusInput(){var t;null===(t=this._filterWidget.renderPromise)||void 0===t||t.then((()=>{var t;const e=this._filterWidget.node.querySelector("jp-search"),s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("input");s?s.focus():console.warn("Input element not found, cannot focus")})).catch(console.warn)}_evtKeydown(t){if("ArrowDown"===t.key||"ArrowUp"===t.key){const e="ArrowDown"===t.key?1:-1;this._updateActive(e)&&t.preventDefault()}}_updateActive(t){const e=[...this.node.querySelectorAll("."+_)].filter((t=>t.checkVisibility()));if(!e.length)return!1;for(const t of e)t.classList.contains("jp-mod-active")&&t.classList.toggle("jp-mod-active",!1);const s=this._activeIndex;let n=null;return n=-1===s?1===t?0:e.length-1:Math.min(Math.max(s+t,0),e.length-1),null!==n&&(e[n].classList.add("jp-mod-active"),r.ElementExt.scrollIntoViewIfNeeded(this._list.node,e[n]),this._activeIndex=n,!0)}}class B extends h.Panel{constructor(t,e,s){super(),this._managers=t,this._translator=null!=s?s:i.nullTranslator,this._filterWidget=e,this.addClass("jp-SearchableSessions-list"),this._emptyIndicator=new k(this._translator),this.addWidget(this._emptyIndicator),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this._managers.added.disconnect(this.addSection,this),super.dispose())}addSection(t,e){const s=new R({manager:e,translator:this._translator,showToolbar:!1,filterProvider:this._filterWidget});s.toggleListView(!0),this.addWidget(s),this.addWidget(this._emptyIndicator)}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1809],{1809:(t,e,s)=>{s.r(e),s.d(e,{IRunningSessionManagers:()=>I,IRunningSessionSidebar:()=>T,RunningSessionManagers:()=>y,RunningSessions:()=>V,SearchableSessions:()=>B,SearchableSessionsList:()=>D});var n=s(63956),i=s(85430),a=s(55947),o=s(53876),l=s(93050),r=s(76878),d=s(21961),h=s(49901),c=s(47392),u=s(2159),g=s(2260),p=s(78156),_=s.n(p);const m="jp-RunningSessions",w="jp-RunningSessions-item",f="jp-RunningSessions-itemLabel",b="jp-RunningSessions-itemDetail",v="jp-RunningSessions-itemShutdown",S="jp-RunningSessions-icon",C="jp-running-sessions",I=new d.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers."),T=new d.Token("@jupyterlab/running:IRunningSessionsSidebar","A token allowing to modify the running sessions sidebar.");class y{constructor(){this._added=new u.Signal(this),this._managers=[]}get added(){return this._added}add(t){return this._managers.push(t),this._added.emit(t),new h.DisposableDelegate((()=>{const e=this._managers.indexOf(t);e>-1&&this._managers.splice(e,1)}))}items(){return this._managers}}function j(t){var e,s;const{runningItem:a}=t,[o,d]=_().useState(!1),h=(0,p.useRef)(!1),c=[w],u=null===(e=a.detail)||void 0===e?void 0:e.call(a),g=a.icon(),m=a.labelTitle?a.labelTitle():"",C=t.translator||l.nullTranslator,I=C.load("jupyterlab"),T=t.shutdownItemIcon||r.closeIcon,y=null!==(s="function"==typeof t.shutdownLabel?t.shutdownLabel(a):t.shutdownLabel)&&void 0!==s?s:I.__("Shut Down"),j=(0,p.useCallback)((t=>{var e;h.current=!0,t.preventDefault(),null===(e=a.shutdown)||void 0===e||e.call(a)}),[a,h]),E=a.children,A=!!(null==E?void 0:E.length),L=(0,p.useCallback)((t=>{if(h.current)return;const e=(0,r.getTreeItemElement)(t.target);t.currentTarget===e&&A&&d(!o)}),[A,o,h]);return t.collapseToggled.connect(((t,e)=>d(e))),a.className&&c.push(a.className),_().createElement(_().Fragment,null,_().createElement(n.k,{className:`${c.join(" ")} jp-TreeItem nested`,onClick:L,"data-context":a.context||"",expanded:!o},g?"string"==typeof g?_().createElement("img",{src:g,className:S,slot:"start"}):_().createElement(g.react,{slot:"start",tag:"span",className:S}):void 0,_().createElement("span",{className:f,title:m,onClick:a.open&&(()=>a.open())},a.label()),u&&_().createElement("span",{className:b},u),a.shutdown&&_().createElement(i.z,{appearance:"stealth",className:v,onClick:j,title:y,slot:"end"},_().createElement(T.react,{tag:null})),E&&_().createElement(x,{runningItems:E,shutdownItemIcon:T,translator:C,collapseToggled:t.collapseToggled})))}function x(t){const e=t.filter,s=e?t.runningItems.map((t=>({item:t,score:e(t)}))).filter((({score:t})=>null!==t)).sort(((t,e)=>t.score.score-e.score.score)).map((({item:t})=>t)):t.runningItems;return _().createElement(_().Fragment,null,s.map(((e,s)=>_().createElement(j,{child:t.child,key:s,runningItem:e,shutdownLabel:t.shutdownLabel,shutdownItemIcon:t.shutdownItemIcon,translator:t.translator,collapseToggled:t.collapseToggled}))))}class E extends r.ReactWidget{constructor(t){super(),this._filterFn=t=>({score:0}),this._filterChanged=new u.Signal(this),this.filter=this.filter.bind(this),this._updateFilter=this._updateFilter.bind(this),this._trans=t.load("jupyterlab"),this.addClass("jp-SearchableSessions-filter")}get filterChanged(){return this._filterChanged}render(){return _().createElement(r.FilterBox,{placeholder:this._trans.__("Search"),updateFilter:this._updateFilter,useFuzzyFilter:!1,caseSensitive:!1})}filter(t){var e;const s=[this._getTextContent(t.label())];for(const n of null!==(e=t.children)&&void 0!==e?e:[])s.push(this._getTextContent(n.label()));return this._filterFn(s.join(" "))}_getTextContent(t){return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?""+t:Array.isArray(t)?t.map((t=>this._getTextContent(t))).join(" "):t&&(0,p.isValidElement)(t)?t.props.children.map((t=>this._getTextContent(t))).join(" "):""}_updateFilter(t){this._filterFn=t,this._filterChanged.emit()}}class A extends r.ReactWidget{constructor(t){super(),this._options=t,this._update=new u.Signal(this),t.manager.runningChanged.connect(this._emitUpdate,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._emitUpdate,this)}get mode(){return this._mode}set mode(t){this._mode!==t&&(this._mode=t,this._update.emit())}dispose(){u.Signal.clearData(this),super.dispose()}onBeforeShow(t){super.onBeforeShow(t),this._update.emit()}render(){const t=this._options;let e=!0;return _().createElement(r.UseSignal,{signal:this._update},(()=>{var s;e?e=!1:t.runningItems=t.manager.running({mode:this.mode});const n=["jp-TreeView"];return"list"===this.mode&&n.push("jp-mod-flat"),_().createElement("div",{className:"jp-RunningSessions-sectionContainer"},_().createElement(a.L,{className:n.join(" ")},_().createElement(x,{runningItems:t.runningItems,shutdownLabel:t.manager.shutdownLabel,shutdownItemIcon:t.manager.shutdownItemIcon,filter:null===(s=t.filterProvider)||void 0===s?void 0:s.filter,translator:t.translator,collapseToggled:t.collapseToggled})))}))}_isAnyHidden(){let t=this.isHidden;if(t)return t;let e=this.parent;for(;null!=e;){if(e.isHidden){t=!0;break}e=e.parent}return t}_emitUpdate(){this._isAnyHidden()||this._update.emit()}}class L extends r.PanelWithToolbar{constructor(t){var e;super(),this._buttons=null,this._listView=!1,this._collapseToggled=new u.Signal(this),this._viewChanged=new u.Signal(this),this._listView="list"===(null!==(e=t.viewMode)&&void 0!==e?e:"tree"),this._manager=t.manager,this._filterProvider=t.filterProvider;const s=t.translator||l.nullTranslator;this._trans=s.load("jupyterlab"),this.addClass("jp-RunningSessions-section"),this.title.label=t.manager.name,this._manager.runningChanged.connect(this._onListChanged,this),t.filterProvider&&t.filterProvider.filterChanged.connect(this._onListChanged,this),this._updateEmptyClass();const n=t.manager.running({mode:t.manager.supportsMultipleViews&&!this._listView?"tree":"list"});!1!==t.showToolbar&&this._initializeToolbar(n),this._listWidget=new A({runningItems:n,collapseToggled:this._collapseToggled,...t}),this._listWidget.mode=t.manager.supportsMultipleViews&&!this._listView?"tree":"list",this.addWidget(this._listWidget)}toggleListView(t){const e=void 0!==t?t:!this._listView;this._listView=e,this._buttons&&(this._buttons["switch-view"].pressed=e),this._collapseToggled.emit(!1),void 0===this._manager.supportsMultipleViews&&this.toggleClass("jp-mod-running-list-view",e),this._updateButtons(),this._listWidget.mode=this._manager.supportsMultipleViews&&!this._listView?"tree":"list",this._viewChanged.emit({mode:e?"list":"tree"})}dispose(){this.isDisposed||(u.Signal.clearData(this),super.dispose())}get _shutdownAllLabel(){return this._manager.shutdownAllLabel||this._trans.__("Shut Down All")}_initializeToolbar(t){const e=t.length>0,s=this._shutdownAllLabel,n=`${s}?`,i=new r.ToolbarButton({label:s,className:"jp-RunningSessions-shutdownAll"+(e?"":" jp-mod-disabled"),enabled:e,onClick:(()=>{var t;const e=null!==(t="function"==typeof this._manager.shutdownAllConfirmationText?this._manager.shutdownAllConfirmationText():this._manager.shutdownAllConfirmationText)&&void 0!==t?t:`${s} ${this._manager.name}`;(0,o.showDialog)({title:n,body:e,buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:s})]}).then((t=>{t.button.accept&&this._manager.shutdownAll()}))}).bind(this)}),a=new r.ToolbarButton({className:"jp-RunningSessions-viewButton",enabled:e,icon:r.tableRowsIcon,pressedIcon:r.treeViewIcon,onClick:()=>this.toggleListView(),tooltip:this._trans.__("Switch to List View"),pressedTooltip:this._trans.__("Switch to Tree View")}),l=new r.ToolbarButton({className:"jp-RunningSessions-collapseButton",enabled:e,icon:r.collapseAllIcon,pressedIcon:r.expandAllIcon,onClick:()=>{const t=!l.pressed;this._collapseToggled.emit(t),l.pressed=t},tooltip:this._trans.__("Collapse All"),pressedTooltip:this._trans.__("Expand All")});this._buttons={"switch-view":a,"collapse-expand":l,"shutdown-all":i},this._updateButtons(),this._manager.runningChanged.connect(this._updateButtons,this),this._manager.toolbarButtons&&this._manager.toolbarButtons.forEach((t=>this.toolbar.addItem(t instanceof r.CommandToolbarButton?t.commandId:t.id,t)));for(const t of["collapse-expand","switch-view","shutdown-all"])this.toolbar.addItem(t,this._buttons[t]);this.toolbar.addClass("jp-RunningSessions-toolbar")}_onListChanged(){this._updateButtons(),this._updateEmptyClass()}_updateEmptyClass(){this._filterProvider&&(0===this._manager.running({mode:this._manager.supportsMultipleViews&&!this._listView?"tree":"list"}).filter(this._filterProvider.filter).length?this.node.classList.toggle("jp-mod-empty",!0):this.node.classList.toggle("jp-mod-empty",!1))}get viewChanged(){return this._viewChanged}_updateButtons(){if(!this._buttons)return;let t=this._manager.running({mode:this._manager.supportsMultipleViews&&!this._listView?"tree":"list"});const e=t.length>0,s=void 0===this._manager.supportsMultipleViews?0!==t.filter((t=>t.children)).length:this._manager.supportsMultipleViews,n=s&&!this._buttons["switch-view"].pressed;this._buttons["switch-view"].node.style.display=s?"flex":"none",this._buttons["collapse-expand"].node.style.display=n?"flex":"none",this._buttons["collapse-expand"].enabled=e,this._buttons["switch-view"].enabled=e,this._buttons["shutdown-all"].enabled=e}}class V extends r.SidePanel{constructor(t,e,s){super(),this.managers=t,this._stateDB=null!=s?s:null,this.translator=null!=e?e:l.nullTranslator;const n=this.translator.load("jupyterlab");this.addClass(m),this.toolbar.addItem("refresh",new r.ToolbarButton({tooltip:n.__("Refresh List"),icon:r.refreshIcon,onClick:()=>t.items().forEach((t=>t.refreshRunning()))})),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this.managers.added.disconnect(this.addSection,this),super.dispose())}async addSection(t,e){const s=new L({manager:e,translator:this.translator});this.addWidget(s);const n=(await this._getState()).listViewSections,i=e.name;n&&n.includes(i)&&s.toggleListView(!0),s.viewChanged.connect((async(t,e)=>{await this._updateState(i,e.mode)}))}async _updateState(t,e){var s;let n=null!==(s=(await this._getState()).listViewSections)&&void 0!==s?s:[];"list"!==e||n.includes(t)?n=n.filter((e=>e!==t)):n.push(t);const i={listViewSections:n};this._stateDB&&await this._stateDB.save(C,i)}async _getState(){var t;return this._stateDB&&null!==(t=await this._stateDB.fetch(C))&&void 0!==t?t:{}}}class R extends L{constructor(t){super(t);const e=document.createElement("h3");e.className="jp-SearchableSessions-title";const s=e.appendChild(document.createElement("span"));s.className="jp-SearchableSessions-titleLabel",s.textContent=this.title.label,this.node.insertAdjacentElement("afterbegin",e)}}class k extends g.Widget{constructor(t){super();const e=t.load("jupyterlab");this.addClass("jp-SearchableSessions-emptyIndicator"),this.node.textContent=e.__("No matches")}}class B extends g.Panel{constructor(t,e){super(),this._activeIndex=0,this._translator=null!=e?e:l.nullTranslator,this.addClass(m),this.addClass("jp-SearchableSessions"),this._filterWidget=new E(this._translator),this.addWidget(this._filterWidget),this._list=new D(t,this._filterWidget,e),this.addWidget(this._list),this._filterWidget.filterChanged.connect((()=>{this._activeIndex=0,this._updateActive(0)}),this)}dispose(){this.isDisposed||(u.Signal.clearData(this),super.dispose())}getValue(){const t=[...this.node.querySelectorAll("."+f)];t[Math.min(Math.max(this._activeIndex,0),t.length-1)].click()}handleEvent(t){"keydown"===t.type&&this._evtKeydown(t)}onAfterAttach(t){this._forceFocusInput(),this.node.addEventListener("keydown",this),setTimeout((()=>{this._updateActive(0)}),0)}onAfterDetach(t){this.node.removeEventListener("keydown",this)}_forceFocusInput(){var t;null===(t=this._filterWidget.renderPromise)||void 0===t||t.then((()=>{var t;const e=this._filterWidget.node.querySelector("jp-search"),s=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("input");s?s.focus():console.warn("Input element not found, cannot focus")})).catch(console.warn)}_evtKeydown(t){if("ArrowDown"===t.key||"ArrowUp"===t.key){const e="ArrowDown"===t.key?1:-1;this._updateActive(e)&&t.preventDefault()}}_updateActive(t){const e=[...this.node.querySelectorAll("."+w)].filter((t=>t.checkVisibility()));if(!e.length)return!1;for(const t of e)t.classList.contains("jp-mod-active")&&t.classList.toggle("jp-mod-active",!1);const s=this._activeIndex;let n=null;return n=-1===s?1===t?0:e.length-1:Math.min(Math.max(s+t,0),e.length-1),null!==n&&(e[n].classList.add("jp-mod-active"),c.ElementExt.scrollIntoViewIfNeeded(this._list.node,e[n]),this._activeIndex=n,!0)}}class D extends g.Panel{constructor(t,e,s){super(),this._managers=t,this._translator=null!=s?s:l.nullTranslator,this._filterWidget=e,this.addClass("jp-SearchableSessions-list"),this._emptyIndicator=new k(this._translator),this.addWidget(this._emptyIndicator),t.items().forEach((e=>this.addSection(t,e))),t.added.connect(this.addSection,this)}dispose(){this.isDisposed||(this._managers.added.disconnect(this.addSection,this),super.dispose())}addSection(t,e){const s=new R({manager:e,translator:this._translator,showToolbar:!1,filterProvider:this._filterWidget,viewMode:"list"});s.toggleListView(!0),this.addWidget(s),this.addWidget(this._emptyIndicator)}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n(27961),i=n(15465),o=n(21058),a=n(40930),s=n(57342),d=n(2646),l=n(87844),c=n(25291);const h="CSVTable",u="TSVTable";var g;!function(e){e.CSVGoToLine="csv:go-to-line",e.TSVGoToLine="tsv:go-to-line"}(g||(g={}));const _={activate:function(e,t,r,s,d,l,c,u){var m;const{commands:y,shell:p}=e;let C;u&&(u.addFactory(h,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(C=(0,i.createToolbarFactory)(u,c,h,_.id,t)));const T=t.load("jupyterlab"),v=new o.LT({name:h,label:T.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:!0,toolbarFactory:C,translator:t}),f=new i.WidgetTracker({namespace:"csvviewer"});let b=w.LIGHT_STYLE,S=w.LIGHT_TEXT_CONFIG;r&&r.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:h}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(v);const L=e.docRegistry.getFileType("csv");let F=!1;v.widgetCreated.connect((async(e,t)=>{if(f.add(t),t.context.pathChanged.connect((()=>{f.save(t)})),L&&(t.title.icon=L.icon,t.title.iconClass=L.iconClass,t.title.iconLabel=L.iconLabel),l&&!F){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("csv",e),F=!0}await t.content.ready,t.content.style=b,t.content.rendererConfig=S}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);b=e?w.LIGHT_STYLE:w.DARK_STYLE,S=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,f.forEach((async e=>{await e.content.ready,e.content.style=b,e.content.rendererConfig=S}))}));const G=()=>null!==f.currentWidget&&f.currentWidget===p.currentWidget;y.addCommand(g.CSVGoToLine,{label:T.__("Go to Line"),execute:async()=>{const e=f.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:T.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:G}),d&&d.editMenu.goToLiners.add({id:g.CSVGoToLine,isEnabled:G});const E=()=>{y.notifyCommandChanged(g.CSVGoToLine)};f.currentChanged.connect(E),null===(m=p.currentChanged)||void 0===m||m.connect(E)},id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},m={activate:function(e,t,r,s,d,l,c,h){const{commands:_,shell:y}=e;let p;h&&(h.addFactory(u,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,i.createToolbarFactory)(h,c,u,m.id,t)));const C=t.load("jupyterlab"),T=new o._d({name:u,label:C.__("TSV Viewer"),fileTypes:["tsv"],defaultFor:["tsv"],readOnly:!0,toolbarFactory:p,translator:t}),v=new i.WidgetTracker({namespace:"tsvviewer"});let f=w.LIGHT_STYLE,b=w.LIGHT_TEXT_CONFIG;r&&r.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:u}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(T);const S=e.docRegistry.getFileType("tsv");let L=!1;T.widgetCreated.connect((async(e,t)=>{if(v.add(t),t.context.pathChanged.connect((()=>{v.save(t)})),S&&(t.title.icon=S.icon,t.title.iconClass=S.iconClass,t.title.iconLabel=S.iconLabel),l&&!L){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("tsv",e),L=!0}await t.content.ready,t.content.style=f,t.content.rendererConfig=b}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);f=e?w.LIGHT_STYLE:w.DARK_STYLE,b=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,v.forEach((async e=>{await e.content.ready,e.content.style=f,e.content.rendererConfig=b}))}));const F=()=>null!==v.currentWidget&&v.currentWidget===y.currentWidget;_.addCommand(g.TSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:C.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:F}),d&&d.editMenu.goToLiners.add({id:g.TSVGoToLine,isEnabled:F}),v.currentChanged.connect((()=>{_.notifyCommandChanged(g.TSVGoToLine)}))},id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},y=[_,m];var w;!function(e){e.LIGHT_STYLE={voidColor:"#F3F3F3",backgroundColor:"white",headerBackgroundColor:"#EEEEEE",gridLineColor:"rgba(20, 20, 20, 0.15)",headerGridLineColor:"rgba(20, 20, 20, 0.25)",rowBackgroundColor:e=>e%2==0?"#F5F5F5":"white"},e.DARK_STYLE={voidColor:"black",backgroundColor:"#111111",headerBackgroundColor:"#424242",gridLineColor:"rgba(235, 235, 235, 0.15)",headerGridLineColor:"rgba(235, 235, 235, 0.25)",rowBackgroundColor:e=>e%2==0?"#212121":"#111111"},e.LIGHT_TEXT_CONFIG={textColor:"#111111",matchBackgroundColor:"#FFFFE0",currentMatchBackgroundColor:"#FFFF00",horizontalAlignment:"right"},e.DARK_TEXT_CONFIG={textColor:"#F5F5F5",matchBackgroundColor:"#838423",currentMatchBackgroundColor:"#A3807A",horizontalAlignment:"right"}}(w||(w={}))},40930:(e,t,n)=>{n.d(t,{p:()=>s});var r,i=n(25291),o=n(12668),a=n(63485);class s extends a.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const n=null==(t=t||i.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",n.__("tab")],["|",n.__("pipe")],["#",n.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=n.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,n]of r){const r=document.createElement("option");r.value=t,r.textContent=n,t===e&&(r.selected=!0),d.appendChild(r)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(r||(r={}))},21058:(e,t,n)=>{n.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var r,i=n(44548),o=n(71120),a=n(20998),s=n(81997),d=n(63485),l=n(40930);class c{}class h{constructor(e){this._looping=!0,this._changed=new s.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:n,column:r})=>this._query&&t.match(this._query)?this._row===n&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const n=this._grid.dataModel,r=n.rowCount("body"),i=n.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const o=this._grid.scrollY/this._grid.defaultSizes.rowHeight,a=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,s=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=o&&e<=a&&t>=s&&t<=d,c=t?-1:1;this._column+=c;for(let o=this._row;t?o>=0:o<r;o+=c){for(let r=this._column;t?r>=0:r<i;r+=c)if(n.data("body",o,r).match(e))return this._changed.emit(void 0),l(o,r)||this._grid.scrollToRow(o),this._row=o,this._column=r,!0;this._column=t?i-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,n=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=n-1,this._column=r):!e&&this._row>=n-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new a.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:n,DataGrid:o}=await r.ensureDataGrid();this._defaultStyle=o.defaultStyle,this._grid=new o({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new n,this._grid.copyConfig={separator:"\t",format:o.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new h(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new i.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),n=this._context.model.toString(),i=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:n,delimiter:i});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,n=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:n,"column-header":n,"corner-header":n,"row-header":n})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:n,delimiter:i,reveal:o,...a}=e;t=t||r.createContent(n),o=Promise.all([o,t.revealed]),super({content:t,context:n,reveal:o,...a}),i&&(t.delimiter=i)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let n=t[1].split(";")[0];n=n.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(n))}))}}class _ extends o.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new g({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends _{createNewWidget(e){return new g({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await n.e(9072).then(n.t.bind(n,59072,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new a.PromiseDelegate,r.resolve(await Promise.all([n.e(8032),n.e(9072)]).then(n.bind(n,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1827],{41827:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n(73852),i=n(53876),o=n(21058),a=n(40930),s=n(95514),d=n(70607),l=n(3012),c=n(93050);const h="CSVTable",u="TSVTable";var g;!function(e){e.CSVGoToLine="csv:go-to-line",e.TSVGoToLine="tsv:go-to-line"}(g||(g={}));const _={activate:function(e,t,r,s,d,l,c,u){var m;const{commands:y,shell:p}=e;let C;u&&(u.addFactory(h,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(C=(0,i.createToolbarFactory)(u,c,h,_.id,t)));const T=t.load("jupyterlab"),v=new o.LT({name:h,label:T.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:!0,toolbarFactory:C,translator:t}),f=new i.WidgetTracker({namespace:"csvviewer"});let b=w.LIGHT_STYLE,S=w.LIGHT_TEXT_CONFIG;r&&r.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:h}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(v);const L=e.docRegistry.getFileType("csv");let F=!1;v.widgetCreated.connect((async(e,t)=>{if(f.add(t),t.context.pathChanged.connect((()=>{f.save(t)})),L&&(t.title.icon=L.icon,t.title.iconClass=L.iconClass,t.title.iconLabel=L.iconLabel),l&&!F){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("csv",e),F=!0}await t.content.ready,t.content.style=b,t.content.rendererConfig=S}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);b=e?w.LIGHT_STYLE:w.DARK_STYLE,S=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,f.forEach((async e=>{await e.content.ready,e.content.style=b,e.content.rendererConfig=S}))}));const G=()=>null!==f.currentWidget&&f.currentWidget===p.currentWidget;y.addCommand(g.CSVGoToLine,{label:T.__("Go to Line"),execute:async()=>{const e=f.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:T.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:G}),d&&d.editMenu.goToLiners.add({id:g.CSVGoToLine,isEnabled:G});const E=()=>{y.notifyCommandChanged(g.CSVGoToLine)};f.currentChanged.connect(E),null===(m=p.currentChanged)||void 0===m||m.connect(E)},id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},m={activate:function(e,t,r,s,d,l,c,h){const{commands:_,shell:y}=e;let p;h&&(h.addFactory(u,"delimiter",(e=>new a.p({widget:e.content,translator:t}))),c&&(p=(0,i.createToolbarFactory)(h,c,u,m.id,t)));const C=t.load("jupyterlab"),T=new o._d({name:u,label:C.__("TSV Viewer"),fileTypes:["tsv"],defaultFor:["tsv"],readOnly:!0,toolbarFactory:p,translator:t}),v=new i.WidgetTracker({namespace:"tsvviewer"});let f=w.LIGHT_STYLE,b=w.LIGHT_TEXT_CONFIG;r&&r.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:u}),name:e=>e.context.path}),e.docRegistry.addWidgetFactory(T);const S=e.docRegistry.getFileType("tsv");let L=!1;T.widgetCreated.connect((async(e,t)=>{if(v.add(t),t.context.pathChanged.connect((()=>{v.save(t)})),S&&(t.title.icon=S.icon,t.title.iconClass=S.iconClass,t.title.iconLabel=S.iconLabel),l&&!L){const{CSVSearchProvider:e}=await n.e(6017).then(n.bind(n,36017));l.add("tsv",e),L=!0}await t.content.ready,t.content.style=f,t.content.rendererConfig=b}));s&&s.themeChanged.connect((()=>{const e=!s||!s.theme||s.isLight(s.theme);f=e?w.LIGHT_STYLE:w.DARK_STYLE,b=e?w.LIGHT_TEXT_CONFIG:w.DARK_TEXT_CONFIG,v.forEach((async e=>{await e.content.ready,e.content.style=f,e.content.rendererConfig=b}))}));const F=()=>null!==v.currentWidget&&v.currentWidget===y.currentWidget;_.addCommand(g.TSVGoToLine,{label:C.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(null===e)return;const t=await i.InputDialog.getNumber({title:C.__("Go to Line"),value:0});t.button.accept&&null!==t.value&&e.content.goToLine(t.value)},isEnabled:F}),d&&d.editMenu.goToLiners.add({id:g.TSVGoToLine,isEnabled:F}),v.currentChanged.connect((()=>{_.notifyCommandChanged(g.TSVGoToLine)}))},id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[c.ITranslator],optional:[r.ILayoutRestorer,i.IThemeManager,d.IMainMenu,s.ISearchProviderRegistry,l.ISettingRegistry,i.IToolbarWidgetRegistry],autoStart:!0},y=[_,m];var w;!function(e){e.LIGHT_STYLE={voidColor:"#F3F3F3",backgroundColor:"white",headerBackgroundColor:"#EEEEEE",gridLineColor:"rgba(20, 20, 20, 0.15)",headerGridLineColor:"rgba(20, 20, 20, 0.25)",rowBackgroundColor:e=>e%2==0?"#F5F5F5":"white"},e.DARK_STYLE={voidColor:"black",backgroundColor:"#111111",headerBackgroundColor:"#424242",gridLineColor:"rgba(235, 235, 235, 0.15)",headerGridLineColor:"rgba(235, 235, 235, 0.25)",rowBackgroundColor:e=>e%2==0?"#212121":"#111111"},e.LIGHT_TEXT_CONFIG={textColor:"#111111",matchBackgroundColor:"#FFFFE0",currentMatchBackgroundColor:"#FFFF00",horizontalAlignment:"right"},e.DARK_TEXT_CONFIG={textColor:"#F5F5F5",matchBackgroundColor:"#838423",currentMatchBackgroundColor:"#A3807A",horizontalAlignment:"right"}}(w||(w={}))},40930:(e,t,n)=>{n.d(t,{p:()=>s});var r,i=n(93050),o=n(76878),a=n(2260);class s extends a.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const n=null==(t=t||i.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",n.__("tab")],["|",n.__("pipe")],["#",n.__("hash")]],a=document.createElement("div"),s=document.createElement("span"),d=document.createElement("select");s.textContent=n.__("Delimiter: "),s.className="jp-CSVDelimiter-label";for(const[t,n]of r){const r=document.createElement("option");r.value=t,r.textContent=n,t===e&&(r.selected=!0),d.appendChild(r)}a.appendChild(s);const l=o.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),a.appendChild(l),a}}(r||(r={}))},21058:(e,t,n)=>{n.d(t,{A9:()=>u,B0:()=>c,JZ:()=>h,LT:()=>_,_d:()=>m,kw:()=>g});var r,i=n(20754),o=n(23764),a=n(21961),s=n(2159),d=n(2260),l=n(40930);class c{}class h{constructor(e){this._looping=!0,this._changed=new s.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:n,column:r})=>this._query&&t.match(this._query)?this._row===n&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const n=this._grid.dataModel,r=n.rowCount("body"),i=n.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const o=this._grid.scrollY/this._grid.defaultSizes.rowHeight,a=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,s=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=o&&e<=a&&t>=s&&t<=d,c=t?-1:1;this._column+=c;for(let o=this._row;t?o>=0:o<r;o+=c){for(let r=this._column;t?r>=0:r<i;r+=c)if(n.data("body",o,r).match(e))return this._changed.emit(void 0),l(o,r)||this._grid.scrollToRow(o),this._row=o,this._column=r,!0;this._column=t?i-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,n=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=n-1,this._column=r):!e&&this._row>=n-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new a.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:n,DataGrid:o}=await r.ensureDataGrid();this._defaultStyle=o.defaultStyle,this._grid=new o({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new n,this._grid.copyConfig={separator:"\t",format:o.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new h(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new i.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),n=this._context.model.toString(),i=this._delimiter,o=this._grid.dataModel,a=this._grid.dataModel=new t({data:n,delimiter:i});this._grid.selectionModel=new e({dataModel:a}),o&&o.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,n=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:n,"column-header":n,"corner-header":n,"row-header":n})}}class g extends o.DocumentWidget{constructor(e){let{content:t,context:n,delimiter:i,reveal:o,...a}=e;t=t||r.createContent(n),o=Promise.all([o,t.revealed]),super({content:t,context:n,reveal:o,...a}),i&&(t.delimiter=i)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let n=t[1].split(";")[0];n=n.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(n))}))}}class _ extends o.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new g({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends _{createNewWidget(e){return new g({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new a.PromiseDelegate,t.resolve(await n.e(9772).then(n.t.bind(n,39772,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new a.PromiseDelegate,r.resolve(await Promise.all([n.e(8032),n.e(9772)]).then(n.bind(n,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1828,5166],{11828:(a,e,s)=>{s.r(e),s.d(e,{IWorkspaceCommands:()=>o,IWorkspacesModel:()=>n,WorkspacesModel:()=>r});var t=s(97934),i=s(81997);class r{constructor(a){var e;this._refreshed=new i.Signal(this),this._isDisposed=!1,this._workspaceData={ids:[],values:[]},this._manager=a.manager;const s=a.refreshInterval||1e4;this._poll=new t.Poll({auto:null===(e=a.auto)||void 0===e||e,name:"@jupyterlab/workspaces:Model",factory:()=>this._fetchList(),frequency:{interval:s,backoff:!0,max:3e5},standby:a.refreshStandby||"when-hidden"})}get workspaces(){return this._workspaceData.values}get identifiers(){return this._workspaceData.ids}async create(a){await this._manager.save(a,{metadata:{id:a},data:{}}),await this.refresh()}get refreshed(){return this._refreshed}async refresh(){await this._poll.refresh(),await this._poll.tick}async rename(a,e){const s=await this._manager.fetch(a);s.metadata.id=e,await this._manager.save(e,s),await this._manager.remove(a),await this.refresh()}async reset(a){const e=await this._manager.fetch(a);e.data={},await this._manager.save(a,e),await this.refresh()}async remove(a){await this._manager.remove(a),await this.refresh()}async saveAs(a,e){const s=await this._manager.fetch(a);s.metadata.id=e,await this._manager.save(e,s),await this.refresh()}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._poll.dispose(),i.Signal.clearData(this))}async _fetchList(){this._workspaceData=await this._manager.list(),this._refreshed.emit(void 0)}}var h=s(20998);const o=new h.Token("@jupyterlab/workspaces:IWorkspaceCommands","Provides identifiers of workspace commands."),n=new h.Token("@jupyterlab/workspaces:IWorkspacesModel","Provides a model for available workspaces.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1828,5166],{11828:(a,e,s)=>{s.r(e),s.d(e,{IWorkspaceCommands:()=>o,IWorkspacesModel:()=>n,WorkspacesModel:()=>r});var t=s(32406),i=s(2159);class r{constructor(a){var e;this._refreshed=new i.Signal(this),this._isDisposed=!1,this._workspaceData={ids:[],values:[]},this._manager=a.manager;const s=a.refreshInterval||1e4;this._poll=new t.Poll({auto:null===(e=a.auto)||void 0===e||e,name:"@jupyterlab/workspaces:Model",factory:()=>this._fetchList(),frequency:{interval:s,backoff:!0,max:3e5},standby:a.refreshStandby||"when-hidden"})}get workspaces(){return this._workspaceData.values}get identifiers(){return this._workspaceData.ids}async create(a){await this._manager.save(a,{metadata:{id:a},data:{}}),await this.refresh()}get refreshed(){return this._refreshed}async refresh(){await this._poll.refresh(),await this._poll.tick}async rename(a,e){const s=await this._manager.fetch(a);s.metadata.id=e,await this._manager.save(e,s),await this._manager.remove(a),await this.refresh()}async reset(a){const e=await this._manager.fetch(a);e.data={},await this._manager.save(a,e),await this.refresh()}async remove(a){await this._manager.remove(a),await this.refresh()}async saveAs(a,e){const s=await this._manager.fetch(a);s.metadata.id=e,await this._manager.save(e,s),await this.refresh()}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._poll.dispose(),i.Signal.clearData(this))}async _fetchList(){this._workspaceData=await this._manager.list(),this._refreshed.emit(void 0)}}var h=s(21961);const o=new h.Token("@jupyterlab/workspaces:IWorkspaceCommands","Provides identifiers of workspace commands."),n=new h.Token("@jupyterlab/workspaces:IWorkspacesModel","Provides a model for available workspaces.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1833],{31833:(e,t,i)=>{i.r(t),i.d(t,{EditorSyntaxStatus:()=>T,EditorTableOfContentsFactory:()=>b,FileEditor:()=>u,FileEditorAdapter:()=>r,FileEditorFactory:()=>g,FileEditorSearchProvider:()=>m,FileEditorWidget:()=>p,IEditorTracker:()=>U,LaTeXTableOfContentsFactory:()=>S,LaTeXTableOfContentsModel:()=>A,MarkdownTableOfContentsFactory:()=>k,MarkdownTableOfContentsModel:()=>O,PythonTableOfContentsFactory:()=>I,PythonTableOfContentsModel:()=>D,TabSpaceStatus:()=>w});var n=i(52712),o=i(63648),s=i(20998);class r extends o.WidgetLSPAdapter{constructor(e,t){const{docRegistry:i,...n}=t;super(e,n),this._readyDelegate=new s.PromiseDelegate,this.editor=e.content,this._docRegistry=i,this._virtualEditor=Object.freeze({getEditor:()=>this.editor.editor,ready:()=>Promise.resolve(this.editor.editor),reveal:()=>Promise.resolve(this.editor.editor)}),Promise.all([this.editor.context.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady(),this._readyDelegate.resolve(),this._editorAdded.emit({editor:this._virtualEditor})})).catch(console.error)}get ready(){return this._readyDelegate.promise}get documentPath(){return this.widget.context.path}get mimeType(){var e;const t=this.editor.model.mimeType,i=Array.isArray(t)?null!==(e=t[0])&&void 0!==e?e:n.IEditorMimeTypeService.defaultMimeType:t,o=this.editor.context.contentsModel;return i!=n.IEditorMimeTypeService.defaultMimeType?i:o?this._docRegistry.getFileTypeForModel(o).mimeTypes[0]:i}get languageFileExtension(){let e=this.documentPath.split(".");return e[e.length-1]}get ceEditor(){return this.editor.editor}get activeEditor(){return this._virtualEditor}get wrapperElement(){return this.widget.node}get path(){return this.widget.context.path}get editors(){var e,t;return[{ceEditor:this._virtualEditor,type:"code",value:null!==(t=null===(e=this.editor)||void 0===e?void 0:e.model.sharedModel.getSource())&&void 0!==t?t:""}]}dispose(){this.isDisposed||(this._editorRemoved.emit({editor:this._virtualEditor}),this.editor.model.mimeTypeChanged.disconnect(this.reloadConnection),super.dispose())}createVirtualDocument(){return new o.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!0,hasLspSupportedFile:!0})}getEditorIndexAt(e){return 0}getEditorIndex(e){return 0}getEditorWrapper(e){return this.wrapperElement}async initOnceReady(){this.initVirtual(),await this.connectDocument(this.virtualDocument,!1),this.editor.model.mimeTypeChanged.connect(this.reloadConnection,this)}}var a=i(15465),d=i(81059),l=i(71120),c=i(12668),h=i(63485);class u extends h.Widget{constructor(e){super(),this._ready=new s.PromiseDelegate,this.addClass("jp-FileEditor");const t=this._context=e.context;this._mimeTypeService=e.mimeTypeService;const i=this._editorWidget=new n.CodeEditorWrapper({factory:e.factory,model:t.model,editorOptions:{config:u.defaultEditorConfig}});this._editorWidget.addClass("jp-FileEditorCodeWrapper"),this._editorWidget.node.dataset.jpCodeRunner="true",this._editorWidget.node.dataset.jpUndoer="true",this.editor=i.editor,this.model=i.model,t.ready.then((()=>{this._onContextReady()})),this._onPathChanged(),t.pathChanged.connect(this._onPathChanged,this),(this.layout=new h.StackedLayout).addWidget(i)}get context(){return this._context}get ready(){return this._ready.promise}handleEvent(e){this.model&&"mousedown"===e.type&&this._ensureFocus()}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("mousedown",this)}onBeforeDetach(e){this.node.removeEventListener("mousedown",this)}onActivateRequest(e){this._ensureFocus()}_ensureFocus(){this.editor.hasFocus()||this.editor.focus()}_onContextReady(){this.isDisposed||(this.editor.clearHistory(),this._ready.resolve(void 0))}_onPathChanged(){const e=this.editor,t=this._context.localPath;e.model.mimeType=this._mimeTypeService.getMimeTypeByFilePath(t)}}!function(e){e.defaultEditorConfig={lineNumbers:!0,scrollPastEnd:!0}}(u||(u={}));class p extends l.DocumentWidget{async setFragment(e){const t=e.split("=");if("#line"!==t[0])return;const i=t[1];let n;return n=i.includes(",")?i.split(",")[0]||"0":i,this.context.ready.then((()=>{const e={line:parseInt(n,10),column:0};this.content.editor.setCursorPosition(e),this.content.editor.revealPosition(e)}))}}class g extends l.ABCWidgetFactory{constructor(e){super(e.factoryOptions),this._services=e.editorServices}createNewWidget(e){const t=this._services.factoryService.newDocumentEditor,i=new u({factory:e=>t(e),context:e,mimeTypeService:this._services.mimeTypeService});return i.title.icon=c.textEditorIcon,new p({content:i,context:e})}}class m extends d.EditorSearchProvider{constructor(e){super(),this.widget=e,this._searchActive=!1}get isReadOnly(){return this.editor.getOption("readOnly")}get replaceOptionsSupport(){return{preserveCase:!0}}get editor(){return this.widget.content.editor}get model(){return this.widget.content.model}async startQuery(e,t){this._searchActive=!0,await super.startQuery(e,t),await this.highlightNext(!0,{from:"selection-start",scroll:!1,select:!1})}async endQuery(){this._searchActive=!1,await super.endQuery()}async onSharedModelChanged(e,t){if(this._searchActive)return super.onSharedModelChanged(e,t)}static createNew(e,t){return new m(e)}static isApplicable(e){return e instanceof a.MainAreaWidget&&e.content instanceof u&&e.content.editor instanceof d.CodeMirrorEditor}getInitialQuery(){const e=this.editor;return e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to)}}var y=i(54252),f=i(25291),v=i(78156),_=i.n(v);function C(e){return _().createElement(y.TextItem,{source:e.language,onClick:e.handleClick})}class T extends c.VDomRenderer{constructor(e){var t;super(new T.Model(e.languages)),this._handleClick=()=>{const e=new h.Menu({commands:this._commands});this._popup&&this._popup.dispose(),this.model.languages.getLanguages().sort(((e,t)=>{var i,n;const o=null!==(i=e.displayName)&&void 0!==i?i:e.name,s=null!==(n=t.displayName)&&void 0!==n?n:t.name;return o.localeCompare(s)})).forEach((t=>{var i;if(0===t.name.toLowerCase().indexOf("brainf"))return;const n={name:t.name,displayName:null!==(i=t.displayName)&&void 0!==i?i:t.name};e.addItem({command:"fileeditor:change-language",args:n})})),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"left"})},this._popup=null,this._commands=e.commands,this.translator=null!==(t=e.translator)&&void 0!==t?t:f.nullTranslator;const i=this.translator.load("jupyterlab");this.addClass("jp-mod-highlighted"),this.title.caption=i.__("Change text editor syntax highlighting")}render(){return this.model?_().createElement(C,{language:this.model.language,handleClick:this._handleClick}):null}}function x(e){const t=(e.translator||f.nullTranslator).load("jupyterlab"),i="number"==typeof e.tabSpace?t.__("Spaces"):t.__("Tab Indent");return _().createElement(y.TextItem,{onClick:e.handleClick,source:"number"==typeof e.tabSpace?`${i}: ${e.tabSpace}`:i,title:t.__("Change the indentation…")})}!function(e){class t extends c.VDomModel{constructor(e){super(),this.languages=e,this._onMIMETypeChange=(e,t)=>{var i;const o=this._language,s=this.languages.findByMIME(t.newValue);this._language=null!==(i=null==s?void 0:s.name)&&void 0!==i?i:n.IEditorMimeTypeService.defaultMimeType,this._triggerChange(o,this._language)},this._language="",this._editor=null}get language(){return this._language}get editor(){return this._editor}set editor(e){var t;const i=this._editor;null!==i&&i.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);const o=this._language;if(this._editor=e,null===this._editor)this._language="";else{const e=this.languages.findByMIME(this._editor.model.mimeType);this._language=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:n.IEditorMimeTypeService.defaultMimeType,this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange)}this._triggerChange(o,this._language)}_triggerChange(e,t){e!==t&&this.stateChanged.emit(void 0)}}e.Model=t}(T||(T={}));class w extends c.VDomRenderer{constructor(e){super(new w.Model),this._popup=null,this._menu=e.menu,this.translator=e.translator||f.nullTranslator,this.addClass("jp-mod-highlighted")}render(){var e;if(null===(e=this.model)||void 0===e?void 0:e.indentUnit){const e="Tab"===this.model.indentUnit?null:parseInt(this.model.indentUnit,10);return _().createElement(x,{tabSpace:e,handleClick:()=>this._handleClick(),translator:this.translator})}return null}_handleClick(){const e=this._menu;this._popup&&this._popup.dispose(),e.aboutToClose.connect(this._menuClosed,this),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"right"}),e.update()}_menuClosed(){this.removeClass("jp-mod-clicked")}}!function(e){class t extends c.VDomModel{get indentUnit(){return this._indentUnit}set indentUnit(e){e!==this._indentUnit&&(this._indentUnit=e,this.stateChanged.emit())}}e.Model=t}(w||(w={}));var E=i(45776);class b extends E.TableOfContentsFactory{createNew(e,t){const i=super.createNew(e,t),n=(t,i)=>{i&&e.content.editor.setCursorPosition({line:i.line,column:0})};return i.activeHeadingChanged.connect(n),e.disposed.connect((()=>{i.activeHeadingChanged.disconnect(n)})),i}}const M={part:1,chapter:1,section:1,subsection:2,subsubsection:3,paragraph:4,subparagraph:5},P=/^\s*\\(section|subsection|subsubsection){(.+)}/;class A extends E.TableOfContentsModel{get documentType(){return"latex"}get supportedOptions(){return["maximalDepth","numberHeaders"]}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n"),t=new Array;let i=t.length;const n=new Array;for(let o=0;o<e.length;o++){const s=e[o].match(P);if(s){const e=M[s[1]];if(e<=this.configuration.maximalDepth){const r=E.TableOfContentsUtils.getPrefix(e,i,t,{...this.configuration,baseNumbering:1,numberingH1:!0});i=e,n.push({text:s[2],prefix:r,level:e,line:o})}}}return Promise.resolve(n)}}class S extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("text/x-latex"===n||"text/x-stex"===n)}return!1}_createNew(e,t){return new A(e,t)}}class O extends E.TableOfContentsModel{get documentType(){return"markdown"}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource(),t=E.TableOfContentsUtils.filterHeadings(E.TableOfContentsUtils.Markdown.getHeadings(e),{...this.configuration,numberHeaders:!1});return Promise.resolve(t)}}class k extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&E.TableOfContentsUtils.Markdown.isMarkdown(n)}return!1}_createNew(e,t){return new O(e,t)}}let F;try{F=new RegExp("^\\s*(class |def |async def |from |import )","d")}catch(e){F=new RegExp("^\\s*(class |def |async def |from |import )")}class D extends E.TableOfContentsModel{get documentType(){return"python"}async getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n");let t=new Array,n=!1,o=1,s=-1;for(const r of e){let e;if(s++,F.flags.includes("d"))e=F.exec(r);else{const{default:t}=await i.e(2913).then(i.t.bind(i,32913,23));e=t(F,r)}if(e){const[i]=e.indices[1];1===o&&i>0&&(o=i);const a=["from ","import "].includes(e[1]);if(a&&n)continue;n=a;const d=1+i/o;if(d>this.configuration.maximalDepth)continue;t.push({text:r.slice(i),level:d,line:s})}}return Promise.resolve(t)}}class I extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("application/x-python-code"===n||"text/x-python"===n)}return!1}_createNew(e,t){return new D(e,t)}}const U=new s.Token("@jupyterlab/fileeditor:IEditorTracker","A widget tracker for file editors.\n Use this if you want to be able to iterate over and interact with file editors\n created by the application.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1833],{31833:(e,t,i)=>{i.r(t),i.d(t,{EditorSyntaxStatus:()=>T,EditorTableOfContentsFactory:()=>b,FileEditor:()=>u,FileEditorAdapter:()=>r,FileEditorFactory:()=>g,FileEditorSearchProvider:()=>m,FileEditorWidget:()=>p,IEditorTracker:()=>U,LaTeXTableOfContentsFactory:()=>S,LaTeXTableOfContentsModel:()=>A,MarkdownTableOfContentsFactory:()=>k,MarkdownTableOfContentsModel:()=>O,PythonTableOfContentsFactory:()=>I,PythonTableOfContentsModel:()=>D,TabSpaceStatus:()=>w});var n=i(983),o=i(37497),s=i(21961);class r extends o.WidgetLSPAdapter{constructor(e,t){const{docRegistry:i,...n}=t;super(e,n),this._readyDelegate=new s.PromiseDelegate,this.editor=e.content,this._docRegistry=i,this._virtualEditor=Object.freeze({getEditor:()=>this.editor.editor,ready:()=>Promise.resolve(this.editor.editor),reveal:()=>Promise.resolve(this.editor.editor)}),Promise.all([this.editor.context.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady(),this._readyDelegate.resolve(),this._editorAdded.emit({editor:this._virtualEditor})})).catch(console.error)}get ready(){return this._readyDelegate.promise}get documentPath(){return this.widget.context.path}get mimeType(){var e;const t=this.editor.model.mimeType,i=Array.isArray(t)?null!==(e=t[0])&&void 0!==e?e:n.IEditorMimeTypeService.defaultMimeType:t,o=this.editor.context.contentsModel;return i!=n.IEditorMimeTypeService.defaultMimeType?i:o?this._docRegistry.getFileTypeForModel(o).mimeTypes[0]:i}get languageFileExtension(){let e=this.documentPath.split(".");return e[e.length-1]}get ceEditor(){return this.editor.editor}get activeEditor(){return this._virtualEditor}get wrapperElement(){return this.widget.node}get path(){return this.widget.context.path}get editors(){var e,t;return[{ceEditor:this._virtualEditor,type:"code",value:null!==(t=null===(e=this.editor)||void 0===e?void 0:e.model.sharedModel.getSource())&&void 0!==t?t:""}]}dispose(){this.isDisposed||(this._editorRemoved.emit({editor:this._virtualEditor}),this.editor.model.mimeTypeChanged.disconnect(this.reloadConnection),super.dispose())}createVirtualDocument(){return new o.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!0,hasLspSupportedFile:!0})}getEditorIndexAt(e){return 0}getEditorIndex(e){return 0}getEditorWrapper(e){return this.wrapperElement}async initOnceReady(){this.initVirtual(),await this.connectDocument(this.virtualDocument,!1),this.editor.model.mimeTypeChanged.connect(this.reloadConnection,this)}}var a=i(53876),d=i(3984),l=i(23764),c=i(76878),h=i(2260);class u extends h.Widget{constructor(e){super(),this._ready=new s.PromiseDelegate,this.addClass("jp-FileEditor");const t=this._context=e.context;this._mimeTypeService=e.mimeTypeService;const i=this._editorWidget=new n.CodeEditorWrapper({factory:e.factory,model:t.model,editorOptions:{config:u.defaultEditorConfig}});this._editorWidget.addClass("jp-FileEditorCodeWrapper"),this._editorWidget.node.dataset.jpCodeRunner="true",this._editorWidget.node.dataset.jpUndoer="true",this.editor=i.editor,this.model=i.model,t.ready.then((()=>{this._onContextReady()})),this._onPathChanged(),t.pathChanged.connect(this._onPathChanged,this),(this.layout=new h.StackedLayout).addWidget(i)}get context(){return this._context}get ready(){return this._ready.promise}handleEvent(e){this.model&&"mousedown"===e.type&&this._ensureFocus()}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("mousedown",this)}onBeforeDetach(e){this.node.removeEventListener("mousedown",this)}onActivateRequest(e){this._ensureFocus()}_ensureFocus(){this.editor.hasFocus()||this.editor.focus()}_onContextReady(){this.isDisposed||(this.editor.clearHistory(),this._ready.resolve(void 0))}_onPathChanged(){const e=this.editor,t=this._context.localPath;e.model.mimeType=this._mimeTypeService.getMimeTypeByFilePath(t)}}!function(e){e.defaultEditorConfig={lineNumbers:!0,scrollPastEnd:!0}}(u||(u={}));class p extends l.DocumentWidget{async setFragment(e){const t=e.split("=");if("#line"!==t[0])return;const i=t[1];let n;return n=i.includes(",")?i.split(",")[0]||"0":i,this.context.ready.then((()=>{const e={line:parseInt(n,10),column:0};this.content.editor.setCursorPosition(e),this.content.editor.revealPosition(e)}))}}class g extends l.ABCWidgetFactory{constructor(e){super(e.factoryOptions),this._services=e.editorServices}createNewWidget(e){const t=this._services.factoryService.newDocumentEditor,i=new u({factory:e=>t(e),context:e,mimeTypeService:this._services.mimeTypeService});return i.title.icon=c.textEditorIcon,new p({content:i,context:e})}}class m extends d.EditorSearchProvider{constructor(e){super(),this.widget=e,this._searchActive=!1}get isReadOnly(){return this.editor.getOption("readOnly")}get replaceOptionsSupport(){return{preserveCase:!0}}get editor(){return this.widget.content.editor}get model(){return this.widget.content.model}async startQuery(e,t){this._searchActive=!0,await super.startQuery(e,t),await this.highlightNext(!0,{from:"selection-start",scroll:!1,select:!1})}async endQuery(){this._searchActive=!1,await super.endQuery()}async onSharedModelChanged(e,t){if(this._searchActive)return super.onSharedModelChanged(e,t)}static createNew(e,t){return new m(e)}static isApplicable(e){return e instanceof a.MainAreaWidget&&e.content instanceof u&&e.content.editor instanceof d.CodeMirrorEditor}getInitialQuery(){const e=this.editor;return e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to)}}var y=i(33441),f=i(93050),v=i(78156),_=i.n(v);function C(e){return _().createElement(y.TextItem,{source:e.language,onClick:e.handleClick})}class T extends c.VDomRenderer{constructor(e){var t;super(new T.Model(e.languages)),this._handleClick=()=>{const e=new h.Menu({commands:this._commands});this._popup&&this._popup.dispose(),this.model.languages.getLanguages().sort(((e,t)=>{var i,n;const o=null!==(i=e.displayName)&&void 0!==i?i:e.name,s=null!==(n=t.displayName)&&void 0!==n?n:t.name;return o.localeCompare(s)})).forEach((t=>{var i;if(0===t.name.toLowerCase().indexOf("brainf"))return;const n={name:t.name,displayName:null!==(i=t.displayName)&&void 0!==i?i:t.name};e.addItem({command:"fileeditor:change-language",args:n})})),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"left"})},this._popup=null,this._commands=e.commands,this.translator=null!==(t=e.translator)&&void 0!==t?t:f.nullTranslator;const i=this.translator.load("jupyterlab");this.addClass("jp-mod-highlighted"),this.title.caption=i.__("Change text editor syntax highlighting")}render(){return this.model?_().createElement(C,{language:this.model.language,handleClick:this._handleClick}):null}}function x(e){const t=(e.translator||f.nullTranslator).load("jupyterlab"),i="number"==typeof e.tabSpace?t.__("Spaces"):t.__("Tab Indent");return _().createElement(y.TextItem,{onClick:e.handleClick,source:"number"==typeof e.tabSpace?`${i}: ${e.tabSpace}`:i,title:t.__("Change the indentation…")})}!function(e){class t extends c.VDomModel{constructor(e){super(),this.languages=e,this._onMIMETypeChange=(e,t)=>{var i;const o=this._language,s=this.languages.findByMIME(t.newValue);this._language=null!==(i=null==s?void 0:s.name)&&void 0!==i?i:n.IEditorMimeTypeService.defaultMimeType,this._triggerChange(o,this._language)},this._language="",this._editor=null}get language(){return this._language}get editor(){return this._editor}set editor(e){var t;const i=this._editor;null!==i&&i.model.mimeTypeChanged.disconnect(this._onMIMETypeChange);const o=this._language;if(this._editor=e,null===this._editor)this._language="";else{const e=this.languages.findByMIME(this._editor.model.mimeType);this._language=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:n.IEditorMimeTypeService.defaultMimeType,this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange)}this._triggerChange(o,this._language)}_triggerChange(e,t){e!==t&&this.stateChanged.emit(void 0)}}e.Model=t}(T||(T={}));class w extends c.VDomRenderer{constructor(e){super(new w.Model),this._popup=null,this._menu=e.menu,this.translator=e.translator||f.nullTranslator,this.addClass("jp-mod-highlighted")}render(){var e;if(null===(e=this.model)||void 0===e?void 0:e.indentUnit){const e="Tab"===this.model.indentUnit?null:parseInt(this.model.indentUnit,10);return _().createElement(x,{tabSpace:e,handleClick:()=>this._handleClick(),translator:this.translator})}return null}_handleClick(){const e=this._menu;this._popup&&this._popup.dispose(),e.aboutToClose.connect(this._menuClosed,this),this._popup=(0,y.showPopup)({body:e,anchor:this,align:"right"}),e.update()}_menuClosed(){this.removeClass("jp-mod-clicked")}}!function(e){class t extends c.VDomModel{get indentUnit(){return this._indentUnit}set indentUnit(e){e!==this._indentUnit&&(this._indentUnit=e,this.stateChanged.emit())}}e.Model=t}(w||(w={}));var E=i(10035);class b extends E.TableOfContentsFactory{createNew(e,t){const i=super.createNew(e,t),n=(t,i)=>{i&&e.content.editor.setCursorPosition({line:i.line,column:0})};return i.activeHeadingChanged.connect(n),e.disposed.connect((()=>{i.activeHeadingChanged.disconnect(n)})),i}}const M={part:1,chapter:1,section:1,subsection:2,subsubsection:3,paragraph:4,subparagraph:5},P=/^\s*\\(section|subsection|subsubsection){(.+)}/;class A extends E.TableOfContentsModel{get documentType(){return"latex"}get supportedOptions(){return["maximalDepth","numberHeaders"]}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n"),t=new Array;let i=t.length;const n=new Array;for(let o=0;o<e.length;o++){const s=e[o].match(P);if(s){const e=M[s[1]];if(e<=this.configuration.maximalDepth){const r=E.TableOfContentsUtils.getPrefix(e,i,t,{...this.configuration,baseNumbering:1,numberingH1:!0});i=e,n.push({text:s[2],prefix:r,level:e,line:o})}}}return Promise.resolve(n)}}class S extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("text/x-latex"===n||"text/x-stex"===n)}return!1}_createNew(e,t){return new A(e,t)}}class O extends E.TableOfContentsModel{get documentType(){return"markdown"}getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource(),t=E.TableOfContentsUtils.filterHeadings(E.TableOfContentsUtils.Markdown.getHeadings(e),{...this.configuration,numberHeaders:!1});return Promise.resolve(t)}}class k extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&E.TableOfContentsUtils.Markdown.isMarkdown(n)}return!1}_createNew(e,t){return new O(e,t)}}let F;try{F=new RegExp("^\\s*(class |def |async def |from |import )","d")}catch(e){F=new RegExp("^\\s*(class |def |async def |from |import )")}class D extends E.TableOfContentsModel{get documentType(){return"python"}async getHeadings(){if(!this.isActive)return Promise.resolve(null);const e=this.widget.content.model.sharedModel.getSource().split("\n");let t=new Array,n=!1,o=1,s=-1;for(const r of e){let e;if(s++,F.flags.includes("d"))e=F.exec(r);else{const{default:t}=await i.e(2913).then(i.t.bind(i,32913,23));e=t(F,r)}if(e){const[i]=e.indices[1];1===o&&i>0&&(o=i);const a=["from ","import "].includes(e[1]);if(a&&n)continue;n=a;const d=1+i/o;if(d>this.configuration.maximalDepth)continue;t.push({text:r.slice(i),level:d,line:s})}}return Promise.resolve(t)}}class I extends b{isApplicable(e){var t,i;if(super.isApplicable(e)){let n=null===(i=null===(t=e.content)||void 0===t?void 0:t.model)||void 0===i?void 0:i.mimeType;return n&&("application/x-python-code"===n||"text/x-python"===n)}return!1}_createNew(e,t){return new D(e,t)}}const U=new s.Token("@jupyterlab/fileeditor:IEditorTracker","A widget tracker for file editors.\n Use this if you want to be able to iterate over and interact with file editors\n created by the application.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1958],{31958:(e,t,a)=>{a.r(t),a.d(t,{Grid:()=>i,GridModel:()=>c});var o,r=a(59072),s=a(81997),n=a(63485),l=a(25291),d=a(78947);class i extends n.Panel{constructor(e){super();const{commands:t,model:a,themeManager:s}=e;this.model=a;const n=new c(e.translator),l=new r.DataGrid,i=new o.MouseHandler;i.doubleClicked.connect(((e,a)=>t.execute(d.q.CommandIDs.inspectVariable,{variableReference:n.getVariableReference(a.row),name:n.getVariableName(a.row)}))),i.selected.connect(((e,t)=>{const{row:a}=t;this.model.selectedVariable={name:n.getVariableName(a),value:n.data("body",a,1),type:n.data("body",a,2),variablesReference:n.getVariableReference(a)}})),l.dataModel=n,l.keyHandler=new r.BasicKeyHandler,l.mouseHandler=i,l.selectionModel=new r.BasicSelectionModel({dataModel:n}),l.stretchLastColumn=!0,l.node.style.height="100%",this._grid=l,s&&s.themeChanged.connect(this._updateStyles,this),this.addWidget(l)}set filter(e){this._grid.dataModel.filter=e,this.update()}set scope(e){this._grid.dataModel.scope=e,this.update()}get dataModel(){return this._grid.dataModel}onAfterAttach(e){super.onAfterAttach(e),this._updateStyles()}_updateStyles(){const{style:e,textRenderer:t}=o.computeStyle();this._grid.cellRenderers.update({},t),this._grid.style=e}}class c extends r.DataModel{constructor(e){super(),this._filter=new Set,this._scope="",this._data={name:[],type:[],value:[],variablesReference:[]},this._trans=(e||l.nullTranslator).load("jupyterlab")}get filter(){return this._filter}set filter(e){this._filter=e}get scope(){return this._scope}set scope(e){this._scope=e}rowCount(e){return"body"===e?this._data.name.length:1}columnCount(e){return"body"===e?2:1}data(e,t,a){return"row-header"===e?this._data.name[t]:"column-header"===e?1===a?this._trans.__("Value"):this._trans.__("Type"):"corner-header"===e?this._trans.__("Name"):1===a?this._data.value[t]:this._data.type[t]}getVariableReference(e){return this._data.variablesReference[e]}getVariableName(e){return this._data.name[e]}setData(e){var t,a;this._clearData(),this.emitChanged({type:"model-reset"});const o=null!==(t=e.find((e=>e.name===this._scope)))&&void 0!==t?t:e[0],r=(null!==(a=null==o?void 0:o.variables)&&void 0!==a?a:[]).filter((e=>e.name&&!this._filter.has(e.name)));r.forEach(((e,t)=>{var a;this._data.name[t]=e.name,this._data.type[t]=null!==(a=e.type)&&void 0!==a?a:"",this._data.value[t]=e.value,this._data.variablesReference[t]=e.variablesReference})),this.emitChanged({type:"rows-inserted",region:"body",index:1,span:r.length})}_clearData(){this._data={name:[],type:[],value:[],variablesReference:[]}}}!function(e){e.computeStyle=function(){const e=function(){const e=document.createElement("div");return e.className="jp-DebuggerVariables-colorPalette",e.innerHTML='\n <div class="jp-mod-void"></div>\n <div class="jp-mod-background"></div>\n <div class="jp-mod-header-background"></div>\n <div class="jp-mod-grid-line"></div>\n <div class="jp-mod-header-grid-line"></div>\n <div class="jp-mod-selection"></div>\n <div class="jp-mod-text"></div>\n ',e}();let t;document.body.appendChild(e),t=e.querySelector(".jp-mod-void");const a=getComputedStyle(t).color;t=e.querySelector(".jp-mod-background");const o=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-background");const s=getComputedStyle(t).color;t=e.querySelector(".jp-mod-grid-line");const n=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-grid-line");const l=getComputedStyle(t).color;t=e.querySelector(".jp-mod-selection");const d=getComputedStyle(t).color;t=e.querySelector(".jp-mod-text");const i=getComputedStyle(t).color;return document.body.removeChild(e),{style:{voidColor:a,backgroundColor:o,headerBackgroundColor:s,gridLineColor:n,headerGridLineColor:l,rowBackgroundColor:e=>e%2==0?a:o,selectionFillColor:d},textRenderer:new r.TextRenderer({font:"12px sans-serif",textColor:i,backgroundColor:"",verticalAlignment:"center",horizontalAlignment:"left"})}};class t extends r.BasicMouseHandler{constructor(){super(...arguments),this._doubleClicked=new s.Signal(this),this._selected=new s.Signal(this)}get doubleClicked(){return this._doubleClicked}get selected(){return this._selected}dispose(){this.isDisposed||(s.Signal.disconnectSender(this),super.dispose())}onMouseDoubleClick(e,t){const a=e.hitTest(t.clientX,t.clientY);this._doubleClicked.emit(a)}onMouseDown(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r),super.onMouseDown(e,t)}onContextMenu(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r)}}e.MouseHandler=t}(o||(o={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1958],{31958:(e,t,a)=>{a.r(t),a.d(t,{Grid:()=>i,GridModel:()=>c});var o,r=a(39772),s=a(2159),n=a(2260),l=a(93050),d=a(78947);class i extends n.Panel{constructor(e){super();const{commands:t,model:a,themeManager:s}=e;this.model=a;const n=new c(e.translator),l=new r.DataGrid,i=new o.MouseHandler;i.doubleClicked.connect(((e,a)=>t.execute(d.q.CommandIDs.inspectVariable,{variableReference:n.getVariableReference(a.row),name:n.getVariableName(a.row)}))),i.selected.connect(((e,t)=>{const{row:a}=t;this.model.selectedVariable={name:n.getVariableName(a),value:n.data("body",a,1),type:n.data("body",a,2),variablesReference:n.getVariableReference(a)}})),l.dataModel=n,l.keyHandler=new r.BasicKeyHandler,l.mouseHandler=i,l.selectionModel=new r.BasicSelectionModel({dataModel:n}),l.stretchLastColumn=!0,l.node.style.height="100%",this._grid=l,s&&s.themeChanged.connect(this._updateStyles,this),this.addWidget(l)}set filter(e){this._grid.dataModel.filter=e,this.update()}set scope(e){this._grid.dataModel.scope=e,this.update()}get dataModel(){return this._grid.dataModel}onAfterAttach(e){super.onAfterAttach(e),this._updateStyles()}_updateStyles(){const{style:e,textRenderer:t}=o.computeStyle();this._grid.cellRenderers.update({},t),this._grid.style=e}}class c extends r.DataModel{constructor(e){super(),this._filter=new Set,this._scope="",this._data={name:[],type:[],value:[],variablesReference:[]},this._trans=(e||l.nullTranslator).load("jupyterlab")}get filter(){return this._filter}set filter(e){this._filter=e}get scope(){return this._scope}set scope(e){this._scope=e}rowCount(e){return"body"===e?this._data.name.length:1}columnCount(e){return"body"===e?2:1}data(e,t,a){return"row-header"===e?this._data.name[t]:"column-header"===e?1===a?this._trans.__("Value"):this._trans.__("Type"):"corner-header"===e?this._trans.__("Name"):1===a?this._data.value[t]:this._data.type[t]}getVariableReference(e){return this._data.variablesReference[e]}getVariableName(e){return this._data.name[e]}setData(e){var t,a;this._clearData(),this.emitChanged({type:"model-reset"});const o=null!==(t=e.find((e=>e.name===this._scope)))&&void 0!==t?t:e[0],r=(null!==(a=null==o?void 0:o.variables)&&void 0!==a?a:[]).filter((e=>e.name&&!this._filter.has(e.name)));r.forEach(((e,t)=>{var a;this._data.name[t]=e.name,this._data.type[t]=null!==(a=e.type)&&void 0!==a?a:"",this._data.value[t]=e.value,this._data.variablesReference[t]=e.variablesReference})),this.emitChanged({type:"rows-inserted",region:"body",index:1,span:r.length})}_clearData(){this._data={name:[],type:[],value:[],variablesReference:[]}}}!function(e){e.computeStyle=function(){const e=function(){const e=document.createElement("div");return e.className="jp-DebuggerVariables-colorPalette",e.innerHTML='\n <div class="jp-mod-void"></div>\n <div class="jp-mod-background"></div>\n <div class="jp-mod-header-background"></div>\n <div class="jp-mod-grid-line"></div>\n <div class="jp-mod-header-grid-line"></div>\n <div class="jp-mod-selection"></div>\n <div class="jp-mod-text"></div>\n ',e}();let t;document.body.appendChild(e),t=e.querySelector(".jp-mod-void");const a=getComputedStyle(t).color;t=e.querySelector(".jp-mod-background");const o=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-background");const s=getComputedStyle(t).color;t=e.querySelector(".jp-mod-grid-line");const n=getComputedStyle(t).color;t=e.querySelector(".jp-mod-header-grid-line");const l=getComputedStyle(t).color;t=e.querySelector(".jp-mod-selection");const d=getComputedStyle(t).color;t=e.querySelector(".jp-mod-text");const i=getComputedStyle(t).color;return document.body.removeChild(e),{style:{voidColor:a,backgroundColor:o,headerBackgroundColor:s,gridLineColor:n,headerGridLineColor:l,rowBackgroundColor:e=>e%2==0?a:o,selectionFillColor:d},textRenderer:new r.TextRenderer({font:"12px sans-serif",textColor:i,backgroundColor:"",verticalAlignment:"center",horizontalAlignment:"left"})}};class t extends r.BasicMouseHandler{constructor(){super(...arguments),this._doubleClicked=new s.Signal(this),this._selected=new s.Signal(this)}get doubleClicked(){return this._doubleClicked}get selected(){return this._selected}dispose(){this.isDisposed||(s.Signal.disconnectSender(this),super.dispose())}onMouseDoubleClick(e,t){const a=e.hitTest(t.clientX,t.clientY);this._doubleClicked.emit(a)}onMouseDown(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r),super.onMouseDown(e,t)}onContextMenu(e,t){let{clientX:a,clientY:o}=t,r=e.hitTest(a,o);this._selected.emit(r)}}e.MouseHandler=t}(o||(o={}))}}]);