notebook 7.0.5__py3-none-any.whl → 7.0.7__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 (173) hide show
  1. notebook/_version.py +1 -1
  2. notebook/app.py +7 -4
  3. notebook/static/1018.bundle.js +1 -1
  4. notebook/static/1053.bundle.js +1 -1
  5. notebook/static/1198.bundle.js +1 -1
  6. notebook/static/1337.bundle.js +1 -1
  7. notebook/static/134.bundle.js +1 -1
  8. notebook/static/1408.bundle.js +1 -1
  9. notebook/static/1647.bundle.js +1 -1
  10. notebook/static/1650.bundle.js +1 -1
  11. notebook/static/1682.bundle.js +1 -1
  12. notebook/static/1684.bundle.js +1 -1
  13. notebook/static/1696.bundle.js +1 -1
  14. notebook/static/1809.bundle.js +1 -1
  15. notebook/static/1827.bundle.js +1 -1
  16. notebook/static/1833.bundle.js +1 -1
  17. notebook/static/1835.bundle.js +1 -1
  18. notebook/static/1950.bundle.js +1 -1
  19. notebook/static/1958.bundle.js +1 -1
  20. notebook/static/2007.bundle.js +1 -1
  21. notebook/static/2053.bundle.js +1 -0
  22. notebook/static/2067.bundle.js +1 -1
  23. notebook/static/2088.bundle.js +1 -1
  24. notebook/static/2089.bundle.js +1 -1
  25. notebook/static/2122.bundle.js +1 -1
  26. notebook/static/2167.bundle.js +1 -1
  27. notebook/static/2184.bundle.js +1 -1
  28. notebook/static/2311.bundle.js +1 -1
  29. notebook/static/2401.bundle.js +1 -1
  30. notebook/static/2479.bundle.js +1 -1
  31. notebook/static/2512.bundle.js +1 -1
  32. notebook/static/2607.bundle.js +1 -1
  33. notebook/static/2924.bundle.js +1 -1
  34. notebook/static/3146.bundle.js +1 -1
  35. notebook/static/3213.bundle.js +1 -1
  36. notebook/static/3340.bundle.js +1 -1
  37. notebook/static/3360.bundle.js +1 -1
  38. notebook/static/3466.bundle.js +1 -1
  39. notebook/static/35.bundle.js +1 -1
  40. notebook/static/3676.bundle.js +1 -1
  41. notebook/static/3680.bundle.js +1 -1
  42. notebook/static/3768.bundle.js +1 -1
  43. notebook/static/377.bundle.js +1 -1
  44. notebook/static/3863.bundle.js +1 -1
  45. notebook/static/3881.bundle.js +1 -1
  46. notebook/static/{6621.bundle.js → 3911.bundle.js} +1 -1
  47. notebook/static/4042.bundle.js +1 -1
  48. notebook/static/4131.bundle.js +1 -1
  49. notebook/static/4212.bundle.js +1 -1
  50. notebook/static/4234.bundle.js +1 -1
  51. notebook/static/4291.bundle.js +1 -1
  52. notebook/static/4382.bundle.js +1 -1
  53. notebook/static/4558.bundle.js +1 -1
  54. notebook/static/4588.bundle.js +1 -1
  55. notebook/static/4645.bundle.js +1 -1
  56. notebook/static/4811.bundle.js +1 -1
  57. notebook/static/4837.bundle.js +1 -1
  58. notebook/static/5088.bundle.js +1 -1
  59. notebook/static/5099.bundle.js +1 -1
  60. notebook/static/5125.bundle.js +1 -1
  61. notebook/static/5135.bundle.js +1 -1
  62. notebook/static/514.bundle.js +1 -1
  63. notebook/static/5313.bundle.js +1 -1
  64. notebook/static/5325.bundle.js +1 -1
  65. notebook/static/5346.bundle.js +1 -1
  66. notebook/static/5426.bundle.js +1 -1
  67. notebook/static/5573.bundle.js +1 -1
  68. notebook/static/5601.bundle.js +1 -1
  69. notebook/static/5678.bundle.js +1 -1
  70. notebook/static/5733.bundle.js +1 -1
  71. notebook/static/5912.bundle.js +1 -1
  72. notebook/static/5921.bundle.js +1 -1
  73. notebook/static/6017.bundle.js +1 -1
  74. notebook/static/6027.bundle.js +1 -1
  75. notebook/static/6139.bundle.js +1 -1
  76. notebook/static/62.bundle.js +1 -1
  77. notebook/static/6256.bundle.js +1 -1
  78. notebook/static/6345.bundle.js +1 -1
  79. notebook/static/6604.bundle.js +1 -1
  80. notebook/static/6627.bundle.js +1 -1
  81. notebook/static/6815.bundle.js +1 -1
  82. notebook/static/6853.bundle.js +1 -1
  83. notebook/static/6893.bundle.js +1 -1
  84. notebook/static/690.bundle.js +1 -1
  85. notebook/static/6962.bundle.js +1 -1
  86. notebook/static/6999.bundle.js +1 -1
  87. notebook/static/7226.bundle.js +1 -1
  88. notebook/static/7252.bundle.js +1 -1
  89. notebook/static/7302.bundle.js +1 -1
  90. notebook/static/7369.bundle.js +1 -1
  91. notebook/static/7386.bundle.js +1 -1
  92. notebook/static/7391.bundle.js +1 -1
  93. notebook/static/7394.bundle.js +1 -1
  94. notebook/static/7427.bundle.js +1 -1
  95. notebook/static/7603.bundle.js +1 -1
  96. notebook/static/7639.bundle.js +1 -1
  97. notebook/static/7684.bundle.js +1 -1
  98. notebook/static/7819.bundle.js +1 -1
  99. notebook/static/7900.bundle.js +1 -1
  100. notebook/static/7906.bundle.js +1 -1
  101. notebook/static/8579.bundle.js +1 -1
  102. notebook/static/8633.bundle.js +1 -1
  103. notebook/static/8771.bundle.js +1 -1
  104. notebook/static/8781.bundle.js +1 -0
  105. notebook/static/8875.bundle.js +1 -1
  106. notebook/static/8907.bundle.js +1 -1
  107. notebook/static/8928.bundle.js +1 -1
  108. notebook/static/8929.bundle.js +1 -1
  109. notebook/static/893.bundle.js +1 -1
  110. notebook/static/901.bundle.js +1 -1
  111. notebook/static/9068.bundle.js +1 -1
  112. notebook/static/9086.bundle.js +1 -1
  113. notebook/static/911.bundle.js +1 -1
  114. notebook/static/9151.bundle.js +1 -1
  115. notebook/static/9268.bundle.js +1 -1
  116. notebook/static/9335.bundle.js +1 -1
  117. notebook/static/9341.bundle.js +1 -1
  118. notebook/static/9380.bundle.js +1 -1
  119. notebook/static/9577.bundle.js +1 -0
  120. notebook/static/9605.bundle.js +1 -1
  121. notebook/static/9609.bundle.js +1 -1
  122. notebook/static/9638.bundle.js +1 -1
  123. notebook/static/9670.bundle.js +1 -0
  124. notebook/static/9680.bundle.js +1 -1
  125. notebook/static/9685.bundle.js +1 -1
  126. notebook/static/9752.bundle.js +1 -1
  127. notebook/static/9799.bundle.js +1 -1
  128. notebook/static/9852.bundle.js +1 -1
  129. notebook/static/bundle.js +1 -1
  130. notebook/static/third-party-licenses.json +98 -98
  131. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  132. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  133. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  134. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  135. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  136. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  137. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  138. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/34.19d4610ec716fa511ef4.js +1 -0
  139. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1160e2de23274a7c0e28.js +1 -0
  140. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.de56d0eb47577cb652f3.js +1 -0
  141. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eddcbb0f5a946c74796b.js +1 -0
  142. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.f2d2e79c8a92fd2ec840.js +1 -0
  143. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +4 -4
  144. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/METADATA +3 -2
  145. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/RECORD +166 -164
  146. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/WHEEL +1 -1
  147. notebook/static/6774.bundle.js +0 -1
  148. notebook/static/880.bundle.js +0 -1
  149. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.cf0b00aa9baf659e6dc7.js +0 -1
  150. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/776.c7baadfaddfd4518c935.js +0 -1
  151. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/922.0beff4620746e288bd5e.js +0 -1
  152. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.79046a2eb17bde1af38c.js +0 -1
  153. notebook-7.0.5.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.58182cbb5c785b66277a.js +0 -1
  154. {notebook-7.0.5.data → notebook-7.0.7.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  155. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  156. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  157. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  158. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  159. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  160. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  161. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  162. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  163. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  164. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  165. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  166. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  167. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  168. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  169. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  170. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  171. {notebook-7.0.5.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  172. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/entry_points.txt +0 -0
  173. {notebook-7.0.5.dist-info → notebook-7.0.7.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6999],{36999:(e,t,s)=>{s.r(t),s.d(t,{FOUND_CLASSES:()=>o,GenericSearchProvider:()=>c,HTMLSearchEngine:()=>h,ISearchProviderRegistry:()=>L,SearchDocumentModel:()=>m,SearchDocumentView:()=>V,SearchProvider:()=>n,SearchProviderRegistry:()=>U,TextSearchEngine:()=>p});var r=s(9267),i=s(81997);class n{constructor(e){this.widget=e,this._stateChanged=new i.Signal(this),this._filtersChanged=new i.Signal(this),this._disposed=!1}get stateChanged(){return this._stateChanged}get filtersChanged(){return this._filtersChanged}get currentMatchIndex(){return null}get isDisposed(){return this._disposed}get matchesCount(){return null}dispose(){this._disposed||(this._disposed=!0,i.Signal.clearData(this))}getInitialQuery(){return""}getFilters(){return{}}static preserveCase(e,t){return e.toUpperCase()===e?t.toUpperCase():e.toLowerCase()===e?t.toLowerCase():a(e)===e?a(t):t}}function a([e="",...t]){return e.toUpperCase()+""+t.join("").toLowerCase()}const o=["cm-string","cm-overlay","cm-searching"],l=["CodeMirror-selectedtext"];class h{static search(e,t){if(!(t instanceof Node))return console.warn("Unable to search with HTMLSearchEngine the provided object.",t),Promise.resolve([]);e.global||(e=new RegExp(e.source,e.flags+"g"));const s=[],r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:s=>{let r=s.parentElement;for(;r!==t;){if(r.nodeName in h.UNSUPPORTED_ELEMENTS)return NodeFilter.FILTER_REJECT;r=r.parentElement}return e.test(s.textContent)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let i=null;for(;null!==(i=r.nextNode());){e.lastIndex=0;let t=null;for(;null!==(t=e.exec(i.textContent));)s.push({text:t[0],position:t.index,node:i})}return Promise.resolve(s)}}h.UNSUPPORTED_ELEMENTS={BASE:!0,HEAD:!0,LINK:!0,META:!0,STYLE:!0,TITLE:!0,BODY:!0,AREA:!0,AUDIO:!0,IMG:!0,MAP:!0,TRACK:!0,VIDEO:!0,APPLET:!0,EMBED:!0,IFRAME:!0,NOEMBED:!0,OBJECT:!0,PARAM:!0,PICTURE:!0,SOURCE:!0,CANVAS:!0,NOSCRIPT:!0,SCRIPT:!0,SVG:!0};class c extends n{constructor(){super(...arguments),this.isReadOnly=!0,this._matches=[],this._mutationObserver=new MutationObserver(this._onWidgetChanged.bind(this)),this._markNodes=new Array}static isApplicable(e){return e instanceof r.Widget}static createNew(e,t,s){return new c(e)}get currentMatchIndex(){return this._currentMatchIndex>=0?this._currentMatchIndex:null}get currentMatch(){var e;return null!==(e=this._matches[this._currentMatchIndex])&&void 0!==e?e:null}get matches(){return this._matches?this._matches.map((e=>Object.assign({},e))):this._matches}get matchesCount(){return this._matches.length}clearHighlight(){return this._currentMatchIndex>=0&&this._markNodes[this._currentMatchIndex].classList.remove(...l),this._currentMatchIndex=-1,Promise.resolve()}dispose(){this.isDisposed||(this.endQuery().catch((e=>{console.error("Failed to end search query.",e)})),super.dispose())}async highlightNext(e){var t;return null!==(t=this._highlightNext(!1,null==e||e))&&void 0!==t?t:void 0}async highlightPrevious(e){var t;return null!==(t=this._highlightNext(!0,null==e||e))&&void 0!==t?t:void 0}async replaceCurrentMatch(e,t){return Promise.resolve(!1)}async replaceAllMatches(e){return Promise.resolve(!1)}async startQuery(e,t={}){if(await this.endQuery(),this._query=e,null===e)return Promise.resolve();const s=await h.search(e,this.widget.node);let r=0;for(;r<s.length;){let e=s[r].node,t=e.parentNode,i=[s[r]];for(;++r<s.length&&s[r].node===e;)i.unshift(s[r]);const n=i.map((s=>{const r=document.createElement("mark");r.classList.add(...o),r.textContent=s.text;const i=e.splitText(s.position);return i.textContent=i.textContent.slice(s.text.length),t.insertBefore(r,i),r}));for(let e=n.length-1;e>=0;e--)this._markNodes.push(n[e])}this._mutationObserver.observe(this.widget.node,{attributes:!1,characterData:!0,childList:!0,subtree:!0}),this._matches=s}async endQuery(){this._mutationObserver.disconnect(),this._markNodes.forEach((e=>{const t=e.parentNode;t.replaceChild(document.createTextNode(e.textContent),e),t.normalize()})),this._markNodes=[],this._matches=[],this._currentMatchIndex=-1}_highlightNext(e,t){if(0===this._matches.length)return null;if(-1===this._currentMatchIndex?this._currentMatchIndex=e?this.matches.length-1:0:(this._markNodes[this._currentMatchIndex].classList.remove(...l),this._currentMatchIndex=e?this._currentMatchIndex-1:this._currentMatchIndex+1,t&&(this._currentMatchIndex<0||this._currentMatchIndex>=this._matches.length)&&(this._currentMatchIndex=(this._currentMatchIndex+this._matches.length)%this._matches.length)),this._currentMatchIndex>=0&&this._currentMatchIndex<this._matches.length){const t=this._markNodes[this._currentMatchIndex];return t.classList.add(...l),function(e){const t=e.getBoundingClientRect();return t.top>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.left>=0&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(t)||t.scrollIntoView(e),t.focus(),this._matches[this._currentMatchIndex]}return this._currentMatchIndex=-1,null}async _onWidgetChanged(e,t){this._currentMatchIndex=-1,await this.startQuery(this._query),this._stateChanged.emit()}}const p={search(e,t){if("string"!=typeof t)try{t=JSON.stringify(t)}catch(e){return console.warn("Unable to search with TextSearchEngine non-JSON serializable object.",e,t),Promise.resolve([])}e.global||(e=new RegExp(e.source,e.flags+"g"));const s=new Array;let r=null;for(;null!==(r=e.exec(t));)s.push({text:r[0],position:r.index});return Promise.resolve(s)}};var d,u=s(59361),g=s(97934);class m extends u.VDomModel{constructor(e,t){if(super(),this.searchProvider=e,this._caseSensitive=!1,this._disposed=new i.Signal(this),this._parsingError="",this._preserveCase=!1,this._initialQuery="",this._filters={},this._replaceText="",this._searchExpression="",this._useRegex=!1,this._wholeWords=!1,this._filters={},this.searchProvider.getFilters){const e=this.searchProvider.getFilters();for(const t in e)this._filters[t]=e[t].default}e.stateChanged.connect(this.refresh,this),this._searchDebouncer=new g.Debouncer((()=>{this._updateSearch().catch((e=>{console.error("Failed to update search on document.",e)}))}),t)}get caseSensitive(){return this._caseSensitive}set caseSensitive(e){this._caseSensitive!==e&&(this._caseSensitive=e,this.stateChanged.emit(),this.refresh())}get currentIndex(){return this.searchProvider.currentMatchIndex}get disposed(){return this._disposed}get filters(){return this._filters}get filtersDefinition(){var e,t,s;return null!==(s=null===(t=(e=this.searchProvider).getFilters)||void 0===t?void 0:t.call(e))&&void 0!==s?s:{}}get filtersDefinitionChanged(){return this.searchProvider.filtersChanged||null}get initialQuery(){return this._initialQuery}set initialQuery(e){this._initialQuery=e||this._searchExpression}get suggestedInitialQuery(){return this.searchProvider.getInitialQuery()}get isReadOnly(){return this.searchProvider.isReadOnly}get replaceOptionsSupport(){return this.searchProvider.replaceOptionsSupport}get parsingError(){return this._parsingError}get preserveCase(){return this._preserveCase}set preserveCase(e){this._preserveCase!==e&&(this._preserveCase=e,this.stateChanged.emit(),this.refresh())}get replaceText(){return this._replaceText}set replaceText(e){this._replaceText!==e&&(this._replaceText=e,this.stateChanged.emit())}get searchExpression(){return this._searchExpression}set searchExpression(e){this._searchExpression!==e&&(this._searchExpression=e,this.stateChanged.emit(),this.refresh())}get totalMatches(){return this.searchProvider.matchesCount}get useRegex(){return this._useRegex}set useRegex(e){this._useRegex!==e&&(this._useRegex=e,this.stateChanged.emit(),this.refresh())}get wholeWords(){return this._wholeWords}set wholeWords(e){this._wholeWords!==e&&(this._wholeWords=e,this.stateChanged.emit(),this.refresh())}dispose(){this.isDisposed||(this._searchExpression&&this.endQuery().catch((e=>{console.error(`Failed to end query '${this._searchExpression}.`,e)})),this.searchProvider.stateChanged.disconnect(this.refresh,this),this._searchDebouncer.dispose(),super.dispose())}async endQuery(){await this.searchProvider.endQuery(),this.stateChanged.emit()}async highlightNext(){await this.searchProvider.highlightNext(),this.stateChanged.emit()}async highlightPrevious(){await this.searchProvider.highlightPrevious(),this.stateChanged.emit()}refresh(){this._searchDebouncer.invoke().catch((e=>{console.error("Failed to invoke search document debouncer.",e)}))}async replaceAllMatches(){await this.searchProvider.replaceAllMatches(this._replaceText,{preserveCase:this.preserveCase,regularExpression:this.useRegex}),this.stateChanged.emit()}async replaceCurrentMatch(){await this.searchProvider.replaceCurrentMatch(this._replaceText,!0,{preserveCase:this.preserveCase,regularExpression:this.useRegex}),this.stateChanged.emit()}async setFilter(e,t){this._filters[e]!==t&&(this.searchProvider.validateFilter?(this._filters[e]=await this.searchProvider.validateFilter(e,t),this._filters[e]===t&&(this.stateChanged.emit(),this.refresh())):(this._filters[e]=t,this.stateChanged.emit(),this.refresh()))}async _updateSearch(){this._parsingError&&(this._parsingError="",this.stateChanged.emit());try{const e=this.searchExpression?d.parseQuery(this.searchExpression,this.caseSensitive,this.useRegex,this.wholeWords):null;e&&(await this.searchProvider.startQuery(e,this._filters),this.stateChanged.emit())}catch(e){this._parsingError=e.toString(),this.stateChanged.emit(),console.error(`Failed to parse expression ${this.searchExpression}`,e)}}}!function(e){e.parseQuery=function(e,t,s,r){const i=t?"gm":"gim";let n=s?e:e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");r&&(n="\\b"+n+"\\b");const a=new RegExp(n,i);return a.test("")?null:a}}(d||(d={}));var _=s(49255),v=s(56165),x=s(78156);const C="jp-DocumentSearch-overlay-row",E="jp-DocumentSearch-input",f="jp-DocumentSearch-input-wrapper",y="jp-DocumentSearch-input-button-off",S="jp-DocumentSearch-input-button-on",w="jp-DocumentSearch-up-down-button",b="jp-DocumentSearch-search-filter",R="jp-DocumentSearch-replace-button",I="jp-DocumentSearch-replace-button-wrapper",T="jp-DocumentSearch-button-content",N="jp-DocumentSearch-button-wrapper";function M(e){const[t,s]=(0,x.useState)(1),r=(0,x.useCallback)((t=>{var r;const i=t?t.target:null===(r=e.inputRef)||void 0===r?void 0:r.current;i&&s(i.value.split(/\n/).length)}),[]);return(0,x.useEffect)((()=>{var t,s;null===(s=null===(t=e.inputRef)||void 0===t?void 0:t.current)||void 0===s||s.select(),r()}),[e.initialValue]),x.createElement("textarea",{placeholder:e.placeholder,className:E,rows:t,onChange:t=>{e.onChange(t),r(t)},onKeyDown:t=>{e.onKeyDown(t),r(t)},key:e.autoUpdate?e.initialValue:null,tabIndex:0,ref:e.inputRef,title:e.title,defaultValue:e.initialValue,autoFocus:e.autoFocus})}function P(e){var t;const s=(null!==(t=e.translator)&&void 0!==t?t:_.nullTranslator).load("jupyterlab"),r=(0,u.classes)(e.caseSensitive?S:y,T),i=(0,u.classes)(e.useRegex?S:y,T),n=(0,u.classes)(e.wholeWords?S:y,T),a=f;return x.createElement("div",{className:a},x.createElement(M,{placeholder:s.__("Find"),onChange:t=>e.onChange(t),onKeyDown:t=>e.onKeydown(t),inputRef:e.inputRef,initialValue:e.initialSearchText,title:s.__("Find"),autoFocus:!0,autoUpdate:!0}),x.createElement("button",{className:N,onClick:()=>{e.onCaseSensitiveToggled()},tabIndex:0,title:s.__("Match Case")},x.createElement(u.caseSensitiveIcon.react,{className:r,tag:"span"})),x.createElement("button",{className:N,onClick:()=>e.onWordToggled(),tabIndex:0,title:s.__("Match Whole Word")},x.createElement(u.wordIcon.react,{className:n,tag:"span"})),x.createElement("button",{className:N,onClick:()=>e.onRegexToggled(),tabIndex:0,title:s.__("Use Regular Expression")},x.createElement(u.regexIcon.react,{className:i,tag:"span"})))}function D(e){var t,s,r;const i=(null!==(t=e.translator)&&void 0!==t?t:_.nullTranslator).load("jupyterlab"),n=(0,u.classes)(e.preserveCase?S:y,T);return x.createElement("div",{className:"jp-DocumentSearch-replace-wrapper-class"},x.createElement("div",{className:f},x.createElement(M,{placeholder:i.__("Replace"),initialValue:null!==(s=e.replaceText)&&void 0!==s?s:"",onKeyDown:t=>e.onReplaceKeydown(t),onChange:t=>e.onChange(t),title:i.__("Replace"),autoFocus:!1,autoUpdate:!1}),(null===(r=e.replaceOptionsSupport)||void 0===r?void 0:r.preserveCase)?x.createElement("button",{className:N,onClick:()=>e.onPreserveCaseToggled(),tabIndex:0,title:i.__("Preserve Case")},x.createElement(u.caseSensitiveIcon.react,{className:n,tag:"span"})):null),x.createElement("button",{className:I,onClick:()=>e.onReplaceCurrent(),tabIndex:0},x.createElement("span",{className:`${R} ${T}`,tabIndex:0},i.__("Replace"))),x.createElement("button",{className:I,tabIndex:0,onClick:()=>e.onReplaceAll()},x.createElement("span",{className:`${R} ${T}`,tabIndex:-1},i.__("Replace All"))))}function F(e){return x.createElement("div",{className:"jp-DocumentSearch-up-down-wrapper"},x.createElement("button",{className:N,onClick:()=>e.onHighlightPrevious(),tabIndex:0,title:e.trans.__("Previous Match")},x.createElement(u.caretUpEmptyThinIcon.react,{className:(0,u.classes)(w,T),tag:"span"})),x.createElement("button",{className:N,onClick:()=>e.onHighlightNext(),tabIndex:0,title:e.trans.__("Next Match")},x.createElement(u.caretDownEmptyThinIcon.react,{className:(0,u.classes)(w,T),tag:"span"})))}function O(e){return x.createElement("div",{className:"jp-DocumentSearch-index-counter"},0===e.totalMatches?"-/-":`${null===e.currentIndex?"-":e.currentIndex+1}/${e.totalMatches}`)}function j(e){let t=`jp-DocumentSearch-filter-button ${T}`;e.visible&&(t=`${t} jp-DocumentSearch-filter-button-enabled`);const s=e.anyEnabled?u.filterDotIcon:u.filterIcon;return x.createElement("button",{className:N,onClick:()=>e.toggleVisible(),tabIndex:0,title:e.visible?e.trans.__("Hide Search Filters"):e.trans.__("Show Search Filters")},x.createElement(s.react,{className:t,tag:"span",height:"20px",width:"20px"}))}function k(e){return x.createElement("label",{className:e.isEnabled?b:`${b} jp-DocumentSearch-search-filter-disabled`,title:e.description},x.createElement("input",{type:"checkbox",className:"jp-mod-styled",disabled:!e.isEnabled,checked:e.value,onChange:e.onToggle}),e.title)}class A extends x.Component{constructor(e){super(e),this.translator=e.translator||_.nullTranslator}_onSearchChange(e){const t=e.target.value;this.props.onSearchChanged(t)}_onSearchKeydown(e){if(13===e.keyCode)if(e.stopPropagation(),e.preventDefault(),e.ctrlKey){const t=e.target;this._insertNewLine(t),this.props.onSearchChanged(t.value)}else e.shiftKey?this.props.onHighlightPrevious():this.props.onHighlightNext()}_onReplaceKeydown(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),e.ctrlKey?this._insertNewLine(e.target):this.props.onReplaceCurrent())}_insertNewLine(e){const[t,s]=[e.selectionStart,e.selectionEnd];e.setRangeText("\n",t,s,"end")}_onClose(){this.props.onClose()}_onReplaceToggled(){if(!this.props.replaceEntryVisible)for(const e in this.props.filtersDefinition){const t=this.props.filtersDefinition[e];t.supportReplace||this.props.onFilterChanged(e,!1).catch((e=>{console.error(`Fail to update filter value for ${t.title}:\n${e}`)}))}this.props.onReplaceEntryShown(!this.props.replaceEntryVisible)}_toggleFiltersVisibility(){this.props.onFiltersVisibilityChanged(!this.props.filtersVisible)}render(){var e;const t=this.translator.load("jupyterlab"),s=!this.props.isReadOnly&&this.props.replaceEntryVisible,r=this.props.filtersDefinition,i=Object.keys(r).length>0,n=i?x.createElement(j,{visible:this.props.filtersVisible,anyEnabled:Object.keys(r).some((e=>{var t;const s=r[e];return null!==(t=this.props.filters[e])&&void 0!==t?t:s.default})),toggleVisible:()=>this._toggleFiltersVisibility(),trans:t}):null,a=i?x.createElement("div",{className:"jp-DocumentSearch-search-options"},Object.keys(r).map((e=>{var t;const i=r[e];return x.createElement(k,{key:e,title:i.title,description:i.description,isEnabled:!s||i.supportReplace,onToggle:async()=>{await this.props.onFilterChanged(e,!this.props.filters[e])},value:null!==(t=this.props.filters[e])&&void 0!==t?t:i.default})}))):null,o=this.props.replaceEntryVisible?u.caretDownIcon:u.caretRightIcon;return x.createElement(x.Fragment,null,x.createElement("div",{className:C},this.props.isReadOnly?x.createElement("div",{className:"jp-DocumentSearch-toggle-placeholder"}):x.createElement("button",{className:"jp-DocumentSearch-toggle-wrapper",onClick:()=>this._onReplaceToggled(),tabIndex:0,title:t.__("Toggle Replace")},x.createElement(o.react,{className:`jp-DocumentSearch-replace-toggle ${T}`,tag:"span",elementPosition:"center",height:"20px",width:"20px"})),x.createElement(P,{inputRef:this.props.searchInputRef,useRegex:this.props.useRegex,caseSensitive:this.props.caseSensitive,wholeWords:this.props.wholeWords,onCaseSensitiveToggled:this.props.onCaseSensitiveToggled,onRegexToggled:this.props.onRegexToggled,onWordToggled:this.props.onWordToggled,onKeydown:e=>this._onSearchKeydown(e),onChange:e=>this._onSearchChange(e),initialSearchText:this.props.initialSearchText,translator:this.translator}),n,x.createElement(O,{currentIndex:this.props.currentIndex,totalMatches:null!==(e=this.props.totalMatches)&&void 0!==e?e:0}),x.createElement(F,{onHighlightPrevious:()=>{this.props.onHighlightPrevious()},onHighlightNext:()=>{this.props.onHighlightNext()},trans:t}),x.createElement("button",{className:N,onClick:()=>this._onClose(),tabIndex:0},x.createElement(u.closeIcon.react,{className:"jp-icon-hover",elementPosition:"center",height:"16px",width:"16px"}))),x.createElement("div",{className:C},s?x.createElement(x.Fragment,null,x.createElement(D,{onPreserveCaseToggled:this.props.onPreserveCaseToggled,onReplaceKeydown:e=>this._onReplaceKeydown(e),onChange:e=>this.props.onReplaceChanged(e.target.value),onReplaceCurrent:()=>this.props.onReplaceCurrent(),onReplaceAll:()=>this.props.onReplaceAll(),replaceOptionsSupport:this.props.replaceOptionsSupport,replaceText:this.props.replaceText,preserveCase:this.props.preserveCase,translator:this.translator}),x.createElement("div",{className:"jp-DocumentSearch-spacer"})):null),this.props.filtersVisible?a:null,!!this.props.errorMessage&&x.createElement("div",{className:"jp-DocumentSearch-regex-error"},this.props.errorMessage))}}class V extends u.VDomRenderer{constructor(e,t){super(e),this.translator=t,this._showReplace=!1,this._showFilters=!1,this._closed=new i.Signal(this),this.addClass("jp-DocumentSearch-overlay"),this._searchInput=x.createRef()}get closed(){return this._closed}focusSearchInput(){var e;null===(e=this._searchInput.current)||void 0===e||e.select()}setSearchText(e){this.model.initialQuery=e,e&&(this.model.searchExpression=e)}setReplaceText(e){this.model.replaceText=e}showReplace(){this.setReplaceInputVisibility(!0)}onCloseRequest(e){super.onCloseRequest(e),this._closed.emit(),this.model.endQuery()}setReplaceInputVisibility(e){this._showReplace!==e&&(this._showReplace=e,this.update())}setFiltersVisibility(e){this._showFilters!==e&&(this._showFilters=e,this.update())}render(){return this.model.filtersDefinitionChanged?x.createElement(v.UseSignal,{signal:this.model.filtersDefinitionChanged},(()=>this._renderOverlay())):this._renderOverlay()}_renderOverlay(){return x.createElement(A,{caseSensitive:this.model.caseSensitive,currentIndex:this.model.currentIndex,isReadOnly:this.model.isReadOnly,errorMessage:this.model.parsingError,filters:this.model.filters,filtersDefinition:this.model.filtersDefinition,preserveCase:this.model.preserveCase,replaceEntryVisible:this._showReplace,filtersVisible:this._showFilters,replaceOptionsSupport:this.model.replaceOptionsSupport,replaceText:this.model.replaceText,initialSearchText:this.model.initialQuery,searchInputRef:this._searchInput,totalMatches:this.model.totalMatches,translator:this.translator,useRegex:this.model.useRegex,wholeWords:this.model.wholeWords,onCaseSensitiveToggled:()=>{this.model.caseSensitive=!this.model.caseSensitive},onRegexToggled:()=>{this.model.useRegex=!this.model.useRegex},onWordToggled:()=>{this.model.wholeWords=!this.model.wholeWords},onFilterChanged:async(e,t)=>{await this.model.setFilter(e,t)},onFiltersVisibilityChanged:e=>{this.setFiltersVisibility(e)},onHighlightNext:()=>{this.model.highlightNext()},onHighlightPrevious:()=>{this.model.highlightPrevious()},onPreserveCaseToggled:()=>{this.model.preserveCase=!this.model.preserveCase},onSearchChanged:e=>{this.model.searchExpression=e},onClose:()=>{this.close()},onReplaceEntryShown:e=>{this.setReplaceInputVisibility(e)},onReplaceChanged:e=>{this.model.replaceText=e},onReplaceCurrent:()=>{this.model.replaceCurrentMatch()},onReplaceAll:()=>{this.model.replaceAllMatches()}})}}var W=s(2549);class U{constructor(e=_.nullTranslator){this.translator=e,this._changed=new i.Signal(this),this._providerMap=new Map}add(e,t){return this._providerMap.set(e,t),this._changed.emit(),new W.DisposableDelegate((()=>{this._providerMap.delete(e),this._changed.emit()}))}getProvider(e){for(const t of this._providerMap.values())if(t.isApplicable(e))return t.createNew(e,this.translator)}hasProvider(e){for(const t of this._providerMap.values())if(t.isApplicable(e))return!0;return!1}get changed(){return this._changed}}const L=new(s(20998).Token)("@jupyterlab/documentsearch:ISearchProviderRegistry","A service for a registry of search\n providers for the application. Plugins can register their UI elements with this registry\n to provide find/replace support.")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6999],{36999:(e,t,s)=>{s.r(t),s.d(t,{FOUND_CLASSES:()=>o,GenericSearchProvider:()=>c,HTMLSearchEngine:()=>h,ISearchProviderRegistry:()=>Q,SearchDocumentModel:()=>m,SearchDocumentView:()=>W,SearchProvider:()=>n,SearchProviderRegistry:()=>U,TextSearchEngine:()=>p});var r=s(9267),i=s(81997);class n{constructor(e){this.widget=e,this._stateChanged=new i.Signal(this),this._filtersChanged=new i.Signal(this),this._disposed=!1}get stateChanged(){return this._stateChanged}get filtersChanged(){return this._filtersChanged}get currentMatchIndex(){return null}get isDisposed(){return this._disposed}get matchesCount(){return null}dispose(){this._disposed||(this._disposed=!0,i.Signal.clearData(this))}getInitialQuery(){return""}getFilters(){return{}}static preserveCase(e,t){return e.toUpperCase()===e?t.toUpperCase():e.toLowerCase()===e?t.toLowerCase():a(e)===e?a(t):t}}function a([e="",...t]){return e.toUpperCase()+""+t.join("").toLowerCase()}const o=["cm-string","cm-overlay","cm-searching"],l=["CodeMirror-selectedtext"];class h{static search(e,t){if(!(t instanceof Node))return console.warn("Unable to search with HTMLSearchEngine the provided object.",t),Promise.resolve([]);e.global||(e=new RegExp(e.source,e.flags+"g"));const s=[],r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:s=>{let r=s.parentElement;for(;r!==t;){if(r.nodeName in h.UNSUPPORTED_ELEMENTS)return NodeFilter.FILTER_REJECT;r=r.parentElement}return e.test(s.textContent)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let i=null;for(;null!==(i=r.nextNode());){e.lastIndex=0;let t=null;for(;null!==(t=e.exec(i.textContent));)s.push({text:t[0],position:t.index,node:i})}return Promise.resolve(s)}}h.UNSUPPORTED_ELEMENTS={BASE:!0,HEAD:!0,LINK:!0,META:!0,STYLE:!0,TITLE:!0,BODY:!0,AREA:!0,AUDIO:!0,IMG:!0,MAP:!0,TRACK:!0,VIDEO:!0,APPLET:!0,EMBED:!0,IFRAME:!0,NOEMBED:!0,OBJECT:!0,PARAM:!0,PICTURE:!0,SOURCE:!0,CANVAS:!0,NOSCRIPT:!0,SCRIPT:!0,SVG:!0};class c extends n{constructor(){super(...arguments),this.isReadOnly=!0,this._matches=[],this._mutationObserver=new MutationObserver(this._onWidgetChanged.bind(this)),this._markNodes=new Array}static isApplicable(e){return e instanceof r.Widget}static createNew(e,t,s){return new c(e)}get currentMatchIndex(){return this._currentMatchIndex>=0?this._currentMatchIndex:null}get currentMatch(){var e;return null!==(e=this._matches[this._currentMatchIndex])&&void 0!==e?e:null}get matches(){return this._matches?this._matches.map((e=>Object.assign({},e))):this._matches}get matchesCount(){return this._matches.length}clearHighlight(){return this._currentMatchIndex>=0&&this._markNodes[this._currentMatchIndex].classList.remove(...l),this._currentMatchIndex=-1,Promise.resolve()}dispose(){this.isDisposed||(this.endQuery().catch((e=>{console.error("Failed to end search query.",e)})),super.dispose())}async highlightNext(e){var t;return null!==(t=this._highlightNext(!1,null==e||e))&&void 0!==t?t:void 0}async highlightPrevious(e){var t;return null!==(t=this._highlightNext(!0,null==e||e))&&void 0!==t?t:void 0}async replaceCurrentMatch(e,t){return Promise.resolve(!1)}async replaceAllMatches(e){return Promise.resolve(!1)}async startQuery(e,t={}){if(await this.endQuery(),this._query=e,null===e)return Promise.resolve();const s=await h.search(e,this.widget.node);let r=0;for(;r<s.length;){let e=s[r].node,t=e.parentNode,i=[s[r]];for(;++r<s.length&&s[r].node===e;)i.unshift(s[r]);const n=i.map((s=>{const r=document.createElement("mark");r.classList.add(...o),r.textContent=s.text;const i=e.splitText(s.position);return i.textContent=i.textContent.slice(s.text.length),t.insertBefore(r,i),r}));for(let e=n.length-1;e>=0;e--)this._markNodes.push(n[e])}this._mutationObserver.observe(this.widget.node,{attributes:!1,characterData:!0,childList:!0,subtree:!0}),this._matches=s}async endQuery(){this._mutationObserver.disconnect(),this._markNodes.forEach((e=>{const t=e.parentNode;t.replaceChild(document.createTextNode(e.textContent),e),t.normalize()})),this._markNodes=[],this._matches=[],this._currentMatchIndex=-1}_highlightNext(e,t){if(0===this._matches.length)return null;if(-1===this._currentMatchIndex?this._currentMatchIndex=e?this.matches.length-1:0:(this._markNodes[this._currentMatchIndex].classList.remove(...l),this._currentMatchIndex=e?this._currentMatchIndex-1:this._currentMatchIndex+1,t&&(this._currentMatchIndex<0||this._currentMatchIndex>=this._matches.length)&&(this._currentMatchIndex=(this._currentMatchIndex+this._matches.length)%this._matches.length)),this._currentMatchIndex>=0&&this._currentMatchIndex<this._matches.length){const t=this._markNodes[this._currentMatchIndex];return t.classList.add(...l),function(e){const t=e.getBoundingClientRect();return t.top>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.left>=0&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(t)||t.scrollIntoView(e),t.focus(),this._matches[this._currentMatchIndex]}return this._currentMatchIndex=-1,null}async _onWidgetChanged(e,t){this._currentMatchIndex=-1,await this.startQuery(this._query),this._stateChanged.emit()}}const p={search(e,t){if("string"!=typeof t)try{t=JSON.stringify(t)}catch(e){return console.warn("Unable to search with TextSearchEngine non-JSON serializable object.",e,t),Promise.resolve([])}e.global||(e=new RegExp(e.source,e.flags+"g"));const s=new Array;let r=null;for(;null!==(r=e.exec(t));)s.push({text:r[0],position:r.index});return Promise.resolve(s)}};var d,u=s(90710),g=s(97934);class m extends u.VDomModel{constructor(e,t){if(super(),this.searchProvider=e,this._caseSensitive=!1,this._disposed=new i.Signal(this),this._parsingError="",this._preserveCase=!1,this._initialQuery="",this._filters={},this._replaceText="",this._searchActive=!1,this._searchExpression="",this._useRegex=!1,this._wholeWords=!1,this._filters={},this.searchProvider.getFilters){const e=this.searchProvider.getFilters();for(const t in e)this._filters[t]=e[t].default}e.stateChanged.connect(this._onProviderStateChanged,this),this._searchDebouncer=new g.Debouncer((()=>{this._updateSearch().catch((e=>{console.error("Failed to update search on document.",e)}))}),t)}get caseSensitive(){return this._caseSensitive}set caseSensitive(e){this._caseSensitive!==e&&(this._caseSensitive=e,this.stateChanged.emit(),this.refresh())}get currentIndex(){return this.searchProvider.currentMatchIndex}get disposed(){return this._disposed}get filters(){return this._filters}get filtersDefinition(){var e,t,s;return null!==(s=null===(t=(e=this.searchProvider).getFilters)||void 0===t?void 0:t.call(e))&&void 0!==s?s:{}}get filtersDefinitionChanged(){return this.searchProvider.filtersChanged||null}get initialQuery(){return this._initialQuery}set initialQuery(e){this._initialQuery=e||this._searchExpression}get suggestedInitialQuery(){return this.searchProvider.getInitialQuery()}get isReadOnly(){return this.searchProvider.isReadOnly}get replaceOptionsSupport(){return this.searchProvider.replaceOptionsSupport}get parsingError(){return this._parsingError}get preserveCase(){return this._preserveCase}set preserveCase(e){this._preserveCase!==e&&(this._preserveCase=e,this.stateChanged.emit(),this.refresh())}get replaceText(){return this._replaceText}set replaceText(e){this._replaceText!==e&&(this._replaceText=e,this.stateChanged.emit())}get searchExpression(){return this._searchExpression}set searchExpression(e){this._searchExpression!==e&&(this._searchExpression=e,this.stateChanged.emit(),this.refresh())}get totalMatches(){return this.searchProvider.matchesCount}get useRegex(){return this._useRegex}set useRegex(e){this._useRegex!==e&&(this._useRegex=e,this.stateChanged.emit(),this.refresh())}get wholeWords(){return this._wholeWords}set wholeWords(e){this._wholeWords!==e&&(this._wholeWords=e,this.stateChanged.emit(),this.refresh())}dispose(){this.isDisposed||(this._searchExpression&&this.endQuery().catch((e=>{console.error(`Failed to end query '${this._searchExpression}.`,e)})),this.searchProvider.stateChanged.disconnect(this._onProviderStateChanged,this),this._searchDebouncer.dispose(),super.dispose())}async endQuery(){this._searchActive=!1,await this.searchProvider.endQuery(),this.stateChanged.emit()}async highlightNext(){await this.searchProvider.highlightNext(),this.stateChanged.emit()}async highlightPrevious(){await this.searchProvider.highlightPrevious(),this.stateChanged.emit()}refresh(){this._searchDebouncer.invoke().catch((e=>{console.error("Failed to invoke search document debouncer.",e)}))}async replaceAllMatches(){await this.searchProvider.replaceAllMatches(this._replaceText,{preserveCase:this.preserveCase,regularExpression:this.useRegex}),this.stateChanged.emit()}async replaceCurrentMatch(){await this.searchProvider.replaceCurrentMatch(this._replaceText,!0,{preserveCase:this.preserveCase,regularExpression:this.useRegex}),this.stateChanged.emit()}async setFilter(e,t){this._filters[e]!==t&&(this.searchProvider.validateFilter?(this._filters[e]=await this.searchProvider.validateFilter(e,t),this._filters[e]===t&&(this.stateChanged.emit(),this.refresh())):(this._filters[e]=t,this.stateChanged.emit(),this.refresh()))}async _updateSearch(){this._parsingError&&(this._parsingError="",this.stateChanged.emit());try{const e=this.searchExpression?d.parseQuery(this.searchExpression,this.caseSensitive,this.useRegex,this.wholeWords):null;e&&(this._searchActive=!0,await this.searchProvider.startQuery(e,this._filters),this.stateChanged.emit())}catch(e){this._parsingError=e.toString(),this.stateChanged.emit(),console.error(`Failed to parse expression ${this.searchExpression}`,e)}}_onProviderStateChanged(){this._searchActive&&this.refresh()}}!function(e){e.parseQuery=function(e,t,s,r){const i=t?"gm":"gim";let n=s?e:e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");r&&(n="\\b"+n+"\\b");const a=new RegExp(n,i);return a.test("")?null:a}}(d||(d={}));var _=s(57356),v=s(28054),x=s(78156);const C="jp-DocumentSearch-overlay-row",E="jp-DocumentSearch-input",f="jp-DocumentSearch-input-label",y="jp-DocumentSearch-input-wrapper",S="jp-DocumentSearch-input-button-off",b="jp-DocumentSearch-input-button-on",w="jp-DocumentSearch-up-down-button",R="jp-DocumentSearch-search-filter",I="jp-DocumentSearch-replace-button",N="jp-DocumentSearch-replace-button-wrapper",T="jp-DocumentSearch-button-content",P="jp-DocumentSearch-button-wrapper";function M(e){const[t,s]=(0,x.useState)(1),r=(0,x.useCallback)((t=>{var r;const i=t?t.target:null===(r=e.inputRef)||void 0===r?void 0:r.current;if(i){const e=i.value.split(/\n/);let t=e.reduce(((e,t)=>e.length>t.length?e:t),"");i.parentNode&&i.parentNode instanceof HTMLElement&&(i.parentNode.dataset.value=t),s(e.length)}}),[]);return(0,x.useEffect)((()=>{var t,s;null===(s=null===(t=e.inputRef)||void 0===t?void 0:t.current)||void 0===s||s.select(),r()}),[e.initialValue]),x.createElement("label",{className:f},x.createElement("textarea",{onChange:t=>{e.onChange(t),r(t)},onKeyDown:t=>{e.onKeyDown(t),r(t)},rows:t,placeholder:e.placeholder,className:E,key:e.autoUpdate?e.initialValue:null,tabIndex:0,ref:e.inputRef,title:e.title,defaultValue:e.initialValue,autoFocus:e.autoFocus}))}function D(e){var t;const s=(null!==(t=e.translator)&&void 0!==t?t:_.nullTranslator).load("jupyterlab"),r=(0,u.classes)(e.caseSensitive?b:S,T),i=(0,u.classes)(e.useRegex?b:S,T),n=(0,u.classes)(e.wholeWords?b:S,T),a=y;return x.createElement("div",{className:a},x.createElement(M,{placeholder:s.__("Find"),onChange:t=>e.onChange(t),onKeyDown:t=>e.onKeydown(t),inputRef:e.inputRef,initialValue:e.initialSearchText,title:s.__("Find"),autoFocus:!0,autoUpdate:!0}),x.createElement("button",{className:P,onClick:()=>{e.onCaseSensitiveToggled()},tabIndex:0,title:s.__("Match Case")},x.createElement(u.caseSensitiveIcon.react,{className:r,tag:"span"})),x.createElement("button",{className:P,onClick:()=>e.onWordToggled(),tabIndex:0,title:s.__("Match Whole Word")},x.createElement(u.wordIcon.react,{className:n,tag:"span"})),x.createElement("button",{className:P,onClick:()=>e.onRegexToggled(),tabIndex:0,title:s.__("Use Regular Expression")},x.createElement(u.regexIcon.react,{className:i,tag:"span"})))}function F(e){var t,s,r;const i=(null!==(t=e.translator)&&void 0!==t?t:_.nullTranslator).load("jupyterlab"),n=(0,u.classes)(e.preserveCase?b:S,T);return x.createElement("div",{className:"jp-DocumentSearch-replace-wrapper-class"},x.createElement("div",{className:y},x.createElement(M,{placeholder:i.__("Replace"),initialValue:null!==(s=e.replaceText)&&void 0!==s?s:"",onKeyDown:t=>e.onReplaceKeydown(t),onChange:t=>e.onChange(t),title:i.__("Replace"),autoFocus:!1,autoUpdate:!1}),(null===(r=e.replaceOptionsSupport)||void 0===r?void 0:r.preserveCase)?x.createElement("button",{className:P,onClick:()=>e.onPreserveCaseToggled(),tabIndex:0,title:i.__("Preserve Case")},x.createElement(u.caseSensitiveIcon.react,{className:n,tag:"span"})):null),x.createElement("button",{className:N,onClick:()=>e.onReplaceCurrent(),tabIndex:0},x.createElement("span",{className:`${I} ${T}`,tabIndex:0},i.__("Replace"))),x.createElement("button",{className:N,tabIndex:0,onClick:()=>e.onReplaceAll()},x.createElement("span",{className:`${I} ${T}`,tabIndex:-1},i.__("Replace All"))))}function O(e){return x.createElement("div",{className:"jp-DocumentSearch-up-down-wrapper"},x.createElement("button",{className:P,onClick:()=>e.onHighlightPrevious(),tabIndex:0,title:e.trans.__("Previous Match")},x.createElement(u.caretUpEmptyThinIcon.react,{className:(0,u.classes)(w,T),tag:"span"})),x.createElement("button",{className:P,onClick:()=>e.onHighlightNext(),tabIndex:0,title:e.trans.__("Next Match")},x.createElement(u.caretDownEmptyThinIcon.react,{className:(0,u.classes)(w,T),tag:"span"})))}function j(e){return x.createElement("div",{className:"jp-DocumentSearch-index-counter"},0===e.totalMatches?"-/-":`${null===e.currentIndex?"-":e.currentIndex+1}/${e.totalMatches}`)}function k(e){let t=`jp-DocumentSearch-filter-button ${T}`;e.visible&&(t=`${t} jp-DocumentSearch-filter-button-enabled`);const s=e.anyEnabled?u.filterDotIcon:u.filterIcon;return x.createElement("button",{className:P,onClick:()=>e.toggleVisible(),tabIndex:0,title:e.visible?e.trans.__("Hide Search Filters"):e.trans.__("Show Search Filters")},x.createElement(s.react,{className:t,tag:"span",height:"20px",width:"20px"}))}function A(e){return x.createElement("label",{className:e.isEnabled?R:`${R} jp-DocumentSearch-search-filter-disabled`,title:e.description},x.createElement("input",{type:"checkbox",className:"jp-mod-styled",disabled:!e.isEnabled,checked:e.value,onChange:e.onToggle}),e.title)}class V extends x.Component{constructor(e){super(e),this.translator=e.translator||_.nullTranslator}_onSearchChange(e){const t=e.target.value;this.props.onSearchChanged(t)}_onSearchKeydown(e){if(13===e.keyCode)if(e.stopPropagation(),e.preventDefault(),e.ctrlKey){const t=e.target;this._insertNewLine(t),this.props.onSearchChanged(t.value)}else e.shiftKey?this.props.onHighlightPrevious():this.props.onHighlightNext()}_onReplaceKeydown(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault(),e.ctrlKey?this._insertNewLine(e.target):this.props.onReplaceCurrent())}_insertNewLine(e){const[t,s]=[e.selectionStart,e.selectionEnd];e.setRangeText("\n",t,s,"end")}_onClose(){this.props.onClose()}_onReplaceToggled(){if(!this.props.replaceEntryVisible)for(const e in this.props.filtersDefinition){const t=this.props.filtersDefinition[e];t.supportReplace||this.props.onFilterChanged(e,!1).catch((e=>{console.error(`Fail to update filter value for ${t.title}:\n${e}`)}))}this.props.onReplaceEntryShown(!this.props.replaceEntryVisible)}_toggleFiltersVisibility(){this.props.onFiltersVisibilityChanged(!this.props.filtersVisible)}render(){var e;const t=this.translator.load("jupyterlab"),s=!this.props.isReadOnly&&this.props.replaceEntryVisible,r=this.props.filtersDefinition,i=Object.keys(r).length>0,n=i?x.createElement(k,{visible:this.props.filtersVisible,anyEnabled:Object.keys(r).some((e=>{var t;const s=r[e];return null!==(t=this.props.filters[e])&&void 0!==t?t:s.default})),toggleVisible:()=>this._toggleFiltersVisibility(),trans:t}):null,a=i?x.createElement("div",{className:"jp-DocumentSearch-search-options"},Object.keys(r).map((e=>{var t;const i=r[e];return x.createElement(A,{key:e,title:i.title,description:i.description,isEnabled:!s||i.supportReplace,onToggle:async()=>{await this.props.onFilterChanged(e,!this.props.filters[e])},value:null!==(t=this.props.filters[e])&&void 0!==t?t:i.default})}))):null,o=this.props.replaceEntryVisible?u.caretDownIcon:u.caretRightIcon;return x.createElement(x.Fragment,null,x.createElement("div",{className:C},this.props.isReadOnly?x.createElement("div",{className:"jp-DocumentSearch-toggle-placeholder"}):x.createElement("button",{className:"jp-DocumentSearch-toggle-wrapper",onClick:()=>this._onReplaceToggled(),tabIndex:0,title:t.__("Toggle Replace")},x.createElement(o.react,{className:`jp-DocumentSearch-replace-toggle ${T}`,tag:"span",elementPosition:"center",height:"20px",width:"20px"})),x.createElement(D,{inputRef:this.props.searchInputRef,useRegex:this.props.useRegex,caseSensitive:this.props.caseSensitive,wholeWords:this.props.wholeWords,onCaseSensitiveToggled:this.props.onCaseSensitiveToggled,onRegexToggled:this.props.onRegexToggled,onWordToggled:this.props.onWordToggled,onKeydown:e=>this._onSearchKeydown(e),onChange:e=>this._onSearchChange(e),initialSearchText:this.props.initialSearchText,translator:this.translator}),n,x.createElement(j,{currentIndex:this.props.currentIndex,totalMatches:null!==(e=this.props.totalMatches)&&void 0!==e?e:0}),x.createElement(O,{onHighlightPrevious:()=>{this.props.onHighlightPrevious()},onHighlightNext:()=>{this.props.onHighlightNext()},trans:t}),x.createElement("button",{className:P,onClick:()=>this._onClose(),tabIndex:0},x.createElement(u.closeIcon.react,{className:"jp-icon-hover",elementPosition:"center",height:"16px",width:"16px"}))),x.createElement("div",{className:C},s?x.createElement(x.Fragment,null,x.createElement(F,{onPreserveCaseToggled:this.props.onPreserveCaseToggled,onReplaceKeydown:e=>this._onReplaceKeydown(e),onChange:e=>this.props.onReplaceChanged(e.target.value),onReplaceCurrent:()=>this.props.onReplaceCurrent(),onReplaceAll:()=>this.props.onReplaceAll(),replaceOptionsSupport:this.props.replaceOptionsSupport,replaceText:this.props.replaceText,preserveCase:this.props.preserveCase,translator:this.translator}),x.createElement("div",{className:"jp-DocumentSearch-spacer"})):null),this.props.filtersVisible?a:null,!!this.props.errorMessage&&x.createElement("div",{className:"jp-DocumentSearch-regex-error"},this.props.errorMessage))}}class W extends u.VDomRenderer{constructor(e,t){super(e),this.translator=t,this._showReplace=!1,this._showFilters=!1,this._closed=new i.Signal(this),this.addClass("jp-DocumentSearch-overlay"),this._searchInput=x.createRef()}get closed(){return this._closed}focusSearchInput(){var e;null===(e=this._searchInput.current)||void 0===e||e.select()}setSearchText(e){this.model.initialQuery=e,e&&(this.model.searchExpression=e)}setReplaceText(e){this.model.replaceText=e}showReplace(){this.setReplaceInputVisibility(!0)}onCloseRequest(e){super.onCloseRequest(e),this._closed.emit(),this.model.endQuery()}setReplaceInputVisibility(e){this._showReplace!==e&&(this._showReplace=e,this.update())}setFiltersVisibility(e){this._showFilters!==e&&(this._showFilters=e,this.update())}render(){return this.model.filtersDefinitionChanged?x.createElement(v.UseSignal,{signal:this.model.filtersDefinitionChanged},(()=>this._renderOverlay())):this._renderOverlay()}_renderOverlay(){return x.createElement(V,{caseSensitive:this.model.caseSensitive,currentIndex:this.model.currentIndex,isReadOnly:this.model.isReadOnly,errorMessage:this.model.parsingError,filters:this.model.filters,filtersDefinition:this.model.filtersDefinition,preserveCase:this.model.preserveCase,replaceEntryVisible:this._showReplace,filtersVisible:this._showFilters,replaceOptionsSupport:this.model.replaceOptionsSupport,replaceText:this.model.replaceText,initialSearchText:this.model.initialQuery,searchInputRef:this._searchInput,totalMatches:this.model.totalMatches,translator:this.translator,useRegex:this.model.useRegex,wholeWords:this.model.wholeWords,onCaseSensitiveToggled:()=>{this.model.caseSensitive=!this.model.caseSensitive},onRegexToggled:()=>{this.model.useRegex=!this.model.useRegex},onWordToggled:()=>{this.model.wholeWords=!this.model.wholeWords},onFilterChanged:async(e,t)=>{await this.model.setFilter(e,t)},onFiltersVisibilityChanged:e=>{this.setFiltersVisibility(e)},onHighlightNext:()=>{this.model.highlightNext()},onHighlightPrevious:()=>{this.model.highlightPrevious()},onPreserveCaseToggled:()=>{this.model.preserveCase=!this.model.preserveCase},onSearchChanged:e=>{this.model.searchExpression=e},onClose:()=>{this.close()},onReplaceEntryShown:e=>{this.setReplaceInputVisibility(e)},onReplaceChanged:e=>{this.model.replaceText=e},onReplaceCurrent:()=>{this.model.replaceCurrentMatch()},onReplaceAll:()=>{this.model.replaceAllMatches()}})}}var L=s(2549);class U{constructor(e=_.nullTranslator){this.translator=e,this._changed=new i.Signal(this),this._providerMap=new Map}add(e,t){return this._providerMap.set(e,t),this._changed.emit(),new L.DisposableDelegate((()=>{this._providerMap.delete(e),this._changed.emit()}))}getProvider(e){for(const t of this._providerMap.values())if(t.isApplicable(e))return t.createNew(e,this.translator)}hasProvider(e){for(const t of this._providerMap.values())if(t.isApplicable(e))return!0;return!1}get changed(){return this._changed}}const Q=new(s(20998).Token)("@jupyterlab/documentsearch:ISearchProviderRegistry","A service for a registry of search\n providers for the application. Plugins can register their UI elements with this registry\n to provide find/replace support.")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7226],{47226:(t,e,s)=>{s.r(e),s.d(e,{OutputArea:()=>x,OutputAreaModel:()=>d,OutputPrompt:()=>w,SimplifiedOutputArea:()=>O,Stdin:()=>v});var i,n=s(11964),r=s(97031),a=s(42628),o=s(33625),h=s(20998),u=s(81997);class d{constructor(t={}){if(this.clearNext=!1,this._lastStream="",this._trusted=!1,this._isDisposed=!1,this._stateChanged=new u.Signal(this),this._changed=new u.Signal(this),this._trusted=!!t.trusted,this.contentFactory=t.contentFactory||d.defaultContentFactory,this.list=new r.ObservableList,t.values)for(const e of t.values){const t=this._add(e)-1;this.list.get(t).changed.connect(this._onGenericChange,this)}this.list.changed.connect(this._onListChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get length(){return this.list?this.list.length:0}get trusted(){return this._trusted}set trusted(t){if(t===this._trusted)return;const e=this._trusted=t;for(let t=0;t<this.list.length;t++){const s=this.list.get(t),i=s.toJSON(),n=this._createItem({value:i,trusted:e});this.list.set(t,n),s.dispose()}}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.list.dispose(),u.Signal.clearData(this))}get(t){return this.list.get(t)}set(t,e){e=h.JSONExt.deepCopy(e),i.normalize(e);const s=this._createItem({value:e,trusted:this._trusted});this.list.set(t,s)}add(t){return this.clearNext&&(this.clear(),this.clearNext=!1),this._add(t)}clear(t=!1){if(this._lastStream="",t)this.clearNext=!0;else{for(const t of this.list)t.dispose();this.list.clear()}}fromJSON(t){this.clear();for(const e of t)this._add(e)}toJSON(){return Array.from((0,o.map)(this.list,(t=>t.toJSON())))}_add(t){const e=this._trusted;if(t=h.JSONExt.deepCopy(t),i.normalize(t),n.isStream(t)&&this._lastStream&&t.name===this._lastName&&this.shouldCombine({value:t,lastModel:this.list.get(this.length-1)})){this._lastStream+=t.text,this._lastStream=i.removeOverwrittenChars(this._lastStream),t.text=this._lastStream;const s=this._createItem({value:t,trusted:e}),n=this.length-1,r=this.list.get(n);return this.list.set(n,s),r.dispose(),this.length}n.isStream(t)&&(t.text=i.removeOverwrittenChars(t.text));const s=this._createItem({value:t,trusted:e});return n.isStream(t)?(this._lastStream=t.text,this._lastName=t.name):this._lastStream="",this.list.push(s)}shouldCombine(t){return!0}_createItem(t){return this.contentFactory.createOutputModel(t)}_onListChanged(t,e){switch(e.type){case"add":e.newValues.forEach((t=>{t.changed.connect(this._onGenericChange,this)}));break;case"remove":e.oldValues.forEach((t=>{t.changed.disconnect(this._onGenericChange,this)}));break;case"set":e.newValues.forEach((t=>{t.changed.connect(this._onGenericChange,this)})),e.oldValues.forEach((t=>{t.changed.disconnect(this._onGenericChange,this)}))}this._changed.emit(e)}_onGenericChange(t){let e,s=null;for(e=0;e<this.list.length&&(s=this.list.get(e),s!==t);e++);null!=s&&(this._stateChanged.emit(e),this._changed.emit({type:"set",newIndex:e,oldIndex:e,oldValues:[s],newValues:[s]}))}}!function(t){class e{createOutputModel(t){return new a.OutputModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(d||(d={})),function(t){t.normalize=function(t){n.isStream(t)&&Array.isArray(t.text)&&(t.text=t.text.join("\n"))},t.removeOverwrittenChars=function(t){return function(t){for(t=t.replace(/\r+\n/gm,"\n");t.search(/\r[^$]/g)>-1;){const e=t.match(/^(.*)\r+/m)[1];let s=t.match(/\r+(.*)$/m)[1];s+=e.slice(s.length,e.length),t=t.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,s)}return t}(function(t){let e=t;do{e=(t=e).replace(/[^\n]\x08/gm,"")}while(e.length<t.length);return t}(t))}}(i||(i={}));var l=s(56165),c=s(27038),p=s(49255),m=s(14421),_=s(9267);const g="jp-OutputArea-child",y="jp-OutputArea-output",f="jp-OutputArea-prompt";class x extends _.Widget{constructor(t){var e,s,i,n;super(),this.outputLengthChanged=new u.Signal(this),this._onIOPub=t=>{const e=this.model,s=t.header.msg_type;let i;const n=(t.content.transient||{}).display_id;let r;switch(s){case"execute_result":case"display_data":case"stream":case"error":i={...t.content,output_type:s},e.add(i);break;case"clear_output":{const s=t.content.wait;e.clear(s);break}case"update_display_data":if(i={...t.content,output_type:"display_data"},r=this._displayIdMap.get(n),r)for(const t of r)e.set(t,i)}n&&"display_data"===s&&(r=this._displayIdMap.get(n)||[],r.push(e.length-1),this._displayIdMap.set(n,r))},this._onExecuteReply=t=>{const e=this.model,s=t.content;if("ok"!==s.status)return;const i=s&&s.payload;if(!i||!i.length)return;const n=i.filter((t=>"page"===t.source));if(!n.length)return;const r={output_type:"display_data",data:JSON.parse(JSON.stringify(n[0])).data,metadata:{}};e.add(r)},this._displayIdMap=new Map,this._minHeightTimeout=null,this._inputRequested=new u.Signal(this),this._toggleScrolling=new u.Signal(this),this._outputTracker=new l.WidgetTracker({namespace:h.UUID.uuid4()}),this._inputHistoryScope="global",super.layout=new _.PanelLayout,this.addClass("jp-OutputArea"),this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:x.defaultContentFactory,this.rendermime=t.rendermime,this._maxNumberOutputs=null!==(s=t.maxNumberOutputs)&&void 0!==s?s:1/0,this._translator=null!==(i=t.translator)&&void 0!==i?i:p.nullTranslator,this._inputHistoryScope=null!==(n=t.inputHistoryScope)&&void 0!==n?n:"global";const r=this.model=t.model;for(let t=0;t<Math.min(r.length,this._maxNumberOutputs+1);t++){const e=r.get(t);this._insertOutput(t,e)}r.changed.connect(this.onModelChanged,this),r.stateChanged.connect(this.onStateChanged,this),t.promptOverlay&&this._addPromptOverlay()}get layout(){return super.layout}get widgets(){return this.layout.widgets}get future(){return this._future}set future(t){if(this.model.isDisposed)throw Error("Model is disposed");this._future!==t&&(this._future&&this._future.dispose(),this._future=t,this.model.clear(),this.widgets.length&&(this._clear(),this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))),t.onIOPub=this._onIOPub,t.onReply=this._onExecuteReply,t.onStdin=e=>{c.KernelMessage.isInputRequestMsg(e)&&this.onInputRequest(e,t)})}get inputRequested(){return this._inputRequested}get maxNumberOutputs(){return this._maxNumberOutputs}set maxNumberOutputs(t){if(t<=0)return void console.warn("OutputArea.maxNumberOutputs must be strictly positive.");const e=this._maxNumberOutputs;this._maxNumberOutputs=t,e<t&&this._showTrimmedOutputs(e)}dispose(){this._future&&(this._future.dispose(),this._future=null),this._displayIdMap.clear(),this._outputTracker.dispose(),super.dispose()}onModelChanged(t,e){switch(e.type){case"add":this._insertOutput(e.newIndex,e.newValues[0]);break;case"remove":if(this.widgets.length)if(0===this.model.length)this._clear();else{const t=e.oldIndex;for(let s=0;s<e.oldValues.length&&t<this.widgets.length;++s){const e=this.widgets[t];e.parent=null,e.dispose()}this._moveDisplayIdIndices(t,e.oldValues.length),this._preventHeightChangeJitter()}break;case"set":this._setOutput(e.newIndex,e.newValues[0])}this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}get toggleScrolling(){return this._toggleScrolling}_addPromptOverlay(){const t=document.createElement("div");t.className="jp-OutputArea-promptOverlay";const e=this._translator.load("jupyterlab");t.title=e.__("Toggle output scrolling"),t.addEventListener("click",(()=>{this._toggleScrolling.emit()})),this.node.appendChild(t)}_moveDisplayIdIndices(t,e){this._displayIdMap.forEach((s=>{const i=t+e;for(let n=s.length-1;n>=0;--n){const r=s[n];r>=t&&r<i?s.splice(n,1):r>=i&&(s[n]-=e)}}))}onStateChanged(t,e){const s=Math.min(this.model.length,this._maxNumberOutputs);if(e){if(e>=this._maxNumberOutputs)return;this._setOutput(e,this.model.get(e))}else for(let t=0;t<s;t++)this._setOutput(t,this.model.get(t));this.outputLengthChanged.emit(s)}_clear(){if(!this.widgets.length)return;const t=this.widgets.length;for(let e=0;e<t;e++){const t=this.widgets[0];t.parent=null,t.dispose()}this._displayIdMap.clear(),this._preventHeightChangeJitter()}_preventHeightChangeJitter(){const t=this.node.getBoundingClientRect();this.node.style.minHeight=`${t.height}px`,this._minHeightTimeout&&window.clearTimeout(this._minHeightTimeout),this._minHeightTimeout=window.setTimeout((()=>{this.isDisposed||(this.node.style.minHeight="")}),50)}onInputRequest(t,e){const s=this.contentFactory,i=t.content.prompt,n=t.content.password,r=new _.Panel;r.addClass(g),r.addClass("jp-OutputArea-stdin-item");const a=s.createOutputPrompt();a.addClass(f),r.addWidget(a);const o=s.createStdin({parent_header:t.header,prompt:i,password:n,future:e,translator:this._translator,inputHistoryScope:this._inputHistoryScope});o.addClass(y),r.addWidget(o),this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length),this.layout.addWidget(r),this._inputRequested.emit(),o.value.then((t=>{this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length+1),this.model.add({output_type:"stream",name:"stdin",text:t+"\n"}),r.dispose()}))}_setOutput(t,e){if(t>=this._maxNumberOutputs)return;const s=this.layout.widgets[t],i=s.widgets?s.widgets[1]:s,n=this.rendermime.preferredMimeType(e.data,e.trusted?"any":"ensure");C.currentPreferredMimetype.get(i)===n&&x.isIsolated(n,e.metadata)===i instanceof C.IsolatedRenderer?i.renderModel(e):(this.layout.widgets[t].dispose(),this._insertOutput(t,e))}_insertOutput(t,e){if(t>this._maxNumberOutputs)return;const s=this.layout;if(t===this._maxNumberOutputs){const e=new C.TrimmedOutputs(this._maxNumberOutputs,(()=>{const t=this._maxNumberOutputs;this._maxNumberOutputs=1/0,this._showTrimmedOutputs(t)}));s.insertWidget(t,this._wrappedOutput(e))}else{let i=this.createOutputItem(e);i?i.toggleClass("jp-OutputArea-executeResult",null!==e.executionCount):i=new _.Widget,this._outputTracker.has(i)||this._outputTracker.add(i),s.insertWidget(t,i)}}get outputTracker(){return this._outputTracker}_showTrimmedOutputs(t){this.widgets[t].dispose();for(let e=t;e<this.model.length;e++)this._insertOutput(e,this.model.get(e));this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}createOutputItem(t){const e=this.createRenderedMimetype(t);return e?this._wrappedOutput(e,t.executionCount):null}createRenderedMimetype(t){const e=this.rendermime.preferredMimeType(t.data,t.trusted?"any":"ensure");if(!e)return null;let s=this.rendermime.createRenderer(e);return!0===x.isIsolated(e,t.metadata)&&(s=new C.IsolatedRenderer(s)),C.currentPreferredMimetype.set(s,e),s.renderModel(t).catch((t=>{const e=document.createElement("pre"),i=this._translator.load("jupyterlab");e.textContent=i.__("Javascript Error: %1",t.message),s.node.appendChild(e),s.node.className="lm-Widget jp-RenderedText",s.node.setAttribute("data-mime-type","application/vnd.jupyter.stderr")})),s}_wrappedOutput(t,e=null){const s=new C.OutputPanel;s.addClass(g);const i=this.contentFactory.createOutputPrompt();return i.executionCount=e,i.addClass(f),s.addWidget(i),t.addClass(y),s.addWidget(t),s}}class O extends x{onInputRequest(t,e){}createOutputItem(t){const e=this.createRenderedMimetype(t);if(!e)return null;const s=new C.OutputPanel;return s.addClass(g),e.addClass(y),s.addWidget(e),s}}!function(t){t.execute=async function(t,e,s,i){var n;let r=!0;i&&Array.isArray(i.tags)&&-1!==i.tags.indexOf("raises-exception")&&(r=!1);const a={code:t,stop_on_error:r},o=null===(n=s.session)||void 0===n?void 0:n.kernel;if(!o)throw new Error("Session has no kernel.");const h=o.requestExecute(a,!1,i);return e.future=h,h.done},t.isIsolated=function(t,e){const s=e[t];return s&&void 0!==s.isolated?!!s.isolated:!!e.isolated};class e{createOutputPrompt(){return new w}createStdin(t){return new v(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(x||(x={}));class w extends _.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-OutputPrompt")}get executionCount(){return this._executionCount}set executionCount(t){this._executionCount=t,this.node.textContent=null===t?"":`[${t}]:`}}class v extends _.Widget{static _historyIx(t,e){const s=v._history.get(t);if(!s)return;const i=s.length;return e<=0?i+e:void 0}static _historyAt(t,e){const s=v._history.get(t);if(!s)return;const i=s.length,n=v._historyIx(t,e);return void 0!==n&&n<i?s[n]:void 0}static _historyPush(t,e){const s=v._history.get(t);s.push(e),s.length>1e3&&s.shift()}static _historySearch(t,e,s,i=!0){const n=v._history.get(t),r=n.length,a=v._historyIx(t,s),o=t=>-1!==t.search(e);if(void 0!==a)if(i){if(0===a)return;const t=n.slice(0,a).findLastIndex(o);if(-1!==t)return t-r}else{if(a>=r-1)return;const t=n.slice(a+1).findIndex(o);if(-1!==t)return t-r+a+1}}constructor(t){var e;super({node:C.createInputWidgetNode(t.prompt,t.password)}),this._promise=new h.PromiseDelegate,this.addClass("jp-Stdin"),this._future=t.future,this._historyIndex=0,this._historyKey="session"===t.inputHistoryScope?t.parent_header.session:"",this._historyPat="",this._parentHeader=t.parent_header,this._password=t.password,this._trans=(null!==(e=t.translator)&&void 0!==e?e:p.nullTranslator).load("jupyterlab"),this._value=t.prompt+" ",this._input=this.node.getElementsByTagName("input")[0],this._input.placeholder=this._trans.__("↑↓ for history. Search history with c-↑/c-↓"),v._history.has(this._historyKey)||v._history.set(this._historyKey,[])}get value(){return this._promise.promise.then((()=>this._value))}handleEvent(t){const e=this._input;if("keydown"===t.type)if("Enter"===t.key)this.resetSearch(),this._future.sendInputReply({status:"ok",value:e.value},this._parentHeader),this._password?this._value+="········":(this._value+=e.value,v._historyPush(this._historyKey,e.value)),this._promise.resolve(void 0);else if("Escape"===t.key)this.resetSearch(),e.blur();else if(!t.ctrlKey||"ArrowUp"!==t.key&&"ArrowDown"!==t.key){if("ArrowUp"===t.key){this.resetSearch();const s=v._historyAt(this._historyKey,this._historyIndex-1);s&&(0===this._historyIndex&&(this._valueCache=e.value),this._setInputValue(s),--this._historyIndex,t.preventDefault())}else if("ArrowDown"===t.key)if(this.resetSearch(),0===this._historyIndex);else if(-1===this._historyIndex)this._setInputValue(this._valueCache),++this._historyIndex;else{const t=v._historyAt(this._historyKey,this._historyIndex+1);t&&(this._setInputValue(t),++this._historyIndex)}}else{""===this._historyPat&&(this._historyPat=e.value);const s="ArrowUp"===t.key,i=v._historySearch(this._historyKey,this._historyPat,this._historyIndex,s);if(void 0!==i){const s=v._historyAt(this._historyKey,i);void 0!==s&&(0===this._historyIndex&&(this._valueCache=e.value),this._setInputValue(s),this._historyIndex=i,t.preventDefault())}}}resetSearch(){this._historyPat=""}onAfterAttach(t){this._input.addEventListener("keydown",this),this._input.focus()}onBeforeDetach(t){this._input.removeEventListener("keydown",this)}_setInputValue(t){this._input.value=t,this._input.setSelectionRange(t.length,t.length)}}var C;v._history=new Map,function(t){t.createInputWidgetNode=function(t,e){const s=document.createElement("div"),i=document.createElement("pre");i.className="jp-Stdin-prompt",i.textContent=t;const n=document.createElement("input");return n.className="jp-Stdin-input",e&&(n.type="password"),s.appendChild(i),i.appendChild(n),s};class e extends _.Widget{constructor(t){super({node:document.createElement("iframe")}),this.addClass("jp-mod-isolated"),this._wrapped=t;const e=this.node;e.frameBorder="0",e.scrolling="auto",e.addEventListener("load",(()=>{e.contentDocument.open(),e.contentDocument.write(this._wrapped.node.innerHTML),e.contentDocument.close();const t=e.contentDocument.body;e.style.height=`${t.scrollHeight}px`,e.heightChangeObserver=new ResizeObserver((()=>{e.style.height=`${t.scrollHeight}px`})),e.heightChangeObserver.observe(t)}))}renderModel(t){return this._wrapped.renderModel(t)}}t.IsolatedRenderer=e,t.currentPreferredMimetype=new m.AttachedProperty({name:"preferredMimetype",create:t=>""});class s extends _.Panel{constructor(t){super(t)}_onContext(t){this.node.focus()}onAfterAttach(t){super.onAfterAttach(t),this.node.addEventListener("contextmenu",this._onContext.bind(this))}onBeforeDetach(t){super.onAfterDetach(t),this.node.removeEventListener("contextmenu",this._onContext.bind(this))}}t.OutputPanel=s;class i extends _.Widget{constructor(t,e){const s=document.createElement("div"),i=`The first ${t} are displayed`;s.insertAdjacentHTML("afterbegin",`<a title=${i}>\n <pre>Show more outputs</pre>\n </a>`),super({node:s}),this._onClick=e,this.addClass("jp-TrimmedOutputs"),this.addClass("jp-RenderedHTMLCommon")}handleEvent(t){"click"===t.type&&this._onClick(t)}onAfterAttach(t){super.onAfterAttach(t),this.node.addEventListener("click",this)}onBeforeDetach(t){super.onBeforeDetach(t),this.node.removeEventListener("click",this)}}t.TrimmedOutputs=i}(C||(C={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7226],{47226:(t,e,s)=>{s.r(e),s.d(e,{OutputArea:()=>x,OutputAreaModel:()=>d,OutputPrompt:()=>w,SimplifiedOutputArea:()=>v,Stdin:()=>O});var i,n=s(47891),r=s(7437),a=s(39401),o=s(33625),h=s(20998),u=s(81997);class d{constructor(t={}){if(this.clearNext=!1,this._lastStream="",this._trusted=!1,this._isDisposed=!1,this._stateChanged=new u.Signal(this),this._changed=new u.Signal(this),this._trusted=!!t.trusted,this.contentFactory=t.contentFactory||d.defaultContentFactory,this.list=new r.ObservableList,t.values)for(const e of t.values){const t=this._add(e)-1;this.list.get(t).changed.connect(this._onGenericChange,this)}this.list.changed.connect(this._onListChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get length(){return this.list?this.list.length:0}get trusted(){return this._trusted}set trusted(t){if(t===this._trusted)return;const e=this._trusted=t;for(let t=0;t<this.list.length;t++){const s=this.list.get(t),i=s.toJSON(),n=this._createItem({value:i,trusted:e});this.list.set(t,n),s.dispose()}}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this.list.dispose(),u.Signal.clearData(this))}get(t){return this.list.get(t)}set(t,e){e=h.JSONExt.deepCopy(e),i.normalize(e);const s=this._createItem({value:e,trusted:this._trusted});this.list.set(t,s)}add(t){return this.clearNext&&(this.clear(),this.clearNext=!1),this._add(t)}clear(t=!1){if(this._lastStream="",t)this.clearNext=!0;else{for(const t of this.list)t.dispose();this.list.clear()}}fromJSON(t){this.clear();for(const e of t)this._add(e)}toJSON(){return Array.from((0,o.map)(this.list,(t=>t.toJSON())))}_add(t){const e=this._trusted;if(t=h.JSONExt.deepCopy(t),i.normalize(t),n.isStream(t)&&this._lastStream&&t.name===this._lastName&&this.shouldCombine({value:t,lastModel:this.list.get(this.length-1)})){this._lastStream+=t.text,this._lastStream=i.removeOverwrittenChars(this._lastStream),t.text=this._lastStream;const s=this._createItem({value:t,trusted:e}),n=this.length-1,r=this.list.get(n);return this.list.set(n,s),r.dispose(),this.length}n.isStream(t)&&(t.text=i.removeOverwrittenChars(t.text));const s=this._createItem({value:t,trusted:e});return n.isStream(t)?(this._lastStream=t.text,this._lastName=t.name):this._lastStream="",this.list.push(s)}shouldCombine(t){return!0}_createItem(t){return this.contentFactory.createOutputModel(t)}_onListChanged(t,e){switch(e.type){case"add":e.newValues.forEach((t=>{t.changed.connect(this._onGenericChange,this)}));break;case"remove":e.oldValues.forEach((t=>{t.changed.disconnect(this._onGenericChange,this)}));break;case"set":e.newValues.forEach((t=>{t.changed.connect(this._onGenericChange,this)})),e.oldValues.forEach((t=>{t.changed.disconnect(this._onGenericChange,this)}))}this._changed.emit(e)}_onGenericChange(t){let e,s=null;for(e=0;e<this.list.length&&(s=this.list.get(e),s!==t);e++);null!=s&&(this._stateChanged.emit(e),this._changed.emit({type:"set",newIndex:e,oldIndex:e,oldValues:[s],newValues:[s]}))}}!function(t){class e{createOutputModel(t){return new a.OutputModel(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(d||(d={})),function(t){t.normalize=function(t){n.isStream(t)&&Array.isArray(t.text)&&(t.text=t.text.join("\n"))},t.removeOverwrittenChars=function(t){return function(t){for(t=t.replace(/\r+\n/gm,"\n");t.search(/\r[^$]/g)>-1;){const e=t.match(/^(.*)\r+/m)[1];let s=t.match(/\r+(.*)$/m)[1];s+=e.slice(s.length,e.length),t=t.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,s)}return t}(function(t){let e=t;do{e=(t=e).replace(/[^\n]\x08/gm,"")}while(e.length<t.length);return t}(t))}}(i||(i={}));var l=s(28054),c=s(52124),p=s(57356),m=s(14421),_=s(9267);const g="jp-OutputArea-child",y="jp-OutputArea-output",f="jp-OutputArea-prompt";class x extends _.Widget{constructor(t){var e,s,i,n;super(),this.outputLengthChanged=new u.Signal(this),this._onIOPub=t=>{const e=this.model,s=t.header.msg_type;let i;const n=(t.content.transient||{}).display_id;let r;switch(s){case"execute_result":case"display_data":case"stream":case"error":i={...t.content,output_type:s},e.add(i);break;case"clear_output":{const s=t.content.wait;e.clear(s);break}case"update_display_data":if(i={...t.content,output_type:"display_data"},r=this._displayIdMap.get(n),r)for(const t of r)e.set(t,i)}n&&"display_data"===s&&(r=this._displayIdMap.get(n)||[],r.push(e.length-1),this._displayIdMap.set(n,r))},this._onExecuteReply=t=>{const e=this.model,s=t.content;if("ok"!==s.status)return;const i=s&&s.payload;if(!i||!i.length)return;const n=i.filter((t=>"page"===t.source));if(!n.length)return;const r={output_type:"display_data",data:JSON.parse(JSON.stringify(n[0])).data,metadata:{}};e.add(r)},this._displayIdMap=new Map,this._minHeightTimeout=null,this._inputRequested=new u.Signal(this),this._toggleScrolling=new u.Signal(this),this._outputTracker=new l.WidgetTracker({namespace:h.UUID.uuid4()}),this._inputHistoryScope="global",super.layout=new _.PanelLayout,this.addClass("jp-OutputArea"),this.contentFactory=null!==(e=t.contentFactory)&&void 0!==e?e:x.defaultContentFactory,this.rendermime=t.rendermime,this._maxNumberOutputs=null!==(s=t.maxNumberOutputs)&&void 0!==s?s:1/0,this._translator=null!==(i=t.translator)&&void 0!==i?i:p.nullTranslator,this._inputHistoryScope=null!==(n=t.inputHistoryScope)&&void 0!==n?n:"global";const r=this.model=t.model;for(let t=0;t<Math.min(r.length,this._maxNumberOutputs+1);t++){const e=r.get(t);this._insertOutput(t,e)}r.changed.connect(this.onModelChanged,this),r.stateChanged.connect(this.onStateChanged,this),t.promptOverlay&&this._addPromptOverlay()}get layout(){return super.layout}get widgets(){return this.layout.widgets}get future(){return this._future}set future(t){if(this.model.isDisposed)throw Error("Model is disposed");this._future!==t&&(this._future&&this._future.dispose(),this._future=t,this.model.clear(),this.widgets.length&&(this._clear(),this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))),t.onIOPub=this._onIOPub,t.onReply=this._onExecuteReply,t.onStdin=e=>{c.KernelMessage.isInputRequestMsg(e)&&this.onInputRequest(e,t)})}get inputRequested(){return this._inputRequested}get maxNumberOutputs(){return this._maxNumberOutputs}set maxNumberOutputs(t){if(t<=0)return void console.warn("OutputArea.maxNumberOutputs must be strictly positive.");const e=this._maxNumberOutputs;this._maxNumberOutputs=t,e<t&&this._showTrimmedOutputs(e)}dispose(){this._future&&(this._future.dispose(),this._future=null),this._displayIdMap.clear(),this._outputTracker.dispose(),super.dispose()}onModelChanged(t,e){switch(e.type){case"add":this._insertOutput(e.newIndex,e.newValues[0]);break;case"remove":if(this.widgets.length)if(0===this.model.length)this._clear();else{const t=e.oldIndex;for(let s=0;s<e.oldValues.length&&t<this.widgets.length;++s){const e=this.widgets[t];e.parent=null,e.dispose()}this._moveDisplayIdIndices(t,e.oldValues.length),this._preventHeightChangeJitter()}break;case"set":this._setOutput(e.newIndex,e.newValues[0])}this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}get toggleScrolling(){return this._toggleScrolling}_addPromptOverlay(){const t=document.createElement("div");t.className="jp-OutputArea-promptOverlay";const e=this._translator.load("jupyterlab");t.title=e.__("Toggle output scrolling"),t.addEventListener("click",(()=>{this._toggleScrolling.emit()})),this.node.appendChild(t)}_moveDisplayIdIndices(t,e){this._displayIdMap.forEach((s=>{const i=t+e;for(let n=s.length-1;n>=0;--n){const r=s[n];r>=t&&r<i?s.splice(n,1):r>=i&&(s[n]-=e)}}))}onStateChanged(t,e){const s=Math.min(this.model.length,this._maxNumberOutputs);if(e){if(e>=this._maxNumberOutputs)return;this._setOutput(e,this.model.get(e))}else for(let t=0;t<s;t++)this._setOutput(t,this.model.get(t));this.outputLengthChanged.emit(s)}_clear(){if(!this.widgets.length)return;const t=this.widgets.length;for(let e=0;e<t;e++){const t=this.widgets[0];t.parent=null,t.dispose()}this._displayIdMap.clear(),this._preventHeightChangeJitter()}_preventHeightChangeJitter(){const t=this.node.getBoundingClientRect();this.node.style.minHeight=`${t.height}px`,this._minHeightTimeout&&window.clearTimeout(this._minHeightTimeout),this._minHeightTimeout=window.setTimeout((()=>{this.isDisposed||(this.node.style.minHeight="")}),50)}onInputRequest(t,e){const s=this.contentFactory,i=t.content.prompt,n=t.content.password,r=new _.Panel;r.addClass(g),r.addClass("jp-OutputArea-stdin-item");const a=s.createOutputPrompt();a.addClass(f),r.addWidget(a);const o=s.createStdin({parent_header:t.header,prompt:i,password:n,future:e,translator:this._translator,inputHistoryScope:this._inputHistoryScope});o.addClass(y),r.addWidget(o),this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length),this._inputRequested.emit();const h=o.node.getElementsByTagName("input")[0];o.value.then((t=>{this.model.length>=this.maxNumberOutputs&&(this.maxNumberOutputs=this.model.length+1),r.addClass("jp-OutputArea-stdin-hiding"),this.model.add({output_type:"stream",name:"stdin",text:t+"\n"}),h.focus(),window.setTimeout((()=>{const t=document.activeElement;r.dispose(),t&&t instanceof HTMLElement&&t.focus()}),500)})),this.layout.addWidget(r)}_setOutput(t,e){if(t>=this._maxNumberOutputs)return;const s=this.layout.widgets[t],i=s.widgets?s.widgets[1]:s,n=this.rendermime.preferredMimeType(e.data,e.trusted?"any":"ensure");C.currentPreferredMimetype.get(i)===n&&x.isIsolated(n,e.metadata)===i instanceof C.IsolatedRenderer?i.renderModel(e):(this.layout.widgets[t].dispose(),this._insertOutput(t,e))}_insertOutput(t,e){if(t>this._maxNumberOutputs)return;const s=this.layout;if(t===this._maxNumberOutputs){const e=new C.TrimmedOutputs(this._maxNumberOutputs,(()=>{const t=this._maxNumberOutputs;this._maxNumberOutputs=1/0,this._showTrimmedOutputs(t)}));s.insertWidget(t,this._wrappedOutput(e))}else{let i=this.createOutputItem(e);i?i.toggleClass("jp-OutputArea-executeResult",null!==e.executionCount):i=new _.Widget,this._outputTracker.has(i)||this._outputTracker.add(i),s.insertWidget(t,i)}}get outputTracker(){return this._outputTracker}_showTrimmedOutputs(t){this.widgets[t].dispose();for(let e=t;e<this.model.length;e++)this._insertOutput(e,this.model.get(e));this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}createOutputItem(t){const e=this.createRenderedMimetype(t);return e?this._wrappedOutput(e,t.executionCount):null}createRenderedMimetype(t){const e=this.rendermime.preferredMimeType(t.data,t.trusted?"any":"ensure");if(!e)return null;let s=this.rendermime.createRenderer(e);return!0===x.isIsolated(e,t.metadata)&&(s=new C.IsolatedRenderer(s)),C.currentPreferredMimetype.set(s,e),s.renderModel(t).catch((t=>{const e=document.createElement("pre"),i=this._translator.load("jupyterlab");e.textContent=i.__("Javascript Error: %1",t.message),s.node.appendChild(e),s.node.className="lm-Widget jp-RenderedText",s.node.setAttribute("data-mime-type","application/vnd.jupyter.stderr")})),s}_wrappedOutput(t,e=null){const s=new C.OutputPanel;s.addClass(g);const i=this.contentFactory.createOutputPrompt();return i.executionCount=e,i.addClass(f),s.addWidget(i),t.addClass(y),s.addWidget(t),s}}class v extends x{onInputRequest(t,e){}createOutputItem(t){const e=this.createRenderedMimetype(t);if(!e)return null;const s=new C.OutputPanel;return s.addClass(g),e.addClass(y),s.addWidget(e),s}}!function(t){t.execute=async function(t,e,s,i){var n;let r=!0;i&&Array.isArray(i.tags)&&-1!==i.tags.indexOf("raises-exception")&&(r=!1);const a={code:t,stop_on_error:r},o=null===(n=s.session)||void 0===n?void 0:n.kernel;if(!o)throw new Error("Session has no kernel.");const h=o.requestExecute(a,!1,i);return e.future=h,h.done},t.isIsolated=function(t,e){const s=e[t];return s&&void 0!==s.isolated?!!s.isolated:!!e.isolated};class e{createOutputPrompt(){return new w}createStdin(t){return new O(t)}}t.ContentFactory=e,t.defaultContentFactory=new e}(x||(x={}));class w extends _.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-OutputPrompt")}get executionCount(){return this._executionCount}set executionCount(t){this._executionCount=t,this.node.textContent=null===t?"":`[${t}]:`}}class O extends _.Widget{static _historyIx(t,e){const s=O._history.get(t);if(!s)return;const i=s.length;return e<=0?i+e:void 0}static _historyAt(t,e){const s=O._history.get(t);if(!s)return;const i=s.length,n=O._historyIx(t,e);return void 0!==n&&n<i?s[n]:void 0}static _historyPush(t,e){const s=O._history.get(t);s.push(e),s.length>1e3&&s.shift()}static _historySearch(t,e,s,i=!0){const n=O._history.get(t),r=n.length,a=O._historyIx(t,s),o=t=>-1!==t.search(e);if(void 0!==a)if(i){if(0===a)return;const t=n.slice(0,a).findLastIndex(o);if(-1!==t)return t-r}else{if(a>=r-1)return;const t=n.slice(a+1).findIndex(o);if(-1!==t)return t-r+a+1}}constructor(t){var e;super({node:C.createInputWidgetNode(t.prompt,t.password)}),this._promise=new h.PromiseDelegate,this._resolved=!1,this.addClass("jp-Stdin"),this._future=t.future,this._historyIndex=0,this._historyKey="session"===t.inputHistoryScope?t.parent_header.session:"",this._historyPat="",this._parentHeader=t.parent_header,this._password=t.password,this._trans=(null!==(e=t.translator)&&void 0!==e?e:p.nullTranslator).load("jupyterlab"),this._value=t.prompt+" ",this._input=this.node.getElementsByTagName("input")[0],this._input.placeholder=this._trans.__("↑↓ for history. Search history with c-↑/c-↓"),O._history.has(this._historyKey)||O._history.set(this._historyKey,[])}get value(){return this._promise.promise.then((()=>this._value))}handleEvent(t){if(this._resolved)return void t.preventDefault();const e=this._input;if("keydown"===t.type)if("Enter"===t.key)this.resetSearch(),this._future.sendInputReply({status:"ok",value:e.value},this._parentHeader),this._password?this._value+="········":(this._value+=e.value,O._historyPush(this._historyKey,e.value)),this._resolved=!0,this._promise.resolve(void 0);else if("Escape"===t.key)this.resetSearch(),e.blur();else if(!t.ctrlKey||"ArrowUp"!==t.key&&"ArrowDown"!==t.key){if("ArrowUp"===t.key){this.resetSearch();const s=O._historyAt(this._historyKey,this._historyIndex-1);s&&(0===this._historyIndex&&(this._valueCache=e.value),this._setInputValue(s),--this._historyIndex,t.preventDefault())}else if("ArrowDown"===t.key)if(this.resetSearch(),0===this._historyIndex);else if(-1===this._historyIndex)this._setInputValue(this._valueCache),++this._historyIndex;else{const t=O._historyAt(this._historyKey,this._historyIndex+1);t&&(this._setInputValue(t),++this._historyIndex)}}else{""===this._historyPat&&(this._historyPat=e.value);const s="ArrowUp"===t.key,i=O._historySearch(this._historyKey,this._historyPat,this._historyIndex,s);if(void 0!==i){const s=O._historyAt(this._historyKey,i);void 0!==s&&(0===this._historyIndex&&(this._valueCache=e.value),this._setInputValue(s),this._historyIndex=i,t.preventDefault())}}}resetSearch(){this._historyPat=""}onAfterAttach(t){this._input.addEventListener("keydown",this),this._input.focus()}onBeforeDetach(t){this._input.removeEventListener("keydown",this)}_setInputValue(t){this._input.value=t,this._input.setSelectionRange(t.length,t.length)}}var C;O._history=new Map,function(t){t.createInputWidgetNode=function(t,e){const s=document.createElement("div"),i=document.createElement("pre");i.className="jp-Stdin-prompt",i.textContent=t;const n=document.createElement("input");return n.className="jp-Stdin-input",e&&(n.type="password"),s.appendChild(i),i.appendChild(n),s};class e extends _.Widget{constructor(t){super({node:document.createElement("iframe")}),this.addClass("jp-mod-isolated"),this._wrapped=t;const e=this.node;e.frameBorder="0",e.scrolling="auto",e.addEventListener("load",(()=>{e.contentDocument.open(),e.contentDocument.write(this._wrapped.node.innerHTML),e.contentDocument.close();const t=e.contentDocument.body;e.style.height=`${t.scrollHeight}px`,e.heightChangeObserver=new ResizeObserver((()=>{e.style.height=`${t.scrollHeight}px`})),e.heightChangeObserver.observe(t)}))}renderModel(t){return this._wrapped.renderModel(t)}}t.IsolatedRenderer=e,t.currentPreferredMimetype=new m.AttachedProperty({name:"preferredMimetype",create:t=>""});class s extends _.Panel{constructor(t){super(t)}_onContext(t){this.node.focus()}onAfterAttach(t){super.onAfterAttach(t),this.node.addEventListener("contextmenu",this._onContext.bind(this))}onBeforeDetach(t){super.onAfterDetach(t),this.node.removeEventListener("contextmenu",this._onContext.bind(this))}}t.OutputPanel=s;class i extends _.Widget{constructor(t,e){const s=document.createElement("div"),i=`The first ${t} are displayed`;s.insertAdjacentHTML("afterbegin",`<a title=${i}>\n <pre>Show more outputs</pre>\n </a>`),super({node:s}),this._onClick=e,this.addClass("jp-TrimmedOutputs"),this.addClass("jp-RenderedHTMLCommon")}handleEvent(t){"click"===t.type&&this._onClick(t)}onAfterAttach(t){super.onAfterAttach(t),this.node.addEventListener("click",this)}onBeforeDetach(t){super.onBeforeDetach(t),this.node.removeEventListener("click",this)}}t.TrimmedOutputs=i}(C||(C={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7252,9685],{79685:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var n,o=r(86883),a=r(56165),d=r(85421),i=r(892),c=r(42628),s=r(20457),w=r(16698),m=r(49255);!function(e){e.markdownPreview="markdownviewer:open",e.markdownEditor="markdownviewer:edit"}(n||(n={}));const p="Markdown Preview",l={activate:function(e,t,r,o,s,w){const m=r.load("jupyterlab"),{commands:k,docRegistry:u}=e;t.addFactory(c.markdownRendererFactory);const g=new a.WidgetTracker({namespace:"markdownviewer-widget"});let f={...i.MarkdownViewer.defaultConfig};function h(e){Object.keys(f).forEach((t=>{var r;e.setOption(t,null!==(r=f[t])&&void 0!==r?r:null)}))}if(s){const e=e=>{f=e.composite,g.forEach((e=>{h(e.content)}))};s.load(l.id).then((t=>{t.changed.connect((()=>{e(t)})),e(t)})).catch((e=>{console.error(e.message)}))}const y=new i.MarkdownViewerFactory({rendermime:t,name:p,label:m.__("Markdown Preview"),primaryFileType:u.getFileType("markdown"),fileTypes:["markdown"],defaultRendered:["markdown"]});return y.widgetCreated.connect(((e,t)=>{t.context.pathChanged.connect((()=>{g.save(t)})),h(t.content),g.add(t)})),u.addWidgetFactory(y),o&&o.restore(g,{command:"docmanager:open",args:e=>({path:e.context.path,factory:p}),name:e=>e.context.path}),k.addCommand(n.markdownPreview,{label:m.__("Markdown Preview"),execute:e=>{const t=e.path;if("string"==typeof t)return k.execute("docmanager:open",{path:t,factory:p,options:e.options})}}),k.addCommand(n.markdownEditor,{execute:()=>{const e=g.currentWidget;if(!e)return;const t=e.context.path;return k.execute("docmanager:open",{path:t,factory:"Editor",options:{mode:"split-right"}})},isVisible:()=>{const e=g.currentWidget;return e&&".md"===d.PathExt.extname(e.context.path)||!1},label:m.__("Show Markdown Editor")}),w&&w.add(new i.MarkdownViewerTableOfContentsFactory(g,t.markdownParser)),g},id:"@jupyterlab/markdownviewer-extension:plugin",description:"Adds markdown file viewer and provides its tracker.",provides:i.IMarkdownViewerTracker,requires:[c.IRenderMimeRegistry,m.ITranslator],optional:[o.ILayoutRestorer,s.ISettingRegistry,w.ITableOfContentsRegistry],autoStart:!0},k=l}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7252,9685],{79685:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var n,a=r(70273),o=r(28054),d=r(64588),i=r(89158),c=r(39401),s=r(70394),w=r(21099),m=r(57356);!function(e){e.markdownPreview="markdownviewer:open",e.markdownEditor="markdownviewer:edit"}(n||(n={}));const p="Markdown Preview",l={activate:function(e,t,r,a,s,w,m){const k=r.load("jupyterlab"),{commands:u,docRegistry:g}=e;t.addFactory(c.markdownRendererFactory);const f=new o.WidgetTracker({namespace:"markdownviewer-widget"});let h={...i.MarkdownViewer.defaultConfig};function y(e){Object.keys(h).forEach((t=>{var r;e.setOption(t,null!==(r=h[t])&&void 0!==r?r:null)}))}if(s){const e=e=>{h=e.composite,f.forEach((e=>{y(e.content)}))};s.load(l.id).then((t=>{t.changed.connect((()=>{e(t)})),e(t)})).catch((e=>{console.error(e.message)}))}const v=new i.MarkdownViewerFactory({rendermime:t,name:p,label:k.__("Markdown Preview"),primaryFileType:g.getFileType("markdown"),fileTypes:["markdown"],defaultRendered:["markdown"]});return v.widgetCreated.connect(((e,t)=>{t.context.pathChanged.connect((()=>{f.save(t)})),y(t.content),f.add(t)})),g.addWidgetFactory(v),a&&a.restore(f,{command:"docmanager:open",args:e=>({path:e.context.path,factory:p}),name:e=>e.context.path}),u.addCommand(n.markdownPreview,{label:k.__("Markdown Preview"),execute:e=>{const t=e.path;if("string"==typeof t)return u.execute("docmanager:open",{path:t,factory:p,options:e.options})}}),u.addCommand(n.markdownEditor,{execute:()=>{const e=f.currentWidget;if(!e)return;const t=e.context.path;return u.execute("docmanager:open",{path:t,factory:"Editor",options:{mode:"split-right"}})},isVisible:()=>{const e=f.currentWidget;return e&&".md"===d.PathExt.extname(e.context.path)||!1},label:k.__("Show Markdown Editor")}),w&&w.add(new i.MarkdownViewerTableOfContentsFactory(f,t.markdownParser,null!=m?m:t.sanitizer)),f},id:"@jupyterlab/markdownviewer-extension:plugin",description:"Adds markdown file viewer and provides its tracker.",provides:i.IMarkdownViewerTracker,requires:[c.IRenderMimeRegistry,m.ITranslator],optional:[a.ILayoutRestorer,s.ISettingRegistry,w.ITableOfContentsRegistry,o.ISanitizer],autoStart:!0},k=l}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7302,3768],{83768:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var r=o(56165),a=o(85421),n=o(45697),i=o(20457),s=o(30279),l=o(12438),d=o(49255),c=o(59361),u=o(81997),m=o(9267),b=o(59719),g=o(78156),f=o.n(g);const w=({commands:e,browser:t,translator:o})=>{const a=o.load("notebook"),n=Array.from(t.selectedItems()),i=n.some((e=>"directory"===e.type)),s=n.filter((e=>"file"===e.type)).length>1;if(0===n.length)return f().createElement("div",null,a.__("Select items to perform actions on them."));{const t=["delete"];return i?1===n.length&&t.unshift("rename"):(t.unshift("duplicate"),s||t.unshift("rename"),t.unshift("download"),t.unshift("open")),f().createElement(f().Fragment,null,t.map((t=>f().createElement(r.CommandToolbarButtonComponent,{key:t,commands:e,id:`filebrowser:${t}`,args:{toolbar:!0},icon:void 0}))))}},h=({commands:e,browser:t,selectionChanged:o,translator:a})=>f().createElement(r.UseSignal,{signal:o,shouldUpdate:()=>!0},(()=>f().createElement(w,{commands:e,browser:t,translator:a})));var p;!function(e){e.create=({commands:e,browser:t,selectionChanged:o,translator:a})=>{const n=r.ReactWidget.create(f().createElement(h,{commands:e,browser:t,selectionChanged:o,translator:a}));return n.addClass("jp-FileActions"),n}}(p||(p={}));const y="FileBrowser";var k;!function(e){e.activate="filebrowser:activate"}(k||(k={}));const F={id:"@jupyter-notebook/tree-extension:new",requires:[d.ITranslator],optional:[r.IToolbarWidgetRegistry],autoStart:!0,activate:(e,t,o)=>{const{commands:r}=e,a=t.load("notebook"),n={overflowMenuOptions:{isVisible:!1}},i=new m.MenuBar(n),s=new m.Menu({commands:r});s.title.label=a.__("New"),s.title.icon=c.caretDownIcon,i.addMenu(s),["notebook:create-new","terminal:create-new","console:create","filebrowser:create-new-file","filebrowser:create-new-directory"].forEach((e=>{s.addItem({command:e})})),o&&o.addFactory(y,"new-dropdown",(e=>{const t=new m.MenuBar(n);return t.addMenu(s),t.addClass("jp-DropdownMenu"),t}))}},S={id:"@jupyter-notebook/tree-extension:file-actions",autoStart:!0,requires:[n.IDefaultFileBrowser,r.IToolbarWidgetRegistry,d.ITranslator],activate:(e,t,o,r)=>{const a=new u.Signal(t);["_selectItem","_handleMultiSelect","handleFileSelect"].forEach((e=>{const o=t.listing[e];t.listing[e]=(...e)=>{o.call(t.listing,...e),a.emit(void 0)}})),o.addFactory(y,"fileActions",(t=>{const{commands:o}=e;return p.create({commands:o,browser:t,selectionChanged:a,translator:r})}))}},T={id:"@jupyter-notebook/tree-extension:load-plugins",autoStart:!0,requires:[i.ISettingRegistry],activate(e,t){const{isDisabled:o}=a.PageConfig.Extension,r=t.connector,n=a.PageConfig.getOption("allPlugins");if(!n)return;const i=JSON.parse(n),s=new Set;Object.keys(i).forEach((e=>{const t=i[e];Object.keys(t).forEach((e=>{const o=t[e];"boolean"==typeof o&&o?s.add(e):Array.isArray(o)&&o.forEach((e=>{s.add(e)}))}))})),e.restored.then((async()=>{(await r.list("all")).ids.forEach((async e=>{const[r]=e.split(":");if((s.has(r)||s.has(e))&&!o(e)&&!(e in t.plugins))try{await t.load(e)}catch(t){console.warn(`Settings failed to load for (${e})`,t)}}))}))}},I={id:"@jupyter-notebook/tree-extension:open-file-browser",requires:[b.INotebookTree,n.IDefaultFileBrowser],autoStart:!0,activate:(e,t,o)=>{const{commands:r}=e;r.addCommand(k.activate,{execute:()=>{t.currentWidget=o}})}},_={id:"@jupyter-notebook/tree-extension:widget",requires:[n.IDefaultFileBrowser,d.ITranslator,i.ISettingRegistry,r.IToolbarWidgetRegistry],optional:[s.IRunningSessionManagers,l.ISettingEditorTracker,l.IJSONSettingEditorTracker],autoStart:!0,provides:b.INotebookTree,activate:(e,t,o,a,i,l,d,u)=>{const m=new b.NotebookTreeWidget,g=o.load("notebook");if(t.title.label=g.__("Files"),t.node.setAttribute("role","region"),t.node.setAttribute("aria-label",g.__("File Browser Section")),t.title.icon=c.folderIcon,m.addWidget(t),m.tabBar.addTab(t.title),m.tabsMovable=!1,i.addFactory(y,"uploader",(e=>new n.Uploader({model:e.model,translator:o,label:g.__("Upload")}))),i.addFactory(y,"fileNameSearcher",(e=>{const t=(0,c.FilenameSearcher)({updateFilter:(t,o)=>{e.model.setFilter((e=>t(e.name.toLowerCase())))},useFuzzyFilter:!0,placeholder:g.__("Filter files by name"),forceRefresh:!0});return t.addClass("jp-FileBrowser-filterBox"),t})),(0,r.setToolbar)(t,(0,r.createToolbarFactory)(i,a,y,_.id,o)),l){const e=new s.RunningSessions(l,o);e.id="jp-running-sessions-tree",e.title.label=g.__("Running"),e.title.icon=c.runningIcon,m.addWidget(e),m.tabBar.addTab(e.title)}const f=a.load("@jupyterlab/filebrowser-extension:browser");return Promise.all([f,e.restored]).then((([e])=>{["showFileCheckboxes","showFileSizeColumn","sortNotebooksFirst"].forEach((t=>{void 0===e.user[t]&&e.set(t,!0)}))})).catch((e=>{console.error(e.message)})),e.shell.add(m,"main",{rank:100}),[d,u].forEach((e=>{e&&e.widgetAdded.connect(((e,t)=>{m.addWidget(t),m.tabBar.addTab(t.title),m.currentWidget=t}))})),m}},E=[F,S,T,I,_]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[7302,3768],{83768:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var r=o(28054),a=o(64588),n=o(16843),i=o(70394),s=o(56153),l=o(46445),d=o(57356),c=o(90710),u=o(81997),m=o(9267),b=o(24135),g=o(78156),f=o.n(g);const w=({commands:e,browser:t,translator:o})=>{const a=o.load("notebook"),n=Array.from(t.selectedItems()),i=n.some((e=>"directory"===e.type)),s=n.filter((e=>"file"===e.type)).length>1;if(0===n.length)return f().createElement("div",null,a.__("Select items to perform actions on them."));{const t=["delete"];return i?1===n.length&&t.unshift("rename"):(t.unshift("duplicate"),s||t.unshift("rename"),t.unshift("download"),t.unshift("open")),f().createElement(f().Fragment,null,t.map((t=>f().createElement(r.CommandToolbarButtonComponent,{key:t,commands:e,id:`filebrowser:${t}`,args:{toolbar:!0},icon:void 0}))))}},h=({commands:e,browser:t,selectionChanged:o,translator:a})=>f().createElement(r.UseSignal,{signal:o,shouldUpdate:()=>!0},(()=>f().createElement(w,{commands:e,browser:t,translator:a})));var p;!function(e){e.create=({commands:e,browser:t,selectionChanged:o,translator:a})=>{const n=r.ReactWidget.create(f().createElement(h,{commands:e,browser:t,selectionChanged:o,translator:a}));return n.addClass("jp-FileActions"),n}}(p||(p={}));const y="FileBrowser";var k;!function(e){e.activate="filebrowser:activate"}(k||(k={}));const F={id:"@jupyter-notebook/tree-extension:new",requires:[d.ITranslator],optional:[r.IToolbarWidgetRegistry],autoStart:!0,activate:(e,t,o)=>{const{commands:r}=e,a=t.load("notebook"),n={overflowMenuOptions:{isVisible:!1}},i=new m.MenuBar(n),s=new m.Menu({commands:r});s.title.label=a.__("New"),s.title.icon=c.caretDownIcon,i.addMenu(s),["notebook:create-new","terminal:create-new","console:create","filebrowser:create-new-file","filebrowser:create-new-directory"].forEach((e=>{s.addItem({command:e})})),o&&o.addFactory(y,"new-dropdown",(e=>{const t=new m.MenuBar(n);return t.addMenu(s),t.addClass("jp-DropdownMenu"),t}))}},S={id:"@jupyter-notebook/tree-extension:file-actions",autoStart:!0,requires:[n.IDefaultFileBrowser,r.IToolbarWidgetRegistry,d.ITranslator],activate:(e,t,o,r)=>{const a=new u.Signal(t);["_selectItem","_handleMultiSelect","handleFileSelect"].forEach((e=>{const o=t.listing[e];t.listing[e]=(...e)=>{o.call(t.listing,...e),a.emit(void 0)}})),o.addFactory(y,"fileActions",(t=>{const{commands:o}=e;return p.create({commands:o,browser:t,selectionChanged:a,translator:r})}))}},T={id:"@jupyter-notebook/tree-extension:load-plugins",autoStart:!0,requires:[i.ISettingRegistry],activate(e,t){const{isDisabled:o}=a.PageConfig.Extension,r=t.connector,n=a.PageConfig.getOption("allPlugins");if(!n)return;const i=JSON.parse(n),s=new Set;Object.keys(i).forEach((e=>{const t=i[e];Object.keys(t).forEach((e=>{const o=t[e];"boolean"==typeof o&&o?s.add(e):Array.isArray(o)&&o.forEach((e=>{s.add(e)}))}))})),e.restored.then((async()=>{(await r.list("all")).ids.forEach((async e=>{const[r]=e.split(":");if((s.has(r)||s.has(e))&&!o(e)&&!(e in t.plugins))try{await t.load(e)}catch(t){console.warn(`Settings failed to load for (${e})`,t)}}))}))}},I={id:"@jupyter-notebook/tree-extension:open-file-browser",requires:[b.INotebookTree,n.IDefaultFileBrowser],autoStart:!0,activate:(e,t,o)=>{const{commands:r}=e;r.addCommand(k.activate,{execute:()=>{t.currentWidget=o}})}},_={id:"@jupyter-notebook/tree-extension:widget",requires:[n.IDefaultFileBrowser,d.ITranslator,i.ISettingRegistry,r.IToolbarWidgetRegistry],optional:[s.IRunningSessionManagers,l.ISettingEditorTracker,l.IJSONSettingEditorTracker],autoStart:!0,provides:b.INotebookTree,activate:(e,t,o,a,i,l,d,u)=>{const m=new b.NotebookTreeWidget,g=o.load("notebook");if(t.title.label=g.__("Files"),t.node.setAttribute("role","region"),t.node.setAttribute("aria-label",g.__("File Browser Section")),t.title.icon=c.folderIcon,m.addWidget(t),m.tabBar.addTab(t.title),m.tabsMovable=!1,i.addFactory(y,"uploader",(e=>new n.Uploader({model:e.model,translator:o,label:g.__("Upload")}))),i.addFactory(y,"fileNameSearcher",(e=>{const t=(0,c.FilenameSearcher)({updateFilter:(t,o)=>{e.model.setFilter((e=>t(e.name.toLowerCase())))},useFuzzyFilter:!0,placeholder:g.__("Filter files by name"),forceRefresh:!0});return t.addClass("jp-FileBrowser-filterBox"),t})),(0,r.setToolbar)(t,(0,r.createToolbarFactory)(i,a,y,_.id,o)),l){const e=new s.RunningSessions(l,o);e.id="jp-running-sessions-tree",e.title.label=g.__("Running"),e.title.icon=c.runningIcon,m.addWidget(e),m.tabBar.addTab(e.title)}const f=a.load("@jupyterlab/filebrowser-extension:browser");return Promise.all([f,e.restored]).then((([e])=>{["showFileCheckboxes","showFileSizeColumn","sortNotebooksFirst"].forEach((t=>{void 0===e.user[t]&&e.set(t,!0)}))})).catch((e=>{console.error(e.message)})),e.shell.add(m,"main",{rank:100}),[d,u].forEach((e=>{e&&e.widgetAdded.connect(((e,t)=>{m.addWidget(t),m.tabBar.addTab(t.title),m.currentWidget=t}))})),m}},E=[F,S,T,I,_]}}]);