text",JSON.stringify({webviewSection:"text",outputId:i,preventDefaultContextMenuItems:!0})),t.length>y&&s.appendChild(Et(i)),s.appendChild(O(t.slice(-1*y).join(`
`),n)),s}var S={};function dt(i,t,n,s){S[t]||(S[t]=0);let e=n.split(/\r\n|\r|\n/g),r=e.length+S[t];return r>pt?!1:(i.appendChild(O(e.join(`
`),s)),S[t]=r,!0)}function I(i,t,n){let{linesLimit:s,error:e,scrollable:r,trustHtml:l,linkifyFilePaths:c}=n,a={linkifyFilePaths:c,trustHtml:l},u=t.split(/\r\n|\r|\n/g);S[i]=S[i]=Math.min(u.length,y);let m;return r?m=Lt(i,u,a):m=xt(i,u,s,a),m.setAttribute("output-item-id",i),e&&m.classList.add("error"),m}function N(i,t,n){let s=i.appendedText?.(),e={linkifyFilePaths:n.linkifyFilePaths,trustHtml:n.trustHtml};if(s&&n.scrollable&&dt(t,i.id,s,e))return;let r=I(i.id,i.text(),n);for(t.replaceWith(r);r.nextSibling;)r.nextSibling.remove()}function Z(i){let t;return t=i.replace(/\u001b\[4\dm/g,""),t=t.replace(/\u001b\[38;.*?\d+m/g,"\x1B[39m"),t=t.replace(/(;32m[ ->]*?)(\d+)(.*)\n/g,(n,s,e,r)=>(r=r.replace(/\u001b\[3\d+m/g,"\x1B[39m"),`${s}${e}${r}
`)),Rt(t)?vt(t):{formattedStack:t}}var At=/\u001b\[.+?m/g,$=/File\s+(?:\u001b\[.+?m)?(.+):(\d+)/,Y=/^((?:\u001b\[.+?m)?[ \->]+?)(\d+)(?:\u001b\[0m)?( .*)/,M=/(?<prefix>Cell\s+(?:\u001b\[.+?m)?In\s*\[(?<executionCount>\d+)\],\s*)(?<lineLabel>line (?<lineNumber>\d+)).*/,H=/(?<prefix>Input\s+?(?:\u001b\[.+?m)(?<cellLabel>In\s*\[(?<executionCount>\d+)\]))(?<postfix>.*)/;function Rt(i){return M.test(i)||H.test(i)||$.test(i)}function P(i){return i.replace(At,"").trim()}function vt(i){let t=i.split(`
`),n,s="";for(let r in t){let l=t[r];if($.test(l)){let c=t[r].match($);n={kind:"file",path:P(c[1])};continue}else if(M.test(l)){n={kind:"cell",path:P(l.replace(M,"vscode-notebook-cell:?execution_count=$<executionCount>"))};let c=l.replace(M,`<a href='${n.path}&line=$<lineNumber>'>line $<lineNumber></a>`);t[r]=l.replace(M,`$<prefix>${c}`),s=s||c;continue}else if(H.test(l)){n={kind:"cell",path:P(l.replace(H,"vscode-notebook-cell:?execution_count=$<executionCount>"))};let c=l.replace(H,`<a href='${n.path}'>$<cellLabel></a>`);t[r]=l.replace(H,`Input ${c}$<postfix>`);continue}else if(!n||l.trim()===""){n=void 0;continue}else if(Y.test(l)){t[r]=l.replace(Y,(c,a,u,m)=>n?.kind==="file"?`${a}<a href='${n?.path}:${u}'>${u}</a>${m}`:`${a}<a href='${n?.path}&line=${u}'>${u}</a>${m}`);continue}}let e=s;return{formattedStack:t.join(`
`),errorLocation:e}}function W(i){for(;i.firstChild;)i.firstChild.remove()}function Tt(i,t){let n=new Blob([i.data()],{type:i.mime}),s=URL.createObjectURL(n),e={dispose:()=>{URL.revokeObjectURL(s)}};if(t.firstChild){let a=t.firstChild;if(a.firstChild&&a.firstChild.nodeName==="IMG"&&a.firstChild instanceof HTMLImageElement)return a.firstChild.src=s,e}let r=document.createElement("img");r.src=s;let l=et(i);l&&(r.alt=l),r.setAttribute("data-vscode-context",JSON.stringify({webviewSection:"image",outputId:i.id,preventDefaultContextMenuItems:!0}));let c=document.createElement("div");return c.classList.add("display"),c.appendChild(r),t.appendChild(c),e}var kt=["type","src","nonce","noModule","async"],nt=i=>{let t=Array.from(i.getElementsByTagName("script"));for(let n=0;n<t.length;n++){let s=t[n],e=document.createElement("script"),r=U?.createScript(s.innerText)??s.innerText;e.text=r;for(let l of kt){let c=s[l]||s.getAttribute&&s.getAttribute(l);c&&e.setAttribute(l,c)}i.appendChild(e).parentNode.removeChild(e)}};function et(i){let t=i.metadata;if(typeof t=="object"&&t&&"vscode_altText"in t&&typeof t.vscode_altText=="string")return t.vscode_altText}function Ut(i,t){if(i.mime.indexOf("svg")>-1){let n=t.querySelector("svg"),s=et(i);if(n&&s){let e=document.createElement("title");e.innerText=s,n.prepend(e)}n&&(n.classList.add("output-image"),n.setAttribute("data-vscode-context",JSON.stringify({webviewSection:"image",outputId:i.id,preventDefaultContextMenuItems:!0})))}}async function Dt(i,t,n,s){W(t);let e=document.createElement("div"),r=i.text(),l=U?.createHTML(r)??r;e.innerHTML=l,Ut(i,e);for(let c of s)if(e=await c.postRender(i,e,n)??e,n.aborted)return;t.appendChild(e),nt(e)}async function wt(i,t,n,s){let e=i.text();for(let a of s)if(e=await a.preEvaluate(i,t,e,n)??e,n.aborted)return;let r=document.createElement("script");r.type="module",r.textContent=e;let l=document.createElement("div"),c=U?.createHTML(r.outerHTML)??r.outerHTML;l.innerHTML=c,t.appendChild(l),nt(l)}function K(){let i=[];return{push:(...n)=>{i.push(...n)},dispose:()=>{i.forEach(n=>n.dispose())}}}function Ot(i,t,n,s){let e=K();W(t);let r;try{r=JSON.parse(i.text())}catch(c){return console.log(c),e}let l=r.name&&r.message?`${r.name}: ${r.message}`:r.name||r.message;if(r.stack){let c=n.settings.minimalError&&!!l?.length;t.classList.add("traceback");let{formattedStack:a,errorLocation:u}=Z(r.stack),m=!c&&q(i,n.settings),R={linesLimit:c?1e3:n.settings.lineLimit,scrollable:m,trustHtml:s,linkifyFilePaths:!1},E=I(i.id,a,R),v=document.createElement("div");v.appendChild(E),t.classList.toggle("word-wrap",n.settings.outputWordWrap),e.push(n.onDidChangeSettings(_=>{t.classList.toggle("word-wrap",_.outputWordWrap)})),c?St(u,l,v,t):(v.classList.toggle("scrollable",m),t.appendChild(v),V(v,e))}else{let c=document.createElement("div");l&&(c.innerText=l,t.appendChild(c))}return t.classList.add("error"),e}function St(i,t,n,s){let e=document.createElement("div"),r=document.createElement("div");r.classList.add("error-output-header"),i&&i.indexOf("<a")===0&&(r.innerHTML=i);let l=document.createElement("span");l.innerText=t,r.appendChild(l),e.appendChild(r);function c(m){let b=document.createElement("li");return b.appendChild(m),b.onmouseover=function(){b.classList.add("hover")},b.onmouseout=function(){b.classList.remove("hover")},b}let a=document.createElement("ul");a.classList.add("error-output-actions"),e.appendChild(a);let u=document.createElement("a");u.innerText="Show Details",u.href="#!",a.appendChild(c(u)),u.onclick=m=>{m.preventDefault();let b=n.style.display==="none";n.style.display=b?"":"none",u.innerText=b?"Hide Details":"Show Details"},e.appendChild(n),n.style.display="none",s.appendChild(e)}function It(i){let t=i.parentElement,n,s=t?.previousSibling;for(;s;){let e=s.firstChild;if(!e||!e.classList.contains("output-stream"))break;n=e.firstChild,s=s?.previousSibling}return n}function Q(i){let t=i.target;t.scrollTop===0?t.classList.remove("more-above"):t.classList.add("more-above")}function h(i){i.ctrlKey||i.shiftKey||(i.code==="ArrowDown"||i.code==="ArrowUp"||i.code==="End"||i.code==="Home"||i.code==="PageUp"||i.code==="PageDown")&&i.stopPropagation()}function V(i,t,n){if(i.classList.contains(G)){let s=i.scrollHeight>i.clientHeight;i.classList.toggle("scrollbar-visible",s),i.scrollTop=n!==void 0?n:i.scrollHeight,s&&(i.addEventListener("scroll",Q),t.push({dispose:()=>i.removeEventListener("scroll",Q)}),i.addEventListener("keydown",h),t.push({dispose:()=>i.removeEventListener("keydown",h)}))}}function Mt(i){let t=i.querySelector("."+G);if(t&&t.scrollHeight-t.scrollTop-t.clientHeight>2)return t.scrollTop}function q(i,t){let n=i.metadata;return typeof n=="object"&&n&&"scrollable"in n&&typeof n.scrollable=="boolean"?n.scrollable:t.outputScrolling}function C(i,t,n,s){let e=K(),r=q(i,s.settings),l={linesLimit:s.settings.lineLimit,scrollable:r,trustHtml:!1,error:n,linkifyFilePaths:s.settings.linkifyFilePaths};t.classList.add("output-stream");let c=r?Mt(t):void 0,a=It(t);if(a){let u=a.querySelector(`[output-item-id="${i.id}"]`);if(u)N(i,u,l);else{let m=I(i.id,i.text(),l);a.appendChild(m)}a.classList.toggle("scrollbar-visible",a.scrollHeight>a.clientHeight),a.scrollTop=c!==void 0?c:a.scrollHeight}else{let u=t.querySelector(`[output-item-id="${i.id}"]`),m=u?.parentElement;if(u&&m)N(i,u,l);else{let b=I(i.id,i.text(),l);for(m=document.createElement("div"),m.appendChild(b);t.firstChild;)t.firstChild.remove();t.appendChild(m)}m.classList.toggle("scrollable",r),t.classList.toggle("word-wrap",s.settings.outputWordWrap),e.push(s.onDidChangeSettings(b=>{t.classList.toggle("word-wrap",b.outputWordWrap)})),V(m,e,c)}return e}function tt(i,t,n){let s=K();W(t);let e=i.text(),r=q(i,n.settings),l={linesLimit:n.settings.lineLimit,scrollable:r,trustHtml:!1,linkifyFilePaths:n.settings.linkifyFilePaths},c=I(i.id,e,l);return c.classList.add("output-plaintext"),t.classList.toggle("word-wrap",n.settings.outputWordWrap),s.push(n.onDidChangeSettings(a=>{t.classList.toggle("word-wrap",a.outputWordWrap)})),c.classList.toggle("scrollable",r),t.appendChild(c),V(c,s),s}var Yt=i=>{let t=new Map,n=new Set,s=new Set,e=i,r=document.createElement("style");return r.textContent=`
	#container div.output.remove-padding {
		padding-left: 0;
		padding-right: 0;
	}
	.output-plaintext,
	.output-stream,
	.traceback {
		display: inline-block;
		width: 100%;
		line-height: var(--notebook-cell-output-line-height);
		font-family: var(--notebook-cell-output-font-family);
		font-size: var(--notebook-cell-output-font-size);
		user-select: text;
		-webkit-user-select: text;
		-ms-user-select: text;
		cursor: auto;
		word-wrap: break-word;
		/* text/stream output container should scroll but preserve newline character */
		white-space: pre;
	}
	/* When wordwrap turned on, force it to pre-wrap */
	#container div.output_container .word-wrap {
		white-space: pre-wrap;
	}
	#container div.output>div {
		padding-left: var(--notebook-output-node-left-padding);
		padding-right: var(--notebook-output-node-padding);
		box-sizing: border-box;
		border-width: 1px;
		border-style: solid;
		border-color: transparent;
	}
	#container div.output>div:focus {
		outline: 0;
		border-color: var(--theme-input-focus-border-color);
	}
	#container div.output .scrollable {
		overflow-y: auto;
		max-height: var(--notebook-cell-output-max-height);
	}
	#container div.output .scrollable.scrollbar-visible {
		border-color: var(--vscode-editorWidget-border);
	}
	#container div.output .scrollable.scrollbar-visible:focus {
		border-color: var(--theme-input-focus-border-color);
	}
	#container div.truncation-message {
		font-style: italic;
		font-family: var(--theme-font-family);
		padding-top: 4px;
	}
	#container div.output .scrollable div {
		cursor: text;
	}
	#container div.output .scrollable div a {
		cursor: pointer;
	}
	#container div.output .scrollable.more-above {
		box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset
	}
	.output-plaintext .code-bold,
	.output-stream .code-bold,
	.traceback .code-bold {
		font-weight: bold;
	}
	.output-plaintext .code-italic,
	.output-stream .code-italic,
	.traceback .code-italic {
		font-style: italic;
	}
	.output-plaintext .code-strike-through,
	.output-stream .code-strike-through,
	.traceback .code-strike-through {
		text-decoration: line-through;
	}
	.output-plaintext .code-underline,
	.output-stream .code-underline,
	.traceback .code-underline {
		text-decoration: underline;
	}
	#container ul.error-output-actions {
		margin: 0px;
		padding: 6px 0px 0px 6px;
		padding-inline-start: 0px;
	}
	#container .error-output-actions li {
		padding: 0px 4px 0px 4px;
		border-radius: 5px;
		height: 20px;
		display: inline-flex;
		cursor: pointer;
		border: solid 1px var(--vscode-notebook-cellToolbarSeparator);
	}
	#container .error-output-actions li.hover {
		background-color: var(--vscode-toolbar-hoverBackground);
	}
	#container .error-output-actions li:focus-within {
		border-color: var(--theme-input-focus-border-color);
	}
	#container .error-output-actions a:focus {
		outline: 0;
	}
	#container .error-output-actions li a {
		color: var(--vscode-foreground);
		text-decoration: none;
	}
	#container .error-output-header a {
		padding-right: 12px;
	}
	`,document.body.appendChild(r),{renderOutputItem:async(l,c,a)=>{switch(c.classList.add("remove-padding"),l.mime){case"text/html":case"image/svg+xml":{if(!i.workspace.isTrusted)return;await Dt(l,c,a,n);break}case"application/javascript":{if(!i.workspace.isTrusted)return;wt(l,c,a,s);break}case"image/gif":case"image/png":case"image/jpeg":case"image/git":{t.get(l.id)?.dispose();let u=Tt(l,c);t.set(l.id,u)}break;case"application/vnd.code.notebook.error":{t.get(l.id)?.dispose();let u=Ot(l,c,e,i.workspace.isTrusted);t.set(l.id,u)}break;case"application/vnd.code.notebook.stdout":case"application/x.notebook.stdout":case"application/x.notebook.stream":{t.get(l.id)?.dispose();let u=C(l,c,!1,e);t.set(l.id,u)}break;case"application/vnd.code.notebook.stderr":case"application/x.notebook.stderr":{t.get(l.id)?.dispose();let u=C(l,c,!0,e);t.set(l.id,u)}break;case"text/plain":{t.get(l.id)?.dispose();let u=tt(l,c,e);t.set(l.id,u)}break;default:if(l.mime.indexOf("text/")>-1){t.get(l.id)?.dispose();let u=tt(l,c,e);t.set(l.id,u)}break}c.querySelector("div")&&(c.querySelector("div").tabIndex=0)},disposeOutputItem:l=>{l?t.get(l)?.dispose():t.forEach(c=>c.dispose())},experimental_registerHtmlRenderingHook:l=>(n.add(l),{dispose:()=>{n.delete(l)}}),experimental_registerJavaScriptRenderingHook:l=>(s.add(l),{dispose:()=>{s.delete(l)}})}};export{Yt as activate};
ØA
—Eoúô