notebook 7.3.0a0__py3-none-any.whl → 7.3.0a1__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 (183) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/113.bundle.js +1 -1
  3. notebook/static/1198.bundle.js +1 -1
  4. notebook/static/1226.bundle.js +1 -1
  5. notebook/static/131.bundle.js +1 -1
  6. notebook/static/134.bundle.js +1 -1
  7. notebook/static/1408.bundle.js +1 -1
  8. notebook/static/1496.bundle.js +1 -1
  9. notebook/static/1584.bundle.js +1 -1
  10. notebook/static/1647.bundle.js +1 -1
  11. notebook/static/1650.bundle.js +1 -1
  12. notebook/static/1684.bundle.js +1 -1
  13. notebook/static/1809.bundle.js +1 -1
  14. notebook/static/1827.bundle.js +1 -1
  15. notebook/static/1833.bundle.js +1 -1
  16. notebook/static/1958.bundle.js +1 -1
  17. notebook/static/1962.bundle.js +1 -1
  18. notebook/static/2007.bundle.js +1 -1
  19. notebook/static/2065.bundle.js +1 -1
  20. notebook/static/2088.bundle.js +1 -1
  21. notebook/static/2089.bundle.js +1 -1
  22. notebook/static/2122.bundle.js +1 -1
  23. notebook/static/2167.bundle.js +1 -1
  24. notebook/static/2184.bundle.js +1 -1
  25. notebook/static/2311.bundle.js +1 -1
  26. notebook/static/2401.bundle.js +1 -1
  27. notebook/static/2479.bundle.js +1 -1
  28. notebook/static/2489.bundle.js +1 -1
  29. notebook/static/2607.bundle.js +1 -1
  30. notebook/static/2615.bundle.js +1 -1
  31. notebook/static/2636.bundle.js +1 -1
  32. notebook/static/2924.bundle.js +1 -1
  33. notebook/static/2944.bundle.js +1 -1
  34. notebook/static/{2323.bundle.js → 3030.bundle.js} +1 -1
  35. notebook/static/3129.bundle.js +1 -1
  36. notebook/static/3146.bundle.js +1 -1
  37. notebook/static/3187.bundle.js +1 -1
  38. notebook/static/3213.bundle.js +1 -1
  39. notebook/static/3340.bundle.js +1 -1
  40. notebook/static/3360.bundle.js +1 -1
  41. notebook/static/3466.bundle.js +1 -1
  42. notebook/static/3512.bundle.js +1 -1
  43. notebook/static/3676.bundle.js +1 -1
  44. notebook/static/3680.bundle.js +1 -1
  45. notebook/static/374.bundle.js +1 -1
  46. notebook/static/3768.bundle.js +1 -1
  47. notebook/static/377.bundle.js +1 -1
  48. notebook/static/3863.bundle.js +1 -1
  49. notebook/static/3881.bundle.js +1 -1
  50. notebook/static/4042.bundle.js +1 -1
  51. notebook/static/4058.bundle.js +1 -1
  52. notebook/static/4212.bundle.js +1 -1
  53. notebook/static/4382.bundle.js +1 -1
  54. notebook/static/4526.bundle.js +1 -1
  55. notebook/static/4588.bundle.js +1 -1
  56. notebook/static/4645.bundle.js +1 -1
  57. notebook/static/4811.bundle.js +1 -1
  58. notebook/static/4837.bundle.js +1 -1
  59. notebook/static/5099.bundle.js +1 -1
  60. notebook/static/5135.bundle.js +1 -1
  61. notebook/static/5254.bundle.js +1 -1
  62. notebook/static/5261.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/545.bundle.js +1 -1
  68. notebook/static/5573.bundle.js +1 -1
  69. notebook/static/5601.bundle.js +1 -1
  70. notebook/static/5733.bundle.js +1 -1
  71. notebook/static/5828.bundle.js +1 -1
  72. notebook/static/5850.bundle.js +1 -1
  73. notebook/static/5912.bundle.js +1 -1
  74. notebook/static/5921.bundle.js +1 -1
  75. notebook/static/6017.bundle.js +1 -1
  76. notebook/static/6139.bundle.js +1 -1
  77. notebook/static/62.bundle.js +1 -1
  78. notebook/static/6271.bundle.js +1 -1
  79. notebook/static/6318.bundle.js +1 -1
  80. notebook/static/6345.bundle.js +1 -1
  81. notebook/static/6604.bundle.js +1 -1
  82. notebook/static/6621.bundle.js +1 -1
  83. notebook/static/6627.bundle.js +1 -1
  84. notebook/static/6748.bundle.js +1 -1
  85. notebook/static/677.bundle.js +1 -1
  86. notebook/static/6815.bundle.js +1 -1
  87. notebook/static/6853.bundle.js +1 -1
  88. notebook/static/6893.bundle.js +1 -1
  89. notebook/static/6898.bundle.js +1 -1
  90. notebook/static/690.bundle.js +1 -1
  91. notebook/static/6962.bundle.js +1 -1
  92. notebook/static/6999.bundle.js +1 -1
  93. notebook/static/7226.bundle.js +1 -1
  94. notebook/static/7252.bundle.js +1 -1
  95. notebook/static/7302.bundle.js +1 -1
  96. notebook/static/7369.bundle.js +1 -1
  97. notebook/static/7386.bundle.js +1 -1
  98. notebook/static/7391.bundle.js +1 -1
  99. notebook/static/7450.bundle.js +1 -1
  100. notebook/static/7506.bundle.js +2 -2
  101. notebook/static/7543.bundle.js +1 -1
  102. notebook/static/755.bundle.js +1 -1
  103. notebook/static/7603.bundle.js +1 -1
  104. notebook/static/7639.bundle.js +1 -1
  105. notebook/static/7655.bundle.js +1 -1
  106. notebook/static/{4427.bundle.js → 7674.bundle.js} +1 -1
  107. notebook/static/7684.bundle.js +1 -1
  108. notebook/static/7812.bundle.js +1 -1
  109. notebook/static/7819.bundle.js +1 -1
  110. notebook/static/7854.bundle.js +1 -1
  111. notebook/static/7900.bundle.js +1 -1
  112. notebook/static/7906.bundle.js +1 -1
  113. notebook/static/7995.bundle.js +1 -1
  114. notebook/static/8054.bundle.js +1 -1
  115. notebook/static/8285.bundle.js +1 -1
  116. notebook/static/8471.bundle.js +1 -1
  117. notebook/static/8579.bundle.js +1 -1
  118. notebook/static/8633.bundle.js +1 -1
  119. notebook/static/8771.bundle.js +1 -1
  120. notebook/static/8781.bundle.js +1 -1
  121. notebook/static/8875.bundle.js +1 -1
  122. notebook/static/8907.bundle.js +1 -1
  123. notebook/static/8928.bundle.js +1 -1
  124. notebook/static/893.bundle.js +1 -1
  125. notebook/static/901.bundle.js +1 -1
  126. notebook/static/9068.bundle.js +1 -1
  127. notebook/static/9136.bundle.js +1 -1
  128. notebook/static/9151.bundle.js +1 -1
  129. notebook/static/9161.bundle.js +1 -1
  130. notebook/static/9268.bundle.js +1 -1
  131. notebook/static/9335.bundle.js +1 -1
  132. notebook/static/9341.bundle.js +1 -1
  133. notebook/static/9380.bundle.js +1 -1
  134. notebook/static/9605.bundle.js +1 -1
  135. notebook/static/9638.bundle.js +1 -1
  136. notebook/static/9680.bundle.js +1 -1
  137. notebook/static/9685.bundle.js +1 -1
  138. notebook/static/9752.bundle.js +1 -1
  139. notebook/static/9821.bundle.js +1 -1
  140. notebook/static/9852.bundle.js +1 -1
  141. notebook/static/bundle.js +1 -1
  142. notebook/static/third-party-licenses.json +104 -104
  143. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  144. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  145. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  146. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  147. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  148. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  149. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  150. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.45e1d3167710e94c3d26.js +1 -0
  151. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/646.57a345a80ce9f0e64830.js → notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/600.25341cef1598f2727482.js +1 -1
  152. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.b94c92715d631efb4a8f.js +1 -0
  153. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.8ca922abea871b34db72.js +1 -0
  154. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  155. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/METADATA +2 -2
  156. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/RECORD +179 -180
  157. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/WHEEL +1 -1
  158. notebook/static/9092.bundle.js +0 -1
  159. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.6d49b092e49dc147dc54.js +0 -1
  160. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.7bcc163b9139ecb2b25b.js +0 -1
  161. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.9381fdb35e72f41d8af1.js +0 -1
  162. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  163. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  164. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  165. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  166. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  167. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  168. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  169. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  170. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  171. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  172. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  173. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  174. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  175. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  176. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  177. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  178. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  179. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  180. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  181. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  182. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/entry_points.txt +0 -0
  183. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2944],{62944:(e,t,i)=>{i.r(t),i.d(t,{CONTEXT_PROVIDER_ID:()=>M,Completer:()=>b,CompleterModel:()=>_,CompletionHandler:()=>u,CompletionProviderManager:()=>$,CompletionTriggerKind:()=>s,ContextCompleterProvider:()=>k,HistoryInlineCompletionProvider:()=>Q,ICompletionProviderManager:()=>c,IInlineCompleterFactory:()=>d,InlineCompleter:()=>U,InlineCompletionTriggerKind:()=>n,KERNEL_PROVIDER_ID:()=>L,KernelCompleterProvider:()=>H,ProviderReconciliator:()=>E,completerWidgetIcon:()=>Z,inlineCompleterIcon:()=>K});var s,n,o=i(63242),r=i(65848),l=i(49503),a=i(81997),h=i(20998);!function(e){e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions"}(s||(s={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(n||(n={}));const d=new h.Token("@jupyterlab/completer:IInlineCompleterFactory","A factory of inline completer widgets."),c=new h.Token("@jupyterlab/completer:ICompletionProviderManager","A service for the completion providers management.");class u{constructor(e){this._fetchingInline=0,this._editor=null,this._enabled=!1,this._isDisposed=!1,this._autoCompletion=!1,this._continuousInline=!0,this.completer=e.completer,this.inlineCompleter=e.inlineCompleter,this.completer.selected.connect(this.onCompletionSelected,this),this.completer.visibilityChanged.connect(this.onVisibilityChanged,this),this._reconciliator=e.reconciliator}set reconciliator(e){this._reconciliator=e}get editor(){return this._editor}set editor(e){if(e===this._editor)return;let t=this._editor;if(t&&!t.isDisposed){const e=t.model;t.host.classList.remove(o.COMPLETER_ENABLED_CLASS),t.host.classList.remove(o.COMPLETER_ACTIVE_CLASS),e.selections.changed.disconnect(this.onSelectionsChanged,this),e.sharedModel.changed.disconnect(this._onSharedModelChanged,this)}if(this.completer.reset(),this.completer.editor=e,t=this._editor=e,t){const e=t.model;this._enabled=!1,e.selections.changed.connect(this.onSelectionsChanged,this),e.sharedModel.changed.connect(this._onSharedModelChanged,this),this.onSelectionsChanged(),this.inlineCompleter&&(this.inlineCompleter.editor=t)}}get isDisposed(){return this._isDisposed}set autoCompletion(e){this._autoCompletion=e}get autoCompletion(){return this._autoCompletion}dispose(){this.isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}invokeInline(){const e=this._editor;e&&this._makeInlineRequest(e.getCursorPosition(),n.Invoke).catch((e=>{console.warn("Inline invoke request bailed",e)}))}invoke(){l.MessageLoop.sendMessage(this,u.Msg.InvokeRequest)}processMessage(e){e.type===u.Msg.InvokeRequest.type&&this.onInvokeRequest(e)}getState(e,t){return{text:e.model.sharedModel.getSource(),line:t.line,column:t.column}}onCompletionSelected(e,t){const i=e.model,s=this._editor;if(!s||!i)return;const n=i.createPatch(t);if(!n)return;const{start:o,end:r,value:l}=n,a=s.getOffsetAt(s.getCursorPosition());s.model.sharedModel.updateSource(o,r,l),a<=r&&a>=o&&s.setCursorPosition(s.getPositionAt(o+l.length))}onInvokeRequest(e){if(!this.completer.model)return;if(this.completer.model.original)return;const t=this._editor;t&&this._makeRequest(t.getCursorPosition(),s.Invoked).catch((e=>{console.warn("Invoke request bailed",e)}))}onSelectionsChanged(){var e;const t=this.completer.model,i=this._editor;if(!i)return;const s=null===(e=this.inlineCompleter)||void 0===e?void 0:e.model;s&&s.handleSelectionChange(i.getSelection());const n=i.host;if(!t)return this._enabled=!1,void n.classList.remove(o.COMPLETER_ENABLED_CLASS);if(t.subsetMatch)return;const r=i.getCursorPosition(),l=i.getLine(r.line);if(!l)return this._enabled=!1,t.reset(!0),void n.classList.remove(o.COMPLETER_ENABLED_CLASS);const{start:a,end:h}=i.getSelection();return a.column!==h.column||a.line!==h.line||l.slice(0,r.column).match(/^\s*$/)?(this._enabled=!1,t.reset(!0),void n.classList.remove(o.COMPLETER_ENABLED_CLASS)):(this._enabled||(this._enabled=!0,n.classList.add(o.COMPLETER_ENABLED_CLASS)),void t.handleCursorChange(this.getState(i,i.getCursorPosition())))}async onTextChanged(e,t){var i;if(!this._enabled)return;const o=this.completer.model,r=this.editor;if(!r)return;o&&this._autoCompletion&&this._reconciliator.shouldShowContinuousHint&&await this._reconciliator.shouldShowContinuousHint(this.completer.isVisible,t)&&this._makeRequest(r.getCursorPosition(),s.TriggerCharacter);const l=null===(i=this.inlineCompleter)||void 0===i?void 0:i.model;if(l&&(l.handleTextChange(t),this._continuousInline&&this._makeInlineRequest(r.getCursorPosition(),n.Automatic)),o){const{start:e,end:t}=r.getSelection();if(e.column!==t.column||e.line!==t.line)return;o.handleTextChange(this.getState(r,r.getCursorPosition()))}}onVisibilityChanged(e){e.isDisposed||e.isHidden?this._editor&&(this._editor.host.classList.remove(o.COMPLETER_ACTIVE_CLASS),this._editor.focus()):this._editor&&this._editor.host.classList.add(o.COMPLETER_ACTIVE_CLASS)}async _onSharedModelChanged(e,t){t.sourceChange&&await this.onTextChanged(e,t)}_makeRequest(e,t){const i=this.editor;if(!i)return Promise.reject(new Error("No active editor"));const s=this._composeRequest(i,e),n=this.getState(i,e);return this._reconciliator.fetch(s,t).then((e=>{if(!e)return;const t=this._updateModel(n,e.start,e.end);t&&t.setCompletionItems&&t.setCompletionItems(e.items)})).catch((e=>{}))}async _makeInlineRequest(e,t){const i=this.editor;if(!i)return Promise.reject(new Error("No active editor"));if(!this.inlineCompleter)return Promise.reject(new Error("No inline completer"));const s=i.getLine(e.line);if(t===n.Automatic&&(void 0===s||e.column<s.length))return;const o=this._composeRequest(i,e),r=this.inlineCompleter.model;if(!r)return;r.cursor=e;const l=++this._fetchingInline,a=this._reconciliator.fetchInline(o,t),h=new Set;for(const e of a)e.then((t=>{t&&t.items&&l===this._fetchingInline&&(h.add(e),1===h.size?r.setCompletions(t):r.appendCompletions(t))})).catch((e=>{console.warn(e)})).finally((()=>{h.add(e);const t=a.length-h.size;r.notifyProgress({pendingProviders:t,totalProviders:a.length})}))}_composeRequest(e,t){const i=e.model.sharedModel.getSource(),s=e.model.mimeType;return{text:i,offset:r.Text.jsIndexToCharIndex(e.getOffsetAt(t),i),mimeType:s}}_updateModel(e,t,i){const s=this.completer.model,n=e.text;return s?(s.original=e,s.cursor={start:r.Text.charIndexToJsIndex(t,n),end:r.Text.charIndexToJsIndex(i,n)},s):null}}!function(e){let t,i;!function(e){e[e.opened=0]="opened",e[e.update=1]="update",e[e.closed=2]="closed"}(t=e.StraemEvent||(e.StraemEvent={})),function(e){e.InvokeRequest=new l.Message("invoke-request")}(i=e.Msg||(e.Msg={}))}(u||(u={}));var m,p=i(33625);function g(e){const t=document.createElement("span");return t.textContent=e,t.innerHTML}class _{constructor(){this.processedItemsCache=null,this._current=null,this._cursor=null,this._isDisposed=!1,this._completionItems=[],this._original=null,this._query="",this._subsetMatch=!1,this._typeMap={},this._orderedTypes=[],this._stateChanged=new a.Signal(this),this._queryChanged=new a.Signal(this),this._processedToOriginalItem=null,this._resolvingItem=0}get stateChanged(){return this._stateChanged}get queryChanged(){return this._queryChanged}get original(){return this._original}set original(e){this._original===e||this._original&&e&&h.JSONExt.deepEqual(e,this._original)||(this._reset(),this._current=this._original=e,this._stateChanged.emit(void 0))}get current(){return this._current}set current(e){if(this._current===e||this._current&&e&&h.JSONExt.deepEqual(e,this._current))return;const t=this._original;if(!t)return;const i=this._cursor;if(!i)return;const s=this._current=e;if(!s)return void this._stateChanged.emit(void 0);const n=t.text.split("\n")[t.line],o=s.text.split("\n")[s.line];if(!this._subsetMatch&&o.length<n.length)return void this.reset(!0);const{start:r,end:l}=i;let a=s.text.substring(r);const d=t.text.substring(l);a=a.substring(0,a.lastIndexOf(d)),this._query=a,this.processedItemsCache=null,this._processedToOriginalItem=null,this._queryChanged.emit({newValue:this._query,origin:"editorUpdate"}),this._stateChanged.emit(void 0)}get cursor(){return this._cursor}set cursor(e){this.original&&(this._cursor=e)}get query(){return this._query}set query(e){this._query=e,this.processedItemsCache=null,this._processedToOriginalItem=null,this._queryChanged.emit({newValue:this._query,origin:"setter"})}get subsetMatch(){return this._subsetMatch}set subsetMatch(e){this._subsetMatch=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}completionItems(){if(!this.processedItemsCache){let e=this._query;if(e){const t=this._markup(e);this.processedItemsCache=t.map((e=>e.processedItem)),this._processedToOriginalItem=new WeakMap(t.map((e=>[e.processedItem,e.originalItem])))}else this.processedItemsCache=this._completionItems.map((e=>this._escapeItemLabel(e))),this._processedToOriginalItem=null}return this.processedItemsCache}setCompletionItems(e){h.JSONExt.deepEqual(e,this._completionItems)||(this._completionItems=e,this._orderedTypes=m.findOrderedCompletionItemTypes(this._completionItems),this.processedItemsCache=null,this._processedToOriginalItem=null,this._stateChanged.emit(void 0))}typeMap(){return this._typeMap}orderedTypes(){return this._orderedTypes}handleCursorChange(e){if(!this._original)return;const{column:t,line:i}=e,{current:s,original:n}=this;if(!n)return;if(i!==n.line)return void this.reset(!0);if(t<n.column)return void this.reset(!0);const{cursor:o}=this;if(!o||!s)return;const r=o.end-o.start,l=n.text.split("\n")[n.line],a=s.text.split("\n")[s.line].length-l.length;t>n.column+r+a&&this.reset(!0)}handleTextChange(e){const t=this._original;if(!t)return;const{text:i,column:s,line:n}=e,o=i.split("\n")[n][s-1];o&&o.match(/\S/)||e.column>=t.column?this.current=e:this.reset(!1)}createPatch(e){const t=this._original,i=this._cursor,s=this._current;if(!t||!i||!s)return;let{start:n,end:o}=i;return o+=s.text.length-t.text.length,{start:n,end:o,value:e}}reset(e=!1){!e&&this._subsetMatch||(this._reset(),this._stateChanged.emit(void 0))}_markup(e){var t;const i=this._completionItems;let s=[];for(const n of i){const i=n.label.indexOf("("),o=i>-1?n.label.substring(0,i):n.label,r=p.StringExt.matchSumOfSquares(g(o),e);if(r){let e=p.StringExt.highlight(g(n.label),r.indices,m.mark);const i=Object.assign({},n);i.label=e.join(""),i.insertText=null!==(t=n.insertText)&&void 0!==t?t:n.label,s.push({item:i,score:r.score,originalItem:n})}}return s.sort(m.scoreCmp),s.map((e=>({processedItem:e.item,originalItem:e.originalItem})))}resolveItem(e){let t,i;if("number"==typeof e){const i=this.completionItems();if(!i||!i[e])return;t=i[e]}else t=e;if(t)return i=this._processedToOriginalItem?this._processedToOriginalItem.get(t):t,i?this._resolveItemByValue(i):void 0}_resolveItemByValue(e){const t=++this._resolvingItem;let i;if(e.resolve){let t;e.insertText&&(t=this.createPatch(e.insertText)),i=e.resolve(t)}else i=Promise.resolve(e);return i.then((i=>(this._escapeItemLabel(i,!0),Object.keys(i).forEach((t=>{e[t]=i[t]})),e.resolve=void 0,t!==this._resolvingItem?Promise.resolve(null):i))).catch((t=>(console.error(t),Promise.resolve(e))))}_escapeItemLabel(e,t=!1){var i;const s=g(e.label);if(s!==e.label){const n=t?e:Object.assign({},e);return n.insertText=null!==(i=e.insertText)&&void 0!==i?i:e.label,n.label=s,n}return e}_reset(){const e=this._query;this._current=null,this._cursor=null,this._completionItems=[],this._original=null,this._query="",this.processedItemsCache=null,this._processedToOriginalItem=null,this._subsetMatch=!1,this._typeMap={},this._orderedTypes=[],e&&this._queryChanged.emit({newValue:this._query,origin:"reset"})}}!function(e){const t=["function","instance","class","module","keyword"],i=t.reduce(((e,t)=>(e[t]=null,e)),{});e.mark=function(e){return`<mark>${e}</mark>`},e.scoreCmp=function(e,t){var i,s,n;const o=e.score-t.score;return 0!==o?o:null!==(n=null===(i=e.item.insertText)||void 0===i?void 0:i.localeCompare(null!==(s=t.item.insertText)&&void 0!==s?s:""))&&void 0!==n?n:0},e.findOrderedCompletionItemTypes=function(e){const i=new Set;e.forEach((e=>{!e.type||t.includes(e.type)||i.has(e.type)||i.add(e.type)}));const s=Array.from(i);return s.sort(((e,t)=>e.localeCompare(t))),t.concat(s)},e.findOrderedTypes=function(e){const s=Object.keys(e).map((t=>e[t])).filter((e=>!!e&&!(e in i))).sort(((e,t)=>e.localeCompare(t)));return t.concat(s)}}(m||(m={}));var v=i(72703),f=i(62514),C=i(95291),y=i(18395),w=i(63485);const x="jp-Completer-item",P="jp-mod-active",I="jp-Completer-list",S=!0;class b extends w.Widget{constructor(e){var t,i,s,n;super({node:document.createElement("div")}),this._activeIndex=0,this._editor=null,this._model=null,this._selected=new a.Signal(this),this._visibilityChanged=new a.Signal(this),this._indexChanged=new a.Signal(this),this._lastSubsetMatch="",this._geometryLock=!1,this._geometryCounter=0,this._docPanelExpanded=!1,this._renderCounter=0,this.sanitizer=null!==(t=e.sanitizer)&&void 0!==t?t:new v.Sanitizer,this._defaultRenderer=b.getDefaultRenderer(this.sanitizer),this._renderer=null!==(i=e.renderer)&&void 0!==i?i:this._defaultRenderer,this._docPanel=this._createDocPanelNode(),this.model=null!==(s=e.model)&&void 0!==s?s:null,this.editor=null!==(n=e.editor)&&void 0!==n?n:null,this.addClass("jp-Completer"),this._updateConstraints()}_updateConstraints(){const e=document.createElement("div");e.classList.add(I),e.style.visibility="hidden",e.style.overflowY="scroll",document.body.appendChild(e);const t=window.getComputedStyle(e);this._maxHeight=parseInt(t.maxHeight,10),this._minHeight=parseInt(t.minHeight,10),this._scrollbarWidth=e.offsetWidth-e.clientWidth,document.body.removeChild(e);const i=this._createDocPanelNode();this._docPanelWidth=T.measureSize(i,"inline-block").width}get activeIndex(){return this._activeIndex}get editor(){return this._editor}set editor(e){this._editor=e}get selected(){return this._selected}get visibilityChanged(){return this._visibilityChanged}get indexChanged(){return this._indexChanged}get model(){return this._model}set model(e){(e||this._model)&&e!==this._model&&(this._model&&(this._model.stateChanged.disconnect(this.onModelStateChanged,this),this._model.queryChanged.disconnect(this.onModelQueryChanged,this)),this._model=e,this._model&&(this._model.stateChanged.connect(this.onModelStateChanged,this),this._model.queryChanged.connect(this.onModelQueryChanged,this)))}get renderer(){return this._renderer}set renderer(e){this._renderer=e}set showDocsPanel(e){this._showDoc=e}get showDocsPanel(){return this._showDoc}dispose(){this._sizeCache=void 0,this._model=null,super.dispose()}handleEvent(e){if(!this.isHidden&&this._editor)switch(e.type){case"keydown":this._evtKeydown(e);break;case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e)}}reset(){this._activeIndex=0,this._lastSubsetMatch="",this._model&&this._model.reset(!0),this._docPanel.style.display="none",this._sizeCache=void 0,this.node.scrollTop=0}selectActive(){const e=this.node.querySelector(`.${P}`);e?(this._selected.emit(e.getAttribute("data-value")),this.reset()):this.reset()}onAfterAttach(e){document.addEventListener("keydown",this,S),document.addEventListener("pointerdown",this,S),document.addEventListener("scroll",this,S)}onBeforeDetach(e){document.removeEventListener("keydown",this,S),document.removeEventListener("pointerdown",this,S),document.removeEventListener("scroll",this,S)}onModelStateChanged(){this.isAttached&&(this._activeIndex=0,this._indexChanged.emit(this._activeIndex),this.update())}onModelQueryChanged(e,t){if(this._sizeCache&&"editorUpdate"===t.origin){const t=e.completionItems(),i=this._sizeCache.items,s=i[this._findWidestItemIndex(i)],n=t[this._findWidestItemIndex(t)],o=this._getPreferredItemWidthHeuristic();t.length===this._sizeCache.items.length&&o(s)===o(n)||(this._sizeCache=void 0)}}onUpdateRequest(e){var t;const i=this._model;if(!i)return;i.query||this._populateSubset();let s=i.completionItems();if(!s.length)return void(this.isHidden||(this.reset(),this.hide(),this._visibilityChanged.emit(void 0)));this._updateConstraints(),this._geometryLock=!0;const n=this._createCompleterNode(i,s);let o=n.querySelectorAll(`.${x}`)[this._activeIndex];o.classList.add(P);const r=null===(t=this.model)||void 0===t?void 0:t.resolveItem(s[this._activeIndex]);this._showDoc&&(this._docPanel.innerText="",n.appendChild(this._docPanel),this._docPanelExpanded=!1,this._docPanel.style.display="none",this._updateDocPanel(r,o)),this.isHidden?(this.show(),this._setGeometry(),this._visibilityChanged.emit(void 0)):this._setGeometry(),this._geometryLock=!1}get sizeCache(){if(this._sizeCache)return{width:this._sizeCache.width+this._sizeCache.docPanelWidth,height:Math.max(this._sizeCache.height,this._sizeCache.docPanelHeight)}}_createDocPanelNode(){const e=document.createElement("div");return e.className="jp-Completer-docpanel",e}_createCompleterNode(e,t){const i=++this._renderCounter;let s=this.node;s.textContent="";let n=e.orderedTypes(),o=document.createElement("ul");o.className=I;const r=this._renderer.createCompletionItemNode(t[0],n),l=[r],a=T.measureSize(r,"inline-grid"),h=Math.max(Math.ceil(this._maxHeight/a.height),5),d=Math.min(h+1,t.length),c=performance.now();for(let e=1;e<d;e++){const i=this._renderer.createCompletionItemNode(t[e],n);l.push(i)}for(const e of l)o.appendChild(e);const u=this._findWidestItemIndex(t),m=u<l.length?l[u]:this._renderer.createCompletionItemNode(t[u],n),p=T.measureSize(m.cloneNode(!0),"inline-grid");if(this._sizeCache={height:Math.min(this._maxHeight,a.height*t.length),width:p.width+this._scrollbarWidth,items:t,docPanelWidth:0,docPanelHeight:0},d<t.length){const e=(performance.now()-c)/d,s=Math.max(5,Math.floor(12/e));let r=d,h=l[l.length-1];const u=()=>{if(r>=t.length)return;const e=a.height*(t.length-r);h.style.marginBottom=`${e}px`,requestAnimationFrame((()=>{if(i!=this._renderCounter)return;h.style.marginBottom="";const e=Math.min(t.length,r+s);for(let i=r;i<e;i++){const e=this._renderer.createCompletionItemNode(t[i],n);o.appendChild(e),h=e}r=e,u()}))};u()}return s.appendChild(o),s}_findWidestItemIndex(e){const t=this._getPreferredItemWidthHeuristic(),i=e.map(t);return i.indexOf(Math.max(...i))}_getPreferredItemWidthHeuristic(){return this._renderer.itemWidthHeuristic?this._renderer.itemWidthHeuristic.bind(this._renderer):this._defaultRenderer.itemWidthHeuristic.bind(this._defaultRenderer)}_cycle(e){var t,i;const s=this.node.querySelectorAll(`.${x}`),n=this._activeIndex,o=s.length-1;let r=this.node.querySelector(`.${P}`);switch(r.classList.remove(P),e){case"up":this._activeIndex=0===n?o:n-1;break;case"down":this._activeIndex=n<o?n+1:0;break;case"pageUp":case"pageDown":{const t=this.node.getBoundingClientRect(),i=r.getBoundingClientRect(),s=Math.floor(t.height/i.height),l="pageUp"===e?-1:1;this._activeIndex=Math.min(Math.max(0,n+l*s),o);break}}r=s[this._activeIndex],r.classList.add(P);let l=this.node.querySelector(`.${I}`);y.ElementExt.scrollIntoViewIfNeeded(l,r),this._indexChanged.emit(this._activeIndex);const a=null===(t=this.model)||void 0===t?void 0:t.completionItems(),h=null==a?void 0:a[this._activeIndex];if(h){const e=null===(i=this.model)||void 0===i?void 0:i.resolveItem(h);this._showDoc&&this._updateDocPanel(e,r)}}_evtKeydown(e){if(!this.isHidden&&this._editor)if(this._editor.host.contains(e.target))switch(e.keyCode){case 9:{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const t=this._model;if(!t)return;const i=t.completionItems();if(i&&1===i.length)return this._selected.emit(i[0].insertText||i[0].label),void this.reset();const s=this._populateSubset();return t.query&&t.query!==this._lastSubsetMatch&&(t.subsetMatch=!0,this._selected.emit(t.query),t.subsetMatch=!1,this._lastSubsetMatch=t.query),s&&this.update(),void this._cycle(e.shiftKey?"up":"down")}case 27:return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),void this.reset();case 33:case 34:case 38:case 40:{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const t=T.keyCodeMap[e.keyCode];return void this._cycle(t)}default:return}else this.reset()}_evtPointerdown(e){if(this.isHidden||!this._editor)return;if(T.nonstandardClick(e))return void this.reset();let t=e.target;for(;t!==document.documentElement;){if(t.classList.contains(x))return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this._selected.emit(t.getAttribute("data-value")),void this.reset();if(t===this.node)return e.preventDefault(),e.stopPropagation(),void e.stopImmediatePropagation();t=t.parentElement}this.reset()}_evtScroll(e){if(this.isHidden||!this._editor)return;const{node:t}=this;t.contains(e.target)||requestAnimationFrame((()=>{this._setGeometry()}))}_populateSubset(){const{model:e}=this;if(!e)return!1;const t=e.completionItems(),i=T.commonSubset(t.map((e=>e.insertText||e.label))),{query:s}=e;return!(!i||i===s||0!==i.indexOf(s)||(e.query=i,0))}_setGeometry(){const{node:e}=this,t=this._model,i=this._editor;if(!(i&&t&&t.original&&t.cursor))return;const s=t.cursor.start,n=i.getPositionAt(s),o=i.getCoordinateForPosition(n);if(!o)return;const r=window.getComputedStyle(e),l=parseInt(r.borderLeftWidth,10)||0,a=parseInt(r.paddingLeft,10)||0,h=i.host.closest(".jp-MainAreaWidget > .lm-Widget")||i.host,d=t.completionItems();this._sizeCache&&this._sizeCache.items.length!==d.length&&(this._sizeCache=void 0),C.HoverBox.setGeometry({anchor:o,host:h,maxHeight:this._maxHeight,minHeight:this._minHeight,node:e,size:this.sizeCache,offset:{horizontal:l+a},privilege:"below",style:r,outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}});const c=++this._geometryCounter;this._sizeCache||requestAnimationFrame((()=>{if(c!=this._geometryCounter)return;let t=e.getBoundingClientRect(),i=this._docPanel.getBoundingClientRect();this._sizeCache={width:t.width-i.width,height:t.height,items:d,docPanelWidth:i.width,docPanelHeight:i.height}}))}_updateDocPanel(e,t){var i,s,n;let o=this._docPanel;if(!e)return void this._toggleDocPanel(!1);const r=null!==(n=null===(s=(i=this._renderer).createLoadingDocsIndicator)||void 0===s?void 0:s.call(i))&&void 0!==n?n:this._defaultRenderer.createLoadingDocsIndicator();t.appendChild(r),e.then((e=>{var t,i,s;if(e&&o)if(e.documentation){const n=null!==(s=null===(i=(t=this._renderer).createDocumentationNode)||void 0===i?void 0:i.call(t,e))&&void 0!==s?s:this._defaultRenderer.createDocumentationNode(e);o.textContent="",o.appendChild(n),this._toggleDocPanel(!0)}else this._toggleDocPanel(!1)})).catch((e=>console.error(e))).finally((()=>{t.removeChild(r)}))}_toggleDocPanel(e){let t=this._docPanel;if(e){if(this._docPanelExpanded)return;t.style.display="",this._docPanelExpanded=!0}else{if(!this._docPanelExpanded)return;t.style.display="none",this._docPanelExpanded=!1}const i=this._sizeCache;i&&(i.docPanelHeight=e?this._maxHeight:0,i.docPanelWidth=e?this._docPanelWidth:0,this._geometryLock||this._setGeometry())}}var T;!function(e){class t{constructor(e){this.sanitizer=(null==e?void 0:e.sanitizer)||new v.Sanitizer}createCompletionItemNode(e,t){let i=this._createWrapperNode(e.insertText||e.label);return e.deprecated&&i.classList.add("jp-Completer-deprecated"),this._constructNode(i,this._createLabelNode(e.label),!!e.type,e.type,t,e.icon)}createDocumentationNode(e){const t=document.createElement("div");t.classList.add("jp-RenderedText");const i=this.sanitizer,s=e.documentation||"";return(0,f.renderText)({host:t,sanitizer:i,source:s}).catch(console.error),t}itemWidthHeuristic(e){var t;return e.label.replace(/<(\/)?mark>/g,"").length+((null===(t=e.type)||void 0===t?void 0:t.length)||0)}createLoadingDocsIndicator(){const e=document.createElement("div");e.classList.add("jp-Completer-loading-bar-container");const t=document.createElement("div");return t.classList.add("jp-Completer-loading-bar"),e.append(t),e}_createWrapperNode(e){const t=document.createElement("li");return t.className=x,t.setAttribute("data-value",e),t}_createLabelNode(e){const t=document.createElement("code");return t.className="jp-Completer-match",t.innerHTML=e,t}_constructNode(e,t,i,s,n,o){if(o){const t=o.element({className:"jp-Completer-type jp-Completer-icon"});e.appendChild(t)}else if(i){const t=document.createElement("span");t.textContent=(s[0]||"").toLowerCase();const i=n.indexOf(s)%10+1;t.className="jp-Completer-type jp-Completer-monogram",t.setAttribute("data-color-index",i.toString()),e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-monogram",e.appendChild(t)}if(e.appendChild(t),i){e.title=s;const t=document.createElement("code");t.className="jp-Completer-typeExtended",t.textContent=s.toLocaleLowerCase(),e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-typeExtended",e.appendChild(t)}return e}}let i;e.Renderer=t,e.getDefaultRenderer=function(e){return(!i||e&&i.sanitizer!==e)&&(i=new t({sanitizer:e})),i}}(b||(b={})),function(e){e.keyCodeMap={38:"up",40:"down",33:"pageUp",34:"pageDown"},e.commonSubset=function(e){const t=e.length;let i="";if(t<2)return i;const s=e[0].length;for(let n=0;n<s;n++){const s=e[0][n];for(let o=1;o<t;o++)if(e[o][n]!==s)return i;i+=s}return i},e.nonstandardClick=function(e){return 0!==e.button||e.altKey||e.ctrlKey||e.shiftKey||e.metaKey},e.measureSize=function(e,t){e.isConnected&&console.warn("Measuring connected elements with `measureSize` has side-effects"),e.style.visibility="hidden",e.style.display=t,document.body.appendChild(e);const i=e.getBoundingClientRect();return document.body.removeChild(e),e.removeAttribute("style"),i}}(T||(T={}));class E{constructor(e){var t,i;this._resolveFactory=(e,t)=>e.resolve?i=>e.resolve(t,this._context,i):void 0,this._fetching=0,this._inlineFetching=0,this._providers=e.providers,this._inlineProviders=null!==(t=e.inlineProviders)&&void 0!==t?t:[],this._inlineProvidersSettings=null!==(i=e.inlineProvidersSettings)&&void 0!==i?i:{},this._context=e.context,this._timeout=e.timeout}async applicableProviders(){const e=this._providers.map((e=>e.isApplicable(this._context))),t=await Promise.all(e);return this._providers.filter(((e,i)=>t[i]))}fetchInline(e,t){let i=[];const s=++this._inlineFetching;for(const o of this._inlineProviders){const r=this._inlineProvidersSettings[o.identifier];let l=0;t===n.Automatic&&(l=r.debouncerDelay);const h=()=>{const i=o.fetch(e,{...this._context,triggerKind:t}).then((e=>({...e,items:e.items.map((e=>{const t=e;return t.stream=new a.Signal(t),t.provider=o,this._stream(t,o),t}))}))),s=new Promise((e=>setTimeout((()=>e(null)),l+r.timeout)));return Promise.race([i,s])},d=0===l?h():new Promise(((e,t)=>setTimeout((()=>s!=this._inlineFetching?t(null):e(h())),l)));i.push(d.catch((e=>e)))}return i}async _stream(e,t){if(!e.isIncomplete||!t.stream||!e.token)return;const i=e.stream,s=e.token;e.token=void 0,e.streaming=!0,i.emit(u.StraemEvent.opened);for await(const n of t.stream(s)){const t=n.response,s=t.insertText.substring(e.insertText.length);e.insertText=t.insertText,e.lastStreamed=s,e.error=n.response.error,i.emit(u.StraemEvent.update)}e.isIncomplete=!1,e.lastStreamed=void 0,e.streaming=!1,i.emit(u.StraemEvent.closed)}async fetch(e,t){const i=++this._fetching;let s=[];const n=await this.applicableProviders();for(const o of n){let n;n=o.fetch(e,this._context,t).then((e=>{if(i!==this._fetching)return Promise.reject(void 0);const t=e.items.map((e=>({...e,resolve:this._resolveFactory(o,e)})));return{...e,items:t}}));const r=new Promise((e=>setTimeout((()=>e(null)),this._timeout)));n=Promise.race([n,r]),s.push(n.catch((e=>e)))}const o=Promise.all(s);return this._mergeCompletions(o)}async shouldShowContinuousHint(e,t){const i=await this.applicableProviders();return 0!==i.length&&(i[0].shouldShowContinuousHint?i[0].shouldShowContinuousHint(e,t,this._context):this._defaultShouldShowContinuousHint(e,t))}_alignPrefixes(e,t,i){if(t!=i){const t=this._context.editor;if(!t)return e;const s=t.getCursorPosition(),n=t.getLine(s.line);return n?e.map((e=>{if(e.start==i)return e;let t=n.substring(e.start,i);return{...e,items:e.items.map((e=>{let i=e.insertText||e.label;return e.insertText=i.startsWith(t)?i.slice(t.length):i,e}))}})):e}return e}async _mergeCompletions(e){let t=(await e).filter((e=>!(!e||e instanceof Error||!e.items.length)));if(0==t.length)return null;if(1==t.length)return t[0];const i=Math.min(...t.map((e=>e.end))),s=t.map((e=>e.start)),n=Math.min(...s),o=Math.max(...s);t=this._alignPrefixes(t,n,o);const r=new Set,l=new Array;for(const e of t)e.items.forEach((e=>{let t=(e.insertText||e.label).trim();r.has(t)||(r.add(t),l.push(e))}));return{start:o,end:i,items:l}}_defaultShouldShowContinuousHint(e,t){return!e&&(null==t.sourceChange||t.sourceChange.some((e=>null!=e.insert&&e.insert.length>0)))}}const M="CompletionProvider:context";class k{constructor(){this.identifier=M,this.rank=500,this.renderer=null}async isApplicable(e){return!0}fetch(e,t){const i=t.editor;return i?new Promise((e=>{e(D.contextHint(i))})):Promise.reject("No editor")}}var D;!function(e){e.contextHint=function(e){const t=e.getTokenAtCursor(),i=function(e,t){return t.getTokens().filter((t=>0===t.value.indexOf(e.value)&&t.value!==e.value))}(t,e).filter((e=>e.type)).map((e=>e.value)),s=new Set(i),n=new Array;return s.forEach((e=>n.push({label:e}))),{start:t.offset,end:t.offset+t.value.length,items:n}}}(D||(D={}));const L="CompletionProvider:kernel";class H{constructor(){this.identifier=L,this.rank=550,this.renderer=null}async isApplicable(e){var t;return!!(null===(t=e.session)||void 0===t?void 0:t.kernel)}async fetch(e,t){var i;const s=null===(i=t.session)||void 0===i?void 0:i.kernel;if(!s)throw new Error("No kernel for completion request.");const n={code:e.text,cursor_pos:e.offset},o=(await s.requestComplete(n)).content;if("ok"!==o.status)throw new Error("Completion fetch failed to return successfully.");const r=new Array,l=o.metadata._jupyter_types_experimental;return o.matches.forEach(((e,t)=>{l&&l[t]?r.push({label:e,type:l[t].type,insertText:l[t].text}):r.push({label:e})})),{start:o.cursor_start,end:o.cursor_end,items:r}}async resolve(e,t,i){const{editor:s,session:n}=t;if(n&&s){let t=s.model.sharedModel.getSource();const o=s.getCursorPosition();let l=r.Text.jsIndexToCharIndex(s.getOffsetAt(o),t);const a=n.kernel;if(!t||!a)return Promise.resolve(e);if(i){const{start:e,value:s}=i;t=t.substring(0,e)+s,l+=s.length}const h={code:t,cursor_pos:l,detail_level:0},d=(await a.requestInspect(h)).content;return"ok"===d.status&&d.found?(e.documentation=d.data["text/plain"],e):e}return e}shouldShowContinuousHint(e,t){const i=t.sourceChange;return null==i||!i.some((e=>null!=e.delete))&&i.some((t=>null!=t.insert&&("."===t.insert||!e&&t.insert.trim().length>0)))}}var A=i(97205),q=i(89843);const O="jp-GhostText-streamingIndicator",R="jp-GhostText-errorIndicator";class W{constructor(e){this.options=e}placeGhost(e,t){const i=[F.addMark.of(t)];e.state.field(F.markField,!1)||(i.push(q.StateEffect.appendConfig.of([F.markField])),i.push(q.StateEffect.appendConfig.of([A.EditorView.domEventHandlers({blur:t=>{if(!1===this.options.onBlur(t))return!0;const i=[F.removeMark.of(null)];setTimeout((()=>{e.dispatch({effects:i})}),0)}})]))),e.dispatch({effects:i})}clearGhosts(e){const t=[F.removeMark.of(null)];e.dispatch({effects:t})}}W.streamingAnimation="uncover";class j extends A.WidgetType{constructor(e){super(),this.options=e,this.isSpacer=!1,this._clearErrorTimeout=null}eq(e){return e.content==this.content&&e.options.streaming===this.options.streaming&&e.options.error===this.options.error}get lineBreaks(){return(this.content.match(/\n/g)||"").length}updateDOM(e,t){return this._updateDOM(e),!0}get content(){return this.options.content}toDOM(){let e=document.createElement("span");return this.options.onPointerOver&&e.addEventListener("pointerover",this.options.onPointerOver),this.options.onPointerLeave&&e.addEventListener("pointerleave",this.options.onPointerLeave),e.classList.add("jp-GhostText"),e.dataset.animation=W.streamingAnimation,e.dataset.providedBy=this.options.providerId,this._updateDOM(e),e}_removeErrorAnimation(e){e.querySelectorAll(`.${R}`).forEach((e=>{e.remove()}))}_mountErrorAnimation(e){const t=document.createElement("span");t.className=R;const i=this.options.error;(null==i?void 0:i.message)&&(t.title=null==i?void 0:i.message),e.querySelectorAll(`.${O}, .${R}`).forEach((e=>{e.remove()})),e.appendChild(t)}_updateDOM(e){if(this.options.error)return this._mountErrorAnimation(e),void(this._clearErrorTimeout=setTimeout((()=>{this._removeErrorAnimation(e),this._clearErrorTimeout=null}),5e3));null!==this._clearErrorTimeout&&(clearTimeout(this._clearErrorTimeout),this._removeErrorAnimation(e),this._clearErrorTimeout=null);const t=this.content;let i=this.options.addedPart;if(i&&!this.isSpacer){i.startsWith("\n")&&(i=i.substring(1)),e.innerText=t.substring(0,t.length-i.length);const s=document.createElement("span");s.className="jp-GhostText-streamedToken",s.innerText=i,e.appendChild(s)}else e.innerText=t;if(!this.isSpacer&&this.options.streaming){const t=document.createElement("span");t.className=O,e.appendChild(t)}}destroy(e){this.options.onPointerOver&&e.removeEventListener("pointerover",this.options.onPointerOver),this.options.onPointerLeave&&e.removeEventListener("pointerleave",this.options.onPointerLeave),super.destroy(e)}}class N extends j{constructor(){super(...arguments),this.isSpacer=!0}}class z extends N{toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-lineSpacer"),e}}class B extends N{get content(){return this.options.content[0]}toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-letterSpacer"),e}}var F;!function(e){let t;function i(e,t){return A.Decoration.widget({widget:new j(e),side:1,ghostSpec:e}).range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))}!function(e){e[e.Set=0]="Set",e[e.Remove=1]="Remove",e[e.FilterAndUpdate=2]="FilterAndUpdate"}(t||(t={})),e.addMark=q.StateEffect.define({map:(e,t)=>({...e,from:t.mapPos(e.from),to:t.mapPos(e.from+e.content.length)})}),e.removeMark=q.StateEffect.define(),e.markField=q.StateField.define({create:()=>A.Decoration.none,update(s,n){const o=function(i){for(let s of i.effects){if(s.is(e.addMark))return{action:t.Set,spec:s.value};if(s.is(e.removeMark))return{action:t.Remove}}return i.docChanged||i.selection?{action:t.FilterAndUpdate}:null}(n);if(s=s.update({filter:(e,t,i)=>!(i.spec.widget instanceof N&&i.spec.timeoutInfo.elapsed)}),!o)return s.map(n.changes);switch(o.action){case t.Set:{const e=i(o.spec,n);return s.update({add:[e],filter:(t,i,s)=>s===e.value})}case t.Remove:return s.update({filter:()=>!1});case t.FilterAndUpdate:{let e=s.iter();for(;e.value&&e.value.spec.widget instanceof N;)e.next();if(!e.value)return s.map(n.changes);const t=e.value.spec.ghostSpec,o={...t};let r=!1;n.changes.iterChanges(((e,t,i,s,n)=>{if(!r)if(e===t&&i!==s)for(let e=0;e<n.lines;e++){const t=n.lineAt(e).text,i=e>0?"\n"+t:t;if(!o.content.startsWith(i)){r=!0;break}o.content=o.content.slice(i.length),o.from+=i.length}else r=!0}));const l=r?function(e,t,i=1e3){if(e.content.length<2)return[];const s={elapsed:!1};setTimeout((()=>{s.elapsed=!0}),i);const n=A.Decoration.widget({widget:new B(e),side:1,timeoutInfo:s}),o=A.Decoration.widget({widget:new z(e),side:1,timeoutInfo:s});return[n.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length)),o.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))]}(t,n):[i(o,n)],a=l.map((e=>e.value));if(s=s.update({add:l,filter:(e,t,i)=>a.includes(i)}),r)try{s=s.map(n.changes)}catch(e){return console.warn(e),A.Decoration.none}return s}}},provide:e=>A.EditorView.decorations.from(e)})}(F||(F={}));const V="jp-mod-inline-completer-active",G="jp-InlineCompleter-hover";class U extends w.Widget{constructor(e){var t,i;super({node:document.createElement("div")}),this._clearHoverTimeout=null,this._current=0,this._editor=null,this._lastItem=null,this._model=null,this._providerWidget=new w.Widget,this._showShortcuts=U.defaultSettings.showShortcuts,this._showWidget=U.defaultSettings.showWidget,this._suggestionsCounter=new w.Widget,this._toolbar=new C.Toolbar,this.model=null!==(t=e.model)&&void 0!==t?t:null,this.editor=null!==(i=e.editor)&&void 0!==i?i:null,this.addClass("jp-InlineCompleter"),this._ghostManager=new W({onBlur:this._onEditorBlur.bind(this)}),this._trans=e.trans;const s=this.layout=new w.PanelLayout;s.addWidget(this._suggestionsCounter),s.addWidget(this.toolbar),s.addWidget(this._providerWidget),this._progressBar=document.createElement("div"),this._progressBar.className="jp-InlineCompleter-progressBar",this.node.appendChild(this._progressBar),this._updateShortcutsVisibility(),this._updateDisplay(),this.node.tabIndex=0}get toolbar(){return this._toolbar}get editor(){return this._editor}set editor(e){var t;null===(t=this.model)||void 0===t||t.reset(),this._editor=e}get model(){return this._model}set model(e){(e||this._model)&&e!==this._model&&(this._model&&(this._model.suggestionsChanged.disconnect(this._onModelSuggestionsChanged,this),this._model.filterTextChanged.disconnect(this._onModelFilterTextChanged,this),this._model.provisionProgress.disconnect(this._onProvisionProgress,this)),this._model=e,this._model&&(this._model.suggestionsChanged.connect(this._onModelSuggestionsChanged,this),this._model.filterTextChanged.connect(this._onModelFilterTextChanged,this),this._model.provisionProgress.connect(this._onProvisionProgress,this)))}cycle(e){var t,i;const s=null===(i=null===(t=this.model)||void 0===t?void 0:t.completions)||void 0===i?void 0:i.items;if(s){if("next"===e){const e=this._current+1;this._current=e===s.length?0:e}else{const e=this._current-1;this._current=-1===e?s.length-1:e}this._updateStreamTracking(),this._render()}}accept(){const e=this.model,t=this.current,i=this._editor;if(!i||!e||!t)return;const s=e.cursor,n=t.insertText,o=i.getOffsetAt(i.getCursorPosition()),r=i.getOffsetAt(s),l=r,a=o;i.model.sharedModel.updateSource(r,o,n),o<=a&&o>=l&&i.setCursorPosition(i.getPositionAt(l+n.length)),e.reset(),this.update()}get current(){var e;const t=null===(e=this.model)||void 0===e?void 0:e.completions;return t?t.items[this._current]:null}_updateStreamTracking(){this._lastItem&&this._lastItem.stream.disconnect(this._onStream,this);const e=this.current;e&&e.stream.connect(this._onStream,this),this._lastItem=e}_onStream(e,t){var i;const s=null===(i=this.model)||void 0===i?void 0:i.completions;if(!s||!s.items||0===s.items.length)return;if(this.isHidden)return;const n=s.items[this._current];this._setText(n)}configure(e){this._showWidget=e.showWidget,this._updateDisplay(),e.showShortcuts!==this._showShortcuts&&(this._showShortcuts=e.showShortcuts,this._updateShortcutsVisibility()),W.streamingAnimation=e.streamingAnimation}handleEvent(e){if(!this.isHidden&&this._editor)switch(e.type){case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e)}}onUpdateRequest(e){super.onUpdateRequest(e);const t=this._model;if(!t)return;let i=t.completions;i&&i.items&&0!==i.items.length?this.isHidden&&(this.show(),this._setGeometry()):this.isHidden||this.hide()}onAfterAttach(e){document.addEventListener("scroll",this,!0),document.addEventListener("pointerdown",this,!0)}onBeforeDetach(e){document.removeEventListener("scroll",this,!0),document.removeEventListener("pointerdown",this,!0)}_evtPointerdown(e){var t;if(this.isHidden||!this._editor)return;const i=e.target;if(this.node.contains(i))return!0;this.hide(),null===(t=this.model)||void 0===t||t.reset()}_evtScroll(e){if(this.isHidden||!this._editor)return;const{node:t}=this;t.contains(e.target)||requestAnimationFrame((()=>{this._setGeometry()}))}_onEditorBlur(e){var t;if(this.node.contains(e.relatedTarget))return!1;null===(t=this._editor)||void 0===t||t.host.classList.remove(V),this.hide()}_onModelSuggestionsChanged(e,t){var i;if(this.isAttached){if("set"===t.event)this._current=null!==(i=t.indexMap.get(this._current))&&void 0!==i?i:0;else if("clear"===t.event){const e=this.editor;e&&(this._ghostManager.clearGhosts(e.editor),e.host.classList.remove(V))}this._updateStreamTracking(),this.update(),this._render()}else this.update()}_onModelFilterTextChanged(e,t){var i,s;const n=null===(i=this.model)||void 0===i?void 0:i.completions;n&&n.items&&0!==n.items.length&&(this._current=null!==(s=t.get(this._current))&&void 0!==s?s:0,this._updateStreamTracking(),setTimeout((()=>{this._render(),this._setGeometry()}),0))}_onProvisionProgress(e,t){requestAnimationFrame((()=>{0===t.pendingProviders?this._progressBar.style.display="none":(this._progressBar.style.display="",this._progressBar.style.width=100*t.pendingProviders/t.totalProviders+"%")}))}_render(){var e,t;const i=null===(e=this.model)||void 0===e?void 0:e.completions;if(!i||!i.items||0===i.items.length)return;const s=i.items[this._current];this._setText(s),"never"!==this._showWidget&&(this._suggestionsCounter.node.innerText=this._trans.__("%1/%2",this._current+1,i.items.length),this._providerWidget.node.title=this._trans.__("Provider: %1",s.provider.name),(null!==(t=s.provider.icon)&&void 0!==t?t:C.kernelIcon).render(this._providerWidget.node))}_setText(e){const t=e.insertText,i=this._editor,s=this._model;if(!s||!i)return;const n=i.editor;this._ghostManager.placeGhost(n,{from:i.getOffsetAt(s.cursor),content:t,providerId:e.provider.identifier,addedPart:e.lastStreamed,streaming:e.streaming,onPointerOver:this._onPointerOverGhost.bind(this),onPointerLeave:this._onPointerLeaveGhost.bind(this),error:e.error}),i.host.classList.add(V)}_onPointerOverGhost(){null!==this._clearHoverTimeout&&(window.clearTimeout(this._clearHoverTimeout),this._clearHoverTimeout=null),this.node.classList.add(G)}_onPointerLeaveGhost(){this._clearHoverTimeout=window.setTimeout((()=>this.node.classList.remove(G)),500)}_setGeometry(){const{node:e}=this,t=this._model,i=this._editor;if(!i||!t||!t.cursor)return;const s=i.host.closest(".jp-MainAreaWidget > .lm-Widget")||i.host;let n;try{const e=i.getCoordinateForPosition(t.cursor);if(!e)throw Error("No coordinates for cursor position");n=e}catch(e){return void this.hide()}C.HoverBox.setGeometry({anchor:n,host:s,maxHeight:40,minHeight:20,node:e,privilege:"forceAbove",outOfViewDisplay:{top:"stick-outside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}})}_updateShortcutsVisibility(){this.node.dataset.showShortcuts=this._showShortcuts+""}_updateDisplay(){this.node.dataset.display=this._showWidget}}!function(e){e.defaultSettings={showWidget:"onHover",showShortcuts:!0,streamingAnimation:"uncover",providers:{}},e.Model=class{constructor(){this.suggestionsChanged=new a.Signal(this),this.filterTextChanged=new a.Signal(this),this.provisionProgress=new a.Signal(this),this._isDisposed=!1,this._completions=null}setCompletions(e){var t,i;const s=new Map(null===(i=null===(t=this._completions)||void 0===t?void 0:t.items)||void 0===i?void 0:i.map(((e,t)=>[e.insertText,t])));this._completions=e;const n=new Map(e.items.map(((e,t)=>[s.get(e.insertText),t])));this.suggestionsChanged.emit({event:"set",indexMap:n})}appendCompletions(e){this._completions&&this._completions.items?(this._completions.items.push(...e.items),this.suggestionsChanged.emit({event:"append"})):console.warn("No completions to append to")}notifyProgress(e){this.provisionProgress.emit(e)}get cursor(){return this._cursor}set cursor(e){this._cursor=e}get completions(){return this._completions}reset(){this._completions=null,this.suggestionsChanged.emit({event:"clear"})}get isDisposed(){return this._isDisposed}handleTextChange(e){var t;const i=this._completions;if(!i||!i.items||0===i.items.length)return;const s=new Map(i.items.map(((e,t)=>[e,t])));for(let s of null!==(t=e.sourceChange)&&void 0!==t?t:[]){const e=s.insert;if(e){const t=i.items.filter((t=>{var i;const s=null!==(i=t.filterText)&&void 0!==i?i:t.insertText;return!!s.startsWith(e)&&(t.filterText=s.substring(e.length),t.insertText=t.insertText.substring(e.length),!0)}));0===t.length&&(this._completions=null),i.items=t}else s.retain||(this._completions=null)}const n=new Map(i.items.map(((e,t)=>[s.get(e),t])));this.filterTextChanged.emit(n)}handleSelectionChange(e){const t=this.cursor;if(!t)return;const{start:i,end:s}=e;i.column===s.column&&i.line===s.line||this.reset(),(i.line!==t.line||i.column<t.column)&&this.reset()}dispose(){this._isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}}}(U||(U={}));class ${constructor(){this._activeProviders=new Set([L,M]),this._inlineCompleterSettings=U.defaultSettings,this._providers=new Map,this._inlineProviders=new Map,this._panelHandlers=new Map,this._mostRecentContext=new Map,this._activeProvidersChanged=new a.Signal(this),this._selected=new a.Signal(this),this._inlineCompleterFactory=null}get activeProvidersChanged(){return this._activeProvidersChanged}get selected(){return this._selected}setTimeout(e){this._timeout=e}setShowDocumentationPanel(e){this._panelHandlers.forEach((t=>t.completer.showDocsPanel=e)),this._showDoc=e}setContinuousHinting(e){this._panelHandlers.forEach((t=>t.autoCompletion=e)),this._autoCompletion=e}registerProvider(e){const t=e.identifier;this._providers.has(t)?console.warn(`Completion provider with identifier ${t} is already registered`):(this._providers.set(t,e),this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})))}registerInlineProvider(e){const t=e.identifier;this._inlineProviders.has(t)?console.warn(`Completion provider with identifier ${t} is already registered`):(this._inlineProviders.set(t,e),this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})))}getProviders(){return this._providers}activateProvider(e){this._activeProviders=new Set([]),e.forEach((e=>{this._providers.has(e)&&this._activeProviders.add(e)})),0===this._activeProviders.size&&(this._activeProviders.add(L),this._activeProviders.add(M)),this._activeProvidersChanged.emit()}async updateCompleter(e){var t,i;const{widget:s,editor:n,sanitizer:o}=e,r=s.id,l=this._panelHandlers.get(r),a=[...this._activeProviders][0],h=this._providers.get(a);let d=null!==(t=null==h?void 0:h.renderer)&&void 0!==t?t:b.getDefaultRenderer(o);const c=null==h?void 0:h.modelFactory;let u;u=c?await c.call(h,e):new _,this._mostRecentContext.set(s.id,e);const m={model:u,editor:n,renderer:d,sanitizer:o,showDoc:this._showDoc};if(l){const t=l.completer;null===(i=t.model)||void 0===i||i.dispose(),t.model=m.model,t.renderer=m.renderer,t.showDocsPanel=m.showDoc,l.autoCompletion=this._autoCompletion,n&&(l.editor=n,l.reconciliator=await this.generateReconciliator(e))}else{const t=await this._generateHandler(e,m);this._panelHandlers.set(s.id,t),t.completer.selected.connect(((e,t)=>this._selected.emit({insertText:t}))),s.disposed.connect((e=>{this.disposeHandler(e.id,t),this._mostRecentContext.delete(r)}))}}invoke(e){const t=this._panelHandlers.get(e);t&&t.invoke()}select(e){const t=this._panelHandlers.get(e);t&&t.completer.selectActive()}setInlineCompleterFactory(e){this._inlineCompleterFactory=e,this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})),this.inline||(this.inline={invoke:e=>{const t=this._panelHandlers.get(e);t&&t.inlineCompleter&&t.invokeInline()},cycle:(e,t)=>{const i=this._panelHandlers.get(e);i&&i.inlineCompleter&&i.inlineCompleter.cycle(t)},accept:e=>{const t=this._panelHandlers.get(e);t&&t.inlineCompleter&&t.inlineCompleter.accept()},configure:e=>{this._inlineCompleterSettings=e,this._panelHandlers.forEach(((t,i)=>{for(const[t,i]of this._inlineProviders.entries())i.configure&&i.configure(e.providers[t]);t.inlineCompleter&&t.inlineCompleter.configure(e),this.updateCompleter(this._mostRecentContext.get(i))}))}})}get inlineProviders(){return[...this._inlineProviders.values()]}async generateReconciliator(e){const t=[];for(const[e,i]of Object.entries(this._inlineCompleterSettings.providers))!0===i.enabled&&t.push(e);const i=[...this._inlineProviders.values()].filter((e=>t.includes(e.identifier))),s=[];for(const e of this._activeProviders){const t=this._providers.get(e);t&&s.push(t)}return new E({context:e,providers:s,inlineProviders:i,inlineProvidersSettings:this._inlineCompleterSettings.providers,timeout:this._timeout})}disposeHandler(e,t){var i,s,n,o;null===(i=t.completer.model)||void 0===i||i.dispose(),t.completer.dispose(),null===(n=null===(s=t.inlineCompleter)||void 0===s?void 0:s.model)||void 0===n||n.dispose(),null===(o=t.inlineCompleter)||void 0===o||o.dispose(),t.dispose(),this._panelHandlers.delete(e)}async _generateHandler(e,t){const i=new b(t),s=this._inlineCompleterFactory?this._inlineCompleterFactory.factory({...t,model:new U.Model}):void 0;i.hide(),w.Widget.attach(i,document.body),s&&(w.Widget.attach(s,document.body),s.hide(),s.configure(this._inlineCompleterSettings));const n=await this.generateReconciliator(e),o=new u({completer:i,inlineCompleter:s,reconciliator:n});return o.editor=e.editor,o}}const K=new C.LabIcon({name:"completer:inline",svgstr:'<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">\n <path class="jp-icon4" fill="#bbbbbb" d="M17 15H3v2h14v-2Zm0-8h-6v2h6V7ZM3 13h18v-2H3v2Zm0 8h18v-2H3v2Z"/>\n <path class="jp-icon1" fill="#616161" d="M3 3v2h18V3H3ZM3 7v2h8V7H3Z"/>\n</svg>\n'}),Z=new C.LabIcon({name:"completer:widget",svgstr:'<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">\n<g fill="#616161" class="jp-icon2 jp-icon-selectable">\n <path d="M6 8h16v14.3H6z" style="fill:#eee;stroke:#444;stroke-linejoin:round"/>\n <path d="M3 3v2h10V3H3Z" transform="matrix(.8 0 0 1 .5 0)"/>\n</g>\n<g class="jp-icon3 jp-icon-selectable">\n <path fill="#616161" d="M18 14.1H8v2h11v-2ZM8 12.1H20V10.1H8v2Zm0 8H20v-2H8v3Z"/>\n</g>\n</svg>\n'});var J=i(70858);class Q{constructor(e){this.options=e,this.identifier="@jupyterlab/inline-completer:history",this._maxSuggestions=100;const t=e.translator||J.nullTranslator;this._trans=t.load("jupyterlab")}get name(){return this._trans.__("History")}get icon(){return C.historyIcon}get schema(){return{properties:{maxSuggestions:{title:this._trans.__("Maximum number of suggestions"),description:this._trans.__("The maximum number of suggestions to retrieve from history."),type:"number"}},default:{enabled:!1,maxSuggestions:100}}}configure(e){var t;this._maxSuggestions=null!==(t=e.maxSuggestions)&&void 0!==t?t:100}async fetch(e,t,i){var s;const n=null===(s=t.session)||void 0===s?void 0:s.kernel;if(!n)throw new Error("No kernel for completion request.");const o=e.text.slice(0,e.offset).split("\n").slice(-1)[0],r={output:!1,raw:!0,hist_access_type:"search",pattern:o+"*",unique:!0,n:this._maxSuggestions},l=await n.requestHistory(r),a=[];if(""===o)return{items:[]};if("ok"===l.content.status)for(const e of l.content.history){const t=e[2].split("\n");for(let e=0;e<t.length;e++){const i=t[e];if(i.startsWith(o)){const s=i.slice(o.length,i.length)+"\n"+t.slice(e+1).join("\n");a.push({insertText:s})}}}return{items:a}}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2944],{62944:(e,t,i)=>{i.r(t),i.d(t,{CONTEXT_PROVIDER_ID:()=>M,Completer:()=>b,CompleterModel:()=>_,CompletionHandler:()=>u,CompletionProviderManager:()=>$,CompletionTriggerKind:()=>s,ContextCompleterProvider:()=>k,HistoryInlineCompletionProvider:()=>Q,ICompletionProviderManager:()=>c,IInlineCompleterFactory:()=>d,InlineCompleter:()=>U,InlineCompletionTriggerKind:()=>n,KERNEL_PROVIDER_ID:()=>L,KernelCompleterProvider:()=>H,ProviderReconciliator:()=>E,completerWidgetIcon:()=>Z,inlineCompleterIcon:()=>K});var s,n,o=i(52712),r=i(44548),l=i(49503),a=i(81997),h=i(20998);!function(e){e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions"}(s||(s={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(n||(n={}));const d=new h.Token("@jupyterlab/completer:IInlineCompleterFactory","A factory of inline completer widgets."),c=new h.Token("@jupyterlab/completer:ICompletionProviderManager","A service for the completion providers management.");class u{constructor(e){this._fetchingInline=0,this._editor=null,this._enabled=!1,this._isDisposed=!1,this._autoCompletion=!1,this._continuousInline=!0,this.completer=e.completer,this.inlineCompleter=e.inlineCompleter,this.completer.selected.connect(this.onCompletionSelected,this),this.completer.visibilityChanged.connect(this.onVisibilityChanged,this),this._reconciliator=e.reconciliator}set reconciliator(e){this._reconciliator=e}get editor(){return this._editor}set editor(e){if(e===this._editor)return;let t=this._editor;if(t&&!t.isDisposed){const e=t.model;t.host.classList.remove(o.COMPLETER_ENABLED_CLASS),t.host.classList.remove(o.COMPLETER_ACTIVE_CLASS),e.selections.changed.disconnect(this.onSelectionsChanged,this),e.sharedModel.changed.disconnect(this._onSharedModelChanged,this)}if(this.completer.reset(),this.completer.editor=e,t=this._editor=e,t){const e=t.model;this._enabled=!1,e.selections.changed.connect(this.onSelectionsChanged,this),e.sharedModel.changed.connect(this._onSharedModelChanged,this),this.onSelectionsChanged(),this.inlineCompleter&&(this.inlineCompleter.editor=t)}}get isDisposed(){return this._isDisposed}set autoCompletion(e){this._autoCompletion=e}get autoCompletion(){return this._autoCompletion}dispose(){this.isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}invokeInline(){const e=this._editor;e&&this._makeInlineRequest(e.getCursorPosition(),n.Invoke).catch((e=>{console.warn("Inline invoke request bailed",e)}))}invoke(){l.MessageLoop.sendMessage(this,u.Msg.InvokeRequest)}processMessage(e){e.type===u.Msg.InvokeRequest.type&&this.onInvokeRequest(e)}getState(e,t){return{text:e.model.sharedModel.getSource(),line:t.line,column:t.column}}onCompletionSelected(e,t){const i=e.model,s=this._editor;if(!s||!i)return;const n=i.createPatch(t);if(!n)return;const{start:o,end:r,value:l}=n,a=s.getOffsetAt(s.getCursorPosition());s.model.sharedModel.updateSource(o,r,l),a<=r&&a>=o&&s.setCursorPosition(s.getPositionAt(o+l.length))}onInvokeRequest(e){if(!this.completer.model)return;if(this.completer.model.original)return;const t=this._editor;t&&this._makeRequest(t.getCursorPosition(),s.Invoked).catch((e=>{console.warn("Invoke request bailed",e)}))}onSelectionsChanged(){var e;const t=this.completer.model,i=this._editor;if(!i)return;const s=null===(e=this.inlineCompleter)||void 0===e?void 0:e.model;s&&s.handleSelectionChange(i.getSelection());const n=i.host;if(!t)return this._enabled=!1,void n.classList.remove(o.COMPLETER_ENABLED_CLASS);if(t.subsetMatch)return;const r=i.getCursorPosition(),l=i.getLine(r.line);if(!l)return this._enabled=!1,t.reset(!0),void n.classList.remove(o.COMPLETER_ENABLED_CLASS);const{start:a,end:h}=i.getSelection();return a.column!==h.column||a.line!==h.line||l.slice(0,r.column).match(/^\s*$/)?(this._enabled=!1,t.reset(!0),void n.classList.remove(o.COMPLETER_ENABLED_CLASS)):(this._enabled||(this._enabled=!0,n.classList.add(o.COMPLETER_ENABLED_CLASS)),void t.handleCursorChange(this.getState(i,i.getCursorPosition())))}async onTextChanged(e,t){var i;if(!this._enabled)return;const o=this.completer.model,r=this.editor;if(!r)return;o&&this._autoCompletion&&this._reconciliator.shouldShowContinuousHint&&await this._reconciliator.shouldShowContinuousHint(this.completer.isVisible,t)&&this._makeRequest(r.getCursorPosition(),s.TriggerCharacter);const l=null===(i=this.inlineCompleter)||void 0===i?void 0:i.model;if(l&&(l.handleTextChange(t),this._continuousInline&&this._makeInlineRequest(r.getCursorPosition(),n.Automatic)),o){const{start:e,end:t}=r.getSelection();if(e.column!==t.column||e.line!==t.line)return;o.handleTextChange(this.getState(r,r.getCursorPosition()))}}onVisibilityChanged(e){e.isDisposed||e.isHidden?this._editor&&(this._editor.host.classList.remove(o.COMPLETER_ACTIVE_CLASS),this._editor.focus()):this._editor&&this._editor.host.classList.add(o.COMPLETER_ACTIVE_CLASS)}async _onSharedModelChanged(e,t){t.sourceChange&&await this.onTextChanged(e,t)}_makeRequest(e,t){const i=this.editor;if(!i)return Promise.reject(new Error("No active editor"));const s=this._composeRequest(i,e),n=this.getState(i,e);return this._reconciliator.fetch(s,t).then((e=>{if(!e)return;const t=this._updateModel(n,e.start,e.end);t&&t.setCompletionItems&&t.setCompletionItems(e.items)})).catch((e=>{}))}async _makeInlineRequest(e,t){const i=this.editor;if(!i)return Promise.reject(new Error("No active editor"));if(!this.inlineCompleter)return Promise.reject(new Error("No inline completer"));const s=i.getLine(e.line);if(t===n.Automatic&&(void 0===s||e.column<s.length))return;const o=this._composeRequest(i,e),r=this.inlineCompleter.model;if(!r)return;r.cursor=e;const l=++this._fetchingInline,a=this._reconciliator.fetchInline(o,t),h=new Set;for(const e of a)e.then((t=>{t&&t.items&&l===this._fetchingInline&&(h.add(e),1===h.size?r.setCompletions(t):r.appendCompletions(t))})).catch((e=>{console.warn(e)})).finally((()=>{h.add(e);const t=a.length-h.size;r.notifyProgress({pendingProviders:t,totalProviders:a.length})}))}_composeRequest(e,t){const i=e.model.sharedModel.getSource(),s=e.model.mimeType;return{text:i,offset:r.Text.jsIndexToCharIndex(e.getOffsetAt(t),i),mimeType:s}}_updateModel(e,t,i){const s=this.completer.model,n=e.text;return s?(s.original=e,s.cursor={start:r.Text.charIndexToJsIndex(t,n),end:r.Text.charIndexToJsIndex(i,n)},s):null}}!function(e){let t,i;!function(e){e[e.opened=0]="opened",e[e.update=1]="update",e[e.closed=2]="closed"}(t=e.StraemEvent||(e.StraemEvent={})),function(e){e.InvokeRequest=new l.Message("invoke-request")}(i=e.Msg||(e.Msg={}))}(u||(u={}));var m,p=i(33625);function g(e){const t=document.createElement("span");return t.textContent=e,t.innerHTML}class _{constructor(){this.processedItemsCache=null,this._current=null,this._cursor=null,this._isDisposed=!1,this._completionItems=[],this._original=null,this._query="",this._subsetMatch=!1,this._typeMap={},this._orderedTypes=[],this._stateChanged=new a.Signal(this),this._queryChanged=new a.Signal(this),this._processedToOriginalItem=null,this._resolvingItem=0}get stateChanged(){return this._stateChanged}get queryChanged(){return this._queryChanged}get original(){return this._original}set original(e){this._original===e||this._original&&e&&h.JSONExt.deepEqual(e,this._original)||(this._reset(),this._current=this._original=e,this._stateChanged.emit(void 0))}get current(){return this._current}set current(e){if(this._current===e||this._current&&e&&h.JSONExt.deepEqual(e,this._current))return;const t=this._original;if(!t)return;const i=this._cursor;if(!i)return;const s=this._current=e;if(!s)return void this._stateChanged.emit(void 0);const n=t.text.split("\n")[t.line],o=s.text.split("\n")[s.line];if(!this._subsetMatch&&o.length<n.length)return void this.reset(!0);const{start:r,end:l}=i;let a=s.text.substring(r);const d=t.text.substring(l);a=a.substring(0,a.lastIndexOf(d)),this._query=a,this.processedItemsCache=null,this._processedToOriginalItem=null,this._queryChanged.emit({newValue:this._query,origin:"editorUpdate"}),this._stateChanged.emit(void 0)}get cursor(){return this._cursor}set cursor(e){this.original&&(this._cursor=e)}get query(){return this._query}set query(e){this._query=e,this.processedItemsCache=null,this._processedToOriginalItem=null,this._queryChanged.emit({newValue:this._query,origin:"setter"})}get subsetMatch(){return this._subsetMatch}set subsetMatch(e){this._subsetMatch=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}completionItems(){if(!this.processedItemsCache){let e=this._query;if(e){const t=this._markup(e);this.processedItemsCache=t.map((e=>e.processedItem)),this._processedToOriginalItem=new WeakMap(t.map((e=>[e.processedItem,e.originalItem])))}else this.processedItemsCache=this._completionItems.map((e=>this._escapeItemLabel(e))),this._processedToOriginalItem=null}return this.processedItemsCache}setCompletionItems(e){h.JSONExt.deepEqual(e,this._completionItems)||(this._completionItems=e,this._orderedTypes=m.findOrderedCompletionItemTypes(this._completionItems),this.processedItemsCache=null,this._processedToOriginalItem=null,this._stateChanged.emit(void 0))}typeMap(){return this._typeMap}orderedTypes(){return this._orderedTypes}handleCursorChange(e){if(!this._original)return;const{column:t,line:i}=e,{current:s,original:n}=this;if(!n)return;if(i!==n.line)return void this.reset(!0);if(t<n.column)return void this.reset(!0);const{cursor:o}=this;if(!o||!s)return;const r=o.end-o.start,l=n.text.split("\n")[n.line],a=s.text.split("\n")[s.line].length-l.length;t>n.column+r+a&&this.reset(!0)}handleTextChange(e){const t=this._original;if(!t)return;const{text:i,column:s,line:n}=e,o=i.split("\n")[n][s-1];o&&o.match(/\S/)||e.column>=t.column?this.current=e:this.reset(!1)}createPatch(e){const t=this._original,i=this._cursor,s=this._current;if(!t||!i||!s)return;let{start:n,end:o}=i;return o+=s.text.length-t.text.length,{start:n,end:o,value:e}}reset(e=!1){!e&&this._subsetMatch||(this._reset(),this._stateChanged.emit(void 0))}_markup(e){var t;const i=this._completionItems;let s=[];for(const n of i){const i=n.label.indexOf("("),o=i>-1?n.label.substring(0,i):n.label,r=p.StringExt.matchSumOfSquares(g(o),e);if(r){let e=p.StringExt.highlight(g(n.label),r.indices,m.mark);const i=Object.assign({},n);i.label=e.join(""),i.insertText=null!==(t=n.insertText)&&void 0!==t?t:n.label,s.push({item:i,score:r.score,originalItem:n})}}return s.sort(m.scoreCmp),s.map((e=>({processedItem:e.item,originalItem:e.originalItem})))}resolveItem(e){let t,i;if("number"==typeof e){const i=this.completionItems();if(!i||!i[e])return;t=i[e]}else t=e;if(t)return i=this._processedToOriginalItem?this._processedToOriginalItem.get(t):t,i?this._resolveItemByValue(i):void 0}_resolveItemByValue(e){const t=++this._resolvingItem;let i;if(e.resolve){let t;e.insertText&&(t=this.createPatch(e.insertText)),i=e.resolve(t)}else i=Promise.resolve(e);return i.then((i=>(this._escapeItemLabel(i,!0),Object.keys(i).forEach((t=>{e[t]=i[t]})),e.resolve=void 0,t!==this._resolvingItem?Promise.resolve(null):i))).catch((t=>(console.error(t),Promise.resolve(e))))}_escapeItemLabel(e,t=!1){var i;const s=g(e.label);if(s!==e.label){const n=t?e:Object.assign({},e);return n.insertText=null!==(i=e.insertText)&&void 0!==i?i:e.label,n.label=s,n}return e}_reset(){const e=this._query;this._current=null,this._cursor=null,this._completionItems=[],this._original=null,this._query="",this.processedItemsCache=null,this._processedToOriginalItem=null,this._subsetMatch=!1,this._typeMap={},this._orderedTypes=[],e&&this._queryChanged.emit({newValue:this._query,origin:"reset"})}}!function(e){const t=["function","instance","class","module","keyword"],i=t.reduce(((e,t)=>(e[t]=null,e)),{});e.mark=function(e){return`<mark>${e}</mark>`},e.scoreCmp=function(e,t){var i,s,n;const o=e.score-t.score;return 0!==o?o:null!==(n=null===(i=e.item.insertText)||void 0===i?void 0:i.localeCompare(null!==(s=t.item.insertText)&&void 0!==s?s:""))&&void 0!==n?n:0},e.findOrderedCompletionItemTypes=function(e){const i=new Set;e.forEach((e=>{!e.type||t.includes(e.type)||i.has(e.type)||i.add(e.type)}));const s=Array.from(i);return s.sort(((e,t)=>e.localeCompare(t))),t.concat(s)},e.findOrderedTypes=function(e){const s=Object.keys(e).map((t=>e[t])).filter((e=>!!e&&!(e in i))).sort(((e,t)=>e.localeCompare(t)));return t.concat(s)}}(m||(m={}));var v=i(15465),f=i(50102),C=i(12668),y=i(18395),w=i(63485);const x="jp-Completer-item",P="jp-mod-active",I="jp-Completer-list",S=!0;class b extends w.Widget{constructor(e){var t,i,s,n;super({node:document.createElement("div")}),this._activeIndex=0,this._editor=null,this._model=null,this._selected=new a.Signal(this),this._visibilityChanged=new a.Signal(this),this._indexChanged=new a.Signal(this),this._lastSubsetMatch="",this._geometryLock=!1,this._geometryCounter=0,this._docPanelExpanded=!1,this._renderCounter=0,this.sanitizer=null!==(t=e.sanitizer)&&void 0!==t?t:new v.Sanitizer,this._defaultRenderer=b.getDefaultRenderer(this.sanitizer),this._renderer=null!==(i=e.renderer)&&void 0!==i?i:this._defaultRenderer,this._docPanel=this._createDocPanelNode(),this.model=null!==(s=e.model)&&void 0!==s?s:null,this.editor=null!==(n=e.editor)&&void 0!==n?n:null,this.addClass("jp-Completer"),this._updateConstraints()}_updateConstraints(){const e=document.createElement("div");e.classList.add(I),e.style.visibility="hidden",e.style.overflowY="scroll",document.body.appendChild(e);const t=window.getComputedStyle(e);this._maxHeight=parseInt(t.maxHeight,10),this._minHeight=parseInt(t.minHeight,10),this._scrollbarWidth=e.offsetWidth-e.clientWidth,document.body.removeChild(e);const i=this._createDocPanelNode();this._docPanelWidth=T.measureSize(i,"inline-block").width}get activeIndex(){return this._activeIndex}get editor(){return this._editor}set editor(e){this._editor=e}get selected(){return this._selected}get visibilityChanged(){return this._visibilityChanged}get indexChanged(){return this._indexChanged}get model(){return this._model}set model(e){(e||this._model)&&e!==this._model&&(this._model&&(this._model.stateChanged.disconnect(this.onModelStateChanged,this),this._model.queryChanged.disconnect(this.onModelQueryChanged,this)),this._model=e,this._model&&(this._model.stateChanged.connect(this.onModelStateChanged,this),this._model.queryChanged.connect(this.onModelQueryChanged,this)))}get renderer(){return this._renderer}set renderer(e){this._renderer=e}set showDocsPanel(e){this._showDoc=e}get showDocsPanel(){return this._showDoc}dispose(){this._sizeCache=void 0,this._model=null,super.dispose()}handleEvent(e){if(!this.isHidden&&this._editor)switch(e.type){case"keydown":this._evtKeydown(e);break;case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e)}}reset(){this._activeIndex=0,this._lastSubsetMatch="",this._model&&this._model.reset(!0),this._docPanel.style.display="none",this._sizeCache=void 0,this.node.scrollTop=0}selectActive(){const e=this.node.querySelector(`.${P}`);e?(this._selected.emit(e.getAttribute("data-value")),this.reset()):this.reset()}onAfterAttach(e){document.addEventListener("keydown",this,S),document.addEventListener("pointerdown",this,S),document.addEventListener("scroll",this,S)}onBeforeDetach(e){document.removeEventListener("keydown",this,S),document.removeEventListener("pointerdown",this,S),document.removeEventListener("scroll",this,S)}onModelStateChanged(){this.isAttached&&(this._activeIndex=0,this._indexChanged.emit(this._activeIndex),this.update())}onModelQueryChanged(e,t){if(this._sizeCache&&"editorUpdate"===t.origin){const t=e.completionItems(),i=this._sizeCache.items,s=i[this._findWidestItemIndex(i)],n=t[this._findWidestItemIndex(t)],o=this._getPreferredItemWidthHeuristic();t.length===this._sizeCache.items.length&&o(s)===o(n)||(this._sizeCache=void 0)}}onUpdateRequest(e){var t;const i=this._model;if(!i)return;i.query||this._populateSubset();let s=i.completionItems();if(!s.length)return void(this.isHidden||(this.reset(),this.hide(),this._visibilityChanged.emit(void 0)));this._updateConstraints(),this._geometryLock=!0;const n=this._createCompleterNode(i,s);let o=n.querySelectorAll(`.${x}`)[this._activeIndex];o.classList.add(P);const r=null===(t=this.model)||void 0===t?void 0:t.resolveItem(s[this._activeIndex]);this._showDoc&&(this._docPanel.innerText="",n.appendChild(this._docPanel),this._docPanelExpanded=!1,this._docPanel.style.display="none",this._updateDocPanel(r,o)),this.isHidden?(this.show(),this._setGeometry(),this._visibilityChanged.emit(void 0)):this._setGeometry(),this._geometryLock=!1}get sizeCache(){if(this._sizeCache)return{width:this._sizeCache.width+this._sizeCache.docPanelWidth,height:Math.max(this._sizeCache.height,this._sizeCache.docPanelHeight)}}_createDocPanelNode(){const e=document.createElement("div");return e.className="jp-Completer-docpanel",e}_createCompleterNode(e,t){const i=++this._renderCounter;let s=this.node;s.textContent="";let n=e.orderedTypes(),o=document.createElement("ul");o.className=I;const r=this._renderer.createCompletionItemNode(t[0],n),l=[r],a=T.measureSize(r,"inline-grid"),h=Math.max(Math.ceil(this._maxHeight/a.height),5),d=Math.min(h+1,t.length),c=performance.now();for(let e=1;e<d;e++){const i=this._renderer.createCompletionItemNode(t[e],n);l.push(i)}for(const e of l)o.appendChild(e);const u=this._findWidestItemIndex(t),m=u<l.length?l[u]:this._renderer.createCompletionItemNode(t[u],n),p=T.measureSize(m.cloneNode(!0),"inline-grid");if(this._sizeCache={height:Math.min(this._maxHeight,a.height*t.length),width:p.width+this._scrollbarWidth,items:t,docPanelWidth:0,docPanelHeight:0},d<t.length){const e=(performance.now()-c)/d,s=Math.max(5,Math.floor(12/e));let r=d,h=l[l.length-1];const u=()=>{if(r>=t.length)return;const e=a.height*(t.length-r);h.style.marginBottom=`${e}px`,requestAnimationFrame((()=>{if(i!=this._renderCounter)return;h.style.marginBottom="";const e=Math.min(t.length,r+s);for(let i=r;i<e;i++){const e=this._renderer.createCompletionItemNode(t[i],n);o.appendChild(e),h=e}r=e,u()}))};u()}return s.appendChild(o),s}_findWidestItemIndex(e){const t=this._getPreferredItemWidthHeuristic(),i=e.map(t);return i.indexOf(Math.max(...i))}_getPreferredItemWidthHeuristic(){return this._renderer.itemWidthHeuristic?this._renderer.itemWidthHeuristic.bind(this._renderer):this._defaultRenderer.itemWidthHeuristic.bind(this._defaultRenderer)}_cycle(e){var t,i;const s=this.node.querySelectorAll(`.${x}`),n=this._activeIndex,o=s.length-1;let r=this.node.querySelector(`.${P}`);switch(r.classList.remove(P),e){case"up":this._activeIndex=0===n?o:n-1;break;case"down":this._activeIndex=n<o?n+1:0;break;case"pageUp":case"pageDown":{const t=this.node.getBoundingClientRect(),i=r.getBoundingClientRect(),s=Math.floor(t.height/i.height),l="pageUp"===e?-1:1;this._activeIndex=Math.min(Math.max(0,n+l*s),o);break}}r=s[this._activeIndex],r.classList.add(P);let l=this.node.querySelector(`.${I}`);y.ElementExt.scrollIntoViewIfNeeded(l,r),this._indexChanged.emit(this._activeIndex);const a=null===(t=this.model)||void 0===t?void 0:t.completionItems(),h=null==a?void 0:a[this._activeIndex];if(h){const e=null===(i=this.model)||void 0===i?void 0:i.resolveItem(h);this._showDoc&&this._updateDocPanel(e,r)}}_evtKeydown(e){if(!this.isHidden&&this._editor)if(this._editor.host.contains(e.target))switch(e.keyCode){case 9:{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const t=this._model;if(!t)return;const i=t.completionItems();if(i&&1===i.length)return this._selected.emit(i[0].insertText||i[0].label),void this.reset();const s=this._populateSubset();return t.query&&t.query!==this._lastSubsetMatch&&(t.subsetMatch=!0,this._selected.emit(t.query),t.subsetMatch=!1,this._lastSubsetMatch=t.query),s&&this.update(),void this._cycle(e.shiftKey?"up":"down")}case 27:return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),void this.reset();case 33:case 34:case 38:case 40:{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();const t=T.keyCodeMap[e.keyCode];return void this._cycle(t)}default:return}else this.reset()}_evtPointerdown(e){if(this.isHidden||!this._editor)return;if(T.nonstandardClick(e))return void this.reset();let t=e.target;for(;t!==document.documentElement;){if(t.classList.contains(x))return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this._selected.emit(t.getAttribute("data-value")),void this.reset();if(t===this.node)return e.preventDefault(),e.stopPropagation(),void e.stopImmediatePropagation();t=t.parentElement}this.reset()}_evtScroll(e){if(this.isHidden||!this._editor)return;const{node:t}=this;t.contains(e.target)||requestAnimationFrame((()=>{this._setGeometry()}))}_populateSubset(){const{model:e}=this;if(!e)return!1;const t=e.completionItems(),i=T.commonSubset(t.map((e=>e.insertText||e.label))),{query:s}=e;return!(!i||i===s||0!==i.indexOf(s)||(e.query=i,0))}_setGeometry(){const{node:e}=this,t=this._model,i=this._editor;if(!(i&&t&&t.original&&t.cursor))return;const s=t.cursor.start,n=i.getPositionAt(s),o=i.getCoordinateForPosition(n);if(!o)return;const r=window.getComputedStyle(e),l=parseInt(r.borderLeftWidth,10)||0,a=parseInt(r.paddingLeft,10)||0,h=i.host.closest(".jp-MainAreaWidget > .lm-Widget")||i.host,d=t.completionItems();this._sizeCache&&this._sizeCache.items.length!==d.length&&(this._sizeCache=void 0),C.HoverBox.setGeometry({anchor:o,host:h,maxHeight:this._maxHeight,minHeight:this._minHeight,node:e,size:this.sizeCache,offset:{horizontal:l+a},privilege:"below",style:r,outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}});const c=++this._geometryCounter;this._sizeCache||requestAnimationFrame((()=>{if(c!=this._geometryCounter)return;let t=e.getBoundingClientRect(),i=this._docPanel.getBoundingClientRect();this._sizeCache={width:t.width-i.width,height:t.height,items:d,docPanelWidth:i.width,docPanelHeight:i.height}}))}_updateDocPanel(e,t){var i,s,n;let o=this._docPanel;if(!e)return void this._toggleDocPanel(!1);const r=null!==(n=null===(s=(i=this._renderer).createLoadingDocsIndicator)||void 0===s?void 0:s.call(i))&&void 0!==n?n:this._defaultRenderer.createLoadingDocsIndicator();t.appendChild(r),e.then((e=>{var t,i,s;if(e&&o)if(e.documentation){const n=null!==(s=null===(i=(t=this._renderer).createDocumentationNode)||void 0===i?void 0:i.call(t,e))&&void 0!==s?s:this._defaultRenderer.createDocumentationNode(e);o.textContent="",o.appendChild(n),this._toggleDocPanel(!0)}else this._toggleDocPanel(!1)})).catch((e=>console.error(e))).finally((()=>{t.removeChild(r)}))}_toggleDocPanel(e){let t=this._docPanel;if(e){if(this._docPanelExpanded)return;t.style.display="",this._docPanelExpanded=!0}else{if(!this._docPanelExpanded)return;t.style.display="none",this._docPanelExpanded=!1}const i=this._sizeCache;i&&(i.docPanelHeight=e?this._maxHeight:0,i.docPanelWidth=e?this._docPanelWidth:0,this._geometryLock||this._setGeometry())}}var T;!function(e){class t{constructor(e){this.sanitizer=(null==e?void 0:e.sanitizer)||new v.Sanitizer}createCompletionItemNode(e,t){let i=this._createWrapperNode(e.insertText||e.label);return e.deprecated&&i.classList.add("jp-Completer-deprecated"),this._constructNode(i,this._createLabelNode(e.label),!!e.type,e.type,t,e.icon)}createDocumentationNode(e){const t=document.createElement("div");t.classList.add("jp-RenderedText");const i=this.sanitizer,s=e.documentation||"";return(0,f.renderText)({host:t,sanitizer:i,source:s}).catch(console.error),t}itemWidthHeuristic(e){var t;return e.label.replace(/<(\/)?mark>/g,"").length+((null===(t=e.type)||void 0===t?void 0:t.length)||0)}createLoadingDocsIndicator(){const e=document.createElement("div");e.classList.add("jp-Completer-loading-bar-container");const t=document.createElement("div");return t.classList.add("jp-Completer-loading-bar"),e.append(t),e}_createWrapperNode(e){const t=document.createElement("li");return t.className=x,t.setAttribute("data-value",e),t}_createLabelNode(e){const t=document.createElement("code");return t.className="jp-Completer-match",t.innerHTML=e,t}_constructNode(e,t,i,s,n,o){if(o){const t=o.element({className:"jp-Completer-type jp-Completer-icon"});e.appendChild(t)}else if(i){const t=document.createElement("span");t.textContent=(s[0]||"").toLowerCase();const i=n.indexOf(s)%10+1;t.className="jp-Completer-type jp-Completer-monogram",t.setAttribute("data-color-index",i.toString()),e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-monogram",e.appendChild(t)}if(e.appendChild(t),i){e.title=s;const t=document.createElement("code");t.className="jp-Completer-typeExtended",t.textContent=s.toLocaleLowerCase(),e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-typeExtended",e.appendChild(t)}return e}}let i;e.Renderer=t,e.getDefaultRenderer=function(e){return(!i||e&&i.sanitizer!==e)&&(i=new t({sanitizer:e})),i}}(b||(b={})),function(e){e.keyCodeMap={38:"up",40:"down",33:"pageUp",34:"pageDown"},e.commonSubset=function(e){const t=e.length;let i="";if(t<2)return i;const s=e[0].length;for(let n=0;n<s;n++){const s=e[0][n];for(let o=1;o<t;o++)if(e[o][n]!==s)return i;i+=s}return i},e.nonstandardClick=function(e){return 0!==e.button||e.altKey||e.ctrlKey||e.shiftKey||e.metaKey},e.measureSize=function(e,t){e.isConnected&&console.warn("Measuring connected elements with `measureSize` has side-effects"),e.style.visibility="hidden",e.style.display=t,document.body.appendChild(e);const i=e.getBoundingClientRect();return document.body.removeChild(e),e.removeAttribute("style"),i}}(T||(T={}));class E{constructor(e){var t,i;this._resolveFactory=(e,t)=>e.resolve?i=>e.resolve(t,this._context,i):void 0,this._fetching=0,this._inlineFetching=0,this._providers=e.providers,this._inlineProviders=null!==(t=e.inlineProviders)&&void 0!==t?t:[],this._inlineProvidersSettings=null!==(i=e.inlineProvidersSettings)&&void 0!==i?i:{},this._context=e.context,this._timeout=e.timeout}async applicableProviders(){const e=this._providers.map((e=>e.isApplicable(this._context))),t=await Promise.all(e);return this._providers.filter(((e,i)=>t[i]))}fetchInline(e,t){let i=[];const s=++this._inlineFetching;for(const o of this._inlineProviders){const r=this._inlineProvidersSettings[o.identifier];let l=0;t===n.Automatic&&(l=r.debouncerDelay);const h=()=>{const i=o.fetch(e,{...this._context,triggerKind:t}).then((e=>({...e,items:e.items.map((e=>{const t=e;return t.stream=new a.Signal(t),t.provider=o,this._stream(t,o),t}))}))),s=new Promise((e=>setTimeout((()=>e(null)),l+r.timeout)));return Promise.race([i,s])},d=0===l?h():new Promise(((e,t)=>setTimeout((()=>s!=this._inlineFetching?t(null):e(h())),l)));i.push(d.catch((e=>e)))}return i}async _stream(e,t){if(!e.isIncomplete||!t.stream||!e.token)return;const i=e.stream,s=e.token;e.token=void 0,e.streaming=!0,i.emit(u.StraemEvent.opened);for await(const n of t.stream(s)){const t=n.response,s=t.insertText.substring(e.insertText.length);e.insertText=t.insertText,e.lastStreamed=s,e.error=n.response.error,i.emit(u.StraemEvent.update)}e.isIncomplete=!1,e.lastStreamed=void 0,e.streaming=!1,i.emit(u.StraemEvent.closed)}async fetch(e,t){const i=++this._fetching;let s=[];const n=await this.applicableProviders();for(const o of n){let n;n=o.fetch(e,this._context,t).then((e=>{if(i!==this._fetching)return Promise.reject(void 0);const t=e.items.map((e=>({...e,resolve:this._resolveFactory(o,e)})));return{...e,items:t}}));const r=new Promise((e=>setTimeout((()=>e(null)),this._timeout)));n=Promise.race([n,r]),s.push(n.catch((e=>e)))}const o=Promise.all(s);return this._mergeCompletions(o)}async shouldShowContinuousHint(e,t){const i=await this.applicableProviders();return 0!==i.length&&(i[0].shouldShowContinuousHint?i[0].shouldShowContinuousHint(e,t,this._context):this._defaultShouldShowContinuousHint(e,t))}_alignPrefixes(e,t,i){if(t!=i){const t=this._context.editor;if(!t)return e;const s=t.getCursorPosition(),n=t.getLine(s.line);return n?e.map((e=>{if(e.start==i)return e;let t=n.substring(e.start,i);return{...e,items:e.items.map((e=>{let i=e.insertText||e.label;return e.insertText=i.startsWith(t)?i.slice(t.length):i,e}))}})):e}return e}async _mergeCompletions(e){let t=(await e).filter((e=>!(!e||e instanceof Error||!e.items.length)));if(0==t.length)return null;if(1==t.length)return t[0];const i=Math.min(...t.map((e=>e.end))),s=t.map((e=>e.start)),n=Math.min(...s),o=Math.max(...s);t=this._alignPrefixes(t,n,o);const r=new Set,l=new Array;for(const e of t)e.items.forEach((e=>{let t=(e.insertText||e.label).trim();r.has(t)||(r.add(t),l.push(e))}));return{start:o,end:i,items:l}}_defaultShouldShowContinuousHint(e,t){return!e&&(null==t.sourceChange||t.sourceChange.some((e=>null!=e.insert&&e.insert.length>0)))}}const M="CompletionProvider:context";class k{constructor(){this.identifier=M,this.rank=500,this.renderer=null}async isApplicable(e){return!0}fetch(e,t){const i=t.editor;return i?new Promise((e=>{e(D.contextHint(i))})):Promise.reject("No editor")}}var D;!function(e){e.contextHint=function(e){const t=e.getTokenAtCursor(),i=function(e,t){return t.getTokens().filter((t=>0===t.value.indexOf(e.value)&&t.value!==e.value))}(t,e).filter((e=>e.type)).map((e=>e.value)),s=new Set(i),n=new Array;return s.forEach((e=>n.push({label:e}))),{start:t.offset,end:t.offset+t.value.length,items:n}}}(D||(D={}));const L="CompletionProvider:kernel";class H{constructor(){this.identifier=L,this.rank=550,this.renderer=null}async isApplicable(e){var t;return!!(null===(t=e.session)||void 0===t?void 0:t.kernel)}async fetch(e,t){var i;const s=null===(i=t.session)||void 0===i?void 0:i.kernel;if(!s)throw new Error("No kernel for completion request.");const n={code:e.text,cursor_pos:e.offset},o=(await s.requestComplete(n)).content;if("ok"!==o.status)throw new Error("Completion fetch failed to return successfully.");const r=new Array,l=o.metadata._jupyter_types_experimental;return o.matches.forEach(((e,t)=>{l&&l[t]?r.push({label:e,type:l[t].type,insertText:l[t].text}):r.push({label:e})})),{start:o.cursor_start,end:o.cursor_end,items:r}}async resolve(e,t,i){const{editor:s,session:n}=t;if(n&&s){let t=s.model.sharedModel.getSource();const o=s.getCursorPosition();let l=r.Text.jsIndexToCharIndex(s.getOffsetAt(o),t);const a=n.kernel;if(!t||!a)return Promise.resolve(e);if(i){const{start:e,value:s}=i;t=t.substring(0,e)+s,l+=s.length}const h={code:t,cursor_pos:l,detail_level:0},d=(await a.requestInspect(h)).content;return"ok"===d.status&&d.found?(e.documentation=d.data["text/plain"],e):e}return e}shouldShowContinuousHint(e,t){const i=t.sourceChange;return null==i||!i.some((e=>null!=e.delete))&&i.some((t=>null!=t.insert&&("."===t.insert||!e&&t.insert.trim().length>0)))}}var A=i(63720),q=i(89843);const O="jp-GhostText-streamingIndicator",R="jp-GhostText-errorIndicator";class W{constructor(e){this.options=e}placeGhost(e,t){const i=[F.addMark.of(t)];e.state.field(F.markField,!1)||(i.push(q.StateEffect.appendConfig.of([F.markField])),i.push(q.StateEffect.appendConfig.of([A.EditorView.domEventHandlers({blur:t=>{if(!1===this.options.onBlur(t))return!0;const i=[F.removeMark.of(null)];setTimeout((()=>{e.dispatch({effects:i})}),0)}})]))),e.dispatch({effects:i})}clearGhosts(e){const t=[F.removeMark.of(null)];e.dispatch({effects:t})}}W.streamingAnimation="uncover";class j extends A.WidgetType{constructor(e){super(),this.options=e,this.isSpacer=!1,this._clearErrorTimeout=null}eq(e){return e.content==this.content&&e.options.streaming===this.options.streaming&&e.options.error===this.options.error}get lineBreaks(){return(this.content.match(/\n/g)||"").length}updateDOM(e,t){return this._updateDOM(e),!0}get content(){return this.options.content}toDOM(){let e=document.createElement("span");return this.options.onPointerOver&&e.addEventListener("pointerover",this.options.onPointerOver),this.options.onPointerLeave&&e.addEventListener("pointerleave",this.options.onPointerLeave),e.classList.add("jp-GhostText"),e.dataset.animation=W.streamingAnimation,e.dataset.providedBy=this.options.providerId,this._updateDOM(e),e}_removeErrorAnimation(e){e.querySelectorAll(`.${R}`).forEach((e=>{e.remove()}))}_mountErrorAnimation(e){const t=document.createElement("span");t.className=R;const i=this.options.error;(null==i?void 0:i.message)&&(t.title=null==i?void 0:i.message),e.querySelectorAll(`.${O}, .${R}`).forEach((e=>{e.remove()})),e.appendChild(t)}_updateDOM(e){if(this.options.error)return this._mountErrorAnimation(e),void(this._clearErrorTimeout=setTimeout((()=>{this._removeErrorAnimation(e),this._clearErrorTimeout=null}),5e3));null!==this._clearErrorTimeout&&(clearTimeout(this._clearErrorTimeout),this._removeErrorAnimation(e),this._clearErrorTimeout=null);const t=this.content;if(this.isSpacer)return void(e.innerText=t);let i=this.options.addedPart;if(i){i.startsWith("\n")&&(i=i.substring(1)),e.innerText=t.substring(0,t.length-i.length);const s=document.createElement("span");s.className="jp-GhostText-streamedToken",s.innerText=i,e.appendChild(s)}else e.innerText=t;if(this.options.streaming){const t=document.createElement("span");t.className=O,e.appendChild(t)}}destroy(e){this.options.onPointerOver&&e.removeEventListener("pointerover",this.options.onPointerOver),this.options.onPointerLeave&&e.removeEventListener("pointerleave",this.options.onPointerLeave),super.destroy(e)}}class N extends j{constructor(){super(...arguments),this.isSpacer=!0}}class z extends N{toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-lineSpacer"),e}}class B extends N{get content(){return this.options.content[0]}toDOM(){const e=super.toDOM();return e.classList.add("jp-GhostText-letterSpacer"),e}}var F;!function(e){let t;function i(e,t){return A.Decoration.widget({widget:new j(e),side:1,ghostSpec:e}).range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))}!function(e){e[e.Set=0]="Set",e[e.Remove=1]="Remove",e[e.FilterAndUpdate=2]="FilterAndUpdate"}(t||(t={})),e.addMark=q.StateEffect.define({map:(e,t)=>({...e,from:t.mapPos(e.from),to:t.mapPos(e.from+e.content.length)})}),e.removeMark=q.StateEffect.define(),e.markField=q.StateField.define({create:()=>A.Decoration.none,update(s,n){const o=function(i){for(let s of i.effects){if(s.is(e.addMark))return{action:t.Set,spec:s.value};if(s.is(e.removeMark))return{action:t.Remove}}return i.docChanged||i.selection?{action:t.FilterAndUpdate}:null}(n);if(s=s.update({filter:(e,t,i)=>!(i.spec.widget instanceof N&&i.spec.timeoutInfo.elapsed)}),!o)return s.map(n.changes);switch(o.action){case t.Set:{const e=i(o.spec,n);return s.update({add:[e],filter:(t,i,s)=>s===e.value})}case t.Remove:return s.update({filter:()=>!1});case t.FilterAndUpdate:{let e=s.iter();for(;e.value&&e.value.spec.widget instanceof N;)e.next();if(!e.value)return s.map(n.changes);const t=e.value.spec.ghostSpec,o={...t};let r=!1;n.changes.iterChanges(((e,t,i,s,n)=>{if(!r)if(e===t&&i!==s)for(let e=0;e<n.lines;e++){const t=n.lineAt(e).text,i=e>0?"\n"+t:t;if(!o.content.startsWith(i)){r=!0;break}o.content=o.content.slice(i.length),o.from+=i.length}else r=!0}));const l=r?function(e,t,i=1e3){if(e.content.length<2)return[];const s={elapsed:!1};setTimeout((()=>{s.elapsed=!0}),i);const n=A.Decoration.widget({widget:new B(e),side:1,timeoutInfo:s}),o=A.Decoration.widget({widget:new z(e),side:1,timeoutInfo:s});return[n.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length)),o.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))]}(t,n):[i(o,n)],a=l.map((e=>e.value));if(s=s.update({add:l,filter:(e,t,i)=>a.includes(i)}),r)try{s=s.map(n.changes)}catch(e){return console.warn(e),A.Decoration.none}return s}}},provide:e=>A.EditorView.decorations.from(e)})}(F||(F={}));const V="jp-mod-inline-completer-active",G="jp-InlineCompleter-hover";class U extends w.Widget{constructor(e){var t,i;super({node:document.createElement("div")}),this._clearHoverTimeout=null,this._current=0,this._editor=null,this._lastItem=null,this._model=null,this._providerWidget=new w.Widget,this._showShortcuts=U.defaultSettings.showShortcuts,this._showWidget=U.defaultSettings.showWidget,this._suggestionsCounter=new w.Widget,this._toolbar=new C.Toolbar,this.model=null!==(t=e.model)&&void 0!==t?t:null,this.editor=null!==(i=e.editor)&&void 0!==i?i:null,this.addClass("jp-InlineCompleter"),this._ghostManager=new W({onBlur:this._onEditorBlur.bind(this)}),this._trans=e.trans;const s=this.layout=new w.PanelLayout;s.addWidget(this._suggestionsCounter),s.addWidget(this.toolbar),s.addWidget(this._providerWidget),this._progressBar=document.createElement("div"),this._progressBar.className="jp-InlineCompleter-progressBar",this.node.appendChild(this._progressBar),this._updateShortcutsVisibility(),this._updateDisplay(),this.node.tabIndex=0}get toolbar(){return this._toolbar}get editor(){return this._editor}set editor(e){var t;null===(t=this.model)||void 0===t||t.reset(),this._editor=e}get model(){return this._model}set model(e){(e||this._model)&&e!==this._model&&(this._model&&(this._model.suggestionsChanged.disconnect(this._onModelSuggestionsChanged,this),this._model.filterTextChanged.disconnect(this._onModelFilterTextChanged,this),this._model.provisionProgress.disconnect(this._onProvisionProgress,this)),this._model=e,this._model&&(this._model.suggestionsChanged.connect(this._onModelSuggestionsChanged,this),this._model.filterTextChanged.connect(this._onModelFilterTextChanged,this),this._model.provisionProgress.connect(this._onProvisionProgress,this)))}cycle(e){var t,i;const s=null===(i=null===(t=this.model)||void 0===t?void 0:t.completions)||void 0===i?void 0:i.items;if(s){if("next"===e){const e=this._current+1;this._current=e===s.length?0:e}else{const e=this._current-1;this._current=-1===e?s.length-1:e}this._updateStreamTracking(),this._render()}}accept(){const e=this.model,t=this.current,i=this._editor;if(!i||!e||!t)return;const s=e.cursor,n=t.insertText,o=i.getOffsetAt(i.getCursorPosition()),r=i.getOffsetAt(s),l=r,a=o;i.model.sharedModel.updateSource(r,o,n),o<=a&&o>=l&&i.setCursorPosition(i.getPositionAt(l+n.length)),e.reset(),this.update()}get current(){var e;const t=null===(e=this.model)||void 0===e?void 0:e.completions;return t?t.items[this._current]:null}_updateStreamTracking(){this._lastItem&&this._lastItem.stream.disconnect(this._onStream,this);const e=this.current;e&&e.stream.connect(this._onStream,this),this._lastItem=e}_onStream(e,t){var i;const s=null===(i=this.model)||void 0===i?void 0:i.completions;if(!s||!s.items||0===s.items.length)return;if(this.isHidden)return;const n=s.items[this._current];this._setText(n)}configure(e){this._showWidget=e.showWidget,this._updateDisplay(),e.showShortcuts!==this._showShortcuts&&(this._showShortcuts=e.showShortcuts,this._updateShortcutsVisibility()),W.streamingAnimation=e.streamingAnimation}handleEvent(e){if(!this.isHidden&&this._editor)switch(e.type){case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e)}}onUpdateRequest(e){super.onUpdateRequest(e);const t=this._model;if(!t)return;let i=t.completions;i&&i.items&&0!==i.items.length?this.isHidden&&(this.show(),this._setGeometry()):this.isHidden||this.hide()}onAfterAttach(e){document.addEventListener("scroll",this,!0),document.addEventListener("pointerdown",this,!0)}onBeforeDetach(e){document.removeEventListener("scroll",this,!0),document.removeEventListener("pointerdown",this,!0)}_evtPointerdown(e){var t;if(this.isHidden||!this._editor)return;const i=e.target;if(this.node.contains(i))return!0;this.hide(),null===(t=this.model)||void 0===t||t.reset()}_evtScroll(e){if(this.isHidden||!this._editor)return;const{node:t}=this;t.contains(e.target)||requestAnimationFrame((()=>{this._setGeometry()}))}_onEditorBlur(e){var t;if(this.node.contains(e.relatedTarget))return!1;null===(t=this._editor)||void 0===t||t.host.classList.remove(V),this.hide()}_onModelSuggestionsChanged(e,t){var i;if(this.isAttached){if("set"===t.event)this._current=null!==(i=t.indexMap.get(this._current))&&void 0!==i?i:0;else if("clear"===t.event){const e=this.editor;e&&(this._ghostManager.clearGhosts(e.editor),e.host.classList.remove(V))}this._updateStreamTracking(),this.update(),this._render()}else this.update()}_onModelFilterTextChanged(e,t){var i,s;const n=null===(i=this.model)||void 0===i?void 0:i.completions;n&&n.items&&0!==n.items.length&&(this._current=null!==(s=t.get(this._current))&&void 0!==s?s:0,this._updateStreamTracking(),setTimeout((()=>{this._render(),this._setGeometry()}),0))}_onProvisionProgress(e,t){requestAnimationFrame((()=>{0===t.pendingProviders?this._progressBar.style.display="none":(this._progressBar.style.display="",this._progressBar.style.width=100*t.pendingProviders/t.totalProviders+"%")}))}_render(){var e,t;const i=null===(e=this.model)||void 0===e?void 0:e.completions;if(!i||!i.items||0===i.items.length)return;const s=i.items[this._current];this._setText(s),"never"!==this._showWidget&&(this._suggestionsCounter.node.innerText=this._trans.__("%1/%2",this._current+1,i.items.length),this._providerWidget.node.title=this._trans.__("Provider: %1",s.provider.name),(null!==(t=s.provider.icon)&&void 0!==t?t:C.kernelIcon).render(this._providerWidget.node))}_setText(e){const t=e.insertText,i=this._editor,s=this._model;if(!s||!i)return;const n=i.editor;this._ghostManager.placeGhost(n,{from:i.getOffsetAt(s.cursor),content:t,providerId:e.provider.identifier,addedPart:e.lastStreamed,streaming:e.streaming,onPointerOver:this._onPointerOverGhost.bind(this),onPointerLeave:this._onPointerLeaveGhost.bind(this),error:e.error}),i.host.classList.add(V)}_onPointerOverGhost(){null!==this._clearHoverTimeout&&(window.clearTimeout(this._clearHoverTimeout),this._clearHoverTimeout=null),this.node.classList.add(G)}_onPointerLeaveGhost(){this._clearHoverTimeout=window.setTimeout((()=>this.node.classList.remove(G)),500)}_setGeometry(){const{node:e}=this,t=this._model,i=this._editor;if(!i||!t||!t.cursor)return;const s=i.host.closest(".jp-MainAreaWidget > .lm-Widget")||i.host;let n;try{const e=i.getCoordinateForPosition(t.cursor);if(!e)throw Error("No coordinates for cursor position");n=e}catch(e){return void this.hide()}C.HoverBox.setGeometry({anchor:n,host:s,maxHeight:40,minHeight:20,node:e,privilege:"forceAbove",outOfViewDisplay:{top:"stick-outside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}})}_updateShortcutsVisibility(){this.node.dataset.showShortcuts=this._showShortcuts+""}_updateDisplay(){this.node.dataset.display=this._showWidget}}!function(e){e.defaultSettings={showWidget:"onHover",showShortcuts:!0,streamingAnimation:"uncover",providers:{}},e.Model=class{constructor(){this.suggestionsChanged=new a.Signal(this),this.filterTextChanged=new a.Signal(this),this.provisionProgress=new a.Signal(this),this._isDisposed=!1,this._completions=null}setCompletions(e){var t,i;const s=new Map(null===(i=null===(t=this._completions)||void 0===t?void 0:t.items)||void 0===i?void 0:i.map(((e,t)=>[e.insertText,t])));this._completions=e;const n=new Map(e.items.map(((e,t)=>[s.get(e.insertText),t])));this.suggestionsChanged.emit({event:"set",indexMap:n})}appendCompletions(e){this._completions&&this._completions.items?(this._completions.items.push(...e.items),this.suggestionsChanged.emit({event:"append"})):console.warn("No completions to append to")}notifyProgress(e){this.provisionProgress.emit(e)}get cursor(){return this._cursor}set cursor(e){this._cursor=e}get completions(){return this._completions}reset(){this._completions=null,this.suggestionsChanged.emit({event:"clear"})}get isDisposed(){return this._isDisposed}handleTextChange(e){var t;const i=this._completions;if(!i||!i.items||0===i.items.length)return;const s=new Map(i.items.map(((e,t)=>[e,t])));for(let s of null!==(t=e.sourceChange)&&void 0!==t?t:[]){const e=s.insert;if(e){const t=i.items.filter((t=>{var i;const s=null!==(i=t.filterText)&&void 0!==i?i:t.insertText;return!!s.startsWith(e)&&(t.filterText=s.substring(e.length),t.insertText=t.insertText.substring(e.length),!0)}));0===t.length&&(this._completions=null),i.items=t}else s.retain||(this._completions=null)}const n=new Map(i.items.map(((e,t)=>[s.get(e),t])));this.filterTextChanged.emit(n)}handleSelectionChange(e){const t=this.cursor;if(!t)return;const{start:i,end:s}=e;i.column===s.column&&i.line===s.line||this.reset(),(i.line!==t.line||i.column<t.column)&&this.reset()}dispose(){this._isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}}}(U||(U={}));class ${constructor(){this._activeProviders=new Set([L,M]),this._inlineCompleterSettings=U.defaultSettings,this._providers=new Map,this._inlineProviders=new Map,this._panelHandlers=new Map,this._mostRecentContext=new Map,this._activeProvidersChanged=new a.Signal(this),this._selected=new a.Signal(this),this._inlineCompleterFactory=null}get activeProvidersChanged(){return this._activeProvidersChanged}get selected(){return this._selected}setTimeout(e){this._timeout=e}setShowDocumentationPanel(e){this._panelHandlers.forEach((t=>t.completer.showDocsPanel=e)),this._showDoc=e}setContinuousHinting(e){this._panelHandlers.forEach((t=>t.autoCompletion=e)),this._autoCompletion=e}registerProvider(e){const t=e.identifier;this._providers.has(t)?console.warn(`Completion provider with identifier ${t} is already registered`):(this._providers.set(t,e),this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})))}registerInlineProvider(e){const t=e.identifier;this._inlineProviders.has(t)?console.warn(`Completion provider with identifier ${t} is already registered`):(this._inlineProviders.set(t,e),this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})))}getProviders(){return this._providers}activateProvider(e){this._activeProviders=new Set([]),e.forEach((e=>{this._providers.has(e)&&this._activeProviders.add(e)})),0===this._activeProviders.size&&(this._activeProviders.add(L),this._activeProviders.add(M)),this._activeProvidersChanged.emit()}async updateCompleter(e){var t,i;const{widget:s,editor:n,sanitizer:o}=e,r=s.id,l=this._panelHandlers.get(r),a=[...this._activeProviders][0],h=this._providers.get(a);let d=null!==(t=null==h?void 0:h.renderer)&&void 0!==t?t:b.getDefaultRenderer(o);const c=null==h?void 0:h.modelFactory;let u;u=c?await c.call(h,e):new _,this._mostRecentContext.set(s.id,e);const m={model:u,editor:n,renderer:d,sanitizer:o,showDoc:this._showDoc};if(l){const t=l.completer;null===(i=t.model)||void 0===i||i.dispose(),t.model=m.model,t.renderer=m.renderer,t.showDocsPanel=m.showDoc,l.autoCompletion=this._autoCompletion,n&&(l.editor=n,l.reconciliator=await this.generateReconciliator(e))}else{const t=await this._generateHandler(e,m);this._panelHandlers.set(s.id,t),t.completer.selected.connect(((e,t)=>this._selected.emit({insertText:t}))),s.disposed.connect((e=>{this.disposeHandler(e.id,t),this._mostRecentContext.delete(r)}))}}invoke(e){const t=this._panelHandlers.get(e);t&&t.invoke()}select(e){const t=this._panelHandlers.get(e);t&&t.completer.selectActive()}setInlineCompleterFactory(e){this._inlineCompleterFactory=e,this._panelHandlers.forEach(((e,t)=>{this.updateCompleter(this._mostRecentContext.get(t))})),this.inline||(this.inline={invoke:e=>{const t=this._panelHandlers.get(e);t&&t.inlineCompleter&&t.invokeInline()},cycle:(e,t)=>{const i=this._panelHandlers.get(e);i&&i.inlineCompleter&&i.inlineCompleter.cycle(t)},accept:e=>{const t=this._panelHandlers.get(e);t&&t.inlineCompleter&&t.inlineCompleter.accept()},configure:e=>{this._inlineCompleterSettings=e;for(const[t,i]of this._inlineProviders.entries())i.configure&&i.configure(e.providers[t]);this._panelHandlers.forEach(((t,i)=>{t.inlineCompleter&&t.inlineCompleter.configure(e),this.updateCompleter(this._mostRecentContext.get(i))}))}})}get inlineProviders(){return[...this._inlineProviders.values()]}async generateReconciliator(e){const t=[];for(const[e,i]of Object.entries(this._inlineCompleterSettings.providers))!0===i.enabled&&t.push(e);const i=[...this._inlineProviders.values()].filter((e=>t.includes(e.identifier))),s=[];for(const e of this._activeProviders){const t=this._providers.get(e);t&&s.push(t)}return new E({context:e,providers:s,inlineProviders:i,inlineProvidersSettings:this._inlineCompleterSettings.providers,timeout:this._timeout})}disposeHandler(e,t){var i,s,n,o;null===(i=t.completer.model)||void 0===i||i.dispose(),t.completer.dispose(),null===(n=null===(s=t.inlineCompleter)||void 0===s?void 0:s.model)||void 0===n||n.dispose(),null===(o=t.inlineCompleter)||void 0===o||o.dispose(),t.dispose(),this._panelHandlers.delete(e)}async _generateHandler(e,t){const i=new b(t),s=this._inlineCompleterFactory?this._inlineCompleterFactory.factory({...t,model:new U.Model}):void 0;i.hide(),w.Widget.attach(i,document.body),s&&(w.Widget.attach(s,document.body),s.hide(),s.configure(this._inlineCompleterSettings));const n=await this.generateReconciliator(e),o=new u({completer:i,inlineCompleter:s,reconciliator:n});return o.editor=e.editor,o}}const K=new C.LabIcon({name:"completer:inline",svgstr:'<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">\n <path class="jp-icon4" fill="#bbbbbb" d="M17 15H3v2h14v-2Zm0-8h-6v2h6V7ZM3 13h18v-2H3v2Zm0 8h18v-2H3v2Z"/>\n <path class="jp-icon1" fill="#616161" d="M3 3v2h18V3H3ZM3 7v2h8V7H3Z"/>\n</svg>\n'}),Z=new C.LabIcon({name:"completer:widget",svgstr:'<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">\n<g fill="#616161" class="jp-icon2 jp-icon-selectable">\n <path d="M6 8h16v14.3H6z" style="fill:#eee;stroke:#444;stroke-linejoin:round"/>\n <path d="M3 3v2h10V3H3Z" transform="matrix(.8 0 0 1 .5 0)"/>\n</g>\n<g class="jp-icon3 jp-icon-selectable">\n <path fill="#616161" d="M18 14.1H8v2h11v-2ZM8 12.1H20V10.1H8v2Zm0 8H20v-2H8v3Z"/>\n</g>\n</svg>\n'});var J=i(25291);class Q{constructor(e){this.options=e,this.identifier="@jupyterlab/inline-completer:history",this._maxSuggestions=100;const t=e.translator||J.nullTranslator;this._trans=t.load("jupyterlab")}get name(){return this._trans.__("History")}get icon(){return C.historyIcon}get schema(){return{properties:{maxSuggestions:{title:this._trans.__("Maximum number of suggestions"),description:this._trans.__("The maximum number of suggestions to retrieve from history."),type:"number"}},default:{enabled:!1,maxSuggestions:100}}}configure(e){var t;this._maxSuggestions=null!==(t=e.maxSuggestions)&&void 0!==t?t:100}async fetch(e,t,i){var s;const n=null===(s=t.session)||void 0===s?void 0:s.kernel;if(!n)throw new Error("No kernel for completion request.");const o=e.text.slice(0,e.offset).split("\n").slice(-1)[0],r={output:!1,raw:!0,hist_access_type:"search",pattern:o+"*",unique:!0,n:this._maxSuggestions},l=await n.requestHistory(r),a=[];if(""===o)return{items:[]};if("ok"===l.content.status)for(const e of l.content.history){const t=e[2].split("\n");for(let e=0;e<t.length;e++){const i=t[e];if(i.startsWith(o)){const s=i.slice(o.length,i.length)+"\n"+t.slice(e+1).join("\n");a.push({insertText:s})}}}return{items:a}}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2323],{92323:(t,e,n)=>{n.r(e),n.d(e,{Annotation:()=>lt,AnnotationType:()=>at,ChangeDesc:()=>M,ChangeSet:()=>A,CharCategory:()=>wt,Compartment:()=>K,EditorSelection:()=>L,EditorState:()=>yt,Facet:()=>j,Line:()=>f,MapMode:()=>E,Prec:()=>Y,Range:()=>Pt,RangeSet:()=>At,RangeSetBuilder:()=>Rt,RangeValue:()=>bt,SelectionRange:()=>J,StateEffect:()=>ft,StateEffectType:()=>ct,StateField:()=>W,Text:()=>i,Transaction:()=>ut,codePointAt:()=>y,codePointSize:()=>b,combineConfig:()=>It,countColumn:()=>qt,findClusterBreak:()=>v,findColumn:()=>$t,fromCodePoint:()=>I});class i{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,n){[t,e]=u(this,t,e);let i=[];return this.decompose(0,t,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(e,this.length,i,1),r.from(i,this.length-(e-t)+n.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=u(this,t,e);let n=[];return this.decompose(t,e,n,0),r.from(n,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),n=this.length-this.scanIdentical(t,-1),i=new l(this),s=new l(t);for(let t=e,r=e;;){if(i.next(t),s.next(t),t=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(r+=i.value.length,i.done||r>=n)return!0}}iter(t=1){return new l(this,t)}iterRange(t,e=this.length){return new a(this,t,e)}iterLines(t,e){let n;if(null==t)n=this.iter();else{null==e&&(e=this.lines+1);let i=this.line(t).from;n=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new s(t):r.from(s.split(t,[])):i.empty}}class s extends i{constructor(t,e=function(t){let e=-1;for(let n of t)e+=n.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.text[s],h=i+r.length;if((e?n:h)>=t)return new f(i,h,n,r);i=h+1,n++}}decompose(t,e,n,i){let r=t<=0&&e>=this.length?this:new s(o(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){let t=n.pop(),e=h(r.text,t.text.slice(),0,r.length);if(e.length<=32)n.push(new s(e,t.length+r.length));else{let t=e.length>>1;n.push(new s(e.slice(0,t)),new s(e.slice(t)))}}else n.push(r)}replace(t,e,n){if(!(n instanceof s))return super.replace(t,e,n);[t,e]=u(this,t,e);let i=h(this.text,h(n.text,o(this.text,0,t)),e),l=this.length+n.length-(e-t);return i.length<=32?new s(i,l):r.from(s.split(i,[]),l)}sliceString(t,e=this.length,n="\n"){[t,e]=u(this,t,e);let i="";for(let s=0,r=0;s<=e&&r<this.text.length;r++){let h=this.text[r],o=s+h.length;s>t&&r&&(i+=n),t<o&&e>s&&(i+=h.slice(Math.max(0,t-s),e-s)),s=o+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let n=[],i=-1;for(let r of t)n.push(r),i+=r.length+1,32==n.length&&(e.push(new s(n,i)),n=[],i=-1);return i>-1&&e.push(new s(n,i)),e}}class r extends i{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.children[s],h=i+r.length,o=n+r.lines-1;if((e?o:h)>=t)return r.lineInner(t,e,n,i);i=h+1,n=o+1}}decompose(t,e,n,i){for(let s=0,r=0;r<=e&&s<this.children.length;s++){let h=this.children[s],o=r+h.length;if(t<=o&&e>=r){let s=i&((r<=t?1:0)|(o>=e?2:0));r>=t&&o<=e&&!s?n.push(h):h.decompose(t-r,e-r,n,s)}r=o+1}}replace(t,e,n){if([t,e]=u(this,t,e),n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let h=this.children[i],o=s+h.length;if(t>=s&&e<=o){let l=h.replace(t-s,e-s,n),a=this.lines-h.lines+l.lines;if(l.lines<a>>4&&l.lines>a>>6){let s=this.children.slice();return s[i]=l,new r(s,this.length-(e-t)+n.length)}return super.replace(s,o,l)}s=o+1}return super.replace(t,e,n)}sliceString(t,e=this.length,n="\n"){[t,e]=u(this,t,e);let i="";for(let s=0,r=0;s<this.children.length&&r<=e;s++){let h=this.children[s],o=r+h.length;r>t&&s&&(i+=n),t<o&&e>r&&(i+=h.sliceString(t-r,e-r,n)),r=o+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof r))return 0;let n=0,[i,s,h,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,s+=e){if(i==h||s==o)return n;let r=this.children[i],l=t.children[s];if(r!=l)return n+r.scanIdentical(l,e);n+=r.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let n=0;for(let e of t)n+=e.lines;if(n<32){let n=[];for(let e of t)e.flatten(n);return new s(n,e)}let i=Math.max(32,n>>5),h=i<<1,o=i>>1,l=[],a=0,c=-1,f=[];function u(t){let e;if(t.lines>h&&t instanceof r)for(let e of t.children)u(e);else t.lines>o&&(a>o||!a)?(g(),l.push(t)):t instanceof s&&a&&(e=f[f.length-1])instanceof s&&t.lines+e.lines<=32?(a+=t.lines,c+=t.length+1,f[f.length-1]=new s(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>i&&g(),a+=t.lines,c+=t.length+1,f.push(t))}function g(){0!=a&&(l.push(1==f.length?f[0]:r.from(f,c)),c=-1,a=f.length=0)}for(let e of t)u(e);return g(),1==l.length?l[0]:new r(l,e)}}function h(t,e,n=0,i=1e9){for(let s=0,r=0,h=!0;r<t.length&&s<=i;r++){let o=t[r],l=s+o.length;l>=n&&(l>i&&(o=o.slice(0,i-s)),s<n&&(o=o.slice(n-s)),h?(e[e.length-1]+=o,h=!1):e.push(o)),s=l+1}return e}function o(t,e,n){return h(t,[""],e,n)}i.empty=new s([""],0);class l{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof s?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],h=r>>1,o=i instanceof s?i.text.length:i.children.length;if(h==(e>0?o:0)){if(0==n)return this.done=!0,this.value="",this;e>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(e>0?0:1)){if(this.offsets[n]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof s){let s=i.text[h+(e<0?-1:0)];if(this.offsets[n]+=e,s.length>Math.max(0,t))return this.value=0==t?s:e>0?s.slice(t):s.slice(0,s.length-t),this;t-=s.length}else{let r=i.children[h+(e<0?-1:0)];t>r.length?(t-=r.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(e>0?1:(r instanceof s?r.text.length:r.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class a{constructor(t,e,n){this.value="",this.done=!1,this.cursor=new l(t,e>n?-1:1),this.pos=e>n?t.length:0,this.from=Math.min(e,n),this.to=Math.max(e,n)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let n=e<0?this.pos-this.from:this.to-this.pos;t>n&&(t=n),n-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=n?i:e<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:n,value:i}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(i.prototype[Symbol.iterator]=function(){return this.iter()},l.prototype[Symbol.iterator]=a.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class f{constructor(t,e,n,i){this.from=t,this.to=e,this.number=n,this.text=i}get length(){return this.to-this.from}}function u(t,e,n){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,n))]}let g="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let t=1;t<g.length;t++)g[t]+=g[t-1];function d(t){for(let e=1;e<g.length;e+=2)if(g[e]>t)return g[e-1]<=t;return!1}function p(t){return t>=127462&&t<=127487}const m=8205;function v(t,e,n=!0,i=!0){return(n?x:w)(t,e,i)}function x(t,e,n){if(e==t.length)return e;e&&k(t.charCodeAt(e))&&S(t.charCodeAt(e-1))&&e--;let i=y(t,e);for(e+=b(i);e<t.length;){let s=y(t,e);if(i==m||s==m||n&&d(s))e+=b(s),i=s;else{if(!p(s))break;{let n=0,i=e-2;for(;i>=0&&p(y(t,i));)n++,i-=2;if(n%2==0)break;e+=2}}}return e}function w(t,e,n){for(;e>0;){let i=x(t,e-2,n);if(i<e)return i;e--}return 0}function k(t){return t>=56320&&t<57344}function S(t){return t>=55296&&t<56320}function y(t,e){let n=t.charCodeAt(e);if(!S(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return k(i)?i-56320+(n-55296<<10)+65536:n}function I(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function b(t){return t<65536?1:2}const P=/\r\n?|\n/;var E=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(E||(E={}));class M{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e+1];t+=n<0?this.sections[e]:n}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,n=0,i=0;e<this.sections.length;){let s=this.sections[e++],r=this.sections[e++];r<0?(t(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(t,e=!1){O(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];i<0?t.push(n,i):t.push(i,n)}return new M(t)}composeDesc(t){return this.empty?t:t.empty?this:B(this,t)}mapDesc(t,e=!1){return t.empty?this:T(this,t,e)}mapPos(t,e=-1,n=E.Simple){let i=0,s=0;for(let r=0;r<this.sections.length;){let h=this.sections[r++],o=this.sections[r++],l=i+h;if(o<0){if(l>t)return s+(t-i);s+=h}else{if(n!=E.Simple&&l>=t&&(n==E.TrackDel&&i<t&&l>t||n==E.TrackBefore&&i<t||n==E.TrackAfter&&l>t))return null;if(l>t||l==t&&e<0&&!h)return t==i||e<0?s:s+o;s+=o}i=l}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return s}touchesRange(t,e=t){for(let n=0,i=0;n<this.sections.length&&i<=e;){let s=i+this.sections[n++];if(this.sections[n++]>=0&&i<=e&&s>=t)return!(i<t&&s>e)||"cover";i=s}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];t+=(t?" ":"")+n+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new M(t)}static create(t){return new M(t)}}class A extends M{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return O(this,((e,n,i,s,r)=>t=t.replace(i,i+(n-e),r)),!1),t}mapDesc(t,e=!1){return T(this,t,e,!0)}invert(t){let e=this.sections.slice(),n=[];for(let s=0,r=0;s<e.length;s+=2){let h=e[s],o=e[s+1];if(o>=0){e[s]=o,e[s+1]=h;let l=s>>1;for(;n.length<l;)n.push(i.empty);n.push(h?t.slice(r,r+h):i.empty)}r+=h}return new A(e,n)}compose(t){return this.empty?t:t.empty?this:B(this,t,!0)}map(t,e=!1){return t.empty?this:T(this,t,e,!0)}iterChanges(t,e=!1){O(this,t,e)}get desc(){return M.create(this.sections)}filter(t){let e=[],n=[],i=[],s=new F(this);t:for(let r=0,h=0;;){let o=r==t.length?1e9:t[r++];for(;h<o||h==o&&0==s.len;){if(s.done)break t;let t=Math.min(s.len,o-h);R(i,t,-1);let r=-1==s.ins?-1:0==s.off?s.ins:0;R(e,t,r),r>0&&C(n,e,s.text),s.forward(t),h+=t}let l=t[r++];for(;h<l;){if(s.done)break t;let t=Math.min(s.len,l-h);R(e,t,-1),R(i,t,-1==s.ins?-1:0==s.off?s.ins:0),s.forward(t),h+=t}}return{changes:new A(e,n),filtered:M.create(i)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e],i=this.sections[e+1];i<0?t.push(n):0==i?t.push([n]):t.push([n].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,n){let s=[],r=[],h=0,o=null;function l(t=!1){if(!t&&!s.length)return;h<e&&R(s,e-h,-1);let n=new A(s,r);o=o?o.compose(n.map(o)):n,s=[],r=[],h=0}return function t(a){if(Array.isArray(a))for(let e of a)t(e);else if(a instanceof A){if(a.length!=e)throw new RangeError(`Mismatched change set length (got ${a.length}, expected ${e})`);l(),o=o?o.compose(a.map(o)):a}else{let{from:t,to:o=t,insert:c}=a;if(t>o||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let f=c?"string"==typeof c?i.of(c.split(n||P)):c:i.empty,u=f.length;if(t==o&&0==u)return;t<h&&l(),t>h&&R(s,t-h,-1),R(s,o-t,u),C(r,s,f),h=o}}(t),l(!o),o}static empty(t){return new A(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],n=[];for(let s=0;s<t.length;s++){let r=t[s];if("number"==typeof r)e.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some(((t,e)=>e&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)e.push(r[0],0);else{for(;n.length<s;)n.push(i.empty);n[s]=i.of(r.slice(1)),e.push(r[0],n[s].length)}}}return new A(e,n)}static createSet(t,e){return new A(t,e)}}function R(t,e,n,i=!1){if(0==e&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:0==e&&0==t[s]?t[s+1]+=n:i?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function C(t,e,n){if(0==n.length)return;let s=e.length-2>>1;if(s<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<s;)t.push(i.empty);t.push(n)}}function O(t,e,n){let s=t.inserted;for(let r=0,h=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,h+=l;else{let c=r,f=h,u=i.empty;for(;c+=l,f+=a,a&&s&&(u=u.append(s[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,h,f,u),r=c,h=f}}}function T(t,e,n,i=!1){let s=[],r=i?[]:null,h=new F(t),o=new F(e);for(let t=-1;;)if(-1==h.ins&&-1==o.ins){let t=Math.min(h.len,o.len);R(s,t,-1),h.forward(t),o.forward(t)}else if(o.ins>=0&&(h.ins<0||t==h.i||0==h.off&&(o.len<h.len||o.len==h.len&&!n))){let e=o.len;for(R(s,o.ins,-1);e;){let n=Math.min(h.len,e);h.ins>=0&&t<h.i&&h.len<=n&&(R(s,0,h.ins),r&&C(r,s,h.text),t=h.i),h.forward(n),e-=n}o.next()}else{if(!(h.ins>=0)){if(h.done&&o.done)return r?A.createSet(s,r):M.create(s);throw new Error("Mismatched change set lengths")}{let e=0,n=h.len;for(;n;)if(-1==o.ins){let t=Math.min(n,o.len);e+=t,n-=t,o.forward(t)}else{if(!(0==o.ins&&o.len<n))break;n-=o.len,o.next()}R(s,e,t<h.i?h.ins:0),r&&t<h.i&&C(r,s,h.text),t=h.i,h.forward(h.len-n)}}}function B(t,e,n=!1){let i=[],s=n?[]:null,r=new F(t),h=new F(e);for(let t=!1;;){if(r.done&&h.done)return s?A.createSet(i,s):M.create(i);if(0==r.ins)R(i,r.len,0,t),r.next();else if(0!=h.len||h.done){if(r.done||h.done)throw new Error("Mismatched change set lengths");{let e=Math.min(r.len2,h.len),n=i.length;if(-1==r.ins){let n=-1==h.ins?-1:h.off?0:h.ins;R(i,e,n,t),s&&n&&C(s,i,h.text)}else-1==h.ins?(R(i,r.off?0:r.len,e,t),s&&C(s,i,r.textBit(e))):(R(i,r.off?0:r.len,h.off?0:h.ins,t),s&&!h.off&&C(s,i,h.text));t=(r.ins>e||h.ins>=0&&h.len>e)&&(t||i.length>n),r.forward2(e),h.forward(e)}}else R(i,0,h.ins,t),s&&C(s,i,h.text),h.next()}}class F{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?i.empty:t[e]}textBit(t){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length&&!t?i.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class J{constructor(t,e,n){this.from=t,this.to=e,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let n,i;return this.empty?n=i=t.mapPos(this.from,e):(n=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new J(n,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return L.range(t,e);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return L.range(this.anchor,n)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return L.range(t.anchor,t.head)}static create(t,e,n){return new J(t,e,n)}}class L{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:L.create(this.ranges.map((n=>n.map(t,e))),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(t.ranges[n],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new L([this.main],0)}addRange(t,e=!0){return L.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let n=this.ranges.slice();return n[e]=t,L.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((t=>t.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new L(t.ranges.map((t=>J.fromJSON(t))),t.main)}static single(t,e=t){return new L([L.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<t.length;i++){let s=t[i];if(s.empty?s.from<=n:s.from<n)return L.normalized(t.slice(),e);n=s.to}return new L(t,e)}static cursor(t,e=0,n,i){return J.create(t,t,(0==e?0:e<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:16777215)<<6)}static range(t,e,n,i){let s=(null!=n?n:16777215)<<6|(null==i?7:Math.min(6,i));return e<t?J.create(e,t,48|s):J.create(t,e,(e>t?8:0)|s)}static normalized(t,e=0){let n=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(n);for(let n=1;n<t.length;n++){let i=t[n],s=t[n-1];if(i.empty?i.from<=s.to:i.from<s.to){let r=s.from,h=Math.max(i.to,s.to);n<=e&&e--,t.splice(--n,2,i.anchor>i.head?L.range(h,r):L.range(r,h))}}return new L(t,e)}}function N(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let D=0;class j{constructor(t,e,n,i,s){this.combine=t,this.compareInput=e,this.compare=n,this.isStatic=i,this.id=D++,this.default=t([]),this.extensions="function"==typeof s?s(this):s}get reader(){return this}static define(t={}){return new j(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:q),!!t.static,t.enables)}of(t){return new $([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new $(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new $(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(n=>e(n.field(t))))}}function q(t,e){return t==e||t.length==e.length&&t.every(((t,n)=>t===e[n]))}class ${constructor(t,e,n,i){this.dependencies=t,this.facet=e,this.type=n,this.value=i,this.id=D++}dynamicSlot(t){var e;let n=this.value,i=this.facet.compareInput,s=this.id,r=t[s]>>1,h=2==this.type,o=!1,l=!1,a=[];for(let n of this.dependencies)"doc"==n?o=!0:"selection"==n?l=!0:0==(1&(null!==(e=t[n.id])&&void 0!==e?e:1))&&a.push(t[n.id]);return{create:t=>(t.values[r]=n(t),1),update(t,e){if(o&&e.docChanged||l&&(e.docChanged||e.selection)||z(t,a)){let e=n(t);if(h?!_(e,t.values[r],i):!i(e,t.values[r]))return t.values[r]=e,1}return 0},reconfigure:(t,e)=>{let o,l=e.config.address[s];if(null!=l){let s=tt(e,l);if(this.dependencies.every((n=>n instanceof j?e.facet(n)===t.facet(n):!(n instanceof W)||e.field(n,!1)==t.field(n,!1)))||(h?_(o=n(t),s,i):i(o=n(t),s)))return t.values[r]=s,0}else o=n(t);return t.values[r]=o,1}}}}function _(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function z(t,e){let n=!1;for(let i of e)1&Z(t,i)&&(n=!0);return n}function V(t,e,n){let i=n.map((e=>t[e.id])),s=n.map((t=>t.type)),r=i.filter((t=>!(1&t))),h=t[e.id]>>1;function o(t){let n=[];for(let e=0;e<i.length;e++){let r=tt(t,i[e]);if(2==s[e])for(let t of r)n.push(t);else n.push(r)}return e.combine(n)}return{create(t){for(let e of i)Z(t,e);return t.values[h]=o(t),1},update(t,n){if(!z(t,r))return 0;let i=o(t);return e.compare(i,t.values[h])?0:(t.values[h]=i,1)},reconfigure(t,s){let r=z(t,i),l=s.config.facets[e.id],a=s.facet(e);if(l&&!r&&q(n,l))return t.values[h]=a,0;let c=o(t);return e.compare(c,a)?(t.values[h]=a,0):(t.values[h]=c,1)}}}const U=j.define({static:!0});class W{constructor(t,e,n,i,s){this.id=t,this.createF=e,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(t){let e=new W(D++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(U).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,n)=>{let i=t.values[e],s=this.updateF(i,n);return this.compareF(i,s)?0:(t.values[e]=s,1)},reconfigure:(t,n)=>null!=n.config.address[this.id]?(t.values[e]=n.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,U.of({field:this,create:t})]}get extension(){return this}}function G(t){return e=>new H(e,t)}const Y={highest:G(0),high:G(1),default:G(2),low:G(3),lowest:G(4)};class H{constructor(t,e){this.inner=t,this.prec=e}}class K{of(t){return new Q(this,t)}reconfigure(t){return K.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class Q{constructor(t,e){this.compartment=t,this.inner=e}}class X{constructor(t,e,n,i,s,r){for(this.base=t,this.compartments=e,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,n){let i=[],s=Object.create(null),r=new Map;for(let n of function(t,e,n){let i=[[],[],[],[],[]],s=new Map;return function t(r,h){let o=s.get(r);if(null!=o){if(o<=h)return;let t=i[o].indexOf(r);t>-1&&i[o].splice(t,1),r instanceof Q&&n.delete(r.compartment)}if(s.set(r,h),Array.isArray(r))for(let e of r)t(e,h);else if(r instanceof Q){if(n.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=e.get(r.compartment)||r.inner;n.set(r.compartment,i),t(i,h)}else if(r instanceof H)t(r.inner,r.prec);else if(r instanceof W)i[h].push(r),r.provides&&t(r.provides,h);else if(r instanceof $)i[h].push(r),r.facet.extensions&&t(r.facet.extensions,2);else{let e=r.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(e,h)}}(t,2),i.reduce(((t,e)=>t.concat(e)))}(t,e,r))n instanceof W?i.push(n):(s[n.facet.id]||(s[n.facet.id]=[])).push(n);let h=Object.create(null),o=[],l=[];for(let t of i)h[t.id]=l.length<<1,l.push((e=>t.slot(e)));let a=null==n?void 0:n.config.facets;for(let t in s){let e=s[t],i=e[0].facet,r=a&&a[t]||[];if(e.every((t=>0==t.type)))if(h[i.id]=o.length<<1|1,q(r,e))o.push(n.facet(i));else{let t=i.combine(e.map((t=>t.value)));o.push(n&&i.compare(t,n.facet(i))?n.facet(i):t)}else{for(let t of e)0==t.type?(h[t.id]=o.length<<1|1,o.push(t.value)):(h[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));h[i.id]=l.length<<1,l.push((t=>V(t,i,e)))}}let c=l.map((t=>t(h)));return new X(t,r,c,h,o,s)}}function Z(t,e){if(1&e)return 2;let n=e>>1,i=t.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function tt(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const et=j.define(),nt=j.define({combine:t=>t.some((t=>t)),static:!0}),it=j.define({combine:t=>t.length?t[0]:void 0,static:!0}),st=j.define(),rt=j.define(),ht=j.define(),ot=j.define({combine:t=>!!t.length&&t[0]});class lt{constructor(t,e){this.type=t,this.value=e}static define(){return new at}}class at{of(t){return new lt(this,t)}}class ct{constructor(t){this.map=t}of(t){return new ft(this,t)}}class ft{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new ft(this.type,e)}is(t){return this.type==t}static define(t={}){return new ct(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let n=[];for(let i of t){let t=i.map(e);t&&n.push(t)}return n}}ft.reconfigure=ft.define(),ft.appendConfig=ft.define();class ut{constructor(t,e,n,i,s,r){this.startState=t,this.changes=e,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,n&&N(n,e.newLength),s.some((t=>t.type==ut.time))||(this.annotations=s.concat(ut.time.of(Date.now())))}static create(t,e,n,i,s,r){return new ut(t,e,n,i,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(ut.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function gt(t,e){let n=[];for(let i=0,s=0;;){let r,h;if(i<t.length&&(s==e.length||e[s]>=t[i]))r=t[i++],h=t[i++];else{if(!(s<e.length))return n;r=e[s++],h=e[s++]}!n.length||n[n.length-1]<r?n.push(r,h):n[n.length-1]<h&&(n[n.length-1]=h)}}function dt(t,e,n){var i;let s,r,h;return n?(s=e.changes,r=A.empty(e.changes.length),h=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),h=t.changes.compose(s)),{changes:h,selection:e.selection?e.selection.map(r):null===(i=t.selection)||void 0===i?void 0:i.map(s),effects:ft.mapEffects(t.effects,s).concat(ft.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function pt(t,e,n){let i=e.selection,s=xt(e.annotations);return e.userEvent&&(s=s.concat(ut.userEvent.of(e.userEvent))),{changes:e.changes instanceof A?e.changes:A.of(e.changes||[],n,t.facet(it)),selection:i&&(i instanceof L?i:L.single(i.anchor,i.head)),effects:xt(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function mt(t,e,n){let i=pt(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(n=!1);for(let s=1;s<e.length;s++){!1===e[s].filter&&(n=!1);let r=!!e[s].sequential;i=dt(i,pt(t,e[s],r?i.changes.newLength:t.doc.length),r)}let s=ut.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(t){let e=t.startState,n=e.facet(ht),i=t;for(let s=n.length-1;s>=0;s--){let r=n[s](t);r&&Object.keys(r).length&&(i=dt(i,pt(e,r,t.changes.newLength),!0))}return i==t?t:ut.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(t){let e=t.startState,n=!0;for(let i of e.facet(st)){let e=i(t);if(!1===e){n=!1;break}Array.isArray(e)&&(n=!0===n?e:gt(n,e))}if(!0!==n){let i,s;if(!1===n)s=t.changes.invertedDesc,i=A.empty(e.doc.length);else{let e=t.changes.filter(n);i=e.changes,s=e.filtered.mapDesc(e.changes).invertedDesc}t=ut.create(e,i,t.selection&&t.selection.map(s),ft.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(rt);for(let n=i.length-1;n>=0;n--){let s=i[n](t);t=s instanceof ut?s:Array.isArray(s)&&1==s.length&&s[0]instanceof ut?s[0]:mt(e,xt(s),!1)}return t}(s):s)}ut.time=lt.define(),ut.userEvent=lt.define(),ut.addToHistory=lt.define(),ut.remote=lt.define();const vt=[];function xt(t){return null==t?vt:Array.isArray(t)?t:[t]}var wt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(wt||(wt={}));const kt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let St;try{St=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}class yt{constructor(t,e,n,i,s,r){this.config=t,this.doc=e,this.selection=n,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)Z(this,t<<1);this.computeSlot=null}field(t,e=!0){let n=this.config.address[t.id];if(null!=n)return Z(this,n),tt(this,n);if(e)throw new RangeError("Field is not present in this state")}update(...t){return mt(this,t,!0)}applyTransaction(t){let e,n=this.config,{base:i,compartments:s}=n;for(let e of t.effects)e.is(K.reconfigure)?(n&&(s=new Map,n.compartments.forEach(((t,e)=>s.set(e,t))),n=null),s.set(e.value.compartment,e.value.extension)):e.is(ft.reconfigure)?(n=null,i=e.value):e.is(ft.appendConfig)&&(n=null,i=xt(i).concat(e.value));n?e=t.startState.values.slice():(n=X.resolve(i,s,this),e=new yt(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values);let r=t.startState.facet(nt)?t.newSelection:t.newSelection.asSingle();new yt(n,t.newDoc,r,e,((e,n)=>n.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:L.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,n=t(e.ranges[0]),i=this.changes(n.changes),s=[n.range],r=xt(n.effects);for(let n=1;n<e.ranges.length;n++){let h=t(e.ranges[n]),o=this.changes(h.changes),l=o.map(i);for(let t=0;t<n;t++)s[t]=s[t].map(l);let a=i.mapDesc(o,!0);s.push(h.range.map(a)),i=i.compose(l),r=ft.mapEffects(r,l).concat(ft.mapEffects(xt(h.effects),a))}return{changes:i,selection:L.create(s,e.mainIndex),effects:r}}changes(t=[]){return t instanceof A?t:A.of(t,this.doc.length,this.facet(yt.lineSeparator))}toText(t){return i.of(t.split(this.facet(yt.lineSeparator)||P))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(Z(this,e),tt(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let n in t){let i=t[n];i instanceof W&&null!=this.config.address[i.id]&&(e[n]=i.spec.toJSON(this.field(t[n]),this))}return e}static fromJSON(t,e={},n){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n)for(let e in n)if(Object.prototype.hasOwnProperty.call(t,e)){let s=n[e],r=t[e];i.push(s.init((t=>s.spec.fromJSON(r,t))))}return yt.create({doc:t.doc,selection:L.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=X.resolve(t.extensions||[],new Map),n=t.doc instanceof i?t.doc:i.of((t.doc||"").split(e.staticFacet(yt.lineSeparator)||P)),s=t.selection?t.selection instanceof L?t.selection:L.single(t.selection.anchor,t.selection.head):L.single(0);return N(s,n.length),e.staticFacet(nt)||(s=s.asSingle()),new yt(e,n,s,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(yt.tabSize)}get lineBreak(){return this.facet(yt.lineSeparator)||"\n"}get readOnly(){return this.facet(ot)}phrase(t,...e){for(let e of this.facet(yt.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>e.length?t:e[i-1]}))),t}languageDataAt(t,e,n=-1){let i=[];for(let s of this.facet(et))for(let r of s(this,e,n))Object.prototype.hasOwnProperty.call(r,t)&&i.push(r[t]);return i}charCategorizer(t){return e=this.languageDataAt("wordChars",t).join(""),t=>{if(!/\S/.test(t))return wt.Space;if(function(t){if(St)return St.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||kt.test(n)))return!0}return!1}(t))return wt.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return wt.Word;return wt.Other};var e}wordAt(t){let{text:e,from:n,length:i}=this.doc.lineAt(t),s=this.charCategorizer(t),r=t-n,h=t-n;for(;r>0;){let t=v(e,r,!1);if(s(e.slice(t,r))!=wt.Word)break;r=t}for(;h<i;){let t=v(e,h);if(s(e.slice(h,t))!=wt.Word)break;h=t}return r==h?null:L.range(r+n,h+n)}}function It(t,e,n={}){let i={};for(let e of t)for(let t of Object.keys(e)){let s=e[t],r=i[t];if(void 0===r)i[t]=s;else if(r===s||void 0===s);else{if(!Object.hasOwnProperty.call(n,t))throw new Error("Config merge conflict for field "+t);i[t]=n[t](r,s)}}for(let t in e)void 0===i[t]&&(i[t]=e[t]);return i}yt.allowMultipleSelections=nt,yt.tabSize=j.define({combine:t=>t.length?t[0]:4}),yt.lineSeparator=it,yt.readOnly=ot,yt.phrases=j.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every((n=>t[n]==e[n]))}}),yt.languageData=et,yt.changeFilter=st,yt.transactionFilter=rt,yt.transactionExtender=ht,K.reconfigure=ft.define();class bt{eq(t){return this==t}range(t,e=t){return Pt.create(t,e,this)}}bt.prototype.startSide=bt.prototype.endSide=0,bt.prototype.point=!1,bt.prototype.mapMode=E.TrackDel;class Pt{constructor(t,e,n){this.from=t,this.to=e,this.value=n}static create(t,e,n){return new Pt(t,e,n)}}function Et(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Mt{constructor(t,e,n,i){this.from=t,this.to=e,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,n,i=0){let s=n?this.to:this.from;for(let r=i,h=s.length;;){if(r==h)return r;let i=r+h>>1,o=s[i]-t||(n?this.value[i].endSide:this.value[i].startSide)-e;if(i==r)return o>=0?r:h;o>=0?h=i:r=i+1}}between(t,e,n,i){for(let s=this.findIndex(e,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(!1===i(this.from[s]+t,this.to[s]+t,this.value[s]))return!1}map(t,e){let n=[],i=[],s=[],r=-1,h=-1;for(let o=0;o<this.value.length;o++){let l,a,c=this.value[o],f=this.from[o]+t,u=this.to[o]+t;if(f==u){let t=e.mapPos(f,c.startSide,c.mapMode);if(null==t)continue;if(l=a=t,c.startSide!=c.endSide&&(a=e.mapPos(f,c.endSide),a<l))continue}else if(l=e.mapPos(f,c.startSide),a=e.mapPos(u,c.endSide),l>a||l==a&&c.startSide>0&&c.endSide<=0)continue;(a-l||c.endSide-c.startSide)<0||(r<0&&(r=l),c.point&&(h=Math.max(h,a-l)),n.push(c),i.push(l-r),s.push(a-r))}return{mapped:n.length?new Mt(i,s,n,h):null,pos:r}}}class At{constructor(t,e,n,i){this.chunkPos=t,this.chunk=e,this.nextLayer=n,this.maxPoint=i}static create(t,e,n,i){return new At(t,e,n,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=t,r=t.filter;if(0==e.length&&!r)return this;if(n&&(e=e.slice().sort(Et)),this.isEmpty)return e.length?At.of(e):this;let h=new Ot(this,null,-1).goto(0),o=0,l=[],a=new Rt;for(;h.value||o<e.length;)if(o<e.length&&(h.from-e[o].from||h.startSide-e[o].value.startSide)>=0){let t=e[o++];a.addInner(t.from,t.to,t.value)||l.push(t)}else 1==h.rangeIndex&&h.chunkIndex<this.chunk.length&&(o==e.length||this.chunkEnd(h.chunkIndex)<e[o].from)&&(!r||i>this.chunkEnd(h.chunkIndex)||s<this.chunkPos[h.chunkIndex])&&a.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!r||i>h.to||s<h.from||r(h.from,h.to,h.value))&&(a.addInner(h.from,h.to,h.value)||l.push(Pt.create(h.from,h.to,h.value))),h.next());return a.finishInner(this.nextLayer.isEmpty&&!l.length?At.empty:this.nextLayer.update({add:l,filter:r,filterFrom:i,filterTo:s}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],n=[],i=-1;for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],h=this.chunk[s],o=t.touchesRange(r,r+h.length);if(!1===o)i=Math.max(i,h.maxPoint),e.push(h),n.push(t.mapPos(r));else if(!0===o){let{mapped:s,pos:o}=h.map(r,t);s&&(i=Math.max(i,s.maxPoint),e.push(s),n.push(o))}}let s=this.nextLayer.map(t);return 0==e.length?s:new At(n,e,s||At.empty,i)}between(t,e,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(e>=s&&t<=s+r.length&&!1===r.between(s,t-s,e-s,n))return}this.nextLayer.between(t,e,n)}}iter(t=0){return Tt.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Tt.from(t).goto(e)}static compare(t,e,n,i,s=-1){let r=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),h=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),o=Ct(r,h,n),l=new Ft(r,o,s),a=new Ft(h,o,s);n.iterGaps(((t,e,n)=>Jt(l,t,a,e,n,i))),n.empty&&0==n.length&&Jt(l,0,a,0,0,i)}static eq(t,e,n=0,i){null==i&&(i=999999999);let s=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(s.length!=r.length)return!1;if(!s.length)return!0;let h=Ct(s,r),o=new Ft(s,h,0).goto(n),l=new Ft(r,h,0).goto(n);for(;;){if(o.to!=l.to||!Lt(o.active,l.active)||o.point&&(!l.point||!o.point.eq(l.point)))return!1;if(o.to>i)return!0;o.next(),l.next()}}static spans(t,e,n,i,s=-1){let r=new Ft(t,null,s).goto(e),h=e,o=r.openStart;for(;;){let t=Math.min(r.to,n);if(r.point){let n=r.activeForPoint(r.to),s=r.pointFrom<e?n.length+1:r.point.startSide<0?n.length:Math.min(n.length,o);i.point(h,t,r.point,n,s,r.pointRank),o=Math.min(r.openEnd(t),n.length)}else t>h&&(i.span(h,t,r.active,o),o=r.openEnd(t));if(r.to>n)return o+(r.point&&r.to>n?1:0);h=r.to,r.next()}}static of(t,e=!1){let n=new Rt;for(let i of t instanceof Pt?[t]:e?function(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(Et(e,i)>0)return t.slice().sort(Et);e=i}return t}(t):t)n.add(i.from,i.to,i.value);return n.finish()}static join(t){if(!t.length)return At.empty;let e=t[t.length-1];for(let n=t.length-2;n>=0;n--)for(let i=t[n];i!=At.empty;i=i.nextLayer)e=new At(i.chunkPos,i.chunk,e,Math.max(i.maxPoint,e.maxPoint));return e}}At.empty=new At([],[],null,-1),At.empty.nextLayer=At.empty;class Rt{finishChunk(t){this.chunks.push(new Mt(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,n){this.addInner(t,e,n)||(this.nextLayer||(this.nextLayer=new Rt)).add(t,e,n)}addInner(t,e,n){let i=t-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),0))}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}finish(){return this.finishInner(At.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=At.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Ct(t,e,n){let i=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&i.set(e.chunk[t],e.chunkPos[t]);let s=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let r=i.get(t.chunk[e]);null==r||(n?n.mapPos(r):r)!=t.chunkPos[e]||(null==n?void 0:n.touchesRange(r,r+t.chunk[e].length))||s.add(t.chunk[e])}return s}class Ot{constructor(t,e,n,i=0){this.layer=t,this.skip=e,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,n){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],n=t+e.from[this.rangeIndex];if(this.from=n,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Tt{constructor(t){this.heap=t}static from(t,e=null,n=-1){let i=[];for(let s=0;s<t.length;s++)for(let r=t[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new Ot(r,e,n,s));return 1==i.length?i[0]:new Tt(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let n of this.heap)n.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Bt(this.heap,t);return this.next(),this}forward(t,e){for(let n of this.heap)n.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Bt(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Bt(this.heap,0)}}}function Bt(t,e){for(let n=t[e];;){let i=1+(e<<1);if(i>=t.length)break;let s=t[i];if(i+1<t.length&&s.compare(t[i+1])>=0&&(s=t[i+1],i++),n.compare(s)<0)break;t[i]=n,t[e]=s,e=i}}class Ft{constructor(t,e,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Tt.from(t,e,n)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Nt(this.active,t),Nt(this.activeTo,t),Nt(this.activeRank,t),this.minActive=jt(this.active,this.activeTo)}addActive(t){let e=0,{value:n,to:i,rank:s}=this.cursor;for(;e<this.activeRank.length&&(s-this.activeRank[e]||i-this.activeTo[e])>0;)e++;Dt(this.active,e,n),Dt(this.activeTo,e,i),Dt(this.activeRank,e,s),t&&Dt(t,e,this.cursor.from),this.minActive=jt(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&Nt(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let e=n.length-1;e>=0&&n[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>=this.point.endSide)&&e.push(this.active[n]);return e.reverse()}openEnd(t){let e=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>t;n--)e++;return e}}function Jt(t,e,n,i,s,r){t.goto(e),n.goto(i);let h=i+s,o=i,l=i-e;for(;;){let e=t.to+l-n.to||t.endSide-n.endSide,i=e<0?t.to+l:n.to,s=Math.min(i,h);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Lt(t.activeForPoint(t.to),n.activeForPoint(n.to))||r.comparePoint(o,s,t.point,n.point):s>o&&!Lt(t.active,n.active)&&r.compareRange(o,s,t.active,n.active),i>h)break;o=i,e<=0&&t.next(),e>=0&&n.next()}}function Lt(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Nt(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function Dt(t,e,n){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=n}function jt(t,e){let n=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||t[s].endSide-t[n].endSide)<0&&(n=s,i=e[s]);return n}function qt(t,e,n=t.length){let i=0;for(let s=0;s<n;)9==t.charCodeAt(s)?(i+=e-i%e,s++):(i++,s=v(t,s));return i}function $t(t,e,n,i){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=9==t.charCodeAt(i)?n-s%n:1,i=v(t,i)}return!0===i?-1:t.length}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3030],{92323:(t,e,n)=>{n.r(e),n.d(e,{Annotation:()=>lt,AnnotationType:()=>at,ChangeDesc:()=>M,ChangeSet:()=>A,CharCategory:()=>wt,Compartment:()=>K,EditorSelection:()=>L,EditorState:()=>yt,Facet:()=>j,Line:()=>f,MapMode:()=>E,Prec:()=>Y,Range:()=>Pt,RangeSet:()=>At,RangeSetBuilder:()=>Rt,RangeValue:()=>bt,SelectionRange:()=>J,StateEffect:()=>ft,StateEffectType:()=>ct,StateField:()=>W,Text:()=>i,Transaction:()=>ut,codePointAt:()=>y,codePointSize:()=>b,combineConfig:()=>It,countColumn:()=>qt,findClusterBreak:()=>v,findColumn:()=>$t,fromCodePoint:()=>I});class i{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,n){[t,e]=u(this,t,e);let i=[];return this.decompose(0,t,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(e,this.length,i,1),r.from(i,this.length-(e-t)+n.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=u(this,t,e);let n=[];return this.decompose(t,e,n,0),r.from(n,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),n=this.length-this.scanIdentical(t,-1),i=new l(this),s=new l(t);for(let t=e,r=e;;){if(i.next(t),s.next(t),t=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(r+=i.value.length,i.done||r>=n)return!0}}iter(t=1){return new l(this,t)}iterRange(t,e=this.length){return new a(this,t,e)}iterLines(t,e){let n;if(null==t)n=this.iter();else{null==e&&(e=this.lines+1);let i=this.line(t).from;n=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new s(t):r.from(s.split(t,[])):i.empty}}class s extends i{constructor(t,e=function(t){let e=-1;for(let n of t)e+=n.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.text[s],h=i+r.length;if((e?n:h)>=t)return new f(i,h,n,r);i=h+1,n++}}decompose(t,e,n,i){let r=t<=0&&e>=this.length?this:new s(o(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){let t=n.pop(),e=h(r.text,t.text.slice(),0,r.length);if(e.length<=32)n.push(new s(e,t.length+r.length));else{let t=e.length>>1;n.push(new s(e.slice(0,t)),new s(e.slice(t)))}}else n.push(r)}replace(t,e,n){if(!(n instanceof s))return super.replace(t,e,n);[t,e]=u(this,t,e);let i=h(this.text,h(n.text,o(this.text,0,t)),e),l=this.length+n.length-(e-t);return i.length<=32?new s(i,l):r.from(s.split(i,[]),l)}sliceString(t,e=this.length,n="\n"){[t,e]=u(this,t,e);let i="";for(let s=0,r=0;s<=e&&r<this.text.length;r++){let h=this.text[r],o=s+h.length;s>t&&r&&(i+=n),t<o&&e>s&&(i+=h.slice(Math.max(0,t-s),e-s)),s=o+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let n=[],i=-1;for(let r of t)n.push(r),i+=r.length+1,32==n.length&&(e.push(new s(n,i)),n=[],i=-1);return i>-1&&e.push(new s(n,i)),e}}class r extends i{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.children[s],h=i+r.length,o=n+r.lines-1;if((e?o:h)>=t)return r.lineInner(t,e,n,i);i=h+1,n=o+1}}decompose(t,e,n,i){for(let s=0,r=0;r<=e&&s<this.children.length;s++){let h=this.children[s],o=r+h.length;if(t<=o&&e>=r){let s=i&((r<=t?1:0)|(o>=e?2:0));r>=t&&o<=e&&!s?n.push(h):h.decompose(t-r,e-r,n,s)}r=o+1}}replace(t,e,n){if([t,e]=u(this,t,e),n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let h=this.children[i],o=s+h.length;if(t>=s&&e<=o){let l=h.replace(t-s,e-s,n),a=this.lines-h.lines+l.lines;if(l.lines<a>>4&&l.lines>a>>6){let s=this.children.slice();return s[i]=l,new r(s,this.length-(e-t)+n.length)}return super.replace(s,o,l)}s=o+1}return super.replace(t,e,n)}sliceString(t,e=this.length,n="\n"){[t,e]=u(this,t,e);let i="";for(let s=0,r=0;s<this.children.length&&r<=e;s++){let h=this.children[s],o=r+h.length;r>t&&s&&(i+=n),t<o&&e>r&&(i+=h.sliceString(t-r,e-r,n)),r=o+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof r))return 0;let n=0,[i,s,h,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,s+=e){if(i==h||s==o)return n;let r=this.children[i],l=t.children[s];if(r!=l)return n+r.scanIdentical(l,e);n+=r.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let n=0;for(let e of t)n+=e.lines;if(n<32){let n=[];for(let e of t)e.flatten(n);return new s(n,e)}let i=Math.max(32,n>>5),h=i<<1,o=i>>1,l=[],a=0,c=-1,f=[];function u(t){let e;if(t.lines>h&&t instanceof r)for(let e of t.children)u(e);else t.lines>o&&(a>o||!a)?(g(),l.push(t)):t instanceof s&&a&&(e=f[f.length-1])instanceof s&&t.lines+e.lines<=32?(a+=t.lines,c+=t.length+1,f[f.length-1]=new s(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>i&&g(),a+=t.lines,c+=t.length+1,f.push(t))}function g(){0!=a&&(l.push(1==f.length?f[0]:r.from(f,c)),c=-1,a=f.length=0)}for(let e of t)u(e);return g(),1==l.length?l[0]:new r(l,e)}}function h(t,e,n=0,i=1e9){for(let s=0,r=0,h=!0;r<t.length&&s<=i;r++){let o=t[r],l=s+o.length;l>=n&&(l>i&&(o=o.slice(0,i-s)),s<n&&(o=o.slice(n-s)),h?(e[e.length-1]+=o,h=!1):e.push(o)),s=l+1}return e}function o(t,e,n){return h(t,[""],e,n)}i.empty=new s([""],0);class l{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof s?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],h=r>>1,o=i instanceof s?i.text.length:i.children.length;if(h==(e>0?o:0)){if(0==n)return this.done=!0,this.value="",this;e>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(e>0?0:1)){if(this.offsets[n]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof s){let s=i.text[h+(e<0?-1:0)];if(this.offsets[n]+=e,s.length>Math.max(0,t))return this.value=0==t?s:e>0?s.slice(t):s.slice(0,s.length-t),this;t-=s.length}else{let r=i.children[h+(e<0?-1:0)];t>r.length?(t-=r.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(e>0?1:(r instanceof s?r.text.length:r.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class a{constructor(t,e,n){this.value="",this.done=!1,this.cursor=new l(t,e>n?-1:1),this.pos=e>n?t.length:0,this.from=Math.min(e,n),this.to=Math.max(e,n)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let n=e<0?this.pos-this.from:this.to-this.pos;t>n&&(t=n),n-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=n?i:e<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:n,value:i}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(i.prototype[Symbol.iterator]=function(){return this.iter()},l.prototype[Symbol.iterator]=a.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class f{constructor(t,e,n,i){this.from=t,this.to=e,this.number=n,this.text=i}get length(){return this.to-this.from}}function u(t,e,n){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,n))]}let g="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let t=1;t<g.length;t++)g[t]+=g[t-1];function d(t){for(let e=1;e<g.length;e+=2)if(g[e]>t)return g[e-1]<=t;return!1}function p(t){return t>=127462&&t<=127487}const m=8205;function v(t,e,n=!0,i=!0){return(n?x:w)(t,e,i)}function x(t,e,n){if(e==t.length)return e;e&&k(t.charCodeAt(e))&&S(t.charCodeAt(e-1))&&e--;let i=y(t,e);for(e+=b(i);e<t.length;){let s=y(t,e);if(i==m||s==m||n&&d(s))e+=b(s),i=s;else{if(!p(s))break;{let n=0,i=e-2;for(;i>=0&&p(y(t,i));)n++,i-=2;if(n%2==0)break;e+=2}}}return e}function w(t,e,n){for(;e>0;){let i=x(t,e-2,n);if(i<e)return i;e--}return 0}function k(t){return t>=56320&&t<57344}function S(t){return t>=55296&&t<56320}function y(t,e){let n=t.charCodeAt(e);if(!S(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return k(i)?i-56320+(n-55296<<10)+65536:n}function I(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function b(t){return t<65536?1:2}const P=/\r\n?|\n/;var E=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(E||(E={}));class M{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e+1];t+=n<0?this.sections[e]:n}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,n=0,i=0;e<this.sections.length;){let s=this.sections[e++],r=this.sections[e++];r<0?(t(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(t,e=!1){O(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];i<0?t.push(n,i):t.push(i,n)}return new M(t)}composeDesc(t){return this.empty?t:t.empty?this:B(this,t)}mapDesc(t,e=!1){return t.empty?this:T(this,t,e)}mapPos(t,e=-1,n=E.Simple){let i=0,s=0;for(let r=0;r<this.sections.length;){let h=this.sections[r++],o=this.sections[r++],l=i+h;if(o<0){if(l>t)return s+(t-i);s+=h}else{if(n!=E.Simple&&l>=t&&(n==E.TrackDel&&i<t&&l>t||n==E.TrackBefore&&i<t||n==E.TrackAfter&&l>t))return null;if(l>t||l==t&&e<0&&!h)return t==i||e<0?s:s+o;s+=o}i=l}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return s}touchesRange(t,e=t){for(let n=0,i=0;n<this.sections.length&&i<=e;){let s=i+this.sections[n++];if(this.sections[n++]>=0&&i<=e&&s>=t)return!(i<t&&s>e)||"cover";i=s}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];t+=(t?" ":"")+n+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new M(t)}static create(t){return new M(t)}}class A extends M{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return O(this,((e,n,i,s,r)=>t=t.replace(i,i+(n-e),r)),!1),t}mapDesc(t,e=!1){return T(this,t,e,!0)}invert(t){let e=this.sections.slice(),n=[];for(let s=0,r=0;s<e.length;s+=2){let h=e[s],o=e[s+1];if(o>=0){e[s]=o,e[s+1]=h;let l=s>>1;for(;n.length<l;)n.push(i.empty);n.push(h?t.slice(r,r+h):i.empty)}r+=h}return new A(e,n)}compose(t){return this.empty?t:t.empty?this:B(this,t,!0)}map(t,e=!1){return t.empty?this:T(this,t,e,!0)}iterChanges(t,e=!1){O(this,t,e)}get desc(){return M.create(this.sections)}filter(t){let e=[],n=[],i=[],s=new F(this);t:for(let r=0,h=0;;){let o=r==t.length?1e9:t[r++];for(;h<o||h==o&&0==s.len;){if(s.done)break t;let t=Math.min(s.len,o-h);R(i,t,-1);let r=-1==s.ins?-1:0==s.off?s.ins:0;R(e,t,r),r>0&&C(n,e,s.text),s.forward(t),h+=t}let l=t[r++];for(;h<l;){if(s.done)break t;let t=Math.min(s.len,l-h);R(e,t,-1),R(i,t,-1==s.ins?-1:0==s.off?s.ins:0),s.forward(t),h+=t}}return{changes:new A(e,n),filtered:M.create(i)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e],i=this.sections[e+1];i<0?t.push(n):0==i?t.push([n]):t.push([n].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,n){let s=[],r=[],h=0,o=null;function l(t=!1){if(!t&&!s.length)return;h<e&&R(s,e-h,-1);let n=new A(s,r);o=o?o.compose(n.map(o)):n,s=[],r=[],h=0}return function t(a){if(Array.isArray(a))for(let e of a)t(e);else if(a instanceof A){if(a.length!=e)throw new RangeError(`Mismatched change set length (got ${a.length}, expected ${e})`);l(),o=o?o.compose(a.map(o)):a}else{let{from:t,to:o=t,insert:c}=a;if(t>o||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let f=c?"string"==typeof c?i.of(c.split(n||P)):c:i.empty,u=f.length;if(t==o&&0==u)return;t<h&&l(),t>h&&R(s,t-h,-1),R(s,o-t,u),C(r,s,f),h=o}}(t),l(!o),o}static empty(t){return new A(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],n=[];for(let s=0;s<t.length;s++){let r=t[s];if("number"==typeof r)e.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some(((t,e)=>e&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)e.push(r[0],0);else{for(;n.length<s;)n.push(i.empty);n[s]=i.of(r.slice(1)),e.push(r[0],n[s].length)}}}return new A(e,n)}static createSet(t,e){return new A(t,e)}}function R(t,e,n,i=!1){if(0==e&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:0==e&&0==t[s]?t[s+1]+=n:i?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function C(t,e,n){if(0==n.length)return;let s=e.length-2>>1;if(s<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<s;)t.push(i.empty);t.push(n)}}function O(t,e,n){let s=t.inserted;for(let r=0,h=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,h+=l;else{let c=r,f=h,u=i.empty;for(;c+=l,f+=a,a&&s&&(u=u.append(s[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,h,f,u),r=c,h=f}}}function T(t,e,n,i=!1){let s=[],r=i?[]:null,h=new F(t),o=new F(e);for(let t=-1;;)if(-1==h.ins&&-1==o.ins){let t=Math.min(h.len,o.len);R(s,t,-1),h.forward(t),o.forward(t)}else if(o.ins>=0&&(h.ins<0||t==h.i||0==h.off&&(o.len<h.len||o.len==h.len&&!n))){let e=o.len;for(R(s,o.ins,-1);e;){let n=Math.min(h.len,e);h.ins>=0&&t<h.i&&h.len<=n&&(R(s,0,h.ins),r&&C(r,s,h.text),t=h.i),h.forward(n),e-=n}o.next()}else{if(!(h.ins>=0)){if(h.done&&o.done)return r?A.createSet(s,r):M.create(s);throw new Error("Mismatched change set lengths")}{let e=0,n=h.len;for(;n;)if(-1==o.ins){let t=Math.min(n,o.len);e+=t,n-=t,o.forward(t)}else{if(!(0==o.ins&&o.len<n))break;n-=o.len,o.next()}R(s,e,t<h.i?h.ins:0),r&&t<h.i&&C(r,s,h.text),t=h.i,h.forward(h.len-n)}}}function B(t,e,n=!1){let i=[],s=n?[]:null,r=new F(t),h=new F(e);for(let t=!1;;){if(r.done&&h.done)return s?A.createSet(i,s):M.create(i);if(0==r.ins)R(i,r.len,0,t),r.next();else if(0!=h.len||h.done){if(r.done||h.done)throw new Error("Mismatched change set lengths");{let e=Math.min(r.len2,h.len),n=i.length;if(-1==r.ins){let n=-1==h.ins?-1:h.off?0:h.ins;R(i,e,n,t),s&&n&&C(s,i,h.text)}else-1==h.ins?(R(i,r.off?0:r.len,e,t),s&&C(s,i,r.textBit(e))):(R(i,r.off?0:r.len,h.off?0:h.ins,t),s&&!h.off&&C(s,i,h.text));t=(r.ins>e||h.ins>=0&&h.len>e)&&(t||i.length>n),r.forward2(e),h.forward(e)}}else R(i,0,h.ins,t),s&&C(s,i,h.text),h.next()}}class F{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?i.empty:t[e]}textBit(t){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length&&!t?i.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class J{constructor(t,e,n){this.from=t,this.to=e,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let n,i;return this.empty?n=i=t.mapPos(this.from,e):(n=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new J(n,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return L.range(t,e);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return L.range(this.anchor,n)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return L.range(t.anchor,t.head)}static create(t,e,n){return new J(t,e,n)}}class L{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:L.create(this.ranges.map((n=>n.map(t,e))),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(t.ranges[n],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new L([this.main],0)}addRange(t,e=!0){return L.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let n=this.ranges.slice();return n[e]=t,L.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((t=>t.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new L(t.ranges.map((t=>J.fromJSON(t))),t.main)}static single(t,e=t){return new L([L.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<t.length;i++){let s=t[i];if(s.empty?s.from<=n:s.from<n)return L.normalized(t.slice(),e);n=s.to}return new L(t,e)}static cursor(t,e=0,n,i){return J.create(t,t,(0==e?0:e<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:16777215)<<6)}static range(t,e,n,i){let s=(null!=n?n:16777215)<<6|(null==i?7:Math.min(6,i));return e<t?J.create(e,t,48|s):J.create(t,e,(e>t?8:0)|s)}static normalized(t,e=0){let n=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(n);for(let n=1;n<t.length;n++){let i=t[n],s=t[n-1];if(i.empty?i.from<=s.to:i.from<s.to){let r=s.from,h=Math.max(i.to,s.to);n<=e&&e--,t.splice(--n,2,i.anchor>i.head?L.range(h,r):L.range(r,h))}}return new L(t,e)}}function N(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let D=0;class j{constructor(t,e,n,i,s){this.combine=t,this.compareInput=e,this.compare=n,this.isStatic=i,this.id=D++,this.default=t([]),this.extensions="function"==typeof s?s(this):s}get reader(){return this}static define(t={}){return new j(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:q),!!t.static,t.enables)}of(t){return new $([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new $(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new $(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(n=>e(n.field(t))))}}function q(t,e){return t==e||t.length==e.length&&t.every(((t,n)=>t===e[n]))}class ${constructor(t,e,n,i){this.dependencies=t,this.facet=e,this.type=n,this.value=i,this.id=D++}dynamicSlot(t){var e;let n=this.value,i=this.facet.compareInput,s=this.id,r=t[s]>>1,h=2==this.type,o=!1,l=!1,a=[];for(let n of this.dependencies)"doc"==n?o=!0:"selection"==n?l=!0:0==(1&(null!==(e=t[n.id])&&void 0!==e?e:1))&&a.push(t[n.id]);return{create:t=>(t.values[r]=n(t),1),update(t,e){if(o&&e.docChanged||l&&(e.docChanged||e.selection)||z(t,a)){let e=n(t);if(h?!_(e,t.values[r],i):!i(e,t.values[r]))return t.values[r]=e,1}return 0},reconfigure:(t,e)=>{let o,l=e.config.address[s];if(null!=l){let s=tt(e,l);if(this.dependencies.every((n=>n instanceof j?e.facet(n)===t.facet(n):!(n instanceof W)||e.field(n,!1)==t.field(n,!1)))||(h?_(o=n(t),s,i):i(o=n(t),s)))return t.values[r]=s,0}else o=n(t);return t.values[r]=o,1}}}}function _(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function z(t,e){let n=!1;for(let i of e)1&Z(t,i)&&(n=!0);return n}function V(t,e,n){let i=n.map((e=>t[e.id])),s=n.map((t=>t.type)),r=i.filter((t=>!(1&t))),h=t[e.id]>>1;function o(t){let n=[];for(let e=0;e<i.length;e++){let r=tt(t,i[e]);if(2==s[e])for(let t of r)n.push(t);else n.push(r)}return e.combine(n)}return{create(t){for(let e of i)Z(t,e);return t.values[h]=o(t),1},update(t,n){if(!z(t,r))return 0;let i=o(t);return e.compare(i,t.values[h])?0:(t.values[h]=i,1)},reconfigure(t,s){let r=z(t,i),l=s.config.facets[e.id],a=s.facet(e);if(l&&!r&&q(n,l))return t.values[h]=a,0;let c=o(t);return e.compare(c,a)?(t.values[h]=a,0):(t.values[h]=c,1)}}}const U=j.define({static:!0});class W{constructor(t,e,n,i,s){this.id=t,this.createF=e,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(t){let e=new W(D++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(U).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,n)=>{let i=t.values[e],s=this.updateF(i,n);return this.compareF(i,s)?0:(t.values[e]=s,1)},reconfigure:(t,n)=>null!=n.config.address[this.id]?(t.values[e]=n.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,U.of({field:this,create:t})]}get extension(){return this}}function G(t){return e=>new H(e,t)}const Y={highest:G(0),high:G(1),default:G(2),low:G(3),lowest:G(4)};class H{constructor(t,e){this.inner=t,this.prec=e}}class K{of(t){return new Q(this,t)}reconfigure(t){return K.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class Q{constructor(t,e){this.compartment=t,this.inner=e}}class X{constructor(t,e,n,i,s,r){for(this.base=t,this.compartments=e,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,n){let i=[],s=Object.create(null),r=new Map;for(let n of function(t,e,n){let i=[[],[],[],[],[]],s=new Map;return function t(r,h){let o=s.get(r);if(null!=o){if(o<=h)return;let t=i[o].indexOf(r);t>-1&&i[o].splice(t,1),r instanceof Q&&n.delete(r.compartment)}if(s.set(r,h),Array.isArray(r))for(let e of r)t(e,h);else if(r instanceof Q){if(n.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=e.get(r.compartment)||r.inner;n.set(r.compartment,i),t(i,h)}else if(r instanceof H)t(r.inner,r.prec);else if(r instanceof W)i[h].push(r),r.provides&&t(r.provides,h);else if(r instanceof $)i[h].push(r),r.facet.extensions&&t(r.facet.extensions,2);else{let e=r.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(e,h)}}(t,2),i.reduce(((t,e)=>t.concat(e)))}(t,e,r))n instanceof W?i.push(n):(s[n.facet.id]||(s[n.facet.id]=[])).push(n);let h=Object.create(null),o=[],l=[];for(let t of i)h[t.id]=l.length<<1,l.push((e=>t.slot(e)));let a=null==n?void 0:n.config.facets;for(let t in s){let e=s[t],i=e[0].facet,r=a&&a[t]||[];if(e.every((t=>0==t.type)))if(h[i.id]=o.length<<1|1,q(r,e))o.push(n.facet(i));else{let t=i.combine(e.map((t=>t.value)));o.push(n&&i.compare(t,n.facet(i))?n.facet(i):t)}else{for(let t of e)0==t.type?(h[t.id]=o.length<<1|1,o.push(t.value)):(h[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));h[i.id]=l.length<<1,l.push((t=>V(t,i,e)))}}let c=l.map((t=>t(h)));return new X(t,r,c,h,o,s)}}function Z(t,e){if(1&e)return 2;let n=e>>1,i=t.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function tt(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const et=j.define(),nt=j.define({combine:t=>t.some((t=>t)),static:!0}),it=j.define({combine:t=>t.length?t[0]:void 0,static:!0}),st=j.define(),rt=j.define(),ht=j.define(),ot=j.define({combine:t=>!!t.length&&t[0]});class lt{constructor(t,e){this.type=t,this.value=e}static define(){return new at}}class at{of(t){return new lt(this,t)}}class ct{constructor(t){this.map=t}of(t){return new ft(this,t)}}class ft{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new ft(this.type,e)}is(t){return this.type==t}static define(t={}){return new ct(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let n=[];for(let i of t){let t=i.map(e);t&&n.push(t)}return n}}ft.reconfigure=ft.define(),ft.appendConfig=ft.define();class ut{constructor(t,e,n,i,s,r){this.startState=t,this.changes=e,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,n&&N(n,e.newLength),s.some((t=>t.type==ut.time))||(this.annotations=s.concat(ut.time.of(Date.now())))}static create(t,e,n,i,s,r){return new ut(t,e,n,i,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(ut.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function gt(t,e){let n=[];for(let i=0,s=0;;){let r,h;if(i<t.length&&(s==e.length||e[s]>=t[i]))r=t[i++],h=t[i++];else{if(!(s<e.length))return n;r=e[s++],h=e[s++]}!n.length||n[n.length-1]<r?n.push(r,h):n[n.length-1]<h&&(n[n.length-1]=h)}}function dt(t,e,n){var i;let s,r,h;return n?(s=e.changes,r=A.empty(e.changes.length),h=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),h=t.changes.compose(s)),{changes:h,selection:e.selection?e.selection.map(r):null===(i=t.selection)||void 0===i?void 0:i.map(s),effects:ft.mapEffects(t.effects,s).concat(ft.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function pt(t,e,n){let i=e.selection,s=xt(e.annotations);return e.userEvent&&(s=s.concat(ut.userEvent.of(e.userEvent))),{changes:e.changes instanceof A?e.changes:A.of(e.changes||[],n,t.facet(it)),selection:i&&(i instanceof L?i:L.single(i.anchor,i.head)),effects:xt(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function mt(t,e,n){let i=pt(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(n=!1);for(let s=1;s<e.length;s++){!1===e[s].filter&&(n=!1);let r=!!e[s].sequential;i=dt(i,pt(t,e[s],r?i.changes.newLength:t.doc.length),r)}let s=ut.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(t){let e=t.startState,n=e.facet(ht),i=t;for(let s=n.length-1;s>=0;s--){let r=n[s](t);r&&Object.keys(r).length&&(i=dt(i,pt(e,r,t.changes.newLength),!0))}return i==t?t:ut.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(t){let e=t.startState,n=!0;for(let i of e.facet(st)){let e=i(t);if(!1===e){n=!1;break}Array.isArray(e)&&(n=!0===n?e:gt(n,e))}if(!0!==n){let i,s;if(!1===n)s=t.changes.invertedDesc,i=A.empty(e.doc.length);else{let e=t.changes.filter(n);i=e.changes,s=e.filtered.mapDesc(e.changes).invertedDesc}t=ut.create(e,i,t.selection&&t.selection.map(s),ft.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(rt);for(let n=i.length-1;n>=0;n--){let s=i[n](t);t=s instanceof ut?s:Array.isArray(s)&&1==s.length&&s[0]instanceof ut?s[0]:mt(e,xt(s),!1)}return t}(s):s)}ut.time=lt.define(),ut.userEvent=lt.define(),ut.addToHistory=lt.define(),ut.remote=lt.define();const vt=[];function xt(t){return null==t?vt:Array.isArray(t)?t:[t]}var wt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(wt||(wt={}));const kt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let St;try{St=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}class yt{constructor(t,e,n,i,s,r){this.config=t,this.doc=e,this.selection=n,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)Z(this,t<<1);this.computeSlot=null}field(t,e=!0){let n=this.config.address[t.id];if(null!=n)return Z(this,n),tt(this,n);if(e)throw new RangeError("Field is not present in this state")}update(...t){return mt(this,t,!0)}applyTransaction(t){let e,n=this.config,{base:i,compartments:s}=n;for(let e of t.effects)e.is(K.reconfigure)?(n&&(s=new Map,n.compartments.forEach(((t,e)=>s.set(e,t))),n=null),s.set(e.value.compartment,e.value.extension)):e.is(ft.reconfigure)?(n=null,i=e.value):e.is(ft.appendConfig)&&(n=null,i=xt(i).concat(e.value));n?e=t.startState.values.slice():(n=X.resolve(i,s,this),e=new yt(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values);let r=t.startState.facet(nt)?t.newSelection:t.newSelection.asSingle();new yt(n,t.newDoc,r,e,((e,n)=>n.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:L.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,n=t(e.ranges[0]),i=this.changes(n.changes),s=[n.range],r=xt(n.effects);for(let n=1;n<e.ranges.length;n++){let h=t(e.ranges[n]),o=this.changes(h.changes),l=o.map(i);for(let t=0;t<n;t++)s[t]=s[t].map(l);let a=i.mapDesc(o,!0);s.push(h.range.map(a)),i=i.compose(l),r=ft.mapEffects(r,l).concat(ft.mapEffects(xt(h.effects),a))}return{changes:i,selection:L.create(s,e.mainIndex),effects:r}}changes(t=[]){return t instanceof A?t:A.of(t,this.doc.length,this.facet(yt.lineSeparator))}toText(t){return i.of(t.split(this.facet(yt.lineSeparator)||P))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(Z(this,e),tt(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let n in t){let i=t[n];i instanceof W&&null!=this.config.address[i.id]&&(e[n]=i.spec.toJSON(this.field(t[n]),this))}return e}static fromJSON(t,e={},n){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n)for(let e in n)if(Object.prototype.hasOwnProperty.call(t,e)){let s=n[e],r=t[e];i.push(s.init((t=>s.spec.fromJSON(r,t))))}return yt.create({doc:t.doc,selection:L.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=X.resolve(t.extensions||[],new Map),n=t.doc instanceof i?t.doc:i.of((t.doc||"").split(e.staticFacet(yt.lineSeparator)||P)),s=t.selection?t.selection instanceof L?t.selection:L.single(t.selection.anchor,t.selection.head):L.single(0);return N(s,n.length),e.staticFacet(nt)||(s=s.asSingle()),new yt(e,n,s,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(yt.tabSize)}get lineBreak(){return this.facet(yt.lineSeparator)||"\n"}get readOnly(){return this.facet(ot)}phrase(t,...e){for(let e of this.facet(yt.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>e.length?t:e[i-1]}))),t}languageDataAt(t,e,n=-1){let i=[];for(let s of this.facet(et))for(let r of s(this,e,n))Object.prototype.hasOwnProperty.call(r,t)&&i.push(r[t]);return i}charCategorizer(t){return e=this.languageDataAt("wordChars",t).join(""),t=>{if(!/\S/.test(t))return wt.Space;if(function(t){if(St)return St.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||kt.test(n)))return!0}return!1}(t))return wt.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return wt.Word;return wt.Other};var e}wordAt(t){let{text:e,from:n,length:i}=this.doc.lineAt(t),s=this.charCategorizer(t),r=t-n,h=t-n;for(;r>0;){let t=v(e,r,!1);if(s(e.slice(t,r))!=wt.Word)break;r=t}for(;h<i;){let t=v(e,h);if(s(e.slice(h,t))!=wt.Word)break;h=t}return r==h?null:L.range(r+n,h+n)}}function It(t,e,n={}){let i={};for(let e of t)for(let t of Object.keys(e)){let s=e[t],r=i[t];if(void 0===r)i[t]=s;else if(r===s||void 0===s);else{if(!Object.hasOwnProperty.call(n,t))throw new Error("Config merge conflict for field "+t);i[t]=n[t](r,s)}}for(let t in e)void 0===i[t]&&(i[t]=e[t]);return i}yt.allowMultipleSelections=nt,yt.tabSize=j.define({combine:t=>t.length?t[0]:4}),yt.lineSeparator=it,yt.readOnly=ot,yt.phrases=j.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every((n=>t[n]==e[n]))}}),yt.languageData=et,yt.changeFilter=st,yt.transactionFilter=rt,yt.transactionExtender=ht,K.reconfigure=ft.define();class bt{eq(t){return this==t}range(t,e=t){return Pt.create(t,e,this)}}bt.prototype.startSide=bt.prototype.endSide=0,bt.prototype.point=!1,bt.prototype.mapMode=E.TrackDel;class Pt{constructor(t,e,n){this.from=t,this.to=e,this.value=n}static create(t,e,n){return new Pt(t,e,n)}}function Et(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Mt{constructor(t,e,n,i){this.from=t,this.to=e,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,n,i=0){let s=n?this.to:this.from;for(let r=i,h=s.length;;){if(r==h)return r;let i=r+h>>1,o=s[i]-t||(n?this.value[i].endSide:this.value[i].startSide)-e;if(i==r)return o>=0?r:h;o>=0?h=i:r=i+1}}between(t,e,n,i){for(let s=this.findIndex(e,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(!1===i(this.from[s]+t,this.to[s]+t,this.value[s]))return!1}map(t,e){let n=[],i=[],s=[],r=-1,h=-1;for(let o=0;o<this.value.length;o++){let l,a,c=this.value[o],f=this.from[o]+t,u=this.to[o]+t;if(f==u){let t=e.mapPos(f,c.startSide,c.mapMode);if(null==t)continue;if(l=a=t,c.startSide!=c.endSide&&(a=e.mapPos(f,c.endSide),a<l))continue}else if(l=e.mapPos(f,c.startSide),a=e.mapPos(u,c.endSide),l>a||l==a&&c.startSide>0&&c.endSide<=0)continue;(a-l||c.endSide-c.startSide)<0||(r<0&&(r=l),c.point&&(h=Math.max(h,a-l)),n.push(c),i.push(l-r),s.push(a-r))}return{mapped:n.length?new Mt(i,s,n,h):null,pos:r}}}class At{constructor(t,e,n,i){this.chunkPos=t,this.chunk=e,this.nextLayer=n,this.maxPoint=i}static create(t,e,n,i){return new At(t,e,n,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=t,r=t.filter;if(0==e.length&&!r)return this;if(n&&(e=e.slice().sort(Et)),this.isEmpty)return e.length?At.of(e):this;let h=new Ot(this,null,-1).goto(0),o=0,l=[],a=new Rt;for(;h.value||o<e.length;)if(o<e.length&&(h.from-e[o].from||h.startSide-e[o].value.startSide)>=0){let t=e[o++];a.addInner(t.from,t.to,t.value)||l.push(t)}else 1==h.rangeIndex&&h.chunkIndex<this.chunk.length&&(o==e.length||this.chunkEnd(h.chunkIndex)<e[o].from)&&(!r||i>this.chunkEnd(h.chunkIndex)||s<this.chunkPos[h.chunkIndex])&&a.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!r||i>h.to||s<h.from||r(h.from,h.to,h.value))&&(a.addInner(h.from,h.to,h.value)||l.push(Pt.create(h.from,h.to,h.value))),h.next());return a.finishInner(this.nextLayer.isEmpty&&!l.length?At.empty:this.nextLayer.update({add:l,filter:r,filterFrom:i,filterTo:s}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],n=[],i=-1;for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],h=this.chunk[s],o=t.touchesRange(r,r+h.length);if(!1===o)i=Math.max(i,h.maxPoint),e.push(h),n.push(t.mapPos(r));else if(!0===o){let{mapped:s,pos:o}=h.map(r,t);s&&(i=Math.max(i,s.maxPoint),e.push(s),n.push(o))}}let s=this.nextLayer.map(t);return 0==e.length?s:new At(n,e,s||At.empty,i)}between(t,e,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(e>=s&&t<=s+r.length&&!1===r.between(s,t-s,e-s,n))return}this.nextLayer.between(t,e,n)}}iter(t=0){return Tt.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Tt.from(t).goto(e)}static compare(t,e,n,i,s=-1){let r=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),h=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),o=Ct(r,h,n),l=new Ft(r,o,s),a=new Ft(h,o,s);n.iterGaps(((t,e,n)=>Jt(l,t,a,e,n,i))),n.empty&&0==n.length&&Jt(l,0,a,0,0,i)}static eq(t,e,n=0,i){null==i&&(i=999999999);let s=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(s.length!=r.length)return!1;if(!s.length)return!0;let h=Ct(s,r),o=new Ft(s,h,0).goto(n),l=new Ft(r,h,0).goto(n);for(;;){if(o.to!=l.to||!Lt(o.active,l.active)||o.point&&(!l.point||!o.point.eq(l.point)))return!1;if(o.to>i)return!0;o.next(),l.next()}}static spans(t,e,n,i,s=-1){let r=new Ft(t,null,s).goto(e),h=e,o=r.openStart;for(;;){let t=Math.min(r.to,n);if(r.point){let n=r.activeForPoint(r.to),s=r.pointFrom<e?n.length+1:r.point.startSide<0?n.length:Math.min(n.length,o);i.point(h,t,r.point,n,s,r.pointRank),o=Math.min(r.openEnd(t),n.length)}else t>h&&(i.span(h,t,r.active,o),o=r.openEnd(t));if(r.to>n)return o+(r.point&&r.to>n?1:0);h=r.to,r.next()}}static of(t,e=!1){let n=new Rt;for(let i of t instanceof Pt?[t]:e?function(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(Et(e,i)>0)return t.slice().sort(Et);e=i}return t}(t):t)n.add(i.from,i.to,i.value);return n.finish()}static join(t){if(!t.length)return At.empty;let e=t[t.length-1];for(let n=t.length-2;n>=0;n--)for(let i=t[n];i!=At.empty;i=i.nextLayer)e=new At(i.chunkPos,i.chunk,e,Math.max(i.maxPoint,e.maxPoint));return e}}At.empty=new At([],[],null,-1),At.empty.nextLayer=At.empty;class Rt{finishChunk(t){this.chunks.push(new Mt(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,n){this.addInner(t,e,n)||(this.nextLayer||(this.nextLayer=new Rt)).add(t,e,n)}addInner(t,e,n){let i=t-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),0))}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}finish(){return this.finishInner(At.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=At.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Ct(t,e,n){let i=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&i.set(e.chunk[t],e.chunkPos[t]);let s=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let r=i.get(t.chunk[e]);null==r||(n?n.mapPos(r):r)!=t.chunkPos[e]||(null==n?void 0:n.touchesRange(r,r+t.chunk[e].length))||s.add(t.chunk[e])}return s}class Ot{constructor(t,e,n,i=0){this.layer=t,this.skip=e,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,n){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],n=t+e.from[this.rangeIndex];if(this.from=n,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Tt{constructor(t){this.heap=t}static from(t,e=null,n=-1){let i=[];for(let s=0;s<t.length;s++)for(let r=t[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new Ot(r,e,n,s));return 1==i.length?i[0]:new Tt(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let n of this.heap)n.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Bt(this.heap,t);return this.next(),this}forward(t,e){for(let n of this.heap)n.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Bt(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Bt(this.heap,0)}}}function Bt(t,e){for(let n=t[e];;){let i=1+(e<<1);if(i>=t.length)break;let s=t[i];if(i+1<t.length&&s.compare(t[i+1])>=0&&(s=t[i+1],i++),n.compare(s)<0)break;t[i]=n,t[e]=s,e=i}}class Ft{constructor(t,e,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Tt.from(t,e,n)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Nt(this.active,t),Nt(this.activeTo,t),Nt(this.activeRank,t),this.minActive=jt(this.active,this.activeTo)}addActive(t){let e=0,{value:n,to:i,rank:s}=this.cursor;for(;e<this.activeRank.length&&(s-this.activeRank[e]||i-this.activeTo[e])>0;)e++;Dt(this.active,e,n),Dt(this.activeTo,e,i),Dt(this.activeRank,e,s),t&&Dt(t,e,this.cursor.from),this.minActive=jt(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&Nt(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let e=n.length-1;e>=0&&n[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>=this.point.endSide)&&e.push(this.active[n]);return e.reverse()}openEnd(t){let e=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>t;n--)e++;return e}}function Jt(t,e,n,i,s,r){t.goto(e),n.goto(i);let h=i+s,o=i,l=i-e;for(;;){let e=t.to+l-n.to||t.endSide-n.endSide,i=e<0?t.to+l:n.to,s=Math.min(i,h);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Lt(t.activeForPoint(t.to),n.activeForPoint(n.to))||r.comparePoint(o,s,t.point,n.point):s>o&&!Lt(t.active,n.active)&&r.compareRange(o,s,t.active,n.active),i>h)break;o=i,e<=0&&t.next(),e>=0&&n.next()}}function Lt(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Nt(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function Dt(t,e,n){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=n}function jt(t,e){let n=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||t[s].endSide-t[n].endSide)<0&&(n=s,i=e[s]);return n}function qt(t,e,n=t.length){let i=0;for(let s=0;s<n;)9==t.charCodeAt(s)?(i+=e-i%e,s++):(i++,s=v(t,s));return i}function $t(t,e,n,i){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=9==t.charCodeAt(i)?n-s%n:1,i=v(t,i)}return!0===i?-1:t.length}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3129,9268],{79268:(e,n,r)=>{r.r(n),r.d(n,{createMarkdownParser:()=>l,default:()=>u});var t=r(20998),a=r(65848),i=r(44033),o=r(62514),s=r(68938);const c="```~~~";function l(e,n){return{render:r=>d.render(r,e,n)}}const u={id:"@jupyterlab/markedparser-extension:plugin",description:"Provides the Markdown parser.",autoStart:!0,provides:o.IMarkdownParser,requires:[i.IEditorLanguageRegistry],optional:[s.IMermaidMarkdown],activate:(e,n,r)=>l(n,{blocks:r?[r]:[]})};var d;!function(e){let n=null,i=null,o=[],s=null,l={},u=new a.LruCache;async function d(e){if(i)return i;if(n)return await n.promise;o=(null==e?void 0:e.blocks)||[],o=o.sort(((e,n)=>{var r,t;return(null!==(r=e.rank)&&void 0!==r?r:1/0)-(null!==(t=n.rank)&&void 0!==t?t:1/0)})),n=new t.PromiseDelegate;const[{marked:a,Renderer:s},c]=await Promise.all([r.e(4329).then(r.t.bind(r,74329,23)),f()]);for(const e of c)a.use(e);return l={async:!0,gfm:!0,walkTokens:w,renderer:g(s)},i=a,n.resolve(i),i}async function f(){return Promise.all([(async()=>(await r.e(4152).then(r.t.bind(r,24152,23))).gfmHeadingId())(),(async()=>(await r.e(9853).then(r.t.bind(r,29853,23))).mangle())()])}function g(e){const n=new e,r=n.code;return n.code=(e,t)=>{for(const n of o)if(n.languages.includes(t)){const r=n.render(e);if(null!=r)return r}const a=`${t}${c}${e}${c}`,i=u.get(a);return null!=i?i:r.call(n,e,t)},n}async function w(e){if("code"===e.type){if(e.lang)for(const n of o)if(n.languages.includes(e.lang))return void await n.walk(e.text);await async function(e){const{lang:n,text:r}=e;if(!n||!s)return;const t=`${n}${c}${r}${c}`;if(u.get(t))return;const a=document.createElement("div");try{await s.highlight(r,s.findBest(n),a);const e=`<pre><code class="language-${n}">${a.innerHTML}</code></pre>`;u.set(t,e)}catch(e){console.error(`Failed to highlight ${n} code`,e)}finally{a.remove()}}(e)}}e.render=async function(e,n,r){return s=n,i||(i=await d(r)),i(e,l)},e.initializeMarked=d}(d||(d={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3129,9268],{79268:(e,n,r)=>{r.r(n),r.d(n,{createMarkdownParser:()=>l,default:()=>u});var t=r(20998),a=r(44548),i=r(81059),o=r(50102),s=r(28986);const c="```~~~";function l(e,n){return{render:r=>d.render(r,e,n)}}const u={id:"@jupyterlab/markedparser-extension:plugin",description:"Provides the Markdown parser.",autoStart:!0,provides:o.IMarkdownParser,requires:[i.IEditorLanguageRegistry],optional:[s.IMermaidMarkdown],activate:(e,n,r)=>l(n,{blocks:r?[r]:[]})};var d;!function(e){let n=null,i=null,o=[],s=null,l={},u=new a.LruCache;async function d(e){if(i)return i;if(n)return await n.promise;o=(null==e?void 0:e.blocks)||[],o=o.sort(((e,n)=>{var r,t;return(null!==(r=e.rank)&&void 0!==r?r:1/0)-(null!==(t=n.rank)&&void 0!==t?t:1/0)})),n=new t.PromiseDelegate;const[{marked:a,Renderer:s},c]=await Promise.all([r.e(4329).then(r.t.bind(r,74329,23)),f()]);for(const e of c)a.use(e);return l={async:!0,gfm:!0,walkTokens:w,renderer:g(s)},i=a,n.resolve(i),i}async function f(){return Promise.all([(async()=>(await r.e(4152).then(r.t.bind(r,24152,23))).gfmHeadingId())(),(async()=>(await r.e(9853).then(r.t.bind(r,29853,23))).mangle())()])}function g(e){const n=new e,r=n.code;return n.code=(e,t)=>{for(const n of o)if(n.languages.includes(t)){const r=n.render(e);if(null!=r)return r}const a=`${t}${c}${e}${c}`,i=u.get(a);return null!=i?i:r.call(n,e,t)},n}async function w(e){if("code"===e.type){if(e.lang)for(const n of o)if(n.languages.includes(e.lang))return void await n.walk(e.text);await async function(e){const{lang:n,text:r}=e;if(!n||!s)return;const t=`${n}${c}${r}${c}`;if(u.get(t))return;const a=document.createElement("div");try{await s.highlight(r,s.findBest(n),a);const e=`<pre><code class="language-${n}">${a.innerHTML}</code></pre>`;u.set(t,e)}catch(e){console.error(`Failed to highlight ${n} code`,e)}finally{a.remove()}}(e)}}e.render=async function(e,n,r){return s=n,i||(i=await d(r)),i(e,l)},e.initializeMarked=d}(d||(d={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3146,4837],{73146:(e,t,o)=>{o.r(t),o.d(t,{INotebookTree:()=>n,NotebookTreeWidget:()=>s});var r=o(95291),a=o(63485);class s extends a.TabPanel{constructor(){super({tabPlacement:"top",tabsMovable:!0,renderer:r.TabBarSvg.defaultRenderer}),this.addClass("jp-TreePanel")}}const n=new(o(20998).Token)("@jupyter-notebook/tree:INotebookTree")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3146,4837],{73146:(e,t,o)=>{o.r(t),o.d(t,{INotebookTree:()=>n,NotebookTreeWidget:()=>s});var r=o(12668),a=o(63485);class s extends a.TabPanel{constructor(){super({tabPlacement:"top",tabsMovable:!0,renderer:r.TabBarSvg.defaultRenderer}),this.addClass("jp-TreePanel")}}const n=new(o(20998).Token)("@jupyter-notebook/tree:INotebookTree")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3187],{53187:(e,n,a)=>{a.r(n),a.d(n,{default:()=>d});var l,r=a(94535),t=a(72703),i=a(70858),o=a(95291),s=a(14088);!function(e){e.open="pluginmanager:open",e.refreshPlugins="pluginmanager:refresh"}(l||(l={}));const u="@jupyterlab/pluginmanager-extension:plugin",d=[{id:u,description:"Enable or disable individual plugins.",autoStart:!0,requires:[],optional:[i.ITranslator,t.ICommandPalette,r.ILayoutRestorer],provides:s.IPluginManager,activate:(e,n,a,r)=>{const{commands:d,shell:c}=e,g=(n=null!=n?n:i.nullTranslator).load("jupyterlab"),p=g.__("Plugin Manager"),m=g.__("Advanced Plugin Manager"),P=g.__("Refresh Plugin List"),b=new t.WidgetTracker({namespace:"plugin-manager"});return d.addCommand(l.open,{label:m,execute:a=>{const r=function(a){const r=new s.PluginListModel({...a,pluginData:{availablePlugins:e.info.availablePlugins},serverSettings:e.serviceManager.serverSettings,extraLockedPlugins:[u,"@jupyterlab/application-extension:layout","@jupyterlab/apputils-extension:resolver"],translator:null!=n?n:i.nullTranslator}),c=new s.Plugins({model:r,translator:null!=n?n:i.nullTranslator});c.title.label=m,c.title.icon=o.extensionIcon,c.title.caption=g.__("Plugin Manager");const p=new t.MainAreaWidget({content:c,reveal:r.ready});return p.toolbar.addItem("refresh-plugins",new o.CommandToolbarButton({id:l.refreshPlugins,args:{noLabel:!0},commands:d})),p}(a);return c.add(r,"main",{type:"Plugins"}),b.add(r),r.content.model.trackerDataChanged.connect((()=>{b.save(r)})),r}}),d.addCommand(l.refreshPlugins,{label:e=>e.noLabel?"":P,caption:g.__("Refresh plugins list"),icon:o.refreshIcon,execute:async()=>{var e;return null===(e=b.currentWidget)||void 0===e?void 0:e.content.model.refresh().catch((e=>{console.error(`Failed to refresh the available plugins list:\n${e}`)}))}}),a&&a.addItem({command:l.open,category:p}),r&&r.restore(b,{command:l.open,name:e=>"plugins",args:e=>{const{query:n,isDisclaimed:a}=e.content.model;return{query:n,isDisclaimed:a}}}),{open:()=>e.commands.execute(l.open)}}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3187],{53187:(e,n,a)=>{a.r(n),a.d(n,{default:()=>d});var l,r=a(27961),t=a(15465),i=a(25291),o=a(12668),s=a(44176);!function(e){e.open="pluginmanager:open",e.refreshPlugins="pluginmanager:refresh"}(l||(l={}));const u="@jupyterlab/pluginmanager-extension:plugin",d=[{id:u,description:"Enable or disable individual plugins.",autoStart:!0,requires:[],optional:[i.ITranslator,t.ICommandPalette,r.ILayoutRestorer],provides:s.IPluginManager,activate:(e,n,a,r)=>{const{commands:d,shell:c}=e,g=(n=null!=n?n:i.nullTranslator).load("jupyterlab"),p=g.__("Plugin Manager"),m=g.__("Advanced Plugin Manager"),P=g.__("Refresh Plugin List"),b=new t.WidgetTracker({namespace:"plugin-manager"});return d.addCommand(l.open,{label:m,execute:a=>{const r=function(a){const r=new s.PluginListModel({...a,pluginData:{availablePlugins:e.info.availablePlugins},serverSettings:e.serviceManager.serverSettings,extraLockedPlugins:[u,"@jupyterlab/application-extension:layout","@jupyterlab/apputils-extension:resolver"],translator:null!=n?n:i.nullTranslator}),c=new s.Plugins({model:r,translator:null!=n?n:i.nullTranslator});c.title.label=m,c.title.icon=o.extensionIcon,c.title.caption=g.__("Plugin Manager");const p=new t.MainAreaWidget({content:c,reveal:r.ready});return p.toolbar.addItem("refresh-plugins",new o.CommandToolbarButton({id:l.refreshPlugins,args:{noLabel:!0},commands:d})),p}(a);return c.add(r,"main",{type:"Plugins"}),b.add(r),r.content.model.trackerDataChanged.connect((()=>{b.save(r)})),r}}),d.addCommand(l.refreshPlugins,{label:e=>e.noLabel?"":P,caption:g.__("Refresh plugins list"),icon:o.refreshIcon,execute:async()=>{var e;return null===(e=b.currentWidget)||void 0===e?void 0:e.content.model.refresh().catch((e=>{console.error(`Failed to refresh the available plugins list:\n${e}`)}))}}),a&&a.addItem({command:l.open,category:p}),r&&r.restore(b,{command:l.open,name:e=>"plugins",args:e=>{const{query:n,isDisclaimed:a}=e.content.model;return{query:n,isDisclaimed:a}}}),{open:()=>e.commands.execute(l.open)}}}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3213],{53213:(e,t,s)=>{s.r(t),s.d(t,{ITerminal:()=>o,ITerminalTracker:()=>n,Terminal:()=>l});var i=s(20998);const n=new i.Token("@jupyterlab/terminal:ITerminalTracker","A widget tracker for terminals.\n Use this if you want to be able to iterate over and interact with terminals\n created by the application.");var o;!function(e){e.defaultOptions={theme:"inherit",fontFamily:'Menlo, Consolas, "DejaVu Sans Mono", monospace',fontSize:13,lineHeight:1,scrollback:1e3,shutdownOnClose:!1,closeOnExit:!0,cursorBlink:!0,initialCommand:"",screenReaderMode:!1,pasteWithCtrlV:!0,autoFit:!0,macOptionIsMeta:!1}}(o||(o={}));var r,a=s(70858),h=s(18395),c=s(49503),d=s(63485);class l extends d.Widget{constructor(e,t={},s){super(),this._needsResize=!0,this._offsetWidth=-1,this._offsetHeight=-1,this._isReady=!1,this._ready=new i.PromiseDelegate,this._termOpened=!1,s=s||a.nullTranslator,this._trans=s.load("jupyterlab"),this.session=e,this._options={...o.defaultOptions,...t};const{theme:n,...h}=this._options,c={theme:r.getXTermTheme(n),...h};this.addClass("jp-Terminal"),this._setThemeAttribute(n);let d="";const l=(e,t)=>{"stdout"===t.type&&t.content&&(d+=t.content[0])};e.messageReceived.connect(l),e.disposed.connect((()=>{this.getOption("closeOnExit")&&this.dispose()}),this),r.createTerminal(c).then((([t,s])=>{this._term=t,this._fitAddon=s,this._initializeTerm(),this.id="jp-Terminal-"+r.id++,this.title.label=this._trans.__("Terminal"),this._isReady=!0,this._ready.resolve(),d&&this._term.write(d),e.messageReceived.disconnect(l),e.messageReceived.connect(this._onMessage,this),"connected"===e.connectionStatus?this._initialConnection():e.connectionStatusChanged.connect(this._initialConnection,this),this.update()})).catch((e=>{console.error("Failed to create a terminal.\n",e),this._ready.reject(e)}))}get ready(){return this._ready.promise}getOption(e){return this._options[e]}setOption(e,t){if("theme"===e||this._options[e]!==t&&"initialCommand"!==e){switch(this._options[e]=t,e){case"fontFamily":this._term.options.fontFamily=t;break;case"fontSize":this._term.options.fontSize=t;break;case"lineHeight":this._term.options.lineHeight=t;break;case"screenReaderMode":this._term.options.screenReaderMode=t;break;case"scrollback":this._term.options.scrollback=t;break;case"theme":this._term.options.theme={...r.getXTermTheme(t)},this._setThemeAttribute(t);break;case"macOptionIsMeta":this._term.options.macOptionIsMeta=t}this._needsResize=!0,this.update()}}dispose(){this.session.isDisposed||this.getOption("shutdownOnClose")&&this.session.shutdown().catch((e=>{console.error(`Terminal not shut down: ${e}`)})),this.ready.then((()=>{this._term.dispose()})),super.dispose()}async refresh(){!this.isDisposed&&this._isReady&&(await this.session.reconnect(),this._term.clear())}hasSelection(){return!(this.isDisposed||!this._isReady)&&this._term.hasSelection()}paste(e){if(!this.isDisposed&&this._isReady)return this._term.paste(e)}getSelection(){return!this.isDisposed&&this._isReady?this._term.getSelection():null}processMessage(e){super.processMessage(e),"fit-request"===e.type&&this.onFitRequest(e)}onAfterAttach(e){this.update()}onAfterShow(e){this.update()}onResize(e){this._offsetWidth=e.width,this._offsetHeight=e.height,this._needsResize=!0,this.update()}onUpdateRequest(e){var t;this.isVisible&&this.isAttached&&this._isReady&&(this._termOpened||(this._term.open(this.node),null===(t=this._term.element)||void 0===t||t.classList.add("jp-Terminal-body"),this._termOpened=!0),this._needsResize&&this._resizeTerminal())}onFitRequest(e){const t=d.Widget.ResizeMessage.UnknownSize;c.MessageLoop.sendMessage(this,t)}onActivateRequest(e){var t;null===(t=this._term)||void 0===t||t.focus()}_initialConnection(){this.isDisposed||"connected"===this.session.connectionStatus&&(this.title.label=this._trans.__("Terminal %1",this.session.name),this._setSessionSize(),this._options.initialCommand&&this.session.send({type:"stdin",content:[this._options.initialCommand+"\r"]}),this.session.connectionStatusChanged.disconnect(this._initialConnection,this))}_initializeTerm(){const e=this._term;e.onData((e=>{this.isDisposed||this.session.send({type:"stdin",content:[e]})})),e.onTitleChange((e=>{this.title.label=e})),h.Platform.IS_MAC||e.attachCustomKeyEventHandler((t=>!(t.ctrlKey&&"c"===t.key&&e.hasSelection()||t.ctrlKey&&"v"===t.key&&this._options.pasteWithCtrlV)))}_onMessage(e,t){switch(t.type){case"stdout":t.content&&this._term.write(t.content[0]);break;case"disconnect":this._term.write("\r\n\r\n[Finished… Term Session]\r\n")}}_resizeTerminal(){this._options.autoFit&&this._fitAddon.fit(),-1===this._offsetWidth&&(this._offsetWidth=this.node.offsetWidth),-1===this._offsetHeight&&(this._offsetHeight=this.node.offsetHeight),this._setSessionSize(),this._needsResize=!1}_setSessionSize(){const e=[this._term.rows,this._term.cols,this._offsetHeight,this._offsetWidth];this.isDisposed||this.session.send({type:"set_size",content:e})}_setThemeAttribute(e){this.isDisposed||this.node.setAttribute("data-term-theme",e?e.toLowerCase():"inherit")}}!function(e){e.id=0,e.lightTheme={foreground:"#000",background:"#fff",cursor:"#616161",cursorAccent:"#F5F5F5",selectionBackground:"rgba(97, 97, 97, 0.3)",selectionInactiveBackground:"rgba(189, 189, 189, 0.3)"},e.darkTheme={foreground:"#fff",background:"#000",cursor:"#fff",cursorAccent:"#000",selectionBackground:"rgba(255, 255, 255, 0.3)",selectionInactiveBackground:"rgba(238, 238, 238, 0.3)"},e.inheritTheme=()=>({foreground:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color0").trim(),background:getComputedStyle(document.body).getPropertyValue("--jp-layout-color0").trim(),cursor:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color1").trim(),cursorAccent:getComputedStyle(document.body).getPropertyValue("--jp-ui-inverse-font-color0").trim(),selectionBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color3").trim(),selectionInactiveBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color2").trim()}),e.getXTermTheme=function(t){switch(t){case"light":return e.lightTheme;case"dark":return e.darkTheme;default:return e.inheritTheme()}}}(r||(r={})),function(e){let t,i,n,o,r=!1;function a(e){let t=new o;e.loadAddon(t),r&&t.onContextLoss((s=>{console.debug("WebGL context lost - reinitialize Xtermjs renderer."),t.dispose(),a(e)}))}e.createTerminal=async function(e){var h;if(!t){r=function(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");try{return t instanceof WebGLRenderingContext}catch(e){return!1}}();const[e,a,c,d]=await Promise.all([s.e(4708).then(s.t.bind(s,54708,23)),s.e(4430).then(s.t.bind(s,44430,23)),r?s.e(7884).then(s.t.bind(s,47884,23)):s.e(3462).then(s.t.bind(s,63462,23)),s.e(6521).then(s.t.bind(s,86521,23))]);t=e.Terminal,i=a.FitAddon,o=null!==(h=c.WebglAddon)&&void 0!==h?h:c.CanvasAddon,n=d.WebLinksAddon}const c=new t(e);a(c);const d=new i;return c.loadAddon(d),c.loadAddon(new n),[c,d]}}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[3213],{53213:(e,t,s)=>{s.r(t),s.d(t,{ITerminal:()=>o,ITerminalTracker:()=>n,Terminal:()=>l});var i=s(20998);const n=new i.Token("@jupyterlab/terminal:ITerminalTracker","A widget tracker for terminals.\n Use this if you want to be able to iterate over and interact with terminals\n created by the application.");var o;!function(e){e.defaultOptions={theme:"inherit",fontFamily:'Menlo, Consolas, "DejaVu Sans Mono", monospace',fontSize:13,lineHeight:1,scrollback:1e3,shutdownOnClose:!1,closeOnExit:!0,cursorBlink:!0,initialCommand:"",screenReaderMode:!1,pasteWithCtrlV:!0,autoFit:!0,macOptionIsMeta:!1}}(o||(o={}));var r,a=s(25291),h=s(18395),c=s(49503),d=s(63485);class l extends d.Widget{constructor(e,t={},s){super(),this._needsResize=!0,this._offsetWidth=-1,this._offsetHeight=-1,this._isReady=!1,this._ready=new i.PromiseDelegate,this._termOpened=!1,s=s||a.nullTranslator,this._trans=s.load("jupyterlab"),this.session=e,this._options={...o.defaultOptions,...t};const{theme:n,...h}=this._options,c={theme:r.getXTermTheme(n),...h};this.addClass("jp-Terminal"),this._setThemeAttribute(n);let d="";const l=(e,t)=>{"stdout"===t.type&&t.content&&(d+=t.content[0])};e.messageReceived.connect(l),e.disposed.connect((()=>{this.getOption("closeOnExit")&&this.dispose()}),this),r.createTerminal(c).then((([t,s])=>{this._term=t,this._fitAddon=s,this._initializeTerm(),this.id="jp-Terminal-"+r.id++,this.title.label=this._trans.__("Terminal"),this._isReady=!0,this._ready.resolve(),d&&this._term.write(d),e.messageReceived.disconnect(l),e.messageReceived.connect(this._onMessage,this),"connected"===e.connectionStatus?this._initialConnection():e.connectionStatusChanged.connect(this._initialConnection,this),this.update()})).catch((e=>{console.error("Failed to create a terminal.\n",e),this._ready.reject(e)}))}get ready(){return this._ready.promise}getOption(e){return this._options[e]}setOption(e,t){if("theme"===e||this._options[e]!==t&&"initialCommand"!==e){switch(this._options[e]=t,e){case"fontFamily":this._term.options.fontFamily=t;break;case"fontSize":this._term.options.fontSize=t;break;case"lineHeight":this._term.options.lineHeight=t;break;case"screenReaderMode":this._term.options.screenReaderMode=t;break;case"scrollback":this._term.options.scrollback=t;break;case"theme":this._term.options.theme={...r.getXTermTheme(t)},this._setThemeAttribute(t);break;case"macOptionIsMeta":this._term.options.macOptionIsMeta=t}this._needsResize=!0,this.update()}}dispose(){this.session.isDisposed||this.getOption("shutdownOnClose")&&this.session.shutdown().catch((e=>{console.error(`Terminal not shut down: ${e}`)})),this.ready.then((()=>{this._term.dispose()})),super.dispose()}async refresh(){!this.isDisposed&&this._isReady&&(await this.session.reconnect(),this._term.clear())}hasSelection(){return!(this.isDisposed||!this._isReady)&&this._term.hasSelection()}paste(e){if(!this.isDisposed&&this._isReady)return this._term.paste(e)}getSelection(){return!this.isDisposed&&this._isReady?this._term.getSelection():null}processMessage(e){super.processMessage(e),"fit-request"===e.type&&this.onFitRequest(e)}onAfterAttach(e){this.update()}onAfterShow(e){this.update()}onResize(e){this._offsetWidth=e.width,this._offsetHeight=e.height,this._needsResize=!0,this.update()}onUpdateRequest(e){var t;this.isVisible&&this.isAttached&&this._isReady&&(this._termOpened||(this._term.open(this.node),null===(t=this._term.element)||void 0===t||t.classList.add("jp-Terminal-body"),this._termOpened=!0),this._needsResize&&this._resizeTerminal())}onFitRequest(e){const t=d.Widget.ResizeMessage.UnknownSize;c.MessageLoop.sendMessage(this,t)}onActivateRequest(e){var t;null===(t=this._term)||void 0===t||t.focus()}_initialConnection(){this.isDisposed||"connected"===this.session.connectionStatus&&(this.title.label=this._trans.__("Terminal %1",this.session.name),this._setSessionSize(),this._options.initialCommand&&this.session.send({type:"stdin",content:[this._options.initialCommand+"\r"]}),this.session.connectionStatusChanged.disconnect(this._initialConnection,this))}_initializeTerm(){const e=this._term;e.onData((e=>{this.isDisposed||this.session.send({type:"stdin",content:[e]})})),e.onTitleChange((e=>{this.title.label=e})),h.Platform.IS_MAC||e.attachCustomKeyEventHandler((t=>!(t.ctrlKey&&"c"===t.key&&e.hasSelection()||t.ctrlKey&&"v"===t.key&&this._options.pasteWithCtrlV)))}_onMessage(e,t){switch(t.type){case"stdout":t.content&&this._term.write(t.content[0]);break;case"disconnect":this._term.write("\r\n\r\n[Finished… Term Session]\r\n")}}_resizeTerminal(){this._options.autoFit&&this._fitAddon.fit(),-1===this._offsetWidth&&(this._offsetWidth=this.node.offsetWidth),-1===this._offsetHeight&&(this._offsetHeight=this.node.offsetHeight),this._setSessionSize(),this._needsResize=!1}_setSessionSize(){const e=[this._term.rows,this._term.cols,this._offsetHeight,this._offsetWidth];this.isDisposed||this.session.send({type:"set_size",content:e})}_setThemeAttribute(e){this.isDisposed||this.node.setAttribute("data-term-theme",e?e.toLowerCase():"inherit")}}!function(e){e.id=0,e.lightTheme={foreground:"#000",background:"#fff",cursor:"#616161",cursorAccent:"#F5F5F5",selectionBackground:"rgba(97, 97, 97, 0.3)",selectionInactiveBackground:"rgba(189, 189, 189, 0.3)"},e.darkTheme={foreground:"#fff",background:"#000",cursor:"#fff",cursorAccent:"#000",selectionBackground:"rgba(255, 255, 255, 0.3)",selectionInactiveBackground:"rgba(238, 238, 238, 0.3)"},e.inheritTheme=()=>({foreground:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color0").trim(),background:getComputedStyle(document.body).getPropertyValue("--jp-layout-color0").trim(),cursor:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color1").trim(),cursorAccent:getComputedStyle(document.body).getPropertyValue("--jp-ui-inverse-font-color0").trim(),selectionBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color3").trim(),selectionInactiveBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color2").trim()}),e.getXTermTheme=function(t){switch(t){case"light":return e.lightTheme;case"dark":return e.darkTheme;default:return e.inheritTheme()}}}(r||(r={})),function(e){let t,i,n,o,r=!1;function a(e){let t=new o;e.loadAddon(t),r&&t.onContextLoss((s=>{console.debug("WebGL context lost - reinitialize Xtermjs renderer."),t.dispose(),a(e)}))}e.createTerminal=async function(e){var h;if(!t){r=function(){const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");try{return t instanceof WebGLRenderingContext}catch(e){return!1}}();const[e,a,c,d]=await Promise.all([s.e(4708).then(s.t.bind(s,54708,23)),s.e(4430).then(s.t.bind(s,44430,23)),r?s.e(7884).then(s.t.bind(s,47884,23)):s.e(3462).then(s.t.bind(s,63462,23)),s.e(6521).then(s.t.bind(s,86521,23))]);t=e.Terminal,i=a.FitAddon,o=null!==(h=c.WebglAddon)&&void 0!==h?h:c.CanvasAddon,n=d.WebLinksAddon}const c=new t(e);a(c);const d=new i;return c.loadAddon(d),c.loadAddon(new n),[c,d]}}(r||(r={}))}}]);