@hyzyn/dsh-tty 0.1.1

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.
package/client.js ADDED
@@ -0,0 +1,285 @@
1
+ "use strict";(()=>{var vi=Object.create;var Ct=Object.defineProperty;var gi=Object.getOwnPropertyDescriptor;var mi=Object.getOwnPropertyNames;var Si=Object.getPrototypeOf,bi=Object.prototype.hasOwnProperty;var wt=(c,u)=>()=>(u||c((u={exports:{}}).exports,u),u.exports);var Ci=(c,u,w,x)=>{if(u&&typeof u=="object"||typeof u=="function")for(let k of mi(u))!bi.call(c,k)&&k!==w&&Ct(c,k,{get:()=>u[k],enumerable:!(x=gi(u,k))||x.enumerable});return c};var yt=(c,u,w)=>(w=c!=null?vi(Si(c)):{},Ci(u||!c||!c.__esModule?Ct(w,"default",{value:c,enumerable:!0}):w,c));var xt=wt((Pe,it)=>{(function(c,u){if(typeof Pe=="object"&&typeof it=="object")it.exports=u();else if(typeof define=="function"&&define.amd)define([],u);else{var w=u();for(var x in w)(typeof Pe=="object"?Pe:c)[x]=w[x]}})(globalThis,()=>(()=>{"use strict";var c={4567:function(k,r,n){var a=this&&this.__decorate||function(e,i,h,g){var p,m=arguments.length,l=m<3?i:g===null?g=Object.getOwnPropertyDescriptor(i,h):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,h,g);else for(var C=e.length-1;C>=0;C--)(p=e[C])&&(l=(m<3?p(l):m>3?p(i,h,l):p(i,h))||l);return m>3&&l&&Object.defineProperty(i,h,l),l},_=this&&this.__param||function(e,i){return function(h,g){i(h,g,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;let o=n(9042),f=n(9924),v=n(844),S=n(4725),d=n(2585),t=n(3656),s=r.AccessibilityManager=class extends v.Disposable{constructor(e,i,h,g){super(),this._terminal=e,this._coreBrowserService=h,this._renderService=g,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 p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,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 f.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(p=>this._handleResize(p.rows))),this.register(this._terminal.onRender(p=>this._refreshRows(p.start,p.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(p=>this._handleChar(p))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
+ `))),this.register(this._terminal.onA11yTab(p=>this._handleTab(p))),this.register(this._terminal.onKey(p=>this._handleKey(p.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,t.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,v.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
3
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let h=this._terminal.buffer,g=h.lines.length.toString();for(let p=e;p<=i;p++){let m=h.lines.get(h.ydisp+p),l=[],C=m?.translateToString(!0,void 0,void 0,l)||"",R=(h.ydisp+p+1).toString(),T=this._rowElements[p];T&&(C.length===0?(T.innerText="\xA0",this._rowColumns.set(T,[0,1])):(T.textContent=C,this._rowColumns.set(T,l)),T.setAttribute("aria-posinset",R),T.setAttribute("aria-setsize",g))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let h=e.target,g=this._rowElements[i===0?1:this._rowElements.length-2];if(h.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==g)return;let p,m;if(i===0?(p=h,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(p=this._rowElements.shift(),m=h,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){let l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{let l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},h={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(h.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===h.node&&i.offset>h.offset)&&([i,h]=[h,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let g=this._rowElements.slice(-1)[0];if(h.node.compareDocumentPosition(g)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(h={node:g,offset:g.textContent?.length??0}),!this._rowContainer.contains(h.node))return;let p=({node:C,offset:R})=>{let T=C instanceof Text?C.parentNode:C,B=parseInt(T?.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;let D=this._rowColumns.get(T);if(!D)return console.warn("columns is null. Race condition?"),null;let F=R<D.length?D[R]:D.slice(-1)[0]+1;return F>=this._terminal.cols&&(++B,F=0),{row:B,column:F}},m=p(i),l=p(h);if(m&&l){if(m.row>l.row||m.row===l.row&&m.column>=l.column)throw new Error("invalid range");this._terminal.select(m.column,m.row,(l.row-m.row)*this._terminal.cols-m.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=s=a([_(1,d.IInstantiationService),_(2,S.ICoreBrowserService),_(3,S.IRenderService)],s)},3614:(k,r)=>{function n(f){return f.replace(/\r?\n/g,"\r")}function a(f,v){return v?"\x1B[200~"+f+"\x1B[201~":f}function _(f,v,S,d){f=a(f=n(f),S.decPrivateModes.bracketedPasteMode&&d.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(f,!0),v.value=""}function o(f,v,S){let d=S.getBoundingClientRect(),t=f.clientX-d.left-10,s=f.clientY-d.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${t}px`,v.style.top=`${s}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=n,r.bracketTextForPaste=a,r.copyHandler=function(f,v){f.clipboardData&&f.clipboardData.setData("text/plain",v.selectionText),f.preventDefault()},r.handlePasteEvent=function(f,v,S,d){f.stopPropagation(),f.clipboardData&&_(f.clipboardData.getData("text/plain"),v,S,d)},r.paste=_,r.moveTextAreaUnderMouseCursor=o,r.rightClickHandler=function(f,v,S,d,t){o(f,v,S),t&&d.rightClickSelect(f),v.value=d.selectionText,v.select()}},7239:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;let a=n(1505);r.ColorContrastCache=class{constructor(){this._color=new a.TwoKeyMap,this._css=new a.TwoKeyMap}setCss(_,o,f){this._css.set(_,o,f)}getCss(_,o){return this._css.get(_,o)}setColor(_,o,f){this._color.set(_,o,f)}getColor(_,o){return this._color.get(_,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(n,a,_,o){n.addEventListener(a,_,o);let f=!1;return{dispose:()=>{f||(f=!0,n.removeEventListener(a,_,o))}}}},3551:function(k,r,n){var a=this&&this.__decorate||function(s,e,i,h){var g,p=arguments.length,m=p<3?e:h===null?h=Object.getOwnPropertyDescriptor(e,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,e,i,h);else for(var l=s.length-1;l>=0;l--)(g=s[l])&&(m=(p<3?g(m):p>3?g(e,i,m):g(e,i))||m);return p>3&&m&&Object.defineProperty(e,i,m),m},_=this&&this.__param||function(s,e){return function(i,h){e(i,h,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;let o=n(3656),f=n(8460),v=n(844),S=n(2585),d=n(4725),t=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(s,e,i,h,g){super(),this._element=s,this._mouseService=e,this._renderService=i,this._bufferService=h,this._linkProviderService=g,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,o.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;let e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let i=s.composedPath();for(let h=0;h<i.length;h++){let g=i[h];if(g.classList.contains("xterm"))break;if(g.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach(h=>{h?.forEach(g=>{g.link.dispose&&g.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=s.y);let i=!1;for(let[h,g]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(h)&&(i=this._checkLinkProviderResult(h,s,i)):g.provideLinks(s.y,p=>{if(this._isMouseOut)return;let m=p?.map(l=>({link:l}));this._activeProviderReplies?.set(h,m),i=this._checkLinkProviderResult(h,s,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)})}_removeIntersectingLinks(s,e){let i=new Set;for(let h=0;h<e.size;h++){let g=e.get(h);if(g)for(let p=0;p<g.length;p++){let m=g[p],l=m.link.range.start.y<s?0:m.link.range.start.x,C=m.link.range.end.y>s?this._bufferService.cols:m.link.range.end.x;for(let R=l;R<=C;R++){if(i.has(R)){g.splice(p--,1);break}i.add(R)}}}}_checkLinkProviderResult(s,e,i){if(!this._activeProviderReplies)return i;let h=this._activeProviderReplies.get(s),g=!1;for(let p=0;p<s;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(g=!0);if(!g&&h){let p=h.find(m=>this._linkAtPosition(m.link,e));p&&(i=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let p=0;p<this._activeProviderReplies.size;p++){let m=this._activeProviderReplies.get(p)?.find(l=>this._linkAtPosition(l.link,e));if(m){i=!0,this._handleNewLink(m);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;let e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let h=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,g=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=g&&(this._clearCurrentLink(h,g),this._lastMouseEvent)){let p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}})))}_linkHover(s,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(s,e){let i=s.range,h=this._bufferService.buffer.ydisp,g=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-h-1,i.end.x,i.end.y-h-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(g)}_linkLeave(s,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(s,e){let i=s.range.start.y*this._bufferService.cols+s.range.start.x,h=s.range.end.y*this._bufferService.cols+s.range.end.x,g=e.y*this._bufferService.cols+e.x;return i<=g&&g<=h}_positionFromMouseEvent(s,e,i){let h=i.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(h)return{x:h[0],y:h[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,i,h,g){return{x1:s,y1:e,x2:i,y2:h,cols:this._bufferService.cols,fg:g}}};r.Linkifier=t=a([_(1,d.IMouseService),_(2,d.IRenderService),_(3,S.IBufferService),_(4,d.ILinkProviderService)],t)},9042:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(k,r,n){var a=this&&this.__decorate||function(d,t,s,e){var i,h=arguments.length,g=h<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(d,t,s,e);else for(var p=d.length-1;p>=0;p--)(i=d[p])&&(g=(h<3?i(g):h>3?i(t,s,g):i(t,s))||g);return h>3&&g&&Object.defineProperty(t,s,g),g},_=this&&this.__param||function(d,t){return function(s,e){t(s,e,d)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;let o=n(511),f=n(2585),v=r.OscLinkProvider=class{constructor(d,t,s){this._bufferService=d,this._optionsService=t,this._oscLinkService=s}provideLinks(d,t){let s=this._bufferService.buffer.lines.get(d-1);if(!s)return void t(void 0);let e=[],i=this._optionsService.rawOptions.linkHandler,h=new o.CellData,g=s.getTrimmedLength(),p=-1,m=-1,l=!1;for(let C=0;C<g;C++)if(m!==-1||s.hasContent(C)){if(s.loadCell(C,h),h.hasExtendedAttrs()&&h.extended.urlId){if(m===-1){m=C,p=h.extended.urlId;continue}l=h.extended.urlId!==p}else m!==-1&&(l=!0);if(l||m!==-1&&C===g-1){let R=this._oscLinkService.getLinkData(p)?.uri;if(R){let T={start:{x:m+1,y:d},end:{x:C+(l||C!==g-1?0:1),y:d}},B=!1;if(!i?.allowNonHttpProtocols)try{let D=new URL(R);["http:","https:"].includes(D.protocol)||(B=!0)}catch{B=!0}B||e.push({text:R,range:T,activate:(D,F)=>i?i.activate(D,F,T):S(0,F),hover:(D,F)=>i?.hover?.(D,F,T),leave:(D,F)=>i?.leave?.(D,F,T)})}l=!1,h.hasExtendedAttrs()&&h.extended.urlId?(m=C,p=h.extended.urlId):(m=-1,p=-1)}}t(e)}};function S(d,t){if(confirm(`Do you want to navigate to ${t}?
4
+
5
+ WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=v=a([_(0,f.IBufferService),_(1,f.IOptionsService),_(2,f.IOscLinkService)],v)},6193:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(n,a){this._renderCallback=n,this._coreBrowserService=a,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(n){return this._refreshCallbacks.push(n),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(n,a,_){this._rowCount=_,n=n!==void 0?n:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,n):n,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a,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();let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let n of this._refreshCallbacks)n(0);this._refreshCallbacks=[]}}},3236:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;let a=n(3614),_=n(3656),o=n(3551),f=n(9042),v=n(3730),S=n(1680),d=n(3107),t=n(5744),s=n(2950),e=n(1296),i=n(428),h=n(4269),g=n(5114),p=n(8934),m=n(3230),l=n(9312),C=n(4725),R=n(6731),T=n(8055),B=n(8969),D=n(8460),F=n(844),I=n(6114),O=n(8437),H=n(2584),P=n(7399),b=n(5941),E=n(9074),L=n(2585),A=n(5435),W=n(4567),$=n(779);class q extends B.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(M={}){super(M),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.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(E.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance($.LinkProviderService),this._instantiationService.setService(C.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((y,N)=>this.refresh(y,N))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(y=>this._reportWindowsOptions(y))),this.register(this._inputHandler.onColor(y=>this._handleColorEvent(y))),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(y=>this._afterResize(y.cols,y.rows))),this.register((0,F.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(M){if(this._themeService)for(let y of M){let N,U="";switch(y.index){case 256:N="foreground",U="10";break;case 257:N="background",U="11";break;case 258:N="cursor",U="12";break;default:N="ansi",U="4;"+y.index}switch(y.type){case 0:let z=T.color.toColorRGB(N==="ansi"?this._themeService.colors.ansi[y.index]:this._themeService.colors[N]);this.coreService.triggerDataEvent(`${H.C0.ESC}]${U};${(0,b.toRgbString)(z)}${H.C1_ESCAPED.ST}`);break;case 1:if(N==="ansi")this._themeService.modifyColors(j=>j.ansi[y.index]=T.channels.toColor(...y.color));else{let j=N;this._themeService.modifyColors(G=>G[j]=T.channels.toColor(...y.color))}break;case 2:this._themeService.restoreColor(y.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(M){M?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(M){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let M=this.buffer.ybase+this.buffer.y,y=this.buffer.lines.get(M);if(!y)return;let N=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,z=y.getWidth(N),j=this._renderService.dimensions.css.cell.width*z,G=this.buffer.y*this._renderService.dimensions.css.cell.height,J=N*this._renderService.dimensions.css.cell.width;this.textarea.style.left=J+"px",this.textarea.style.top=G+"px",this.textarea.style.width=j+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",y=>{this.hasSelection()&&(0,a.copyHandler)(y,this._selectionService)}));let M=y=>(0,a.handlePasteEvent)(y,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",M)),this.register((0,_.addDisposableDomListener)(this.element,"paste",M)),I.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",y=>{y.button===2&&(0,a.rightClickHandler)(y,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",y=>{(0,a.rightClickHandler)(y,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),I.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",y=>{y.button===1&&(0,a.moveTextAreaUnderMouseCursor)(y,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",M=>this._keyUp(M),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",M=>this._keyDown(M),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",M=>this._keyPress(M),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",M=>this._compositionHelper.compositionupdate(M))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",M=>this._inputEvent(M),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(M){if(!M)throw new Error("Terminal requires a parent element.");if(M.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=M.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"),M.appendChild(this.element);let y=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),y.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,_.addDisposableDomListener)(this.screenElement,"mousemove",N=>this.updateCursorStyle(N))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),y.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),I.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(g.CoreBrowserService,this.textarea,M.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(C.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",N=>this._handleTextAreaFocus(N))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(C.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(C.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(h.CharacterJoinerService),this._instantiationService.setService(C.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(C.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(N=>this._onRender.fire(N))),this.onResize(N=>this._renderService.resize(N.cols,N.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(p.MouseService),this._instantiationService.setService(C.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(o.Linkifier,this.screenElement)),this.element.appendChild(y);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(N=>this.scrollLines(N.amount,N.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(l.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(C.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(N=>this.scrollLines(N.amount,N.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(N=>this._renderService.handleSelectionChanged(N.start,N.end,N.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(N=>{this.textarea.value=N,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(N=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(d.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",N=>this._selectionService.handleMouseDown(N))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",N=>this._handleScreenReaderModeOptionChange(N))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",N=>{!this._overviewRulerRenderer&&N&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let M=this,y=this.element;function N(j){let G=M._mouseService.getMouseReportCoords(j,M.screenElement);if(!G)return!1;let J,Y;switch(j.overrideType||j.type){case"mousemove":Y=32,j.buttons===void 0?(J=3,j.button!==void 0&&(J=j.button<3?j.button:3)):J=1&j.buttons?0:4&j.buttons?1:2&j.buttons?2:3;break;case"mouseup":Y=0,J=j.button<3?j.button:3;break;case"mousedown":Y=1,J=j.button<3?j.button:3;break;case"wheel":if(M._customWheelEventHandler&&M._customWheelEventHandler(j)===!1||M.viewport.getLinesScrolled(j)===0)return!1;Y=j.deltaY<0?0:1,J=4;break;default:return!1}return!(Y===void 0||J===void 0||J>4)&&M.coreMouseService.triggerMouseEvent({col:G.col,row:G.row,x:G.x,y:G.y,button:J,action:Y,ctrl:j.ctrlKey,alt:j.altKey,shift:j.shiftKey})}let U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:j=>(N(j),j.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(j)),wheel:j=>(N(j),this.cancel(j,!0)),mousedrag:j=>{j.buttons&&N(j)},mousemove:j=>{j.buttons||N(j)}};this.register(this.coreMouseService.onProtocolChange(j=>{j?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(j)),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&j?U.mousemove||(y.addEventListener("mousemove",z.mousemove),U.mousemove=z.mousemove):(y.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&j?U.wheel||(y.addEventListener("wheel",z.wheel,{passive:!1}),U.wheel=z.wheel):(y.removeEventListener("wheel",U.wheel),U.wheel=null),2&j?U.mouseup||(U.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&j?U.mousedrag||(U.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(y,"mousedown",j=>{if(j.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(j))return N(j),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(j)})),this.register((0,_.addDisposableDomListener)(y,"wheel",j=>{if(!U.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(j)===!1)return!1;if(!this.buffer.hasScrollback){let G=this.viewport.getLinesScrolled(j);if(G===0)return;let J=H.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(j.deltaY<0?"A":"B"),Y="";for(let ee=0;ee<Math.abs(G);ee++)Y+=J;return this.coreService.triggerDataEvent(Y,!0),this.cancel(j,!0)}return this.viewport.handleWheel(j)?this.cancel(j):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(y,"touchstart",j=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(j),this.cancel(j)},{passive:!0})),this.register((0,_.addDisposableDomListener)(y,"touchmove",j=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(j)?void 0:this.cancel(j)},{passive:!1}))}refresh(M,y){this._renderService?.refreshRows(M,y)}updateCursorStyle(M){this._selectionService?.shouldColumnSelect(M)?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(M,y,N=0){N===1?(super.scrollLines(M,y,N),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(M)}paste(M){(0,a.paste)(M,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(M){this._customKeyEventHandler=M}attachCustomWheelEventHandler(M){this._customWheelEventHandler=M}registerLinkProvider(M){return this._linkProviderService.registerLinkProvider(M)}registerCharacterJoiner(M){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let y=this._characterJoinerService.register(M);return this.refresh(0,this.rows-1),y}deregisterCharacterJoiner(M){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(M)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(M){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+M)}registerDecoration(M){return this._decorationService.registerDecoration(M)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(M,y,N){this._selectionService.setSelection(M,y,N)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(M,y){this._selectionService?.selectLines(M,y)}_keyDown(M){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;let y=this.browser.isMac&&this.options.macOptionIsMeta&&M.altKey;if(!y&&!this._compositionHelper.keydown(M))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;y||M.key!=="Dead"&&M.key!=="AltGraph"||(this._unprocessedDeadKey=!0);let N=(0,P.evaluateKeyboardEvent)(M,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(M),N.type===3||N.type===2){let U=this.rows-1;return this.scrollLines(N.type===2?-U:U),this.cancel(M,!0)}return N.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,M)||(N.cancel&&this.cancel(M,!0),!N.key||!!(M.key&&!M.ctrlKey&&!M.altKey&&!M.metaKey&&M.key.length===1&&M.key.charCodeAt(0)>=65&&M.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(N.key!==H.C0.ETX&&N.key!==H.C0.CR||(this.textarea.value=""),this._onKey.fire({key:N.key,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(N.key,!0),!this.optionsService.rawOptions.screenReaderMode||M.altKey||M.ctrlKey?this.cancel(M,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(M,y){let N=M.isMac&&!this.options.macOptionIsMeta&&y.altKey&&!y.ctrlKey&&!y.metaKey||M.isWindows&&y.altKey&&y.ctrlKey&&!y.metaKey||M.isWindows&&y.getModifierState("AltGraph");return y.type==="keypress"?N:N&&(!y.keyCode||y.keyCode>47)}_keyUp(M){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1||(function(y){return y.keyCode===16||y.keyCode===17||y.keyCode===18}(M)||this.focus(),this.updateCursorStyle(M),this._keyPressHandled=!1)}_keyPress(M){let y;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;if(this.cancel(M),M.charCode)y=M.charCode;else if(M.which===null||M.which===void 0)y=M.keyCode;else{if(M.which===0||M.charCode===0)return!1;y=M.which}return!(!y||(M.altKey||M.ctrlKey||M.metaKey)&&!this._isThirdLevelShift(this.browser,M)||(y=String.fromCharCode(y),this._onKey.fire({key:y,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(y,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(M){if(M.data&&M.inputType==="insertText"&&(!M.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let y=M.data;return this.coreService.triggerDataEvent(y,!0),this.cancel(M),!0}return!1}resize(M,y){M!==this.cols||y!==this.rows?super.resize(M,y):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(M,y){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){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 M=1;M<this.rows;M++)this.buffer.lines.push(this.buffer.getBlankLine(O.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let M=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=M,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(H.C0.ESC+"[I"):this.coreService.triggerDataEvent(H.C0.ESC+"[O")}_reportWindowsOptions(M){if(this._renderService)switch(M){case A.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let y=this._renderService.dimensions.css.canvas.width.toFixed(0),N=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[4;${N};${y}t`);break;case A.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let U=this._renderService.dimensions.css.cell.width.toFixed(0),z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[6;${z};${U}t`)}}cancel(M,y){if(this.options.cancelEvents||y)return M.preventDefault(),M.stopPropagation(),!1}}r.Terminal=q},9924:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(n,a=1e3){this._renderCallback=n,this._debounceThresholdMS=a,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(n,a,_){this._rowCount=_,n=n!==void 0?n:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,n):n,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a;let o=Date.now();if(o-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=o,this._innerRefresh();else if(!this._additionalRefreshRequested){let f=o-this._lastRefreshMs,v=this._debounceThresholdMS-f;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a)}}},1680:function(k,r,n){var a=this&&this.__decorate||function(s,e,i,h){var g,p=arguments.length,m=p<3?e:h===null?h=Object.getOwnPropertyDescriptor(e,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,e,i,h);else for(var l=s.length-1;l>=0;l--)(g=s[l])&&(m=(p<3?g(m):p>3?g(e,i,m):g(e,i))||m);return p>3&&m&&Object.defineProperty(e,i,m),m},_=this&&this.__param||function(s,e){return function(i,h){e(i,h,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;let o=n(3656),f=n(4725),v=n(8460),S=n(844),d=n(2585),t=r.Viewport=class extends S.Disposable{constructor(s,e,i,h,g,p,m,l){super(),this._viewportElement=s,this._scrollArea=e,this._bufferService=i,this._optionsService=h,this._charSizeService=g,this._renderService=p,this._coreBrowserService=m,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 v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,o.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(C=>this._activeBuffer=C.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(C=>this._renderDimensions=C)),this._handleThemeChange(l.colors),this.register(l.onChangeColors(C=>this._handleThemeChange(C))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.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(s){if(s)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;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){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});let e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<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(s,e){let i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&i<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){let e=this._getPixelsScrolled(s);return e!==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+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let e=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(s,e){let i,h="",g=[],p=e??this._bufferService.buffer.lines.length,m=this._bufferService.buffer.lines;for(let l=s;l<p;l++){let C=m.get(l);if(!C)continue;let R=m.get(l+1)?.isWrapped;if(h+=C.translateToString(!R),!R||l===m.length-1){let T=document.createElement("div");T.textContent=h,g.push(T),h.length>0&&(i=T),h=""}}return{bufferElements:g,cursorElement:i}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(s,e){let i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&e.altKey||i==="ctrl"&&e.ctrlKey||i==="shift"&&e.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){let e=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}};r.Viewport=t=a([_(2,d.IBufferService),_(3,d.IOptionsService),_(4,f.ICharSizeService),_(5,f.IRenderService),_(6,f.ICoreBrowserService),_(7,f.IThemeService)],t)},3107:function(k,r,n){var a=this&&this.__decorate||function(d,t,s,e){var i,h=arguments.length,g=h<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(d,t,s,e);else for(var p=d.length-1;p>=0;p--)(i=d[p])&&(g=(h<3?i(g):h>3?i(t,s,g):i(t,s))||g);return h>3&&g&&Object.defineProperty(t,s,g),g},_=this&&this.__param||function(d,t){return function(s,e){t(s,e,d)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;let o=n(4725),f=n(844),v=n(2585),S=r.BufferDecorationRenderer=class extends f.Disposable{constructor(d,t,s,e,i){super(),this._screenElement=d,this._bufferService=t,this._coreBrowserService=s,this._decorationService=e,this._renderService=i,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(h=>this._removeDecoration(h))),this.register((0,f.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(let d of this._decorationService.decorations)this._renderDecoration(d);this._dimensionsChanged=!1}_renderDecoration(d){this._refreshStyle(d),this._dimensionsChanged&&this._refreshXPosition(d)}_createElement(d){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",d?.options?.layer==="top"),t.style.width=`${Math.round((d.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(d.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(d.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let s=d.options.x??0;return s&&s>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(d,t),t}_refreshStyle(d){let t=d.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)d.element&&(d.element.style.display="none",d.onRenderEmitter.fire(d.element));else{let s=this._decorationElements.get(d);s||(s=this._createElement(d),d.element=s,this._decorationElements.set(d,s),this._container.appendChild(s),d.onDispose(()=>{this._decorationElements.delete(d),s.remove()})),s.style.top=t*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",d.onRenderEmitter.fire(s)}}_refreshXPosition(d,t=d.element){if(!t)return;let s=d.options.x??0;(d.options.anchor||"left")==="right"?t.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(d){this._decorationElements.get(d)?.remove(),this._decorationElements.delete(d),d.dispose()}};r.BufferDecorationRenderer=S=a([_(1,v.IBufferService),_(2,o.ICoreBrowserService),_(3,v.IDecorationService),_(4,o.IRenderService)],S)},5871:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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(n){if(n.options.overviewRulerOptions){for(let a of this._zones)if(a.color===n.options.overviewRulerOptions.color&&a.position===n.options.overviewRulerOptions.position){if(this._lineIntersectsZone(a,n.marker.line))return;if(this._lineAdjacentToZone(a,n.marker.line,n.options.overviewRulerOptions.position))return void this._addLineToZone(a,n.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=n.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=n.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=n.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=n.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:n.options.overviewRulerOptions.color,position:n.options.overviewRulerOptions.position,startBufferLine:n.marker.line,endBufferLine:n.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(n){this._linePadding=n}_lineIntersectsZone(n,a){return a>=n.startBufferLine&&a<=n.endBufferLine}_lineAdjacentToZone(n,a,_){return a>=n.startBufferLine-this._linePadding[_||"full"]&&a<=n.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(n,a){n.startBufferLine=Math.min(n.startBufferLine,a),n.endBufferLine=Math.max(n.endBufferLine,a)}}},5744:function(k,r,n){var a=this&&this.__decorate||function(i,h,g,p){var m,l=arguments.length,C=l<3?h:p===null?p=Object.getOwnPropertyDescriptor(h,g):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,h,g,p);else for(var R=i.length-1;R>=0;R--)(m=i[R])&&(C=(l<3?m(C):l>3?m(h,g,C):m(h,g))||C);return l>3&&C&&Object.defineProperty(h,g,C),C},_=this&&this.__param||function(i,h){return function(g,p){h(g,p,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;let o=n(5871),f=n(4725),v=n(844),S=n(2585),d={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},e=r.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(i,h,g,p,m,l,C){super(),this._viewportElement=i,this._screenElement=h,this._bufferService=g,this._decorationService=p,this._renderService=m,this._optionsService=l,this._coreBrowserService=C,this._colorZoneStore=new o.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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)(()=>{this._canvas?.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(){let i=Math.floor(this._canvas.width/3),h=Math.ceil(this._canvas.width/3);t.full=this._canvas.width,t.left=i,t.center=h,t.right=i,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=t.left,s.right=t.left+t.center}_refreshDrawHeightConstants(){d.full=Math.round(2*this._coreBrowserService.dpr);let i=this._canvas.height/this._bufferService.buffer.lines.length,h=Math.round(Math.max(Math.min(i,12),6)*this._coreBrowserService.dpr);d.left=h,d.center=h,d.right=h}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.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(let h of this._decorationService.decorations)this._colorZoneStore.addDecoration(h);this._ctx.lineWidth=1;let i=this._colorZoneStore.zones;for(let h of i)h.position!=="full"&&this._renderColorZone(h);for(let h of i)h.position==="full"&&this._renderColorZone(h);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(i){this._ctx.fillStyle=i.color,this._ctx.fillRect(s[i.position||"full"],Math.round((this._canvas.height-1)*(i.startBufferLine/this._bufferService.buffers.active.lines.length)-d[i.position||"full"]/2),t[i.position||"full"],Math.round((this._canvas.height-1)*((i.endBufferLine-i.startBufferLine)/this._bufferService.buffers.active.lines.length)+d[i.position||"full"]))}_queueRefresh(i,h){this._shouldUpdateDimensions=i||this._shouldUpdateDimensions,this._shouldUpdateAnchor=h||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=e=a([_(2,S.IBufferService),_(3,S.IDecorationService),_(4,f.IRenderService),_(5,S.IOptionsService),_(6,f.ICoreBrowserService)],e)},2950:function(k,r,n){var a=this&&this.__decorate||function(d,t,s,e){var i,h=arguments.length,g=h<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(d,t,s,e);else for(var p=d.length-1;p>=0;p--)(i=d[p])&&(g=(h<3?i(g):h>3?i(t,s,g):i(t,s))||g);return h>3&&g&&Object.defineProperty(t,s,g),g},_=this&&this.__param||function(d,t){return function(s,e){t(s,e,d)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;let o=n(4725),f=n(2585),v=n(2584),S=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(d,t,s,e,i,h){this._textarea=d,this._compositionView=t,this._bufferService=s,this._optionsService=e,this._coreService=i,this._renderService=h,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(d){this._compositionView.textContent=d.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(d){if(this._isComposing||this._isSendingComposition){if(d.keyCode===229||d.keyCode===16||d.keyCode===17||d.keyCode===18)return!1;this._finalizeComposition(!1)}return d.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(d){if(this._compositionView.classList.remove("active"),this._isComposing=!1,d){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let d=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,s=t.replace(d,"");this._dataAlreadySent=s,t.length>d.length?this._coreService.triggerDataEvent(s,!0):t.length<d.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):t.length===d.length&&t!==d&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(d){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let h=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(h.width,1)+"px",this._textarea.style.height=Math.max(h.height,1)+"px",this._textarea.style.lineHeight=h.height+"px"}d||setTimeout(()=>this.updateCompositionElements(!0),0)}}};r.CompositionHelper=S=a([_(2,f.IBufferService),_(3,f.IOptionsService),_(4,f.ICoreService),_(5,o.IRenderService)],S)},9806:(k,r)=>{function n(a,_,o){let f=o.getBoundingClientRect(),v=a.getComputedStyle(o),S=parseInt(v.getPropertyValue("padding-left")),d=parseInt(v.getPropertyValue("padding-top"));return[_.clientX-f.left-S,_.clientY-f.top-d]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=n,r.getCoords=function(a,_,o,f,v,S,d,t,s){if(!S)return;let e=n(a,_,o);return e?(e[0]=Math.ceil((e[0]+(s?d/2:0))/d),e[1]=Math.ceil(e[1]/t),e[0]=Math.min(Math.max(e[0],1),f+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),v),e):void 0}},9504:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;let a=n(2584);function _(t,s,e,i){let h=t-o(t,e),g=s-o(s,e),p=Math.abs(h-g)-function(m,l,C){let R=0,T=m-o(m,C),B=l-o(l,C);for(let D=0;D<Math.abs(T-B);D++){let F=f(m,l)==="A"?-1:1;C.buffer.lines.get(T+F*D)?.isWrapped&&R++}return R}(t,s,e);return d(p,S(f(t,s),i))}function o(t,s){let e=0,i=s.buffer.lines.get(t),h=i?.isWrapped;for(;h&&t>=0&&t<s.rows;)e++,i=s.buffer.lines.get(--t),h=i?.isWrapped;return e}function f(t,s){return t>s?"A":"B"}function v(t,s,e,i,h,g){let p=t,m=s,l="";for(;p!==e||m!==i;)p+=h?1:-1,h&&p>g.cols-1?(l+=g.buffer.translateBufferLineToString(m,!1,t,p),p=0,t=0,m++):!h&&p<0&&(l+=g.buffer.translateBufferLineToString(m,!1,0,t+1),p=g.cols-1,t=p,m--);return l+g.buffer.translateBufferLineToString(m,!1,t,p)}function S(t,s){let e=s?"O":"[";return a.C0.ESC+e+t}function d(t,s){t=Math.floor(t);let e="";for(let i=0;i<t;i++)e+=s;return e}r.moveToCellSequence=function(t,s,e,i){let h=e.buffer.x,g=e.buffer.y;if(!e.buffer.hasScrollback)return function(l,C,R,T,B,D){return _(C,T,B,D).length===0?"":d(v(l,C,l,C-o(C,B),!1,B).length,S("D",D))}(h,g,0,s,e,i)+_(g,s,e,i)+function(l,C,R,T,B,D){let F;F=_(C,T,B,D).length>0?T-o(T,B):C;let I=T,O=function(H,P,b,E,L,A){let W;return W=_(b,E,L,A).length>0?E-o(E,L):P,H<b&&W<=E||H>=b&&W<E?"C":"D"}(l,C,R,T,B,D);return d(v(l,F,R,I,O==="C",B).length,S(O,D))}(h,g,t,s,e,i);let p;if(g===s)return p=h>t?"D":"C",d(Math.abs(h-t),S(p,i));p=g>s?"D":"C";let m=Math.abs(g-s);return d(function(l,C){return C.cols-l}(g>s?t:h,e)+(m-1)*e.cols+1+((g>s?h:t)-1),S(p,i))}},1296:function(k,r,n){var a=this&&this.__decorate||function(D,F,I,O){var H,P=arguments.length,b=P<3?F:O===null?O=Object.getOwnPropertyDescriptor(F,I):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(D,F,I,O);else for(var E=D.length-1;E>=0;E--)(H=D[E])&&(b=(P<3?H(b):P>3?H(F,I,b):H(F,I))||b);return P>3&&b&&Object.defineProperty(F,I,b),b},_=this&&this.__param||function(D,F){return function(I,O){F(I,O,D)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;let o=n(3787),f=n(2550),v=n(2223),S=n(6171),d=n(6052),t=n(4725),s=n(8055),e=n(8460),i=n(844),h=n(2585),g="xterm-dom-renderer-owner-",p="xterm-rows",m="xterm-fg-",l="xterm-bg-",C="xterm-focus",R="xterm-selection",T=1,B=r.DomRenderer=class extends i.Disposable{constructor(D,F,I,O,H,P,b,E,L,A,W,$,q){super(),this._terminal=D,this._document=F,this._element=I,this._screenElement=O,this._viewportElement=H,this._helperContainer=P,this._linkifier2=b,this._charSizeService=L,this._optionsService=A,this._bufferService=W,this._coreBrowserService=$,this._themeService=q,this._terminalClass=T++,this._rowElements=[],this._selectionRenderModel=(0,d.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(p),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(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(K=>this._injectCss(K))),this._injectCss(this._themeService.colors),this._rowFactory=E.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(g+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(K=>this._handleLinkHover(K))),this.register(this._linkifier2.onHideLinkUnderline(K=>this._handleLinkLeave(K))),this.register((0,i.toDisposable)(()=>{this._element.classList.remove(g+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new f.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(){let 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(let I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let F=`${this._terminalSelector} .${p} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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 F=`${this._terminalSelector} .${p} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${p} .xterm-dim { color: ${s.color.multiplyOpacity(D.foreground,.5).css};}`,F+=`${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;}`;let I=`blink_underline_${this._terminalClass}`,O=`blink_bar_${this._terminalClass}`,H=`blink_block_${this._terminalClass}`;F+=`@keyframes ${I} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${O} { 50% { box-shadow: none; }}`,F+=`@keyframes ${H} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,F+=`${this._terminalSelector} .${p}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${p}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${O} 1s step-end infinite;}${this._terminalSelector} .${p}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(let[P,b]of D.ansi.entries())F+=`${this._terminalSelector} .${m}${P} { color: ${b.css}; }${this._terminalSelector} .${m}${P}.xterm-dim { color: ${s.color.multiplyOpacity(b,.5).css}; }${this._terminalSelector} .${l}${P} { background-color: ${b.css}; }`;F+=`${this._terminalSelector} .${m}${v.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(D.background).css}; }${this._terminalSelector} .${m}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${l}${v.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){let 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,F){for(let I=this._rowElements.length;I<=F;I++){let O=this._document.createElement("div");this._rowContainer.appendChild(O),this._rowElements.push(O)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,F){this._refreshRowElements(D,F),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(C),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(C),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,F,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,F,I),this.renderRows(0,this._bufferService.rows-1),!D||!F)return;this._selectionRenderModel.update(this._terminal,D,F,I);let O=this._selectionRenderModel.viewportStartRow,H=this._selectionRenderModel.viewportEndRow,P=this._selectionRenderModel.viewportCappedStartRow,b=this._selectionRenderModel.viewportCappedEndRow;if(P>=this._bufferService.rows||b<0)return;let E=this._document.createDocumentFragment();if(I){let L=D[0]>F[0];E.appendChild(this._createSelectionElement(P,L?F[0]:D[0],L?D[0]:F[0],b-P+1))}else{let L=O===P?D[0]:0,A=P===H?F[0]:this._bufferService.cols;E.appendChild(this._createSelectionElement(P,L,A));let W=b-P-1;if(E.appendChild(this._createSelectionElement(P+1,0,this._bufferService.cols,W)),P!==b){let $=H===b?F[0]:this._bufferService.cols;E.appendChild(this._createSelectionElement(b,0,$))}}this._selectionContainer.appendChild(E)}_createSelectionElement(D,F,I,O=1){let H=this._document.createElement("div"),P=F*this.dimensions.css.cell.width,b=this.dimensions.css.cell.width*(I-F);return P+b>this.dimensions.css.canvas.width&&(b=this.dimensions.css.canvas.width-P),H.style.height=O*this.dimensions.css.cell.height+"px",H.style.top=D*this.dimensions.css.cell.height+"px",H.style.left=`${P}px`,H.style.width=`${b}px`,H}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(let D of this._rowElements)D.replaceChildren()}renderRows(D,F){let I=this._bufferService.buffer,O=I.ybase+I.y,H=Math.min(I.x,this._bufferService.cols-1),P=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,E=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=D;L<=F;L++){let A=L+I.ydisp,W=this._rowElements[L],$=I.lines.get(A);if(!W||!$)break;W.replaceChildren(...this._rowFactory.createRow($,A,A===O,b,E,H,P,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${g}${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,F,I,O,H,P){I<0&&(D=0),O<0&&(F=0);let b=this._bufferService.rows-1;I=Math.max(Math.min(I,b),0),O=Math.max(Math.min(O,b),0),H=Math.min(H,this._bufferService.cols);let E=this._bufferService.buffer,L=E.ybase+E.y,A=Math.min(E.x,H-1),W=this._optionsService.rawOptions.cursorBlink,$=this._optionsService.rawOptions.cursorStyle,q=this._optionsService.rawOptions.cursorInactiveStyle;for(let K=I;K<=O;++K){let M=K+E.ydisp,y=this._rowElements[K],N=E.lines.get(M);if(!y||!N)break;y.replaceChildren(...this._rowFactory.createRow(N,M,M===L,$,q,A,W,this.dimensions.css.cell.width,this._widthCache,P?K===I?D:0:-1,P?(K===O?F:H)-1:-1))}}};r.DomRenderer=B=a([_(7,h.IInstantiationService),_(8,t.ICharSizeService),_(9,h.IOptionsService),_(10,h.IBufferService),_(11,t.ICoreBrowserService),_(12,t.IThemeService)],B)},3787:function(k,r,n){var a=this&&this.__decorate||function(p,m,l,C){var R,T=arguments.length,B=T<3?m:C===null?C=Object.getOwnPropertyDescriptor(m,l):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(p,m,l,C);else for(var D=p.length-1;D>=0;D--)(R=p[D])&&(B=(T<3?R(B):T>3?R(m,l,B):R(m,l))||B);return T>3&&B&&Object.defineProperty(m,l,B),B},_=this&&this.__param||function(p,m){return function(l,C){m(l,C,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;let o=n(2223),f=n(643),v=n(511),S=n(2585),d=n(8055),t=n(4725),s=n(4269),e=n(6171),i=n(3734),h=r.DomRendererRowFactory=class{constructor(p,m,l,C,R,T,B){this._document=p,this._characterJoinerService=m,this._optionsService=l,this._coreBrowserService=C,this._coreService=R,this._decorationService=T,this._themeService=B,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(p,m,l){this._selectionStart=p,this._selectionEnd=m,this._columnSelectMode=l}createRow(p,m,l,C,R,T,B,D,F,I,O){let H=[],P=this._characterJoinerService.getJoinedCharacters(m),b=this._themeService.colors,E,L=p.getNoBgTrimmedLength();l&&L<T+1&&(L=T+1);let A=0,W="",$=0,q=0,K=0,M=!1,y=0,N=!1,U=0,z=[],j=I!==-1&&O!==-1;for(let G=0;G<L;G++){p.loadCell(G,this._workCell);let J=this._workCell.getWidth();if(J===0)continue;let Y=!1,ee=G,V=this._workCell;if(P.length>0&&G===P[0][0]){Y=!0;let X=P.shift();V=new s.JoinedCellData(this._workCell,p.translateToString(!0,X[0],X[1]),X[1]-X[0]),ee=X[1]-1,J=V.getWidth()}let Ee=this._isCellInSelection(G,m),Ze=l&&G===T,Qe=j&&G>=I&&G<=O,et=!1;this._decorationService.forEachDecorationAtCell(G,m,void 0,X=>{et=!0});let Oe=V.getChars()||f.WHITESPACE_CELL_CHAR;if(Oe===" "&&(V.isUnderline()||V.isOverline())&&(Oe="\xA0"),U=J*D-F.get(Oe,V.isBold(),V.isItalic()),E){if(A&&(Ee&&N||!Ee&&!N&&V.bg===$)&&(Ee&&N&&b.selectionForeground||V.fg===q)&&V.extended.ext===K&&Qe===M&&U===y&&!Ze&&!Y&&!et){V.isInvisible()?W+=f.WHITESPACE_CELL_CHAR:W+=Oe,A++;continue}A&&(E.textContent=W),E=this._document.createElement("span"),A=0,W=""}else E=this._document.createElement("span");if($=V.bg,q=V.fg,K=V.extended.ext,M=Qe,y=U,N=Ee,Y&&T>=G&&T<=ee&&(T=G),!this._coreService.isCursorHidden&&Ze&&this._coreService.isCursorInitialized){if(z.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&z.push("xterm-cursor-blink"),z.push(C==="bar"?"xterm-cursor-bar":C==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":z.push("xterm-cursor-outline");break;case"block":z.push("xterm-cursor-block");break;case"bar":z.push("xterm-cursor-bar");break;case"underline":z.push("xterm-cursor-underline")}}if(V.isBold()&&z.push("xterm-bold"),V.isItalic()&&z.push("xterm-italic"),V.isDim()&&z.push("xterm-dim"),W=V.isInvisible()?f.WHITESPACE_CELL_CHAR:V.getChars()||f.WHITESPACE_CELL_CHAR,V.isUnderline()&&(z.push(`xterm-underline-${V.extended.underlineStyle}`),W===" "&&(W="\xA0"),!V.isUnderlineColorDefault()))if(V.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB(V.getUnderlineColor()).join(",")})`;else{let X=V.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&V.isBold()&&X<8&&(X+=8),E.style.textDecorationColor=b.ansi[X].css}V.isOverline()&&(z.push("xterm-overline"),W===" "&&(W="\xA0")),V.isStrikethrough()&&z.push("xterm-strikethrough"),Qe&&(E.style.textDecoration="underline");let se=V.getFgColor(),xe=V.getFgColorMode(),oe=V.getBgColor(),ke=V.getBgColorMode(),tt=!!V.isInverse();if(tt){let X=se;se=oe,oe=X;let pi=xe;xe=ke,ke=pi}let ue,Ie,_e,Le=!1;switch(this._decorationService.forEachDecorationAtCell(G,m,void 0,X=>{X.options.layer!=="top"&&Le||(X.backgroundColorRGB&&(ke=50331648,oe=X.backgroundColorRGB.rgba>>8&16777215,ue=X.backgroundColorRGB),X.foregroundColorRGB&&(xe=50331648,se=X.foregroundColorRGB.rgba>>8&16777215,Ie=X.foregroundColorRGB),Le=X.options.layer==="top")}),!Le&&Ee&&(ue=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,oe=ue.rgba>>8&16777215,ke=50331648,Le=!0,b.selectionForeground&&(xe=50331648,se=b.selectionForeground.rgba>>8&16777215,Ie=b.selectionForeground)),Le&&z.push("xterm-decoration-top"),ke){case 16777216:case 33554432:_e=b.ansi[oe],z.push(`xterm-bg-${oe}`);break;case 50331648:_e=d.channels.toColor(oe>>16,oe>>8&255,255&oe),this._addStyle(E,`background-color:#${g((oe>>>0).toString(16),"0",6)}`);break;default:tt?(_e=b.foreground,z.push(`xterm-bg-${o.INVERTED_DEFAULT_COLOR}`)):_e=b.background}switch(ue||V.isDim()&&(ue=d.color.multiplyOpacity(_e,.5)),xe){case 16777216:case 33554432:V.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(E,_e,b.ansi[se],V,ue,void 0)||z.push(`xterm-fg-${se}`);break;case 50331648:let X=d.channels.toColor(se>>16&255,se>>8&255,255&se);this._applyMinimumContrast(E,_e,X,V,ue,Ie)||this._addStyle(E,`color:#${g(se.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(E,_e,b.foreground,V,ue,Ie)||tt&&z.push(`xterm-fg-${o.INVERTED_DEFAULT_COLOR}`)}z.length&&(E.className=z.join(" "),z.length=0),Ze||Y||et?E.textContent=W:A++,U!==this.defaultSpacing&&(E.style.letterSpacing=`${U}px`),H.push(E),G=ee}return E&&A&&(E.textContent=W),H}_applyMinimumContrast(p,m,l,C,R,T){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(C.getCode()))return!1;let B=this._getContrastCache(C),D;if(R||T||(D=B.getColor(m.rgba,l.rgba)),D===void 0){let F=this._optionsService.rawOptions.minimumContrastRatio/(C.isDim()?2:1);D=d.color.ensureContrastRatio(R||m,T||l,F),B.setColor((R||m).rgba,(T||l).rgba,D??null)}return!!D&&(this._addStyle(p,`color:${D.css}`),!0)}_getContrastCache(p){return p.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(p,m){p.setAttribute("style",`${p.getAttribute("style")||""}${m};`)}_isCellInSelection(p,m){let l=this._selectionStart,C=this._selectionEnd;return!(!l||!C)&&(this._columnSelectMode?l[0]<=C[0]?p>=l[0]&&m>=l[1]&&p<C[0]&&m<=C[1]:p<l[0]&&m>=l[1]&&p>=C[0]&&m<=C[1]:m>l[1]&&m<C[1]||l[1]===C[1]&&m===l[1]&&p>=l[0]&&p<C[0]||l[1]<C[1]&&m===C[1]&&p<C[0]||l[1]<C[1]&&m===l[1]&&p>=l[0])}};function g(p,m,l){for(;p.length<l;)p=m+p;return p}r.DomRendererRowFactory=h=a([_(1,t.ICharacterJoinerService),_(2,S.IOptionsService),_(3,t.ICoreBrowserService),_(4,S.ICoreService),_(5,S.IDecorationService),_(6,t.IThemeService)],h)},2550:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(n,a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=n.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";let _=n.createElement("span");_.classList.add("xterm-char-measure-element");let o=n.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold";let f=n.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";let v=n.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[_,o,f,v],this._container.appendChild(_),this._container.appendChild(o),this._container.appendChild(f),this._container.appendChild(v),a.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(n,a,_,o){n===this._font&&a===this._fontSize&&_===this._weight&&o===this._weightBold||(this._font=n,this._fontSize=a,this._weight=_,this._weightBold=o,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${o}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${o}`,this.clear())}get(n,a,_){let o=0;if(!a&&!_&&n.length===1&&(o=n.charCodeAt(0))<256){if(this._flat[o]!==-9999)return this._flat[o];let S=this._measure(n,0);return S>0&&(this._flat[o]=S),S}let f=n;a&&(f+="B"),_&&(f+="I");let v=this._holey.get(f);if(v===void 0){let S=0;a&&(S|=1),_&&(S|=2),v=this._measure(n,S),v>0&&this._holey.set(f,v)}return v}_measure(n,a){let _=this._measureElements[a];return _.textContent=n.repeat(32),_.offsetWidth/32}}},2223:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;let a=n(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},6171:(k,r)=>{function n(_){return 57508<=_&&_<=57558}function a(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},r.isPowerlineGlyph=n,r.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},r.isEmoji=a,r.allowRescaling=function(_,o,f,v){return o===1&&f>Math.ceil(1.5*v)&&_!==void 0&&_>255&&!a(_)&&!n(_)&&!function(S){return 57344<=S&&S<=63743}(_)},r.treatGlyphAsBackgroundColor=function(_){return n(_)||function(o){return 9472<=o&&o<=9631}(_)},r.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}}}},r.computeNextVariantOffset=function(_,o,f=0){return(_-(2*Math.round(o)-f))%(2*Math.round(o))}},6052:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class n{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(_,o,f,v=!1){if(this.selectionStart=o,this.selectionEnd=f,!o||!f||o[0]===f[0]&&o[1]===f[1])return void this.clear();let S=_.buffers.active.ydisp,d=o[1]-S,t=f[1]-S,s=Math.max(d,0),e=Math.min(t,_.rows-1);s>=_.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=d,this.viewportEndRow=t,this.viewportCappedStartRow=s,this.viewportCappedEndRow=e,this.startCol=o[0],this.endCol=f[0])}isCellSelected(_,o,f){return!!this.hasSelection&&(f-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&f>=this.viewportCappedStartRow&&o<this.endCol&&f<=this.viewportCappedEndRow:o<this.startCol&&f>=this.viewportCappedStartRow&&o>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&o>=this.startCol)}}r.createSelectionRenderModel=function(){return new n}},456:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(n){this._bufferService=n,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()){let n=this.selectionStart[0]+this.selectionStartLength;return n>this._bufferService.cols?n%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)-1]:[n%this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)]:[n,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let n=this.selectionStart[0]+this.selectionStartLength;return n>this._bufferService.cols?[n%this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)]:[Math.max(n,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let n=this.selectionStart,a=this.selectionEnd;return!(!n||!a)&&(n[1]>a[1]||n[1]===a[1]&&n[0]>a[0])}handleTrim(n){return this.selectionStart&&(this.selectionStart[1]-=n),this.selectionEnd&&(this.selectionEnd[1]-=n),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(k,r,n){var a=this&&this.__decorate||function(e,i,h,g){var p,m=arguments.length,l=m<3?i:g===null?g=Object.getOwnPropertyDescriptor(i,h):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,h,g);else for(var C=e.length-1;C>=0;C--)(p=e[C])&&(l=(m<3?p(l):m>3?p(i,h,l):p(i,h))||l);return m>3&&l&&Object.defineProperty(i,h,l),l},_=this&&this.__param||function(e,i){return function(h,g){i(h,g,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;let o=n(2585),f=n(8460),v=n(844),S=r.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,i,h){super(),this._optionsService=h,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new t(e,i,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){let e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};r.CharSizeService=S=a([_(2,o.IOptionsService)],S);class d extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(i,h){i!==void 0&&i>0&&h!==void 0&&h>0&&(this._result.width=i,this._result.height=h)}}class t extends d{constructor(i,h,g){super(),this._document=i,this._parentElement=h,this._optionsService=g,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 s extends d{constructor(i){super(),this._optionsService=i,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let h=this._ctx.measureText("W");if(!("width"in h&&"fontBoundingBoxAscent"in h&&"fontBoundingBoxDescent"in h))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let i=this._ctx.measureText("W");return this._validateAndSet(i.width,i.fontBoundingBoxAscent+i.fontBoundingBoxDescent),this._result}}},4269:function(k,r,n){var a=this&&this.__decorate||function(s,e,i,h){var g,p=arguments.length,m=p<3?e:h===null?h=Object.getOwnPropertyDescriptor(e,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,e,i,h);else for(var l=s.length-1;l>=0;l--)(g=s[l])&&(m=(p<3?g(m):p>3?g(e,i,m):g(e,i))||m);return p>3&&m&&Object.defineProperty(e,i,m),m},_=this&&this.__param||function(s,e){return function(i,h){e(i,h,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;let o=n(3734),f=n(643),v=n(511),S=n(2585);class d extends o.AttributeData{constructor(e,i,h){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=h}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=d;let t=r.CharacterJoinerService=class Et{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(e){let i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===e)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let i=this._bufferService.buffer.lines.get(e);if(!i||i.length===0)return[];let h=[],g=i.translateToString(!0),p=0,m=0,l=0,C=i.getFg(0),R=i.getBg(0);for(let T=0;T<i.getTrimmedLength();T++)if(i.loadCell(T,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==R){if(T-p>1){let B=this._getJoinedRanges(g,l,m,i,p);for(let D=0;D<B.length;D++)h.push(B[D])}p=T,l=m,C=this._workCell.fg,R=this._workCell.bg}m+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-p>1){let T=this._getJoinedRanges(g,l,m,i,p);for(let B=0;B<T.length;B++)h.push(T[B])}return h}_getJoinedRanges(e,i,h,g,p){let m=e.substring(i,h),l=[];try{l=this._characterJoiners[0].handler(m)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{let R=this._characterJoiners[C].handler(m);for(let T=0;T<R.length;T++)Et._mergeRanges(l,R[T])}catch(R){console.error(R)}return this._stringRangesToCellRanges(l,g,p),l}_stringRangesToCellRanges(e,i,h){let g=0,p=!1,m=0,l=e[g];if(l){for(let C=h;C<this._bufferService.cols;C++){let R=i.getWidth(C),T=i.getString(C).length||f.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!p&&l[0]<=m&&(l[0]=C,p=!0),l[1]<=m){if(l[1]=C,l=e[++g],!l)break;l[0]<=m?(l[0]=C,p=!0):p=!1}m+=T}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,i){let h=!1;for(let g=0;g<e.length;g++){let p=e[g];if(h){if(i[1]<=p[0])return e[g-1][1]=i[1],e;if(i[1]<=p[1])return e[g-1][1]=Math.max(i[1],p[1]),e.splice(g,1),e;e.splice(g,1),g--}else{if(i[1]<=p[0])return e.splice(g,0,i),e;if(i[1]<=p[1])return p[0]=Math.min(i[0],p[0]),e;i[0]<p[1]&&(p[0]=Math.min(i[0],p[0]),h=!0)}}return h?e[e.length-1][1]=i[1]:e.push(i),e}};r.CharacterJoinerService=t=a([_(0,S.IBufferService)],t)},5114:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;let a=n(844),_=n(8460),o=n(3656);class f extends a.Disposable{constructor(d,t,s){super(),this._textarea=d,this._window=t,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this.register((0,_.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(d){this._window!==d&&(this._window=d,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}}r.CoreBrowserService=f;class v extends a.Disposable{constructor(d){super(),this._parentWindow=d,this._windowResizeListener=this.register(new a.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,a.toDisposable)(()=>this.clearListener()))}setWindow(d){this._parentWindow=d,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,o.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;let a=n(844);class _ extends a.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,a.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{let v=this.linkProviders.indexOf(f);v!==-1&&this.linkProviders.splice(v,1)}}}}r.LinkProviderService=_},8934:function(k,r,n){var a=this&&this.__decorate||function(S,d,t,s){var e,i=arguments.length,h=i<3?d:s===null?s=Object.getOwnPropertyDescriptor(d,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(S,d,t,s);else for(var g=S.length-1;g>=0;g--)(e=S[g])&&(h=(i<3?e(h):i>3?e(d,t,h):e(d,t))||h);return i>3&&h&&Object.defineProperty(d,t,h),h},_=this&&this.__param||function(S,d){return function(t,s){d(t,s,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;let o=n(4725),f=n(9806),v=r.MouseService=class{constructor(S,d){this._renderService=S,this._charSizeService=d}getCoords(S,d,t,s,e){return(0,f.getCoords)(window,S,d,t,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(S,d){let t=(0,f.getCoordsRelativeToElement)(window,S,d);if(this._charSizeService.hasValidSize)return t[0]=Math.min(Math.max(t[0],0),this._renderService.dimensions.css.canvas.width-1),t[1]=Math.min(Math.max(t[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(t[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(t[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(t[0]),y:Math.floor(t[1])}}};r.MouseService=v=a([_(0,o.IRenderService),_(1,o.ICharSizeService)],v)},3230:function(k,r,n){var a=this&&this.__decorate||function(e,i,h,g){var p,m=arguments.length,l=m<3?i:g===null?g=Object.getOwnPropertyDescriptor(i,h):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,h,g);else for(var C=e.length-1;C>=0;C--)(p=e[C])&&(l=(m<3?p(l):m>3?p(i,h,l):p(i,h))||l);return m>3&&l&&Object.defineProperty(i,h,l),l},_=this&&this.__param||function(e,i){return function(h,g){i(h,g,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;let o=n(6193),f=n(4725),v=n(8460),S=n(844),d=n(7226),t=n(2585),s=r.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,i,h,g,p,m,l,C){super(),this._rowCount=e,this._charSizeService=g,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new d.DebouncedIdleTask,this._observerDisposable=this.register(new S.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 v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o.RenderDebouncer((R,T)=>this._renderRows(R,T),l),this.register(this._renderDebouncer),this.register(l.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(m.onResize(()=>this._fullRefresh())),this.register(m.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(h.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(p.onDecorationRegistered(()=>this._fullRefresh())),this.register(p.onDecorationRemoved(()=>this._fullRefresh())),this.register(h.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(m.cols,m.rows),this._fullRefresh()})),this.register(h.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(m.buffer.y,m.buffer.y,!0))),this.register(C.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(l.window,i),this.register(l.onWindowChange(R=>this._registerIntersectionObserver(R,i)))}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let h=new e.IntersectionObserver(g=>this._handleIntersectionChange(g[g.length-1]),{threshold:0});h.observe(i),this._observerDisposable.value=(0,S.toDisposable)(()=>h.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,i,h=!1){this._isPaused?this._needsFullRefresh=!0:(h||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount))}_renderRows(e,i){this._renderer.value&&(e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0)}resize(e,i){this._rowCount=i,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,h){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=h,this._renderer.value?.handleSelectionChanged(e,i,h)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=s=a([_(2,t.IOptionsService),_(3,f.ICharSizeService),_(4,t.IDecorationService),_(5,t.IBufferService),_(6,f.ICoreBrowserService),_(7,f.IThemeService)],s)},9312:function(k,r,n){var a=this&&this.__decorate||function(l,C,R,T){var B,D=arguments.length,F=D<3?C:T===null?T=Object.getOwnPropertyDescriptor(C,R):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(l,C,R,T);else for(var I=l.length-1;I>=0;I--)(B=l[I])&&(F=(D<3?B(F):D>3?B(C,R,F):B(C,R))||F);return D>3&&F&&Object.defineProperty(C,R,F),F},_=this&&this.__param||function(l,C){return function(R,T){C(R,T,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;let o=n(9806),f=n(9504),v=n(456),S=n(4725),d=n(8460),t=n(844),s=n(6114),e=n(4841),i=n(511),h=n(2585),g="\xA0",p=new RegExp(g,"g"),m=r.SelectionService=class extends t.Disposable{constructor(l,C,R,T,B,D,F,I,O){super(),this._element=l,this._screenElement=C,this._linkifier=R,this._bufferService=T,this._coreService=B,this._mouseService=D,this._optionsService=F,this._renderService=I,this._coreBrowserService=O,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new i.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new d.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new d.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new d.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new d.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=H=>this._handleMouseMove(H),this._mouseUpListener=H=>this._handleMouseUp(H),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(H=>this._handleTrim(H)),this.register(this._bufferService.buffers.onBufferActivate(H=>this._handleBufferActivate(H))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.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(){let l=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!(!l||!C||l[0]===C[0]&&l[1]===C[1])}get selectionText(){let l=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;if(!l||!C)return"";let R=this._bufferService.buffer,T=[];if(this._activeSelectionMode===3){if(l[0]===C[0])return"";let B=l[0]<C[0]?l[0]:C[0],D=l[0]<C[0]?C[0]:l[0];for(let F=l[1];F<=C[1];F++){let I=R.translateBufferLineToString(F,!0,B,D);T.push(I)}}else{let B=l[1]===C[1]?C[0]:void 0;T.push(R.translateBufferLineToString(l[1],!0,l[0],B));for(let D=l[1]+1;D<=C[1]-1;D++){let F=R.lines.get(D),I=R.translateBufferLineToString(D,!0);F?.isWrapped?T[T.length-1]+=I:T.push(I)}if(l[1]!==C[1]){let D=R.lines.get(C[1]),F=R.translateBufferLineToString(C[1],!0,0,C[0]);D&&D.isWrapped?T[T.length-1]+=F:T.push(F)}}return T.map(B=>B.replace(p," ")).join(s.isWindows?`\r
6
+ `:`
7
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(l){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),s.isLinux&&l&&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(l){let C=this._getMouseBufferCoords(l),R=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!!(R&&T&&C)&&this._areCoordsInSelection(C,R,T)}isCellInSelection(l,C){let R=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!R||!T)&&this._areCoordsInSelection([l,C],R,T)}_areCoordsInSelection(l,C,R){return l[1]>C[1]&&l[1]<R[1]||C[1]===R[1]&&l[1]===C[1]&&l[0]>=C[0]&&l[0]<R[0]||C[1]<R[1]&&l[1]===R[1]&&l[0]<R[0]||C[1]<R[1]&&l[1]===C[1]&&l[0]>=C[0]}_selectWordAtCursor(l,C){let R=this._linkifier.currentLink?.link?.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let T=this._getMouseBufferCoords(l);return!!T&&(this._selectWordAt(T,C),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,C){this._model.clearSelection(),l=Math.max(l,0),C=Math.min(C,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,C],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){let C=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(C)return C[0]--,C[1]--,C[1]+=this._bufferService.buffer.ydisp,C}_getMouseEventScrollAmount(l){let C=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1],R=this._renderService.dimensions.css.canvas.height;return C>=0&&C<=R?0:(C>R&&(C-=R),C=Math.min(Math.max(C,-50),50),C/=50,C/Math.abs(C)+Math.round(14*C))}shouldForceSelection(l){return s.isMac?l.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:l.shiftKey}handleMouseDown(l){if(this._mouseDownTimeStamp=l.timeStamp,(l.button!==2||!this.hasSelection)&&l.button===0){if(!this._enabled){if(!this.shouldForceSelection(l))return;l.stopPropagation()}l.preventDefault(),this._dragScrollAmount=0,this._enabled&&l.shiftKey?this._handleIncrementalClick(l):l.detail===1?this._handleSingleClick(l):l.detail===2?this._handleDoubleClick(l):l.detail===3&&this._handleTripleClick(l),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(l){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(l))}_handleSingleClick(l){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(l)?3:0,this._model.selectionStart=this._getMouseBufferCoords(l),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let C=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);C&&C.length!==this._model.selectionStart[0]&&C.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){let C=this._getMouseBufferCoords(l);C&&(this._activeSelectionMode=2,this._selectLineAt(C[1]))}shouldColumnSelect(l){return l.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;let C=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(l),!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(l),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){let T=R.lines.get(this._model.selectionEnd[1]);T&&T.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}C&&C[0]===this._model.selectionEnd[0]&&C[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});let l=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(l.ydisp+this._bufferService.rows,l.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=l.ydisp),this.refresh()}}_handleMouseUp(l){let C=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&C<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let R=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){let T=(0,f.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(T,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let l=this._model.finalSelectionStart,C=this._model.finalSelectionEnd,R=!(!l||!C||l[0]===C[0]&&l[1]===C[1]);R?l&&C&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&C[0]===this._oldSelectionEnd[0]&&C[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,C,R)):this._oldHasSelection&&this._fireOnSelectionChange(l,C,R)}_fireOnSelectionChange(l,C,R){this._oldSelectionStart=l,this._oldSelectionEnd=C,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim(C=>this._handleTrim(C))}_convertViewportColToCharacterIndex(l,C){let R=C;for(let T=0;C>=T;T++){let B=l.loadCell(T,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:B>1&&C!==T&&(R+=B-1)}return R}setSelection(l,C,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,C],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,C,R=!0,T=!0){if(l[0]>=this._bufferService.cols)return;let B=this._bufferService.buffer,D=B.lines.get(l[1]);if(!D)return;let F=B.translateBufferLineToString(l[1],!1),I=this._convertViewportColToCharacterIndex(D,l[0]),O=I,H=l[0]-I,P=0,b=0,E=0,L=0;if(F.charAt(I)===" "){for(;I>0&&F.charAt(I-1)===" ";)I--;for(;O<F.length&&F.charAt(O+1)===" ";)O++}else{let $=l[0],q=l[0];D.getWidth($)===0&&(P++,$--),D.getWidth(q)===2&&(b++,q++);let K=D.getString(q).length;for(K>1&&(L+=K-1,O+=K-1);$>0&&I>0&&!this._isCharWordSeparator(D.loadCell($-1,this._workCell));){D.loadCell($-1,this._workCell);let M=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,$--):M>1&&(E+=M-1,I-=M-1),I--,$--}for(;q<D.length&&O+1<F.length&&!this._isCharWordSeparator(D.loadCell(q+1,this._workCell));){D.loadCell(q+1,this._workCell);let M=this._workCell.getChars().length;this._workCell.getWidth()===2?(b++,q++):M>1&&(L+=M-1,O+=M-1),O++,q++}}O++;let A=I+H-P+E,W=Math.min(this._bufferService.cols,O-I+P+b-E-L);if(C||F.slice(I,O).trim()!==""){if(R&&A===0&&D.getCodePoint(0)!==32){let $=B.lines.get(l[1]-1);if($&&D.isWrapped&&$.getCodePoint(this._bufferService.cols-1)!==32){let q=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if(q){let K=this._bufferService.cols-q.start;A-=K,W+=K}}}if(T&&A+W===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){let $=B.lines.get(l[1]+1);if($?.isWrapped&&$.getCodePoint(0)!==32){let q=this._getWordAt([0,l[1]+1],!1,!1,!0);q&&(W+=q.length)}}return{start:A,length:W}}}_selectWordAt(l,C){let R=this._getWordAt(l,C);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[R.start,l[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(l){let C=this._getWordAt(l,!0);if(C){let R=l[1];for(;C.start<0;)C.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;C.start+C.length>this._bufferService.cols;)C.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?C.start:C.start+C.length,R]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){let C=this._bufferService.buffer.getWrappedRangeForLine(l),R={start:{x:0,y:C.first},end:{x:this._bufferService.cols-1,y:C.last}};this._model.selectionStart=[0,C.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(R,this._bufferService.cols)}};r.SelectionService=m=a([_(3,h.IBufferService),_(4,h.ICoreService),_(5,S.IMouseService),_(6,h.IOptionsService),_(7,S.IRenderService),_(8,S.ICoreBrowserService)],m)},4725:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;let a=n(8343);r.ICharSizeService=(0,a.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,a.createDecorator)("CoreBrowserService"),r.IMouseService=(0,a.createDecorator)("MouseService"),r.IRenderService=(0,a.createDecorator)("RenderService"),r.ISelectionService=(0,a.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,a.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,a.createDecorator)("ThemeService"),r.ILinkProviderService=(0,a.createDecorator)("LinkProviderService")},6731:function(k,r,n){var a=this&&this.__decorate||function(m,l,C,R){var T,B=arguments.length,D=B<3?l:R===null?R=Object.getOwnPropertyDescriptor(l,C):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,l,C,R);else for(var F=m.length-1;F>=0;F--)(T=m[F])&&(D=(B<3?T(D):B>3?T(l,C,D):T(l,C))||D);return B>3&&D&&Object.defineProperty(l,C,D),D},_=this&&this.__param||function(m,l){return function(C,R){l(C,R,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;let o=n(7239),f=n(8055),v=n(8460),S=n(844),d=n(2585),t=f.css.toColor("#ffffff"),s=f.css.toColor("#000000"),e=f.css.toColor("#ffffff"),i=f.css.toColor("#000000"),h={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let m=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],l=[0,95,135,175,215,255];for(let C=0;C<216;C++){let R=l[C/36%6|0],T=l[C/6%6|0],B=l[C%6];m.push({css:f.channels.toCss(R,T,B),rgba:f.channels.toRgba(R,T,B)})}for(let C=0;C<24;C++){let R=8+10*C;m.push({css:f.channels.toCss(R,R,R),rgba:f.channels.toRgba(R,R,R)})}return m})());let g=r.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:t,background:s,cursor:e,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:h,selectionBackgroundOpaque:f.color.blend(s,h),selectionInactiveBackgroundTransparent:h,selectionInactiveBackgroundOpaque:f.color.blend(s,h),ansi:r.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(m={}){let l=this._colors;if(l.foreground=p(m.foreground,t),l.background=p(m.background,s),l.cursor=p(m.cursor,e),l.cursorAccent=p(m.cursorAccent,i),l.selectionBackgroundTransparent=p(m.selectionBackground,h),l.selectionBackgroundOpaque=f.color.blend(l.background,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundTransparent=p(m.selectionInactiveBackground,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundOpaque=f.color.blend(l.background,l.selectionInactiveBackgroundTransparent),l.selectionForeground=m.selectionForeground?p(m.selectionForeground,f.NULL_COLOR):void 0,l.selectionForeground===f.NULL_COLOR&&(l.selectionForeground=void 0),f.color.isOpaque(l.selectionBackgroundTransparent)&&(l.selectionBackgroundTransparent=f.color.opacity(l.selectionBackgroundTransparent,.3)),f.color.isOpaque(l.selectionInactiveBackgroundTransparent)&&(l.selectionInactiveBackgroundTransparent=f.color.opacity(l.selectionInactiveBackgroundTransparent,.3)),l.ansi=r.DEFAULT_ANSI_COLORS.slice(),l.ansi[0]=p(m.black,r.DEFAULT_ANSI_COLORS[0]),l.ansi[1]=p(m.red,r.DEFAULT_ANSI_COLORS[1]),l.ansi[2]=p(m.green,r.DEFAULT_ANSI_COLORS[2]),l.ansi[3]=p(m.yellow,r.DEFAULT_ANSI_COLORS[3]),l.ansi[4]=p(m.blue,r.DEFAULT_ANSI_COLORS[4]),l.ansi[5]=p(m.magenta,r.DEFAULT_ANSI_COLORS[5]),l.ansi[6]=p(m.cyan,r.DEFAULT_ANSI_COLORS[6]),l.ansi[7]=p(m.white,r.DEFAULT_ANSI_COLORS[7]),l.ansi[8]=p(m.brightBlack,r.DEFAULT_ANSI_COLORS[8]),l.ansi[9]=p(m.brightRed,r.DEFAULT_ANSI_COLORS[9]),l.ansi[10]=p(m.brightGreen,r.DEFAULT_ANSI_COLORS[10]),l.ansi[11]=p(m.brightYellow,r.DEFAULT_ANSI_COLORS[11]),l.ansi[12]=p(m.brightBlue,r.DEFAULT_ANSI_COLORS[12]),l.ansi[13]=p(m.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),l.ansi[14]=p(m.brightCyan,r.DEFAULT_ANSI_COLORS[14]),l.ansi[15]=p(m.brightWhite,r.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){let C=Math.min(l.ansi.length-16,m.extendedAnsi.length);for(let R=0;R<C;R++)l.ansi[R+16]=p(m.extendedAnsi[R],r.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){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[m]=this._restoreColors.ansi[m]}else for(let l=0;l<this._restoreColors.ansi.length;++l)this._colors.ansi[l]=this._restoreColors.ansi[l]}modifyColors(m){m(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 p(m,l){if(m!==void 0)try{return f.css.toColor(m)}catch{}return l}r.ThemeService=g=a([_(0,d.IOptionsService)],g)},6349:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;let a=n(8460),_=n(844);class o extends _.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new a.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new a.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new a.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(v){if(this._maxLength===v)return;let S=new Array(v);for(let d=0;d<Math.min(v,this.length);d++)S[d]=this._array[this._getCyclicIndex(d)];this._array=S,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let S=this._length;S<v;S++)this._array[S]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,S){this._array[this._getCyclicIndex(v)]=S}push(v){this._array[this._getCyclicIndex(this._length)]=v,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(v,S,...d){if(S){for(let t=v;t<this._length-S;t++)this._array[this._getCyclicIndex(t)]=this._array[this._getCyclicIndex(t+S)];this._length-=S,this.onDeleteEmitter.fire({index:v,amount:S})}for(let t=this._length-1;t>=v;t--)this._array[this._getCyclicIndex(t+d.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<d.length;t++)this._array[this._getCyclicIndex(v+t)]=d[t];if(d.length&&this.onInsertEmitter.fire({index:v,amount:d.length}),this._length+d.length>this._maxLength){let t=this._length+d.length-this._maxLength;this._startIndex+=t,this._length=this._maxLength,this.onTrimEmitter.fire(t)}else this._length+=d.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,S,d){if(!(S<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+d<0)throw new Error("Cannot shift elements in list beyond index 0");if(d>0){for(let s=S-1;s>=0;s--)this.set(v+s+d,this.get(v+s));let t=v+S+d-this._length;if(t>0)for(this._length+=t;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let t=0;t<S;t++)this.set(v+t+d,this.get(v+t))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}r.CircularList=o},1439:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function n(a,_=5){if(typeof a!="object")return a;let o=Array.isArray(a)?[]:{};for(let f in a)o[f]=_<=1?a[f]:a[f]&&n(a[f],_-1);return o}},8055:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let n=0,a=0,_=0,o=0;var f,v,S,d,t;function s(i){let h=i.toString(16);return h.length<2?"0"+h:h}function e(i,h){return i<h?(h+.05)/(i+.05):(i+.05)/(h+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(i){i.toCss=function(h,g,p,m){return m!==void 0?`#${s(h)}${s(g)}${s(p)}${s(m)}`:`#${s(h)}${s(g)}${s(p)}`},i.toRgba=function(h,g,p,m=255){return(h<<24|g<<16|p<<8|m)>>>0},i.toColor=function(h,g,p,m){return{css:i.toCss(h,g,p,m),rgba:i.toRgba(h,g,p,m)}}}(f||(r.channels=f={})),function(i){function h(g,p){return o=Math.round(255*p),[n,a,_]=t.toChannels(g.rgba),{css:f.toCss(n,a,_,o),rgba:f.toRgba(n,a,_,o)}}i.blend=function(g,p){if(o=(255&p.rgba)/255,o===1)return{css:p.css,rgba:p.rgba};let m=p.rgba>>24&255,l=p.rgba>>16&255,C=p.rgba>>8&255,R=g.rgba>>24&255,T=g.rgba>>16&255,B=g.rgba>>8&255;return n=R+Math.round((m-R)*o),a=T+Math.round((l-T)*o),_=B+Math.round((C-B)*o),{css:f.toCss(n,a,_),rgba:f.toRgba(n,a,_)}},i.isOpaque=function(g){return(255&g.rgba)==255},i.ensureContrastRatio=function(g,p,m){let l=t.ensureContrastRatio(g.rgba,p.rgba,m);if(l)return f.toColor(l>>24&255,l>>16&255,l>>8&255)},i.opaque=function(g){let p=(255|g.rgba)>>>0;return[n,a,_]=t.toChannels(p),{css:f.toCss(n,a,_),rgba:p}},i.opacity=h,i.multiplyOpacity=function(g,p){return o=255&g.rgba,h(g,o*p/255)},i.toColorRGB=function(g){return[g.rgba>>24&255,g.rgba>>16&255,g.rgba>>8&255]}}(v||(r.color=v={})),function(i){let h,g;try{let p=document.createElement("canvas");p.width=1,p.height=1;let m=p.getContext("2d",{willReadFrequently:!0});m&&(h=m,h.globalCompositeOperation="copy",g=h.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return n=parseInt(p.slice(1,2).repeat(2),16),a=parseInt(p.slice(2,3).repeat(2),16),_=parseInt(p.slice(3,4).repeat(2),16),f.toColor(n,a,_);case 5:return n=parseInt(p.slice(1,2).repeat(2),16),a=parseInt(p.slice(2,3).repeat(2),16),_=parseInt(p.slice(3,4).repeat(2),16),o=parseInt(p.slice(4,5).repeat(2),16),f.toColor(n,a,_,o);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}let m=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return n=parseInt(m[1]),a=parseInt(m[2]),_=parseInt(m[3]),o=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),f.toColor(n,a,_,o);if(!h||!g)throw new Error("css.toColor: Unsupported css format");if(h.fillStyle=g,h.fillStyle=p,typeof h.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(h.fillRect(0,0,1,1),[n,a,_,o]=h.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(n,a,_,o),css:p}}}(S||(r.css=S={})),function(i){function h(g,p,m){let l=g/255,C=p/255,R=m/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}i.relativeLuminance=function(g){return h(g>>16&255,g>>8&255,255&g)},i.relativeLuminance2=h}(d||(r.rgb=d={})),function(i){function h(p,m,l){let C=p>>24&255,R=p>>16&255,T=p>>8&255,B=m>>24&255,D=m>>16&255,F=m>>8&255,I=e(d.relativeLuminance2(B,D,F),d.relativeLuminance2(C,R,T));for(;I<l&&(B>0||D>0||F>0);)B-=Math.max(0,Math.ceil(.1*B)),D-=Math.max(0,Math.ceil(.1*D)),F-=Math.max(0,Math.ceil(.1*F)),I=e(d.relativeLuminance2(B,D,F),d.relativeLuminance2(C,R,T));return(B<<24|D<<16|F<<8|255)>>>0}function g(p,m,l){let C=p>>24&255,R=p>>16&255,T=p>>8&255,B=m>>24&255,D=m>>16&255,F=m>>8&255,I=e(d.relativeLuminance2(B,D,F),d.relativeLuminance2(C,R,T));for(;I<l&&(B<255||D<255||F<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),D=Math.min(255,D+Math.ceil(.1*(255-D))),F=Math.min(255,F+Math.ceil(.1*(255-F))),I=e(d.relativeLuminance2(B,D,F),d.relativeLuminance2(C,R,T));return(B<<24|D<<16|F<<8|255)>>>0}i.blend=function(p,m){if(o=(255&m)/255,o===1)return m;let l=m>>24&255,C=m>>16&255,R=m>>8&255,T=p>>24&255,B=p>>16&255,D=p>>8&255;return n=T+Math.round((l-T)*o),a=B+Math.round((C-B)*o),_=D+Math.round((R-D)*o),f.toRgba(n,a,_)},i.ensureContrastRatio=function(p,m,l){let C=d.relativeLuminance(p>>8),R=d.relativeLuminance(m>>8);if(e(C,R)<l){if(R<C){let D=h(p,m,l),F=e(C,d.relativeLuminance(D>>8));if(F<l){let I=g(p,m,l);return F>e(C,d.relativeLuminance(I>>8))?D:I}return D}let T=g(p,m,l),B=e(C,d.relativeLuminance(T>>8));if(B<l){let D=h(p,m,l);return B>e(C,d.relativeLuminance(D>>8))?T:D}return T}},i.reduceLuminance=h,i.increaseLuminance=g,i.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]}}(t||(r.rgba=t={})),r.toPaddedHex=s,r.contrastRatio=e},8969:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;let a=n(844),_=n(2585),o=n(4348),f=n(7866),v=n(744),S=n(7302),d=n(6975),t=n(8460),s=n(1753),e=n(1480),i=n(7994),h=n(9282),g=n(5435),p=n(5981),m=n(2660),l=!1;class C extends a.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new t.EventEmitter),this._onScroll.event(T=>{this._onScrollApi?.fire(T.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(T){for(let B in T)this.optionsService.options[B]=T[B]}constructor(T){super(),this._windowsWrappingHeuristics=this.register(new a.MutableDisposable),this._onBinary=this.register(new t.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new t.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new t.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new t.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new t.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new t.EventEmitter),this._instantiationService=new o.InstantiationService,this.optionsService=this.register(new S.OptionsService(T)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(d.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,t.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,t.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,t.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,t.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(B=>{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(B=>{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 p.WriteBuffer((B,D)=>this._inputHandler.parse(B,D))),this.register((0,t.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(T,B){this._writeBuffer.write(T,B)}writeSync(T,B){this._logService.logLevel<=_.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(T,B)}input(T,B=!0){this.coreService.triggerDataEvent(T,B)}resize(T,B){isNaN(T)||isNaN(B)||(T=Math.max(T,v.MINIMUM_COLS),B=Math.max(B,v.MINIMUM_ROWS),this._bufferService.resize(T,B))}scroll(T,B=!1){this._bufferService.scroll(T,B)}scrollLines(T,B,D){this._bufferService.scrollLines(T,B,D)}scrollPages(T){this.scrollLines(T*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(T){let B=T-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(T,B){return this._inputHandler.registerEscHandler(T,B)}registerDcsHandler(T,B){return this._inputHandler.registerDcsHandler(T,B)}registerCsiHandler(T,B){return this._inputHandler.registerCsiHandler(T,B)}registerOscHandler(T,B){return this._inputHandler.registerOscHandler(T,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let T=!1,B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?T=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(T=!0),T?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let T=[];T.push(this.onLineFeed(h.updateWindowsModeWrappedState.bind(null,this._bufferService))),T.push(this.registerCsiHandler({final:"H"},()=>((0,h.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,a.toDisposable)(()=>{for(let B of T)B.dispose()})}}}r.CoreTerminal=C},8460:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=n=>(this._listeners.push(n),{dispose:()=>{if(!this._disposed){for(let a=0;a<this._listeners.length;a++)if(this._listeners[a]===n)return void this._listeners.splice(a,1)}}})),this._event}fire(n,a){let _=[];for(let o=0;o<this._listeners.length;o++)_.push(this._listeners[o]);for(let o=0;o<_.length;o++)_[o].call(void 0,n,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(n,a){return n(_=>a.fire(_))},r.runAndSubscribe=function(n,a){return a(void 0),n(_=>a(_))}},5435:function(k,r,n){var a=this&&this.__decorate||function(P,b,E,L){var A,W=arguments.length,$=W<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(P,b,E,L);else for(var q=P.length-1;q>=0;q--)(A=P[q])&&($=(W<3?A($):W>3?A(b,E,$):A(b,E))||$);return W>3&&$&&Object.defineProperty(b,E,$),$},_=this&&this.__param||function(P,b){return function(E,L){b(E,L,P)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;let o=n(2584),f=n(7116),v=n(2015),S=n(844),d=n(482),t=n(8437),s=n(8460),e=n(643),i=n(511),h=n(3734),g=n(2585),p=n(1480),m=n(6242),l=n(6351),C=n(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},T=131072;function B(P,b){if(P>24)return b.setWinLines||!1;switch(P){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(P){P[P.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",P[P.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(r.WindowsOptionsReportType=D={}));let F=0;class I extends S.Disposable{getAttrData(){return this._curAttrData}constructor(b,E,L,A,W,$,q,K,M=new v.EscapeSequenceParser){super(),this._bufferService=b,this._charsetService=E,this._coreService=L,this._logService=A,this._optionsService=W,this._oscLinkService=$,this._coreMouseService=q,this._unicodeService=K,this._parser=M,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new d.StringToUtf32,this._utf8Decoder=new d.Utf8ToUtf32,this._workCell=new i.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.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 O(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(y=>this._activeBuffer=y.activeBuffer)),this._parser.setCsiHandlerFallback((y,N)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(y),params:N.toArray()})}),this._parser.setEscHandlerFallback(y=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(y)})}),this._parser.setExecuteHandlerFallback(y=>{this._logService.debug("Unknown EXECUTE code: ",{code:y})}),this._parser.setOscHandlerFallback((y,N,U)=>{this._logService.debug("Unknown OSC code: ",{identifier:y,action:N,data:U})}),this._parser.setDcsHandlerFallback((y,N,U)=>{N==="HOOK"&&(U=U.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(y),action:N,payload:U})}),this._parser.setPrintHandler((y,N,U)=>this.print(y,N,U)),this._parser.registerCsiHandler({final:"@"},y=>this.insertChars(y)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},y=>this.scrollLeft(y)),this._parser.registerCsiHandler({final:"A"},y=>this.cursorUp(y)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},y=>this.scrollRight(y)),this._parser.registerCsiHandler({final:"B"},y=>this.cursorDown(y)),this._parser.registerCsiHandler({final:"C"},y=>this.cursorForward(y)),this._parser.registerCsiHandler({final:"D"},y=>this.cursorBackward(y)),this._parser.registerCsiHandler({final:"E"},y=>this.cursorNextLine(y)),this._parser.registerCsiHandler({final:"F"},y=>this.cursorPrecedingLine(y)),this._parser.registerCsiHandler({final:"G"},y=>this.cursorCharAbsolute(y)),this._parser.registerCsiHandler({final:"H"},y=>this.cursorPosition(y)),this._parser.registerCsiHandler({final:"I"},y=>this.cursorForwardTab(y)),this._parser.registerCsiHandler({final:"J"},y=>this.eraseInDisplay(y,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},y=>this.eraseInDisplay(y,!0)),this._parser.registerCsiHandler({final:"K"},y=>this.eraseInLine(y,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},y=>this.eraseInLine(y,!0)),this._parser.registerCsiHandler({final:"L"},y=>this.insertLines(y)),this._parser.registerCsiHandler({final:"M"},y=>this.deleteLines(y)),this._parser.registerCsiHandler({final:"P"},y=>this.deleteChars(y)),this._parser.registerCsiHandler({final:"S"},y=>this.scrollUp(y)),this._parser.registerCsiHandler({final:"T"},y=>this.scrollDown(y)),this._parser.registerCsiHandler({final:"X"},y=>this.eraseChars(y)),this._parser.registerCsiHandler({final:"Z"},y=>this.cursorBackwardTab(y)),this._parser.registerCsiHandler({final:"`"},y=>this.charPosAbsolute(y)),this._parser.registerCsiHandler({final:"a"},y=>this.hPositionRelative(y)),this._parser.registerCsiHandler({final:"b"},y=>this.repeatPrecedingCharacter(y)),this._parser.registerCsiHandler({final:"c"},y=>this.sendDeviceAttributesPrimary(y)),this._parser.registerCsiHandler({prefix:">",final:"c"},y=>this.sendDeviceAttributesSecondary(y)),this._parser.registerCsiHandler({final:"d"},y=>this.linePosAbsolute(y)),this._parser.registerCsiHandler({final:"e"},y=>this.vPositionRelative(y)),this._parser.registerCsiHandler({final:"f"},y=>this.hVPosition(y)),this._parser.registerCsiHandler({final:"g"},y=>this.tabClear(y)),this._parser.registerCsiHandler({final:"h"},y=>this.setMode(y)),this._parser.registerCsiHandler({prefix:"?",final:"h"},y=>this.setModePrivate(y)),this._parser.registerCsiHandler({final:"l"},y=>this.resetMode(y)),this._parser.registerCsiHandler({prefix:"?",final:"l"},y=>this.resetModePrivate(y)),this._parser.registerCsiHandler({final:"m"},y=>this.charAttributes(y)),this._parser.registerCsiHandler({final:"n"},y=>this.deviceStatus(y)),this._parser.registerCsiHandler({prefix:"?",final:"n"},y=>this.deviceStatusPrivate(y)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},y=>this.softReset(y)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},y=>this.setCursorStyle(y)),this._parser.registerCsiHandler({final:"r"},y=>this.setScrollRegion(y)),this._parser.registerCsiHandler({final:"s"},y=>this.saveCursor(y)),this._parser.registerCsiHandler({final:"t"},y=>this.windowOptions(y)),this._parser.registerCsiHandler({final:"u"},y=>this.restoreCursor(y)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},y=>this.insertColumns(y)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},y=>this.deleteColumns(y)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},y=>this.selectProtected(y)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},y=>this.requestMode(y,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},y=>this.requestMode(y,!1)),this._parser.setExecuteHandler(o.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(o.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(o.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(o.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(o.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(o.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(o.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(o.C1.IND,()=>this.index()),this._parser.setExecuteHandler(o.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(o.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new m.OscHandler(y=>(this.setTitle(y),this.setIconName(y),!0))),this._parser.registerOscHandler(1,new m.OscHandler(y=>this.setIconName(y))),this._parser.registerOscHandler(2,new m.OscHandler(y=>this.setTitle(y))),this._parser.registerOscHandler(4,new m.OscHandler(y=>this.setOrReportIndexedColor(y))),this._parser.registerOscHandler(8,new m.OscHandler(y=>this.setHyperlink(y))),this._parser.registerOscHandler(10,new m.OscHandler(y=>this.setOrReportFgColor(y))),this._parser.registerOscHandler(11,new m.OscHandler(y=>this.setOrReportBgColor(y))),this._parser.registerOscHandler(12,new m.OscHandler(y=>this.setOrReportCursorColor(y))),this._parser.registerOscHandler(104,new m.OscHandler(y=>this.restoreIndexedColor(y))),this._parser.registerOscHandler(110,new m.OscHandler(y=>this.restoreFgColor(y))),this._parser.registerOscHandler(111,new m.OscHandler(y=>this.restoreBgColor(y))),this._parser.registerOscHandler(112,new m.OscHandler(y=>this.restoreCursorColor(y))),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(let y in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:y},()=>this.selectCharset("("+y)),this._parser.registerEscHandler({intermediates:")",final:y},()=>this.selectCharset(")"+y)),this._parser.registerEscHandler({intermediates:"*",final:y},()=>this.selectCharset("*"+y)),this._parser.registerEscHandler({intermediates:"+",final:y},()=>this.selectCharset("+"+y)),this._parser.registerEscHandler({intermediates:"-",final:y},()=>this.selectCharset("-"+y)),this._parser.registerEscHandler({intermediates:".",final:y},()=>this.selectCharset("."+y)),this._parser.registerEscHandler({intermediates:"/",final:y},()=>this.selectCharset("/"+y));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(y=>(this._logService.error("Parsing error: ",y),y)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new l.DcsHandler((y,N)=>this.requestStatusString(y,N)))}_preserveStack(b,E,L,A){this._parseStack.paused=!0,this._parseStack.cursorStartX=b,this._parseStack.cursorStartY=E,this._parseStack.decodedLength=L,this._parseStack.position=A}_logSlowResolvingAsync(b){this._logService.logLevel<=g.LogLevelEnum.WARN&&Promise.race([b,new Promise((E,L)=>setTimeout(()=>L("#SLOW_TIMEOUT"),5e3))]).catch(E=>{if(E!=="#SLOW_TIMEOUT")throw E;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(b,E){let L,A=this._activeBuffer.x,W=this._activeBuffer.y,$=0,q=this._parseStack.paused;if(q){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,E))return this._logSlowResolvingAsync(L),L;A=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,b.length>T&&($=this._parseStack.position+T)}if(this._logService.logLevel<=g.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof b=="string"?` "${b}"`:` "${Array.prototype.map.call(b,y=>String.fromCharCode(y)).join("")}"`),typeof b=="string"?b.split("").map(y=>y.charCodeAt(0)):b),this._parseBuffer.length<b.length&&this._parseBuffer.length<T&&(this._parseBuffer=new Uint32Array(Math.min(b.length,T))),q||this._dirtyRowTracker.clearRange(),b.length>T)for(let y=$;y<b.length;y+=T){let N=y+T<b.length?y+T:b.length,U=typeof b=="string"?this._stringDecoder.decode(b.substring(y,N),this._parseBuffer):this._utf8Decoder.decode(b.subarray(y,N),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,U))return this._preserveStack(A,W,U,y),this._logSlowResolvingAsync(L),L}else if(!q){let y=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,y))return this._preserveStack(A,W,y,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===A&&this._activeBuffer.y===W||this._onCursorMove.fire();let K=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),M=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);M<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(M,this._bufferService.rows-1),Math.min(K,this._bufferService.rows-1))}print(b,E,L){let A,W,$=this._charsetService.charset,q=this._optionsService.rawOptions.screenReaderMode,K=this._bufferService.cols,M=this._coreService.decPrivateModes.wraparound,y=this._coreService.modes.insertMode,N=this._curAttrData,U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-E>0&&U.getWidth(this._activeBuffer.x-1)===2&&U.setCellFromCodepoint(this._activeBuffer.x-1,0,1,N);let z=this._parser.precedingJoinState;for(let j=E;j<L;++j){if(A=b[j],A<127&&$){let ee=$[String.fromCharCode(A)];ee&&(A=ee.charCodeAt(0))}let G=this._unicodeService.charProperties(A,z);W=p.UnicodeService.extractWidth(G);let J=p.UnicodeService.extractShouldJoin(G),Y=J?p.UnicodeService.extractWidth(z):0;if(z=G,q&&this._onA11yChar.fire((0,d.stringFromCodePoint)(A)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-Y>K){if(M){let ee=U,V=this._activeBuffer.x-Y;for(this._activeBuffer.x=Y,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),U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Y>0&&U instanceof t.BufferLine&&U.copyCellsFrom(ee,V,0,Y,!1);V<K;)ee.setCellFromCodepoint(V++,0,1,N)}else if(this._activeBuffer.x=K-1,W===2)continue}if(J&&this._activeBuffer.x){let ee=U.getWidth(this._activeBuffer.x-1)?1:2;U.addCodepointToCell(this._activeBuffer.x-ee,A,W);for(let V=W-Y;--V>=0;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,N)}else if(y&&(U.insertCells(this._activeBuffer.x,W-Y,this._activeBuffer.getNullCell(N)),U.getWidth(K-1)===2&&U.setCellFromCodepoint(K-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,N)),U.setCellFromCodepoint(this._activeBuffer.x++,A,W,N),W>0)for(;--W;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,N)}this._parser.precedingJoinState=z,this._activeBuffer.x<K&&L-E>0&&U.getWidth(this._activeBuffer.x)===0&&!U.hasContent(this._activeBuffer.x)&&U.setCellFromCodepoint(this._activeBuffer.x,0,1,N),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(b,E){return b.final!=="t"||b.prefix||b.intermediates?this._parser.registerCsiHandler(b,E):this._parser.registerCsiHandler(b,L=>!B(L.params[0],this._optionsService.rawOptions.windowOptions)||E(L))}registerDcsHandler(b,E){return this._parser.registerDcsHandler(b,new l.DcsHandler(E))}registerEscHandler(b,E){return this._parser.registerEscHandler(b,E)}registerOscHandler(b,E){return this._parser.registerOscHandler(b,new m.OscHandler(E))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);b.hasWidth(this._activeBuffer.x)&&!b.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let 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,E){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=b,this._activeBuffer.y=this._activeBuffer.scrollTop+E):(this._activeBuffer.x=b,this._activeBuffer.y=E),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(b,E){this._restrictCursor(),this._setCursor(this._activeBuffer.x+b,this._activeBuffer.y+E)}cursorUp(b){let E=this._activeBuffer.y-this._activeBuffer.scrollTop;return E>=0?this._moveCursor(0,-Math.min(E,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1)),!0}cursorDown(b){let E=this._activeBuffer.scrollBottom-this._activeBuffer.y;return E>=0?this._moveCursor(0,Math.min(E,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){let E=b.params[0];return E===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:E===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=b.params[0]||1;for(;E--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=b.params[0]||1;for(;E--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(b){let E=b.params[0];return E===1&&(this._curAttrData.bg|=536870912),E!==2&&E!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(b,E,L,A=!1,W=!1){let $=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);$.replaceCells(E,L,this._activeBuffer.getNullCell(this._eraseAttrData()),W),A&&($.isWrapped=!1)}_resetBufferLine(b,E=!1){let L=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),E),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+b),L.isWrapped=!1)}eraseInDisplay(b,E=!1){let L;switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,E);L<this._bufferService.rows;L++)this._resetBufferLine(L,E);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,E),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,E);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,E);this._dirtyRowTracker.markDirty(0);break;case 3:let A=this._activeBuffer.lines.length-this._bufferService.rows;A>0&&(this._activeBuffer.lines.trimStart(A),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-A,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-A,0),this._onScroll.fire(0))}return!0}eraseInLine(b,E=!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,E);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,E);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,E)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(b){this._restrictCursor();let E=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let L=this._activeBuffer.ybase+this._activeBuffer.y,A=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-A+1;for(;E--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(L,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 E=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let L=this._activeBuffer.ybase+this._activeBuffer.y,A;for(A=this._bufferService.rows-1-this._activeBuffer.scrollBottom,A=this._bufferService.rows-1+this._activeBuffer.ybase-A;E--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(A,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();let E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.insertCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(b){this._restrictCursor();let E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.deleteCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(b){let E=b.params[0]||1;for(;E--;)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 E=b.params[0]||1;for(;E--;)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(t.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;let E=b.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);A.deleteCells(0,E,this._activeBuffer.getNullCell(this._eraseAttrData())),A.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;let E=b.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);A.insertCells(0,E,this._activeBuffer.getNullCell(this._eraseAttrData())),A.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;let E=b.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);A.insertCells(this._activeBuffer.x,E,this._activeBuffer.getNullCell(this._eraseAttrData())),A.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;let E=b.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);A.deleteCells(this._activeBuffer.x,E,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(b){this._restrictCursor();let E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.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){let E=this._parser.precedingJoinState;if(!E)return!0;let L=b.params[0]||1,A=p.UnicodeService.extractWidth(E),W=this._activeBuffer.x-A,$=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),q=new Uint32Array($.length*L),K=0;for(let y=0;y<$.length;){let N=$.codePointAt(y)||0;q[K++]=N,y+=N>65535?2:1}let M=K;for(let y=1;y<L;++y)q.copyWithin(M,0,K),M+=K;return this.print(q,0,M),!0}sendDeviceAttributesPrimary(b){return b.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(b){return b.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(b){return(this._optionsService.rawOptions.termName+"").indexOf(b)===0}setMode(b){for(let E=0;E<b.length;E++)switch(b.params[E]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(b){for(let E=0;E<b.length;E++)switch(b.params[E]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.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 E=0;E<b.length;E++)switch(b.params[E]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(b){for(let E=0;E<b.length;E++)switch(b.params[E]){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[E]===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,E){let L=this._coreService.decPrivateModes,{activeProtocol:A,activeEncoding:W}=this._coreMouseService,$=this._coreService,{buffers:q,cols:K}=this._bufferService,{active:M,alt:y}=q,N=this._optionsService.rawOptions,U=J=>J?1:2,z=b.params[0];return j=z,G=E?z===2?4:z===4?U($.modes.insertMode):z===12?3:z===20?U(N.convertEol):0:z===1?U(L.applicationCursorKeys):z===3?N.windowOptions.setWinLines?K===80?2:K===132?1:0:0:z===6?U(L.origin):z===7?U(L.wraparound):z===8?3:z===9?U(A==="X10"):z===12?U(N.cursorBlink):z===25?U(!$.isCursorHidden):z===45?U(L.reverseWraparound):z===66?U(L.applicationKeypad):z===67?4:z===1e3?U(A==="VT200"):z===1002?U(A==="DRAG"):z===1003?U(A==="ANY"):z===1004?U(L.sendFocus):z===1005?4:z===1006?U(W==="SGR"):z===1015?4:z===1016?U(W==="SGR_PIXELS"):z===1048?1:z===47||z===1047||z===1049?U(M===y):z===2004?U(L.bracketedPasteMode):0,$.triggerDataEvent(`${o.C0.ESC}[${E?"":"?"}${j};${G}$y`),!0;var j,G}_updateAttrColor(b,E,L,A,W){return E===2?(b|=50331648,b&=-16777216,b|=h.AttributeData.fromColorRGB([L,A,W])):E===5&&(b&=-50331904,b|=33554432|255&L),b}_extractColor(b,E,L){let A=[0,0,-1,0,0,0],W=0,$=0;do{if(A[$+W]=b.params[E+$],b.hasSubParams(E+$)){let q=b.getSubParams(E+$),K=0;do A[1]===5&&(W=1),A[$+K+1+W]=q[K];while(++K<q.length&&K+$+1+W<A.length);break}if(A[1]===5&&$+W>=2||A[1]===2&&$+W>=5)break;A[1]&&(W=1)}while(++$+E<b.length&&$+W<A.length);for(let q=2;q<A.length;++q)A[q]===-1&&(A[q]=0);switch(A[0]){case 38:L.fg=this._updateAttrColor(L.fg,A[1],A[3],A[4],A[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,A[1],A[3],A[4],A[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,A[1],A[3],A[4],A[5])}return $}_processUnderline(b,E){E.extended=E.extended.clone(),(!~b||b>5)&&(b=1),E.extended.underlineStyle=b,E.fg|=268435456,b===0&&(E.fg&=-268435457),E.updateExtended()}_processSGR0(b){b.fg=t.DEFAULT_ATTR_DATA.fg,b.bg=t.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;let E=b.length,L,A=this._curAttrData;for(let W=0;W<E;W++)L=b.params[W],L>=30&&L<=37?(A.fg&=-50331904,A.fg|=16777216|L-30):L>=40&&L<=47?(A.bg&=-50331904,A.bg|=16777216|L-40):L>=90&&L<=97?(A.fg&=-50331904,A.fg|=16777224|L-90):L>=100&&L<=107?(A.bg&=-50331904,A.bg|=16777224|L-100):L===0?this._processSGR0(A):L===1?A.fg|=134217728:L===3?A.bg|=67108864:L===4?(A.fg|=268435456,this._processUnderline(b.hasSubParams(W)?b.getSubParams(W)[0]:1,A)):L===5?A.fg|=536870912:L===7?A.fg|=67108864:L===8?A.fg|=1073741824:L===9?A.fg|=2147483648:L===2?A.bg|=134217728:L===21?this._processUnderline(2,A):L===22?(A.fg&=-134217729,A.bg&=-134217729):L===23?A.bg&=-67108865:L===24?(A.fg&=-268435457,this._processUnderline(0,A)):L===25?A.fg&=-536870913:L===27?A.fg&=-67108865:L===28?A.fg&=-1073741825:L===29?A.fg&=2147483647:L===39?(A.fg&=-67108864,A.fg|=16777215&t.DEFAULT_ATTR_DATA.fg):L===49?(A.bg&=-67108864,A.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?W+=this._extractColor(b,W,A):L===53?A.bg|=1073741824:L===55?A.bg&=-1073741825:L===59?(A.extended=A.extended.clone(),A.extended.underlineColor=-1,A.updateExtended()):L===100?(A.fg&=-67108864,A.fg|=16777215&t.DEFAULT_ATTR_DATA.fg,A.bg&=-67108864,A.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:let E=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${E};${L}R`)}return!0}deviceStatusPrivate(b){if(b.params[0]===6){let E=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${E};${L}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=t.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){let E=b.params[0]||1;switch(E){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"}let L=E%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(b){let E=b.params[0]||1,L;return(b.length<2||(L=b.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>E&&(this._activeBuffer.scrollTop=E-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(b){if(!B(b.params[0],this._optionsService.rawOptions.windowOptions))return!0;let E=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:E!==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(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:E!==0&&E!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),E!==0&&E!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:E!==0&&E!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),E!==0&&E!==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){let E=[],L=b.split(";");for(;L.length>1;){let A=L.shift(),W=L.shift();if(/^\d+$/.exec(A)){let $=parseInt(A);if(H($))if(W==="?")E.push({type:0,index:$});else{let q=(0,C.parseColor)(W);q&&E.push({type:1,index:$,color:q})}}}return E.length&&this._onColor.fire(E),!0}setHyperlink(b){let E=b.split(";");return!(E.length<2)&&(E[1]?this._createHyperlink(E[0],E[1]):!E[0]&&this._finishHyperlink())}_createHyperlink(b,E){this._getCurrentLinkId()&&this._finishHyperlink();let L=b.split(":"),A,W=L.findIndex($=>$.startsWith("id="));return W!==-1&&(A=L[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:A,uri:E}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(b,E){let L=b.split(";");for(let A=0;A<L.length&&!(E>=this._specialColors.length);++A,++E)if(L[A]==="?")this._onColor.fire([{type:0,index:this._specialColors[E]}]);else{let W=(0,C.parseColor)(L[A]);W&&this._onColor.fire([{type:1,index:this._specialColors[E],color:W}])}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;let E=[],L=b.split(";");for(let A=0;A<L.length;++A)if(/^\d+$/.exec(L[A])){let W=parseInt(L[A]);H(W)&&E.push({type:2,index:W})}return E.length&&this._onColor.fire(E),!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,f.DEFAULT_CHARSET),!0}selectCharset(b){return b.length!==2?(this.selectDefaultCharset(),!0):(b[0]==="/"||this._charsetService.setgCharset(R[b[0]],f.CHARSETS[b[1]]||f.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){let 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=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.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(){let b=new i.CellData;b.content=4194373,b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg,this._setCursor(0,0);for(let E=0;E<this._bufferService.rows;++E){let L=this._activeBuffer.ybase+this._activeBuffer.y+E,A=this._activeBuffer.lines.get(L);A&&(A.fill(b),A.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(b,E){let L=this._bufferService.buffer,A=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${W}${o.C0.ESC}\\`),!0))(b==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:b==='"p'?'P1$r61;1"p':b==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:b==="m"?"P1$r0m":b===" q"?`P1$r${{block:2,underline:4,bar:6}[A.cursorStyle]-(A.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(b,E){this._dirtyRowTracker.markRangeDirty(b,E)}}r.InputHandler=I;let O=class{constructor(P){this._bufferService=P,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(P){P<this.start?this.start=P:P>this.end&&(this.end=P)}markRangeDirty(P,b){P>b&&(F=P,P=b,b=F),P<this.start&&(this.start=P),b>this.end&&(this.end=b)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function H(P){return 0<=P&&P<256}O=a([_(0,g.IBufferService)],O)},844:(k,r)=>{function n(a){for(let _ of a)_.dispose();a.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let a of this._disposables)a.dispose();this._disposables.length=0}register(a){return this._disposables.push(a),a}unregister(a){let _=this._disposables.indexOf(a);_!==-1&&this._disposables.splice(_,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(a){this._isDisposed||a===this._value||(this._value?.dispose(),this._value=a)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(a){return{dispose:a}},r.disposeArray=n,r.getDisposeArrayDisposable=function(a){return{dispose:()=>n(a)}}},1505:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(_,o,f){this._data[_]||(this._data[_]={}),this._data[_][o]=f}get(_,o){return this._data[_]?this._data[_][o]:void 0}clear(){this._data={}}}r.TwoKeyMap=n,r.FourKeyMap=class{constructor(){this._data=new n}set(a,_,o,f,v){this._data.get(a,_)||this._data.set(a,_,new n),this._data.get(a,_).set(o,f,v)}get(a,_,o,f){return this._data.get(a,_)?.get(o,f)}clear(){this._data.clear()}}},6114:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;let n=r.isNode?"node":navigator.userAgent,a=r.isNode?"node":navigator.platform;r.isFirefox=n.includes("Firefox"),r.isLegacyEdge=n.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(n),r.getSafariVersion=function(){if(!r.isSafari)return 0;let _=n.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(a),r.isIpad=a==="iPad",r.isIphone=a==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(a),r.isLinux=a.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(n)},6106:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let n=0;r.SortedList=class{constructor(a){this._getKey=a,this._array=[]}clear(){this._array.length=0}insert(a){this._array.length!==0?(n=this._search(this._getKey(a)),this._array.splice(n,0,a)):this._array.push(a)}delete(a){if(this._array.length===0)return!1;let _=this._getKey(a);if(_===void 0||(n=this._search(_),n===-1)||this._getKey(this._array[n])!==_)return!1;do if(this._array[n]===a)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===_);return!1}*getKeyIterator(a){if(this._array.length!==0&&(n=this._search(a),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===a))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===a)}forEachByKey(a,_){if(this._array.length!==0&&(n=this._search(a),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===a))do _(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===a)}values(){return[...this._array].values()}_search(a){let _=0,o=this._array.length-1;for(;o>=_;){let f=_+o>>1,v=this._getKey(this._array[f]);if(v>a)o=f-1;else{if(!(v<a)){for(;f>0&&this._getKey(this._array[f-1])===a;)f--;return f}_=f+1}}return _}}},7226:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;let a=n(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),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(v){this._idleCallback=void 0;let S=0,d=0,t=v.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),d=Math.max(S,d),s=v.timeRemaining(),1.5*d>s)return t-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(t-S))}ms`),void this._start();t=s}this.clear()}}class o extends _{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){let S=Date.now()+v;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}r.PriorityTaskQueue=o,r.IdleTaskQueue=!a.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:o,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;let a=n(643);r.updateWindowsModeWrappedState=function(_){let o=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),f=o?.get(_.cols-1),v=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);v&&f&&(v.isWrapped=f[a.CHAR_DATA_CODE_INDEX]!==a.NULL_CELL_CODE&&f[a.CHAR_DATA_CODE_INDEX]!==a.WHITESPACE_CELL_CODE)}},3734:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new a}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){let o=new n;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}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}}r.AttributeData=n;class a{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){let o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,f=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=f}clone(){return new a(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=a},9092:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;let a=n(6349),_=n(7226),o=n(3734),f=n(8437),v=n(4634),S=n(511),d=n(643),t=n(4863),s=n(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(e,i,h){this._hasScrollback=e,this._optionsService=i,this._bufferService=h,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,d.WHITESPACE_CELL_CHAR,d.WHITESPACE_CELL_WIDTH,d.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,i){return new f.BufferLine(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let i=e+this._optionsService.rawOptions.scrollback;return i>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=f.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let h=this.getNullCell(f.DEFAULT_ATTR_DATA),g=0,p=this._getCorrectBufferLength(i);if(p>this.lines.maxLength&&(this.lines.maxLength=p),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)g+=+this.lines.get(l).resize(e,h);let m=0;if(this._rows<i)for(let l=this._rows;l<i;l++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(e,h)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(e,h)));else for(let l=this._rows;l>i;l--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(p<this.lines.maxLength){let l=this.lines.length-p;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=p}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let m=0;m<this.lines.length;m++)g+=+this.lines.get(m).resize(e,h);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),g>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let h=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(h.length>0){let g=(0,v.reflowLargerCreateNewLayout)(this.lines,h);(0,v.reflowLargerApplyNewLayout)(this.lines,g.layout),this._reflowLargerAdjustViewport(e,i,g.countRemoved)}}_reflowLargerAdjustViewport(e,i,h){let g=this.getNullCell(f.DEFAULT_ATTR_DATA),p=h;for(;p-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new f.BufferLine(e,g))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-h,0)}_reflowSmaller(e,i){let h=this.getNullCell(f.DEFAULT_ATTR_DATA),g=[],p=0;for(let m=this.lines.length-1;m>=0;m--){let l=this.lines.get(m);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;let C=[l];for(;l.isWrapped&&m>0;)l=this.lines.get(--m),C.unshift(l);let R=this.ybase+this.y;if(R>=m&&R<m+C.length)continue;let T=C[C.length-1].getTrimmedLength(),B=(0,v.reflowSmallerGetNewLineLengths)(C,this._cols,e),D=B.length-C.length,F;F=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);let I=[];for(let L=0;L<D;L++){let A=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);I.push(A)}I.length>0&&(g.push({start:m+C.length+p,newLines:I}),p+=I.length),C.push(...I);let O=B.length-1,H=B[O];H===0&&(O--,H=B[O]);let P=C.length-D-1,b=T;for(;P>=0;){let L=Math.min(b,H);if(C[O]===void 0)break;if(C[O].copyCellsFrom(C[P],b-L,H-L,L,!0),H-=L,H===0&&(O--,H=B[O]),b-=L,b===0){P--;let A=Math.max(P,0);b=(0,v.getWrappedLineTrimmedLength)(C,A,this._cols)}}for(let L=0;L<C.length;L++)B[L]<e&&C[L].setCell(B[L],h);let E=D-F;for(;E-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+p)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+i-1)}if(g.length>0){let m=[],l=[];for(let O=0;O<this.lines.length;O++)l.push(this.lines.get(O));let C=this.lines.length,R=C-1,T=0,B=g[T];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+p);let D=0;for(let O=Math.min(this.lines.maxLength-1,C+p-1);O>=0;O--)if(B&&B.start>R+D){for(let H=B.newLines.length-1;H>=0;H--)this.lines.set(O--,B.newLines[H]);O++,m.push({index:R+1,amount:B.newLines.length}),D+=B.newLines.length,B=g[++T]}else this.lines.set(O,l[R--]);let F=0;for(let O=m.length-1;O>=0;O--)m[O].index+=F,this.lines.onInsertEmitter.fire(m[O]),F+=m[O].amount;let I=Math.max(0,C+p-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(e,i,h=0,g){let p=this.lines.get(e);return p?p.translateToString(i,h,g):""}getWrappedRangeForLine(e){let i=e,h=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;h+1<this.lines.length&&this.lines.get(h+1).isWrapped;)h++;return{first:i,last:h}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let i=new t.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim(h=>{i.line-=h,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(h=>{i.line>=h.index&&(i.line+=h.amount)})),i.register(this.lines.onDelete(h=>{i.line>=h.index&&i.line<h.index+h.amount&&i.dispose(),i.line>h.index&&(i.line-=h.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;let a=n(3734),_=n(511),o=n(643),f=n(482);r.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);let v=0;class S{constructor(t,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);let i=s||_.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]);for(let h=0;h<t;++h)this.setCell(h,i);this.length=t}get(t){let s=this._data[3*t+0],e=2097151&s;return[this._data[3*t+1],2097152&s?this._combined[t]:e?(0,f.stringFromCodePoint)(e):"",s>>22,2097152&s?this._combined[t].charCodeAt(this._combined[t].length-1):e]}set(t,s){this._data[3*t+1]=s[o.CHAR_DATA_ATTR_INDEX],s[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=s[1],this._data[3*t+0]=2097152|t|s[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=s[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[o.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){let s=this._data[3*t+0];return 2097152&s?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&s}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){let s=this._data[3*t+0];return 2097152&s?this._combined[t]:2097151&s?(0,f.stringFromCodePoint)(2097151&s):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,s){return v=3*t,s.content=this._data[v+0],s.fg=this._data[v+1],s.bg=this._data[v+2],2097152&s.content&&(s.combinedData=this._combined[t]),268435456&s.bg&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){2097152&s.content&&(this._combined[t]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[t]=s.extended),this._data[3*t+0]=s.content,this._data[3*t+1]=s.fg,this._data[3*t+2]=s.bg}setCellFromCodepoint(t,s,e,i){268435456&i.bg&&(this._extendedAttrs[t]=i.extended),this._data[3*t+0]=s|e<<22,this._data[3*t+1]=i.fg,this._data[3*t+2]=i.bg}addCodepointToCell(t,s,e){let i=this._data[3*t+0];2097152&i?this._combined[t]+=(0,f.stringFromCodePoint)(s):2097151&i?(this._combined[t]=(0,f.stringFromCodePoint)(2097151&i)+(0,f.stringFromCodePoint)(s),i&=-2097152,i|=2097152):i=s|4194304,e&&(i&=-12582913,i|=e<<22),this._data[3*t+0]=i}insertCells(t,s,e){if((t%=this.length)&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),s<this.length-t){let i=new _.CellData;for(let h=this.length-t-s-1;h>=0;--h)this.setCell(t+s+h,this.loadCell(t+h,i));for(let h=0;h<s;++h)this.setCell(t+h,e)}else for(let i=t;i<this.length;++i)this.setCell(i,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(t,s,e){if(t%=this.length,s<this.length-t){let i=new _.CellData;for(let h=0;h<this.length-t-s;++h)this.setCell(t+h,this.loadCell(t+s+h,i));for(let h=this.length-s;h<this.length;++h)this.setCell(h,e)}else for(let i=t;i<this.length;++i)this.setCell(i,e);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),this.getWidth(t)!==0||this.hasContent(t)||this.setCellFromCodepoint(t,0,1,e)}replaceCells(t,s,e,i=!1){if(i)for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,e);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,e),t++;else for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,e);t<s&&t<this.length;)this.setCell(t++,e)}resize(t,s){if(t===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let e=3*t;if(t>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{let i=new Uint32Array(e);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,s)}else{this._data=this._data.subarray(0,e);let i=Object.keys(this._combined);for(let g=0;g<i.length;g++){let p=parseInt(i[g],10);p>=t&&delete this._combined[p]}let h=Object.keys(this._extendedAttrs);for(let g=0;g<h.length;g++){let p=parseInt(h[g],10);p>=t&&delete this._extendedAttrs[p]}}return this.length=t,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,s=!1){if(s)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(let s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){let t=new S(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let s in this._combined)t._combined[s]=this._combined[s];for(let s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0]||50331648&this._data[3*t+2])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,s,e,i,h){let g=t._data;if(h)for(let m=i-1;m>=0;m--){for(let l=0;l<3;l++)this._data[3*(e+m)+l]=g[3*(s+m)+l];268435456&g[3*(s+m)+2]&&(this._extendedAttrs[e+m]=t._extendedAttrs[s+m])}else for(let m=0;m<i;m++){for(let l=0;l<3;l++)this._data[3*(e+m)+l]=g[3*(s+m)+l];268435456&g[3*(s+m)+2]&&(this._extendedAttrs[e+m]=t._extendedAttrs[s+m])}let p=Object.keys(t._combined);for(let m=0;m<p.length;m++){let l=parseInt(p[m],10);l>=s&&(this._combined[l-s+e]=t._combined[l])}}translateToString(t,s,e,i){s=s??0,e=e??this.length,t&&(e=Math.min(e,this.getTrimmedLength())),i&&(i.length=0);let h="";for(;s<e;){let g=this._data[3*s+0],p=2097151&g,m=2097152&g?this._combined[s]:p?(0,f.stringFromCodePoint)(p):o.WHITESPACE_CELL_CHAR;if(h+=m,i)for(let l=0;l<m.length;++l)i.push(s);s+=g>>22||1}return i&&i.push(s),h}}r.BufferLine=S},4841:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(n,a){if(n.start.y>n.end.y)throw new Error(`Buffer range end (${n.end.x}, ${n.end.y}) cannot be before start (${n.start.x}, ${n.start.y})`);return a*(n.end.y-n.start.y)+(n.end.x-n.start.x+1)}},4634:(k,r)=>{function n(a,_,o){if(_===a.length-1)return a[_].getTrimmedLength();let f=!a[_].hasContent(o-1)&&a[_].getWidth(o-1)===1,v=a[_+1].getWidth(0)===2;return f&&v?o-1:o}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(a,_,o,f,v){let S=[];for(let d=0;d<a.length-1;d++){let t=d,s=a.get(++t);if(!s.isWrapped)continue;let e=[a.get(d)];for(;t<a.length&&s.isWrapped;)e.push(s),s=a.get(++t);if(f>=d&&f<t){d+=e.length-1;continue}let i=0,h=n(e,i,_),g=1,p=0;for(;g<e.length;){let l=n(e,g,_),C=l-p,R=o-h,T=Math.min(C,R);e[i].copyCellsFrom(e[g],p,h,T,!1),h+=T,h===o&&(i++,h=0),p+=T,p===l&&(g++,p=0),h===0&&i!==0&&e[i-1].getWidth(o-1)===2&&(e[i].copyCellsFrom(e[i-1],o-1,h++,1,!1),e[i-1].setCell(o-1,v))}e[i].replaceCells(h,o,v);let m=0;for(let l=e.length-1;l>0&&(l>i||e[l].getTrimmedLength()===0);l--)m++;m>0&&(S.push(d+e.length-m),S.push(m)),d+=e.length-1}return S},r.reflowLargerCreateNewLayout=function(a,_){let o=[],f=0,v=_[f],S=0;for(let d=0;d<a.length;d++)if(v===d){let t=_[++f];a.onDeleteEmitter.fire({index:d-S,amount:t}),d+=t-1,S+=t,v=_[++f]}else o.push(d);return{layout:o,countRemoved:S}},r.reflowLargerApplyNewLayout=function(a,_){let o=[];for(let f=0;f<_.length;f++)o.push(a.get(_[f]));for(let f=0;f<o.length;f++)a.set(f,o[f]);a.length=_.length},r.reflowSmallerGetNewLineLengths=function(a,_,o){let f=[],v=a.map((s,e)=>n(a,e,_)).reduce((s,e)=>s+e),S=0,d=0,t=0;for(;t<v;){if(v-t<o){f.push(v-t);break}S+=o;let s=n(a,d,_);S>s&&(S-=s,d++);let e=a[d].getWidth(S-1)===2;e&&S--;let i=e?o-1:o;f.push(i),t+=i}return f},r.getWrappedLineTrimmedLength=n},5295:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;let a=n(8460),_=n(844),o=n(9092);class f extends _.Disposable{constructor(S,d){super(),this._optionsService=S,this._bufferService=d,this._onBufferActivate=this.register(new a.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 o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.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(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,d){this._normal.resize(S,d),this._alt.resize(S,d),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}r.BufferSet=f},511:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;let a=n(482),_=n(643),o=n(3734);class f extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(S){let d=new f;return d.setFromCharData(S),d}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,a.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let d=!1;if(S[_.CHAR_DATA_CHAR_INDEX].length>2)d=!0;else if(S[_.CHAR_DATA_CHAR_INDEX].length===2){let t=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){let s=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(t-55296)+s-56320+65536|S[_.CHAR_DATA_WIDTH_INDEX]<<22:d=!0}else d=!0}else this.content=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[_.CHAR_DATA_WIDTH_INDEX]<<22;d&&(this.combinedData=S[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=f},643:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;let a=n(8460),_=n(844);class o{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=o._nextId++,this._onDispose=this.register(new a.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}r.Marker=o,o._nextId=1},7116:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},r.CHARSETS.A={"#":"\xA3"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},r.CHARSETS.C=r.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},r.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},r.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},r.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},r.CHARSETS.E=r.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},r.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},r.CHARSETS.H=r.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(k,r)=>{var n,a,_;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT=" ",o.LF=`
8
+ `,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL="\x7F"}(n||(r.C0=n={})),function(o){o.PAD="\x80",o.HOP="\x81",o.BPH="\x82",o.NBH="\x83",o.IND="\x84",o.NEL="\x85",o.SSA="\x86",o.ESA="\x87",o.HTS="\x88",o.HTJ="\x89",o.VTS="\x8A",o.PLD="\x8B",o.PLU="\x8C",o.RI="\x8D",o.SS2="\x8E",o.SS3="\x8F",o.DCS="\x90",o.PU1="\x91",o.PU2="\x92",o.STS="\x93",o.CCH="\x94",o.MW="\x95",o.SPA="\x96",o.EPA="\x97",o.SOS="\x98",o.SGCI="\x99",o.SCI="\x9A",o.CSI="\x9B",o.ST="\x9C",o.OSC="\x9D",o.PM="\x9E",o.APC="\x9F"}(a||(r.C1=a={})),function(o){o.ST=`${n.ESC}\\`}(_||(r.C1_ESCAPED=_={}))},7399:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;let a=n(2584),_={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:["'",'"']};r.evaluateKeyboardEvent=function(o,f,v,S){let d={type:0,cancel:!1,key:void 0},t=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?d.key=f?a.C0.ESC+"OA":a.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?d.key=f?a.C0.ESC+"OD":a.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?d.key=f?a.C0.ESC+"OC":a.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(d.key=f?a.C0.ESC+"OB":a.C0.ESC+"[B");break;case 8:d.key=o.ctrlKey?"\b":a.C0.DEL,o.altKey&&(d.key=a.C0.ESC+d.key);break;case 9:if(o.shiftKey){d.key=a.C0.ESC+"[Z";break}d.key=a.C0.HT,d.cancel=!0;break;case 13:d.key=o.altKey?a.C0.ESC+a.C0.CR:a.C0.CR,d.cancel=!0;break;case 27:d.key=a.C0.ESC,o.altKey&&(d.key=a.C0.ESC+a.C0.ESC),d.cancel=!0;break;case 37:if(o.metaKey)break;t?(d.key=a.C0.ESC+"[1;"+(t+1)+"D",d.key===a.C0.ESC+"[1;3D"&&(d.key=a.C0.ESC+(v?"b":"[1;5D"))):d.key=f?a.C0.ESC+"OD":a.C0.ESC+"[D";break;case 39:if(o.metaKey)break;t?(d.key=a.C0.ESC+"[1;"+(t+1)+"C",d.key===a.C0.ESC+"[1;3C"&&(d.key=a.C0.ESC+(v?"f":"[1;5C"))):d.key=f?a.C0.ESC+"OC":a.C0.ESC+"[C";break;case 38:if(o.metaKey)break;t?(d.key=a.C0.ESC+"[1;"+(t+1)+"A",v||d.key!==a.C0.ESC+"[1;3A"||(d.key=a.C0.ESC+"[1;5A")):d.key=f?a.C0.ESC+"OA":a.C0.ESC+"[A";break;case 40:if(o.metaKey)break;t?(d.key=a.C0.ESC+"[1;"+(t+1)+"B",v||d.key!==a.C0.ESC+"[1;3B"||(d.key=a.C0.ESC+"[1;5B")):d.key=f?a.C0.ESC+"OB":a.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(d.key=a.C0.ESC+"[2~");break;case 46:d.key=t?a.C0.ESC+"[3;"+(t+1)+"~":a.C0.ESC+"[3~";break;case 36:d.key=t?a.C0.ESC+"[1;"+(t+1)+"H":f?a.C0.ESC+"OH":a.C0.ESC+"[H";break;case 35:d.key=t?a.C0.ESC+"[1;"+(t+1)+"F":f?a.C0.ESC+"OF":a.C0.ESC+"[F";break;case 33:o.shiftKey?d.type=2:o.ctrlKey?d.key=a.C0.ESC+"[5;"+(t+1)+"~":d.key=a.C0.ESC+"[5~";break;case 34:o.shiftKey?d.type=3:o.ctrlKey?d.key=a.C0.ESC+"[6;"+(t+1)+"~":d.key=a.C0.ESC+"[6~";break;case 112:d.key=t?a.C0.ESC+"[1;"+(t+1)+"P":a.C0.ESC+"OP";break;case 113:d.key=t?a.C0.ESC+"[1;"+(t+1)+"Q":a.C0.ESC+"OQ";break;case 114:d.key=t?a.C0.ESC+"[1;"+(t+1)+"R":a.C0.ESC+"OR";break;case 115:d.key=t?a.C0.ESC+"[1;"+(t+1)+"S":a.C0.ESC+"OS";break;case 116:d.key=t?a.C0.ESC+"[15;"+(t+1)+"~":a.C0.ESC+"[15~";break;case 117:d.key=t?a.C0.ESC+"[17;"+(t+1)+"~":a.C0.ESC+"[17~";break;case 118:d.key=t?a.C0.ESC+"[18;"+(t+1)+"~":a.C0.ESC+"[18~";break;case 119:d.key=t?a.C0.ESC+"[19;"+(t+1)+"~":a.C0.ESC+"[19~";break;case 120:d.key=t?a.C0.ESC+"[20;"+(t+1)+"~":a.C0.ESC+"[20~";break;case 121:d.key=t?a.C0.ESC+"[21;"+(t+1)+"~":a.C0.ESC+"[21~";break;case 122:d.key=t?a.C0.ESC+"[23;"+(t+1)+"~":a.C0.ESC+"[23~";break;case 123:d.key=t?a.C0.ESC+"[24;"+(t+1)+"~":a.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(v&&!S||!o.altKey||o.metaKey)!v||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?d.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(d.key=a.C0.US),o.key==="@"&&(d.key=a.C0.NUL)):o.keyCode===65&&(d.type=1);else{let s=_[o.keyCode],e=s?.[o.shiftKey?1:0];if(e)d.key=a.C0.ESC+e;else if(o.keyCode>=65&&o.keyCode<=90){let i=o.ctrlKey?o.keyCode-64:o.keyCode+32,h=String.fromCharCode(i);o.shiftKey&&(h=h.toUpperCase()),d.key=a.C0.ESC+h}else if(o.keyCode===32)d.key=a.C0.ESC+(o.ctrlKey?a.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let i=o.code.slice(3,4);o.shiftKey||(i=i.toLowerCase()),d.key=a.C0.ESC+i,d.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?d.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?d.key=a.C0.NUL:o.keyCode>=51&&o.keyCode<=55?d.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?d.key=a.C0.DEL:o.keyCode===219?d.key=a.C0.ESC:o.keyCode===220?d.key=a.C0.FS:o.keyCode===221&&(d.key=a.C0.GS)}return d}},482:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(n){return n>65535?(n-=65536,String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):String.fromCharCode(n)},r.utf32ToString=function(n,a=0,_=n.length){let o="";for(let f=a;f<_;++f){let v=n[f];v>65535?(v-=65536,o+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):o+=String.fromCharCode(v)}return o},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(n,a){let _=n.length;if(!_)return 0;let o=0,f=0;if(this._interim){let v=n.charCodeAt(f++);56320<=v&&v<=57343?a[o++]=1024*(this._interim-55296)+v-56320+65536:(a[o++]=this._interim,a[o++]=v),this._interim=0}for(let v=f;v<_;++v){let S=n.charCodeAt(v);if(55296<=S&&S<=56319){if(++v>=_)return this._interim=S,o;let d=n.charCodeAt(v);56320<=d&&d<=57343?a[o++]=1024*(S-55296)+d-56320+65536:(a[o++]=S,a[o++]=d)}else S!==65279&&(a[o++]=S)}return o}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(n,a){let _=n.length;if(!_)return 0;let o,f,v,S,d=0,t=0,s=0;if(this.interim[0]){let h=!1,g=this.interim[0];g&=(224&g)==192?31:(240&g)==224?15:7;let p,m=0;for(;(p=63&this.interim[++m])&&m<4;)g<<=6,g|=p;let l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=l-m;for(;s<C;){if(s>=_)return 0;if(p=n[s++],(192&p)!=128){s--,h=!0;break}this.interim[m++]=p,g<<=6,g|=63&p}h||(l===2?g<128?s--:a[d++]=g:l===3?g<2048||g>=55296&&g<=57343||g===65279||(a[d++]=g):g<65536||g>1114111||(a[d++]=g)),this.interim.fill(0)}let e=_-4,i=s;for(;i<_;){for(;!(!(i<e)||128&(o=n[i])||128&(f=n[i+1])||128&(v=n[i+2])||128&(S=n[i+3]));)a[d++]=o,a[d++]=f,a[d++]=v,a[d++]=S,i+=4;if(o=n[i++],o<128)a[d++]=o;else if((224&o)==192){if(i>=_)return this.interim[0]=o,d;if(f=n[i++],(192&f)!=128){i--;continue}if(t=(31&o)<<6|63&f,t<128){i--;continue}a[d++]=t}else if((240&o)==224){if(i>=_)return this.interim[0]=o,d;if(f=n[i++],(192&f)!=128){i--;continue}if(i>=_)return this.interim[0]=o,this.interim[1]=f,d;if(v=n[i++],(192&v)!=128){i--;continue}if(t=(15&o)<<12|(63&f)<<6|63&v,t<2048||t>=55296&&t<=57343||t===65279)continue;a[d++]=t}else if((248&o)==240){if(i>=_)return this.interim[0]=o,d;if(f=n[i++],(192&f)!=128){i--;continue}if(i>=_)return this.interim[0]=o,this.interim[1]=f,d;if(v=n[i++],(192&v)!=128){i--;continue}if(i>=_)return this.interim[0]=o,this.interim[1]=f,this.interim[2]=v,d;if(S=n[i++],(192&S)!=128){i--;continue}if(t=(7&o)<<18|(63&f)<<12|(63&v)<<6|63&S,t<65536||t>1114111)continue;a[d++]=t}}return d}}},225:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;let a=n(1480),_=[[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]],o=[[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]],f;r.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let v=0;v<_.length;++v)f.fill(0,_[v][0],_[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?f[v]:function(S,d){let t,s=0,e=d.length-1;if(S<d[0][0]||S>d[e][1])return!1;for(;e>=s;)if(t=s+e>>1,S>d[t][1])s=t+1;else{if(!(S<d[t][0]))return!0;e=t-1}return!1}(v,o)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,S){let d=this.wcwidth(v),t=d===0&&S!==0;if(t){let s=a.UnicodeService.extractWidth(S);s===0?t=!1:s>d&&(d=s)}return a.UnicodeService.createPropertyValue(0,d,t)}}},5981:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;let a=n(8460),_=n(844);class o extends _.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let d;for(this._isSyncWriting=!0;d=this._writeBuffer.shift();){this._action(d);let t=this._callbacks.shift();t&&t()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,S){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+=v.length,this._writeBuffer.push(v),this._callbacks.push(S),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(S)}_innerWrite(v=0,S=!0){let d=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let t=this._writeBuffer[this._bufferOffset],s=this._action(t,S);if(s){let i=h=>Date.now()-d>=12?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(d,h);return void s.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(i)}let e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=t.length,Date.now()-d>=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()}}r.WriteBuffer=o},5941:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;let n=/^([\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})$/,a=/^[\da-f]+$/;function _(o,f){let v=o.toString(16),S=v.length<2?"0"+v:v;switch(f){case 4:return v[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}r.parseColor=function(o){if(!o)return;let f=o.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);let v=n.exec(f);if(v){let S=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/S*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/S*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/S*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),a.exec(f)&&[3,6,9,12].includes(f.length))){let v=f.length/3,S=[0,0,0];for(let d=0;d<3;++d){let t=parseInt(f.slice(v*d,v*d+v),16);S[d]=v===1?t<<4:v===2?t:v===3?t>>4:t>>8}return S}},r.toRgbString=function(o,f=16){let[v,S,d]=o;return`rgb:${_(v,f)}/${_(S,f)}/${_(d,f)}`}},5770:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;let a=n(482),_=n(8742),o=n(5770),f=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(S,d){this._handlers[S]===void 0&&(this._handlers[S]=[]);let t=this._handlers[S];return t.push(d),{dispose:()=>{let s=t.indexOf(d);s!==-1&&t.splice(s,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(S,d){if(this.reset(),this._ident=S,this._active=this._handlers[S]||f,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(d);else this._handlerFb(this._ident,"HOOK",d)}put(S,d,t){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(S,d,t);else this._handlerFb(this._ident,"PUT",(0,a.utf32ToString)(S,d,t))}unhook(S,d=!0){if(this._active.length){let t=!1,s=this._active.length-1,e=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,t=d,e=this._stack.fallThrough,this._stack.paused=!1),!e&&t===!1){for(;s>=0&&(t=this._active[s].unhook(S),t!==!0);s--)if(t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,t;s--}for(;s>=0;s--)if(t=this._active[s].unhook(!1),t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,t}else this._handlerFb(this._ident,"UNHOOK",S);this._active=f,this._ident=0}};let v=new _.Params;v.addParam(0),r.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=v,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():v,this._data="",this._hitLimit=!1}put(S,d,t){this._hitLimit||(this._data+=(0,a.utf32ToString)(S,d,t),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let d=!1;if(this._hitLimit)d=!1;else if(S&&(d=this._handler(this._data,this._params),d instanceof Promise))return d.then(t=>(this._params=v,this._data="",this._hitLimit=!1,t));return this._params=v,this._data="",this._hitLimit=!1,d}}},2015:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;let a=n(844),_=n(8742),o=n(6242),f=n(6351);class v{constructor(s){this.table=new Uint8Array(s)}setDefault(s,e){this.table.fill(s<<4|e)}add(s,e,i,h){this.table[e<<8|s]=i<<4|h}addMany(s,e,i,h){for(let g=0;g<s.length;g++)this.table[e<<8|s[g]]=i<<4|h}}r.TransitionTable=v;let S=160;r.VT500_TRANSITION_TABLE=function(){let t=new v(4095),s=Array.apply(null,Array(256)).map((m,l)=>l),e=(m,l)=>s.slice(m,l),i=e(32,127),h=e(0,24);h.push(25),h.push.apply(h,e(28,32));let g=e(0,14),p;for(p in t.setDefault(1,0),t.addMany(i,0,2,0),g)t.addMany([24,26,153,154],p,3,0),t.addMany(e(128,144),p,3,0),t.addMany(e(144,152),p,3,0),t.add(156,p,0,0),t.add(27,p,11,1),t.add(157,p,4,8),t.addMany([152,158,159],p,0,7),t.add(155,p,11,3),t.add(144,p,11,9);return t.addMany(h,0,3,0),t.addMany(h,1,3,1),t.add(127,1,0,1),t.addMany(h,8,0,8),t.addMany(h,3,3,3),t.add(127,3,0,3),t.addMany(h,4,3,4),t.add(127,4,0,4),t.addMany(h,6,3,6),t.addMany(h,5,3,5),t.add(127,5,0,5),t.addMany(h,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(i,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(i,7,0,7),t.addMany(h,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(h,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(h,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(h,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(h,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(h,13,13,13),t.addMany(i,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(S,0,2,0),t.add(S,8,5,8),t.add(S,6,0,6),t.add(S,11,0,11),t.add(S,13,13,13),t}();class d extends a.Disposable{constructor(s=r.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,i,h)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,i)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,a.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new o.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(s,e=[64,126]){let i=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=s.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let g=0;g<s.intermediates.length;++g){let p=s.intermediates.charCodeAt(g);if(32>p||p>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=p}}if(s.final.length!==1)throw new Error("final must be a single byte");let h=s.final.charCodeAt(0);if(e[0]>h||h>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return i<<=8,i|=h,i}identToString(s){let e=[];for(;s;)e.push(String.fromCharCode(255&s)),s>>=8;return e.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,e){let i=this._identifier(s,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let h=this._escHandlers[i];return h.push(e),{dispose:()=>{let g=h.indexOf(e);g!==-1&&h.splice(g,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,e){this._executeHandlers[s.charCodeAt(0)]=e}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,e){let i=this._identifier(s);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let h=this._csiHandlers[i];return h.push(e),{dispose:()=>{let g=h.indexOf(e);g!==-1&&h.splice(g,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,e){return this._dcsParser.registerHandler(this._identifier(s),e)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,e){return this._oscParser.registerHandler(s,e)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}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(s,e,i,h,g){this._parseStack.state=s,this._parseStack.handlers=e,this._parseStack.handlerPos=i,this._parseStack.transition=h,this._parseStack.chunkPos=g}parse(s,e,i){let h,g=0,p=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let l=this._parseStack.handlers,C=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&C>-1){for(;C>=0&&(h=l[C](this._params),h!==!0);C--)if(h instanceof Promise)return this._parseStack.handlerPos=C,h}this._parseStack.handlers=[];break;case 4:if(i===!1&&C>-1){for(;C>=0&&(h=l[C](),h!==!0);C--)if(h instanceof Promise)return this._parseStack.handlerPos=C,h}this._parseStack.handlers=[];break;case 6:if(g=s[this._parseStack.chunkPos],h=this._dcsParser.unhook(g!==24&&g!==26,i),h)return h;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(g=s[this._parseStack.chunkPos],h=this._oscParser.end(g!==24&&g!==26,i),h)return h;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let l=m;l<e;++l){switch(g=s[l],p=this._transitions.table[this.currentState<<8|(g<160?g:S)],p>>4){case 2:for(let D=l+1;;++D){if(D>=e||(g=s[D])<32||g>126&&g<S){this._printHandler(s,l,D),l=D-1;break}if(++D>=e||(g=s[D])<32||g>126&&g<S){this._printHandler(s,l,D),l=D-1;break}if(++D>=e||(g=s[D])<32||g>126&&g<S){this._printHandler(s,l,D),l=D-1;break}if(++D>=e||(g=s[D])<32||g>126&&g<S){this._printHandler(s,l,D),l=D-1;break}}break;case 3:this._executeHandlers[g]?this._executeHandlers[g]():this._executeHandlerFb(g),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:g,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let C=this._csiHandlers[this._collect<<8|g],R=C?C.length-1:-1;for(;R>=0&&(h=C[R](this._params),h!==!0);R--)if(h instanceof Promise)return this._preserveStack(3,C,R,p,l),h;R<0&&this._csiHandlerFb(this._collect<<8|g,this._params),this.precedingJoinState=0;break;case 8:do switch(g){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(g-48)}while(++l<e&&(g=s[l])>47&&g<60);l--;break;case 9:this._collect<<=8,this._collect|=g;break;case 10:let T=this._escHandlers[this._collect<<8|g],B=T?T.length-1:-1;for(;B>=0&&(h=T[B](),h!==!0);B--)if(h instanceof Promise)return this._preserveStack(4,T,B,p,l),h;B<0&&this._escHandlerFb(this._collect<<8|g),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|g,this._params);break;case 13:for(let D=l+1;;++D)if(D>=e||(g=s[D])===24||g===26||g===27||g>127&&g<S){this._dcsParser.put(s,l,D),l=D-1;break}break;case 14:if(h=this._dcsParser.unhook(g!==24&&g!==26),h)return this._preserveStack(6,[],0,p,l),h;g===27&&(p|=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=l+1;;D++)if(D>=e||(g=s[D])<32||g>127&&g<S){this._oscParser.put(s,l,D),l=D-1;break}break;case 6:if(h=this._oscParser.end(g!==24&&g!==26),h)return this._preserveStack(5,[],0,p,l),h;g===27&&(p|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&p}}}r.EscapeSequenceParser=d},6242:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;let a=n(5770),_=n(482),o=[];r.OscParser=class{constructor(){this._state=0,this._active=o,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,v){this._handlers[f]===void 0&&(this._handlers[f]=[]);let S=this._handlers[f];return S.push(v),{dispose:()=>{let d=S.indexOf(v);d!==-1&&S.splice(d,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,v,S){if(this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].put(f,v,S);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(f,v,S))}start(){this.reset(),this._state=1}put(f,v,S){if(this._state!==3){if(this._state===1)for(;v<S;){let d=f[v++];if(d===59){this._state=2,this._start();break}if(d<48||57<d)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+d-48}this._state===2&&S-v>0&&this._put(f,v,S)}}end(f,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,d=this._active.length-1,t=!1;if(this._stack.paused&&(d=this._stack.loopPosition-1,S=v,t=this._stack.fallThrough,this._stack.paused=!1),!t&&S===!1){for(;d>=0&&(S=this._active[d].end(f),S!==!0);d--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!1,S;d--}for(;d>=0;d--)if(S=this._active[d].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",f);this._active=o,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,v,S){this._hitLimit||(this._data+=(0,_.utf32ToString)(f,v,S),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let v=!1;if(this._hitLimit)v=!1;else if(f&&(v=this._handler(this._data),v instanceof Promise))return v.then(S=>(this._data="",this._hitLimit=!1,S));return this._data="",this._hitLimit=!1,v}}},8742:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;let n=2147483647;class a{static fromArray(o){let f=new a;if(!o.length)return f;for(let v=Array.isArray(o[0])?1:0;v<o.length;++v){let S=o[v];if(Array.isArray(S))for(let d=0;d<S.length;++d)f.addSubParam(S[d]);else f.addParam(S)}return f}constructor(o=32,f=32){if(this.maxLength=o,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let o=new a(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){let o=[];for(let f=0;f<this.length;++f){o.push(this.params[f]);let v=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];S-v>0&&o.push(Array.prototype.slice.call(this._subParams,v,S))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>n?n:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>n?n:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){let f=this._subParamsIdx[o]>>8,v=255&this._subParamsIdx[o];return v-f>0?this._subParams.subarray(f,v):null}getSubParamsAll(){let o={};for(let f=0;f<this.length;++f){let v=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];S-v>0&&(o[f]=this._subParams.slice(v,S))}return o}addDigit(o){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let v=this._digitIsSub?this._subParams:this.params,S=v[f-1];v[f-1]=~S?Math.min(10*S+o,n):o}}r.Params=a},5741:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let n=this._addons.length-1;n>=0;n--)this._addons[n].instance.dispose()}loadAddon(n,a){let _={instance:a,dispose:a.dispose,isDisposed:!1};this._addons.push(_),a.dispose=()=>this._wrappedAddonDispose(_),a.activate(n)}_wrappedAddonDispose(n){if(n.isDisposed)return;let a=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===n){a=_;break}if(a===-1)throw new Error("Could not dispose an addon that has not been loaded");n.isDisposed=!0,n.dispose.apply(n.instance),this._addons.splice(a,1)}}},8771:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;let a=n(3785),_=n(511);r.BufferApiView=class{constructor(o,f){this._buffer=o,this.type=f}init(o){return this._buffer=o,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(o){let f=this._buffer.lines.get(o);if(f)return new a.BufferLineApiView(f)}getNullCell(){return new _.CellData}}},3785:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;let a=n(511);r.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,o){if(!(_<0||_>=this._line.length))return o?(this._line.loadCell(_,o),o):this._line.loadCell(_,new a.CellData)}translateToString(_,o,f){return this._line.translateToString(_,o,f)}}},8285:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;let a=n(8771),_=n(8460),o=n(844);class f extends o.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new a.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new a.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)}}r.BufferNamespaceApi=f},7975:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(n){this._core=n}registerCsiHandler(n,a){return this._core.registerCsiHandler(n,_=>a(_.toArray()))}addCsiHandler(n,a){return this.registerCsiHandler(n,a)}registerDcsHandler(n,a){return this._core.registerDcsHandler(n,(_,o)=>a(_,o.toArray()))}addDcsHandler(n,a){return this.registerDcsHandler(n,a)}registerEscHandler(n,a){return this._core.registerEscHandler(n,a)}addEscHandler(n,a){return this.registerEscHandler(n,a)}registerOscHandler(n,a){return this._core.registerOscHandler(n,a)}addOscHandler(n,a){return this.registerOscHandler(n,a)}}},7090:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(n){this._core=n}register(n){this._core.unicodeService.register(n)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(n){this._core.unicodeService.activeVersion=n}}},744:function(k,r,n){var a=this&&this.__decorate||function(t,s,e,i){var h,g=arguments.length,p=g<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,e,i);else for(var m=t.length-1;m>=0;m--)(h=t[m])&&(p=(g<3?h(p):g>3?h(s,e,p):h(s,e))||p);return g>3&&p&&Object.defineProperty(s,e,p),p},_=this&&this.__param||function(t,s){return function(e,i){s(e,i,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;let o=n(8460),f=n(844),v=n(5295),S=n(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let d=r.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(t){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(t,this))}resize(t,s){this.cols=t,this.rows=s,this.buffers.resize(t,s),this._onResize.fire({cols:t,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,s=!1){let e=this.buffer,i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===t.fg&&i.getBg(0)===t.bg||(i=e.getBlankLine(t,s),this._cachedBlankLine=i),i.isWrapped=s;let h=e.ybase+e.scrollTop,g=e.ybase+e.scrollBottom;if(e.scrollTop===0){let p=e.lines.isFull;g===e.lines.length-1?p?e.lines.recycle().copyFrom(i):e.lines.push(i.clone()):e.lines.splice(g+1,0,i.clone()),p?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{let p=g-h+1;e.lines.shiftElements(h+1,p-1,-1),e.lines.set(g,i.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(t,s,e){let i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let h=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),h!==i.ydisp&&(s||this._onScroll.fire(i.ydisp))}};r.BufferService=d=a([_(0,S.IOptionsService)],d)},7994:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(n){this.glevel=n,this.charset=this._charsets[n]}setgCharset(n,a){this._charsets[n]=a,this.glevel===n&&(this.charset=a)}}},1753:function(k,r,n){var a=this&&this.__decorate||function(i,h,g,p){var m,l=arguments.length,C=l<3?h:p===null?p=Object.getOwnPropertyDescriptor(h,g):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(i,h,g,p);else for(var R=i.length-1;R>=0;R--)(m=i[R])&&(C=(l<3?m(C):l>3?m(h,g,C):m(h,g))||C);return l>3&&C&&Object.defineProperty(h,g,C),C},_=this&&this.__param||function(i,h){return function(g,p){h(g,p,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;let o=n(2585),f=n(8460),v=n(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:i=>i.button!==4&&i.action===1&&(i.ctrl=!1,i.alt=!1,i.shift=!1,!0)},VT200:{events:19,restrict:i=>i.action!==32},DRAG:{events:23,restrict:i=>i.action!==32||i.button!==3},ANY:{events:31,restrict:i=>!0}};function d(i,h){let g=(i.ctrl?16:0)|(i.shift?4:0)|(i.alt?8:0);return i.button===4?(g|=64,g|=i.action):(g|=3&i.button,4&i.button&&(g|=64),8&i.button&&(g|=128),i.action===32?g|=32:i.action!==0||h||(g|=3)),g}let t=String.fromCharCode,s={DEFAULT:i=>{let h=[d(i,!1)+32,i.col+32,i.row+32];return h[0]>255||h[1]>255||h[2]>255?"":`\x1B[M${t(h[0])}${t(h[1])}${t(h[2])}`},SGR:i=>{let h=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${d(i,!0)};${i.col};${i.row}${h}`},SGR_PIXELS:i=>{let h=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${d(i,!0)};${i.x};${i.y}${h}`}},e=r.CoreMouseService=class extends v.Disposable{constructor(i,h){super(),this._bufferService=i,this._coreService=h,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let g of Object.keys(S))this.addProtocol(g,S[g]);for(let g of Object.keys(s))this.addEncoding(g,s[g]);this.reset()}addProtocol(i,h){this._protocols[i]=h}addEncoding(i,h){this._encodings[i]=h}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(i){if(!this._protocols[i])throw new Error(`unknown protocol "${i}"`);this._activeProtocol=i,this._onProtocolChange.fire(this._protocols[i].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(i){if(!this._encodings[i])throw new Error(`unknown encoding "${i}"`);this._activeEncoding=i}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(i){if(i.col<0||i.col>=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows||i.button===4&&i.action===32||i.button===3&&i.action!==32||i.button!==4&&(i.action===2||i.action===3)||(i.col++,i.row++,i.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,i,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(i))return!1;let h=this._encodings[this._activeEncoding](i);return h&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(h):this._coreService.triggerDataEvent(h,!0)),this._lastEvent=i,!0}explainEvents(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}}_equalEvents(i,h,g){if(g){if(i.x!==h.x||i.y!==h.y)return!1}else if(i.col!==h.col||i.row!==h.row)return!1;return i.button===h.button&&i.action===h.action&&i.ctrl===h.ctrl&&i.alt===h.alt&&i.shift===h.shift}};r.CoreMouseService=e=a([_(0,o.IBufferService),_(1,o.ICoreService)],e)},6975:function(k,r,n){var a=this&&this.__decorate||function(e,i,h,g){var p,m=arguments.length,l=m<3?i:g===null?g=Object.getOwnPropertyDescriptor(i,h):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,h,g);else for(var C=e.length-1;C>=0;C--)(p=e[C])&&(l=(m<3?p(l):m>3?p(i,h,l):p(i,h))||l);return m>3&&l&&Object.defineProperty(i,h,l),l},_=this&&this.__param||function(e,i){return function(h,g){i(h,g,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;let o=n(1439),f=n(8460),v=n(844),S=n(2585),d=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),s=r.CoreService=class extends v.Disposable{constructor(e,i,h){super(),this._bufferService=e,this._logService=i,this._optionsService=h,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,o.clone)(d),this.decPrivateModes=(0,o.clone)(t)}reset(){this.modes=(0,o.clone)(d),this.decPrivateModes=(0,o.clone)(t)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let h=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&h.ybase!==h.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(g=>g.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};r.CoreService=s=a([_(0,S.IBufferService),_(1,S.ILogService),_(2,S.IOptionsService)],s)},9074:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;let a=n(8055),_=n(8460),o=n(844),f=n(6106),v=0,S=0;class d extends o.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(e=>e?.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,o.toDisposable)(()=>this.reset()))}registerDecoration(e){if(e.marker.isDisposed)return;let i=new t(e);if(i){let h=i.marker.onDispose(()=>i.dispose());i.onDispose(()=>{i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),h.dispose())}),this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,h){let g=0,p=0;for(let m of this._decorations.getKeyIterator(i))g=m.options.x??0,p=g+(m.options.width??1),e>=g&&e<p&&(!h||(m.options.layer??"bottom")===h)&&(yield m)}forEachDecorationAtCell(e,i,h,g){this._decorations.forEachByKey(i,p=>{v=p.options.x??0,S=v+(p.options.width??1),e>=v&&e<S&&(!h||(p.options.layer??"bottom")===h)&&g(p)})}}r.DecorationService=d;class t extends o.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=a.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=a.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;let a=n(2585),_=n(8343);class o{constructor(...v){this._entries=new Map;for(let[S,d]of v)this.set(S,d)}set(v,S){let d=this._entries.get(v);return this._entries.set(v,S),d}forEach(v){for(let[S,d]of this._entries.entries())v(S,d)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}r.ServiceCollection=o,r.InstantiationService=class{constructor(){this._services=new o,this._services.set(a.IInstantiationService,this)}setService(f,v){this._services.set(f,v)}getService(f){return this._services.get(f)}createInstance(f,...v){let S=(0,_.getServiceDependencies)(f).sort((s,e)=>s.index-e.index),d=[];for(let s of S){let e=this._services.get(s.id);if(!e)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${s.id}.`);d.push(e)}let t=S.length>0?S[0].index:v.length;if(v.length!==t)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${t+1} conflicts with ${v.length} static arguments`);return new f(...v,...d)}}},7866:function(k,r,n){var a=this&&this.__decorate||function(t,s,e,i){var h,g=arguments.length,p=g<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,e,i);else for(var m=t.length-1;m>=0;m--)(h=t[m])&&(p=(g<3?h(p):g>3?h(s,e,p):h(s,e))||p);return g>3&&p&&Object.defineProperty(s,e,p),p},_=this&&this.__param||function(t,s){return function(e,i){s(e,i,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;let o=n(844),f=n(2585),v={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF},S,d=r.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let s=0;s<t.length;s++)typeof t[s]=="function"&&(t[s]=t[s]())}_log(t,s,e){this._evalLazyOptionalParams(e),t.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...e)}trace(t,...s){this._logLevel<=f.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,s)}debug(t,...s){this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,s)}info(t,...s){this._logLevel<=f.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,s)}warn(t,...s){this._logLevel<=f.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,s)}error(t,...s){this._logLevel<=f.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,s)}};r.LogService=d=a([_(0,f.IOptionsService)],d),r.setTraceLogger=function(t){S=t},r.traceCall=function(t,s,e){if(typeof e.value!="function")throw new Error("not supported");let i=e.value;e.value=function(...h){if(S.logLevel!==f.LogLevelEnum.TRACE)return i.apply(this,h);S.trace(`GlyphRenderer#${i.name}(${h.map(p=>JSON.stringify(p)).join(", ")})`);let g=i.apply(this,h);return S.trace(`GlyphRenderer#${i.name} return`,g),g}}},7302:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;let a=n(8460),_=n(844),o=n(6114);r.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:o.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};let f=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends _.Disposable{constructor(d){super(),this._onOptionChange=this.register(new a.EventEmitter),this.onOptionChange=this._onOptionChange.event;let t={...r.DEFAULT_OPTIONS};for(let s in d)if(s in t)try{let e=d[s];t[s]=this._sanitizeAndValidateOption(s,e)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(d,t){return this.onOptionChange(s=>{s===d&&t(this.rawOptions[d])})}onMultipleOptionChange(d,t){return this.onOptionChange(s=>{d.indexOf(s)!==-1&&t()})}_setupOptions(){let d=s=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,e)=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);e=this._sanitizeAndValidateOption(s,e),this.rawOptions[s]!==e&&(this.rawOptions[s]=e,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let e={get:d.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,e)}}_sanitizeAndValidateOption(d,t){switch(d){case"cursorStyle":if(t||(t=r.DEFAULT_OPTIONS[d]),!function(s){return s==="block"||s==="underline"||s==="bar"}(t))throw new Error(`"${t}" is not a valid value for ${d}`);break;case"wordSeparator":t||(t=r.DEFAULT_OPTIONS[d]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=f.includes(t)?t:r.DEFAULT_OPTIONS[d];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${d} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(`${d} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${d} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${d} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{}}return t}}r.OptionsService=v},2660:function(k,r,n){var a=this&&this.__decorate||function(v,S,d,t){var s,e=arguments.length,i=e<3?S:t===null?t=Object.getOwnPropertyDescriptor(S,d):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(v,S,d,t);else for(var h=v.length-1;h>=0;h--)(s=v[h])&&(i=(e<3?s(i):e>3?s(S,d,i):s(S,d))||i);return e>3&&i&&Object.defineProperty(S,d,i),i},_=this&&this.__param||function(v,S){return function(d,t){S(d,t,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;let o=n(2585),f=r.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){let S=this._bufferService.buffer;if(v.id===void 0){let h=S.addMarker(S.ybase+S.y),g={data:v,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(g,h)),this._dataByLinkId.set(g.id,g),g.id}let d=v,t=this._getEntryIdKey(d),s=this._entriesWithId.get(t);if(s)return this.addLineToLink(s.id,S.ybase+S.y),s.id;let e=S.addMarker(S.ybase+S.y),i={id:this._nextId++,key:this._getEntryIdKey(d),data:d,lines:[e]};return e.onDispose(()=>this._removeMarkerFromLink(i,e)),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(v,S){let d=this._dataByLinkId.get(v);if(d&&d.lines.every(t=>t.line!==S)){let t=this._bufferService.buffer.addMarker(S);d.lines.push(t),t.onDispose(()=>this._removeMarkerFromLink(d,t))}}getLinkData(v){return this._dataByLinkId.get(v)?.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,S){let d=v.lines.indexOf(S);d!==-1&&(v.lines.splice(d,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};r.OscLinkService=f=a([_(0,o.IBufferService)],f)},8343:(k,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;let n="di$target",a="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(_){return _[a]||[]},r.createDecorator=function(_){if(r.serviceRegistry.has(_))return r.serviceRegistry.get(_);let o=function(f,v,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(d,t,s){t[n]===t?t[a].push({id:d,index:s}):(t[a]=[{id:d,index:s}],t[n]=t)})(o,f,S)};return o.toString=()=>_,r.serviceRegistry.set(_,o),o}},2585:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;let a=n(8343);var _;r.IBufferService=(0,a.createDecorator)("BufferService"),r.ICoreMouseService=(0,a.createDecorator)("CoreMouseService"),r.ICoreService=(0,a.createDecorator)("CoreService"),r.ICharsetService=(0,a.createDecorator)("CharsetService"),r.IInstantiationService=(0,a.createDecorator)("InstantiationService"),function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"}(_||(r.LogLevelEnum=_={})),r.ILogService=(0,a.createDecorator)("LogService"),r.IOptionsService=(0,a.createDecorator)("OptionsService"),r.IOscLinkService=(0,a.createDecorator)("OscLinkService"),r.IUnicodeService=(0,a.createDecorator)("UnicodeService"),r.IDecorationService=(0,a.createDecorator)("DecorationService")},1480:(k,r,n)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;let a=n(8460),_=n(225);class o{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,S,d=!1){return(16777215&v)<<3|(3&S)<<1|(d?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new a.EventEmitter,this.onChange=this._onChange.event;let v=new _.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let S=0,d=0,t=v.length;for(let s=0;s<t;++s){let e=v.charCodeAt(s);if(55296<=e&&e<=56319){if(++s>=t)return S+this.wcwidth(e);let g=v.charCodeAt(s);56320<=g&&g<=57343?e=1024*(e-55296)+g-56320+65536:S+=this.wcwidth(g)}let i=this.charProperties(e,d),h=o.extractWidth(i);o.extractShouldJoin(i)&&(h-=o.extractWidth(d)),S+=h,d=i}return S}charProperties(v,S){return this._activeProvider.charProperties(v,S)}}r.UnicodeService=o}},u={};function w(k){var r=u[k];if(r!==void 0)return r.exports;var n=u[k]={exports:{}};return c[k].call(n.exports,n,n.exports,w),n.exports}var x={};return(()=>{var k=x;Object.defineProperty(k,"__esModule",{value:!0}),k.Terminal=void 0;let r=w(9042),n=w(3236),a=w(844),_=w(5741),o=w(8285),f=w(7975),v=w(7090),S=["cols","rows"];class d extends a.Disposable{constructor(s){super(),this._core=this.register(new n.Terminal(s)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};let e=h=>this._core.options[h],i=(h,g)=>{this._checkReadonlyOptions(h),this._core.options[h]=g};for(let h in this._core.options){let g={get:e.bind(this,h),set:i.bind(this,h)};Object.defineProperty(this._publicOptions,h,g)}}_checkReadonlyOptions(s){if(S.includes(s))throw new Error(`Option "${s}" 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 f.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.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 o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let s=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(let e in s)this._publicOptions[e]=s[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,e=!0){this._core.input(s,e)}resize(s,e){this._verifyIntegers(s,e),this._core.resize(s,e)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,e,i){this._verifyIntegers(s,e,i),this._core.select(s,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,e){this._verifyIntegers(s,e),this._core.selectLines(s,e)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,e){this._core.write(s,e)}writeln(s,e){this._core.write(s),this._core.write(`\r
9
+ `,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(let e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(let e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}k.Terminal=d})(),x})())});var kt=wt((He,st)=>{(function(c,u){typeof He=="object"&&typeof st=="object"?st.exports=u():typeof define=="function"&&define.amd?define([],u):typeof He=="object"?He.FitAddon=u():c.FitAddon=u()})(self,()=>(()=>{"use strict";var c={};return(()=>{var u=c;Object.defineProperty(u,"__esModule",{value:!0}),u.FitAddon=void 0,u.FitAddon=class{activate(w){this._terminal=w}dispose(){}fit(){let w=this.proposeDimensions();if(!w||!this._terminal||isNaN(w.cols)||isNaN(w.rows))return;let x=this._terminal._core;this._terminal.rows===w.rows&&this._terminal.cols===w.cols||(x._renderService.clear(),this._terminal.resize(w.cols,w.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let w=this._terminal._core,x=w._renderService.dimensions;if(x.css.cell.width===0||x.css.cell.height===0)return;let k=this._terminal.options.scrollback===0?0:w.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),a=Math.max(0,parseInt(r.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),o=n-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),f=a-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-k;return{cols:Math.max(2,Math.floor(f/x.css.cell.width)),rows:Math.max(1,Math.floor(o/x.css.cell.height))}}}})(),c})())});var si=yt(xt(),1),ri=yt(kt(),1);var wi=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(c){setTimeout(()=>{throw c.stack?Lt.isErrorNoTelemetry(c)?new Lt(c.message+`
10
+
11
+ `+c.stack):new Error(c.message+`
12
+
13
+ `+c.stack):c},0)}}addListener(c){return this.listeners.push(c),()=>{this._removeListener(c)}}emit(c){this.listeners.forEach(u=>{u(c)})}_removeListener(c){this.listeners.splice(this.listeners.indexOf(c),1)}setUnexpectedErrorHandler(c){this.unexpectedErrorHandler=c}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(c){this.unexpectedErrorHandler(c),this.emit(c)}onUnexpectedExternalError(c){this.unexpectedErrorHandler(c)}},yi=new wi;function rt(c){Ei(c)||yi.onUnexpectedError(c)}var at="Canceled";function Ei(c){return c instanceof xi?!0:c instanceof Error&&c.name===at&&c.message===at}var xi=class extends Error{constructor(){super(at),this.name=this.message}},Lt=class ht extends Error{constructor(u){super(u),this.name="CodeExpectedError"}static fromError(u){if(u instanceof ht)return u;let w=new ht;return w.message=u.message,w.stack=u.stack,w}static isErrorNoTelemetry(u){return u.name==="CodeExpectedError"}};function ki(c,u,w=0,x=c.length){let k=w,r=x;for(;k<r;){let n=Math.floor((k+r)/2);u(c[n])?k=n+1:r=n}return k-1}var Li=class Pt{constructor(u){this._array=u,this._findLastMonotonousLastIdx=0}findLastMonotonous(u){if(Pt.assertInvariants){if(this._prevFindLastPredicate){for(let x of this._array)if(this._prevFindLastPredicate(x)&&!u(x))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=u}let w=ki(this._array,u,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=w+1,w===-1?void 0:this._array[w]}};Li.assertInvariants=!1;var Ht;(c=>{function u(r){return r<0}c.isLessThan=u;function w(r){return r<=0}c.isLessThanOrEqual=w;function x(r){return r>0}c.isGreaterThan=x;function k(r){return r===0}c.isNeitherLessOrGreaterThan=k,c.greaterThan=1,c.lessThan=-1,c.neitherLessOrGreaterThan=0})(Ht||(Ht={}));function Di(c,u){return(w,x)=>u(c(w),c(x))}var Ri=(c,u)=>c-u,Dt=class lt{constructor(u){this.iterate=u}forEach(u){this.iterate(w=>(u(w),!0))}toArray(){let u=[];return this.iterate(w=>(u.push(w),!0)),u}filter(u){return new lt(w=>this.iterate(x=>u(x)?w(x):!0))}map(u){return new lt(w=>this.iterate(x=>w(u(x))))}some(u){let w=!1;return this.iterate(x=>(w=u(x),!w)),w}findFirst(u){let w;return this.iterate(x=>u(x)?(w=x,!1):!0),w}findLast(u){let w;return this.iterate(x=>(u(x)&&(w=x),!0)),w}findLastMaxBy(u){let w,x=!0;return this.iterate(k=>((x||Ht.isGreaterThan(u(k,w)))&&(x=!1,w=k),!0)),w}};Dt.empty=new Dt(c=>{});function Ti(c,u){let w=Object.create(null);for(let x of c){let k=u(x),r=w[k];r||(r=w[k]=[]),r.push(x)}return w}var Rt,Tt,Br=class{constructor(c,u){this.toKey=u,this._map=new Map,this[Rt]="SetWithKey";for(let w of c)this.add(w)}get size(){return this._map.size}add(c){let u=this.toKey(c);return this._map.set(u,c),this}delete(c){return this._map.delete(this.toKey(c))}has(c){return this._map.has(this.toKey(c))}*entries(){for(let c of this._map.values())yield[c,c]}keys(){return this.values()}*values(){for(let c of this._map.values())yield c}clear(){this._map.clear()}forEach(c,u){this._map.forEach(w=>c.call(u,w,w,this))}[(Tt=Symbol.iterator,Rt=Symbol.toStringTag,Tt)](){return this.values()}},Ai=class{constructor(){this.map=new Map}add(c,u){let w=this.map.get(c);w||(w=new Set,this.map.set(c,w)),w.add(u)}delete(c,u){let w=this.map.get(c);w&&(w.delete(u),w.size===0&&this.map.delete(c))}forEach(c,u){let w=this.map.get(c);w&&w.forEach(u)}get(c){return this.map.get(c)||new Set}};function Bi(c,u){let w=this,x=!1,k;return function(){if(x)return k;if(x=!0,u)try{k=c.apply(w,arguments)}finally{u()}else k=c.apply(w,arguments);return k}}var Ft;(c=>{function u(p){return p&&typeof p=="object"&&typeof p[Symbol.iterator]=="function"}c.is=u;let w=Object.freeze([]);function x(){return w}c.empty=x;function*k(p){yield p}c.single=k;function r(p){return u(p)?p:k(p)}c.wrap=r;function n(p){return p||w}c.from=n;function*a(p){for(let m=p.length-1;m>=0;m--)yield p[m]}c.reverse=a;function _(p){return!p||p[Symbol.iterator]().next().done===!0}c.isEmpty=_;function o(p){return p[Symbol.iterator]().next().value}c.first=o;function f(p,m){let l=0;for(let C of p)if(m(C,l++))return!0;return!1}c.some=f;function v(p,m){for(let l of p)if(m(l))return l}c.find=v;function*S(p,m){for(let l of p)m(l)&&(yield l)}c.filter=S;function*d(p,m){let l=0;for(let C of p)yield m(C,l++)}c.map=d;function*t(p,m){let l=0;for(let C of p)yield*m(C,l++)}c.flatMap=t;function*s(...p){for(let m of p)yield*m}c.concat=s;function e(p,m,l){let C=l;for(let R of p)C=m(C,R);return C}c.reduce=e;function*i(p,m,l=p.length){for(m<0&&(m+=p.length),l<0?l+=p.length:l>p.length&&(l=p.length);m<l;m++)yield p[m]}c.slice=i;function h(p,m=Number.POSITIVE_INFINITY){let l=[];if(m===0)return[l,p];let C=p[Symbol.iterator]();for(let R=0;R<m;R++){let T=C.next();if(T.done)return[l,c.empty()];l.push(T.value)}return[l,{[Symbol.iterator](){return C}}]}c.consume=h;async function g(p){let m=[];for await(let l of p)m.push(l);return Promise.resolve(m)}c.asyncToArray=g})(Ft||(Ft={}));var Mi=!1,Se=null,Oi=class Wt{constructor(){this.livingDisposables=new Map}getDisposableData(u){let w=this.livingDisposables.get(u);return w||(w={parent:null,source:null,isSingleton:!1,value:u,idx:Wt.idx++},this.livingDisposables.set(u,w)),w}trackDisposable(u){let w=this.getDisposableData(u);w.source||(w.source=new Error().stack)}setParent(u,w){let x=this.getDisposableData(u);x.parent=w}markAsDisposed(u){this.livingDisposables.delete(u)}markAsSingleton(u){this.getDisposableData(u).isSingleton=!0}getRootParent(u,w){let x=w.get(u);if(x)return x;let k=u.parent?this.getRootParent(this.getDisposableData(u.parent),w):u;return w.set(u,k),k}getTrackedDisposables(){let u=new Map;return[...this.livingDisposables.entries()].filter(([,w])=>w.source!==null&&!this.getRootParent(w,u).isSingleton).flatMap(([w])=>w)}computeLeakingDisposables(u=10,w){let x;if(w)x=w;else{let _=new Map,o=[...this.livingDisposables.values()].filter(v=>v.source!==null&&!this.getRootParent(v,_).isSingleton);if(o.length===0)return;let f=new Set(o.map(v=>v.value));if(x=o.filter(v=>!(v.parent&&f.has(v.parent))),x.length===0)throw new Error("There are cyclic diposable chains!")}if(!x)return;function k(_){function o(v,S){for(;v.length>0&&S.some(d=>typeof d=="string"?d===v[0]:v[0].match(d));)v.shift()}let f=_.source.split(`
14
+ `).map(v=>v.trim().replace("at ","")).filter(v=>v!=="");return o(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}let r=new Ai;for(let _ of x){let o=k(_);for(let f=0;f<=o.length;f++)r.add(o.slice(0,f).join(`
15
+ `),_)}x.sort(Di(_=>_.idx,Ri));let n="",a=0;for(let _ of x.slice(0,u)){a++;let o=k(_),f=[];for(let v=0;v<o.length;v++){let S=o[v];S=`(shared with ${r.get(o.slice(0,v+1).join(`
16
+ `)).size}/${x.length} leaks) at ${S}`;let d=r.get(o.slice(0,v).join(`
17
+ `)),t=Ti([...d].map(s=>k(s)[v]),s=>s);delete t[o[v]];for(let[s,e]of Object.entries(t))f.unshift(` - stacktraces of ${e.length} other leaks continue with ${s}`);f.unshift(S)}n+=`
18
+
19
+
20
+ ==================== Leaking disposable ${a}/${x.length}: ${_.value.constructor.name} ====================
21
+ ${f.join(`
22
+ `)}
23
+ ============================================================
24
+
25
+ `}return x.length>u&&(n+=`
26
+
27
+
28
+ ... and ${x.length-u} more leaking disposables
29
+
30
+ `),{leaks:x,details:n}}};Oi.idx=0;function Ii(c){Se=c}if(Mi){let c="__is_disposable_tracked__";Ii(new class{trackDisposable(u){let w=new Error("Potentially leaked disposable").stack;setTimeout(()=>{u[c]||console.log(w)},3e3)}setParent(u,w){if(u&&u!==he.None)try{u[c]=!0}catch{}}markAsDisposed(u){if(u&&u!==he.None)try{u[c]=!0}catch{}}markAsSingleton(u){}})}function ze(c){return Se?.trackDisposable(c),c}function qe(c){Se?.markAsDisposed(c)}function Re(c,u){Se?.setParent(c,u)}function Pi(c,u){if(Se)for(let w of c)Se.setParent(w,u)}function De(c){if(Ft.is(c)){let u=[];for(let w of c)if(w)try{w.dispose()}catch(x){u.push(x)}if(u.length===1)throw u[0];if(u.length>1)throw new AggregateError(u,"Encountered errors while disposing of store");return Array.isArray(c)?[]:c}else if(c)return c.dispose(),c}function Nt(...c){let u=be(()=>De(c));return Pi(c,u),u}function be(c){let u=ze({dispose:Bi(()=>{qe(u),c()})});return u}var Ut=class $t{constructor(){this._toDispose=new Set,this._isDisposed=!1,ze(this)}dispose(){this._isDisposed||(qe(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{De(this._toDispose)}finally{this._toDispose.clear()}}add(u){if(!u)return u;if(u===this)throw new Error("Cannot register a disposable on itself!");return Re(u,this),this._isDisposed?$t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(u),u}delete(u){if(u){if(u===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(u),u.dispose()}}deleteAndLeak(u){u&&this._toDispose.has(u)&&(this._toDispose.delete(u),Re(u,null))}};Ut.DISABLE_DISPOSED_WARNING=!1;var vt=Ut,he=class{constructor(){this._store=new vt,ze(this),Re(this._store,this)}dispose(){qe(this),this._store.dispose()}_register(c){if(c===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(c)}};he.None=Object.freeze({dispose(){}});var je=class{constructor(){this._isDisposed=!1,ze(this)}get value(){return this._isDisposed?void 0:this._value}set value(c){this._isDisposed||c===this._value||(this._value?.dispose(),c&&Re(c,this),this._value=c)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,qe(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let c=this._value;return this._value=void 0,c&&Re(c,null),c}},At=class ct{constructor(u){this.element=u,this.next=ct.Undefined,this.prev=ct.Undefined}};At.Undefined=new At(void 0);var Hi=globalThis.performance&&typeof globalThis.performance.now=="function",Fi=class jt{static create(u){return new jt(u)}constructor(u){this._now=Hi&&u===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Wi=!1,Bt=!1,Ni=!1,gt;(c=>{c.None=()=>he.None;function u(I){if(Ni){let{onDidAddListener:O}=I,H=_t.create(),P=0;I.onDidAddListener=()=>{++P===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),H.print()),O?.()}}}function w(I,O){return S(I,()=>{},0,void 0,!0,void 0,O)}c.defer=w;function x(I){return(O,H=null,P)=>{let b=!1,E;return E=I(L=>{if(!b)return E?E.dispose():b=!0,O.call(H,L)},null,P),b&&E.dispose(),E}}c.once=x;function k(I,O,H){return f((P,b=null,E)=>I(L=>P.call(b,O(L)),null,E),H)}c.map=k;function r(I,O,H){return f((P,b=null,E)=>I(L=>{O(L),P.call(b,L)},null,E),H)}c.forEach=r;function n(I,O,H){return f((P,b=null,E)=>I(L=>O(L)&&P.call(b,L),null,E),H)}c.filter=n;function a(I){return I}c.signal=a;function _(...I){return(O,H=null,P)=>{let b=Nt(...I.map(E=>E(L=>O.call(H,L))));return v(b,P)}}c.any=_;function o(I,O,H,P){let b=H;return k(I,E=>(b=O(b,E),b),P)}c.reduce=o;function f(I,O){let H,P={onWillAddFirstListener(){H=I(b.fire,b)},onDidRemoveLastListener(){H?.dispose()}};O||u(P);let b=new ae(P);return O?.add(b),b.event}function v(I,O){return O instanceof Array?O.push(I):O&&O.add(I),I}function S(I,O,H=100,P=!1,b=!1,E,L){let A,W,$,q=0,K,M={leakWarningThreshold:E,onWillAddFirstListener(){A=I(N=>{q++,W=O(W,N),P&&!$&&(y.fire(W),W=void 0),K=()=>{let U=W;W=void 0,$=void 0,(!P||q>1)&&y.fire(U),q=0},typeof H=="number"?(clearTimeout($),$=setTimeout(K,H)):$===void 0&&($=0,queueMicrotask(K))})},onWillRemoveListener(){b&&q>0&&K?.()},onDidRemoveLastListener(){K=void 0,A.dispose()}};L||u(M);let y=new ae(M);return L?.add(y),y.event}c.debounce=S;function d(I,O=0,H){return c.debounce(I,(P,b)=>P?(P.push(b),P):[b],O,void 0,!0,void 0,H)}c.accumulate=d;function t(I,O=(P,b)=>P===b,H){let P=!0,b;return n(I,E=>{let L=P||!O(E,b);return P=!1,b=E,L},H)}c.latch=t;function s(I,O,H){return[c.filter(I,O,H),c.filter(I,P=>!O(P),H)]}c.split=s;function e(I,O=!1,H=[],P){let b=H.slice(),E=I(W=>{b?b.push(W):A.fire(W)});P&&P.add(E);let L=()=>{b?.forEach(W=>A.fire(W)),b=null},A=new ae({onWillAddFirstListener(){E||(E=I(W=>A.fire(W)),P&&P.add(E))},onDidAddFirstListener(){b&&(O?setTimeout(L):L())},onDidRemoveLastListener(){E&&E.dispose(),E=null}});return P&&P.add(A),A.event}c.buffer=e;function i(I,O){return(H,P,b)=>{let E=O(new g);return I(function(L){let A=E.evaluate(L);A!==h&&H.call(P,A)},void 0,b)}}c.chain=i;let h=Symbol("HaltChainable");class g{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(H=>(O(H),H)),this}filter(O){return this.steps.push(H=>O(H)?H:h),this}reduce(O,H){let P=H;return this.steps.push(b=>(P=O(P,b),P)),this}latch(O=(H,P)=>H===P){let H=!0,P;return this.steps.push(b=>{let E=H||!O(b,P);return H=!1,P=b,E?b:h}),this}evaluate(O){for(let H of this.steps)if(O=H(O),O===h)break;return O}}function p(I,O,H=P=>P){let P=(...A)=>L.fire(H(...A)),b=()=>I.on(O,P),E=()=>I.removeListener(O,P),L=new ae({onWillAddFirstListener:b,onDidRemoveLastListener:E});return L.event}c.fromNodeEventEmitter=p;function m(I,O,H=P=>P){let P=(...A)=>L.fire(H(...A)),b=()=>I.addEventListener(O,P),E=()=>I.removeEventListener(O,P),L=new ae({onWillAddFirstListener:b,onDidRemoveLastListener:E});return L.event}c.fromDOMEventEmitter=m;function l(I){return new Promise(O=>x(I)(O))}c.toPromise=l;function C(I){let O=new ae;return I.then(H=>{O.fire(H)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}c.fromPromise=C;function R(I,O){return I(H=>O.fire(H))}c.forward=R;function T(I,O,H){return O(H),I(P=>O(P))}c.runAndSubscribe=T;class B{constructor(O,H){this._observable=O,this._counter=0,this._hasChanged=!1;let P={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};H||u(P),this.emitter=new ae(P),H&&H.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,H){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function D(I,O){return new B(I,O).emitter.event}c.fromObservable=D;function F(I){return(O,H,P)=>{let b=0,E=!1,L={beginUpdate(){b++},endUpdate(){b--,b===0&&(I.reportChanges(),E&&(E=!1,O.call(H)))},handlePossibleChange(){},handleChange(){E=!0}};I.addObserver(L),I.reportChanges();let A={dispose(){I.removeObserver(L)}};return P instanceof vt?P.add(A):Array.isArray(P)&&P.push(A),A}}c.fromObservableLight=F})(gt||(gt={}));var dt=class ut{constructor(u){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${u}_${ut._idPool++}`,ut.all.add(this)}start(u){this._stopWatch=new Fi,this.listenerCount=u}stop(){if(this._stopWatch){let u=this._stopWatch.elapsed();this.durations.push(u),this.elapsedOverall+=u,this.invocationCount+=1,this._stopWatch=void 0}}};dt.all=new Set,dt._idPool=0;var Ui=dt,Mt=-1,zt=class qt{constructor(u,w,x=(qt._idPool++).toString(16).padStart(3,"0")){this._errorHandler=u,this.threshold=w,this.name=x,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(u,w){let x=this.threshold;if(x<=0||w<x)return;this._stacks||(this._stacks=new Map);let k=this._stacks.get(u.value)||0;if(this._stacks.set(u.value,k+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=x*.5;let[r,n]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${w} listeners already. MOST frequent listener (${n}):`;console.warn(a),console.warn(r);let _=new ji(a,r);this._errorHandler(_)}return()=>{let r=this._stacks.get(u.value)||0;this._stacks.set(u.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let u,w=0;for(let[x,k]of this._stacks)(!u||w<k)&&(u=[x,k],w=k);return u}};zt._idPool=1;var $i=zt,_t=class Kt{constructor(u){this.value=u}static create(){let u=new Error;return new Kt(u.stack??"")}print(){console.warn(this.value.split(`
31
+ `).slice(2).join(`
32
+ `))}},ji=class extends Error{constructor(c,u){super(c),this.name="ListenerLeakError",this.stack=u}},zi=class extends Error{constructor(c,u){super(c),this.name="ListenerRefusalError",this.stack=u}},qi=0,We=class{constructor(c){this.value=c,this.id=qi++}},Ki=2,Vi=(c,u)=>{if(c instanceof We)u(c);else for(let w=0;w<c.length;w++){let x=c[w];x&&u(x)}},Ne;if(Wi){let c=[];setInterval(()=>{c.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(c.join(`
33
+ `)),c.length=0)},3e3),Ne=new FinalizationRegistry(u=>{typeof u=="string"&&c.push(u)})}var ae=class{constructor(c){this._size=0,this._options=c,this._leakageMon=Mt>0||this._options?.leakWarningThreshold?new $i(c?.onListenerError??rt,this._options?.leakWarningThreshold??Mt):void 0,this._perfMon=this._options?._profName?new Ui(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Bt){let c=this._listeners;queueMicrotask(()=>{Vi(c,u=>u.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??(this._event=(c,u,w)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let _=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],o=new zi(`${a}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(this._options?.onListenerError||rt)(o),he.None}if(this._disposed)return he.None;u&&(c=c.bind(u));let x=new We(c),k,r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(x.stack=_t.create(),k=this._leakageMon.check(x.stack,this._size+1)),Bt&&(x.stack=r??_t.create()),this._listeners?this._listeners instanceof We?(this._deliveryQueue??(this._deliveryQueue=new Gi),this._listeners=[this._listeners,x]):this._listeners.push(x):(this._options?.onWillAddFirstListener?.(this),this._listeners=x,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=be(()=>{Ne?.unregister(n),k?.(),this._removeListener(x)});if(w instanceof vt?w.add(n):Array.isArray(w)&&w.push(n),Ne){let a=new Error().stack.split(`
34
+ `).slice(2,3).join(`
35
+ `).trim(),_=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);Ne.register(n,_?.[2]??a,n)}return n}),this._event}_removeListener(c){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let u=this._listeners,w=u.indexOf(c);if(w===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,u[w]=void 0;let x=this._deliveryQueue.current===this;if(this._size*Ki<=u.length){let k=0;for(let r=0;r<u.length;r++)u[r]?u[k++]=u[r]:x&&(this._deliveryQueue.end--,k<this._deliveryQueue.i&&this._deliveryQueue.i--);u.length=k}}_deliver(c,u){if(!c)return;let w=this._options?.onListenerError||rt;if(!w){c.value(u);return}try{c.value(u)}catch(x){w(x)}}_deliverQueue(c){let u=c.current._listeners;for(;c.i<c.end;)this._deliver(u[c.i++],c.value);c.reset()}fire(c){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof We)this._deliver(this._listeners,c);else{let u=this._deliveryQueue;u.enqueue(this,c,this._listeners.length),this._deliverQueue(u)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Gi=class{constructor(){this.i=-1,this.end=0}enqueue(c,u,w){this.i=0,this.end=w,this.current=c,this.value=u}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Vt=Object.freeze(function(c,u){let w=setTimeout(c.bind(u),0);return{dispose(){clearTimeout(w)}}}),Xi;(c=>{function u(w){return w===c.None||w===c.Cancelled||w instanceof Ji?!0:!w||typeof w!="object"?!1:typeof w.isCancellationRequested=="boolean"&&typeof w.onCancellationRequested=="function"}c.isCancellationToken=u,c.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:gt.None}),c.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Vt})})(Xi||(Xi={}));var Ji=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Vt:(this._emitter||(this._emitter=new ae),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},me="en",ft=!1,pt=!1,Ue=!1,Yi=!1,Zi=!1,Gt=!1,Qi=!1,es=!1,ts=!1,is=!1,Fe,$e=me,Ot=me,ss,ce,de=globalThis,ie;typeof de.vscode<"u"&&typeof de.vscode.process<"u"?ie=de.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ie=process);var Xt=typeof ie?.versions?.electron=="string",rs=Xt&&ie?.type==="renderer";if(typeof ie=="object"){ft=ie.platform==="win32",pt=ie.platform==="darwin",Ue=ie.platform==="linux",Yi=Ue&&!!ie.env.SNAP&&!!ie.env.SNAP_REVISION,Qi=Xt,ts=!!ie.env.CI||!!ie.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Fe=me,$e=me;let c=ie.env.VSCODE_NLS_CONFIG;if(c)try{let u=JSON.parse(c);Fe=u.userLocale,Ot=u.osLocale,$e=u.resolvedLanguage||me,ss=u.languagePack?.translationsConfigFile}catch{}Zi=!0}else typeof navigator=="object"&&!rs?(ce=navigator.userAgent,ft=ce.indexOf("Windows")>=0,pt=ce.indexOf("Macintosh")>=0,es=(ce.indexOf("Macintosh")>=0||ce.indexOf("iPad")>=0||ce.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ue=ce.indexOf("Linux")>=0,is=ce?.indexOf("Mobi")>=0,Gt=!0,$e=globalThis._VSCODE_NLS_LANGUAGE||me,Fe=navigator.language.toLowerCase(),Ot=Fe):console.error("Unable to resolve platform.");var nt=0;pt?nt=1:ft?nt=3:Ue&&(nt=2);var ns=Gt&&typeof de.importScripts=="function",Mr=ns?de.origin:void 0,le=ce,fe=$e,os;(c=>{function u(){return fe}c.value=u;function w(){return fe.length===2?fe==="en":fe.length>=3?fe[0]==="e"&&fe[1]==="n"&&fe[2]==="-":!1}c.isDefaultVariant=w;function x(){return fe==="en"}c.isDefault=x})(os||(os={}));var as=typeof de.postMessage=="function"&&!de.importScripts,hs=(()=>{if(as){let c=[];de.addEventListener("message",w=>{if(w.data&&w.data.vscodeScheduleAsyncWork)for(let x=0,k=c.length;x<k;x++){let r=c[x];if(r.id===w.data.vscodeScheduleAsyncWork){c.splice(x,1),r.callback();return}}});let u=0;return w=>{let x=++u;c.push({id:x,callback:w}),de.postMessage({vscodeScheduleAsyncWork:x},"*")}}return c=>setTimeout(c)})(),ls=!!(le&&le.indexOf("Chrome")>=0),Or=!!(le&&le.indexOf("Firefox")>=0),Ir=!!(!ls&&le&&le.indexOf("Safari")>=0),Pr=!!(le&&le.indexOf("Edg/")>=0),Hr=!!(le&&le.indexOf("Android")>=0),Fr=Symbol("MicrotaskDelay");function Jt(c,u=0,w){let x=setTimeout(()=>{c(),w&&k.dispose()},u),k=be(()=>{clearTimeout(x),w?.deleteAndLeak(k)});return w?.add(k),k}var cs,ot;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?ot=(c,u)=>{hs(()=>{if(w)return;let x=Date.now()+15;u(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,x-Date.now())}}))});let w=!1;return{dispose(){w||(w=!0)}}}:ot=(c,u,w)=>{let x=c.requestIdleCallback(u,typeof w=="number"?{timeout:w}:void 0),k=!1;return{dispose(){k||(k=!0,c.cancelIdleCallback(x))}}},cs=c=>ot(globalThis,c)})();var ds;(c=>{async function u(x){let k,r=await Promise.all(x.map(n=>n.then(a=>a,a=>{k||(k=a)})));if(typeof k<"u")throw k;return r}c.settled=u;function w(x){return new Promise(async(k,r)=>{try{await x(k,r)}catch(n){r(n)}})}c.withAsyncBody=w})(ds||(ds={}));var It=class re{static fromArray(u){return new re(w=>{w.emitMany(u)})}static fromPromise(u){return new re(async w=>{w.emitMany(await u)})}static fromPromises(u){return new re(async w=>{await Promise.all(u.map(async x=>w.emitOne(await x)))})}static merge(u){return new re(async w=>{await Promise.all(u.map(async x=>{for await(let k of x)w.emitOne(k)}))})}constructor(u,w){this._state=0,this._results=[],this._error=null,this._onReturn=w,this._onStateChanged=new ae,queueMicrotask(async()=>{let x={emitOne:k=>this.emitOne(k),emitMany:k=>this.emitMany(k),reject:k=>this.reject(k)};try{await Promise.resolve(u(x)),this.resolve()}catch(k){this.reject(k)}finally{x.emitOne=void 0,x.emitMany=void 0,x.reject=void 0}})}[Symbol.asyncIterator](){let u=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(u<this._results.length)return{done:!1,value:this._results[u++]};if(this._state===1)return{done:!0,value:void 0};await gt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(u,w){return new re(async x=>{for await(let k of u)x.emitOne(w(k))})}map(u){return re.map(this,u)}static filter(u,w){return new re(async x=>{for await(let k of u)w(k)&&x.emitOne(k)})}filter(u){return re.filter(this,u)}static coalesce(u){return re.filter(u,w=>!!w)}coalesce(){return re.coalesce(this)}static async toPromise(u){let w=[];for await(let x of u)w.push(x);return w}toPromise(){return re.toPromise(this)}emitOne(u){this._state===0&&(this._results.push(u),this._onStateChanged.fire())}emitMany(u){this._state===0&&(this._results=this._results.concat(u),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(u){this._state===0&&(this._state=2,this._error=u,this._onStateChanged.fire())}};It.EMPTY=It.fromArray([]);var us=class extends he{constructor(c){super(),this._terminal=c,this._linesCacheTimeout=this._register(new je),this._linesCacheDisposables=this._register(new je),this._register(be(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=Nt(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=Jt(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(c){return this._linesCache?.[c]}setLineInCache(c,u){this._linesCache&&(this._linesCache[c]=u)}translateBufferLineToStringWithWrap(c,u){let w=[],x=[0],k=this._terminal.buffer.active.getLine(c);for(;k;){let r=this._terminal.buffer.active.getLine(c+1),n=r?r.isWrapped:!1,a=k.translateToString(!n&&u);if(n&&r){let _=k.getCell(k.length-1);_&&_.getCode()===0&&_.getWidth()===1&&r.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(w.push(a),n)x.push(x[x.length-1]+a.length);else break;c++,k=r}return[w.join(""),x]}},_s=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(c){this._cachedSearchTerm=c}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(c){this._lastSearchOptions=c}isValidSearchTerm(c){return!!(c&&c.length>0)}didOptionsChange(c){return this._lastSearchOptions?c?this._lastSearchOptions.caseSensitive!==c.caseSensitive||this._lastSearchOptions.regex!==c.regex||this._lastSearchOptions.wholeWord!==c.wholeWord:!1:!0}shouldUpdateHighlighting(c,u){return u?.decorations?this._cachedSearchTerm===void 0||c!==this._cachedSearchTerm||this.didOptionsChange(u):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},fs=class{constructor(c,u){this._terminal=c,this._lineCache=u}find(c,u,w,x){if(!c||c.length===0){this._terminal.clearSelection();return}if(w>this._terminal.cols)throw new Error(`Invalid col: ${w} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let k={startRow:u,startCol:w},r=this._findInLine(c,k,x);if(!r)for(let n=u+1;n<this._terminal.buffer.active.baseY+this._terminal.rows&&(k.startRow=n,k.startCol=0,r=this._findInLine(c,k,x),!r);n++);return r}findNextWithSelection(c,u,w){if(!c||c.length===0){this._terminal.clearSelection();return}let x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let k=0,r=0;x&&(w===c?(k=x.end.x,r=x.end.y):(k=x.start.x,r=x.start.y)),this._lineCache.initLinesCache();let n={startRow:r,startCol:k},a=this._findInLine(c,n,u);if(!a)for(let _=r+1;_<this._terminal.buffer.active.baseY+this._terminal.rows&&(n.startRow=_,n.startCol=0,a=this._findInLine(c,n,u),!a);_++);if(!a&&r!==0)for(let _=0;_<r&&(n.startRow=_,n.startCol=0,a=this._findInLine(c,n,u),!a);_++);return!a&&x&&(n.startRow=x.start.y,n.startCol=0,a=this._findInLine(c,n,u)),a}findPreviousWithSelection(c,u,w){if(!c||c.length===0){this._terminal.clearSelection();return}let x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let k=this._terminal.buffer.active.baseY+this._terminal.rows-1,r=this._terminal.cols,n=!0;this._lineCache.initLinesCache();let a={startRow:k,startCol:r},_;if(x&&(a.startRow=k=x.start.y,a.startCol=r=x.start.x,w!==c&&(_=this._findInLine(c,a,u,!1),_||(a.startRow=k=x.end.y,a.startCol=r=x.end.x))),_||(_=this._findInLine(c,a,u,n)),!_){a.startCol=Math.max(a.startCol,this._terminal.cols);for(let o=k-1;o>=0&&(a.startRow=o,_=this._findInLine(c,a,u,n),!_);o--);}if(!_&&k!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let o=this._terminal.buffer.active.baseY+this._terminal.rows-1;o>=k&&(a.startRow=o,_=this._findInLine(c,a,u,n),!_);o--);return _}_isWholeWord(c,u,w){return(c===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(u[c-1]))&&(c+w.length===u.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(u[c+w.length]))}_findInLine(c,u,w={},x=!1){let k=u.startRow,r=u.startCol;if(this._terminal.buffer.active.getLine(k)?.isWrapped){if(x){u.startCol+=this._terminal.cols;return}return u.startRow--,u.startCol+=this._terminal.cols,this._findInLine(c,u,w)}let n=this._lineCache.getLineFromCache(k);n||(n=this._lineCache.translateBufferLineToStringWithWrap(k,!0),this._lineCache.setLineInCache(k,n));let[a,_]=n,o=this._bufferColsToStringOffset(k,r),f=c,v=a;w.regex||(f=w.caseSensitive?c:c.toLowerCase(),v=w.caseSensitive?a:a.toLowerCase());let S=-1;if(w.regex){let d=RegExp(f,w.caseSensitive?"g":"gi"),t;if(x)for(;t=d.exec(v.slice(0,o));)S=d.lastIndex-t[0].length,c=t[0],d.lastIndex-=c.length-1;else t=d.exec(v.slice(o)),t&&t[0].length>0&&(S=o+(d.lastIndex-t[0].length),c=t[0])}else x?o-f.length>=0&&(S=v.lastIndexOf(f,o-f.length)):S=v.indexOf(f,o);if(S>=0){if(w.wholeWord&&!this._isWholeWord(S,v,c))return;let d=0;for(;d<_.length-1&&S>=_[d+1];)d++;let t=d;for(;t<_.length-1&&S+c.length>=_[t+1];)t++;let s=S-_[d],e=S+c.length-_[t],i=this._stringLengthToBufferSize(k+d,s),h=this._stringLengthToBufferSize(k+t,e)-i+this._terminal.cols*(t-d);return{term:c,col:i,row:k+d,size:h}}}_stringLengthToBufferSize(c,u){let w=this._terminal.buffer.active.getLine(c);if(!w)return 0;for(let x=0;x<u;x++){let k=w.getCell(x);if(!k)break;let r=k.getChars();r.length>1&&(u-=r.length-1);let n=w.getCell(x+1);n&&n.getWidth()===0&&u++}return u}_bufferColsToStringOffset(c,u){let w=c,x=0,k=this._terminal.buffer.active.getLine(w);for(;u>0&&k;){for(let r=0;r<u&&r<this._terminal.cols;r++){let n=k.getCell(r);if(!n)break;n.getWidth()&&(x+=n.getCode()===0?1:n.getChars().length)}if(w++,k=this._terminal.buffer.active.getLine(w),k&&!k.isWrapped)break;u-=this._terminal.cols}return x}},ps=class extends he{constructor(c){super(),this._terminal=c,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(be(()=>this.clearHighlightDecorations()))}createHighlightDecorations(c,u){this.clearHighlightDecorations();for(let w of c){let x=this._createResultDecorations(w,u,!1);if(x)for(let k of x)this._storeDecoration(k,w)}}createActiveDecoration(c,u){let w=this._createResultDecorations(c,u,!0);if(w)return{decorations:w,match:c,dispose(){De(w)}}}clearHighlightDecorations(){De(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(c,u){this._highlightedLines.add(c.marker.line),this._highlightDecorations.push({decoration:c,match:u,dispose(){c.dispose()}})}_applyStyles(c,u,w){c.classList.contains("xterm-find-result-decoration")||(c.classList.add("xterm-find-result-decoration"),u&&(c.style.outline=`1px solid ${u}`)),w&&c.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(c,u,w){let x=[],k=c.col,r=c.size,n=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+c.row;for(;r>0;){let _=Math.min(this._terminal.cols-k,r);x.push([n,k,_]),k=0,r-=_,n++}let a=[];for(let _ of x){let o=this._terminal.registerMarker(_[0]),f=this._terminal.registerDecoration({marker:o,x:_[1],width:_[2],backgroundColor:w?u.activeMatchBackground:u.matchBackground,overviewRulerOptions:this._highlightedLines.has(o.line)?void 0:{color:w?u.activeMatchColorOverviewRuler:u.matchOverviewRuler,position:"center"}});if(f){let v=[];v.push(o),v.push(f.onRender(S=>this._applyStyles(S,w?u.activeMatchBorder:u.matchBorder,!1))),v.push(f.onDispose(()=>De(v))),a.push(f)}}return a.length===0?void 0:a}},vs=class extends he{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new ae)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(c){this._selectedDecoration=c}updateResults(c,u){this._searchResults=c.slice(0,u)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(c){for(let u=0;u<this._searchResults.length;u++){let w=this._searchResults[u];if(w.row===c.row&&w.col===c.col&&w.size===c.size)return u}return-1}fireResultsChanged(c){if(!c)return;let u=-1;this._selectedDecoration&&(u=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:u,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},Yt=class extends he{constructor(c){super(),this._highlightTimeout=this._register(new je),this._lineCache=this._register(new je),this._state=new _s,this._resultTracker=this._register(new vs),this._highlightLimit=c?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(c){this._terminal=c,this._lineCache.value=new us(c),this._engine=new fs(c,this._lineCache.value),this._decorationManager=new ps(c),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(be(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=Jt(()=>{let c=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(c,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(c){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),c||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(c,u,w){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=u,this._state.shouldUpdateHighlighting(c,u)&&this._highlightAllMatches(c,u);let x=this._findNextAndSelect(c,u,w);return this._fireResults(u),this._state.cachedSearchTerm=c,x}_highlightAllMatches(c,u){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(c)){this.clearDecorations();return}this.clearDecorations(!0);let w=[],x,k=this._engine.find(c,0,0,u);for(;k&&(x?.row!==k.row||x?.col!==k.col)&&!(w.length>=this._highlightLimit);)x=k,w.push(x),k=this._engine.find(c,x.col+x.term.length>=this._terminal.cols?x.row+1:x.row,x.col+x.term.length>=this._terminal.cols?0:x.col+1,u);this._resultTracker.updateResults(w,this._highlightLimit),u.decorations&&this._decorationManager.createHighlightDecorations(w,u.decorations)}_findNextAndSelect(c,u,w){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(c))return this._terminal.clearSelection(),this.clearDecorations(),!1;let x=this._engine.findNextWithSelection(c,u,this._state.cachedSearchTerm);return this._selectResult(x,u?.decorations,w?.noScroll)}findPrevious(c,u,w){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=u,this._state.shouldUpdateHighlighting(c,u)&&this._highlightAllMatches(c,u);let x=this._findPreviousAndSelect(c,u,w);return this._fireResults(u),this._state.cachedSearchTerm=c,x}_fireResults(c){this._resultTracker.fireResultsChanged(!!c?.decorations)}_findPreviousAndSelect(c,u,w){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(c))return this._terminal.clearSelection(),this.clearDecorations(),!1;let x=this._engine.findPreviousWithSelection(c,u,this._state.cachedSearchTerm);return this._selectResult(x,u?.decorations,w?.noScroll)}_selectResult(c,u,w){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!c)return this._terminal.clearSelection(),!1;if(this._terminal.select(c.col,c.row,c.size),u){let x=this._decorationManager.createActiveDecoration(c,u);x&&(this._resultTracker.selectedDecoration=x)}if(!w&&(c.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||c.row<this._terminal.buffer.active.viewportY)){let x=c.row-this._terminal.buffer.active.viewportY;x-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(x)}return!0}};var gs=class{constructor(c,u,w,x={}){this._terminal=c,this._regex=u,this._handler=w,this._options=x}provideLinks(c,u){let w=Ss.computeLink(c,this._regex,this._terminal,this._handler);u(this._addCallbacks(w))}_addCallbacks(c){return c.map(u=>(u.leave=this._options.leave,u.hover=(w,x)=>{if(this._options.hover){let{range:k}=u;this._options.hover(w,x,k)}},u))}};function ms(c){try{let u=new URL(c),w=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return c.toLocaleLowerCase().startsWith(w.toLocaleLowerCase())}catch{return!1}}var Ss=class Ke{static computeLink(u,w,x,k){let r=new RegExp(w.source,(w.flags||"")+"g"),[n,a]=Ke._getWindowedLineStrings(u-1,x),_=n.join(""),o,f=[];for(;o=r.exec(_);){let v=o[0];if(!ms(v))continue;let[S,d]=Ke._mapStrIdx(x,a,0,o.index),[t,s]=Ke._mapStrIdx(x,S,d,v.length);if(S===-1||d===-1||t===-1||s===-1)continue;let e={start:{x:d+1,y:S+1},end:{x:s,y:t+1}};f.push({range:e,text:v,activate:k})}return f}static _getWindowedLineStrings(u,w){let x,k=u,r=u,n=0,a="",_=[];if(x=w.buffer.active.getLine(u)){let o=x.translateToString(!0);if(x.isWrapped&&o[0]!==" "){for(n=0;(x=w.buffer.active.getLine(--k))&&n<2048&&(a=x.translateToString(!0),n+=a.length,_.push(a),!(!x.isWrapped||a.indexOf(" ")!==-1)););_.reverse()}for(_.push(o),n=0;(x=w.buffer.active.getLine(++r))&&x.isWrapped&&n<2048&&(a=x.translateToString(!0),n+=a.length,_.push(a),a.indexOf(" ")===-1););}return[_,k]}static _mapStrIdx(u,w,x,k){let r=u.buffer.active,n=r.getNullCell(),a=x;for(;k;){let _=r.getLine(w);if(!_)return[-1,-1];for(let o=a;o<_.length;++o){_.getCell(o,n);let f=n.getChars();if(n.getWidth()&&(k-=f.length||1,o===_.length-1&&f==="")){let v=r.getLine(w+1);v&&v.isWrapped&&(v.getCell(0,n),n.getWidth()===2&&(k+=1))}if(k<0)return[w,o]}w++,a=0}return[w,a]}},bs=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function Cs(c,u){let w=window.open();if(w){try{w.opener=null}catch{}w.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}var Zt=class{constructor(c=Cs,u={}){this._handler=c,this._options=u}activate(c){this._terminal=c;let u=this._options,w=u.urlRegex||bs;this._linkProvider=this._terminal.registerLinkProvider(new gs(this._terminal,w,this._handler,u))}dispose(){this._linkProvider?.dispose()}};var Qt=`/**
36
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
37
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
38
+ * https://github.com/chjj/term.js
39
+ * @license MIT
40
+ *
41
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
42
+ * of this software and associated documentation files (the "Software"), to deal
43
+ * in the Software without restriction, including without limitation the rights
44
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45
+ * copies of the Software, and to permit persons to whom the Software is
46
+ * furnished to do so, subject to the following conditions:
47
+ *
48
+ * The above copyright notice and this permission notice shall be included in
49
+ * all copies or substantial portions of the Software.
50
+ *
51
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
57
+ * THE SOFTWARE.
58
+ *
59
+ * Originally forked from (with the author's permission):
60
+ * Fabrice Bellard's javascript vt100 for jslinux:
61
+ * http://bellard.org/jslinux/
62
+ * Copyright (c) 2011 Fabrice Bellard
63
+ * The original design remains. The terminal itself
64
+ * has been extended to include xterm CSI codes, among
65
+ * other features.
66
+ */
67
+
68
+ /**
69
+ * Default styles for xterm.js
70
+ */
71
+
72
+ .xterm {
73
+ cursor: text;
74
+ position: relative;
75
+ user-select: none;
76
+ -ms-user-select: none;
77
+ -webkit-user-select: none;
78
+ }
79
+
80
+ .xterm.focus,
81
+ .xterm:focus {
82
+ outline: none;
83
+ }
84
+
85
+ .xterm .xterm-helpers {
86
+ position: absolute;
87
+ top: 0;
88
+ /**
89
+ * The z-index of the helpers must be higher than the canvases in order for
90
+ * IMEs to appear on top.
91
+ */
92
+ z-index: 5;
93
+ }
94
+
95
+ .xterm .xterm-helper-textarea {
96
+ padding: 0;
97
+ border: 0;
98
+ margin: 0;
99
+ /* Move textarea out of the screen to the far left, so that the cursor is not visible */
100
+ position: absolute;
101
+ opacity: 0;
102
+ left: -9999em;
103
+ top: 0;
104
+ width: 0;
105
+ height: 0;
106
+ z-index: -5;
107
+ /** Prevent wrapping so the IME appears against the textarea at the correct position */
108
+ white-space: nowrap;
109
+ overflow: hidden;
110
+ resize: none;
111
+ }
112
+
113
+ .xterm .composition-view {
114
+ /* TODO: Composition position got messed up somewhere */
115
+ background: #000;
116
+ color: #FFF;
117
+ display: none;
118
+ position: absolute;
119
+ white-space: nowrap;
120
+ z-index: 1;
121
+ }
122
+
123
+ .xterm .composition-view.active {
124
+ display: block;
125
+ }
126
+
127
+ .xterm .xterm-viewport {
128
+ /* On OS X this is required in order for the scroll bar to appear fully opaque */
129
+ background-color: #000;
130
+ overflow-y: scroll;
131
+ cursor: default;
132
+ position: absolute;
133
+ right: 0;
134
+ left: 0;
135
+ top: 0;
136
+ bottom: 0;
137
+ }
138
+
139
+ .xterm .xterm-screen {
140
+ position: relative;
141
+ }
142
+
143
+ .xterm .xterm-screen canvas {
144
+ position: absolute;
145
+ left: 0;
146
+ top: 0;
147
+ }
148
+
149
+ .xterm .xterm-scroll-area {
150
+ visibility: hidden;
151
+ }
152
+
153
+ .xterm-char-measure-element {
154
+ display: inline-block;
155
+ visibility: hidden;
156
+ position: absolute;
157
+ top: 0;
158
+ left: -9999em;
159
+ line-height: normal;
160
+ }
161
+
162
+ .xterm.enable-mouse-events {
163
+ /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
164
+ cursor: default;
165
+ }
166
+
167
+ .xterm.xterm-cursor-pointer,
168
+ .xterm .xterm-cursor-pointer {
169
+ cursor: pointer;
170
+ }
171
+
172
+ .xterm.column-select.focus {
173
+ /* Column selection mode */
174
+ cursor: crosshair;
175
+ }
176
+
177
+ .xterm .xterm-accessibility:not(.debug),
178
+ .xterm .xterm-message {
179
+ position: absolute;
180
+ left: 0;
181
+ top: 0;
182
+ bottom: 0;
183
+ right: 0;
184
+ z-index: 10;
185
+ color: transparent;
186
+ pointer-events: none;
187
+ }
188
+
189
+ .xterm .xterm-accessibility-tree:not(.debug) *::selection {
190
+ color: transparent;
191
+ }
192
+
193
+ .xterm .xterm-accessibility-tree {
194
+ user-select: text;
195
+ white-space: pre;
196
+ }
197
+
198
+ .xterm .live-region {
199
+ position: absolute;
200
+ left: -9999px;
201
+ width: 1px;
202
+ height: 1px;
203
+ overflow: hidden;
204
+ }
205
+
206
+ .xterm-dim {
207
+ /* Dim should not apply to background, so the opacity of the foreground color is applied
208
+ * explicitly in the generated class and reset to 1 here */
209
+ opacity: 1 !important;
210
+ }
211
+
212
+ .xterm-underline-1 { text-decoration: underline; }
213
+ .xterm-underline-2 { text-decoration: double underline; }
214
+ .xterm-underline-3 { text-decoration: wavy underline; }
215
+ .xterm-underline-4 { text-decoration: dotted underline; }
216
+ .xterm-underline-5 { text-decoration: dashed underline; }
217
+
218
+ .xterm-overline {
219
+ text-decoration: overline;
220
+ }
221
+
222
+ .xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
223
+ .xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
224
+ .xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
225
+ .xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
226
+ .xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
227
+
228
+ .xterm-strikethrough {
229
+ text-decoration: line-through;
230
+ }
231
+
232
+ .xterm-screen .xterm-decoration-container .xterm-decoration {
233
+ z-index: 6;
234
+ position: absolute;
235
+ }
236
+
237
+ .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
238
+ z-index: 7;
239
+ }
240
+
241
+ .xterm-decoration-overview-ruler {
242
+ z-index: 8;
243
+ position: absolute;
244
+ top: 0;
245
+ right: 0;
246
+ pointer-events: none;
247
+ }
248
+
249
+ .xterm-decoration-top {
250
+ z-index: 2;
251
+ position: relative;
252
+ }
253
+ `;var ys=[".tt_sidebarEntry{width:100%;height:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:8px;align-items:center;gap:8px;padding:0 12px;font-size:13px;display:flex}",".tt_sidebarEntry:hover{background:var(--dsw-specific-sidebar-nav-item-hover);color:var(--dsw-alias-label-primary)}",".tt_sidebarEntry[data-active]{background:var(--dsw-specific-sidebar-nav-item-active);color:var(--dsw-alias-label-primary);font-weight:600}",".tt_sidebarEntryIcon{flex:none;justify-content:center;align-items:center;display:inline-flex}",".tt_sidebarEntryLabel{text-overflow:ellipsis;overflow:hidden}","[data-sidebar-collapsed] .tt_sidebarEntry{justify-content:center;width:100%;padding:0}","[data-sidebar-collapsed] .tt_sidebarEntryLabel{display:none}",".tt_modalBackdrop{z-index:1300;background:var(--dsw-alias-bg-mask-1);justify-content:center;align-items:flex-start;display:flex;position:fixed;inset:0;padding-top:5vh}",".tt_modal{background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l2);width:min(1180px,96vw);height:min(84vh,920px);box-shadow:var(--dsw-shadow-lv3);color:var(--dsw-alias-label-primary);border-radius:14px;flex-direction:column;gap:0;display:flex;overflow:hidden}",".tt_header{flex:none;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid var(--dsw-alias-border-l1);display:flex}",".tt_title{flex:1;margin:0;font-size:14px;font-weight:600;white-space:nowrap;align-items:center;gap:8px;display:flex}",".tt_status{font-size:11px;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;display:flex;white-space:nowrap}",".tt_statusDot{width:8px;height:8px;border-radius:50%;background:var(--dsw-alias-label-tertiary);flex:none}",".tt_statusDot[data-state=connected]{background:var(--dsw-alias-state-success-primary)}",".tt_statusDot[data-state=error]{background:var(--dsw-alias-state-error-primary)}",".tt_toolBtn{appearance:none;background:0 0;border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);border-radius:8px;height:28px;padding:0 10px;cursor:pointer;font-size:12px;flex:none;white-space:nowrap}",".tt_toolBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".tt_searchInput{width:120px;height:28px;background:var(--dsw-specific-input-major);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;color:inherit;font:inherit;font-size:12px;padding:0 8px;flex:none}",".tt_searchInput:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}",".tt_close{appearance:none;background:0 0;border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);border-radius:8px;width:30px;height:30px;cursor:pointer;font-size:16px;line-height:1;flex:none}",".tt_close:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".tt_tabbar{flex:none;display:flex;align-items:center;gap:6px;padding:6px 12px;border-bottom:1px solid var(--dsw-alias-border-l1);overflow-x:auto}",".tt_tab{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 8px 0 12px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-size:12px;cursor:pointer;flex:none;white-space:nowrap}",".tt_tab:hover{color:var(--dsw-alias-label-primary)}",".tt_tab[data-active]{background:var(--dsw-specific-sidebar-nav-item-active);color:var(--dsw-alias-label-primary);font-weight:600}",".tt_tabClose{appearance:none;background:0 0;border:none;color:inherit;cursor:pointer;font-size:13px;line-height:1;padding:0 2px}",".tt_tabClose:hover{color:var(--dsw-alias-state-error-primary)}",".tt_tabAdd{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px dashed var(--dsw-alias-border-l2);border-radius:8px;background:0 0;color:var(--dsw-alias-label-secondary);font-size:16px;cursor:pointer;flex:none}",".tt_tabAdd:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-secondary)}",".tt_body{flex:1;min-height:0;position:relative;background:#0d1117;overflow:hidden}",".tt_term{position:absolute;inset:0;padding:8px 10px}",".tt_term .xterm{height:100%}",".tt_overlay{position:absolute;inset:0;align-items:center;justify-content:center;background:rgba(0,0,0,.55);color:#e6edf3;font-size:13px;cursor:pointer;display:flex;z-index:5}",".tt_overlay:empty{display:none}",".tt_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}",".tt_card:hover{border-color:var(--dsw-alias-label-dimmed)}",".tt_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}",".tt_cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}",".tt_cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}",".tt_cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}",".tt_cardDescription{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}",".tt_cardChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}",".tt_cardChevronOpen{transform:rotate(180deg)}",".tt_cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}",".tt_cardField{flex-direction:column;gap:6px;padding:12px 0;display:flex}",".tt_cardField+.tt_cardField{border-top:1px solid var(--dsw-alias-border-l2)}",".tt_cardLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}",".tt_cardInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5;box-sizing:border-box}",".tt_cardInput:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}",".tt_cardCheckbox{width:16px;height:16px;accent-color:var(--dsw-alias-state-business-primary)}",".tt_cardRow{align-items:center;gap:8px;display:flex;flex-direction:row}",".tt_cardHint{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:1.5;margin-top:2px}",".tt_cardSave{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border:1px solid transparent}",".tt_cardSave:disabled{opacity:.4;cursor:default}",".tt_cardMessage{margin:8px 0 0;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}",".tt_cardMessageOk{color:var(--dsw-alias-state-success-primary)}",".tt_cardMessageError{color:var(--dsw-alias-state-error-primary)}"].join(`
254
+ `),Es="/api/dsh-tty/ws";function xs(){return(location.protocol==="https:"?"wss:":"ws:")+"//"+location.host+Es}function ni(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"t"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}var Ve;function oi(){document.getElementById("dsh-tty-style")||(Ve=document.createElement("style"),Ve.id="dsh-tty-style",Ve.textContent=ys+`
255
+ `+Qt,document.head.appendChild(Ve))}var ai='<svg viewBox="0 0 16 16" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 5l3.5 3L3 11"/><path d="M8.5 11H13"/></svg>',hi=null,te=null,Z=null,Xe=null,St=null,Ce=null,we=null,ne=null,ye=null,mt=!1,Be=null,Q=new Map,ge=null,li=0,Ge=!1;function ve(c,u){Xe!==null&&(Xe.textContent=c,St.dataset.state=u)}function pe(c){te!==null&&te.readyState===WebSocket.OPEN&&te.send(JSON.stringify(c))}function Te(){return ge!==null?Q.get(ge):void 0}function ci(){try{let c=hi?.list?.getSnapshot?.(),u=c?.byId?.[c?.current]?.cwd;return typeof u=="string"&&u!==""?u:void 0}catch{return}}function bt(c){if(c===void 0||c.fit===void 0)return;let u=c.fit.proposeDimensions();u!==void 0&&pe({t:"resize",sid:c.sid,cols:u.cols,rows:u.rows})}function Ae(c,u){c.overlayEl===null||c.overlayEl===void 0||(c.overlayEl.textContent=u)}function di(c){let u=new si.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"SF Mono", Menlo, Consolas, "Courier New", monospace',scrollback:5e3,convertEol:!1,allowProposedApi:!0}),w=new ri.FitAddon,x=new Yt;u.loadAddon(w),u.loadAddon(x),u.loadAddon(new Zt);let k=document.createElement("div");k.className="tt_term";let r=document.createElement("div");r.className="tt_overlay",r.addEventListener("click",()=>{r.textContent="",ks(c.sid)}),k.appendChild(r),u.open(k);try{w.fit()}catch{}u.onData(n=>{pe({t:"input",sid:c.sid,d:n})}),u.attachCustomKeyEventHandler(n=>(n.ctrlKey||n.metaKey)&&n.key.toLowerCase()==="f"?(n.preventDefault(),_i(),!1):!0),c.term=u,c.fit=w,c.search=x,c.termEl=k,c.overlayEl=r}function ui(){let c=ni(),u={sid:c,term:null,fit:null,search:null,termEl:null,overlayEl:null,exited:!1,spawned:!1};di(u),Q.set(c,u),li+=1,Ye(),Je(c);let w=u.fit.proposeDimensions();return pe({t:"spawn",sid:c,cols:w!==void 0?w.cols:80,rows:w!==void 0?w.rows:24,cwd:ci()}),u}function ks(c){let u=Q.get(c);if(u===void 0)return;if(u.exited||pe({t:"kill",sid:c}),u.term!==null)try{u.term.dispose()}catch{}u.termEl!==null&&u.termEl.remove(),Q.delete(c);let w={sid:ni(),term:null,fit:null,search:null,termEl:null,overlayEl:null,exited:!1,spawned:!1};di(w),Q.set(w.sid,w),Ye(),Je(w.sid);let x=w.fit.proposeDimensions();pe({t:"spawn",sid:w.sid,cols:x!==void 0?x.cols:80,rows:x!==void 0?x.rows:24,cwd:ci()})}function Ls(c){let u=Q.get(c);if(u!==void 0){if(u.exited||pe({t:"kill",sid:c}),Q.delete(c),u.term!==null)try{u.term.dispose()}catch{}if(u.termEl!==null&&u.termEl.remove(),ge===c){ge=null;let w=[...Q.keys()].pop()??null;w!==null&&Je(w)}Ye(),Q.size===0&&Me()}}function Je(c){let u=Q.get(c);if(u!==void 0){ge=c;for(let[w,x]of Q)x.termEl!==null&&(x.termEl.style.display=w===c?"":"none");we!==null&&u.termEl!==null&&u.termEl.parentElement!==we&&we.appendChild(u.termEl),Ye();try{u.fit.fit()}catch{}u.spawned&&!u.exited&&bt(u),Ae(u,u.exited?"\u4F1A\u8BDD\u5DF2\u9000\u51FA \u2014 \u70B9\u51FB\u91CD\u65B0\u6253\u5F00":"")}}function Ye(){if(Ce===null)return;Ce.textContent="";for(let[u,w]of Q){let x=document.createElement("button");x.className="tt_tab",u===ge&&(x.dataset.active=""),x.innerHTML="<span>\u7EC8\u7AEF "+Ds(u)+'</span><span class="tt_tabClose" title="\u5173\u95ED">\u2715</span>',x.addEventListener("click",k=>{if(k.target.closest(".tt_tabClose")!==null){k.stopPropagation(),Ls(u);return}Je(u)}),Ce.appendChild(x)}let c=document.createElement("button");c.className="tt_tabAdd",c.title="\u65B0\u5EFA\u7EC8\u7AEF",c.textContent="+",c.addEventListener("click",()=>{ui()}),Ce.appendChild(c)}function Ds(c){let u=1;for(let w of Q.keys()){if(w===c)return String(u);u+=1}return String(u)}function _i(){if(ne===null)return;let c=ne.style.display==="none"||ne.style.display==="";ne.style.display=c?"":"none",c&&ne.focus()}var Rs={matchBackground:"#3d2b00",matchBorder:"#8a5a00",activeMatchBackground:"#b06a00",activeMatchBorder:"#ffb84d",matchOverviewRuler:"#8a5a00",activeMatchColorOverviewRuler:"#ffb84d"};function Ts(c){let u=Te();if(u===void 0||u.search===void 0)return;let w=ne.value;if(w==="")return;let x={decorations:Rs};c?u.search.findPrevious(w,x):u.search.findNext(w,x)}function ei(){if(te!==null){try{te.close()}catch{}te=null}mt=!1,Ge=!0,ve("\u8FDE\u63A5\u4E2D\u2026","");try{te=new WebSocket(xs())}catch(c){Ge=!1,ve("\u8FDE\u63A5\u5931\u8D25\uFF1A"+c.message,"error"),ti("\u70B9\u51FB\u91CD\u8BD5");return}te.onopen=()=>{Ge=!1,ve("\u5DF2\u8FDE\u63A5","connected"),Q.size===0&&ui()},te.onmessage=c=>{let u;try{u=JSON.parse(c.data)}catch{return}let w=u.sid;if(u.t==="ready"){ve("\u5DF2\u8FDE\u63A5 pid="+u.pid,"connected");let x=Q.get(w);x!==void 0&&(x.exited=!1,x.spawned=!0,Ae(x,""),bt(x))}else if(u.t==="data"){let x=Q.get(w);x!==void 0&&x.term!==null&&x.term.write(String(u.d??""))}else if(u.t==="exit"){let x=Q.get(w);if(x!==void 0){x.exited=!0;let k=u.code!==null&&u.code!==void 0?"code="+u.code:"",r=u.signal!==null&&u.signal!==void 0?"signal="+u.signal:"";ve("\u5DF2\u9000\u51FA "+[k,r].filter(Boolean).join(" "),""),Ae(x,"\u4F1A\u8BDD\u5DF2\u9000\u51FA \u2014 \u70B9\u51FB\u91CD\u65B0\u6253\u5F00")}}else if(u.t==="error")if(ve("\u9519\u8BEF\uFF1A"+String(u.m??""),"error"),typeof w=="string"){let x=Q.get(w);x!==void 0&&Ae(x,"\u9519\u8BEF\uFF1A"+String(u.m??"")+" \u2014 \u70B9\u51FB\u91CD\u8BD5")}else ti("\u70B9\u51FB\u91CD\u8BD5")},te.onclose=()=>{if(Ge=!1,!mt){ve("\u8FDE\u63A5\u65AD\u5F00","error");for(let c of Q.values())c.exited=!0,Ae(c,"\u8FDE\u63A5\u65AD\u5F00 \u2014 \u70B9\u51FB\u91CD\u65B0\u8FDE\u63A5")}},te.onerror=()=>{}}function ti(c){ye!==null&&(ye.textContent=c)}function As(){Z===null&&(oi(),Z=document.createElement("div"),Z.className="tt_modalBackdrop",Z.innerHTML='<div class="tt_modal"><div class="tt_header"><div class="tt_title">'+ai+'<span>\u7EC8\u7AEF</span></div><div class="tt_status"><span class="tt_statusDot"></span><span class="tt_statusText">\u521D\u59CB\u5316\u2026</span></div><input class="tt_searchInput" style="display:none" placeholder="\u641C\u7D22 (Enter \u4E0B\u4E00\u4E2A, Shift+Enter \u4E0A\u4E00\u4E2A)" /><button class="tt_toolBtn" data-act="search" title="\u641C\u7D22 (Ctrl+F)">\u641C\u7D22</button><button class="tt_toolBtn" data-act="clear" title="\u6E05\u5C4F">\u6E05\u5C4F</button><button class="tt_toolBtn" data-act="copy" title="\u590D\u5236\u9009\u4E2D\u5185\u5BB9">\u590D\u5236</button><button class="tt_toolBtn" data-act="paste" title="\u7C98\u8D34">\u7C98\u8D34</button><button class="tt_close" title="\u5173\u95ED\u7EC8\u7AEF">\u2715</button></div><div class="tt_tabbar"></div><div class="tt_body"><div class="tt_overlay"></div></div></div>',document.body.appendChild(Z),Xe=Z.querySelector(".tt_statusText"),St=Z.querySelector(".tt_statusDot"),Ce=Z.querySelector(".tt_tabbar"),we=Z.querySelector(".tt_body"),ye=Z.querySelector(".tt_body > .tt_overlay"),ne=Z.querySelector(".tt_searchInput"),ye.addEventListener("click",()=>{ye.textContent="",ei()}),Z.querySelector("[data-act=search]").addEventListener("click",()=>{_i(),ne.style.display!=="none"&&ne.focus()}),ne.addEventListener("keydown",c=>{c.key==="Enter"?(c.preventDefault(),Ts(c.shiftKey)):c.key==="Escape"&&(ne.style.display="none")}),Z.querySelector("[data-act=clear]").addEventListener("click",()=>{let c=Te();c!==void 0&&c.term!==null&&c.term.clear()}),Z.querySelector("[data-act=copy]").addEventListener("click",()=>{let c=Te();if(c===void 0||c.term===null)return;let u=c.term.getSelection();u!==""&&navigator.clipboard.writeText(u).catch(()=>{})}),Z.querySelector("[data-act=paste]").addEventListener("click",()=>{let c=Te();c!==void 0&&navigator.clipboard.readText().then(u=>{pe({t:"input",sid:c.sid,d:u})}).catch(()=>{})}),Z.querySelector(".tt_close").addEventListener("click",()=>{Me()}),Z.addEventListener("mousedown",c=>{c.target===Z&&Me()}),document.addEventListener("keydown",fi),Be=new ResizeObserver(()=>{let c=Te();if(c!==void 0&&c.fit!==void 0){try{c.fit.fit()}catch{return}c.exited||bt(c)}}),Be.observe(we),ei())}function Me(){if(Z!==null){if(mt=!0,te!==null){for(let c of Q.values())c.exited||pe({t:"kill",sid:c.sid});try{te.close()}catch{}te=null}Be!==null&&(Be.disconnect(),Be=null);for(let c of Q.values())if(c.term!==null)try{c.term.dispose()}catch{}Q.clear(),ge=null,document.removeEventListener("keydown",fi),Z.remove(),Z=null,Xe=null,St=null,Ce=null,we=null,ye=null,ne=null,li=0}}function fi(c){c.key==="Escape"&&Z!==null&&(c.preventDefault(),Me())}function Bs(){let c=document.querySelector('[data-pane="sidebar"], [class*="sidebarCol"]');if(c!==null)return c.querySelector('[class*="logoRow"]')?.parentElement??c.firstElementChild}function Ms(c){let u=c.querySelector('button[class*="newSession"]');if(u!==null)return u;for(let w of c.children)if(w.tagName==="BUTTON")return w}function Os(){let c=document.createElement("div");return c.dataset.dshTtyEntry="",c.className="tt_sidebarEntry",c.setAttribute("role","button"),c.setAttribute("aria-label","\u7EC8\u7AEF"),c.innerHTML='<span class="tt_sidebarEntryIcon">'+ai+'</span><span class="tt_sidebarEntryLabel">\u7EC8\u7AEF</span>',c.addEventListener("click",u=>{u.preventDefault(),As()}),c}function ii(c,u){let w=Ms(c);if(w===void 0)return!1;if(u.parentElement!==c){let x=w.closest('[class*="logoRow"]'),k=x!==null&&x.parentElement===c?x:w,r=Array.from(c.children).filter(n=>n instanceof HTMLElement&&n.matches("[data-dsh-global-search-entry], [data-dsh-rss-entry], [data-dsh-taskboard-entry], [data-dsh-ssh-entry], [data-dsh-tty-entry]"));if(r.length>0){let n=r[r.length-1];c.insertBefore(u,n.nextSibling)}else c.insertBefore(u,k.nextElementSibling)}return!0}function Is(){if(oi(),typeof document<"u"&&document.querySelector("[data-dsh-tty-entry]")!==null)return()=>{};let c=Os(),u,w=!1,x=()=>{if(u!==void 0&&!u.isConnected&&(r.disconnect(),u=void 0,w=!1),w){if(document.body.contains(c))return;r.disconnect(),u=void 0,w=!1}u??(u=Bs()),u!==void 0&&(w=ii(u,c),w&&r.observe(u,{childList:!0,subtree:!0}))},k=new MutationObserver(()=>{x()});k.observe(document.body,{childList:!0,subtree:!0});let r=new MutationObserver(()=>{if(u===void 0||!u.isConnected){w=!1,x();return}u.contains(c)||(w=ii(u,c))});return x(),()=>{k.disconnect(),r.disconnect(),c.remove()}}window.__ModuleLoader__.load({id:"@hyzyn/dsh-tty",factory:c=>{let u={},w=c("react"),{jsx:x,jsxs:k}=c("react/jsx-runtime"),r="M6 9.5L9.5 7L6 4.5V9.5Z";function n(){let[a,_]=w.useState(!1),[o,f]=w.useState(null),[v,S]=w.useState(!1),[d,t]=w.useState(!1),[s,e]=w.useState({kind:"",text:""}),i=async()=>{try{let C=await(await fetch("/api/dsh-tty/config",{cache:"no-store"})).json();C.ok&&typeof C.config=="object"&&C.config!==null?f(C.config):e({kind:"error",text:String(C.error||"\u8BFB\u53D6\u914D\u7F6E\u5931\u8D25")})}catch(l){e({kind:"error",text:String(l&&l.message?l.message:l)})}};w.useEffect(()=>{a&&!v&&(S(!0),i())},[a]);let h=(l,C)=>f(R=>({...R||{},[l]:C})),g=async()=>{t(!0),e({kind:"",text:""});try{let l=await fetch("/api/dsh-tty/config",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o||{})}),C=await l.json();!l.ok||!C.ok?e({kind:"error",text:String(C.error||"\u4FDD\u5B58\u5931\u8D25")}):(e({kind:"ok",text:"\u5DF2\u4FDD\u5B58\u5E76\u70ED\u751F\u6548"}),C.config&&f(C.config))}catch(l){e({kind:"error",text:String(l&&l.message?l.message:l)})}t(!1)},p=(l,C,R,T)=>k("label",{className:"tt_cardField",children:[x("span",{className:"tt_cardLabel",children:l}),x("input",{className:"tt_cardInput",value:o[C]??"",placeholder:R??"",onChange:B=>h(C,B.target.value)}),T?x("span",{className:"tt_cardHint",children:T}):null]}),m=(l,C)=>k("label",{className:"tt_cardField tt_cardRow",children:[x("input",{type:"checkbox",className:"tt_cardCheckbox",checked:o[C]===!0,onChange:R=>h(C,R.target.checked)}),x("span",{className:"tt_cardLabel",children:l})]});return k("li",{className:a?"tt_card tt_cardOpen":"tt_card",children:[k("button",{type:"button",className:"tt_cardHeader","aria-expanded":a,onClick:()=>_(l=>!l),children:[k("span",{className:"tt_cardHeadText",children:[x("span",{className:"tt_cardName",children:"\u7EC8\u7AEF\u9762\u677F"}),x("span",{className:"tt_cardDescription",children:"xterm \u7EC8\u7AEF\u9762\u677F\uFF1A\u591A\u6807\u7B7E\u9875\u3001cwd \u8DDF\u968F\u4F1A\u8BDD\uFF1Bshell / TERM / \u5E76\u53D1\u4E0A\u9650\u7B49\u4FDD\u5B58\u5373\u70ED\u751F\u6548\u3002"})]}),k("svg",{className:a?"tt_cardChevron tt_cardChevronOpen":"tt_cardChevron",width:"14",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:x("path",{d:"M6 9.5L9.5 7L6 4.5V9.5Z",fill:"currentColor"})})]}),a?k("div",{className:"tt_cardBody",children:[o===null?x("div",{className:"tt_cardMessage",children:"\u52A0\u8F7D\u914D\u7F6E\u4E2D\u2026"}):k("div",{children:[m("\u542F\u7528\u63D2\u4EF6\uFF08\u9700\u91CD\u542F\u751F\u6548\uFF09","enabled"),m("\u5411 agent \u516C\u544A\u7EC8\u7AEF\u9762\u677F\u80FD\u529B","announceToAgent"),p("\u5E76\u53D1\u4F1A\u8BDD\u4E0A\u9650\uFF081~16\uFF09","maxSessions","4","\u8D85\u8FC7\u4E0A\u9650\u7684\u65B0\u6807\u7B7E\u4F1A\u88AB\u62D2\u7EDD\uFF1B\u4FDD\u5B58\u5373\u70ED\u751F\u6548"),p("Shell \u8DEF\u5F84\uFF08\u9ED8\u8BA4 $SHELL\uFF09","shell","","\u7559\u7A7A\u4F7F\u7528 $SHELL"),p("TERM","term","xterm-256color","TUI \u7A0B\u5E8F\u4F9D\u8D56\u6B64\u503C"),p("COLORTERM","colorTerm","truecolor",""),p("\u515C\u5E95\u5DE5\u4F5C\u76EE\u5F55\uFF08\u5BA2\u6237\u7AEF\u5F53\u524D\u4F1A\u8BDD cwd \u4F18\u5148\uFF09","cwd","","\u7559\u7A7A\u4F7F\u7528\u5BBF\u4E3B\u8FDB\u7A0B\u542F\u52A8\u76EE\u5F55"),k("div",{className:"tt_cardField tt_cardRow",children:[x("button",{className:"tt_cardSave",disabled:d,onClick:()=>void g(),children:d?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58"}),x("span",{className:"tt_cardMessage"+(s.kind==="ok"?" tt_cardMessageOk":s.kind==="error"?" tt_cardMessageError":""),children:s.text})]})]})]}):null]})}return u.inject=["slots","sessions"],u.apply=a=>(hi=a.sessions,Is(),a.slots.inject("settings.plugin.item",()=>a.slots.register({name:"settings.plugin.item",key:"tty",order:110},n)),()=>{Me()}),u}});})();
256
+ /*! Bundled license information:
257
+
258
+ @xterm/addon-search/lib/addon-search.mjs:
259
+ (**
260
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
261
+ * @license MIT
262
+ *
263
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
264
+ * @license MIT
265
+ *
266
+ * Originally forked from (with the author's permission):
267
+ * Fabrice Bellard's javascript vt100 for jslinux:
268
+ * http://bellard.org/jslinux/
269
+ * Copyright (c) 2011 Fabrice Bellard
270
+ *)
271
+
272
+ @xterm/addon-web-links/lib/addon-web-links.mjs:
273
+ (**
274
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
275
+ * @license MIT
276
+ *
277
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
278
+ * @license MIT
279
+ *
280
+ * Originally forked from (with the author's permission):
281
+ * Fabrice Bellard's javascript vt100 for jslinux:
282
+ * http://bellard.org/jslinux/
283
+ * Copyright (c) 2011 Fabrice Bellard
284
+ *)
285
+ */