notebook 7.0.6__py3-none-any.whl → 7.0.7__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (173) hide show
  1. notebook/_version.py +1 -1
  2. notebook/app.py +5 -2
  3. notebook/static/1018.bundle.js +1 -1
  4. notebook/static/1053.bundle.js +1 -1
  5. notebook/static/1198.bundle.js +1 -1
  6. notebook/static/1337.bundle.js +1 -1
  7. notebook/static/134.bundle.js +1 -1
  8. notebook/static/1408.bundle.js +1 -1
  9. notebook/static/1647.bundle.js +1 -1
  10. notebook/static/1650.bundle.js +1 -1
  11. notebook/static/1682.bundle.js +1 -1
  12. notebook/static/1684.bundle.js +1 -1
  13. notebook/static/1696.bundle.js +1 -1
  14. notebook/static/1809.bundle.js +1 -1
  15. notebook/static/1827.bundle.js +1 -1
  16. notebook/static/1833.bundle.js +1 -1
  17. notebook/static/1835.bundle.js +1 -1
  18. notebook/static/1950.bundle.js +1 -1
  19. notebook/static/1958.bundle.js +1 -1
  20. notebook/static/2007.bundle.js +1 -1
  21. notebook/static/2053.bundle.js +1 -0
  22. notebook/static/2067.bundle.js +1 -1
  23. notebook/static/2088.bundle.js +1 -1
  24. notebook/static/2089.bundle.js +1 -1
  25. notebook/static/2122.bundle.js +1 -1
  26. notebook/static/2167.bundle.js +1 -1
  27. notebook/static/2184.bundle.js +1 -1
  28. notebook/static/2311.bundle.js +1 -1
  29. notebook/static/2401.bundle.js +1 -1
  30. notebook/static/2479.bundle.js +1 -1
  31. notebook/static/2512.bundle.js +1 -1
  32. notebook/static/2607.bundle.js +1 -1
  33. notebook/static/2924.bundle.js +1 -1
  34. notebook/static/3146.bundle.js +1 -1
  35. notebook/static/3213.bundle.js +1 -1
  36. notebook/static/3340.bundle.js +1 -1
  37. notebook/static/3360.bundle.js +1 -1
  38. notebook/static/3466.bundle.js +1 -1
  39. notebook/static/35.bundle.js +1 -1
  40. notebook/static/3676.bundle.js +1 -1
  41. notebook/static/3680.bundle.js +1 -1
  42. notebook/static/3768.bundle.js +1 -1
  43. notebook/static/377.bundle.js +1 -1
  44. notebook/static/3863.bundle.js +1 -1
  45. notebook/static/3881.bundle.js +1 -1
  46. notebook/static/{6621.bundle.js → 3911.bundle.js} +1 -1
  47. notebook/static/4042.bundle.js +1 -1
  48. notebook/static/4131.bundle.js +1 -1
  49. notebook/static/4212.bundle.js +1 -1
  50. notebook/static/4234.bundle.js +1 -1
  51. notebook/static/4291.bundle.js +1 -1
  52. notebook/static/4382.bundle.js +1 -1
  53. notebook/static/4558.bundle.js +1 -1
  54. notebook/static/4588.bundle.js +1 -1
  55. notebook/static/4645.bundle.js +1 -1
  56. notebook/static/4811.bundle.js +1 -1
  57. notebook/static/4837.bundle.js +1 -1
  58. notebook/static/5088.bundle.js +1 -1
  59. notebook/static/5099.bundle.js +1 -1
  60. notebook/static/5125.bundle.js +1 -1
  61. notebook/static/5135.bundle.js +1 -1
  62. notebook/static/514.bundle.js +1 -1
  63. notebook/static/5313.bundle.js +1 -1
  64. notebook/static/5325.bundle.js +1 -1
  65. notebook/static/5346.bundle.js +1 -1
  66. notebook/static/5426.bundle.js +1 -1
  67. notebook/static/5573.bundle.js +1 -1
  68. notebook/static/5601.bundle.js +1 -1
  69. notebook/static/5678.bundle.js +1 -1
  70. notebook/static/5733.bundle.js +1 -1
  71. notebook/static/5912.bundle.js +1 -1
  72. notebook/static/5921.bundle.js +1 -1
  73. notebook/static/6017.bundle.js +1 -1
  74. notebook/static/6027.bundle.js +1 -1
  75. notebook/static/6139.bundle.js +1 -1
  76. notebook/static/62.bundle.js +1 -1
  77. notebook/static/6256.bundle.js +1 -1
  78. notebook/static/6345.bundle.js +1 -1
  79. notebook/static/6604.bundle.js +1 -1
  80. notebook/static/6627.bundle.js +1 -1
  81. notebook/static/6815.bundle.js +1 -1
  82. notebook/static/6853.bundle.js +1 -1
  83. notebook/static/6893.bundle.js +1 -1
  84. notebook/static/690.bundle.js +1 -1
  85. notebook/static/6962.bundle.js +1 -1
  86. notebook/static/6999.bundle.js +1 -1
  87. notebook/static/7226.bundle.js +1 -1
  88. notebook/static/7252.bundle.js +1 -1
  89. notebook/static/7302.bundle.js +1 -1
  90. notebook/static/7369.bundle.js +1 -1
  91. notebook/static/7386.bundle.js +1 -1
  92. notebook/static/7391.bundle.js +1 -1
  93. notebook/static/7394.bundle.js +1 -1
  94. notebook/static/7427.bundle.js +1 -1
  95. notebook/static/7603.bundle.js +1 -1
  96. notebook/static/7639.bundle.js +1 -1
  97. notebook/static/7684.bundle.js +1 -1
  98. notebook/static/7819.bundle.js +1 -1
  99. notebook/static/7900.bundle.js +1 -1
  100. notebook/static/7906.bundle.js +1 -1
  101. notebook/static/8579.bundle.js +1 -1
  102. notebook/static/8633.bundle.js +1 -1
  103. notebook/static/8771.bundle.js +1 -1
  104. notebook/static/8781.bundle.js +1 -0
  105. notebook/static/8875.bundle.js +1 -1
  106. notebook/static/8907.bundle.js +1 -1
  107. notebook/static/8928.bundle.js +1 -1
  108. notebook/static/8929.bundle.js +1 -1
  109. notebook/static/893.bundle.js +1 -1
  110. notebook/static/901.bundle.js +1 -1
  111. notebook/static/9068.bundle.js +1 -1
  112. notebook/static/9086.bundle.js +1 -1
  113. notebook/static/911.bundle.js +1 -1
  114. notebook/static/9151.bundle.js +1 -1
  115. notebook/static/9268.bundle.js +1 -1
  116. notebook/static/9335.bundle.js +1 -1
  117. notebook/static/9341.bundle.js +1 -1
  118. notebook/static/9380.bundle.js +1 -1
  119. notebook/static/9577.bundle.js +1 -0
  120. notebook/static/9605.bundle.js +1 -1
  121. notebook/static/9609.bundle.js +1 -1
  122. notebook/static/9638.bundle.js +1 -1
  123. notebook/static/9670.bundle.js +1 -0
  124. notebook/static/9680.bundle.js +1 -1
  125. notebook/static/9685.bundle.js +1 -1
  126. notebook/static/9752.bundle.js +1 -1
  127. notebook/static/9799.bundle.js +1 -1
  128. notebook/static/9852.bundle.js +1 -1
  129. notebook/static/bundle.js +1 -1
  130. notebook/static/third-party-licenses.json +97 -97
  131. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  132. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  133. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  134. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  135. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  136. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  137. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  138. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/34.19d4610ec716fa511ef4.js +1 -0
  139. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1160e2de23274a7c0e28.js +1 -0
  140. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.de56d0eb47577cb652f3.js +1 -0
  141. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eddcbb0f5a946c74796b.js +1 -0
  142. notebook-7.0.7.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.f2d2e79c8a92fd2ec840.js +1 -0
  143. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +4 -4
  144. {notebook-7.0.6.dist-info → notebook-7.0.7.dist-info}/METADATA +3 -2
  145. {notebook-7.0.6.dist-info → notebook-7.0.7.dist-info}/RECORD +166 -164
  146. {notebook-7.0.6.dist-info → notebook-7.0.7.dist-info}/WHEEL +1 -1
  147. notebook/static/6774.bundle.js +0 -1
  148. notebook/static/880.bundle.js +0 -1
  149. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1e7b382fb5e84b6e7620.js +0 -1
  150. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/776.c7baadfaddfd4518c935.js +0 -1
  151. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/922.0beff4620746e288bd5e.js +0 -1
  152. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.79046a2eb17bde1af38c.js +0 -1
  153. notebook-7.0.6.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.b2792fe643cae74ea824.js +0 -1
  154. {notebook-7.0.6.data → notebook-7.0.7.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  155. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  156. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  157. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  158. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  159. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  160. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  161. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  162. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  163. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  164. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  165. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  166. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  167. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  168. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  169. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  170. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  171. {notebook-7.0.6.data → notebook-7.0.7.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  172. {notebook-7.0.6.dist-info → notebook-7.0.7.dist-info}/entry_points.txt +0 -0
  173. {notebook-7.0.6.dist-info → notebook-7.0.7.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2401],{43967:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var s,r=n(97031),a=n(20998),i=n(81997);class o{constructor(e){this.trusted=!1,this._changed=new i.Signal(this),this._raw={};const t=s.getData(e.value);this._data=new r.ObservableJSON({values:t}),this._rawData=t;const n=e.value;for(const e in n)"data"===e||(this._raw[e]=s.extract(n,e))}get changed(){return this._changed}dispose(){this._data.dispose(),i.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return{}}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),this._changed.emit(void 0)}toJSON(){const e={};for(const t in this._raw)e[t]=s.extract(this._raw,t);return e}_updateObservable(e,t){const n=e.keys(),s=Object.keys(t);for(const t of n)-1===s.indexOf(t)&&e.delete(t);for(const n of s){const s=e.get(n),r=t[n];s!==r&&e.set(n,r)}}}!function(e){e.getData=function(e){return s.getData(e)}}(o||(o={})),function(e){function t(e){return function(e){const t=Object.create(null);for(const s in e)t[s]=n(e,s);return t}(e)}function n(e,t){const n=e[t];return void 0===n||a.JSONExt.isPrimitive(n)?n:a.JSONExt.deepCopy(n)}e.getData=t,e.getBundleOptions=function(e){return{data:t(e.value)}},e.extract=n}(s||(s={}))},15862:(e,t,n)=>{"use strict";n.d(t,{BJ:()=>d,F:()=>l,Lz:()=>a,Nf:()=>u,hJ:()=>i,nF:()=>c,vy:()=>r,xr:()=>o});var s=n(28182);const r={safe:!0,mimeTypes:["text/html"],defaultRank:50,createRenderer:e=>new s.oI(e)},a={safe:!0,mimeTypes:["image/bmp","image/png","image/jpeg","image/gif","image/webp"],defaultRank:90,createRenderer:e=>new s.UH(e)},i={safe:!0,mimeTypes:["text/latex"],defaultRank:70,createRenderer:e=>new s.FK(e)},o={safe:!0,mimeTypes:["text/markdown"],defaultRank:60,createRenderer:e=>new s.cw(e)},l={safe:!1,mimeTypes:["image/svg+xml"],defaultRank:80,createRenderer:e=>new s.zt(e)},d={safe:!0,mimeTypes:["text/plain","application/vnd.jupyter.stdout","application/vnd.jupyter.stderr"],defaultRank:120,createRenderer:e=>new s.lH(e)},c={safe:!1,mimeTypes:["text/javascript","application/javascript"],defaultRank:110,createRenderer:e=>new s.ND(e)},u=[r,o,i,l,a,c,d]},72401:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachmentModel:()=>a.g,ILatexTypesetter:()=>h._y,IMarkdownParser:()=>h.sc,IRenderMimeRegistry:()=>h.ZD,MimeModel:()=>l.a,OutputModel:()=>d.M,RenderMimeRegistry:()=>c.D,RenderedCommon:()=>p.pY,RenderedHTML:()=>p.oI,RenderedHTMLCommon:()=>p.BP,RenderedImage:()=>p.UH,RenderedJavaScript:()=>p.ND,RenderedLatex:()=>p.FK,RenderedMarkdown:()=>p.cw,RenderedSVG:()=>p.zt,RenderedText:()=>p.lH,htmlRendererFactory:()=>i.vy,imageRendererFactory:()=>i.Lz,javaScriptRendererFactory:()=>i.nF,latexRendererFactory:()=>i.hJ,markdownRendererFactory:()=>i.xr,removeMath:()=>o.D,renderHTML:()=>u.NN,renderImage:()=>u.co,renderLatex:()=>u.K3,renderMarkdown:()=>u.ap,renderSVG:()=>u.KB,renderText:()=>u.IY,replaceMath:()=>o.b,standardRendererFactories:()=>i.Nf,svgRendererFactory:()=>i.F,textRendererFactory:()=>i.BJ});var s=n(58772),r={};for(const e in s)"default"!==e&&(r[e]=()=>s[e]);n.d(t,r);var a=n(43967),i=n(15862),o=n(69837),l=n(32021),d=n(4800),c=n(32549),u=n(3328),h=n(2186),p=n(28182)},69837:(e,t,n)=>{"use strict";n.d(t,{D:()=>a,b:()=>i});const s="$",r=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function a(e){const t=[];let n,a=null,i=null,l=null,d=0;e.includes("`")||e.includes("~~~")?(e=e.replace(/~/g,"~T").replace(/^(?<fence>`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k<fence>`*$/gm,(e=>e.replace(/\$/g,"~D"))).replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D"))),n=e=>e.replace(/~([TD])/g,((e,t)=>"T"===t?"~":s))):n=e=>e;let c=e.replace(/\r\n?/g,"\n").split(r);for(let e=1,r=c.length;e<r;e+=2){const r=c[e];"@"===r.charAt(0)?(c[e]="@@"+t.length+"@@",t.push(r)):null!==a?r===i?d?l=e:(c=o(a,e,n,t,c),a=null,i=null,l=null):r.match(/\n.*\n/)?(null!==l&&(e=l,c=o(a,e,n,t,c)),a=null,i=null,l=null,d=0):"{"===r?d++:"}"===r&&d&&d--:r===s||"$$"===r?(a=e,i=r,d=0):"\\\\("===r||"\\\\["===r?(a=e,i="("===r.slice(-1)?"\\\\)":"\\\\]",d=0):"begin"===r.substr(1,5)&&(a=e,i="\\end"+r.substr(6),d=0)}return null!==a&&null!==l&&(c=o(a,l,n,t,c),a=null,i=null,l=null),{text:n(c.join("")),math:t}}function i(e,t){return e.replace(/@@(\d+)@@/g,((e,n)=>{let s=t[n];return"\\\\("===s.substr(0,3)&&"\\\\)"===s.substr(s.length-3)?s="\\("+s.substring(3,s.length-3)+"\\)":"\\\\["===s.substr(0,3)&&"\\\\]"===s.substr(s.length-3)&&(s="\\["+s.substring(3,s.length-3)+"\\]"),s}))}function o(e,t,n,s,r){let a=r.slice(e,t+1).join("").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(a=a.replace(/(%[^\n]*)\n/g,"$1<br/>\n"));t>e;)r[t]="",t--;return r[e]="@@"+s.length+"@@",n&&(a=n(a)),s.push(a),r}},32021:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});class s{constructor(e={}){this.trusted=!!e.trusted,this._data=e.data||{},this._metadata=e.metadata||{},this._callback=e.callback||r.noOp}get data(){return this._data}get metadata(){return this._metadata}setData(e){this._data=e.data||this._data,this._metadata=e.metadata||this._metadata,this._callback(e)}}var r;!function(e){e.noOp=function(){}}(r||(r={}))},4800:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var s,r=n(11964),a=n(97031),i=n(20998),o=n(81997);class l{constructor(e){this._changed=new o.Signal(this),this._raw={};const{data:t,metadata:n,trusted:i}=s.getBundleOptions(e);this._data=new a.ObservableJSON({values:t}),this._rawData=t,this._metadata=new a.ObservableJSON({values:n}),this._rawMetadata=n,this.trusted=i;const l=e.value;for(const e in l)switch(e){case"data":case"metadata":break;default:this._raw[e]=s.extract(l,e)}this.type=l.output_type,r.isExecuteResult(l)?this.executionCount=l.execution_count:this.executionCount=null}get changed(){return this._changed}dispose(){this._data.dispose(),this._metadata.dispose(),o.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return this._rawMetadata}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),e.metadata&&(this._updateObservable(this._metadata,e.metadata),this._rawMetadata=e.metadata),this._changed.emit()}toJSON(){const e={};for(const t in this._raw)e[t]=s.extract(this._raw,t);switch(this.type){case"display_data":case"execute_result":case"update_display_data":e.data=this.data,e.metadata=this.metadata}return delete e.transient,e}_updateObservable(e,t){const n=e.keys(),s=Object.keys(t);for(const t of n)-1===s.indexOf(t)&&e.delete(t);for(const n of s){const s=e.get(n),r=t[n];s!==r&&e.set(n,r)}}}!function(e){e.getData=function(e){return s.getData(e)},e.getMetadata=function(e){return s.getMetadata(e)}}(l||(l={})),function(e){function t(e){let t={};if(r.isExecuteResult(e)||r.isDisplayData(e)||r.isDisplayUpdate(e))t=e.data;else if(r.isStream(e))"stderr"===e.name?t["application/vnd.jupyter.stderr"]=e.text:t["application/vnd.jupyter.stdout"]=e.text;else if(r.isError(e)){t["application/vnd.jupyter.error"]=e;const n=e.traceback.join("\n");t["application/vnd.jupyter.stderr"]=n||`${e.ename}: ${e.evalue}`}return function(e){const t=Object.create(null);for(const n in e)t[n]=s(e,n);return t}(t)}function n(e){const t=Object.create(null);if(r.isExecuteResult(e)||r.isDisplayData(e))for(const n in e.metadata)t[n]=s(e.metadata,n);return t}function s(e,t){const n=e[t];return void 0===n||i.JSONExt.isPrimitive(n)?n:JSON.parse(JSON.stringify(n))}e.getData=t,e.getMetadata=n,e.getBundleOptions=function(e){return{data:t(e.value),metadata:n(e.value),trusted:!!e.trusted}},e.extract=s}(s||(s={}))},32549:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var s,r=n(56165),a=n(85421),i=n(49255),o=n(32021);class l{constructor(e={}){var t,n,s,a,o,l;if(this._id=0,this._ranks={},this._types=null,this._factories={},this.translator=null!==(t=e.translator)&&void 0!==t?t:i.nullTranslator,this.resolver=null!==(n=e.resolver)&&void 0!==n?n:null,this.linkHandler=null!==(s=e.linkHandler)&&void 0!==s?s:null,this.latexTypesetter=null!==(a=e.latexTypesetter)&&void 0!==a?a:null,this.markdownParser=null!==(o=e.markdownParser)&&void 0!==o?o:null,this.sanitizer=null!==(l=e.sanitizer)&&void 0!==l?l:new r.Sanitizer,e.initialFactories)for(const t of e.initialFactories)this.addFactory(t)}get mimeTypes(){return this._types||(this._types=s.sortedTypes(this._ranks))}preferredMimeType(e,t="ensure"){if("ensure"===t||"prefer"===t)for(const t of this.mimeTypes)if(t in e&&this._factories[t].safe)return t;if("ensure"!==t)for(const t of this.mimeTypes)if(t in e)return t}createRenderer(e){if(!(e in this._factories))throw new Error(`No factory for mime type: '${e}'`);return this._factories[e].createRenderer({mimeType:e,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}createModel(e={}){return new o.a(e)}clone(e={}){var t,n,s,r,a,i,o,d,c,u;const h=new l({resolver:null!==(n=null!==(t=e.resolver)&&void 0!==t?t:this.resolver)&&void 0!==n?n:void 0,sanitizer:null!==(r=null!==(s=e.sanitizer)&&void 0!==s?s:this.sanitizer)&&void 0!==r?r:void 0,linkHandler:null!==(i=null!==(a=e.linkHandler)&&void 0!==a?a:this.linkHandler)&&void 0!==i?i:void 0,latexTypesetter:null!==(d=null!==(o=e.latexTypesetter)&&void 0!==o?o:this.latexTypesetter)&&void 0!==d?d:void 0,markdownParser:null!==(u=null!==(c=e.markdownParser)&&void 0!==c?c:this.markdownParser)&&void 0!==u?u:void 0,translator:this.translator});return h._factories={...this._factories},h._ranks={...this._ranks},h._id=this._id,h}getFactory(e){return this._factories[e]}addFactory(e,t){void 0===t&&void 0===(t=e.defaultRank)&&(t=100);for(const n of e.mimeTypes)this._factories[n]=e,this._ranks[n]={rank:t,id:this._id++};this._types=null}removeMimeType(e){delete this._factories[e],delete this._ranks[e],this._types=null}getRank(e){const t=this._ranks[e];return t&&t.rank}setRank(e,t){if(!this._ranks[e])return;const n=this._id++;this._ranks[e]={rank:t,id:n},this._types=null}}!function(e){e.UrlResolver=class{constructor(e){this._path=e.path,this._contents=e.contents}get path(){return this._path}set path(e){this._path=e}async resolveUrl(e){if(this.isLocal(e)){const t=encodeURI(a.PathExt.dirname(this.path));e=a.PathExt.resolve(t,e)}return e}async getDownloadUrl(e){return this.isLocal(e)?this._contents.getDownloadUrl(decodeURIComponent(e)):e}isLocal(e){return!this.isMalformed(e)&&(a.URLExt.isLocal(e)||!!this._contents.driveName(decodeURI(e)))}isMalformed(e){try{return decodeURI(e),!1}catch(e){if(e instanceof URIError)return!0;throw e}}}}(l||(l={})),function(e){e.sortedTypes=function(e){return Object.keys(e).sort(((t,n)=>{const s=e[t],r=e[n];return s.rank!==r.rank?s.rank-r.rank:s.id-r.id}))}}(s||(s={}))},3328:(e,t,n)=>{"use strict";n.d(t,{IY:()=>g,K3:()=>u,KB:()=>p,NN:()=>d,ap:()=>h,co:()=>c});var s,r=n(85421),a=n(49255),i=n(8872),o=n.n(i),l=n(69837);function d(e){let{host:t,source:n,trusted:r,sanitizer:i,resolver:o,linkHandler:l,shouldTypeset:d,latexTypesetter:c,translator:u}=e;u=u||a.nullTranslator;const h=null==u?void 0:u.load("jupyterlab");let p,f=n;if(!n)return t.textContent="",Promise.resolve(void 0);if(r||(f=`${n}`,n=i.sanitize(n)),t.innerHTML=n,t.getElementsByTagName("script").length>0)if(r)s.evalInnerHTMLScriptTags(t);else{const e=document.createElement("div"),n=document.createElement("pre");n.textContent=h.__("This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const r=document.createElement("button");r.textContent=h.__("Run"),r.onclick=e=>{t.innerHTML=f,s.evalInnerHTMLScriptTags(t),t.firstChild&&t.removeChild(t.firstChild)},e.appendChild(n),e.appendChild(r),t.insertBefore(e,t.firstChild)}return s.handleDefaults(t,o),p=o?s.handleUrls(t,o,l):Promise.resolve(void 0),p.then((()=>{d&&c&&c.typeset(t)}))}function c(e){const{host:t,mimeType:n,source:s,width:r,height:a,needsBackground:i,unconfined:o}=e;t.textContent="";const l=document.createElement("img");return l.src=`data:${n};base64,${s}`,"number"==typeof a&&(l.height=a),"number"==typeof r&&(l.width=r),"light"===i?l.classList.add("jp-needs-light-background"):"dark"===i&&l.classList.add("jp-needs-dark-background"),!0===o&&l.classList.add("jp-mod-unconfined"),t.appendChild(l),Promise.resolve(void 0)}function u(e){const{host:t,source:n,shouldTypeset:s,latexTypesetter:r}=e;return t.textContent=n,s&&r&&r.typeset(t),Promise.resolve(void 0)}async function h(e){const{host:t,source:n,markdownParser:r,...a}=e;if(!n)return void(t.textContent="");let i="";if(r){const e=(0,l.D)(n);i=await r.render(e.text),i=(0,l.b)(i,e.math)}else i=`<pre>${n}</pre>`;await d({host:t,source:i,...a}),s.headerAnchors(t)}function p(e){let{host:t,source:n,trusted:s,unconfined:r}=e;if(!n)return t.textContent="",Promise.resolve(void 0);if(!s)return t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?",Promise.resolve(void 0);n.search("<svg[^>]+xmlns=[^>]+svg")<0&&(n=n.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));const a=new Image;return a.src=`data:image/svg+xml,${encodeURIComponent(n)}`,t.appendChild(a),!0===r&&t.classList.add("jp-mod-unconfined"),Promise.resolve()}function f(e,t){var n,s;const r=e.cloneNode();r.textContent=null===(n=e.textContent)||void 0===n?void 0:n.slice(0,t);const a=e.cloneNode();return a.textContent=null===(s=e.textContent)||void 0===s?void 0:s.slice(t),{pre:r,post:a}}function*m(e){var t;let n,s=0;for(let r of e)n=s+((null===(t=r.textContent)||void 0===t?void 0:t.length)||0),yield{node:r,start:s,end:n,isText:r.nodeType===Node.TEXT_NODE},s=n}function g(e){var t,n;const{host:r,sanitizer:a,source:i}=e,o=a.sanitize(s.ansiSpan(i),{allowedTags:["span"]}),l=document.createElement("pre"),d=document.createElement("pre");d.innerHTML=o;const c=d.textContent;if(c){const e=null===(n=null===(t=a.getAutolink)||void 0===t?void 0:t.call(a))||void 0===n||n?function(e){const t="\\u0000-\\u0020\\u007f-\\u009f",n=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+t+'"]{2,}[^\\s'+t+"\"'(){}\\[\\],:;.!?]","ug"),s=[];let r,a=0;for(;null!=(r=n.exec(e));){r.index!==a&&s.push(document.createTextNode(e.slice(a,r.index)));let t=r[0];const n=t.slice(-1),i=-1!==[">","<"].indexOf(n)?t.length-1:t.length,o=document.createElement("a");t=t.slice(0,i),o.href=t.startsWith("www.")?"https://"+t:t,o.rel="noopener",o.target="_blank",o.appendChild(document.createTextNode(t.slice(0,i))),s.push(o),a=r.index+i}return a!==e.length&&s.push(document.createTextNode(e.slice(a,e.length))),s}(c):[document.createTextNode(o)];let s=!1;const r=[],i=Array.from(d.childNodes);for(let t of function*(e,t){var n,s;let r=m(e),a=m(t),i=r.next(),o=a.next();for(;!i.done&&!o.done;){let e=i.value,t=o.value;if(e.isText&&e.start<=t.start&&e.end>=t.end)yield[null,t.node],o=a.next();else if(t.isText&&t.start<=e.start&&t.end>=e.end)yield[e.node,null],i=r.next();else if(e.end===t.end&&e.start===t.start)yield[e.node,t.node],i=r.next(),o=a.next();else if(e.end>t.end){let{pre:s,post:r}=f(e.node,t.end-e.start);t.start<e.start&&(t.node.textContent=null===(n=t.node.textContent)||void 0===n?void 0:n.slice(e.start-t.start)),yield[s,t.node],e.node=r,e.start=t.end,o=a.next()}else{if(!(t.end>e.end))throw new Error(`Unexpected intersection: ${JSON.stringify(e)} ${JSON.stringify(t)}`);{let{pre:n,post:a}=f(t.node,e.end-t.start);e.start<t.start&&(e.node.textContent=null===(s=e.node.textContent)||void 0===s?void 0:s.slice(t.start-e.start)),yield[e.node,n],t.node=a,t.start=e.end,i=r.next()}}}}(i,e)){if(!t[0]){r.push(t[1]),s=t[1].nodeType!==Node.TEXT_NODE;continue}if(!t[1]){r.push(t[0]),s=!1;continue}let[e,n]=t;const a=r[r.length-1];s&&n.href===a.href?a.appendChild(e):n.nodeType!==Node.TEXT_NODE?(n.textContent="",n.appendChild(e),r.push(n),s=!0):(r.push(e),s=!1)}for(const e of r)l.appendChild(e)}return r.appendChild(l),Promise.resolve(void 0)}!function(e){e.createHeaderId=function(e){var t;return(null!==(t=e.textContent)&&void 0!==t?t:"").replace(/ /g,"-")}}(h||(h={})),function(e){async function t(e,t,n){const s=e.getAttribute(t)||"",a=n.isLocal?n.isLocal(s):r.URLExt.isLocal(s);if(s&&a)try{const a=await n.resolveUrl(s);let i=await n.getDownloadUrl(a);"data:"!==r.URLExt.parse(i).protocol&&(i+=(/\?/.test(i)?"&":"?")+(new Date).getTime()),e.setAttribute(t,i)}catch(n){throw e.setAttribute(t,""),n}}function n(e,t,n){let s=e.getAttribute("href")||"";const a=t.isLocal?t.isLocal(s):r.URLExt.isLocal(s);if(!s||!a)return Promise.resolve(void 0);const i=e.hash;if(i){if(i===s)return e.target="_self",Promise.resolve(void 0);s=s.replace(i,"")}return t.resolveUrl(s).then((s=>{const r=decodeURIComponent(s);return n&&n.handleLink(e,r,i),t.getDownloadUrl(s)})).then((t=>{e.href=t+i})).catch((t=>{e.href=""}))}e.evalInnerHTMLScriptTags=function(e){const t=Array.from(e.getElementsByTagName("script"));for(const e of t){if(!e.parentNode)continue;const t=document.createElement("script"),n=e.attributes;for(let e=0,s=n.length;e<s;++e){const{name:s,value:r}=n[e];t.setAttribute(s,r)}t.textContent=e.textContent,e.parentNode.replaceChild(t,e)}},e.handleDefaults=function(e,t){const n=e.getElementsByTagName("a");for(let e=0;e<n.length;e++){const s=n[e];if(!(s instanceof HTMLAnchorElement))continue;const a=s.href,i=t&&t.isLocal?t.isLocal(a):r.URLExt.isLocal(a);s.target||(s.target=i?"_self":"_blank"),i||(s.rel="noopener")}const s=e.getElementsByTagName("img");for(let e=0;e<s.length;e++)s[e].alt||(s[e].alt="Image")},e.handleUrls=function(e,s,r){const a=[],i=e.querySelectorAll("*[src]");for(let e=0;e<i.length;e++)a.push(t(i[e],"src",s));const o=e.getElementsByTagName("a");for(let e=0;e<o.length;e++)a.push(n(o[e],s,r));const l=e.getElementsByTagName("link");for(let e=0;e<l.length;e++)a.push(t(l[e],"href",s));return Promise.all(a).then((()=>{}))},e.headerAnchors=function(e){const t=["h1","h2","h3","h4","h5","h6"];for(const n of t){const t=e.getElementsByTagName(n);for(let e=0;e<t.length;e++){const n=t[e];n.id=h.createHeaderId(n);const s=document.createElement("a");s.target="_self",s.textContent="¶",s.href="#"+n.id,s.classList.add("jp-InternalAnchorLink"),n.appendChild(s)}}};const s=["ansi-black","ansi-red","ansi-green","ansi-yellow","ansi-blue","ansi-magenta","ansi-cyan","ansi-white","ansi-black-intense","ansi-red-intense","ansi-green-intense","ansi-yellow-intense","ansi-blue-intense","ansi-magenta-intense","ansi-cyan-intense","ansi-white-intense"];function a(e,t,n,r,a,i,o){if(e){const l=[],d=[];r&&"number"==typeof t&&0<=t&&t<8&&(t+=8),i&&([t,n]=[n,t]),"number"==typeof t?l.push(s[t]+"-fg"):t.length?d.push(`color: rgb(${t})`):i&&l.push("ansi-default-inverse-fg"),"number"==typeof n?l.push(s[n]+"-bg"):n.length?d.push(`background-color: rgb(${n})`):i&&l.push("ansi-default-inverse-bg"),r&&l.push("ansi-bold"),a&&l.push("ansi-underline"),l.length||d.length?(o.push("<span"),l.length&&o.push(` class="${l.join(" ")}"`),d.length&&o.push(` style="${d.join("; ")}"`),o.push(">"),o.push(e),o.push("</span>")):o.push(e)}}function i(e){let t,n,s;const r=e.shift();if(2===r&&e.length>=3){if(t=e.shift(),n=e.shift(),s=e.shift(),[t,n,s].some((e=>e<0||255<e)))throw new RangeError("Invalid range for RGB colors")}else{if(!(5===r&&e.length>=1))throw new RangeError("Invalid extended color specification");{const r=e.shift();if(r<0)throw new RangeError("Color index must be >= 0");if(r<16)return r;if(r<232)t=Math.floor((r-16)/36),t=t>0?55+40*t:0,n=Math.floor((r-16)%36/6),n=n>0?55+40*n:0,s=(r-16)%6,s=s>0?55+40*s:0;else{if(!(r<256))throw new RangeError("Color index must be < 256");t=n=s=10*(r-232)+8}}}return[t,n,s]}e.ansiSpan=function(e){const t=/\x1b\[(.*?)([@-~])/g;let n,s=[],r=[],l=!1,d=!1,c=!1;const u=[],h=[];let p=0;for(e=o()(e),e+="";n=t.exec(e);){if("m"===n[2]){const e=n[1].split(";");for(let t=0;t<e.length;t++){const n=e[t];if(""===n)h.push(0);else{if(-1===n.search(/^\d+$/)){h.length=0;break}h.push(parseInt(n,10))}}}for(a(e.substring(p,n.index),s,r,l,d,c,u),p=t.lastIndex;h.length;){const e=h.shift();switch(e){case 0:s=r=[],l=!1,d=!1,c=!1;break;case 1:case 5:l=!0;break;case 4:d=!0;break;case 7:c=!0;break;case 21:case 22:l=!1;break;case 24:d=!1;break;case 27:c=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:s=e-30;break;case 38:try{s=i(h)}catch(e){h.length=0}break;case 39:s=[];break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:r=e-40;break;case 48:try{r=i(h)}catch(e){h.length=0}break;case 49:r=[];break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:s=e-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:r=e-100+8}}}return u.join("")}}(s||(s={}))},2186:(e,t,n)=>{"use strict";n.d(t,{ZD:()=>r,_y:()=>a,sc:()=>i});var s=n(20998);const r=new s.Token("@jupyterlab/rendermime:IRenderMimeRegistry",'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.'),a=new s.Token("@jupyterlab/rendermime:ILatexTypesetter","A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension."),i=new s.Token("@jupyterlab/rendermime:IMarkdownParser","A service for rendering markdown syntax as HTML content.")},28182:(e,t,n)=>{"use strict";n.d(t,{BP:()=>o,FK:()=>d,ND:()=>f,UH:()=>c,cw:()=>u,lH:()=>p,oI:()=>l,pY:()=>i,zt:()=>h});var s=n(49255),r=n(9267),a=n(3328);class i extends r.Widget{constructor(e){var t,n;super(),this.mimeType=e.mimeType,this.sanitizer=e.sanitizer,this.resolver=e.resolver,this.linkHandler=e.linkHandler,this.translator=null!==(t=e.translator)&&void 0!==t?t:s.nullTranslator,this.latexTypesetter=e.latexTypesetter,this.markdownParser=null!==(n=e.markdownParser)&&void 0!==n?n:null,this.node.dataset.mimeType=this.mimeType}async renderModel(e,t){if(!t)for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.toggleClass("jp-mod-trusted",e.trusted),await this.render(e);const{fragment:n}=e.metadata;n&&this.setFragment(n)}setFragment(e){}}class o extends i{constructor(e){super(e),this.addClass("jp-RenderedHTMLCommon")}setFragment(e){let t;try{t=this.node.querySelector(e.startsWith("#")?`#${CSS.escape(e.slice(1))}`:e)}catch(e){console.warn("Unable to set URI fragment identifier.",e)}t&&t.scrollIntoView()}}class l extends o{constructor(e){super(e),this.addClass("jp-RenderedHTML")}render(e){return a.NN({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,translator:this.translator})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class d extends i{constructor(e){super(e),this.addClass("jp-RenderedLatex")}render(e){return a.K3({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class c extends i{constructor(e){super(e),this.addClass("jp-RenderedImage")}render(e){const t=e.metadata[this.mimeType];return a.co({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,needsBackground:e.metadata.needs_background,unconfined:t&&t.unconfined})}}class u extends o{constructor(e){super(e),this.addClass("jp-RenderedMarkdown")}render(e){return a.ap({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}async renderModel(e){await super.renderModel(e,!0)}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class h extends i{constructor(e){super(e),this.addClass("jp-RenderedSVG")}render(e){const t=e.metadata[this.mimeType];return a.KB({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,unconfined:t&&t.unconfined,translator:this.translator})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class p extends i{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return a.IY({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),translator:this.translator})}}class f extends i{constructor(e){super(e),this.addClass("jp-RenderedJavaScript")}render(e){const t=this.translator.load("jupyterlab");return a.IY({host:this.node,sanitizer:this.sanitizer,source:t.__("JavaScript output is disabled in JupyterLab"),translator:this.translator})}}},8872:(e,t,n)=>{var s,r=/[&<>"'`]/g,a=RegExp(r.source),i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,o="object"==typeof self&&self&&self.Object===Object&&self,l=i||o||Function("return this")(),d=(s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(e){return null==s?void 0:s[e]}),c=Object.prototype.toString,u=l.Symbol,h=u?u.prototype:void 0,p=h?h.toString:void 0;e.exports=function(e){var t;return(e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==c.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t))&&a.test(e)?e.replace(r,d):e}}}]);
1
+ (self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2401],{43967:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var s,r=n(7437),a=n(20998),i=n(81997);class o{constructor(e){this.trusted=!1,this._changed=new i.Signal(this),this._raw={};const t=s.getData(e.value);this._data=new r.ObservableJSON({values:t}),this._rawData=t;const n=e.value;for(const e in n)"data"===e||(this._raw[e]=s.extract(n,e))}get changed(){return this._changed}dispose(){this._data.dispose(),i.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return{}}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),this._changed.emit(void 0)}toJSON(){const e={};for(const t in this._raw)e[t]=s.extract(this._raw,t);return e}_updateObservable(e,t){const n=e.keys(),s=Object.keys(t);for(const t of n)-1===s.indexOf(t)&&e.delete(t);for(const n of s){const s=e.get(n),r=t[n];s!==r&&e.set(n,r)}}}!function(e){e.getData=function(e){return s.getData(e)}}(o||(o={})),function(e){function t(e){return function(e){const t=Object.create(null);for(const s in e)t[s]=n(e,s);return t}(e)}function n(e,t){const n=e[t];return void 0===n||a.JSONExt.isPrimitive(n)?n:a.JSONExt.deepCopy(n)}e.getData=t,e.getBundleOptions=function(e){return{data:t(e.value)}},e.extract=n}(s||(s={}))},15862:(e,t,n)=>{"use strict";n.d(t,{BJ:()=>d,F:()=>l,Lz:()=>a,Nf:()=>u,hJ:()=>i,nF:()=>c,vy:()=>r,xr:()=>o});var s=n(28182);const r={safe:!0,mimeTypes:["text/html"],defaultRank:50,createRenderer:e=>new s.oI(e)},a={safe:!0,mimeTypes:["image/bmp","image/png","image/jpeg","image/gif","image/webp"],defaultRank:90,createRenderer:e=>new s.UH(e)},i={safe:!0,mimeTypes:["text/latex"],defaultRank:70,createRenderer:e=>new s.FK(e)},o={safe:!0,mimeTypes:["text/markdown"],defaultRank:60,createRenderer:e=>new s.cw(e)},l={safe:!1,mimeTypes:["image/svg+xml"],defaultRank:80,createRenderer:e=>new s.zt(e)},d={safe:!0,mimeTypes:["text/plain","application/vnd.jupyter.stdout","application/vnd.jupyter.stderr"],defaultRank:120,createRenderer:e=>new s.lH(e)},c={safe:!1,mimeTypes:["text/javascript","application/javascript"],defaultRank:110,createRenderer:e=>new s.ND(e)},u=[r,o,i,l,a,c,d]},72401:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachmentModel:()=>a.g,ILatexTypesetter:()=>h._y,IMarkdownParser:()=>h.sc,IRenderMimeRegistry:()=>h.ZD,MimeModel:()=>l.a,OutputModel:()=>d.M,RenderMimeRegistry:()=>c.D,RenderedCommon:()=>p.pY,RenderedHTML:()=>p.oI,RenderedHTMLCommon:()=>p.BP,RenderedImage:()=>p.UH,RenderedJavaScript:()=>p.ND,RenderedLatex:()=>p.FK,RenderedMarkdown:()=>p.cw,RenderedSVG:()=>p.zt,RenderedText:()=>p.lH,htmlRendererFactory:()=>i.vy,imageRendererFactory:()=>i.Lz,javaScriptRendererFactory:()=>i.nF,latexRendererFactory:()=>i.hJ,markdownRendererFactory:()=>i.xr,removeMath:()=>o.D,renderHTML:()=>u.NN,renderImage:()=>u.co,renderLatex:()=>u.K3,renderMarkdown:()=>u.ap,renderSVG:()=>u.KB,renderText:()=>u.IY,replaceMath:()=>o.b,standardRendererFactories:()=>i.Nf,svgRendererFactory:()=>i.F,textRendererFactory:()=>i.BJ});var s=n(93267),r={};for(const e in s)"default"!==e&&(r[e]=()=>s[e]);n.d(t,r);var a=n(43967),i=n(15862),o=n(69837),l=n(32021),d=n(4800),c=n(32549),u=n(3328),h=n(2186),p=n(28182)},69837:(e,t,n)=>{"use strict";n.d(t,{D:()=>a,b:()=>i});const s="$",r=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function a(e){const t=[];let n,a=null,i=null,l=null,d=0;e.includes("`")||e.includes("~~~")?(e=e.replace(/~/g,"~T").replace(/^(?<fence>`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k<fence>`*$/gm,(e=>e.replace(/\$/g,"~D"))).replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D"))),n=e=>e.replace(/~([TD])/g,((e,t)=>"T"===t?"~":s))):n=e=>e;let c=e.replace(/\r\n?/g,"\n").split(r);for(let e=1,r=c.length;e<r;e+=2){const r=c[e];"@"===r.charAt(0)?(c[e]="@@"+t.length+"@@",t.push(r)):null!==a?r===i?d?l=e:(c=o(a,e,n,t,c),a=null,i=null,l=null):r.match(/\n.*\n/)?(null!==l&&(e=l,c=o(a,e,n,t,c)),a=null,i=null,l=null,d=0):"{"===r?d++:"}"===r&&d&&d--:r===s||"$$"===r?(a=e,i=r,d=0):"\\\\("===r||"\\\\["===r?(a=e,i="("===r.slice(-1)?"\\\\)":"\\\\]",d=0):"begin"===r.substr(1,5)&&(a=e,i="\\end"+r.substr(6),d=0)}return null!==a&&null!==l&&(c=o(a,l,n,t,c),a=null,i=null,l=null),{text:n(c.join("")),math:t}}function i(e,t){return e.replace(/@@(\d+)@@/g,((e,n)=>{let s=t[n];return"\\\\("===s.substr(0,3)&&"\\\\)"===s.substr(s.length-3)?s="\\("+s.substring(3,s.length-3)+"\\)":"\\\\["===s.substr(0,3)&&"\\\\]"===s.substr(s.length-3)&&(s="\\["+s.substring(3,s.length-3)+"\\]"),s}))}function o(e,t,n,s,r){let a=r.slice(e,t+1).join("").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(a=a.replace(/(%[^\n]*)\n/g,"$1<br/>\n"));t>e;)r[t]="",t--;return r[e]="@@"+s.length+"@@",n&&(a=n(a)),s.push(a),r}},32021:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});class s{constructor(e={}){this.trusted=!!e.trusted,this._data=e.data||{},this._metadata=e.metadata||{},this._callback=e.callback||r.noOp}get data(){return this._data}get metadata(){return this._metadata}setData(e){this._data=e.data||this._data,this._metadata=e.metadata||this._metadata,this._callback(e)}}var r;!function(e){e.noOp=function(){}}(r||(r={}))},4800:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var s,r=n(47891),a=n(7437),i=n(20998),o=n(81997);class l{constructor(e){this._changed=new o.Signal(this),this._raw={};const{data:t,metadata:n,trusted:i}=s.getBundleOptions(e);this._data=new a.ObservableJSON({values:t}),this._rawData=t,this._metadata=new a.ObservableJSON({values:n}),this._rawMetadata=n,this.trusted=i;const l=e.value;for(const e in l)switch(e){case"data":case"metadata":break;default:this._raw[e]=s.extract(l,e)}this.type=l.output_type,r.isExecuteResult(l)?this.executionCount=l.execution_count:this.executionCount=null}get changed(){return this._changed}dispose(){this._data.dispose(),this._metadata.dispose(),o.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return this._rawMetadata}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),e.metadata&&(this._updateObservable(this._metadata,e.metadata),this._rawMetadata=e.metadata),this._changed.emit()}toJSON(){const e={};for(const t in this._raw)e[t]=s.extract(this._raw,t);switch(this.type){case"display_data":case"execute_result":case"update_display_data":e.data=this.data,e.metadata=this.metadata}return delete e.transient,e}_updateObservable(e,t){const n=e.keys(),s=Object.keys(t);for(const t of n)-1===s.indexOf(t)&&e.delete(t);for(const n of s){const s=e.get(n),r=t[n];s!==r&&e.set(n,r)}}}!function(e){e.getData=function(e){return s.getData(e)},e.getMetadata=function(e){return s.getMetadata(e)}}(l||(l={})),function(e){function t(e){let t={};if(r.isExecuteResult(e)||r.isDisplayData(e)||r.isDisplayUpdate(e))t=e.data;else if(r.isStream(e))"stderr"===e.name?t["application/vnd.jupyter.stderr"]=e.text:t["application/vnd.jupyter.stdout"]=e.text;else if(r.isError(e)){t["application/vnd.jupyter.error"]=e;const n=e.traceback.join("\n");t["application/vnd.jupyter.stderr"]=n||`${e.ename}: ${e.evalue}`}return function(e){const t=Object.create(null);for(const n in e)t[n]=s(e,n);return t}(t)}function n(e){const t=Object.create(null);if(r.isExecuteResult(e)||r.isDisplayData(e))for(const n in e.metadata)t[n]=s(e.metadata,n);return t}function s(e,t){const n=e[t];return void 0===n||i.JSONExt.isPrimitive(n)?n:JSON.parse(JSON.stringify(n))}e.getData=t,e.getMetadata=n,e.getBundleOptions=function(e){return{data:t(e.value),metadata:n(e.value),trusted:!!e.trusted}},e.extract=s}(s||(s={}))},32549:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var s,r=n(28054),a=n(64588),i=n(57356),o=n(32021);class l{constructor(e={}){var t,n,s,a,o,l;if(this._id=0,this._ranks={},this._types=null,this._factories={},this.translator=null!==(t=e.translator)&&void 0!==t?t:i.nullTranslator,this.resolver=null!==(n=e.resolver)&&void 0!==n?n:null,this.linkHandler=null!==(s=e.linkHandler)&&void 0!==s?s:null,this.latexTypesetter=null!==(a=e.latexTypesetter)&&void 0!==a?a:null,this.markdownParser=null!==(o=e.markdownParser)&&void 0!==o?o:null,this.sanitizer=null!==(l=e.sanitizer)&&void 0!==l?l:new r.Sanitizer,e.initialFactories)for(const t of e.initialFactories)this.addFactory(t)}get mimeTypes(){return this._types||(this._types=s.sortedTypes(this._ranks))}preferredMimeType(e,t="ensure"){if("ensure"===t||"prefer"===t)for(const t of this.mimeTypes)if(t in e&&this._factories[t].safe)return t;if("ensure"!==t)for(const t of this.mimeTypes)if(t in e)return t}createRenderer(e){if(!(e in this._factories))throw new Error(`No factory for mime type: '${e}'`);return this._factories[e].createRenderer({mimeType:e,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}createModel(e={}){return new o.a(e)}clone(e={}){var t,n,s,r,a,i,o,d,c,u;const h=new l({resolver:null!==(n=null!==(t=e.resolver)&&void 0!==t?t:this.resolver)&&void 0!==n?n:void 0,sanitizer:null!==(r=null!==(s=e.sanitizer)&&void 0!==s?s:this.sanitizer)&&void 0!==r?r:void 0,linkHandler:null!==(i=null!==(a=e.linkHandler)&&void 0!==a?a:this.linkHandler)&&void 0!==i?i:void 0,latexTypesetter:null!==(d=null!==(o=e.latexTypesetter)&&void 0!==o?o:this.latexTypesetter)&&void 0!==d?d:void 0,markdownParser:null!==(u=null!==(c=e.markdownParser)&&void 0!==c?c:this.markdownParser)&&void 0!==u?u:void 0,translator:this.translator});return h._factories={...this._factories},h._ranks={...this._ranks},h._id=this._id,h}getFactory(e){return this._factories[e]}addFactory(e,t){void 0===t&&void 0===(t=e.defaultRank)&&(t=100);for(const n of e.mimeTypes)this._factories[n]=e,this._ranks[n]={rank:t,id:this._id++};this._types=null}removeMimeType(e){delete this._factories[e],delete this._ranks[e],this._types=null}getRank(e){const t=this._ranks[e];return t&&t.rank}setRank(e,t){if(!this._ranks[e])return;const n=this._id++;this._ranks[e]={rank:t,id:n},this._types=null}}!function(e){e.UrlResolver=class{constructor(e){this._path=e.path,this._contents=e.contents}get path(){return this._path}set path(e){this._path=e}async resolveUrl(e){if(this.isLocal(e)){const t=encodeURI(a.PathExt.dirname(this.path));e=a.PathExt.resolve(t,e)}return e}async getDownloadUrl(e){return this.isLocal(e)?this._contents.getDownloadUrl(decodeURIComponent(e)):e}isLocal(e){return!this.isMalformed(e)&&(a.URLExt.isLocal(e)||!!this._contents.driveName(decodeURI(e)))}isMalformed(e){try{return decodeURI(e),!1}catch(e){if(e instanceof URIError)return!0;throw e}}}}(l||(l={})),function(e){e.sortedTypes=function(e){return Object.keys(e).sort(((t,n)=>{const s=e[t],r=e[n];return s.rank!==r.rank?s.rank-r.rank:s.id-r.id}))}}(s||(s={}))},3328:(e,t,n)=>{"use strict";n.d(t,{IY:()=>g,K3:()=>u,KB:()=>p,NN:()=>d,ap:()=>h,co:()=>c});var s,r=n(64588),a=n(57356),i=n(8872),o=n.n(i),l=n(69837);function d(e){let{host:t,source:n,trusted:r,sanitizer:i,resolver:o,linkHandler:l,shouldTypeset:d,latexTypesetter:c,translator:u}=e;u=u||a.nullTranslator;const h=null==u?void 0:u.load("jupyterlab");let p,f=n;if(!n)return t.textContent="",Promise.resolve(void 0);if(r||(f=`${n}`,n=i.sanitize(n)),t.innerHTML=n,t.getElementsByTagName("script").length>0)if(r)s.evalInnerHTMLScriptTags(t);else{const e=document.createElement("div"),n=document.createElement("pre");n.textContent=h.__("This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const r=document.createElement("button");r.textContent=h.__("Run"),r.onclick=e=>{t.innerHTML=f,s.evalInnerHTMLScriptTags(t),t.firstChild&&t.removeChild(t.firstChild)},e.appendChild(n),e.appendChild(r),t.insertBefore(e,t.firstChild)}return s.handleDefaults(t,o),p=o?s.handleUrls(t,o,l):Promise.resolve(void 0),p.then((()=>{d&&c&&c.typeset(t)}))}function c(e){const{host:t,mimeType:n,source:s,width:r,height:a,needsBackground:i,unconfined:o}=e;t.textContent="";const l=document.createElement("img");return l.src=`data:${n};base64,${s}`,"number"==typeof a&&(l.height=a),"number"==typeof r&&(l.width=r),"light"===i?l.classList.add("jp-needs-light-background"):"dark"===i&&l.classList.add("jp-needs-dark-background"),!0===o&&l.classList.add("jp-mod-unconfined"),t.appendChild(l),Promise.resolve(void 0)}function u(e){const{host:t,source:n,shouldTypeset:s,latexTypesetter:r}=e;return t.textContent=n,s&&r&&r.typeset(t),Promise.resolve(void 0)}async function h(e){const{host:t,source:n,markdownParser:r,...a}=e;if(!n)return void(t.textContent="");let i="";if(r){const e=(0,l.D)(n);i=await r.render(e.text),i=(0,l.b)(i,e.math)}else i=`<pre>${n}</pre>`;await d({host:t,source:i,...a}),s.headerAnchors(t)}function p(e){let{host:t,source:n,trusted:s,unconfined:r}=e;if(!n)return t.textContent="",Promise.resolve(void 0);if(!s)return t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?",Promise.resolve(void 0);n.search("<svg[^>]+xmlns=[^>]+svg")<0&&(n=n.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));const a=new Image;return a.src=`data:image/svg+xml,${encodeURIComponent(n)}`,t.appendChild(a),!0===r&&t.classList.add("jp-mod-unconfined"),Promise.resolve()}function f(e,t){var n,s;const r=e.cloneNode();r.textContent=null===(n=e.textContent)||void 0===n?void 0:n.slice(0,t);const a=e.cloneNode();return a.textContent=null===(s=e.textContent)||void 0===s?void 0:s.slice(t),{pre:r,post:a}}function*m(e){var t;let n,s=0;for(let r of e)n=s+((null===(t=r.textContent)||void 0===t?void 0:t.length)||0),yield{node:r,start:s,end:n,isText:r.nodeType===Node.TEXT_NODE},s=n}function g(e){var t,n;const{host:r,sanitizer:a,source:i}=e,o=a.sanitize(s.ansiSpan(i),{allowedTags:["span"]}),l=document.createElement("pre"),d=document.createElement("pre");d.innerHTML=o;const c=d.textContent;if(c){const e=null===(n=null===(t=a.getAutolink)||void 0===t?void 0:t.call(a))||void 0===n||n?function(e){const t="\\u0000-\\u0020\\u007f-\\u009f",n=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+t+'"]{2,}[^\\s'+t+"\"'(){}\\[\\],:;.!?]","ug"),s=[];let r,a=0;for(;null!=(r=n.exec(e));){r.index!==a&&s.push(document.createTextNode(e.slice(a,r.index)));let t=r[0];const n=t.slice(-1),i=-1!==[">","<"].indexOf(n)?t.length-1:t.length,o=document.createElement("a");t=t.slice(0,i),o.href=t.startsWith("www.")?"https://"+t:t,o.rel="noopener",o.target="_blank",o.appendChild(document.createTextNode(t.slice(0,i))),s.push(o),a=r.index+i}return a!==e.length&&s.push(document.createTextNode(e.slice(a,e.length))),s}(c):[document.createTextNode(o)];let s=!1;const r=[],i=Array.from(d.childNodes);for(let t of function*(e,t){var n,s;let r=m(e),a=m(t),i=r.next(),o=a.next();for(;!i.done&&!o.done;){let e=i.value,t=o.value;if(e.isText&&e.start<=t.start&&e.end>=t.end)yield[null,t.node],o=a.next();else if(t.isText&&t.start<=e.start&&t.end>=e.end)yield[e.node,null],i=r.next();else if(e.end===t.end&&e.start===t.start)yield[e.node,t.node],i=r.next(),o=a.next();else if(e.end>t.end){let{pre:s,post:r}=f(e.node,t.end-e.start);t.start<e.start&&(t.node.textContent=null===(n=t.node.textContent)||void 0===n?void 0:n.slice(e.start-t.start)),yield[s,t.node],e.node=r,e.start=t.end,o=a.next()}else{if(!(t.end>e.end))throw new Error(`Unexpected intersection: ${JSON.stringify(e)} ${JSON.stringify(t)}`);{let{pre:n,post:a}=f(t.node,e.end-t.start);e.start<t.start&&(e.node.textContent=null===(s=e.node.textContent)||void 0===s?void 0:s.slice(t.start-e.start)),yield[e.node,n],t.node=a,t.start=e.end,i=r.next()}}}}(i,e)){if(!t[0]){r.push(t[1]),s=t[1].nodeType!==Node.TEXT_NODE;continue}if(!t[1]){r.push(t[0]),s=!1;continue}let[e,n]=t;const a=r[r.length-1];s&&n.href===a.href?a.appendChild(e):n.nodeType!==Node.TEXT_NODE?(n.textContent="",n.appendChild(e),r.push(n),s=!0):(r.push(e),s=!1)}for(const e of r)l.appendChild(e)}return r.appendChild(l),Promise.resolve(void 0)}!function(e){e.createHeaderId=function(e){var t;return(null!==(t=e.textContent)&&void 0!==t?t:"").replace(/ /g,"-")}}(h||(h={})),function(e){async function t(e,t,n){const s=e.getAttribute(t)||"",a=n.isLocal?n.isLocal(s):r.URLExt.isLocal(s);if(s&&a)try{const a=await n.resolveUrl(s);let i=await n.getDownloadUrl(a);"data:"!==r.URLExt.parse(i).protocol&&(i+=(/\?/.test(i)?"&":"?")+(new Date).getTime()),e.setAttribute(t,i)}catch(n){throw e.setAttribute(t,""),n}}function n(e,t,n){let s=e.getAttribute("href")||"";const a=t.isLocal?t.isLocal(s):r.URLExt.isLocal(s);if(!s||!a)return Promise.resolve(void 0);const i=e.hash;if(i){if(i===s)return e.target="_self",Promise.resolve(void 0);s=s.replace(i,"")}return t.resolveUrl(s).then((s=>{const r=decodeURIComponent(s);return n&&n.handleLink(e,r,i),t.getDownloadUrl(s)})).then((t=>{e.href=t+i})).catch((t=>{e.href=""}))}e.evalInnerHTMLScriptTags=function(e){const t=Array.from(e.getElementsByTagName("script"));for(const e of t){if(!e.parentNode)continue;const t=document.createElement("script"),n=e.attributes;for(let e=0,s=n.length;e<s;++e){const{name:s,value:r}=n[e];t.setAttribute(s,r)}t.textContent=e.textContent,e.parentNode.replaceChild(t,e)}},e.handleDefaults=function(e,t){const n=e.getElementsByTagName("a");for(let e=0;e<n.length;e++){const s=n[e];if(!(s instanceof HTMLAnchorElement))continue;const a=s.href,i=t&&t.isLocal?t.isLocal(a):r.URLExt.isLocal(a);s.target||(s.target=i?"_self":"_blank"),i||(s.rel="noopener")}const s=e.getElementsByTagName("img");for(let e=0;e<s.length;e++)s[e].alt||(s[e].alt="Image")},e.handleUrls=function(e,s,r){const a=[],i=e.querySelectorAll("*[src]");for(let e=0;e<i.length;e++)a.push(t(i[e],"src",s));const o=e.getElementsByTagName("a");for(let e=0;e<o.length;e++)a.push(n(o[e],s,r));const l=e.getElementsByTagName("link");for(let e=0;e<l.length;e++)a.push(t(l[e],"href",s));return Promise.all(a).then((()=>{}))},e.headerAnchors=function(e){const t=["h1","h2","h3","h4","h5","h6"];for(const n of t){const t=e.getElementsByTagName(n);for(let e=0;e<t.length;e++){const n=t[e];n.id=h.createHeaderId(n);const s=document.createElement("a");s.target="_self",s.textContent="¶",s.href="#"+n.id,s.classList.add("jp-InternalAnchorLink"),n.appendChild(s)}}};const s=["ansi-black","ansi-red","ansi-green","ansi-yellow","ansi-blue","ansi-magenta","ansi-cyan","ansi-white","ansi-black-intense","ansi-red-intense","ansi-green-intense","ansi-yellow-intense","ansi-blue-intense","ansi-magenta-intense","ansi-cyan-intense","ansi-white-intense"];function a(e,t,n,r,a,i,o){if(e){const l=[],d=[];r&&"number"==typeof t&&0<=t&&t<8&&(t+=8),i&&([t,n]=[n,t]),"number"==typeof t?l.push(s[t]+"-fg"):t.length?d.push(`color: rgb(${t})`):i&&l.push("ansi-default-inverse-fg"),"number"==typeof n?l.push(s[n]+"-bg"):n.length?d.push(`background-color: rgb(${n})`):i&&l.push("ansi-default-inverse-bg"),r&&l.push("ansi-bold"),a&&l.push("ansi-underline"),l.length||d.length?(o.push("<span"),l.length&&o.push(` class="${l.join(" ")}"`),d.length&&o.push(` style="${d.join("; ")}"`),o.push(">"),o.push(e),o.push("</span>")):o.push(e)}}function i(e){let t,n,s;const r=e.shift();if(2===r&&e.length>=3){if(t=e.shift(),n=e.shift(),s=e.shift(),[t,n,s].some((e=>e<0||255<e)))throw new RangeError("Invalid range for RGB colors")}else{if(!(5===r&&e.length>=1))throw new RangeError("Invalid extended color specification");{const r=e.shift();if(r<0)throw new RangeError("Color index must be >= 0");if(r<16)return r;if(r<232)t=Math.floor((r-16)/36),t=t>0?55+40*t:0,n=Math.floor((r-16)%36/6),n=n>0?55+40*n:0,s=(r-16)%6,s=s>0?55+40*s:0;else{if(!(r<256))throw new RangeError("Color index must be < 256");t=n=s=10*(r-232)+8}}}return[t,n,s]}e.ansiSpan=function(e){const t=/\x1b\[(.*?)([@-~])/g;let n,s=[],r=[],l=!1,d=!1,c=!1;const u=[],h=[];let p=0;for(e=o()(e),e+="";n=t.exec(e);){if("m"===n[2]){const e=n[1].split(";");for(let t=0;t<e.length;t++){const n=e[t];if(""===n)h.push(0);else{if(-1===n.search(/^\d+$/)){h.length=0;break}h.push(parseInt(n,10))}}}for(a(e.substring(p,n.index),s,r,l,d,c,u),p=t.lastIndex;h.length;){const e=h.shift();switch(e){case 0:s=r=[],l=!1,d=!1,c=!1;break;case 1:case 5:l=!0;break;case 4:d=!0;break;case 7:c=!0;break;case 21:case 22:l=!1;break;case 24:d=!1;break;case 27:c=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:s=e-30;break;case 38:try{s=i(h)}catch(e){h.length=0}break;case 39:s=[];break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:r=e-40;break;case 48:try{r=i(h)}catch(e){h.length=0}break;case 49:r=[];break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:s=e-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:r=e-100+8}}}return u.join("")}}(s||(s={}))},2186:(e,t,n)=>{"use strict";n.d(t,{ZD:()=>r,_y:()=>a,sc:()=>i});var s=n(20998);const r=new s.Token("@jupyterlab/rendermime:IRenderMimeRegistry",'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.'),a=new s.Token("@jupyterlab/rendermime:ILatexTypesetter","A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension."),i=new s.Token("@jupyterlab/rendermime:IMarkdownParser","A service for rendering markdown syntax as HTML content.")},28182:(e,t,n)=>{"use strict";n.d(t,{BP:()=>o,FK:()=>d,ND:()=>f,UH:()=>c,cw:()=>u,lH:()=>p,oI:()=>l,pY:()=>i,zt:()=>h});var s=n(57356),r=n(9267),a=n(3328);class i extends r.Widget{constructor(e){var t,n;super(),this.mimeType=e.mimeType,this.sanitizer=e.sanitizer,this.resolver=e.resolver,this.linkHandler=e.linkHandler,this.translator=null!==(t=e.translator)&&void 0!==t?t:s.nullTranslator,this.latexTypesetter=e.latexTypesetter,this.markdownParser=null!==(n=e.markdownParser)&&void 0!==n?n:null,this.node.dataset.mimeType=this.mimeType}async renderModel(e,t){if(!t)for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.toggleClass("jp-mod-trusted",e.trusted),await this.render(e);const{fragment:n}=e.metadata;n&&this.setFragment(n)}setFragment(e){}}class o extends i{constructor(e){super(e),this.addClass("jp-RenderedHTMLCommon")}setFragment(e){let t;try{t=this.node.querySelector(e.startsWith("#")?`#${CSS.escape(e.slice(1))}`:e)}catch(e){console.warn("Unable to set URI fragment identifier.",e)}t&&t.scrollIntoView()}}class l extends o{constructor(e){super(e),this.addClass("jp-RenderedHTML")}render(e){return a.NN({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,translator:this.translator})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class d extends i{constructor(e){super(e),this.addClass("jp-RenderedLatex")}render(e){return a.K3({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class c extends i{constructor(e){super(e),this.addClass("jp-RenderedImage")}render(e){const t=e.metadata[this.mimeType];return a.co({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,needsBackground:e.metadata.needs_background,unconfined:t&&t.unconfined})}}class u extends o{constructor(e){super(e),this.addClass("jp-RenderedMarkdown")}render(e){return a.ap({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}async renderModel(e){await super.renderModel(e,!0)}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class h extends i{constructor(e){super(e),this.addClass("jp-RenderedSVG")}render(e){const t=e.metadata[this.mimeType];return a.KB({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,unconfined:t&&t.unconfined,translator:this.translator})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class p extends i{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return a.IY({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),translator:this.translator})}}class f extends i{constructor(e){super(e),this.addClass("jp-RenderedJavaScript")}render(e){const t=this.translator.load("jupyterlab");return a.IY({host:this.node,sanitizer:this.sanitizer,source:t.__("JavaScript output is disabled in JupyterLab"),translator:this.translator})}}},8872:(e,t,n)=>{var s,r=/[&<>"'`]/g,a=RegExp(r.source),i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,o="object"==typeof self&&self&&self.Object===Object&&self,l=i||o||Function("return this")(),d=(s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(e){return null==s?void 0:s[e]}),c=Object.prototype.toString,u=l.Symbol,h=u?u.prototype:void 0,p=h?h.toString:void 0;e.exports=function(e){var t;return(e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==c.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t))&&a.test(e)?e.replace(r,d):e}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2479],{72479:(e,t,s)=>{s.r(t),s.d(t,{AttachmentsCell:()=>pe,AttachmentsCellModel:()=>D,Cell:()=>he,CellDragUtils:()=>l,CellFooter:()=>v,CellHeader:()=>_,CellModel:()=>E,CellSearchProvider:()=>z,CodeCell:()=>ce,CodeCellLayout:()=>ue,CodeCellModel:()=>j,Collapser:()=>p,InputArea:()=>w,InputCollapser:()=>g,InputPlaceholder:()=>W,InputPrompt:()=>M,MarkdownCell:()=>ge,MarkdownCellModel:()=>k,OutputCollapser:()=>m,OutputPlaceholder:()=>T,Placeholder:()=>F,RawCell:()=>me,RawCellModel:()=>I,SELECTED_HIGHLIGHT_CLASS:()=>B,createCellSearchProvider:()=>J,isCodeCellModel:()=>b,isMarkdownCellModel:()=>A,isRawCellModel:()=>H});var i=s(24475);const n="jp-dragImage",r="jp-dragImage-singlePrompt",o="jp-dragImage-content",a="jp-dragImage-prompt",d="jp-dragImage-multipleBack";var l;!function(e){e.findCell=function(e,t,s){let i=-1;for(;e&&e.parentElement;){if(s(e)){let s=-1;for(const n of t)if(n.node===e){i=++s;break}break}e=e.parentElement}return i},e.detectTargetArea=function(e,t){var s,i;let n;return n=e?(null===(s=e.editorWidget)||void 0===s?void 0:s.node.contains(t))?"input":(null===(i=e.promptNode)||void 0===i?void 0:i.contains(t))?"prompt":"cell":"unknown",n},e.shouldStartDrag=function(e,t,s,i){const n=Math.abs(s-e),r=Math.abs(i-t);return n>=5||r>=5},e.createCellDragImage=function(e,t){const s=t.length;let l;if("code"===e.model.type){const t=e.model.executionCount;l=" ",t&&(l=t.toString())}else l="";const h=e.model.sharedModel.getSource().split("\n")[0].slice(0,26);return s>1?""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a},"["+l+"]:"),i.h.span({className:o},h)),i.h.div({className:d},""))):i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a}),i.h.span({className:o},h)),i.h.div({className:d},""))):""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${r}`},i.h.span({className:a},"["+l+"]:"),i.h.span({className:o},h)))):i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${r}`},i.h.span({className:a}),i.h.span({className:o},h))))}}(l||(l={}));var h=s(59361),u=s(18395),c=s(78156);class p extends h.ReactWidget{constructor(){super(),this.addClass("jp-Collapser")}get collapsed(){return!1}render(){return c.createElement("div",{className:"jp-Collapser-child",onClick:e=>this.handleClick(e)})}}class g extends p{constructor(){super(),this.addClass("jp-InputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.inputHidden}handleClick(e){var t;const s=null===(t=this.parent)||void 0===t?void 0:t.parent;s&&(s.inputHidden=!s.inputHidden),this.update()}}class m extends p{constructor(){super(),this.addClass("jp-OutputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.outputHidden}handleClick(e){var t,s;const i=null===(t=this.parent)||void 0===t?void 0:t.parent;if(i&&(i.outputHidden=!i.outputHidden,i.outputHidden)){let e=null===(s=i.parent)||void 0===s?void 0:s.node;e&&u.ElementExt.scrollIntoViewIfNeeded(e,i.node)}this.update()}}var C=s(9267);class _ extends C.Widget{constructor(){super(),this.addClass("jp-CellHeader")}}class v extends C.Widget{constructor(){super(),this.addClass("jp-CellFooter")}}var y=s(8434);class w extends C.Widget{constructor(e){super(),this.addClass("jp-InputArea");const{contentFactory:t,editorOptions:s,model:i}=e;this.model=i,this.contentFactory=t;const n=this._prompt=t.createInputPrompt();n.addClass("jp-InputArea-prompt");const r=this._editor=new y.CodeEditorWrapper({factory:t.editorFactory,model:i,editorOptions:s});r.addClass("jp-InputArea-editor");const o=this.layout=new C.PanelLayout;o.addWidget(n),o.addWidget(r)}get editorWidget(){return this._editor}get editor(){return this._editor.editor}get promptNode(){return this._prompt.node}get renderedInput(){return this._rendered}renderInput(e){const t=this.layout;this._rendered&&(this._rendered.parent=null),this._editor.hide(),this._rendered=e,t.addWidget(e)}showEditor(){this._rendered&&(this._rendered.parent=null),this._editor.show()}setPrompt(e){this._prompt.executionCount=e}dispose(){this.isDisposed||(this._prompt=null,this._editor=null,this._rendered=null,super.dispose())}}!function(e){e.ContentFactory=class{constructor(e){this._editor=e.editorFactory}get editorFactory(){return this._editor}createInputPrompt(){return new M}}}(w||(w={}));class M extends C.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-InputPrompt")}get executionCount(){return this._executionCount}set executionCount(e){this._executionCount=e,this.node.textContent=null===e?" ":`[${e||" "}]:`}}var f=s(81997),x=s(91777),P=s(53252),S=s(69688);const O=(0,S.createMutex)();function b(e){return"code"===e.type}function A(e){return"markdown"===e.type}function H(e){return"raw"===e.type}class E extends y.CodeEditor.Model{constructor(e={}){const{cell_type:t,sharedModel:s,...i}=e;super({sharedModel:null!=s?s:(0,S.createStandaloneCell)({cell_type:null!=t?t:"raw",id:e.id}),...i}),this.contentChanged=new f.Signal(this),this.stateChanged=new f.Signal(this),this._metadataChanged=new f.Signal(this),this._trusted=!1,this.standaloneModel=void 0===e.sharedModel,this.trusted=!!this.getMetadata("trusted")||!!e.trusted,this.sharedModel.changed.connect(this.onGenericChange,this),this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get metadataChanged(){return this._metadataChanged}get id(){return this.sharedModel.getId()}get metadata(){return this.sharedModel.metadata}get trusted(){return this._trusted}set trusted(e){const t=this.trusted;t!==e&&(this._trusted=e,this.onTrustedChanged(this,{newValue:e,oldValue:t}))}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this.onGenericChange,this),this.sharedModel.metadataChanged.disconnect(this._onMetadataChanged,this),super.dispose())}onTrustedChanged(e,t){}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){void 0===t?this.sharedModel.deleteMetadata(e):this.sharedModel.setMetadata(e,t)}toJSON(){return this.sharedModel.toJSON()}onGenericChange(){this.contentChanged.emit(void 0)}_onMetadataChanged(e,t){this._metadataChanged.emit(t)}}class D extends E{constructor(e){var t;super(e);const s=null!==(t=e.contentFactory)&&void 0!==t?t:D.defaultContentFactory,i=this.sharedModel.getAttachments();this._attachments=s.createAttachmentsModel({values:i}),this._attachments.stateChanged.connect(this.onGenericChange,this),this._attachments.changed.connect(this._onAttachmentsChange,this),this.sharedModel.changed.connect(this._onSharedModelChanged,this)}get attachments(){return this._attachments}dispose(){this.isDisposed||(this._attachments.stateChanged.disconnect(this.onGenericChange,this),this._attachments.changed.disconnect(this._onAttachmentsChange,this),this._attachments.dispose(),this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),super.dispose())}toJSON(){return super.toJSON()}_onAttachmentsChange(e,t){const s=this.sharedModel;O((()=>s.setAttachments(e.toJSON())))}_onSharedModelChanged(e,t){if(t.attachmentsChange){const e=this.sharedModel;O((()=>{var t;return this._attachments.fromJSON(null!==(t=e.getAttachments())&&void 0!==t?t:{})}))}}}!function(e){class t{createAttachmentsModel(e){return new x.AttachmentsModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(D||(D={}));class I extends D{constructor(e={}){super({cell_type:"raw",...e})}get type(){return"raw"}toJSON(){return super.toJSON()}}class k extends D{constructor(e={}){super({cell_type:"markdown",...e}),this.mimeType="text/x-ipythongfm"}get type(){return"markdown"}toJSON(){return super.toJSON()}}class j extends E{constructor(e={}){var t;super({cell_type:"code",...e}),this._executedCode="",this._isDirty=!1;const s=null!==(t=null==e?void 0:e.contentFactory)&&void 0!==t?t:j.defaultContentFactory,i=this.trusted,n=this.sharedModel.getOutputs();this._outputs=s.createOutputArea({trusted:i,values:n}),this.sharedModel.changed.connect(this._onSharedModelChanged,this),this._outputs.changed.connect(this.onGenericChange,this),this._outputs.changed.connect(this.onOutputsChange,this)}get type(){return"code"}get executionCount(){return this.sharedModel.execution_count||null}set executionCount(e){this.sharedModel.execution_count=e||null}get isDirty(){return this._isDirty}get outputs(){return this._outputs}clearExecution(){this.outputs.clear(),this.executionCount=null,this._setDirty(!1),this.sharedModel.deleteMetadata("execution"),this.trusted=!0}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),this._outputs.changed.disconnect(this.onGenericChange,this),this._outputs.changed.disconnect(this.onOutputsChange,this),this._outputs.dispose(),this._outputs=null,super.dispose())}onTrustedChanged(e,t){const s=t.newValue;if(this._outputs&&(this._outputs.trusted=s),s){const e=this.sharedModel,t=e.getMetadata();t.trusted=!0,e.setMetadata(t)}this.stateChanged.emit({name:"trusted",oldValue:t.oldValue,newValue:s})}toJSON(){return super.toJSON()}onOutputsChange(e,t){const s=this.sharedModel;O((()=>{switch(t.type){case"add":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.newIndex,t.newIndex,e);break}case"set":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.oldIndex,t.oldIndex+e.length,e);break}case"remove":s.updateOutputs(t.oldIndex,t.oldValues.length);break;default:throw new Error(`Invalid event type: ${t.type}`)}}))}_onSharedModelChanged(e,t){t.outputsChange&&O((()=>{this.outputs.clear(),e.getOutputs().forEach((e=>this._outputs.add(e)))})),t.executionCountChange&&(!t.executionCountChange.newValue||!this.isDirty&&t.executionCountChange.oldValue||this._setDirty(!1),this.stateChanged.emit({name:"executionCount",oldValue:t.executionCountChange.oldValue,newValue:t.executionCountChange.newValue})),t.sourceChange&&null!==this.executionCount&&this._setDirty(this._executedCode!==this.sharedModel.getSource().trim())}_setDirty(e){e||(this._executedCode=this.sharedModel.getSource().trim()),e!==this._isDirty&&(this._isDirty=e,this.stateChanged.emit({name:"isDirty",oldValue:!e,newValue:e}))}}!function(e){class t{createOutputArea(e){return new P.OutputAreaModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(j||(j={}));var N=s(49255);class F extends C.Widget{constructor(e){var t,s,i;const n=document.createElement("div");super({node:n});const r=(null!==(t=e.translator)&&void 0!==t?t:N.nullTranslator).load("jupyterlab"),o=document.createElement("div");o.className=null!==(s=e.promptClass)&&void 0!==s?s:"",n.insertAdjacentHTML("afterbegin",o.outerHTML),this._cell=document.createElement("div"),this._cell.classList.add("jp-Placeholder-content"),this._cell.title=r.__("Click to expand");const a=this._cell.appendChild(document.createElement("div"));a.classList.add("jp-Placeholder-contentContainer"),this._textContent=a.appendChild(document.createElement("span")),this._textContent.className="jp-PlaceholderText",this._textContent.innerText=null!==(i=e.text)&&void 0!==i?i:"",n.appendChild(this._cell),h.ellipsesIcon.element({container:a.appendChild(document.createElement("span")),className:"jp-MoreHorizIcon",elementPosition:"center",height:"auto",width:"32px"}),this.addClass("jp-Placeholder"),this._callback=e.callback}set text(e){this._textContent.innerText=e}get text(){return this._textContent.innerText}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this._callback)}onBeforeDetach(e){this.node.removeEventListener("click",this._callback),super.onBeforeDetach(e)}}class W extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-InputPrompt"}),this.addClass("jp-InputPlaceholder")}}class T extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-OutputPrompt"}),this.addClass("jp-OutputPlaceholder")}}var L=s(94682),R=s(85421),V=s(80309);const B="jp-mod-selected";class z extends L.EditorSearchProvider{constructor(e){super(),this.cell=e,this.cell.inViewport||this.cell.editor||(0,R.signalToPromise)(e.inViewportChanged).then((([,e])=>{e&&this.cmHandler.setEditor(this.editor)}))}get editor(){return this.cell.editor}get model(){return this.cell.model}}class U extends z{constructor(e){super(e),this.currentProviderIndex=-1,this.outputsProvider=[];const t=this.cell.outputArea;this._onOutputsChanged(t,t.widgets.length).catch((e=>{console.error("Failed to initialize search on cell outputs.",e)})),t.outputLengthChanged.connect(this._onOutputsChanged,this),t.disposed.connect((()=>{t.outputLengthChanged.disconnect(this._onOutputsChanged)}),this)}get matchesCount(){return this.isActive?super.matchesCount+this.outputsProvider.reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0):0}async clearHighlight(){await super.clearHighlight(),await Promise.all(this.outputsProvider.map((e=>e.clearHighlight())))}dispose(){this.isDisposed||(super.dispose(),this.outputsProvider.map((e=>{e.dispose()})),this.outputsProvider.length=0)}async highlightNext(e,t){if(0!==this.matchesCount&&this.isActive){if(-1===this.currentProviderIndex){const e=await super.highlightNext(!0,t);if(e)return this.currentIndex=this.cmHandler.currentIndex,e;this.currentProviderIndex=0}for(;this.currentProviderIndex<this.outputsProvider.length;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightNext(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex+=1}return this.currentProviderIndex=-1,void(this.currentIndex=null)}this.currentIndex=null}async highlightPrevious(){if(0!==this.matchesCount&&this.isActive){for(null===this.currentIndex&&(this.currentProviderIndex=this.outputsProvider.length-1);this.currentProviderIndex>=0;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightPrevious(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex-=1}const e=await super.highlightPrevious();return e?(this.currentIndex=this.cmHandler.currentIndex,e):void(this.currentIndex=null)}this.currentIndex=null}async startQuery(e,t){await super.startQuery(e,t),!1!==(null==t?void 0:t.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((t=>t.startQuery(e))))}async endQuery(){var e;await super.endQuery(),!1!==(null===(e=this.filters)||void 0===e?void 0:e.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((e=>e.endQuery())))}async _onOutputsChanged(e,t){var s;this.outputsProvider.forEach((e=>{e.dispose()})),this.outputsProvider.length=0,this.currentProviderIndex=-1,this.outputsProvider=this.cell.outputArea.widgets.map((e=>new V.GenericSearchProvider(e))),this.isActive&&this.query&&!1!==(null===(s=this.filters)||void 0===s?void 0:s.output)&&await Promise.all([this.outputsProvider.map((e=>{e.startQuery(this.query)}))]),this._stateChanged.emit()}}class $ extends z{constructor(e){super(e),this._unrenderedByHighligh=!1,this.renderedProvider=new V.GenericSearchProvider(e.renderer)}async clearHighlight(){await super.clearHighlight(),await this.renderedProvider.clearHighlight()}dispose(){this.isDisposed||(super.dispose(),this.renderedProvider.dispose())}async endQuery(){await super.endQuery(),await this.renderedProvider.endQuery()}async highlightNext(){let e;if(!this.isActive)return e;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighligh=!0;const e=(0,R.signalToPromise)(t.renderedChanged);t.rendered=!1,await e}return e=await super.highlightNext(),e}async highlightPrevious(){let e;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighligh=!0;const e=(0,R.signalToPromise)(t.renderedChanged);t.rendered=!1,await e}return e=await super.highlightPrevious(),e}async startQuery(e,t){await super.startQuery(e,t);const s=this.cell;s.rendered&&this.onRenderedChanged(s,s.rendered),s.renderedChanged.connect(this.onRenderedChanged,this)}async replaceAllMatches(e){const t=await super.replaceAllMatches(e);return this.cell.rendered&&this.cell.update(),t}onRenderedChanged(e,t){var s;this._unrenderedByHighligh||(this.currentIndex=null),this._unrenderedByHighligh=!1,this.isActive&&(t?this.renderedProvider.startQuery(this.query):(null===(s=e.editor)||void 0===s||s.setCursorPosition({column:0,line:0}),this.renderedProvider.endQuery()))}}function J(e){if(e.isPlaceholder())return new z(e);switch(e.model.type){case"code":return new U(e);case"markdown":return new $(e);default:return new z(e)}}var Q=s(19768),G=s(42628),q=s(16698),X=s(20998),Y=s(33625),K=s(49503),Z=s(97934);const ee="jp-mod-resizedCell";class te extends C.Widget{constructor(e){super(),this.targetNode=e,this._isActive=!1,this._isDragging=!1,this.addClass("jp-CellResizeHandle"),this._resizer=new Z.Throttler((e=>this._resize(e)),50)}dispose(){this._resizer.dispose(),super.dispose()}handleEvent(e){var t,s;switch(e.type){case"dblclick":null===(t=this.targetNode.parentNode)||void 0===t||t.childNodes.forEach((e=>{e.classList.remove(ee)})),document.documentElement.style.setProperty("--jp-side-by-side-output-size","1fr"),this._isActive=!1;break;case"mousedown":this._isDragging=!0,this._isActive||(null===(s=this.targetNode.parentNode)||void 0===s||s.childNodes.forEach((e=>{e.classList.add(ee)})),this._isActive=!0),window.addEventListener("mousemove",this),window.addEventListener("mouseup",this);break;case"mousemove":this._isActive&&this._isDragging&&this._resizer.invoke(e);break;case"mouseup":this._isDragging=!1,window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this)}}onAfterAttach(e){this.node.addEventListener("dblclick",this),this.node.addEventListener("mousedown",this),super.onAfterAttach(e)}onBeforeDetach(e){this.node.removeEventListener("dblclick",this),this.node.removeEventListener("mousedown",this),super.onBeforeDetach(e)}_resize(e){const{width:t,x:s}=this.targetNode.getBoundingClientRect(),i=t/(e.clientX-s)-1;if(0<i){const e=Math.max(Math.min(Math.abs(i),50),.05);document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`)}}}const se="jp-Cell-outputWrapper",ie="jp-mod-dirty",ne="jp-MarkdownHeadingCollapsed",re="jp-collapseHeadingButton",oe="jp-showHiddenCellsButton",ae="jp-mod-rendered",de="jp-mod-noOutputs",le="application/x-jupyter-icontentsrich";class he extends C.Widget{constructor(e){var t,s,i,n;super(),this.prompt="",this._displayChanged=new f.Signal(this),this._editorConfig={},this._inputHidden=!1,this._inViewportChanged=new f.Signal(this),this._readOnly=!1,this._ready=new X.PromiseDelegate,this._resizeDebouncer=new Z.Debouncer((()=>{this._displayChanged.emit()}),0),this._syncCollapse=!1,this._syncEditable=!1,this.addClass("jp-Cell");const r=this._model=e.model;this.contentFactory=e.contentFactory,this.layout=null!==(t=e.layout)&&void 0!==t?t:new C.PanelLayout,this.translator=null!==(s=e.translator)&&void 0!==s?s:N.nullTranslator,this._editorConfig=null!==(i=e.editorConfig)&&void 0!==i?i:{},this._placeholder=!0,this._inViewport=!1,this.placeholder=null===(n=e.placeholder)||void 0===n||n,r.metadataChanged.connect(this.onMetadataChanged,this)}initializeState(){return this.loadCollapseState(),this.loadEditableState(),this}get displayChanged(){return this._displayChanged}get inViewport(){return this._inViewport}set inViewport(e){this._inViewport!==e&&(this._inViewport=e,this._inViewportChanged.emit(this._inViewport))}get inViewportChanged(){return this._inViewportChanged}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&!1===e&&(this.initializeDOM(),this._placeholder=e,this._ready.resolve())}get promptNode(){return this.placeholder?null:this._inputHidden?this._inputPlaceholder.node.firstElementChild:this._input.promptNode}get editorWidget(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editorWidget)&&void 0!==t?t:null}get editor(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editor)&&void 0!==t?t:null}get editorConfig(){return this._editorConfig}get headings(){return new Array}get model(){return this._model}get inputArea(){return this._input}get readOnly(){return this._readOnly}set readOnly(e){e!==this._readOnly&&(this._readOnly=e,this.syncEditable&&this.saveEditableState(),this.update())}isPlaceholder(){return this.placeholder}saveEditableState(){const{sharedModel:e}=this.model,t=e.getMetadata("editable");this.readOnly&&!1===t||!this.readOnly&&void 0===t||(this.readOnly?e.setMetadata("editable",!1):e.deleteMetadata("editable"))}loadEditableState(){this.readOnly=!1===this.model.sharedModel.getMetadata("editable")}get ready(){return this._ready.promise}setPrompt(e){var t;this.prompt=e,null===(t=this._input)||void 0===t||t.setPrompt(e)}get inputHidden(){return this._inputHidden}set inputHidden(e){var t;if(this._inputHidden!==e){if(!this.placeholder){const s=this._inputWrapper.layout;e?(this._input.parent=null,this._inputPlaceholder&&(this._inputPlaceholder.text=null===(t=this.model.sharedModel.getSource().split("\n"))||void 0===t?void 0:t[0]),s.addWidget(this._inputPlaceholder)):(this._inputPlaceholder.parent=null,s.addWidget(this._input))}this._inputHidden=e,this.syncCollapse&&this.saveCollapseState(),this.handleInputHidden(e)}}saveCollapseState(){const e={...this.model.getMetadata("jupyter")};this.inputHidden&&!0===e.source_hidden||!this.inputHidden&&void 0===e.source_hidden||(this.inputHidden?e.source_hidden=!0:delete e.source_hidden,0===Object.keys(e).length?this.model.deleteMetadata("jupyter"):this.model.setMetadata("jupyter",e))}loadCollapseState(){var e;const t=null!==(e=this.model.getMetadata("jupyter"))&&void 0!==e?e:{};this.inputHidden=!!t.source_hidden}handleInputHidden(e){}get syncCollapse(){return this._syncCollapse}set syncCollapse(e){this._syncCollapse!==e&&(this._syncCollapse=e,e&&this.loadCollapseState())}get syncEditable(){return this._syncEditable}set syncEditable(e){this._syncEditable!==e&&(this._syncEditable=e,e&&this.loadEditableState())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}dispose(){this.isDisposed||(this._resizeDebouncer.dispose(),this._input=null,this._model=null,this._inputWrapper=null,this._inputPlaceholder=null,super.dispose())}updateEditorConfig(e){this._editorConfig={...this._editorConfig,...e},this.editor&&this.editor.setOptions(this._editorConfig)}initializeDOM(){if(!this.placeholder)return;const e=this.contentFactory,t=this._model,s=e.createCellHeader();s.addClass("jp-Cell-header"),this.layout.addWidget(s);const i=this._inputWrapper=new C.Panel;i.addClass("jp-Cell-inputWrapper");const n=new g;n.addClass("jp-Cell-inputCollapser");const r=this._input=new w({model:t,contentFactory:e,editorOptions:this.getEditorOptions()});r.addClass("jp-Cell-inputArea"),i.addWidget(n),i.addWidget(r),this.layout.addWidget(i),this._inputPlaceholder=new W({callback:()=>{this.inputHidden=!this.inputHidden},text:r.model.sharedModel.getSource().split("\n")[0],translator:this.translator}),r.model.contentChanged.connect(((e,t)=>{var s;this._inputPlaceholder&&this.inputHidden&&(this._inputPlaceholder.text=null===(s=e.sharedModel.getSource().split("\n"))||void 0===s?void 0:s[0])})),this.inputHidden&&(r.parent=null,i.layout.addWidget(this._inputPlaceholder));const o=this.contentFactory.createCellFooter();o.addClass("jp-Cell-footer"),this.layout.addWidget(o)}getEditorOptions(){return{config:this.editorConfig}}onBeforeAttach(e){this.placeholder&&(this.placeholder=!1)}onAfterAttach(e){this.update()}onActivateRequest(e){var t;null===(t=this.editor)||void 0===t||t.focus()}onResize(e){this._resizeDebouncer.invoke()}onUpdateRequest(e){var t,s;this._model&&(null===(t=this.editor)||void 0===t?void 0:t.getOption("readOnly"))!==this._readOnly&&(null===(s=this.editor)||void 0===s||s.setOption("readOnly",this._readOnly))}onContentChanged(){var e;this.inputHidden&&this._inputPlaceholder&&(this._inputPlaceholder.text=null===(e=this.model.sharedModel.getSource().split("\n"))||void 0===e?void 0:e[0])}onMetadataChanged(e,t){switch(t.key){case"jupyter":this.syncCollapse&&this.loadCollapseState();break;case"editable":this.syncEditable&&this.loadEditableState()}}}!function(e){let t;!function(e){e[e.HTML=0]="HTML",e[e.Markdown=1]="Markdown"}(t=e.HeadingType||(e.HeadingType={})),e.ContentFactory=class{constructor(e){this._editorFactory=e.editorFactory}get editorFactory(){return this._editorFactory}createCellHeader(){return new _}createCellFooter(){return new v}createInputPrompt(){return new M}createOutputPrompt(){return new P.OutputPrompt}createStdin(e){return new P.Stdin(e)}}}(he||(he={}));class ue extends C.PanelLayout{onBeforeAttach(e){let t=!0;const s=this.parent.node.firstElementChild;for(const i of this)s&&(i.node===s?t=!1:(K.MessageLoop.sendMessage(i,e),t?this.parent.node.insertBefore(i.node,s):this.parent.node.appendChild(i.node),this.parent.isHidden||i.setFlag(C.Widget.Flag.IsVisible),K.MessageLoop.sendMessage(i,C.Widget.Msg.AfterAttach)))}onAfterDetach(e){for(const t of this)!t.hasClass(se)&&t.node.isConnected&&(K.MessageLoop.sendMessage(t,C.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),K.MessageLoop.sendMessage(t,e))}}class ce extends he{constructor(e){var t;super({layout:new ue,...e,placeholder:!0}),this._headingsCache=null,this._outputHidden=!1,this._outputWrapper=null,this._outputPlaceholder=null,this._syncScrolled=!1,this.addClass("jp-CodeCell");const s=this.translator.load("jupyterlab"),i=this._rendermime=e.rendermime,n=this.contentFactory,r=this.model;this.maxNumberOutputs=e.maxNumberOutputs;const o=0===r.outputs.length?s.__("Code Cell Content"):s.__("Code Cell Content with Output");this.node.setAttribute("aria-label",o);const a=this._output=new P.OutputArea({model:this.model.outputs,rendermime:i,contentFactory:n,maxNumberOutputs:this.maxNumberOutputs,translator:this.translator,promptOverlay:!0,inputHistoryScope:e.inputHistoryScope});a.addClass("jp-Cell-outputArea"),a.toggleScrolling.connect((()=>{this.outputsScrolled=!this.outputsScrolled})),this.placeholder=null===(t=e.placeholder)||void 0===t||t,r.outputs.changed.connect(this.onOutputChanged,this),r.outputs.stateChanged.connect(this.onOutputChanged,this),r.stateChanged.connect(this.onStateChanged,this)}initializeDOM(){if(!this.placeholder)return;super.initializeDOM(),this.setPrompt(this.prompt);const e=this._outputWrapper=new C.Panel;e.addClass(se);const t=new m;t.addClass("jp-Cell-outputCollapser"),e.addWidget(t),0===this.model.outputs.length&&this.addClass(de),this._output.outputLengthChanged.connect(this._outputLengthHandler,this),e.addWidget(this._output);const s=this.layout;s.insertWidget(s.widgets.length-1,new te(this.node)),s.insertWidget(s.widgets.length-1,e),this.model.isDirty&&this.addClass(ie),this._outputPlaceholder=new T({callback:()=>{this.outputHidden=!this.outputHidden},text:this.getOutputPlaceholderText(),translator:this.translator});const i=e.layout;this.outputHidden&&(i.removeWidget(this._output),i.addWidget(this._outputPlaceholder),this.inputHidden&&!e.isHidden&&this._outputWrapper.hide());const n=this.translator.load("jupyterlab"),r=0===this.model.outputs.length?n.__("Code Cell Content"):n.__("Code Cell Content with Output");this.node.setAttribute("aria-label",r)}getOutputPlaceholderText(){var e;const t=this.model.outputs.get(0);if(!(null==t?void 0:t.data))return;const s=["text/html","image/svg+xml","application/pdf","text/markdown","text/plain","application/vnd.jupyter.stderr","application/vnd.jupyter.stdout","text"].find((e=>{const s=t.data[e];return"string"==(Array.isArray(s)?typeof s[0]:typeof s)})),i=t.data[null!=s?s:""];return void 0!==i?null===(e=Array.isArray(i)?i:null==i?void 0:i.split("\n"))||void 0===e?void 0:e.find((e=>""!==e)):void 0}initializeState(){return super.initializeState(),this.loadScrolledState(),this.setPrompt(`${this.model.executionCount||""}`),this}get headings(){if(!this._headingsCache){const e=[],t=this.model.outputs;for(let s=0;s<t.length;s++){const i=t.get(s);let n=null,r=null;Object.keys(i.data).forEach((e=>{!r&&q.TableOfContentsUtils.Markdown.isMarkdown(e)?r=e:!n&&q.TableOfContentsUtils.isHTML(e)&&(n=e)})),n?e.push(...q.TableOfContentsUtils.getHTMLHeadings(this._rendermime.sanitizer.sanitize(i.data[n])).map((e=>({...e,outputIndex:s,type:he.HeadingType.HTML})))):r&&e.push(...q.TableOfContentsUtils.Markdown.getHeadings(i.data[r]).map((e=>({...e,outputIndex:s,type:he.HeadingType.Markdown}))))}this._headingsCache=e}return[...this._headingsCache]}get outputArea(){return this._output}get outputHidden(){return this._outputHidden}set outputHidden(e){var t;if(this._outputHidden!==e){if(!this.placeholder){const s=this._outputWrapper.layout;e?(s.removeWidget(this._output),s.addWidget(this._outputPlaceholder),this.inputHidden&&!this._outputWrapper.isHidden&&this._outputWrapper.hide(),this._outputPlaceholder&&(this._outputPlaceholder.text=null!==(t=this.getOutputPlaceholderText())&&void 0!==t?t:"")):(this._outputWrapper.isHidden&&this._outputWrapper.show(),s.removeWidget(this._outputPlaceholder),s.addWidget(this._output))}this._outputHidden=e,this.syncCollapse&&this.saveCollapseState()}}saveCollapseState(){this.model.sharedModel.transact((()=>{super.saveCollapseState();const e=this.model.getMetadata("collapsed");this.outputHidden&&!0===e||!this.outputHidden&&void 0===e||(this.outputHidden?this.model.setMetadata("collapsed",!0):this.model.deleteMetadata("collapsed"))}),!1)}loadCollapseState(){super.loadCollapseState(),this.outputHidden=!!this.model.getMetadata("collapsed")}get outputsScrolled(){return this._outputsScrolled}set outputsScrolled(e){this.toggleClass("jp-mod-outputsScrolled",e),this._outputsScrolled=e,this.syncScrolled&&this.saveScrolledState()}saveScrolledState(){const e=this.model.getMetadata("scrolled");this.outputsScrolled&&!0===e||!this.outputsScrolled&&void 0===e||(this.outputsScrolled?this.model.setMetadata("scrolled",!0):this.model.deleteMetadata("scrolled"))}loadScrolledState(){"auto"===this.model.getMetadata("scrolled")?this.outputsScrolled=!1:this.outputsScrolled=!!this.model.getMetadata("scrolled")}get syncScrolled(){return this._syncScrolled}set syncScrolled(e){this._syncScrolled!==e&&(this._syncScrolled=e,e&&this.loadScrolledState())}handleInputHidden(e){this.placeholder||(!e&&this._outputWrapper.isHidden?this._outputWrapper.show():e&&!this._outputWrapper.isHidden&&this._outputHidden&&this._outputWrapper.hide())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}cloneOutputArea(){return new P.SimplifiedOutputArea({model:this.model.outputs,contentFactory:this.contentFactory,rendermime:this._rendermime})}dispose(){this.isDisposed||(this._output.outputLengthChanged.disconnect(this._outputLengthHandler,this),this._rendermime=null,this._output=null,this._outputWrapper=null,this._outputPlaceholder=null,super.dispose())}onStateChanged(e,t){switch(t.name){case"executionCount":this.setPrompt(`${e.executionCount||""}`);break;case"isDirty":e.isDirty?this.addClass(ie):this.removeClass(ie)}}onOutputChanged(){var e;this._headingsCache=null,this._outputPlaceholder&&this.outputHidden&&(this._outputPlaceholder.text=null!==(e=this.getOutputPlaceholderText())&&void 0!==e?e:"")}onMetadataChanged(e,t){switch(t.key){case"scrolled":this.syncScrolled&&this.loadScrolledState();break;case"collapsed":this.syncCollapse&&this.loadCollapseState()}super.onMetadataChanged(e,t)}_outputLengthHandler(e,t){const s=0===t;this.toggleClass(de,s);const i=this.translator.load("jupyterlab"),n=s?i.__("Code Cell Content"):i.__("Code Cell Content with Output");this.node.setAttribute("aria-label",n)}}!function(e){e.execute=async function(e,t,s){var i;const n=e.model,r=n.sharedModel.getSource();if(!r.trim()||!(null===(i=t.session)||void 0===i?void 0:i.kernel))return void n.sharedModel.transact((()=>{n.clearExecution()}),!1);const o={cellId:n.sharedModel.getId()};s={...n.metadata,...s,...o};const{recordTiming:a}=s;let d;n.sharedModel.transact((()=>{n.clearExecution(),e.outputHidden=!1}),!1),e.setPrompt("*"),n.trusted=!0;try{const i=P.OutputArea.execute(r,e.outputArea,t,s);if(a){const t=e=>{let t;switch(e.header.msg_type){case"status":t=`status.${e.content.execution_state}`;break;case"execute_input":t="execute_input";break;default:return!0}const s=e.header.date||(new Date).toISOString(),i=Object.assign({},n.getMetadata("execution"));return i[`iopub.${t}`]=s,n.setMetadata("execution",i),!0};e.outputArea.future.registerMessageHook(t)}else n.deleteMetadata("execution");d=e.outputArea.future;const o=await i;if(n.executionCount=o.content.execution_count,a){const e=Object.assign({},n.getMetadata("execution")),t=o.metadata.started;t&&(e["shell.execute_reply.started"]=t);const s=o.header.date;e["shell.execute_reply"]=s||(new Date).toISOString(),n.setMetadata("execution",e)}return o}catch(t){throw d&&!e.isDisposed&&e.outputArea.future===d&&e.setPrompt(""),t}}}(ce||(ce={}));class pe extends he{handleEvent(e){switch(e.type){case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e)}}getEditorOptions(){var e,t;const s=null!==(e=super.getEditorOptions())&&void 0!==e?e:{};return s.extensions=[...null!==(t=s.extensions)&&void 0!==t?t:[],Q.EditorView.domEventHandlers({dragenter:e=>{e.preventDefault()},dragover:e=>{e.preventDefault()},drop:e=>{this._evtNativeDrop(e)},paste:e=>{this._evtPaste(e)}})],s}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("lm-dragover",this),t.addEventListener("lm-drop",this)}onBeforeDetach(e){const t=this.node;t.removeEventListener("lm-dragover",this),t.removeEventListener("lm-drop",this),super.onBeforeDetach(e)}_evtDragOver(e){(0,Y.some)(G.imageRendererFactory.mimeTypes,(t=>!!e.mimeData.hasData(le)&&e.mimeData.getData(le).model.mimetype===t))&&(e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction)}_evtPaste(e){if(e.clipboardData){const t=e.clipboardData.items;for(let s=0;s<t.length;s++){if("text/plain"===t[s].type){if(s<t.length-1&&"file"===t[s+1].kind)continue;t[s].getAsString((e=>{var t,s;null===(s=(t=this.editor).replaceSelection)||void 0===s||s.call(t,e)}))}this._attachFiles(e.clipboardData.items)}}e.preventDefault()}_evtNativeDrop(e){e.dataTransfer&&this._attachFiles(e.dataTransfer.items),e.preventDefault()}_evtDrop(e){const t=e.mimeData.types().filter((t=>{if(t===le){const t=e.mimeData.getData(le);return-1!==G.imageRendererFactory.mimeTypes.indexOf(t.model.mimetype)}return-1!==G.imageRendererFactory.mimeTypes.indexOf(t)}));if(0!==t.length)if(e.preventDefault(),e.stopPropagation(),"none"!==e.proposedAction){e.dropAction="copy";for(const s of t)if(s===le){const{model:t,withContent:s}=e.mimeData.getData(le);if("file"===t.type){const e=this._generateURI(t.name);this.updateCellSourceWithAttachment(t.name,e),s().then((t=>{this.model.attachments.set(e,{[t.mimetype]:t.content})}))}}else{const t=this._generateURI();this.model.attachments.set(t,{[s]:e.mimeData.getData(s)}),this.updateCellSourceWithAttachment(t,t)}}else e.dropAction="none"}_attachFiles(e){for(let t=0;t<e.length;t++){const s=e[t];if("file"===s.kind){const e=s.getAsFile();e&&this._attachFile(e)}}}_attachFile(e){const t=new FileReader;t.onload=s=>{const{href:i,protocol:n}=R.URLExt.parse(t.result);if("data:"!==n)return;const r=/([\w+\/\+]+)?(?:;(charset=[\w\d-]*|base64))?,(.*)/.exec(i);if(!r||4!==r.length)return;const o=r[1],a={[o]:r[3]},d=this._generateURI(e.name);o.startsWith("image/")&&(this.model.attachments.set(d,a),this.updateCellSourceWithAttachment(e.name,d))},t.onerror=t=>{console.error(`Failed to attach ${e.name}`+t)},t.readAsDataURL(e)}_generateURI(e=""){const t=e.lastIndexOf(".");return-1!==t?X.UUID.uuid4().concat(e.substring(t)):X.UUID.uuid4()}}class ge extends pe{constructor(e){var t,s,i,n;super({...e,placeholder:!0}),this._headingsCache=null,this._headingCollapsedChanged=new f.Signal(this),this._prevText="",this._rendered=!0,this._renderedChanged=new f.Signal(this),this._showEditorForReadOnlyMarkdown=!0,this.addClass("jp-MarkdownCell"),this.model.contentChanged.connect(this.onContentChanged,this);const r=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",r.__("Markdown Cell Content")),this._rendermime=e.rendermime.clone({resolver:new x.AttachmentsResolver({parent:null!==(t=e.rendermime.resolver)&&void 0!==t?t:void 0,model:this.model.attachments})}),this._renderer=this._rendermime.createRenderer("text/markdown"),this._renderer.addClass("jp-MarkdownOutput"),this._headingCollapsed=null!==(s=this.model.getMetadata(ne))&&void 0!==s&&s,this._showEditorForReadOnlyMarkdown=null!==(i=e.showEditorForReadOnlyMarkdown)&&void 0!==i?i:ge.defaultShowEditorForReadOnlyMarkdown,this.placeholder=null===(n=e.placeholder)||void 0===n||n,this._monitor=new R.ActivityMonitor({signal:this.model.contentChanged,timeout:1e3}),this.ready.then((()=>{this.isDisposed||this._monitor.activityStopped.connect((()=>{this._rendered&&this.update()}),this)})).catch((e=>{console.error("Failed to be ready",e)}))}get headingInfo(){const e=this.headings;if(e.length>0){const{text:t,level:s}=e.reduce(((e,t)=>e.level<=t.level?e:t),e[0]);return{text:t,level:s}}return{text:"",level:-1}}get headings(){if(!this._headingsCache){const e=q.TableOfContentsUtils.Markdown.getHeadings(this.model.sharedModel.getSource());this._headingsCache=e.map((e=>({...e,type:he.HeadingType.Markdown})))}return[...this._headingsCache]}get headingCollapsed(){return this._headingCollapsed}set headingCollapsed(e){var t;if(this._headingCollapsed!==e){this._headingCollapsed=e,e?this.model.setMetadata(ne,e):"undefined"!==this.model.getMetadata(ne)&&this.model.deleteMetadata(ne);const s=null===(t=this.inputArea)||void 0===t?void 0:t.promptNode.getElementsByClassName(re)[0];s&&(e?s.classList.add("jp-mod-collapsed"):s.classList.remove("jp-mod-collapsed")),this.renderCollapseButtons(this._renderer),this._headingCollapsedChanged.emit(this._headingCollapsed)}}get numberChildNodes(){return this._numberChildNodes}set numberChildNodes(e){this._numberChildNodes=e,this.renderCollapseButtons(this._renderer)}get headingCollapsedChanged(){return this._headingCollapsedChanged}get rendered(){return this._rendered}set rendered(e){this.readOnly&&!1===this._showEditorForReadOnlyMarkdown&&(e=!0),e!==this._rendered&&(this._rendered=e,this._handleRendered().then((()=>{this._displayChanged.emit(),this._renderedChanged.emit(this._rendered)})).catch((e=>{console.error("Failed to render",e)})))}get renderedChanged(){return this._renderedChanged}get showEditorForReadOnly(){return this._showEditorForReadOnlyMarkdown}set showEditorForReadOnly(e){this._showEditorForReadOnlyMarkdown=e,!1===e&&(this.rendered=!0)}get renderer(){return this._renderer}dispose(){this.isDisposed||(this._monitor.dispose(),super.dispose())}initializeDOM(){this.placeholder&&(super.initializeDOM(),this.renderCollapseButtons(this._renderer),this._handleRendered().catch((e=>{console.error("Failed to render",e)})))}maybeCreateCollapseButton(){var e;const{level:t}=this.headingInfo;if(t>0&&0==(null===(e=this.inputArea)||void 0===e?void 0:e.promptNode.getElementsByClassName(re).length)){let e=this.inputArea.promptNode.appendChild(document.createElement("button"));e.className=`jp-Button ${re}`,e.setAttribute("data-heading-level",t.toString()),this._headingCollapsed?e.classList.add("jp-mod-collapsed"):e.classList.remove("jp-mod-collapsed"),e.onclick=e=>{this.headingCollapsed=!this.headingCollapsed}}}maybeCreateOrUpdateExpandButton(){const e=this.node.getElementsByClassName(oe);let t=this.translator.load("jupyterlab")._n("%1 cell hidden","%1 cells hidden",this._numberChildNodes);if(this.headingCollapsed&&this._numberChildNodes>0&&0==e.length){const e=document.createElement("button");e.className=`jp-mod-minimal jp-Button ${oe}`,h.addIcon.render(e);const s=document.createElement("div");s.textContent=t,e.appendChild(s),e.onclick=()=>{this.headingCollapsed=!1},this.node.appendChild(e)}if(this.headingCollapsed&&this._numberChildNodes>0&&1==e.length&&(e[0].childNodes[1].textContent=t),!(this.headingCollapsed&&this._numberChildNodes>0))for(const t of e)this.node.removeChild(t)}onContentChanged(){super.onContentChanged(),this._headingsCache=null}renderCollapseButtons(e){this.node.classList.toggle(ne,this._headingCollapsed),this.maybeCreateCollapseButton(),this.maybeCreateOrUpdateExpandButton()}renderInput(e){this.addClass(ae),this.placeholder||this.isDisposed||(this.renderCollapseButtons(e),this.inputArea.renderInput(e))}showEditor(){if(this.removeClass(ae),!this.placeholder&&!this.isDisposed){this.inputArea.showEditor();let e=(this.model.sharedModel.getSource().match(/^#+/g)||[""])[0].length;e>0&&this.inputArea.editor.setCursorPosition({column:e+1,line:0})}}onUpdateRequest(e){this._handleRendered().catch((e=>{console.error("Failed to render",e)})),super.onUpdateRequest(e)}updateCellSourceWithAttachment(e,t){var s,i;const n=`![${e}](attachment:${null!=t?t:e})`;null===(i=null===(s=this.editor)||void 0===s?void 0:s.replaceSelection)||void 0===i||i.call(s,n)}async _handleRendered(){this._rendered?(await this._updateRenderedInput(),this._rendered&&this.renderInput(this._renderer)):this.showEditor()}_updateRenderedInput(){if(this.placeholder)return Promise.resolve();const e=this.model,t=e&&e.sharedModel.getSource()||"Type Markdown and LaTeX: $ α^2 $";if(t!==this._prevText){const e=new G.MimeModel({data:{"text/markdown":t}});return this._prevText=t,this._renderer.renderModel(e)}return Promise.resolve()}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}}!function(e){e.defaultShowEditorForReadOnlyMarkdown=!0}(ge||(ge={}));class me extends he{constructor(e){super(e),this.addClass("jp-RawCell");const t=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",t.__("Raw Cell Content"))}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2479],{72479:(e,t,s)=>{s.r(t),s.d(t,{AttachmentsCell:()=>pe,AttachmentsCellModel:()=>D,Cell:()=>he,CellDragUtils:()=>l,CellFooter:()=>v,CellHeader:()=>_,CellModel:()=>E,CellSearchProvider:()=>B,CodeCell:()=>ce,CodeCellLayout:()=>ue,CodeCellModel:()=>j,Collapser:()=>p,InputArea:()=>w,InputCollapser:()=>g,InputPlaceholder:()=>W,InputPrompt:()=>M,MarkdownCell:()=>ge,MarkdownCellModel:()=>k,OutputCollapser:()=>m,OutputPlaceholder:()=>T,Placeholder:()=>F,RawCell:()=>me,RawCellModel:()=>I,SELECTED_HIGHLIGHT_CLASS:()=>z,createCellSearchProvider:()=>J,isCodeCellModel:()=>b,isMarkdownCellModel:()=>A,isRawCellModel:()=>H});var i=s(24475);const n="jp-dragImage",r="jp-dragImage-singlePrompt",o="jp-dragImage-content",a="jp-dragImage-prompt",d="jp-dragImage-multipleBack";var l;!function(e){e.findCell=function(e,t,s){let i=-1;for(;e&&e.parentElement;){if(s(e)){let s=-1;for(const n of t)if(n.node===e){i=++s;break}break}e=e.parentElement}return i},e.detectTargetArea=function(e,t){var s,i;let n;return n=e?(null===(s=e.editorWidget)||void 0===s?void 0:s.node.contains(t))?"input":(null===(i=e.promptNode)||void 0===i?void 0:i.contains(t))?"prompt":"cell":"unknown",n},e.shouldStartDrag=function(e,t,s,i){const n=Math.abs(s-e),r=Math.abs(i-t);return n>=5||r>=5},e.createCellDragImage=function(e,t){const s=t.length;let l;if("code"===e.model.type){const t=e.model.executionCount;l=" ",t&&(l=t.toString())}else l="";const h=e.model.sharedModel.getSource().split("\n")[0].slice(0,26);return s>1?""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a},"["+l+"]:"),i.h.span({className:o},h)),i.h.div({className:d},""))):i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a}),i.h.span({className:o},h)),i.h.div({className:d},""))):""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${r}`},i.h.span({className:a},"["+l+"]:"),i.h.span({className:o},h)))):i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${r}`},i.h.span({className:a}),i.h.span({className:o},h))))}}(l||(l={}));var h=s(90710),u=s(18395),c=s(78156);class p extends h.ReactWidget{constructor(){super(),this.addClass("jp-Collapser")}get collapsed(){return!1}render(){return c.createElement("div",{className:"jp-Collapser-child",onClick:e=>this.handleClick(e)})}}class g extends p{constructor(){super(),this.addClass("jp-InputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.inputHidden}handleClick(e){var t;const s=null===(t=this.parent)||void 0===t?void 0:t.parent;s&&(s.inputHidden=!s.inputHidden),this.update()}}class m extends p{constructor(){super(),this.addClass("jp-OutputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.outputHidden}handleClick(e){var t,s;const i=null===(t=this.parent)||void 0===t?void 0:t.parent;if(i&&(i.outputHidden=!i.outputHidden,i.outputHidden)){let e=null===(s=i.parent)||void 0===s?void 0:s.node;e&&u.ElementExt.scrollIntoViewIfNeeded(e,i.node)}this.update()}}var C=s(9267);class _ extends C.Widget{constructor(){super(),this.addClass("jp-CellHeader")}}class v extends C.Widget{constructor(){super(),this.addClass("jp-CellFooter")}}var y=s(69384);class w extends C.Widget{constructor(e){super(),this.addClass("jp-InputArea");const{contentFactory:t,editorOptions:s,model:i}=e;this.model=i,this.contentFactory=t;const n=this._prompt=t.createInputPrompt();n.addClass("jp-InputArea-prompt");const r=this._editor=new y.CodeEditorWrapper({factory:t.editorFactory,model:i,editorOptions:s});r.addClass("jp-InputArea-editor");const o=this.layout=new C.PanelLayout;o.addWidget(n),o.addWidget(r)}get editorWidget(){return this._editor}get editor(){return this._editor.editor}get promptNode(){return this._prompt.node}get renderedInput(){return this._rendered}renderInput(e){const t=this.layout;this._rendered&&(this._rendered.parent=null),this._editor.hide(),this._rendered=e,t.addWidget(e)}showEditor(){this._rendered&&(this._rendered.parent=null),this._editor.show()}setPrompt(e){this._prompt.executionCount=e}dispose(){this.isDisposed||(this._prompt=null,this._editor=null,this._rendered=null,super.dispose())}}!function(e){e.ContentFactory=class{constructor(e){this._editor=e.editorFactory}get editorFactory(){return this._editor}createInputPrompt(){return new M}}}(w||(w={}));class M extends C.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-InputPrompt")}get executionCount(){return this._executionCount}set executionCount(e){this._executionCount=e,this.node.textContent=null===e?" ":`[${e||" "}]:`}}var f=s(81997),x=s(5079),P=s(90363),S=s(23781);const O=(0,S.createMutex)();function b(e){return"code"===e.type}function A(e){return"markdown"===e.type}function H(e){return"raw"===e.type}class E extends y.CodeEditor.Model{constructor(e={}){const{cell_type:t,sharedModel:s,...i}=e;super({sharedModel:null!=s?s:(0,S.createStandaloneCell)({cell_type:null!=t?t:"raw",id:e.id}),...i}),this.contentChanged=new f.Signal(this),this.stateChanged=new f.Signal(this),this._metadataChanged=new f.Signal(this),this._trusted=!1,this.standaloneModel=void 0===e.sharedModel,this.trusted=!!this.getMetadata("trusted")||!!e.trusted,this.sharedModel.changed.connect(this.onGenericChange,this),this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get metadataChanged(){return this._metadataChanged}get id(){return this.sharedModel.getId()}get metadata(){return this.sharedModel.metadata}get trusted(){return this._trusted}set trusted(e){const t=this.trusted;t!==e&&(this._trusted=e,this.onTrustedChanged(this,{newValue:e,oldValue:t}))}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this.onGenericChange,this),this.sharedModel.metadataChanged.disconnect(this._onMetadataChanged,this),super.dispose())}onTrustedChanged(e,t){}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){void 0===t?this.sharedModel.deleteMetadata(e):this.sharedModel.setMetadata(e,t)}toJSON(){return this.sharedModel.toJSON()}onGenericChange(){this.contentChanged.emit(void 0)}_onMetadataChanged(e,t){this._metadataChanged.emit(t)}}class D extends E{constructor(e){var t;super(e);const s=null!==(t=e.contentFactory)&&void 0!==t?t:D.defaultContentFactory,i=this.sharedModel.getAttachments();this._attachments=s.createAttachmentsModel({values:i}),this._attachments.stateChanged.connect(this.onGenericChange,this),this._attachments.changed.connect(this._onAttachmentsChange,this),this.sharedModel.changed.connect(this._onSharedModelChanged,this)}get attachments(){return this._attachments}dispose(){this.isDisposed||(this._attachments.stateChanged.disconnect(this.onGenericChange,this),this._attachments.changed.disconnect(this._onAttachmentsChange,this),this._attachments.dispose(),this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),super.dispose())}toJSON(){return super.toJSON()}_onAttachmentsChange(e,t){const s=this.sharedModel;O((()=>s.setAttachments(e.toJSON())))}_onSharedModelChanged(e,t){if(t.attachmentsChange){const e=this.sharedModel;O((()=>{var t;return this._attachments.fromJSON(null!==(t=e.getAttachments())&&void 0!==t?t:{})}))}}}!function(e){class t{createAttachmentsModel(e){return new x.AttachmentsModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(D||(D={}));class I extends D{constructor(e={}){super({cell_type:"raw",...e})}get type(){return"raw"}toJSON(){return super.toJSON()}}class k extends D{constructor(e={}){super({cell_type:"markdown",...e}),this.mimeType="text/x-ipythongfm"}get type(){return"markdown"}toJSON(){return super.toJSON()}}class j extends E{constructor(e={}){var t;super({cell_type:"code",...e}),this._executedCode="",this._isDirty=!1;const s=null!==(t=null==e?void 0:e.contentFactory)&&void 0!==t?t:j.defaultContentFactory,i=this.trusted,n=this.sharedModel.getOutputs();this._outputs=s.createOutputArea({trusted:i,values:n}),this.sharedModel.changed.connect(this._onSharedModelChanged,this),this._outputs.changed.connect(this.onGenericChange,this),this._outputs.changed.connect(this.onOutputsChange,this)}get type(){return"code"}get executionCount(){return this.sharedModel.execution_count||null}set executionCount(e){this.sharedModel.execution_count=e||null}get isDirty(){return this._isDirty}get outputs(){return this._outputs}clearExecution(){this.outputs.clear(),this.executionCount=null,this._setDirty(!1),this.sharedModel.deleteMetadata("execution"),this.trusted=!0}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),this._outputs.changed.disconnect(this.onGenericChange,this),this._outputs.changed.disconnect(this.onOutputsChange,this),this._outputs.dispose(),this._outputs=null,super.dispose())}onTrustedChanged(e,t){const s=t.newValue;if(this._outputs&&(this._outputs.trusted=s),s){const e=this.sharedModel,t=e.getMetadata();t.trusted=!0,e.setMetadata(t)}this.stateChanged.emit({name:"trusted",oldValue:t.oldValue,newValue:s})}toJSON(){return super.toJSON()}onOutputsChange(e,t){const s=this.sharedModel;O((()=>{switch(t.type){case"add":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.newIndex,t.newIndex,e);break}case"set":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.oldIndex,t.oldIndex+e.length,e);break}case"remove":s.updateOutputs(t.oldIndex,t.oldValues.length);break;default:throw new Error(`Invalid event type: ${t.type}`)}}))}_onSharedModelChanged(e,t){t.outputsChange&&O((()=>{this.outputs.clear(),e.getOutputs().forEach((e=>this._outputs.add(e)))})),t.executionCountChange&&(!t.executionCountChange.newValue||!this.isDirty&&t.executionCountChange.oldValue||this._setDirty(!1),this.stateChanged.emit({name:"executionCount",oldValue:t.executionCountChange.oldValue,newValue:t.executionCountChange.newValue})),t.sourceChange&&null!==this.executionCount&&this._setDirty(this._executedCode!==this.sharedModel.getSource().trim())}_setDirty(e){e||(this._executedCode=this.sharedModel.getSource().trim()),e!==this._isDirty&&(this._isDirty=e,this.stateChanged.emit({name:"isDirty",oldValue:!e,newValue:e}))}}!function(e){class t{createOutputArea(e){return new P.OutputAreaModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(j||(j={}));var N=s(57356);class F extends C.Widget{constructor(e){var t,s,i;const n=document.createElement("div");super({node:n});const r=(null!==(t=e.translator)&&void 0!==t?t:N.nullTranslator).load("jupyterlab"),o=document.createElement("div");o.className=null!==(s=e.promptClass)&&void 0!==s?s:"",n.insertAdjacentHTML("afterbegin",o.outerHTML),this._cell=document.createElement("div"),this._cell.classList.add("jp-Placeholder-content"),this._cell.title=r.__("Click to expand");const a=this._cell.appendChild(document.createElement("div"));a.classList.add("jp-Placeholder-contentContainer"),this._textContent=a.appendChild(document.createElement("span")),this._textContent.className="jp-PlaceholderText",this._textContent.innerText=null!==(i=e.text)&&void 0!==i?i:"",n.appendChild(this._cell),h.ellipsesIcon.element({container:a.appendChild(document.createElement("span")),className:"jp-MoreHorizIcon",elementPosition:"center",height:"auto",width:"32px"}),this.addClass("jp-Placeholder"),this._callback=e.callback}set text(e){this._textContent.innerText=e}get text(){return this._textContent.innerText}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this._callback)}onBeforeDetach(e){this.node.removeEventListener("click",this._callback),super.onBeforeDetach(e)}}class W extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-InputPrompt"}),this.addClass("jp-InputPlaceholder")}}class T extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-OutputPrompt"}),this.addClass("jp-OutputPlaceholder")}}var L=s(58277),R=s(64588),V=s(54117);const z="jp-mod-selected";class B extends L.EditorSearchProvider{constructor(e){super(),this.cell=e,this.cell.inViewport||this.cell.editor||(0,R.signalToPromise)(e.inViewportChanged).then((([,e])=>{e&&this.cmHandler.setEditor(this.editor)}))}get editor(){return this.cell.editor}get model(){return this.cell.model}}class U extends B{constructor(e){super(e),this.currentProviderIndex=-1,this.outputsProvider=[];const t=this.cell.outputArea;this._onOutputsChanged(t,t.widgets.length).catch((e=>{console.error("Failed to initialize search on cell outputs.",e)})),t.outputLengthChanged.connect(this._onOutputsChanged,this),t.disposed.connect((()=>{t.outputLengthChanged.disconnect(this._onOutputsChanged)}),this)}get matchesCount(){return this.isActive?super.matchesCount+this.outputsProvider.reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0):0}async clearHighlight(){await super.clearHighlight(),await Promise.all(this.outputsProvider.map((e=>e.clearHighlight())))}dispose(){this.isDisposed||(super.dispose(),this.outputsProvider.map((e=>{e.dispose()})),this.outputsProvider.length=0)}async highlightNext(e,t){if(0!==this.matchesCount&&this.isActive){if(-1===this.currentProviderIndex){const e=await super.highlightNext(!0,t);if(e)return this.currentIndex=this.cmHandler.currentIndex,e;this.currentProviderIndex=0}for(;this.currentProviderIndex<this.outputsProvider.length;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightNext(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex+=1}return this.currentProviderIndex=-1,void(this.currentIndex=null)}this.currentIndex=null}async highlightPrevious(){if(0!==this.matchesCount&&this.isActive){for(null===this.currentIndex&&(this.currentProviderIndex=this.outputsProvider.length-1);this.currentProviderIndex>=0;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightPrevious(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex-=1}const e=await super.highlightPrevious();return e?(this.currentIndex=this.cmHandler.currentIndex,e):void(this.currentIndex=null)}this.currentIndex=null}async startQuery(e,t){await super.startQuery(e,t),!1!==(null==t?void 0:t.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((t=>t.startQuery(e))))}async endQuery(){var e;await super.endQuery(),!1!==(null===(e=this.filters)||void 0===e?void 0:e.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((e=>e.endQuery())))}async _onOutputsChanged(e,t){var s;this.outputsProvider.forEach((e=>{e.dispose()})),this.outputsProvider.length=0,this.currentProviderIndex=-1,this.outputsProvider=this.cell.outputArea.widgets.map((e=>new V.GenericSearchProvider(e))),this.isActive&&this.query&&!1!==(null===(s=this.filters)||void 0===s?void 0:s.output)&&await Promise.all([this.outputsProvider.map((e=>{e.startQuery(this.query)}))]),this._stateChanged.emit()}}class $ extends B{constructor(e){super(e),this._unrenderedByHighlight=!1,this.renderedProvider=new V.GenericSearchProvider(e.renderer)}async clearHighlight(){await super.clearHighlight(),await this.renderedProvider.clearHighlight()}dispose(){this.isDisposed||(super.dispose(),this.renderedProvider.dispose())}async endQuery(){await super.endQuery(),await this.renderedProvider.endQuery()}async highlightNext(){let e;if(!this.isActive)return e;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighlight=!0;const e=(0,R.signalToPromise)(t.renderedChanged);t.rendered=!1,await e}return e=await super.highlightNext(),e}async highlightPrevious(){let e;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighlight=!0;const e=(0,R.signalToPromise)(t.renderedChanged);t.rendered=!1,await e}return e=await super.highlightPrevious(),e}async startQuery(e,t){await super.startQuery(e,t);const s=this.cell;s.rendered&&this.onRenderedChanged(s,s.rendered),s.renderedChanged.connect(this.onRenderedChanged,this)}async replaceAllMatches(e){const t=await super.replaceAllMatches(e);return this.cell.rendered&&this.cell.update(),t}onRenderedChanged(e,t){var s;this._unrenderedByHighlight||(this.currentIndex=null),this._unrenderedByHighlight=!1,this.isActive&&(t?this.renderedProvider.startQuery(this.query):(null===(s=e.editor)||void 0===s||s.setCursorPosition({column:0,line:0}),this.renderedProvider.endQuery()))}}function J(e){if(e.isPlaceholder())return new B(e);switch(e.model.type){case"code":return new U(e);case"markdown":return new $(e);default:return new B(e)}}var Q=s(19768),G=s(39401),q=s(21099),X=s(20998),Y=s(33625),K=s(49503),Z=s(97934);const ee="jp-mod-resizedCell";class te extends C.Widget{constructor(e){super(),this.targetNode=e,this._isActive=!1,this._isDragging=!1,this.sizeChanged=new f.Signal(this),this.addClass("jp-CellResizeHandle"),this._resizer=new Z.Throttler((e=>this._resize(e)),50)}dispose(){this._resizer.dispose(),super.dispose()}handleEvent(e){var t,s;switch(e.type){case"dblclick":null===(t=this.targetNode.parentNode)||void 0===t||t.childNodes.forEach((e=>{e.classList.remove(ee)})),document.documentElement.style.setProperty("--jp-side-by-side-output-size","1fr"),this._isActive=!1;break;case"mousedown":this._isDragging=!0,this._isActive||(null===(s=this.targetNode.parentNode)||void 0===s||s.childNodes.forEach((e=>{e.classList.add(ee)})),this._isActive=!0),window.addEventListener("mousemove",this),window.addEventListener("mouseup",this);break;case"mousemove":this._isActive&&this._isDragging&&this._resizer.invoke(e);break;case"mouseup":this._isDragging=!1,window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this)}}onAfterAttach(e){this.node.addEventListener("dblclick",this),this.node.addEventListener("mousedown",this),super.onAfterAttach(e)}onBeforeDetach(e){this.node.removeEventListener("dblclick",this),this.node.removeEventListener("mousedown",this),super.onBeforeDetach(e)}_resize(e){const{width:t,x:s}=this.targetNode.getBoundingClientRect(),i=t/(e.clientX-s)-1;if(0<i){const e=Math.max(Math.min(Math.abs(i),50),.05);document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`),this.sizeChanged.emit(e)}}}const se="jp-Cell-outputWrapper",ie="jp-mod-dirty",ne="jp-MarkdownHeadingCollapsed",re="jp-collapseHeadingButton",oe="jp-showHiddenCellsButton",ae="jp-mod-rendered",de="jp-mod-noOutputs",le="application/x-jupyter-icontentsrich";class he extends C.Widget{constructor(e){var t,s,i,n;super(),this.prompt="",this._displayChanged=new f.Signal(this),this._editorConfig={},this._inputHidden=!1,this._inViewportChanged=new f.Signal(this),this._readOnly=!1,this._ready=new X.PromiseDelegate,this._resizeDebouncer=new Z.Debouncer((()=>{this._displayChanged.emit()}),0),this._syncCollapse=!1,this._syncEditable=!1,this.addClass("jp-Cell");const r=this._model=e.model;this.contentFactory=e.contentFactory,this.layout=null!==(t=e.layout)&&void 0!==t?t:new C.PanelLayout,this.translator=null!==(s=e.translator)&&void 0!==s?s:N.nullTranslator,this._editorConfig=null!==(i=e.editorConfig)&&void 0!==i?i:{},this._placeholder=!0,this._inViewport=!1,this.placeholder=null===(n=e.placeholder)||void 0===n||n,r.metadataChanged.connect(this.onMetadataChanged,this)}initializeState(){return this.loadCollapseState(),this.loadEditableState(),this}get displayChanged(){return this._displayChanged}get inViewport(){return this._inViewport}set inViewport(e){this._inViewport!==e&&(this._inViewport=e,this._inViewportChanged.emit(this._inViewport))}get inViewportChanged(){return this._inViewportChanged}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&!1===e&&(this.initializeDOM(),this._placeholder=e,this._ready.resolve())}get promptNode(){return this.placeholder?null:this._inputHidden?this._inputPlaceholder.node.firstElementChild:this._input.promptNode}get editorWidget(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editorWidget)&&void 0!==t?t:null}get editor(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editor)&&void 0!==t?t:null}get editorConfig(){return this._editorConfig}get headings(){return new Array}get model(){return this._model}get inputArea(){return this._input}get readOnly(){return this._readOnly}set readOnly(e){e!==this._readOnly&&(this._readOnly=e,this.syncEditable&&this.saveEditableState(),this.update())}isPlaceholder(){return this.placeholder}saveEditableState(){const{sharedModel:e}=this.model,t=e.getMetadata("editable");this.readOnly&&!1===t||!this.readOnly&&void 0===t||(this.readOnly?e.setMetadata("editable",!1):e.deleteMetadata("editable"))}loadEditableState(){this.readOnly=!1===this.model.sharedModel.getMetadata("editable")}get ready(){return this._ready.promise}setPrompt(e){var t;this.prompt=e,null===(t=this._input)||void 0===t||t.setPrompt(e)}get inputHidden(){return this._inputHidden}set inputHidden(e){var t;if(this._inputHidden!==e){if(!this.placeholder){const s=this._inputWrapper.layout;e?(this._input.parent=null,this._inputPlaceholder&&(this._inputPlaceholder.text=null===(t=this.model.sharedModel.getSource().split("\n"))||void 0===t?void 0:t[0]),s.addWidget(this._inputPlaceholder)):(this._inputPlaceholder.parent=null,s.addWidget(this._input))}this._inputHidden=e,this.syncCollapse&&this.saveCollapseState(),this.handleInputHidden(e)}}saveCollapseState(){const e={...this.model.getMetadata("jupyter")};this.inputHidden&&!0===e.source_hidden||!this.inputHidden&&void 0===e.source_hidden||(this.inputHidden?e.source_hidden=!0:delete e.source_hidden,0===Object.keys(e).length?this.model.deleteMetadata("jupyter"):this.model.setMetadata("jupyter",e))}loadCollapseState(){var e;const t=null!==(e=this.model.getMetadata("jupyter"))&&void 0!==e?e:{};this.inputHidden=!!t.source_hidden}handleInputHidden(e){}get syncCollapse(){return this._syncCollapse}set syncCollapse(e){this._syncCollapse!==e&&(this._syncCollapse=e,e&&this.loadCollapseState())}get syncEditable(){return this._syncEditable}set syncEditable(e){this._syncEditable!==e&&(this._syncEditable=e,e&&this.loadEditableState())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}dispose(){this.isDisposed||(this._resizeDebouncer.dispose(),this._input=null,this._model=null,this._inputWrapper=null,this._inputPlaceholder=null,super.dispose())}updateEditorConfig(e){this._editorConfig={...this._editorConfig,...e},this.editor&&this.editor.setOptions(this._editorConfig)}initializeDOM(){if(!this.placeholder)return;const e=this.contentFactory,t=this._model,s=e.createCellHeader();s.addClass("jp-Cell-header"),this.layout.addWidget(s);const i=this._inputWrapper=new C.Panel;i.addClass("jp-Cell-inputWrapper");const n=new g;n.addClass("jp-Cell-inputCollapser");const r=this._input=new w({model:t,contentFactory:e,editorOptions:this.getEditorOptions()});r.addClass("jp-Cell-inputArea"),i.addWidget(n),i.addWidget(r),this.layout.addWidget(i),this._inputPlaceholder=new W({callback:()=>{this.inputHidden=!this.inputHidden},text:r.model.sharedModel.getSource().split("\n")[0],translator:this.translator}),r.model.contentChanged.connect(((e,t)=>{var s;this._inputPlaceholder&&this.inputHidden&&(this._inputPlaceholder.text=null===(s=e.sharedModel.getSource().split("\n"))||void 0===s?void 0:s[0])})),this.inputHidden&&(r.parent=null,i.layout.addWidget(this._inputPlaceholder));const o=this.contentFactory.createCellFooter();o.addClass("jp-Cell-footer"),this.layout.addWidget(o)}getEditorOptions(){return{config:this.editorConfig}}onBeforeAttach(e){this.placeholder&&(this.placeholder=!1)}onAfterAttach(e){this.update()}onActivateRequest(e){var t;null===(t=this.editor)||void 0===t||t.focus()}onResize(e){this._resizeDebouncer.invoke()}onUpdateRequest(e){var t,s;this._model&&(null===(t=this.editor)||void 0===t?void 0:t.getOption("readOnly"))!==this._readOnly&&(null===(s=this.editor)||void 0===s||s.setOption("readOnly",this._readOnly))}onContentChanged(){var e;this.inputHidden&&this._inputPlaceholder&&(this._inputPlaceholder.text=null===(e=this.model.sharedModel.getSource().split("\n"))||void 0===e?void 0:e[0])}onMetadataChanged(e,t){switch(t.key){case"jupyter":this.syncCollapse&&this.loadCollapseState();break;case"editable":this.syncEditable&&this.loadEditableState()}}}!function(e){let t;!function(e){e[e.HTML=0]="HTML",e[e.Markdown=1]="Markdown"}(t=e.HeadingType||(e.HeadingType={})),e.ContentFactory=class{constructor(e){this._editorFactory=e.editorFactory}get editorFactory(){return this._editorFactory}createCellHeader(){return new _}createCellFooter(){return new v}createInputPrompt(){return new M}createOutputPrompt(){return new P.OutputPrompt}createStdin(e){return new P.Stdin(e)}}}(he||(he={}));class ue extends C.PanelLayout{onBeforeAttach(e){let t=!0;const s=this.parent.node.firstElementChild;for(const i of this)s&&(i.node===s?t=!1:(K.MessageLoop.sendMessage(i,e),t?this.parent.node.insertBefore(i.node,s):this.parent.node.appendChild(i.node),this.parent.isHidden||i.setFlag(C.Widget.Flag.IsVisible),K.MessageLoop.sendMessage(i,C.Widget.Msg.AfterAttach)))}onAfterDetach(e){for(const t of this)!t.hasClass(se)&&t.node.isConnected&&(K.MessageLoop.sendMessage(t,C.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),K.MessageLoop.sendMessage(t,e))}}class ce extends he{constructor(e){var t;super({layout:new ue,...e,placeholder:!0}),this._headingsCache=null,this._outputHidden=!1,this._outputWrapper=null,this._outputPlaceholder=null,this._syncScrolled=!1,this.addClass("jp-CodeCell");const s=this.translator.load("jupyterlab"),i=this._rendermime=e.rendermime,n=this.contentFactory,r=this.model;this.maxNumberOutputs=e.maxNumberOutputs;const o=0===r.outputs.length?s.__("Code Cell Content"):s.__("Code Cell Content with Output");this.node.setAttribute("aria-label",o);const a=this._output=new P.OutputArea({model:this.model.outputs,rendermime:i,contentFactory:n,maxNumberOutputs:this.maxNumberOutputs,translator:this.translator,promptOverlay:!0,inputHistoryScope:e.inputHistoryScope});a.addClass("jp-Cell-outputArea"),a.toggleScrolling.connect((()=>{this.outputsScrolled=!this.outputsScrolled})),this.placeholder=null===(t=e.placeholder)||void 0===t||t,r.outputs.changed.connect(this.onOutputChanged,this),r.outputs.stateChanged.connect(this.onOutputChanged,this),r.stateChanged.connect(this.onStateChanged,this)}initializeDOM(){if(!this.placeholder)return;super.initializeDOM(),this.setPrompt(this.prompt);const e=this._outputWrapper=new C.Panel;e.addClass(se);const t=new m;t.addClass("jp-Cell-outputCollapser"),e.addWidget(t),0===this.model.outputs.length&&this.addClass(de),this._output.outputLengthChanged.connect(this._outputLengthHandler,this),e.addWidget(this._output);const s=this.layout,i=new te(this.node);i.sizeChanged.connect(this._sizeChangedHandler,this),s.insertWidget(s.widgets.length-1,i),s.insertWidget(s.widgets.length-1,e),this.model.isDirty&&this.addClass(ie),this._outputPlaceholder=new T({callback:()=>{this.outputHidden=!this.outputHidden},text:this.getOutputPlaceholderText(),translator:this.translator});const n=e.layout;this.outputHidden&&(n.removeWidget(this._output),n.addWidget(this._outputPlaceholder),this.inputHidden&&!e.isHidden&&this._outputWrapper.hide());const r=this.translator.load("jupyterlab"),o=0===this.model.outputs.length?r.__("Code Cell Content"):r.__("Code Cell Content with Output");this.node.setAttribute("aria-label",o)}getOutputPlaceholderText(){var e;const t=this.model.outputs.get(0);if(!(null==t?void 0:t.data))return;const s=["text/html","image/svg+xml","application/pdf","text/markdown","text/plain","application/vnd.jupyter.stderr","application/vnd.jupyter.stdout","text"].find((e=>{const s=t.data[e];return"string"==(Array.isArray(s)?typeof s[0]:typeof s)})),i=t.data[null!=s?s:""];return void 0!==i?null===(e=Array.isArray(i)?i:null==i?void 0:i.split("\n"))||void 0===e?void 0:e.find((e=>""!==e)):void 0}initializeState(){return super.initializeState(),this.loadScrolledState(),this.setPrompt(`${this.model.executionCount||""}`),this}get headings(){if(!this._headingsCache){const e=[],t=this.model.outputs;for(let s=0;s<t.length;s++){const i=t.get(s);let n=null,r=null;Object.keys(i.data).forEach((e=>{!r&&q.TableOfContentsUtils.Markdown.isMarkdown(e)?r=e:!n&&q.TableOfContentsUtils.isHTML(e)&&(n=e)})),n?e.push(...q.TableOfContentsUtils.getHTMLHeadings(this._rendermime.sanitizer.sanitize(i.data[n])).map((e=>({...e,outputIndex:s,type:he.HeadingType.HTML})))):r&&e.push(...q.TableOfContentsUtils.Markdown.getHeadings(i.data[r]).map((e=>({...e,outputIndex:s,type:he.HeadingType.Markdown}))))}this._headingsCache=e}return[...this._headingsCache]}get outputArea(){return this._output}get outputHidden(){return this._outputHidden}set outputHidden(e){var t;if(this._outputHidden!==e){if(!this.placeholder){const s=this._outputWrapper.layout;e?(s.removeWidget(this._output),s.addWidget(this._outputPlaceholder),this.inputHidden&&!this._outputWrapper.isHidden&&this._outputWrapper.hide(),this._outputPlaceholder&&(this._outputPlaceholder.text=null!==(t=this.getOutputPlaceholderText())&&void 0!==t?t:"")):(this._outputWrapper.isHidden&&this._outputWrapper.show(),s.removeWidget(this._outputPlaceholder),s.addWidget(this._output))}this._outputHidden=e,this.syncCollapse&&this.saveCollapseState()}}saveCollapseState(){this.model.sharedModel.transact((()=>{super.saveCollapseState();const e=this.model.getMetadata("collapsed");this.outputHidden&&!0===e||!this.outputHidden&&void 0===e||(this.outputHidden?this.model.setMetadata("collapsed",!0):this.model.deleteMetadata("collapsed"))}),!1)}loadCollapseState(){super.loadCollapseState(),this.outputHidden=!!this.model.getMetadata("collapsed")}get outputsScrolled(){return this._outputsScrolled}set outputsScrolled(e){this.toggleClass("jp-mod-outputsScrolled",e),this._outputsScrolled=e,this.syncScrolled&&this.saveScrolledState()}saveScrolledState(){const e=this.model.getMetadata("scrolled");this.outputsScrolled&&!0===e||!this.outputsScrolled&&void 0===e||(this.outputsScrolled?this.model.setMetadata("scrolled",!0):this.model.deleteMetadata("scrolled"))}loadScrolledState(){"auto"===this.model.getMetadata("scrolled")?this.outputsScrolled=!1:this.outputsScrolled=!!this.model.getMetadata("scrolled")}get syncScrolled(){return this._syncScrolled}set syncScrolled(e){this._syncScrolled!==e&&(this._syncScrolled=e,e&&this.loadScrolledState())}handleInputHidden(e){this.placeholder||(!e&&this._outputWrapper.isHidden?this._outputWrapper.show():e&&!this._outputWrapper.isHidden&&this._outputHidden&&this._outputWrapper.hide())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}cloneOutputArea(){return new P.SimplifiedOutputArea({model:this.model.outputs,contentFactory:this.contentFactory,rendermime:this._rendermime})}dispose(){this.isDisposed||(this._output.outputLengthChanged.disconnect(this._outputLengthHandler,this),this._rendermime=null,this._output=null,this._outputWrapper=null,this._outputPlaceholder=null,super.dispose())}onStateChanged(e,t){switch(t.name){case"executionCount":this.setPrompt(`${e.executionCount||""}`);break;case"isDirty":e.isDirty?this.addClass(ie):this.removeClass(ie)}}onOutputChanged(){var e;this._headingsCache=null,this._outputPlaceholder&&this.outputHidden&&(this._outputPlaceholder.text=null!==(e=this.getOutputPlaceholderText())&&void 0!==e?e:"")}onMetadataChanged(e,t){switch(t.key){case"scrolled":this.syncScrolled&&this.loadScrolledState();break;case"collapsed":this.syncCollapse&&this.loadCollapseState()}super.onMetadataChanged(e,t)}_outputLengthHandler(e,t){const s=0===t;this.toggleClass(de,s);const i=this.translator.load("jupyterlab"),n=s?i.__("Code Cell Content"):i.__("Code Cell Content with Output");this.node.setAttribute("aria-label",n)}_sizeChangedHandler(e){this._displayChanged.emit()}}!function(e){e.execute=async function(e,t,s){var i;const n=e.model,r=n.sharedModel.getSource();if(!r.trim()||!(null===(i=t.session)||void 0===i?void 0:i.kernel))return void n.sharedModel.transact((()=>{n.clearExecution()}),!1);const o={cellId:n.sharedModel.getId()};s={...n.metadata,...s,...o};const{recordTiming:a}=s;let d;n.sharedModel.transact((()=>{n.clearExecution(),e.outputHidden=!1}),!1),e.setPrompt("*"),n.trusted=!0;try{const i=P.OutputArea.execute(r,e.outputArea,t,s);if(a){const t=e=>{let t;switch(e.header.msg_type){case"status":t=`status.${e.content.execution_state}`;break;case"execute_input":t="execute_input";break;default:return!0}const s=e.header.date||(new Date).toISOString(),i=Object.assign({},n.getMetadata("execution"));return i[`iopub.${t}`]=s,n.setMetadata("execution",i),!0};e.outputArea.future.registerMessageHook(t)}else n.deleteMetadata("execution");d=e.outputArea.future;const o=await i;if(n.executionCount=o.content.execution_count,a){const e=Object.assign({},n.getMetadata("execution")),t=o.metadata.started;t&&(e["shell.execute_reply.started"]=t);const s=o.header.date;e["shell.execute_reply"]=s||(new Date).toISOString(),n.setMetadata("execution",e)}return o}catch(t){throw d&&!e.isDisposed&&e.outputArea.future===d&&e.setPrompt(""),t}}}(ce||(ce={}));class pe extends he{handleEvent(e){switch(e.type){case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e)}}getEditorOptions(){var e,t;const s=null!==(e=super.getEditorOptions())&&void 0!==e?e:{};return s.extensions=[...null!==(t=s.extensions)&&void 0!==t?t:[],Q.EditorView.domEventHandlers({dragenter:e=>{e.preventDefault()},dragover:e=>{e.preventDefault()},drop:e=>{this._evtNativeDrop(e)},paste:e=>{this._evtPaste(e)}})],s}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("lm-dragover",this),t.addEventListener("lm-drop",this)}onBeforeDetach(e){const t=this.node;t.removeEventListener("lm-dragover",this),t.removeEventListener("lm-drop",this),super.onBeforeDetach(e)}_evtDragOver(e){(0,Y.some)(G.imageRendererFactory.mimeTypes,(t=>!!e.mimeData.hasData(le)&&e.mimeData.getData(le).model.mimetype===t))&&(e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction)}_evtPaste(e){if(e.clipboardData){const t=e.clipboardData.items;for(let s=0;s<t.length;s++){if("text/plain"===t[s].type){if(s<t.length-1&&"file"===t[s+1].kind)continue;t[s].getAsString((e=>{var t,s;null===(s=(t=this.editor).replaceSelection)||void 0===s||s.call(t,e)}))}this._attachFiles(e.clipboardData.items)}}e.preventDefault()}_evtNativeDrop(e){e.dataTransfer&&this._attachFiles(e.dataTransfer.items),e.preventDefault()}_evtDrop(e){const t=e.mimeData.types().filter((t=>{if(t===le){const t=e.mimeData.getData(le);return-1!==G.imageRendererFactory.mimeTypes.indexOf(t.model.mimetype)}return-1!==G.imageRendererFactory.mimeTypes.indexOf(t)}));if(0!==t.length)if(e.preventDefault(),e.stopPropagation(),"none"!==e.proposedAction){e.dropAction="copy";for(const s of t)if(s===le){const{model:t,withContent:s}=e.mimeData.getData(le);if("file"===t.type){const e=this._generateURI(t.name);this.updateCellSourceWithAttachment(t.name,e),s().then((t=>{this.model.attachments.set(e,{[t.mimetype]:t.content})}))}}else{const t=this._generateURI();this.model.attachments.set(t,{[s]:e.mimeData.getData(s)}),this.updateCellSourceWithAttachment(t,t)}}else e.dropAction="none"}_attachFiles(e){for(let t=0;t<e.length;t++){const s=e[t];if("file"===s.kind){const e=s.getAsFile();e&&this._attachFile(e)}}}_attachFile(e){const t=new FileReader;t.onload=s=>{const{href:i,protocol:n}=R.URLExt.parse(t.result);if("data:"!==n)return;const r=/([\w+\/\+]+)?(?:;(charset=[\w\d-]*|base64))?,(.*)/.exec(i);if(!r||4!==r.length)return;const o=r[1],a={[o]:r[3]},d=this._generateURI(e.name);o.startsWith("image/")&&(this.model.attachments.set(d,a),this.updateCellSourceWithAttachment(e.name,d))},t.onerror=t=>{console.error(`Failed to attach ${e.name}`+t)},t.readAsDataURL(e)}_generateURI(e=""){const t=e.lastIndexOf(".");return-1!==t?X.UUID.uuid4().concat(e.substring(t)):X.UUID.uuid4()}}class ge extends pe{constructor(e){var t,s,i,n;super({...e,placeholder:!0}),this._headingsCache=null,this._headingCollapsedChanged=new f.Signal(this),this._prevText="",this._rendered=!0,this._renderedChanged=new f.Signal(this),this._showEditorForReadOnlyMarkdown=!0,this.addClass("jp-MarkdownCell"),this.model.contentChanged.connect(this.onContentChanged,this);const r=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",r.__("Markdown Cell Content")),this._rendermime=e.rendermime.clone({resolver:new x.AttachmentsResolver({parent:null!==(t=e.rendermime.resolver)&&void 0!==t?t:void 0,model:this.model.attachments})}),this._renderer=this._rendermime.createRenderer("text/markdown"),this._renderer.addClass("jp-MarkdownOutput"),this._headingCollapsed=null!==(s=this.model.getMetadata(ne))&&void 0!==s&&s,this._showEditorForReadOnlyMarkdown=null!==(i=e.showEditorForReadOnlyMarkdown)&&void 0!==i?i:ge.defaultShowEditorForReadOnlyMarkdown,this.placeholder=null===(n=e.placeholder)||void 0===n||n,this._monitor=new R.ActivityMonitor({signal:this.model.contentChanged,timeout:1e3}),this.ready.then((()=>{this.isDisposed||this._monitor.activityStopped.connect((()=>{this._rendered&&this.update()}),this)})).catch((e=>{console.error("Failed to be ready",e)}))}get headingInfo(){const e=this.headings;if(e.length>0){const{text:t,level:s}=e.reduce(((e,t)=>e.level<=t.level?e:t),e[0]);return{text:t,level:s}}return{text:"",level:-1}}get headings(){if(!this._headingsCache){const e=q.TableOfContentsUtils.Markdown.getHeadings(this.model.sharedModel.getSource());this._headingsCache=e.map((e=>({...e,type:he.HeadingType.Markdown})))}return[...this._headingsCache]}get headingCollapsed(){return this._headingCollapsed}set headingCollapsed(e){var t;if(this._headingCollapsed!==e){this._headingCollapsed=e,e?this.model.setMetadata(ne,e):"undefined"!==this.model.getMetadata(ne)&&this.model.deleteMetadata(ne);const s=null===(t=this.inputArea)||void 0===t?void 0:t.promptNode.getElementsByClassName(re)[0];s&&(e?s.classList.add("jp-mod-collapsed"):s.classList.remove("jp-mod-collapsed")),this.renderCollapseButtons(this._renderer),this._headingCollapsedChanged.emit(this._headingCollapsed)}}get numberChildNodes(){return this._numberChildNodes}set numberChildNodes(e){this._numberChildNodes=e,this.renderCollapseButtons(this._renderer)}get headingCollapsedChanged(){return this._headingCollapsedChanged}get rendered(){return this._rendered}set rendered(e){this.readOnly&&!1===this._showEditorForReadOnlyMarkdown&&(e=!0),e!==this._rendered&&(this._rendered=e,this._handleRendered().then((()=>{this._displayChanged.emit(),this._renderedChanged.emit(this._rendered)})).catch((e=>{console.error("Failed to render",e)})))}get renderedChanged(){return this._renderedChanged}get showEditorForReadOnly(){return this._showEditorForReadOnlyMarkdown}set showEditorForReadOnly(e){this._showEditorForReadOnlyMarkdown=e,!1===e&&(this.rendered=!0)}get renderer(){return this._renderer}dispose(){this.isDisposed||(this._monitor.dispose(),super.dispose())}initializeDOM(){this.placeholder&&(super.initializeDOM(),this.renderCollapseButtons(this._renderer),this._handleRendered().catch((e=>{console.error("Failed to render",e)})))}maybeCreateCollapseButton(){var e;const{level:t}=this.headingInfo;if(t>0&&0==(null===(e=this.inputArea)||void 0===e?void 0:e.promptNode.getElementsByClassName(re).length)){let e=this.inputArea.promptNode.appendChild(document.createElement("button"));e.className=`jp-Button ${re}`,e.setAttribute("data-heading-level",t.toString()),this._headingCollapsed?e.classList.add("jp-mod-collapsed"):e.classList.remove("jp-mod-collapsed"),e.onclick=e=>{this.headingCollapsed=!this.headingCollapsed}}}maybeCreateOrUpdateExpandButton(){const e=this.node.getElementsByClassName(oe);let t=this.translator.load("jupyterlab")._n("%1 cell hidden","%1 cells hidden",this._numberChildNodes);if(this.headingCollapsed&&this._numberChildNodes>0&&0==e.length){const e=document.createElement("button");e.className=`jp-mod-minimal jp-Button ${oe}`,h.addIcon.render(e);const s=document.createElement("div");s.textContent=t,e.appendChild(s),e.onclick=()=>{this.headingCollapsed=!1},this.node.appendChild(e)}if(this.headingCollapsed&&this._numberChildNodes>0&&1==e.length&&(e[0].childNodes[1].textContent=t),!(this.headingCollapsed&&this._numberChildNodes>0))for(const t of e)this.node.removeChild(t)}onContentChanged(){super.onContentChanged(),this._headingsCache=null}renderCollapseButtons(e){this.node.classList.toggle(ne,this._headingCollapsed),this.maybeCreateCollapseButton(),this.maybeCreateOrUpdateExpandButton()}renderInput(e){this.addClass(ae),this.placeholder||this.isDisposed||(this.renderCollapseButtons(e),this.inputArea.renderInput(e))}showEditor(){if(this.removeClass(ae),!this.placeholder&&!this.isDisposed){this.inputArea.showEditor();let e=(this.model.sharedModel.getSource().match(/^#+/g)||[""])[0].length;e>0&&this.inputArea.editor.setCursorPosition({column:e+1,line:0},{scroll:!1})}}onUpdateRequest(e){this._handleRendered().catch((e=>{console.error("Failed to render",e)})),super.onUpdateRequest(e)}updateCellSourceWithAttachment(e,t){var s,i;const n=`![${e}](attachment:${null!=t?t:e})`;null===(i=null===(s=this.editor)||void 0===s?void 0:s.replaceSelection)||void 0===i||i.call(s,n)}async _handleRendered(){this._rendered?(await this._updateRenderedInput(),this._rendered&&this.renderInput(this._renderer)):this.showEditor()}_updateRenderedInput(){if(this.placeholder)return Promise.resolve();const e=this.model,t=e&&e.sharedModel.getSource()||"Type Markdown and LaTeX: $ α^2 $";if(t!==this._prevText){const e=new G.MimeModel({data:{"text/markdown":t}});return this._prevText=t,this._renderer.renderModel(e)}return Promise.resolve()}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}}!function(e){e.defaultShowEditorForReadOnlyMarkdown=!0}(ge||(ge={}));class me extends he{constructor(e){super(e),this.addClass("jp-RawCell");const t=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",t.__("Raw Cell Content"))}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}}}}]);