notebook 7.2.0rc0__py3-none-any.whl → 7.2.1__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 (175) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/113.bundle.js +1 -1
  3. notebook/static/1198.bundle.js +1 -1
  4. notebook/static/134.bundle.js +1 -1
  5. notebook/static/1388.bundle.js +1 -1
  6. notebook/static/1408.bundle.js +1 -1
  7. notebook/static/1496.bundle.js +1 -1
  8. notebook/static/1647.bundle.js +1 -1
  9. notebook/static/1650.bundle.js +1 -1
  10. notebook/static/1684.bundle.js +1 -1
  11. notebook/static/1809.bundle.js +1 -1
  12. notebook/static/1827.bundle.js +1 -1
  13. notebook/static/1833.bundle.js +1 -1
  14. notebook/static/1846.bundle.js +1 -1
  15. notebook/static/1958.bundle.js +1 -1
  16. notebook/static/1962.bundle.js +1 -1
  17. notebook/static/2007.bundle.js +1 -1
  18. notebook/static/2088.bundle.js +1 -1
  19. notebook/static/2089.bundle.js +1 -1
  20. notebook/static/2122.bundle.js +1 -1
  21. notebook/static/2167.bundle.js +1 -1
  22. notebook/static/2184.bundle.js +1 -1
  23. notebook/static/2311.bundle.js +1 -1
  24. notebook/static/2401.bundle.js +1 -1
  25. notebook/static/2479.bundle.js +1 -1
  26. notebook/static/2489.bundle.js +1 -1
  27. notebook/static/2607.bundle.js +1 -1
  28. notebook/static/2615.bundle.js +1 -1
  29. notebook/static/2636.bundle.js +1 -1
  30. notebook/static/2692.bundle.js +1 -1
  31. notebook/static/2924.bundle.js +1 -1
  32. notebook/static/2944.bundle.js +1 -1
  33. notebook/static/3129.bundle.js +1 -1
  34. notebook/static/3146.bundle.js +1 -1
  35. notebook/static/3154.bundle.js +1 -1
  36. notebook/static/3187.bundle.js +1 -1
  37. notebook/static/3213.bundle.js +1 -1
  38. notebook/static/3340.bundle.js +1 -1
  39. notebook/static/3360.bundle.js +1 -1
  40. notebook/static/3466.bundle.js +1 -1
  41. notebook/static/3512.bundle.js +1 -1
  42. notebook/static/3676.bundle.js +1 -1
  43. notebook/static/3680.bundle.js +1 -1
  44. notebook/static/374.bundle.js +1 -1
  45. notebook/static/3768.bundle.js +1 -1
  46. notebook/static/377.bundle.js +1 -1
  47. notebook/static/3863.bundle.js +1 -1
  48. notebook/static/3881.bundle.js +1 -1
  49. notebook/static/4042.bundle.js +1 -1
  50. notebook/static/4212.bundle.js +1 -1
  51. notebook/static/4382.bundle.js +1 -1
  52. notebook/static/4630.bundle.js +1 -1
  53. notebook/static/4645.bundle.js +1 -1
  54. notebook/static/4811.bundle.js +1 -1
  55. notebook/static/4837.bundle.js +1 -1
  56. notebook/static/5099.bundle.js +1 -1
  57. notebook/static/5135.bundle.js +1 -1
  58. notebook/static/5254.bundle.js +1 -1
  59. notebook/static/5263.bundle.js +1 -1
  60. notebook/static/5313.bundle.js +1 -1
  61. notebook/static/5325.bundle.js +1 -1
  62. notebook/static/5346.bundle.js +1 -1
  63. notebook/static/5425.bundle.js +1 -1
  64. notebook/static/5426.bundle.js +1 -1
  65. notebook/static/545.bundle.js +1 -1
  66. notebook/static/5573.bundle.js +1 -1
  67. notebook/static/5601.bundle.js +1 -1
  68. notebook/static/5733.bundle.js +1 -1
  69. notebook/static/5912.bundle.js +1 -1
  70. notebook/static/5921.bundle.js +1 -1
  71. notebook/static/6017.bundle.js +1 -1
  72. notebook/static/{1053.bundle.js → 6078.bundle.js} +1 -1
  73. notebook/static/6139.bundle.js +1 -1
  74. notebook/static/62.bundle.js +1 -1
  75. notebook/static/6281.bundle.js +1 -1
  76. notebook/static/6345.bundle.js +1 -1
  77. notebook/static/6417.bundle.js +1 -1
  78. notebook/static/6604.bundle.js +1 -1
  79. notebook/static/6621.bundle.js +1 -1
  80. notebook/static/6627.bundle.js +1 -1
  81. notebook/static/6640.bundle.js +1 -1
  82. notebook/static/6748.bundle.js +1 -1
  83. notebook/static/6815.bundle.js +1 -1
  84. notebook/static/6853.bundle.js +1 -1
  85. notebook/static/6893.bundle.js +1 -1
  86. notebook/static/690.bundle.js +1 -1
  87. notebook/static/6962.bundle.js +1 -1
  88. notebook/static/6999.bundle.js +1 -1
  89. notebook/static/7097.bundle.js +1 -1
  90. notebook/static/7153.bundle.js +1 -1
  91. notebook/static/7226.bundle.js +1 -1
  92. notebook/static/7252.bundle.js +1 -1
  93. notebook/static/7259.bundle.js +1 -1
  94. notebook/static/7302.bundle.js +1 -1
  95. notebook/static/7386.bundle.js +1 -1
  96. notebook/static/7391.bundle.js +1 -1
  97. notebook/static/7471.bundle.js +1 -1
  98. notebook/static/7506.bundle.js +2 -2
  99. notebook/static/7543.bundle.js +1 -1
  100. notebook/static/7603.bundle.js +1 -1
  101. notebook/static/7639.bundle.js +1 -1
  102. notebook/static/7655.bundle.js +1 -1
  103. notebook/static/7684.bundle.js +1 -1
  104. notebook/static/7812.bundle.js +1 -1
  105. notebook/static/7819.bundle.js +1 -1
  106. notebook/static/7854.bundle.js +1 -1
  107. notebook/static/7900.bundle.js +1 -1
  108. notebook/static/7906.bundle.js +1 -1
  109. notebook/static/8471.bundle.js +1 -1
  110. notebook/static/8579.bundle.js +1 -1
  111. notebook/static/8633.bundle.js +1 -1
  112. notebook/static/8771.bundle.js +1 -1
  113. notebook/static/8781.bundle.js +1 -1
  114. notebook/static/8845.bundle.js +1 -1
  115. notebook/static/8875.bundle.js +1 -1
  116. notebook/static/8907.bundle.js +1 -1
  117. notebook/static/8928.bundle.js +1 -1
  118. notebook/static/893.bundle.js +1 -1
  119. notebook/static/901.bundle.js +1 -1
  120. notebook/static/9068.bundle.js +1 -1
  121. notebook/static/9136.bundle.js +1 -1
  122. notebook/static/9151.bundle.js +1 -1
  123. notebook/static/9161.bundle.js +1 -1
  124. notebook/static/9268.bundle.js +1 -1
  125. notebook/static/9335.bundle.js +1 -1
  126. notebook/static/9341.bundle.js +1 -1
  127. notebook/static/9380.bundle.js +1 -1
  128. notebook/static/9605.bundle.js +1 -1
  129. notebook/static/9638.bundle.js +1 -1
  130. notebook/static/9680.bundle.js +1 -1
  131. notebook/static/9685.bundle.js +1 -1
  132. notebook/static/9752.bundle.js +1 -1
  133. notebook/static/9821.bundle.js +1 -1
  134. notebook/static/9852.bundle.js +1 -1
  135. notebook/static/bundle.js +1 -1
  136. notebook/static/third-party-licenses.json +101 -101
  137. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  138. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  139. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  140. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  141. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  142. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  143. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  144. notebook-7.2.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.c842f59b09a70d32fbf5.js → notebook-7.2.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.9cd06af416befd593828.js +1 -1
  145. notebook-7.2.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/678.af323c3ff765541c6aa4.js +1 -0
  146. notebook-7.2.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.0be57dd4ecbedec78b46.js → notebook-7.2.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.6d26fccf0ddab13bf5bb.js +1 -1
  147. notebook-7.2.1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.d04be841d48ffe2a9bdd.js +1 -0
  148. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  149. {notebook-7.2.0rc0.dist-info → notebook-7.2.1.dist-info}/METADATA +2 -2
  150. {notebook-7.2.0rc0.dist-info → notebook-7.2.1.dist-info}/RECORD +173 -173
  151. notebook-7.2.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/546.f643d3e7381a2d9b834f.js +0 -1
  152. notebook-7.2.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.dbe55a308c2bef40bd5e.js +0 -1
  153. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  154. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  155. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  156. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  157. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  158. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  159. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  160. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  161. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  162. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  163. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  164. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  165. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  166. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  167. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  168. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  169. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  170. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  171. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  172. {notebook-7.2.0rc0.data → notebook-7.2.1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  173. {notebook-7.2.0rc0.dist-info → notebook-7.2.1.dist-info}/WHEEL +0 -0
  174. {notebook-7.2.0rc0.dist-info → notebook-7.2.1.dist-info}/entry_points.txt +0 -0
  175. {notebook-7.2.0rc0.dist-info → notebook-7.2.1.dist-info}/licenses/LICENSE +0 -0
notebook/_version.py CHANGED
@@ -5,7 +5,7 @@ import re
5
5
  from collections import namedtuple
6
6
 
7
7
  # Use "hatch version xx.yy.zz" to handle version changes
8
- __version__ = "7.2.0rc0"
8
+ __version__ = "7.2.1"
9
9
 
10
10
  # PEP440 version parser
11
11
  _version_regex = re.compile(
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[113],{113:(t,e,s)=>{s.r(e),s.d(e,{default:()=>K});var i,n=s(24554),r=s(37267),o=s(22620),l=s(16934),a=s(20998),c=s(2549),h=s(18395);!function(t){t.editBinding="shortcuts:edit-keybinding",t.addBinding="shortcuts:add-keybinding",t.deleteBinding="shortcuts:delete-keybinding",t.toggleSelectors="shortcuts:toggle-selectors",t.resetAll="shortcuts:reset-all"}(i||(i={}));var d=s(78156),u=s.n(d),p=s(33625),m=s(80554);class g extends d.Component{constructor(t){super(t),this.handleSubmit=async()=>{this._isReplacingExistingKeybinding?this.state.selected?(this.props.toggleInput(),this.setState({value:"",userInput:""})):await this._updateShortcut():(await this._updateShortcut(),this.setState({value:"",keys:[],currentChain:""}),this.props.toggleInput()),this._updateConflictDisplay()},this._updateShortcut=async()=>{const t=[...this.state.keys,this.state.currentChain];this.setState({keys:t}),this.props.keybinding?await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,t):await this.props.addKeybinding(this.props.shortcut,t)},this.handleOverwrite=async()=>{const t=[...this.state.keys,this.state.currentChain];for(const e of this.state.conflicts){const s=e.keybindings.filter((e=>a.JSONExt.deepEqual(e.keys,t)||t.some((t=>a.JSONExt.deepEqual(e.keys,[t])))))[0];s?await this.props.deleteKeybinding(e,s):console.error(`Conflicting binding could not be found for ${e} using keys ${t}`)}this.setState({conflicts:[]}),await this._updateShortcut(),this._updateConflictDisplay()},this.parseChaining=(t,e,s,i,n)=>{let r=m.EN_US.keyForKeydownEvent(t.nativeEvent);const o=["Shift","Control","Alt","Meta","Ctrl","Accel"];if("Backspace"===t.key)s="",i=[],n="",this.setState({value:"",userInput:s,keys:i,currentChain:n});else if("CapsLock"!==t.key){const e=s.substr(s.lastIndexOf(" ")+1,s.length).trim();-1===o.lastIndexOf(e)&&""!=e?(s+=",",i.push(n),n="",t.ctrlKey&&"Control"!=t.key&&(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()),t.metaKey&&"Meta"!=t.key&&(s=(s+" Accel").trim(),n=(n+" Accel").trim()),t.altKey&&"Alt"!=t.key&&(s=(s+" Alt").trim(),n=(n+" Alt").trim()),t.shiftKey&&"Shift"!=t.key&&(s=(s+" Shift").trim(),n=(n+" Shift").trim()),-1===o.lastIndexOf(t.key)?(s=(s+" "+r).trim(),n=(n+" "+r).trim()):"Meta"===t.key?(s=(s+" Accel").trim(),n=(n+" Accel").trim()):"Control"===t.key?(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()):"Shift"===t.key?(s=(s+" Shift").trim(),n=(n+" Shift").trim()):"Alt"===t.key?(s=(s+" Alt").trim(),n=(n+" Alt").trim()):(s=(s+" "+t.key).trim(),n=(n+" "+t.key).trim())):"Control"===t.key?(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()):"Meta"===t.key?(s=(s+" Accel").trim(),n=(n+" Accel").trim()):"Shift"===t.key?(s=(s+" Shift").trim(),n=(n+" Shift").trim()):"Alt"===t.key?(s=(s+" Alt").trim(),n=(n+" Alt").trim()):(s=(s+" "+r).trim(),n=(n+" "+r).trim())}return this.setState({keys:i,currentChain:n}),[s,i,n]},this.checkNonFunctional=()=>{const t=["Ctrl","Alt","Accel","Shift"],e=this.state.currentChain.split(" "),s=e[e.length-1];return this.setState({isFunctional:!(-1!==t.indexOf(s))}),-1!==t.indexOf(s)},this.checkShortcutAvailability=(t,e,s)=>{const i=this.props.findConflictsFor([...e,s],this.props.shortcut.selector),n=""===t||0===i.length;return!n&&1===i.length&&i[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding?(this.setState({isAvailable:!0}),[]):(this.setState({isAvailable:n}),i)},this.handleInput=t=>{t.preventDefault(),this.setState({selected:!1});const e=this.parseChaining(t,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain),s=e[0],i=e[1],n=e[2],r=this.props.toSymbols(s);let o=this.checkShortcutAvailability(s,i,n);this.setState({value:r,userInput:s,conflicts:o,keys:i,currentChain:n},(()=>{this.checkNonFunctional(),this._updateConflictDisplay()}))},this.handleBlur=t=>{null!==t.relatedTarget&&"no-blur"===t.relatedTarget.id||(this.props.toggleInput(),this.setState({value:"",userInput:"",conflicts:[]},(()=>{this._updateConflictDisplay()})))},this.state={value:this.props.placeholder,userInput:"",isAvailable:!0,isFunctional:this._isReplacingExistingKeybinding,conflicts:[],keys:[],currentChain:"",selected:!0}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_updateConflictDisplay(){this.props.displayConflicts({conflictsWith:this.state.conflicts,keys:this.state.keys,overwrite:this.handleOverwrite})}render(){const t=this.props.translator.load("jupyterlab");let e="jp-Shortcuts-Input";return this.state.isAvailable||(e+=" jp-mod-unavailable-Input"),d.createElement("div",{className:this.props.displayInput?this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox":"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-mod-hidden",onBlur:t=>this.handleBlur(t)},d.createElement("div",{tabIndex:0,id:"no-blur",className:e,onKeyDown:this.handleInput,ref:t=>t&&t.focus(),"data-lm-suppress-shortcuts":"true"},d.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":""===this.state.value?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},""===this.state.value?t.__("press keys"):this.state.value)),d.createElement("button",{className:this.state.isFunctional?this.state.isAvailable?"jp-Shortcuts-Submit":"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit jp-mod-defunc-Submit",id:"no-blur",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit},this.state.isAvailable?d.createElement(o.checkIcon.react,null):d.createElement(o.errorIcon.react,null)))}}class y extends d.Component{constructor(t){super(t),this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput})},this.toSymbols=t=>t.split(" ").reduce(((t,e)=>"Ctrl"===e?(t+" ⌃").trim():"Alt"===e?(t+" ⌥").trim():"Shift"===e?(t+" ⇧").trim():"Accel"===e&&h.Platform.IS_MAC?(t+" ⌘").trim():"Accel"===e?(t+" ⌃").trim():(t+" "+e).trim()),""),this._trans=this.props.external.translator.load("jupyterlab"),this.state={displayNewInput:!1,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(t,e){if(!("shortcutId"in e)||e.shortcutId===this.props.shortcut.id){if("add-keybinding"===e.request)return this.toggleInputNew();if("edit-keybinding"===e.request&&this.toggleInputReplaceMethod(e.keybinding),"delete-keybinding"===e.request){const t=this.props.shortcut,s=t.keybindings[e.keybinding];this.props.deleteKeybinding(t,s).catch(console.error)}}}getCategoryCell(){return d.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var t;return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-label"},null!==(t=this.props.shortcut.label)&&void 0!==t?t:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return d.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this._trans.__("Reset"))}getSourceCell(){const t=this.props.shortcut.keybindings.every((t=>t.isDefault));return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-Shortcuts-SourceCell"},t?this._trans.__("Default"):this._trans.__("Custom")),t?"":this.getResetShortCutLink())}getOptionalSelectorCell(){return this.props.showSelectors?d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(t){const e=["jp-Shortcuts-ShortcutCell"];switch(t.length){case 1:e.push("jp-Shortcuts-SingleCell");break;case 0:e.push("jp-Shortcuts-EmptyCell")}return e.join(" ")}toggleInputReplaceMethod(t){const e=this.state.displayReplaceInput[t];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[t]:!e}})}getDisplayReplaceInput(t){return this.state.displayReplaceInput[t]}getOrDiplayIfNeeded(t){const e=["jp-Shortcuts-Or"];return(t||this.state.displayNewInput)&&e.push("jp-Shortcuts-Or-Forced"),d.createElement("div",{className:e.join(" ")},this._trans.__("or"))}getShortCutAsInput(t,e){return d.createElement(g,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(e),shortcut:this.props.shortcut,keybinding:t,displayConflicts:e=>{const s=new Map(this.state.conflicts);s.set(t,e),this.setState({conflicts:s})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(e),placeholder:this.toSymbols(t.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(t){return t.keys.map(((e,s)=>d.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:s},d.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(e)),s+1<t.keys.length?d.createElement("div",{className:"jp-Shortcuts-Comma"},","):null)))}isLocationBeingEdited(t){return this.state.displayReplaceInput[t]}getDivForKey(t,e,s){return d.createElement("div",{className:"jp-Shortcuts-ShortcutContainer",key:this.props.shortcut.id+"_"+t,"data-keybinding":t,"data-shortcut":this.props.shortcut.id,onClick:()=>this.toggleInputReplaceMethod(t)},this.isLocationBeingEdited(t)?this.getShortCutAsInput(e,t):this.getShortCutForDisplayOnly(e),this.getOrDiplayIfNeeded(t<s.length-1))}getAddLink(){return d.createElement("a",{className:this.state.displayNewInput?"":"jp-Shortcuts-Plus",onClick:()=>{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?d.createElement(g,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:t=>{const e=new Map(this.state.conflicts);e.set(null,t),this.setState({conflicts:e})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):d.createElement("div",null)}getShortCutsCell(t){return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:this.getClassNameForShortCuts(t)},t.map(((e,s)=>this.getDivForKey(s,e,t))),t.length>=1&&!this.state.displayNewInput&&!this.state.displayReplaceInput[0]&&this.getAddLink(),0===t.length&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const t=[...this.state.conflicts.values()].filter((t=>0!==t.conflictsWith.length));return 0===t.length?d.createElement(d.Fragment,null):d.createElement("div",{className:"jp-Shortcuts-Row"},d.createElement("div",{className:"jp-Shortcuts-ConflictContainer"},t.map((t=>{const e=t.keys.join(" ")+"_"+t.conflictsWith.map((t=>t.id)).join("");return d.createElement("div",{className:"jp-Shortcuts-Conflict",key:e},d.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",t.conflictsWith.map((t=>{var e;return null!==(e=t.label)&&void 0!==e?e:t.command})).join(", "))),d.createElement("div",{className:"jp-Shortcuts-ErrorButton"},d.createElement("button",null,this._trans.__("Cancel")),d.createElement("button",{id:"no-blur",onClick:()=>{t.overwrite()}},this._trans.__("Overwrite"))))}))))}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter((t=>0!==t.keys.filter((t=>""!=t)).length))}render(){return d.createElement(d.Fragment,null,d.createElement("div",{className:"jp-Shortcuts-Row","data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}class S extends d.Component{render(){return d.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:this.props.height-115+"px"},id:"shortcutListContainer"},d.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map((t=>d.createElement(y,{key:t.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,shortcut:t,showSelectors:this.props.showSelectors,external:this.props.external})))))}}class b extends d.Component{render(){return d.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,d.createElement(o.caretDownEmptyThinIcon.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function f(t){return d.createElement("div",{className:"jp-Shortcuts-Symbols"},d.createElement("table",null,d.createElement("tbody",null,d.createElement("tr",null,d.createElement("td",null,d.createElement("kbd",null,"Cmd")),d.createElement("td",null,"⌘"),d.createElement("td",null,d.createElement("kbd",null,"Ctrl")),d.createElement("td",null,"⌃")),d.createElement("tr",null,d.createElement("td",null,d.createElement("kbd",null,"Alt")),d.createElement("td",null,"⌥"),d.createElement("td",null,d.createElement("kbd",null,"Shift")),d.createElement("td",null,"⇧")))))}function C(t){const e=t.translator.load("jupyterlab");return d.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},d.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>t.toggleSelectors()},t.showSelectors?e.__("Hide Selectors"):e.__("Show Selectors")),d.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>t.resetShortcuts()},e.__("Reset All")))}class k extends d.Component{constructor(t){super(t)}getShortCutTitleItem(t,e){return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement(b,{title:t,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:e}))}render(){const t=this.props.translator.load("jupyterlab");return d.createElement("div",{className:"jp-Shortcuts-Top"},d.createElement("div",{className:"jp-Shortcuts-TopNav"},d.createElement(f,null),d.createElement(o.FilterBox,{"aria-label":t.__("Search shortcuts"),updateFilter:(t,e)=>this.props.updateSearchQuery(null!=e?e:""),placeholder:t.__("Search…"),useFuzzyFilter:!1}),d.createElement(C,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,translator:this.props.translator})),d.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},d.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(t.__("Category"),"category"),this.getShortCutTitleItem(t.__("Command"),"command"),d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"title-div"},t.__("Shortcut"))),this.getShortCutTitleItem(t.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(t.__("Selectors"),"selector"))))}}class v extends Map{constructor(t){var e,s,i;super();const{settings:n,commandRegistry:r}=t,o=null!==(e=n.user.shortcuts)&&void 0!==e?e:[],l=new Set(o.map(this._computeKeybindingId.bind(this))),a=null!==(s=n.composite.shortcuts)&&void 0!==s?s:[];for(const t of a){const e=this._computeTargetId(t),s=this._computeKeybindingId(t),n={keys:t.keys,isDefault:!l.has(s)},o=this.get(e);if(o)o.keybindings.push(n);else{const s=t.command.split(":"),o=null!==(i=r.label(t.command,t.args))&&void 0!==i?i:s.length>1?s[1]:void 0,l=s[0];this.set(e,{id:e,selector:t.selector,command:t.command,category:l,label:o,args:t.args,keybindings:[n]})}}}findConflictsFor(t,e){const s=new _({registry:this});let i=s.findConflicts(t,e);if(0!==i.length)return i;for(const n of t)if(i=s.findConflicts([n],e),0!==i.length)return i;return[]}_computeTargetId(t){var e;return t.command+"_"+t.selector+"_"+JSON.stringify(null!==(e=t.args)&&void 0!==e?e:{})}_computeKeybindingId(t){var e;return[t.command,t.selector,JSON.stringify(null!==(e=t.args)&&void 0!==e?e:{}),t.keys.join(" ")].join("_")}}class _{constructor(t){var e;const s=new Map;for(const i of t.registry.values())for(const t of i.keybindings){const n=this._keybindingHash(t.keys,i.selector),r=null!==(e=s.get(n))&&void 0!==e?e:[];r.push(i),s.set(n,r)}this._keybindingsMap=s}findConflicts(t,e){var s;const i=this._keybindingHash(t,e);return null!==(s=this._keybindingsMap.get(i))&&void 0!==s?s:[]}_keybindingHash(t,e){return t.join(" ")+"_"+e}}function E(t,e){var s;const i=t.category.toLowerCase(),n=`${i} ${(null!==(s=t.label)&&void 0!==s?s:"").toLowerCase()}`;let r=1/0,o=null;const l=/\b\w/g;for(;;){const t=l.exec(n);if(!t)break;const s=p.StringExt.matchSumOfDeltas(n,e,t.index);if(!s)break;s&&s.score<=r&&(r=s.score,o=s.indices)}if(!o||r===1/0)return null;const a=i.length+1,c=p.ArrayExt.lowerBound(o,a,((t,e)=>t-e)),h=o.slice(0,c),d=o.slice(c);for(let t=0,e=d.length;t<e;++t)d[t]-=a;return 0===h.length?{matchType:0,categoryIndices:null,labelIndices:d,score:r,item:t}:0===d.length?{matchType:1,categoryIndices:h,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:h,labelIndices:d,score:r,item:t}}class I extends d.Component{constructor(t){super(t),this.updateSearchQuery=t=>{this.setState({searchQuery:t},(()=>{const t=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(t)},(()=>{this.sortShortcuts()}))}))},this.resetShortcuts=async()=>{const t=await this.props.external.getSettings();await t.set("shortcuts",[]),await this._refreshShortcutList()},this.resetKeybindings=async t=>{for(const e of t.keybindings)await this._setKeybinding(t,e.isDefault?e.keys:[],e)},this.replaceKeybinding=async(t,e,s)=>this._setKeybinding(t,s,e),this.deleteKeybinding=async(t,e)=>{await this._setKeybinding(t,[],e)},this.addKeybinding=async(t,e)=>{await this._setKeybinding(t,e)},this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})},this.updateSort=t=>{t!==this.state.currentSort&&this.setState({currentSort:t},this.sortShortcuts)},this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:!1,searchQuery:"",showSelectors:!1,currentSort:"category"}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this),this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(t,e){if("toggle-selectors"===e.request)return this.toggleSelectors();"reset-all"===e.request&&await this.resetShortcuts()}async _refreshShortcutList(){const t=await this.props.external.getSettings(),e=new v({commandRegistry:this.props.external.commandRegistry,settings:t});this.setState({shortcutRegistry:e,filteredShortcutList:this._searchFilterShortcuts(e),shortcutsFetched:!0},(()=>{this.sortShortcuts()}))}_searchFilterShortcuts(t){return t?function(t,e){e=e.replace(/\s+/g,"").toLowerCase();let s=[];for(const i of t.values()){if(!e){s.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:i});continue}let t=E(i,e);t&&s.push(t)}return s}(t,this.state.searchQuery).map((t=>t.item)):[]}async _setKeybinding(t,e,s){var i,n,r;1===e.length&&""==e[0]&&(e=[]);const o=await this.props.external.getSettings(),l=null!==(i=o.user.shortcuts)&&void 0!==i?i:[],c=[];let h=!1;for(let i of l)if(i.command===t.command&&i.selector===t.selector&&a.JSONExt.deepEqual(null!==(n=i.args)&&void 0!==n?n:{},null!==(r=t.args)&&void 0!==r?r:{})&&s&&a.JSONExt.deepEqual(s.keys,i.keys)){const t=s&&s.isDefault&&a.JSONExt.deepEqual(s.keys,e);0===e.length||t||c.push({command:i.command,selector:i.selector,keys:e}),h=!0}else c.push(i);if(!h){const i=!s||!a.JSONExt.deepEqual(s.keys,e);s&&s.isDefault&&i&&c.push({command:t.command,selector:t.selector,disabled:!0,keys:s.keys}),0!==e.length&&c.push({command:t.command,selector:t.selector,keys:e})}await o.set("shortcuts",c),await this._refreshShortcutList()}sortShortcuts(){const t=this.state.filteredShortcutList;let e=this.state.currentSort;"command"===e&&(e="label");const s=t=>{var s;return"source"===e?t.keybindings.every((t=>t.isDefault))?"default":"other":null!==(s=t[e])&&void 0!==s?s:""};t.sort(((t,e)=>{var i,n;const r=s(t),o=s(e),l=r.localeCompare(o);if(l)return l;{const s=null!==(i=t.label)&&void 0!==i?i:"",r=null!==(n=e.label)&&void 0!==n?n:"";return s.localeCompare(r)}})),this.setState({filteredShortcutList:t})}render(){return this.state.shortcutsFetched?d.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},d.createElement(k,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,width:this.props.width,translator:this.props.external.translator}),d.createElement(S,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,showSelectors:this.state.showSelectors,findConflictsFor:(t,e)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(t,e):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),height:this.props.height,external:this.props.external})):null}}var w=s(81997);const j="@jupyterlab/shortcuts-extension:shortcuts";function x(t,e,s,i){return{translator:s,getSettings:()=>t.load(j,!0),commandRegistry:e.commands,actionRequested:i}}const N={id:j,description:"Adds the keyboard shortcuts editor.",requires:[n.ISettingRegistry],optional:[r.ITranslator,o.IFormRendererRegistry],activate:async(t,e,s,o)=>{const c=null!=s?s:r.nullTranslator,d=c.load("jupyterlab"),{commands:p}=t;let m,g,y={};if(o){const s=new w.Signal({}),n=t=>void 0!==t.dataset.shortcut;t.commands.addCommand(i.editBinding,{label:d.__("Edit Keybinding"),caption:d.__("Edit existing keybinding"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.keybinding,r=null==e?void 0:e.dataset.shortcut;if(!r||!i)return console.log("Missing shortcut id/keybinding information");s.emit({request:"edit-keybinding",keybinding:parseInt(i,10),shortcutId:r})}}),t.commands.addCommand(i.deleteBinding,{label:d.__("Delete Keybinding"),caption:d.__("Delete chosen keybinding"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.keybinding,r=null==e?void 0:e.dataset.shortcut;if(!r||!i)return console.log("Missing shortcut id/keybinding information");s.emit({request:"delete-keybinding",keybinding:parseInt(i,10),shortcutId:r})}}),t.commands.addCommand(i.addBinding,{label:d.__("Add Keybinding"),caption:d.__("Add new keybinding for existing shortcut target"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.shortcut;if(!i)return console.log("Missing shortcut id to add keybinding to");s.emit({request:"add-keybinding",shortcutId:i})}}),p.addCommand(i.toggleSelectors,{label:d.__("Toggle Selectors"),caption:d.__("Toggle command selectors"),execute:()=>{s.emit({request:"toggle-selectors"})}}),p.addCommand(i.resetAll,{label:d.__("Reset All"),caption:d.__("Reset all shortcuts"),execute:()=>{s.emit({request:"reset-all"})}});const r={fieldRenderer:i=>(t=>u().createElement(I,{external:t.external,height:1e3,width:1e3}))({external:x(e,t,c,s),...i})};o.addRenderer(`${N.id}.shortcuts`,r)}function S(s){const i=t.commands.listCommands().join("\n");g||(g=a.JSONExt.deepCopy(s.properties.shortcuts.default)),y={},s.properties.shortcuts.default=Object.keys(e.plugins).map((t=>{const s=e.plugins[t].schema["jupyter.lab.shortcuts"]||[];return y[t]=s,s})).concat([g]).reduce(((t,e)=>h.Platform.IS_MAC?t.concat(e):t.concat(e.filter((t=>!t.keys.some((t=>{const{cmd:e}=l.CommandRegistry.parseKeystroke(t);return e})))))),[]).sort(((t,e)=>t.command.localeCompare(e.command))),s.properties.shortcuts.description=d.__('Note: To disable a system default shortcut,\ncopy it to User Preferences and add the\n"disabled" key, for example:\n{\n "command": "application:activate-next-tab",\n "keys": [\n "Ctrl Shift ]"\n ],\n "selector": "body",\n "disabled": true\n}\n\nList of commands followed by keyboard shortcuts:\n%1\n\nList of keyboard shortcuts:',i)}e.pluginChanged.connect((async(t,s)=>{if(s!==N.id){const t=y[s],i=e.plugins[s].schema["jupyter.lab.shortcuts"]||[];void 0!==t&&a.JSONExt.deepEqual(t,i)||(m=null,e.plugins[N.id].schema.properties.shortcuts.default=g,await e.load(N.id,!0))}})),e.transform(N.id,{compose:t=>{var e,s,i,r;m||(m=a.JSONExt.deepCopy(t.schema),S(m));const o=null!==(i=null===(s=null===(e=m.properties)||void 0===e?void 0:e.shortcuts)||void 0===s?void 0:s.default)&&void 0!==i?i:[],l={shortcuts:null!==(r=t.data.user.shortcuts)&&void 0!==r?r:[]},c={shortcuts:n.SettingRegistry.reconcileShortcuts(o,l.shortcuts)};return t.data={composite:c,user:l},t},fetch:t=>(m||(m=a.JSONExt.deepCopy(t.schema),S(m)),{data:t.data,id:t.id,raw:t.raw,schema:m,version:t.version})});try{m=null;const t=await e.load(N.id);A.loadShortcuts(p,t.composite),t.changed.connect((()=>{A.loadShortcuts(p,t.composite)}))}catch(t){console.error(`Loading ${N.id} failed.`,t)}},autoStart:!0},K=N;var A;!function(t){let e;t.loadShortcuts=function(t,s){var i;const n=null!==(i=null==s?void 0:s.shortcuts)&&void 0!==i?i:[];e&&e.dispose(),e=n.reduce(((e,s)=>{const i=function(t){if(!t||"object"!=typeof t)return;const{isArray:e}=Array;return"command"in t&&"keys"in t&&"selector"in t&&e(t.keys)?t:void 0}(s);return i&&e.add(t.addKeyBinding(i)),e}),new c.DisposableSet)}}(A||(A={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[113],{113:(t,e,s)=>{s.r(e),s.d(e,{default:()=>K});var i,n=s(23295),r=s(12030),o=s(35613),l=s(16934),a=s(20998),c=s(2549),h=s(18395);!function(t){t.editBinding="shortcuts:edit-keybinding",t.addBinding="shortcuts:add-keybinding",t.deleteBinding="shortcuts:delete-keybinding",t.toggleSelectors="shortcuts:toggle-selectors",t.resetAll="shortcuts:reset-all"}(i||(i={}));var d=s(78156),u=s.n(d),p=s(33625),m=s(80554);class g extends d.Component{constructor(t){super(t),this.handleSubmit=async()=>{this._isReplacingExistingKeybinding?this.state.selected?(this.props.toggleInput(),this.setState({value:"",userInput:""})):await this._updateShortcut():(await this._updateShortcut(),this.setState({value:"",keys:[],currentChain:""}),this.props.toggleInput()),this._updateConflictDisplay()},this._updateShortcut=async()=>{const t=[...this.state.keys,this.state.currentChain];this.setState({keys:t}),this.props.keybinding?await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,t):await this.props.addKeybinding(this.props.shortcut,t)},this.handleOverwrite=async()=>{const t=[...this.state.keys,this.state.currentChain];for(const e of this.state.conflicts){const s=e.keybindings.filter((e=>a.JSONExt.deepEqual(e.keys,t)||t.some((t=>a.JSONExt.deepEqual(e.keys,[t])))))[0];s?await this.props.deleteKeybinding(e,s):console.error(`Conflicting binding could not be found for ${e} using keys ${t}`)}this.setState({conflicts:[]}),await this._updateShortcut(),this._updateConflictDisplay()},this.parseChaining=(t,e,s,i,n)=>{let r=m.EN_US.keyForKeydownEvent(t.nativeEvent);const o=["Shift","Control","Alt","Meta","Ctrl","Accel"];if("Backspace"===t.key)s="",i=[],n="",this.setState({value:"",userInput:s,keys:i,currentChain:n});else if("CapsLock"!==t.key){const e=s.substr(s.lastIndexOf(" ")+1,s.length).trim();-1===o.lastIndexOf(e)&&""!=e?(s+=",",i.push(n),n="",t.ctrlKey&&"Control"!=t.key&&(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()),t.metaKey&&"Meta"!=t.key&&(s=(s+" Accel").trim(),n=(n+" Accel").trim()),t.altKey&&"Alt"!=t.key&&(s=(s+" Alt").trim(),n=(n+" Alt").trim()),t.shiftKey&&"Shift"!=t.key&&(s=(s+" Shift").trim(),n=(n+" Shift").trim()),-1===o.lastIndexOf(t.key)?(s=(s+" "+r).trim(),n=(n+" "+r).trim()):"Meta"===t.key?(s=(s+" Accel").trim(),n=(n+" Accel").trim()):"Control"===t.key?(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()):"Shift"===t.key?(s=(s+" Shift").trim(),n=(n+" Shift").trim()):"Alt"===t.key?(s=(s+" Alt").trim(),n=(n+" Alt").trim()):(s=(s+" "+t.key).trim(),n=(n+" "+t.key).trim())):"Control"===t.key?(s=(s+" Ctrl").trim(),n=(n+" Ctrl").trim()):"Meta"===t.key?(s=(s+" Accel").trim(),n=(n+" Accel").trim()):"Shift"===t.key?(s=(s+" Shift").trim(),n=(n+" Shift").trim()):"Alt"===t.key?(s=(s+" Alt").trim(),n=(n+" Alt").trim()):(s=(s+" "+r).trim(),n=(n+" "+r).trim())}return this.setState({keys:i,currentChain:n}),[s,i,n]},this.checkNonFunctional=()=>{const t=["Ctrl","Alt","Accel","Shift"],e=this.state.currentChain.split(" "),s=e[e.length-1];return this.setState({isFunctional:!(-1!==t.indexOf(s))}),-1!==t.indexOf(s)},this.checkShortcutAvailability=(t,e,s)=>{const i=this.props.findConflictsFor([...e,s],this.props.shortcut.selector),n=""===t||0===i.length;return!n&&1===i.length&&i[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding?(this.setState({isAvailable:!0}),[]):(this.setState({isAvailable:n}),i)},this.handleInput=t=>{t.preventDefault(),this.setState({selected:!1});const e=this.parseChaining(t,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain),s=e[0],i=e[1],n=e[2],r=this.props.toSymbols(s);let o=this.checkShortcutAvailability(s,i,n);this.setState({value:r,userInput:s,conflicts:o,keys:i,currentChain:n},(()=>{this.checkNonFunctional(),this._updateConflictDisplay()}))},this.handleBlur=t=>{null!==t.relatedTarget&&"no-blur"===t.relatedTarget.id||(this.props.toggleInput(),this.setState({value:"",userInput:"",conflicts:[]},(()=>{this._updateConflictDisplay()})))},this.state={value:this.props.placeholder,userInput:"",isAvailable:!0,isFunctional:this._isReplacingExistingKeybinding,conflicts:[],keys:[],currentChain:"",selected:!0}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_updateConflictDisplay(){this.props.displayConflicts({conflictsWith:this.state.conflicts,keys:this.state.keys,overwrite:this.handleOverwrite})}render(){const t=this.props.translator.load("jupyterlab");let e="jp-Shortcuts-Input";return this.state.isAvailable||(e+=" jp-mod-unavailable-Input"),d.createElement("div",{className:this.props.displayInput?this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox":"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-mod-hidden",onBlur:t=>this.handleBlur(t)},d.createElement("div",{tabIndex:0,id:"no-blur",className:e,onKeyDown:this.handleInput,ref:t=>t&&t.focus(),"data-lm-suppress-shortcuts":"true"},d.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":""===this.state.value?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},""===this.state.value?t.__("press keys"):this.state.value)),d.createElement("button",{className:this.state.isFunctional?this.state.isAvailable?"jp-Shortcuts-Submit":"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit jp-mod-defunc-Submit",id:"no-blur",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit},this.state.isAvailable?d.createElement(o.checkIcon.react,null):d.createElement(o.errorIcon.react,null)))}}class y extends d.Component{constructor(t){super(t),this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput})},this.toSymbols=t=>t.split(" ").reduce(((t,e)=>"Ctrl"===e?(t+" ⌃").trim():"Alt"===e?(t+" ⌥").trim():"Shift"===e?(t+" ⇧").trim():"Accel"===e&&h.Platform.IS_MAC?(t+" ⌘").trim():"Accel"===e?(t+" ⌃").trim():(t+" "+e).trim()),""),this._trans=this.props.external.translator.load("jupyterlab"),this.state={displayNewInput:!1,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(t,e){if(!("shortcutId"in e)||e.shortcutId===this.props.shortcut.id){if("add-keybinding"===e.request)return this.toggleInputNew();if("edit-keybinding"===e.request&&this.toggleInputReplaceMethod(e.keybinding),"delete-keybinding"===e.request){const t=this.props.shortcut,s=t.keybindings[e.keybinding];this.props.deleteKeybinding(t,s).catch(console.error)}}}getCategoryCell(){return d.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var t;return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-label"},null!==(t=this.props.shortcut.label)&&void 0!==t?t:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return d.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this._trans.__("Reset"))}getSourceCell(){const t=this.props.shortcut.keybindings.every((t=>t.isDefault));return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-Shortcuts-SourceCell"},t?this._trans.__("Default"):this._trans.__("Custom")),t?"":this.getResetShortCutLink())}getOptionalSelectorCell(){return this.props.showSelectors?d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(t){const e=["jp-Shortcuts-ShortcutCell"];switch(t.length){case 1:e.push("jp-Shortcuts-SingleCell");break;case 0:e.push("jp-Shortcuts-EmptyCell")}return e.join(" ")}toggleInputReplaceMethod(t){const e=this.state.displayReplaceInput[t];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[t]:!e}})}getDisplayReplaceInput(t){return this.state.displayReplaceInput[t]}getOrDiplayIfNeeded(t){const e=["jp-Shortcuts-Or"];return(t||this.state.displayNewInput)&&e.push("jp-Shortcuts-Or-Forced"),d.createElement("div",{className:e.join(" ")},this._trans.__("or"))}getShortCutAsInput(t,e){return d.createElement(g,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(e),shortcut:this.props.shortcut,keybinding:t,displayConflicts:e=>{const s=new Map(this.state.conflicts);s.set(t,e),this.setState({conflicts:s})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(e),placeholder:this.toSymbols(t.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(t){return t.keys.map(((e,s)=>d.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:s},d.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(e)),s+1<t.keys.length?d.createElement("div",{className:"jp-Shortcuts-Comma"},","):null)))}isLocationBeingEdited(t){return this.state.displayReplaceInput[t]}getDivForKey(t,e,s){return d.createElement("div",{className:"jp-Shortcuts-ShortcutContainer",key:this.props.shortcut.id+"_"+t,"data-keybinding":t,"data-shortcut":this.props.shortcut.id,onClick:()=>this.toggleInputReplaceMethod(t)},this.isLocationBeingEdited(t)?this.getShortCutAsInput(e,t):this.getShortCutForDisplayOnly(e),this.getOrDiplayIfNeeded(t<s.length-1))}getAddLink(){return d.createElement("a",{className:this.state.displayNewInput?"":"jp-Shortcuts-Plus",onClick:()=>{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?d.createElement(g,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:t=>{const e=new Map(this.state.conflicts);e.set(null,t),this.setState({conflicts:e})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):d.createElement("div",null)}getShortCutsCell(t){return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:this.getClassNameForShortCuts(t)},t.map(((e,s)=>this.getDivForKey(s,e,t))),t.length>=1&&!this.state.displayNewInput&&!this.state.displayReplaceInput[0]&&this.getAddLink(),0===t.length&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const t=[...this.state.conflicts.values()].filter((t=>0!==t.conflictsWith.length));return 0===t.length?d.createElement(d.Fragment,null):d.createElement("div",{className:"jp-Shortcuts-Row"},d.createElement("div",{className:"jp-Shortcuts-ConflictContainer"},t.map((t=>{const e=t.keys.join(" ")+"_"+t.conflictsWith.map((t=>t.id)).join("");return d.createElement("div",{className:"jp-Shortcuts-Conflict",key:e},d.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",t.conflictsWith.map((t=>{var e;return null!==(e=t.label)&&void 0!==e?e:t.command})).join(", "))),d.createElement("div",{className:"jp-Shortcuts-ErrorButton"},d.createElement("button",null,this._trans.__("Cancel")),d.createElement("button",{id:"no-blur",onClick:()=>{t.overwrite()}},this._trans.__("Overwrite"))))}))))}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter((t=>0!==t.keys.filter((t=>""!=t)).length))}render(){return d.createElement(d.Fragment,null,d.createElement("div",{className:"jp-Shortcuts-Row","data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}class S extends d.Component{render(){return d.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:this.props.height-115+"px"},id:"shortcutListContainer"},d.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map((t=>d.createElement(y,{key:t.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,shortcut:t,showSelectors:this.props.showSelectors,external:this.props.external})))))}}class b extends d.Component{render(){return d.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,d.createElement(o.caretDownEmptyThinIcon.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function f(t){return d.createElement("div",{className:"jp-Shortcuts-Symbols"},d.createElement("table",null,d.createElement("tbody",null,d.createElement("tr",null,d.createElement("td",null,d.createElement("kbd",null,"Cmd")),d.createElement("td",null,"⌘"),d.createElement("td",null,d.createElement("kbd",null,"Ctrl")),d.createElement("td",null,"⌃")),d.createElement("tr",null,d.createElement("td",null,d.createElement("kbd",null,"Alt")),d.createElement("td",null,"⌥"),d.createElement("td",null,d.createElement("kbd",null,"Shift")),d.createElement("td",null,"⇧")))))}function C(t){const e=t.translator.load("jupyterlab");return d.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},d.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>t.toggleSelectors()},t.showSelectors?e.__("Hide Selectors"):e.__("Show Selectors")),d.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>t.resetShortcuts()},e.__("Reset All")))}class k extends d.Component{constructor(t){super(t)}getShortCutTitleItem(t,e){return d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement(b,{title:t,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:e}))}render(){const t=this.props.translator.load("jupyterlab");return d.createElement("div",{className:"jp-Shortcuts-Top"},d.createElement("div",{className:"jp-Shortcuts-TopNav"},d.createElement(f,null),d.createElement(o.FilterBox,{"aria-label":t.__("Search shortcuts"),updateFilter:(t,e)=>this.props.updateSearchQuery(null!=e?e:""),placeholder:t.__("Search…"),useFuzzyFilter:!1}),d.createElement(C,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,translator:this.props.translator})),d.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},d.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(t.__("Category"),"category"),this.getShortCutTitleItem(t.__("Command"),"command"),d.createElement("div",{className:"jp-Shortcuts-Cell"},d.createElement("div",{className:"title-div"},t.__("Shortcut"))),this.getShortCutTitleItem(t.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(t.__("Selectors"),"selector"))))}}class v extends Map{constructor(t){var e,s,i;super();const{settings:n,commandRegistry:r}=t,o=null!==(e=n.user.shortcuts)&&void 0!==e?e:[],l=new Set(o.map(this._computeKeybindingId.bind(this))),a=null!==(s=n.composite.shortcuts)&&void 0!==s?s:[];for(const t of a){const e=this._computeTargetId(t),s=this._computeKeybindingId(t),n={keys:t.keys,isDefault:!l.has(s)},o=this.get(e);if(o)o.keybindings.push(n);else{const s=t.command.split(":"),o=null!==(i=r.label(t.command,t.args))&&void 0!==i?i:s.length>1?s[1]:void 0,l=s[0];this.set(e,{id:e,selector:t.selector,command:t.command,category:l,label:o,args:t.args,keybindings:[n]})}}}findConflictsFor(t,e){const s=new _({registry:this});let i=s.findConflicts(t,e);if(0!==i.length)return i;for(const n of t)if(i=s.findConflicts([n],e),0!==i.length)return i;return[]}_computeTargetId(t){var e;return t.command+"_"+t.selector+"_"+JSON.stringify(null!==(e=t.args)&&void 0!==e?e:{})}_computeKeybindingId(t){var e;return[t.command,t.selector,JSON.stringify(null!==(e=t.args)&&void 0!==e?e:{}),t.keys.join(" ")].join("_")}}class _{constructor(t){var e;const s=new Map;for(const i of t.registry.values())for(const t of i.keybindings){const n=this._keybindingHash(t.keys,i.selector),r=null!==(e=s.get(n))&&void 0!==e?e:[];r.push(i),s.set(n,r)}this._keybindingsMap=s}findConflicts(t,e){var s;const i=this._keybindingHash(t,e);return null!==(s=this._keybindingsMap.get(i))&&void 0!==s?s:[]}_keybindingHash(t,e){return t.join(" ")+"_"+e}}function E(t,e){var s;const i=t.category.toLowerCase(),n=`${i} ${(null!==(s=t.label)&&void 0!==s?s:"").toLowerCase()}`;let r=1/0,o=null;const l=/\b\w/g;for(;;){const t=l.exec(n);if(!t)break;const s=p.StringExt.matchSumOfDeltas(n,e,t.index);if(!s)break;s&&s.score<=r&&(r=s.score,o=s.indices)}if(!o||r===1/0)return null;const a=i.length+1,c=p.ArrayExt.lowerBound(o,a,((t,e)=>t-e)),h=o.slice(0,c),d=o.slice(c);for(let t=0,e=d.length;t<e;++t)d[t]-=a;return 0===h.length?{matchType:0,categoryIndices:null,labelIndices:d,score:r,item:t}:0===d.length?{matchType:1,categoryIndices:h,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:h,labelIndices:d,score:r,item:t}}class I extends d.Component{constructor(t){super(t),this.updateSearchQuery=t=>{this.setState({searchQuery:t},(()=>{const t=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(t)},(()=>{this.sortShortcuts()}))}))},this.resetShortcuts=async()=>{const t=await this.props.external.getSettings();await t.set("shortcuts",[]),await this._refreshShortcutList()},this.resetKeybindings=async t=>{for(const e of t.keybindings)await this._setKeybinding(t,e.isDefault?e.keys:[],e)},this.replaceKeybinding=async(t,e,s)=>this._setKeybinding(t,s,e),this.deleteKeybinding=async(t,e)=>{await this._setKeybinding(t,[],e)},this.addKeybinding=async(t,e)=>{await this._setKeybinding(t,e)},this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})},this.updateSort=t=>{t!==this.state.currentSort&&this.setState({currentSort:t},this.sortShortcuts)},this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:!1,searchQuery:"",showSelectors:!1,currentSort:"category"}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this),this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(t,e){if("toggle-selectors"===e.request)return this.toggleSelectors();"reset-all"===e.request&&await this.resetShortcuts()}async _refreshShortcutList(){const t=await this.props.external.getSettings(),e=new v({commandRegistry:this.props.external.commandRegistry,settings:t});this.setState({shortcutRegistry:e,filteredShortcutList:this._searchFilterShortcuts(e),shortcutsFetched:!0},(()=>{this.sortShortcuts()}))}_searchFilterShortcuts(t){return t?function(t,e){e=e.replace(/\s+/g,"").toLowerCase();let s=[];for(const i of t.values()){if(!e){s.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:i});continue}let t=E(i,e);t&&s.push(t)}return s}(t,this.state.searchQuery).map((t=>t.item)):[]}async _setKeybinding(t,e,s){var i,n,r;1===e.length&&""==e[0]&&(e=[]);const o=await this.props.external.getSettings(),l=null!==(i=o.user.shortcuts)&&void 0!==i?i:[],c=[];let h=!1;for(let i of l)if(i.command===t.command&&i.selector===t.selector&&a.JSONExt.deepEqual(null!==(n=i.args)&&void 0!==n?n:{},null!==(r=t.args)&&void 0!==r?r:{})&&s&&a.JSONExt.deepEqual(s.keys,i.keys)){const t=s&&s.isDefault&&a.JSONExt.deepEqual(s.keys,e);0===e.length||t||c.push({command:i.command,selector:i.selector,keys:e}),h=!0}else c.push(i);if(!h){const i=!s||!a.JSONExt.deepEqual(s.keys,e);s&&s.isDefault&&i&&c.push({command:t.command,selector:t.selector,disabled:!0,keys:s.keys}),0!==e.length&&c.push({command:t.command,selector:t.selector,keys:e})}await o.set("shortcuts",c),await this._refreshShortcutList()}sortShortcuts(){const t=this.state.filteredShortcutList;let e=this.state.currentSort;"command"===e&&(e="label");const s=t=>{var s;return"source"===e?t.keybindings.every((t=>t.isDefault))?"default":"other":null!==(s=t[e])&&void 0!==s?s:""};t.sort(((t,e)=>{var i,n;const r=s(t),o=s(e),l=r.localeCompare(o);if(l)return l;{const s=null!==(i=t.label)&&void 0!==i?i:"",r=null!==(n=e.label)&&void 0!==n?n:"";return s.localeCompare(r)}})),this.setState({filteredShortcutList:t})}render(){return this.state.shortcutsFetched?d.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},d.createElement(k,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,width:this.props.width,translator:this.props.external.translator}),d.createElement(S,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,showSelectors:this.state.showSelectors,findConflictsFor:(t,e)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(t,e):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),height:this.props.height,external:this.props.external})):null}}var w=s(81997);const j="@jupyterlab/shortcuts-extension:shortcuts";function x(t,e,s,i){return{translator:s,getSettings:()=>t.load(j,!0),commandRegistry:e.commands,actionRequested:i}}const N={id:j,description:"Adds the keyboard shortcuts editor.",requires:[n.ISettingRegistry],optional:[r.ITranslator,o.IFormRendererRegistry],activate:async(t,e,s,o)=>{const c=null!=s?s:r.nullTranslator,d=c.load("jupyterlab"),{commands:p}=t;let m,g,y={};if(o){const s=new w.Signal({}),n=t=>void 0!==t.dataset.shortcut;t.commands.addCommand(i.editBinding,{label:d.__("Edit Keybinding"),caption:d.__("Edit existing keybinding"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.keybinding,r=null==e?void 0:e.dataset.shortcut;if(!r||!i)return console.log("Missing shortcut id/keybinding information");s.emit({request:"edit-keybinding",keybinding:parseInt(i,10),shortcutId:r})}}),t.commands.addCommand(i.deleteBinding,{label:d.__("Delete Keybinding"),caption:d.__("Delete chosen keybinding"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.keybinding,r=null==e?void 0:e.dataset.shortcut;if(!r||!i)return console.log("Missing shortcut id/keybinding information");s.emit({request:"delete-keybinding",keybinding:parseInt(i,10),shortcutId:r})}}),t.commands.addCommand(i.addBinding,{label:d.__("Add Keybinding"),caption:d.__("Add new keybinding for existing shortcut target"),execute:()=>{const e=t.contextMenuHitTest(n),i=null==e?void 0:e.dataset.shortcut;if(!i)return console.log("Missing shortcut id to add keybinding to");s.emit({request:"add-keybinding",shortcutId:i})}}),p.addCommand(i.toggleSelectors,{label:d.__("Toggle Selectors"),caption:d.__("Toggle command selectors"),execute:()=>{s.emit({request:"toggle-selectors"})}}),p.addCommand(i.resetAll,{label:d.__("Reset All"),caption:d.__("Reset all shortcuts"),execute:()=>{s.emit({request:"reset-all"})}});const r={fieldRenderer:i=>(t=>u().createElement(I,{external:t.external,height:1e3,width:1e3}))({external:x(e,t,c,s),...i})};o.addRenderer(`${N.id}.shortcuts`,r)}function S(s){const i=t.commands.listCommands().join("\n");g||(g=a.JSONExt.deepCopy(s.properties.shortcuts.default)),y={},s.properties.shortcuts.default=Object.keys(e.plugins).map((t=>{const s=e.plugins[t].schema["jupyter.lab.shortcuts"]||[];return y[t]=s,s})).concat([g]).reduce(((t,e)=>h.Platform.IS_MAC?t.concat(e):t.concat(e.filter((t=>!t.keys.some((t=>{const{cmd:e}=l.CommandRegistry.parseKeystroke(t);return e})))))),[]).sort(((t,e)=>t.command.localeCompare(e.command))),s.properties.shortcuts.description=d.__('Note: To disable a system default shortcut,\ncopy it to User Preferences and add the\n"disabled" key, for example:\n{\n "command": "application:activate-next-tab",\n "keys": [\n "Ctrl Shift ]"\n ],\n "selector": "body",\n "disabled": true\n}\n\nList of commands followed by keyboard shortcuts:\n%1\n\nList of keyboard shortcuts:',i)}e.pluginChanged.connect((async(t,s)=>{if(s!==N.id){const t=y[s],i=e.plugins[s].schema["jupyter.lab.shortcuts"]||[];void 0!==t&&a.JSONExt.deepEqual(t,i)||(m=null,e.plugins[N.id].schema.properties.shortcuts.default=g,await e.load(N.id,!0))}})),e.transform(N.id,{compose:t=>{var e,s,i,r;m||(m=a.JSONExt.deepCopy(t.schema),S(m));const o=null!==(i=null===(s=null===(e=m.properties)||void 0===e?void 0:e.shortcuts)||void 0===s?void 0:s.default)&&void 0!==i?i:[],l={shortcuts:null!==(r=t.data.user.shortcuts)&&void 0!==r?r:[]},c={shortcuts:n.SettingRegistry.reconcileShortcuts(o,l.shortcuts)};return t.data={composite:c,user:l},t},fetch:t=>(m||(m=a.JSONExt.deepCopy(t.schema),S(m)),{data:t.data,id:t.id,raw:t.raw,schema:m,version:t.version})});try{m=null;const t=await e.load(N.id);A.loadShortcuts(p,t.composite),t.changed.connect((()=>{A.loadShortcuts(p,t.composite)}))}catch(t){console.error(`Loading ${N.id} failed.`,t)}},autoStart:!0},K=N;var A;!function(t){let e;t.loadShortcuts=function(t,s){var i;const n=null!==(i=null==s?void 0:s.shortcuts)&&void 0!==i?i:[];e&&e.dispose(),e=n.reduce(((e,s)=>{const i=function(t){if(!t||"object"!=typeof t)return;const{isArray:e}=Array;return"command"in t&&"keys"in t&&"selector"in t&&e(t.keys)?t:void 0}(s);return i&&e.add(t.addKeyBinding(i)),e}),new c.DisposableSet)}}(A||(A={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1198,8907],{41198:(t,e,s)=>{s.r(e),s.d(e,{IPropertyInspectorProvider:()=>c,SideBarPropertyInspectorProvider:()=>a});var n=s(37267),r=s(22620),o=s(81997),i=s(63485);const c=new(s(20998).Token)("@jupyterlab/property-inspector:IPropertyInspectorProvider","A service to registry new widget in the property inspector side panel.");class h extends i.Widget{constructor(){super(),this._tracker=new i.FocusTracker,this._inspectors=new Map,this.addClass("jp-PropertyInspector"),this._tracker=new i.FocusTracker,this._tracker.currentChanged.connect(this._onCurrentChanged,this)}register(t){if(this._inspectors.has(t))throw new Error("Widget is already registered");const e=new l.PropertyInspector(t);return t.disposed.connect(this._onWidgetDisposed,this),this._inspectors.set(t,e),e.onAction.connect(this._onInspectorAction,this),this._tracker.add(t),e}get currentWidget(){return this._tracker.currentWidget}refresh(){const t=this._tracker.currentWidget;if(!t)return void this.setContent(null);const e=this._inspectors.get(t);e&&this.setContent(e.content)}_onWidgetDisposed(t){const e=this._inspectors.get(t);e&&(e.dispose(),this._inspectors.delete(t))}_onInspectorAction(t,e){const s=t.owner,n=this._tracker.currentWidget;switch(e){case"content":n===s&&this.setContent(t.content);break;case"dispose":s&&(this._tracker.remove(s),this._inspectors.delete(s));break;case"show-panel":n===s&&this.showPanel();break;default:throw new Error("Unsupported inspector action")}}_onCurrentChanged(){const t=this._tracker.currentWidget;if(t){const e=this._inspectors.get(t).content;this.setContent(e)}else this.setContent(null)}}class a extends h{constructor({shell:t,placeholder:e,translator:s}){super(),this._labshell=t,this.translator=s||n.nullTranslator,this._trans=this.translator.load("jupyterlab");const r=this.layout=new i.SingletonLayout;if(e)this._placeholder=e;else{const t=document.createElement("div"),e=document.createElement("div");e.textContent=this._trans.__("No properties to inspect."),e.className="jp-PropertyInspector-placeholderContent",t.appendChild(e),this._placeholder=new i.Widget({node:t}),this._placeholder.addClass("jp-PropertyInspector-placeholder")}r.widget=this._placeholder,this._labshell.currentChanged.connect(this._onShellCurrentChanged,this),this._onShellCurrentChanged()}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-PropertyInspector-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-PropertyInspector-content"),e.widget=t}showPanel(){this._labshell.activateById(this.id)}_onShellCurrentChanged(){const t=this.currentWidget;if(!t)return void this.setContent(null);const e=this._labshell.currentWidget;(null==e?void 0:e.node.contains(t.node))?this.refresh():this.setContent(null)}}var l;!function(t){t.PropertyInspector=class{constructor(t){this._isDisposed=!1,this._content=null,this._owner=null,this._onAction=new o.Signal(this),this._owner=t}get owner(){return this._owner}get content(){return this._content}get isDisposed(){return this._isDisposed}get onAction(){return this._onAction}showPanel(){this._isDisposed||this._onAction.emit("show-panel")}render(t){this._isDisposed||(t instanceof i.Widget?this._content=t:this._content=r.ReactWidget.create(t),this._onAction.emit("content"))}dispose(){this._isDisposed||(this._isDisposed=!0,this._content=null,this._owner=null,o.Signal.clearData(this))}}}(l||(l={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1198,8907],{41198:(t,e,s)=>{s.r(e),s.d(e,{IPropertyInspectorProvider:()=>c,SideBarPropertyInspectorProvider:()=>a});var n=s(12030),r=s(35613),o=s(81997),i=s(63485);const c=new(s(20998).Token)("@jupyterlab/property-inspector:IPropertyInspectorProvider","A service to registry new widget in the property inspector side panel.");class h extends i.Widget{constructor(){super(),this._tracker=new i.FocusTracker,this._inspectors=new Map,this.addClass("jp-PropertyInspector"),this._tracker=new i.FocusTracker,this._tracker.currentChanged.connect(this._onCurrentChanged,this)}register(t){if(this._inspectors.has(t))throw new Error("Widget is already registered");const e=new l.PropertyInspector(t);return t.disposed.connect(this._onWidgetDisposed,this),this._inspectors.set(t,e),e.onAction.connect(this._onInspectorAction,this),this._tracker.add(t),e}get currentWidget(){return this._tracker.currentWidget}refresh(){const t=this._tracker.currentWidget;if(!t)return void this.setContent(null);const e=this._inspectors.get(t);e&&this.setContent(e.content)}_onWidgetDisposed(t){const e=this._inspectors.get(t);e&&(e.dispose(),this._inspectors.delete(t))}_onInspectorAction(t,e){const s=t.owner,n=this._tracker.currentWidget;switch(e){case"content":n===s&&this.setContent(t.content);break;case"dispose":s&&(this._tracker.remove(s),this._inspectors.delete(s));break;case"show-panel":n===s&&this.showPanel();break;default:throw new Error("Unsupported inspector action")}}_onCurrentChanged(){const t=this._tracker.currentWidget;if(t){const e=this._inspectors.get(t).content;this.setContent(e)}else this.setContent(null)}}class a extends h{constructor({shell:t,placeholder:e,translator:s}){super(),this._labshell=t,this.translator=s||n.nullTranslator,this._trans=this.translator.load("jupyterlab");const r=this.layout=new i.SingletonLayout;if(e)this._placeholder=e;else{const t=document.createElement("div"),e=document.createElement("div");e.textContent=this._trans.__("No properties to inspect."),e.className="jp-PropertyInspector-placeholderContent",t.appendChild(e),this._placeholder=new i.Widget({node:t}),this._placeholder.addClass("jp-PropertyInspector-placeholder")}r.widget=this._placeholder,this._labshell.currentChanged.connect(this._onShellCurrentChanged,this),this._onShellCurrentChanged()}setContent(t){const e=this.layout;e.widget&&(e.widget.removeClass("jp-PropertyInspector-content"),e.removeWidget(e.widget)),t||(t=this._placeholder),t.addClass("jp-PropertyInspector-content"),e.widget=t}showPanel(){this._labshell.activateById(this.id)}_onShellCurrentChanged(){const t=this.currentWidget;if(!t)return void this.setContent(null);const e=this._labshell.currentWidget;(null==e?void 0:e.node.contains(t.node))?this.refresh():this.setContent(null)}}var l;!function(t){t.PropertyInspector=class{constructor(t){this._isDisposed=!1,this._content=null,this._owner=null,this._onAction=new o.Signal(this),this._owner=t}get owner(){return this._owner}get content(){return this._content}get isDisposed(){return this._isDisposed}get onAction(){return this._onAction}showPanel(){this._isDisposed||this._onAction.emit("show-panel")}render(t){this._isDisposed||(t instanceof i.Widget?this._content=t:this._content=r.ReactWidget.create(t),this._onAction.emit("content"))}dispose(){this._isDisposed||(this._isDisposed=!0,this._content=null,this._owner=null,o.Signal.clearData(this))}}}(l||(l={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[134,4042],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(58959),n=s(13408),i=s(81997);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[134,4042],{44042:(t,e,s)=>{s.r(e),s.d(e,{AttachmentsModel:()=>r,AttachmentsResolver:()=>h});var a=s(31231),n=s(81221),i=s(81997);class r{constructor(t){var e;if(this._map=new a.ObservableMap,this._isDisposed=!1,this._stateChanged=new i.Signal(this),this._changed=new i.Signal(this),this._serialized=null,this._changeGuard=!1,this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:r.defaultContentFactory,t.values)for(const e of Object.keys(t.values))void 0!==t.values[e]&&this.set(e,t.values[e]);this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._map.dispose(),i.Signal.clearData(this))}has(t){return this._map.has(t)}get(t){return this._map.get(t)}set(t,e){const s=this._createItem({value:e});this._map.set(t,s)}remove(t){this._map.delete(t)}clear(){this._map.values().forEach((t=>{t.dispose()})),this._map.clear()}fromJSON(t){this.clear(),Object.keys(t).forEach((e=>{void 0!==t[e]&&this.set(e,t[e])}))}toJSON(){const t={};for(const e of this._map.keys())t[e]=this._map.get(e).toJSON();return t}_createItem(t){const e=this.contentFactory.createAttachmentModel(t);return e.changed.connect(this._onGenericChange,this),e}_onMapChanged(t,e){this._serialized&&!this._changeGuard&&(this._changeGuard=!0,this._serialized.set(this.toJSON()),this._changeGuard=!1),this._changed.emit(e),this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}!function(t){class e{createAttachmentModel(t){return new n.AttachmentModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(r||(r={}));class h{constructor(t){this._parent=t.parent||null,this._model=t.model}async resolveUrl(t){return this._parent&&!t.startsWith("attachment:")?this._parent.resolveUrl(t):t}async getDownloadUrl(t){if(this._parent&&!t.startsWith("attachment:"))return this._parent.getDownloadUrl(t);const e=t.slice(11),s=this._model.get(e);if(void 0===s)return t;const{data:a}=s,i=Object.keys(a)[0];if(void 0===i||-1===n.imageRendererFactory.mimeTypes.indexOf(i))throw new Error(`Cannot render unknown image mime type "${i}".`);return`data:${i};base64,${a[i]}`}isLocal(t){var e,s,a;return!(this._parent&&!t.startsWith("attachment:"))||null===(a=null===(s=(e=this._parent).isLocal)||void 0===s?void 0:s.call(e,t))||void 0===a||a}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1388],{91388:(t,e,a)=>{a.d(e,{diagram:()=>f});var r=a(17010),i=a(23617),n=a(7259),d=a(29197),o=a(24028);a(27693),a(7608),a(31699);let s=0;const l=function(t,e,a,r){const{displayText:i,cssStyle:n}=e.getDisplayDetails(),d=t.append("tspan").attr("x",r.padding).text(i);""!==n&&d.attr("style",e.cssStyle),a||d.attr("dy",r.textHeight)},p=function(t,e,a,r){o.l.debug("Rendering class ",e,a);const i=e.id,n={id:i,label:e.id,width:0,height:0},d=t.append("g").attr("id",r.db.lookUpDomId(i)).attr("class","classGroup");let s;s=e.link?d.append("svg:a").attr("xlink:href",e.link).attr("target",e.linkTarget).append("text").attr("y",a.textHeight+a.padding).attr("x",0):d.append("text").attr("y",a.textHeight+a.padding).attr("x",0);let p=!0;e.annotations.forEach((function(t){const e=s.append("tspan").text("«"+t+"»");p||e.attr("dy",a.textHeight),p=!1}));let c=function(t){let e=t.id;return t.type&&(e+="<"+(0,o.v)(t.type)+">"),e}(e);const g=s.append("tspan").text(c).attr("class","title");p||g.attr("dy",a.textHeight);const h=s.node().getBBox().height;let f,x,u;if(e.members.length>0){f=d.append("line").attr("x1",0).attr("y1",a.padding+h+a.dividerMargin/2).attr("y2",a.padding+h+a.dividerMargin/2);const t=d.append("text").attr("x",a.padding).attr("y",h+a.dividerMargin+a.textHeight).attr("fill","white").attr("class","classText");p=!0,e.members.forEach((function(e){l(t,e,p,a),p=!1})),x=t.node().getBBox()}if(e.methods.length>0){u=d.append("line").attr("x1",0).attr("y1",a.padding+h+a.dividerMargin+x.height).attr("y2",a.padding+h+a.dividerMargin+x.height);const t=d.append("text").attr("x",a.padding).attr("y",h+2*a.dividerMargin+x.height+a.textHeight).attr("fill","white").attr("class","classText");p=!0,e.methods.forEach((function(e){l(t,e,p,a),p=!1}))}const y=d.node().getBBox();var b=" ";e.cssClasses.length>0&&(b+=e.cssClasses.join(" "));const m=d.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",y.width+2*a.padding).attr("height",y.height+a.padding+.5*a.dividerMargin).attr("class",b).node().getBBox().width;return s.node().childNodes.forEach((function(t){t.setAttribute("x",(m-t.getBBox().width)/2)})),e.tooltip&&s.insert("title").text(e.tooltip),f&&f.attr("x2",m),u&&u.attr("x2",m),n.width=m,n.height=y.height+a.padding+.5*a.dividerMargin,n};let c={};const g=function(t){const e=Object.entries(c).find((e=>e[1].label===t));if(e)return e[0]},h={draw:function(t,e,a,r){const l=(0,o.c)().class;c={},o.l.info("Rendering diagram "+t);const h=(0,o.c)().securityLevel;let f;"sandbox"===h&&(f=(0,i.Ys)("#i"+e));const x="sandbox"===h?(0,i.Ys)(f.nodes()[0].contentDocument.body):(0,i.Ys)("body"),u=x.select(`[id='${e}']`);var y;(y=u).append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),y.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),y.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z");const b=new d.k({multigraph:!0});b.setGraph({isMultiGraph:!0}),b.setDefaultEdgeLabel((function(){return{}}));const m=r.db.getClasses(),k=Object.keys(m);for(const t of k){const e=m[t],a=p(u,e,l,r);c[a.id]=a,b.setNode(a.id,a),o.l.info("Org height: "+a.height)}r.db.getRelations().forEach((function(t){o.l.info("tjoho"+g(t.id1)+g(t.id2)+JSON.stringify(t)),b.setEdge(g(t.id1),g(t.id2),{relation:t},t.title||"DEFAULT")})),r.db.getNotes().forEach((function(t){o.l.debug(`Adding note: ${JSON.stringify(t)}`);const e=function(t,e,a,r){o.l.debug("Rendering note ",e,a);const i=e.id,n={id:i,text:e.text,width:0,height:0},d=t.append("g").attr("id",i).attr("class","classGroup");let s=d.append("text").attr("y",a.textHeight+a.padding).attr("x",0);const l=JSON.parse(`"${e.text}"`).split("\n");l.forEach((function(t){o.l.debug(`Adding line: ${t}`),s.append("tspan").text(t).attr("class","title").attr("dy",a.textHeight)}));const p=d.node().getBBox(),c=d.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",p.width+2*a.padding).attr("height",p.height+l.length*a.textHeight+a.padding+.5*a.dividerMargin).node().getBBox().width;return s.node().childNodes.forEach((function(t){t.setAttribute("x",(c-t.getBBox().width)/2)})),n.width=c,n.height=p.height+l.length*a.textHeight+a.padding+.5*a.dividerMargin,n}(u,t,l);c[e.id]=e,b.setNode(e.id,e),t.class&&t.class in m&&b.setEdge(t.id,g(t.class),{relation:{id1:t.id,id2:t.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")})),(0,n.bK)(b),b.nodes().forEach((function(t){void 0!==t&&void 0!==b.node(t)&&(o.l.debug("Node "+t+": "+JSON.stringify(b.node(t))),x.select("#"+(r.db.lookUpDomId(t)||t)).attr("transform","translate("+(b.node(t).x-b.node(t).width/2)+","+(b.node(t).y-b.node(t).height/2)+" )"))})),b.edges().forEach((function(t){void 0!==t&&void 0!==b.edge(t)&&(o.l.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(b.edge(t))),function(t,e,a,r,n){const d=function(t){switch(t){case n.db.relationType.AGGREGATION:return"aggregation";case n.db.relationType.EXTENSION:return"extension";case n.db.relationType.COMPOSITION:return"composition";case n.db.relationType.DEPENDENCY:return"dependency";case n.db.relationType.LOLLIPOP:return"lollipop"}};e.points=e.points.filter((t=>!Number.isNaN(t.y)));const l=e.points,p=(0,i.jvg)().x((function(t){return t.x})).y((function(t){return t.y})).curve(i.$0Z),c=t.append("path").attr("d",p(l)).attr("id","edge"+s).attr("class","relation");let g,h,f="";r.arrowMarkerAbsolute&&(f=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,f=f.replace(/\(/g,"\\("),f=f.replace(/\)/g,"\\)")),1==a.relation.lineType&&c.attr("class","relation dashed-line"),10==a.relation.lineType&&c.attr("class","relation dotted-line"),"none"!==a.relation.type1&&c.attr("marker-start","url("+f+"#"+d(a.relation.type1)+"Start)"),"none"!==a.relation.type2&&c.attr("marker-end","url("+f+"#"+d(a.relation.type2)+"End)");const x=e.points.length;let u,y,b,m,k=o.u.calcLabelPosition(e.points);if(g=k.x,h=k.y,x%2!=0&&x>1){let t=o.u.calcCardinalityPosition("none"!==a.relation.type1,e.points,e.points[0]),r=o.u.calcCardinalityPosition("none"!==a.relation.type2,e.points,e.points[x-1]);o.l.debug("cardinality_1_point "+JSON.stringify(t)),o.l.debug("cardinality_2_point "+JSON.stringify(r)),u=t.x,y=t.y,b=r.x,m=r.y}if(void 0!==a.title){const e=t.append("g").attr("class","classLabel"),i=e.append("text").attr("class","label").attr("x",g).attr("y",h).attr("fill","red").attr("text-anchor","middle").text(a.title);window.label=i;const n=i.node().getBBox();e.insert("rect",":first-child").attr("class","box").attr("x",n.x-r.padding/2).attr("y",n.y-r.padding/2).attr("width",n.width+r.padding).attr("height",n.height+r.padding)}o.l.info("Rendering relation "+JSON.stringify(a)),void 0!==a.relationTitle1&&"none"!==a.relationTitle1&&t.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",u).attr("y",y).attr("fill","black").attr("font-size","6").text(a.relationTitle1),void 0!==a.relationTitle2&&"none"!==a.relationTitle2&&t.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",b).attr("y",m).attr("fill","black").attr("font-size","6").text(a.relationTitle2),s++}(u,b.edge(t),b.edge(t).relation,l,r))}));const w=u.node().getBBox(),E=w.width+40,L=w.height+40;(0,o.i)(u,L,E,l.useMaxWidth);const T=`${w.x-20} ${w.y-20} ${E} ${L}`;o.l.debug(`viewBox ${T}`),u.attr("viewBox",T)}},f={parser:r.p,db:r.d,renderer:h,styles:r.s,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,r.d.clear()}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1388],{91388:(t,e,a)=>{a.d(e,{diagram:()=>f});var r=a(17010),i=a(23617),n=a(7259),d=a(67406),o=a(24028);a(27693),a(7608),a(31699);let s=0;const l=function(t,e,a,r){const{displayText:i,cssStyle:n}=e.getDisplayDetails(),d=t.append("tspan").attr("x",r.padding).text(i);""!==n&&d.attr("style",e.cssStyle),a||d.attr("dy",r.textHeight)},p=function(t,e,a,r){o.l.debug("Rendering class ",e,a);const i=e.id,n={id:i,label:e.id,width:0,height:0},d=t.append("g").attr("id",r.db.lookUpDomId(i)).attr("class","classGroup");let s;s=e.link?d.append("svg:a").attr("xlink:href",e.link).attr("target",e.linkTarget).append("text").attr("y",a.textHeight+a.padding).attr("x",0):d.append("text").attr("y",a.textHeight+a.padding).attr("x",0);let p=!0;e.annotations.forEach((function(t){const e=s.append("tspan").text("«"+t+"»");p||e.attr("dy",a.textHeight),p=!1}));let c=function(t){let e=t.id;return t.type&&(e+="<"+(0,o.v)(t.type)+">"),e}(e);const g=s.append("tspan").text(c).attr("class","title");p||g.attr("dy",a.textHeight);const h=s.node().getBBox().height;let f,x,u;if(e.members.length>0){f=d.append("line").attr("x1",0).attr("y1",a.padding+h+a.dividerMargin/2).attr("y2",a.padding+h+a.dividerMargin/2);const t=d.append("text").attr("x",a.padding).attr("y",h+a.dividerMargin+a.textHeight).attr("fill","white").attr("class","classText");p=!0,e.members.forEach((function(e){l(t,e,p,a),p=!1})),x=t.node().getBBox()}if(e.methods.length>0){u=d.append("line").attr("x1",0).attr("y1",a.padding+h+a.dividerMargin+x.height).attr("y2",a.padding+h+a.dividerMargin+x.height);const t=d.append("text").attr("x",a.padding).attr("y",h+2*a.dividerMargin+x.height+a.textHeight).attr("fill","white").attr("class","classText");p=!0,e.methods.forEach((function(e){l(t,e,p,a),p=!1}))}const y=d.node().getBBox();var b=" ";e.cssClasses.length>0&&(b+=e.cssClasses.join(" "));const m=d.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",y.width+2*a.padding).attr("height",y.height+a.padding+.5*a.dividerMargin).attr("class",b).node().getBBox().width;return s.node().childNodes.forEach((function(t){t.setAttribute("x",(m-t.getBBox().width)/2)})),e.tooltip&&s.insert("title").text(e.tooltip),f&&f.attr("x2",m),u&&u.attr("x2",m),n.width=m,n.height=y.height+a.padding+.5*a.dividerMargin,n};let c={};const g=function(t){const e=Object.entries(c).find((e=>e[1].label===t));if(e)return e[0]},h={draw:function(t,e,a,r){const l=(0,o.c)().class;c={},o.l.info("Rendering diagram "+t);const h=(0,o.c)().securityLevel;let f;"sandbox"===h&&(f=(0,i.Ys)("#i"+e));const x="sandbox"===h?(0,i.Ys)(f.nodes()[0].contentDocument.body):(0,i.Ys)("body"),u=x.select(`[id='${e}']`);var y;(y=u).append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),y.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),y.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),y.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z");const b=new d.k({multigraph:!0});b.setGraph({isMultiGraph:!0}),b.setDefaultEdgeLabel((function(){return{}}));const m=r.db.getClasses(),k=Object.keys(m);for(const t of k){const e=m[t],a=p(u,e,l,r);c[a.id]=a,b.setNode(a.id,a),o.l.info("Org height: "+a.height)}r.db.getRelations().forEach((function(t){o.l.info("tjoho"+g(t.id1)+g(t.id2)+JSON.stringify(t)),b.setEdge(g(t.id1),g(t.id2),{relation:t},t.title||"DEFAULT")})),r.db.getNotes().forEach((function(t){o.l.debug(`Adding note: ${JSON.stringify(t)}`);const e=function(t,e,a,r){o.l.debug("Rendering note ",e,a);const i=e.id,n={id:i,text:e.text,width:0,height:0},d=t.append("g").attr("id",i).attr("class","classGroup");let s=d.append("text").attr("y",a.textHeight+a.padding).attr("x",0);const l=JSON.parse(`"${e.text}"`).split("\n");l.forEach((function(t){o.l.debug(`Adding line: ${t}`),s.append("tspan").text(t).attr("class","title").attr("dy",a.textHeight)}));const p=d.node().getBBox(),c=d.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",p.width+2*a.padding).attr("height",p.height+l.length*a.textHeight+a.padding+.5*a.dividerMargin).node().getBBox().width;return s.node().childNodes.forEach((function(t){t.setAttribute("x",(c-t.getBBox().width)/2)})),n.width=c,n.height=p.height+l.length*a.textHeight+a.padding+.5*a.dividerMargin,n}(u,t,l);c[e.id]=e,b.setNode(e.id,e),t.class&&t.class in m&&b.setEdge(t.id,g(t.class),{relation:{id1:t.id,id2:t.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")})),(0,n.bK)(b),b.nodes().forEach((function(t){void 0!==t&&void 0!==b.node(t)&&(o.l.debug("Node "+t+": "+JSON.stringify(b.node(t))),x.select("#"+(r.db.lookUpDomId(t)||t)).attr("transform","translate("+(b.node(t).x-b.node(t).width/2)+","+(b.node(t).y-b.node(t).height/2)+" )"))})),b.edges().forEach((function(t){void 0!==t&&void 0!==b.edge(t)&&(o.l.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(b.edge(t))),function(t,e,a,r,n){const d=function(t){switch(t){case n.db.relationType.AGGREGATION:return"aggregation";case n.db.relationType.EXTENSION:return"extension";case n.db.relationType.COMPOSITION:return"composition";case n.db.relationType.DEPENDENCY:return"dependency";case n.db.relationType.LOLLIPOP:return"lollipop"}};e.points=e.points.filter((t=>!Number.isNaN(t.y)));const l=e.points,p=(0,i.jvg)().x((function(t){return t.x})).y((function(t){return t.y})).curve(i.$0Z),c=t.append("path").attr("d",p(l)).attr("id","edge"+s).attr("class","relation");let g,h,f="";r.arrowMarkerAbsolute&&(f=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,f=f.replace(/\(/g,"\\("),f=f.replace(/\)/g,"\\)")),1==a.relation.lineType&&c.attr("class","relation dashed-line"),10==a.relation.lineType&&c.attr("class","relation dotted-line"),"none"!==a.relation.type1&&c.attr("marker-start","url("+f+"#"+d(a.relation.type1)+"Start)"),"none"!==a.relation.type2&&c.attr("marker-end","url("+f+"#"+d(a.relation.type2)+"End)");const x=e.points.length;let u,y,b,m,k=o.u.calcLabelPosition(e.points);if(g=k.x,h=k.y,x%2!=0&&x>1){let t=o.u.calcCardinalityPosition("none"!==a.relation.type1,e.points,e.points[0]),r=o.u.calcCardinalityPosition("none"!==a.relation.type2,e.points,e.points[x-1]);o.l.debug("cardinality_1_point "+JSON.stringify(t)),o.l.debug("cardinality_2_point "+JSON.stringify(r)),u=t.x,y=t.y,b=r.x,m=r.y}if(void 0!==a.title){const e=t.append("g").attr("class","classLabel"),i=e.append("text").attr("class","label").attr("x",g).attr("y",h).attr("fill","red").attr("text-anchor","middle").text(a.title);window.label=i;const n=i.node().getBBox();e.insert("rect",":first-child").attr("class","box").attr("x",n.x-r.padding/2).attr("y",n.y-r.padding/2).attr("width",n.width+r.padding).attr("height",n.height+r.padding)}o.l.info("Rendering relation "+JSON.stringify(a)),void 0!==a.relationTitle1&&"none"!==a.relationTitle1&&t.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",u).attr("y",y).attr("fill","black").attr("font-size","6").text(a.relationTitle1),void 0!==a.relationTitle2&&"none"!==a.relationTitle2&&t.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",b).attr("y",m).attr("fill","black").attr("font-size","6").text(a.relationTitle2),s++}(u,b.edge(t),b.edge(t).relation,l,r))}));const w=u.node().getBBox(),E=w.width+40,L=w.height+40;(0,o.i)(u,L,E,l.useMaxWidth);const T=`${w.x-20} ${w.y-20} ${E} ${L}`;o.l.debug(`viewBox ${T}`),u.attr("viewBox",T)}},f={parser:r.p,db:r.d,renderer:h,styles:r.s,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,r.d.clear()}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1408],{11408:(e,t,a)=>{a.r(t),a.d(t,{MathJaxTypesetter:()=>o,default:()=>r});var n,i=a(20998),s=a(13408);!function(e){e.copy="mathjax:clipboard",e.scale="mathjax:scale"}(n||(n={}));class o{constructor(){this._initialized=!1}async _ensureInitialized(){this._initialized||(this._mathDocument=await c.ensureMathDocument(),this._initialized=!0)}async mathDocument(){return await this._ensureInitialized(),this._mathDocument}async typeset(e){try{await this._ensureInitialized()}catch(e){return void console.error(e)}this._mathDocument.options.elements=[e],this._mathDocument.clear().render(),delete this._mathDocument.options.elements}}const r={id:"@jupyterlab/mathjax-extension:plugin",description:"Provides the LaTeX mathematical expression interpreter.",provides:s.ILatexTypesetter,activate:e=>{const t=new o;return e.commands.addCommand(n.copy,{execute:async()=>{const e=(await t.mathDocument()).outputJax;await navigator.clipboard.writeText(e.math.math)},label:"MathJax Copy Latex"}),e.commands.addCommand(n.scale,{execute:async e=>{const a=await t.mathDocument(),n=e.scale||1;a.outputJax.options.scale=n,a.rerender()},label:e=>"Mathjax Scale "+(e.scale?`x${e.scale}`:"Reset")}),t},autoStart:!0};var c;!function(e){let t=null;e.ensureMathDocument=async function(){if(!t){t=new i.PromiseDelegate,Promise.all([a.e(7969),a.e(5115),a.e(792)]).then(a.t.bind(a,20792,23));const[{mathjax:e},{CHTML:n},{TeX:s},{TeXFont:o},{AllPackages:r},{SafeHandler:c},{HTMLHandler:l},{browserAdaptor:m},{AssistiveMmlHandler:h}]=await Promise.all([a.e(4971).then(a.bind(a,44971)),Promise.all([a.e(7969),a.e(28),a.e(2065),a.e(7369)]).then(a.t.bind(a,57369,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(7582)]).then(a.t.bind(a,27582,23)),Promise.all([a.e(2065),a.e(4498)]).then(a.t.bind(a,42065,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(8845)]).then(a.bind(a,78845)),a.e(8285).then(a.t.bind(a,78285,23)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(7471)]).then(a.t.bind(a,97471,23)),a.e(270).then(a.bind(a,90270)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(4105)]).then(a.t.bind(a,74105,23))]);e.handlers.register(h(c(new l(m()))));class d extends o{}d.defaultFonts={};const u=new n({font:new d}),p=new s({packages:r.concat("require"),inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0}),x=e.document(window.document,{InputJax:p,OutputJax:u});t.resolve(x)}return t.promise}}(c||(c={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1408],{11408:(e,t,a)=>{a.r(t),a.d(t,{MathJaxTypesetter:()=>o,default:()=>r});var n,i=a(20998),s=a(81221);!function(e){e.copy="mathjax:clipboard",e.scale="mathjax:scale"}(n||(n={}));class o{constructor(){this._initialized=!1}async _ensureInitialized(){this._initialized||(this._mathDocument=await c.ensureMathDocument(),this._initialized=!0)}async mathDocument(){return await this._ensureInitialized(),this._mathDocument}async typeset(e){try{await this._ensureInitialized()}catch(e){return void console.error(e)}this._mathDocument.options.elements=[e],this._mathDocument.clear().render(),delete this._mathDocument.options.elements}}const r={id:"@jupyterlab/mathjax-extension:plugin",description:"Provides the LaTeX mathematical expression interpreter.",provides:s.ILatexTypesetter,activate:e=>{const t=new o;return e.commands.addCommand(n.copy,{execute:async()=>{const e=(await t.mathDocument()).outputJax;await navigator.clipboard.writeText(e.math.math)},label:"MathJax Copy Latex"}),e.commands.addCommand(n.scale,{execute:async e=>{const a=await t.mathDocument(),n=e.scale||1;a.outputJax.options.scale=n,a.rerender()},label:e=>"Mathjax Scale "+(e.scale?`x${e.scale}`:"Reset")}),t},autoStart:!0};var c;!function(e){let t=null;e.ensureMathDocument=async function(){if(!t){t=new i.PromiseDelegate,Promise.all([a.e(7969),a.e(5115),a.e(792)]).then(a.t.bind(a,20792,23));const[{mathjax:e},{CHTML:n},{TeX:s},{TeXFont:o},{AllPackages:r},{SafeHandler:c},{HTMLHandler:l},{browserAdaptor:m},{AssistiveMmlHandler:h}]=await Promise.all([a.e(4971).then(a.bind(a,44971)),Promise.all([a.e(7969),a.e(28),a.e(2065),a.e(7369)]).then(a.t.bind(a,57369,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(7582)]).then(a.t.bind(a,27582,23)),Promise.all([a.e(2065),a.e(4498)]).then(a.t.bind(a,42065,23)),Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(8845)]).then(a.bind(a,78845)),a.e(8285).then(a.t.bind(a,78285,23)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(7471)]).then(a.t.bind(a,97471,23)),a.e(270).then(a.bind(a,90270)),Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(4105)]).then(a.t.bind(a,74105,23))]);e.handlers.register(h(c(new l(m()))));class d extends o{}d.defaultFonts={};const u=new n({font:new d}),p=new s({packages:r.concat("require"),inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0}),x=e.document(window.document,{InputJax:p,OutputJax:u});t.resolve(x)}return t.promise}}(c||(c={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1496],{91496:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var a=n(2922),s=n(96049),r=n(1167),l=n(50845),o=n(37267),i=n(22620),c=n(78156),d=n(70611),u=n(20998),m=n(81997),h=n(24475),p=n(63485);const g="jp-Licenses-Filters-title";class _ extends p.SplitPanel{constructor(e){super(),this.addClass("jp-Licenses"),this.model=e.model,this.initLeftPanel(),this.initFilters(),this.initBundles(),this.initGrid(),this.initLicenseText(),this.setRelativeSizes([1,2,3]),this.model.initLicenses().then((()=>this._updateBundles())),this.model.trackerDataChanged.connect((()=>{this.title.label=this.model.title}))}dispose(){this.isDisposed||(this._bundles.currentChanged.disconnect(this.onBundleSelected,this),this.model.dispose(),super.dispose())}initLeftPanel(){this._leftPanel=new p.Panel,this._leftPanel.addClass("jp-Licenses-FormArea"),this.addWidget(this._leftPanel),p.SplitPanel.setStretch(this._leftPanel,1)}initFilters(){this._filters=new _.Filters(this.model),p.SplitPanel.setStretch(this._filters,1),this._leftPanel.addWidget(this._filters)}initBundles(){this._bundles=new p.TabBar({orientation:"vertical",renderer:new _.BundleTabRenderer(this.model)}),this._bundles.addClass("jp-Licenses-Bundles"),p.SplitPanel.setStretch(this._bundles,1),this._leftPanel.addWidget(this._bundles),this._bundles.currentChanged.connect(this.onBundleSelected,this),this.model.stateChanged.connect((()=>this._bundles.update()))}initGrid(){this._grid=new _.Grid(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._grid)}initLicenseText(){this._licenseText=new _.FullText(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._licenseText)}onBundleSelected(){var e;(null===(e=this._bundles.currentTitle)||void 0===e?void 0:e.label)&&(this.model.currentBundleName=this._bundles.currentTitle.label)}_updateBundles(){this._bundles.clearTabs();let e=0;const{currentBundleName:t}=this.model;let n=0;for(const a of this.model.bundleNames){const s=new p.Widget;s.title.label=a,a===t&&(n=e),this._bundles.insertTab(++e,s.title)}this._bundles.currentIndex=n}}var b;!function(e){e.REPORT_FORMATS={markdown:{id:"markdown",title:"Markdown",icon:i.markdownIcon},csv:{id:"csv",title:"CSV",icon:i.spreadsheetIcon},json:{id:"csv",title:"JSON",icon:i.jsonIcon}},e.DEFAULT_FORMAT="markdown";class t extends i.VDomModel{constructor(e){super(),this._selectedPackageChanged=new m.Signal(this),this._trackerDataChanged=new m.Signal(this),this._currentPackageIndex=0,this._licensesReady=new u.PromiseDelegate,this._packageFilter={},this._trans=e.trans,this._licensesUrl=e.licensesUrl,this._serverSettings=e.serverSettings||d.ServerConnection.makeSettings(),e.currentBundleName&&(this._currentBundleName=e.currentBundleName),e.packageFilter&&(this._packageFilter=e.packageFilter),e.currentPackageIndex&&(this._currentPackageIndex=e.currentPackageIndex)}async initLicenses(){try{const e=await d.ServerConnection.makeRequest(this._licensesUrl,{},this._serverSettings);this._serverResponse=await e.json(),this._licensesReady.resolve(),this.stateChanged.emit(void 0)}catch(e){this._licensesReady.reject(e)}}async download(e){const t=`${this._licensesUrl}?format=${e.format}&download=1`,n=document.createElement("a");n.href=t,n.download="",document.body.appendChild(n),n.click(),document.body.removeChild(n)}get selectedPackageChanged(){return this._selectedPackageChanged}get trackerDataChanged(){return this._trackerDataChanged}get bundleNames(){var e;return Object.keys((null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{})}get currentBundleName(){return this._currentBundleName?this._currentBundleName:this.bundleNames.length?this.bundleNames[0]:null}set currentBundleName(e){this._currentBundleName!==e&&(this._currentBundleName=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get licensesReady(){return this._licensesReady.promise}get bundles(){var e;return(null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{}}get currentPackageIndex(){return this._currentPackageIndex}set currentPackageIndex(e){this._currentPackageIndex!==e&&(this._currentPackageIndex=e,this._selectedPackageChanged.emit(void 0),this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get currentPackage(){var e;return this.currentBundleName&&this.bundles&&null!=this._currentPackageIndex?this.getFilteredPackages((null===(e=this.bundles[this.currentBundleName])||void 0===e?void 0:e.packages)||[])[this._currentPackageIndex]:null}get trans(){return this._trans}get title(){return`${this._currentBundleName||""} ${this._trans.__("Licenses")}`.trim()}get packageFilter(){return this._packageFilter}set packageFilter(e){this._packageFilter=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0)}getFilteredPackages(e){let t=[],n=Object.entries(this._packageFilter).filter((([e,t])=>t&&`${t}`.trim().length)).map((([e,t])=>[e,`${t}`.toLowerCase().trim().split(" ")]));for(const a of e){let e=0;for(const[t,s]of n){let n=0,r=`${a[t]}`.toLowerCase();for(const e of s)r.includes(e)&&(n+=1);n&&(e+=1)}e===n.length&&t.push(a)}return Object.values(t)}}e.Model=t;class n extends i.VDomRenderer{constructor(e){super(e),this.renderFilter=e=>{const t=this.model.packageFilter[e]||"";return c.createElement("input",{type:"text",name:e,defaultValue:t,className:"jp-mod-styled",onInput:this.onFilterInput})},this.onFilterInput=e=>{const t=e.currentTarget,{name:n,value:a}=t;this.model.packageFilter={...this.model.packageFilter,[n]:a}},this.addClass("jp-Licenses-Filters"),this.addClass("jp-RenderedHTMLCommon")}render(){const{trans:e}=this.model;return c.createElement("div",null,c.createElement("label",null,c.createElement("strong",{className:g},e.__("Filter Licenses By"))),c.createElement("ul",null,c.createElement("li",null,c.createElement("label",null,e.__("Package")),this.renderFilter("name")),c.createElement("li",null,c.createElement("label",null,e.__("Version")),this.renderFilter("versionInfo")),c.createElement("li",null,c.createElement("label",null,e.__("License")),this.renderFilter("licenseId"))),c.createElement("label",null,c.createElement("strong",{className:g},e.__("Distributions"))))}}e.Filters=n;class a extends p.TabBar.Renderer{constructor(e){super(),this.closeIconSelector=".lm-TabBar-tabCloseIcon",this.model=e}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),a=this.createTabStyle(e),s=this.createTabClass(e),r=this.createTabDataset(e);return h.h.li({key:n,className:s,title:t,style:a,dataset:r},this.renderIcon(e),this.renderLabel(e),this.renderCountBadge(e))}renderCountBadge(e){const t=e.title.label,{bundles:n}=this.model,a=this.model.getFilteredPackages((n&&t?n[t].packages:[])||[]);return h.h.label({},`${a.length}`)}}e.BundleTabRenderer=a;class s extends i.VDomRenderer{constructor(e){super(e),this.renderRow=(e,t)=>{const n=t===this.model.currentPackageIndex,a=()=>this.model.currentPackageIndex=t;return c.createElement("tr",{key:e.name,className:n?"jp-mod-selected":"",onClick:a},c.createElement("td",null,c.createElement("input",{type:"radio",name:"show-package-license",value:t,onChange:a,checked:n})),c.createElement("th",null,e.name),c.createElement("td",null,c.createElement("code",null,e.versionInfo)),c.createElement("td",null,c.createElement("code",null,e.licenseId)))},this.addClass("jp-Licenses-Grid"),this.addClass("jp-RenderedHTMLCommon")}render(){var e;const{bundles:t,currentBundleName:n,trans:a}=this.model,s=this.model.getFilteredPackages(t&&n&&(null===(e=t[n])||void 0===e?void 0:e.packages)||[]);return s.length?c.createElement("form",null,c.createElement("table",null,c.createElement("thead",null,c.createElement("tr",null,c.createElement("td",null),c.createElement("th",null,a.__("Package")),c.createElement("th",null,a.__("Version")),c.createElement("th",null,a.__("License")))),c.createElement("tbody",null,s.map(this.renderRow)))):c.createElement("blockquote",null,c.createElement("em",null,a.__("No Packages found")))}}e.Grid=s;class r extends i.VDomRenderer{constructor(e){super(e),this.addClass("jp-Licenses-Text"),this.addClass("jp-RenderedHTMLCommon"),this.addClass("jp-RenderedMarkdown")}render(){const{currentPackage:e,trans:t}=this.model;let n="",a=t.__("No Package selected"),s="";if(e){const{name:r,versionInfo:l,licenseId:o,extractedText:i}=e;n=`${r} v${l}`,a=`${t.__("License")}: ${o||t.__("No License ID found")}`,s=i||t.__("No License Text found")}return[c.createElement("h1",{key:"h1"},n),c.createElement("blockquote",{key:"quote"},c.createElement("em",null,a)),c.createElement("code",{key:"code"},s)]}}e.FullText=r}(_||(_={})),function(e){e.open="help:open",e.about="help:about",e.activate="help:activate",e.close="help:close",e.show="help:show",e.hide="help:hide",e.jupyterForum="help:jupyter-forum",e.licenses="help:licenses",e.licenseReport="help:license-report",e.refreshLicenses="help:licenses-refresh"}(b||(b={}));const k="https:"===window.location.protocol,f=[{id:"@jupyterlab/help-extension:about",description:'Adds a "About" dialog feature.',autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,r=t.load("jupyterlab"),l=r.__("Help");a.addCommand(b.about,{label:r.__("About %1",e.name),execute:()=>{const t=r.__("Version %1",e.version),n=c.createElement("span",{className:"jp-About-version-info"},c.createElement("span",{className:"jp-About-version"},t)),a=c.createElement("span",{className:"jp-About-header"},c.createElement(i.jupyterIcon.react,{margin:"7px 9.5px",height:"auto",width:"58px"}),c.createElement("div",{className:"jp-About-header-info"},c.createElement(i.jupyterlabWordmarkIcon.react,{height:"auto",width:"196px"}),n)),l=c.createElement("span",{className:"jp-About-externalLinks"},c.createElement("a",{href:"https://github.com/jupyterlab/jupyterlab/graphs/contributors",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("CONTRIBUTOR LIST")),c.createElement("a",{href:"https://jupyter.org/about.html",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("ABOUT PROJECT JUPYTER"))),o=c.createElement("span",{className:"jp-About-copyright"},r.__("© 2015-2023 Project Jupyter Contributors")),d=c.createElement("div",{className:"jp-About-body"},l,o);return(0,s.showDialog)({title:a,body:d,buttons:[s.Dialog.createButton({label:r.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),n&&n.addItem({command:b.about,category:l})}},{id:"@jupyterlab/help-extension:jupyter-forum",description:"Adds command to open the Jupyter Forum website.",autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,s=t.load("jupyterlab"),r=s.__("Help");a.addCommand(b.jupyterForum,{label:s.__("Jupyter Forum"),execute:()=>{window.open("https://discourse.jupyter.org/c/jupyterlab")}}),n&&n.addItem({command:b.jupyterForum,category:r})}},{id:"@jupyterlab/help-extension:open",description:"Add command to open websites as panel or browser tab.",autoStart:!0,requires:[o.ITranslator],optional:[a.ILayoutRestorer],activate:(e,t,n)=>{const{commands:a,shell:l}=e,o=t.load("jupyterlab"),c="help-doc",d=new s.WidgetTracker({namespace:c});let u=0;a.addCommand(b.open,{label:e=>{var t;return null!==(t=e.text)&&void 0!==t?t:o.__("Open the provided `url` in a tab.")},execute:e=>{const t=e.url,n=e.text;if(e.newBrowserTab||k&&"https:"!==r.URLExt.parse(t).protocol)return void window.open(t);const a=function(e,t){const n=new i.IFrame({sandbox:["allow-scripts","allow-forms"]});n.url=e,n.addClass("jp-Help"),n.title.label=t,n.id=`${c}-${++u}`;const a=new s.MainAreaWidget({content:n});return a.addClass("jp-Help"),a}(t,n);return d.add(a),l.add(a,"main"),a}}),n&&n.restore(d,{command:b.open,args:e=>({url:e.content.url,text:e.content.title.label}),name:e=>e.content.url})}},{id:"@jupyterlab/help-extension:resources",description:"Adds menu entries to Jupyter reference documentation websites.",autoStart:!0,requires:[l.IMainMenu,o.ITranslator],optional:[a.ILabShell,s.ICommandPalette],activate:(e,t,n,a,r)=>{const l=n.load("jupyterlab"),o=l.__("Help"),{commands:i,serviceManager:d}=e,u=[{text:l.__("JupyterLab Reference"),url:"https://jupyterlab.readthedocs.io/en/latest/"},{text:l.__("JupyterLab FAQ"),url:"https://jupyterlab.readthedocs.io/en/latest/getting_started/faq.html"},{text:l.__("Jupyter Reference"),url:"https://jupyter.org/documentation"},{text:l.__("Markdown Reference"),url:"https://commonmark.org/help/"}];u.sort(((e,t)=>e.text.localeCompare(t.text)));const m=t.helpMenu,h=u.map((e=>({args:e,command:b.open})));m.addGroup(h,10);const p=new Map,g=(e,t)=>{var n;if(!t.length)return;const r=t[t.length-1];if(!r.kernel||p.has(r.kernel.name))return;const o=d.sessions.connectTo({model:r,kernelConnectionOptions:{handleComms:!1}});null===(n=o.kernel)||void 0===n||n.info.then((e=>{var t,n;const r=o.kernel.name;if(p.has(r))return;const u=null===(n=null===(t=d.kernelspecs)||void 0===t?void 0:t.specs)||void 0===n?void 0:n.kernelspecs[r];if(!u)return;p.set(r,e);let h=!1;const g=async()=>{const e=await i.execute("helpmenu:get-kernel");h=(null==e?void 0:e.name)===r};g().catch((e=>{console.error("Failed to get the kernel for the current widget.",e)})),a&&a.currentChanged.connect(g);const _=()=>h,k=`help-menu-${r}:banner`,f=u.display_name,v=u.resources["logo-svg"]||u.resources["logo-64x64"];i.addCommand(k,{label:l.__("About the %1 Kernel",f),isVisible:_,isEnabled:_,execute:()=>{const t=c.createElement("img",{src:v,alt:l.__("Kernel Icon")}),n=c.createElement("span",{className:"jp-About-header"},t,c.createElement("div",{className:"jp-About-header-info"},f)),a=c.createElement("pre",null,e.banner),r=c.createElement("div",{className:"jp-About-body"},a);return(0,s.showDialog)({title:n,body:r,buttons:[s.Dialog.createButton({label:l.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),m.addGroup([{command:k}],20);const y=[];(e.help_links||[]).forEach((e=>{const t=`help-menu-${r}:${e.text}`;i.addCommand(t,{label:i.label(b.open,e),isVisible:_,isEnabled:_,execute:()=>i.execute(b.open,e)}),y.push({command:t})})),m.addGroup(y,21)})).then((()=>{o.dispose()}))};for(const e of d.sessions.running())g(d.sessions,[e]);d.sessions.runningChanged.connect(g),r&&(u.forEach((e=>{r.addItem({args:e,command:b.open,category:o})})),r.addItem({args:{reload:!0},command:"apputils:reset",category:o}))}},{id:"@jupyterlab/help-extension:licenses",description:"Adds licenses used report tools.",autoStart:!0,requires:[o.ITranslator],optional:[l.IMainMenu,s.ICommandPalette,a.ILayoutRestorer],activate:(e,t,n,a,l)=>{if(!r.PageConfig.getOption("licensesUrl"))return;const{commands:o,shell:c}=e,d=t.load("jupyterlab"),u=d.__("Help"),m=d.__("Download All Licenses as"),h=d.__("Licenses"),p=d.__("Refresh Licenses");let g=0;const k=r.URLExt.join(r.PageConfig.getBaseUrl(),r.PageConfig.getOption("licensesUrl"))+"/",f="help-licenses",v=new s.WidgetTracker({namespace:f});function y(e){return _.REPORT_FORMATS[e]||_.REPORT_FORMATS[_.DEFAULT_FORMAT]}o.addCommand(b.licenses,{label:h,execute:t=>{const n=function(t){const n=new _.Model({...t,licensesUrl:k,trans:d,serverSettings:e.serviceManager.serverSettings}),a=new _({model:n});a.id=`${f}-${++g}`,a.title.label=h,a.title.icon=i.copyrightIcon;const r=new s.MainAreaWidget({content:a,reveal:n.licensesReady});r.toolbar.addItem("refresh-licenses",new i.CommandToolbarButton({id:b.refreshLicenses,args:{noLabel:1},commands:o})),r.toolbar.addItem("spacer",i.Toolbar.createSpacerItem());for(const e of Object.keys(_.REPORT_FORMATS)){const t=new i.CommandToolbarButton({id:b.licenseReport,args:{format:e,noLabel:1},commands:o});r.toolbar.addItem(`download-${e}`,t)}return r}(t);return c.add(n,"main",{type:"Licenses"}),v.add(n),n.content.model.trackerDataChanged.connect((()=>{v.save(n)})),n}}),o.addCommand(b.refreshLicenses,{label:e=>e.noLabel?"":p,caption:p,icon:i.refreshIcon,execute:async()=>{var e;return null===(e=v.currentWidget)||void 0===e?void 0:e.content.model.initLicenses()}}),o.addCommand(b.licenseReport,{label:e=>{if(e.noLabel)return"";const t=y(`${e.format}`);return`${m} ${t.title}`},caption:e=>{const t=y(`${e.format}`);return`${m} ${t.title}`},icon:e=>y(`${e.format}`).icon,execute:async e=>{var t;const n=y(`${e.format}`);return await(null===(t=v.currentWidget)||void 0===t?void 0:t.content.model.download({format:n.id}))}}),a&&a.addItem({command:b.licenses,category:u}),n&&n.helpMenu.addGroup([{command:b.licenses}],0),l&&l.restore(v,{command:b.licenses,name:e=>"licenses",args:e=>{const{currentBundleName:t,currentPackageIndex:n,packageFilter:a}=e.content.model;return{currentBundleName:t,currentPackageIndex:n,packageFilter:a}}})}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1496],{91496:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var a=n(44604),s=n(53312),r=n(68722),l=n(29879),o=n(12030),i=n(35613),c=n(78156),d=n(87408),u=n(20998),m=n(81997),h=n(24475),p=n(63485);const g="jp-Licenses-Filters-title";class _ extends p.SplitPanel{constructor(e){super(),this.addClass("jp-Licenses"),this.model=e.model,this.initLeftPanel(),this.initFilters(),this.initBundles(),this.initGrid(),this.initLicenseText(),this.setRelativeSizes([1,2,3]),this.model.initLicenses().then((()=>this._updateBundles())),this.model.trackerDataChanged.connect((()=>{this.title.label=this.model.title}))}dispose(){this.isDisposed||(this._bundles.currentChanged.disconnect(this.onBundleSelected,this),this.model.dispose(),super.dispose())}initLeftPanel(){this._leftPanel=new p.Panel,this._leftPanel.addClass("jp-Licenses-FormArea"),this.addWidget(this._leftPanel),p.SplitPanel.setStretch(this._leftPanel,1)}initFilters(){this._filters=new _.Filters(this.model),p.SplitPanel.setStretch(this._filters,1),this._leftPanel.addWidget(this._filters)}initBundles(){this._bundles=new p.TabBar({orientation:"vertical",renderer:new _.BundleTabRenderer(this.model)}),this._bundles.addClass("jp-Licenses-Bundles"),p.SplitPanel.setStretch(this._bundles,1),this._leftPanel.addWidget(this._bundles),this._bundles.currentChanged.connect(this.onBundleSelected,this),this.model.stateChanged.connect((()=>this._bundles.update()))}initGrid(){this._grid=new _.Grid(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._grid)}initLicenseText(){this._licenseText=new _.FullText(this.model),p.SplitPanel.setStretch(this._grid,1),this.addWidget(this._licenseText)}onBundleSelected(){var e;(null===(e=this._bundles.currentTitle)||void 0===e?void 0:e.label)&&(this.model.currentBundleName=this._bundles.currentTitle.label)}_updateBundles(){this._bundles.clearTabs();let e=0;const{currentBundleName:t}=this.model;let n=0;for(const a of this.model.bundleNames){const s=new p.Widget;s.title.label=a,a===t&&(n=e),this._bundles.insertTab(++e,s.title)}this._bundles.currentIndex=n}}var b;!function(e){e.REPORT_FORMATS={markdown:{id:"markdown",title:"Markdown",icon:i.markdownIcon},csv:{id:"csv",title:"CSV",icon:i.spreadsheetIcon},json:{id:"csv",title:"JSON",icon:i.jsonIcon}},e.DEFAULT_FORMAT="markdown";class t extends i.VDomModel{constructor(e){super(),this._selectedPackageChanged=new m.Signal(this),this._trackerDataChanged=new m.Signal(this),this._currentPackageIndex=0,this._licensesReady=new u.PromiseDelegate,this._packageFilter={},this._trans=e.trans,this._licensesUrl=e.licensesUrl,this._serverSettings=e.serverSettings||d.ServerConnection.makeSettings(),e.currentBundleName&&(this._currentBundleName=e.currentBundleName),e.packageFilter&&(this._packageFilter=e.packageFilter),e.currentPackageIndex&&(this._currentPackageIndex=e.currentPackageIndex)}async initLicenses(){try{const e=await d.ServerConnection.makeRequest(this._licensesUrl,{},this._serverSettings);this._serverResponse=await e.json(),this._licensesReady.resolve(),this.stateChanged.emit(void 0)}catch(e){this._licensesReady.reject(e)}}async download(e){const t=`${this._licensesUrl}?format=${e.format}&download=1`,n=document.createElement("a");n.href=t,n.download="",document.body.appendChild(n),n.click(),document.body.removeChild(n)}get selectedPackageChanged(){return this._selectedPackageChanged}get trackerDataChanged(){return this._trackerDataChanged}get bundleNames(){var e;return Object.keys((null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{})}get currentBundleName(){return this._currentBundleName?this._currentBundleName:this.bundleNames.length?this.bundleNames[0]:null}set currentBundleName(e){this._currentBundleName!==e&&(this._currentBundleName=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get licensesReady(){return this._licensesReady.promise}get bundles(){var e;return(null===(e=this._serverResponse)||void 0===e?void 0:e.bundles)||{}}get currentPackageIndex(){return this._currentPackageIndex}set currentPackageIndex(e){this._currentPackageIndex!==e&&(this._currentPackageIndex=e,this._selectedPackageChanged.emit(void 0),this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0))}get currentPackage(){var e;return this.currentBundleName&&this.bundles&&null!=this._currentPackageIndex?this.getFilteredPackages((null===(e=this.bundles[this.currentBundleName])||void 0===e?void 0:e.packages)||[])[this._currentPackageIndex]:null}get trans(){return this._trans}get title(){return`${this._currentBundleName||""} ${this._trans.__("Licenses")}`.trim()}get packageFilter(){return this._packageFilter}set packageFilter(e){this._packageFilter=e,this.stateChanged.emit(void 0),this._trackerDataChanged.emit(void 0)}getFilteredPackages(e){let t=[],n=Object.entries(this._packageFilter).filter((([e,t])=>t&&`${t}`.trim().length)).map((([e,t])=>[e,`${t}`.toLowerCase().trim().split(" ")]));for(const a of e){let e=0;for(const[t,s]of n){let n=0,r=`${a[t]}`.toLowerCase();for(const e of s)r.includes(e)&&(n+=1);n&&(e+=1)}e===n.length&&t.push(a)}return Object.values(t)}}e.Model=t;class n extends i.VDomRenderer{constructor(e){super(e),this.renderFilter=e=>{const t=this.model.packageFilter[e]||"";return c.createElement("input",{type:"text",name:e,defaultValue:t,className:"jp-mod-styled",onInput:this.onFilterInput})},this.onFilterInput=e=>{const t=e.currentTarget,{name:n,value:a}=t;this.model.packageFilter={...this.model.packageFilter,[n]:a}},this.addClass("jp-Licenses-Filters"),this.addClass("jp-RenderedHTMLCommon")}render(){const{trans:e}=this.model;return c.createElement("div",null,c.createElement("label",null,c.createElement("strong",{className:g},e.__("Filter Licenses By"))),c.createElement("ul",null,c.createElement("li",null,c.createElement("label",null,e.__("Package")),this.renderFilter("name")),c.createElement("li",null,c.createElement("label",null,e.__("Version")),this.renderFilter("versionInfo")),c.createElement("li",null,c.createElement("label",null,e.__("License")),this.renderFilter("licenseId"))),c.createElement("label",null,c.createElement("strong",{className:g},e.__("Distributions"))))}}e.Filters=n;class a extends p.TabBar.Renderer{constructor(e){super(),this.closeIconSelector=".lm-TabBar-tabCloseIcon",this.model=e}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),a=this.createTabStyle(e),s=this.createTabClass(e),r=this.createTabDataset(e);return h.h.li({key:n,className:s,title:t,style:a,dataset:r},this.renderIcon(e),this.renderLabel(e),this.renderCountBadge(e))}renderCountBadge(e){const t=e.title.label,{bundles:n}=this.model,a=this.model.getFilteredPackages((n&&t?n[t].packages:[])||[]);return h.h.label({},`${a.length}`)}}e.BundleTabRenderer=a;class s extends i.VDomRenderer{constructor(e){super(e),this.renderRow=(e,t)=>{const n=t===this.model.currentPackageIndex,a=()=>this.model.currentPackageIndex=t;return c.createElement("tr",{key:e.name,className:n?"jp-mod-selected":"",onClick:a},c.createElement("td",null,c.createElement("input",{type:"radio",name:"show-package-license",value:t,onChange:a,checked:n})),c.createElement("th",null,e.name),c.createElement("td",null,c.createElement("code",null,e.versionInfo)),c.createElement("td",null,c.createElement("code",null,e.licenseId)))},this.addClass("jp-Licenses-Grid"),this.addClass("jp-RenderedHTMLCommon")}render(){var e;const{bundles:t,currentBundleName:n,trans:a}=this.model,s=this.model.getFilteredPackages(t&&n&&(null===(e=t[n])||void 0===e?void 0:e.packages)||[]);return s.length?c.createElement("form",null,c.createElement("table",null,c.createElement("thead",null,c.createElement("tr",null,c.createElement("td",null),c.createElement("th",null,a.__("Package")),c.createElement("th",null,a.__("Version")),c.createElement("th",null,a.__("License")))),c.createElement("tbody",null,s.map(this.renderRow)))):c.createElement("blockquote",null,c.createElement("em",null,a.__("No Packages found")))}}e.Grid=s;class r extends i.VDomRenderer{constructor(e){super(e),this.addClass("jp-Licenses-Text"),this.addClass("jp-RenderedHTMLCommon"),this.addClass("jp-RenderedMarkdown")}render(){const{currentPackage:e,trans:t}=this.model;let n="",a=t.__("No Package selected"),s="";if(e){const{name:r,versionInfo:l,licenseId:o,extractedText:i}=e;n=`${r} v${l}`,a=`${t.__("License")}: ${o||t.__("No License ID found")}`,s=i||t.__("No License Text found")}return[c.createElement("h1",{key:"h1"},n),c.createElement("blockquote",{key:"quote"},c.createElement("em",null,a)),c.createElement("code",{key:"code"},s)]}}e.FullText=r}(_||(_={})),function(e){e.open="help:open",e.about="help:about",e.activate="help:activate",e.close="help:close",e.show="help:show",e.hide="help:hide",e.jupyterForum="help:jupyter-forum",e.licenses="help:licenses",e.licenseReport="help:license-report",e.refreshLicenses="help:licenses-refresh"}(b||(b={}));const k="https:"===window.location.protocol,f=[{id:"@jupyterlab/help-extension:about",description:'Adds a "About" dialog feature.',autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,r=t.load("jupyterlab"),l=r.__("Help");a.addCommand(b.about,{label:r.__("About %1",e.name),execute:()=>{const t=r.__("Version %1",e.version),n=c.createElement("span",{className:"jp-About-version-info"},c.createElement("span",{className:"jp-About-version"},t)),a=c.createElement("span",{className:"jp-About-header"},c.createElement(i.jupyterIcon.react,{margin:"7px 9.5px",height:"auto",width:"58px"}),c.createElement("div",{className:"jp-About-header-info"},c.createElement(i.jupyterlabWordmarkIcon.react,{height:"auto",width:"196px"}),n)),l=c.createElement("span",{className:"jp-About-externalLinks"},c.createElement("a",{href:"https://github.com/jupyterlab/jupyterlab/graphs/contributors",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("CONTRIBUTOR LIST")),c.createElement("a",{href:"https://jupyter.org/about.html",target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},r.__("ABOUT PROJECT JUPYTER"))),o=c.createElement("span",{className:"jp-About-copyright"},r.__("© 2015-2023 Project Jupyter Contributors")),d=c.createElement("div",{className:"jp-About-body"},l,o);return(0,s.showDialog)({title:a,body:d,buttons:[s.Dialog.createButton({label:r.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),n&&n.addItem({command:b.about,category:l})}},{id:"@jupyterlab/help-extension:jupyter-forum",description:"Adds command to open the Jupyter Forum website.",autoStart:!0,requires:[o.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{const{commands:a}=e,s=t.load("jupyterlab"),r=s.__("Help");a.addCommand(b.jupyterForum,{label:s.__("Jupyter Forum"),execute:()=>{window.open("https://discourse.jupyter.org/c/jupyterlab")}}),n&&n.addItem({command:b.jupyterForum,category:r})}},{id:"@jupyterlab/help-extension:open",description:"Add command to open websites as panel or browser tab.",autoStart:!0,requires:[o.ITranslator],optional:[a.ILayoutRestorer],activate:(e,t,n)=>{const{commands:a,shell:l}=e,o=t.load("jupyterlab"),c="help-doc",d=new s.WidgetTracker({namespace:c});let u=0;a.addCommand(b.open,{label:e=>{var t;return null!==(t=e.text)&&void 0!==t?t:o.__("Open the provided `url` in a tab.")},execute:e=>{const t=e.url,n=e.text;if(e.newBrowserTab||k&&"https:"!==r.URLExt.parse(t).protocol)return void window.open(t);const a=function(e,t){const n=new i.IFrame({sandbox:["allow-scripts","allow-forms"]});n.url=e,n.addClass("jp-Help"),n.title.label=t,n.id=`${c}-${++u}`;const a=new s.MainAreaWidget({content:n});return a.addClass("jp-Help"),a}(t,n);return d.add(a),l.add(a,"main"),a}}),n&&n.restore(d,{command:b.open,args:e=>({url:e.content.url,text:e.content.title.label}),name:e=>e.content.url})}},{id:"@jupyterlab/help-extension:resources",description:"Adds menu entries to Jupyter reference documentation websites.",autoStart:!0,requires:[l.IMainMenu,o.ITranslator],optional:[a.ILabShell,s.ICommandPalette],activate:(e,t,n,a,r)=>{const l=n.load("jupyterlab"),o=l.__("Help"),{commands:i,serviceManager:d}=e,u=[{text:l.__("JupyterLab Reference"),url:"https://jupyterlab.readthedocs.io/en/latest/"},{text:l.__("JupyterLab FAQ"),url:"https://jupyterlab.readthedocs.io/en/latest/getting_started/faq.html"},{text:l.__("Jupyter Reference"),url:"https://jupyter.org/documentation"},{text:l.__("Markdown Reference"),url:"https://commonmark.org/help/"}];u.sort(((e,t)=>e.text.localeCompare(t.text)));const m=t.helpMenu,h=u.map((e=>({args:e,command:b.open})));m.addGroup(h,10);const p=new Map,g=(e,t)=>{var n;if(!t.length)return;const r=t[t.length-1];if(!r.kernel||p.has(r.kernel.name))return;const o=d.sessions.connectTo({model:r,kernelConnectionOptions:{handleComms:!1}});null===(n=o.kernel)||void 0===n||n.info.then((e=>{var t,n;const r=o.kernel.name;if(p.has(r))return;const u=null===(n=null===(t=d.kernelspecs)||void 0===t?void 0:t.specs)||void 0===n?void 0:n.kernelspecs[r];if(!u)return;p.set(r,e);let h=!1;const g=async()=>{const e=await i.execute("helpmenu:get-kernel");h=(null==e?void 0:e.name)===r};g().catch((e=>{console.error("Failed to get the kernel for the current widget.",e)})),a&&a.currentChanged.connect(g);const _=()=>h,k=`help-menu-${r}:banner`,f=u.display_name,v=u.resources["logo-svg"]||u.resources["logo-64x64"];i.addCommand(k,{label:l.__("About the %1 Kernel",f),isVisible:_,isEnabled:_,execute:()=>{const t=c.createElement("img",{src:v,alt:l.__("Kernel Icon")}),n=c.createElement("span",{className:"jp-About-header"},t,c.createElement("div",{className:"jp-About-header-info"},f)),a=c.createElement("pre",null,e.banner),r=c.createElement("div",{className:"jp-About-body"},a);return(0,s.showDialog)({title:n,body:r,buttons:[s.Dialog.createButton({label:l.__("Dismiss"),className:"jp-About-button jp-mod-reject jp-mod-styled"})]})}}),m.addGroup([{command:k}],20);const y=[];(e.help_links||[]).forEach((e=>{const t=`help-menu-${r}:${e.text}`;i.addCommand(t,{label:i.label(b.open,e),isVisible:_,isEnabled:_,execute:()=>i.execute(b.open,e)}),y.push({command:t})})),m.addGroup(y,21)})).then((()=>{o.dispose()}))};for(const e of d.sessions.running())g(d.sessions,[e]);d.sessions.runningChanged.connect(g),r&&(u.forEach((e=>{r.addItem({args:e,command:b.open,category:o})})),r.addItem({args:{reload:!0},command:"apputils:reset",category:o}))}},{id:"@jupyterlab/help-extension:licenses",description:"Adds licenses used report tools.",autoStart:!0,requires:[o.ITranslator],optional:[l.IMainMenu,s.ICommandPalette,a.ILayoutRestorer],activate:(e,t,n,a,l)=>{if(!r.PageConfig.getOption("licensesUrl"))return;const{commands:o,shell:c}=e,d=t.load("jupyterlab"),u=d.__("Help"),m=d.__("Download All Licenses as"),h=d.__("Licenses"),p=d.__("Refresh Licenses");let g=0;const k=r.URLExt.join(r.PageConfig.getBaseUrl(),r.PageConfig.getOption("licensesUrl"))+"/",f="help-licenses",v=new s.WidgetTracker({namespace:f});function y(e){return _.REPORT_FORMATS[e]||_.REPORT_FORMATS[_.DEFAULT_FORMAT]}o.addCommand(b.licenses,{label:h,execute:t=>{const n=function(t){const n=new _.Model({...t,licensesUrl:k,trans:d,serverSettings:e.serviceManager.serverSettings}),a=new _({model:n});a.id=`${f}-${++g}`,a.title.label=h,a.title.icon=i.copyrightIcon;const r=new s.MainAreaWidget({content:a,reveal:n.licensesReady});r.toolbar.addItem("refresh-licenses",new i.CommandToolbarButton({id:b.refreshLicenses,args:{noLabel:1},commands:o})),r.toolbar.addItem("spacer",i.Toolbar.createSpacerItem());for(const e of Object.keys(_.REPORT_FORMATS)){const t=new i.CommandToolbarButton({id:b.licenseReport,args:{format:e,noLabel:1},commands:o});r.toolbar.addItem(`download-${e}`,t)}return r}(t);return c.add(n,"main",{type:"Licenses"}),v.add(n),n.content.model.trackerDataChanged.connect((()=>{v.save(n)})),n}}),o.addCommand(b.refreshLicenses,{label:e=>e.noLabel?"":p,caption:p,icon:i.refreshIcon,execute:async()=>{var e;return null===(e=v.currentWidget)||void 0===e?void 0:e.content.model.initLicenses()}}),o.addCommand(b.licenseReport,{label:e=>{if(e.noLabel)return"";const t=y(`${e.format}`);return`${m} ${t.title}`},caption:e=>{const t=y(`${e.format}`);return`${m} ${t.title}`},icon:e=>y(`${e.format}`).icon,execute:async e=>{var t;const n=y(`${e.format}`);return await(null===(t=v.currentWidget)||void 0===t?void 0:t.content.model.download({format:n.id}))}}),a&&a.addItem({command:b.licenses,category:u}),n&&n.helpMenu.addGroup([{command:b.licenses}],0),l&&l.restore(v,{command:b.licenses,name:e=>"licenses",args:e=>{const{currentBundleName:t,currentPackageIndex:n,packageFilter:a}=e.content.model;return{currentBundleName:t,currentPackageIndex:n,packageFilter:a}}})}}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1647,2167],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(20998).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(22620),n=o(13408),r=o(63485);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null;const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t);if(!o)return;const s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1647,2167],{51647:(t,e,o)=>{o.r(e),o.d(e,{ITooltipManager:()=>s,Tooltip:()=>a});const s=new(o(20998).Token)("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var i=o(35613),n=o(81221),r=o(63485);const d="jp-mod-tooltip",h=!0;class a extends r.Widget{constructor(t){super(),this._content=null;const e=this.layout=new r.PanelLayout,o=new n.MimeModel({data:t.bundle});this.anchor=t.anchor,this.addClass("jp-Tooltip"),this.hide(),this._editor=t.editor,this._position=t.position,this._rendermime=t.rendermime;const s=this._rendermime.preferredMimeType(t.bundle,"any");s&&(this._content=this._rendermime.createRenderer(s),this._content.renderModel(o).then((()=>this._setGeometry())).catch((t=>console.error("tooltip rendering failed",t))),this._content.addClass("jp-Tooltip-content"),e.addWidget(this._content))}dispose(){this._content&&(this._content.dispose(),this._content=null),super.dispose()}handleEvent(t){if(this.isHidden||this.isDisposed)return;const{node:e}=this,o=t.target;switch(t.type){case"keydown":if(e.contains(o))return;this.dispose();break;case"mousedown":if(e.contains(o))return void this.activate();this.dispose();break;case"scroll":this._evtScroll(t)}}onActivateRequest(t){this.node.tabIndex=0,this.node.focus()}onAfterAttach(t){document.body.classList.add(d),document.addEventListener("keydown",this,h),document.addEventListener("mousedown",this,h),this.anchor.node.addEventListener("scroll",this,h),this.update()}onBeforeDetach(t){document.body.classList.remove(d),document.removeEventListener("keydown",this,h),document.removeEventListener("mousedown",this,h),this.anchor.node.removeEventListener("scroll",this,h)}onUpdateRequest(t){this.isHidden&&this.show(),this._setGeometry(),super.onUpdateRequest(t)}_evtScroll(t){this.node.contains(t.target)||this.update()}_getTokenPosition(){const t=this._editor,e=t.getCursorPosition(),o=t.getOffsetAt(e),s=t.getLine(e.line);if(!s)return;const i=s.substring(0,o).split(/\W+/),n=i[i.length-1],r=n?o-n.length:o;return t.getPositionAt(r)}_setGeometry(){const t=this._position?this._position:this._getTokenPosition();if(!t)return;const e=this._editor,o=e.getCoordinateForPosition(t);if(!o)return;const s=window.getComputedStyle(this.node),n=parseInt(s.paddingLeft,10)||0,r=e.host.closest(".jp-MainAreaWidget > .lm-Widget")||e.host;i.HoverBox.setGeometry({anchor:o,host:r,maxHeight:250,minHeight:20,node:this.node,offset:{horizontal:-1*n},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:s})}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1650,8875],{71650:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var n=o(1167),a=o(91942),i=o(46807),d=o(81997);const s=[{id:"@jupyter-notebook/docmanager-extension:opener",autoStart:!0,optional:[i.INotebookPathOpener,i.INotebookShell],provides:a.IDocumentWidgetOpener,description:"Open documents in a new browser tab",activate:(e,t,o)=>{const a=n.PageConfig.getBaseUrl(),s=e.docRegistry,r=null!=t?t:i.defaultNotebookPathOpener;let l=0;return new class{constructor(){this._opened=new d.Signal(this)}async open(t,i){var d,c,u;const p=null!==(d=null==i?void 0:i.type)&&void 0!==d?d:"",h=null==i?void 0:i.ref,v=null===(u=null===(c=null==o?void 0:o.userLayout)||void 0===c?void 0:c[p])||void 0===u?void 0:u.area;if("_noref"!==h&&void 0===v){const e=t.context.path,o=n.PathExt.extname(e);let i,d="edit";return("default"===p&&".ipynb"===o||p.includes("Notebook"))&&(t.context.sessionContext.kernelPreference.name&&await t.context.save(),d="notebooks"),p!==s.defaultWidgetFactory(e).name&&(i=new URLSearchParams({factory:p})),r.open({prefix:n.URLExt.join(a,d),path:e,searchParams:i}),void t.dispose()}t.id||(t.id="document-manager-"+ ++l),t.title.dataset={type:"document-title",...t.title.dataset},t.isAttached||e.shell.add(t,"main",i||{}),e.shell.activateById(t.id),this._opened.emit(t)}get opened(){return this._opened}}}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1650,8875],{71650:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var n=o(68722),a=o(5094),i=o(1635),d=o(81997);const s=[{id:"@jupyter-notebook/docmanager-extension:opener",autoStart:!0,optional:[i.INotebookPathOpener,i.INotebookShell],provides:a.IDocumentWidgetOpener,description:"Open documents in a new browser tab",activate:(e,t,o)=>{const a=n.PageConfig.getBaseUrl(),s=e.docRegistry,r=null!=t?t:i.defaultNotebookPathOpener;let l=0;return new class{constructor(){this._opened=new d.Signal(this)}async open(t,i){var d,c,u;const p=null!==(d=null==i?void 0:i.type)&&void 0!==d?d:"",h=null==i?void 0:i.ref,v=null===(u=null===(c=null==o?void 0:o.userLayout)||void 0===c?void 0:c[p])||void 0===u?void 0:u.area;if("_noref"!==h&&void 0===v){const e=t.context.path,o=n.PathExt.extname(e);let i,d="edit";return("default"===p&&".ipynb"===o||p.includes("Notebook"))&&(t.context.sessionContext.kernelPreference.name&&await t.context.save(),d="notebooks"),p!==s.defaultWidgetFactory(e).name&&(i=new URLSearchParams({factory:p})),r.open({prefix:n.URLExt.join(a,d),path:e,searchParams:i}),void t.dispose()}t.id||(t.id="document-manager-"+ ++l),t.title.dataset={type:"document-title",...t.title.dataset},t.isAttached||e.shell.add(t,"main",i||{}),e.shell.activateById(t.id),this._opened.emit(t)}get opened(){return this._opened}}}}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(2922),o=n(1167),i=n(69200),r=n(46807),s=n(33625);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1684,5601],{95601:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(44604),o=n(68722),i=n(5333),r=n(1635),s=n(33625);const c={id:"@jupyter-notebook/terminal-extension:opener",description:"A plugin to open terminals in a new tab.",requires:[a.IRouter,i.ITerminalTracker],autoStart:!0,activate:(e,t,n)=>{const{commands:a}=e,o=new RegExp("/terminals/(.*)"),i="router:terminal";a.addCommand(i,{execute:e=>{const t=e.path.match(o);if(!t)return;const[,i]=t;i&&(n.widgetAdded.connect(((e,t)=>{t.content.setOption("closeOnExit",!1)})),a.execute("terminal:open",{name:i}))}}),t.register({command:i,pattern:o})}},d={id:"@jupyter-notebook/terminal-extension:redirect",description:"Open terminals in a new tab.",requires:[i.ITerminalTracker],optional:[r.INotebookPathOpener],autoStart:!0,activate:(e,t,n)=>{const a=o.PageConfig.getBaseUrl(),i=null!=n?n:r.defaultNotebookPathOpener;t.widgetAdded.connect(((t,n)=>{if((0,s.find)(e.shell.widgets("main"),(e=>e.id===n.id)))return;const r=n.content.session.name;i.open({prefix:o.URLExt.join(a,"terminals"),path:r,target:"_blank"}),n.dispose()}))}},l=[c,d]}}]);
@@ -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(96049),i=s(37267),a=s(22620),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:()=>C,IRunningSessionSidebar:()=>y,RunningSessionManagers:()=>I,RunningSessions:()=>L,SearchableSessions:()=>D,SearchableSessionsList:()=>B});var n=s(53312),i=s(12030),a=s(35613),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 +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(2922),i=n(96049),o=n(21058),a=n(40930),s=n(26862),d=n(50845),l=n(24554),c=n(37267);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(37267),o=n(22620),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(1167),o=n(10979),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(44604),i=n(53312),o=n(21058),a=n(40930),s=n(95183),d=n(29879),l=n(23295),c=n(12030);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(12030),o=n(35613),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(68722),o=n(65903),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 +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(52839),o=i(52138),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(96049),d=i(49269),l=i(10979),c=i(22620),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(27829),v=i(37267),_=i(78156),f=i.n(_);function C(e){return f().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:v.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?f().createElement(C,{language:this.model.language,handleClick:this._handleClick}):null}}function x(e){const t=(e.translator||v.nullTranslator).load("jupyterlab"),i="number"==typeof e.tabSpace?t.__("Spaces"):t.__("Tab Indent");return f().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||v.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 f().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(87017);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 |from |import )","d")}catch(e){F=new RegExp("^\\s*(class |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(51429),o=i(61907),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(53312),d=i(30525),l=i(65903),c=i(35613),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(71098),v=i(12030),_=i(78156),f=i.n(_);function C(e){return f().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:v.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?f().createElement(C,{language:this.model.language,handleClick:this._handleClick}):null}}function x(e){const t=(e.translator||v.nullTranslator).load("jupyterlab"),i="number"==typeof e.tabSpace?t.__("Spaces"):t.__("Tab Indent");return f().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||v.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 f().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(79426);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 |from |import )","d")}catch(e){F=new RegExp("^\\s*(class |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.")}}]);