@runmedev/react-components 3.15.12 → 3.15.13

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.
@@ -35,25 +35,7 @@
35
35
  * @license
36
36
  * Copyright 2017 Google LLC
37
37
  * SPDX-License-Identifier: BSD-3-Clause
38
- */function T2(e){return Oe({...e,state:!0,attribute:!1})}/**
39
- * @license
40
- * Copyright 2021 Google LLC
41
- * SPDX-License-Identifier: BSD-3-Clause
42
- */function ct(e,t,r){return e?t(e):r==null?void 0:r(e)}var wh={exports:{}},Ch;function N2(){return Ch||(Ch=1,(function(e,t){(function(r,n){e.exports=n()})(globalThis,(()=>(()=>{var r={4567:function(l,s,a){var c=this&&this.__decorate||function(f,g,S,k){var I,N=arguments.length,E=N<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,g,S,k);else for(var R=f.length-1;R>=0;R--)(I=f[R])&&(E=(N<3?I(E):N>3?I(g,S,E):I(g,S))||E);return N>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(f,g){return function(S,k){g(S,k,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const h=a(9042),b=a(9924),_=a(844),C=a(4725),y=a(2585),d=a(3656);let p=s.AccessibilityManager=class extends _.Disposable{constructor(f,g,S,k){super(),this._terminal=f,this._coreBrowserService=S,this._renderService=k,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let I=0;I<this._terminal.rows;I++)this._rowElements[I]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[I]);if(this._topBoundaryFocusListener=I=>this._handleBoundaryFocus(I,0),this._bottomBoundaryFocusListener=I=>this._handleBoundaryFocus(I,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new b.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((I=>this._handleResize(I.rows)))),this.register(this._terminal.onRender((I=>this._refreshRows(I.start,I.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((I=>this._handleChar(I)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
43
- `)))),this.register(this._terminal.onA11yTab((I=>this._handleTab(I)))),this.register(this._terminal.onKey((I=>this._handleKey(I.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let g=0;g<f;g++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
44
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,g){this._liveRegionDebouncer.refresh(f,g,this._terminal.rows)}_renderRows(f,g){const S=this._terminal.buffer,k=S.lines.length.toString();for(let I=f;I<=g;I++){const N=S.lines.get(S.ydisp+I),E=[],R=(N==null?void 0:N.translateToString(!0,void 0,void 0,E))||"",O=(S.ydisp+I+1).toString(),V=this._rowElements[I];V&&(R.length===0?(V.innerText=" ",this._rowColumns.set(V,[0,1])):(V.textContent=R,this._rowColumns.set(V,E)),V.setAttribute("aria-posinset",O),V.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,g){const S=f.target,k=this._rowElements[g===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(g===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==k)return;let I,N;if(g===0?(I=S,N=this._rowElements.pop(),this._rowContainer.removeChild(N)):(I=this._rowElements.shift(),N=S,this._rowContainer.removeChild(I)),I.removeEventListener("focus",this._topBoundaryFocusListener),N.removeEventListener("focus",this._bottomBoundaryFocusListener),g===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(g===0?-1:1),this._rowElements[g===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){var f;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:g.anchorNode,offset:g.anchorOffset},k={node:g.focusNode,offset:g.focusOffset};if((S.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===k.node&&S.offset>k.offset)&&([S,k]=[k,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const I=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(I)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:I,offset:((f=I.textContent)==null?void 0:f.length)??0}),!this._rowContainer.contains(k.node))return;const N=({node:O,offset:V})=>{const M=O instanceof Text?O.parentNode:O;let D=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const ee=this._rowColumns.get(M);if(!ee)return console.warn("columns is null. Race condition?"),null;let ae=V<ee.length?ee[V]:ee.slice(-1)[0]+1;return ae>=this._terminal.cols&&(++D,ae=0),{row:D,column:ae}},E=N(S),R=N(k);if(E&&R){if(E.row>R.row||E.row===R.row&&E.column>=R.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(R.row-E.row)*this._terminal.cols-E.column+R.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let g=this._rowContainer.children.length;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);for(;this._rowElements.length>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=p=c([m(1,y.IInstantiationService),m(2,C.ICoreBrowserService),m(3,C.IRenderService)],p)},3614:(l,s)=>{function a(b){return b.replace(/\r?\n/g,"\r")}function c(b,_){return _?"\x1B[200~"+b+"\x1B[201~":b}function m(b,_,C,y){b=c(b=a(b),C.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(b,!0),_.value=""}function h(b,_,C){const y=C.getBoundingClientRect(),d=b.clientX-y.left-10,p=b.clientY-y.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${d}px`,_.style.top=`${p}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=c,s.copyHandler=function(b,_){b.clipboardData&&b.clipboardData.setData("text/plain",_.selectionText),b.preventDefault()},s.handlePasteEvent=function(b,_,C,y){b.stopPropagation(),b.clipboardData&&m(b.clipboardData.getData("text/plain"),_,C,y)},s.paste=m,s.moveTextAreaUnderMouseCursor=h,s.rightClickHandler=function(b,_,C,y,d){h(b,_,C),d&&y.rightClickSelect(b),_.value=y.selectionText,_.select()}},7239:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(m,h,b){this._css.set(m,h,b)}getCss(m,h){return this._css.get(m,h)}setColor(m,h,b){this._color.set(m,h,b)}getColor(m,h){return this._color.get(m,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,c,m,h){a.addEventListener(c,m,h);let b=!1;return{dispose:()=>{b||(b=!0,a.removeEventListener(c,m,h))}}}},3551:function(l,s,a){var c=this&&this.__decorate||function(p,f,g,S){var k,I=arguments.length,N=I<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(p,f,g,S);else for(var E=p.length-1;E>=0;E--)(k=p[E])&&(N=(I<3?k(N):I>3?k(f,g,N):k(f,g))||N);return I>3&&N&&Object.defineProperty(f,g,N),N},m=this&&this.__param||function(p,f){return function(g,S){f(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const h=a(3656),b=a(8460),_=a(844),C=a(2585),y=a(4725);let d=s.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(p,f,g,S,k){super(),this._element=p,this._mouseService=f,this._renderService=g,this._bufferService=S,this._linkProviderService=k,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{var I;this._lastMouseEvent=void 0,(I=this._activeProviderReplies)==null||I.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const g=p.composedPath();for(let S=0;S<g.length;S++){const k=g[S];if(k.classList.contains("xterm"))break;if(k.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,f){var g,S;this._activeProviderReplies&&f||((g=this._activeProviderReplies)==null||g.forEach((I=>{I==null||I.forEach((N=>{N.link.dispose&&N.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let k=!1;for(const[I,N]of this._linkProviderService.linkProviders.entries())f?(S=this._activeProviderReplies)!=null&&S.get(I)&&(k=this._checkLinkProviderResult(I,p,k)):N.provideLinks(p.y,(E=>{var R,O;if(this._isMouseOut)return;const V=E==null?void 0:E.map((M=>({link:M})));(R=this._activeProviderReplies)==null||R.set(I,V),k=this._checkLinkProviderResult(I,p,k),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,f){const g=new Set;for(let S=0;S<f.size;S++){const k=f.get(S);if(k)for(let I=0;I<k.length;I++){const N=k[I],E=N.link.range.start.y<p?0:N.link.range.start.x,R=N.link.range.end.y>p?this._bufferService.cols:N.link.range.end.x;for(let O=E;O<=R;O++){if(g.has(O)){k.splice(I--,1);break}g.add(O)}}}}_checkLinkProviderResult(p,f,g){var S;if(!this._activeProviderReplies)return g;const k=this._activeProviderReplies.get(p);let I=!1;for(let N=0;N<p;N++)this._activeProviderReplies.has(N)&&!this._activeProviderReplies.get(N)||(I=!0);if(!I&&k){const N=k.find((E=>this._linkAtPosition(E.link,f)));N&&(g=!0,this._handleNewLink(N))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!g)for(let N=0;N<this._activeProviderReplies.size;N++){const E=(S=this._activeProviderReplies.get(N))==null?void 0:S.find((R=>this._linkAtPosition(R.link,f)));if(E){g=!0,this._handleNewLink(E);break}}return g}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,f){this._currentLink&&this._lastMouseEvent&&(!p||!f||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(p.link,f)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var g,S;return(S=(g=this._currentLink)==null?void 0:g.state)==null?void 0:S.decorations.pointerCursor},set:g=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==g&&(this._currentLink.state.decorations.pointerCursor=g,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",g))}},underline:{get:()=>{var g,S;return(S=(g=this._currentLink)==null?void 0:g.state)==null?void 0:S.decorations.underline},set:g=>{var S,k,I;(S=this._currentLink)!=null&&S.state&&((I=(k=this._currentLink)==null?void 0:k.state)==null?void 0:I.decorations.underline)!==g&&(this._currentLink.state.decorations.underline=g,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,g))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((g=>{if(!this._currentLink)return;const S=g.start===0?0:g.start+1+this._bufferService.buffer.ydisp,k=this._bufferService.buffer.ydisp+1+g.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=k&&(this._clearCurrentLink(S,k),this._lastMouseEvent)){const I=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);I&&this._askForLink(I,!1)}}))))}_linkHover(p,f,g){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(g,f.text)}_fireUnderlineEvent(p,f){const g=p.range,S=this._bufferService.buffer.ydisp,k=this._createLinkUnderlineEvent(g.start.x-1,g.start.y-S-1,g.end.x,g.end.y-S-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(k)}_linkLeave(p,f,g){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(g,f.text)}_linkAtPosition(p,f){const g=p.range.start.y*this._bufferService.cols+p.range.start.x,S=p.range.end.y*this._bufferService.cols+p.range.end.x,k=f.y*this._bufferService.cols+f.x;return g<=k&&k<=S}_positionFromMouseEvent(p,f,g){const S=g.getCoords(p,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,f,g,S,k){return{x1:p,y1:f,x2:g,y2:S,cols:this._bufferService.cols,fg:k}}};s.Linkifier=d=c([m(1,y.IMouseService),m(2,y.IRenderService),m(3,C.IBufferService),m(4,y.ILinkProviderService)],d)},9042:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,f){var g,S=arguments.length,k=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,d,p,f);else for(var I=y.length-1;I>=0;I--)(g=y[I])&&(k=(S<3?g(k):S>3?g(d,p,k):g(d,p))||k);return S>3&&k&&Object.defineProperty(d,p,k),k},m=this&&this.__param||function(y,d){return function(p,f){d(p,f,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const h=a(511),b=a(2585);let _=s.OscLinkProvider=class{constructor(y,d,p){this._bufferService=y,this._optionsService=d,this._oscLinkService=p}provideLinks(y,d){var p;const f=this._bufferService.buffer.lines.get(y-1);if(!f)return void d(void 0);const g=[],S=this._optionsService.rawOptions.linkHandler,k=new h.CellData,I=f.getTrimmedLength();let N=-1,E=-1,R=!1;for(let O=0;O<I;O++)if(E!==-1||f.hasContent(O)){if(f.loadCell(O,k),k.hasExtendedAttrs()&&k.extended.urlId){if(E===-1){E=O,N=k.extended.urlId;continue}R=k.extended.urlId!==N}else E!==-1&&(R=!0);if(R||E!==-1&&O===I-1){const V=(p=this._oscLinkService.getLinkData(N))==null?void 0:p.uri;if(V){const M={start:{x:E+1,y},end:{x:O+(R||O!==I-1?0:1),y}};let D=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const ee=new URL(V);["http:","https:"].includes(ee.protocol)||(D=!0)}catch{D=!0}D||g.push({text:V,range:M,activate:(ee,ae)=>S?S.activate(ee,ae,M):C(0,ae),hover:(ee,ae)=>{var ge;return(ge=S==null?void 0:S.hover)==null?void 0:ge.call(S,ee,ae,M)},leave:(ee,ae)=>{var ge;return(ge=S==null?void 0:S.leave)==null?void 0:ge.call(S,ee,ae,M)}})}R=!1,k.hasExtendedAttrs()&&k.extended.urlId?(E=O,N=k.extended.urlId):(E=-1,N=-1)}}d(g)}};function C(y,d){if(confirm(`Do you want to navigate to ${d}?
45
-
46
- WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=_=c([m(0,b.IBufferService),m(1,b.IOptionsService),m(2,b.IOscLinkService)],_)},6193:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,c,m){this._rowCount=m,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=a(3614),m=a(3656),h=a(3551),b=a(9042),_=a(3730),C=a(1680),y=a(3107),d=a(5744),p=a(2950),f=a(1296),g=a(428),S=a(4269),k=a(5114),I=a(8934),N=a(3230),E=a(9312),R=a(4725),O=a(6731),V=a(8055),M=a(8969),D=a(8460),ee=a(844),ae=a(6114),ge=a(8437),ke=a(2584),re=a(7399),B=a(5941),U=a(9074),W=a(2585),K=a(5435),ue=a(4567),ve=a(779);class _e extends M.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(J={}){super(J),this.browser=ae,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new ee.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(W.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ve.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((L,ne)=>this.refresh(L,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((L=>this._reportWindowsOptions(L)))),this.register(this._inputHandler.onColor((L=>this._handleColorEvent(L)))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((L=>this._afterResize(L.cols,L.rows)))),this.register((0,ee.toDisposable)((()=>{var L,ne;this._customKeyEventHandler=void 0,(ne=(L=this.element)==null?void 0:L.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(J){if(this._themeService)for(const L of J){let ne,se="";switch(L.index){case 256:ne="foreground",se="10";break;case 257:ne="background",se="11";break;case 258:ne="cursor",se="12";break;default:ne="ansi",se="4;"+L.index}switch(L.type){case 0:const Te=V.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${ke.C0.ESC}]${se};${(0,B.toRgbString)(Te)}${ke.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((pe=>pe.ansi[L.index]=V.channels.toColor(...L.color)));else{const pe=ne;this._themeService.modifyColors((Ue=>Ue[pe]=V.channels.toColor(...L.color)))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(J){J?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ue.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(J){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ke.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var J;return(J=this.textarea)==null?void 0:J.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ke.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const J=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(J);if(!L)return;const ne=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,Te=L.getWidth(ne),pe=this._renderService.dimensions.css.cell.width*Te,Ue=this.buffer.y*this._renderService.dimensions.css.cell.height,nt=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=nt+"px",this.textarea.style.top=Ue+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(L=>{this.hasSelection()&&(0,c.copyHandler)(L,this._selectionService)})));const J=L=>(0,c.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",J)),this.register((0,m.addDisposableDomListener)(this.element,"paste",J)),ae.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(L=>{L.button===2&&(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(L=>{(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ae.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(L=>{L.button===1&&(0,c.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(J=>this._keyUp(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(J=>this._keyDown(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(J=>this._keyPress(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(J=>this._compositionHelper.compositionupdate(J)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(J=>this._inputEvent(J)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(J){var L;if(!J)throw new Error("Terminal requires a parent element.");if(J.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((L=this.element)==null?void 0:L.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=J.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),J.appendChild(this.element);const ne=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),ne.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),ne.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),ae.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(k.CoreBrowserService,this.textarea,J.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(g.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(N.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(I.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(ne);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(ue.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const J=this,L=this.element;function ne(pe){const Ue=J._mouseService.getMouseReportCoords(pe,J.screenElement);if(!Ue)return!1;let nt,Je;switch(pe.overrideType||pe.type){case"mousemove":Je=32,pe.buttons===void 0?(nt=3,pe.button!==void 0&&(nt=pe.button<3?pe.button:3)):nt=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Je=0,nt=pe.button<3?pe.button:3;break;case"mousedown":Je=1,nt=pe.button<3?pe.button:3;break;case"wheel":if(J._customWheelEventHandler&&J._customWheelEventHandler(pe)===!1||J.viewport.getLinesScrolled(pe)===0)return!1;Je=pe.deltaY<0?0:1,nt=4;break;default:return!1}return!(Je===void 0||nt===void 0||nt>4)&&J.coreMouseService.triggerMouseEvent({col:Ue.col,row:Ue.row,x:Ue.x,y:Ue.y,button:nt,action:Je,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Te={mouseup:pe=>(ne(pe),pe.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(pe)),wheel:pe=>(ne(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ne(pe)},mousemove:pe=>{pe.buttons||ne(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?se.mousemove||(L.addEventListener("mousemove",Te.mousemove),se.mousemove=Te.mousemove):(L.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&pe?se.wheel||(L.addEventListener("wheel",Te.wheel,{passive:!1}),se.wheel=Te.wheel):(L.removeEventListener("wheel",se.wheel),se.wheel=null),2&pe?se.mouseup||(se.mouseup=Te.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&pe?se.mousedrag||(se.mousedrag=Te.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(L,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ne(pe),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(pe)}))),this.register((0,m.addDisposableDomListener)(L,"wheel",(pe=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Ue=this.viewport.getLinesScrolled(pe);if(Ue===0)return;const nt=ke.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Je="";for(let wt=0;wt<Math.abs(Ue);wt++)Je+=nt;return this.coreService.triggerDataEvent(Je,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(L,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(L,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(J,L){var ne;(ne=this._renderService)==null||ne.refreshRows(J,L)}updateCursorStyle(J){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(J)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(J,L,ne=0){var se;ne===1?(super.scrollLines(J,L,ne),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(J)}paste(J){(0,c.paste)(J,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(J){this._customKeyEventHandler=J}attachCustomWheelEventHandler(J){this._customWheelEventHandler=J}registerLinkProvider(J){return this._linkProviderService.registerLinkProvider(J)}registerCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(J);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(J)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(J){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+J)}registerDecoration(J){return this._decorationService.registerDecoration(J)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(J,L,ne){this._selectionService.setSelection(J,L,ne)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var J;(J=this._selectionService)==null||J.clearSelection()}selectAll(){var J;(J=this._selectionService)==null||J.selectAll()}selectLines(J,L){var ne;(ne=this._selectionService)==null||ne.selectLines(J,L)}_keyDown(J){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&J.altKey;if(!L&&!this._compositionHelper.keydown(J))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||J.key!=="Dead"&&J.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,re.evaluateKeyboardEvent)(J,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(J),ne.type===3||ne.type===2){const se=this.rows-1;return this.scrollLines(ne.type===2?-se:se),this.cancel(J,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,J)||(ne.cancel&&this.cancel(J,!0),!ne.key||!!(J.key&&!J.ctrlKey&&!J.altKey&&!J.metaKey&&J.key.length===1&&J.key.charCodeAt(0)>=65&&J.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==ke.C0.ETX&&ne.key!==ke.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||J.altKey||J.ctrlKey?this.cancel(J,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(J,L){const ne=J.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||J.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||J.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?ne:ne&&(!L.keyCode||L.keyCode>47)}_keyUp(J){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1||((function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18})(J)||this.focus(),this.updateCursorStyle(J),this._keyPressHandled=!1)}_keyPress(J){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(this.cancel(J),J.charCode)L=J.charCode;else if(J.which===null||J.which===void 0)L=J.keyCode;else{if(J.which===0||J.charCode===0)return!1;L=J.which}return!(!L||(J.altKey||J.ctrlKey||J.metaKey)&&!this._isThirdLevelShift(this.browser,J)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(J){if(J.data&&J.inputType==="insertText"&&(!J.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=J.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(J),!0}return!1}resize(J,L){J!==this.cols||L!==this.rows?super.resize(J,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(J,L){var ne,se;(ne=this._charSizeService)==null||ne.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var J;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(ge.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(J=this.viewport)==null||J.reset(),this.refresh(0,this.rows-1)}}reset(){var J,L;this.options.rows=this.rows,this.options.cols=this.cols;const ne=this._customKeyEventHandler;this._setup(),super.reset(),(J=this._selectionService)==null||J.reset(),this._decorationService.reset(),(L=this.viewport)==null||L.reset(),this._customKeyEventHandler=ne,this.refresh(0,this.rows-1)}clearTextureAtlas(){var J;(J=this._renderService)==null||J.clearTextureAtlas()}_reportFocus(){var J;(J=this.element)!=null&&J.classList.contains("focus")?this.coreService.triggerDataEvent(ke.C0.ESC+"[I"):this.coreService.triggerDataEvent(ke.C0.ESC+"[O")}_reportWindowsOptions(J){if(this._renderService)switch(J){case K.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ke.C0.ESC}[4;${ne};${L}t`);break;case K.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),Te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ke.C0.ESC}[6;${Te};${se}t`)}}cancel(J,L){if(this.options.cancelEvents||L)return J.preventDefault(),J.stopPropagation(),!1}}s.Terminal=_e},9924:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,m){this._rowCount=m,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=h-this._lastRefreshMs,_=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(l,s,a){var c=this&&this.__decorate||function(p,f,g,S){var k,I=arguments.length,N=I<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(p,f,g,S);else for(var E=p.length-1;E>=0;E--)(k=p[E])&&(N=(I<3?k(N):I>3?k(f,g,N):k(f,g))||N);return I>3&&N&&Object.defineProperty(f,g,N),N},m=this&&this.__param||function(p,f){return function(g,S){f(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const h=a(3656),b=a(4725),_=a(8460),C=a(844),y=a(2585);let d=s.Viewport=class extends C.Disposable{constructor(p,f,g,S,k,I,N,E){super(),this._viewportElement=p,this._scrollArea=f,this._bufferService=g,this._optionsService=S,this._charSizeService=k,this._renderService=I,this._coreBrowserService=N,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(p){if(p)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(p,f){const g=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&g<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const f=this._getPixelsScrolled(p);return f!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(p,f){var g;let S,k="";const I=[],N=f??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let R=p;R<N;R++){const O=E.get(R);if(!O)continue;const V=(g=E.get(R+1))==null?void 0:g.isWrapped;if(k+=O.translateToString(!V),!V||R===E.length-1){const M=document.createElement("div");M.textContent=k,I.push(M),k.length>0&&(S=M),k=""}}return{bufferElements:I,cursorElement:S}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(p,f){const g=this._optionsService.rawOptions.fastScrollModifier;return g==="alt"&&f.altKey||g==="ctrl"&&f.ctrlKey||g==="shift"&&f.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const f=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}};s.Viewport=d=c([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,b.ICharSizeService),m(5,b.IRenderService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],d)},3107:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,f){var g,S=arguments.length,k=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,d,p,f);else for(var I=y.length-1;I>=0;I--)(g=y[I])&&(k=(S<3?g(k):S>3?g(d,p,k):g(d,p))||k);return S>3&&k&&Object.defineProperty(d,p,k),k},m=this&&this.__param||function(y,d){return function(p,f){d(p,f,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const h=a(4725),b=a(844),_=a(2585);let C=s.BufferDecorationRenderer=class extends b.Disposable{constructor(y,d,p,f,g){super(),this._screenElement=y,this._bufferService=d,this._coreBrowserService=p,this._decorationService=f,this._renderService=g,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((S=>this._removeDecoration(S)))),this.register((0,b.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const y of this._decorationService.decorations)this._renderDecoration(y);this._dimensionsChanged=!1}_renderDecoration(y){this._refreshStyle(y),this._dimensionsChanged&&this._refreshXPosition(y)}_createElement(y){var d;const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",((d=y==null?void 0:y.options)==null?void 0:d.layer)==="top"),p.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=y.options.x??0;return f&&f>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(y,p),p}_refreshStyle(y){const d=y.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let p=this._decorationElements.get(y);p||(p=this._createElement(y),y.element=p,this._decorationElements.set(y,p),this._container.appendChild(p),y.onDispose((()=>{this._decorationElements.delete(y),p.remove()}))),p.style.top=d*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(p)}}_refreshXPosition(y,d=y.element){if(!d)return;const p=y.options.x??0;(y.options.anchor||"left")==="right"?d.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var d;(d=this._decorationElements.get(y))==null||d.remove(),this._decorationElements.delete(y),y.dispose()}};s.BufferDecorationRenderer=C=c([m(1,_.IBufferService),m(2,h.ICoreBrowserService),m(3,_.IDecorationService),m(4,h.IRenderService)],C)},5871:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,m){return c>=a.startBufferLine-this._linePadding[m||"full"]&&c<=a.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(l,s,a){var c=this&&this.__decorate||function(g,S,k,I){var N,E=arguments.length,R=E<3?S:I===null?I=Object.getOwnPropertyDescriptor(S,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,S,k,I);else for(var O=g.length-1;O>=0;O--)(N=g[O])&&(R=(E<3?N(R):E>3?N(S,k,R):N(S,k))||R);return E>3&&R&&Object.defineProperty(S,k,R),R},m=this&&this.__param||function(g,S){return function(k,I){S(k,I,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const h=a(5871),b=a(4725),_=a(844),C=a(2585),y={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let f=s.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(g,S,k,I,N,E,R){var O;super(),this._viewportElement=g,this._screenElement=S,this._bufferService=k,this._decorationService=I,this._renderService=N,this._optionsService=E,this._coreBrowserService=R,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const V=this._canvas.getContext("2d");if(!V)throw new Error("Ctx cannot be null");this._ctx=V,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var M;(M=this._canvas)==null||M.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const g=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=g,d.center=S,d.right=g,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=d.left,p.right=d.left+d.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const g=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(g,12),6)*this._coreBrowserService.dpr);y.left=S,y.center=S,y.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const g=this._colorZoneStore.zones;for(const S of g)S.position!=="full"&&this._renderColorZone(S);for(const S of g)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(g){this._ctx.fillStyle=g.color,this._ctx.fillRect(p[g.position||"full"],Math.round((this._canvas.height-1)*(g.startBufferLine/this._bufferService.buffers.active.lines.length)-y[g.position||"full"]/2),d[g.position||"full"],Math.round((this._canvas.height-1)*((g.endBufferLine-g.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[g.position||"full"]))}_queueRefresh(g,S){this._shouldUpdateDimensions=g||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=f=c([m(2,C.IBufferService),m(3,C.IDecorationService),m(4,b.IRenderService),m(5,C.IOptionsService),m(6,b.ICoreBrowserService)],f)},2950:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,f){var g,S=arguments.length,k=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,d,p,f);else for(var I=y.length-1;I>=0;I--)(g=y[I])&&(k=(S<3?g(k):S>3?g(d,p,k):g(d,p))||k);return S>3&&k&&Object.defineProperty(d,p,k),k},m=this&&this.__param||function(y,d){return function(p,f){d(p,f,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const h=a(4725),b=a(2585),_=a(2584);let C=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,d,p,f,g,S){this._textarea=y,this._compositionView=d,this._bufferService=p,this._optionsService=f,this._coreService=g,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,p=d.replace(y,"");this._dataAlreadySent=p,d.length>y.length?this._coreService.triggerDataEvent(p,!0):d.length<y.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):d.length===y.length&&d!==y&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,g=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=g+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=g+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}y||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=C=c([m(2,b.IBufferService),m(3,b.IOptionsService),m(4,b.ICoreService),m(5,h.IRenderService)],C)},9806:(l,s)=>{function a(c,m,h){const b=h.getBoundingClientRect(),_=c.getComputedStyle(h),C=parseInt(_.getPropertyValue("padding-left")),y=parseInt(_.getPropertyValue("padding-top"));return[m.clientX-b.left-C,m.clientY-b.top-y]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(c,m,h,b,_,C,y,d,p){if(!C)return;const f=a(c,m,h);return f?(f[0]=Math.ceil((f[0]+(p?y/2:0))/y),f[1]=Math.ceil(f[1]/d),f[0]=Math.min(Math.max(f[0],1),b+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),_),f):void 0}},9504:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=a(2584);function m(d,p,f,g){const S=d-h(d,f),k=p-h(p,f),I=Math.abs(S-k)-(function(N,E,R){let O=0;const V=N-h(N,R),M=E-h(E,R);for(let D=0;D<Math.abs(V-M);D++){const ee=b(N,E)==="A"?-1:1,ae=R.buffer.lines.get(V+ee*D);ae!=null&&ae.isWrapped&&O++}return O})(d,p,f);return y(I,C(b(d,p),g))}function h(d,p){let f=0,g=p.buffer.lines.get(d),S=g==null?void 0:g.isWrapped;for(;S&&d>=0&&d<p.rows;)f++,g=p.buffer.lines.get(--d),S=g==null?void 0:g.isWrapped;return f}function b(d,p){return d>p?"A":"B"}function _(d,p,f,g,S,k){let I=d,N=p,E="";for(;I!==f||N!==g;)I+=S?1:-1,S&&I>k.cols-1?(E+=k.buffer.translateBufferLineToString(N,!1,d,I),I=0,d=0,N++):!S&&I<0&&(E+=k.buffer.translateBufferLineToString(N,!1,0,d+1),I=k.cols-1,d=I,N--);return E+k.buffer.translateBufferLineToString(N,!1,d,I)}function C(d,p){const f=p?"O":"[";return c.C0.ESC+f+d}function y(d,p){d=Math.floor(d);let f="";for(let g=0;g<d;g++)f+=p;return f}s.moveToCellSequence=function(d,p,f,g){const S=f.buffer.x,k=f.buffer.y;if(!f.buffer.hasScrollback)return(function(E,R,O,V,M,D){return m(R,V,M,D).length===0?"":y(_(E,R,E,R-h(R,M),!1,M).length,C("D",D))})(S,k,0,p,f,g)+m(k,p,f,g)+(function(E,R,O,V,M,D){let ee;ee=m(R,V,M,D).length>0?V-h(V,M):R;const ae=V,ge=(function(ke,re,B,U,W,K){let ue;return ue=m(B,U,W,K).length>0?U-h(U,W):re,ke<B&&ue<=U||ke>=B&&ue<U?"C":"D"})(E,R,O,V,M,D);return y(_(E,ee,O,ae,ge==="C",M).length,C(ge,D))})(S,k,d,p,f,g);let I;if(k===p)return I=S>d?"D":"C",y(Math.abs(S-d),C(I,g));I=k>p?"D":"C";const N=Math.abs(k-p);return y((function(E,R){return R.cols-E})(k>p?d:S,f)+(N-1)*f.cols+1+((k>p?S:d)-1),C(I,g))}},1296:function(l,s,a){var c=this&&this.__decorate||function(D,ee,ae,ge){var ke,re=arguments.length,B=re<3?ee:ge===null?ge=Object.getOwnPropertyDescriptor(ee,ae):ge;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(D,ee,ae,ge);else for(var U=D.length-1;U>=0;U--)(ke=D[U])&&(B=(re<3?ke(B):re>3?ke(ee,ae,B):ke(ee,ae))||B);return re>3&&B&&Object.defineProperty(ee,ae,B),B},m=this&&this.__param||function(D,ee){return function(ae,ge){ee(ae,ge,D)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const h=a(3787),b=a(2550),_=a(2223),C=a(6171),y=a(6052),d=a(4725),p=a(8055),f=a(8460),g=a(844),S=a(2585),k="xterm-dom-renderer-owner-",I="xterm-rows",N="xterm-fg-",E="xterm-bg-",R="xterm-focus",O="xterm-selection";let V=1,M=s.DomRenderer=class extends g.Disposable{constructor(D,ee,ae,ge,ke,re,B,U,W,K,ue,ve,_e){super(),this._terminal=D,this._document=ee,this._element=ae,this._screenElement=ge,this._viewportElement=ke,this._helperContainer=re,this._linkifier2=B,this._charSizeService=W,this._optionsService=K,this._bufferService=ue,this._coreBrowserService=ve,this._themeService=_e,this._terminalClass=V++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(I),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Ce=>this._injectCss(Ce)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(k+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Ce=>this._handleLinkHover(Ce)))),this.register(this._linkifier2.onHideLinkUnderline((Ce=>this._handleLinkLeave(Ce)))),this.register((0,g.toDisposable)((()=>{this._element.classList.remove(k+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new b.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const ae of this._rowElements)ae.style.width=`${this.dimensions.css.canvas.width}px`,ae.style.height=`${this.dimensions.css.cell.height}px`,ae.style.lineHeight=`${this.dimensions.css.cell.height}px`,ae.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const ee=`${this._terminalSelector} .${I} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=ee,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let ee=`${this._terminalSelector} .${I} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;ee+=`${this._terminalSelector} .${I} .xterm-dim { color: ${p.color.multiplyOpacity(D.foreground,.5).css};}`,ee+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const ae=`blink_underline_${this._terminalClass}`,ge=`blink_bar_${this._terminalClass}`,ke=`blink_block_${this._terminalClass}`;ee+=`@keyframes ${ae} { 50% { border-bottom-style: hidden; }}`,ee+=`@keyframes ${ge} { 50% { box-shadow: none; }}`,ee+=`@keyframes ${ke} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,ee+=`${this._terminalSelector} .${I}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ae} 1s step-end infinite;}${this._terminalSelector} .${I}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${ge} 1s step-end infinite;}${this._terminalSelector} .${I}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ke} 1s step-end infinite;}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,ee+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[re,B]of D.ansi.entries())ee+=`${this._terminalSelector} .${N}${re} { color: ${B.css}; }${this._terminalSelector} .${N}${re}.xterm-dim { color: ${p.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${E}${re} { background-color: ${B.css}; }`;ee+=`${this._terminalSelector} .${N}${_.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(D.background).css}; }${this._terminalSelector} .${N}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=ee}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,ee){for(let ae=this._rowElements.length;ae<=ee;ae++){const ge=this._document.createElement("div");this._rowContainer.appendChild(ge),this._rowElements.push(ge)}for(;this._rowElements.length>ee;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,ee){this._refreshRowElements(D,ee),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,ee,ae){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,ee,ae),this.renderRows(0,this._bufferService.rows-1),!D||!ee)return;this._selectionRenderModel.update(this._terminal,D,ee,ae);const ge=this._selectionRenderModel.viewportStartRow,ke=this._selectionRenderModel.viewportEndRow,re=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(re>=this._bufferService.rows||B<0)return;const U=this._document.createDocumentFragment();if(ae){const W=D[0]>ee[0];U.appendChild(this._createSelectionElement(re,W?ee[0]:D[0],W?D[0]:ee[0],B-re+1))}else{const W=ge===re?D[0]:0,K=re===ke?ee[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(re,W,K));const ue=B-re-1;if(U.appendChild(this._createSelectionElement(re+1,0,this._bufferService.cols,ue)),re!==B){const ve=ke===B?ee[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(B,0,ve))}}this._selectionContainer.appendChild(U)}_createSelectionElement(D,ee,ae,ge=1){const ke=this._document.createElement("div"),re=ee*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(ae-ee);return re+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-re),ke.style.height=ge*this.dimensions.css.cell.height+"px",ke.style.top=D*this.dimensions.css.cell.height+"px",ke.style.left=`${re}px`,ke.style.width=`${B}px`,ke}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const D of this._rowElements)D.replaceChildren()}renderRows(D,ee){const ae=this._bufferService.buffer,ge=ae.ybase+ae.y,ke=Math.min(ae.x,this._bufferService.cols-1),re=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let W=D;W<=ee;W++){const K=W+ae.ydisp,ue=this._rowElements[W],ve=ae.lines.get(K);if(!ue||!ve)break;ue.replaceChildren(...this._rowFactory.createRow(ve,K,K===ge,B,U,ke,re,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${k}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,ee,ae,ge,ke,re){ae<0&&(D=0),ge<0&&(ee=0);const B=this._bufferService.rows-1;ae=Math.max(Math.min(ae,B),0),ge=Math.max(Math.min(ge,B),0),ke=Math.min(ke,this._bufferService.cols);const U=this._bufferService.buffer,W=U.ybase+U.y,K=Math.min(U.x,ke-1),ue=this._optionsService.rawOptions.cursorBlink,ve=this._optionsService.rawOptions.cursorStyle,_e=this._optionsService.rawOptions.cursorInactiveStyle;for(let Ce=ae;Ce<=ge;++Ce){const J=Ce+U.ydisp,L=this._rowElements[Ce],ne=U.lines.get(J);if(!L||!ne)break;L.replaceChildren(...this._rowFactory.createRow(ne,J,J===W,ve,_e,K,ue,this.dimensions.css.cell.width,this._widthCache,re?Ce===ae?D:0:-1,re?(Ce===ge?ee:ke)-1:-1))}}};s.DomRenderer=M=c([m(7,S.IInstantiationService),m(8,d.ICharSizeService),m(9,S.IOptionsService),m(10,S.IBufferService),m(11,d.ICoreBrowserService),m(12,d.IThemeService)],M)},3787:function(l,s,a){var c=this&&this.__decorate||function(I,N,E,R){var O,V=arguments.length,M=V<3?N:R===null?R=Object.getOwnPropertyDescriptor(N,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(I,N,E,R);else for(var D=I.length-1;D>=0;D--)(O=I[D])&&(M=(V<3?O(M):V>3?O(N,E,M):O(N,E))||M);return V>3&&M&&Object.defineProperty(N,E,M),M},m=this&&this.__param||function(I,N){return function(E,R){N(E,R,I)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const h=a(2223),b=a(643),_=a(511),C=a(2585),y=a(8055),d=a(4725),p=a(4269),f=a(6171),g=a(3734);let S=s.DomRendererRowFactory=class{constructor(I,N,E,R,O,V,M){this._document=I,this._characterJoinerService=N,this._optionsService=E,this._coreBrowserService=R,this._coreService=O,this._decorationService=V,this._themeService=M,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(I,N,E){this._selectionStart=I,this._selectionEnd=N,this._columnSelectMode=E}createRow(I,N,E,R,O,V,M,D,ee,ae,ge){const ke=[],re=this._characterJoinerService.getJoinedCharacters(N),B=this._themeService.colors;let U,W=I.getNoBgTrimmedLength();E&&W<V+1&&(W=V+1);let K=0,ue="",ve=0,_e=0,Ce=0,J=!1,L=0,ne=!1,se=0;const Te=[],pe=ae!==-1&&ge!==-1;for(let Ue=0;Ue<W;Ue++){I.loadCell(Ue,this._workCell);let nt=this._workCell.getWidth();if(nt===0)continue;let Je=!1,wt=Ue,Le=this._workCell;if(re.length>0&&Ue===re[0][0]){Je=!0;const $e=re.shift();Le=new p.JoinedCellData(this._workCell,I.translateToString(!0,$e[0],$e[1]),$e[1]-$e[0]),wt=$e[1]-1,nt=Le.getWidth()}const Pr=this._isCellInSelection(Ue,N),zn=E&&Ue===V,Wr=pe&&Ue>=ae&&Ue<=ge;let Ot=!1;this._decorationService.forEachDecorationAtCell(Ue,N,void 0,($e=>{Ot=!0}));let jr=Le.getChars()||b.WHITESPACE_CELL_CHAR;if(jr===" "&&(Le.isUnderline()||Le.isOverline())&&(jr=" "),se=nt*D-ee.get(jr,Le.isBold(),Le.isItalic()),U){if(K&&(Pr&&ne||!Pr&&!ne&&Le.bg===ve)&&(Pr&&ne&&B.selectionForeground||Le.fg===_e)&&Le.extended.ext===Ce&&Wr===J&&se===L&&!zn&&!Je&&!Ot){Le.isInvisible()?ue+=b.WHITESPACE_CELL_CHAR:ue+=jr,K++;continue}K&&(U.textContent=ue),U=this._document.createElement("span"),K=0,ue=""}else U=this._document.createElement("span");if(ve=Le.bg,_e=Le.fg,Ce=Le.extended.ext,J=Wr,L=se,ne=Pr,Je&&V>=Ue&&V<=wt&&(V=Ue),!this._coreService.isCursorHidden&&zn&&this._coreService.isCursorInitialized){if(Te.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&Te.push("xterm-cursor-blink"),Te.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":Te.push("xterm-cursor-outline");break;case"block":Te.push("xterm-cursor-block");break;case"bar":Te.push("xterm-cursor-bar");break;case"underline":Te.push("xterm-cursor-underline")}}if(Le.isBold()&&Te.push("xterm-bold"),Le.isItalic()&&Te.push("xterm-italic"),Le.isDim()&&Te.push("xterm-dim"),ue=Le.isInvisible()?b.WHITESPACE_CELL_CHAR:Le.getChars()||b.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(Te.push(`xterm-underline-${Le.extended.underlineStyle}`),ue===" "&&(ue=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${g.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let $e=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&$e<8&&($e+=8),U.style.textDecorationColor=B.ansi[$e].css}Le.isOverline()&&(Te.push("xterm-overline"),ue===" "&&(ue=" ")),Le.isStrikethrough()&&Te.push("xterm-strikethrough"),Wr&&(U.style.textDecoration="underline");let ht=Le.getFgColor(),Er=Le.getFgColorMode(),Ct=Le.getBgColor(),Lt=Le.getBgColorMode();const Yt=!!Le.isInverse();if(Yt){const $e=ht;ht=Ct,Ct=$e;const cn=Er;Er=Lt,Lt=cn}let jt,nr,Zt,ir=!1;switch(this._decorationService.forEachDecorationAtCell(Ue,N,void 0,($e=>{$e.options.layer!=="top"&&ir||($e.backgroundColorRGB&&(Lt=50331648,Ct=$e.backgroundColorRGB.rgba>>8&16777215,jt=$e.backgroundColorRGB),$e.foregroundColorRGB&&(Er=50331648,ht=$e.foregroundColorRGB.rgba>>8&16777215,nr=$e.foregroundColorRGB),ir=$e.options.layer==="top")})),!ir&&Pr&&(jt=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Ct=jt.rgba>>8&16777215,Lt=50331648,ir=!0,B.selectionForeground&&(Er=50331648,ht=B.selectionForeground.rgba>>8&16777215,nr=B.selectionForeground)),ir&&Te.push("xterm-decoration-top"),Lt){case 16777216:case 33554432:Zt=B.ansi[Ct],Te.push(`xterm-bg-${Ct}`);break;case 50331648:Zt=y.channels.toColor(Ct>>16,Ct>>8&255,255&Ct),this._addStyle(U,`background-color:#${k((Ct>>>0).toString(16),"0",6)}`);break;default:Yt?(Zt=B.foreground,Te.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Zt=B.background}switch(jt||Le.isDim()&&(jt=y.color.multiplyOpacity(Zt,.5)),Er){case 16777216:case 33554432:Le.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(U,Zt,B.ansi[ht],Le,jt,void 0)||Te.push(`xterm-fg-${ht}`);break;case 50331648:const $e=y.channels.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(U,Zt,$e,Le,jt,nr)||this._addStyle(U,`color:#${k(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,Zt,B.foreground,Le,jt,nr)||Yt&&Te.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Te.length&&(U.className=Te.join(" "),Te.length=0),zn||Je||Ot?U.textContent=ue:K++,se!==this.defaultSpacing&&(U.style.letterSpacing=`${se}px`),ke.push(U),Ue=wt}return U&&K&&(U.textContent=ue),ke}_applyMinimumContrast(I,N,E,R,O,V){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const M=this._getContrastCache(R);let D;if(O||V||(D=M.getColor(N.rgba,E.rgba)),D===void 0){const ee=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);D=y.color.ensureContrastRatio(O||N,V||E,ee),M.setColor((O||N).rgba,(V||E).rgba,D??null)}return!!D&&(this._addStyle(I,`color:${D.css}`),!0)}_getContrastCache(I){return I.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(I,N){I.setAttribute("style",`${I.getAttribute("style")||""}${N};`)}_isCellInSelection(I,N){const E=this._selectionStart,R=this._selectionEnd;return!(!E||!R)&&(this._columnSelectMode?E[0]<=R[0]?I>=E[0]&&N>=E[1]&&I<R[0]&&N<=R[1]:I<E[0]&&N>=E[1]&&I>=R[0]&&N<=R[1]:N>E[1]&&N<R[1]||E[1]===R[1]&&N===E[1]&&I>=E[0]&&I<R[0]||E[1]<R[1]&&N===R[1]&&I<R[0]||E[1]<R[1]&&N===E[1]&&I>=E[0])}};function k(I,N,E){for(;I.length<E;)I=N+I;return I}s.DomRendererRowFactory=S=c([m(1,d.ICharacterJoinerService),m(2,C.IOptionsService),m(3,d.ICoreBrowserService),m(4,C.ICoreService),m(5,C.IDecorationService),m(6,d.IThemeService)],S)},2550:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=a.createElement("span");m.classList.add("xterm-char-measure-element");const h=a.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const b=a.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const _=a.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[m,h,b,_],this._container.appendChild(m),this._container.appendChild(h),this._container.appendChild(b),this._container.appendChild(_),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,c,m,h){a===this._font&&c===this._fontSize&&m===this._weight&&h===this._weightBold||(this._font=a,this._fontSize=c,this._weight=m,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(a,c,m){let h=0;if(!c&&!m&&a.length===1&&(h=a.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const C=this._measure(a,0);return C>0&&(this._flat[h]=C),C}let b=a;c&&(b+="B"),m&&(b+="I");let _=this._holey.get(b);if(_===void 0){let C=0;c&&(C|=1),m&&(C|=2),_=this._measure(a,C),_>0&&this._holey.set(b,_)}return _}_measure(a,c){const m=this._measureElements[c];return m.textContent=a.repeat(32),m.offsetWidth/32}}},2223:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(l,s)=>{function a(m){return 57508<=m&&m<=57558}function c(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},s.isEmoji=c,s.allowRescaling=function(m,h,b,_){return h===1&&b>Math.ceil(1.5*_)&&m!==void 0&&m>255&&!c(m)&&!a(m)&&!(function(C){return 57344<=C&&C<=63743})(m)},s.treatGlyphAsBackgroundColor=function(m){return a(m)||(function(h){return 9472<=h&&h<=9631})(m)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(m,h,b=0){return(m-(2*Math.round(h)-b))%(2*Math.round(h))}},6052:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,h,b,_=!1){if(this.selectionStart=h,this.selectionEnd=b,!h||!b||h[0]===b[0]&&h[1]===b[1])return void this.clear();const C=m.buffers.active.ydisp,y=h[1]-C,d=b[1]-C,p=Math.max(y,0),f=Math.min(d,m.rows-1);p>=m.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=y,this.viewportEndRow=d,this.viewportCappedStartRow=p,this.viewportCappedEndRow=f,this.startCol=h[0],this.endCol=b[0])}isCellSelected(m,h,b){return!!this.hasSelection&&(b-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&b>=this.viewportCappedStartRow&&h<this.endCol&&b<=this.viewportCappedEndRow:h<this.startCol&&b>=this.viewportCappedStartRow&&h>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&h>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},456:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,s,a){var c=this&&this.__decorate||function(f,g,S,k){var I,N=arguments.length,E=N<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,g,S,k);else for(var R=f.length-1;R>=0;R--)(I=f[R])&&(E=(N<3?I(E):N>3?I(g,S,E):I(g,S))||E);return N>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(f,g){return function(S,k){g(S,k,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const h=a(2585),b=a(8460),_=a(844);let C=s.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,g,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new d(f,g,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};s.CharSizeService=C=c([m(2,h.IOptionsService)],C);class y extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(g,S){g!==void 0&&g>0&&S!==void 0&&S>0&&(this._result.width=g,this._result.height=S)}}class d extends y{constructor(g,S,k){super(),this._document=g,this._parentElement=S,this._optionsService=k,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class p extends y{constructor(g){super(),this._optionsService=g,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const g=this._ctx.measureText("W");return this._validateAndSet(g.width,g.fontBoundingBoxAscent+g.fontBoundingBoxDescent),this._result}}},4269:function(l,s,a){var c=this&&this.__decorate||function(p,f,g,S){var k,I=arguments.length,N=I<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(p,f,g,S);else for(var E=p.length-1;E>=0;E--)(k=p[E])&&(N=(I<3?k(N):I>3?k(f,g,N):k(f,g))||N);return I>3&&N&&Object.defineProperty(f,g,N),N},m=this&&this.__param||function(p,f){return function(g,S){f(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const h=a(3734),b=a(643),_=a(511),C=a(2585);class y extends h.AttributeData{constructor(f,g,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=g,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=y;let d=s.CharacterJoinerService=class Lm{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(f){const g={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(g),g.id}deregister(f){for(let g=0;g<this._characterJoiners.length;g++)if(this._characterJoiners[g].id===f)return this._characterJoiners.splice(g,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const g=this._bufferService.buffer.lines.get(f);if(!g||g.length===0)return[];const S=[],k=g.translateToString(!0);let I=0,N=0,E=0,R=g.getFg(0),O=g.getBg(0);for(let V=0;V<g.getTrimmedLength();V++)if(g.loadCell(V,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==O){if(V-I>1){const M=this._getJoinedRanges(k,E,N,g,I);for(let D=0;D<M.length;D++)S.push(M[D])}I=V,E=N,R=this._workCell.fg,O=this._workCell.bg}N+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-I>1){const V=this._getJoinedRanges(k,E,N,g,I);for(let M=0;M<V.length;M++)S.push(V[M])}return S}_getJoinedRanges(f,g,S,k,I){const N=f.substring(g,S);let E=[];try{E=this._characterJoiners[0].handler(N)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const O=this._characterJoiners[R].handler(N);for(let V=0;V<O.length;V++)Lm._mergeRanges(E,O[V])}catch(O){console.error(O)}return this._stringRangesToCellRanges(E,k,I),E}_stringRangesToCellRanges(f,g,S){let k=0,I=!1,N=0,E=f[k];if(E){for(let R=S;R<this._bufferService.cols;R++){const O=g.getWidth(R),V=g.getString(R).length||b.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!I&&E[0]<=N&&(E[0]=R,I=!0),E[1]<=N){if(E[1]=R,E=f[++k],!E)break;E[0]<=N?(E[0]=R,I=!0):I=!1}N+=V}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(f,g){let S=!1;for(let k=0;k<f.length;k++){const I=f[k];if(S){if(g[1]<=I[0])return f[k-1][1]=g[1],f;if(g[1]<=I[1])return f[k-1][1]=Math.max(g[1],I[1]),f.splice(k,1),f;f.splice(k,1),k--}else{if(g[1]<=I[0])return f.splice(k,0,g),f;if(g[1]<=I[1])return I[0]=Math.min(g[0],I[0]),f;g[0]<I[1]&&(I[0]=Math.min(g[0],I[0]),S=!0)}}return S?f[f.length-1][1]=g[1]:f.push(g),f}};s.CharacterJoinerService=d=c([m(0,C.IBufferService)],d)},5114:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=a(844),m=a(8460),h=a(3656);class b extends c.Disposable{constructor(y,d,p){super(),this._textarea=y,this._window=d,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((f=>this._screenDprMonitor.setWindow(f)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(y){this._window!==y&&(this._window=y,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=b;class _ extends c.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(y){this._parentWindow=y,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var y;this._outerListener&&((y=this._resolutionMediaMatchList)==null||y.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=a(844);class m extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const _=this.linkProviders.indexOf(b);_!==-1&&this.linkProviders.splice(_,1)}}}}s.LinkProviderService=m},8934:function(l,s,a){var c=this&&this.__decorate||function(C,y,d,p){var f,g=arguments.length,S=g<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,d):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,y,d,p);else for(var k=C.length-1;k>=0;k--)(f=C[k])&&(S=(g<3?f(S):g>3?f(y,d,S):f(y,d))||S);return g>3&&S&&Object.defineProperty(y,d,S),S},m=this&&this.__param||function(C,y){return function(d,p){y(d,p,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const h=a(4725),b=a(9806);let _=s.MouseService=class{constructor(C,y){this._renderService=C,this._charSizeService=y}getCoords(C,y,d,p,f){return(0,b.getCoords)(window,C,y,d,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(C,y){const d=(0,b.getCoordsRelativeToElement)(window,C,y);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};s.MouseService=_=c([m(0,h.IRenderService),m(1,h.ICharSizeService)],_)},3230:function(l,s,a){var c=this&&this.__decorate||function(f,g,S,k){var I,N=arguments.length,E=N<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,g,S,k);else for(var R=f.length-1;R>=0;R--)(I=f[R])&&(E=(N<3?I(E):N>3?I(g,S,E):I(g,S))||E);return N>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(f,g){return function(S,k){g(S,k,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const h=a(6193),b=a(4725),_=a(8460),C=a(844),y=a(7226),d=a(2585);let p=s.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,g,S,k,I,N,E,R){super(),this._rowCount=f,this._charSizeService=k,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((O,V)=>this._renderRows(O,V)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(N.onResize((()=>this._fullRefresh()))),this.register(N.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(I.onDecorationRegistered((()=>this._fullRefresh()))),this.register(I.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(N.cols,N.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(N.buffer.y,N.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,g),this.register(E.onWindowChange((O=>this._registerIntersectionObserver(O,g))))}_registerIntersectionObserver(f,g){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((k=>this._handleIntersectionChange(k[k.length-1])),{threshold:0});S.observe(g),this._observerDisposable.value=(0,C.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(f,g,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,g,this._rowCount))}_renderRows(f,g){this._renderer.value&&(f=Math.min(f,this._rowCount-1),g=Math.min(g,this._rowCount-1),this._renderer.value.renderRows(f,g),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:g}),this._onRender.fire({start:f,end:g}),this._isNextRenderRedrawOnly=!0)}resize(f,g){this._rowCount=g,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((g=>this.refreshRows(g.start,g.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var f,g;this._renderer.value&&((g=(f=this._renderer.value).clearTextureAtlas)==null||g.call(f),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,g){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(f,g)})):this._renderer.value.handleResize(f,g),this._fullRefresh())}handleCharSizeChanged(){var f;(f=this._renderer.value)==null||f.handleCharSizeChanged()}handleBlur(){var f;(f=this._renderer.value)==null||f.handleBlur()}handleFocus(){var f;(f=this._renderer.value)==null||f.handleFocus()}handleSelectionChanged(f,g,S){var k;this._selectionState.start=f,this._selectionState.end=g,this._selectionState.columnSelectMode=S,(k=this._renderer.value)==null||k.handleSelectionChanged(f,g,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};s.RenderService=p=c([m(2,d.IOptionsService),m(3,b.ICharSizeService),m(4,d.IDecorationService),m(5,d.IBufferService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],p)},9312:function(l,s,a){var c=this&&this.__decorate||function(E,R,O,V){var M,D=arguments.length,ee=D<3?R:V===null?V=Object.getOwnPropertyDescriptor(R,O):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(E,R,O,V);else for(var ae=E.length-1;ae>=0;ae--)(M=E[ae])&&(ee=(D<3?M(ee):D>3?M(R,O,ee):M(R,O))||ee);return D>3&&ee&&Object.defineProperty(R,O,ee),ee},m=this&&this.__param||function(E,R){return function(O,V){R(O,V,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const h=a(9806),b=a(9504),_=a(456),C=a(4725),y=a(8460),d=a(844),p=a(6114),f=a(4841),g=a(511),S=a(2585),k=" ",I=new RegExp(k,"g");let N=s.SelectionService=class extends d.Disposable{constructor(E,R,O,V,M,D,ee,ae,ge){super(),this._element=E,this._screenElement=R,this._linkifier=O,this._bufferService=V,this._coreService=M,this._mouseService=D,this._optionsService=ee,this._renderService=ae,this._coreBrowserService=ge,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new g.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ke=>this._handleMouseMove(ke),this._mouseUpListener=ke=>this._handleMouseUp(ke),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ke=>this._handleTrim(ke))),this.register(this._bufferService.buffers.onBufferActivate((ke=>this._handleBufferActivate(ke)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!E||!R||E[0]===R[0]&&E[1]===R[1])}get selectionText(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!E||!R)return"";const O=this._bufferService.buffer,V=[];if(this._activeSelectionMode===3){if(E[0]===R[0])return"";const M=E[0]<R[0]?E[0]:R[0],D=E[0]<R[0]?R[0]:E[0];for(let ee=E[1];ee<=R[1];ee++){const ae=O.translateBufferLineToString(ee,!0,M,D);V.push(ae)}}else{const M=E[1]===R[1]?R[0]:void 0;V.push(O.translateBufferLineToString(E[1],!0,E[0],M));for(let D=E[1]+1;D<=R[1]-1;D++){const ee=O.lines.get(D),ae=O.translateBufferLineToString(D,!0);ee!=null&&ee.isWrapped?V[V.length-1]+=ae:V.push(ae)}if(E[1]!==R[1]){const D=O.lines.get(R[1]),ee=O.translateBufferLineToString(R[1],!0,0,R[0]);D&&D.isWrapped?V[V.length-1]+=ee:V.push(ee)}}return V.map((M=>M.replace(I," "))).join(p.isWindows?`\r
47
- `:`
48
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),p.isLinux&&E&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(E){const R=this._getMouseBufferCoords(E),O=this._model.finalSelectionStart,V=this._model.finalSelectionEnd;return!!(O&&V&&R)&&this._areCoordsInSelection(R,O,V)}isCellInSelection(E,R){const O=this._model.finalSelectionStart,V=this._model.finalSelectionEnd;return!(!O||!V)&&this._areCoordsInSelection([E,R],O,V)}_areCoordsInSelection(E,R,O){return E[1]>R[1]&&E[1]<O[1]||R[1]===O[1]&&E[1]===R[1]&&E[0]>=R[0]&&E[0]<O[0]||R[1]<O[1]&&E[1]===O[1]&&E[0]<O[0]||R[1]<O[1]&&E[1]===R[1]&&E[0]>=R[0]}_selectWordAtCursor(E,R){var O,V;const M=(V=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:V.range;if(M)return this._model.selectionStart=[M.start.x-1,M.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(M,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(E);return!!D&&(this._selectWordAt(D,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,R){this._model.clearSelection(),E=Math.max(E,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const R=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(E){let R=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=O?0:(R>O&&(R-=O),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(E){return p.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const R=this._getMouseBufferCoords(E);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(E){return E.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const V=O.lines.get(this._model.selectionEnd[1]);V&&V.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const R=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const V=(0,b.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(V,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,O=!(!E||!R||E[0]===R[0]&&E[1]===R[1]);O?E&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,R,O)):this._oldHasSelection&&this._fireOnSelectionChange(E,R,O)}_fireOnSelectionChange(E,R,O){this._oldSelectionStart=E,this._oldSelectionEnd=R,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(E,R){let O=R;for(let V=0;R>=V;V++){const M=E.loadCell(V,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:M>1&&R!==V&&(O+=M-1)}return O}setSelection(E,R,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,R],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,R,O=!0,V=!0){if(E[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,D=M.lines.get(E[1]);if(!D)return;const ee=M.translateBufferLineToString(E[1],!1);let ae=this._convertViewportColToCharacterIndex(D,E[0]),ge=ae;const ke=E[0]-ae;let re=0,B=0,U=0,W=0;if(ee.charAt(ae)===" "){for(;ae>0&&ee.charAt(ae-1)===" ";)ae--;for(;ge<ee.length&&ee.charAt(ge+1)===" ";)ge++}else{let ve=E[0],_e=E[0];D.getWidth(ve)===0&&(re++,ve--),D.getWidth(_e)===2&&(B++,_e++);const Ce=D.getString(_e).length;for(Ce>1&&(W+=Ce-1,ge+=Ce-1);ve>0&&ae>0&&!this._isCharWordSeparator(D.loadCell(ve-1,this._workCell));){D.loadCell(ve-1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===0?(re++,ve--):J>1&&(U+=J-1,ae-=J-1),ae--,ve--}for(;_e<D.length&&ge+1<ee.length&&!this._isCharWordSeparator(D.loadCell(_e+1,this._workCell));){D.loadCell(_e+1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,_e++):J>1&&(W+=J-1,ge+=J-1),ge++,_e++}}ge++;let K=ae+ke-re+U,ue=Math.min(this._bufferService.cols,ge-ae+re+B-U-W);if(R||ee.slice(ae,ge).trim()!==""){if(O&&K===0&&D.getCodePoint(0)!==32){const ve=M.lines.get(E[1]-1);if(ve&&D.isWrapped&&ve.getCodePoint(this._bufferService.cols-1)!==32){const _e=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(_e){const Ce=this._bufferService.cols-_e.start;K-=Ce,ue+=Ce}}}if(V&&K+ue===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const ve=M.lines.get(E[1]+1);if(ve!=null&&ve.isWrapped&&ve.getCodePoint(0)!==32){const _e=this._getWordAt([0,E[1]+1],!1,!1,!0);_e&&(ue+=_e.length)}}return{start:K,length:ue}}}_selectWordAt(E,R){const O=this._getWordAt(E,R);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[O.start,E[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(E){const R=this._getWordAt(E,!0);if(R){let O=E[1];for(;R.start<0;)R.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,O]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const R=this._bufferService.buffer.getWrappedRangeForLine(E),O={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(O,this._bufferService.cols)}};s.SelectionService=N=c([m(3,S.IBufferService),m(4,S.ICoreService),m(5,C.IMouseService),m(6,S.IOptionsService),m(7,C.IRenderService),m(8,C.ICoreBrowserService)],N)},4725:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=a(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(l,s,a){var c=this&&this.__decorate||function(N,E,R,O){var V,M=arguments.length,D=M<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(N,E,R,O);else for(var ee=N.length-1;ee>=0;ee--)(V=N[ee])&&(D=(M<3?V(D):M>3?V(E,R,D):V(E,R))||D);return M>3&&D&&Object.defineProperty(E,R,D),D},m=this&&this.__param||function(N,E){return function(R,O){E(R,O,N)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const h=a(7239),b=a(8055),_=a(8460),C=a(844),y=a(2585),d=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),f=b.css.toColor("#ffffff"),g=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const N=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let R=0;R<216;R++){const O=E[R/36%6|0],V=E[R/6%6|0],M=E[R%6];N.push({css:b.channels.toCss(O,V,M),rgba:b.channels.toRgba(O,V,M)})}for(let R=0;R<24;R++){const O=8+10*R;N.push({css:b.channels.toCss(O,O,O),rgba:b.channels.toRgba(O,O,O)})}return N})());let k=s.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(N){super(),this._optionsService=N,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:f,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(p,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(N={}){const E=this._colors;if(E.foreground=I(N.foreground,d),E.background=I(N.background,p),E.cursor=I(N.cursor,f),E.cursorAccent=I(N.cursorAccent,g),E.selectionBackgroundTransparent=I(N.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=I(N.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=N.selectionForeground?I(N.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=s.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=I(N.black,s.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=I(N.red,s.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=I(N.green,s.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=I(N.yellow,s.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=I(N.blue,s.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=I(N.magenta,s.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=I(N.cyan,s.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=I(N.white,s.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=I(N.brightBlack,s.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=I(N.brightRed,s.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=I(N.brightGreen,s.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=I(N.brightYellow,s.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=I(N.brightBlue,s.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=I(N.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=I(N.brightCyan,s.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=I(N.brightWhite,s.DEFAULT_ANSI_COLORS[15]),N.extendedAnsi){const R=Math.min(E.ansi.length-16,N.extendedAnsi.length);for(let O=0;O<R;O++)E.ansi[O+16]=I(N.extendedAnsi[O],s.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(N){this._restoreColor(N),this._onChangeColors.fire(this.colors)}_restoreColor(N){if(N!==void 0)switch(N){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[N]=this._restoreColors.ansi[N]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(N){N(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function I(N,E){if(N!==void 0)try{return b.css.toColor(N)}catch{}return E}s.ThemeService=k=c([m(0,y.IOptionsService)],k)},6349:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=a(8460),m=a(844);class h extends m.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const C=new Array(_);for(let y=0;y<Math.min(_,this.length);y++)C[y]=this._array[this._getCyclicIndex(y)];this._array=C,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let C=this._length;C<_;C++)this._array[C]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,C){this._array[this._getCyclicIndex(_)]=C}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,C,...y){if(C){for(let d=_;d<this._length-C;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+C)];this._length-=C,this.onDeleteEmitter.fire({index:_,amount:C})}for(let d=this._length-1;d>=_;d--)this._array[this._getCyclicIndex(d+y.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<y.length;d++)this._array[this._getCyclicIndex(_+d)]=y[d];if(y.length&&this.onInsertEmitter.fire({index:_,amount:y.length}),this._length+y.length>this._maxLength){const d=this._length+y.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=y.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,C,y){if(!(C<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let p=C-1;p>=0;p--)this.set(_+p+y,this.get(_+p));const d=_+C+y-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<C;d++)this.set(_+d+y,this.get(_+d))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}s.CircularList=h},1439:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(c,m=5){if(typeof c!="object")return c;const h=Array.isArray(c)?[]:{};for(const b in c)h[b]=m<=1?c[b]:c[b]&&a(c[b],m-1);return h}},8055:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,m=0,h=0;var b,_,C,y,d;function p(g){const S=g.toString(16);return S.length<2?"0"+S:S}function f(g,S){return g<S?(S+.05)/(g+.05):(g+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(g){g.toCss=function(S,k,I,N){return N!==void 0?`#${p(S)}${p(k)}${p(I)}${p(N)}`:`#${p(S)}${p(k)}${p(I)}`},g.toRgba=function(S,k,I,N=255){return(S<<24|k<<16|I<<8|N)>>>0},g.toColor=function(S,k,I,N){return{css:g.toCss(S,k,I,N),rgba:g.toRgba(S,k,I,N)}}})(b||(s.channels=b={})),(function(g){function S(k,I){return h=Math.round(255*I),[a,c,m]=d.toChannels(k.rgba),{css:b.toCss(a,c,m,h),rgba:b.toRgba(a,c,m,h)}}g.blend=function(k,I){if(h=(255&I.rgba)/255,h===1)return{css:I.css,rgba:I.rgba};const N=I.rgba>>24&255,E=I.rgba>>16&255,R=I.rgba>>8&255,O=k.rgba>>24&255,V=k.rgba>>16&255,M=k.rgba>>8&255;return a=O+Math.round((N-O)*h),c=V+Math.round((E-V)*h),m=M+Math.round((R-M)*h),{css:b.toCss(a,c,m),rgba:b.toRgba(a,c,m)}},g.isOpaque=function(k){return(255&k.rgba)==255},g.ensureContrastRatio=function(k,I,N){const E=d.ensureContrastRatio(k.rgba,I.rgba,N);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},g.opaque=function(k){const I=(255|k.rgba)>>>0;return[a,c,m]=d.toChannels(I),{css:b.toCss(a,c,m),rgba:I}},g.opacity=S,g.multiplyOpacity=function(k,I){return h=255&k.rgba,S(k,h*I/255)},g.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}})(_||(s.color=_={})),(function(g){let S,k;try{const I=document.createElement("canvas");I.width=1,I.height=1;const N=I.getContext("2d",{willReadFrequently:!0});N&&(S=N,S.globalCompositeOperation="copy",k=S.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(I){if(I.match(/#[\da-f]{3,8}/i))switch(I.length){case 4:return a=parseInt(I.slice(1,2).repeat(2),16),c=parseInt(I.slice(2,3).repeat(2),16),m=parseInt(I.slice(3,4).repeat(2),16),b.toColor(a,c,m);case 5:return a=parseInt(I.slice(1,2).repeat(2),16),c=parseInt(I.slice(2,3).repeat(2),16),m=parseInt(I.slice(3,4).repeat(2),16),h=parseInt(I.slice(4,5).repeat(2),16),b.toColor(a,c,m,h);case 7:return{css:I,rgba:(parseInt(I.slice(1),16)<<8|255)>>>0};case 9:return{css:I,rgba:parseInt(I.slice(1),16)>>>0}}const N=I.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(N)return a=parseInt(N[1]),c=parseInt(N[2]),m=parseInt(N[3]),h=Math.round(255*(N[5]===void 0?1:parseFloat(N[5]))),b.toColor(a,c,m,h);if(!S||!k)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=k,S.fillStyle=I,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,m,h]=S.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(a,c,m,h),css:I}}})(C||(s.css=C={})),(function(g){function S(k,I,N){const E=k/255,R=I/255,O=N/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}g.relativeLuminance=function(k){return S(k>>16&255,k>>8&255,255&k)},g.relativeLuminance2=S})(y||(s.rgb=y={})),(function(g){function S(I,N,E){const R=I>>24&255,O=I>>16&255,V=I>>8&255;let M=N>>24&255,D=N>>16&255,ee=N>>8&255,ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));for(;ae<E&&(M>0||D>0||ee>0);)M-=Math.max(0,Math.ceil(.1*M)),D-=Math.max(0,Math.ceil(.1*D)),ee-=Math.max(0,Math.ceil(.1*ee)),ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));return(M<<24|D<<16|ee<<8|255)>>>0}function k(I,N,E){const R=I>>24&255,O=I>>16&255,V=I>>8&255;let M=N>>24&255,D=N>>16&255,ee=N>>8&255,ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));for(;ae<E&&(M<255||D<255||ee<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),D=Math.min(255,D+Math.ceil(.1*(255-D))),ee=Math.min(255,ee+Math.ceil(.1*(255-ee))),ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));return(M<<24|D<<16|ee<<8|255)>>>0}g.blend=function(I,N){if(h=(255&N)/255,h===1)return N;const E=N>>24&255,R=N>>16&255,O=N>>8&255,V=I>>24&255,M=I>>16&255,D=I>>8&255;return a=V+Math.round((E-V)*h),c=M+Math.round((R-M)*h),m=D+Math.round((O-D)*h),b.toRgba(a,c,m)},g.ensureContrastRatio=function(I,N,E){const R=y.relativeLuminance(I>>8),O=y.relativeLuminance(N>>8);if(f(R,O)<E){if(O<R){const D=S(I,N,E),ee=f(R,y.relativeLuminance(D>>8));if(ee<E){const ae=k(I,N,E);return ee>f(R,y.relativeLuminance(ae>>8))?D:ae}return D}const V=k(I,N,E),M=f(R,y.relativeLuminance(V>>8));if(M<E){const D=S(I,N,E);return M>f(R,y.relativeLuminance(D>>8))?V:D}return V}},g.reduceLuminance=S,g.increaseLuminance=k,g.toChannels=function(I){return[I>>24&255,I>>16&255,I>>8&255,255&I]}})(d||(s.rgba=d={})),s.toPaddedHex=p,s.contrastRatio=f},8969:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=a(844),m=a(2585),h=a(4348),b=a(7866),_=a(744),C=a(7302),y=a(6975),d=a(8460),p=a(1753),f=a(1480),g=a(7994),S=a(9282),k=a(5435),I=a(5981),N=a(2660);let E=!1;class R extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((V=>{var M;(M=this._onScrollApi)==null||M.fire(V.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(V){for(const M in V)this.optionsService.options[M]=V[M]}constructor(V){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new C.OptionsService(V)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(g.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(N.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new k.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new I.WriteBuffer(((M,D)=>this._inputHandler.parse(M,D)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(V,M){this._writeBuffer.write(V,M)}writeSync(V,M){this._logService.logLevel<=m.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(V,M)}input(V,M=!0){this.coreService.triggerDataEvent(V,M)}resize(V,M){isNaN(V)||isNaN(M)||(V=Math.max(V,_.MINIMUM_COLS),M=Math.max(M,_.MINIMUM_ROWS),this._bufferService.resize(V,M))}scroll(V,M=!1){this._bufferService.scroll(V,M)}scrollLines(V,M,D){this._bufferService.scrollLines(V,M,D)}scrollPages(V){this.scrollLines(V*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(V){const M=V-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(V,M){return this._inputHandler.registerEscHandler(V,M)}registerDcsHandler(V,M){return this._inputHandler.registerDcsHandler(V,M)}registerCsiHandler(V,M){return this._inputHandler.registerCsiHandler(V,M)}registerOscHandler(V,M){return this._inputHandler.registerOscHandler(V,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let V=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?V=M.backend==="conpty"&&M.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(V=!0),V?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const V=[];V.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),V.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const M of V)M.dispose()}))}}}s.CoreTerminal=R},8460:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},5435:function(l,s,a){var c=this&&this.__decorate||function(re,B,U,W){var K,ue=arguments.length,ve=ue<3?B:W===null?W=Object.getOwnPropertyDescriptor(B,U):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ve=Reflect.decorate(re,B,U,W);else for(var _e=re.length-1;_e>=0;_e--)(K=re[_e])&&(ve=(ue<3?K(ve):ue>3?K(B,U,ve):K(B,U))||ve);return ue>3&&ve&&Object.defineProperty(B,U,ve),ve},m=this&&this.__param||function(re,B){return function(U,W){B(U,W,re)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const h=a(2584),b=a(7116),_=a(2015),C=a(844),y=a(482),d=a(8437),p=a(8460),f=a(643),g=a(511),S=a(3734),k=a(2585),I=a(1480),N=a(6242),E=a(6351),R=a(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},V=131072;function M(re,B){if(re>24)return B.setWinLines||!1;switch(re){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var D;(function(re){re[re.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",re[re.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(s.WindowsOptionsReportType=D={}));let ee=0;class ae extends C.Disposable{getAttrData(){return this._curAttrData}constructor(B,U,W,K,ue,ve,_e,Ce,J=new _.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=U,this._coreService=W,this._logService=K,this._optionsService=ue,this._oscLinkService=ve,this._coreMouseService=_e,this._unicodeService=Ce,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new g.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new ge(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._parser.setCsiHandlerFallback(((L,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:ne.toArray()})})),this._parser.setEscHandlerFallback((L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})})),this._parser.setExecuteHandlerFallback((L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})})),this._parser.setOscHandlerFallback(((L,ne,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:ne,data:se})})),this._parser.setDcsHandlerFallback(((L,ne,se)=>{ne==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:ne,payload:se})})),this._parser.setPrintHandler(((L,ne,se)=>this.print(L,ne,se))),this._parser.registerCsiHandler({final:"@"},(L=>this.insertChars(L))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(L=>this.scrollLeft(L))),this._parser.registerCsiHandler({final:"A"},(L=>this.cursorUp(L))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(L=>this.scrollRight(L))),this._parser.registerCsiHandler({final:"B"},(L=>this.cursorDown(L))),this._parser.registerCsiHandler({final:"C"},(L=>this.cursorForward(L))),this._parser.registerCsiHandler({final:"D"},(L=>this.cursorBackward(L))),this._parser.registerCsiHandler({final:"E"},(L=>this.cursorNextLine(L))),this._parser.registerCsiHandler({final:"F"},(L=>this.cursorPrecedingLine(L))),this._parser.registerCsiHandler({final:"G"},(L=>this.cursorCharAbsolute(L))),this._parser.registerCsiHandler({final:"H"},(L=>this.cursorPosition(L))),this._parser.registerCsiHandler({final:"I"},(L=>this.cursorForwardTab(L))),this._parser.registerCsiHandler({final:"J"},(L=>this.eraseInDisplay(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(L=>this.eraseInDisplay(L,!0))),this._parser.registerCsiHandler({final:"K"},(L=>this.eraseInLine(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(L=>this.eraseInLine(L,!0))),this._parser.registerCsiHandler({final:"L"},(L=>this.insertLines(L))),this._parser.registerCsiHandler({final:"M"},(L=>this.deleteLines(L))),this._parser.registerCsiHandler({final:"P"},(L=>this.deleteChars(L))),this._parser.registerCsiHandler({final:"S"},(L=>this.scrollUp(L))),this._parser.registerCsiHandler({final:"T"},(L=>this.scrollDown(L))),this._parser.registerCsiHandler({final:"X"},(L=>this.eraseChars(L))),this._parser.registerCsiHandler({final:"Z"},(L=>this.cursorBackwardTab(L))),this._parser.registerCsiHandler({final:"`"},(L=>this.charPosAbsolute(L))),this._parser.registerCsiHandler({final:"a"},(L=>this.hPositionRelative(L))),this._parser.registerCsiHandler({final:"b"},(L=>this.repeatPrecedingCharacter(L))),this._parser.registerCsiHandler({final:"c"},(L=>this.sendDeviceAttributesPrimary(L))),this._parser.registerCsiHandler({prefix:">",final:"c"},(L=>this.sendDeviceAttributesSecondary(L))),this._parser.registerCsiHandler({final:"d"},(L=>this.linePosAbsolute(L))),this._parser.registerCsiHandler({final:"e"},(L=>this.vPositionRelative(L))),this._parser.registerCsiHandler({final:"f"},(L=>this.hVPosition(L))),this._parser.registerCsiHandler({final:"g"},(L=>this.tabClear(L))),this._parser.registerCsiHandler({final:"h"},(L=>this.setMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(L=>this.setModePrivate(L))),this._parser.registerCsiHandler({final:"l"},(L=>this.resetMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(L=>this.resetModePrivate(L))),this._parser.registerCsiHandler({final:"m"},(L=>this.charAttributes(L))),this._parser.registerCsiHandler({final:"n"},(L=>this.deviceStatus(L))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(L=>this.deviceStatusPrivate(L))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(L=>this.softReset(L))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(L=>this.setCursorStyle(L))),this._parser.registerCsiHandler({final:"r"},(L=>this.setScrollRegion(L))),this._parser.registerCsiHandler({final:"s"},(L=>this.saveCursor(L))),this._parser.registerCsiHandler({final:"t"},(L=>this.windowOptions(L))),this._parser.registerCsiHandler({final:"u"},(L=>this.restoreCursor(L))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(L=>this.insertColumns(L))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(L=>this.deleteColumns(L))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(L=>this.selectProtected(L))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(L=>this.requestMode(L,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(L=>this.requestMode(L,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new N.OscHandler((L=>(this.setTitle(L),this.setIconName(L),!0)))),this._parser.registerOscHandler(1,new N.OscHandler((L=>this.setIconName(L)))),this._parser.registerOscHandler(2,new N.OscHandler((L=>this.setTitle(L)))),this._parser.registerOscHandler(4,new N.OscHandler((L=>this.setOrReportIndexedColor(L)))),this._parser.registerOscHandler(8,new N.OscHandler((L=>this.setHyperlink(L)))),this._parser.registerOscHandler(10,new N.OscHandler((L=>this.setOrReportFgColor(L)))),this._parser.registerOscHandler(11,new N.OscHandler((L=>this.setOrReportBgColor(L)))),this._parser.registerOscHandler(12,new N.OscHandler((L=>this.setOrReportCursorColor(L)))),this._parser.registerOscHandler(104,new N.OscHandler((L=>this.restoreIndexedColor(L)))),this._parser.registerOscHandler(110,new N.OscHandler((L=>this.restoreFgColor(L)))),this._parser.registerOscHandler(111,new N.OscHandler((L=>this.restoreBgColor(L)))),this._parser.registerOscHandler(112,new N.OscHandler((L=>this.restoreCursorColor(L)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const L in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},(()=>this.selectCharset("("+L))),this._parser.registerEscHandler({intermediates:")",final:L},(()=>this.selectCharset(")"+L))),this._parser.registerEscHandler({intermediates:"*",final:L},(()=>this.selectCharset("*"+L))),this._parser.registerEscHandler({intermediates:"+",final:L},(()=>this.selectCharset("+"+L))),this._parser.registerEscHandler({intermediates:"-",final:L},(()=>this.selectCharset("-"+L))),this._parser.registerEscHandler({intermediates:".",final:L},(()=>this.selectCharset("."+L))),this._parser.registerEscHandler({intermediates:"/",final:L},(()=>this.selectCharset("/"+L)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((L=>(this._logService.error("Parsing error: ",L),L))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((L,ne)=>this.requestStatusString(L,ne))))}_preserveStack(B,U,W,K){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=W,this._parseStack.position=K}_logSlowResolvingAsync(B){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([B,new Promise(((U,W)=>setTimeout((()=>W("#SLOW_TIMEOUT")),5e3)))]).catch((U=>{if(U!=="#SLOW_TIMEOUT")throw U;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,U){let W,K=this._activeBuffer.x,ue=this._activeBuffer.y,ve=0;const _e=this._parseStack.paused;if(_e){if(W=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(W),W;K=this._parseStack.cursorStartX,ue=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>V&&(ve=this._parseStack.position+V)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(L=>String.fromCharCode(L))).join("")}"`),typeof B=="string"?B.split("").map((L=>L.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<V&&(this._parseBuffer=new Uint32Array(Math.min(B.length,V))),_e||this._dirtyRowTracker.clearRange(),B.length>V)for(let L=ve;L<B.length;L+=V){const ne=L+V<B.length?L+V:B.length,se=typeof B=="string"?this._stringDecoder.decode(B.substring(L,ne),this._parseBuffer):this._utf8Decoder.decode(B.subarray(L,ne),this._parseBuffer);if(W=this._parser.parse(this._parseBuffer,se))return this._preserveStack(K,ue,se,L),this._logSlowResolvingAsync(W),W}else if(!_e){const L=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(W=this._parser.parse(this._parseBuffer,L))return this._preserveStack(K,ue,L,0),this._logSlowResolvingAsync(W),W}this._activeBuffer.x===K&&this._activeBuffer.y===ue||this._onCursorMove.fire();const Ce=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),J=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);J<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(J,this._bufferService.rows-1),Math.min(Ce,this._bufferService.rows-1))}print(B,U,W){let K,ue;const ve=this._charsetService.charset,_e=this._optionsService.rawOptions.screenReaderMode,Ce=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,ne=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&W-U>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let Te=this._parser.precedingJoinState;for(let pe=U;pe<W;++pe){if(K=B[pe],K<127&&ve){const wt=ve[String.fromCharCode(K)];wt&&(K=wt.charCodeAt(0))}const Ue=this._unicodeService.charProperties(K,Te);ue=I.UnicodeService.extractWidth(Ue);const nt=I.UnicodeService.extractShouldJoin(Ue),Je=nt?I.UnicodeService.extractWidth(Te):0;if(Te=Ue,_e&&this._onA11yChar.fire((0,y.stringFromCodePoint)(K)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ue-Je>Ce){if(J){const wt=se;let Le=this._activeBuffer.x-Je;for(this._activeBuffer.x=Je,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Je>0&&se instanceof d.BufferLine&&se.copyCellsFrom(wt,Le,0,Je,!1);Le<Ce;)wt.setCellFromCodepoint(Le++,0,1,ne)}else if(this._activeBuffer.x=Ce-1,ue===2)continue}if(nt&&this._activeBuffer.x){const wt=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-wt,K,ue);for(let Le=ue-Je;--Le>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(L&&(se.insertCells(this._activeBuffer.x,ue-Je,this._activeBuffer.getNullCell(ne)),se.getWidth(Ce-1)===2&&se.setCellFromCodepoint(Ce-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ne)),se.setCellFromCodepoint(this._activeBuffer.x++,K,ue,ne),ue>0)for(;--ue;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=Te,this._activeBuffer.x<Ce&&W-U>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,U){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,U):this._parser.registerCsiHandler(B,(W=>!M(W.params[0],this._optionsService.rawOptions.windowOptions)||U(W)))}registerDcsHandler(B,U){return this._parser.registerDcsHandler(B,new E.DcsHandler(U))}registerEscHandler(B,U){return this._parser.registerEscHandler(B,U)}registerOscHandler(B,U){return this._parser.registerOscHandler(B,new N.OscHandler(U))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var B;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);U.hasWidth(this._activeBuffer.x)&&!U.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(B,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=B,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+U)}cursorUp(B){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const U=B.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=B.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=B.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const U=B.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,U,W,K=!1,ue=!1){const ve=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ve.replaceCells(U,W,this._activeBuffer.getNullCell(this._eraseAttrData()),ue),K&&(ve.isWrapped=!1)}_resetBufferLine(B,U=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);W&&(W.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),W.isWrapped=!1)}eraseInDisplay(B,U=!1){let W;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(W=this._activeBuffer.y,this._dirtyRowTracker.markDirty(W),this._eraseInBufferLine(W++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);W<this._bufferService.rows;W++)this._resetBufferLine(W,U);this._dirtyRowTracker.markDirty(W);break;case 1:for(W=this._activeBuffer.y,this._dirtyRowTracker.markDirty(W),this._eraseInBufferLine(W,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(W+1).isWrapped=!1);W--;)this._resetBufferLine(W,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(W=this._bufferService.rows,this._dirtyRowTracker.markDirty(W-1);W--;)this._resetBufferLine(W,U);this._dirtyRowTracker.markDirty(0);break;case 3:const K=this._activeBuffer.lines.length-this._bufferService.rows;K>0&&(this._activeBuffer.lines.trimStart(K),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-K,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-K,0),this._onScroll.fire(0))}return!0}eraseInLine(B,U=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,U);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,U)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let U=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=this._activeBuffer.ybase+this._activeBuffer.y,K=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ue=this._bufferService.rows-1+this._activeBuffer.ybase-K+1;for(;U--;)this._activeBuffer.lines.splice(ue-1,1),this._activeBuffer.lines.splice(W,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let U=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=this._activeBuffer.ybase+this._activeBuffer.y;let K;for(K=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-K;U--;)this._activeBuffer.lines.splice(W,1),this._activeBuffer.lines.splice(K,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let U=B.params[0]||1;for(;U--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(B){let U=B.params[0]||1;for(;U--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);K.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);K.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);K.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);K.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const U=this._parser.precedingJoinState;if(!U)return!0;const W=B.params[0]||1,K=I.UnicodeService.extractWidth(U),ue=this._activeBuffer.x-K,ve=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ue),_e=new Uint32Array(ve.length*W);let Ce=0;for(let L=0;L<ve.length;){const ne=ve.codePointAt(L)||0;_e[Ce++]=ne,L+=ne>65535?2:1}let J=Ce;for(let L=1;L<W;++L)_e.copyWithin(J,0,Ce),J+=Ce;return this.print(_e,0,J),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),B.params[U]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(B,U){const W=this._coreService.decPrivateModes,{activeProtocol:K,activeEncoding:ue}=this._coreMouseService,ve=this._coreService,{buffers:_e,cols:Ce}=this._bufferService,{active:J,alt:L}=_e,ne=this._optionsService.rawOptions,se=nt=>nt?1:2,Te=B.params[0];return pe=Te,Ue=U?Te===2?4:Te===4?se(ve.modes.insertMode):Te===12?3:Te===20?se(ne.convertEol):0:Te===1?se(W.applicationCursorKeys):Te===3?ne.windowOptions.setWinLines?Ce===80?2:Ce===132?1:0:0:Te===6?se(W.origin):Te===7?se(W.wraparound):Te===8?3:Te===9?se(K==="X10"):Te===12?se(ne.cursorBlink):Te===25?se(!ve.isCursorHidden):Te===45?se(W.reverseWraparound):Te===66?se(W.applicationKeypad):Te===67?4:Te===1e3?se(K==="VT200"):Te===1002?se(K==="DRAG"):Te===1003?se(K==="ANY"):Te===1004?se(W.sendFocus):Te===1005?4:Te===1006?se(ue==="SGR"):Te===1015?4:Te===1016?se(ue==="SGR_PIXELS"):Te===1048?1:Te===47||Te===1047||Te===1049?se(J===L):Te===2004?se(W.bracketedPasteMode):0,ve.triggerDataEvent(`${h.C0.ESC}[${U?"":"?"}${pe};${Ue}$y`),!0;var pe,Ue}_updateAttrColor(B,U,W,K,ue){return U===2?(B|=50331648,B&=-16777216,B|=S.AttributeData.fromColorRGB([W,K,ue])):U===5&&(B&=-50331904,B|=33554432|255&W),B}_extractColor(B,U,W){const K=[0,0,-1,0,0,0];let ue=0,ve=0;do{if(K[ve+ue]=B.params[U+ve],B.hasSubParams(U+ve)){const _e=B.getSubParams(U+ve);let Ce=0;do K[1]===5&&(ue=1),K[ve+Ce+1+ue]=_e[Ce];while(++Ce<_e.length&&Ce+ve+1+ue<K.length);break}if(K[1]===5&&ve+ue>=2||K[1]===2&&ve+ue>=5)break;K[1]&&(ue=1)}while(++ve+U<B.length&&ve+ue<K.length);for(let _e=2;_e<K.length;++_e)K[_e]===-1&&(K[_e]=0);switch(K[0]){case 38:W.fg=this._updateAttrColor(W.fg,K[1],K[3],K[4],K[5]);break;case 48:W.bg=this._updateAttrColor(W.bg,K[1],K[3],K[4],K[5]);break;case 58:W.extended=W.extended.clone(),W.extended.underlineColor=this._updateAttrColor(W.extended.underlineColor,K[1],K[3],K[4],K[5])}return ve}_processUnderline(B,U){U.extended=U.extended.clone(),(!~B||B>5)&&(B=1),U.extended.underlineStyle=B,U.fg|=268435456,B===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(B){B.fg=d.DEFAULT_ATTR_DATA.fg,B.bg=d.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=B.length;let W;const K=this._curAttrData;for(let ue=0;ue<U;ue++)W=B.params[ue],W>=30&&W<=37?(K.fg&=-50331904,K.fg|=16777216|W-30):W>=40&&W<=47?(K.bg&=-50331904,K.bg|=16777216|W-40):W>=90&&W<=97?(K.fg&=-50331904,K.fg|=16777224|W-90):W>=100&&W<=107?(K.bg&=-50331904,K.bg|=16777224|W-100):W===0?this._processSGR0(K):W===1?K.fg|=134217728:W===3?K.bg|=67108864:W===4?(K.fg|=268435456,this._processUnderline(B.hasSubParams(ue)?B.getSubParams(ue)[0]:1,K)):W===5?K.fg|=536870912:W===7?K.fg|=67108864:W===8?K.fg|=1073741824:W===9?K.fg|=2147483648:W===2?K.bg|=134217728:W===21?this._processUnderline(2,K):W===22?(K.fg&=-134217729,K.bg&=-134217729):W===23?K.bg&=-67108865:W===24?(K.fg&=-268435457,this._processUnderline(0,K)):W===25?K.fg&=-536870913:W===27?K.fg&=-67108865:W===28?K.fg&=-1073741825:W===29?K.fg&=2147483647:W===39?(K.fg&=-67108864,K.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):W===49?(K.bg&=-67108864,K.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):W===38||W===48||W===58?ue+=this._extractColor(B,ue,K):W===53?K.bg|=1073741824:W===55?K.bg&=-1073741825:W===59?(K.extended=K.extended.clone(),K.extended.underlineColor=-1,K.updateExtended()):W===100?(K.fg&=-67108864,K.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,K.bg&=-67108864,K.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",W);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,W=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${U};${W}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const U=this._activeBuffer.y+1,W=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${U};${W}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(B){const U=B.params[0]||1;switch(U){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const W=U%2==1;return this._optionsService.options.cursorBlink=W,!0}setScrollRegion(B){const U=B.params[0]||1;let W;return(B.length<2||(W=B.params[1])>this._bufferService.rows||W===0)&&(W=this._bufferService.rows),W>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=W-1,this._setCursor(0,0)),!0}windowOptions(B){if(!M(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:U!==0&&U!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),U!==0&&U!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:U!==0&&U!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),U!==0&&U!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(B){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const U=[],W=B.split(";");for(;W.length>1;){const K=W.shift(),ue=W.shift();if(/^\d+$/.exec(K)){const ve=parseInt(K);if(ke(ve))if(ue==="?")U.push({type:0,index:ve});else{const _e=(0,R.parseColor)(ue);_e&&U.push({type:1,index:ve,color:_e})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(B){const U=B.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(B,U){this._getCurrentLinkId()&&this._finishHyperlink();const W=B.split(":");let K;const ue=W.findIndex((ve=>ve.startsWith("id=")));return ue!==-1&&(K=W[ue].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:K,uri:U}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,U){const W=B.split(";");for(let K=0;K<W.length&&!(U>=this._specialColors.length);++K,++U)if(W[K]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const ue=(0,R.parseColor)(W[K]);ue&&this._onColor.fire([{type:1,index:this._specialColors[U],color:ue}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const U=[],W=B.split(";");for(let K=0;K<W.length;++K)if(/^\d+$/.exec(W[K])){const ue=parseInt(W[K]);ke(ue)&&U.push({type:2,index:ue})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(O[B[0]],b.CHARSETS[B[1]]||b.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new g.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const W=this._activeBuffer.ybase+this._activeBuffer.y+U,K=this._activeBuffer.lines.get(W);K&&(K.fill(B),K.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,U){const W=this._bufferService.buffer,K=this._optionsService.rawOptions;return(ue=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${ue}${h.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${W.scrollTop+1};${W.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[K.cursorStyle]-(K.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,U){this._dirtyRowTracker.markRangeDirty(B,U)}}s.InputHandler=ae;let ge=class{constructor(re){this._bufferService=re,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(re){re<this.start?this.start=re:re>this.end&&(this.end=re)}markRangeDirty(re,B){re>B&&(ee=re,re=B,B=ee),re<this.start&&(this.start=re),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ke(re){return 0<=re&&re<256}ge=c([m(0,k.IBufferService)],ge)},844:(l,s)=>{function a(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(m,h,b){this._data[m]||(this._data[m]={}),this._data[m][h]=b}get(m,h){return this._data[m]?this._data[m][h]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,m,h,b,_){this._data.get(c,m)||this._data.set(c,m,new a),this._data.get(c,m).set(h,b,_)}get(c,m,h,b){var _;return(_=this._data.get(c,m))==null?void 0:_.get(h,b)}clear(){this._data.clear()}}},6114:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const a=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const m=a.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const m=this._getKey(c);if(m===void 0||(a=this._search(m),a===-1)||this._getKey(this._array[a])!==m)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===m);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,m){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do m(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let m=0,h=this._array.length-1;for(;h>=m;){let b=m+h>>1;const _=this._getKey(this._array[b]);if(_>c)h=b-1;else{if(!(_<c)){for(;b>0&&this._getKey(this._array[b-1])===c;)b--;return b}m=b+1}}return m}}},7226:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=a(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let C=0,y=0,d=_.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),y=Math.max(C,y),p=_.timeRemaining(),1.5*y>p)return d-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-C))}ms`),void this._start();d=p}this.clear()}}class h extends m{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const C=Date.now()+_;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}s.PriorityTaskQueue=h,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:h,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=a(643);s.updateWindowsModeWrappedState=function(m){const h=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),b=h==null?void 0:h.get(m.cols-1),_=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);_&&b&&(_.isWrapped=b[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&b[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new a;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,b=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=b}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=a(6349),m=a(7226),h=a(3734),b=a(8437),_=a(4634),C=a(511),y=a(643),d=a(4863),p=a(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(f,g,S){this._hasScrollback=f,this._optionsService=g,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,g){return new b.BufferLine(this._bufferService.cols,this.getNullCell(f),g)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const g=f+this._optionsService.rawOptions.scrollback;return g>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:g}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=b.DEFAULT_ATTR_DATA);let g=this._rows;for(;g--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,g){const S=this.getNullCell(b.DEFAULT_ATTR_DATA);let k=0;const I=this._getCorrectBufferLength(g);if(I>this.lines.maxLength&&(this.lines.maxLength=I),this.lines.length>0){if(this._cols<f)for(let E=0;E<this.lines.length;E++)k+=+this.lines.get(E).resize(f,S);let N=0;if(this._rows<g)for(let E=this._rows;E<g;E++)this.lines.length<g+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(f,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+N+1?(this.ybase--,N++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(f,S)));else for(let E=this._rows;E>g;E--)this.lines.length>g+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(I<this.lines.maxLength){const E=this.lines.length-I;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=I}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,g-1),N&&(this.y+=N),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=g-1,this._isReflowEnabled&&(this._reflow(f,g),this._cols>f))for(let N=0;N<this.lines.length;N++)k+=+this.lines.get(N).resize(f,S);this._cols=f,this._rows=g,this._memoryCleanupQueue.clear(),k>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let g=0;for(;this._memoryCleanupPosition<this.lines.length;)if(g+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),g>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,g){this._cols!==f&&(f>this._cols?this._reflowLarger(f,g):this._reflowSmaller(f,g))}_reflowLarger(f,g){const S=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(S.length>0){const k=(0,_.reflowLargerCreateNewLayout)(this.lines,S);(0,_.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(f,g,k.countRemoved)}}_reflowLargerAdjustViewport(f,g,S){const k=this.getNullCell(b.DEFAULT_ATTR_DATA);let I=S;for(;I-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<g&&this.lines.push(new b.BufferLine(f,k))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,g){const S=this.getNullCell(b.DEFAULT_ATTR_DATA),k=[];let I=0;for(let N=this.lines.length-1;N>=0;N--){let E=this.lines.get(N);if(!E||!E.isWrapped&&E.getTrimmedLength()<=f)continue;const R=[E];for(;E.isWrapped&&N>0;)E=this.lines.get(--N),R.unshift(E);const O=this.ybase+this.y;if(O>=N&&O<N+R.length)continue;const V=R[R.length-1].getTrimmedLength(),M=(0,_.reflowSmallerGetNewLineLengths)(R,this._cols,f),D=M.length-R.length;let ee;ee=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const ae=[];for(let W=0;W<D;W++){const K=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);ae.push(K)}ae.length>0&&(k.push({start:N+R.length+I,newLines:ae}),I+=ae.length),R.push(...ae);let ge=M.length-1,ke=M[ge];ke===0&&(ge--,ke=M[ge]);let re=R.length-D-1,B=V;for(;re>=0;){const W=Math.min(B,ke);if(R[ge]===void 0)break;if(R[ge].copyCellsFrom(R[re],B-W,ke-W,W,!0),ke-=W,ke===0&&(ge--,ke=M[ge]),B-=W,B===0){re--;const K=Math.max(re,0);B=(0,_.getWrappedLineTrimmedLength)(R,K,this._cols)}}for(let W=0;W<R.length;W++)M[W]<f&&R[W].setCell(M[W],S);let U=D-ee;for(;U-- >0;)this.ybase===0?this.y<g-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+I)-g&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+g-1)}if(k.length>0){const N=[],E=[];for(let ge=0;ge<this.lines.length;ge++)E.push(this.lines.get(ge));const R=this.lines.length;let O=R-1,V=0,M=k[V];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+I);let D=0;for(let ge=Math.min(this.lines.maxLength-1,R+I-1);ge>=0;ge--)if(M&&M.start>O+D){for(let ke=M.newLines.length-1;ke>=0;ke--)this.lines.set(ge--,M.newLines[ke]);ge++,N.push({index:O+1,amount:M.newLines.length}),D+=M.newLines.length,M=k[++V]}else this.lines.set(ge,E[O--]);let ee=0;for(let ge=N.length-1;ge>=0;ge--)N[ge].index+=ee,this.lines.onInsertEmitter.fire(N[ge]),ee+=N[ge].amount;const ae=Math.max(0,R+I-this.lines.maxLength);ae>0&&this.lines.onTrimEmitter.fire(ae)}}translateBufferLineToString(f,g,S=0,k){const I=this.lines.get(f);return I?I.translateToString(g,S,k):""}getWrappedRangeForLine(f){let g=f,S=f;for(;g>0&&this.lines.get(g).isWrapped;)g--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:g,last:S}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].line===f&&(this.markers[g].dispose(),this.markers.splice(g--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const g=new d.Marker(f);return this.markers.push(g),g.register(this.lines.onTrim((S=>{g.line-=S,g.line<0&&g.dispose()}))),g.register(this.lines.onInsert((S=>{g.line>=S.index&&(g.line+=S.amount)}))),g.register(this.lines.onDelete((S=>{g.line>=S.index&&g.line<S.index+S.amount&&g.dispose(),g.line>S.index&&(g.line-=S.amount)}))),g.register(g.onDispose((()=>this._removeMarker(g)))),g}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=a(3734),m=a(511),h=a(643),b=a(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class C{constructor(d,p,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const g=p||m.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let S=0;S<d;++S)this.setCell(S,g);this.length=d}get(d){const p=this._data[3*d+0],f=2097151&p;return[this._data[3*d+1],2097152&p?this._combined[d]:f?(0,b.stringFromCodePoint)(f):"",p>>22,2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):f]}set(d,p){this._data[3*d+1]=p[h.CHAR_DATA_ATTR_INDEX],p[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=p[1],this._data[3*d+0]=2097152|d|p[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=p[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&p}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d]:2097151&p?(0,b.stringFromCodePoint)(2097151&p):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,p){return _=3*d,p.content=this._data[_+0],p.fg=this._data[_+1],p.bg=this._data[_+2],2097152&p.content&&(p.combinedData=this._combined[d]),268435456&p.bg&&(p.extended=this._extendedAttrs[d]),p}setCell(d,p){2097152&p.content&&(this._combined[d]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[d]=p.extended),this._data[3*d+0]=p.content,this._data[3*d+1]=p.fg,this._data[3*d+2]=p.bg}setCellFromCodepoint(d,p,f,g){268435456&g.bg&&(this._extendedAttrs[d]=g.extended),this._data[3*d+0]=p|f<<22,this._data[3*d+1]=g.fg,this._data[3*d+2]=g.bg}addCodepointToCell(d,p,f){let g=this._data[3*d+0];2097152&g?this._combined[d]+=(0,b.stringFromCodePoint)(p):2097151&g?(this._combined[d]=(0,b.stringFromCodePoint)(2097151&g)+(0,b.stringFromCodePoint)(p),g&=-2097152,g|=2097152):g=p|4194304,f&&(g&=-12582913,g|=f<<22),this._data[3*d+0]=g}insertCells(d,p,f){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length-d){const g=new m.CellData;for(let S=this.length-d-p-1;S>=0;--S)this.setCell(d+p+S,this.loadCell(d+S,g));for(let S=0;S<p;++S)this.setCell(d+S,f)}else for(let g=d;g<this.length;++g)this.setCell(g,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(d,p,f){if(d%=this.length,p<this.length-d){const g=new m.CellData;for(let S=0;S<this.length-d-p;++S)this.setCell(d+S,this.loadCell(d+p+S,g));for(let S=this.length-p;S<this.length;++S)this.setCell(S,f)}else for(let g=d;g<this.length;++g)this.setCell(g,f);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,f)}replaceCells(d,p,f,g=!1){if(g)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,f);d<p&&d<this.length;)this.isProtected(d)||this.setCell(d,f),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,f);d<p&&d<this.length;)this.setCell(d++,f)}resize(d,p){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const g=new Uint32Array(f);g.set(this._data),this._data=g}for(let g=this.length;g<d;++g)this.setCell(g,p)}else{this._data=this._data.subarray(0,f);const g=Object.keys(this._combined);for(let k=0;k<g.length;k++){const I=parseInt(g[k],10);I>=d&&delete this._combined[I]}const S=Object.keys(this._extendedAttrs);for(let k=0;k<S.length;k++){const I=parseInt(S[k],10);I>=d&&delete this._extendedAttrs[I]}}return this.length=d,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,p=!1){if(p)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,d);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const p in d._combined)this._combined[p]=d._combined[p];this._extendedAttrs={};for(const p in d._extendedAttrs)this._extendedAttrs[p]=d._extendedAttrs[p];this.isWrapped=d.isWrapped}clone(){const d=new C(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const p in this._combined)d._combined[p]=this._combined[p];for(const p in this._extendedAttrs)d._extendedAttrs[p]=this._extendedAttrs[p];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,p,f,g,S){const k=d._data;if(S)for(let N=g-1;N>=0;N--){for(let E=0;E<3;E++)this._data[3*(f+N)+E]=k[3*(p+N)+E];268435456&k[3*(p+N)+2]&&(this._extendedAttrs[f+N]=d._extendedAttrs[p+N])}else for(let N=0;N<g;N++){for(let E=0;E<3;E++)this._data[3*(f+N)+E]=k[3*(p+N)+E];268435456&k[3*(p+N)+2]&&(this._extendedAttrs[f+N]=d._extendedAttrs[p+N])}const I=Object.keys(d._combined);for(let N=0;N<I.length;N++){const E=parseInt(I[N],10);E>=p&&(this._combined[E-p+f]=d._combined[E])}}translateToString(d,p,f,g){p=p??0,f=f??this.length,d&&(f=Math.min(f,this.getTrimmedLength())),g&&(g.length=0);let S="";for(;p<f;){const k=this._data[3*p+0],I=2097151&k,N=2097152&k?this._combined[p]:I?(0,b.stringFromCodePoint)(I):h.WHITESPACE_CELL_CHAR;if(S+=N,g)for(let E=0;E<N.length;++E)g.push(p);p+=k>>22||1}return g&&g.push(p),S}}s.BufferLine=C},4841:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(l,s)=>{function a(c,m,h){if(m===c.length-1)return c[m].getTrimmedLength();const b=!c[m].hasContent(h-1)&&c[m].getWidth(h-1)===1,_=c[m+1].getWidth(0)===2;return b&&_?h-1:h}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,m,h,b,_){const C=[];for(let y=0;y<c.length-1;y++){let d=y,p=c.get(++d);if(!p.isWrapped)continue;const f=[c.get(y)];for(;d<c.length&&p.isWrapped;)f.push(p),p=c.get(++d);if(b>=y&&b<d){y+=f.length-1;continue}let g=0,S=a(f,g,m),k=1,I=0;for(;k<f.length;){const E=a(f,k,m),R=E-I,O=h-S,V=Math.min(R,O);f[g].copyCellsFrom(f[k],I,S,V,!1),S+=V,S===h&&(g++,S=0),I+=V,I===E&&(k++,I=0),S===0&&g!==0&&f[g-1].getWidth(h-1)===2&&(f[g].copyCellsFrom(f[g-1],h-1,S++,1,!1),f[g-1].setCell(h-1,_))}f[g].replaceCells(S,h,_);let N=0;for(let E=f.length-1;E>0&&(E>g||f[E].getTrimmedLength()===0);E--)N++;N>0&&(C.push(y+f.length-N),C.push(N)),y+=f.length-1}return C},s.reflowLargerCreateNewLayout=function(c,m){const h=[];let b=0,_=m[b],C=0;for(let y=0;y<c.length;y++)if(_===y){const d=m[++b];c.onDeleteEmitter.fire({index:y-C,amount:d}),y+=d-1,C+=d,_=m[++b]}else h.push(y);return{layout:h,countRemoved:C}},s.reflowLargerApplyNewLayout=function(c,m){const h=[];for(let b=0;b<m.length;b++)h.push(c.get(m[b]));for(let b=0;b<h.length;b++)c.set(b,h[b]);c.length=m.length},s.reflowSmallerGetNewLineLengths=function(c,m,h){const b=[],_=c.map(((p,f)=>a(c,f,m))).reduce(((p,f)=>p+f));let C=0,y=0,d=0;for(;d<_;){if(_-d<h){b.push(_-d);break}C+=h;const p=a(c,y,m);C>p&&(C-=p,y++);const f=c[y].getWidth(C-1)===2;f&&C--;const g=f?h-1:h;b.push(g),d+=g}return b},s.getWrappedLineTrimmedLength=a},5295:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=a(8460),m=a(844),h=a(9092);class b extends m.Disposable{constructor(C,y){super(),this._optionsService=C,this._bufferService=y,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,y){this._normal.resize(C,y),this._alt.resize(C,y),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}s.BufferSet=b},511:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=a(482),m=a(643),h=a(3734);class b extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const y=new b;return y.setFromCharData(C),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(C[m.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(C[m.CHAR_DATA_CHAR_INDEX].length===2){const d=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const p=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(d-55296)+p-56320+65536|C[m.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[m.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=C[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=b},643:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=a(8460),m=a(844);class h{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}s.Marker=h,h._nextId=1},7116:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,s)=>{var a,c,m;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
49
- `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(a||(s.C0=a={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(c||(s.C1=c={})),(function(h){h.ST=`${a.ESC}\\`})(m||(s.C1_ESCAPED=m={}))},7399:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=a(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(h,b,_,C){const y={type:0,cancel:!1,key:void 0},d=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?y.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?y.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?y.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(y.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:y.key=h.ctrlKey?"\b":c.C0.DEL,h.altKey&&(y.key=c.C0.ESC+y.key);break;case 9:if(h.shiftKey){y.key=c.C0.ESC+"[Z";break}y.key=c.C0.HT,y.cancel=!0;break;case 13:y.key=h.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,y.cancel=!0;break;case 27:y.key=c.C0.ESC,h.altKey&&(y.key=c.C0.ESC+c.C0.ESC),y.cancel=!0;break;case 37:if(h.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"D",y.key===c.C0.ESC+"[1;3D"&&(y.key=c.C0.ESC+(_?"b":"[1;5D"))):y.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(h.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"C",y.key===c.C0.ESC+"[1;3C"&&(y.key=c.C0.ESC+(_?"f":"[1;5C"))):y.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(h.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"A",_||y.key!==c.C0.ESC+"[1;3A"||(y.key=c.C0.ESC+"[1;5A")):y.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(h.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"B",_||y.key!==c.C0.ESC+"[1;3B"||(y.key=c.C0.ESC+"[1;5B")):y.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(y.key=c.C0.ESC+"[2~");break;case 46:y.key=d?c.C0.ESC+"[3;"+(d+1)+"~":c.C0.ESC+"[3~";break;case 36:y.key=d?c.C0.ESC+"[1;"+(d+1)+"H":b?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:y.key=d?c.C0.ESC+"[1;"+(d+1)+"F":b?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:h.shiftKey?y.type=2:h.ctrlKey?y.key=c.C0.ESC+"[5;"+(d+1)+"~":y.key=c.C0.ESC+"[5~";break;case 34:h.shiftKey?y.type=3:h.ctrlKey?y.key=c.C0.ESC+"[6;"+(d+1)+"~":y.key=c.C0.ESC+"[6~";break;case 112:y.key=d?c.C0.ESC+"[1;"+(d+1)+"P":c.C0.ESC+"OP";break;case 113:y.key=d?c.C0.ESC+"[1;"+(d+1)+"Q":c.C0.ESC+"OQ";break;case 114:y.key=d?c.C0.ESC+"[1;"+(d+1)+"R":c.C0.ESC+"OR";break;case 115:y.key=d?c.C0.ESC+"[1;"+(d+1)+"S":c.C0.ESC+"OS";break;case 116:y.key=d?c.C0.ESC+"[15;"+(d+1)+"~":c.C0.ESC+"[15~";break;case 117:y.key=d?c.C0.ESC+"[17;"+(d+1)+"~":c.C0.ESC+"[17~";break;case 118:y.key=d?c.C0.ESC+"[18;"+(d+1)+"~":c.C0.ESC+"[18~";break;case 119:y.key=d?c.C0.ESC+"[19;"+(d+1)+"~":c.C0.ESC+"[19~";break;case 120:y.key=d?c.C0.ESC+"[20;"+(d+1)+"~":c.C0.ESC+"[20~";break;case 121:y.key=d?c.C0.ESC+"[21;"+(d+1)+"~":c.C0.ESC+"[21~";break;case 122:y.key=d?c.C0.ESC+"[23;"+(d+1)+"~":c.C0.ESC+"[23~";break;case 123:y.key=d?c.C0.ESC+"[24;"+(d+1)+"~":c.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(_&&!C||!h.altKey||h.metaKey)!_||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?y.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(y.key=c.C0.US),h.key==="@"&&(y.key=c.C0.NUL)):h.keyCode===65&&(y.type=1);else{const p=m[h.keyCode],f=p==null?void 0:p[h.shiftKey?1:0];if(f)y.key=c.C0.ESC+f;else if(h.keyCode>=65&&h.keyCode<=90){const g=h.ctrlKey?h.keyCode-64:h.keyCode+32;let S=String.fromCharCode(g);h.shiftKey&&(S=S.toUpperCase()),y.key=c.C0.ESC+S}else if(h.keyCode===32)y.key=c.C0.ESC+(h.ctrlKey?c.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let g=h.code.slice(3,4);h.shiftKey||(g=g.toLowerCase()),y.key=c.C0.ESC+g,y.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?y.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?y.key=c.C0.NUL:h.keyCode>=51&&h.keyCode<=55?y.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?y.key=c.C0.DEL:h.keyCode===219?y.key=c.C0.ESC:h.keyCode===220?y.key=c.C0.FS:h.keyCode===221&&(y.key=c.C0.GS)}return y}},482:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,c=0,m=a.length){let h="";for(let b=c;b<m;++b){let _=a[b];_>65535?(_-=65536,h+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):h+=String.fromCharCode(_)}return h},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const m=a.length;if(!m)return 0;let h=0,b=0;if(this._interim){const _=a.charCodeAt(b++);56320<=_&&_<=57343?c[h++]=1024*(this._interim-55296)+_-56320+65536:(c[h++]=this._interim,c[h++]=_),this._interim=0}for(let _=b;_<m;++_){const C=a.charCodeAt(_);if(55296<=C&&C<=56319){if(++_>=m)return this._interim=C,h;const y=a.charCodeAt(_);56320<=y&&y<=57343?c[h++]=1024*(C-55296)+y-56320+65536:(c[h++]=C,c[h++]=y)}else C!==65279&&(c[h++]=C)}return h}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const m=a.length;if(!m)return 0;let h,b,_,C,y=0,d=0,p=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let I,N=0;for(;(I=63&this.interim[++N])&&N<4;)k<<=6,k|=I;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=E-N;for(;p<R;){if(p>=m)return 0;if(I=a[p++],(192&I)!=128){p--,S=!0;break}this.interim[N++]=I,k<<=6,k|=63&I}S||(E===2?k<128?p--:c[y++]=k:E===3?k<2048||k>=55296&&k<=57343||k===65279||(c[y++]=k):k<65536||k>1114111||(c[y++]=k)),this.interim.fill(0)}const f=m-4;let g=p;for(;g<m;){for(;!(!(g<f)||128&(h=a[g])||128&(b=a[g+1])||128&(_=a[g+2])||128&(C=a[g+3]));)c[y++]=h,c[y++]=b,c[y++]=_,c[y++]=C,g+=4;if(h=a[g++],h<128)c[y++]=h;else if((224&h)==192){if(g>=m)return this.interim[0]=h,y;if(b=a[g++],(192&b)!=128){g--;continue}if(d=(31&h)<<6|63&b,d<128){g--;continue}c[y++]=d}else if((240&h)==224){if(g>=m)return this.interim[0]=h,y;if(b=a[g++],(192&b)!=128){g--;continue}if(g>=m)return this.interim[0]=h,this.interim[1]=b,y;if(_=a[g++],(192&_)!=128){g--;continue}if(d=(15&h)<<12|(63&b)<<6|63&_,d<2048||d>=55296&&d<=57343||d===65279)continue;c[y++]=d}else if((248&h)==240){if(g>=m)return this.interim[0]=h,y;if(b=a[g++],(192&b)!=128){g--;continue}if(g>=m)return this.interim[0]=h,this.interim[1]=b,y;if(_=a[g++],(192&_)!=128){g--;continue}if(g>=m)return this.interim[0]=h,this.interim[1]=b,this.interim[2]=_,y;if(C=a[g++],(192&C)!=128){g--;continue}if(d=(7&h)<<18|(63&b)<<12|(63&_)<<6|63&C,d<65536||d>1114111)continue;c[y++]=d}}return y}}},225:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;s.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let _=0;_<m.length;++_)b.fill(0,m[_][0],m[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?b[_]:(function(C,y){let d,p=0,f=y.length-1;if(C<y[0][0]||C>y[f][1])return!1;for(;f>=p;)if(d=p+f>>1,C>y[d][1])p=d+1;else{if(!(C<y[d][0]))return!0;f=d-1}return!1})(_,h)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,C){let y=this.wcwidth(_),d=y===0&&C!==0;if(d){const p=c.UnicodeService.extractWidth(C);p===0?d=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,d)}}},5981:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=a(8460),m=a(844);class h extends m.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C)}_innerWrite(_=0,C=!0){const y=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],p=this._action(d,C);if(p){const g=S=>Date.now()-y>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(y,S);return void p.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(g)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=h},5941:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function m(h,b){const _=h.toString(16),C=_.length<2?"0"+_:_;switch(b){case 4:return _[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}s.parseColor=function(h){if(!h)return;let b=h.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const _=a.exec(b);if(_){const C=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/C*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/C*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/C*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),c.exec(b)&&[3,6,9,12].includes(b.length))){const _=b.length/3,C=[0,0,0];for(let y=0;y<3;++y){const d=parseInt(b.slice(_*y,_*y+_),16);C[y]=_===1?d<<4:_===2?d:_===3?d>>4:d>>8}return C}},s.toRgbString=function(h,b=16){const[_,C,y]=h;return`rgb:${m(_,b)}/${m(C,b)}/${m(y,b)}`}},5770:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=a(482),m=a(8742),h=a(5770),b=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(C,y){this._handlers[C]===void 0&&(this._handlers[C]=[]);const d=this._handlers[C];return d.push(y),{dispose:()=>{const p=d.indexOf(y);p!==-1&&d.splice(p,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(C,y){if(this.reset(),this._ident=C,this._active=this._handlers[C]||b,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(C,y,d){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(C,y,d);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(C,y,d))}unhook(C,y=!0){if(this._active.length){let d=!1,p=this._active.length-1,f=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,d=y,f=this._stack.fallThrough,this._stack.paused=!1),!f&&d===!1){for(;p>=0&&(d=this._active[p].unhook(C),d!==!0);p--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,d;p--}for(;p>=0;p--)if(d=this._active[p].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",C);this._active=b,this._ident=0}};const _=new m.Params;_.addParam(0),s.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=_,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():_,this._data="",this._hitLimit=!1}put(C,y,d){this._hitLimit||(this._data+=(0,c.utf32ToString)(C,y,d),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let y=!1;if(this._hitLimit)y=!1;else if(C&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then((d=>(this._params=_,this._data="",this._hitLimit=!1,d)));return this._params=_,this._data="",this._hitLimit=!1,y}}},2015:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=a(844),m=a(8742),h=a(6242),b=a(6351);class _{constructor(p){this.table=new Uint8Array(p)}setDefault(p,f){this.table.fill(p<<4|f)}add(p,f,g,S){this.table[f<<8|p]=g<<4|S}addMany(p,f,g,S){for(let k=0;k<p.length;k++)this.table[f<<8|p[k]]=g<<4|S}}s.TransitionTable=_;const C=160;s.VT500_TRANSITION_TABLE=(function(){const d=new _(4095),p=Array.apply(null,Array(256)).map(((N,E)=>E)),f=(N,E)=>p.slice(N,E),g=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const k=f(0,14);let I;for(I in d.setDefault(1,0),d.addMany(g,0,2,0),k)d.addMany([24,26,153,154],I,3,0),d.addMany(f(128,144),I,3,0),d.addMany(f(144,152),I,3,0),d.add(156,I,0,0),d.add(27,I,11,1),d.add(157,I,4,8),d.addMany([152,158,159],I,0,7),d.add(155,I,11,3),d.add(144,I,11,9);return d.addMany(S,0,3,0),d.addMany(S,1,3,1),d.add(127,1,0,1),d.addMany(S,8,0,8),d.addMany(S,3,3,3),d.add(127,3,0,3),d.addMany(S,4,3,4),d.add(127,4,0,4),d.addMany(S,6,3,6),d.addMany(S,5,3,5),d.add(127,5,0,5),d.addMany(S,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(g,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(f(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(g,7,0,7),d.addMany(S,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(f(64,127),3,7,0),d.addMany(f(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(f(48,60),4,8,4),d.addMany(f(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(f(32,64),6,0,6),d.add(127,6,0,6),d.addMany(f(64,127),6,0,0),d.addMany(f(32,48),3,9,5),d.addMany(f(32,48),5,9,5),d.addMany(f(48,64),5,0,6),d.addMany(f(64,127),5,7,0),d.addMany(f(32,48),4,9,5),d.addMany(f(32,48),1,9,2),d.addMany(f(32,48),2,9,2),d.addMany(f(48,127),2,10,0),d.addMany(f(48,80),1,10,0),d.addMany(f(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(f(96,127),1,10,0),d.add(80,1,11,9),d.addMany(S,9,0,9),d.add(127,9,0,9),d.addMany(f(28,32),9,0,9),d.addMany(f(32,48),9,9,12),d.addMany(f(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(S,11,0,11),d.addMany(f(32,128),11,0,11),d.addMany(f(28,32),11,0,11),d.addMany(S,10,0,10),d.add(127,10,0,10),d.addMany(f(28,32),10,0,10),d.addMany(f(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(f(32,48),10,9,12),d.addMany(S,12,0,12),d.add(127,12,0,12),d.addMany(f(28,32),12,0,12),d.addMany(f(32,48),12,9,12),d.addMany(f(48,64),12,0,11),d.addMany(f(64,127),12,12,13),d.addMany(f(64,127),10,12,13),d.addMany(f(64,127),9,12,13),d.addMany(S,13,13,13),d.addMany(g,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(C,0,2,0),d.add(C,8,5,8),d.add(C,6,0,6),d.add(C,11,0,11),d.add(C,13,13,13),d})();class y extends c.Disposable{constructor(p=s.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,g,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,g)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(p,f=[64,126]){let g=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(g=p.prefix.charCodeAt(0),g&&60>g||g>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;k<p.intermediates.length;++k){const I=p.intermediates.charCodeAt(k);if(32>I||I>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");g<<=8,g|=I}}if(p.final.length!==1)throw new Error("final must be a single byte");const S=p.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return g<<=8,g|=S,g}identToString(p){const f=[];for(;p;)f.push(String.fromCharCode(255&p)),p>>=8;return f.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,f){const g=this._identifier(p,[48,126]);this._escHandlers[g]===void 0&&(this._escHandlers[g]=[]);const S=this._escHandlers[g];return S.push(f),{dispose:()=>{const k=S.indexOf(f);k!==-1&&S.splice(k,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,f){this._executeHandlers[p.charCodeAt(0)]=f}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,f){const g=this._identifier(p);this._csiHandlers[g]===void 0&&(this._csiHandlers[g]=[]);const S=this._csiHandlers[g];return S.push(f),{dispose:()=>{const k=S.indexOf(f);k!==-1&&S.splice(k,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,f){return this._dcsParser.registerHandler(this._identifier(p),f)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,f){return this._oscParser.registerHandler(p,f)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(p,f,g,S,k){this._parseStack.state=p,this._parseStack.handlers=f,this._parseStack.handlerPos=g,this._parseStack.transition=S,this._parseStack.chunkPos=k}parse(p,f,g){let S,k=0,I=0,N=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,N=this._parseStack.chunkPos+1;else{if(g===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(g===!1&&R>-1){for(;R>=0&&(S=E[R](this._params),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 4:if(g===!1&&R>-1){for(;R>=0&&(S=E[R](),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 6:if(k=p[this._parseStack.chunkPos],S=this._dcsParser.unhook(k!==24&&k!==26,g),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=p[this._parseStack.chunkPos],S=this._oscParser.end(k!==24&&k!==26,g),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,N=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=N;E<f;++E){switch(k=p[E],I=this._transitions.table[this.currentState<<8|(k<160?k:C)],I>>4){case 2:for(let D=E+1;;++D){if(D>=f||(k=p[D])<32||k>126&&k<C){this._printHandler(p,E,D),E=D-1;break}if(++D>=f||(k=p[D])<32||k>126&&k<C){this._printHandler(p,E,D),E=D-1;break}if(++D>=f||(k=p[D])<32||k>126&&k<C){this._printHandler(p,E,D),E=D-1;break}if(++D>=f||(k=p[D])<32||k>126&&k<C){this._printHandler(p,E,D),E=D-1;break}}break;case 3:this._executeHandlers[k]?this._executeHandlers[k]():this._executeHandlerFb(k),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:k,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|k];let O=R?R.length-1:-1;for(;O>=0&&(S=R[O](this._params),S!==!0);O--)if(S instanceof Promise)return this._preserveStack(3,R,O,I,E),S;O<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingJoinState=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++E<f&&(k=p[E])>47&&k<60);E--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const V=this._escHandlers[this._collect<<8|k];let M=V?V.length-1:-1;for(;M>=0&&(S=V[M](),S!==!0);M--)if(S instanceof Promise)return this._preserveStack(4,V,M,I,E),S;M<0&&this._escHandlerFb(this._collect<<8|k),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|k,this._params);break;case 13:for(let D=E+1;;++D)if(D>=f||(k=p[D])===24||k===26||k===27||k>127&&k<C){this._dcsParser.put(p,E,D),E=D-1;break}break;case 14:if(S=this._dcsParser.unhook(k!==24&&k!==26),S)return this._preserveStack(6,[],0,I,E),S;k===27&&(I|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let D=E+1;;D++)if(D>=f||(k=p[D])<32||k>127&&k<C){this._oscParser.put(p,E,D),E=D-1;break}break;case 6:if(S=this._oscParser.end(k!==24&&k!==26),S)return this._preserveStack(5,[],0,I,E),S;k===27&&(I|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&I}}}s.EscapeSequenceParser=y},6242:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=a(5770),m=a(482),h=[];s.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,_){this._handlers[b]===void 0&&(this._handlers[b]=[]);const C=this._handlers[b];return C.push(_),{dispose:()=>{const y=C.indexOf(_);y!==-1&&C.splice(y,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,_,C){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(b,_,C);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(b,_,C))}start(){this.reset(),this._state=1}put(b,_,C){if(this._state!==3){if(this._state===1)for(;_<C;){const y=b[_++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&C-_>0&&this._put(b,_,C)}}end(b,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,y=this._active.length-1,d=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,C=_,d=this._stack.fallThrough,this._stack.paused=!1),!d&&C===!1){for(;y>=0&&(C=this._active[y].end(b),C!==!0);y--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,C;y--}for(;y>=0;y--)if(C=this._active[y].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",b);this._active=h,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,_,C){this._hitLimit||(this._data+=(0,m.utf32ToString)(b,_,C),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let _=!1;if(this._hitLimit)_=!1;else if(b&&(_=this._handler(this._data),_ instanceof Promise))return _.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,_}}},8742:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class c{static fromArray(h){const b=new c;if(!h.length)return b;for(let _=Array.isArray(h[0])?1:0;_<h.length;++_){const C=h[_];if(Array.isArray(C))for(let y=0;y<C.length;++y)b.addSubParam(C[y]);else b.addParam(C)}return b}constructor(h=32,b=32){if(this.maxLength=h,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new c(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let b=0;b<this.length;++b){h.push(this.params[b]);const _=this._subParamsIdx[b]>>8,C=255&this._subParamsIdx[b];C-_>0&&h.push(Array.prototype.slice.call(this._subParams,_,C))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>a?a:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>a?a:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const b=this._subParamsIdx[h]>>8,_=255&this._subParamsIdx[h];return _-b>0?this._subParams.subarray(b,_):null}getSubParamsAll(){const h={};for(let b=0;b<this.length;++b){const _=this._subParamsIdx[b]>>8,C=255&this._subParamsIdx[b];C-_>0&&(h[b]=this._subParams.slice(_,C))}return h}addDigit(h){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,C=_[b-1];_[b-1]=~C?Math.min(10*C+h,a):h}}s.Params=c},5741:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const m={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(m),c.dispose=()=>this._wrappedAddonDispose(m),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===a){c=m;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=a(3785),m=a(511);s.BufferApiView=class{constructor(h,b){this._buffer=h,this.type=b}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const b=this._buffer.lines.get(h);if(b)return new c.BufferLineApiView(b)}getNullCell(){return new m.CellData}}},3785:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=a(511);s.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,h){if(!(m<0||m>=this._line.length))return h?(this._line.loadCell(m,h),h):this._line.loadCell(m,new c.CellData)}translateToString(m,h,b){return this._line.translateToString(m,h,b)}}},8285:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=a(8771),m=a(8460),h=a(844);class b extends h.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=b},7975:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,(m=>c(m.toArray())))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,((m,h)=>c(m,h.toArray())))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(l,s,a){var c=this&&this.__decorate||function(d,p,f,g){var S,k=arguments.length,I=k<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(d,p,f,g);else for(var N=d.length-1;N>=0;N--)(S=d[N])&&(I=(k<3?S(I):k>3?S(p,f,I):S(p,f))||I);return k>3&&I&&Object.defineProperty(p,f,I),I},m=this&&this.__param||function(d,p){return function(f,g){p(f,g,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const h=a(8460),b=a(844),_=a(5295),C=a(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let y=s.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(d,this))}resize(d,p){this.cols=d,this.rows=p,this.buffers.resize(d,p),this._onResize.fire({cols:d,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,p=!1){const f=this.buffer;let g;g=this._cachedBlankLine,g&&g.length===this.cols&&g.getFg(0)===d.fg&&g.getBg(0)===d.bg||(g=f.getBlankLine(d,p),this._cachedBlankLine=g),g.isWrapped=p;const S=f.ybase+f.scrollTop,k=f.ybase+f.scrollBottom;if(f.scrollTop===0){const I=f.lines.isFull;k===f.lines.length-1?I?f.lines.recycle().copyFrom(g):f.lines.push(g.clone()):f.lines.splice(k+1,0,g.clone()),I?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const I=k-S+1;f.lines.shiftElements(S+1,I-1,-1),f.lines.set(k,g.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(d,p,f){const g=this.buffer;if(d<0){if(g.ydisp===0)return;this.isUserScrolling=!0}else d+g.ydisp>=g.ybase&&(this.isUserScrolling=!1);const S=g.ydisp;g.ydisp=Math.max(Math.min(g.ydisp+d,g.ybase),0),S!==g.ydisp&&(p||this._onScroll.fire(g.ydisp))}};s.BufferService=y=c([m(0,C.IOptionsService)],y)},7994:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(l,s,a){var c=this&&this.__decorate||function(g,S,k,I){var N,E=arguments.length,R=E<3?S:I===null?I=Object.getOwnPropertyDescriptor(S,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,S,k,I);else for(var O=g.length-1;O>=0;O--)(N=g[O])&&(R=(E<3?N(R):E>3?N(S,k,R):N(S,k))||R);return E>3&&R&&Object.defineProperty(S,k,R),R},m=this&&this.__param||function(g,S){return function(k,I){S(k,I,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const h=a(2585),b=a(8460),_=a(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:g=>g.button!==4&&g.action===1&&(g.ctrl=!1,g.alt=!1,g.shift=!1,!0)},VT200:{events:19,restrict:g=>g.action!==32},DRAG:{events:23,restrict:g=>g.action!==32||g.button!==3},ANY:{events:31,restrict:g=>!0}};function y(g,S){let k=(g.ctrl?16:0)|(g.shift?4:0)|(g.alt?8:0);return g.button===4?(k|=64,k|=g.action):(k|=3&g.button,4&g.button&&(k|=64),8&g.button&&(k|=128),g.action===32?k|=32:g.action!==0||S||(k|=3)),k}const d=String.fromCharCode,p={DEFAULT:g=>{const S=[y(g,!1)+32,g.col+32,g.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${d(S[0])}${d(S[1])}${d(S[2])}`},SGR:g=>{const S=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${y(g,!0)};${g.col};${g.row}${S}`},SGR_PIXELS:g=>{const S=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${y(g,!0)};${g.x};${g.y}${S}`}};let f=s.CoreMouseService=class extends _.Disposable{constructor(g,S){super(),this._bufferService=g,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const k of Object.keys(C))this.addProtocol(k,C[k]);for(const k of Object.keys(p))this.addEncoding(k,p[k]);this.reset()}addProtocol(g,S){this._protocols[g]=S}addEncoding(g,S){this._encodings[g]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(g){if(!this._protocols[g])throw new Error(`unknown protocol "${g}"`);this._activeProtocol=g,this._onProtocolChange.fire(this._protocols[g].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(g){if(!this._encodings[g])throw new Error(`unknown encoding "${g}"`);this._activeEncoding=g}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(g){if(g.col<0||g.col>=this._bufferService.cols||g.row<0||g.row>=this._bufferService.rows||g.button===4&&g.action===32||g.button===3&&g.action!==32||g.button!==4&&(g.action===2||g.action===3)||(g.col++,g.row++,g.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,g,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(g))return!1;const S=this._encodings[this._activeEncoding](g);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=g,!0}explainEvents(g){return{down:!!(1&g),up:!!(2&g),drag:!!(4&g),move:!!(8&g),wheel:!!(16&g)}}_equalEvents(g,S,k){if(k){if(g.x!==S.x||g.y!==S.y)return!1}else if(g.col!==S.col||g.row!==S.row)return!1;return g.button===S.button&&g.action===S.action&&g.ctrl===S.ctrl&&g.alt===S.alt&&g.shift===S.shift}};s.CoreMouseService=f=c([m(0,h.IBufferService),m(1,h.ICoreService)],f)},6975:function(l,s,a){var c=this&&this.__decorate||function(f,g,S,k){var I,N=arguments.length,E=N<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,g,S,k);else for(var R=f.length-1;R>=0;R--)(I=f[R])&&(E=(N<3?I(E):N>3?I(g,S,E):I(g,S))||E);return N>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(f,g){return function(S,k){g(S,k,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const h=a(1439),b=a(8460),_=a(844),C=a(2585),y=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=s.CoreService=class extends _.Disposable{constructor(f,g,S){super(),this._bufferService=f,this._logService=g,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(y),this.decPrivateModes=(0,h.clone)(d)}reset(){this.modes=(0,h.clone)(y),this.decPrivateModes=(0,h.clone)(d)}triggerDataEvent(f,g=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;g&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),g&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((k=>k.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((g=>g.charCodeAt(0))))),this._onBinary.fire(f))}};s.CoreService=p=c([m(0,C.IBufferService),m(1,C.ILogService),m(2,C.IOptionsService)],p)},9074:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=a(8055),m=a(8460),h=a(844),b=a(6106);let _=0,C=0;class y extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((f=>f==null?void 0:f.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const g=new d(f);if(g){const S=g.marker.onDispose((()=>g.dispose()));g.onDispose((()=>{g&&(this._decorations.delete(g)&&this._onDecorationRemoved.fire(g),S.dispose())})),this._decorations.insert(g),this._onDecorationRegistered.fire(g)}return g}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,g,S){let k=0,I=0;for(const N of this._decorations.getKeyIterator(g))k=N.options.x??0,I=k+(N.options.width??1),f>=k&&f<I&&(!S||(N.options.layer??"bottom")===S)&&(yield N)}forEachDecorationAtCell(f,g,S,k){this._decorations.forEachByKey(g,(I=>{_=I.options.x??0,C=_+(I.options.width??1),f>=_&&f<C&&(!S||(I.options.layer??"bottom")===S)&&k(I)}))}}s.DecorationService=y;class d extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=a(2585),m=a(8343);class h{constructor(..._){this._entries=new Map;for(const[C,y]of _)this.set(C,y)}set(_,C){const y=this._entries.get(_);return this._entries.set(_,C),y}forEach(_){for(const[C,y]of this._entries.entries())_(C,y)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}s.ServiceCollection=h,s.InstantiationService=class{constructor(){this._services=new h,this._services.set(c.IInstantiationService,this)}setService(b,_){this._services.set(b,_)}getService(b){return this._services.get(b)}createInstance(b,..._){const C=(0,m.getServiceDependencies)(b).sort(((p,f)=>p.index-f.index)),y=[];for(const p of C){const f=this._services.get(p.id);if(!f)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${p.id}.`);y.push(f)}const d=C.length>0?C[0].index:_.length;if(_.length!==d)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${d+1} conflicts with ${_.length} static arguments`);return new b(..._,...y)}}},7866:function(l,s,a){var c=this&&this.__decorate||function(d,p,f,g){var S,k=arguments.length,I=k<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(d,p,f,g);else for(var N=d.length-1;N>=0;N--)(S=d[N])&&(I=(k<3?S(I):k>3?S(p,f,I):S(p,f))||I);return k>3&&I&&Object.defineProperty(p,f,I),I},m=this&&this.__param||function(d,p){return function(f,g){p(f,g,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const h=a(844),b=a(2585),_={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let C,y=s.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let p=0;p<d.length;p++)typeof d[p]=="function"&&(d[p]=d[p]())}_log(d,p,f){this._evalLazyOptionalParams(f),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...f)}trace(d,...p){var f;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,d,p)}debug(d,...p){var f;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,d,p)}info(d,...p){var f;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,d,p)}warn(d,...p){var f;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,d,p)}error(d,...p){var f;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,d,p)}};s.LogService=y=c([m(0,b.IOptionsService)],y),s.setTraceLogger=function(d){C=d},s.traceCall=function(d,p,f){if(typeof f.value!="function")throw new Error("not supported");const g=f.value;f.value=function(...S){if(C.logLevel!==b.LogLevelEnum.TRACE)return g.apply(this,S);C.trace(`GlyphRenderer#${g.name}(${S.map((I=>JSON.stringify(I))).join(", ")})`);const k=g.apply(this,S);return C.trace(`GlyphRenderer#${g.name} return`,k),k}}},7302:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=a(8460),m=a(844),h=a(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends m.Disposable{constructor(y){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...s.DEFAULT_OPTIONS};for(const p in y)if(p in d)try{const f=y[p];d[p]=this._sanitizeAndValidateOption(p,f)}catch(f){console.error(f)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(y,d){return this.onOptionChange((p=>{p===y&&d(this.rawOptions[y])}))}onMultipleOptionChange(y,d){return this.onOptionChange((p=>{y.indexOf(p)!==-1&&d()}))}_setupOptions(){const y=p=>{if(!(p in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},d=(p,f)=>{if(!(p in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);f=this._sanitizeAndValidateOption(p,f),this.rawOptions[p]!==f&&(this.rawOptions[p]=f,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const f={get:y.bind(this,p),set:d.bind(this,p)};Object.defineProperty(this.options,p,f)}}_sanitizeAndValidateOption(y,d){switch(y){case"cursorStyle":if(d||(d=s.DEFAULT_OPTIONS[y]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${y}`);break;case"wordSeparator":d||(d=s.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=b.includes(d)?d:s.DEFAULT_OPTIONS[y];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${y} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${y} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}s.OptionsService=_},2660:function(l,s,a){var c=this&&this.__decorate||function(_,C,y,d){var p,f=arguments.length,g=f<3?C:d===null?d=Object.getOwnPropertyDescriptor(C,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(_,C,y,d);else for(var S=_.length-1;S>=0;S--)(p=_[S])&&(g=(f<3?p(g):f>3?p(C,y,g):p(C,y))||g);return f>3&&g&&Object.defineProperty(C,y,g),g},m=this&&this.__param||function(_,C){return function(y,d){C(y,d,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const h=a(2585);let b=s.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const C=this._bufferService.buffer;if(_.id===void 0){const S=C.addMarker(C.ybase+C.y),k={data:_,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(k,S))),this._dataByLinkId.set(k.id,k),k.id}const y=_,d=this._getEntryIdKey(y),p=this._entriesWithId.get(d);if(p)return this.addLineToLink(p.id,C.ybase+C.y),p.id;const f=C.addMarker(C.ybase+C.y),g={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(g,f))),this._entriesWithId.set(g.key,g),this._dataByLinkId.set(g.id,g),g.id}addLineToLink(_,C){const y=this._dataByLinkId.get(_);if(y&&y.lines.every((d=>d.line!==C))){const d=this._bufferService.buffer.addMarker(C);y.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(y,d)))}}getLinkData(_){var C;return(C=this._dataByLinkId.get(_))==null?void 0:C.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,C){const y=_.lines.indexOf(C);y!==-1&&(_.lines.splice(y,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};s.OscLinkService=b=c([m(0,h.IBufferService)],b)},8343:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(m){return m[c]||[]},s.createDecorator=function(m){if(s.serviceRegistry.has(m))return s.serviceRegistry.get(m);const h=function(b,_,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,p){d[a]===d?d[c].push({id:y,index:p}):(d[c]=[{id:y,index:p}],d[a]=d)})(h,b,C)};return h.toString=()=>m,s.serviceRegistry.set(m,h),h}},2585:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(8343);var m;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(m||(s.LogLevelEnum=m={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(8460),m=a(225);class h{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,C,y=!1){return(16777215&_)<<3|(3&C)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new m.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let C=0,y=0;const d=_.length;for(let p=0;p<d;++p){let f=_.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=d)return C+this.wcwidth(f);const k=_.charCodeAt(p);56320<=k&&k<=57343?f=1024*(f-55296)+k-56320+65536:C+=this.wcwidth(k)}const g=this.charProperties(f,y);let S=h.extractWidth(g);h.extractShouldJoin(g)&&(S-=h.extractWidth(y)),C+=S,y=g}return C}charProperties(_,C){return this._activeProvider.charProperties(_,C)}}s.UnicodeService=h}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const s=i(9042),a=i(3236),c=i(844),m=i(5741),h=i(8285),b=i(7975),_=i(7090),C=["cols","rows"];class y extends c.Disposable{constructor(p){super(),this._core=this.register(new a.Terminal(p)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],g=(S,k)=>{this._checkReadonlyOptions(S),this._core.options[S]=k};for(const S in this._core.options){const k={get:f.bind(this,S),set:g.bind(this,S)};Object.defineProperty(this._publicOptions,S,k)}}_checkReadonlyOptions(p){if(C.includes(p))throw new Error(`Option "${p}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const f in p)this._publicOptions[f]=p[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,f=!0){this._core.input(p,f)}resize(p,f){this._verifyIntegers(p,f),this._core.resize(p,f)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,f,g){this._verifyIntegers(p,f,g),this._core.select(p,f,g)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,f){this._verifyIntegers(p,f),this._core.selectLines(p,f)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,f){this._core.write(p,f)}writeln(p,f){this._core.write(p),this._core.write(`\r
50
- `,f)}paste(p){this._core.paste(p)}refresh(p,f){this._verifyIntegers(p,f),this._core.refresh(p,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return s}_verifyIntegers(...p){for(const f of p)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const f of p)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}l.Terminal=y})(),o})()))})(wh)),wh.exports}var A2=N2(),rc={exports:{}},R2=rc.exports,Ih;function x2(){return Ih||(Ih=1,(function(e,t){(function(r,n){e.exports=n()})(R2,(()=>(()=>{var r={930:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(485);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(m,h,b){this._css.set(m,h,b)}getCss(m,h){return this._css.get(m,h)}setColor(m,h,b){this._color.set(m,h,b)}getColor(m,h){return this._color.get(m,h)}clear(){this._color.clear(),this._css.clear()}}},997:function(l,s,a){var c=this&&this.__decorate||function(N,E,R,O){var V,M=arguments.length,D=M<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(N,E,R,O);else for(var ee=N.length-1;ee>=0;ee--)(V=N[ee])&&(D=(M<3?V(D):M>3?V(E,R,D):V(E,R))||D);return M>3&&D&&Object.defineProperty(E,R,D),D},m=this&&this.__param||function(N,E){return function(R,O){E(R,O,N)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const h=a(930),b=a(160),_=a(345),C=a(859),y=a(97),d=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),f=b.css.toColor("#ffffff"),g=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const N=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let R=0;R<216;R++){const O=E[R/36%6|0],V=E[R/6%6|0],M=E[R%6];N.push({css:b.channels.toCss(O,V,M),rgba:b.channels.toRgba(O,V,M)})}for(let R=0;R<24;R++){const O=8+10*R;N.push({css:b.channels.toCss(O,O,O),rgba:b.channels.toRgba(O,O,O)})}return N})());let k=s.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(N){super(),this._optionsService=N,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:f,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(p,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(N={}){const E=this._colors;if(E.foreground=I(N.foreground,d),E.background=I(N.background,p),E.cursor=I(N.cursor,f),E.cursorAccent=I(N.cursorAccent,g),E.selectionBackgroundTransparent=I(N.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=I(N.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=N.selectionForeground?I(N.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=s.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=I(N.black,s.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=I(N.red,s.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=I(N.green,s.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=I(N.yellow,s.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=I(N.blue,s.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=I(N.magenta,s.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=I(N.cyan,s.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=I(N.white,s.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=I(N.brightBlack,s.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=I(N.brightRed,s.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=I(N.brightGreen,s.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=I(N.brightYellow,s.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=I(N.brightBlue,s.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=I(N.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=I(N.brightCyan,s.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=I(N.brightWhite,s.DEFAULT_ANSI_COLORS[15]),N.extendedAnsi){const R=Math.min(E.ansi.length-16,N.extendedAnsi.length);for(let O=0;O<R;O++)E.ansi[O+16]=I(N.extendedAnsi[O],s.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(N){this._restoreColor(N),this._onChangeColors.fire(this.colors)}_restoreColor(N){if(N!==void 0)switch(N){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[N]=this._restoreColors.ansi[N]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(N){N(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function I(N,E){if(N!==void 0)try{return b.css.toColor(N)}catch{}return E}s.ThemeService=k=c([m(0,y.IOptionsService)],k)},160:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,m=0,h=0;var b,_,C,y,d;function p(g){const S=g.toString(16);return S.length<2?"0"+S:S}function f(g,S){return g<S?(S+.05)/(g+.05):(g+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(g){g.toCss=function(S,k,I,N){return N!==void 0?`#${p(S)}${p(k)}${p(I)}${p(N)}`:`#${p(S)}${p(k)}${p(I)}`},g.toRgba=function(S,k,I,N=255){return(S<<24|k<<16|I<<8|N)>>>0},g.toColor=function(S,k,I,N){return{css:g.toCss(S,k,I,N),rgba:g.toRgba(S,k,I,N)}}})(b||(s.channels=b={})),(function(g){function S(k,I){return h=Math.round(255*I),[a,c,m]=d.toChannels(k.rgba),{css:b.toCss(a,c,m,h),rgba:b.toRgba(a,c,m,h)}}g.blend=function(k,I){if(h=(255&I.rgba)/255,h===1)return{css:I.css,rgba:I.rgba};const N=I.rgba>>24&255,E=I.rgba>>16&255,R=I.rgba>>8&255,O=k.rgba>>24&255,V=k.rgba>>16&255,M=k.rgba>>8&255;return a=O+Math.round((N-O)*h),c=V+Math.round((E-V)*h),m=M+Math.round((R-M)*h),{css:b.toCss(a,c,m),rgba:b.toRgba(a,c,m)}},g.isOpaque=function(k){return(255&k.rgba)==255},g.ensureContrastRatio=function(k,I,N){const E=d.ensureContrastRatio(k.rgba,I.rgba,N);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},g.opaque=function(k){const I=(255|k.rgba)>>>0;return[a,c,m]=d.toChannels(I),{css:b.toCss(a,c,m),rgba:I}},g.opacity=S,g.multiplyOpacity=function(k,I){return h=255&k.rgba,S(k,h*I/255)},g.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}})(_||(s.color=_={})),(function(g){let S,k;try{const I=document.createElement("canvas");I.width=1,I.height=1;const N=I.getContext("2d",{willReadFrequently:!0});N&&(S=N,S.globalCompositeOperation="copy",k=S.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(I){if(I.match(/#[\da-f]{3,8}/i))switch(I.length){case 4:return a=parseInt(I.slice(1,2).repeat(2),16),c=parseInt(I.slice(2,3).repeat(2),16),m=parseInt(I.slice(3,4).repeat(2),16),b.toColor(a,c,m);case 5:return a=parseInt(I.slice(1,2).repeat(2),16),c=parseInt(I.slice(2,3).repeat(2),16),m=parseInt(I.slice(3,4).repeat(2),16),h=parseInt(I.slice(4,5).repeat(2),16),b.toColor(a,c,m,h);case 7:return{css:I,rgba:(parseInt(I.slice(1),16)<<8|255)>>>0};case 9:return{css:I,rgba:parseInt(I.slice(1),16)>>>0}}const N=I.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(N)return a=parseInt(N[1]),c=parseInt(N[2]),m=parseInt(N[3]),h=Math.round(255*(N[5]===void 0?1:parseFloat(N[5]))),b.toColor(a,c,m,h);if(!S||!k)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=k,S.fillStyle=I,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,m,h]=S.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(a,c,m,h),css:I}}})(C||(s.css=C={})),(function(g){function S(k,I,N){const E=k/255,R=I/255,O=N/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}g.relativeLuminance=function(k){return S(k>>16&255,k>>8&255,255&k)},g.relativeLuminance2=S})(y||(s.rgb=y={})),(function(g){function S(I,N,E){const R=I>>24&255,O=I>>16&255,V=I>>8&255;let M=N>>24&255,D=N>>16&255,ee=N>>8&255,ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));for(;ae<E&&(M>0||D>0||ee>0);)M-=Math.max(0,Math.ceil(.1*M)),D-=Math.max(0,Math.ceil(.1*D)),ee-=Math.max(0,Math.ceil(.1*ee)),ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));return(M<<24|D<<16|ee<<8|255)>>>0}function k(I,N,E){const R=I>>24&255,O=I>>16&255,V=I>>8&255;let M=N>>24&255,D=N>>16&255,ee=N>>8&255,ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));for(;ae<E&&(M<255||D<255||ee<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),D=Math.min(255,D+Math.ceil(.1*(255-D))),ee=Math.min(255,ee+Math.ceil(.1*(255-ee))),ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));return(M<<24|D<<16|ee<<8|255)>>>0}g.blend=function(I,N){if(h=(255&N)/255,h===1)return N;const E=N>>24&255,R=N>>16&255,O=N>>8&255,V=I>>24&255,M=I>>16&255,D=I>>8&255;return a=V+Math.round((E-V)*h),c=M+Math.round((R-M)*h),m=D+Math.round((O-D)*h),b.toRgba(a,c,m)},g.ensureContrastRatio=function(I,N,E){const R=y.relativeLuminance(I>>8),O=y.relativeLuminance(N>>8);if(f(R,O)<E){if(O<R){const D=S(I,N,E),ee=f(R,y.relativeLuminance(D>>8));if(ee<E){const ae=k(I,N,E);return ee>f(R,y.relativeLuminance(ae>>8))?D:ae}return D}const V=k(I,N,E),M=f(R,y.relativeLuminance(V>>8));if(M<E){const D=S(I,N,E);return M>f(R,y.relativeLuminance(D>>8))?V:D}return V}},g.reduceLuminance=S,g.increaseLuminance=k,g.toChannels=function(I){return[I>>24&255,I>>16&255,I>>8&255,255&I]}})(d||(s.rgba=d={})),s.toPaddedHex=p,s.contrastRatio=f},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},859:(l,s)=>{function a(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},485:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(m,h,b){this._data[m]||(this._data[m]={}),this._data[m][h]=b}get(m,h){return this._data[m]?this._data[m][h]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,m,h,b,_){this._data.get(c,m)||this._data.set(c,m,new a),this._data.get(c,m).set(h,b,_)}get(c,m,h,b){var _;return(_=this._data.get(c,m))==null?void 0:_.get(h,b)}clear(){this._data.clear()}}},726:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(m){return m[c]||[]},s.createDecorator=function(m){if(s.serviceRegistry.has(m))return s.serviceRegistry.get(m);const h=function(b,_,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,p){d[a]===d?d[c].push({id:y,index:p}):(d[c]=[{id:y,index:p}],d[a]=d)})(h,b,C)};return h.toString=()=>m,s.serviceRegistry.set(m,h),h}},97:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(726);var m;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(m||(s.LogLevelEnum=m={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.HTMLSerializeHandler=l.SerializeAddon=void 0;const s=i(997);function a(y,d,p){return Math.max(d,Math.min(y,p))}class c{constructor(d){this._buffer=d}serialize(d,p){const f=this._buffer.getNullCell(),g=this._buffer.getNullCell();let S=f;const k=d.start.y,I=d.end.y,N=d.start.x,E=d.end.x;this._beforeSerialize(I-k,k,I);for(let R=k;R<=I;R++){const O=this._buffer.getLine(R);if(O){const V=R===d.start.y?N:0,M=R===d.end.y?E:O.length;for(let D=V;D<M;D++){const ee=O.getCell(D,S===f?g:f);ee?(this._nextCell(ee,S,R,D),S=ee):console.warn(`Can't get cell at row=${R}, col=${D}`)}}this._rowEnd(R,R===I)}return this._afterSerialize(),this._serializeString(p)}_nextCell(d,p,f,g){}_rowEnd(d,p){}_beforeSerialize(d,p,f){}_afterSerialize(){}_serializeString(d){return""}}function m(y,d){return y.getFgColorMode()===d.getFgColorMode()&&y.getFgColor()===d.getFgColor()}function h(y,d){return y.getBgColorMode()===d.getBgColorMode()&&y.getBgColor()===d.getBgColor()}function b(y,d){return y.isInverse()===d.isInverse()&&y.isBold()===d.isBold()&&y.isUnderline()===d.isUnderline()&&y.isOverline()===d.isOverline()&&y.isBlink()===d.isBlink()&&y.isInvisible()===d.isInvisible()&&y.isItalic()===d.isItalic()&&y.isDim()===d.isDim()&&y.isStrikethrough()===d.isStrikethrough()}class _ extends c{constructor(d,p){super(d),this._terminal=p,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(d,p,f){this._allRows=new Array(d),this._lastContentCursorRow=p,this._lastCursorRow=p,this._firstRow=p}_rowEnd(d,p){var f;this._nullCellCount>0&&!h(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let g="";if(!p){d-this._firstRow>=this._terminal.rows&&((f=this._buffer.getLine(this._cursorStyleRow))==null||f.getCell(this._cursorStyleCol,this._backgroundCell));const S=this._buffer.getLine(d),k=this._buffer.getLine(d+1);if(k.isWrapped){g="";const I=S.getCell(S.length-1,this._thisRowLastChar),N=S.getCell(S.length-2,this._thisRowLastSecondChar),E=k.getCell(0,this._nextRowFirstChar),R=E.getWidth()>1;let O=!1;(E.getChars()&&R?this._nullCellCount<=1:this._nullCellCount<=0)&&((I.getChars()||I.getWidth()===0)&&h(I,E)&&(O=!0),R&&(N.getChars()||N.getWidth()===0)&&h(I,E)&&h(N,E)&&(O=!0)),O||(g="-".repeat(this._nullCellCount+1),g+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(g+="\x1B[A",g+=`\x1B[${S.length-this._nullCellCount}C`,g+=`\x1B[${this._nullCellCount}X`,g+=`\x1B[${S.length-this._nullCellCount}D`,g+="\x1B[B"),this._lastContentCursorRow=d+1,this._lastContentCursorCol=0,this._lastCursorRow=d+1,this._lastCursorCol=0)}else g=`\r
51
- `,this._lastCursorRow=d+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=g,this._currentRow="",this._nullCellCount=0}_diffStyle(d,p){const f=[],g=!m(d,p),S=!h(d,p),k=!b(d,p);if(g||S||k)if(d.isAttributeDefault())p.isAttributeDefault()||f.push(0);else{if(g){const I=d.getFgColor();d.isFgRGB()?f.push(38,2,I>>>16&255,I>>>8&255,255&I):d.isFgPalette()?I>=16?f.push(38,5,I):f.push(8&I?90+(7&I):30+(7&I)):f.push(39)}if(S){const I=d.getBgColor();d.isBgRGB()?f.push(48,2,I>>>16&255,I>>>8&255,255&I):d.isBgPalette()?I>=16?f.push(48,5,I):f.push(8&I?100+(7&I):40+(7&I)):f.push(49)}k&&(d.isInverse()!==p.isInverse()&&f.push(d.isInverse()?7:27),d.isBold()!==p.isBold()&&f.push(d.isBold()?1:22),d.isUnderline()!==p.isUnderline()&&f.push(d.isUnderline()?4:24),d.isOverline()!==p.isOverline()&&f.push(d.isOverline()?53:55),d.isBlink()!==p.isBlink()&&f.push(d.isBlink()?5:25),d.isInvisible()!==p.isInvisible()&&f.push(d.isInvisible()?8:28),d.isItalic()!==p.isItalic()&&f.push(d.isItalic()?3:23),d.isDim()!==p.isDim()&&f.push(d.isDim()?2:22),d.isStrikethrough()!==p.isStrikethrough()&&f.push(d.isStrikethrough()?9:29))}return f}_nextCell(d,p,f,g){if(d.getWidth()===0)return;const S=d.getChars()==="",k=this._diffStyle(d,this._cursorStyle);if(S?!h(this._cursorStyle,d):k.length>0){this._nullCellCount>0&&(h(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=f,this._lastContentCursorCol=this._lastCursorCol=g,this._currentRow+=`\x1B[${k.join(";")}m`;const I=this._buffer.getLine(f);I!==void 0&&(I.getCell(g,this._cursorStyle),this._cursorStyleRow=f,this._cursorStyleCol=g)}S?this._nullCellCount+=d.getWidth():(this._nullCellCount>0&&(h(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=d.getChars(),this._lastContentCursorRow=this._lastCursorRow=f,this._lastContentCursorCol=this._lastCursorCol=g+d.getWidth())}_serializeString(d){let p=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(p=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let f="";for(let I=0;I<p;I++)f+=this._allRows[I],I+1<p&&(f+=this._allRowSeparators[I]);if(!d){const I=this._buffer.baseY+this._buffer.cursorY,N=this._buffer.cursorX,E=R=>{R>0?f+=`\x1B[${R}C`:R<0&&(f+=`\x1B[${-R}D`)};(I!==this._lastCursorRow||N!==this._lastCursorCol)&&((g=I-this._lastCursorRow)>0?f+=`\x1B[${g}B`:g<0&&(f+=`\x1B[${-g}A`),E(N-this._lastCursorCol))}var g;const S=this._terminal._core._inputHandler._curAttrData,k=this._diffStyle(S,this._cursorStyle);return k.length>0&&(f+=`\x1B[${k.join(";")}m`),f}}l.SerializeAddon=class{activate(y){this._terminal=y}_serializeBufferByScrollback(y,d,p){const f=d.length,g=p===void 0?f:a(p+y.rows,0,f);return this._serializeBufferByRange(y,d,{start:f-g,end:f-1},!1)}_serializeBufferByRange(y,d,p,f){return new _(d,y).serialize({start:{x:0,y:typeof p.start=="number"?p.start:p.start.line},end:{x:y.cols,y:typeof p.end=="number"?p.end:p.end.line}},f)}_serializeBufferAsHTML(y,d){var p;const f=y.buffer.active,g=new C(f,y,d);if(!d.onlySelection){const k=f.length,I=d.scrollback,N=I===void 0?k:a(I+y.rows,0,k);return g.serialize({start:{x:0,y:k-N},end:{x:y.cols,y:k-1}})}const S=(p=this._terminal)==null?void 0:p.getSelectionPosition();return S!==void 0?g.serialize({start:{x:S.start.x,y:S.start.y},end:{x:S.end.x,y:S.end.y}}):""}_serializeModes(y){let d="";const p=y.modes;if(p.applicationCursorKeysMode&&(d+="\x1B[?1h"),p.applicationKeypadMode&&(d+="\x1B[?66h"),p.bracketedPasteMode&&(d+="\x1B[?2004h"),p.insertMode&&(d+="\x1B[4h"),p.originMode&&(d+="\x1B[?6h"),p.reverseWraparoundMode&&(d+="\x1B[?45h"),p.sendFocusMode&&(d+="\x1B[?1004h"),p.wraparoundMode===!1&&(d+="\x1B[?7l"),p.mouseTrackingMode!=="none")switch(p.mouseTrackingMode){case"x10":d+="\x1B[?9h";break;case"vt200":d+="\x1B[?1000h";break;case"drag":d+="\x1B[?1002h";break;case"any":d+="\x1B[?1003h"}return d}serialize(y){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let d=y!=null&&y.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,y.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,y==null?void 0:y.scrollback);return y!=null&&y.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(d+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),y!=null&&y.excludeModes||(d+=this._serializeModes(this._terminal)),d}serializeAsHTML(y){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,y||{})}dispose(){}};class C extends c{constructor(d,p,f){super(d),this._terminal=p,this._options=f,this._currentRow="",this._htmlContent="",p._core._themeService?this._ansiColors=p._core._themeService.colors.ansi:this._ansiColors=s.DEFAULT_ANSI_COLORS}_padStart(d,p,f){return p>>=0,f=f??" ",d.length>p?d:((p-=d.length)>f.length&&(f+=f.repeat(p/f.length)),f.slice(0,p)+d)}_beforeSerialize(d,p,f){var g,S;this._htmlContent+="<html><body><!--StartFragment--><pre>";let k="#000000",I="#ffffff";this._options.includeGlobalBackground&&(k=((g=this._terminal.options.theme)==null?void 0:g.foreground)??"#ffffff",I=((S=this._terminal.options.theme)==null?void 0:S.background)??"#000000");const N=[];N.push("color: "+k+";"),N.push("background-color: "+I+";"),N.push("font-family: "+this._terminal.options.fontFamily+";"),N.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+N.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(d,p){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(d,p){const f=p?d.getFgColor():d.getBgColor();return(p?d.isFgRGB():d.isBgRGB())?"#"+[f>>16&255,f>>8&255,255&f].map((g=>this._padStart(g.toString(16),2,"0"))).join(""):(p?d.isFgPalette():d.isBgPalette())?this._ansiColors[f].css:void 0}_diffStyle(d,p){const f=[],g=!m(d,p),S=!h(d,p),k=!b(d,p);if(g||S||k){const I=this._getHexColor(d,!0);I&&f.push("color: "+I+";");const N=this._getHexColor(d,!1);return N&&f.push("background-color: "+N+";"),d.isInverse()&&f.push("color: #000000; background-color: #BFBFBF;"),d.isBold()&&f.push("font-weight: bold;"),d.isUnderline()&&d.isOverline()?f.push("text-decoration: overline underline;"):d.isUnderline()?f.push("text-decoration: underline;"):d.isOverline()&&f.push("text-decoration: overline;"),d.isBlink()&&f.push("text-decoration: blink;"),d.isInvisible()&&f.push("visibility: hidden;"),d.isItalic()&&f.push("font-style: italic;"),d.isDim()&&f.push("opacity: 0.5;"),d.isStrikethrough()&&f.push("text-decoration: line-through;"),f}}_nextCell(d,p,f,g){if(d.getWidth()===0)return;const S=d.getChars()==="",k=this._diffStyle(d,p);k&&(this._currentRow+=k.length===0?"</span><span>":"</span><span style='"+k.join(" ")+"'>"),this._currentRow+=S?" ":d.getChars()}_serializeString(){return this._htmlContent}}l.HTMLSerializeHandler=C})(),o})()))})(rc)),rc.exports}var B2=x2(),nc={exports:{}},O2=nc.exports,kh;function L2(){return kh||(kh=1,(function(e,t){(function(r,n){e.exports=n()})(O2,(()=>(()=>{var r={433:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const c=a(938),m=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],h=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],b=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let C;function y(d,p){let f,g=0,S=p.length-1;if(d<p[0][0]||d>p[S][1])return!1;for(;S>=g;)if(f=g+S>>1,d>p[f][1])g=f+1;else{if(!(d<p[f][0]))return!0;S=f-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160);for(let d=0;d<m.length;++d)C.fill(0,m[d][0],m[d][1]+1);for(let d=0;d<b.length;++d)C.fill(2,b[d][0],b[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?C[d]:y(d,h)?0:y(d,_)?2:1}charProperties(d,p){let f=this.wcwidth(d),g=f===0&&p!==0;if(g){const S=c.UnicodeService.extractWidth(p);S===0?g=!1:S>f&&(f=S)}return c.UnicodeService.createPropertyValue(0,f,g)}}},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},490:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(938),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;s.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let _=0;_<m.length;++_)b.fill(0,m[_][0],m[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?b[_]:(function(C,y){let d,p=0,f=y.length-1;if(C<y[0][0]||C>y[f][1])return!1;for(;f>=p;)if(d=p+f>>1,C>y[d][1])p=d+1;else{if(!(C<y[d][0]))return!0;f=d-1}return!1})(_,h)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,C){let y=this.wcwidth(_),d=y===0&&C!==0;if(d){const p=c.UnicodeService.extractWidth(C);p===0?d=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,d)}}},938:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(345),m=a(490);class h{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,C,y=!1){return(16777215&_)<<3|(3&C)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new m.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let C=0,y=0;const d=_.length;for(let p=0;p<d;++p){let f=_.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=d)return C+this.wcwidth(f);const k=_.charCodeAt(p);56320<=k&&k<=57343?f=1024*(f-55296)+k-56320+65536:C+=this.wcwidth(k)}const g=this.charProperties(f,y);let S=h.extractWidth(g);h.extractShouldJoin(g)&&(S-=h.extractWidth(y)),C+=S,y=g}return C}charProperties(_,C){return this._activeProvider.charProperties(_,C)}}s.UnicodeService=h}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l](a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.Unicode11Addon=void 0;const s=i(433);l.Unicode11Addon=class{activate(a){a.unicode.register(new s.UnicodeV11)}dispose(){}}})(),o})()))})(nc)),nc.exports}var D2=L2(),Th={exports:{}},Nh;function F2(){return Nh||(Nh=1,(function(e,t){(function(r,n){e.exports=n()})(self,(()=>(()=>{var r={6:(l,s)=>{function a(m){try{const h=new URL(m),b=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return m.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(m,h,b,_={}){this._terminal=m,this._regex=h,this._handler=b,this._options=_}provideLinks(m,h){const b=c.computeLink(m,this._regex,this._terminal,this._handler);h(this._addCallbacks(b))}_addCallbacks(m){return m.map((h=>(h.leave=this._options.leave,h.hover=(b,_)=>{if(this._options.hover){const{range:C}=h;this._options.hover(b,_,C)}},h)))}};class c{static computeLink(h,b,_,C){const y=new RegExp(b.source,(b.flags||"")+"g"),[d,p]=c._getWindowedLineStrings(h-1,_),f=d.join("");let g;const S=[];for(;g=y.exec(f);){const k=g[0];if(!a(k))continue;const[I,N]=c._mapStrIdx(_,p,0,g.index),[E,R]=c._mapStrIdx(_,I,N,k.length);if(I===-1||N===-1||E===-1||R===-1)continue;const O={start:{x:N+1,y:I+1},end:{x:R,y:E+1}};S.push({range:O,text:k,activate:C})}return S}static _getWindowedLineStrings(h,b){let _,C=h,y=h,d=0,p="";const f=[];if(_=b.buffer.active.getLine(h)){const g=_.translateToString(!0);if(_.isWrapped&&g[0]!==" "){for(d=0;(_=b.buffer.active.getLine(--C))&&d<2048&&(p=_.translateToString(!0),d+=p.length,f.push(p),_.isWrapped&&p.indexOf(" ")===-1););f.reverse()}for(f.push(g),d=0;(_=b.buffer.active.getLine(++y))&&_.isWrapped&&d<2048&&(p=_.translateToString(!0),d+=p.length,f.push(p),p.indexOf(" ")===-1););}return[f,C]}static _mapStrIdx(h,b,_,C){const y=h.buffer.active,d=y.getNullCell();let p=_;for(;C;){const f=y.getLine(b);if(!f)return[-1,-1];for(let g=p;g<f.length;++g){f.getCell(g,d);const S=d.getChars();if(d.getWidth()&&(C-=S.length||1,g===f.length-1&&S==="")){const k=y.getLine(b+1);k&&k.isWrapped&&(k.getCell(0,d),d.getWidth()===2&&(C+=1))}if(C<0)return[b,g]}b++,p=0}return[b,p]}}s.LinkComputer=c}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l](a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const s=i(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(m,h){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(m=c,h={}){this._handler=m,this._options=h}activate(m){this._terminal=m;const h=this._options,b=h.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,b,this._handler,h))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),o})()))})(Th)),Th.exports}var V2=F2();function Rt(e){return typeof e=="function"}function Dm(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Ia=Dm(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
52
- `+t.map(function(r,n){return n+1+") "+r.toString()}).join(`
53
- `):"",this.name="UnsubscriptionError",this.errors=t}});function ho(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Qi=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var s=Un(l),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(y){t={error:y}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else l.remove(this);var m=this.initialTeardown;if(Rt(m))try{m()}catch(y){o=y instanceof Ia?y.errors:[y]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var b=Un(h),_=b.next();!_.done;_=b.next()){var C=_.value;try{Ah(C)}catch(y){o=o??[],y instanceof Ia?o=Li(Li([],Oi(o)),Oi(y.errors)):o.push(y)}}}catch(y){n={error:y}}finally{try{_&&!_.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}if(o)throw new Ia(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Ah(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&ho(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ho(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Fm=Qi.EMPTY;function Vm(e){return e instanceof Qi||e&&"closed"in e&&Rt(e.remove)&&Rt(e.add)&&Rt(e.unsubscribe)}function Ah(e){Rt(e)?e():e.unsubscribe()}var U2={Promise:void 0},M2={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Li([e,t],Oi(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Um(e){M2.setTimeout(function(){throw e})}function Rh(){}function Ks(e){e()}var gl=(function(e){Ur(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Vm(r)&&r.add(n)):n.destination=j2,n}return t.create=function(r,n,i){return new Mi(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Qi),P2=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Rs(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Rs(n)}else Rs(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Rs(r)}},e})(),Mi=(function(e){Ur(t,e);function t(r,n,i){var o=e.call(this)||this,l;return Rt(r)||!r?l={next:r??void 0,error:n??void 0,complete:i??void 0}:l=r,o.destination=new P2(l),o}return t})(gl);function Rs(e){Um(e)}function W2(e){throw e}var j2={closed:!0,next:Rh,error:W2,complete:Rh},vl=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Mm(e){return e}function Z2(e){return e.length===0?Mm:e.length===1?e[0]:function(t){return e.reduce(function(r,n){return n(r)},t)}}var _r=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=K2(t)?t:new Mi(t,r,n);return Ks(function(){var l=i,s=l.operator,a=l.source;o.add(s?s.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=xh(r),new r(function(i,o){var l=new Mi({next:function(s){try{t(s)}catch(a){o(a),l.unsubscribe()}},error:o,complete:i});n.subscribe(l)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[vl]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Z2(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=xh(t),new t(function(n,i){var o;r.subscribe(function(l){return o=l},function(l){return i(l)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function xh(e){var t;return(t=e??U2.Promise)!==null&&t!==void 0?t:Promise}function G2(e){return e&&Rt(e.next)&&Rt(e.error)&&Rt(e.complete)}function K2(e){return e&&e instanceof gl||G2(e)&&Vm(e)}function H2(e){return Rt(e==null?void 0:e.lift)}function qi(e){return function(t){if(H2(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ko(e,t,r,n,i){return new X2(e,t,r,n,i)}var X2=(function(e){Ur(t,e);function t(r,n,i,o,l,s){var a=e.call(this,r)||this;return a.onFinalize=l,a.shouldUnsubscribe=s,a._next=n?function(c){try{n(c)}catch(m){r.error(m)}}:e.prototype._next,a._error=o?function(c){try{o(c)}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(gl),Y2=Dm(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Pm=(function(e){Ur(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new Bh(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Y2},t.prototype.next=function(r){var n=this;Ks(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=Un(n.currentObservers),s=l.next();!s.done;s=l.next()){var a=s.value;a.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;Ks(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;Ks(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,l=i.isStopped,s=i.observers;return o||l?Fm:(this.currentObservers=null,s.push(r),new Qi(function(){n.currentObservers=null,ho(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,l=n.isStopped;i?r.error(o):l&&r.complete()},t.prototype.asObservable=function(){var r=new _r;return r.source=this,r},t.create=function(r,n){return new Bh(r,n)},t})(_r),Bh=(function(e){Ur(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:Fm},t})(Pm),$2={now:function(){return Date.now()}},J2=(function(e){Ur(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(Qi),Oh={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,Li([e,t],Oi(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},z2=(function(e){Ur(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,l=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(l,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(l,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),Oh.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Oh.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(l){i=!0,o=l||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ho(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(J2),Lh=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=$2.now,e})(),Q2=(function(e){Ur(t,e);function t(r,n){n===void 0&&(n=Lh.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(Lh),q2=new Q2(z2),eS=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function tS(e){return Rt(e==null?void 0:e.then)}function rS(e){return Rt(e[vl])}function nS(e){return Symbol.asyncIterator&&Rt(e==null?void 0:e[Symbol.asyncIterator])}function iS(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function sS(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var oS=sS();function aS(e){return Rt(e==null?void 0:e[oS])}function cS(e){return s2(this,arguments,function(){var t,r,n,i;return Nm(this,function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,In(t.read())];case 3:return r=o.sent(),n=r.value,i=r.done,i?[4,In(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,In(n)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function lS(e){return Rt(e==null?void 0:e.getReader)}function Wm(e){if(e instanceof _r)return e;if(e!=null){if(rS(e))return uS(e);if(eS(e))return dS(e);if(tS(e))return hS(e);if(nS(e))return jm(e);if(aS(e))return fS(e);if(lS(e))return pS(e)}throw iS(e)}function uS(e){return new _r(function(t){var r=e[vl]();if(Rt(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function dS(e){return new _r(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function hS(e){return new _r(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Um)})}function fS(e){return new _r(function(t){var r,n;try{for(var i=Un(e),o=i.next();!o.done;o=i.next()){var l=o.value;if(t.next(l),t.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()})}function jm(e){return new _r(function(t){mS(e,t).catch(function(r){return t.error(r)})})}function pS(e){return jm(cS(e))}function mS(e,t){var r,n,i,o;return i2(this,void 0,void 0,function(){var l,s;return Nm(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),r=o2(e),a.label=1;case 1:return[4,r.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(l=n.value,t.next(l),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=a.sent(),i={error:s},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function gS(e,t){return qi(function(r,n){var i=0;r.subscribe(ko(n,function(o){n.next(e.call(t,o,i++))}))})}function Zm(e,t){return qi(function(r,n){var i=0;r.subscribe(ko(n,function(o){return e.call(t,o,i++)&&n.next(o)}))})}function Gm(e,t){return t===void 0&&(t=q2),qi(function(r,n){var i=null,o=null,l=null,s=function(){if(i){i.unsubscribe(),i=null;var c=o;o=null,n.next(c)}};function a(){var c=l+e,m=t.now();if(m<c){i=this.schedule(void 0,c-m),n.add(i);return}s()}r.subscribe(ko(n,function(c){o=c,l=t.now(),i||(i=t.schedule(a,e),n.add(i))},function(){s(),n.complete()},void 0,function(){o=i=null}))})}function Km(e,t){return t===void 0&&(t=Mm),e=e??vS,qi(function(r,n){var i,o=!0;r.subscribe(ko(n,function(l){var s=t(l);(o||!e(i,s))&&(o=!1,i=s,n.next(l))}))})}function vS(e,t){return e===t}function bS(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Pm}:t,n=e.resetOnError,i=n===void 0?!0:n,o=e.resetOnComplete,l=o===void 0?!0:o,s=e.resetOnRefCountZero,a=s===void 0?!0:s;return function(c){var m,h,b,_=0,C=!1,y=!1,d=function(){h==null||h.unsubscribe(),h=void 0},p=function(){d(),m=b=void 0,C=y=!1},f=function(){var g=m;p(),g==null||g.unsubscribe()};return qi(function(g,S){_++,!y&&!C&&d();var k=b=b??r();S.add(function(){_--,_===0&&!y&&!C&&(h=ka(f,a))}),k.subscribe(S),!m&&_>0&&(m=new Mi({next:function(I){return k.next(I)},error:function(I){y=!0,d(),h=ka(p,i,I),k.error(I)},complete:function(){C=!0,d(),h=ka(p,l),k.complete()}}),Wm(g).subscribe(m))})(c)}}function ka(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t===!0){e();return}if(t!==!1){var i=new Mi({next:function(){i.unsubscribe(),e()}});return Wm(t.apply(void 0,Li([],Oi(r)))).subscribe(i)}}/**
54
- * Copyright (c) 2017 The xterm.js authors. All rights reserved.
55
- * @license MIT
56
- */const _S=2,yS=1;class SS{constructor(){}activate(t){this._terminal=t}dispose(){}fit(t){const r=this.proposeDimensions();if(t!==void 0&&r&&(r.rows=t),!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;const n=this._terminal._core;return(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(n._renderService.clear(),this._terminal.resize(r.cols,r.rows)),r}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const t=this.getCore(),r=t._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const n=this._terminal.options.scrollback===0?0:t.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(i.getPropertyValue("height")),l=Math.max(0,parseInt(i.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),a={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},c=a.top+a.bottom,m=a.right+a.left,h=o-c,b=l-m-n,{width:_,height:C}=this.getCellSize();return{cols:Math.max(_S,Math.floor(b/_)),rows:Math.max(yS,Math.floor(h/C))}}getCellSize(){const{value:t}=this.getCore()._renderService._renderer;return{width:t._charSizeService.width+Math.round(t._optionsService.rawOptions.letterSpacing),height:Math.floor(t._charSizeService.height*t._optionsService.rawOptions.lineHeight)}}getCore(){return this._terminal._core}}function ES({}){}function wS(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function CS(e){const t=new Date().getTime()-e.getTime(),r=Math.floor(t/1e3)*-1,n=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(r)<60?n.format(Math.round(r),"second"):Math.abs(r)<3600?n.format(Math.round(r/60),"minute"):Math.abs(r)<86400?n.format(Math.round(r/3600),"hour"):n.format(Math.round(r/86400),"day")}var IS=(e,t,r,n)=>{for(var i=t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=l(i)||i);return i};let ic=class extends At{onClose(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("closed");this.dispatchEvent(t)}render(){return xe`
38
+ */function T2(e){return Oe({...e,state:!0,attribute:!1})}var N2=(e,t,r,n)=>{for(var i=t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=l(i)||i);return i};let rc=class extends At{onClose(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("closed");this.dispatchEvent(t)}render(){return xe`
57
39
  <div class="close-button tooltip">
58
40
  <span class="tooltiptext">Close</span>
59
41
  <vscode-button
@@ -65,7 +47,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
65
47
  <span class="icon icon-close"></span>
66
48
  </vscode-button>
67
49
  </div>
68
- `}};ic.styles=tr`
50
+ `}};rc.styles=tr`
69
51
  :host {
70
52
  --button-icon-hover-background: var(--vscode-toolbar-hoverBackground);
71
53
  --tooltip-background: #343434;
@@ -137,7 +119,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
137
119
  .tooltip:not(:hover) .tooltiptext {
138
120
  transition-delay: 0s;
139
121
  }
140
- `;ic=IS([Xt("close-cell-button")],ic);const Hm=xe`
122
+ `;rc=N2([Xt("close-cell-button")],rc);const Lm=xe`
141
123
  <svg
142
124
  class="icon"
143
125
  width="16"
@@ -153,11 +135,11 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
153
135
  />
154
136
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3 1L2 2v10l1 1V2h6.414l-1-1H3z" />
155
137
  </svg>
156
- `;var kS=Object.defineProperty,TS=Object.getOwnPropertyDescriptor,Xm=(e,t,r,n)=>{for(var i=n>1?void 0:n?TS(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&kS(t,r,i),i};let fo=class extends At{constructor(){super(...arguments),this.copyText="Copy"}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t)}render(){return xe`
138
+ `;var A2=Object.defineProperty,R2=Object.getOwnPropertyDescriptor,Dm=(e,t,r,n)=>{for(var i=n>1?void 0:n?R2(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&A2(t,r,i),i};let ho=class extends At{constructor(){super(...arguments),this.copyText="Copy"}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t)}render(){return xe`
157
139
  <vscode-button appearance="secondary" @click=${this.onCopy}>
158
- ${Hm} ${this.copyText}
140
+ ${Lm} ${this.copyText}
159
141
  </vscode-button>
160
- `}};fo.styles=tr`
142
+ `}};ho.styles=tr`
161
143
  vscode-button {
162
144
  color: var(--vscode-button-foreground);
163
145
  background-color: var(--vscode-button-background);
@@ -174,7 +156,25 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
174
156
  margin: 0 5px 0 -5px;
175
157
  padding: 0;
176
158
  }
177
- `;Xm([Oe({type:String})],fo.prototype,"copyText",2);fo=Xm([Xt("copy-button")],fo);const NS=xe`<svg
159
+ `;Dm([Oe({type:String})],ho.prototype,"copyText",2);ho=Dm([Xt("copy-button")],ho);/**
160
+ * @license
161
+ * Copyright 2021 Google LLC
162
+ * SPDX-License-Identifier: BSD-3-Clause
163
+ */function ct(e,t,r){return e?t(e):r==null?void 0:r(e)}var wh={exports:{}},Ch;function x2(){return Ch||(Ch=1,(function(e,t){(function(r,n){e.exports=n()})(globalThis,(()=>(()=>{var r={4567:function(l,s,a){var c=this&&this.__decorate||function(f,g,S,k){var I,N=arguments.length,E=N<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,g,S,k);else for(var R=f.length-1;R>=0;R--)(I=f[R])&&(E=(N<3?I(E):N>3?I(g,S,E):I(g,S))||E);return N>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(f,g){return function(S,k){g(S,k,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const h=a(9042),b=a(9924),_=a(844),C=a(4725),y=a(2585),d=a(3656);let p=s.AccessibilityManager=class extends _.Disposable{constructor(f,g,S,k){super(),this._terminal=f,this._coreBrowserService=S,this._renderService=k,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let I=0;I<this._terminal.rows;I++)this._rowElements[I]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[I]);if(this._topBoundaryFocusListener=I=>this._handleBoundaryFocus(I,0),this._bottomBoundaryFocusListener=I=>this._handleBoundaryFocus(I,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new b.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((I=>this._handleResize(I.rows)))),this.register(this._terminal.onRender((I=>this._refreshRows(I.start,I.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((I=>this._handleChar(I)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
164
+ `)))),this.register(this._terminal.onA11yTab((I=>this._handleTab(I)))),this.register(this._terminal.onKey((I=>this._handleKey(I.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let g=0;g<f;g++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
165
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,g){this._liveRegionDebouncer.refresh(f,g,this._terminal.rows)}_renderRows(f,g){const S=this._terminal.buffer,k=S.lines.length.toString();for(let I=f;I<=g;I++){const N=S.lines.get(S.ydisp+I),E=[],R=(N==null?void 0:N.translateToString(!0,void 0,void 0,E))||"",O=(S.ydisp+I+1).toString(),V=this._rowElements[I];V&&(R.length===0?(V.innerText=" ",this._rowColumns.set(V,[0,1])):(V.textContent=R,this._rowColumns.set(V,E)),V.setAttribute("aria-posinset",O),V.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,g){const S=f.target,k=this._rowElements[g===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(g===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==k)return;let I,N;if(g===0?(I=S,N=this._rowElements.pop(),this._rowContainer.removeChild(N)):(I=this._rowElements.shift(),N=S,this._rowContainer.removeChild(I)),I.removeEventListener("focus",this._topBoundaryFocusListener),N.removeEventListener("focus",this._bottomBoundaryFocusListener),g===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(g===0?-1:1),this._rowElements[g===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){var f;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:g.anchorNode,offset:g.anchorOffset},k={node:g.focusNode,offset:g.focusOffset};if((S.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===k.node&&S.offset>k.offset)&&([S,k]=[k,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const I=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(I)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:I,offset:((f=I.textContent)==null?void 0:f.length)??0}),!this._rowContainer.contains(k.node))return;const N=({node:O,offset:V})=>{const M=O instanceof Text?O.parentNode:O;let D=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const ee=this._rowColumns.get(M);if(!ee)return console.warn("columns is null. Race condition?"),null;let ae=V<ee.length?ee[V]:ee.slice(-1)[0]+1;return ae>=this._terminal.cols&&(++D,ae=0),{row:D,column:ae}},E=N(S),R=N(k);if(E&&R){if(E.row>R.row||E.row===R.row&&E.column>=R.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(R.row-E.row)*this._terminal.cols-E.column+R.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let g=this._rowContainer.children.length;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);for(;this._rowElements.length>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=p=c([m(1,y.IInstantiationService),m(2,C.ICoreBrowserService),m(3,C.IRenderService)],p)},3614:(l,s)=>{function a(b){return b.replace(/\r?\n/g,"\r")}function c(b,_){return _?"\x1B[200~"+b+"\x1B[201~":b}function m(b,_,C,y){b=c(b=a(b),C.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(b,!0),_.value=""}function h(b,_,C){const y=C.getBoundingClientRect(),d=b.clientX-y.left-10,p=b.clientY-y.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${d}px`,_.style.top=`${p}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=c,s.copyHandler=function(b,_){b.clipboardData&&b.clipboardData.setData("text/plain",_.selectionText),b.preventDefault()},s.handlePasteEvent=function(b,_,C,y){b.stopPropagation(),b.clipboardData&&m(b.clipboardData.getData("text/plain"),_,C,y)},s.paste=m,s.moveTextAreaUnderMouseCursor=h,s.rightClickHandler=function(b,_,C,y,d){h(b,_,C),d&&y.rightClickSelect(b),_.value=y.selectionText,_.select()}},7239:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(m,h,b){this._css.set(m,h,b)}getCss(m,h){return this._css.get(m,h)}setColor(m,h,b){this._color.set(m,h,b)}getColor(m,h){return this._color.get(m,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,c,m,h){a.addEventListener(c,m,h);let b=!1;return{dispose:()=>{b||(b=!0,a.removeEventListener(c,m,h))}}}},3551:function(l,s,a){var c=this&&this.__decorate||function(p,f,g,S){var k,I=arguments.length,N=I<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(p,f,g,S);else for(var E=p.length-1;E>=0;E--)(k=p[E])&&(N=(I<3?k(N):I>3?k(f,g,N):k(f,g))||N);return I>3&&N&&Object.defineProperty(f,g,N),N},m=this&&this.__param||function(p,f){return function(g,S){f(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const h=a(3656),b=a(8460),_=a(844),C=a(2585),y=a(4725);let d=s.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(p,f,g,S,k){super(),this._element=p,this._mouseService=f,this._renderService=g,this._bufferService=S,this._linkProviderService=k,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{var I;this._lastMouseEvent=void 0,(I=this._activeProviderReplies)==null||I.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const g=p.composedPath();for(let S=0;S<g.length;S++){const k=g[S];if(k.classList.contains("xterm"))break;if(k.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,f){var g,S;this._activeProviderReplies&&f||((g=this._activeProviderReplies)==null||g.forEach((I=>{I==null||I.forEach((N=>{N.link.dispose&&N.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let k=!1;for(const[I,N]of this._linkProviderService.linkProviders.entries())f?(S=this._activeProviderReplies)!=null&&S.get(I)&&(k=this._checkLinkProviderResult(I,p,k)):N.provideLinks(p.y,(E=>{var R,O;if(this._isMouseOut)return;const V=E==null?void 0:E.map((M=>({link:M})));(R=this._activeProviderReplies)==null||R.set(I,V),k=this._checkLinkProviderResult(I,p,k),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,f){const g=new Set;for(let S=0;S<f.size;S++){const k=f.get(S);if(k)for(let I=0;I<k.length;I++){const N=k[I],E=N.link.range.start.y<p?0:N.link.range.start.x,R=N.link.range.end.y>p?this._bufferService.cols:N.link.range.end.x;for(let O=E;O<=R;O++){if(g.has(O)){k.splice(I--,1);break}g.add(O)}}}}_checkLinkProviderResult(p,f,g){var S;if(!this._activeProviderReplies)return g;const k=this._activeProviderReplies.get(p);let I=!1;for(let N=0;N<p;N++)this._activeProviderReplies.has(N)&&!this._activeProviderReplies.get(N)||(I=!0);if(!I&&k){const N=k.find((E=>this._linkAtPosition(E.link,f)));N&&(g=!0,this._handleNewLink(N))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!g)for(let N=0;N<this._activeProviderReplies.size;N++){const E=(S=this._activeProviderReplies.get(N))==null?void 0:S.find((R=>this._linkAtPosition(R.link,f)));if(E){g=!0,this._handleNewLink(E);break}}return g}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,f){this._currentLink&&this._lastMouseEvent&&(!p||!f||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(p.link,f)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var g,S;return(S=(g=this._currentLink)==null?void 0:g.state)==null?void 0:S.decorations.pointerCursor},set:g=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==g&&(this._currentLink.state.decorations.pointerCursor=g,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",g))}},underline:{get:()=>{var g,S;return(S=(g=this._currentLink)==null?void 0:g.state)==null?void 0:S.decorations.underline},set:g=>{var S,k,I;(S=this._currentLink)!=null&&S.state&&((I=(k=this._currentLink)==null?void 0:k.state)==null?void 0:I.decorations.underline)!==g&&(this._currentLink.state.decorations.underline=g,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,g))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((g=>{if(!this._currentLink)return;const S=g.start===0?0:g.start+1+this._bufferService.buffer.ydisp,k=this._bufferService.buffer.ydisp+1+g.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=k&&(this._clearCurrentLink(S,k),this._lastMouseEvent)){const I=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);I&&this._askForLink(I,!1)}}))))}_linkHover(p,f,g){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(g,f.text)}_fireUnderlineEvent(p,f){const g=p.range,S=this._bufferService.buffer.ydisp,k=this._createLinkUnderlineEvent(g.start.x-1,g.start.y-S-1,g.end.x,g.end.y-S-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(k)}_linkLeave(p,f,g){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(g,f.text)}_linkAtPosition(p,f){const g=p.range.start.y*this._bufferService.cols+p.range.start.x,S=p.range.end.y*this._bufferService.cols+p.range.end.x,k=f.y*this._bufferService.cols+f.x;return g<=k&&k<=S}_positionFromMouseEvent(p,f,g){const S=g.getCoords(p,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,f,g,S,k){return{x1:p,y1:f,x2:g,y2:S,cols:this._bufferService.cols,fg:k}}};s.Linkifier=d=c([m(1,y.IMouseService),m(2,y.IRenderService),m(3,C.IBufferService),m(4,y.ILinkProviderService)],d)},9042:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,f){var g,S=arguments.length,k=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,d,p,f);else for(var I=y.length-1;I>=0;I--)(g=y[I])&&(k=(S<3?g(k):S>3?g(d,p,k):g(d,p))||k);return S>3&&k&&Object.defineProperty(d,p,k),k},m=this&&this.__param||function(y,d){return function(p,f){d(p,f,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const h=a(511),b=a(2585);let _=s.OscLinkProvider=class{constructor(y,d,p){this._bufferService=y,this._optionsService=d,this._oscLinkService=p}provideLinks(y,d){var p;const f=this._bufferService.buffer.lines.get(y-1);if(!f)return void d(void 0);const g=[],S=this._optionsService.rawOptions.linkHandler,k=new h.CellData,I=f.getTrimmedLength();let N=-1,E=-1,R=!1;for(let O=0;O<I;O++)if(E!==-1||f.hasContent(O)){if(f.loadCell(O,k),k.hasExtendedAttrs()&&k.extended.urlId){if(E===-1){E=O,N=k.extended.urlId;continue}R=k.extended.urlId!==N}else E!==-1&&(R=!0);if(R||E!==-1&&O===I-1){const V=(p=this._oscLinkService.getLinkData(N))==null?void 0:p.uri;if(V){const M={start:{x:E+1,y},end:{x:O+(R||O!==I-1?0:1),y}};let D=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const ee=new URL(V);["http:","https:"].includes(ee.protocol)||(D=!0)}catch{D=!0}D||g.push({text:V,range:M,activate:(ee,ae)=>S?S.activate(ee,ae,M):C(0,ae),hover:(ee,ae)=>{var ge;return(ge=S==null?void 0:S.hover)==null?void 0:ge.call(S,ee,ae,M)},leave:(ee,ae)=>{var ge;return(ge=S==null?void 0:S.leave)==null?void 0:ge.call(S,ee,ae,M)}})}R=!1,k.hasExtendedAttrs()&&k.extended.urlId?(E=O,N=k.extended.urlId):(E=-1,N=-1)}}d(g)}};function C(y,d){if(confirm(`Do you want to navigate to ${d}?
166
+
167
+ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=_=c([m(0,b.IBufferService),m(1,b.IOptionsService),m(2,b.IOscLinkService)],_)},6193:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,c,m){this._rowCount=m,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=a(3614),m=a(3656),h=a(3551),b=a(9042),_=a(3730),C=a(1680),y=a(3107),d=a(5744),p=a(2950),f=a(1296),g=a(428),S=a(4269),k=a(5114),I=a(8934),N=a(3230),E=a(9312),R=a(4725),O=a(6731),V=a(8055),M=a(8969),D=a(8460),ee=a(844),ae=a(6114),ge=a(8437),ke=a(2584),re=a(7399),B=a(5941),U=a(9074),W=a(2585),K=a(5435),ue=a(4567),ve=a(779);class _e extends M.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(J={}){super(J),this.browser=ae,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new ee.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(W.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ve.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((L,ne)=>this.refresh(L,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((L=>this._reportWindowsOptions(L)))),this.register(this._inputHandler.onColor((L=>this._handleColorEvent(L)))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((L=>this._afterResize(L.cols,L.rows)))),this.register((0,ee.toDisposable)((()=>{var L,ne;this._customKeyEventHandler=void 0,(ne=(L=this.element)==null?void 0:L.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(J){if(this._themeService)for(const L of J){let ne,se="";switch(L.index){case 256:ne="foreground",se="10";break;case 257:ne="background",se="11";break;case 258:ne="cursor",se="12";break;default:ne="ansi",se="4;"+L.index}switch(L.type){case 0:const Te=V.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${ke.C0.ESC}]${se};${(0,B.toRgbString)(Te)}${ke.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((pe=>pe.ansi[L.index]=V.channels.toColor(...L.color)));else{const pe=ne;this._themeService.modifyColors((Ue=>Ue[pe]=V.channels.toColor(...L.color)))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(J){J?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ue.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(J){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ke.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var J;return(J=this.textarea)==null?void 0:J.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ke.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const J=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(J);if(!L)return;const ne=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,Te=L.getWidth(ne),pe=this._renderService.dimensions.css.cell.width*Te,Ue=this.buffer.y*this._renderService.dimensions.css.cell.height,nt=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=nt+"px",this.textarea.style.top=Ue+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(L=>{this.hasSelection()&&(0,c.copyHandler)(L,this._selectionService)})));const J=L=>(0,c.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",J)),this.register((0,m.addDisposableDomListener)(this.element,"paste",J)),ae.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(L=>{L.button===2&&(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(L=>{(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ae.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(L=>{L.button===1&&(0,c.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(J=>this._keyUp(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(J=>this._keyDown(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(J=>this._keyPress(J)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(J=>this._compositionHelper.compositionupdate(J)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(J=>this._inputEvent(J)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(J){var L;if(!J)throw new Error("Terminal requires a parent element.");if(J.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((L=this.element)==null?void 0:L.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=J.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),J.appendChild(this.element);const ne=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),ne.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),ne.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),ae.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(k.CoreBrowserService,this.textarea,J.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(g.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(N.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(I.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(ne);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(ue.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const J=this,L=this.element;function ne(pe){const Ue=J._mouseService.getMouseReportCoords(pe,J.screenElement);if(!Ue)return!1;let nt,Je;switch(pe.overrideType||pe.type){case"mousemove":Je=32,pe.buttons===void 0?(nt=3,pe.button!==void 0&&(nt=pe.button<3?pe.button:3)):nt=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Je=0,nt=pe.button<3?pe.button:3;break;case"mousedown":Je=1,nt=pe.button<3?pe.button:3;break;case"wheel":if(J._customWheelEventHandler&&J._customWheelEventHandler(pe)===!1||J.viewport.getLinesScrolled(pe)===0)return!1;Je=pe.deltaY<0?0:1,nt=4;break;default:return!1}return!(Je===void 0||nt===void 0||nt>4)&&J.coreMouseService.triggerMouseEvent({col:Ue.col,row:Ue.row,x:Ue.x,y:Ue.y,button:nt,action:Je,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Te={mouseup:pe=>(ne(pe),pe.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(pe)),wheel:pe=>(ne(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ne(pe)},mousemove:pe=>{pe.buttons||ne(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?se.mousemove||(L.addEventListener("mousemove",Te.mousemove),se.mousemove=Te.mousemove):(L.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&pe?se.wheel||(L.addEventListener("wheel",Te.wheel,{passive:!1}),se.wheel=Te.wheel):(L.removeEventListener("wheel",se.wheel),se.wheel=null),2&pe?se.mouseup||(se.mouseup=Te.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&pe?se.mousedrag||(se.mousedrag=Te.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(L,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ne(pe),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(pe)}))),this.register((0,m.addDisposableDomListener)(L,"wheel",(pe=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Ue=this.viewport.getLinesScrolled(pe);if(Ue===0)return;const nt=ke.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Je="";for(let wt=0;wt<Math.abs(Ue);wt++)Je+=nt;return this.coreService.triggerDataEvent(Je,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(L,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(L,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(J,L){var ne;(ne=this._renderService)==null||ne.refreshRows(J,L)}updateCursorStyle(J){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(J)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(J,L,ne=0){var se;ne===1?(super.scrollLines(J,L,ne),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(J)}paste(J){(0,c.paste)(J,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(J){this._customKeyEventHandler=J}attachCustomWheelEventHandler(J){this._customWheelEventHandler=J}registerLinkProvider(J){return this._linkProviderService.registerLinkProvider(J)}registerCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(J);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(J)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(J){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+J)}registerDecoration(J){return this._decorationService.registerDecoration(J)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(J,L,ne){this._selectionService.setSelection(J,L,ne)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var J;(J=this._selectionService)==null||J.clearSelection()}selectAll(){var J;(J=this._selectionService)==null||J.selectAll()}selectLines(J,L){var ne;(ne=this._selectionService)==null||ne.selectLines(J,L)}_keyDown(J){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&J.altKey;if(!L&&!this._compositionHelper.keydown(J))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||J.key!=="Dead"&&J.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,re.evaluateKeyboardEvent)(J,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(J),ne.type===3||ne.type===2){const se=this.rows-1;return this.scrollLines(ne.type===2?-se:se),this.cancel(J,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,J)||(ne.cancel&&this.cancel(J,!0),!ne.key||!!(J.key&&!J.ctrlKey&&!J.altKey&&!J.metaKey&&J.key.length===1&&J.key.charCodeAt(0)>=65&&J.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==ke.C0.ETX&&ne.key!==ke.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||J.altKey||J.ctrlKey?this.cancel(J,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(J,L){const ne=J.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||J.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||J.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?ne:ne&&(!L.keyCode||L.keyCode>47)}_keyUp(J){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1||((function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18})(J)||this.focus(),this.updateCursorStyle(J),this._keyPressHandled=!1)}_keyPress(J){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(this.cancel(J),J.charCode)L=J.charCode;else if(J.which===null||J.which===void 0)L=J.keyCode;else{if(J.which===0||J.charCode===0)return!1;L=J.which}return!(!L||(J.altKey||J.ctrlKey||J.metaKey)&&!this._isThirdLevelShift(this.browser,J)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(J){if(J.data&&J.inputType==="insertText"&&(!J.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=J.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(J),!0}return!1}resize(J,L){J!==this.cols||L!==this.rows?super.resize(J,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(J,L){var ne,se;(ne=this._charSizeService)==null||ne.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var J;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(ge.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(J=this.viewport)==null||J.reset(),this.refresh(0,this.rows-1)}}reset(){var J,L;this.options.rows=this.rows,this.options.cols=this.cols;const ne=this._customKeyEventHandler;this._setup(),super.reset(),(J=this._selectionService)==null||J.reset(),this._decorationService.reset(),(L=this.viewport)==null||L.reset(),this._customKeyEventHandler=ne,this.refresh(0,this.rows-1)}clearTextureAtlas(){var J;(J=this._renderService)==null||J.clearTextureAtlas()}_reportFocus(){var J;(J=this.element)!=null&&J.classList.contains("focus")?this.coreService.triggerDataEvent(ke.C0.ESC+"[I"):this.coreService.triggerDataEvent(ke.C0.ESC+"[O")}_reportWindowsOptions(J){if(this._renderService)switch(J){case K.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ke.C0.ESC}[4;${ne};${L}t`);break;case K.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),Te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ke.C0.ESC}[6;${Te};${se}t`)}}cancel(J,L){if(this.options.cancelEvents||L)return J.preventDefault(),J.stopPropagation(),!1}}s.Terminal=_e},9924:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,m){this._rowCount=m,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=h-this._lastRefreshMs,_=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(l,s,a){var c=this&&this.__decorate||function(p,f,g,S){var k,I=arguments.length,N=I<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(p,f,g,S);else for(var E=p.length-1;E>=0;E--)(k=p[E])&&(N=(I<3?k(N):I>3?k(f,g,N):k(f,g))||N);return I>3&&N&&Object.defineProperty(f,g,N),N},m=this&&this.__param||function(p,f){return function(g,S){f(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const h=a(3656),b=a(4725),_=a(8460),C=a(844),y=a(2585);let d=s.Viewport=class extends C.Disposable{constructor(p,f,g,S,k,I,N,E){super(),this._viewportElement=p,this._scrollArea=f,this._bufferService=g,this._optionsService=S,this._charSizeService=k,this._renderService=I,this._coreBrowserService=N,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(p){if(p)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(p,f){const g=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&g<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const f=this._getPixelsScrolled(p);return f!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(p,f){var g;let S,k="";const I=[],N=f??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let R=p;R<N;R++){const O=E.get(R);if(!O)continue;const V=(g=E.get(R+1))==null?void 0:g.isWrapped;if(k+=O.translateToString(!V),!V||R===E.length-1){const M=document.createElement("div");M.textContent=k,I.push(M),k.length>0&&(S=M),k=""}}return{bufferElements:I,cursorElement:S}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(p,f){const g=this._optionsService.rawOptions.fastScrollModifier;return g==="alt"&&f.altKey||g==="ctrl"&&f.ctrlKey||g==="shift"&&f.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const f=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}};s.Viewport=d=c([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,b.ICharSizeService),m(5,b.IRenderService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],d)},3107:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,f){var g,S=arguments.length,k=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,d,p,f);else for(var I=y.length-1;I>=0;I--)(g=y[I])&&(k=(S<3?g(k):S>3?g(d,p,k):g(d,p))||k);return S>3&&k&&Object.defineProperty(d,p,k),k},m=this&&this.__param||function(y,d){return function(p,f){d(p,f,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const h=a(4725),b=a(844),_=a(2585);let C=s.BufferDecorationRenderer=class extends b.Disposable{constructor(y,d,p,f,g){super(),this._screenElement=y,this._bufferService=d,this._coreBrowserService=p,this._decorationService=f,this._renderService=g,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((S=>this._removeDecoration(S)))),this.register((0,b.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const y of this._decorationService.decorations)this._renderDecoration(y);this._dimensionsChanged=!1}_renderDecoration(y){this._refreshStyle(y),this._dimensionsChanged&&this._refreshXPosition(y)}_createElement(y){var d;const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",((d=y==null?void 0:y.options)==null?void 0:d.layer)==="top"),p.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=y.options.x??0;return f&&f>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(y,p),p}_refreshStyle(y){const d=y.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let p=this._decorationElements.get(y);p||(p=this._createElement(y),y.element=p,this._decorationElements.set(y,p),this._container.appendChild(p),y.onDispose((()=>{this._decorationElements.delete(y),p.remove()}))),p.style.top=d*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(p)}}_refreshXPosition(y,d=y.element){if(!d)return;const p=y.options.x??0;(y.options.anchor||"left")==="right"?d.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var d;(d=this._decorationElements.get(y))==null||d.remove(),this._decorationElements.delete(y),y.dispose()}};s.BufferDecorationRenderer=C=c([m(1,_.IBufferService),m(2,h.ICoreBrowserService),m(3,_.IDecorationService),m(4,h.IRenderService)],C)},5871:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,m){return c>=a.startBufferLine-this._linePadding[m||"full"]&&c<=a.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(l,s,a){var c=this&&this.__decorate||function(g,S,k,I){var N,E=arguments.length,R=E<3?S:I===null?I=Object.getOwnPropertyDescriptor(S,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,S,k,I);else for(var O=g.length-1;O>=0;O--)(N=g[O])&&(R=(E<3?N(R):E>3?N(S,k,R):N(S,k))||R);return E>3&&R&&Object.defineProperty(S,k,R),R},m=this&&this.__param||function(g,S){return function(k,I){S(k,I,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const h=a(5871),b=a(4725),_=a(844),C=a(2585),y={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let f=s.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(g,S,k,I,N,E,R){var O;super(),this._viewportElement=g,this._screenElement=S,this._bufferService=k,this._decorationService=I,this._renderService=N,this._optionsService=E,this._coreBrowserService=R,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const V=this._canvas.getContext("2d");if(!V)throw new Error("Ctx cannot be null");this._ctx=V,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var M;(M=this._canvas)==null||M.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const g=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=g,d.center=S,d.right=g,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=d.left,p.right=d.left+d.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const g=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(g,12),6)*this._coreBrowserService.dpr);y.left=S,y.center=S,y.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const g=this._colorZoneStore.zones;for(const S of g)S.position!=="full"&&this._renderColorZone(S);for(const S of g)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(g){this._ctx.fillStyle=g.color,this._ctx.fillRect(p[g.position||"full"],Math.round((this._canvas.height-1)*(g.startBufferLine/this._bufferService.buffers.active.lines.length)-y[g.position||"full"]/2),d[g.position||"full"],Math.round((this._canvas.height-1)*((g.endBufferLine-g.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[g.position||"full"]))}_queueRefresh(g,S){this._shouldUpdateDimensions=g||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=f=c([m(2,C.IBufferService),m(3,C.IDecorationService),m(4,b.IRenderService),m(5,C.IOptionsService),m(6,b.ICoreBrowserService)],f)},2950:function(l,s,a){var c=this&&this.__decorate||function(y,d,p,f){var g,S=arguments.length,k=S<3?d:f===null?f=Object.getOwnPropertyDescriptor(d,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,d,p,f);else for(var I=y.length-1;I>=0;I--)(g=y[I])&&(k=(S<3?g(k):S>3?g(d,p,k):g(d,p))||k);return S>3&&k&&Object.defineProperty(d,p,k),k},m=this&&this.__param||function(y,d){return function(p,f){d(p,f,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const h=a(4725),b=a(2585),_=a(2584);let C=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,d,p,f,g,S){this._textarea=y,this._compositionView=d,this._bufferService=p,this._optionsService=f,this._coreService=g,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,p=d.replace(y,"");this._dataAlreadySent=p,d.length>y.length?this._coreService.triggerDataEvent(p,!0):d.length<y.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):d.length===y.length&&d!==y&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,g=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=g+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=g+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}y||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=C=c([m(2,b.IBufferService),m(3,b.IOptionsService),m(4,b.ICoreService),m(5,h.IRenderService)],C)},9806:(l,s)=>{function a(c,m,h){const b=h.getBoundingClientRect(),_=c.getComputedStyle(h),C=parseInt(_.getPropertyValue("padding-left")),y=parseInt(_.getPropertyValue("padding-top"));return[m.clientX-b.left-C,m.clientY-b.top-y]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(c,m,h,b,_,C,y,d,p){if(!C)return;const f=a(c,m,h);return f?(f[0]=Math.ceil((f[0]+(p?y/2:0))/y),f[1]=Math.ceil(f[1]/d),f[0]=Math.min(Math.max(f[0],1),b+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),_),f):void 0}},9504:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=a(2584);function m(d,p,f,g){const S=d-h(d,f),k=p-h(p,f),I=Math.abs(S-k)-(function(N,E,R){let O=0;const V=N-h(N,R),M=E-h(E,R);for(let D=0;D<Math.abs(V-M);D++){const ee=b(N,E)==="A"?-1:1,ae=R.buffer.lines.get(V+ee*D);ae!=null&&ae.isWrapped&&O++}return O})(d,p,f);return y(I,C(b(d,p),g))}function h(d,p){let f=0,g=p.buffer.lines.get(d),S=g==null?void 0:g.isWrapped;for(;S&&d>=0&&d<p.rows;)f++,g=p.buffer.lines.get(--d),S=g==null?void 0:g.isWrapped;return f}function b(d,p){return d>p?"A":"B"}function _(d,p,f,g,S,k){let I=d,N=p,E="";for(;I!==f||N!==g;)I+=S?1:-1,S&&I>k.cols-1?(E+=k.buffer.translateBufferLineToString(N,!1,d,I),I=0,d=0,N++):!S&&I<0&&(E+=k.buffer.translateBufferLineToString(N,!1,0,d+1),I=k.cols-1,d=I,N--);return E+k.buffer.translateBufferLineToString(N,!1,d,I)}function C(d,p){const f=p?"O":"[";return c.C0.ESC+f+d}function y(d,p){d=Math.floor(d);let f="";for(let g=0;g<d;g++)f+=p;return f}s.moveToCellSequence=function(d,p,f,g){const S=f.buffer.x,k=f.buffer.y;if(!f.buffer.hasScrollback)return(function(E,R,O,V,M,D){return m(R,V,M,D).length===0?"":y(_(E,R,E,R-h(R,M),!1,M).length,C("D",D))})(S,k,0,p,f,g)+m(k,p,f,g)+(function(E,R,O,V,M,D){let ee;ee=m(R,V,M,D).length>0?V-h(V,M):R;const ae=V,ge=(function(ke,re,B,U,W,K){let ue;return ue=m(B,U,W,K).length>0?U-h(U,W):re,ke<B&&ue<=U||ke>=B&&ue<U?"C":"D"})(E,R,O,V,M,D);return y(_(E,ee,O,ae,ge==="C",M).length,C(ge,D))})(S,k,d,p,f,g);let I;if(k===p)return I=S>d?"D":"C",y(Math.abs(S-d),C(I,g));I=k>p?"D":"C";const N=Math.abs(k-p);return y((function(E,R){return R.cols-E})(k>p?d:S,f)+(N-1)*f.cols+1+((k>p?S:d)-1),C(I,g))}},1296:function(l,s,a){var c=this&&this.__decorate||function(D,ee,ae,ge){var ke,re=arguments.length,B=re<3?ee:ge===null?ge=Object.getOwnPropertyDescriptor(ee,ae):ge;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(D,ee,ae,ge);else for(var U=D.length-1;U>=0;U--)(ke=D[U])&&(B=(re<3?ke(B):re>3?ke(ee,ae,B):ke(ee,ae))||B);return re>3&&B&&Object.defineProperty(ee,ae,B),B},m=this&&this.__param||function(D,ee){return function(ae,ge){ee(ae,ge,D)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const h=a(3787),b=a(2550),_=a(2223),C=a(6171),y=a(6052),d=a(4725),p=a(8055),f=a(8460),g=a(844),S=a(2585),k="xterm-dom-renderer-owner-",I="xterm-rows",N="xterm-fg-",E="xterm-bg-",R="xterm-focus",O="xterm-selection";let V=1,M=s.DomRenderer=class extends g.Disposable{constructor(D,ee,ae,ge,ke,re,B,U,W,K,ue,ve,_e){super(),this._terminal=D,this._document=ee,this._element=ae,this._screenElement=ge,this._viewportElement=ke,this._helperContainer=re,this._linkifier2=B,this._charSizeService=W,this._optionsService=K,this._bufferService=ue,this._coreBrowserService=ve,this._themeService=_e,this._terminalClass=V++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(I),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Ce=>this._injectCss(Ce)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(k+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Ce=>this._handleLinkHover(Ce)))),this.register(this._linkifier2.onHideLinkUnderline((Ce=>this._handleLinkLeave(Ce)))),this.register((0,g.toDisposable)((()=>{this._element.classList.remove(k+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new b.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const ae of this._rowElements)ae.style.width=`${this.dimensions.css.canvas.width}px`,ae.style.height=`${this.dimensions.css.cell.height}px`,ae.style.lineHeight=`${this.dimensions.css.cell.height}px`,ae.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const ee=`${this._terminalSelector} .${I} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=ee,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let ee=`${this._terminalSelector} .${I} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;ee+=`${this._terminalSelector} .${I} .xterm-dim { color: ${p.color.multiplyOpacity(D.foreground,.5).css};}`,ee+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const ae=`blink_underline_${this._terminalClass}`,ge=`blink_bar_${this._terminalClass}`,ke=`blink_block_${this._terminalClass}`;ee+=`@keyframes ${ae} { 50% { border-bottom-style: hidden; }}`,ee+=`@keyframes ${ge} { 50% { box-shadow: none; }}`,ee+=`@keyframes ${ke} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,ee+=`${this._terminalSelector} .${I}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ae} 1s step-end infinite;}${this._terminalSelector} .${I}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${ge} 1s step-end infinite;}${this._terminalSelector} .${I}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ke} 1s step-end infinite;}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${I} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,ee+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[re,B]of D.ansi.entries())ee+=`${this._terminalSelector} .${N}${re} { color: ${B.css}; }${this._terminalSelector} .${N}${re}.xterm-dim { color: ${p.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${E}${re} { background-color: ${B.css}; }`;ee+=`${this._terminalSelector} .${N}${_.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(D.background).css}; }${this._terminalSelector} .${N}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${E}${_.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=ee}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,ee){for(let ae=this._rowElements.length;ae<=ee;ae++){const ge=this._document.createElement("div");this._rowContainer.appendChild(ge),this._rowElements.push(ge)}for(;this._rowElements.length>ee;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,ee){this._refreshRowElements(D,ee),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,ee,ae){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,ee,ae),this.renderRows(0,this._bufferService.rows-1),!D||!ee)return;this._selectionRenderModel.update(this._terminal,D,ee,ae);const ge=this._selectionRenderModel.viewportStartRow,ke=this._selectionRenderModel.viewportEndRow,re=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(re>=this._bufferService.rows||B<0)return;const U=this._document.createDocumentFragment();if(ae){const W=D[0]>ee[0];U.appendChild(this._createSelectionElement(re,W?ee[0]:D[0],W?D[0]:ee[0],B-re+1))}else{const W=ge===re?D[0]:0,K=re===ke?ee[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(re,W,K));const ue=B-re-1;if(U.appendChild(this._createSelectionElement(re+1,0,this._bufferService.cols,ue)),re!==B){const ve=ke===B?ee[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(B,0,ve))}}this._selectionContainer.appendChild(U)}_createSelectionElement(D,ee,ae,ge=1){const ke=this._document.createElement("div"),re=ee*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(ae-ee);return re+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-re),ke.style.height=ge*this.dimensions.css.cell.height+"px",ke.style.top=D*this.dimensions.css.cell.height+"px",ke.style.left=`${re}px`,ke.style.width=`${B}px`,ke}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const D of this._rowElements)D.replaceChildren()}renderRows(D,ee){const ae=this._bufferService.buffer,ge=ae.ybase+ae.y,ke=Math.min(ae.x,this._bufferService.cols-1),re=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let W=D;W<=ee;W++){const K=W+ae.ydisp,ue=this._rowElements[W],ve=ae.lines.get(K);if(!ue||!ve)break;ue.replaceChildren(...this._rowFactory.createRow(ve,K,K===ge,B,U,ke,re,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${k}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,ee,ae,ge,ke,re){ae<0&&(D=0),ge<0&&(ee=0);const B=this._bufferService.rows-1;ae=Math.max(Math.min(ae,B),0),ge=Math.max(Math.min(ge,B),0),ke=Math.min(ke,this._bufferService.cols);const U=this._bufferService.buffer,W=U.ybase+U.y,K=Math.min(U.x,ke-1),ue=this._optionsService.rawOptions.cursorBlink,ve=this._optionsService.rawOptions.cursorStyle,_e=this._optionsService.rawOptions.cursorInactiveStyle;for(let Ce=ae;Ce<=ge;++Ce){const J=Ce+U.ydisp,L=this._rowElements[Ce],ne=U.lines.get(J);if(!L||!ne)break;L.replaceChildren(...this._rowFactory.createRow(ne,J,J===W,ve,_e,K,ue,this.dimensions.css.cell.width,this._widthCache,re?Ce===ae?D:0:-1,re?(Ce===ge?ee:ke)-1:-1))}}};s.DomRenderer=M=c([m(7,S.IInstantiationService),m(8,d.ICharSizeService),m(9,S.IOptionsService),m(10,S.IBufferService),m(11,d.ICoreBrowserService),m(12,d.IThemeService)],M)},3787:function(l,s,a){var c=this&&this.__decorate||function(I,N,E,R){var O,V=arguments.length,M=V<3?N:R===null?R=Object.getOwnPropertyDescriptor(N,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(I,N,E,R);else for(var D=I.length-1;D>=0;D--)(O=I[D])&&(M=(V<3?O(M):V>3?O(N,E,M):O(N,E))||M);return V>3&&M&&Object.defineProperty(N,E,M),M},m=this&&this.__param||function(I,N){return function(E,R){N(E,R,I)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const h=a(2223),b=a(643),_=a(511),C=a(2585),y=a(8055),d=a(4725),p=a(4269),f=a(6171),g=a(3734);let S=s.DomRendererRowFactory=class{constructor(I,N,E,R,O,V,M){this._document=I,this._characterJoinerService=N,this._optionsService=E,this._coreBrowserService=R,this._coreService=O,this._decorationService=V,this._themeService=M,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(I,N,E){this._selectionStart=I,this._selectionEnd=N,this._columnSelectMode=E}createRow(I,N,E,R,O,V,M,D,ee,ae,ge){const ke=[],re=this._characterJoinerService.getJoinedCharacters(N),B=this._themeService.colors;let U,W=I.getNoBgTrimmedLength();E&&W<V+1&&(W=V+1);let K=0,ue="",ve=0,_e=0,Ce=0,J=!1,L=0,ne=!1,se=0;const Te=[],pe=ae!==-1&&ge!==-1;for(let Ue=0;Ue<W;Ue++){I.loadCell(Ue,this._workCell);let nt=this._workCell.getWidth();if(nt===0)continue;let Je=!1,wt=Ue,Le=this._workCell;if(re.length>0&&Ue===re[0][0]){Je=!0;const $e=re.shift();Le=new p.JoinedCellData(this._workCell,I.translateToString(!0,$e[0],$e[1]),$e[1]-$e[0]),wt=$e[1]-1,nt=Le.getWidth()}const Pr=this._isCellInSelection(Ue,N),zn=E&&Ue===V,Wr=pe&&Ue>=ae&&Ue<=ge;let Ot=!1;this._decorationService.forEachDecorationAtCell(Ue,N,void 0,($e=>{Ot=!0}));let jr=Le.getChars()||b.WHITESPACE_CELL_CHAR;if(jr===" "&&(Le.isUnderline()||Le.isOverline())&&(jr=" "),se=nt*D-ee.get(jr,Le.isBold(),Le.isItalic()),U){if(K&&(Pr&&ne||!Pr&&!ne&&Le.bg===ve)&&(Pr&&ne&&B.selectionForeground||Le.fg===_e)&&Le.extended.ext===Ce&&Wr===J&&se===L&&!zn&&!Je&&!Ot){Le.isInvisible()?ue+=b.WHITESPACE_CELL_CHAR:ue+=jr,K++;continue}K&&(U.textContent=ue),U=this._document.createElement("span"),K=0,ue=""}else U=this._document.createElement("span");if(ve=Le.bg,_e=Le.fg,Ce=Le.extended.ext,J=Wr,L=se,ne=Pr,Je&&V>=Ue&&V<=wt&&(V=Ue),!this._coreService.isCursorHidden&&zn&&this._coreService.isCursorInitialized){if(Te.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&Te.push("xterm-cursor-blink"),Te.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":Te.push("xterm-cursor-outline");break;case"block":Te.push("xterm-cursor-block");break;case"bar":Te.push("xterm-cursor-bar");break;case"underline":Te.push("xterm-cursor-underline")}}if(Le.isBold()&&Te.push("xterm-bold"),Le.isItalic()&&Te.push("xterm-italic"),Le.isDim()&&Te.push("xterm-dim"),ue=Le.isInvisible()?b.WHITESPACE_CELL_CHAR:Le.getChars()||b.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(Te.push(`xterm-underline-${Le.extended.underlineStyle}`),ue===" "&&(ue=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${g.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let $e=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&$e<8&&($e+=8),U.style.textDecorationColor=B.ansi[$e].css}Le.isOverline()&&(Te.push("xterm-overline"),ue===" "&&(ue=" ")),Le.isStrikethrough()&&Te.push("xterm-strikethrough"),Wr&&(U.style.textDecoration="underline");let ht=Le.getFgColor(),Er=Le.getFgColorMode(),Ct=Le.getBgColor(),Lt=Le.getBgColorMode();const Yt=!!Le.isInverse();if(Yt){const $e=ht;ht=Ct,Ct=$e;const cn=Er;Er=Lt,Lt=cn}let jt,nr,Zt,ir=!1;switch(this._decorationService.forEachDecorationAtCell(Ue,N,void 0,($e=>{$e.options.layer!=="top"&&ir||($e.backgroundColorRGB&&(Lt=50331648,Ct=$e.backgroundColorRGB.rgba>>8&16777215,jt=$e.backgroundColorRGB),$e.foregroundColorRGB&&(Er=50331648,ht=$e.foregroundColorRGB.rgba>>8&16777215,nr=$e.foregroundColorRGB),ir=$e.options.layer==="top")})),!ir&&Pr&&(jt=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Ct=jt.rgba>>8&16777215,Lt=50331648,ir=!0,B.selectionForeground&&(Er=50331648,ht=B.selectionForeground.rgba>>8&16777215,nr=B.selectionForeground)),ir&&Te.push("xterm-decoration-top"),Lt){case 16777216:case 33554432:Zt=B.ansi[Ct],Te.push(`xterm-bg-${Ct}`);break;case 50331648:Zt=y.channels.toColor(Ct>>16,Ct>>8&255,255&Ct),this._addStyle(U,`background-color:#${k((Ct>>>0).toString(16),"0",6)}`);break;default:Yt?(Zt=B.foreground,Te.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Zt=B.background}switch(jt||Le.isDim()&&(jt=y.color.multiplyOpacity(Zt,.5)),Er){case 16777216:case 33554432:Le.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(U,Zt,B.ansi[ht],Le,jt,void 0)||Te.push(`xterm-fg-${ht}`);break;case 50331648:const $e=y.channels.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(U,Zt,$e,Le,jt,nr)||this._addStyle(U,`color:#${k(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,Zt,B.foreground,Le,jt,nr)||Yt&&Te.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Te.length&&(U.className=Te.join(" "),Te.length=0),zn||Je||Ot?U.textContent=ue:K++,se!==this.defaultSpacing&&(U.style.letterSpacing=`${se}px`),ke.push(U),Ue=wt}return U&&K&&(U.textContent=ue),ke}_applyMinimumContrast(I,N,E,R,O,V){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const M=this._getContrastCache(R);let D;if(O||V||(D=M.getColor(N.rgba,E.rgba)),D===void 0){const ee=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);D=y.color.ensureContrastRatio(O||N,V||E,ee),M.setColor((O||N).rgba,(V||E).rgba,D??null)}return!!D&&(this._addStyle(I,`color:${D.css}`),!0)}_getContrastCache(I){return I.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(I,N){I.setAttribute("style",`${I.getAttribute("style")||""}${N};`)}_isCellInSelection(I,N){const E=this._selectionStart,R=this._selectionEnd;return!(!E||!R)&&(this._columnSelectMode?E[0]<=R[0]?I>=E[0]&&N>=E[1]&&I<R[0]&&N<=R[1]:I<E[0]&&N>=E[1]&&I>=R[0]&&N<=R[1]:N>E[1]&&N<R[1]||E[1]===R[1]&&N===E[1]&&I>=E[0]&&I<R[0]||E[1]<R[1]&&N===R[1]&&I<R[0]||E[1]<R[1]&&N===E[1]&&I>=E[0])}};function k(I,N,E){for(;I.length<E;)I=N+I;return I}s.DomRendererRowFactory=S=c([m(1,d.ICharacterJoinerService),m(2,C.IOptionsService),m(3,d.ICoreBrowserService),m(4,C.ICoreService),m(5,C.IDecorationService),m(6,d.IThemeService)],S)},2550:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=a.createElement("span");m.classList.add("xterm-char-measure-element");const h=a.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const b=a.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const _=a.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[m,h,b,_],this._container.appendChild(m),this._container.appendChild(h),this._container.appendChild(b),this._container.appendChild(_),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,c,m,h){a===this._font&&c===this._fontSize&&m===this._weight&&h===this._weightBold||(this._font=a,this._fontSize=c,this._weight=m,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(a,c,m){let h=0;if(!c&&!m&&a.length===1&&(h=a.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const C=this._measure(a,0);return C>0&&(this._flat[h]=C),C}let b=a;c&&(b+="B"),m&&(b+="I");let _=this._holey.get(b);if(_===void 0){let C=0;c&&(C|=1),m&&(C|=2),_=this._measure(a,C),_>0&&this._holey.set(b,_)}return _}_measure(a,c){const m=this._measureElements[c];return m.textContent=a.repeat(32),m.offsetWidth/32}}},2223:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(l,s)=>{function a(m){return 57508<=m&&m<=57558}function c(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},s.isEmoji=c,s.allowRescaling=function(m,h,b,_){return h===1&&b>Math.ceil(1.5*_)&&m!==void 0&&m>255&&!c(m)&&!a(m)&&!(function(C){return 57344<=C&&C<=63743})(m)},s.treatGlyphAsBackgroundColor=function(m){return a(m)||(function(h){return 9472<=h&&h<=9631})(m)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(m,h,b=0){return(m-(2*Math.round(h)-b))%(2*Math.round(h))}},6052:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,h,b,_=!1){if(this.selectionStart=h,this.selectionEnd=b,!h||!b||h[0]===b[0]&&h[1]===b[1])return void this.clear();const C=m.buffers.active.ydisp,y=h[1]-C,d=b[1]-C,p=Math.max(y,0),f=Math.min(d,m.rows-1);p>=m.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=y,this.viewportEndRow=d,this.viewportCappedStartRow=p,this.viewportCappedEndRow=f,this.startCol=h[0],this.endCol=b[0])}isCellSelected(m,h,b){return!!this.hasSelection&&(b-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&b>=this.viewportCappedStartRow&&h<this.endCol&&b<=this.viewportCappedEndRow:h<this.startCol&&b>=this.viewportCappedStartRow&&h>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&h>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},456:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,s,a){var c=this&&this.__decorate||function(f,g,S,k){var I,N=arguments.length,E=N<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,g,S,k);else for(var R=f.length-1;R>=0;R--)(I=f[R])&&(E=(N<3?I(E):N>3?I(g,S,E):I(g,S))||E);return N>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(f,g){return function(S,k){g(S,k,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const h=a(2585),b=a(8460),_=a(844);let C=s.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,g,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new d(f,g,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};s.CharSizeService=C=c([m(2,h.IOptionsService)],C);class y extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(g,S){g!==void 0&&g>0&&S!==void 0&&S>0&&(this._result.width=g,this._result.height=S)}}class d extends y{constructor(g,S,k){super(),this._document=g,this._parentElement=S,this._optionsService=k,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class p extends y{constructor(g){super(),this._optionsService=g,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const g=this._ctx.measureText("W");return this._validateAndSet(g.width,g.fontBoundingBoxAscent+g.fontBoundingBoxDescent),this._result}}},4269:function(l,s,a){var c=this&&this.__decorate||function(p,f,g,S){var k,I=arguments.length,N=I<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(p,f,g,S);else for(var E=p.length-1;E>=0;E--)(k=p[E])&&(N=(I<3?k(N):I>3?k(f,g,N):k(f,g))||N);return I>3&&N&&Object.defineProperty(f,g,N),N},m=this&&this.__param||function(p,f){return function(g,S){f(g,S,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const h=a(3734),b=a(643),_=a(511),C=a(2585);class y extends h.AttributeData{constructor(f,g,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=g,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=y;let d=s.CharacterJoinerService=class Fm{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(f){const g={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(g),g.id}deregister(f){for(let g=0;g<this._characterJoiners.length;g++)if(this._characterJoiners[g].id===f)return this._characterJoiners.splice(g,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const g=this._bufferService.buffer.lines.get(f);if(!g||g.length===0)return[];const S=[],k=g.translateToString(!0);let I=0,N=0,E=0,R=g.getFg(0),O=g.getBg(0);for(let V=0;V<g.getTrimmedLength();V++)if(g.loadCell(V,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==O){if(V-I>1){const M=this._getJoinedRanges(k,E,N,g,I);for(let D=0;D<M.length;D++)S.push(M[D])}I=V,E=N,R=this._workCell.fg,O=this._workCell.bg}N+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-I>1){const V=this._getJoinedRanges(k,E,N,g,I);for(let M=0;M<V.length;M++)S.push(V[M])}return S}_getJoinedRanges(f,g,S,k,I){const N=f.substring(g,S);let E=[];try{E=this._characterJoiners[0].handler(N)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const O=this._characterJoiners[R].handler(N);for(let V=0;V<O.length;V++)Fm._mergeRanges(E,O[V])}catch(O){console.error(O)}return this._stringRangesToCellRanges(E,k,I),E}_stringRangesToCellRanges(f,g,S){let k=0,I=!1,N=0,E=f[k];if(E){for(let R=S;R<this._bufferService.cols;R++){const O=g.getWidth(R),V=g.getString(R).length||b.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!I&&E[0]<=N&&(E[0]=R,I=!0),E[1]<=N){if(E[1]=R,E=f[++k],!E)break;E[0]<=N?(E[0]=R,I=!0):I=!1}N+=V}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(f,g){let S=!1;for(let k=0;k<f.length;k++){const I=f[k];if(S){if(g[1]<=I[0])return f[k-1][1]=g[1],f;if(g[1]<=I[1])return f[k-1][1]=Math.max(g[1],I[1]),f.splice(k,1),f;f.splice(k,1),k--}else{if(g[1]<=I[0])return f.splice(k,0,g),f;if(g[1]<=I[1])return I[0]=Math.min(g[0],I[0]),f;g[0]<I[1]&&(I[0]=Math.min(g[0],I[0]),S=!0)}}return S?f[f.length-1][1]=g[1]:f.push(g),f}};s.CharacterJoinerService=d=c([m(0,C.IBufferService)],d)},5114:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=a(844),m=a(8460),h=a(3656);class b extends c.Disposable{constructor(y,d,p){super(),this._textarea=y,this._window=d,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((f=>this._screenDprMonitor.setWindow(f)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(y){this._window!==y&&(this._window=y,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=b;class _ extends c.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(y){this._parentWindow=y,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var y;this._outerListener&&((y=this._resolutionMediaMatchList)==null||y.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=a(844);class m extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const _=this.linkProviders.indexOf(b);_!==-1&&this.linkProviders.splice(_,1)}}}}s.LinkProviderService=m},8934:function(l,s,a){var c=this&&this.__decorate||function(C,y,d,p){var f,g=arguments.length,S=g<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,d):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,y,d,p);else for(var k=C.length-1;k>=0;k--)(f=C[k])&&(S=(g<3?f(S):g>3?f(y,d,S):f(y,d))||S);return g>3&&S&&Object.defineProperty(y,d,S),S},m=this&&this.__param||function(C,y){return function(d,p){y(d,p,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const h=a(4725),b=a(9806);let _=s.MouseService=class{constructor(C,y){this._renderService=C,this._charSizeService=y}getCoords(C,y,d,p,f){return(0,b.getCoords)(window,C,y,d,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(C,y){const d=(0,b.getCoordsRelativeToElement)(window,C,y);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};s.MouseService=_=c([m(0,h.IRenderService),m(1,h.ICharSizeService)],_)},3230:function(l,s,a){var c=this&&this.__decorate||function(f,g,S,k){var I,N=arguments.length,E=N<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,g,S,k);else for(var R=f.length-1;R>=0;R--)(I=f[R])&&(E=(N<3?I(E):N>3?I(g,S,E):I(g,S))||E);return N>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(f,g){return function(S,k){g(S,k,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const h=a(6193),b=a(4725),_=a(8460),C=a(844),y=a(7226),d=a(2585);let p=s.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,g,S,k,I,N,E,R){super(),this._rowCount=f,this._charSizeService=k,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((O,V)=>this._renderRows(O,V)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(N.onResize((()=>this._fullRefresh()))),this.register(N.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(I.onDecorationRegistered((()=>this._fullRefresh()))),this.register(I.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(N.cols,N.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(N.buffer.y,N.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,g),this.register(E.onWindowChange((O=>this._registerIntersectionObserver(O,g))))}_registerIntersectionObserver(f,g){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((k=>this._handleIntersectionChange(k[k.length-1])),{threshold:0});S.observe(g),this._observerDisposable.value=(0,C.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(f,g,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,g,this._rowCount))}_renderRows(f,g){this._renderer.value&&(f=Math.min(f,this._rowCount-1),g=Math.min(g,this._rowCount-1),this._renderer.value.renderRows(f,g),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:g}),this._onRender.fire({start:f,end:g}),this._isNextRenderRedrawOnly=!0)}resize(f,g){this._rowCount=g,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((g=>this.refreshRows(g.start,g.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var f,g;this._renderer.value&&((g=(f=this._renderer.value).clearTextureAtlas)==null||g.call(f),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,g){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(f,g)})):this._renderer.value.handleResize(f,g),this._fullRefresh())}handleCharSizeChanged(){var f;(f=this._renderer.value)==null||f.handleCharSizeChanged()}handleBlur(){var f;(f=this._renderer.value)==null||f.handleBlur()}handleFocus(){var f;(f=this._renderer.value)==null||f.handleFocus()}handleSelectionChanged(f,g,S){var k;this._selectionState.start=f,this._selectionState.end=g,this._selectionState.columnSelectMode=S,(k=this._renderer.value)==null||k.handleSelectionChanged(f,g,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};s.RenderService=p=c([m(2,d.IOptionsService),m(3,b.ICharSizeService),m(4,d.IDecorationService),m(5,d.IBufferService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],p)},9312:function(l,s,a){var c=this&&this.__decorate||function(E,R,O,V){var M,D=arguments.length,ee=D<3?R:V===null?V=Object.getOwnPropertyDescriptor(R,O):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(E,R,O,V);else for(var ae=E.length-1;ae>=0;ae--)(M=E[ae])&&(ee=(D<3?M(ee):D>3?M(R,O,ee):M(R,O))||ee);return D>3&&ee&&Object.defineProperty(R,O,ee),ee},m=this&&this.__param||function(E,R){return function(O,V){R(O,V,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const h=a(9806),b=a(9504),_=a(456),C=a(4725),y=a(8460),d=a(844),p=a(6114),f=a(4841),g=a(511),S=a(2585),k=" ",I=new RegExp(k,"g");let N=s.SelectionService=class extends d.Disposable{constructor(E,R,O,V,M,D,ee,ae,ge){super(),this._element=E,this._screenElement=R,this._linkifier=O,this._bufferService=V,this._coreService=M,this._mouseService=D,this._optionsService=ee,this._renderService=ae,this._coreBrowserService=ge,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new g.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ke=>this._handleMouseMove(ke),this._mouseUpListener=ke=>this._handleMouseUp(ke),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ke=>this._handleTrim(ke))),this.register(this._bufferService.buffers.onBufferActivate((ke=>this._handleBufferActivate(ke)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!E||!R||E[0]===R[0]&&E[1]===R[1])}get selectionText(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!E||!R)return"";const O=this._bufferService.buffer,V=[];if(this._activeSelectionMode===3){if(E[0]===R[0])return"";const M=E[0]<R[0]?E[0]:R[0],D=E[0]<R[0]?R[0]:E[0];for(let ee=E[1];ee<=R[1];ee++){const ae=O.translateBufferLineToString(ee,!0,M,D);V.push(ae)}}else{const M=E[1]===R[1]?R[0]:void 0;V.push(O.translateBufferLineToString(E[1],!0,E[0],M));for(let D=E[1]+1;D<=R[1]-1;D++){const ee=O.lines.get(D),ae=O.translateBufferLineToString(D,!0);ee!=null&&ee.isWrapped?V[V.length-1]+=ae:V.push(ae)}if(E[1]!==R[1]){const D=O.lines.get(R[1]),ee=O.translateBufferLineToString(R[1],!0,0,R[0]);D&&D.isWrapped?V[V.length-1]+=ee:V.push(ee)}}return V.map((M=>M.replace(I," "))).join(p.isWindows?`\r
168
+ `:`
169
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),p.isLinux&&E&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(E){const R=this._getMouseBufferCoords(E),O=this._model.finalSelectionStart,V=this._model.finalSelectionEnd;return!!(O&&V&&R)&&this._areCoordsInSelection(R,O,V)}isCellInSelection(E,R){const O=this._model.finalSelectionStart,V=this._model.finalSelectionEnd;return!(!O||!V)&&this._areCoordsInSelection([E,R],O,V)}_areCoordsInSelection(E,R,O){return E[1]>R[1]&&E[1]<O[1]||R[1]===O[1]&&E[1]===R[1]&&E[0]>=R[0]&&E[0]<O[0]||R[1]<O[1]&&E[1]===O[1]&&E[0]<O[0]||R[1]<O[1]&&E[1]===R[1]&&E[0]>=R[0]}_selectWordAtCursor(E,R){var O,V;const M=(V=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:V.range;if(M)return this._model.selectionStart=[M.start.x-1,M.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(M,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(E);return!!D&&(this._selectWordAt(D,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,R){this._model.clearSelection(),E=Math.max(E,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const R=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(E){let R=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=O?0:(R>O&&(R-=O),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(E){return p.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const R=this._getMouseBufferCoords(E);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(E){return E.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const V=O.lines.get(this._model.selectionEnd[1]);V&&V.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const R=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const V=(0,b.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(V,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,O=!(!E||!R||E[0]===R[0]&&E[1]===R[1]);O?E&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,R,O)):this._oldHasSelection&&this._fireOnSelectionChange(E,R,O)}_fireOnSelectionChange(E,R,O){this._oldSelectionStart=E,this._oldSelectionEnd=R,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(E,R){let O=R;for(let V=0;R>=V;V++){const M=E.loadCell(V,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:M>1&&R!==V&&(O+=M-1)}return O}setSelection(E,R,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,R],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,R,O=!0,V=!0){if(E[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,D=M.lines.get(E[1]);if(!D)return;const ee=M.translateBufferLineToString(E[1],!1);let ae=this._convertViewportColToCharacterIndex(D,E[0]),ge=ae;const ke=E[0]-ae;let re=0,B=0,U=0,W=0;if(ee.charAt(ae)===" "){for(;ae>0&&ee.charAt(ae-1)===" ";)ae--;for(;ge<ee.length&&ee.charAt(ge+1)===" ";)ge++}else{let ve=E[0],_e=E[0];D.getWidth(ve)===0&&(re++,ve--),D.getWidth(_e)===2&&(B++,_e++);const Ce=D.getString(_e).length;for(Ce>1&&(W+=Ce-1,ge+=Ce-1);ve>0&&ae>0&&!this._isCharWordSeparator(D.loadCell(ve-1,this._workCell));){D.loadCell(ve-1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===0?(re++,ve--):J>1&&(U+=J-1,ae-=J-1),ae--,ve--}for(;_e<D.length&&ge+1<ee.length&&!this._isCharWordSeparator(D.loadCell(_e+1,this._workCell));){D.loadCell(_e+1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,_e++):J>1&&(W+=J-1,ge+=J-1),ge++,_e++}}ge++;let K=ae+ke-re+U,ue=Math.min(this._bufferService.cols,ge-ae+re+B-U-W);if(R||ee.slice(ae,ge).trim()!==""){if(O&&K===0&&D.getCodePoint(0)!==32){const ve=M.lines.get(E[1]-1);if(ve&&D.isWrapped&&ve.getCodePoint(this._bufferService.cols-1)!==32){const _e=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(_e){const Ce=this._bufferService.cols-_e.start;K-=Ce,ue+=Ce}}}if(V&&K+ue===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const ve=M.lines.get(E[1]+1);if(ve!=null&&ve.isWrapped&&ve.getCodePoint(0)!==32){const _e=this._getWordAt([0,E[1]+1],!1,!1,!0);_e&&(ue+=_e.length)}}return{start:K,length:ue}}}_selectWordAt(E,R){const O=this._getWordAt(E,R);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[O.start,E[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(E){const R=this._getWordAt(E,!0);if(R){let O=E[1];for(;R.start<0;)R.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,O]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const R=this._bufferService.buffer.getWrappedRangeForLine(E),O={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(O,this._bufferService.cols)}};s.SelectionService=N=c([m(3,S.IBufferService),m(4,S.ICoreService),m(5,C.IMouseService),m(6,S.IOptionsService),m(7,C.IRenderService),m(8,C.ICoreBrowserService)],N)},4725:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=a(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(l,s,a){var c=this&&this.__decorate||function(N,E,R,O){var V,M=arguments.length,D=M<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(N,E,R,O);else for(var ee=N.length-1;ee>=0;ee--)(V=N[ee])&&(D=(M<3?V(D):M>3?V(E,R,D):V(E,R))||D);return M>3&&D&&Object.defineProperty(E,R,D),D},m=this&&this.__param||function(N,E){return function(R,O){E(R,O,N)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const h=a(7239),b=a(8055),_=a(8460),C=a(844),y=a(2585),d=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),f=b.css.toColor("#ffffff"),g=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const N=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let R=0;R<216;R++){const O=E[R/36%6|0],V=E[R/6%6|0],M=E[R%6];N.push({css:b.channels.toCss(O,V,M),rgba:b.channels.toRgba(O,V,M)})}for(let R=0;R<24;R++){const O=8+10*R;N.push({css:b.channels.toCss(O,O,O),rgba:b.channels.toRgba(O,O,O)})}return N})());let k=s.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(N){super(),this._optionsService=N,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:f,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(p,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(N={}){const E=this._colors;if(E.foreground=I(N.foreground,d),E.background=I(N.background,p),E.cursor=I(N.cursor,f),E.cursorAccent=I(N.cursorAccent,g),E.selectionBackgroundTransparent=I(N.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=I(N.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=N.selectionForeground?I(N.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=s.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=I(N.black,s.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=I(N.red,s.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=I(N.green,s.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=I(N.yellow,s.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=I(N.blue,s.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=I(N.magenta,s.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=I(N.cyan,s.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=I(N.white,s.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=I(N.brightBlack,s.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=I(N.brightRed,s.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=I(N.brightGreen,s.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=I(N.brightYellow,s.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=I(N.brightBlue,s.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=I(N.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=I(N.brightCyan,s.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=I(N.brightWhite,s.DEFAULT_ANSI_COLORS[15]),N.extendedAnsi){const R=Math.min(E.ansi.length-16,N.extendedAnsi.length);for(let O=0;O<R;O++)E.ansi[O+16]=I(N.extendedAnsi[O],s.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(N){this._restoreColor(N),this._onChangeColors.fire(this.colors)}_restoreColor(N){if(N!==void 0)switch(N){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[N]=this._restoreColors.ansi[N]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(N){N(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function I(N,E){if(N!==void 0)try{return b.css.toColor(N)}catch{}return E}s.ThemeService=k=c([m(0,y.IOptionsService)],k)},6349:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=a(8460),m=a(844);class h extends m.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const C=new Array(_);for(let y=0;y<Math.min(_,this.length);y++)C[y]=this._array[this._getCyclicIndex(y)];this._array=C,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let C=this._length;C<_;C++)this._array[C]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,C){this._array[this._getCyclicIndex(_)]=C}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,C,...y){if(C){for(let d=_;d<this._length-C;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+C)];this._length-=C,this.onDeleteEmitter.fire({index:_,amount:C})}for(let d=this._length-1;d>=_;d--)this._array[this._getCyclicIndex(d+y.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<y.length;d++)this._array[this._getCyclicIndex(_+d)]=y[d];if(y.length&&this.onInsertEmitter.fire({index:_,amount:y.length}),this._length+y.length>this._maxLength){const d=this._length+y.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=y.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,C,y){if(!(C<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let p=C-1;p>=0;p--)this.set(_+p+y,this.get(_+p));const d=_+C+y-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<C;d++)this.set(_+d+y,this.get(_+d))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}s.CircularList=h},1439:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(c,m=5){if(typeof c!="object")return c;const h=Array.isArray(c)?[]:{};for(const b in c)h[b]=m<=1?c[b]:c[b]&&a(c[b],m-1);return h}},8055:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,m=0,h=0;var b,_,C,y,d;function p(g){const S=g.toString(16);return S.length<2?"0"+S:S}function f(g,S){return g<S?(S+.05)/(g+.05):(g+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(g){g.toCss=function(S,k,I,N){return N!==void 0?`#${p(S)}${p(k)}${p(I)}${p(N)}`:`#${p(S)}${p(k)}${p(I)}`},g.toRgba=function(S,k,I,N=255){return(S<<24|k<<16|I<<8|N)>>>0},g.toColor=function(S,k,I,N){return{css:g.toCss(S,k,I,N),rgba:g.toRgba(S,k,I,N)}}})(b||(s.channels=b={})),(function(g){function S(k,I){return h=Math.round(255*I),[a,c,m]=d.toChannels(k.rgba),{css:b.toCss(a,c,m,h),rgba:b.toRgba(a,c,m,h)}}g.blend=function(k,I){if(h=(255&I.rgba)/255,h===1)return{css:I.css,rgba:I.rgba};const N=I.rgba>>24&255,E=I.rgba>>16&255,R=I.rgba>>8&255,O=k.rgba>>24&255,V=k.rgba>>16&255,M=k.rgba>>8&255;return a=O+Math.round((N-O)*h),c=V+Math.round((E-V)*h),m=M+Math.round((R-M)*h),{css:b.toCss(a,c,m),rgba:b.toRgba(a,c,m)}},g.isOpaque=function(k){return(255&k.rgba)==255},g.ensureContrastRatio=function(k,I,N){const E=d.ensureContrastRatio(k.rgba,I.rgba,N);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},g.opaque=function(k){const I=(255|k.rgba)>>>0;return[a,c,m]=d.toChannels(I),{css:b.toCss(a,c,m),rgba:I}},g.opacity=S,g.multiplyOpacity=function(k,I){return h=255&k.rgba,S(k,h*I/255)},g.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}})(_||(s.color=_={})),(function(g){let S,k;try{const I=document.createElement("canvas");I.width=1,I.height=1;const N=I.getContext("2d",{willReadFrequently:!0});N&&(S=N,S.globalCompositeOperation="copy",k=S.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(I){if(I.match(/#[\da-f]{3,8}/i))switch(I.length){case 4:return a=parseInt(I.slice(1,2).repeat(2),16),c=parseInt(I.slice(2,3).repeat(2),16),m=parseInt(I.slice(3,4).repeat(2),16),b.toColor(a,c,m);case 5:return a=parseInt(I.slice(1,2).repeat(2),16),c=parseInt(I.slice(2,3).repeat(2),16),m=parseInt(I.slice(3,4).repeat(2),16),h=parseInt(I.slice(4,5).repeat(2),16),b.toColor(a,c,m,h);case 7:return{css:I,rgba:(parseInt(I.slice(1),16)<<8|255)>>>0};case 9:return{css:I,rgba:parseInt(I.slice(1),16)>>>0}}const N=I.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(N)return a=parseInt(N[1]),c=parseInt(N[2]),m=parseInt(N[3]),h=Math.round(255*(N[5]===void 0?1:parseFloat(N[5]))),b.toColor(a,c,m,h);if(!S||!k)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=k,S.fillStyle=I,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,m,h]=S.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(a,c,m,h),css:I}}})(C||(s.css=C={})),(function(g){function S(k,I,N){const E=k/255,R=I/255,O=N/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}g.relativeLuminance=function(k){return S(k>>16&255,k>>8&255,255&k)},g.relativeLuminance2=S})(y||(s.rgb=y={})),(function(g){function S(I,N,E){const R=I>>24&255,O=I>>16&255,V=I>>8&255;let M=N>>24&255,D=N>>16&255,ee=N>>8&255,ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));for(;ae<E&&(M>0||D>0||ee>0);)M-=Math.max(0,Math.ceil(.1*M)),D-=Math.max(0,Math.ceil(.1*D)),ee-=Math.max(0,Math.ceil(.1*ee)),ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));return(M<<24|D<<16|ee<<8|255)>>>0}function k(I,N,E){const R=I>>24&255,O=I>>16&255,V=I>>8&255;let M=N>>24&255,D=N>>16&255,ee=N>>8&255,ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));for(;ae<E&&(M<255||D<255||ee<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),D=Math.min(255,D+Math.ceil(.1*(255-D))),ee=Math.min(255,ee+Math.ceil(.1*(255-ee))),ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));return(M<<24|D<<16|ee<<8|255)>>>0}g.blend=function(I,N){if(h=(255&N)/255,h===1)return N;const E=N>>24&255,R=N>>16&255,O=N>>8&255,V=I>>24&255,M=I>>16&255,D=I>>8&255;return a=V+Math.round((E-V)*h),c=M+Math.round((R-M)*h),m=D+Math.round((O-D)*h),b.toRgba(a,c,m)},g.ensureContrastRatio=function(I,N,E){const R=y.relativeLuminance(I>>8),O=y.relativeLuminance(N>>8);if(f(R,O)<E){if(O<R){const D=S(I,N,E),ee=f(R,y.relativeLuminance(D>>8));if(ee<E){const ae=k(I,N,E);return ee>f(R,y.relativeLuminance(ae>>8))?D:ae}return D}const V=k(I,N,E),M=f(R,y.relativeLuminance(V>>8));if(M<E){const D=S(I,N,E);return M>f(R,y.relativeLuminance(D>>8))?V:D}return V}},g.reduceLuminance=S,g.increaseLuminance=k,g.toChannels=function(I){return[I>>24&255,I>>16&255,I>>8&255,255&I]}})(d||(s.rgba=d={})),s.toPaddedHex=p,s.contrastRatio=f},8969:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=a(844),m=a(2585),h=a(4348),b=a(7866),_=a(744),C=a(7302),y=a(6975),d=a(8460),p=a(1753),f=a(1480),g=a(7994),S=a(9282),k=a(5435),I=a(5981),N=a(2660);let E=!1;class R extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((V=>{var M;(M=this._onScrollApi)==null||M.fire(V.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(V){for(const M in V)this.optionsService.options[M]=V[M]}constructor(V){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new C.OptionsService(V)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(g.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(N.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new k.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new I.WriteBuffer(((M,D)=>this._inputHandler.parse(M,D)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(V,M){this._writeBuffer.write(V,M)}writeSync(V,M){this._logService.logLevel<=m.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(V,M)}input(V,M=!0){this.coreService.triggerDataEvent(V,M)}resize(V,M){isNaN(V)||isNaN(M)||(V=Math.max(V,_.MINIMUM_COLS),M=Math.max(M,_.MINIMUM_ROWS),this._bufferService.resize(V,M))}scroll(V,M=!1){this._bufferService.scroll(V,M)}scrollLines(V,M,D){this._bufferService.scrollLines(V,M,D)}scrollPages(V){this.scrollLines(V*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(V){const M=V-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(V,M){return this._inputHandler.registerEscHandler(V,M)}registerDcsHandler(V,M){return this._inputHandler.registerDcsHandler(V,M)}registerCsiHandler(V,M){return this._inputHandler.registerCsiHandler(V,M)}registerOscHandler(V,M){return this._inputHandler.registerOscHandler(V,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let V=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?V=M.backend==="conpty"&&M.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(V=!0),V?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const V=[];V.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),V.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const M of V)M.dispose()}))}}}s.CoreTerminal=R},8460:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},5435:function(l,s,a){var c=this&&this.__decorate||function(re,B,U,W){var K,ue=arguments.length,ve=ue<3?B:W===null?W=Object.getOwnPropertyDescriptor(B,U):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ve=Reflect.decorate(re,B,U,W);else for(var _e=re.length-1;_e>=0;_e--)(K=re[_e])&&(ve=(ue<3?K(ve):ue>3?K(B,U,ve):K(B,U))||ve);return ue>3&&ve&&Object.defineProperty(B,U,ve),ve},m=this&&this.__param||function(re,B){return function(U,W){B(U,W,re)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const h=a(2584),b=a(7116),_=a(2015),C=a(844),y=a(482),d=a(8437),p=a(8460),f=a(643),g=a(511),S=a(3734),k=a(2585),I=a(1480),N=a(6242),E=a(6351),R=a(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},V=131072;function M(re,B){if(re>24)return B.setWinLines||!1;switch(re){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var D;(function(re){re[re.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",re[re.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(s.WindowsOptionsReportType=D={}));let ee=0;class ae extends C.Disposable{getAttrData(){return this._curAttrData}constructor(B,U,W,K,ue,ve,_e,Ce,J=new _.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=U,this._coreService=W,this._logService=K,this._optionsService=ue,this._oscLinkService=ve,this._coreMouseService=_e,this._unicodeService=Ce,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new g.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new ge(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._parser.setCsiHandlerFallback(((L,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:ne.toArray()})})),this._parser.setEscHandlerFallback((L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})})),this._parser.setExecuteHandlerFallback((L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})})),this._parser.setOscHandlerFallback(((L,ne,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:ne,data:se})})),this._parser.setDcsHandlerFallback(((L,ne,se)=>{ne==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:ne,payload:se})})),this._parser.setPrintHandler(((L,ne,se)=>this.print(L,ne,se))),this._parser.registerCsiHandler({final:"@"},(L=>this.insertChars(L))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(L=>this.scrollLeft(L))),this._parser.registerCsiHandler({final:"A"},(L=>this.cursorUp(L))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(L=>this.scrollRight(L))),this._parser.registerCsiHandler({final:"B"},(L=>this.cursorDown(L))),this._parser.registerCsiHandler({final:"C"},(L=>this.cursorForward(L))),this._parser.registerCsiHandler({final:"D"},(L=>this.cursorBackward(L))),this._parser.registerCsiHandler({final:"E"},(L=>this.cursorNextLine(L))),this._parser.registerCsiHandler({final:"F"},(L=>this.cursorPrecedingLine(L))),this._parser.registerCsiHandler({final:"G"},(L=>this.cursorCharAbsolute(L))),this._parser.registerCsiHandler({final:"H"},(L=>this.cursorPosition(L))),this._parser.registerCsiHandler({final:"I"},(L=>this.cursorForwardTab(L))),this._parser.registerCsiHandler({final:"J"},(L=>this.eraseInDisplay(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(L=>this.eraseInDisplay(L,!0))),this._parser.registerCsiHandler({final:"K"},(L=>this.eraseInLine(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(L=>this.eraseInLine(L,!0))),this._parser.registerCsiHandler({final:"L"},(L=>this.insertLines(L))),this._parser.registerCsiHandler({final:"M"},(L=>this.deleteLines(L))),this._parser.registerCsiHandler({final:"P"},(L=>this.deleteChars(L))),this._parser.registerCsiHandler({final:"S"},(L=>this.scrollUp(L))),this._parser.registerCsiHandler({final:"T"},(L=>this.scrollDown(L))),this._parser.registerCsiHandler({final:"X"},(L=>this.eraseChars(L))),this._parser.registerCsiHandler({final:"Z"},(L=>this.cursorBackwardTab(L))),this._parser.registerCsiHandler({final:"`"},(L=>this.charPosAbsolute(L))),this._parser.registerCsiHandler({final:"a"},(L=>this.hPositionRelative(L))),this._parser.registerCsiHandler({final:"b"},(L=>this.repeatPrecedingCharacter(L))),this._parser.registerCsiHandler({final:"c"},(L=>this.sendDeviceAttributesPrimary(L))),this._parser.registerCsiHandler({prefix:">",final:"c"},(L=>this.sendDeviceAttributesSecondary(L))),this._parser.registerCsiHandler({final:"d"},(L=>this.linePosAbsolute(L))),this._parser.registerCsiHandler({final:"e"},(L=>this.vPositionRelative(L))),this._parser.registerCsiHandler({final:"f"},(L=>this.hVPosition(L))),this._parser.registerCsiHandler({final:"g"},(L=>this.tabClear(L))),this._parser.registerCsiHandler({final:"h"},(L=>this.setMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(L=>this.setModePrivate(L))),this._parser.registerCsiHandler({final:"l"},(L=>this.resetMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(L=>this.resetModePrivate(L))),this._parser.registerCsiHandler({final:"m"},(L=>this.charAttributes(L))),this._parser.registerCsiHandler({final:"n"},(L=>this.deviceStatus(L))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(L=>this.deviceStatusPrivate(L))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(L=>this.softReset(L))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(L=>this.setCursorStyle(L))),this._parser.registerCsiHandler({final:"r"},(L=>this.setScrollRegion(L))),this._parser.registerCsiHandler({final:"s"},(L=>this.saveCursor(L))),this._parser.registerCsiHandler({final:"t"},(L=>this.windowOptions(L))),this._parser.registerCsiHandler({final:"u"},(L=>this.restoreCursor(L))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(L=>this.insertColumns(L))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(L=>this.deleteColumns(L))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(L=>this.selectProtected(L))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(L=>this.requestMode(L,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(L=>this.requestMode(L,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new N.OscHandler((L=>(this.setTitle(L),this.setIconName(L),!0)))),this._parser.registerOscHandler(1,new N.OscHandler((L=>this.setIconName(L)))),this._parser.registerOscHandler(2,new N.OscHandler((L=>this.setTitle(L)))),this._parser.registerOscHandler(4,new N.OscHandler((L=>this.setOrReportIndexedColor(L)))),this._parser.registerOscHandler(8,new N.OscHandler((L=>this.setHyperlink(L)))),this._parser.registerOscHandler(10,new N.OscHandler((L=>this.setOrReportFgColor(L)))),this._parser.registerOscHandler(11,new N.OscHandler((L=>this.setOrReportBgColor(L)))),this._parser.registerOscHandler(12,new N.OscHandler((L=>this.setOrReportCursorColor(L)))),this._parser.registerOscHandler(104,new N.OscHandler((L=>this.restoreIndexedColor(L)))),this._parser.registerOscHandler(110,new N.OscHandler((L=>this.restoreFgColor(L)))),this._parser.registerOscHandler(111,new N.OscHandler((L=>this.restoreBgColor(L)))),this._parser.registerOscHandler(112,new N.OscHandler((L=>this.restoreCursorColor(L)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const L in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},(()=>this.selectCharset("("+L))),this._parser.registerEscHandler({intermediates:")",final:L},(()=>this.selectCharset(")"+L))),this._parser.registerEscHandler({intermediates:"*",final:L},(()=>this.selectCharset("*"+L))),this._parser.registerEscHandler({intermediates:"+",final:L},(()=>this.selectCharset("+"+L))),this._parser.registerEscHandler({intermediates:"-",final:L},(()=>this.selectCharset("-"+L))),this._parser.registerEscHandler({intermediates:".",final:L},(()=>this.selectCharset("."+L))),this._parser.registerEscHandler({intermediates:"/",final:L},(()=>this.selectCharset("/"+L)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((L=>(this._logService.error("Parsing error: ",L),L))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((L,ne)=>this.requestStatusString(L,ne))))}_preserveStack(B,U,W,K){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=W,this._parseStack.position=K}_logSlowResolvingAsync(B){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([B,new Promise(((U,W)=>setTimeout((()=>W("#SLOW_TIMEOUT")),5e3)))]).catch((U=>{if(U!=="#SLOW_TIMEOUT")throw U;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,U){let W,K=this._activeBuffer.x,ue=this._activeBuffer.y,ve=0;const _e=this._parseStack.paused;if(_e){if(W=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(W),W;K=this._parseStack.cursorStartX,ue=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>V&&(ve=this._parseStack.position+V)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(L=>String.fromCharCode(L))).join("")}"`),typeof B=="string"?B.split("").map((L=>L.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<V&&(this._parseBuffer=new Uint32Array(Math.min(B.length,V))),_e||this._dirtyRowTracker.clearRange(),B.length>V)for(let L=ve;L<B.length;L+=V){const ne=L+V<B.length?L+V:B.length,se=typeof B=="string"?this._stringDecoder.decode(B.substring(L,ne),this._parseBuffer):this._utf8Decoder.decode(B.subarray(L,ne),this._parseBuffer);if(W=this._parser.parse(this._parseBuffer,se))return this._preserveStack(K,ue,se,L),this._logSlowResolvingAsync(W),W}else if(!_e){const L=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(W=this._parser.parse(this._parseBuffer,L))return this._preserveStack(K,ue,L,0),this._logSlowResolvingAsync(W),W}this._activeBuffer.x===K&&this._activeBuffer.y===ue||this._onCursorMove.fire();const Ce=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),J=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);J<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(J,this._bufferService.rows-1),Math.min(Ce,this._bufferService.rows-1))}print(B,U,W){let K,ue;const ve=this._charsetService.charset,_e=this._optionsService.rawOptions.screenReaderMode,Ce=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,ne=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&W-U>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let Te=this._parser.precedingJoinState;for(let pe=U;pe<W;++pe){if(K=B[pe],K<127&&ve){const wt=ve[String.fromCharCode(K)];wt&&(K=wt.charCodeAt(0))}const Ue=this._unicodeService.charProperties(K,Te);ue=I.UnicodeService.extractWidth(Ue);const nt=I.UnicodeService.extractShouldJoin(Ue),Je=nt?I.UnicodeService.extractWidth(Te):0;if(Te=Ue,_e&&this._onA11yChar.fire((0,y.stringFromCodePoint)(K)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ue-Je>Ce){if(J){const wt=se;let Le=this._activeBuffer.x-Je;for(this._activeBuffer.x=Je,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Je>0&&se instanceof d.BufferLine&&se.copyCellsFrom(wt,Le,0,Je,!1);Le<Ce;)wt.setCellFromCodepoint(Le++,0,1,ne)}else if(this._activeBuffer.x=Ce-1,ue===2)continue}if(nt&&this._activeBuffer.x){const wt=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-wt,K,ue);for(let Le=ue-Je;--Le>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(L&&(se.insertCells(this._activeBuffer.x,ue-Je,this._activeBuffer.getNullCell(ne)),se.getWidth(Ce-1)===2&&se.setCellFromCodepoint(Ce-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ne)),se.setCellFromCodepoint(this._activeBuffer.x++,K,ue,ne),ue>0)for(;--ue;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=Te,this._activeBuffer.x<Ce&&W-U>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,U){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,U):this._parser.registerCsiHandler(B,(W=>!M(W.params[0],this._optionsService.rawOptions.windowOptions)||U(W)))}registerDcsHandler(B,U){return this._parser.registerDcsHandler(B,new E.DcsHandler(U))}registerEscHandler(B,U){return this._parser.registerEscHandler(B,U)}registerOscHandler(B,U){return this._parser.registerOscHandler(B,new N.OscHandler(U))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var B;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);U.hasWidth(this._activeBuffer.x)&&!U.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(B,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=B,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+U)}cursorUp(B){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const U=B.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=B.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=B.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const U=B.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,U,W,K=!1,ue=!1){const ve=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ve.replaceCells(U,W,this._activeBuffer.getNullCell(this._eraseAttrData()),ue),K&&(ve.isWrapped=!1)}_resetBufferLine(B,U=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);W&&(W.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),W.isWrapped=!1)}eraseInDisplay(B,U=!1){let W;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(W=this._activeBuffer.y,this._dirtyRowTracker.markDirty(W),this._eraseInBufferLine(W++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);W<this._bufferService.rows;W++)this._resetBufferLine(W,U);this._dirtyRowTracker.markDirty(W);break;case 1:for(W=this._activeBuffer.y,this._dirtyRowTracker.markDirty(W),this._eraseInBufferLine(W,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(W+1).isWrapped=!1);W--;)this._resetBufferLine(W,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(W=this._bufferService.rows,this._dirtyRowTracker.markDirty(W-1);W--;)this._resetBufferLine(W,U);this._dirtyRowTracker.markDirty(0);break;case 3:const K=this._activeBuffer.lines.length-this._bufferService.rows;K>0&&(this._activeBuffer.lines.trimStart(K),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-K,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-K,0),this._onScroll.fire(0))}return!0}eraseInLine(B,U=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,U);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,U)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let U=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=this._activeBuffer.ybase+this._activeBuffer.y,K=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ue=this._bufferService.rows-1+this._activeBuffer.ybase-K+1;for(;U--;)this._activeBuffer.lines.splice(ue-1,1),this._activeBuffer.lines.splice(W,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let U=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=this._activeBuffer.ybase+this._activeBuffer.y;let K;for(K=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-K;U--;)this._activeBuffer.lines.splice(W,1),this._activeBuffer.lines.splice(K,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let U=B.params[0]||1;for(;U--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(B){let U=B.params[0]||1;for(;U--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);K.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);K.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);K.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let W=this._activeBuffer.scrollTop;W<=this._activeBuffer.scrollBottom;++W){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+W);K.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),K.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const U=this._parser.precedingJoinState;if(!U)return!0;const W=B.params[0]||1,K=I.UnicodeService.extractWidth(U),ue=this._activeBuffer.x-K,ve=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ue),_e=new Uint32Array(ve.length*W);let Ce=0;for(let L=0;L<ve.length;){const ne=ve.codePointAt(L)||0;_e[Ce++]=ne,L+=ne>65535?2:1}let J=Ce;for(let L=1;L<W;++L)_e.copyWithin(J,0,Ce),J+=Ce;return this.print(_e,0,J),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),B.params[U]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(B,U){const W=this._coreService.decPrivateModes,{activeProtocol:K,activeEncoding:ue}=this._coreMouseService,ve=this._coreService,{buffers:_e,cols:Ce}=this._bufferService,{active:J,alt:L}=_e,ne=this._optionsService.rawOptions,se=nt=>nt?1:2,Te=B.params[0];return pe=Te,Ue=U?Te===2?4:Te===4?se(ve.modes.insertMode):Te===12?3:Te===20?se(ne.convertEol):0:Te===1?se(W.applicationCursorKeys):Te===3?ne.windowOptions.setWinLines?Ce===80?2:Ce===132?1:0:0:Te===6?se(W.origin):Te===7?se(W.wraparound):Te===8?3:Te===9?se(K==="X10"):Te===12?se(ne.cursorBlink):Te===25?se(!ve.isCursorHidden):Te===45?se(W.reverseWraparound):Te===66?se(W.applicationKeypad):Te===67?4:Te===1e3?se(K==="VT200"):Te===1002?se(K==="DRAG"):Te===1003?se(K==="ANY"):Te===1004?se(W.sendFocus):Te===1005?4:Te===1006?se(ue==="SGR"):Te===1015?4:Te===1016?se(ue==="SGR_PIXELS"):Te===1048?1:Te===47||Te===1047||Te===1049?se(J===L):Te===2004?se(W.bracketedPasteMode):0,ve.triggerDataEvent(`${h.C0.ESC}[${U?"":"?"}${pe};${Ue}$y`),!0;var pe,Ue}_updateAttrColor(B,U,W,K,ue){return U===2?(B|=50331648,B&=-16777216,B|=S.AttributeData.fromColorRGB([W,K,ue])):U===5&&(B&=-50331904,B|=33554432|255&W),B}_extractColor(B,U,W){const K=[0,0,-1,0,0,0];let ue=0,ve=0;do{if(K[ve+ue]=B.params[U+ve],B.hasSubParams(U+ve)){const _e=B.getSubParams(U+ve);let Ce=0;do K[1]===5&&(ue=1),K[ve+Ce+1+ue]=_e[Ce];while(++Ce<_e.length&&Ce+ve+1+ue<K.length);break}if(K[1]===5&&ve+ue>=2||K[1]===2&&ve+ue>=5)break;K[1]&&(ue=1)}while(++ve+U<B.length&&ve+ue<K.length);for(let _e=2;_e<K.length;++_e)K[_e]===-1&&(K[_e]=0);switch(K[0]){case 38:W.fg=this._updateAttrColor(W.fg,K[1],K[3],K[4],K[5]);break;case 48:W.bg=this._updateAttrColor(W.bg,K[1],K[3],K[4],K[5]);break;case 58:W.extended=W.extended.clone(),W.extended.underlineColor=this._updateAttrColor(W.extended.underlineColor,K[1],K[3],K[4],K[5])}return ve}_processUnderline(B,U){U.extended=U.extended.clone(),(!~B||B>5)&&(B=1),U.extended.underlineStyle=B,U.fg|=268435456,B===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(B){B.fg=d.DEFAULT_ATTR_DATA.fg,B.bg=d.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=B.length;let W;const K=this._curAttrData;for(let ue=0;ue<U;ue++)W=B.params[ue],W>=30&&W<=37?(K.fg&=-50331904,K.fg|=16777216|W-30):W>=40&&W<=47?(K.bg&=-50331904,K.bg|=16777216|W-40):W>=90&&W<=97?(K.fg&=-50331904,K.fg|=16777224|W-90):W>=100&&W<=107?(K.bg&=-50331904,K.bg|=16777224|W-100):W===0?this._processSGR0(K):W===1?K.fg|=134217728:W===3?K.bg|=67108864:W===4?(K.fg|=268435456,this._processUnderline(B.hasSubParams(ue)?B.getSubParams(ue)[0]:1,K)):W===5?K.fg|=536870912:W===7?K.fg|=67108864:W===8?K.fg|=1073741824:W===9?K.fg|=2147483648:W===2?K.bg|=134217728:W===21?this._processUnderline(2,K):W===22?(K.fg&=-134217729,K.bg&=-134217729):W===23?K.bg&=-67108865:W===24?(K.fg&=-268435457,this._processUnderline(0,K)):W===25?K.fg&=-536870913:W===27?K.fg&=-67108865:W===28?K.fg&=-1073741825:W===29?K.fg&=2147483647:W===39?(K.fg&=-67108864,K.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):W===49?(K.bg&=-67108864,K.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):W===38||W===48||W===58?ue+=this._extractColor(B,ue,K):W===53?K.bg|=1073741824:W===55?K.bg&=-1073741825:W===59?(K.extended=K.extended.clone(),K.extended.underlineColor=-1,K.updateExtended()):W===100?(K.fg&=-67108864,K.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,K.bg&=-67108864,K.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",W);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,W=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${U};${W}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const U=this._activeBuffer.y+1,W=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${U};${W}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(B){const U=B.params[0]||1;switch(U){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const W=U%2==1;return this._optionsService.options.cursorBlink=W,!0}setScrollRegion(B){const U=B.params[0]||1;let W;return(B.length<2||(W=B.params[1])>this._bufferService.rows||W===0)&&(W=this._bufferService.rows),W>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=W-1,this._setCursor(0,0)),!0}windowOptions(B){if(!M(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:U!==0&&U!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),U!==0&&U!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:U!==0&&U!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),U!==0&&U!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(B){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const U=[],W=B.split(";");for(;W.length>1;){const K=W.shift(),ue=W.shift();if(/^\d+$/.exec(K)){const ve=parseInt(K);if(ke(ve))if(ue==="?")U.push({type:0,index:ve});else{const _e=(0,R.parseColor)(ue);_e&&U.push({type:1,index:ve,color:_e})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(B){const U=B.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(B,U){this._getCurrentLinkId()&&this._finishHyperlink();const W=B.split(":");let K;const ue=W.findIndex((ve=>ve.startsWith("id=")));return ue!==-1&&(K=W[ue].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:K,uri:U}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,U){const W=B.split(";");for(let K=0;K<W.length&&!(U>=this._specialColors.length);++K,++U)if(W[K]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const ue=(0,R.parseColor)(W[K]);ue&&this._onColor.fire([{type:1,index:this._specialColors[U],color:ue}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const U=[],W=B.split(";");for(let K=0;K<W.length;++K)if(/^\d+$/.exec(W[K])){const ue=parseInt(W[K]);ke(ue)&&U.push({type:2,index:ue})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(O[B[0]],b.CHARSETS[B[1]]||b.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new g.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const W=this._activeBuffer.ybase+this._activeBuffer.y+U,K=this._activeBuffer.lines.get(W);K&&(K.fill(B),K.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,U){const W=this._bufferService.buffer,K=this._optionsService.rawOptions;return(ue=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${ue}${h.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${W.scrollTop+1};${W.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[K.cursorStyle]-(K.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,U){this._dirtyRowTracker.markRangeDirty(B,U)}}s.InputHandler=ae;let ge=class{constructor(re){this._bufferService=re,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(re){re<this.start?this.start=re:re>this.end&&(this.end=re)}markRangeDirty(re,B){re>B&&(ee=re,re=B,B=ee),re<this.start&&(this.start=re),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ke(re){return 0<=re&&re<256}ge=c([m(0,k.IBufferService)],ge)},844:(l,s)=>{function a(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(m,h,b){this._data[m]||(this._data[m]={}),this._data[m][h]=b}get(m,h){return this._data[m]?this._data[m][h]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,m,h,b,_){this._data.get(c,m)||this._data.set(c,m,new a),this._data.get(c,m).set(h,b,_)}get(c,m,h,b){var _;return(_=this._data.get(c,m))==null?void 0:_.get(h,b)}clear(){this._data.clear()}}},6114:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const a=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const m=a.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const m=this._getKey(c);if(m===void 0||(a=this._search(m),a===-1)||this._getKey(this._array[a])!==m)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===m);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,m){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do m(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let m=0,h=this._array.length-1;for(;h>=m;){let b=m+h>>1;const _=this._getKey(this._array[b]);if(_>c)h=b-1;else{if(!(_<c)){for(;b>0&&this._getKey(this._array[b-1])===c;)b--;return b}m=b+1}}return m}}},7226:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=a(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let C=0,y=0,d=_.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),y=Math.max(C,y),p=_.timeRemaining(),1.5*y>p)return d-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-C))}ms`),void this._start();d=p}this.clear()}}class h extends m{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const C=Date.now()+_;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}s.PriorityTaskQueue=h,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:h,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=a(643);s.updateWindowsModeWrappedState=function(m){const h=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),b=h==null?void 0:h.get(m.cols-1),_=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);_&&b&&(_.isWrapped=b[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&b[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new a;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,b=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=b}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=a(6349),m=a(7226),h=a(3734),b=a(8437),_=a(4634),C=a(511),y=a(643),d=a(4863),p=a(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(f,g,S){this._hasScrollback=f,this._optionsService=g,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,g){return new b.BufferLine(this._bufferService.cols,this.getNullCell(f),g)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const g=f+this._optionsService.rawOptions.scrollback;return g>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:g}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=b.DEFAULT_ATTR_DATA);let g=this._rows;for(;g--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,g){const S=this.getNullCell(b.DEFAULT_ATTR_DATA);let k=0;const I=this._getCorrectBufferLength(g);if(I>this.lines.maxLength&&(this.lines.maxLength=I),this.lines.length>0){if(this._cols<f)for(let E=0;E<this.lines.length;E++)k+=+this.lines.get(E).resize(f,S);let N=0;if(this._rows<g)for(let E=this._rows;E<g;E++)this.lines.length<g+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(f,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+N+1?(this.ybase--,N++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(f,S)));else for(let E=this._rows;E>g;E--)this.lines.length>g+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(I<this.lines.maxLength){const E=this.lines.length-I;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=I}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,g-1),N&&(this.y+=N),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=g-1,this._isReflowEnabled&&(this._reflow(f,g),this._cols>f))for(let N=0;N<this.lines.length;N++)k+=+this.lines.get(N).resize(f,S);this._cols=f,this._rows=g,this._memoryCleanupQueue.clear(),k>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let g=0;for(;this._memoryCleanupPosition<this.lines.length;)if(g+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),g>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,g){this._cols!==f&&(f>this._cols?this._reflowLarger(f,g):this._reflowSmaller(f,g))}_reflowLarger(f,g){const S=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(S.length>0){const k=(0,_.reflowLargerCreateNewLayout)(this.lines,S);(0,_.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(f,g,k.countRemoved)}}_reflowLargerAdjustViewport(f,g,S){const k=this.getNullCell(b.DEFAULT_ATTR_DATA);let I=S;for(;I-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<g&&this.lines.push(new b.BufferLine(f,k))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,g){const S=this.getNullCell(b.DEFAULT_ATTR_DATA),k=[];let I=0;for(let N=this.lines.length-1;N>=0;N--){let E=this.lines.get(N);if(!E||!E.isWrapped&&E.getTrimmedLength()<=f)continue;const R=[E];for(;E.isWrapped&&N>0;)E=this.lines.get(--N),R.unshift(E);const O=this.ybase+this.y;if(O>=N&&O<N+R.length)continue;const V=R[R.length-1].getTrimmedLength(),M=(0,_.reflowSmallerGetNewLineLengths)(R,this._cols,f),D=M.length-R.length;let ee;ee=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const ae=[];for(let W=0;W<D;W++){const K=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);ae.push(K)}ae.length>0&&(k.push({start:N+R.length+I,newLines:ae}),I+=ae.length),R.push(...ae);let ge=M.length-1,ke=M[ge];ke===0&&(ge--,ke=M[ge]);let re=R.length-D-1,B=V;for(;re>=0;){const W=Math.min(B,ke);if(R[ge]===void 0)break;if(R[ge].copyCellsFrom(R[re],B-W,ke-W,W,!0),ke-=W,ke===0&&(ge--,ke=M[ge]),B-=W,B===0){re--;const K=Math.max(re,0);B=(0,_.getWrappedLineTrimmedLength)(R,K,this._cols)}}for(let W=0;W<R.length;W++)M[W]<f&&R[W].setCell(M[W],S);let U=D-ee;for(;U-- >0;)this.ybase===0?this.y<g-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+I)-g&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+g-1)}if(k.length>0){const N=[],E=[];for(let ge=0;ge<this.lines.length;ge++)E.push(this.lines.get(ge));const R=this.lines.length;let O=R-1,V=0,M=k[V];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+I);let D=0;for(let ge=Math.min(this.lines.maxLength-1,R+I-1);ge>=0;ge--)if(M&&M.start>O+D){for(let ke=M.newLines.length-1;ke>=0;ke--)this.lines.set(ge--,M.newLines[ke]);ge++,N.push({index:O+1,amount:M.newLines.length}),D+=M.newLines.length,M=k[++V]}else this.lines.set(ge,E[O--]);let ee=0;for(let ge=N.length-1;ge>=0;ge--)N[ge].index+=ee,this.lines.onInsertEmitter.fire(N[ge]),ee+=N[ge].amount;const ae=Math.max(0,R+I-this.lines.maxLength);ae>0&&this.lines.onTrimEmitter.fire(ae)}}translateBufferLineToString(f,g,S=0,k){const I=this.lines.get(f);return I?I.translateToString(g,S,k):""}getWrappedRangeForLine(f){let g=f,S=f;for(;g>0&&this.lines.get(g).isWrapped;)g--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:g,last:S}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].line===f&&(this.markers[g].dispose(),this.markers.splice(g--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const g=new d.Marker(f);return this.markers.push(g),g.register(this.lines.onTrim((S=>{g.line-=S,g.line<0&&g.dispose()}))),g.register(this.lines.onInsert((S=>{g.line>=S.index&&(g.line+=S.amount)}))),g.register(this.lines.onDelete((S=>{g.line>=S.index&&g.line<S.index+S.amount&&g.dispose(),g.line>S.index&&(g.line-=S.amount)}))),g.register(g.onDispose((()=>this._removeMarker(g)))),g}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=a(3734),m=a(511),h=a(643),b=a(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class C{constructor(d,p,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const g=p||m.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let S=0;S<d;++S)this.setCell(S,g);this.length=d}get(d){const p=this._data[3*d+0],f=2097151&p;return[this._data[3*d+1],2097152&p?this._combined[d]:f?(0,b.stringFromCodePoint)(f):"",p>>22,2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):f]}set(d,p){this._data[3*d+1]=p[h.CHAR_DATA_ATTR_INDEX],p[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=p[1],this._data[3*d+0]=2097152|d|p[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=p[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&p}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const p=this._data[3*d+0];return 2097152&p?this._combined[d]:2097151&p?(0,b.stringFromCodePoint)(2097151&p):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,p){return _=3*d,p.content=this._data[_+0],p.fg=this._data[_+1],p.bg=this._data[_+2],2097152&p.content&&(p.combinedData=this._combined[d]),268435456&p.bg&&(p.extended=this._extendedAttrs[d]),p}setCell(d,p){2097152&p.content&&(this._combined[d]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[d]=p.extended),this._data[3*d+0]=p.content,this._data[3*d+1]=p.fg,this._data[3*d+2]=p.bg}setCellFromCodepoint(d,p,f,g){268435456&g.bg&&(this._extendedAttrs[d]=g.extended),this._data[3*d+0]=p|f<<22,this._data[3*d+1]=g.fg,this._data[3*d+2]=g.bg}addCodepointToCell(d,p,f){let g=this._data[3*d+0];2097152&g?this._combined[d]+=(0,b.stringFromCodePoint)(p):2097151&g?(this._combined[d]=(0,b.stringFromCodePoint)(2097151&g)+(0,b.stringFromCodePoint)(p),g&=-2097152,g|=2097152):g=p|4194304,f&&(g&=-12582913,g|=f<<22),this._data[3*d+0]=g}insertCells(d,p,f){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length-d){const g=new m.CellData;for(let S=this.length-d-p-1;S>=0;--S)this.setCell(d+p+S,this.loadCell(d+S,g));for(let S=0;S<p;++S)this.setCell(d+S,f)}else for(let g=d;g<this.length;++g)this.setCell(g,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(d,p,f){if(d%=this.length,p<this.length-d){const g=new m.CellData;for(let S=0;S<this.length-d-p;++S)this.setCell(d+S,this.loadCell(d+p+S,g));for(let S=this.length-p;S<this.length;++S)this.setCell(S,f)}else for(let g=d;g<this.length;++g)this.setCell(g,f);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,f)}replaceCells(d,p,f,g=!1){if(g)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,f);d<p&&d<this.length;)this.isProtected(d)||this.setCell(d,f),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,f);d<p&&d<this.length;)this.setCell(d++,f)}resize(d,p){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const g=new Uint32Array(f);g.set(this._data),this._data=g}for(let g=this.length;g<d;++g)this.setCell(g,p)}else{this._data=this._data.subarray(0,f);const g=Object.keys(this._combined);for(let k=0;k<g.length;k++){const I=parseInt(g[k],10);I>=d&&delete this._combined[I]}const S=Object.keys(this._extendedAttrs);for(let k=0;k<S.length;k++){const I=parseInt(S[k],10);I>=d&&delete this._extendedAttrs[I]}}return this.length=d,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,p=!1){if(p)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,d);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const p in d._combined)this._combined[p]=d._combined[p];this._extendedAttrs={};for(const p in d._extendedAttrs)this._extendedAttrs[p]=d._extendedAttrs[p];this.isWrapped=d.isWrapped}clone(){const d=new C(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const p in this._combined)d._combined[p]=this._combined[p];for(const p in this._extendedAttrs)d._extendedAttrs[p]=this._extendedAttrs[p];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,p,f,g,S){const k=d._data;if(S)for(let N=g-1;N>=0;N--){for(let E=0;E<3;E++)this._data[3*(f+N)+E]=k[3*(p+N)+E];268435456&k[3*(p+N)+2]&&(this._extendedAttrs[f+N]=d._extendedAttrs[p+N])}else for(let N=0;N<g;N++){for(let E=0;E<3;E++)this._data[3*(f+N)+E]=k[3*(p+N)+E];268435456&k[3*(p+N)+2]&&(this._extendedAttrs[f+N]=d._extendedAttrs[p+N])}const I=Object.keys(d._combined);for(let N=0;N<I.length;N++){const E=parseInt(I[N],10);E>=p&&(this._combined[E-p+f]=d._combined[E])}}translateToString(d,p,f,g){p=p??0,f=f??this.length,d&&(f=Math.min(f,this.getTrimmedLength())),g&&(g.length=0);let S="";for(;p<f;){const k=this._data[3*p+0],I=2097151&k,N=2097152&k?this._combined[p]:I?(0,b.stringFromCodePoint)(I):h.WHITESPACE_CELL_CHAR;if(S+=N,g)for(let E=0;E<N.length;++E)g.push(p);p+=k>>22||1}return g&&g.push(p),S}}s.BufferLine=C},4841:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(l,s)=>{function a(c,m,h){if(m===c.length-1)return c[m].getTrimmedLength();const b=!c[m].hasContent(h-1)&&c[m].getWidth(h-1)===1,_=c[m+1].getWidth(0)===2;return b&&_?h-1:h}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,m,h,b,_){const C=[];for(let y=0;y<c.length-1;y++){let d=y,p=c.get(++d);if(!p.isWrapped)continue;const f=[c.get(y)];for(;d<c.length&&p.isWrapped;)f.push(p),p=c.get(++d);if(b>=y&&b<d){y+=f.length-1;continue}let g=0,S=a(f,g,m),k=1,I=0;for(;k<f.length;){const E=a(f,k,m),R=E-I,O=h-S,V=Math.min(R,O);f[g].copyCellsFrom(f[k],I,S,V,!1),S+=V,S===h&&(g++,S=0),I+=V,I===E&&(k++,I=0),S===0&&g!==0&&f[g-1].getWidth(h-1)===2&&(f[g].copyCellsFrom(f[g-1],h-1,S++,1,!1),f[g-1].setCell(h-1,_))}f[g].replaceCells(S,h,_);let N=0;for(let E=f.length-1;E>0&&(E>g||f[E].getTrimmedLength()===0);E--)N++;N>0&&(C.push(y+f.length-N),C.push(N)),y+=f.length-1}return C},s.reflowLargerCreateNewLayout=function(c,m){const h=[];let b=0,_=m[b],C=0;for(let y=0;y<c.length;y++)if(_===y){const d=m[++b];c.onDeleteEmitter.fire({index:y-C,amount:d}),y+=d-1,C+=d,_=m[++b]}else h.push(y);return{layout:h,countRemoved:C}},s.reflowLargerApplyNewLayout=function(c,m){const h=[];for(let b=0;b<m.length;b++)h.push(c.get(m[b]));for(let b=0;b<h.length;b++)c.set(b,h[b]);c.length=m.length},s.reflowSmallerGetNewLineLengths=function(c,m,h){const b=[],_=c.map(((p,f)=>a(c,f,m))).reduce(((p,f)=>p+f));let C=0,y=0,d=0;for(;d<_;){if(_-d<h){b.push(_-d);break}C+=h;const p=a(c,y,m);C>p&&(C-=p,y++);const f=c[y].getWidth(C-1)===2;f&&C--;const g=f?h-1:h;b.push(g),d+=g}return b},s.getWrappedLineTrimmedLength=a},5295:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=a(8460),m=a(844),h=a(9092);class b extends m.Disposable{constructor(C,y){super(),this._optionsService=C,this._bufferService=y,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,y){this._normal.resize(C,y),this._alt.resize(C,y),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}s.BufferSet=b},511:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=a(482),m=a(643),h=a(3734);class b extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const y=new b;return y.setFromCharData(C),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(C[m.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(C[m.CHAR_DATA_CHAR_INDEX].length===2){const d=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const p=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(d-55296)+p-56320+65536|C[m.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[m.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=C[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=b},643:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=a(8460),m=a(844);class h{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}s.Marker=h,h._nextId=1},7116:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,s)=>{var a,c,m;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
170
+ `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(a||(s.C0=a={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(c||(s.C1=c={})),(function(h){h.ST=`${a.ESC}\\`})(m||(s.C1_ESCAPED=m={}))},7399:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=a(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(h,b,_,C){const y={type:0,cancel:!1,key:void 0},d=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?y.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?y.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?y.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(y.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:y.key=h.ctrlKey?"\b":c.C0.DEL,h.altKey&&(y.key=c.C0.ESC+y.key);break;case 9:if(h.shiftKey){y.key=c.C0.ESC+"[Z";break}y.key=c.C0.HT,y.cancel=!0;break;case 13:y.key=h.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,y.cancel=!0;break;case 27:y.key=c.C0.ESC,h.altKey&&(y.key=c.C0.ESC+c.C0.ESC),y.cancel=!0;break;case 37:if(h.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"D",y.key===c.C0.ESC+"[1;3D"&&(y.key=c.C0.ESC+(_?"b":"[1;5D"))):y.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(h.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"C",y.key===c.C0.ESC+"[1;3C"&&(y.key=c.C0.ESC+(_?"f":"[1;5C"))):y.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(h.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"A",_||y.key!==c.C0.ESC+"[1;3A"||(y.key=c.C0.ESC+"[1;5A")):y.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(h.metaKey)break;d?(y.key=c.C0.ESC+"[1;"+(d+1)+"B",_||y.key!==c.C0.ESC+"[1;3B"||(y.key=c.C0.ESC+"[1;5B")):y.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(y.key=c.C0.ESC+"[2~");break;case 46:y.key=d?c.C0.ESC+"[3;"+(d+1)+"~":c.C0.ESC+"[3~";break;case 36:y.key=d?c.C0.ESC+"[1;"+(d+1)+"H":b?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:y.key=d?c.C0.ESC+"[1;"+(d+1)+"F":b?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:h.shiftKey?y.type=2:h.ctrlKey?y.key=c.C0.ESC+"[5;"+(d+1)+"~":y.key=c.C0.ESC+"[5~";break;case 34:h.shiftKey?y.type=3:h.ctrlKey?y.key=c.C0.ESC+"[6;"+(d+1)+"~":y.key=c.C0.ESC+"[6~";break;case 112:y.key=d?c.C0.ESC+"[1;"+(d+1)+"P":c.C0.ESC+"OP";break;case 113:y.key=d?c.C0.ESC+"[1;"+(d+1)+"Q":c.C0.ESC+"OQ";break;case 114:y.key=d?c.C0.ESC+"[1;"+(d+1)+"R":c.C0.ESC+"OR";break;case 115:y.key=d?c.C0.ESC+"[1;"+(d+1)+"S":c.C0.ESC+"OS";break;case 116:y.key=d?c.C0.ESC+"[15;"+(d+1)+"~":c.C0.ESC+"[15~";break;case 117:y.key=d?c.C0.ESC+"[17;"+(d+1)+"~":c.C0.ESC+"[17~";break;case 118:y.key=d?c.C0.ESC+"[18;"+(d+1)+"~":c.C0.ESC+"[18~";break;case 119:y.key=d?c.C0.ESC+"[19;"+(d+1)+"~":c.C0.ESC+"[19~";break;case 120:y.key=d?c.C0.ESC+"[20;"+(d+1)+"~":c.C0.ESC+"[20~";break;case 121:y.key=d?c.C0.ESC+"[21;"+(d+1)+"~":c.C0.ESC+"[21~";break;case 122:y.key=d?c.C0.ESC+"[23;"+(d+1)+"~":c.C0.ESC+"[23~";break;case 123:y.key=d?c.C0.ESC+"[24;"+(d+1)+"~":c.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(_&&!C||!h.altKey||h.metaKey)!_||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?y.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(y.key=c.C0.US),h.key==="@"&&(y.key=c.C0.NUL)):h.keyCode===65&&(y.type=1);else{const p=m[h.keyCode],f=p==null?void 0:p[h.shiftKey?1:0];if(f)y.key=c.C0.ESC+f;else if(h.keyCode>=65&&h.keyCode<=90){const g=h.ctrlKey?h.keyCode-64:h.keyCode+32;let S=String.fromCharCode(g);h.shiftKey&&(S=S.toUpperCase()),y.key=c.C0.ESC+S}else if(h.keyCode===32)y.key=c.C0.ESC+(h.ctrlKey?c.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let g=h.code.slice(3,4);h.shiftKey||(g=g.toLowerCase()),y.key=c.C0.ESC+g,y.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?y.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?y.key=c.C0.NUL:h.keyCode>=51&&h.keyCode<=55?y.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?y.key=c.C0.DEL:h.keyCode===219?y.key=c.C0.ESC:h.keyCode===220?y.key=c.C0.FS:h.keyCode===221&&(y.key=c.C0.GS)}return y}},482:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,c=0,m=a.length){let h="";for(let b=c;b<m;++b){let _=a[b];_>65535?(_-=65536,h+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):h+=String.fromCharCode(_)}return h},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const m=a.length;if(!m)return 0;let h=0,b=0;if(this._interim){const _=a.charCodeAt(b++);56320<=_&&_<=57343?c[h++]=1024*(this._interim-55296)+_-56320+65536:(c[h++]=this._interim,c[h++]=_),this._interim=0}for(let _=b;_<m;++_){const C=a.charCodeAt(_);if(55296<=C&&C<=56319){if(++_>=m)return this._interim=C,h;const y=a.charCodeAt(_);56320<=y&&y<=57343?c[h++]=1024*(C-55296)+y-56320+65536:(c[h++]=C,c[h++]=y)}else C!==65279&&(c[h++]=C)}return h}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const m=a.length;if(!m)return 0;let h,b,_,C,y=0,d=0,p=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let I,N=0;for(;(I=63&this.interim[++N])&&N<4;)k<<=6,k|=I;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=E-N;for(;p<R;){if(p>=m)return 0;if(I=a[p++],(192&I)!=128){p--,S=!0;break}this.interim[N++]=I,k<<=6,k|=63&I}S||(E===2?k<128?p--:c[y++]=k:E===3?k<2048||k>=55296&&k<=57343||k===65279||(c[y++]=k):k<65536||k>1114111||(c[y++]=k)),this.interim.fill(0)}const f=m-4;let g=p;for(;g<m;){for(;!(!(g<f)||128&(h=a[g])||128&(b=a[g+1])||128&(_=a[g+2])||128&(C=a[g+3]));)c[y++]=h,c[y++]=b,c[y++]=_,c[y++]=C,g+=4;if(h=a[g++],h<128)c[y++]=h;else if((224&h)==192){if(g>=m)return this.interim[0]=h,y;if(b=a[g++],(192&b)!=128){g--;continue}if(d=(31&h)<<6|63&b,d<128){g--;continue}c[y++]=d}else if((240&h)==224){if(g>=m)return this.interim[0]=h,y;if(b=a[g++],(192&b)!=128){g--;continue}if(g>=m)return this.interim[0]=h,this.interim[1]=b,y;if(_=a[g++],(192&_)!=128){g--;continue}if(d=(15&h)<<12|(63&b)<<6|63&_,d<2048||d>=55296&&d<=57343||d===65279)continue;c[y++]=d}else if((248&h)==240){if(g>=m)return this.interim[0]=h,y;if(b=a[g++],(192&b)!=128){g--;continue}if(g>=m)return this.interim[0]=h,this.interim[1]=b,y;if(_=a[g++],(192&_)!=128){g--;continue}if(g>=m)return this.interim[0]=h,this.interim[1]=b,this.interim[2]=_,y;if(C=a[g++],(192&C)!=128){g--;continue}if(d=(7&h)<<18|(63&b)<<12|(63&_)<<6|63&C,d<65536||d>1114111)continue;c[y++]=d}}return y}}},225:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;s.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let _=0;_<m.length;++_)b.fill(0,m[_][0],m[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?b[_]:(function(C,y){let d,p=0,f=y.length-1;if(C<y[0][0]||C>y[f][1])return!1;for(;f>=p;)if(d=p+f>>1,C>y[d][1])p=d+1;else{if(!(C<y[d][0]))return!0;f=d-1}return!1})(_,h)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,C){let y=this.wcwidth(_),d=y===0&&C!==0;if(d){const p=c.UnicodeService.extractWidth(C);p===0?d=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,d)}}},5981:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=a(8460),m=a(844);class h extends m.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C)}_innerWrite(_=0,C=!0){const y=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],p=this._action(d,C);if(p){const g=S=>Date.now()-y>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(y,S);return void p.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(g)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=h},5941:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function m(h,b){const _=h.toString(16),C=_.length<2?"0"+_:_;switch(b){case 4:return _[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}s.parseColor=function(h){if(!h)return;let b=h.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const _=a.exec(b);if(_){const C=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/C*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/C*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/C*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),c.exec(b)&&[3,6,9,12].includes(b.length))){const _=b.length/3,C=[0,0,0];for(let y=0;y<3;++y){const d=parseInt(b.slice(_*y,_*y+_),16);C[y]=_===1?d<<4:_===2?d:_===3?d>>4:d>>8}return C}},s.toRgbString=function(h,b=16){const[_,C,y]=h;return`rgb:${m(_,b)}/${m(C,b)}/${m(y,b)}`}},5770:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=a(482),m=a(8742),h=a(5770),b=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(C,y){this._handlers[C]===void 0&&(this._handlers[C]=[]);const d=this._handlers[C];return d.push(y),{dispose:()=>{const p=d.indexOf(y);p!==-1&&d.splice(p,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(C,y){if(this.reset(),this._ident=C,this._active=this._handlers[C]||b,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(C,y,d){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(C,y,d);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(C,y,d))}unhook(C,y=!0){if(this._active.length){let d=!1,p=this._active.length-1,f=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,d=y,f=this._stack.fallThrough,this._stack.paused=!1),!f&&d===!1){for(;p>=0&&(d=this._active[p].unhook(C),d!==!0);p--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,d;p--}for(;p>=0;p--)if(d=this._active[p].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",C);this._active=b,this._ident=0}};const _=new m.Params;_.addParam(0),s.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=_,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():_,this._data="",this._hitLimit=!1}put(C,y,d){this._hitLimit||(this._data+=(0,c.utf32ToString)(C,y,d),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let y=!1;if(this._hitLimit)y=!1;else if(C&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then((d=>(this._params=_,this._data="",this._hitLimit=!1,d)));return this._params=_,this._data="",this._hitLimit=!1,y}}},2015:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=a(844),m=a(8742),h=a(6242),b=a(6351);class _{constructor(p){this.table=new Uint8Array(p)}setDefault(p,f){this.table.fill(p<<4|f)}add(p,f,g,S){this.table[f<<8|p]=g<<4|S}addMany(p,f,g,S){for(let k=0;k<p.length;k++)this.table[f<<8|p[k]]=g<<4|S}}s.TransitionTable=_;const C=160;s.VT500_TRANSITION_TABLE=(function(){const d=new _(4095),p=Array.apply(null,Array(256)).map(((N,E)=>E)),f=(N,E)=>p.slice(N,E),g=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const k=f(0,14);let I;for(I in d.setDefault(1,0),d.addMany(g,0,2,0),k)d.addMany([24,26,153,154],I,3,0),d.addMany(f(128,144),I,3,0),d.addMany(f(144,152),I,3,0),d.add(156,I,0,0),d.add(27,I,11,1),d.add(157,I,4,8),d.addMany([152,158,159],I,0,7),d.add(155,I,11,3),d.add(144,I,11,9);return d.addMany(S,0,3,0),d.addMany(S,1,3,1),d.add(127,1,0,1),d.addMany(S,8,0,8),d.addMany(S,3,3,3),d.add(127,3,0,3),d.addMany(S,4,3,4),d.add(127,4,0,4),d.addMany(S,6,3,6),d.addMany(S,5,3,5),d.add(127,5,0,5),d.addMany(S,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(g,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(f(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(g,7,0,7),d.addMany(S,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(f(64,127),3,7,0),d.addMany(f(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(f(48,60),4,8,4),d.addMany(f(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(f(32,64),6,0,6),d.add(127,6,0,6),d.addMany(f(64,127),6,0,0),d.addMany(f(32,48),3,9,5),d.addMany(f(32,48),5,9,5),d.addMany(f(48,64),5,0,6),d.addMany(f(64,127),5,7,0),d.addMany(f(32,48),4,9,5),d.addMany(f(32,48),1,9,2),d.addMany(f(32,48),2,9,2),d.addMany(f(48,127),2,10,0),d.addMany(f(48,80),1,10,0),d.addMany(f(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(f(96,127),1,10,0),d.add(80,1,11,9),d.addMany(S,9,0,9),d.add(127,9,0,9),d.addMany(f(28,32),9,0,9),d.addMany(f(32,48),9,9,12),d.addMany(f(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(S,11,0,11),d.addMany(f(32,128),11,0,11),d.addMany(f(28,32),11,0,11),d.addMany(S,10,0,10),d.add(127,10,0,10),d.addMany(f(28,32),10,0,10),d.addMany(f(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(f(32,48),10,9,12),d.addMany(S,12,0,12),d.add(127,12,0,12),d.addMany(f(28,32),12,0,12),d.addMany(f(32,48),12,9,12),d.addMany(f(48,64),12,0,11),d.addMany(f(64,127),12,12,13),d.addMany(f(64,127),10,12,13),d.addMany(f(64,127),9,12,13),d.addMany(S,13,13,13),d.addMany(g,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(C,0,2,0),d.add(C,8,5,8),d.add(C,6,0,6),d.add(C,11,0,11),d.add(C,13,13,13),d})();class y extends c.Disposable{constructor(p=s.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,g,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,g)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(p,f=[64,126]){let g=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(g=p.prefix.charCodeAt(0),g&&60>g||g>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;k<p.intermediates.length;++k){const I=p.intermediates.charCodeAt(k);if(32>I||I>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");g<<=8,g|=I}}if(p.final.length!==1)throw new Error("final must be a single byte");const S=p.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return g<<=8,g|=S,g}identToString(p){const f=[];for(;p;)f.push(String.fromCharCode(255&p)),p>>=8;return f.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,f){const g=this._identifier(p,[48,126]);this._escHandlers[g]===void 0&&(this._escHandlers[g]=[]);const S=this._escHandlers[g];return S.push(f),{dispose:()=>{const k=S.indexOf(f);k!==-1&&S.splice(k,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,f){this._executeHandlers[p.charCodeAt(0)]=f}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,f){const g=this._identifier(p);this._csiHandlers[g]===void 0&&(this._csiHandlers[g]=[]);const S=this._csiHandlers[g];return S.push(f),{dispose:()=>{const k=S.indexOf(f);k!==-1&&S.splice(k,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,f){return this._dcsParser.registerHandler(this._identifier(p),f)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,f){return this._oscParser.registerHandler(p,f)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(p,f,g,S,k){this._parseStack.state=p,this._parseStack.handlers=f,this._parseStack.handlerPos=g,this._parseStack.transition=S,this._parseStack.chunkPos=k}parse(p,f,g){let S,k=0,I=0,N=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,N=this._parseStack.chunkPos+1;else{if(g===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(g===!1&&R>-1){for(;R>=0&&(S=E[R](this._params),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 4:if(g===!1&&R>-1){for(;R>=0&&(S=E[R](),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 6:if(k=p[this._parseStack.chunkPos],S=this._dcsParser.unhook(k!==24&&k!==26,g),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=p[this._parseStack.chunkPos],S=this._oscParser.end(k!==24&&k!==26,g),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,N=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=N;E<f;++E){switch(k=p[E],I=this._transitions.table[this.currentState<<8|(k<160?k:C)],I>>4){case 2:for(let D=E+1;;++D){if(D>=f||(k=p[D])<32||k>126&&k<C){this._printHandler(p,E,D),E=D-1;break}if(++D>=f||(k=p[D])<32||k>126&&k<C){this._printHandler(p,E,D),E=D-1;break}if(++D>=f||(k=p[D])<32||k>126&&k<C){this._printHandler(p,E,D),E=D-1;break}if(++D>=f||(k=p[D])<32||k>126&&k<C){this._printHandler(p,E,D),E=D-1;break}}break;case 3:this._executeHandlers[k]?this._executeHandlers[k]():this._executeHandlerFb(k),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:k,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|k];let O=R?R.length-1:-1;for(;O>=0&&(S=R[O](this._params),S!==!0);O--)if(S instanceof Promise)return this._preserveStack(3,R,O,I,E),S;O<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingJoinState=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++E<f&&(k=p[E])>47&&k<60);E--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const V=this._escHandlers[this._collect<<8|k];let M=V?V.length-1:-1;for(;M>=0&&(S=V[M](),S!==!0);M--)if(S instanceof Promise)return this._preserveStack(4,V,M,I,E),S;M<0&&this._escHandlerFb(this._collect<<8|k),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|k,this._params);break;case 13:for(let D=E+1;;++D)if(D>=f||(k=p[D])===24||k===26||k===27||k>127&&k<C){this._dcsParser.put(p,E,D),E=D-1;break}break;case 14:if(S=this._dcsParser.unhook(k!==24&&k!==26),S)return this._preserveStack(6,[],0,I,E),S;k===27&&(I|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let D=E+1;;D++)if(D>=f||(k=p[D])<32||k>127&&k<C){this._oscParser.put(p,E,D),E=D-1;break}break;case 6:if(S=this._oscParser.end(k!==24&&k!==26),S)return this._preserveStack(5,[],0,I,E),S;k===27&&(I|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&I}}}s.EscapeSequenceParser=y},6242:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=a(5770),m=a(482),h=[];s.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,_){this._handlers[b]===void 0&&(this._handlers[b]=[]);const C=this._handlers[b];return C.push(_),{dispose:()=>{const y=C.indexOf(_);y!==-1&&C.splice(y,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,_,C){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(b,_,C);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(b,_,C))}start(){this.reset(),this._state=1}put(b,_,C){if(this._state!==3){if(this._state===1)for(;_<C;){const y=b[_++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&C-_>0&&this._put(b,_,C)}}end(b,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,y=this._active.length-1,d=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,C=_,d=this._stack.fallThrough,this._stack.paused=!1),!d&&C===!1){for(;y>=0&&(C=this._active[y].end(b),C!==!0);y--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,C;y--}for(;y>=0;y--)if(C=this._active[y].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",b);this._active=h,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,_,C){this._hitLimit||(this._data+=(0,m.utf32ToString)(b,_,C),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let _=!1;if(this._hitLimit)_=!1;else if(b&&(_=this._handler(this._data),_ instanceof Promise))return _.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,_}}},8742:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class c{static fromArray(h){const b=new c;if(!h.length)return b;for(let _=Array.isArray(h[0])?1:0;_<h.length;++_){const C=h[_];if(Array.isArray(C))for(let y=0;y<C.length;++y)b.addSubParam(C[y]);else b.addParam(C)}return b}constructor(h=32,b=32){if(this.maxLength=h,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new c(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let b=0;b<this.length;++b){h.push(this.params[b]);const _=this._subParamsIdx[b]>>8,C=255&this._subParamsIdx[b];C-_>0&&h.push(Array.prototype.slice.call(this._subParams,_,C))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>a?a:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>a?a:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const b=this._subParamsIdx[h]>>8,_=255&this._subParamsIdx[h];return _-b>0?this._subParams.subarray(b,_):null}getSubParamsAll(){const h={};for(let b=0;b<this.length;++b){const _=this._subParamsIdx[b]>>8,C=255&this._subParamsIdx[b];C-_>0&&(h[b]=this._subParams.slice(_,C))}return h}addDigit(h){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,C=_[b-1];_[b-1]=~C?Math.min(10*C+h,a):h}}s.Params=c},5741:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const m={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(m),c.dispose=()=>this._wrappedAddonDispose(m),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===a){c=m;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=a(3785),m=a(511);s.BufferApiView=class{constructor(h,b){this._buffer=h,this.type=b}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const b=this._buffer.lines.get(h);if(b)return new c.BufferLineApiView(b)}getNullCell(){return new m.CellData}}},3785:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=a(511);s.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,h){if(!(m<0||m>=this._line.length))return h?(this._line.loadCell(m,h),h):this._line.loadCell(m,new c.CellData)}translateToString(m,h,b){return this._line.translateToString(m,h,b)}}},8285:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=a(8771),m=a(8460),h=a(844);class b extends h.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=b},7975:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,(m=>c(m.toArray())))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,((m,h)=>c(m,h.toArray())))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(l,s,a){var c=this&&this.__decorate||function(d,p,f,g){var S,k=arguments.length,I=k<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(d,p,f,g);else for(var N=d.length-1;N>=0;N--)(S=d[N])&&(I=(k<3?S(I):k>3?S(p,f,I):S(p,f))||I);return k>3&&I&&Object.defineProperty(p,f,I),I},m=this&&this.__param||function(d,p){return function(f,g){p(f,g,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const h=a(8460),b=a(844),_=a(5295),C=a(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let y=s.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(d,this))}resize(d,p){this.cols=d,this.rows=p,this.buffers.resize(d,p),this._onResize.fire({cols:d,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,p=!1){const f=this.buffer;let g;g=this._cachedBlankLine,g&&g.length===this.cols&&g.getFg(0)===d.fg&&g.getBg(0)===d.bg||(g=f.getBlankLine(d,p),this._cachedBlankLine=g),g.isWrapped=p;const S=f.ybase+f.scrollTop,k=f.ybase+f.scrollBottom;if(f.scrollTop===0){const I=f.lines.isFull;k===f.lines.length-1?I?f.lines.recycle().copyFrom(g):f.lines.push(g.clone()):f.lines.splice(k+1,0,g.clone()),I?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const I=k-S+1;f.lines.shiftElements(S+1,I-1,-1),f.lines.set(k,g.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(d,p,f){const g=this.buffer;if(d<0){if(g.ydisp===0)return;this.isUserScrolling=!0}else d+g.ydisp>=g.ybase&&(this.isUserScrolling=!1);const S=g.ydisp;g.ydisp=Math.max(Math.min(g.ydisp+d,g.ybase),0),S!==g.ydisp&&(p||this._onScroll.fire(g.ydisp))}};s.BufferService=y=c([m(0,C.IOptionsService)],y)},7994:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(l,s,a){var c=this&&this.__decorate||function(g,S,k,I){var N,E=arguments.length,R=E<3?S:I===null?I=Object.getOwnPropertyDescriptor(S,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,S,k,I);else for(var O=g.length-1;O>=0;O--)(N=g[O])&&(R=(E<3?N(R):E>3?N(S,k,R):N(S,k))||R);return E>3&&R&&Object.defineProperty(S,k,R),R},m=this&&this.__param||function(g,S){return function(k,I){S(k,I,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const h=a(2585),b=a(8460),_=a(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:g=>g.button!==4&&g.action===1&&(g.ctrl=!1,g.alt=!1,g.shift=!1,!0)},VT200:{events:19,restrict:g=>g.action!==32},DRAG:{events:23,restrict:g=>g.action!==32||g.button!==3},ANY:{events:31,restrict:g=>!0}};function y(g,S){let k=(g.ctrl?16:0)|(g.shift?4:0)|(g.alt?8:0);return g.button===4?(k|=64,k|=g.action):(k|=3&g.button,4&g.button&&(k|=64),8&g.button&&(k|=128),g.action===32?k|=32:g.action!==0||S||(k|=3)),k}const d=String.fromCharCode,p={DEFAULT:g=>{const S=[y(g,!1)+32,g.col+32,g.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${d(S[0])}${d(S[1])}${d(S[2])}`},SGR:g=>{const S=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${y(g,!0)};${g.col};${g.row}${S}`},SGR_PIXELS:g=>{const S=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${y(g,!0)};${g.x};${g.y}${S}`}};let f=s.CoreMouseService=class extends _.Disposable{constructor(g,S){super(),this._bufferService=g,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const k of Object.keys(C))this.addProtocol(k,C[k]);for(const k of Object.keys(p))this.addEncoding(k,p[k]);this.reset()}addProtocol(g,S){this._protocols[g]=S}addEncoding(g,S){this._encodings[g]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(g){if(!this._protocols[g])throw new Error(`unknown protocol "${g}"`);this._activeProtocol=g,this._onProtocolChange.fire(this._protocols[g].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(g){if(!this._encodings[g])throw new Error(`unknown encoding "${g}"`);this._activeEncoding=g}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(g){if(g.col<0||g.col>=this._bufferService.cols||g.row<0||g.row>=this._bufferService.rows||g.button===4&&g.action===32||g.button===3&&g.action!==32||g.button!==4&&(g.action===2||g.action===3)||(g.col++,g.row++,g.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,g,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(g))return!1;const S=this._encodings[this._activeEncoding](g);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=g,!0}explainEvents(g){return{down:!!(1&g),up:!!(2&g),drag:!!(4&g),move:!!(8&g),wheel:!!(16&g)}}_equalEvents(g,S,k){if(k){if(g.x!==S.x||g.y!==S.y)return!1}else if(g.col!==S.col||g.row!==S.row)return!1;return g.button===S.button&&g.action===S.action&&g.ctrl===S.ctrl&&g.alt===S.alt&&g.shift===S.shift}};s.CoreMouseService=f=c([m(0,h.IBufferService),m(1,h.ICoreService)],f)},6975:function(l,s,a){var c=this&&this.__decorate||function(f,g,S,k){var I,N=arguments.length,E=N<3?g:k===null?k=Object.getOwnPropertyDescriptor(g,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,g,S,k);else for(var R=f.length-1;R>=0;R--)(I=f[R])&&(E=(N<3?I(E):N>3?I(g,S,E):I(g,S))||E);return N>3&&E&&Object.defineProperty(g,S,E),E},m=this&&this.__param||function(f,g){return function(S,k){g(S,k,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const h=a(1439),b=a(8460),_=a(844),C=a(2585),y=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=s.CoreService=class extends _.Disposable{constructor(f,g,S){super(),this._bufferService=f,this._logService=g,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(y),this.decPrivateModes=(0,h.clone)(d)}reset(){this.modes=(0,h.clone)(y),this.decPrivateModes=(0,h.clone)(d)}triggerDataEvent(f,g=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;g&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),g&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((k=>k.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((g=>g.charCodeAt(0))))),this._onBinary.fire(f))}};s.CoreService=p=c([m(0,C.IBufferService),m(1,C.ILogService),m(2,C.IOptionsService)],p)},9074:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=a(8055),m=a(8460),h=a(844),b=a(6106);let _=0,C=0;class y extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((f=>f==null?void 0:f.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const g=new d(f);if(g){const S=g.marker.onDispose((()=>g.dispose()));g.onDispose((()=>{g&&(this._decorations.delete(g)&&this._onDecorationRemoved.fire(g),S.dispose())})),this._decorations.insert(g),this._onDecorationRegistered.fire(g)}return g}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,g,S){let k=0,I=0;for(const N of this._decorations.getKeyIterator(g))k=N.options.x??0,I=k+(N.options.width??1),f>=k&&f<I&&(!S||(N.options.layer??"bottom")===S)&&(yield N)}forEachDecorationAtCell(f,g,S,k){this._decorations.forEachByKey(g,(I=>{_=I.options.x??0,C=_+(I.options.width??1),f>=_&&f<C&&(!S||(I.options.layer??"bottom")===S)&&k(I)}))}}s.DecorationService=y;class d extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=a(2585),m=a(8343);class h{constructor(..._){this._entries=new Map;for(const[C,y]of _)this.set(C,y)}set(_,C){const y=this._entries.get(_);return this._entries.set(_,C),y}forEach(_){for(const[C,y]of this._entries.entries())_(C,y)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}s.ServiceCollection=h,s.InstantiationService=class{constructor(){this._services=new h,this._services.set(c.IInstantiationService,this)}setService(b,_){this._services.set(b,_)}getService(b){return this._services.get(b)}createInstance(b,..._){const C=(0,m.getServiceDependencies)(b).sort(((p,f)=>p.index-f.index)),y=[];for(const p of C){const f=this._services.get(p.id);if(!f)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${p.id}.`);y.push(f)}const d=C.length>0?C[0].index:_.length;if(_.length!==d)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${d+1} conflicts with ${_.length} static arguments`);return new b(..._,...y)}}},7866:function(l,s,a){var c=this&&this.__decorate||function(d,p,f,g){var S,k=arguments.length,I=k<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(d,p,f,g);else for(var N=d.length-1;N>=0;N--)(S=d[N])&&(I=(k<3?S(I):k>3?S(p,f,I):S(p,f))||I);return k>3&&I&&Object.defineProperty(p,f,I),I},m=this&&this.__param||function(d,p){return function(f,g){p(f,g,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const h=a(844),b=a(2585),_={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let C,y=s.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let p=0;p<d.length;p++)typeof d[p]=="function"&&(d[p]=d[p]())}_log(d,p,f){this._evalLazyOptionalParams(f),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...f)}trace(d,...p){var f;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,d,p)}debug(d,...p){var f;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,d,p)}info(d,...p){var f;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,d,p)}warn(d,...p){var f;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,d,p)}error(d,...p){var f;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,d,p)}};s.LogService=y=c([m(0,b.IOptionsService)],y),s.setTraceLogger=function(d){C=d},s.traceCall=function(d,p,f){if(typeof f.value!="function")throw new Error("not supported");const g=f.value;f.value=function(...S){if(C.logLevel!==b.LogLevelEnum.TRACE)return g.apply(this,S);C.trace(`GlyphRenderer#${g.name}(${S.map((I=>JSON.stringify(I))).join(", ")})`);const k=g.apply(this,S);return C.trace(`GlyphRenderer#${g.name} return`,k),k}}},7302:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=a(8460),m=a(844),h=a(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends m.Disposable{constructor(y){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...s.DEFAULT_OPTIONS};for(const p in y)if(p in d)try{const f=y[p];d[p]=this._sanitizeAndValidateOption(p,f)}catch(f){console.error(f)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(y,d){return this.onOptionChange((p=>{p===y&&d(this.rawOptions[y])}))}onMultipleOptionChange(y,d){return this.onOptionChange((p=>{y.indexOf(p)!==-1&&d()}))}_setupOptions(){const y=p=>{if(!(p in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},d=(p,f)=>{if(!(p in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);f=this._sanitizeAndValidateOption(p,f),this.rawOptions[p]!==f&&(this.rawOptions[p]=f,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const f={get:y.bind(this,p),set:d.bind(this,p)};Object.defineProperty(this.options,p,f)}}_sanitizeAndValidateOption(y,d){switch(y){case"cursorStyle":if(d||(d=s.DEFAULT_OPTIONS[y]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${y}`);break;case"wordSeparator":d||(d=s.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=b.includes(d)?d:s.DEFAULT_OPTIONS[y];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${y} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${y} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}s.OptionsService=_},2660:function(l,s,a){var c=this&&this.__decorate||function(_,C,y,d){var p,f=arguments.length,g=f<3?C:d===null?d=Object.getOwnPropertyDescriptor(C,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(_,C,y,d);else for(var S=_.length-1;S>=0;S--)(p=_[S])&&(g=(f<3?p(g):f>3?p(C,y,g):p(C,y))||g);return f>3&&g&&Object.defineProperty(C,y,g),g},m=this&&this.__param||function(_,C){return function(y,d){C(y,d,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const h=a(2585);let b=s.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const C=this._bufferService.buffer;if(_.id===void 0){const S=C.addMarker(C.ybase+C.y),k={data:_,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(k,S))),this._dataByLinkId.set(k.id,k),k.id}const y=_,d=this._getEntryIdKey(y),p=this._entriesWithId.get(d);if(p)return this.addLineToLink(p.id,C.ybase+C.y),p.id;const f=C.addMarker(C.ybase+C.y),g={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(g,f))),this._entriesWithId.set(g.key,g),this._dataByLinkId.set(g.id,g),g.id}addLineToLink(_,C){const y=this._dataByLinkId.get(_);if(y&&y.lines.every((d=>d.line!==C))){const d=this._bufferService.buffer.addMarker(C);y.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(y,d)))}}getLinkData(_){var C;return(C=this._dataByLinkId.get(_))==null?void 0:C.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,C){const y=_.lines.indexOf(C);y!==-1&&(_.lines.splice(y,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};s.OscLinkService=b=c([m(0,h.IBufferService)],b)},8343:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(m){return m[c]||[]},s.createDecorator=function(m){if(s.serviceRegistry.has(m))return s.serviceRegistry.get(m);const h=function(b,_,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,p){d[a]===d?d[c].push({id:y,index:p}):(d[c]=[{id:y,index:p}],d[a]=d)})(h,b,C)};return h.toString=()=>m,s.serviceRegistry.set(m,h),h}},2585:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(8343);var m;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(m||(s.LogLevelEnum=m={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(8460),m=a(225);class h{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,C,y=!1){return(16777215&_)<<3|(3&C)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new m.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let C=0,y=0;const d=_.length;for(let p=0;p<d;++p){let f=_.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=d)return C+this.wcwidth(f);const k=_.charCodeAt(p);56320<=k&&k<=57343?f=1024*(f-55296)+k-56320+65536:C+=this.wcwidth(k)}const g=this.charProperties(f,y);let S=h.extractWidth(g);h.extractShouldJoin(g)&&(S-=h.extractWidth(y)),C+=S,y=g}return C}charProperties(_,C){return this._activeProvider.charProperties(_,C)}}s.UnicodeService=h}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const s=i(9042),a=i(3236),c=i(844),m=i(5741),h=i(8285),b=i(7975),_=i(7090),C=["cols","rows"];class y extends c.Disposable{constructor(p){super(),this._core=this.register(new a.Terminal(p)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],g=(S,k)=>{this._checkReadonlyOptions(S),this._core.options[S]=k};for(const S in this._core.options){const k={get:f.bind(this,S),set:g.bind(this,S)};Object.defineProperty(this._publicOptions,S,k)}}_checkReadonlyOptions(p){if(C.includes(p))throw new Error(`Option "${p}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const f in p)this._publicOptions[f]=p[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,f=!0){this._core.input(p,f)}resize(p,f){this._verifyIntegers(p,f),this._core.resize(p,f)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,f,g){this._verifyIntegers(p,f,g),this._core.select(p,f,g)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,f){this._verifyIntegers(p,f),this._core.selectLines(p,f)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,f){this._core.write(p,f)}writeln(p,f){this._core.write(p),this._core.write(`\r
171
+ `,f)}paste(p){this._core.paste(p)}refresh(p,f){this._verifyIntegers(p,f),this._core.refresh(p,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return s}_verifyIntegers(...p){for(const f of p)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const f of p)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}l.Terminal=y})(),o})()))})(wh)),wh.exports}var B2=x2(),nc={exports:{}},O2=nc.exports,Ih;function L2(){return Ih||(Ih=1,(function(e,t){(function(r,n){e.exports=n()})(O2,(()=>(()=>{var r={930:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(485);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(m,h,b){this._css.set(m,h,b)}getCss(m,h){return this._css.get(m,h)}setColor(m,h,b){this._color.set(m,h,b)}getColor(m,h){return this._color.get(m,h)}clear(){this._color.clear(),this._css.clear()}}},997:function(l,s,a){var c=this&&this.__decorate||function(N,E,R,O){var V,M=arguments.length,D=M<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(N,E,R,O);else for(var ee=N.length-1;ee>=0;ee--)(V=N[ee])&&(D=(M<3?V(D):M>3?V(E,R,D):V(E,R))||D);return M>3&&D&&Object.defineProperty(E,R,D),D},m=this&&this.__param||function(N,E){return function(R,O){E(R,O,N)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const h=a(930),b=a(160),_=a(345),C=a(859),y=a(97),d=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),f=b.css.toColor("#ffffff"),g=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const N=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let R=0;R<216;R++){const O=E[R/36%6|0],V=E[R/6%6|0],M=E[R%6];N.push({css:b.channels.toCss(O,V,M),rgba:b.channels.toRgba(O,V,M)})}for(let R=0;R<24;R++){const O=8+10*R;N.push({css:b.channels.toCss(O,O,O),rgba:b.channels.toRgba(O,O,O)})}return N})());let k=s.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(N){super(),this._optionsService=N,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:p,cursor:f,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(p,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(N={}){const E=this._colors;if(E.foreground=I(N.foreground,d),E.background=I(N.background,p),E.cursor=I(N.cursor,f),E.cursorAccent=I(N.cursorAccent,g),E.selectionBackgroundTransparent=I(N.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=I(N.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=N.selectionForeground?I(N.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=s.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=I(N.black,s.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=I(N.red,s.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=I(N.green,s.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=I(N.yellow,s.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=I(N.blue,s.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=I(N.magenta,s.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=I(N.cyan,s.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=I(N.white,s.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=I(N.brightBlack,s.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=I(N.brightRed,s.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=I(N.brightGreen,s.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=I(N.brightYellow,s.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=I(N.brightBlue,s.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=I(N.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=I(N.brightCyan,s.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=I(N.brightWhite,s.DEFAULT_ANSI_COLORS[15]),N.extendedAnsi){const R=Math.min(E.ansi.length-16,N.extendedAnsi.length);for(let O=0;O<R;O++)E.ansi[O+16]=I(N.extendedAnsi[O],s.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(N){this._restoreColor(N),this._onChangeColors.fire(this.colors)}_restoreColor(N){if(N!==void 0)switch(N){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[N]=this._restoreColors.ansi[N]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(N){N(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function I(N,E){if(N!==void 0)try{return b.css.toColor(N)}catch{}return E}s.ThemeService=k=c([m(0,y.IOptionsService)],k)},160:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,m=0,h=0;var b,_,C,y,d;function p(g){const S=g.toString(16);return S.length<2?"0"+S:S}function f(g,S){return g<S?(S+.05)/(g+.05):(g+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(g){g.toCss=function(S,k,I,N){return N!==void 0?`#${p(S)}${p(k)}${p(I)}${p(N)}`:`#${p(S)}${p(k)}${p(I)}`},g.toRgba=function(S,k,I,N=255){return(S<<24|k<<16|I<<8|N)>>>0},g.toColor=function(S,k,I,N){return{css:g.toCss(S,k,I,N),rgba:g.toRgba(S,k,I,N)}}})(b||(s.channels=b={})),(function(g){function S(k,I){return h=Math.round(255*I),[a,c,m]=d.toChannels(k.rgba),{css:b.toCss(a,c,m,h),rgba:b.toRgba(a,c,m,h)}}g.blend=function(k,I){if(h=(255&I.rgba)/255,h===1)return{css:I.css,rgba:I.rgba};const N=I.rgba>>24&255,E=I.rgba>>16&255,R=I.rgba>>8&255,O=k.rgba>>24&255,V=k.rgba>>16&255,M=k.rgba>>8&255;return a=O+Math.round((N-O)*h),c=V+Math.round((E-V)*h),m=M+Math.round((R-M)*h),{css:b.toCss(a,c,m),rgba:b.toRgba(a,c,m)}},g.isOpaque=function(k){return(255&k.rgba)==255},g.ensureContrastRatio=function(k,I,N){const E=d.ensureContrastRatio(k.rgba,I.rgba,N);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},g.opaque=function(k){const I=(255|k.rgba)>>>0;return[a,c,m]=d.toChannels(I),{css:b.toCss(a,c,m),rgba:I}},g.opacity=S,g.multiplyOpacity=function(k,I){return h=255&k.rgba,S(k,h*I/255)},g.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}})(_||(s.color=_={})),(function(g){let S,k;try{const I=document.createElement("canvas");I.width=1,I.height=1;const N=I.getContext("2d",{willReadFrequently:!0});N&&(S=N,S.globalCompositeOperation="copy",k=S.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(I){if(I.match(/#[\da-f]{3,8}/i))switch(I.length){case 4:return a=parseInt(I.slice(1,2).repeat(2),16),c=parseInt(I.slice(2,3).repeat(2),16),m=parseInt(I.slice(3,4).repeat(2),16),b.toColor(a,c,m);case 5:return a=parseInt(I.slice(1,2).repeat(2),16),c=parseInt(I.slice(2,3).repeat(2),16),m=parseInt(I.slice(3,4).repeat(2),16),h=parseInt(I.slice(4,5).repeat(2),16),b.toColor(a,c,m,h);case 7:return{css:I,rgba:(parseInt(I.slice(1),16)<<8|255)>>>0};case 9:return{css:I,rgba:parseInt(I.slice(1),16)>>>0}}const N=I.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(N)return a=parseInt(N[1]),c=parseInt(N[2]),m=parseInt(N[3]),h=Math.round(255*(N[5]===void 0?1:parseFloat(N[5]))),b.toColor(a,c,m,h);if(!S||!k)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=k,S.fillStyle=I,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[a,c,m,h]=S.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(a,c,m,h),css:I}}})(C||(s.css=C={})),(function(g){function S(k,I,N){const E=k/255,R=I/255,O=N/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}g.relativeLuminance=function(k){return S(k>>16&255,k>>8&255,255&k)},g.relativeLuminance2=S})(y||(s.rgb=y={})),(function(g){function S(I,N,E){const R=I>>24&255,O=I>>16&255,V=I>>8&255;let M=N>>24&255,D=N>>16&255,ee=N>>8&255,ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));for(;ae<E&&(M>0||D>0||ee>0);)M-=Math.max(0,Math.ceil(.1*M)),D-=Math.max(0,Math.ceil(.1*D)),ee-=Math.max(0,Math.ceil(.1*ee)),ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));return(M<<24|D<<16|ee<<8|255)>>>0}function k(I,N,E){const R=I>>24&255,O=I>>16&255,V=I>>8&255;let M=N>>24&255,D=N>>16&255,ee=N>>8&255,ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));for(;ae<E&&(M<255||D<255||ee<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),D=Math.min(255,D+Math.ceil(.1*(255-D))),ee=Math.min(255,ee+Math.ceil(.1*(255-ee))),ae=f(y.relativeLuminance2(M,D,ee),y.relativeLuminance2(R,O,V));return(M<<24|D<<16|ee<<8|255)>>>0}g.blend=function(I,N){if(h=(255&N)/255,h===1)return N;const E=N>>24&255,R=N>>16&255,O=N>>8&255,V=I>>24&255,M=I>>16&255,D=I>>8&255;return a=V+Math.round((E-V)*h),c=M+Math.round((R-M)*h),m=D+Math.round((O-D)*h),b.toRgba(a,c,m)},g.ensureContrastRatio=function(I,N,E){const R=y.relativeLuminance(I>>8),O=y.relativeLuminance(N>>8);if(f(R,O)<E){if(O<R){const D=S(I,N,E),ee=f(R,y.relativeLuminance(D>>8));if(ee<E){const ae=k(I,N,E);return ee>f(R,y.relativeLuminance(ae>>8))?D:ae}return D}const V=k(I,N,E),M=f(R,y.relativeLuminance(V>>8));if(M<E){const D=S(I,N,E);return M>f(R,y.relativeLuminance(D>>8))?V:D}return V}},g.reduceLuminance=S,g.increaseLuminance=k,g.toChannels=function(I){return[I>>24&255,I>>16&255,I>>8&255,255&I]}})(d||(s.rgba=d={})),s.toPaddedHex=p,s.contrastRatio=f},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},859:(l,s)=>{function a(c){for(const m of c)m.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const m=this._disposables.indexOf(c);m!==-1&&this._disposables.splice(m,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var m;this._isDisposed||c===this._value||((m=this._value)==null||m.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},485:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(m,h,b){this._data[m]||(this._data[m]={}),this._data[m][h]=b}get(m,h){return this._data[m]?this._data[m][h]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,m,h,b,_){this._data.get(c,m)||this._data.set(c,m,new a),this._data.get(c,m).set(h,b,_)}get(c,m,h,b){var _;return(_=this._data.get(c,m))==null?void 0:_.get(h,b)}clear(){this._data.clear()}}},726:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(m){return m[c]||[]},s.createDecorator=function(m){if(s.serviceRegistry.has(m))return s.serviceRegistry.get(m);const h=function(b,_,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,p){d[a]===d?d[c].push({id:y,index:p}):(d[c]=[{id:y,index:p}],d[a]=d)})(h,b,C)};return h.toString=()=>m,s.serviceRegistry.set(m,h),h}},97:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(726);var m;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(m||(s.LogLevelEnum=m={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.HTMLSerializeHandler=l.SerializeAddon=void 0;const s=i(997);function a(y,d,p){return Math.max(d,Math.min(y,p))}class c{constructor(d){this._buffer=d}serialize(d,p){const f=this._buffer.getNullCell(),g=this._buffer.getNullCell();let S=f;const k=d.start.y,I=d.end.y,N=d.start.x,E=d.end.x;this._beforeSerialize(I-k,k,I);for(let R=k;R<=I;R++){const O=this._buffer.getLine(R);if(O){const V=R===d.start.y?N:0,M=R===d.end.y?E:O.length;for(let D=V;D<M;D++){const ee=O.getCell(D,S===f?g:f);ee?(this._nextCell(ee,S,R,D),S=ee):console.warn(`Can't get cell at row=${R}, col=${D}`)}}this._rowEnd(R,R===I)}return this._afterSerialize(),this._serializeString(p)}_nextCell(d,p,f,g){}_rowEnd(d,p){}_beforeSerialize(d,p,f){}_afterSerialize(){}_serializeString(d){return""}}function m(y,d){return y.getFgColorMode()===d.getFgColorMode()&&y.getFgColor()===d.getFgColor()}function h(y,d){return y.getBgColorMode()===d.getBgColorMode()&&y.getBgColor()===d.getBgColor()}function b(y,d){return y.isInverse()===d.isInverse()&&y.isBold()===d.isBold()&&y.isUnderline()===d.isUnderline()&&y.isOverline()===d.isOverline()&&y.isBlink()===d.isBlink()&&y.isInvisible()===d.isInvisible()&&y.isItalic()===d.isItalic()&&y.isDim()===d.isDim()&&y.isStrikethrough()===d.isStrikethrough()}class _ extends c{constructor(d,p){super(d),this._terminal=p,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(d,p,f){this._allRows=new Array(d),this._lastContentCursorRow=p,this._lastCursorRow=p,this._firstRow=p}_rowEnd(d,p){var f;this._nullCellCount>0&&!h(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let g="";if(!p){d-this._firstRow>=this._terminal.rows&&((f=this._buffer.getLine(this._cursorStyleRow))==null||f.getCell(this._cursorStyleCol,this._backgroundCell));const S=this._buffer.getLine(d),k=this._buffer.getLine(d+1);if(k.isWrapped){g="";const I=S.getCell(S.length-1,this._thisRowLastChar),N=S.getCell(S.length-2,this._thisRowLastSecondChar),E=k.getCell(0,this._nextRowFirstChar),R=E.getWidth()>1;let O=!1;(E.getChars()&&R?this._nullCellCount<=1:this._nullCellCount<=0)&&((I.getChars()||I.getWidth()===0)&&h(I,E)&&(O=!0),R&&(N.getChars()||N.getWidth()===0)&&h(I,E)&&h(N,E)&&(O=!0)),O||(g="-".repeat(this._nullCellCount+1),g+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(g+="\x1B[A",g+=`\x1B[${S.length-this._nullCellCount}C`,g+=`\x1B[${this._nullCellCount}X`,g+=`\x1B[${S.length-this._nullCellCount}D`,g+="\x1B[B"),this._lastContentCursorRow=d+1,this._lastContentCursorCol=0,this._lastCursorRow=d+1,this._lastCursorCol=0)}else g=`\r
172
+ `,this._lastCursorRow=d+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=g,this._currentRow="",this._nullCellCount=0}_diffStyle(d,p){const f=[],g=!m(d,p),S=!h(d,p),k=!b(d,p);if(g||S||k)if(d.isAttributeDefault())p.isAttributeDefault()||f.push(0);else{if(g){const I=d.getFgColor();d.isFgRGB()?f.push(38,2,I>>>16&255,I>>>8&255,255&I):d.isFgPalette()?I>=16?f.push(38,5,I):f.push(8&I?90+(7&I):30+(7&I)):f.push(39)}if(S){const I=d.getBgColor();d.isBgRGB()?f.push(48,2,I>>>16&255,I>>>8&255,255&I):d.isBgPalette()?I>=16?f.push(48,5,I):f.push(8&I?100+(7&I):40+(7&I)):f.push(49)}k&&(d.isInverse()!==p.isInverse()&&f.push(d.isInverse()?7:27),d.isBold()!==p.isBold()&&f.push(d.isBold()?1:22),d.isUnderline()!==p.isUnderline()&&f.push(d.isUnderline()?4:24),d.isOverline()!==p.isOverline()&&f.push(d.isOverline()?53:55),d.isBlink()!==p.isBlink()&&f.push(d.isBlink()?5:25),d.isInvisible()!==p.isInvisible()&&f.push(d.isInvisible()?8:28),d.isItalic()!==p.isItalic()&&f.push(d.isItalic()?3:23),d.isDim()!==p.isDim()&&f.push(d.isDim()?2:22),d.isStrikethrough()!==p.isStrikethrough()&&f.push(d.isStrikethrough()?9:29))}return f}_nextCell(d,p,f,g){if(d.getWidth()===0)return;const S=d.getChars()==="",k=this._diffStyle(d,this._cursorStyle);if(S?!h(this._cursorStyle,d):k.length>0){this._nullCellCount>0&&(h(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=f,this._lastContentCursorCol=this._lastCursorCol=g,this._currentRow+=`\x1B[${k.join(";")}m`;const I=this._buffer.getLine(f);I!==void 0&&(I.getCell(g,this._cursorStyle),this._cursorStyleRow=f,this._cursorStyleCol=g)}S?this._nullCellCount+=d.getWidth():(this._nullCellCount>0&&(h(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=d.getChars(),this._lastContentCursorRow=this._lastCursorRow=f,this._lastContentCursorCol=this._lastCursorCol=g+d.getWidth())}_serializeString(d){let p=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(p=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let f="";for(let I=0;I<p;I++)f+=this._allRows[I],I+1<p&&(f+=this._allRowSeparators[I]);if(!d){const I=this._buffer.baseY+this._buffer.cursorY,N=this._buffer.cursorX,E=R=>{R>0?f+=`\x1B[${R}C`:R<0&&(f+=`\x1B[${-R}D`)};(I!==this._lastCursorRow||N!==this._lastCursorCol)&&((g=I-this._lastCursorRow)>0?f+=`\x1B[${g}B`:g<0&&(f+=`\x1B[${-g}A`),E(N-this._lastCursorCol))}var g;const S=this._terminal._core._inputHandler._curAttrData,k=this._diffStyle(S,this._cursorStyle);return k.length>0&&(f+=`\x1B[${k.join(";")}m`),f}}l.SerializeAddon=class{activate(y){this._terminal=y}_serializeBufferByScrollback(y,d,p){const f=d.length,g=p===void 0?f:a(p+y.rows,0,f);return this._serializeBufferByRange(y,d,{start:f-g,end:f-1},!1)}_serializeBufferByRange(y,d,p,f){return new _(d,y).serialize({start:{x:0,y:typeof p.start=="number"?p.start:p.start.line},end:{x:y.cols,y:typeof p.end=="number"?p.end:p.end.line}},f)}_serializeBufferAsHTML(y,d){var p;const f=y.buffer.active,g=new C(f,y,d);if(!d.onlySelection){const k=f.length,I=d.scrollback,N=I===void 0?k:a(I+y.rows,0,k);return g.serialize({start:{x:0,y:k-N},end:{x:y.cols,y:k-1}})}const S=(p=this._terminal)==null?void 0:p.getSelectionPosition();return S!==void 0?g.serialize({start:{x:S.start.x,y:S.start.y},end:{x:S.end.x,y:S.end.y}}):""}_serializeModes(y){let d="";const p=y.modes;if(p.applicationCursorKeysMode&&(d+="\x1B[?1h"),p.applicationKeypadMode&&(d+="\x1B[?66h"),p.bracketedPasteMode&&(d+="\x1B[?2004h"),p.insertMode&&(d+="\x1B[4h"),p.originMode&&(d+="\x1B[?6h"),p.reverseWraparoundMode&&(d+="\x1B[?45h"),p.sendFocusMode&&(d+="\x1B[?1004h"),p.wraparoundMode===!1&&(d+="\x1B[?7l"),p.mouseTrackingMode!=="none")switch(p.mouseTrackingMode){case"x10":d+="\x1B[?9h";break;case"vt200":d+="\x1B[?1000h";break;case"drag":d+="\x1B[?1002h";break;case"any":d+="\x1B[?1003h"}return d}serialize(y){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let d=y!=null&&y.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,y.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,y==null?void 0:y.scrollback);return y!=null&&y.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(d+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),y!=null&&y.excludeModes||(d+=this._serializeModes(this._terminal)),d}serializeAsHTML(y){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,y||{})}dispose(){}};class C extends c{constructor(d,p,f){super(d),this._terminal=p,this._options=f,this._currentRow="",this._htmlContent="",p._core._themeService?this._ansiColors=p._core._themeService.colors.ansi:this._ansiColors=s.DEFAULT_ANSI_COLORS}_padStart(d,p,f){return p>>=0,f=f??" ",d.length>p?d:((p-=d.length)>f.length&&(f+=f.repeat(p/f.length)),f.slice(0,p)+d)}_beforeSerialize(d,p,f){var g,S;this._htmlContent+="<html><body><!--StartFragment--><pre>";let k="#000000",I="#ffffff";this._options.includeGlobalBackground&&(k=((g=this._terminal.options.theme)==null?void 0:g.foreground)??"#ffffff",I=((S=this._terminal.options.theme)==null?void 0:S.background)??"#000000");const N=[];N.push("color: "+k+";"),N.push("background-color: "+I+";"),N.push("font-family: "+this._terminal.options.fontFamily+";"),N.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+N.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(d,p){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(d,p){const f=p?d.getFgColor():d.getBgColor();return(p?d.isFgRGB():d.isBgRGB())?"#"+[f>>16&255,f>>8&255,255&f].map((g=>this._padStart(g.toString(16),2,"0"))).join(""):(p?d.isFgPalette():d.isBgPalette())?this._ansiColors[f].css:void 0}_diffStyle(d,p){const f=[],g=!m(d,p),S=!h(d,p),k=!b(d,p);if(g||S||k){const I=this._getHexColor(d,!0);I&&f.push("color: "+I+";");const N=this._getHexColor(d,!1);return N&&f.push("background-color: "+N+";"),d.isInverse()&&f.push("color: #000000; background-color: #BFBFBF;"),d.isBold()&&f.push("font-weight: bold;"),d.isUnderline()&&d.isOverline()?f.push("text-decoration: overline underline;"):d.isUnderline()?f.push("text-decoration: underline;"):d.isOverline()&&f.push("text-decoration: overline;"),d.isBlink()&&f.push("text-decoration: blink;"),d.isInvisible()&&f.push("visibility: hidden;"),d.isItalic()&&f.push("font-style: italic;"),d.isDim()&&f.push("opacity: 0.5;"),d.isStrikethrough()&&f.push("text-decoration: line-through;"),f}}_nextCell(d,p,f,g){if(d.getWidth()===0)return;const S=d.getChars()==="",k=this._diffStyle(d,p);k&&(this._currentRow+=k.length===0?"</span><span>":"</span><span style='"+k.join(" ")+"'>"),this._currentRow+=S?" ":d.getChars()}_serializeString(){return this._htmlContent}}l.HTMLSerializeHandler=C})(),o})()))})(nc)),nc.exports}var D2=L2(),ic={exports:{}},F2=ic.exports,kh;function V2(){return kh||(kh=1,(function(e,t){(function(r,n){e.exports=n()})(F2,(()=>(()=>{var r={433:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const c=a(938),m=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],h=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],b=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let C;function y(d,p){let f,g=0,S=p.length-1;if(d<p[0][0]||d>p[S][1])return!1;for(;S>=g;)if(f=g+S>>1,d>p[f][1])g=f+1;else{if(!(d<p[f][0]))return!0;S=f-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160);for(let d=0;d<m.length;++d)C.fill(0,m[d][0],m[d][1]+1);for(let d=0;d<b.length;++d)C.fill(2,b[d][0],b[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?C[d]:y(d,h)?0:y(d,_)?2:1}charProperties(d,p){let f=this.wcwidth(d),g=f===0&&p!==0;if(g){const S=c.UnicodeService.extractWidth(p);S===0?g=!1:S>f&&(f=S)}return c.UnicodeService.createPropertyValue(0,f,g)}}},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const m=[];for(let h=0;h<this._listeners.length;h++)m.push(this._listeners[h]);for(let h=0;h<m.length;h++)m[h].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((m=>c.fire(m)))},s.runAndSubscribe=function(a,c){return c(void 0),a((m=>c(m)))}},490:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(938),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;s.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let _=0;_<m.length;++_)b.fill(0,m[_][0],m[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?b[_]:(function(C,y){let d,p=0,f=y.length-1;if(C<y[0][0]||C>y[f][1])return!1;for(;f>=p;)if(d=p+f>>1,C>y[d][1])p=d+1;else{if(!(C<y[d][0]))return!0;f=d-1}return!1})(_,h)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,C){let y=this.wcwidth(_),d=y===0&&C!==0;if(d){const p=c.UnicodeService.extractWidth(C);p===0?d=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,d)}}},938:(l,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(345),m=a(490);class h{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,C,y=!1){return(16777215&_)<<3|(3&C)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new m.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let C=0,y=0;const d=_.length;for(let p=0;p<d;++p){let f=_.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=d)return C+this.wcwidth(f);const k=_.charCodeAt(p);56320<=k&&k<=57343?f=1024*(f-55296)+k-56320+65536:C+=this.wcwidth(k)}const g=this.charProperties(f,y);let S=h.extractWidth(g);h.extractShouldJoin(g)&&(S-=h.extractWidth(y)),C+=S,y=g}return C}charProperties(_,C){return this._activeProvider.charProperties(_,C)}}s.UnicodeService=h}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l](a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.Unicode11Addon=void 0;const s=i(433);l.Unicode11Addon=class{activate(a){a.unicode.register(new s.UnicodeV11)}dispose(){}}})(),o})()))})(ic)),ic.exports}var U2=V2(),Th={exports:{}},Nh;function M2(){return Nh||(Nh=1,(function(e,t){(function(r,n){e.exports=n()})(self,(()=>(()=>{var r={6:(l,s)=>{function a(m){try{const h=new URL(m),b=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return m.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(m,h,b,_={}){this._terminal=m,this._regex=h,this._handler=b,this._options=_}provideLinks(m,h){const b=c.computeLink(m,this._regex,this._terminal,this._handler);h(this._addCallbacks(b))}_addCallbacks(m){return m.map((h=>(h.leave=this._options.leave,h.hover=(b,_)=>{if(this._options.hover){const{range:C}=h;this._options.hover(b,_,C)}},h)))}};class c{static computeLink(h,b,_,C){const y=new RegExp(b.source,(b.flags||"")+"g"),[d,p]=c._getWindowedLineStrings(h-1,_),f=d.join("");let g;const S=[];for(;g=y.exec(f);){const k=g[0];if(!a(k))continue;const[I,N]=c._mapStrIdx(_,p,0,g.index),[E,R]=c._mapStrIdx(_,I,N,k.length);if(I===-1||N===-1||E===-1||R===-1)continue;const O={start:{x:N+1,y:I+1},end:{x:R,y:E+1}};S.push({range:O,text:k,activate:C})}return S}static _getWindowedLineStrings(h,b){let _,C=h,y=h,d=0,p="";const f=[];if(_=b.buffer.active.getLine(h)){const g=_.translateToString(!0);if(_.isWrapped&&g[0]!==" "){for(d=0;(_=b.buffer.active.getLine(--C))&&d<2048&&(p=_.translateToString(!0),d+=p.length,f.push(p),_.isWrapped&&p.indexOf(" ")===-1););f.reverse()}for(f.push(g),d=0;(_=b.buffer.active.getLine(++y))&&_.isWrapped&&d<2048&&(p=_.translateToString(!0),d+=p.length,f.push(p),p.indexOf(" ")===-1););}return[f,C]}static _mapStrIdx(h,b,_,C){const y=h.buffer.active,d=y.getNullCell();let p=_;for(;C;){const f=y.getLine(b);if(!f)return[-1,-1];for(let g=p;g<f.length;++g){f.getCell(g,d);const S=d.getChars();if(d.getWidth()&&(C-=S.length||1,g===f.length-1&&S==="")){const k=y.getLine(b+1);k&&k.isWrapped&&(k.getCell(0,d),d.getWidth()===2&&(C+=1))}if(C<0)return[b,g]}b++,p=0}return[b,p]}}s.LinkComputer=c}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var a=n[l]={exports:{}};return r[l](a,a.exports,i),a.exports}var o={};return(()=>{var l=o;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const s=i(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(m,h){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(m=c,h={}){this._handler=m,this._options=h}activate(m){this._terminal=m;const h=this._options,b=h.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,b,this._handler,h))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),o})()))})(Th)),Th.exports}var P2=M2();function Rt(e){return typeof e=="function"}function Vm(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Ia=Vm(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
173
+ `+t.map(function(r,n){return n+1+") "+r.toString()}).join(`
174
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function fo(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Qi=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var s=Un(l),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(y){t={error:y}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else l.remove(this);var m=this.initialTeardown;if(Rt(m))try{m()}catch(y){o=y instanceof Ia?y.errors:[y]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var b=Un(h),_=b.next();!_.done;_=b.next()){var C=_.value;try{Ah(C)}catch(y){o=o??[],y instanceof Ia?o=Li(Li([],Oi(o)),Oi(y.errors)):o.push(y)}}}catch(y){n={error:y}}finally{try{_&&!_.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}if(o)throw new Ia(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Ah(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&fo(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&fo(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Um=Qi.EMPTY;function Mm(e){return e instanceof Qi||e&&"closed"in e&&Rt(e.remove)&&Rt(e.add)&&Rt(e.unsubscribe)}function Ah(e){Rt(e)?e():e.unsubscribe()}var W2={Promise:void 0},j2={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Li([e,t],Oi(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Pm(e){j2.setTimeout(function(){throw e})}function Rh(){}function Ks(e){e()}var gl=(function(e){Ur(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Mm(r)&&r.add(n)):n.destination=K2,n}return t.create=function(r,n,i){return new Mi(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Qi),Z2=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Rs(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Rs(n)}else Rs(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Rs(r)}},e})(),Mi=(function(e){Ur(t,e);function t(r,n,i){var o=e.call(this)||this,l;return Rt(r)||!r?l={next:r??void 0,error:n??void 0,complete:i??void 0}:l=r,o.destination=new Z2(l),o}return t})(gl);function Rs(e){Pm(e)}function G2(e){throw e}var K2={closed:!0,next:Rh,error:G2,complete:Rh},vl=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Wm(e){return e}function H2(e){return e.length===0?Wm:e.length===1?e[0]:function(t){return e.reduce(function(r,n){return n(r)},t)}}var _r=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=Y2(t)?t:new Mi(t,r,n);return Ks(function(){var l=i,s=l.operator,a=l.source;o.add(s?s.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=xh(r),new r(function(i,o){var l=new Mi({next:function(s){try{t(s)}catch(a){o(a),l.unsubscribe()}},error:o,complete:i});n.subscribe(l)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[vl]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return H2(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=xh(t),new t(function(n,i){var o;r.subscribe(function(l){return o=l},function(l){return i(l)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function xh(e){var t;return(t=e??W2.Promise)!==null&&t!==void 0?t:Promise}function X2(e){return e&&Rt(e.next)&&Rt(e.error)&&Rt(e.complete)}function Y2(e){return e&&e instanceof gl||X2(e)&&Mm(e)}function $2(e){return Rt(e==null?void 0:e.lift)}function qi(e){return function(t){if($2(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ko(e,t,r,n,i){return new J2(e,t,r,n,i)}var J2=(function(e){Ur(t,e);function t(r,n,i,o,l,s){var a=e.call(this,r)||this;return a.onFinalize=l,a.shouldUnsubscribe=s,a._next=n?function(c){try{n(c)}catch(m){r.error(m)}}:e.prototype._next,a._error=o?function(c){try{o(c)}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(gl),z2=Vm(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),jm=(function(e){Ur(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new Bh(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new z2},t.prototype.next=function(r){var n=this;Ks(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=Un(n.currentObservers),s=l.next();!s.done;s=l.next()){var a=s.value;a.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;Ks(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;Ks(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,l=i.isStopped,s=i.observers;return o||l?Um:(this.currentObservers=null,s.push(r),new Qi(function(){n.currentObservers=null,fo(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,l=n.isStopped;i?r.error(o):l&&r.complete()},t.prototype.asObservable=function(){var r=new _r;return r.source=this,r},t.create=function(r,n){return new Bh(r,n)},t})(_r),Bh=(function(e){Ur(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:Um},t})(jm),Q2={now:function(){return Date.now()}},q2=(function(e){Ur(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(Qi),Oh={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,Li([e,t],Oi(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},eS=(function(e){Ur(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,l=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(l,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(l,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),Oh.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Oh.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(l){i=!0,o=l||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,fo(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(q2),Lh=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=Q2.now,e})(),tS=(function(e){Ur(t,e);function t(r,n){n===void 0&&(n=Lh.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(Lh),rS=new tS(eS),nS=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function iS(e){return Rt(e==null?void 0:e.then)}function sS(e){return Rt(e[vl])}function oS(e){return Symbol.asyncIterator&&Rt(e==null?void 0:e[Symbol.asyncIterator])}function aS(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function cS(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var lS=cS();function uS(e){return Rt(e==null?void 0:e[lS])}function dS(e){return s2(this,arguments,function(){var t,r,n,i;return Nm(this,function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,In(t.read())];case 3:return r=o.sent(),n=r.value,i=r.done,i?[4,In(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,In(n)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function hS(e){return Rt(e==null?void 0:e.getReader)}function Zm(e){if(e instanceof _r)return e;if(e!=null){if(sS(e))return fS(e);if(nS(e))return pS(e);if(iS(e))return mS(e);if(oS(e))return Gm(e);if(uS(e))return gS(e);if(hS(e))return vS(e)}throw aS(e)}function fS(e){return new _r(function(t){var r=e[vl]();if(Rt(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function pS(e){return new _r(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function mS(e){return new _r(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Pm)})}function gS(e){return new _r(function(t){var r,n;try{for(var i=Un(e),o=i.next();!o.done;o=i.next()){var l=o.value;if(t.next(l),t.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()})}function Gm(e){return new _r(function(t){bS(e,t).catch(function(r){return t.error(r)})})}function vS(e){return Gm(dS(e))}function bS(e,t){var r,n,i,o;return i2(this,void 0,void 0,function(){var l,s;return Nm(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),r=o2(e),a.label=1;case 1:return[4,r.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(l=n.value,t.next(l),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=a.sent(),i={error:s},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function _S(e,t){return qi(function(r,n){var i=0;r.subscribe(ko(n,function(o){n.next(e.call(t,o,i++))}))})}function Km(e,t){return qi(function(r,n){var i=0;r.subscribe(ko(n,function(o){return e.call(t,o,i++)&&n.next(o)}))})}function Hm(e,t){return t===void 0&&(t=rS),qi(function(r,n){var i=null,o=null,l=null,s=function(){if(i){i.unsubscribe(),i=null;var c=o;o=null,n.next(c)}};function a(){var c=l+e,m=t.now();if(m<c){i=this.schedule(void 0,c-m),n.add(i);return}s()}r.subscribe(ko(n,function(c){o=c,l=t.now(),i||(i=t.schedule(a,e),n.add(i))},function(){s(),n.complete()},void 0,function(){o=i=null}))})}function Xm(e,t){return t===void 0&&(t=Wm),e=e??yS,qi(function(r,n){var i,o=!0;r.subscribe(ko(n,function(l){var s=t(l);(o||!e(i,s))&&(o=!1,i=s,n.next(l))}))})}function yS(e,t){return e===t}function SS(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new jm}:t,n=e.resetOnError,i=n===void 0?!0:n,o=e.resetOnComplete,l=o===void 0?!0:o,s=e.resetOnRefCountZero,a=s===void 0?!0:s;return function(c){var m,h,b,_=0,C=!1,y=!1,d=function(){h==null||h.unsubscribe(),h=void 0},p=function(){d(),m=b=void 0,C=y=!1},f=function(){var g=m;p(),g==null||g.unsubscribe()};return qi(function(g,S){_++,!y&&!C&&d();var k=b=b??r();S.add(function(){_--,_===0&&!y&&!C&&(h=ka(f,a))}),k.subscribe(S),!m&&_>0&&(m=new Mi({next:function(I){return k.next(I)},error:function(I){y=!0,d(),h=ka(p,i,I),k.error(I)},complete:function(){C=!0,d(),h=ka(p,l),k.complete()}}),Zm(g).subscribe(m))})(c)}}function ka(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t===!0){e();return}if(t!==!1){var i=new Mi({next:function(){i.unsubscribe(),e()}});return Zm(t.apply(void 0,Li([],Oi(r)))).subscribe(i)}}/**
175
+ * Copyright (c) 2017 The xterm.js authors. All rights reserved.
176
+ * @license MIT
177
+ */const ES=2,wS=1;class CS{constructor(){}activate(t){this._terminal=t}dispose(){}fit(t){const r=this.proposeDimensions();if(t!==void 0&&r&&(r.rows=t),!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;const n=this._terminal._core;return(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(n._renderService.clear(),this._terminal.resize(r.cols,r.rows)),r}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const t=this.getCore(),r=t._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const n=this._terminal.options.scrollback===0?0:t.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(i.getPropertyValue("height")),l=Math.max(0,parseInt(i.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),a={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},c=a.top+a.bottom,m=a.right+a.left,h=o-c,b=l-m-n,{width:_,height:C}=this.getCellSize();return{cols:Math.max(ES,Math.floor(b/_)),rows:Math.max(wS,Math.floor(h/C))}}getCellSize(){const{value:t}=this.getCore()._renderService._renderer;return{width:t._charSizeService.width+Math.round(t._optionsService.rawOptions.letterSpacing),height:Math.floor(t._charSizeService.height*t._optionsService.rawOptions.lineHeight)}}getCore(){return this._terminal._core}}function IS({}){}function kS(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function TS(e){const t=new Date().getTime()-e.getTime(),r=Math.floor(t/1e3)*-1,n=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(r)<60?n.format(Math.round(r),"second"):Math.abs(r)<3600?n.format(Math.round(r/60),"minute"):Math.abs(r)<86400?n.format(Math.round(r/3600),"hour"):n.format(Math.round(r/86400),"day")}const NS=xe`<svg
178
178
  class="icon"
179
179
  width="16"
180
180
  height="16"
@@ -1454,9 +1454,9 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
1454
1454
  --vscode-widget-border: #e5e5e5;
1455
1455
  --vscode-activityBarBadge-background: #005fb8;
1456
1456
  }
1457
- `;var jS=Object.defineProperty,ZS=Object.getOwnPropertyDescriptor,Jm=e=>{throw TypeError(e)},st=(e,t,r,n)=>{for(var i=n>1?void 0:n?ZS(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&jS(t,r,i),i},GS=(e,t,r)=>t.has(e)||Jm("Cannot "+r),KS=(e,t,r)=>t.has(e)?Jm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ye=(e,t,r)=>(GS(e,t,"access private method"),r),Ke,To,zm,Qm,Hs,xr,oc,qm,eg,ac,tg,cc,rg,ng,ig,sg,og,ag,cg,lg,ug=(e=>(e.OpenLink="Open",e.CopyToClipboard="Copy to clipboard",e.Cancel="Cancel",e))(ug||{});const kn=(...e)=>`--vscode-${e.join("-")}`,wn=e=>kn("terminal",e),HS=e=>`ansi${e.charAt(0).toUpperCase()+e.slice(1)}`,XS=["terminal:","theme:",Pe.platformApiRequest,Pe.platformApiResponse,Pe.onOptionsMessage,Pe.optionsMessage,Pe.onCopyTextToClipboard,Pe.onProgramClose,Pe.featuresResponse,Pe.featuresUpdateAction],YS=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],$S="terminal-view";let rt=class extends At{constructor(){super(),KS(this,Ke),this.copyText="Copy",this.disposables=[],this.rows=10,this.isShareReady=!1,this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.windowSize={height:window.innerHeight,width:window.innerWidth}}applyThemeStyles(){if(this.shadowRoot){if(this.themeStyleSheet){const e=this.shadowRoot.adoptedStyleSheets.indexOf(this.themeStyleSheet);e!==-1&&(this.shadowRoot.adoptedStyleSheets=this.shadowRoot.adoptedStyleSheets.filter((t,r)=>r!==e)),this.themeStyleSheet=void 0}this.theme==="dark"?(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(PS.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet]):this.theme==="light"&&(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(WS.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet])}}connectedCallback(){var e;if(super.connectedCallback(),this.applyThemeStyles(),!this.id)throw new Error("No id provided to terminal!");this.rows=this.initialRows??this.rows;const{rows:t,cursorBlink:r,fontSize:n,cursorStyle:i,cursorWidth:o,fontFamily:l,smoothScrollDuration:s,scrollback:a}=this;this.terminal=new A2.Terminal({rows:t,fontSize:n,fontFamily:l,scrollback:a,cursorWidth:o,cursorBlink:r,cursorStyle:i,smoothScrollDuration:s,disableStdin:!1,convertEol:!0,allowProposedApi:!0,drawBoldTextInBrightColors:!1}),this.initialContent&&((e=this.terminal)==null||e.write(this.initialContent)),this.fitAddon=new SS,this.fitAddon.activate(this.terminal),this.serializer=new B2.SerializeAddon,this.terminal.loadAddon(this.serializer),this.terminal.loadAddon(new D2.Unicode11Addon),this.terminal.loadAddon(new V2.WebLinksAddon(Ye(this,Ke,og).bind(this))),this.terminal.attachCustomKeyEventHandler(m=>{var h;if(m.shiftKey&&m.ctrlKey&&m.code==="KeyC"){const b=(h=this==null?void 0:this.terminal)==null?void 0:h.getSelection();if(b)return navigator.clipboard.writeText(b),!1}return!0}),this.terminal.unicode.activeVersion="11",this.terminal.options.drawBoldTextInBrightColors;const c=Mt();this.disposables.push(r2(c,async m=>{var h;if(XS.some(b=>m.type.startsWith(b)))switch(m.type){case Pe.activeThemeChanged:Ye(this,Ke,Hs).call(this);break;case Pe.terminalStdout:case Pe.terminalStderr:{const{"runme.dev/id":b,data:_}=m.output;if(b!==this.id)return;this.isShareReady=!1,this.terminal.write(_),this.requestUpdate()}break;case Pe.platformApiResponse:{if(m.output.id!==this.id)return;if(this.isLoading=!1,m.output.hasErrors)return bt(c,Pe.errorMessage,m.output.data);if(m.output.data.hasOwnProperty("displayShare")&&m.output.data.displayShare===!1)return;const b=((h=m.output.data)==null?void 0:h.data)||{};if(b.createExtensionCellOutput||b.createCellExecution){const _=b.createCellExecution||b.createExtensionCellOutput||{},{exitCode:C,id:y,htmlUrl:d,isSlackReady:p}=_;return this.platformId=y,this.shareUrl=d||"",this.exitCode=C,this.isSlackReady=!!p,this.isShareReady=!0,bt(c,Pe.tangleEvent,{webviewId:Tm.RunmeCloud,data:{cellId:y}})}if(b.updateCellOutput){const{updateCellOutput:{exitCode:_,isSlackReady:C}}=b;this.isUpdatedReady=!0,this.exitCode=_,this.isSlackReady=!!C,Ye(this,Ke,tg).call(this)}b.createEscalation&&(this.escalationUrl=b.createEscalation.escalationUrl)}break;case Pe.onOptionsMessage:{if(m.output.id!==this.id)return;const b=m.output.option;switch(this.isLoading=!1,b){case"Open":return bt(c,Pe.openExternalLink,{link:this.shareUrl,telemetryEvent:"app.openLink"});case"Copy to clipboard":return bt(c,Pe.copyTextToClipboard,{id:this.id,text:this.shareUrl})}}break;case Pe.onCopyTextToClipboard:return m.output.id!==this.id?void 0:bt(c,Pe.infoMessage,"Link copied!");case Pe.onProgramClose:{const{"runme.dev/id":b,code:_}=m.output;if(b!==this.id)return;this.exitCode=_;return}}}),this.terminal.onData(m=>bt(c,Pe.terminalStdin,{"runme.dev/id":this.id,input:m}))),bt(c,Pe.featuresRequest,{})}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}updated(e){super.updated(e),e.has("theme")&&(this.applyThemeStyles(),Ye(this,Ke,Hs).call(this))}firstUpdated(e){var t;super.firstUpdated(e);const r=Ye(this,Ke,Qm).call(this);this.takeFocus&&window.addEventListener("focus",()=>{Ye(this,Ke,ac).call(this)}),window.addEventListener("click",()=>{Ye(this,Ke,ac).call(this,!1)}),this.terminal.open(r),this.takeFocus&&this.terminal.focus(),Ye(this,Ke,To).call(this),Ye(this,Ke,Hs).call(this);const n=Ye(this,Ke,zm).call(this),i=new _r(l=>{window.addEventListener("resize",()=>l.next(Ye(this,Ke,oc).call(this,!0))),r.addEventListener("mouseup",()=>l.next(Ye(this,Ke,oc).call(this,!1)))}).pipe(bS());Ye(this,Ke,qm).call(this,i),Ye(this,Ke,eg).call(this,i),r.appendChild(n);const o=Mt();o.postMessage&&bt(o,Pe.terminalOpen,{"runme.dev/id":this.id,terminalDimensions:dg((t=this.fitAddon)==null?void 0:t.proposeDimensions())}),this.lastLine&&this.terminal.scrollToLine(this.lastLine)}render(){const e=xe`
1457
+ `;var jS=Object.defineProperty,ZS=Object.getOwnPropertyDescriptor,Jm=e=>{throw TypeError(e)},st=(e,t,r,n)=>{for(var i=n>1?void 0:n?ZS(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&jS(t,r,i),i},GS=(e,t,r)=>t.has(e)||Jm("Cannot "+r),KS=(e,t,r)=>t.has(e)?Jm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ye=(e,t,r)=>(GS(e,t,"access private method"),r),Ke,To,zm,Qm,Hs,xr,oc,qm,eg,ac,tg,cc,rg,ng,ig,sg,og,ag,cg,lg,ug=(e=>(e.OpenLink="Open",e.CopyToClipboard="Copy to clipboard",e.Cancel="Cancel",e))(ug||{});const kn=(...e)=>`--vscode-${e.join("-")}`,wn=e=>kn("terminal",e),HS=e=>`ansi${e.charAt(0).toUpperCase()+e.slice(1)}`,XS=["terminal:","theme:",Pe.platformApiRequest,Pe.platformApiResponse,Pe.onOptionsMessage,Pe.optionsMessage,Pe.onCopyTextToClipboard,Pe.onProgramClose,Pe.featuresResponse,Pe.featuresUpdateAction],YS=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],$S="console-view";let rt=class extends At{constructor(){super(),KS(this,Ke),this.copyText="Copy",this.disposables=[],this.rows=10,this.isShareReady=!1,this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.windowSize={height:window.innerHeight,width:window.innerWidth}}applyThemeStyles(){if(this.shadowRoot){if(this.themeStyleSheet){const e=this.shadowRoot.adoptedStyleSheets.indexOf(this.themeStyleSheet);e!==-1&&(this.shadowRoot.adoptedStyleSheets=this.shadowRoot.adoptedStyleSheets.filter((t,r)=>r!==e)),this.themeStyleSheet=void 0}this.theme==="dark"?(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(PS.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet]):this.theme==="light"&&(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(WS.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet])}}connectedCallback(){var e;if(super.connectedCallback(),this.applyThemeStyles(),!this.id)throw new Error("No id provided to terminal!");this.rows=this.initialRows??this.rows;const{rows:t,cursorBlink:r,fontSize:n,cursorStyle:i,cursorWidth:o,fontFamily:l,smoothScrollDuration:s,scrollback:a}=this;this.terminal=new B2.Terminal({rows:t,fontSize:n,fontFamily:l,scrollback:a,cursorWidth:o,cursorBlink:r,cursorStyle:i,smoothScrollDuration:s,disableStdin:!1,convertEol:!0,allowProposedApi:!0,drawBoldTextInBrightColors:!1}),this.initialContent&&((e=this.terminal)==null||e.write(this.initialContent)),this.fitAddon=new CS,this.fitAddon.activate(this.terminal),this.serializer=new D2.SerializeAddon,this.terminal.loadAddon(this.serializer),this.terminal.loadAddon(new U2.Unicode11Addon),this.terminal.loadAddon(new P2.WebLinksAddon(Ye(this,Ke,og).bind(this))),this.terminal.attachCustomKeyEventHandler(m=>{var h;if(m.shiftKey&&m.ctrlKey&&m.code==="KeyC"){const b=(h=this==null?void 0:this.terminal)==null?void 0:h.getSelection();if(b)return navigator.clipboard.writeText(b),!1}return!0}),this.terminal.unicode.activeVersion="11",this.terminal.options.drawBoldTextInBrightColors;const c=Mt();this.disposables.push(r2(c,async m=>{var h;if(XS.some(b=>m.type.startsWith(b)))switch(m.type){case Pe.activeThemeChanged:Ye(this,Ke,Hs).call(this);break;case Pe.terminalStdout:case Pe.terminalStderr:{const{"runme.dev/id":b,data:_}=m.output;if(b!==this.id)return;this.isShareReady=!1,this.terminal.write(_),this.requestUpdate()}break;case Pe.platformApiResponse:{if(m.output.id!==this.id)return;if(this.isLoading=!1,m.output.hasErrors)return bt(c,Pe.errorMessage,m.output.data);if(m.output.data.hasOwnProperty("displayShare")&&m.output.data.displayShare===!1)return;const b=((h=m.output.data)==null?void 0:h.data)||{};if(b.createExtensionCellOutput||b.createCellExecution){const _=b.createCellExecution||b.createExtensionCellOutput||{},{exitCode:C,id:y,htmlUrl:d,isSlackReady:p}=_;return this.platformId=y,this.shareUrl=d||"",this.exitCode=C,this.isSlackReady=!!p,this.isShareReady=!0,bt(c,Pe.tangleEvent,{webviewId:Tm.RunmeCloud,data:{cellId:y}})}if(b.updateCellOutput){const{updateCellOutput:{exitCode:_,isSlackReady:C}}=b;this.isUpdatedReady=!0,this.exitCode=_,this.isSlackReady=!!C,Ye(this,Ke,tg).call(this)}b.createEscalation&&(this.escalationUrl=b.createEscalation.escalationUrl)}break;case Pe.onOptionsMessage:{if(m.output.id!==this.id)return;const b=m.output.option;switch(this.isLoading=!1,b){case"Open":return bt(c,Pe.openExternalLink,{link:this.shareUrl,telemetryEvent:"app.openLink"});case"Copy to clipboard":return bt(c,Pe.copyTextToClipboard,{id:this.id,text:this.shareUrl})}}break;case Pe.onCopyTextToClipboard:return m.output.id!==this.id?void 0:bt(c,Pe.infoMessage,"Link copied!");case Pe.onProgramClose:{const{"runme.dev/id":b,code:_}=m.output;if(b!==this.id)return;this.exitCode=_;return}}}),this.terminal.onData(m=>bt(c,Pe.terminalStdin,{"runme.dev/id":this.id,input:m}))),bt(c,Pe.featuresRequest,{})}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}updated(e){super.updated(e),e.has("theme")&&(this.applyThemeStyles(),Ye(this,Ke,Hs).call(this))}firstUpdated(e){var t;super.firstUpdated(e);const r=Ye(this,Ke,Qm).call(this);this.takeFocus&&window.addEventListener("focus",()=>{Ye(this,Ke,ac).call(this)}),window.addEventListener("click",()=>{Ye(this,Ke,ac).call(this,!1)}),this.terminal.open(r),this.takeFocus&&this.terminal.focus(),Ye(this,Ke,To).call(this),Ye(this,Ke,Hs).call(this);const n=Ye(this,Ke,zm).call(this),i=new _r(l=>{window.addEventListener("resize",()=>l.next(Ye(this,Ke,oc).call(this,!0))),r.addEventListener("mouseup",()=>l.next(Ye(this,Ke,oc).call(this,!1)))}).pipe(SS());Ye(this,Ke,qm).call(this,i),Ye(this,Ke,eg).call(this,i),r.appendChild(n);const o=Mt();o.postMessage&&bt(o,Pe.terminalOpen,{"runme.dev/id":this.id,terminalDimensions:dg((t=this.fitAddon)==null?void 0:t.proposeDimensions())}),this.lastLine&&this.terminal.scrollToLine(this.lastLine)}render(){const e=xe`
1458
1458
  <close-cell-button
1459
- @closed="${()=>ES({id:this.id,outputType:km.terminal})}"
1459
+ @closed="${()=>IS({id:this.id,outputType:km.terminal})}"
1460
1460
  ></close-cell-button>
1461
1461
  <div class="button-group">
1462
1462
  <copy-button
@@ -1497,7 +1497,7 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
1497
1497
  `;return xe`<section>
1498
1498
  <div id="terminal"></div>
1499
1499
  ${ct(this.buttons,()=>e)}
1500
- </section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}};Ke=new WeakSet;To=function(e){var t;return e!==void 0&&(this.rows=e),(t=this.fitAddon)==null?void 0:t.fit(this.rows)};zm=function(){const e=document.createElement("div");e.setAttribute("class","xterm-drag-handle");let t;const r=o=>{var l;t={initialClientY:o.clientY,initialRows:this.rows},o.preventDefault(),(l=this.terminal)==null||l.focus()},n=()=>{t!==void 0&&(t=void 0)},i=o=>{var l;if(t===void 0||!this.fitAddon)return;const s=(o.clientY-t.initialClientY)/this.fitAddon.getCellSize().height,a=Math.round(t.initialRows+s);a!==this.rows&&(Ye(this,Ke,To).call(this,a),(l=this.terminal)==null||l.focus())};return e.addEventListener("mousedown",r),window.addEventListener("mouseup",n),window.addEventListener("mousemove",i),this.disposables.push({dispose:()=>{e.removeEventListener("mousedown",r),window.removeEventListener("mouseup",n),window.removeEventListener("mousemove",i)}}),e};Qm=function(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("#terminal")};Hs=function(){const e=Ye(this,Ke,xr).call(this,wn("foreground")),t={foreground:e,cursor:Ye(this,Ke,xr).call(this,kn("terminalCursor","foreground"))||e,cursorAccent:Ye(this,Ke,xr).call(this,kn("terminalCursor","background")),selectionForeground:Ye(this,Ke,xr).call(this,wn("selectionForeground")),selectionBackground:Ye(this,Ke,xr).call(this,wn("selectionBackground")),selectionInactiveBackground:Ye(this,Ke,xr).call(this,wn("inactiveSelectionBackground")),...Object.fromEntries(YS.map(r=>[r,Ye(this,Ke,xr).call(this,wn(HS(r)))]))};this.terminal.options.theme=t};xr=function(e){var t;const r=(t=this.shadowRoot)==null?void 0:t.querySelector("#terminal");return getComputedStyle(r).getPropertyValue(e)??void 0};oc=function(e){if(!this.fitAddon)return;const{innerWidth:t,innerHeight:r}=window;if(e&&Math.abs(this.windowSize.width-t)<=Number.EPSILON&&Math.abs(this.windowSize.height-r)<=Number.EPSILON)return;this.windowSize.width=t;const n=Ye(this,Ke,To).call(this);if(n)return dg(n)};qm=async function(e){const t=e.pipe(Zm(r=>!!r),Km(),Gm(100)).subscribe(async r=>{const n=Mt();n.postMessage&&await bt(n,Pe.terminalResize,{"runme.dev/id":this.id,terminalDimensions:r})});this.disposables.push({dispose:()=>t.unsubscribe()})};eg=async function(e){const t=e.pipe(gS(r=>r==null?void 0:r.rows),Zm(r=>!!r),Km(),Gm(100)).subscribe(async r=>{const n=Mt();n.postMessage&&n.postMessage({type:Pe.mutateAnnotations,output:{annotations:{"runme.dev/id":this.id,terminalRows:r}}})});this.disposables.push({dispose:()=>t.unsubscribe()})};ac=async function(e=!0){var t;e&&((t=this.terminal)==null||t.focus());const r=Mt();r.postMessage&&await bt(r,Pe.terminalFocus,{"runme.dev/id":this.id})};tg=async function(){const e=Mt();if(!(!e.postMessage||!this.shareUrl))return bt(e,Pe.optionsMessage,{title:'Please share link with caution. Anyone with the link has access. Click "Open" to toggle visibility.',options:Object.values(ug),id:this.id,telemetryEvent:"app.share"})};cc=async function(){return Ye(this,Ke,sg).call(this,!0)};rg=async function(){this.isCreatingEscalation=!0};ng=async function(){const e=Mt();if(this.escalationUrl)return bt(e,Pe.openLink,this.escalationUrl)};ig=function(){const e=Mt();if(e.postMessage)return bt(e,Pe.gistCell,{cellId:this.id,telemetryEvent:"app.cellGist"})};sg=async function(e){Mt().postMessage};og=function(e,t){bt(Mt(),Pe.openLink,t)};ag=function(){bt(Mt(),Pe.openLink,this.shareUrl)};cg=function(){bt(Mt(),Pe.errorMessage,`There is no Slack integration configured yet.
1500
+ </section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}};Ke=new WeakSet;To=function(e){var t;return e!==void 0&&(this.rows=e),(t=this.fitAddon)==null?void 0:t.fit(this.rows)};zm=function(){const e=document.createElement("div");e.setAttribute("class","xterm-drag-handle");let t;const r=o=>{var l;t={initialClientY:o.clientY,initialRows:this.rows},o.preventDefault(),(l=this.terminal)==null||l.focus()},n=()=>{t!==void 0&&(t=void 0)},i=o=>{var l;if(t===void 0||!this.fitAddon)return;const s=(o.clientY-t.initialClientY)/this.fitAddon.getCellSize().height,a=Math.round(t.initialRows+s);a!==this.rows&&(Ye(this,Ke,To).call(this,a),(l=this.terminal)==null||l.focus())};return e.addEventListener("mousedown",r),window.addEventListener("mouseup",n),window.addEventListener("mousemove",i),this.disposables.push({dispose:()=>{e.removeEventListener("mousedown",r),window.removeEventListener("mouseup",n),window.removeEventListener("mousemove",i)}}),e};Qm=function(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("#terminal")};Hs=function(){const e=Ye(this,Ke,xr).call(this,wn("foreground")),t={foreground:e,cursor:Ye(this,Ke,xr).call(this,kn("terminalCursor","foreground"))||e,cursorAccent:Ye(this,Ke,xr).call(this,kn("terminalCursor","background")),selectionForeground:Ye(this,Ke,xr).call(this,wn("selectionForeground")),selectionBackground:Ye(this,Ke,xr).call(this,wn("selectionBackground")),selectionInactiveBackground:Ye(this,Ke,xr).call(this,wn("inactiveSelectionBackground")),...Object.fromEntries(YS.map(r=>[r,Ye(this,Ke,xr).call(this,wn(HS(r)))]))};this.terminal.options.theme=t};xr=function(e){var t;const r=(t=this.shadowRoot)==null?void 0:t.querySelector("#terminal");return getComputedStyle(r).getPropertyValue(e)??void 0};oc=function(e){if(!this.fitAddon)return;const{innerWidth:t,innerHeight:r}=window;if(e&&Math.abs(this.windowSize.width-t)<=Number.EPSILON&&Math.abs(this.windowSize.height-r)<=Number.EPSILON)return;this.windowSize.width=t;const n=Ye(this,Ke,To).call(this);if(n)return dg(n)};qm=async function(e){const t=e.pipe(Km(r=>!!r),Xm(),Hm(100)).subscribe(async r=>{const n=Mt();n.postMessage&&await bt(n,Pe.terminalResize,{"runme.dev/id":this.id,terminalDimensions:r})});this.disposables.push({dispose:()=>t.unsubscribe()})};eg=async function(e){const t=e.pipe(_S(r=>r==null?void 0:r.rows),Km(r=>!!r),Xm(),Hm(100)).subscribe(async r=>{const n=Mt();n.postMessage&&n.postMessage({type:Pe.mutateAnnotations,output:{annotations:{"runme.dev/id":this.id,terminalRows:r}}})});this.disposables.push({dispose:()=>t.unsubscribe()})};ac=async function(e=!0){var t;e&&((t=this.terminal)==null||t.focus());const r=Mt();r.postMessage&&await bt(r,Pe.terminalFocus,{"runme.dev/id":this.id})};tg=async function(){const e=Mt();if(!(!e.postMessage||!this.shareUrl))return bt(e,Pe.optionsMessage,{title:'Please share link with caution. Anyone with the link has access. Click "Open" to toggle visibility.',options:Object.values(ug),id:this.id,telemetryEvent:"app.share"})};cc=async function(){return Ye(this,Ke,sg).call(this,!0)};rg=async function(){this.isCreatingEscalation=!0};ng=async function(){const e=Mt();if(this.escalationUrl)return bt(e,Pe.openLink,this.escalationUrl)};ig=function(){const e=Mt();if(e.postMessage)return bt(e,Pe.gistCell,{cellId:this.id,telemetryEvent:"app.cellGist"})};sg=async function(e){Mt().postMessage};og=function(e,t){bt(Mt(),Pe.openLink,t)};ag=function(){bt(Mt(),Pe.openLink,this.shareUrl)};cg=function(){bt(Mt(),Pe.errorMessage,`There is no Slack integration configured yet.
1501
1501
  Open Dashboard to configure it`)};lg=function(){var e;const t=Mt();if(!t.postMessage)return;const r=JS(((e=this.serializer)==null?void 0:e.serialize({excludeModes:!0,excludeAltBuffer:!0}))??"");return navigator.clipboard.writeText(r).then(()=>{this.copyText="Copied!",this.requestUpdate()}).catch(n=>bt(t,Pe.infoMessage,`Failed to copy to clipboard: ${n.message}!`))};rt.styles=tr`
1502
1502
  .xterm {
1503
1503
  cursor: text;
@@ -1995,7 +1995,7 @@ Open Dashboard to configure it`)};lg=function(){var e;const t=Mt();if(!t.postMes
1995
1995
  appearance="icon"
1996
1996
  class="cursor-pointer"
1997
1997
  @click=${this.onCopy}
1998
- >${ct(this._copied,()=>xe`${Iw}`,()=>xe`${Hm}`)}</vscode-button
1998
+ >${ct(this._copied,()=>xe`${Iw}`,()=>xe`${Lm}`)}</vscode-button
1999
1999
  >`,()=>xe``)}
2000
2000
  </div>
2001
2001
  </div>
@@ -2058,7 +2058,7 @@ Open Dashboard to configure it`)};lg=function(){var e;const t=Mt();if(!t.postMes
2058
2058
  `;var xw=Object.defineProperty,Bw=Object.getOwnPropertyDescriptor,Dg=e=>{throw TypeError(e)},Fg=(e,t,r,n)=>{for(var i=n>1?void 0:n?Bw(t,r):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(i=(n?l(t,r,i):l(i))||i);return n&&i&&xw(t,r,i),i},Ow=(e,t,r)=>t.has(e)||Dg("Cannot "+r),Lw=(e,t,r)=>t.has(e)?Dg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),yn=(e,t,r)=>(Ow(e,t,"access private method"),r),Br,Vg,Ug,pi;const Dw="__",Fw=[{text:"Name"},{text:"Value"},{text:"Description"},{text:"Spec"},{text:"Source"},{text:"Updated"}],Vw=["resolvedValue","errors","status","specClass"];let fc=class extends At{constructor(){super(...arguments),Lw(this,Br),this.disposables=[]}dispose(){this.disposables.forEach(({dispose:e})=>e())}render(){var e;return yn(this,Br,Ug).call(this),xe` <div>
2059
2059
  <table-view
2060
2060
  .columns="${Fw}"
2061
- .rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:wS(new Date(t.updateTime)),resolvedValue:t.resolvedValue,errors:t.errors}))}"
2061
+ .rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:kS(new Date(t.updateTime)),resolvedValue:t.resolvedValue,errors:t.errors}))}"
2062
2062
  .displayable="${(t,r)=>!Vw.includes(r)}"
2063
2063
  .hasErrors="${t=>{var r;return!(!((r=t.errors)!=null&&r.length)||t.name===Dw)}}"
2064
2064
  .renderer="${(t,r)=>{switch(r){case"originalValue":const n=t.status===mr.LITERAL;let i=t.status===mr.MASKED?`${t.resolvedValue} [masked]`:t.resolvedValue;return t.status===mr.UNSPECIFIED?i="[unset]":t.status===mr.HIDDEN&&(i="[hidden]"),i=i.replace(/\n/g," ").replace(/\r/g,""),xe`<env-viewer
@@ -2067,7 +2067,7 @@ Open Dashboard to configure it`)};lg=function(){var e;const t=Mt();if(!t.postMes
2067
2067
  .maskedValue="${yn(this,Br,pi).call(this,t,r,()=>i)}"
2068
2068
  .status="${t.status}"
2069
2069
  @onCopy="${async()=>yn(this,Br,Vg).call(this,t.originalValue)}"
2070
- ></env-viewer>`;case"updatedAt":return yn(this,Br,pi).call(this,t,r,()=>t[r]?CS(new Date(t[r])):"");case"spec":return yn(this,Br,pi).call(this,t,r,()=>xe`<span class="${t.specClass}">${t[r]}</span>`);default:return yn(this,Br,pi).call(this,t,r,()=>t[r])}}}"
2070
+ ></env-viewer>`;case"updatedAt":return yn(this,Br,pi).call(this,t,r,()=>t[r]?TS(new Date(t[r])):"");case"spec":return yn(this,Br,pi).call(this,t,r,()=>xe`<span class="${t.specClass}">${t[r]}</span>`);default:return yn(this,Br,pi).call(this,t,r,()=>t[r])}}}"
2071
2071
  ></table-view>
2072
2072
  </div>`}};Br=new WeakSet;Vg=function(e){return navigator.clipboard.writeText(e)};Ug=function(){var e;(e=this.variables)==null||e.sort((t,r)=>t.errors.length>0?-1:r.errors.length>0?1:0)};pi=function(e,t,r){var n;const i=t==="name"?xe`${Rw(10,10)}`:xe``;return(n=e.errors)!=null&&n.length?xe`<div class="flex">
2073
2073
  <tooltip-text
@@ -2084,7 +2084,7 @@ Open Dashboard to configure it`)};lg=function(){var e;const t=Mt();if(!t.postMes
2084
2084
  </div>`:xe`${r()}`};Fg([Oe({type:Array})],fc.prototype,"variables",2);fc=Fg([Xt("env-store")],fc);const Uw=Ji("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Mw=cl(Uw,0),Pw=ll(Mw),Ww=Ji("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Mg=Ji("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[Ww,Co]),pc=$n(Mg,3),jw=$n(Mg,4);var mc=function(e,t){return mc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},mc(e,t)};function Mr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mc(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Zw(e,t,r,n){function i(o){return o instanceof r?o:new r(function(l){l(o)})}return new(r||(r=Promise))(function(o,l){function s(m){try{c(n.next(m))}catch(h){l(h)}}function a(m){try{c(n.throw(m))}catch(h){l(h)}}function c(m){m.done?o(m.value):i(m.value).then(s,a)}c((n=n.apply(e,[])).next())})}function Pg(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=s(0),l.throw=s(1),l.return=s(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(c){return function(m){return a([c,m])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(m){c=[6,m],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Xn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],l;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){l={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return o}function Dr(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function Tn(e){return this instanceof Tn?(this.v=e,this):new Tn(e)}function Gw(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",l),i[Symbol.asyncIterator]=function(){return this},i;function l(_){return function(C){return Promise.resolve(C).then(_,h)}}function s(_,C){n[_]&&(i[_]=function(y){return new Promise(function(d,p){o.push([_,y,d,p])>1||a(_,y)})},C&&(i[_]=C(i[_])))}function a(_,C){try{c(n[_](C))}catch(y){b(o[0][3],y)}}function c(_){_.value instanceof Tn?Promise.resolve(_.value.v).then(m,h):b(o[0][2],_)}function m(_){a("next",_)}function h(_){a("throw",_)}function b(_,C){_(C),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Kw(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Xn=="function"?Xn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(l){return new Promise(function(s,a){l=e[o](l),i(s,a,l.done,l.value)})}}function i(o,l,s,a){Promise.resolve(a).then(function(c){o({value:c,done:s})},l)}}function Qe(e){return typeof e=="function"}function Wg(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var xa=Wg(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
2085
2085
  `+t.map(function(r,n){return n+1+") "+r.toString()}).join(`
2086
2086
  `):"",this.name="UnsubscriptionError",this.errors=t}});function bo(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var es=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var s=Xn(l),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(y){t={error:y}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else l.remove(this);var m=this.initialTeardown;if(Qe(m))try{m()}catch(y){o=y instanceof xa?y.errors:[y]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var b=Xn(h),_=b.next();!_.done;_=b.next()){var C=_.value;try{bf(C)}catch(y){o=o??[],y instanceof xa?o=Dr(Dr([],Sr(o)),Sr(y.errors)):o.push(y)}}}catch(y){n={error:y}}finally{try{_&&!_.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}if(o)throw new xa(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)bf(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&bo(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&bo(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),jg=es.EMPTY;function Zg(e){return e instanceof es||e&&"closed"in e&&Qe(e.remove)&&Qe(e.add)&&Qe(e.unsubscribe)}function bf(e){Qe(e)?e():e.unsubscribe()}var Hw={Promise:void 0},Xw={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,Dr([e,t],Sr(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Gg(e){Xw.setTimeout(function(){throw e})}function Xi(){}function $s(e){e()}var Dl=(function(e){Mr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Zg(r)&&r.add(n)):n.destination=Jw,n}return t.create=function(r,n,i){return new Yi(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(es),Yw=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Os(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Os(n)}else Os(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Os(r)}},e})(),Yi=(function(e){Mr(t,e);function t(r,n,i){var o=e.call(this)||this,l;return Qe(r)||!r?l={next:r??void 0,error:n??void 0,complete:i??void 0}:l=r,o.destination=new Yw(l),o}return t})(Dl);function Os(e){Gg(e)}function $w(e){throw e}var Jw={closed:!0,next:Xi,error:$w,complete:Xi},Fl=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Ro(e){return e}function zw(e){return e.length===0?Ro:e.length===1?e[0]:function(t){return e.reduce(function(r,n){return n(r)},t)}}var dt=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=qw(t)?t:new Yi(t,r,n);return $s(function(){var l=i,s=l.operator,a=l.source;o.add(s?s.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=_f(r),new r(function(i,o){var l=new Yi({next:function(s){try{t(s)}catch(a){o(a),l.unsubscribe()}},error:o,complete:i});n.subscribe(l)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Fl]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return zw(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=_f(t),new t(function(n,i){var o;r.subscribe(function(l){return o=l},function(l){return i(l)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function _f(e){var t;return(t=e??Hw.Promise)!==null&&t!==void 0?t:Promise}function Qw(e){return e&&Qe(e.next)&&Qe(e.error)&&Qe(e.complete)}function qw(e){return e&&e instanceof Dl||Qw(e)&&Zg(e)}function e3(e){return Qe(e==null?void 0:e.lift)}function Et(e){return function(t){if(e3(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ut(e,t,r,n,i){return new t3(e,t,r,n,i)}var t3=(function(e){Mr(t,e);function t(r,n,i,o,l,s){var a=e.call(this,r)||this;return a.onFinalize=l,a.shouldUnsubscribe=s,a._next=n?function(c){try{n(c)}catch(m){r.error(m)}}:e.prototype._next,a._error=o?function(c){try{o(c)}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(Dl),r3=Wg(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ht=(function(e){Mr(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new yf(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new r3},t.prototype.next=function(r){var n=this;$s(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var l=Xn(n.currentObservers),s=l.next();!s.done;s=l.next()){var a=s.value;a.next(r)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;$s(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;$s(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,l=i.isStopped,s=i.observers;return o||l?jg:(this.currentObservers=null,s.push(r),new es(function(){n.currentObservers=null,bo(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,l=n.isStopped;i?r.error(o):l&&r.complete()},t.prototype.asObservable=function(){var r=new dt;return r.source=this,r},t.create=function(r,n){return new yf(r,n)},t})(dt),yf=(function(e){Mr(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:jg},t})(Ht),n3={now:function(){return Date.now()}},i3=(function(e){Mr(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(es),Sf={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,Dr([e,t],Sr(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},s3=(function(e){Mr(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,l=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(l,o,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(l,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),Sf.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Sf.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o;try{this.work(r)}catch(l){i=!0,o=l||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,bo(o,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(i3),Ef=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=n3.now,e})(),o3=(function(e){Mr(t,e);function t(r,n){n===void 0&&(n=Ef.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(Ef),xo=new o3(s3),a3=xo,Kg=new dt(function(e){return e.complete()});function Hg(e){return e&&Qe(e.schedule)}function Vl(e){return e[e.length-1]}function c3(e){return Qe(Vl(e))?e.pop():void 0}function Xg(e){return Hg(Vl(e))?e.pop():void 0}function l3(e,t){return typeof Vl(e)=="number"?e.pop():t}var Ul=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Yg(e){return Qe(e==null?void 0:e.then)}function $g(e){return Qe(e[Fl])}function Jg(e){return Symbol.asyncIterator&&Qe(e==null?void 0:e[Symbol.asyncIterator])}function zg(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function u3(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Qg=u3();function qg(e){return Qe(e==null?void 0:e[Qg])}function ev(e){return Gw(this,arguments,function(){var t,r,n,i;return Pg(this,function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Tn(t.read())];case 3:return r=o.sent(),n=r.value,i=r.done,i?[4,Tn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Tn(n)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function tv(e){return Qe(e==null?void 0:e.getReader)}function mt(e){if(e instanceof dt)return e;if(e!=null){if($g(e))return d3(e);if(Ul(e))return h3(e);if(Yg(e))return f3(e);if(Jg(e))return rv(e);if(qg(e))return p3(e);if(tv(e))return m3(e)}throw zg(e)}function d3(e){return new dt(function(t){var r=e[Fl]();if(Qe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function h3(e){return new dt(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function f3(e){return new dt(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Gg)})}function p3(e){return new dt(function(t){var r,n;try{for(var i=Xn(e),o=i.next();!o.done;o=i.next()){var l=o.value;if(t.next(l),t.closed)return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()})}function rv(e){return new dt(function(t){g3(e,t).catch(function(r){return t.error(r)})})}function m3(e){return rv(ev(e))}function g3(e,t){var r,n,i,o;return Zw(this,void 0,void 0,function(){var l,s;return Pg(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),r=Kw(e),a.label=1;case 1:return[4,r.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(l=n.value,t.next(l),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=a.sent(),i={error:s},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function sn(e,t,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var o=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!i)return o}function nv(e,t){return t===void 0&&(t=0),Et(function(r,n){r.subscribe(ut(n,function(i){return sn(n,e,function(){return n.next(i)},t)},function(){return sn(n,e,function(){return n.complete()},t)},function(i){return sn(n,e,function(){return n.error(i)},t)}))})}function iv(e,t){return t===void 0&&(t=0),Et(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function v3(e,t){return mt(e).pipe(iv(t),nv(t))}function b3(e,t){return mt(e).pipe(iv(t),nv(t))}function _3(e,t){return new dt(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function y3(e,t){return new dt(function(r){var n;return sn(r,t,function(){n=e[Qg](),sn(r,t,function(){var i,o,l;try{i=n.next(),o=i.value,l=i.done}catch(s){r.error(s);return}l?r.complete():r.next(o)},0,!0)}),function(){return Qe(n==null?void 0:n.return)&&n.return()}})}function sv(e,t){if(!e)throw new Error("Iterable cannot be null");return new dt(function(r){sn(r,t,function(){var n=e[Symbol.asyncIterator]();sn(r,t,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function S3(e,t){return sv(ev(e),t)}function E3(e,t){if(e!=null){if($g(e))return v3(e,t);if(Ul(e))return _3(e,t);if(Yg(e))return b3(e,t);if(Jg(e))return sv(e,t);if(qg(e))return y3(e,t);if(tv(e))return S3(e,t)}throw zg(e)}function ov(e,t){return t?E3(e,t):mt(e)}function w3(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xg(e);return ov(e,r)}function C3(e){return e instanceof Date&&!isNaN(e)}function Kt(e,t){return Et(function(r,n){var i=0;r.subscribe(ut(n,function(o){n.next(e.call(t,o,i++))}))})}var I3=Array.isArray;function k3(e,t){return I3(t)?e.apply(void 0,Dr([],Sr(t))):e(t)}function T3(e){return Kt(function(t){return k3(e,t)})}function N3(e,t,r,n,i,o,l,s){var a=[],c=0,m=0,h=!1,b=function(){h&&!a.length&&!c&&t.complete()},_=function(y){return c<n?C(y):a.push(y)},C=function(y){c++;var d=!1;mt(r(y,m++)).subscribe(ut(t,function(p){t.next(p)},function(){d=!0},void 0,function(){if(d)try{c--;for(var p=function(){var f=a.shift();l||C(f)};a.length&&c<n;)p();b()}catch(f){t.error(f)}}))};return e.subscribe(ut(t,_,function(){h=!0,b()})),function(){}}function en(e,t,r){return r===void 0&&(r=1/0),Qe(t)?en(function(n,i){return Kt(function(o,l){return t(n,o,i,l)})(mt(e(n,i)))},r):(typeof t=="number"&&(r=t),Et(function(n,i){return N3(n,i,e,r)}))}function A3(e){return e===void 0&&(e=1/0),en(Ro,e)}function R3(e){return new dt(function(t){mt(e()).subscribe(t)})}var x3={connector:function(){return new Ht},resetOnDisconnect:!0};function zr(e,t){t===void 0&&(t=x3);var r=null,n=t.connector,i=t.resetOnDisconnect,o=i===void 0?!0:i,l=n(),s=new dt(function(a){return l.subscribe(a)});return s.connect=function(){return(!r||r.closed)&&(r=R3(function(){return e}).subscribe(l),o&&r.add(function(){return l=n()})),r},s}var B3=["addListener","removeListener"],O3=["addEventListener","removeEventListener"],L3=["on","off"];function gc(e,t,r,n){if(Qe(r)&&(n=r,r=void 0),n)return gc(e,t,r).pipe(T3(n));var i=Sr(V3(e)?O3.map(function(s){return function(a){return e[s](t,a,r)}}):D3(e)?B3.map(wf(e,t)):F3(e)?L3.map(wf(e,t)):[],2),o=i[0],l=i[1];if(!o&&Ul(e))return en(function(s){return gc(s,t,r)})(mt(e));if(!o)throw new TypeError("Invalid event target");return new dt(function(s){var a=function(){for(var c=[],m=0;m<arguments.length;m++)c[m]=arguments[m];return s.next(1<c.length?c:c[0])};return o(a),function(){return l(a)}})}function wf(e,t){return function(r){return function(n){return e[r](t,n)}}}function D3(e){return Qe(e.addListener)&&Qe(e.removeListener)}function F3(e){return Qe(e.on)&&Qe(e.off)}function V3(e){return Qe(e.addEventListener)&&Qe(e.removeEventListener)}function Ei(e,t,r){e===void 0&&(e=0),r===void 0&&(r=a3);var n=-1;return t!=null&&(Hg(t)?r=t:n=t),new dt(function(i){var o=C3(e)?+e-r.now():e;o<0&&(o=0);var l=0;return r.schedule(function(){i.closed||(i.next(l++),0<=n?this.schedule(void 0,n):i.complete())},o)})}function U3(e,t){return t===void 0&&(t=xo),Ei(e,e,t)}function M3(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xg(e),n=l3(e,1/0),i=e;return i.length?i.length===1?mt(i[0]):A3(n)(ov(i,r)):Kg}var P3=Array.isArray;function W3(e){return e.length===1&&P3(e[0])?e[0]:e}function Rr(e,t){return Et(function(r,n){var i=0;r.subscribe(ut(n,function(o){return e.call(t,o,i++)&&n.next(o)}))})}function j3(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=W3(e),e.length===1?mt(e[0]):new dt(Z3(e))}function Z3(e){return function(t){for(var r=[],n=function(o){r.push(mt(e[o]).subscribe(ut(t,function(l){if(r){for(var s=0;s<r.length;s++)s!==o&&r[s].unsubscribe();r=null}t.next(l)})))},i=0;r&&!t.closed&&i<e.length;i++)n(i)}}function G3(e){return Et(function(t,r){var n=null,i=null,o=function(){i==null||i.unsubscribe();var l=n;n=[],l&&r.next(l),mt(e()).subscribe(i=ut(r,o,Xi))};o(),t.subscribe(ut(r,function(l){return n==null?void 0:n.push(l)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}function av(e){return Et(function(t,r){var n=null,i=!1,o;n=t.subscribe(ut(r,void 0,void 0,function(l){o=mt(e(l,av(e)(t))),n?(n.unsubscribe(),n=null,o.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,o.subscribe(r))})}function K3(e,t,r,n,i){return function(o,l){var s=r,a=t,c=0;o.subscribe(ut(l,function(m){var h=c++;a=s?e(a,m,h):(s=!0,m),l.next(a)},i))}}function Cf(e){return e<=0?function(){return Kg}:Et(function(t,r){var n=0;t.subscribe(ut(r,function(i){++n<=e&&(r.next(i),e<=n&&r.complete())}))})}function H3(e){return Et(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function X3(e,t){return Et(K3(e,t,arguments.length>=2,!0))}function Y3(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Ht}:t,n=e.resetOnError,i=n===void 0?!0:n,o=e.resetOnComplete,l=o===void 0?!0:o,s=e.resetOnRefCountZero,a=s===void 0?!0:s;return function(c){var m,h,b,_=0,C=!1,y=!1,d=function(){h==null||h.unsubscribe(),h=void 0},p=function(){d(),m=b=void 0,C=y=!1},f=function(){var g=m;p(),g==null||g.unsubscribe()};return Et(function(g,S){_++,!y&&!C&&d();var k=b=b??r();S.add(function(){_--,_===0&&!y&&!C&&(h=Ba(f,a))}),k.subscribe(S),!m&&_>0&&(m=new Yi({next:function(I){return k.next(I)},error:function(I){y=!0,d(),h=Ba(p,i,I),k.error(I)},complete:function(){C=!0,d(),h=Ba(p,l),k.complete()}}),mt(g).subscribe(m))})(c)}}function Ba(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t===!0){e();return}if(t!==!1){var i=new Yi({next:function(){i.unsubscribe(),e()}});return mt(t.apply(void 0,Dr([],Sr(r)))).subscribe(i)}}function $3(e){return Et(function(t,r){var n=!1,i=ut(r,function(){i==null||i.unsubscribe(),n=!0},Xi);mt(e).subscribe(i),t.subscribe(ut(r,function(o){return n&&r.next(o)}))})}function If(e,t){return Et(function(r,n){var i=null,o=0,l=!1,s=function(){return l&&!i&&n.complete()};r.subscribe(ut(n,function(a){i==null||i.unsubscribe();var c=0,m=o++;mt(e(a,m)).subscribe(i=ut(n,function(h){return n.next(t?t(a,h,m,c++):h)},function(){i=null,s()}))},function(){l=!0,s()}))})}function Ls(e,t){return t===void 0&&(t=!1),Et(function(r,n){var i=0;r.subscribe(ut(n,function(o){var l=e(o,i++);(l||t)&&n.next(o),!l&&n.complete()}))})}function J3(e,t,r){var n=Qe(e)||t||r?{next:e,error:t,complete:r}:e;return n?Et(function(i,o){var l;(l=n.subscribe)===null||l===void 0||l.call(n);var s=!0;i.subscribe(ut(o,function(a){var c;(c=n.next)===null||c===void 0||c.call(n,a),o.next(a)},function(){var a;s=!1,(a=n.complete)===null||a===void 0||a.call(n),o.complete()},function(a){var c;s=!1,(c=n.error)===null||c===void 0||c.call(n,a),o.error(a)},function(){var a,c;s&&((a=n.unsubscribe)===null||a===void 0||a.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Ro}function z3(e,t){return Et(function(r,n){var i=t??{},o=i.leading,l=o===void 0?!0:o,s=i.trailing,a=s===void 0?!1:s,c=!1,m=null,h=null,b=!1,_=function(){h==null||h.unsubscribe(),h=null,a&&(d(),b&&n.complete())},C=function(){h=null,b&&n.complete()},y=function(p){return h=mt(e(p)).subscribe(ut(n,_,C))},d=function(){if(c){c=!1;var p=m;m=null,n.next(p),!b&&y(p)}};r.subscribe(ut(n,function(p){c=!0,m=p,!(h&&!h.closed)&&(l?d():y(p))},function(){b=!0,!(a&&c&&h&&!h.closed)&&n.complete()}))})}function kf(e,t,r){t===void 0&&(t=xo);var n=Ei(e,t);return z3(function(){return n},r)}function Oa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c3(e);return Et(function(n,i){for(var o=e.length,l=new Array(o),s=e.map(function(){return!1}),a=!1,c=function(h){mt(e[h]).subscribe(ut(i,function(b){l[h]=b,!a&&!s[h]&&(s[h]=!0,(a=s.every(Ro))&&(s=null))},Xi))},m=0;m<o;m++)c(m);n.subscribe(ut(i,function(h){if(a){var b=Dr([h],Sr(l));i.next(r?r.apply(void 0,Dr([],Sr(b))):b)}}))})}const cv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",_o=32,Q3=16,lv=10,Tf=0xffffffffffff;var tn;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(tn||(tn={}));class mi extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function q3(e){const t=Math.floor(e()*_o)%_o;return cv.charAt(t)}function eC(e){const t=tC(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new mi(tn.PRNGDetectFailure,"Failed to find a reliable PRNG")}function tC(){return iC()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function rC(e,t){let r="";for(;e>0;e--)r=q3(t)+r;return r}function nC(e,t=lv){if(isNaN(e))throw new mi(tn.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Tf)throw new mi(tn.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Tf}: ${e}`);if(e<0)throw new mi(tn.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new mi(tn.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%_o,n=cv.charAt(r)+n,e=(e-r)/_o;return n}function iC(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function sC(e,t){const r=eC(),n=Date.now();return nC(n,lv)+rC(Q3,r)}const vt=[];for(let e=0;e<256;++e)vt.push((e+256).toString(16).slice(1));function oC(e,t=0){return(vt[e[t+0]]+vt[e[t+1]]+vt[e[t+2]]+vt[e[t+3]]+"-"+vt[e[t+4]]+vt[e[t+5]]+"-"+vt[e[t+6]]+vt[e[t+7]]+"-"+vt[e[t+8]]+vt[e[t+9]]+"-"+vt[e[t+10]]+vt[e[t+11]]+vt[e[t+12]]+vt[e[t+13]]+vt[e[t+14]]+vt[e[t+15]]).toLowerCase()}let La;const aC=new Uint8Array(16);function cC(){if(!La){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");La=crypto.getRandomValues.bind(crypto)}return La(aC)}const lC=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Nf={randomUUID:lC};function uC(e,t,r){var n;if(Nf.randomUUID&&!e)return Nf.randomUUID();e=e||{};const i=e.random??((n=e.rng)==null?void 0:n.call(e))??cC();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,oC(i)}const dC=5e3,hC=1e3,Ds=4e3,Af=1e3;var uv=(e=>(e.CONTINUOUS="CONTINUOUS",e.INITIAL="INITIAL",e))(uv||{});class dv{constructor({knownID:t,runID:r,sequence:n,options:i}){tt(this,"callback"),tt(this,"queue",new Ht),tt(this,"subscriptions",[]),tt(this,"reconnect",new Ht),tt(this,"client",new dt),tt(this,"_latencies",new Ht),tt(this,"_latenciesConnectable",zr(this._latencies.asObservable().pipe(X3((o,l)=>{if(l.latency<0){const s=o.get(l.streamID);s&&o.set(l.streamID,{...s,readyState:l.readyState})}else o.set(l.streamID,l);return o},new Map)))),tt(this,"_errors",new Ht),tt(this,"_errorsConnectable",zr(this._errors.asObservable())),tt(this,"_stdout",new Ht),tt(this,"_stderr",new Ht),tt(this,"_exitCode",new Ht),tt(this,"_pid",new Ht),tt(this,"_mimeType",new Ht),tt(this,"_stdoutConnectable",zr(this._stdout.asObservable())),tt(this,"_stderrConnectable",zr(this._stderr.asObservable())),tt(this,"_exitCodeConnectable",zr(this._exitCode.asObservable())),tt(this,"_pidConnectable",zr(this._pid.asObservable())),tt(this,"_mimeTypeConnectable",zr(this._mimeType.asObservable())),tt(this,"knownID"),tt(this,"runID"),tt(this,"sequence"),tt(this,"runnerEndpoint"),tt(this,"interceptors"),tt(this,"autoReconnect"),this.knownID=t,this.runID=r,this.sequence=n,this.runnerEndpoint=i.runnerEndpoint,this.interceptors=i.interceptors,this.autoReconnect=i.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(kf(Af,xo,{leading:!0,trailing:!0}),If(o=>this.useSocketClient(o.streamID).pipe(If(l=>this.useHeartbeat(l,o))))).pipe(Y3()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return U3(hC).pipe(Rr(()=>this.autoReconnect),Oa(this.reconnect),Rr(([,t])=>t.heartbeat==="CONTINUOUS"),Oa(this.latencies),Kt(([,t])=>Array.from(t.values()).filter(r=>r.readyState===WebSocket.OPEN&&r.latency>=Ds)),Rr(t=>t.length>0),kf(Af)).subscribe({next:t=>{console.log(new Date,"Triggering reconnect",t),this.connect()},complete:()=>{console.log("Monitor complete")},error:t=>{console.error("Error in monitor",t)}})}process(){const t=this.client.pipe(Rr(i=>(i==null?void 0:i.readyState)===WebSocket.OPEN),Cf(1)),r=this.queue.pipe(G3(()=>t),Rr(i=>i.length>0),Kt(i=>i.sort((o,l)=>{const s=a=>{var c;return!!((c=a.payload.value)!=null&&c.config)};return s(l)?1:s(o)?-1:0}))),n=this.queue.pipe($3(t));return M3(r.pipe(en(i=>i)),n).pipe(Oa(this.client),Ls(([,i])=>i.readyState===WebSocket.OPEN),en(async([i,o])=>{await xf({req:i,interceptors:this.interceptors,socket:o,knownID:this.knownID,runID:this.runID})})).subscribe({error:i=>{this._errors.next(i)}})}useSocketClient(t){return new dt(r=>{const n=new URL(this.runnerEndpoint);n.searchParams.set("id",t),n.searchParams.set("runID",this.runID);const i=new WebSocket(n.toString()),o=c=>{if(console.log(new Date,`WebSocket transport ${t} closed`,c),c.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},l=c=>{console.log(new Date,`WebSocket transport ${t} error`,c),this.autoReconnect||r.error(c)},s=c=>{var m,h;if(typeof c.data!="string"){console.warn("Unexpected WebSocket message type:",typeof c.data);return}let b;try{b=Rf(c.data),console.log("Received WebsocketResponse:",b)}catch(y){console.error("Failed to parse WebsocketResponse:",y)}const _=b.status;if(_&&_.code!==Pw.OK){r.error(_);return}if(b.pong)return;const C=b.payload.value;if(C.stdoutData&&C.stdoutData.length>0&&((m=this.callback)==null||m.call(this,{type:Pe.terminalStdout,output:{"runme.dev/id":this.knownID,data:C.stdoutData}}),this._stdout.next(C.stdoutData)),C.stderrData&&C.stderrData.length>0&&((h=this.callback)==null||h.call(this,{type:Pe.terminalStderr,output:{"runme.dev/id":this.knownID,data:C.stderrData}}),this._stderr.next(C.stderrData)),C.exitCode!==void 0&&(this._exitCode.next(C.exitCode),r.complete()),C.pid!==void 0&&this._pid.next(C.pid),C.mimeType){const y=C.mimeType.split(";")[0];this._mimeType.next(y)}},a=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(i)};return i.addEventListener("close",o),i.addEventListener("error",l),i.addEventListener("message",s),i.addEventListener("open",a),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),i.removeEventListener("close",o),i.removeEventListener("error",l),i.removeEventListener("message",s),i.removeEventListener("open",a),i.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(Fe.create(pc,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:n}){return new dt(i=>{const o=gc(t,"message").pipe(Ls(()=>t.readyState===WebSocket.OPEN),Kt(a=>Rf(a.data)),Kt(a=>a.pong),Rr(a=>a!==void 0),Kt(a=>({receivedAt:BigInt(Date.now()),pong:a}))),l=(n==="INITIAL"?Ei(0):Ei(0,dC)).pipe(Ls(()=>t.readyState===WebSocket.OPEN),Kt(()=>{const a={timestamp:BigInt(Date.now())};return Fe.create(pc,{ping:a})}),en(async a=>(await xf({req:a,interceptors:this.interceptors,socket:t}),a)),Kt(a=>a.ping)).pipe(Rr(a=>(a==null?void 0:a.timestamp)!==void 0),en(a=>j3(o.pipe(Rr(c=>c.pong.timestamp===a.timestamp),Cf(1),Kt(c=>{const m=a.timestamp,h=c.receivedAt;return Number(h-m)})),Ei(Ds).pipe(Kt(()=>{throw new Error(`Pong not received within ${Ds}ms for stream ${r}`)}))).pipe(av(c=>(this._latencies.next({streamID:r,latency:Ds,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",c.message),w3(null))))),H3(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),J3(a=>{a!==null&&this._latencies.next({streamID:r,latency:a,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),s=[];return s.push(l.subscribe({error:a=>{console.error("Unexpected error sending heartbeat",a)}})),i.next(t),()=>{s.forEach(a=>a.unsubscribe())}})}connect(t="CONTINUOUS"){const r=fC(),n=this.latencies.pipe(Kt(i=>{const o=i.get(r);return o===void 0?null:o}),Ls(i=>(i==null?void 0:i.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),n}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function Rf(e){const t=JSON.parse(e);return Fe.fromJson(jw,t)}async function xf({req:e,interceptors:t,socket:r,knownID:n,runID:i}){n&&(e.knownId=n),i&&(e.runId=i);const o={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let l=async a=>({stream:!1,message:{},method:{},service:{},header:a.header});for(const a of t.concat().reverse())l=a(l);const s=(await l(o)).header.get("Authorization");s&&e&&(e.authorization=s),r.send(JSON.stringify(Fe.toJson(pc,e)))}function fC(){return uC().replace(/-/g,"")}function hv(){return`run_${sC()}`}function pC({cellID:e,runID:t,sequence:r,languageID:n,commands:i,content:o,runner:l,settings:s={},onStdout:a,onStderr:c,onExitCode:m,onPid:h,onMimeType:b}){var _;const{rows:C=20,className:y,fontSize:d=12,fontFamily:p="monospace",takeFocus:f=!0,scrollToFit:g=!0}=s,S=ce.useMemo(()=>!e||o===""?null:o,[e,o]),k=ce.useMemo(()=>{if(!(!e||!t||!l.endpoint))return console.log("Creating stream",e,t,l.endpoint),new dv({knownID:e,runID:t,sequence:r,options:{runnerEndpoint:l.endpoint,interceptors:l.interceptors,autoReconnect:l.reconnect}})},[e,t,r,l]);ce.useEffect(()=>{const O=k==null?void 0:k.connect().subscribe(V=>console.log(`Heartbeat latency for streamID ${V==null?void 0:V.streamID} (${(V==null?void 0:V.readyState)===1?"open":"closed"}): ${V==null?void 0:V.latency}ms`));return()=>{O==null||O.unsubscribe(),k==null||k.close()}},[k]);let I=Fe.create(ch,{rows:34,cols:100,x:0,y:0});const N=ce.useMemo(()=>{const O=n||"sh",V=new Set(["sh","shell","bash","zsh","fish","ksh","csh","tcsh","dash","powershell","pwsh","cmd","ash","elvish","xonsh"]).has(O),M=Fe.create(wa,{sessionStrategy:t2.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:O,background:!1,fileExtension:"",env:[`RUNME_ID=${e}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],interactive:!0,runId:t,knownId:e},winsize:I});return V?(M.config.source={case:"commands",value:Fe.create(Qy,{items:i})},M.config.mode=ah.INLINE):(M.config.source={case:"script",value:i.join(`
2087
- `)},M.config.mode=ah.FILE,M.config.fileExtension=n||""),M},[e,t,i,I]),E=ce.useMemo(()=>{var O;return{output:{"runme.dev/id":(O=N.config)==null?void 0:O.knownId,theme:"dark",fontFamily:p||"monospace",fontSize:d||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:f,scrollToFit:g,smoothScrollDuration:0,scrollback:4e3,initialRows:C,content:S||"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}},[(_=N.config)==null?void 0:_.knownId,p,d,f,g,C,S]),R=new TextEncoder;return n2({postMessage:O=>{if(O.type===Pe.terminalOpen||O.type===Pe.terminalResize){const V=Number(O.output.terminalDimensions.columns),M=Number(O.output.terminalDimensions.rows);if(Number.isFinite(V)&&Number.isFinite(M)){if(I.cols===V&&I.rows===M)return;I=Fe.create(ch,{cols:V,rows:M,x:0,y:0});const D=Fe.create(wa,{winsize:I});k==null||k.sendExecuteRequest(D)}}if(O.type===Pe.terminalStdin){const V=R.encode(O.output.input),M=Fe.create(wa,{inputData:V});k==null||k.sendExecuteRequest(M)}},onDidReceiveMessage:O=>{k==null||k.setCallback(O)}}),ce.useEffect(()=>{const O=k==null?void 0:k.stdout.subscribe(V=>{a==null||a(V)});return()=>O==null?void 0:O.unsubscribe()},[k,a]),ce.useEffect(()=>{const O=k==null?void 0:k.stderr.subscribe(V=>{c==null||c(V)});return()=>O==null?void 0:O.unsubscribe()},[k,c]),ce.useEffect(()=>{const O=k==null?void 0:k.exitCode.subscribe(V=>{m==null||m(V),k==null||k.close()});return()=>O==null?void 0:O.unsubscribe()},[k,m]),ce.useEffect(()=>{const O=k==null?void 0:k.pid.subscribe(V=>{h==null||h(V)});return()=>O==null?void 0:O.unsubscribe()},[k,h]),ce.useEffect(()=>{const O=k==null?void 0:k.mimeType.subscribe(V=>{b==null||b(V)});return()=>O==null?void 0:O.unsubscribe()},[k,b]),ce.useEffect(()=>{!k||!N||(console.log("useEffect invoked - Commands changed:",JSON.stringify(N.config.source.value)),k==null||k.sendExecuteRequest(N))},[N,k]),j.jsx("div",{className:y,ref:O=>{if(!O||O.hasChildNodes())return;const V=document.createElement("terminal-view");V.setAttribute("buttons","false"),V.setAttribute("id",E.output["runme.dev/id"]),V.setAttribute("theme",E.output.theme),V.setAttribute("fontFamily",E.output.fontFamily),typeof E.output.fontSize=="number"&&V.setAttribute("fontSize",E.output.fontSize.toString()),E.output.cursorStyle&&V.setAttribute("cursorStyle",E.output.cursorStyle),typeof E.output.cursorBlink=="boolean"&&V.setAttribute("cursorBlink",E.output.cursorBlink?"true":"false"),typeof E.output.cursorWidth=="number"&&V.setAttribute("cursorWidth",E.output.cursorWidth.toString()),typeof E.output.takeFocus=="boolean"&&V.setAttribute("takeFocus",E.output.takeFocus?"true":"false"),typeof E.output.smoothScrollDuration=="number"&&V.setAttribute("smoothScrollDuration",E.output.smoothScrollDuration.toString()),typeof E.output.scrollback=="number"&&V.setAttribute("scrollback",E.output.scrollback.toString()),E.output.initialRows!==void 0&&V.setAttribute("initialRows",E.output.initialRows.toString()),E.output.content!==void 0&&V.setAttribute("initialContent",E.output.content),E.output.isAutoSaveEnabled&&V.setAttribute("isAutoSaveEnabled",E.output.isAutoSaveEnabled.toString()),E.output.isPlatformAuthEnabled&&V.setAttribute("isPlatformAuthEnabled",E.output.isPlatformAuthEnabled.toString()),O.appendChild(V);const M=document.createElement("div");M.setAttribute("className","h-1"),O.appendChild(M),setTimeout(()=>{g&&!mC(M)&&M.scrollIntoView({behavior:"smooth"})},0)}})}function mC(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}class gi extends Error{}gi.prototype.name="InvalidTokenError";function gC(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function vC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return gC(t)}catch{return atob(t)}}function fv(e,t){if(typeof e!="string")throw new gi("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,n=e.split(".")[r];if(typeof n!="string")throw new gi(`Invalid token specified: missing part #${r+1}`);let i;try{i=vC(n)}catch(o){throw new gi(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new gi(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}const pv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",yo=32,bC=16,mv=10,Bf=0xffffffffffff;var rn;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(rn||(rn={}));class vi extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function _C(e){const t=Math.floor(e()*yo)%yo;return pv.charAt(t)}function yC(e){const t=SC(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new vi(rn.PRNGDetectFailure,"Failed to find a reliable PRNG")}function SC(){return CC()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function EC(e,t){let r="";for(;e>0;e--)r=_C(t)+r;return r}function wC(e,t=mv){if(isNaN(e))throw new vi(rn.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Bf)throw new vi(rn.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Bf}: ${e}`);if(e<0)throw new vi(rn.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new vi(rn.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%yo,n=pv.charAt(r)+n,e=(e-r)/yo;return n}function CC(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function IC(e,t){const r=yC(),n=Date.now();return wC(n,mv)+EC(bC,r)}const kC=Fr("ChphZ2VudC92MS9jcmVkZW50aWFscy5wcm90bxIIYWdlbnQudjEioQEKCk9BdXRoVG9rZW4SFAoMYWNjZXNzX3Rva2VuGAEgASgJEhIKCnRva2VuX3R5cGUYAiABKAkSFQoNcmVmcmVzaF90b2tlbhgDIAEoCRISCgpleHBpcmVzX2F0GAQgASgDEioKBmV4cGlyeRgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASEgoKZXhwaXJlc19pbhgGIAEoA0JAWj5naXRodWIuY29tL3J1bm1lZGV2L3J1bm1lL3YzL2FwaS9nZW4vcHJvdG8vZ28vYWdlbnQvdjE7YWdlbnR2MWIGcHJvdG8z",[Yn.file_google_protobuf_timestamp]),Of=Be(kC,0);/*! js-cookie v3.0.5 | MIT */function Fs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var TC={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function vc(e,t){function r(i,o,l){if(!(typeof document>"u")){l=Fs({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in l)l[a]&&(s+="; "+a,l[a]!==!0&&(s+="="+l[a].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],l={},s=0;s<o.length;s++){var a=o[s].split("="),c=a.slice(1).join("=");try{var m=decodeURIComponent(a[0]);if(l[m]=e.read(c,m),i===m)break}catch{}}return i?l[i]:l}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",Fs({},o,{expires:-1}))},withAttributes:function(i){return vc(this.converter,Fs({},this.attributes,i))},withConverter:function(i){return vc(Fs({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var gv=vc(TC,{path:"/"});const NC=["agent-session","cassie-session"],AC=["agent-oauth-token","cassie-oauth-token"];function bc(){for(const e of NC){const t=gv.get(e);if(t&&t.length>0)return t}}function RC(){let e=Fe.create(Of);for(const t of AC){const r=gv.get(t);if(r&&r.length>0)try{const n=JSON.parse(r);return e=Fe.fromJson(Of,n),e.accessToken}catch(n){console.error("Failed to parse OAuthToken:",n)}}return e.accessToken}const vv=ce.createContext(void 0),rr=()=>{const e=ce.useContext(vv);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e},bv=({children:e,agentEndpoint:t,requireAuth:r,webApp:n,createAuthInterceptors:i})=>{const[o,l]=ce.useState(null),s=ce.useMemo(()=>{const y=bc();if(!y)return"unauthenticated";let d;try{return d=fv(y),d.email||d.sub||"unauthenticated"}catch(p){return console.error("Error decoding token",p),"unauthenticated"}},[]),a=ce.useMemo(()=>{const y=window.location.hostname==="localhost",d=window.location.protocol==="http:",p=window.location.port==="4173"||window.location.port==="5173",f=y&&d&&p;return{requireAuth:r??!1,agentEndpoint:t??(f?"http://localhost:8080":window.location.origin),webApp:{runner:(n==null?void 0:n.runner)??(f?"ws://localhost:8080/ws":`${d?"ws:":"wss:"}//${window.location.host}/ws`),reconnect:(n==null?void 0:n.reconnect)??!0,invertedOrder:(n==null?void 0:n.invertedOrder)??!1}}},[r,n]),[c,m]=ce.useState(()=>{const y=localStorage.getItem("cloudAssistantSettings"),d=y?JSON.parse(y):{};return d&&d.webApp&&d.webApp.reconnect!==void 0&&(d.webApp.reconnect=a.webApp.reconnect),y?{...a,...d}:a});ce.useEffect(()=>{localStorage.setItem("cloudAssistantSettings",JSON.stringify(c))},[c]);const h=ce.useCallback(y=>{const d=p=>{const f=window.location.pathname,g=ze.from(p);f!=="/login"&&g.code===je.Unauthenticated&&(window.location.href=`/login?error=${encodeURIComponent(g.name)}&error_description=${encodeURIComponent(g.message)}`)};return[p=>async f=>{const g=bc();return g&&f.header.set("Authorization",`Bearer ${g}`),y?p(f).catch(S=>{throw d(S),S}):p(f)}]},[]),b=ce.useMemo(()=>i??h,[i,h]),_=ce.useCallback(async()=>{if(!c.webApp.runner)return;l(null);const y=new dv({knownID:`check_${IC()}`,runID:hv(),sequence:0,options:{runnerEndpoint:c.webApp.runner,interceptors:b(!1),autoReconnect:!1}}),d=[];return d.push(y.errors.subscribe({next:p=>l(p)})),d.push(y.connect(uv.INITIAL).subscribe(p=>{p!==null&&(console.log(`Initial heartbeat latency for streamID ${p.streamID} (${p.readyState===1?"open":"closed"}): ${p.latency}ms`),y.close())})),()=>{d.forEach(p=>p.unsubscribe())}},[i,c.webApp.runner]);ce.useEffect(()=>{_()},[_]);const C=y=>{m(d=>({...d,...y,webApp:{...d.webApp,...y.webApp}}))};return j.jsx(vv.Provider,{value:{principal:s,checkRunnerAuth:_,createAuthInterceptors:b,defaultSettings:a,runnerError:o,settings:c,updateSettings:C},children:e})},_v=ce.createContext(void 0),yv=()=>{const e=ce.useContext(_v);if(!e)throw new Error("useClient must be used within a ClientProvider");return e},Sv=({children:e})=>{const[t,r]=ce.useState(),{settings:n,createAuthInterceptors:i}=rr();return ce.useEffect(()=>{r(xC(n.agentEndpoint,i(!0)))},[n.agentEndpoint,i]),j.jsx(_v.Provider,{value:{client:t,setClient:r},children:e})};function xC(e,t){console.log(`initializing the client: baseURL ${e}`);const r=zp({baseUrl:e,interceptors:t});return Zp(M0,r)}const Ev=ce.createContext(void 0),Bo=()=>{const e=ce.useContext(Ev);if(!e)throw new Error("useOutput must be used within an OutputProvider");return e},wv=({children:e})=>{const t=ce.useMemo(()=>new Map,[]),r=ce.useCallback((s,a)=>{t.set(s,a)},[t]),n=ce.useCallback(s=>{t.delete(s)},[t]),i=ce.useCallback(s=>t.get(s),[t]),o=ce.useCallback(()=>t,[t]),l=ce.useMemo(()=>({registerRenderer:r,unregisterRenderer:n,getRenderer:i,getAllRenderers:o}),[r,n,i,o]);return j.jsx(Ev.Provider,{value:l,children:e})},Cv=ce.createContext(void 0),lr=()=>{const e=ce.useContext(Cv);if(!e)throw new Error("useCell must be used within a CellProvider");return e};function Lf(e,t){if(!e)return[];const r=e.positions.map(n=>{const i=e.cells[n];return i.kind===Nt.CODE&&(i.languageId=i.languageId||"sh"),i});return r.length===0?[]:t?r.reverse():r}const Iv=({children:e,getAccessToken:t})=>{const{settings:r,createAuthInterceptors:n,principal:i}=rr(),[o,l]=ce.useState(0),[s,a]=ce.useState(!1),[c,m]=ce.useState(!1),[h,b]=ce.useState(),{getAllRenderers:_}=Bo(),C=ce.useMemo(()=>{const re=new URL(r.webApp.runner);return re.protocol==="ws:"?re.protocol="http:":re.protocol="https:",re.pathname="",re.toString()},[r.webApp.runner]),y=ce.useMemo(()=>{if(i)return new R1("agent",i,Ka(Wp,C,n(!0)))},[r.agentEndpoint,i]),d=ce.useMemo(()=>r.webApp.invertedOrder,[r.webApp.invertedOrder]),{client:p}=yv(),[f,g]=ce.useState(void 0),S=ce.useCallback(()=>{if(!f)return;const re=Lf(f,d),B=Fe.create(qs,{cells:re});h&&(B.metadata[eo.PreviousResponseId]=h),y==null||y.saveNotebook(f.runmeSession,B)},[f,d,h,y]),k=ce.useCallback(async({attemptRestore:re})=>{if(!y)return;l(0),b(void 0);const B=y.createSession();let U;if(!re)U=await B;else{const W=await y.listActiveSessions(),ue=(await y.loadSessions(W)).filter(ve=>ve.data.cells.length!==0);if(ue.length===0)U=await B;else{const ve=ue[0];let _e=ve.data.cells.map(J=>J.refId);d&&(_e=_e.reverse());const Ce=ve.data.metadata[eo.PreviousResponseId];Ce&&b(Ce),g({runmeSession:ve.id,cells:ve.data.cells.reduce((J,L)=>(J[L.refId]=L,J),{}),positions:_e});return}}g({runmeSession:U,cells:{},positions:[]})},[d,y]);ce.useEffect(()=>{S()},[f,y,d,S]),ce.useEffect(()=>{g(re=>({runmeSession:(re==null?void 0:re.runmeSession)??"",cells:(re==null?void 0:re.cells)??{},positions:[...(re==null?void 0:re.positions)??[]].reverse()}))},[d]),ce.useEffect(()=>{k&&k({attemptRestore:!0})},[k]);const I=ce.useMemo(()=>f?f.positions.map(re=>f.cells[re]).filter(re=>!!re&&(re.kind===Nt.MARKUP||re.kind===Nt.CODE)):[],[f]),N=ce.useMemo(()=>f?f.positions.map(re=>f.cells[re]).filter(re=>!!re&&re.kind===Nt.CODE):[],[f]),E=ce.useMemo(()=>f?f.positions.map(re=>f.cells[re]).filter(re=>!!re&&re.kind===Nt.DOC_RESULTS):[],[f]),R=()=>({chat:I,actions:N,files:E}),O=re=>Fe.clone(nn,re),V=async re=>{const B=await t(),U=Fe.create(U0,{cells:re,previousResponseId:h});U.openaiAccessToken=B,B||console.warn("No access token found (expected if oauth is disabled)");try{const W=p.generate(U);for await(const K of W){for(const ue of K.cells)m(!1),ee(ue);b(K.responseId)}}catch(W){console.log(W)}finally{m(!1),a(!1)}},M=async re=>{if(!re.trim())return;const B=Fe.create(nn,{refId:`user_${td()}`,role:Ut.USER,kind:Nt.MARKUP,value:re});ee(B),a(!0),m(!0),await V([B])},D=async re=>{re.outputs.length!==0&&(console.log("sending output cell",re.refId,"previousResponseId",h),a(!0),m(!0),await V([re]))},ee=re=>{const B=_();for(const U of B.values())U.onCellUpdate(re);g(U=>{if(U){if(!U.cells[re.refId]){const W=d?[re.refId,...U.positions]:[...U.positions,re.refId];return{runmeSession:U.runmeSession,cells:{...U.cells,[re.refId]:re},positions:W}}return{...U,runmeSession:U.runmeSession,cells:{...U.cells,[re.refId]:re}}}})},ae=()=>{const re=`code_${td().replace(/-/g,"")}`,B=Fe.create(nn,{metadata:{[Bt.ID]:re,[Bt.RunmeID]:re},refId:re,languageId:"sh",role:Ut.USER,kind:Nt.CODE,value:""});ee(B)},ge=re=>{if(!N.find(W=>W.refId===re.refId))return;const U=new CustomEvent("runCodeCell",{detail:{cellId:re.refId}});re.executionSummary=void 0,re.outputs=re.outputs.filter(W=>W.items.some(K=>K.mime===ar.StatefulRunmeTerminal)),l(W=>{const K=W+1;return re.metadata[Bt.Sequence]=K.toString(),K}),window.dispatchEvent(U)},ke=async({asSessionRecord:re})=>{var L;const B=Lf(f,d);if(!f||B.length===0)return;const U=Fe.create(qs,{cells:B}),W=Ka(Yc,r.agentEndpoint,n(!0)),K=Fe.create(Gc,{notebook:U,options:Fe.create(Zc,{outputs:Fe.create(jc,{enabled:!1,summary:!1})})});re&&((L=K.options)!=null&&L.outputs)&&(K.options.outputs.enabled=!0,K.options.outputs.summary=!0,K.options.session=Fe.create(Wc,{id:f.runmeSession}));const ue=await W.serialize(K),ve=new Blob([new Uint8Array(ue.result)],{type:"text/plain"}),_e=URL.createObjectURL(ve),Ce=document.createElement("a");Ce.href=_e;const J=re?"Session":"Notebook";Ce.download=`${J}-${nm()}.md`,document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(_e)};return j.jsx(Cv.Provider,{value:{useColumns:R,sequence:o,saveState:S,exportDocument:ke,sendOutputCell:D,createOutputCell:O,sendUserCell:M,addCodeCell:ae,isInputDisabled:s,isTyping:c,runCodeCell:ge,resetSession:k},children:e})},Df=new TextEncoder;function BC({pid:e,exitCode:t},r,n,i){let o;return e!==null&&t!==null&&(o=Fe.create(Mc,{pid:BigInt(e),exitReason:Fe.create(Uc,{type:"exit",code:t})})),[Fe.create(Eo,{items:[Fe.create(Ti,{mime:ar.VSCodeNotebookStdOut,type:"Buffer",data:Df.encode(r)}),Fe.create(Ti,{mime:ar.VSCodeNotebookStdErr,type:"Buffer",data:Df.encode(n)})],processInfo:o})]}const OC=Fe.create(nn,{kind:Nt.MARKUP,role:Ut.ASSISTANT,value:"..."}),_c={fontSize:14,fontFamily:"monospace"},LC=new TextDecoder,DC=ce.memo(pC,(e,t)=>e.cellID===t.cellID&&e.runID===t.runID),kv=({cell:e,onExitCode:t,onPid:r})=>{const{createAuthInterceptors:n,settings:{webApp:i}}=rr(),{sendOutputCell:o,saveState:l}=lr(),s=i.invertedOrder,[a,c]=ce.useState(!1),[m,h]=ce.useState({value:"",runID:""}),[b,_]=ce.useState(null),[C,y]=ce.useState(null),[d,p]=ce.useState(null),[f,g]=ce.useState(null),[S,k]=ce.useState(""),[I,N]=ce.useState(""),[E,R]=ce.useState(""),O=ce.useMemo(()=>Number(e.metadata[Bt.Sequence]??0),[e,C,d]),V=ce.useCallback((_e=!1)=>{_(BigInt(Date.now())),k(""),N(""),y(null),p(null),c(_e),h({value:e.value,runID:hv()})},[e]),M=ce.useMemo(()=>({..._c,className:"rounded-md overflow-hidden",rows:14,scrollToFit:!s,takeFocus:a}),[s,a]);ce.useEffect(()=>{const _e=Ce=>{Ce.detail.cellId===e.refId&&V()};return window.addEventListener("runCodeCell",_e),()=>{window.removeEventListener("runCodeCell",_e)}},[e.refId,V]);const D=ce.useMemo(()=>{const _e=e.outputs.filter(J=>J.items.some(L=>L.mime===ar.StatefulRunmeTerminal)),Ce=BC({pid:C,exitCode:d},S,I);return[..._e,...Ce]},[C,d,S,I,f,e.outputs]);ce.useEffect(()=>{b!==null&&(e.outputs=D,e.executionSummary=Fe.create(Pc,{timing:Fe.create(Vc,{startTime:b,endTime:BigInt(Date.now())}),executionOrder:O,success:Number.isFinite(d)&&d===0}))},[e,D,d,O,b]);const ee=ce.useMemo(()=>C===null||d===null||m.runID===""||!Number.isFinite(C)||!Number.isInteger(d)?null:e,[e,m.runID,d,C]);ce.useEffect(()=>{!ee||E===m.runID||(R(m.runID),o(ee))},[o,ee,m.runID,E]),ce.useEffect(()=>{C!==null&&r(C)},[C,r]),ce.useEffect(()=>{d!==null&&t(d)},[d,t]),ce.useEffect(()=>{e.kind===Nt.CODE&&(m.runID!==""&&(e.metadata[Bt.LastRunID]=m.runID),C?e.metadata[Bt.Pid]=C.toString():delete e.metadata[Bt.Pid],d!==null&&Number.isFinite(d)?(delete e.metadata[Bt.Pid],e.metadata[Bt.ExitCode]=d.toString()):delete e.metadata[Bt.ExitCode],l())},[C,d,e,l,m.runID]);const ae=ce.useMemo(()=>{if(e.kind!==Nt.CODE||E!=="")return;const _e=e.outputs.flatMap(Ce=>Ce.items).find(Ce=>Ce.mime===ar.VSCodeNotebookStdOut);if(_e)return LC.decode(_e.data)},[e.kind,e.outputs,E]),ge=ce.useMemo(()=>{var Ce;return((Ce=e.metadata)==null?void 0:Ce[Bt.Pid])??""?e.metadata[Bt.LastRunID]??"":""},[e.metadata]),ke=ce.useMemo(()=>m.value===""||m.runID===""?[]:m.value.split(`
2087
+ `)},M.config.mode=ah.FILE,M.config.fileExtension=n||""),M},[e,t,i,I]),E=ce.useMemo(()=>{var O;return{output:{"runme.dev/id":(O=N.config)==null?void 0:O.knownId,theme:"dark",fontFamily:p||"monospace",fontSize:d||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:f,scrollToFit:g,smoothScrollDuration:0,scrollback:4e3,initialRows:C,content:S||"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}},[(_=N.config)==null?void 0:_.knownId,p,d,f,g,C,S]),R=new TextEncoder;return n2({postMessage:O=>{if(O.type===Pe.terminalOpen||O.type===Pe.terminalResize){const V=Number(O.output.terminalDimensions.columns),M=Number(O.output.terminalDimensions.rows);if(Number.isFinite(V)&&Number.isFinite(M)){if(I.cols===V&&I.rows===M)return;I=Fe.create(ch,{cols:V,rows:M,x:0,y:0});const D=Fe.create(wa,{winsize:I});k==null||k.sendExecuteRequest(D)}}if(O.type===Pe.terminalStdin){const V=R.encode(O.output.input),M=Fe.create(wa,{inputData:V});k==null||k.sendExecuteRequest(M)}},onDidReceiveMessage:O=>{k==null||k.setCallback(O)}}),ce.useEffect(()=>{const O=k==null?void 0:k.stdout.subscribe(V=>{a==null||a(V)});return()=>O==null?void 0:O.unsubscribe()},[k,a]),ce.useEffect(()=>{const O=k==null?void 0:k.stderr.subscribe(V=>{c==null||c(V)});return()=>O==null?void 0:O.unsubscribe()},[k,c]),ce.useEffect(()=>{const O=k==null?void 0:k.exitCode.subscribe(V=>{m==null||m(V),k==null||k.close()});return()=>O==null?void 0:O.unsubscribe()},[k,m]),ce.useEffect(()=>{const O=k==null?void 0:k.pid.subscribe(V=>{h==null||h(V)});return()=>O==null?void 0:O.unsubscribe()},[k,h]),ce.useEffect(()=>{const O=k==null?void 0:k.mimeType.subscribe(V=>{b==null||b(V)});return()=>O==null?void 0:O.unsubscribe()},[k,b]),ce.useEffect(()=>{!k||!N||(console.log("useEffect invoked - Commands changed:",JSON.stringify(N.config.source.value)),k==null||k.sendExecuteRequest(N))},[N,k]),j.jsx("div",{className:y,ref:O=>{if(!O||O.hasChildNodes())return;const V=document.createElement("console-view");V.setAttribute("buttons","false"),V.setAttribute("id",E.output["runme.dev/id"]),V.setAttribute("theme",E.output.theme),V.setAttribute("fontFamily",E.output.fontFamily),typeof E.output.fontSize=="number"&&V.setAttribute("fontSize",E.output.fontSize.toString()),E.output.cursorStyle&&V.setAttribute("cursorStyle",E.output.cursorStyle),typeof E.output.cursorBlink=="boolean"&&V.setAttribute("cursorBlink",E.output.cursorBlink?"true":"false"),typeof E.output.cursorWidth=="number"&&V.setAttribute("cursorWidth",E.output.cursorWidth.toString()),typeof E.output.takeFocus=="boolean"&&V.setAttribute("takeFocus",E.output.takeFocus?"true":"false"),typeof E.output.smoothScrollDuration=="number"&&V.setAttribute("smoothScrollDuration",E.output.smoothScrollDuration.toString()),typeof E.output.scrollback=="number"&&V.setAttribute("scrollback",E.output.scrollback.toString()),E.output.initialRows!==void 0&&V.setAttribute("initialRows",E.output.initialRows.toString()),E.output.content!==void 0&&V.setAttribute("initialContent",E.output.content),E.output.isAutoSaveEnabled&&V.setAttribute("isAutoSaveEnabled",E.output.isAutoSaveEnabled.toString()),E.output.isPlatformAuthEnabled&&V.setAttribute("isPlatformAuthEnabled",E.output.isPlatformAuthEnabled.toString()),O.appendChild(V);const M=document.createElement("div");M.setAttribute("className","h-1"),O.appendChild(M),setTimeout(()=>{g&&!mC(M)&&M.scrollIntoView({behavior:"smooth"})},0)}})}function mC(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}class gi extends Error{}gi.prototype.name="InvalidTokenError";function gC(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function vC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return gC(t)}catch{return atob(t)}}function fv(e,t){if(typeof e!="string")throw new gi("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,n=e.split(".")[r];if(typeof n!="string")throw new gi(`Invalid token specified: missing part #${r+1}`);let i;try{i=vC(n)}catch(o){throw new gi(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new gi(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}const pv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",yo=32,bC=16,mv=10,Bf=0xffffffffffff;var rn;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(rn||(rn={}));class vi extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function _C(e){const t=Math.floor(e()*yo)%yo;return pv.charAt(t)}function yC(e){const t=SC(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new vi(rn.PRNGDetectFailure,"Failed to find a reliable PRNG")}function SC(){return CC()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function EC(e,t){let r="";for(;e>0;e--)r=_C(t)+r;return r}function wC(e,t=mv){if(isNaN(e))throw new vi(rn.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Bf)throw new vi(rn.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Bf}: ${e}`);if(e<0)throw new vi(rn.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new vi(rn.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%yo,n=pv.charAt(r)+n,e=(e-r)/yo;return n}function CC(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function IC(e,t){const r=yC(),n=Date.now();return wC(n,mv)+EC(bC,r)}const kC=Fr("ChphZ2VudC92MS9jcmVkZW50aWFscy5wcm90bxIIYWdlbnQudjEioQEKCk9BdXRoVG9rZW4SFAoMYWNjZXNzX3Rva2VuGAEgASgJEhIKCnRva2VuX3R5cGUYAiABKAkSFQoNcmVmcmVzaF90b2tlbhgDIAEoCRISCgpleHBpcmVzX2F0GAQgASgDEioKBmV4cGlyeRgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASEgoKZXhwaXJlc19pbhgGIAEoA0JAWj5naXRodWIuY29tL3J1bm1lZGV2L3J1bm1lL3YzL2FwaS9nZW4vcHJvdG8vZ28vYWdlbnQvdjE7YWdlbnR2MWIGcHJvdG8z",[Yn.file_google_protobuf_timestamp]),Of=Be(kC,0);/*! js-cookie v3.0.5 | MIT */function Fs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var TC={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function vc(e,t){function r(i,o,l){if(!(typeof document>"u")){l=Fs({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in l)l[a]&&(s+="; "+a,l[a]!==!0&&(s+="="+l[a].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],l={},s=0;s<o.length;s++){var a=o[s].split("="),c=a.slice(1).join("=");try{var m=decodeURIComponent(a[0]);if(l[m]=e.read(c,m),i===m)break}catch{}}return i?l[i]:l}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",Fs({},o,{expires:-1}))},withAttributes:function(i){return vc(this.converter,Fs({},this.attributes,i))},withConverter:function(i){return vc(Fs({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var gv=vc(TC,{path:"/"});const NC=["agent-session","cassie-session"],AC=["agent-oauth-token","cassie-oauth-token"];function bc(){for(const e of NC){const t=gv.get(e);if(t&&t.length>0)return t}}function RC(){let e=Fe.create(Of);for(const t of AC){const r=gv.get(t);if(r&&r.length>0)try{const n=JSON.parse(r);return e=Fe.fromJson(Of,n),e.accessToken}catch(n){console.error("Failed to parse OAuthToken:",n)}}return e.accessToken}const vv=ce.createContext(void 0),rr=()=>{const e=ce.useContext(vv);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e},bv=({children:e,agentEndpoint:t,requireAuth:r,webApp:n,createAuthInterceptors:i})=>{const[o,l]=ce.useState(null),s=ce.useMemo(()=>{const y=bc();if(!y)return"unauthenticated";let d;try{return d=fv(y),d.email||d.sub||"unauthenticated"}catch(p){return console.error("Error decoding token",p),"unauthenticated"}},[]),a=ce.useMemo(()=>{const y=window.location.hostname==="localhost",d=window.location.protocol==="http:",p=window.location.port==="4173"||window.location.port==="5173",f=y&&d&&p;return{requireAuth:r??!1,agentEndpoint:t??(f?"http://localhost:8080":window.location.origin),webApp:{runner:(n==null?void 0:n.runner)??(f?"ws://localhost:8080/ws":`${d?"ws:":"wss:"}//${window.location.host}/ws`),reconnect:(n==null?void 0:n.reconnect)??!0,invertedOrder:(n==null?void 0:n.invertedOrder)??!1}}},[r,n]),[c,m]=ce.useState(()=>{const y=localStorage.getItem("cloudAssistantSettings"),d=y?JSON.parse(y):{};return d&&d.webApp&&d.webApp.reconnect!==void 0&&(d.webApp.reconnect=a.webApp.reconnect),y?{...a,...d}:a});ce.useEffect(()=>{localStorage.setItem("cloudAssistantSettings",JSON.stringify(c))},[c]);const h=ce.useCallback(y=>{const d=p=>{const f=window.location.pathname,g=ze.from(p);f!=="/login"&&g.code===je.Unauthenticated&&(window.location.href=`/login?error=${encodeURIComponent(g.name)}&error_description=${encodeURIComponent(g.message)}`)};return[p=>async f=>{const g=bc();return g&&f.header.set("Authorization",`Bearer ${g}`),y?p(f).catch(S=>{throw d(S),S}):p(f)}]},[]),b=ce.useMemo(()=>i??h,[i,h]),_=ce.useCallback(async()=>{if(!c.webApp.runner)return;l(null);const y=new dv({knownID:`check_${IC()}`,runID:hv(),sequence:0,options:{runnerEndpoint:c.webApp.runner,interceptors:b(!1),autoReconnect:!1}}),d=[];return d.push(y.errors.subscribe({next:p=>l(p)})),d.push(y.connect(uv.INITIAL).subscribe(p=>{p!==null&&(console.log(`Initial heartbeat latency for streamID ${p.streamID} (${p.readyState===1?"open":"closed"}): ${p.latency}ms`),y.close())})),()=>{d.forEach(p=>p.unsubscribe())}},[i,c.webApp.runner]);ce.useEffect(()=>{_()},[_]);const C=y=>{m(d=>({...d,...y,webApp:{...d.webApp,...y.webApp}}))};return j.jsx(vv.Provider,{value:{principal:s,checkRunnerAuth:_,createAuthInterceptors:b,defaultSettings:a,runnerError:o,settings:c,updateSettings:C},children:e})},_v=ce.createContext(void 0),yv=()=>{const e=ce.useContext(_v);if(!e)throw new Error("useClient must be used within a ClientProvider");return e},Sv=({children:e})=>{const[t,r]=ce.useState(),{settings:n,createAuthInterceptors:i}=rr();return ce.useEffect(()=>{r(xC(n.agentEndpoint,i(!0)))},[n.agentEndpoint,i]),j.jsx(_v.Provider,{value:{client:t,setClient:r},children:e})};function xC(e,t){console.log(`initializing the client: baseURL ${e}`);const r=zp({baseUrl:e,interceptors:t});return Zp(M0,r)}const Ev=ce.createContext(void 0),Bo=()=>{const e=ce.useContext(Ev);if(!e)throw new Error("useOutput must be used within an OutputProvider");return e},wv=({children:e})=>{const t=ce.useMemo(()=>new Map,[]),r=ce.useCallback((s,a)=>{t.set(s,a)},[t]),n=ce.useCallback(s=>{t.delete(s)},[t]),i=ce.useCallback(s=>t.get(s),[t]),o=ce.useCallback(()=>t,[t]),l=ce.useMemo(()=>({registerRenderer:r,unregisterRenderer:n,getRenderer:i,getAllRenderers:o}),[r,n,i,o]);return j.jsx(Ev.Provider,{value:l,children:e})},Cv=ce.createContext(void 0),lr=()=>{const e=ce.useContext(Cv);if(!e)throw new Error("useCell must be used within a CellProvider");return e};function Lf(e,t){if(!e)return[];const r=e.positions.map(n=>{const i=e.cells[n];return i.kind===Nt.CODE&&(i.languageId=i.languageId||"sh"),i});return r.length===0?[]:t?r.reverse():r}const Iv=({children:e,getAccessToken:t})=>{const{settings:r,createAuthInterceptors:n,principal:i}=rr(),[o,l]=ce.useState(0),[s,a]=ce.useState(!1),[c,m]=ce.useState(!1),[h,b]=ce.useState(),{getAllRenderers:_}=Bo(),C=ce.useMemo(()=>{const re=new URL(r.webApp.runner);return re.protocol==="ws:"?re.protocol="http:":re.protocol="https:",re.pathname="",re.toString()},[r.webApp.runner]),y=ce.useMemo(()=>{if(i)return new R1("agent",i,Ka(Wp,C,n(!0)))},[r.agentEndpoint,i]),d=ce.useMemo(()=>r.webApp.invertedOrder,[r.webApp.invertedOrder]),{client:p}=yv(),[f,g]=ce.useState(void 0),S=ce.useCallback(()=>{if(!f)return;const re=Lf(f,d),B=Fe.create(qs,{cells:re});h&&(B.metadata[eo.PreviousResponseId]=h),y==null||y.saveNotebook(f.runmeSession,B)},[f,d,h,y]),k=ce.useCallback(async({attemptRestore:re})=>{if(!y)return;l(0),b(void 0);const B=y.createSession();let U;if(!re)U=await B;else{const W=await y.listActiveSessions(),ue=(await y.loadSessions(W)).filter(ve=>ve.data.cells.length!==0);if(ue.length===0)U=await B;else{const ve=ue[0];let _e=ve.data.cells.map(J=>J.refId);d&&(_e=_e.reverse());const Ce=ve.data.metadata[eo.PreviousResponseId];Ce&&b(Ce),g({runmeSession:ve.id,cells:ve.data.cells.reduce((J,L)=>(J[L.refId]=L,J),{}),positions:_e});return}}g({runmeSession:U,cells:{},positions:[]})},[d,y]);ce.useEffect(()=>{S()},[f,y,d,S]),ce.useEffect(()=>{g(re=>({runmeSession:(re==null?void 0:re.runmeSession)??"",cells:(re==null?void 0:re.cells)??{},positions:[...(re==null?void 0:re.positions)??[]].reverse()}))},[d]),ce.useEffect(()=>{k&&k({attemptRestore:!0})},[k]);const I=ce.useMemo(()=>f?f.positions.map(re=>f.cells[re]).filter(re=>!!re&&(re.kind===Nt.MARKUP||re.kind===Nt.CODE)):[],[f]),N=ce.useMemo(()=>f?f.positions.map(re=>f.cells[re]).filter(re=>!!re&&re.kind===Nt.CODE):[],[f]),E=ce.useMemo(()=>f?f.positions.map(re=>f.cells[re]).filter(re=>!!re&&re.kind===Nt.DOC_RESULTS):[],[f]),R=()=>({chat:I,actions:N,files:E}),O=re=>Fe.clone(nn,re),V=async re=>{const B=await t(),U=Fe.create(U0,{cells:re,previousResponseId:h});U.openaiAccessToken=B,B||console.warn("No access token found (expected if oauth is disabled)");try{const W=p.generate(U);for await(const K of W){for(const ue of K.cells)m(!1),ee(ue);b(K.responseId)}}catch(W){console.log(W)}finally{m(!1),a(!1)}},M=async re=>{if(!re.trim())return;const B=Fe.create(nn,{refId:`user_${td()}`,role:Ut.USER,kind:Nt.MARKUP,value:re});ee(B),a(!0),m(!0),await V([B])},D=async re=>{re.outputs.length!==0&&(console.log("sending output cell",re.refId,"previousResponseId",h),a(!0),m(!0),await V([re]))},ee=re=>{const B=_();for(const U of B.values())U.onCellUpdate(re);g(U=>{if(U){if(!U.cells[re.refId]){const W=d?[re.refId,...U.positions]:[...U.positions,re.refId];return{runmeSession:U.runmeSession,cells:{...U.cells,[re.refId]:re},positions:W}}return{...U,runmeSession:U.runmeSession,cells:{...U.cells,[re.refId]:re}}}})},ae=()=>{const re=`code_${td().replace(/-/g,"")}`,B=Fe.create(nn,{metadata:{[Bt.ID]:re,[Bt.RunmeID]:re},refId:re,languageId:"sh",role:Ut.USER,kind:Nt.CODE,value:""});ee(B)},ge=re=>{if(!N.find(W=>W.refId===re.refId))return;const U=new CustomEvent("runCodeCell",{detail:{cellId:re.refId}});re.executionSummary=void 0,re.outputs=re.outputs.filter(W=>W.items.some(K=>K.mime===ar.StatefulRunmeTerminal)),l(W=>{const K=W+1;return re.metadata[Bt.Sequence]=K.toString(),K}),window.dispatchEvent(U)},ke=async({asSessionRecord:re})=>{var L;const B=Lf(f,d);if(!f||B.length===0)return;const U=Fe.create(qs,{cells:B}),W=Ka(Yc,r.agentEndpoint,n(!0)),K=Fe.create(Gc,{notebook:U,options:Fe.create(Zc,{outputs:Fe.create(jc,{enabled:!1,summary:!1})})});re&&((L=K.options)!=null&&L.outputs)&&(K.options.outputs.enabled=!0,K.options.outputs.summary=!0,K.options.session=Fe.create(Wc,{id:f.runmeSession}));const ue=await W.serialize(K),ve=new Blob([new Uint8Array(ue.result)],{type:"text/plain"}),_e=URL.createObjectURL(ve),Ce=document.createElement("a");Ce.href=_e;const J=re?"Session":"Notebook";Ce.download=`${J}-${nm()}.md`,document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(_e)};return j.jsx(Cv.Provider,{value:{useColumns:R,sequence:o,saveState:S,exportDocument:ke,sendOutputCell:D,createOutputCell:O,sendUserCell:M,addCodeCell:ae,isInputDisabled:s,isTyping:c,runCodeCell:ge,resetSession:k},children:e})},Df=new TextEncoder;function BC({pid:e,exitCode:t},r,n,i){let o;return e!==null&&t!==null&&(o=Fe.create(Mc,{pid:BigInt(e),exitReason:Fe.create(Uc,{type:"exit",code:t})})),[Fe.create(Eo,{items:[Fe.create(Ti,{mime:ar.VSCodeNotebookStdOut,type:"Buffer",data:Df.encode(r)}),Fe.create(Ti,{mime:ar.VSCodeNotebookStdErr,type:"Buffer",data:Df.encode(n)})],processInfo:o})]}const OC=Fe.create(nn,{kind:Nt.MARKUP,role:Ut.ASSISTANT,value:"..."}),_c={fontSize:14,fontFamily:"monospace"},LC=new TextDecoder,DC=ce.memo(pC,(e,t)=>e.cellID===t.cellID&&e.runID===t.runID),kv=({cell:e,onExitCode:t,onPid:r})=>{const{createAuthInterceptors:n,settings:{webApp:i}}=rr(),{sendOutputCell:o,saveState:l}=lr(),s=i.invertedOrder,[a,c]=ce.useState(!1),[m,h]=ce.useState({value:"",runID:""}),[b,_]=ce.useState(null),[C,y]=ce.useState(null),[d,p]=ce.useState(null),[f,g]=ce.useState(null),[S,k]=ce.useState(""),[I,N]=ce.useState(""),[E,R]=ce.useState(""),O=ce.useMemo(()=>Number(e.metadata[Bt.Sequence]??0),[e,C,d]),V=ce.useCallback((_e=!1)=>{_(BigInt(Date.now())),k(""),N(""),y(null),p(null),c(_e),h({value:e.value,runID:hv()})},[e]),M=ce.useMemo(()=>({..._c,className:"rounded-md overflow-hidden",rows:14,scrollToFit:!s,takeFocus:a}),[s,a]);ce.useEffect(()=>{const _e=Ce=>{Ce.detail.cellId===e.refId&&V()};return window.addEventListener("runCodeCell",_e),()=>{window.removeEventListener("runCodeCell",_e)}},[e.refId,V]);const D=ce.useMemo(()=>{const _e=e.outputs.filter(J=>J.items.some(L=>L.mime===ar.StatefulRunmeTerminal)),Ce=BC({pid:C,exitCode:d},S,I);return[..._e,...Ce]},[C,d,S,I,f,e.outputs]);ce.useEffect(()=>{b!==null&&(e.outputs=D,e.executionSummary=Fe.create(Pc,{timing:Fe.create(Vc,{startTime:b,endTime:BigInt(Date.now())}),executionOrder:O,success:Number.isFinite(d)&&d===0}))},[e,D,d,O,b]);const ee=ce.useMemo(()=>C===null||d===null||m.runID===""||!Number.isFinite(C)||!Number.isInteger(d)?null:e,[e,m.runID,d,C]);ce.useEffect(()=>{!ee||E===m.runID||(R(m.runID),o(ee))},[o,ee,m.runID,E]),ce.useEffect(()=>{C!==null&&r(C)},[C,r]),ce.useEffect(()=>{d!==null&&t(d)},[d,t]),ce.useEffect(()=>{e.kind===Nt.CODE&&(m.runID!==""&&(e.metadata[Bt.LastRunID]=m.runID),C?e.metadata[Bt.Pid]=C.toString():delete e.metadata[Bt.Pid],d!==null&&Number.isFinite(d)?(delete e.metadata[Bt.Pid],e.metadata[Bt.ExitCode]=d.toString()):delete e.metadata[Bt.ExitCode],l())},[C,d,e,l,m.runID]);const ae=ce.useMemo(()=>{if(e.kind!==Nt.CODE||E!=="")return;const _e=e.outputs.flatMap(Ce=>Ce.items).find(Ce=>Ce.mime===ar.VSCodeNotebookStdOut);if(_e)return LC.decode(_e.data)},[e.kind,e.outputs,E]),ge=ce.useMemo(()=>{var Ce;return((Ce=e.metadata)==null?void 0:Ce[Bt.Pid])??""?e.metadata[Bt.LastRunID]??"":""},[e.metadata]),ke=ce.useMemo(()=>m.value===""||m.runID===""?[]:m.value.split(`
2088
2088
  `),[m]),re=ce.useMemo(()=>m.runID===""?ge:m.runID,[m.runID,ge]),B=ce.useMemo(()=>({endpoint:i.runner,reconnect:i.reconnect,interceptors:n(!1)}),[i.runner,i.reconnect,n]),U=ce.useCallback(_e=>{k(Ce=>Ce+new TextDecoder().decode(_e))},[]),W=ce.useCallback(_e=>{N(Ce=>Ce+new TextDecoder().decode(_e))},[]),K=ce.useCallback(_e=>{y(_e)},[]),ue=ce.useCallback(_e=>{p(_e)},[]),ve=ce.useCallback(_e=>{g(_e)},[]);return ke.length===0&&(!ae||ae.length===0)?null:j.jsx(DC,{cellID:e.refId,runID:re,sequence:O,languageID:e.languageId,commands:ke,content:ae,runner:B,settings:M,onPid:K,onStdout:U,onStderr:W,onExitCode:ue,onMimeType:ve},re)},Ff="vs-dark",FC=ce.memo(({id:e,value:t,language:r,fontSize:n=14,fontFamily:i="monospace",onChange:o,onEnter:l})=>{const s=ce.useRef(l),a=ce.useRef(null),c=ce.useRef(null),[m,h]=ce.useState("140px"),[b,_]=ce.useState(!1),C=ce.useRef(0),y=ce.useRef(0);ce.useEffect(()=>{s.current=l},[l]),ce.useEffect(()=>{const f=S=>{if(!b)return;const k=S.clientY-C.current,I=Math.max(100,y.current+k);h(`${I}px`),a.current&&a.current.layout()},g=()=>{_(!1),document.body.style.cursor="default"};return b&&(document.addEventListener("mousemove",f),document.addEventListener("mouseup",g)),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",g)}},[b]);const d=(f,g)=>{a.current=f,g!=null&&g.editor&&(g.editor.setTheme(Ff),f&&(f.onKeyDown(S=>{S.ctrlKey&&S.keyCode===3&&s.current()}),t===""&&f.focus()))},p=f=>{var g;_(!0),C.current=f.clientY,y.current=((g=c.current)==null?void 0:g.clientHeight)||140,document.body.style.cursor="ns-resize",f.preventDefault()};return j.jsxs("div",{className:"pb-1 w-full",ref:c,children:[j.jsx("div",{className:"rounded-md overflow-hidden",children:j.jsx(pb,{height:m,width:"100%",defaultLanguage:r,value:t,options:{scrollbar:{alwaysConsumeMouseWheel:!1},minimap:{enabled:!1},theme:Ff,wordWrap:"wordWrapColumn",fontSize:n,fontFamily:i,lineHeight:20},onChange:f=>{f&&(t=f,o==null||o(f))},onMount:d,className:"rounded-lg",wrapperProps:{className:"rounded-lg"}},e)}),j.jsx("div",{className:"h-2 w-full cursor-ns-resize",onMouseDown:p})]})},(e,t)=>e.value===t.value),VC=()=>j.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:j.jsx("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4338 7.5L4 3.57925Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",stroke:"currentColor",strokeWidth:"0.5"})}),UC=()=>j.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:j.jsx("path",{d:"M7.5 1.5C4.5 1.5 2 4 2 7C2 8.9 3 10.5 4.5 11.5L4 12.5C2 11.5 1 9.2 1 7C1 3.5 4 0.5 7.5 0.5C11 0.5 14 3.5 14 7C14 9.2 13 11.5 11 12.5L10.5 11.5C12 10.5 13 8.9 13 7C13 4 10.5 1.5 7.5 1.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),MC=()=>j.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:j.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"#22c55e",fillRule:"evenodd",clipRule:"evenodd",stroke:"#22c55e",strokeWidth:"1"})}),PC=({exitCode:e})=>j.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[j.jsx("circle",{cx:"12",cy:"12",r:"20",fill:"#ef4444",fillOpacity:"0.3"}),j.jsx("text",{x:"50%",y:"50%",dominantBaseline:"middle",textAnchor:"middle",fill:"#ef4444",fontSize:"10",fontWeight:"bold",children:e})]});function WC(){return j.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:j.jsx("path",{d:"M7.5 0.75C7.91421 0.75 8.25 1.08579 8.25 1.5V7.25H14C14.4142 7.25 14.75 7.58579 14.75 8C14.75 8.41421 14.4142 8.75 14 8.75H8.25V14.5C8.25 14.9142 7.91421 15.25 7.5 15.25C7.08579 15.25 6.75 14.9142 6.75 14.5V8.75H1C0.585786 8.75 0.25 8.41421 0.25 8C0.25 7.58579 0.585786 7.25 1 7.25H6.75V1.5C6.75 1.08579 7.08579 0.75 7.5 0.75Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",strokeWidth:"0.5"})})}function jC(){return j.jsx("svg",{width:"28",height:"28",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:j.jsx("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.3",fillRule:"evenodd",clipRule:"evenodd"})})}function ZC({pid:e,exitCode:t,onClick:r}){const n=()=>t===null&&e===null?"Run code":t===null&&e!==null?"Running...":t!==null&&t===0?"Execution successful":t!==null&&t>0?`Execution failed with exit code ${t}`:"Run code";return j.jsxs(Ee.Button,{variant:"soft",onClick:r,"aria-label":n(),children:[t===null&&e===null&&j.jsx(VC,{}),t===null&&e!==null&&j.jsx("div",{className:"animate-spin",children:j.jsx(UC,{})}),t!==null&&t===0&&j.jsx(MC,{}),t!==null&&t>0&&j.jsx(PC,{exitCode:t})]})}function Tv({cell:e}){const{saveState:t,runCodeCell:r}=lr(),{getRenderer:n}=Bo(),[i,o]=ce.useState(null),[l,s]=ce.useState(null),a=ce.useCallback(()=>{r(e)},[e,r]),c=ce.useMemo(()=>{const m=Number(e.metadata[Bt.Sequence]);return m?m.toString():" "},[e,i,l]);return j.jsx("div",{children:j.jsx(Ee.Box,{className:"w-full p-2",children:j.jsxs("div",{className:"flex justify-between items-top",children:[j.jsxs("div",{className:"flex flex-col items-center",children:[j.jsx(ZC,{pid:i,exitCode:l,onClick:a}),j.jsxs(Ee.Text,{size:"2",className:"mt-1 p-2 font-bold text-gray-400 font-mono","data-testid":"sequence-label",children:["[",c,"]"]})]}),j.jsxs(Ee.Card,{className:"whitespace-nowrap overflow-hidden flex-1 ml-2",children:[j.jsx(FC,{id:e.refId,value:e.value,language:"shellscript",fontSize:_c.fontSize,fontFamily:_c.fontFamily,onChange:m=>{e.value=m,t()},onEnter:a},`editor-${e.refId}`),e.outputs.flatMap(m=>(m.items??[]).map(h=>{const b=n(h.mime);if(!b)return null;const _=b.component;return j.jsx(_,{cell:e,onPid:o,onExitCode:s,...b.props},`${h.mime}-${e.refId}`)}))]})]})})})}function yc(){const{useColumns:e,addCodeCell:t}=lr(),{settings:r}=rr(),{actions:n}=e(),i=ce.useRef(null),o=ce.useRef(null);ce.useEffect(()=>{var a,c;if(r.webApp.invertedOrder){(a=i.current)==null||a.scrollIntoView({behavior:"smooth"});return}(c=o.current)==null||c.scrollIntoView({behavior:"smooth"})},[n,r.webApp.invertedOrder]);const{registerRenderer:l,unregisterRenderer:s}=Bo();return ce.useEffect(()=>(l(ar.StatefulRunmeTerminal,{onCellUpdate:a=>{a.kind!==Nt.CODE||a.outputs.length>0||(a.outputs=[Fe.create(Eo,{items:[Fe.create(Ti,{mime:ar.StatefulRunmeTerminal,type:"Buffer",data:new Uint8Array})]})])},component:({cell:a,onPid:c,onExitCode:m})=>j.jsx(kv,{cell:a,onPid:c,onExitCode:m},`console-${a.refId}`)}),()=>{s(ar.StatefulRunmeTerminal)}),[l,s]),j.jsxs("div",{className:"flex flex-col h-full",children:[j.jsxs("div",{className:"flex items-center mb-2",children:[j.jsx(Ee.Text,{size:"5",weight:"bold",className:"pr-2",children:"Actions"}),j.jsx(Ee.Button,{variant:"ghost",size:"1",className:"cursor-pointer",onClick:t,"aria-label":"Add code cell",children:j.jsx(WC,{})})]}),j.jsxs(Ee.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 p-2",children:[j.jsx("div",{ref:i}),n.map(a=>j.jsx(Tv,{cell:a},`action-${a.refId}`)),j.jsx("div",{ref:o})]})]})}const Nv=({role:e,children:t})=>{const r=e===Ut.USER?"self-end":"self-start",n={backgroundColor:e===Ut.USER?"var(--accent-9)":"var(--gray-a5)",color:e===Ut.USER?"var(--accent-contrast)":"var(--gray-background)",border:e===Ut.USER?"1px solid var(--accent-7)":"1px solid var(--gray-1)",borderRadius:"var(--radius-3)"};return j.jsx("div",{className:`${r} max-w-[80%] break-words m-1 p-3`,style:n,children:t})},GC=({cell:e})=>j.jsx(Nv,{role:Ut.USER,children:e.value}),KC=({cell:e})=>j.jsx(Nv,{role:Ut.ASSISTANT,children:j.jsx(mb,{components:{code:({children:t,...r})=>j.jsx("pre",{className:"whitespace-pre-wrap",children:j.jsx("code",{...r,children:String(t).replace(/\n$/,"")})})},children:e.value})}),HC=ce.memo(({cell:e,isRecentCodeCell:t,onClick:r})=>{var c,m;const{runCodeCell:n}=lr(),{settings:i}=rr(),o=((m=(c=e.value)==null?void 0:c.split(/&&|;|\n|\\n/)[0])==null?void 0:m.substring(0,50))||"",l=()=>{r?r():n(e)},s=i.webApp.invertedOrder?"justify-end":"justify-start",a=j.jsx("span",{className:"text-xs text-gray-400 p-2",children:"Press CTRL+ENTER to run"});return j.jsxs("div",{className:`flex ${s} items-center h-full`,children:[t&&i.webApp.invertedOrder&&a,j.jsxs("div",{className:"flex items-center m-1 p-2 bg-[#1e1e1e] rounded-md max-w-[60%] cursor-pointer",onClick:l,children:[j.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:j.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),j.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#d4d4d4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-1",children:[j.jsx("polyline",{points:"4 17 10 11 4 5"}),j.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),j.jsx("span",{className:"text-sm text-[#d4d4d4] italic truncate max-w-4/5",children:o})]}),t&&!i.webApp.invertedOrder&&a]})},(e,t)=>e.cell.refId===t.cell.refId&&JSON.stringify(e.cell.value)===JSON.stringify(t.cell.value)&&e.isRecentCodeCell===t.isRecentCodeCell),Vf=({cell:e,isRecentCodeCell:t})=>{if(e.kind===Nt.CODE)return j.jsx(HC,{cell:e,isRecentCodeCell:t},e.refId);switch(e.role){case Ut.USER:return j.jsx(GC,{cell:e});case Ut.ASSISTANT:return j.jsx(KC,{cell:e});default:return null}},Uf=()=>{const{useColumns:e,isTyping:t}=lr(),{settings:r}=rr(),{chat:n}=e(),i=ce.useRef(null);ce.useEffect(()=>{var a;r.webApp.invertedOrder||(a=i.current)==null||a.scrollIntoView({behavior:"smooth"})},[n,r.webApp.invertedOrder]);const o=r.webApp.invertedOrder?0:n.length-1,s=j.jsx("div",{className:"flex justify-start items-center h-full",children:j.jsx(Vf,{cell:OC})});return j.jsxs("div",{className:"overflow-y-clip p-1 flex flex-col whitespace-pre-wrap",children:[t&&r.webApp.invertedOrder&&s,n.map((a,c)=>j.jsx(Vf,{cell:a,isRecentCodeCell:a.kind===Nt.CODE&&c===o&&!t},c)),t&&!r.webApp.invertedOrder&&s,j.jsx("div",{ref:i})]})},Mf=()=>{const{sendUserCell:e,isInputDisabled:t}=lr(),[r,n]=ce.useState(""),i=ce.useRef(null);ce.useEffect(()=>{var s;(s=i.current)==null||s.focus()},[]);const o=s=>{s.preventDefault(),r.trim()&&(e(r),n(""))},l=s=>{if(s.key==="Enter"&&!s.shiftKey){s.preventDefault();const a=s.currentTarget.form;a&&a.requestSubmit()}};return j.jsx("form",{onSubmit:o,className:"flex w-full",children:j.jsxs(Ee.Flex,{className:"w-full flex flex-nowrap items-start gap-4 m-2",children:[j.jsx(Ee.TextArea,{name:"userInput",value:r,onChange:s=>n(s.target.value),onKeyDown:l,placeholder:"Enter your question",size:"3",className:"flex-grow min-w-0",ref:i,rows:2,style:{resize:"vertical"}}),j.jsx(Ee.Button,{type:"submit",disabled:t,children:j.jsx(jC,{})})]})})};function Sc(){const{useColumns:e,runCodeCell:t}=lr(),{settings:r}=rr(),{chat:n}=e(),i=ce.useRef(null);ce.useEffect(()=>{const l=a=>{if(a.ctrlKey&&a.key==="Enter"){const c=r.webApp.invertedOrder?n[0]:n[n.length-1];(c==null?void 0:c.kind)===Nt.CODE&&t(c)}},s=i.current;if(s)return s.addEventListener("keydown",l),()=>s.removeEventListener("keydown",l)},[n,t,r.webApp.invertedOrder]);const o=r.webApp.invertedOrder?"flex-col":"flex-col-reverse";return j.jsxs("div",{ref:i,className:"flex flex-col h-full",children:[j.jsx(Ee.Text,{size:"5",weight:"bold",className:"mb-2",children:"How can I help you?"}),j.jsx(Ee.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 p-4",children:j.jsx("div",{className:`flex ${o} h-full w-full`,children:r.webApp.invertedOrder?j.jsxs(j.Fragment,{children:[j.jsx(Mf,{}),j.jsx(Uf,{})]}):j.jsxs(j.Fragment,{children:[j.jsx(Mf,{}),j.jsx(Uf,{})]})})})]})}const Av=()=>{const{useColumns:e}=lr(),{files:t}=e(),r=ce.useRef(null),n=()=>{var l;(l=r.current)==null||l.scrollIntoView({behavior:"smooth"})},i=ce.useMemo(()=>{let l=Fe.create(nn,{});return t.length>0&&(l=t[t.length-1]),l},[t]);ce.useEffect(()=>{n()},[i]);const o=i.docResults.length>0;return j.jsxs("div",{className:"flex flex-col h-full",children:[j.jsx(Ee.Text,{size:"5",weight:"bold",className:"mb-2",children:"Docs"}),j.jsx(Ee.ScrollArea,{type:"auto",scrollbars:"vertical",className:"flex-1 pt-4",children:o?j.jsxs("div",{className:"grow",children:[i.docResults.map(l=>j.jsx("div",{className:"mb-2",children:j.jsx(Ee.Box,{p:"2",style:{borderRadius:"6px",border:"1px solid var(--gray-5)"},children:j.jsx(Ee.Text,{size:"2",weight:"medium",children:j.jsx(Ee.Link,{href:l.link,target:"_blank",className:"text-blue-500 hover:underline",children:l.fileName})})})},l.fileId)),j.jsx("div",{ref:r,className:"h-1"})]}):j.jsxs("div",{children:[j.jsx("div",{children:"No search results yet"}),j.jsx("div",{ref:r,className:"h-1"})]})})]})},XC=Fr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),YC=Pt(XC,0),Rv=Wt(YC);function xv(){const{runnerError:e}=rr(),[t]=Vt.useSearchParams(),r=ce.useMemo(()=>e&&!(e instanceof Error)?Rv[e.code]??e.code:t.get("error"),[e,t]),n=ce.useMemo(()=>e&&!(e instanceof Error)?e.message:t.get("error_description"),[e,t]),i=()=>{window.location.href="/oidc/login"};return j.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[r&&j.jsxs(Ee.Callout.Root,{color:"red",children:[j.jsxs(Ee.Callout.Text,{className:"font-bold",children:["Error: ",r]}),n&&j.jsx(Ee.Callout.Text,{children:n})]}),j.jsx(Ee.Button,{size:"4",onClick:i,className:"cursor-pointer",children:"Login"})]})}const Bv=()=>j.jsxs(Ee.Container,{size:"3",style:{padding:"2rem",textAlign:"center"},children:[j.jsx(Ee.Heading,{size:"8",mb:"4",children:"404"}),j.jsx(Ee.Text,{size:"5",color:"gray",children:"Page not found"}),j.jsx(Ee.Text,{as:"p",mt:"4",children:"The page you're looking for doesn't exist or has been moved."}),j.jsxs(Ee.Text,{as:"p",mt:"4",children:["Click"," ",j.jsx(Ee.Link,{href:"/",underline:"always",children:"here"})," ","to go back home."]})]});function Ov(){const e=Vt.useNavigate(),{settings:t,updateSettings:r,runnerError:n,defaultSettings:i}=rr(),[o,l]=ce.useState(!1),[s,a]=ce.useState(t.agentEndpoint),[c,m]=ce.useState(t.webApp.runner),[h,b]=ce.useState(t.webApp.invertedOrder),_=()=>{r({agentEndpoint:s,webApp:{runner:c,reconnect:t.webApp.reconnect,invertedOrder:h}}),l(!0)};ce.useEffect(()=>{o&&(l(!1),n&&e("/"))},[n,o,e]);const C=()=>{a(i.agentEndpoint),m(i.webApp.runner),b(i.webApp.invertedOrder)},y=ce.useMemo(()=>{if(n&&!(!n||typeof n!="object"||!("message"in n)))return n.message},[n]),d=s!==t.agentEndpoint||c!==t.webApp.runner||h!==t.webApp.invertedOrder;return j.jsxs(Ee.Box,{className:"w-full mx-auto",children:[j.jsx(Ee.Text,{size:"5",weight:"bold",className:"mb-2",children:"Settings"}),j.jsxs(Ee.Box,{className:"mt-4",children:[j.jsxs(Ee.Flex,{direction:"column",gap:"4",children:[j.jsxs(Ee.Flex,{direction:"column",gap:"2",children:[j.jsx(Ee.Text,{size:"3",weight:"bold",children:"Agent Endpoint Configuration"}),j.jsx(Ee.Text,{size:"2",color:"gray",children:"Configure the endpoint URL for the AI agent. Changes will take effect after saving."}),j.jsx(Ee.TextArea,{size:"3",placeholder:"Enter AI endpoint URL",value:s,onChange:p=>a(p.target.value)})]}),j.jsxs(Ee.Flex,{direction:"column",gap:"2",children:[j.jsx(Ee.Text,{size:"3",weight:"bold",children:"Runner Endpoint Configuration"}),j.jsx(Ee.Text,{size:"2",color:"gray",children:"Configure the WebSocket endpoint URL for the runner. Changes will take effect after saving."}),n&&j.jsx(Ee.Callout.Root,{color:"red",children:j.jsxs(Ee.Callout.Text,{className:"font-bold",children:["Runner error",y?": "+y:""]})}),j.jsx(Ee.TextArea,{size:"3",placeholder:"Enter Runner WebSocket endpoint URL",value:c,onChange:p=>m(p.target.value)}),j.jsx(Ee.Text,{size:"2",color:"gray",children:"Revert will reset endpoints to the default values, including protocol http(s), based on the current page."})]}),j.jsxs(Ee.Flex,{direction:"column",gap:"2",children:[j.jsx(Ee.Text,{size:"3",weight:"bold",children:"User Experience Mode"}),j.jsx(Ee.Text,{as:"label",size:"2",children:j.jsxs(Ee.Flex,{gap:"2",children:["Document Mode",j.jsx(Ee.Switch,{checked:h,onCheckedChange:b}),"Console Mode"]})})]})]}),j.jsxs(Ee.Flex,{gap:"3",justify:"end",mt:"4",children:[j.jsx(Ee.Button,{size:"2",variant:"soft",onClick:()=>e("/"),children:"Back"}),j.jsx(Ee.Button,{size:"2",variant:"soft",onClick:C,children:"Revert"}),j.jsx(Ee.Button,{size:"2",onClick:_,disabled:!d,children:"Save"})]})]})]})}function $C(e,t=[]){let r=[];function n(o,l){const s=He.createContext(l),a=r.length;r=[...r,l];const c=h=>{var p;const{scope:b,children:_,...C}=h,y=((p=b==null?void 0:b[e])==null?void 0:p[a])||s,d=He.useMemo(()=>C,Object.values(C));return j.jsx(y.Provider,{value:d,children:_})};c.displayName=o+"Provider";function m(h,b){var y;const _=((y=b==null?void 0:b[e])==null?void 0:y[a])||s,C=He.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[c,m]}const i=()=>{const o=r.map(l=>He.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return He.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[n,JC(i,...t)]}function JC(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=n.reduce((s,{useScope:a,scopeName:c})=>{const h=a(o)[`__scope${c}`];return{...s,...h}},{});return He.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function zC(e){const t=He.useRef(e);return He.useEffect(()=>{t.current=e}),He.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var Ec=globalThis!=null&&globalThis.document?He.useLayoutEffect:()=>{};function Pf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function QC(...e){return t=>{let r=!1;const n=e.map(i=>{const o=Pf(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i<n.length;i++){const o=n[i];typeof o=="function"?o():Pf(e[i],null)}}}}function qC(e){const t=e5(e),r=He.forwardRef((n,i)=>{const{children:o,...l}=n,s=He.Children.toArray(o),a=s.find(r5);if(a){const c=a.props.children,m=s.map(h=>h===a?He.Children.count(c)>1?He.Children.only(null):He.isValidElement(c)?c.props.children:null:h);return j.jsx(t,{...l,ref:i,children:He.isValidElement(c)?He.cloneElement(c,void 0,m):null})}return j.jsx(t,{...l,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function e5(e){const t=He.forwardRef((r,n)=>{const{children:i,...o}=r;if(He.isValidElement(i)){const l=i5(i),s=n5(o,i.props);return i.type!==He.Fragment&&(s.ref=n?QC(n,l):l),He.cloneElement(i,s)}return He.Children.count(i)>1?He.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var t5=Symbol("radix.slottable");function r5(e){return He.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===t5}function n5(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function i5(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var s5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ml=s5.reduce((e,t)=>{const r=qC(`Primitive.${t}`),n=He.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),j.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Vs={exports:{}},Da={};/**
2089
2089
  * @license React
2090
2090
  * use-sync-external-store-shim.production.js