herdr-remote-relay 0.3.0 → 0.3.2

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.
@@ -0,0 +1,9 @@
1
+ var Ce={exports:{}},Ee;function Pe(){return Ee||(Ee=1,(function(ue,we){(function(le,ne){ue.exports=ne()})(globalThis,(()=>(()=>{var le={4567:function(B,s,a){var c=this&&this.__decorate||function(t,i,h,v){var l,g=arguments.length,_=g<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(t,i,h,v);else for(var m=t.length-1;m>=0;m--)(l=t[m])&&(_=(g<3?l(_):g>3?l(i,h,_):l(i,h))||_);return g>3&&_&&Object.defineProperty(i,h,_),_},u=this&&this.__param||function(t,i){return function(h,v){i(h,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const n=a(9042),d=a(9924),f=a(844),p=a(4725),o=a(2585),e=a(3656);let r=s.AccessibilityManager=class extends f.Disposable{constructor(t,i,h,v){super(),this._terminal=t,this._coreBrowserService=h,this._renderService=v,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 l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,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 d.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((l=>this._handleResize(l.rows)))),this.register(this._terminal.onRender((l=>this._refreshRows(l.start,l.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((l=>this._handleChar(l)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
2
+ `)))),this.register(this._terminal.onA11yTab((l=>this._handleTab(l)))),this.register(this._terminal.onKey((l=>this._handleKey(l.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,e.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,f.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(t){for(let i=0;i<t;i++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
3
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,i){this._liveRegionDebouncer.refresh(t,i,this._terminal.rows)}_renderRows(t,i){const h=this._terminal.buffer,v=h.lines.length.toString();for(let l=t;l<=i;l++){const g=h.lines.get(h.ydisp+l),_=[],m=(g==null?void 0:g.translateToString(!0,void 0,void 0,_))||"",C=(h.ydisp+l+1).toString(),b=this._rowElements[l];b&&(m.length===0?(b.innerText=" ",this._rowColumns.set(b,[0,1])):(b.textContent=m,this._rowColumns.set(b,_)),b.setAttribute("aria-posinset",C),b.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,i){const h=t.target,v=this._rowElements[i===0?1:this._rowElements.length-2];if(h.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||t.relatedTarget!==v)return;let l,g;if(i===0?(l=h,g=this._rowElements.pop(),this._rowContainer.removeChild(g)):(l=this._rowElements.shift(),g=h,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),g.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){const _=this._createAccessibilityTreeNode();this._rowElements.unshift(_),this._rowContainer.insertAdjacentElement("afterbegin",_)}else{const _=this._createAccessibilityTreeNode();this._rowElements.push(_),this._rowContainer.appendChild(_)}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(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){var m;if(this._rowElements.length===0)return;const t=document.getSelection();if(!t)return;if(t.isCollapsed)return void(this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection());if(!t.anchorNode||!t.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:t.anchorNode,offset:t.anchorOffset},h={node:t.focusNode,offset:t.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;const v=this._rowElements.slice(-1)[0];if(h.node.compareDocumentPosition(v)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(h={node:v,offset:((m=v.textContent)==null?void 0:m.length)??0}),!this._rowContainer.contains(h.node))return;const l=({node:C,offset:b})=>{const y=C instanceof Text?C.parentNode:C;let w=parseInt(y==null?void 0:y.getAttribute("aria-posinset"),10)-1;if(isNaN(w))return console.warn("row is invalid. Race condition?"),null;const R=this._rowColumns.get(y);if(!R)return console.warn("columns is null. Race condition?"),null;let D=b<R.length?R[b]:R.slice(-1)[0]+1;return D>=this._terminal.cols&&(++w,D=0),{row:w,column:D}},g=l(i),_=l(h);if(g&&_){if(g.row>_.row||g.row===_.row&&g.column>=_.column)throw new Error("invalid range");this._terminal.select(g.column,g.row,(_.row-g.row)*this._terminal.cols-g.column+_.column)}}_handleResize(t){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>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_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 t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=r=c([u(1,o.IInstantiationService),u(2,p.ICoreBrowserService),u(3,p.IRenderService)],r)},3614:(B,s)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function c(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function u(d,f,p,o){d=c(d=a(d),p.decPrivateModes.bracketedPasteMode&&o.rawOptions.ignoreBracketedPasteMode!==!0),p.triggerDataEvent(d,!0),f.value=""}function n(d,f,p){const o=p.getBoundingClientRect(),e=d.clientX-o.left-10,r=d.clientY-o.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${r}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=c,s.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},s.handlePasteEvent=function(d,f,p,o){d.stopPropagation(),d.clipboardData&&u(d.clipboardData.getData("text/plain"),f,p,o)},s.paste=u,s.moveTextAreaUnderMouseCursor=n,s.rightClickHandler=function(d,f,p,o,e){n(d,f,p),e&&o.rightClickSelect(d),f.value=o.selectionText,f.select()}},7239:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=a(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(u,n,d){this._css.set(u,n,d)}getCss(u,n){return this._css.get(u,n)}setColor(u,n,d){this._color.set(u,n,d)}getColor(u,n){return this._color.get(u,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,c,u,n){a.addEventListener(c,u,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(c,u,n))}}}},3551:function(B,s,a){var c=this&&this.__decorate||function(r,t,i,h){var v,l=arguments.length,g=l<3?t:h===null?h=Object.getOwnPropertyDescriptor(t,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,t,i,h);else for(var _=r.length-1;_>=0;_--)(v=r[_])&&(g=(l<3?v(g):l>3?v(t,i,g):v(t,i))||g);return l>3&&g&&Object.defineProperty(t,i,g),g},u=this&&this.__param||function(r,t){return function(i,h){t(i,h,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const n=a(3656),d=a(8460),f=a(844),p=a(2585),o=a(4725);let e=s.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(r,t,i,h,v){super(),this._element=r,this._mouseService=t,this._renderService=i,this._bufferService=h,this._linkProviderService=v,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)((()=>{var l;this._lastMouseEvent=void 0,(l=this._activeProviderReplies)==null||l.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(r){this._lastMouseEvent=r;const t=this._positionFromMouseEvent(r,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;const i=r.composedPath();for(let h=0;h<i.length;h++){const v=i[h];if(v.classList.contains("xterm"))break;if(v.classList.contains("xterm-hover"))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(r){if(this._activeLine!==r.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(r,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,r)||(this._clearCurrentLink(),this._askForLink(r,!0))}_askForLink(r,t){var h,v;this._activeProviderReplies&&t||((h=this._activeProviderReplies)==null||h.forEach((l=>{l==null||l.forEach((g=>{g.link.dispose&&g.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=r.y);let i=!1;for(const[l,g]of this._linkProviderService.linkProviders.entries())t?(v=this._activeProviderReplies)!=null&&v.get(l)&&(i=this._checkLinkProviderResult(l,r,i)):g.provideLinks(r.y,(_=>{var C,b;if(this._isMouseOut)return;const m=_==null?void 0:_.map((y=>({link:y})));(C=this._activeProviderReplies)==null||C.set(l,m),i=this._checkLinkProviderResult(l,r,i),((b=this._activeProviderReplies)==null?void 0:b.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(r.y,this._activeProviderReplies)}))}_removeIntersectingLinks(r,t){const i=new Set;for(let h=0;h<t.size;h++){const v=t.get(h);if(v)for(let l=0;l<v.length;l++){const g=v[l],_=g.link.range.start.y<r?0:g.link.range.start.x,m=g.link.range.end.y>r?this._bufferService.cols:g.link.range.end.x;for(let C=_;C<=m;C++){if(i.has(C)){v.splice(l--,1);break}i.add(C)}}}}_checkLinkProviderResult(r,t,i){var l;if(!this._activeProviderReplies)return i;const h=this._activeProviderReplies.get(r);let v=!1;for(let g=0;g<r;g++)this._activeProviderReplies.has(g)&&!this._activeProviderReplies.get(g)||(v=!0);if(!v&&h){const g=h.find((_=>this._linkAtPosition(_.link,t)));g&&(i=!0,this._handleNewLink(g))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let g=0;g<this._activeProviderReplies.size;g++){const _=(l=this._activeProviderReplies.get(g))==null?void 0:l.find((m=>this._linkAtPosition(m.link,t)));if(_){i=!0,this._handleNewLink(_);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(r){if(!this._currentLink)return;const t=this._positionFromMouseEvent(r,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(r,this._currentLink.link.text)}_clearCurrentLink(r,t){this._currentLink&&this._lastMouseEvent&&(!r||!t||this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(r){if(!this._lastMouseEvent)return;const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(r.link,t)&&(this._currentLink=r,this._currentLink.state={decorations:{underline:r.link.decorations===void 0||r.link.decorations.underline,pointerCursor:r.link.decorations===void 0||r.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,r.link,this._lastMouseEvent),r.link.decorations={},Object.defineProperties(r.link.decorations,{pointerCursor:{get:()=>{var i,h;return(h=(i=this._currentLink)==null?void 0:i.state)==null?void 0:h.decorations.pointerCursor},set:i=>{var h;(h=this._currentLink)!=null&&h.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:()=>{var i,h;return(h=(i=this._currentLink)==null?void 0:i.state)==null?void 0:h.decorations.underline},set:i=>{var h,v,l;(h=this._currentLink)!=null&&h.state&&((l=(v=this._currentLink)==null?void 0:v.state)==null?void 0:l.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(r.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((i=>{if(!this._currentLink)return;const h=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=v&&(this._clearCurrentLink(h,v),this._lastMouseEvent)){const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}}))))}_linkHover(r,t,i){var h;(h=this._currentLink)!=null&&h.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&r.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(r,t){const i=r.range,h=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-h-1,i.end.x,i.end.y-h-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)}_linkLeave(r,t,i){var h;(h=this._currentLink)!=null&&h.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&r.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(r,t){const i=r.range.start.y*this._bufferService.cols+r.range.start.x,h=r.range.end.y*this._bufferService.cols+r.range.end.x,v=t.y*this._bufferService.cols+t.x;return i<=v&&v<=h}_positionFromMouseEvent(r,t,i){const h=i.getCoords(r,t,this._bufferService.cols,this._bufferService.rows);if(h)return{x:h[0],y:h[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(r,t,i,h,v){return{x1:r,y1:t,x2:i,y2:h,cols:this._bufferService.cols,fg:v}}};s.Linkifier=e=c([u(1,o.IMouseService),u(2,o.IRenderService),u(3,p.IBufferService),u(4,o.ILinkProviderService)],e)},9042:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(B,s,a){var c=this&&this.__decorate||function(o,e,r,t){var i,h=arguments.length,v=h<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(o,e,r,t);else for(var l=o.length-1;l>=0;l--)(i=o[l])&&(v=(h<3?i(v):h>3?i(e,r,v):i(e,r))||v);return h>3&&v&&Object.defineProperty(e,r,v),v},u=this&&this.__param||function(o,e){return function(r,t){e(r,t,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const n=a(511),d=a(2585);let f=s.OscLinkProvider=class{constructor(o,e,r){this._bufferService=o,this._optionsService=e,this._oscLinkService=r}provideLinks(o,e){var m;const r=this._bufferService.buffer.lines.get(o-1);if(!r)return void e(void 0);const t=[],i=this._optionsService.rawOptions.linkHandler,h=new n.CellData,v=r.getTrimmedLength();let l=-1,g=-1,_=!1;for(let C=0;C<v;C++)if(g!==-1||r.hasContent(C)){if(r.loadCell(C,h),h.hasExtendedAttrs()&&h.extended.urlId){if(g===-1){g=C,l=h.extended.urlId;continue}_=h.extended.urlId!==l}else g!==-1&&(_=!0);if(_||g!==-1&&C===v-1){const b=(m=this._oscLinkService.getLinkData(l))==null?void 0:m.uri;if(b){const y={start:{x:g+1,y:o},end:{x:C+(_||C!==v-1?0:1),y:o}};let w=!1;if(!(i!=null&&i.allowNonHttpProtocols))try{const R=new URL(b);["http:","https:"].includes(R.protocol)||(w=!0)}catch{w=!0}w||t.push({text:b,range:y,activate:(R,D)=>i?i.activate(R,D,y):p(0,D),hover:(R,D)=>{var P;return(P=i==null?void 0:i.hover)==null?void 0:P.call(i,R,D,y)},leave:(R,D)=>{var P;return(P=i==null?void 0:i.leave)==null?void 0:P.call(i,R,D,y)}})}_=!1,h.hasExtendedAttrs()&&h.extended.urlId?(g=C,l=h.extended.urlId):(g=-1,l=-1)}}e(t)}};function p(o,e){if(confirm(`Do you want to navigate to ${e}?
4
+
5
+ WARNING: This link could potentially be dangerous`)){const r=window.open();if(r){try{r.opener=null}catch{}r.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=f=c([u(0,d.IBufferService),u(1,d.IOptionsService),u(2,d.IOscLinkService)],f)},6193:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,c,u){this._rowCount=u,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=a(3614),u=a(3656),n=a(3551),d=a(9042),f=a(3730),p=a(1680),o=a(3107),e=a(5744),r=a(2950),t=a(1296),i=a(428),h=a(4269),v=a(5114),l=a(8934),g=a(3230),_=a(9312),m=a(4725),C=a(6731),b=a(8055),y=a(8969),w=a(8460),R=a(844),D=a(6114),P=a(8437),T=a(2584),A=a(7399),S=a(5941),x=a(9074),E=a(2585),k=a(5435),I=a(4567),F=a(779);class N extends y.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=D,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new R.MutableDisposable),this._onCursorMove=this.register(new w.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new w.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new w.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new w.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new w.EventEmitter),this._onBlur=this.register(new w.EventEmitter),this._onA11yCharEmitter=this.register(new w.EventEmitter),this._onA11yTabEmitter=this.register(new w.EventEmitter),this._onWillOpen=this.register(new w.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(E.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(F.LinkProviderService),this._instantiationService.setService(m.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((L,H)=>this.refresh(L,H)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((L=>this._reportWindowsOptions(L)))),this.register(this._inputHandler.onColor((L=>this._handleColorEvent(L)))),this.register((0,w.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,w.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((L=>this._afterResize(L.cols,L.rows)))),this.register((0,R.toDisposable)((()=>{var L,H;this._customKeyEventHandler=void 0,(H=(L=this.element)==null?void 0:L.parentNode)==null||H.removeChild(this.element)})))}_handleColorEvent(M){if(this._themeService)for(const L of M){let H,O="";switch(L.index){case 256:H="foreground",O="10";break;case 257:H="background",O="11";break;case 258:H="cursor",O="12";break;default:H="ansi",O="4;"+L.index}switch(L.type){case 0:const $=b.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${T.C0.ESC}]${O};${(0,S.toRgbString)($)}${T.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors((W=>W.ansi[L.index]=b.channels.toColor(...L.color)));else{const W=H;this._themeService.modifyColors((K=>K[W]=b.channels.toColor(...L.color)))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(M){M?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(M){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var M;return(M=this.textarea)==null?void 0:M.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const M=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(M);if(!L)return;const H=Math.min(this.buffer.x,this.cols-1),O=this._renderService.dimensions.css.cell.height,$=L.getWidth(H),W=this._renderService.dimensions.css.cell.width*$,K=this.buffer.y*this._renderService.dimensions.css.cell.height,q=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=q+"px",this.textarea.style.top=K+"px",this.textarea.style.width=W+"px",this.textarea.style.height=O+"px",this.textarea.style.lineHeight=O+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,u.addDisposableDomListener)(this.element,"copy",(L=>{this.hasSelection()&&(0,c.copyHandler)(L,this._selectionService)})));const M=L=>(0,c.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,u.addDisposableDomListener)(this.textarea,"paste",M)),this.register((0,u.addDisposableDomListener)(this.element,"paste",M)),D.isFirefox?this.register((0,u.addDisposableDomListener)(this.element,"mousedown",(L=>{L.button===2&&(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,u.addDisposableDomListener)(this.element,"contextmenu",(L=>{(0,c.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),D.isLinux&&this.register((0,u.addDisposableDomListener)(this.element,"auxclick",(L=>{L.button===1&&(0,c.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,u.addDisposableDomListener)(this.textarea,"keyup",(M=>this._keyUp(M)),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"keydown",(M=>this._keyDown(M)),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"keypress",(M=>this._keyPress(M)),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionupdate",(M=>this._compositionHelper.compositionupdate(M)))),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,u.addDisposableDomListener)(this.textarea,"input",(M=>this._inputEvent(M)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(M){var H;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"),((H=this.element)==null?void 0:H.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);const L=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),L.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,u.addDisposableDomListener)(this.screenElement,"mousemove",(O=>this.updateCursorStyle(O)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),L.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),D.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(v.CoreBrowserService,this.textarea,M.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this.register((0,u.addDisposableDomListener)(this.textarea,"focus",(O=>this._handleTextAreaFocus(O)))),this.register((0,u.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(m.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(C.ThemeService),this._instantiationService.setService(m.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(h.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(g.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((O=>this._onRender.fire(O)))),this.onResize((O=>this._renderService.resize(O.cols,O.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(r.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(l.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(L);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(p.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((O=>this.scrollLines(O.amount,O.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(_.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((O=>this.scrollLines(O.amount,O.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((O=>this._renderService.handleSelectionChanged(O.start,O.end,O.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((O=>{this.textarea.value=O,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((O=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(o.BufferDecorationRenderer,this.screenElement)),this.register((0,u.addDisposableDomListener)(this.element,"mousedown",(O=>this._selectionService.handleMouseDown(O)))),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(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(O=>this._handleScreenReaderModeOptionChange(O)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(O=>{!this._overviewRulerRenderer&&O&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const M=this,L=this.element;function H(W){const K=M._mouseService.getMouseReportCoords(W,M.screenElement);if(!K)return!1;let q,Z;switch(W.overrideType||W.type){case"mousemove":Z=32,W.buttons===void 0?(q=3,W.button!==void 0&&(q=W.button<3?W.button:3)):q=1&W.buttons?0:4&W.buttons?1:2&W.buttons?2:3;break;case"mouseup":Z=0,q=W.button<3?W.button:3;break;case"mousedown":Z=1,q=W.button<3?W.button:3;break;case"wheel":if(M._customWheelEventHandler&&M._customWheelEventHandler(W)===!1||M.viewport.getLinesScrolled(W)===0)return!1;Z=W.deltaY<0?0:1,q=4;break;default:return!1}return!(Z===void 0||q===void 0||q>4)&&M.coreMouseService.triggerMouseEvent({col:K.col,row:K.row,x:K.x,y:K.y,button:q,action:Z,ctrl:W.ctrlKey,alt:W.altKey,shift:W.shiftKey})}const O={mouseup:null,wheel:null,mousedrag:null,mousemove:null},$={mouseup:W=>(H(W),W.buttons||(this._document.removeEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.removeEventListener("mousemove",O.mousedrag)),this.cancel(W)),wheel:W=>(H(W),this.cancel(W,!0)),mousedrag:W=>{W.buttons&&H(W)},mousemove:W=>{W.buttons||H(W)}};this.register(this.coreMouseService.onProtocolChange((W=>{W?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(W)),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&W?O.mousemove||(L.addEventListener("mousemove",$.mousemove),O.mousemove=$.mousemove):(L.removeEventListener("mousemove",O.mousemove),O.mousemove=null),16&W?O.wheel||(L.addEventListener("wheel",$.wheel,{passive:!1}),O.wheel=$.wheel):(L.removeEventListener("wheel",O.wheel),O.wheel=null),2&W?O.mouseup||(O.mouseup=$.mouseup):(this._document.removeEventListener("mouseup",O.mouseup),O.mouseup=null),4&W?O.mousedrag||(O.mousedrag=$.mousedrag):(this._document.removeEventListener("mousemove",O.mousedrag),O.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,u.addDisposableDomListener)(L,"mousedown",(W=>{if(W.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(W))return H(W),O.mouseup&&this._document.addEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.addEventListener("mousemove",O.mousedrag),this.cancel(W)}))),this.register((0,u.addDisposableDomListener)(L,"wheel",(W=>{if(!O.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(W)===!1)return!1;if(!this.buffer.hasScrollback){const K=this.viewport.getLinesScrolled(W);if(K===0)return;const q=T.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(W.deltaY<0?"A":"B");let Z="";for(let ie=0;ie<Math.abs(K);ie++)Z+=q;return this.coreService.triggerDataEvent(Z,!0),this.cancel(W,!0)}return this.viewport.handleWheel(W)?this.cancel(W):void 0}}),{passive:!1})),this.register((0,u.addDisposableDomListener)(L,"touchstart",(W=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(W),this.cancel(W)}),{passive:!0})),this.register((0,u.addDisposableDomListener)(L,"touchmove",(W=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(W)?void 0:this.cancel(W)}),{passive:!1}))}refresh(M,L){var H;(H=this._renderService)==null||H.refreshRows(M,L)}updateCursorStyle(M){var L;(L=this._selectionService)!=null&&L.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,L,H=0){var O;H===1?(super.scrollLines(M,L,H),this.refresh(0,this.rows-1)):(O=this.viewport)==null||O.scrollLines(M)}paste(M){(0,c.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");const L=this._characterJoinerService.register(M);return this.refresh(0,this.rows-1),L}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,L,H){this._selectionService.setSelection(M,L,H)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var M;(M=this._selectionService)==null||M.clearSelection()}selectAll(){var M;(M=this._selectionService)==null||M.selectAll()}selectLines(M,L){var H;(H=this._selectionService)==null||H.selectLines(M,L)}_keyDown(M){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&M.altKey;if(!L&&!this._compositionHelper.keydown(M))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||M.key!=="Dead"&&M.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,A.evaluateKeyboardEvent)(M,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(M),H.type===3||H.type===2){const O=this.rows-1;return this.scrollLines(H.type===2?-O:O),this.cancel(M,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,M)||(H.cancel&&this.cancel(M,!0),!H.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):(H.key!==T.C0.ETX&&H.key!==T.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||M.altKey||M.ctrlKey?this.cancel(M,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(M,L){const H=M.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||M.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||M.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?H:H&&(!L.keyCode||L.keyCode>47)}_keyUp(M){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1||((function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18})(M)||this.focus(),this.updateCursorStyle(M),this._keyPressHandled=!1)}_keyPress(M){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;if(this.cancel(M),M.charCode)L=M.charCode;else if(M.which===null||M.which===void 0)L=M.keyCode;else{if(M.which===0||M.charCode===0)return!1;L=M.which}return!(!L||(M.altKey||M.ctrlKey||M.metaKey)&&!this._isThirdLevelShift(this.browser,M)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(L,!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;const L=M.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(M),!0}return!1}resize(M,L){M!==this.cols||L!==this.rows?super.resize(M,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(M,L){var H,O;(H=this._charSizeService)==null||H.measure(),(O=this.viewport)==null||O.syncScrollArea(!0)}clear(){var M;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(P.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(M=this.viewport)==null||M.reset(),this.refresh(0,this.rows-1)}}reset(){var L,H;this.options.rows=this.rows,this.options.cols=this.cols;const M=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)==null||L.reset(),this._decorationService.reset(),(H=this.viewport)==null||H.reset(),this._customKeyEventHandler=M,this.refresh(0,this.rows-1)}clearTextureAtlas(){var M;(M=this._renderService)==null||M.clearTextureAtlas()}_reportFocus(){var M;(M=this.element)!=null&&M.classList.contains("focus")?this.coreService.triggerDataEvent(T.C0.ESC+"[I"):this.coreService.triggerDataEvent(T.C0.ESC+"[O")}_reportWindowsOptions(M){if(this._renderService)switch(M){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[4;${H};${L}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const O=this._renderService.dimensions.css.cell.width.toFixed(0),$=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[6;${$};${O}t`)}}cancel(M,L){if(this.options.cancelEvents||L)return M.preventDefault(),M.stopPropagation(),!1}}s.Terminal=N},9924:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,c=1e3){this._renderCallback=a,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,c,u){this._rowCount=u,a=a!==void 0?a:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=n-this._lastRefreshMs,f=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,c)}}},1680:function(B,s,a){var c=this&&this.__decorate||function(r,t,i,h){var v,l=arguments.length,g=l<3?t:h===null?h=Object.getOwnPropertyDescriptor(t,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,t,i,h);else for(var _=r.length-1;_>=0;_--)(v=r[_])&&(g=(l<3?v(g):l>3?v(t,i,g):v(t,i))||g);return l>3&&g&&Object.defineProperty(t,i,g),g},u=this&&this.__param||function(r,t){return function(i,h){t(i,h,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const n=a(3656),d=a(4725),f=a(8460),p=a(844),o=a(2585);let e=s.Viewport=class extends p.Disposable{constructor(r,t,i,h,v,l,g,_){super(),this._viewportElement=r,this._scrollArea=t,this._bufferService=i,this._optionsService=h,this._charSizeService=v,this._renderService=l,this._coreBrowserService=g,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 f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((m=>this._activeBuffer=m.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((m=>this._renderDimensions=m))),this._handleThemeChange(_.colors),this.register(_.onChangeColors((m=>this._handleThemeChange(m)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(r){this._viewportElement.style.backgroundColor=r.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(r){if(r)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==r&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=r),this._refreshAnimationFrame=null}syncScrollArea(r=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(r);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(r)}_handleScroll(r){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const r=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(r*(this._smoothScrollState.target-this._smoothScrollState.origin)),r<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(r,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&i<this._lastRecordedBufferHeight)||(r.cancelable&&r.preventDefault(),!1)}handleWheel(r){const t=this._getPixelsScrolled(r);return t!==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+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(r,t))}scrollLines(r){if(r!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const t=r*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:r,suppressScrollEvent:!1})}_getPixelsScrolled(r){if(r.deltaY===0||r.shiftKey)return 0;let t=this._applyScrollModifier(r.deltaY,r);return r.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:r.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(r,t){var _;let i,h="";const v=[],l=t??this._bufferService.buffer.lines.length,g=this._bufferService.buffer.lines;for(let m=r;m<l;m++){const C=g.get(m);if(!C)continue;const b=(_=g.get(m+1))==null?void 0:_.isWrapped;if(h+=C.translateToString(!b),!b||m===g.length-1){const y=document.createElement("div");y.textContent=h,v.push(y),h.length>0&&(i=y),h=""}}return{bufferElements:v,cursorElement:i}}getLinesScrolled(r){if(r.deltaY===0||r.shiftKey)return 0;let t=this._applyScrollModifier(r.deltaY,r);return r.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):r.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(r,t){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&t.altKey||i==="ctrl"&&t.ctrlKey||i==="shift"&&t.shiftKey?r*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:r*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(r){this._lastTouchY=r.touches[0].pageY}handleTouchMove(r){const t=this._lastTouchY-r.touches[0].pageY;return this._lastTouchY=r.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(r,t))}};s.Viewport=e=c([u(2,o.IBufferService),u(3,o.IOptionsService),u(4,d.ICharSizeService),u(5,d.IRenderService),u(6,d.ICoreBrowserService),u(7,d.IThemeService)],e)},3107:function(B,s,a){var c=this&&this.__decorate||function(o,e,r,t){var i,h=arguments.length,v=h<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(o,e,r,t);else for(var l=o.length-1;l>=0;l--)(i=o[l])&&(v=(h<3?i(v):h>3?i(e,r,v):i(e,r))||v);return h>3&&v&&Object.defineProperty(e,r,v),v},u=this&&this.__param||function(o,e){return function(r,t){e(r,t,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const n=a(4725),d=a(844),f=a(2585);let p=s.BufferDecorationRenderer=class extends d.Disposable{constructor(o,e,r,t,i){super(),this._screenElement=o,this._bufferService=e,this._coreBrowserService=r,this._decorationService=t,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,d.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const o of this._decorationService.decorations)this._renderDecoration(o);this._dimensionsChanged=!1}_renderDecoration(o){this._refreshStyle(o),this._dimensionsChanged&&this._refreshXPosition(o)}_createElement(o){var t;const e=this._coreBrowserService.mainDocument.createElement("div");e.classList.add("xterm-decoration"),e.classList.toggle("xterm-decoration-top-layer",((t=o==null?void 0:o.options)==null?void 0:t.layer)==="top"),e.style.width=`${Math.round((o.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,e.style.height=(o.options.height||1)*this._renderService.dimensions.css.cell.height+"px",e.style.top=(o.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",e.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const r=o.options.x??0;return r&&r>this._bufferService.cols&&(e.style.display="none"),this._refreshXPosition(o,e),e}_refreshStyle(o){const e=o.marker.line-this._bufferService.buffers.active.ydisp;if(e<0||e>=this._bufferService.rows)o.element&&(o.element.style.display="none",o.onRenderEmitter.fire(o.element));else{let r=this._decorationElements.get(o);r||(r=this._createElement(o),o.element=r,this._decorationElements.set(o,r),this._container.appendChild(r),o.onDispose((()=>{this._decorationElements.delete(o),r.remove()}))),r.style.top=e*this._renderService.dimensions.css.cell.height+"px",r.style.display=this._altBufferIsActive?"none":"block",o.onRenderEmitter.fire(r)}}_refreshXPosition(o,e=o.element){if(!e)return;const r=o.options.x??0;(o.options.anchor||"left")==="right"?e.style.right=r?r*this._renderService.dimensions.css.cell.width+"px":"":e.style.left=r?r*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(o){var e;(e=this._decorationElements.get(o))==null||e.remove(),this._decorationElements.delete(o),o.dispose()}};s.BufferDecorationRenderer=p=c([u(1,f.IBufferService),u(2,n.ICoreBrowserService),u(3,f.IDecorationService),u(4,n.IRenderService)],p)},5871:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const c of this._zones)if(c.color===a.options.overviewRulerOptions.color&&c.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,a.marker.line))return;if(this._lineAdjacentToZone(c,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(c,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,c){return c>=a.startBufferLine&&c<=a.endBufferLine}_lineAdjacentToZone(a,c,u){return c>=a.startBufferLine-this._linePadding[u||"full"]&&c<=a.endBufferLine+this._linePadding[u||"full"]}_addLineToZone(a,c){a.startBufferLine=Math.min(a.startBufferLine,c),a.endBufferLine=Math.max(a.endBufferLine,c)}}},5744:function(B,s,a){var c=this&&this.__decorate||function(i,h,v,l){var g,_=arguments.length,m=_<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,v):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,h,v,l);else for(var C=i.length-1;C>=0;C--)(g=i[C])&&(m=(_<3?g(m):_>3?g(h,v,m):g(h,v))||m);return _>3&&m&&Object.defineProperty(h,v,m),m},u=this&&this.__param||function(i,h){return function(v,l){h(v,l,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const n=a(5871),d=a(4725),f=a(844),p=a(2585),o={full:0,left:0,center:0,right:0},e={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0};let t=s.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(i,h,v,l,g,_,m){var b;super(),this._viewportElement=i,this._screenElement=h,this._bufferService=v,this._decorationService=l,this._renderService=g,this._optionsService=_,this._coreBrowserService=m,this._colorZoneStore=new n.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(),(b=this._viewportElement.parentElement)==null||b.insertBefore(this._canvas,this._viewportElement);const C=this._canvas.getContext("2d");if(!C)throw new Error("Ctx cannot be null");this._ctx=C,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)((()=>{var y;(y=this._canvas)==null||y.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const i=Math.floor(this._canvas.width/3),h=Math.ceil(this._canvas.width/3);e.full=this._canvas.width,e.left=i,e.center=h,e.right=i,this._refreshDrawHeightConstants(),r.full=0,r.left=0,r.center=e.left,r.right=e.left+e.center}_refreshDrawHeightConstants(){o.full=Math.round(2*this._coreBrowserService.dpr);const i=this._canvas.height/this._bufferService.buffer.lines.length,h=Math.round(Math.max(Math.min(i,12),6)*this._coreBrowserService.dpr);o.left=h,o.center=h,o.right=h}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*o.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const h of this._decorationService.decorations)this._colorZoneStore.addDecoration(h);this._ctx.lineWidth=1;const i=this._colorZoneStore.zones;for(const h of i)h.position!=="full"&&this._renderColorZone(h);for(const 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(r[i.position||"full"],Math.round((this._canvas.height-1)*(i.startBufferLine/this._bufferService.buffers.active.lines.length)-o[i.position||"full"]/2),e[i.position||"full"],Math.round((this._canvas.height-1)*((i.endBufferLine-i.startBufferLine)/this._bufferService.buffers.active.lines.length)+o[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})))}};s.OverviewRulerRenderer=t=c([u(2,p.IBufferService),u(3,p.IDecorationService),u(4,d.IRenderService),u(5,p.IOptionsService),u(6,d.ICoreBrowserService)],t)},2950:function(B,s,a){var c=this&&this.__decorate||function(o,e,r,t){var i,h=arguments.length,v=h<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(o,e,r,t);else for(var l=o.length-1;l>=0;l--)(i=o[l])&&(v=(h<3?i(v):h>3?i(e,r,v):i(e,r))||v);return h>3&&v&&Object.defineProperty(e,r,v),v},u=this&&this.__param||function(o,e){return function(r,t){e(r,t,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const n=a(4725),d=a(2585),f=a(2584);let p=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(o,e,r,t,i,h){this._textarea=o,this._compositionView=e,this._bufferService=r,this._optionsService=t,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(o){this._compositionView.textContent=o.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(o){if(this._isComposing||this._isSendingComposition){if(o.keyCode===229||o.keyCode===16||o.keyCode===17||o.keyCode===18)return!1;this._finalizeComposition(!1)}return o.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(o){if(this._compositionView.classList.remove("active"),this._isComposing=!1,o){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let r;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,r=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}}),0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const o=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const e=this._textarea.value,r=e.replace(o,"");this._dataAlreadySent=r,e.length>o.length?this._coreService.triggerDataEvent(r,!0):e.length<o.length?this._coreService.triggerDataEvent(`${f.C0.DEL}`,!0):e.length===o.length&&e!==o&&this._coreService.triggerDataEvent(e,!0)}}),0)}updateCompositionElements(o){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,t=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=t+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const h=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=t+"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"}o||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=p=c([u(2,d.IBufferService),u(3,d.IOptionsService),u(4,d.ICoreService),u(5,n.IRenderService)],p)},9806:(B,s)=>{function a(c,u,n){const d=n.getBoundingClientRect(),f=c.getComputedStyle(n),p=parseInt(f.getPropertyValue("padding-left")),o=parseInt(f.getPropertyValue("padding-top"));return[u.clientX-d.left-p,u.clientY-d.top-o]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(c,u,n,d,f,p,o,e,r){if(!p)return;const t=a(c,u,n);return t?(t[0]=Math.ceil((t[0]+(r?o/2:0))/o),t[1]=Math.ceil(t[1]/e),t[0]=Math.min(Math.max(t[0],1),d+(r?1:0)),t[1]=Math.min(Math.max(t[1],1),f),t):void 0}},9504:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=a(2584);function u(e,r,t,i){const h=e-n(e,t),v=r-n(r,t),l=Math.abs(h-v)-(function(g,_,m){let C=0;const b=g-n(g,m),y=_-n(_,m);for(let w=0;w<Math.abs(b-y);w++){const R=d(g,_)==="A"?-1:1,D=m.buffer.lines.get(b+R*w);D!=null&&D.isWrapped&&C++}return C})(e,r,t);return o(l,p(d(e,r),i))}function n(e,r){let t=0,i=r.buffer.lines.get(e),h=i==null?void 0:i.isWrapped;for(;h&&e>=0&&e<r.rows;)t++,i=r.buffer.lines.get(--e),h=i==null?void 0:i.isWrapped;return t}function d(e,r){return e>r?"A":"B"}function f(e,r,t,i,h,v){let l=e,g=r,_="";for(;l!==t||g!==i;)l+=h?1:-1,h&&l>v.cols-1?(_+=v.buffer.translateBufferLineToString(g,!1,e,l),l=0,e=0,g++):!h&&l<0&&(_+=v.buffer.translateBufferLineToString(g,!1,0,e+1),l=v.cols-1,e=l,g--);return _+v.buffer.translateBufferLineToString(g,!1,e,l)}function p(e,r){const t=r?"O":"[";return c.C0.ESC+t+e}function o(e,r){e=Math.floor(e);let t="";for(let i=0;i<e;i++)t+=r;return t}s.moveToCellSequence=function(e,r,t,i){const h=t.buffer.x,v=t.buffer.y;if(!t.buffer.hasScrollback)return(function(_,m,C,b,y,w){return u(m,b,y,w).length===0?"":o(f(_,m,_,m-n(m,y),!1,y).length,p("D",w))})(h,v,0,r,t,i)+u(v,r,t,i)+(function(_,m,C,b,y,w){let R;R=u(m,b,y,w).length>0?b-n(b,y):m;const D=b,P=(function(T,A,S,x,E,k){let I;return I=u(S,x,E,k).length>0?x-n(x,E):A,T<S&&I<=x||T>=S&&I<x?"C":"D"})(_,m,C,b,y,w);return o(f(_,R,C,D,P==="C",y).length,p(P,w))})(h,v,e,r,t,i);let l;if(v===r)return l=h>e?"D":"C",o(Math.abs(h-e),p(l,i));l=v>r?"D":"C";const g=Math.abs(v-r);return o((function(_,m){return m.cols-_})(v>r?e:h,t)+(g-1)*t.cols+1+((v>r?h:e)-1),p(l,i))}},1296:function(B,s,a){var c=this&&this.__decorate||function(w,R,D,P){var T,A=arguments.length,S=A<3?R:P===null?P=Object.getOwnPropertyDescriptor(R,D):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,R,D,P);else for(var x=w.length-1;x>=0;x--)(T=w[x])&&(S=(A<3?T(S):A>3?T(R,D,S):T(R,D))||S);return A>3&&S&&Object.defineProperty(R,D,S),S},u=this&&this.__param||function(w,R){return function(D,P){R(D,P,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const n=a(3787),d=a(2550),f=a(2223),p=a(6171),o=a(6052),e=a(4725),r=a(8055),t=a(8460),i=a(844),h=a(2585),v="xterm-dom-renderer-owner-",l="xterm-rows",g="xterm-fg-",_="xterm-bg-",m="xterm-focus",C="xterm-selection";let b=1,y=s.DomRenderer=class extends i.Disposable{constructor(w,R,D,P,T,A,S,x,E,k,I,F,N){super(),this._terminal=w,this._document=R,this._element=D,this._screenElement=P,this._viewportElement=T,this._helperContainer=A,this._linkifier2=S,this._charSizeService=E,this._optionsService=k,this._bufferService=I,this._coreBrowserService=F,this._themeService=N,this._terminalClass=b++,this._rowElements=[],this._selectionRenderModel=(0,o.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new t.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(l),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(C),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,p.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((z=>this._injectCss(z)))),this._injectCss(this._themeService.colors),this._rowFactory=x.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(v+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((z=>this._handleLinkHover(z)))),this.register(this._linkifier2.onHideLinkUnderline((z=>this._handleLinkLeave(z)))),this.register((0,i.toDisposable)((()=>{this._element.classList.remove(v+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new d.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const w=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*w,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),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/w),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const D of this._rowElements)D.style.width=`${this.dimensions.css.canvas.width}px`,D.style.height=`${this.dimensions.css.cell.height}px`,D.style.lineHeight=`${this.dimensions.css.cell.height}px`,D.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const R=`${this._terminalSelector} .${l} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=R,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(w){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let R=`${this._terminalSelector} .${l} { color: ${w.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;R+=`${this._terminalSelector} .${l} .xterm-dim { color: ${r.color.multiplyOpacity(w.foreground,.5).css};}`,R+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const D=`blink_underline_${this._terminalClass}`,P=`blink_bar_${this._terminalClass}`,T=`blink_block_${this._terminalClass}`;R+=`@keyframes ${D} { 50% { border-bottom-style: hidden; }}`,R+=`@keyframes ${P} { 50% { box-shadow: none; }}`,R+=`@keyframes ${T} { 0% { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css}; } 50% { background-color: inherit; color: ${w.cursor.css}; }}`,R+=`${this._terminalSelector} .${l}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${D} 1s step-end infinite;}${this._terminalSelector} .${l}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${l}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${T} 1s step-end infinite;}${this._terminalSelector} .${l} .xterm-cursor.xterm-cursor-block { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css};}${this._terminalSelector} .${l} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${w.cursor.css} !important; color: ${w.cursorAccent.css} !important;}${this._terminalSelector} .${l} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${w.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${l} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${w.cursor.css} inset;}${this._terminalSelector} .${l} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${w.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,R+=`${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${w.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${w.selectionInactiveBackgroundOpaque.css};}`;for(const[A,S]of w.ansi.entries())R+=`${this._terminalSelector} .${g}${A} { color: ${S.css}; }${this._terminalSelector} .${g}${A}.xterm-dim { color: ${r.color.multiplyOpacity(S,.5).css}; }${this._terminalSelector} .${_}${A} { background-color: ${S.css}; }`;R+=`${this._terminalSelector} .${g}${f.INVERTED_DEFAULT_COLOR} { color: ${r.color.opaque(w.background).css}; }${this._terminalSelector} .${g}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${r.color.multiplyOpacity(r.color.opaque(w.background),.5).css}; }${this._terminalSelector} .${_}${f.INVERTED_DEFAULT_COLOR} { background-color: ${w.foreground.css}; }`,this._themeStyleElement.textContent=R}_setDefaultSpacing(){const w=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${w}px`,this._rowFactory.defaultSpacing=w}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(w,R){for(let D=this._rowElements.length;D<=R;D++){const P=this._document.createElement("div");this._rowContainer.appendChild(P),this._rowElements.push(P)}for(;this._rowElements.length>R;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(w,R){this._refreshRowElements(w,R),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(m),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(m),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(w,R,D){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(w,R,D),this.renderRows(0,this._bufferService.rows-1),!w||!R)return;this._selectionRenderModel.update(this._terminal,w,R,D);const P=this._selectionRenderModel.viewportStartRow,T=this._selectionRenderModel.viewportEndRow,A=this._selectionRenderModel.viewportCappedStartRow,S=this._selectionRenderModel.viewportCappedEndRow;if(A>=this._bufferService.rows||S<0)return;const x=this._document.createDocumentFragment();if(D){const E=w[0]>R[0];x.appendChild(this._createSelectionElement(A,E?R[0]:w[0],E?w[0]:R[0],S-A+1))}else{const E=P===A?w[0]:0,k=A===T?R[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(A,E,k));const I=S-A-1;if(x.appendChild(this._createSelectionElement(A+1,0,this._bufferService.cols,I)),A!==S){const F=T===S?R[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(S,0,F))}}this._selectionContainer.appendChild(x)}_createSelectionElement(w,R,D,P=1){const T=this._document.createElement("div"),A=R*this.dimensions.css.cell.width;let S=this.dimensions.css.cell.width*(D-R);return A+S>this.dimensions.css.canvas.width&&(S=this.dimensions.css.canvas.width-A),T.style.height=P*this.dimensions.css.cell.height+"px",T.style.top=w*this.dimensions.css.cell.height+"px",T.style.left=`${A}px`,T.style.width=`${S}px`,T}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const w of this._rowElements)w.replaceChildren()}renderRows(w,R){const D=this._bufferService.buffer,P=D.ybase+D.y,T=Math.min(D.x,this._bufferService.cols-1),A=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let E=w;E<=R;E++){const k=E+D.ydisp,I=this._rowElements[E],F=D.lines.get(k);if(!I||!F)break;I.replaceChildren(...this._rowFactory.createRow(F,k,k===P,S,x,T,A,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${v}${this._terminalClass}`}_handleLinkHover(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!0)}_handleLinkLeave(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!1)}_setCellUnderline(w,R,D,P,T,A){D<0&&(w=0),P<0&&(R=0);const S=this._bufferService.rows-1;D=Math.max(Math.min(D,S),0),P=Math.max(Math.min(P,S),0),T=Math.min(T,this._bufferService.cols);const x=this._bufferService.buffer,E=x.ybase+x.y,k=Math.min(x.x,T-1),I=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let z=D;z<=P;++z){const M=z+x.ydisp,L=this._rowElements[z],H=x.lines.get(M);if(!L||!H)break;L.replaceChildren(...this._rowFactory.createRow(H,M,M===E,F,N,k,I,this.dimensions.css.cell.width,this._widthCache,A?z===D?w:0:-1,A?(z===P?R:T)-1:-1))}}};s.DomRenderer=y=c([u(7,h.IInstantiationService),u(8,e.ICharSizeService),u(9,h.IOptionsService),u(10,h.IBufferService),u(11,e.ICoreBrowserService),u(12,e.IThemeService)],y)},3787:function(B,s,a){var c=this&&this.__decorate||function(l,g,_,m){var C,b=arguments.length,y=b<3?g:m===null?m=Object.getOwnPropertyDescriptor(g,_):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(l,g,_,m);else for(var w=l.length-1;w>=0;w--)(C=l[w])&&(y=(b<3?C(y):b>3?C(g,_,y):C(g,_))||y);return b>3&&y&&Object.defineProperty(g,_,y),y},u=this&&this.__param||function(l,g){return function(_,m){g(_,m,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const n=a(2223),d=a(643),f=a(511),p=a(2585),o=a(8055),e=a(4725),r=a(4269),t=a(6171),i=a(3734);let h=s.DomRendererRowFactory=class{constructor(l,g,_,m,C,b,y){this._document=l,this._characterJoinerService=g,this._optionsService=_,this._coreBrowserService=m,this._coreService=C,this._decorationService=b,this._themeService=y,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(l,g,_){this._selectionStart=l,this._selectionEnd=g,this._columnSelectMode=_}createRow(l,g,_,m,C,b,y,w,R,D,P){const T=[],A=this._characterJoinerService.getJoinedCharacters(g),S=this._themeService.colors;let x,E=l.getNoBgTrimmedLength();_&&E<b+1&&(E=b+1);let k=0,I="",F=0,N=0,z=0,M=!1,L=0,H=!1,O=0;const $=[],W=D!==-1&&P!==-1;for(let K=0;K<E;K++){l.loadCell(K,this._workCell);let q=this._workCell.getWidth();if(q===0)continue;let Z=!1,ie=K,j=this._workCell;if(A.length>0&&K===A[0][0]){Z=!0;const G=A.shift();j=new r.JoinedCellData(this._workCell,l.translateToString(!0,G[0],G[1]),G[1]-G[0]),ie=G[1]-1,q=j.getWidth()}const he=this._isCellInSelection(K,g),_e=_&&K===b,Y=W&&K>=D&&K<=P;let V=!1;this._decorationService.forEachDecorationAtCell(K,g,void 0,(G=>{V=!0}));let X=j.getChars()||d.WHITESPACE_CELL_CHAR;if(X===" "&&(j.isUnderline()||j.isOverline())&&(X=" "),O=q*w-R.get(X,j.isBold(),j.isItalic()),x){if(k&&(he&&H||!he&&!H&&j.bg===F)&&(he&&H&&S.selectionForeground||j.fg===N)&&j.extended.ext===z&&Y===M&&O===L&&!_e&&!Z&&!V){j.isInvisible()?I+=d.WHITESPACE_CELL_CHAR:I+=X,k++;continue}k&&(x.textContent=I),x=this._document.createElement("span"),k=0,I=""}else x=this._document.createElement("span");if(F=j.bg,N=j.fg,z=j.extended.ext,M=Y,L=O,H=he,Z&&b>=K&&b<=ie&&(b=K),!this._coreService.isCursorHidden&&_e&&this._coreService.isCursorInitialized){if($.push("xterm-cursor"),this._coreBrowserService.isFocused)y&&$.push("xterm-cursor-blink"),$.push(m==="bar"?"xterm-cursor-bar":m==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(C)switch(C){case"outline":$.push("xterm-cursor-outline");break;case"block":$.push("xterm-cursor-block");break;case"bar":$.push("xterm-cursor-bar");break;case"underline":$.push("xterm-cursor-underline")}}if(j.isBold()&&$.push("xterm-bold"),j.isItalic()&&$.push("xterm-italic"),j.isDim()&&$.push("xterm-dim"),I=j.isInvisible()?d.WHITESPACE_CELL_CHAR:j.getChars()||d.WHITESPACE_CELL_CHAR,j.isUnderline()&&($.push(`xterm-underline-${j.extended.underlineStyle}`),I===" "&&(I=" "),!j.isUnderlineColorDefault()))if(j.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB(j.getUnderlineColor()).join(",")})`;else{let G=j.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&j.isBold()&&G<8&&(G+=8),x.style.textDecorationColor=S.ansi[G].css}j.isOverline()&&($.push("xterm-overline"),I===" "&&(I=" ")),j.isStrikethrough()&&$.push("xterm-strikethrough"),Y&&(x.style.textDecoration="underline");let U=j.getFgColor(),J=j.getFgColorMode(),te=j.getBgColor(),ee=j.getBgColorMode();const ce=!!j.isInverse();if(ce){const G=U;U=te,te=G;const fe=J;J=ee,ee=fe}let oe,ae,se,Q=!1;switch(this._decorationService.forEachDecorationAtCell(K,g,void 0,(G=>{G.options.layer!=="top"&&Q||(G.backgroundColorRGB&&(ee=50331648,te=G.backgroundColorRGB.rgba>>8&16777215,oe=G.backgroundColorRGB),G.foregroundColorRGB&&(J=50331648,U=G.foregroundColorRGB.rgba>>8&16777215,ae=G.foregroundColorRGB),Q=G.options.layer==="top")})),!Q&&he&&(oe=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,te=oe.rgba>>8&16777215,ee=50331648,Q=!0,S.selectionForeground&&(J=50331648,U=S.selectionForeground.rgba>>8&16777215,ae=S.selectionForeground)),Q&&$.push("xterm-decoration-top"),ee){case 16777216:case 33554432:se=S.ansi[te],$.push(`xterm-bg-${te}`);break;case 50331648:se=o.channels.toColor(te>>16,te>>8&255,255&te),this._addStyle(x,`background-color:#${v((te>>>0).toString(16),"0",6)}`);break;default:ce?(se=S.foreground,$.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):se=S.background}switch(oe||j.isDim()&&(oe=o.color.multiplyOpacity(se,.5)),J){case 16777216:case 33554432:j.isBold()&&U<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(U+=8),this._applyMinimumContrast(x,se,S.ansi[U],j,oe,void 0)||$.push(`xterm-fg-${U}`);break;case 50331648:const G=o.channels.toColor(U>>16&255,U>>8&255,255&U);this._applyMinimumContrast(x,se,G,j,oe,ae)||this._addStyle(x,`color:#${v(U.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(x,se,S.foreground,j,oe,ae)||ce&&$.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}$.length&&(x.className=$.join(" "),$.length=0),_e||Z||V?x.textContent=I:k++,O!==this.defaultSpacing&&(x.style.letterSpacing=`${O}px`),T.push(x),K=ie}return x&&k&&(x.textContent=I),T}_applyMinimumContrast(l,g,_,m,C,b){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,t.treatGlyphAsBackgroundColor)(m.getCode()))return!1;const y=this._getContrastCache(m);let w;if(C||b||(w=y.getColor(g.rgba,_.rgba)),w===void 0){const R=this._optionsService.rawOptions.minimumContrastRatio/(m.isDim()?2:1);w=o.color.ensureContrastRatio(C||g,b||_,R),y.setColor((C||g).rgba,(b||_).rgba,w??null)}return!!w&&(this._addStyle(l,`color:${w.css}`),!0)}_getContrastCache(l){return l.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(l,g){l.setAttribute("style",`${l.getAttribute("style")||""}${g};`)}_isCellInSelection(l,g){const _=this._selectionStart,m=this._selectionEnd;return!(!_||!m)&&(this._columnSelectMode?_[0]<=m[0]?l>=_[0]&&g>=_[1]&&l<m[0]&&g<=m[1]:l<_[0]&&g>=_[1]&&l>=m[0]&&g<=m[1]:g>_[1]&&g<m[1]||_[1]===m[1]&&g===_[1]&&l>=_[0]&&l<m[0]||_[1]<m[1]&&g===m[1]&&l<m[0]||_[1]<m[1]&&g===_[1]&&l>=_[0])}};function v(l,g,_){for(;l.length<_;)l=g+l;return l}s.DomRendererRowFactory=h=c([u(1,e.ICharacterJoinerService),u(2,p.IOptionsService),u(3,e.ICoreBrowserService),u(4,p.ICoreService),u(5,p.IDecorationService),u(6,e.IThemeService)],h)},2550:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(a,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const u=a.createElement("span");u.classList.add("xterm-char-measure-element");const n=a.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const d=a.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const f=a.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[u,n,d,f],this._container.appendChild(u),this._container.appendChild(n),this._container.appendChild(d),this._container.appendChild(f),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,c,u,n){a===this._font&&c===this._fontSize&&u===this._weight&&n===this._weightBold||(this._font=a,this._fontSize=c,this._weight=u,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${u}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${u}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(a,c,u){let n=0;if(!c&&!u&&a.length===1&&(n=a.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const p=this._measure(a,0);return p>0&&(this._flat[n]=p),p}let d=a;c&&(d+="B"),u&&(d+="I");let f=this._holey.get(d);if(f===void 0){let p=0;c&&(p|=1),u&&(p|=2),f=this._measure(a,p),f>0&&this._holey.set(d,f)}return f}_measure(a,c){const u=this._measureElements[c];return u.textContent=a.repeat(32),u.offsetWidth/32}}},2223:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(B,s)=>{function a(u){return 57508<=u&&u<=57558}function c(u){return u>=128512&&u<=128591||u>=127744&&u<=128511||u>=128640&&u<=128767||u>=9728&&u<=9983||u>=9984&&u<=10175||u>=65024&&u<=65039||u>=129280&&u<=129535||u>=127462&&u<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(u){if(!u)throw new Error("value must not be falsy");return u},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},s.isEmoji=c,s.allowRescaling=function(u,n,d,f){return n===1&&d>Math.ceil(1.5*f)&&u!==void 0&&u>255&&!c(u)&&!a(u)&&!(function(p){return 57344<=p&&p<=63743})(u)},s.treatGlyphAsBackgroundColor=function(u){return a(u)||(function(n){return 9472<=n&&n<=9631})(u)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(u,n,d=0){return(u-(2*Math.round(n)-d))%(2*Math.round(n))}},6052:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(u,n,d,f=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const p=u.buffers.active.ydisp,o=n[1]-p,e=d[1]-p,r=Math.max(o,0),t=Math.min(e,u.rows-1);r>=u.rows||t<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=o,this.viewportEndRow=e,this.viewportCappedStartRow=r,this.viewportCappedEndRow=t,this.startCol=n[0],this.endCol=d[0])}isCellSelected(u,n,d){return!!this.hasSelection&&(d-=u.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},456:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,c=this.selectionEnd;return!(!a||!c)&&(a[1]>c[1]||a[1]===c[1]&&a[0]>c[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(B,s,a){var c=this&&this.__decorate||function(t,i,h,v){var l,g=arguments.length,_=g<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(t,i,h,v);else for(var m=t.length-1;m>=0;m--)(l=t[m])&&(_=(g<3?l(_):g>3?l(i,h,_):l(i,h))||_);return g>3&&_&&Object.defineProperty(i,h,_),_},u=this&&this.__param||function(t,i){return function(h,v){i(h,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const n=a(2585),d=a(8460),f=a(844);let p=s.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(t,i,h){super(),this._optionsService=h,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new r(this._optionsService))}catch{this._measureStrategy=this.register(new e(t,i,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const t=this._measureStrategy.measure();t.width===this.width&&t.height===this.height||(this.width=t.width,this.height=t.height,this._onCharSizeChange.fire())}};s.CharSizeService=p=c([u(2,n.IOptionsService)],p);class o extends f.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 e extends o{constructor(i,h,v){super(),this._document=i,this._parentElement=h,this._optionsService=v,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 r extends o{constructor(i){super(),this._optionsService=i,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const 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}`;const i=this._ctx.measureText("W");return this._validateAndSet(i.width,i.fontBoundingBoxAscent+i.fontBoundingBoxDescent),this._result}}},4269:function(B,s,a){var c=this&&this.__decorate||function(r,t,i,h){var v,l=arguments.length,g=l<3?t:h===null?h=Object.getOwnPropertyDescriptor(t,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,t,i,h);else for(var _=r.length-1;_>=0;_--)(v=r[_])&&(g=(l<3?v(g):l>3?v(t,i,g):v(t,i))||g);return l>3&&g&&Object.defineProperty(t,i,g),g},u=this&&this.__param||function(r,t){return function(i,h){t(i,h,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const n=a(3734),d=a(643),f=a(511),p=a(2585);class o extends n.AttributeData{constructor(t,i,h){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=i,this._width=h}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=o;let e=s.CharacterJoinerService=class Me{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(t){const i={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(i),i.id}deregister(t){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===t)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(t);if(!i||i.length===0)return[];const h=[],v=i.translateToString(!0);let l=0,g=0,_=0,m=i.getFg(0),C=i.getBg(0);for(let b=0;b<i.getTrimmedLength();b++)if(i.loadCell(b,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==m||this._workCell.bg!==C){if(b-l>1){const y=this._getJoinedRanges(v,_,g,i,l);for(let w=0;w<y.length;w++)h.push(y[w])}l=b,_=g,m=this._workCell.fg,C=this._workCell.bg}g+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-l>1){const b=this._getJoinedRanges(v,_,g,i,l);for(let y=0;y<b.length;y++)h.push(b[y])}return h}_getJoinedRanges(t,i,h,v,l){const g=t.substring(i,h);let _=[];try{_=this._characterJoiners[0].handler(g)}catch(m){console.error(m)}for(let m=1;m<this._characterJoiners.length;m++)try{const C=this._characterJoiners[m].handler(g);for(let b=0;b<C.length;b++)Me._mergeRanges(_,C[b])}catch(C){console.error(C)}return this._stringRangesToCellRanges(_,v,l),_}_stringRangesToCellRanges(t,i,h){let v=0,l=!1,g=0,_=t[v];if(_){for(let m=h;m<this._bufferService.cols;m++){const C=i.getWidth(m),b=i.getString(m).length||d.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!l&&_[0]<=g&&(_[0]=m,l=!0),_[1]<=g){if(_[1]=m,_=t[++v],!_)break;_[0]<=g?(_[0]=m,l=!0):l=!1}g+=b}}_&&(_[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let h=!1;for(let v=0;v<t.length;v++){const l=t[v];if(h){if(i[1]<=l[0])return t[v-1][1]=i[1],t;if(i[1]<=l[1])return t[v-1][1]=Math.max(i[1],l[1]),t.splice(v,1),t;t.splice(v,1),v--}else{if(i[1]<=l[0])return t.splice(v,0,i),t;if(i[1]<=l[1])return l[0]=Math.min(i[0],l[0]),t;i[0]<l[1]&&(l[0]=Math.min(i[0],l[0]),h=!0)}}return h?t[t.length-1][1]=i[1]:t.push(i),t}};s.CharacterJoinerService=e=c([u(0,p.IBufferService)],e)},5114:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=a(844),u=a(8460),n=a(3656);class d extends c.Disposable{constructor(o,e,r){super(),this._textarea=o,this._window=e,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new u.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new u.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((t=>this._screenDprMonitor.setWindow(t)))),this.register((0,u.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(o){this._window!==o&&(this._window=o,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=d;class f extends c.Disposable{constructor(o){super(),this._parentWindow=o,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new u.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(o){this._parentWindow=o,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var o;this._outerListener&&((o=this._resolutionMediaMatchList)==null||o.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:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=a(844);class u extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const f=this.linkProviders.indexOf(d);f!==-1&&this.linkProviders.splice(f,1)}}}}s.LinkProviderService=u},8934:function(B,s,a){var c=this&&this.__decorate||function(p,o,e,r){var t,i=arguments.length,h=i<3?o:r===null?r=Object.getOwnPropertyDescriptor(o,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(p,o,e,r);else for(var v=p.length-1;v>=0;v--)(t=p[v])&&(h=(i<3?t(h):i>3?t(o,e,h):t(o,e))||h);return i>3&&h&&Object.defineProperty(o,e,h),h},u=this&&this.__param||function(p,o){return function(e,r){o(e,r,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const n=a(4725),d=a(9806);let f=s.MouseService=class{constructor(p,o){this._renderService=p,this._charSizeService=o}getCoords(p,o,e,r,t){return(0,d.getCoords)(window,p,o,e,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,t)}getMouseReportCoords(p,o){const e=(0,d.getCoordsRelativeToElement)(window,p,o);if(this._charSizeService.hasValidSize)return e[0]=Math.min(Math.max(e[0],0),this._renderService.dimensions.css.canvas.width-1),e[1]=Math.min(Math.max(e[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(e[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(e[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(e[0]),y:Math.floor(e[1])}}};s.MouseService=f=c([u(0,n.IRenderService),u(1,n.ICharSizeService)],f)},3230:function(B,s,a){var c=this&&this.__decorate||function(t,i,h,v){var l,g=arguments.length,_=g<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(t,i,h,v);else for(var m=t.length-1;m>=0;m--)(l=t[m])&&(_=(g<3?l(_):g>3?l(i,h,_):l(i,h))||_);return g>3&&_&&Object.defineProperty(i,h,_),_},u=this&&this.__param||function(t,i){return function(h,v){i(h,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const n=a(6193),d=a(4725),f=a(8460),p=a(844),o=a(7226),e=a(2585);let r=s.RenderService=class extends p.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(t,i,h,v,l,g,_,m){super(),this._rowCount=t,this._charSizeService=v,this._renderer=this.register(new p.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,this._observerDisposable=this.register(new p.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 f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer(((C,b)=>this._renderRows(C,b)),_),this.register(this._renderDebouncer),this.register(_.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(g.onResize((()=>this._fullRefresh()))),this.register(g.buffers.onBufferActivate((()=>{var C;return(C=this._renderer.value)==null?void 0:C.clear()}))),this.register(h.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(l.onDecorationRegistered((()=>this._fullRefresh()))),this.register(l.onDecorationRemoved((()=>this._fullRefresh()))),this.register(h.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(g.cols,g.rows),this._fullRefresh()}))),this.register(h.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(g.buffer.y,g.buffer.y,!0)))),this.register(m.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(_.window,i),this.register(_.onWindowChange((C=>this._registerIntersectionObserver(C,i))))}_registerIntersectionObserver(t,i){if("IntersectionObserver"in t){const h=new t.IntersectionObserver((v=>this._handleIntersectionChange(v[v.length-1])),{threshold:0});h.observe(i),this._observerDisposable.value=(0,p.toDisposable)((()=>h.disconnect()))}}_handleIntersectionChange(t){this._isPaused=t.isIntersecting===void 0?t.intersectionRatio===0:!t.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(t,i,h=!1){this._isPaused?this._needsFullRefresh=!0:(h||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(t,i,this._rowCount))}_renderRows(t,i){this._renderer.value&&(t=Math.min(t,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(t,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:t,end:i}),this._onRender.fire({start:t,end:i}),this._isNextRenderRedrawOnly=!0)}resize(t,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(t){this._renderer.value=t,this._renderer.value&&(this._renderer.value.onRequestRedraw((i=>this.refreshRows(i.start,i.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(t){return this._renderDebouncer.addRefreshCallback(t)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var t,i;this._renderer.value&&((i=(t=this._renderer.value).clearTextureAtlas)==null||i.call(t),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(t,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var h;return(h=this._renderer.value)==null?void 0:h.handleResize(t,i)})):this._renderer.value.handleResize(t,i),this._fullRefresh())}handleCharSizeChanged(){var t;(t=this._renderer.value)==null||t.handleCharSizeChanged()}handleBlur(){var t;(t=this._renderer.value)==null||t.handleBlur()}handleFocus(){var t;(t=this._renderer.value)==null||t.handleFocus()}handleSelectionChanged(t,i,h){var v;this._selectionState.start=t,this._selectionState.end=i,this._selectionState.columnSelectMode=h,(v=this._renderer.value)==null||v.handleSelectionChanged(t,i,h)}handleCursorMove(){var t;(t=this._renderer.value)==null||t.handleCursorMove()}clear(){var t;(t=this._renderer.value)==null||t.clear()}};s.RenderService=r=c([u(2,e.IOptionsService),u(3,d.ICharSizeService),u(4,e.IDecorationService),u(5,e.IBufferService),u(6,d.ICoreBrowserService),u(7,d.IThemeService)],r)},9312:function(B,s,a){var c=this&&this.__decorate||function(_,m,C,b){var y,w=arguments.length,R=w<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,C):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,m,C,b);else for(var D=_.length-1;D>=0;D--)(y=_[D])&&(R=(w<3?y(R):w>3?y(m,C,R):y(m,C))||R);return w>3&&R&&Object.defineProperty(m,C,R),R},u=this&&this.__param||function(_,m){return function(C,b){m(C,b,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const n=a(9806),d=a(9504),f=a(456),p=a(4725),o=a(8460),e=a(844),r=a(6114),t=a(4841),i=a(511),h=a(2585),v=" ",l=new RegExp(v,"g");let g=s.SelectionService=class extends e.Disposable{constructor(_,m,C,b,y,w,R,D,P){super(),this._element=_,this._screenElement=m,this._linkifier=C,this._bufferService=b,this._coreService=y,this._mouseService=w,this._optionsService=R,this._renderService=D,this._coreBrowserService=P,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 o.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new o.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new o.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=T=>this._handleMouseMove(T),this._mouseUpListener=T=>this._handleMouseUp(T),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((T=>this._handleTrim(T))),this.register(this._bufferService.buffers.onBufferActivate((T=>this._handleBufferActivate(T)))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const _=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;return!(!_||!m||_[0]===m[0]&&_[1]===m[1])}get selectionText(){const _=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;if(!_||!m)return"";const C=this._bufferService.buffer,b=[];if(this._activeSelectionMode===3){if(_[0]===m[0])return"";const y=_[0]<m[0]?_[0]:m[0],w=_[0]<m[0]?m[0]:_[0];for(let R=_[1];R<=m[1];R++){const D=C.translateBufferLineToString(R,!0,y,w);b.push(D)}}else{const y=_[1]===m[1]?m[0]:void 0;b.push(C.translateBufferLineToString(_[1],!0,_[0],y));for(let w=_[1]+1;w<=m[1]-1;w++){const R=C.lines.get(w),D=C.translateBufferLineToString(w,!0);R!=null&&R.isWrapped?b[b.length-1]+=D:b.push(D)}if(_[1]!==m[1]){const w=C.lines.get(m[1]),R=C.translateBufferLineToString(m[1],!0,0,m[0]);w&&w.isWrapped?b[b.length-1]+=R:b.push(R)}}return b.map((y=>y.replace(l," "))).join(r.isWindows?`\r
6
+ `:`
7
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(_){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),r.isLinux&&_&&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(_){const m=this._getMouseBufferCoords(_),C=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!!(C&&b&&m)&&this._areCoordsInSelection(m,C,b)}isCellInSelection(_,m){const C=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!C||!b)&&this._areCoordsInSelection([_,m],C,b)}_areCoordsInSelection(_,m,C){return _[1]>m[1]&&_[1]<C[1]||m[1]===C[1]&&_[1]===m[1]&&_[0]>=m[0]&&_[0]<C[0]||m[1]<C[1]&&_[1]===C[1]&&_[0]<C[0]||m[1]<C[1]&&_[1]===m[1]&&_[0]>=m[0]}_selectWordAtCursor(_,m){var y,w;const C=(w=(y=this._linkifier.currentLink)==null?void 0:y.link)==null?void 0:w.range;if(C)return this._model.selectionStart=[C.start.x-1,C.start.y-1],this._model.selectionStartLength=(0,t.getRangeLength)(C,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const b=this._getMouseBufferCoords(_);return!!b&&(this._selectWordAt(b,m),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(_,m){this._model.clearSelection(),_=Math.max(_,0),m=Math.min(m,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,_],this._model.selectionEnd=[this._bufferService.cols,m],this.refresh(),this._onSelectionChange.fire()}_handleTrim(_){this._model.handleTrim(_)&&this.refresh()}_getMouseBufferCoords(_){const m=this._mouseService.getCoords(_,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(m)return m[0]--,m[1]--,m[1]+=this._bufferService.buffer.ydisp,m}_getMouseEventScrollAmount(_){let m=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,_,this._screenElement)[1];const C=this._renderService.dimensions.css.canvas.height;return m>=0&&m<=C?0:(m>C&&(m-=C),m=Math.min(Math.max(m,-50),50),m/=50,m/Math.abs(m)+Math.round(14*m))}shouldForceSelection(_){return r.isMac?_.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:_.shiftKey}handleMouseDown(_){if(this._mouseDownTimeStamp=_.timeStamp,(_.button!==2||!this.hasSelection)&&_.button===0){if(!this._enabled){if(!this.shouldForceSelection(_))return;_.stopPropagation()}_.preventDefault(),this._dragScrollAmount=0,this._enabled&&_.shiftKey?this._handleIncrementalClick(_):_.detail===1?this._handleSingleClick(_):_.detail===2?this._handleDoubleClick(_):_.detail===3&&this._handleTripleClick(_),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(_){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(_))}_handleSingleClick(_){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(_)?3:0,this._model.selectionStart=this._getMouseBufferCoords(_),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const m=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);m&&m.length!==this._model.selectionStart[0]&&m.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(_){this._selectWordAtCursor(_,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(_){const m=this._getMouseBufferCoords(_);m&&(this._activeSelectionMode=2,this._selectLineAt(m[1]))}shouldColumnSelect(_){return _.altKey&&!(r.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(_){if(_.stopImmediatePropagation(),!this._model.selectionStart)return;const m=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(_),!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(_),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){const b=C.lines.get(this._model.selectionEnd[1]);b&&b.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}m&&m[0]===this._model.selectionEnd[0]&&m[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const _=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(_.ydisp+this._bufferService.rows,_.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=_.ydisp),this.refresh()}}_handleMouseUp(_){const m=_.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&m<500&&_.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const C=this._mouseService.getCoords(_,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){const b=(0,d.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(b,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const _=this._model.finalSelectionStart,m=this._model.finalSelectionEnd,C=!(!_||!m||_[0]===m[0]&&_[1]===m[1]);C?_&&m&&(this._oldSelectionStart&&this._oldSelectionEnd&&_[0]===this._oldSelectionStart[0]&&_[1]===this._oldSelectionStart[1]&&m[0]===this._oldSelectionEnd[0]&&m[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(_,m,C)):this._oldHasSelection&&this._fireOnSelectionChange(_,m,C)}_fireOnSelectionChange(_,m,C){this._oldSelectionStart=_,this._oldSelectionEnd=m,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(_){this.clearSelection(),this._trimListener.dispose(),this._trimListener=_.activeBuffer.lines.onTrim((m=>this._handleTrim(m)))}_convertViewportColToCharacterIndex(_,m){let C=m;for(let b=0;m>=b;b++){const y=_.loadCell(b,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&m!==b&&(C+=y-1)}return C}setSelection(_,m,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[_,m],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(_){this._isClickInSelection(_)||(this._selectWordAtCursor(_,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(_,m,C=!0,b=!0){if(_[0]>=this._bufferService.cols)return;const y=this._bufferService.buffer,w=y.lines.get(_[1]);if(!w)return;const R=y.translateBufferLineToString(_[1],!1);let D=this._convertViewportColToCharacterIndex(w,_[0]),P=D;const T=_[0]-D;let A=0,S=0,x=0,E=0;if(R.charAt(D)===" "){for(;D>0&&R.charAt(D-1)===" ";)D--;for(;P<R.length&&R.charAt(P+1)===" ";)P++}else{let F=_[0],N=_[0];w.getWidth(F)===0&&(A++,F--),w.getWidth(N)===2&&(S++,N++);const z=w.getString(N).length;for(z>1&&(E+=z-1,P+=z-1);F>0&&D>0&&!this._isCharWordSeparator(w.loadCell(F-1,this._workCell));){w.loadCell(F-1,this._workCell);const M=this._workCell.getChars().length;this._workCell.getWidth()===0?(A++,F--):M>1&&(x+=M-1,D-=M-1),D--,F--}for(;N<w.length&&P+1<R.length&&!this._isCharWordSeparator(w.loadCell(N+1,this._workCell));){w.loadCell(N+1,this._workCell);const M=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,N++):M>1&&(E+=M-1,P+=M-1),P++,N++}}P++;let k=D+T-A+x,I=Math.min(this._bufferService.cols,P-D+A+S-x-E);if(m||R.slice(D,P).trim()!==""){if(C&&k===0&&w.getCodePoint(0)!==32){const F=y.lines.get(_[1]-1);if(F&&w.isWrapped&&F.getCodePoint(this._bufferService.cols-1)!==32){const N=this._getWordAt([this._bufferService.cols-1,_[1]-1],!1,!0,!1);if(N){const z=this._bufferService.cols-N.start;k-=z,I+=z}}}if(b&&k+I===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const F=y.lines.get(_[1]+1);if(F!=null&&F.isWrapped&&F.getCodePoint(0)!==32){const N=this._getWordAt([0,_[1]+1],!1,!1,!0);N&&(I+=N.length)}}return{start:k,length:I}}}_selectWordAt(_,m){const C=this._getWordAt(_,m);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,_[1]--;this._model.selectionStart=[C.start,_[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(_){const m=this._getWordAt(_,!0);if(m){let C=_[1];for(;m.start<0;)m.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;m.start+m.length>this._bufferService.cols;)m.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?m.start:m.start+m.length,C]}}_isCharWordSeparator(_){return _.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(_.getChars())>=0}_selectLineAt(_){const m=this._bufferService.buffer.getWrappedRangeForLine(_),C={start:{x:0,y:m.first},end:{x:this._bufferService.cols-1,y:m.last}};this._model.selectionStart=[0,m.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,t.getRangeLength)(C,this._bufferService.cols)}};s.SelectionService=g=c([u(3,h.IBufferService),u(4,h.ICoreService),u(5,p.IMouseService),u(6,h.IOptionsService),u(7,p.IRenderService),u(8,p.ICoreBrowserService)],g)},4725:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=a(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(B,s,a){var c=this&&this.__decorate||function(g,_,m,C){var b,y=arguments.length,w=y<3?_:C===null?C=Object.getOwnPropertyDescriptor(_,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(g,_,m,C);else for(var R=g.length-1;R>=0;R--)(b=g[R])&&(w=(y<3?b(w):y>3?b(_,m,w):b(_,m))||w);return y>3&&w&&Object.defineProperty(_,m,w),w},u=this&&this.__param||function(g,_){return function(m,C){_(m,C,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const n=a(7239),d=a(8055),f=a(8460),p=a(844),o=a(2585),e=d.css.toColor("#ffffff"),r=d.css.toColor("#000000"),t=d.css.toColor("#ffffff"),i=d.css.toColor("#000000"),h={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const g=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],_=[0,95,135,175,215,255];for(let m=0;m<216;m++){const C=_[m/36%6|0],b=_[m/6%6|0],y=_[m%6];g.push({css:d.channels.toCss(C,b,y),rgba:d.channels.toRgba(C,b,y)})}for(let m=0;m<24;m++){const C=8+10*m;g.push({css:d.channels.toCss(C,C,C),rgba:d.channels.toRgba(C,C,C)})}return g})());let v=s.ThemeService=class extends p.Disposable{get colors(){return this._colors}constructor(g){super(),this._optionsService=g,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:r,cursor:t,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:h,selectionBackgroundOpaque:d.color.blend(r,h),selectionInactiveBackgroundTransparent:h,selectionInactiveBackgroundOpaque:d.color.blend(r,h),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(g={}){const _=this._colors;if(_.foreground=l(g.foreground,e),_.background=l(g.background,r),_.cursor=l(g.cursor,t),_.cursorAccent=l(g.cursorAccent,i),_.selectionBackgroundTransparent=l(g.selectionBackground,h),_.selectionBackgroundOpaque=d.color.blend(_.background,_.selectionBackgroundTransparent),_.selectionInactiveBackgroundTransparent=l(g.selectionInactiveBackground,_.selectionBackgroundTransparent),_.selectionInactiveBackgroundOpaque=d.color.blend(_.background,_.selectionInactiveBackgroundTransparent),_.selectionForeground=g.selectionForeground?l(g.selectionForeground,d.NULL_COLOR):void 0,_.selectionForeground===d.NULL_COLOR&&(_.selectionForeground=void 0),d.color.isOpaque(_.selectionBackgroundTransparent)&&(_.selectionBackgroundTransparent=d.color.opacity(_.selectionBackgroundTransparent,.3)),d.color.isOpaque(_.selectionInactiveBackgroundTransparent)&&(_.selectionInactiveBackgroundTransparent=d.color.opacity(_.selectionInactiveBackgroundTransparent,.3)),_.ansi=s.DEFAULT_ANSI_COLORS.slice(),_.ansi[0]=l(g.black,s.DEFAULT_ANSI_COLORS[0]),_.ansi[1]=l(g.red,s.DEFAULT_ANSI_COLORS[1]),_.ansi[2]=l(g.green,s.DEFAULT_ANSI_COLORS[2]),_.ansi[3]=l(g.yellow,s.DEFAULT_ANSI_COLORS[3]),_.ansi[4]=l(g.blue,s.DEFAULT_ANSI_COLORS[4]),_.ansi[5]=l(g.magenta,s.DEFAULT_ANSI_COLORS[5]),_.ansi[6]=l(g.cyan,s.DEFAULT_ANSI_COLORS[6]),_.ansi[7]=l(g.white,s.DEFAULT_ANSI_COLORS[7]),_.ansi[8]=l(g.brightBlack,s.DEFAULT_ANSI_COLORS[8]),_.ansi[9]=l(g.brightRed,s.DEFAULT_ANSI_COLORS[9]),_.ansi[10]=l(g.brightGreen,s.DEFAULT_ANSI_COLORS[10]),_.ansi[11]=l(g.brightYellow,s.DEFAULT_ANSI_COLORS[11]),_.ansi[12]=l(g.brightBlue,s.DEFAULT_ANSI_COLORS[12]),_.ansi[13]=l(g.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),_.ansi[14]=l(g.brightCyan,s.DEFAULT_ANSI_COLORS[14]),_.ansi[15]=l(g.brightWhite,s.DEFAULT_ANSI_COLORS[15]),g.extendedAnsi){const m=Math.min(_.ansi.length-16,g.extendedAnsi.length);for(let C=0;C<m;C++)_.ansi[C+16]=l(g.extendedAnsi[C],s.DEFAULT_ANSI_COLORS[C+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(g){this._restoreColor(g),this._onChangeColors.fire(this.colors)}_restoreColor(g){if(g!==void 0)switch(g){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[g]=this._restoreColors.ansi[g]}else for(let _=0;_<this._restoreColors.ansi.length;++_)this._colors.ansi[_]=this._restoreColors.ansi[_]}modifyColors(g){g(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 l(g,_){if(g!==void 0)try{return d.css.toColor(g)}catch{}return _}s.ThemeService=v=c([u(0,o.IOptionsService)],v)},6349:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=a(8460),u=a(844);class n extends u.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(f){if(this._maxLength===f)return;const p=new Array(f);for(let o=0;o<Math.min(f,this.length);o++)p[o]=this._array[this._getCyclicIndex(o)];this._array=p,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let p=this._length;p<f;p++)this._array[p]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,p){this._array[this._getCyclicIndex(f)]=p}push(f){this._array[this._getCyclicIndex(this._length)]=f,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(f,p,...o){if(p){for(let e=f;e<this._length-p;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+p)];this._length-=p,this.onDeleteEmitter.fire({index:f,amount:p})}for(let e=this._length-1;e>=f;e--)this._array[this._getCyclicIndex(e+o.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<o.length;e++)this._array[this._getCyclicIndex(f+e)]=o[e];if(o.length&&this.onInsertEmitter.fire({index:f,amount:o.length}),this._length+o.length>this._maxLength){const e=this._length+o.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=o.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,p,o){if(!(p<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+o<0)throw new Error("Cannot shift elements in list beyond index 0");if(o>0){for(let r=p-1;r>=0;r--)this.set(f+r+o,this.get(f+r));const e=f+p+o-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<p;e++)this.set(f+e+o,this.get(f+e))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}s.CircularList=n},1439:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(c,u=5){if(typeof c!="object")return c;const n=Array.isArray(c)?[]:{};for(const d in c)n[d]=u<=1?c[d]:c[d]&&a(c[d],u-1);return n}},8055:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,u=0,n=0;var d,f,p,o,e;function r(i){const h=i.toString(16);return h.length<2?"0"+h:h}function t(i,h){return i<h?(h+.05)/(i+.05):(i+.05)/(h+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(i){i.toCss=function(h,v,l,g){return g!==void 0?`#${r(h)}${r(v)}${r(l)}${r(g)}`:`#${r(h)}${r(v)}${r(l)}`},i.toRgba=function(h,v,l,g=255){return(h<<24|v<<16|l<<8|g)>>>0},i.toColor=function(h,v,l,g){return{css:i.toCss(h,v,l,g),rgba:i.toRgba(h,v,l,g)}}})(d||(s.channels=d={})),(function(i){function h(v,l){return n=Math.round(255*l),[a,c,u]=e.toChannels(v.rgba),{css:d.toCss(a,c,u,n),rgba:d.toRgba(a,c,u,n)}}i.blend=function(v,l){if(n=(255&l.rgba)/255,n===1)return{css:l.css,rgba:l.rgba};const g=l.rgba>>24&255,_=l.rgba>>16&255,m=l.rgba>>8&255,C=v.rgba>>24&255,b=v.rgba>>16&255,y=v.rgba>>8&255;return a=C+Math.round((g-C)*n),c=b+Math.round((_-b)*n),u=y+Math.round((m-y)*n),{css:d.toCss(a,c,u),rgba:d.toRgba(a,c,u)}},i.isOpaque=function(v){return(255&v.rgba)==255},i.ensureContrastRatio=function(v,l,g){const _=e.ensureContrastRatio(v.rgba,l.rgba,g);if(_)return d.toColor(_>>24&255,_>>16&255,_>>8&255)},i.opaque=function(v){const l=(255|v.rgba)>>>0;return[a,c,u]=e.toChannels(l),{css:d.toCss(a,c,u),rgba:l}},i.opacity=h,i.multiplyOpacity=function(v,l){return n=255&v.rgba,h(v,n*l/255)},i.toColorRGB=function(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}})(f||(s.color=f={})),(function(i){let h,v;try{const l=document.createElement("canvas");l.width=1,l.height=1;const g=l.getContext("2d",{willReadFrequently:!0});g&&(h=g,h.globalCompositeOperation="copy",v=h.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return a=parseInt(l.slice(1,2).repeat(2),16),c=parseInt(l.slice(2,3).repeat(2),16),u=parseInt(l.slice(3,4).repeat(2),16),d.toColor(a,c,u);case 5:return a=parseInt(l.slice(1,2).repeat(2),16),c=parseInt(l.slice(2,3).repeat(2),16),u=parseInt(l.slice(3,4).repeat(2),16),n=parseInt(l.slice(4,5).repeat(2),16),d.toColor(a,c,u,n);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}const g=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return a=parseInt(g[1]),c=parseInt(g[2]),u=parseInt(g[3]),n=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),d.toColor(a,c,u,n);if(!h||!v)throw new Error("css.toColor: Unsupported css format");if(h.fillStyle=v,h.fillStyle=l,typeof h.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(h.fillRect(0,0,1,1),[a,c,u,n]=h.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,c,u,n),css:l}}})(p||(s.css=p={})),(function(i){function h(v,l,g){const _=v/255,m=l/255,C=g/255;return .2126*(_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}i.relativeLuminance=function(v){return h(v>>16&255,v>>8&255,255&v)},i.relativeLuminance2=h})(o||(s.rgb=o={})),(function(i){function h(l,g,_){const m=l>>24&255,C=l>>16&255,b=l>>8&255;let y=g>>24&255,w=g>>16&255,R=g>>8&255,D=t(o.relativeLuminance2(y,w,R),o.relativeLuminance2(m,C,b));for(;D<_&&(y>0||w>0||R>0);)y-=Math.max(0,Math.ceil(.1*y)),w-=Math.max(0,Math.ceil(.1*w)),R-=Math.max(0,Math.ceil(.1*R)),D=t(o.relativeLuminance2(y,w,R),o.relativeLuminance2(m,C,b));return(y<<24|w<<16|R<<8|255)>>>0}function v(l,g,_){const m=l>>24&255,C=l>>16&255,b=l>>8&255;let y=g>>24&255,w=g>>16&255,R=g>>8&255,D=t(o.relativeLuminance2(y,w,R),o.relativeLuminance2(m,C,b));for(;D<_&&(y<255||w<255||R<255);)y=Math.min(255,y+Math.ceil(.1*(255-y))),w=Math.min(255,w+Math.ceil(.1*(255-w))),R=Math.min(255,R+Math.ceil(.1*(255-R))),D=t(o.relativeLuminance2(y,w,R),o.relativeLuminance2(m,C,b));return(y<<24|w<<16|R<<8|255)>>>0}i.blend=function(l,g){if(n=(255&g)/255,n===1)return g;const _=g>>24&255,m=g>>16&255,C=g>>8&255,b=l>>24&255,y=l>>16&255,w=l>>8&255;return a=b+Math.round((_-b)*n),c=y+Math.round((m-y)*n),u=w+Math.round((C-w)*n),d.toRgba(a,c,u)},i.ensureContrastRatio=function(l,g,_){const m=o.relativeLuminance(l>>8),C=o.relativeLuminance(g>>8);if(t(m,C)<_){if(C<m){const w=h(l,g,_),R=t(m,o.relativeLuminance(w>>8));if(R<_){const D=v(l,g,_);return R>t(m,o.relativeLuminance(D>>8))?w:D}return w}const b=v(l,g,_),y=t(m,o.relativeLuminance(b>>8));if(y<_){const w=h(l,g,_);return y>t(m,o.relativeLuminance(w>>8))?b:w}return b}},i.reduceLuminance=h,i.increaseLuminance=v,i.toChannels=function(l){return[l>>24&255,l>>16&255,l>>8&255,255&l]}})(e||(s.rgba=e={})),s.toPaddedHex=r,s.contrastRatio=t},8969:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=a(844),u=a(2585),n=a(4348),d=a(7866),f=a(744),p=a(7302),o=a(6975),e=a(8460),r=a(1753),t=a(1480),i=a(7994),h=a(9282),v=a(5435),l=a(5981),g=a(2660);let _=!1;class m extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event((b=>{var y;(y=this._onScrollApi)==null||y.fire(b.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(b){for(const y in b)this.optionsService.options[y]=b[y]}constructor(b){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new p.OptionsService(b)),this._instantiationService.setService(u.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(u.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(u.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(o.CoreService)),this._instantiationService.setService(u.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(r.CoreMouseService)),this._instantiationService.setService(u.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(t.UnicodeService)),this._instantiationService.setService(u.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(u.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(g.OscLinkService),this._instantiationService.setService(u.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.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((y=>{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((y=>{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 l.WriteBuffer(((y,w)=>this._inputHandler.parse(y,w)))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(b,y){this._writeBuffer.write(b,y)}writeSync(b,y){this._logService.logLevel<=u.LogLevelEnum.WARN&&!_&&(this._logService.warn("writeSync is unreliable and will be removed soon."),_=!0),this._writeBuffer.writeSync(b,y)}input(b,y=!0){this.coreService.triggerDataEvent(b,y)}resize(b,y){isNaN(b)||isNaN(y)||(b=Math.max(b,f.MINIMUM_COLS),y=Math.max(y,f.MINIMUM_ROWS),this._bufferService.resize(b,y))}scroll(b,y=!1){this._bufferService.scroll(b,y)}scrollLines(b,y,w){this._bufferService.scrollLines(b,y,w)}scrollPages(b){this.scrollLines(b*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(b){const y=b-this._bufferService.buffer.ydisp;y!==0&&this.scrollLines(y)}registerEscHandler(b,y){return this._inputHandler.registerEscHandler(b,y)}registerDcsHandler(b,y){return this._inputHandler.registerDcsHandler(b,y)}registerCsiHandler(b,y){return this._inputHandler.registerCsiHandler(b,y)}registerOscHandler(b,y){return this._inputHandler.registerOscHandler(b,y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let b=!1;const y=this.optionsService.rawOptions.windowsPty;y&&y.buildNumber!==void 0&&y.buildNumber!==void 0?b=y.backend==="conpty"&&y.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(b=!0),b?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const b=[];b.push(this.onLineFeed(h.updateWindowsModeWrappedState.bind(null,this._bufferService))),b.push(this.registerCsiHandler({final:"H"},(()=>((0,h.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const y of b)y.dispose()}))}}}s.CoreTerminal=m},8460:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const u=[];for(let n=0;n<this._listeners.length;n++)u.push(this._listeners[n]);for(let n=0;n<u.length;n++)u[n].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((u=>c.fire(u)))},s.runAndSubscribe=function(a,c){return c(void 0),a((u=>c(u)))}},5435:function(B,s,a){var c=this&&this.__decorate||function(A,S,x,E){var k,I=arguments.length,F=I<3?S:E===null?E=Object.getOwnPropertyDescriptor(S,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(A,S,x,E);else for(var N=A.length-1;N>=0;N--)(k=A[N])&&(F=(I<3?k(F):I>3?k(S,x,F):k(S,x))||F);return I>3&&F&&Object.defineProperty(S,x,F),F},u=this&&this.__param||function(A,S){return function(x,E){S(x,E,A)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const n=a(2584),d=a(7116),f=a(2015),p=a(844),o=a(482),e=a(8437),r=a(8460),t=a(643),i=a(511),h=a(3734),v=a(2585),l=a(1480),g=a(6242),_=a(6351),m=a(5941),C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},b=131072;function y(A,S){if(A>24)return S.setWinLines||!1;switch(A){case 1:return!!S.restoreWin;case 2:return!!S.minimizeWin;case 3:return!!S.setWinPosition;case 4:return!!S.setWinSizePixels;case 5:return!!S.raiseWin;case 6:return!!S.lowerWin;case 7:return!!S.refreshWin;case 8:return!!S.setWinSizeChars;case 9:return!!S.maximizeWin;case 10:return!!S.fullscreenWin;case 11:return!!S.getWinState;case 13:return!!S.getWinPosition;case 14:return!!S.getWinSizePixels;case 15:return!!S.getScreenSizePixels;case 16:return!!S.getCellSizePixels;case 18:return!!S.getWinSizeChars;case 19:return!!S.getScreenSizeChars;case 20:return!!S.getIconTitle;case 21:return!!S.getWinTitle;case 22:return!!S.pushTitle;case 23:return!!S.popTitle;case 24:return!!S.setWinLines}return!1}var w;(function(A){A[A.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",A[A.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(s.WindowsOptionsReportType=w={}));let R=0;class D extends p.Disposable{getAttrData(){return this._curAttrData}constructor(S,x,E,k,I,F,N,z,M=new f.EscapeSequenceParser){super(),this._bufferService=S,this._charsetService=x,this._coreService=E,this._logService=k,this._optionsService=I,this._oscLinkService=F,this._coreMouseService=N,this._unicodeService=z,this._parser=M,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new o.StringToUtf32,this._utf8Decoder=new o.Utf8ToUtf32,this._workCell=new i.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new r.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new r.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new r.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new r.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new r.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new r.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new r.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new r.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new r.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new r.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new r.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new r.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 P(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._parser.setCsiHandlerFallback(((L,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:H.toArray()})})),this._parser.setEscHandlerFallback((L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})})),this._parser.setExecuteHandlerFallback((L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})})),this._parser.setOscHandlerFallback(((L,H,O)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:H,data:O})})),this._parser.setDcsHandlerFallback(((L,H,O)=>{H==="HOOK"&&(O=O.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:H,payload:O})})),this._parser.setPrintHandler(((L,H,O)=>this.print(L,H,O))),this._parser.registerCsiHandler({final:"@"},(L=>this.insertChars(L))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(L=>this.scrollLeft(L))),this._parser.registerCsiHandler({final:"A"},(L=>this.cursorUp(L))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(L=>this.scrollRight(L))),this._parser.registerCsiHandler({final:"B"},(L=>this.cursorDown(L))),this._parser.registerCsiHandler({final:"C"},(L=>this.cursorForward(L))),this._parser.registerCsiHandler({final:"D"},(L=>this.cursorBackward(L))),this._parser.registerCsiHandler({final:"E"},(L=>this.cursorNextLine(L))),this._parser.registerCsiHandler({final:"F"},(L=>this.cursorPrecedingLine(L))),this._parser.registerCsiHandler({final:"G"},(L=>this.cursorCharAbsolute(L))),this._parser.registerCsiHandler({final:"H"},(L=>this.cursorPosition(L))),this._parser.registerCsiHandler({final:"I"},(L=>this.cursorForwardTab(L))),this._parser.registerCsiHandler({final:"J"},(L=>this.eraseInDisplay(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(L=>this.eraseInDisplay(L,!0))),this._parser.registerCsiHandler({final:"K"},(L=>this.eraseInLine(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(L=>this.eraseInLine(L,!0))),this._parser.registerCsiHandler({final:"L"},(L=>this.insertLines(L))),this._parser.registerCsiHandler({final:"M"},(L=>this.deleteLines(L))),this._parser.registerCsiHandler({final:"P"},(L=>this.deleteChars(L))),this._parser.registerCsiHandler({final:"S"},(L=>this.scrollUp(L))),this._parser.registerCsiHandler({final:"T"},(L=>this.scrollDown(L))),this._parser.registerCsiHandler({final:"X"},(L=>this.eraseChars(L))),this._parser.registerCsiHandler({final:"Z"},(L=>this.cursorBackwardTab(L))),this._parser.registerCsiHandler({final:"`"},(L=>this.charPosAbsolute(L))),this._parser.registerCsiHandler({final:"a"},(L=>this.hPositionRelative(L))),this._parser.registerCsiHandler({final:"b"},(L=>this.repeatPrecedingCharacter(L))),this._parser.registerCsiHandler({final:"c"},(L=>this.sendDeviceAttributesPrimary(L))),this._parser.registerCsiHandler({prefix:">",final:"c"},(L=>this.sendDeviceAttributesSecondary(L))),this._parser.registerCsiHandler({final:"d"},(L=>this.linePosAbsolute(L))),this._parser.registerCsiHandler({final:"e"},(L=>this.vPositionRelative(L))),this._parser.registerCsiHandler({final:"f"},(L=>this.hVPosition(L))),this._parser.registerCsiHandler({final:"g"},(L=>this.tabClear(L))),this._parser.registerCsiHandler({final:"h"},(L=>this.setMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(L=>this.setModePrivate(L))),this._parser.registerCsiHandler({final:"l"},(L=>this.resetMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(L=>this.resetModePrivate(L))),this._parser.registerCsiHandler({final:"m"},(L=>this.charAttributes(L))),this._parser.registerCsiHandler({final:"n"},(L=>this.deviceStatus(L))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(L=>this.deviceStatusPrivate(L))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(L=>this.softReset(L))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(L=>this.setCursorStyle(L))),this._parser.registerCsiHandler({final:"r"},(L=>this.setScrollRegion(L))),this._parser.registerCsiHandler({final:"s"},(L=>this.saveCursor(L))),this._parser.registerCsiHandler({final:"t"},(L=>this.windowOptions(L))),this._parser.registerCsiHandler({final:"u"},(L=>this.restoreCursor(L))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(L=>this.insertColumns(L))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(L=>this.deleteColumns(L))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(L=>this.selectProtected(L))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(L=>this.requestMode(L,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(L=>this.requestMode(L,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new g.OscHandler((L=>(this.setTitle(L),this.setIconName(L),!0)))),this._parser.registerOscHandler(1,new g.OscHandler((L=>this.setIconName(L)))),this._parser.registerOscHandler(2,new g.OscHandler((L=>this.setTitle(L)))),this._parser.registerOscHandler(4,new g.OscHandler((L=>this.setOrReportIndexedColor(L)))),this._parser.registerOscHandler(8,new g.OscHandler((L=>this.setHyperlink(L)))),this._parser.registerOscHandler(10,new g.OscHandler((L=>this.setOrReportFgColor(L)))),this._parser.registerOscHandler(11,new g.OscHandler((L=>this.setOrReportBgColor(L)))),this._parser.registerOscHandler(12,new g.OscHandler((L=>this.setOrReportCursorColor(L)))),this._parser.registerOscHandler(104,new g.OscHandler((L=>this.restoreIndexedColor(L)))),this._parser.registerOscHandler(110,new g.OscHandler((L=>this.restoreFgColor(L)))),this._parser.registerOscHandler(111,new g.OscHandler((L=>this.restoreBgColor(L)))),this._parser.registerOscHandler(112,new g.OscHandler((L=>this.restoreCursorColor(L)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const L in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},(()=>this.selectCharset("("+L))),this._parser.registerEscHandler({intermediates:")",final:L},(()=>this.selectCharset(")"+L))),this._parser.registerEscHandler({intermediates:"*",final:L},(()=>this.selectCharset("*"+L))),this._parser.registerEscHandler({intermediates:"+",final:L},(()=>this.selectCharset("+"+L))),this._parser.registerEscHandler({intermediates:"-",final:L},(()=>this.selectCharset("-"+L))),this._parser.registerEscHandler({intermediates:".",final:L},(()=>this.selectCharset("."+L))),this._parser.registerEscHandler({intermediates:"/",final:L},(()=>this.selectCharset("/"+L)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((L=>(this._logService.error("Parsing error: ",L),L))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new _.DcsHandler(((L,H)=>this.requestStatusString(L,H))))}_preserveStack(S,x,E,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=S,this._parseStack.cursorStartY=x,this._parseStack.decodedLength=E,this._parseStack.position=k}_logSlowResolvingAsync(S){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([S,new Promise(((x,E)=>setTimeout((()=>E("#SLOW_TIMEOUT")),5e3)))]).catch((x=>{if(x!=="#SLOW_TIMEOUT")throw x;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(S,x){let E,k=this._activeBuffer.x,I=this._activeBuffer.y,F=0;const N=this._parseStack.paused;if(N){if(E=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,x))return this._logSlowResolvingAsync(E),E;k=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,S.length>b&&(F=this._parseStack.position+b)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof S=="string"?` "${S}"`:` "${Array.prototype.map.call(S,(L=>String.fromCharCode(L))).join("")}"`),typeof S=="string"?S.split("").map((L=>L.charCodeAt(0))):S),this._parseBuffer.length<S.length&&this._parseBuffer.length<b&&(this._parseBuffer=new Uint32Array(Math.min(S.length,b))),N||this._dirtyRowTracker.clearRange(),S.length>b)for(let L=F;L<S.length;L+=b){const H=L+b<S.length?L+b:S.length,O=typeof S=="string"?this._stringDecoder.decode(S.substring(L,H),this._parseBuffer):this._utf8Decoder.decode(S.subarray(L,H),this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,O))return this._preserveStack(k,I,O,L),this._logSlowResolvingAsync(E),E}else if(!N){const L=typeof S=="string"?this._stringDecoder.decode(S,this._parseBuffer):this._utf8Decoder.decode(S,this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,L))return this._preserveStack(k,I,L,0),this._logSlowResolvingAsync(E),E}this._activeBuffer.x===k&&this._activeBuffer.y===I||this._onCursorMove.fire();const z=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(z,this._bufferService.rows-1))}print(S,x,E){let k,I;const F=this._charsetService.charset,N=this._optionsService.rawOptions.screenReaderMode,z=this._bufferService.cols,M=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,H=this._curAttrData;let O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&E-x>0&&O.getWidth(this._activeBuffer.x-1)===2&&O.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let $=this._parser.precedingJoinState;for(let W=x;W<E;++W){if(k=S[W],k<127&&F){const ie=F[String.fromCharCode(k)];ie&&(k=ie.charCodeAt(0))}const K=this._unicodeService.charProperties(k,$);I=l.UnicodeService.extractWidth(K);const q=l.UnicodeService.extractShouldJoin(K),Z=q?l.UnicodeService.extractWidth($):0;if($=K,N&&this._onA11yChar.fire((0,o.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-Z>z){if(M){const ie=O;let j=this._activeBuffer.x-Z;for(this._activeBuffer.x=Z,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),O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Z>0&&O instanceof e.BufferLine&&O.copyCellsFrom(ie,j,0,Z,!1);j<z;)ie.setCellFromCodepoint(j++,0,1,H)}else if(this._activeBuffer.x=z-1,I===2)continue}if(q&&this._activeBuffer.x){const ie=O.getWidth(this._activeBuffer.x-1)?1:2;O.addCodepointToCell(this._activeBuffer.x-ie,k,I);for(let j=I-Z;--j>=0;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(L&&(O.insertCells(this._activeBuffer.x,I-Z,this._activeBuffer.getNullCell(H)),O.getWidth(z-1)===2&&O.setCellFromCodepoint(z-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,H)),O.setCellFromCodepoint(this._activeBuffer.x++,k,I,H),I>0)for(;--I;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=$,this._activeBuffer.x<z&&E-x>0&&O.getWidth(this._activeBuffer.x)===0&&!O.hasContent(this._activeBuffer.x)&&O.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(S,x){return S.final!=="t"||S.prefix||S.intermediates?this._parser.registerCsiHandler(S,x):this._parser.registerCsiHandler(S,(E=>!y(E.params[0],this._optionsService.rawOptions.windowOptions)||x(E)))}registerDcsHandler(S,x){return this._parser.registerDcsHandler(S,new _.DcsHandler(x))}registerEscHandler(S,x){return this._parser.registerEscHandler(S,x)}registerOscHandler(S,x){return this._parser.registerOscHandler(S,new g.OscHandler(x))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var S;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&&((S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&S.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const S=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-S),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(S=this._bufferService.cols-1){this._activeBuffer.x=Math.min(S,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(S,x){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=S,this._activeBuffer.y=this._activeBuffer.scrollTop+x):(this._activeBuffer.x=S,this._activeBuffer.y=x),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(S,x){this._restrictCursor(),this._setCursor(this._activeBuffer.x+S,this._activeBuffer.y+x)}cursorUp(S){const x=this._activeBuffer.y-this._activeBuffer.scrollTop;return x>=0?this._moveCursor(0,-Math.min(x,S.params[0]||1)):this._moveCursor(0,-(S.params[0]||1)),!0}cursorDown(S){const x=this._activeBuffer.scrollBottom-this._activeBuffer.y;return x>=0?this._moveCursor(0,Math.min(x,S.params[0]||1)):this._moveCursor(0,S.params[0]||1),!0}cursorForward(S){return this._moveCursor(S.params[0]||1,0),!0}cursorBackward(S){return this._moveCursor(-(S.params[0]||1),0),!0}cursorNextLine(S){return this.cursorDown(S),this._activeBuffer.x=0,!0}cursorPrecedingLine(S){return this.cursorUp(S),this._activeBuffer.x=0,!0}cursorCharAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(S){return this._setCursor(S.length>=2?(S.params[1]||1)-1:0,(S.params[0]||1)-1),!0}charPosAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(S){return this._moveCursor(S.params[0]||1,0),!0}linePosAbsolute(S){return this._setCursor(this._activeBuffer.x,(S.params[0]||1)-1),!0}vPositionRelative(S){return this._moveCursor(0,S.params[0]||1),!0}hVPosition(S){return this.cursorPosition(S),!0}tabClear(S){const x=S.params[0];return x===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:x===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=S.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=S.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(S){const x=S.params[0];return x===1&&(this._curAttrData.bg|=536870912),x!==2&&x!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(S,x,E,k=!1,I=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);F.replaceCells(x,E,this._activeBuffer.getNullCell(this._eraseAttrData()),I),k&&(F.isWrapped=!1)}_resetBufferLine(S,x=!1){const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);E&&(E.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),x),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+S),E.isWrapped=!1)}eraseInDisplay(S,x=!1){let E;switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);E<this._bufferService.rows;E++)this._resetBufferLine(E,x);this._dirtyRowTracker.markDirty(E);break;case 1:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E,0,this._activeBuffer.x+1,!0,x),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(E+1).isWrapped=!1);E--;)this._resetBufferLine(E,x);this._dirtyRowTracker.markDirty(0);break;case 2:for(E=this._bufferService.rows,this._dirtyRowTracker.markDirty(E-1);E--;)this._resetBufferLine(E,x);this._dirtyRowTracker.markDirty(0);break;case 3:const k=this._activeBuffer.lines.length-this._bufferService.rows;k>0&&(this._activeBuffer.lines.trimStart(k),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-k,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-k,0),this._onScroll.fire(0))}return!0}eraseInLine(S,x=!1){switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,x);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,x)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(S){this._restrictCursor();let x=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;x--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(E,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(S){this._restrictCursor();let x=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=this._activeBuffer.ybase+this._activeBuffer.y;let k;for(k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-k;x--;)this._activeBuffer.lines.splice(E,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(S){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.insertCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(S){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.deleteCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(S){let x=S.params[0]||1;for(;x--;)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(S){let x=S.params[0]||1;for(;x--;)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(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=S.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);k.deleteCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=S.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);k.insertCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=S.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);k.insertCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=S.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);k.deleteCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(S){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(S.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(S){const x=this._parser.precedingJoinState;if(!x)return!0;const E=S.params[0]||1,k=l.UnicodeService.extractWidth(x),I=this._activeBuffer.x-k,F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),N=new Uint32Array(F.length*E);let z=0;for(let L=0;L<F.length;){const H=F.codePointAt(L)||0;N[z++]=H,L+=H>65535?2:1}let M=z;for(let L=1;L<E;++L)N.copyWithin(M,0,z),M+=z;return this.print(N,0,M),!0}sendDeviceAttributesPrimary(S){return S.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(S){return S.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(S.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(S){return(this._optionsService.rawOptions.termName+"").indexOf(S)===0}setMode(S){for(let x=0;x<S.length;x++)switch(S.params[x]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(S){for(let x=0;x<S.length;x++)switch(S.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.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(S){for(let x=0;x<S.length;x++)switch(S.params[x]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(S){for(let x=0;x<S.length;x++)switch(S.params[x]){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(),S.params[x]===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(S,x){const E=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:I}=this._coreMouseService,F=this._coreService,{buffers:N,cols:z}=this._bufferService,{active:M,alt:L}=N,H=this._optionsService.rawOptions,O=q=>q?1:2,$=S.params[0];return W=$,K=x?$===2?4:$===4?O(F.modes.insertMode):$===12?3:$===20?O(H.convertEol):0:$===1?O(E.applicationCursorKeys):$===3?H.windowOptions.setWinLines?z===80?2:z===132?1:0:0:$===6?O(E.origin):$===7?O(E.wraparound):$===8?3:$===9?O(k==="X10"):$===12?O(H.cursorBlink):$===25?O(!F.isCursorHidden):$===45?O(E.reverseWraparound):$===66?O(E.applicationKeypad):$===67?4:$===1e3?O(k==="VT200"):$===1002?O(k==="DRAG"):$===1003?O(k==="ANY"):$===1004?O(E.sendFocus):$===1005?4:$===1006?O(I==="SGR"):$===1015?4:$===1016?O(I==="SGR_PIXELS"):$===1048?1:$===47||$===1047||$===1049?O(M===L):$===2004?O(E.bracketedPasteMode):0,F.triggerDataEvent(`${n.C0.ESC}[${x?"":"?"}${W};${K}$y`),!0;var W,K}_updateAttrColor(S,x,E,k,I){return x===2?(S|=50331648,S&=-16777216,S|=h.AttributeData.fromColorRGB([E,k,I])):x===5&&(S&=-50331904,S|=33554432|255&E),S}_extractColor(S,x,E){const k=[0,0,-1,0,0,0];let I=0,F=0;do{if(k[F+I]=S.params[x+F],S.hasSubParams(x+F)){const N=S.getSubParams(x+F);let z=0;do k[1]===5&&(I=1),k[F+z+1+I]=N[z];while(++z<N.length&&z+F+1+I<k.length);break}if(k[1]===5&&F+I>=2||k[1]===2&&F+I>=5)break;k[1]&&(I=1)}while(++F+x<S.length&&F+I<k.length);for(let N=2;N<k.length;++N)k[N]===-1&&(k[N]=0);switch(k[0]){case 38:E.fg=this._updateAttrColor(E.fg,k[1],k[3],k[4],k[5]);break;case 48:E.bg=this._updateAttrColor(E.bg,k[1],k[3],k[4],k[5]);break;case 58:E.extended=E.extended.clone(),E.extended.underlineColor=this._updateAttrColor(E.extended.underlineColor,k[1],k[3],k[4],k[5])}return F}_processUnderline(S,x){x.extended=x.extended.clone(),(!~S||S>5)&&(S=1),x.extended.underlineStyle=S,x.fg|=268435456,S===0&&(x.fg&=-268435457),x.updateExtended()}_processSGR0(S){S.fg=e.DEFAULT_ATTR_DATA.fg,S.bg=e.DEFAULT_ATTR_DATA.bg,S.extended=S.extended.clone(),S.extended.underlineStyle=0,S.extended.underlineColor&=-67108864,S.updateExtended()}charAttributes(S){if(S.length===1&&S.params[0]===0)return this._processSGR0(this._curAttrData),!0;const x=S.length;let E;const k=this._curAttrData;for(let I=0;I<x;I++)E=S.params[I],E>=30&&E<=37?(k.fg&=-50331904,k.fg|=16777216|E-30):E>=40&&E<=47?(k.bg&=-50331904,k.bg|=16777216|E-40):E>=90&&E<=97?(k.fg&=-50331904,k.fg|=16777224|E-90):E>=100&&E<=107?(k.bg&=-50331904,k.bg|=16777224|E-100):E===0?this._processSGR0(k):E===1?k.fg|=134217728:E===3?k.bg|=67108864:E===4?(k.fg|=268435456,this._processUnderline(S.hasSubParams(I)?S.getSubParams(I)[0]:1,k)):E===5?k.fg|=536870912:E===7?k.fg|=67108864:E===8?k.fg|=1073741824:E===9?k.fg|=2147483648:E===2?k.bg|=134217728:E===21?this._processUnderline(2,k):E===22?(k.fg&=-134217729,k.bg&=-134217729):E===23?k.bg&=-67108865:E===24?(k.fg&=-268435457,this._processUnderline(0,k)):E===25?k.fg&=-536870913:E===27?k.fg&=-67108865:E===28?k.fg&=-1073741825:E===29?k.fg&=2147483647:E===39?(k.fg&=-67108864,k.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):E===49?(k.bg&=-67108864,k.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):E===38||E===48||E===58?I+=this._extractColor(S,I,k):E===53?k.bg|=1073741824:E===55?k.bg&=-1073741825:E===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):E===100?(k.fg&=-67108864,k.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,k.bg&=-67108864,k.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",E);return!0}deviceStatus(S){switch(S.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const x=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${x};${E}R`)}return!0}deviceStatusPrivate(S){if(S.params[0]===6){const x=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${x};${E}R`)}return!0}softReset(S){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=e.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(S){const x=S.params[0]||1;switch(x){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const E=x%2==1;return this._optionsService.options.cursorBlink=E,!0}setScrollRegion(S){const x=S.params[0]||1;let E;return(S.length<2||(E=S.params[1])>this._bufferService.rows||E===0)&&(E=this._bufferService.rows),E>x&&(this._activeBuffer.scrollTop=x-1,this._activeBuffer.scrollBottom=E-1,this._setCursor(0,0)),!0}windowOptions(S){if(!y(S.params[0],this._optionsService.rawOptions.windowOptions))return!0;const x=S.length>1?S.params[1]:0;switch(S.params[0]){case 14:x!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:x!==0&&x!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),x!==0&&x!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:x!==0&&x!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),x!==0&&x!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(S){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(S){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(S){return this._windowTitle=S,this._onTitleChange.fire(S),!0}setIconName(S){return this._iconName=S,!0}setOrReportIndexedColor(S){const x=[],E=S.split(";");for(;E.length>1;){const k=E.shift(),I=E.shift();if(/^\d+$/.exec(k)){const F=parseInt(k);if(T(F))if(I==="?")x.push({type:0,index:F});else{const N=(0,m.parseColor)(I);N&&x.push({type:1,index:F,color:N})}}}return x.length&&this._onColor.fire(x),!0}setHyperlink(S){const x=S.split(";");return!(x.length<2)&&(x[1]?this._createHyperlink(x[0],x[1]):!x[0]&&this._finishHyperlink())}_createHyperlink(S,x){this._getCurrentLinkId()&&this._finishHyperlink();const E=S.split(":");let k;const I=E.findIndex((F=>F.startsWith("id=")));return I!==-1&&(k=E[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:k,uri:x}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(S,x){const E=S.split(";");for(let k=0;k<E.length&&!(x>=this._specialColors.length);++k,++x)if(E[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[x]}]);else{const I=(0,m.parseColor)(E[k]);I&&this._onColor.fire([{type:1,index:this._specialColors[x],color:I}])}return!0}setOrReportFgColor(S){return this._setOrReportSpecialColor(S,0)}setOrReportBgColor(S){return this._setOrReportSpecialColor(S,1)}setOrReportCursorColor(S){return this._setOrReportSpecialColor(S,2)}restoreIndexedColor(S){if(!S)return this._onColor.fire([{type:2}]),!0;const x=[],E=S.split(";");for(let k=0;k<E.length;++k)if(/^\d+$/.exec(E[k])){const I=parseInt(E[k]);T(I)&&x.push({type:2,index:I})}return x.length&&this._onColor.fire(x),!0}restoreFgColor(S){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(S){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(S){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,d.DEFAULT_CHARSET),!0}selectCharset(S){return S.length!==2?(this.selectDefaultCharset(),!0):(S[0]==="/"||this._charsetService.setgCharset(C[S[0]],d.CHARSETS[S[1]]||d.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const S=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,S,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=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(S){return this._charsetService.setgLevel(S),!0}screenAlignmentPattern(){const S=new i.CellData;S.content=4194373,S.fg=this._curAttrData.fg,S.bg=this._curAttrData.bg,this._setCursor(0,0);for(let x=0;x<this._bufferService.rows;++x){const E=this._activeBuffer.ybase+this._activeBuffer.y+x,k=this._activeBuffer.lines.get(E);k&&(k.fill(S),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(S,x){const E=this._bufferService.buffer,k=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${I}${n.C0.ESC}\\`),!0))(S==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:S==='"p'?'P1$r61;1"p':S==="r"?`P1$r${E.scrollTop+1};${E.scrollBottom+1}r`:S==="m"?"P1$r0m":S===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(S,x){this._dirtyRowTracker.markRangeDirty(S,x)}}s.InputHandler=D;let P=class{constructor(A){this._bufferService=A,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(A){A<this.start?this.start=A:A>this.end&&(this.end=A)}markRangeDirty(A,S){A>S&&(R=A,A=S,S=R),A<this.start&&(this.start=A),S>this.end&&(this.end=S)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function T(A){return 0<=A&&A<256}P=c([u(0,v.IBufferService)],P)},844:(B,s)=>{function a(c){for(const u of c)u.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const u=this._disposables.indexOf(c);u!==-1&&this._disposables.splice(u,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var u;this._isDisposed||c===this._value||((u=this._value)==null||u.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},1505:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(u,n,d){this._data[u]||(this._data[u]={}),this._data[u][n]=d}get(u,n){return this._data[u]?this._data[u][n]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,u,n,d,f){this._data.get(c,u)||this._data.set(c,u,new a),this._data.get(c,u).set(n,d,f)}get(c,u,n,d){var f;return(f=this._data.get(c,u))==null?void 0:f.get(n,d)}clear(){this._data.clear()}}},6114:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const a=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const u=a.match(/Version\/(\d+)/);return u===null||u.length<2?0:parseInt(u[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(a=this._search(this._getKey(c)),this._array.splice(a,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const u=this._getKey(c);if(u===void 0||(a=this._search(u),a===-1)||this._getKey(this._array[a])!==u)return!1;do if(this._array[a]===c)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===u);return!1}*getKeyIterator(c){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===c)}forEachByKey(c,u){if(this._array.length!==0&&(a=this._search(c),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===c))do u(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===c)}values(){return[...this._array].values()}_search(c){let u=0,n=this._array.length-1;for(;n>=u;){let d=u+n>>1;const f=this._getKey(this._array[d]);if(f>c)n=d-1;else{if(!(f<c)){for(;d>0&&this._getKey(this._array[d-1])===c;)d--;return d}u=d+1}}return u}}},7226:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=a(6114);class u{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let p=0,o=0,e=f.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(p=Date.now(),this._tasks[this._i]()||this._i++,p=Math.max(1,Date.now()-p),o=Math.max(p,o),r=f.timeRemaining(),1.5*o>r)return e-p<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-p))}ms`),void this._start();e=r}this.clear()}}class n extends u{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const p=Date.now()+f;return{timeRemaining:()=>Math.max(0,p-Date.now())}}}s.PriorityTaskQueue=n,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends u{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=a(643);s.updateWindowsModeWrappedState=function(u){const n=u.buffer.lines.get(u.buffer.ybase+u.buffer.y-1),d=n==null?void 0:n.get(u.cols-1),f=u.buffer.lines.get(u.buffer.ybase+u.buffer.y);f&&d&&(f.isWrapped=d[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&d[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=a(6349),u=a(7226),n=a(3734),d=a(8437),f=a(4634),p=a(511),o=a(643),e=a(4863),r=a(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(t,i,h){this._hasScrollback=t,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=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=r.DEFAULT_CHARSET,this.markers=[],this._nullCell=p.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=p.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new u.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(t,i){return new d.BufferLine(this._bufferService.cols,this.getNullCell(t),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;const i=t+this._optionsService.rawOptions.scrollback;return i>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:i}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=d.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,i){const h=this.getNullCell(d.DEFAULT_ATTR_DATA);let v=0;const l=this._getCorrectBufferLength(i);if(l>this.lines.maxLength&&(this.lines.maxLength=l),this.lines.length>0){if(this._cols<t)for(let _=0;_<this.lines.length;_++)v+=+this.lines.get(_).resize(t,h);let g=0;if(this._rows<i)for(let _=this._rows;_<i;_++)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 d.BufferLine(t,h)):this.ybase>0&&this.lines.length<=this.ybase+this.y+g+1?(this.ybase--,g++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(t,h)));else for(let _=this._rows;_>i;_--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(l<this.lines.maxLength){const _=this.lines.length-l;_>0&&(this.lines.trimStart(_),this.ybase=Math.max(this.ybase-_,0),this.ydisp=Math.max(this.ydisp-_,0),this.savedY=Math.max(this.savedY-_,0)),this.lines.maxLength=l}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,i-1),g&&(this.y+=g),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(t,i),this._cols>t))for(let g=0;g<this.lines.length;g++)v+=+this.lines.get(g).resize(t,h);this._cols=t,this._rows=i,this._memoryCleanupQueue.clear(),v>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return t}get _isReflowEnabled(){const t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,i){this._cols!==t&&(t>this._cols?this._reflowLarger(t,i):this._reflowSmaller(t,i))}_reflowLarger(t,i){const h=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(h.length>0){const v=(0,f.reflowLargerCreateNewLayout)(this.lines,h);(0,f.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(t,i,v.countRemoved)}}_reflowLargerAdjustViewport(t,i,h){const v=this.getNullCell(d.DEFAULT_ATTR_DATA);let l=h;for(;l-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new d.BufferLine(t,v))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-h,0)}_reflowSmaller(t,i){const h=this.getNullCell(d.DEFAULT_ATTR_DATA),v=[];let l=0;for(let g=this.lines.length-1;g>=0;g--){let _=this.lines.get(g);if(!_||!_.isWrapped&&_.getTrimmedLength()<=t)continue;const m=[_];for(;_.isWrapped&&g>0;)_=this.lines.get(--g),m.unshift(_);const C=this.ybase+this.y;if(C>=g&&C<g+m.length)continue;const b=m[m.length-1].getTrimmedLength(),y=(0,f.reflowSmallerGetNewLineLengths)(m,this._cols,t),w=y.length-m.length;let R;R=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+w):Math.max(0,this.lines.length-this.lines.maxLength+w);const D=[];for(let E=0;E<w;E++){const k=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);D.push(k)}D.length>0&&(v.push({start:g+m.length+l,newLines:D}),l+=D.length),m.push(...D);let P=y.length-1,T=y[P];T===0&&(P--,T=y[P]);let A=m.length-w-1,S=b;for(;A>=0;){const E=Math.min(S,T);if(m[P]===void 0)break;if(m[P].copyCellsFrom(m[A],S-E,T-E,E,!0),T-=E,T===0&&(P--,T=y[P]),S-=E,S===0){A--;const k=Math.max(A,0);S=(0,f.getWrappedLineTrimmedLength)(m,k,this._cols)}}for(let E=0;E<m.length;E++)y[E]<t&&m[E].setCell(y[E],h);let x=w-R;for(;x-- >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+l)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+w,this.ybase+i-1)}if(v.length>0){const g=[],_=[];for(let P=0;P<this.lines.length;P++)_.push(this.lines.get(P));const m=this.lines.length;let C=m-1,b=0,y=v[b];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let w=0;for(let P=Math.min(this.lines.maxLength-1,m+l-1);P>=0;P--)if(y&&y.start>C+w){for(let T=y.newLines.length-1;T>=0;T--)this.lines.set(P--,y.newLines[T]);P++,g.push({index:C+1,amount:y.newLines.length}),w+=y.newLines.length,y=v[++b]}else this.lines.set(P,_[C--]);let R=0;for(let P=g.length-1;P>=0;P--)g[P].index+=R,this.lines.onInsertEmitter.fire(g[P]),R+=g[P].amount;const D=Math.max(0,m+l-this.lines.maxLength);D>0&&this.lines.onTrimEmitter.fire(D)}}translateBufferLineToString(t,i,h=0,v){const l=this.lines.get(t);return l?l.translateToString(i,h,v):""}getWrappedRangeForLine(t){let i=t,h=t;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(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===t&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose(),this.markers.splice(t--,1);this._isClearing=!1}addMarker(t){const i=new e.Marker(t);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(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}}},8437:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=a(3734),u=a(511),n=a(643),d=a(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let f=0;class p{constructor(e,r,t=!1){this.isWrapped=t,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const i=r||u.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let h=0;h<e;++h)this.setCell(h,i);this.length=e}get(e){const r=this._data[3*e+0],t=2097151&r;return[this._data[3*e+1],2097152&r?this._combined[e]:t?(0,d.stringFromCodePoint)(t):"",r>>22,2097152&r?this._combined[e].charCodeAt(this._combined[e].length-1):t]}set(e,r){this._data[3*e+1]=r[n.CHAR_DATA_ATTR_INDEX],r[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=r[1],this._data[3*e+0]=2097152|e|r[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=r[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|r[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const r=this._data[3*e+0];return 2097152&r?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&r}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const r=this._data[3*e+0];return 2097152&r?this._combined[e]:2097151&r?(0,d.stringFromCodePoint)(2097151&r):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,r){return f=3*e,r.content=this._data[f+0],r.fg=this._data[f+1],r.bg=this._data[f+2],2097152&r.content&&(r.combinedData=this._combined[e]),268435456&r.bg&&(r.extended=this._extendedAttrs[e]),r}setCell(e,r){2097152&r.content&&(this._combined[e]=r.combinedData),268435456&r.bg&&(this._extendedAttrs[e]=r.extended),this._data[3*e+0]=r.content,this._data[3*e+1]=r.fg,this._data[3*e+2]=r.bg}setCellFromCodepoint(e,r,t,i){268435456&i.bg&&(this._extendedAttrs[e]=i.extended),this._data[3*e+0]=r|t<<22,this._data[3*e+1]=i.fg,this._data[3*e+2]=i.bg}addCodepointToCell(e,r,t){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,d.stringFromCodePoint)(r):2097151&i?(this._combined[e]=(0,d.stringFromCodePoint)(2097151&i)+(0,d.stringFromCodePoint)(r),i&=-2097152,i|=2097152):i=r|4194304,t&&(i&=-12582913,i|=t<<22),this._data[3*e+0]=i}insertCells(e,r,t){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,t),r<this.length-e){const i=new u.CellData;for(let h=this.length-e-r-1;h>=0;--h)this.setCell(e+r+h,this.loadCell(e+h,i));for(let h=0;h<r;++h)this.setCell(e+h,t)}else for(let i=e;i<this.length;++i)this.setCell(i,t);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,t)}deleteCells(e,r,t){if(e%=this.length,r<this.length-e){const i=new u.CellData;for(let h=0;h<this.length-e-r;++h)this.setCell(e+h,this.loadCell(e+r+h,i));for(let h=this.length-r;h<this.length;++h)this.setCell(h,t)}else for(let i=e;i<this.length;++i)this.setCell(i,t);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,t),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,t)}replaceCells(e,r,t,i=!1){if(i)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,t),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,t);e<r&&e<this.length;)this.isProtected(e)||this.setCell(e,t),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,t),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,t);e<r&&e<this.length;)this.setCell(e++,t)}resize(e,r){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const t=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*t)this._data=new Uint32Array(this._data.buffer,0,t);else{const i=new Uint32Array(t);i.set(this._data),this._data=i}for(let i=this.length;i<e;++i)this.setCell(i,r)}else{this._data=this._data.subarray(0,t);const i=Object.keys(this._combined);for(let v=0;v<i.length;v++){const l=parseInt(i[v],10);l>=e&&delete this._combined[l]}const h=Object.keys(this._extendedAttrs);for(let v=0;v<h.length;v++){const l=parseInt(h[v],10);l>=e&&delete this._extendedAttrs[l]}}return this.length=e,4*t*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,r=!1){if(r)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const r in e._combined)this._combined[r]=e._combined[r];this._extendedAttrs={};for(const r in e._extendedAttrs)this._extendedAttrs[r]=e._extendedAttrs[r];this.isWrapped=e.isWrapped}clone(){const e=new p(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const r in this._combined)e._combined[r]=this._combined[r];for(const r in this._extendedAttrs)e._extendedAttrs[r]=this._extendedAttrs[r];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,r,t,i,h){const v=e._data;if(h)for(let g=i-1;g>=0;g--){for(let _=0;_<3;_++)this._data[3*(t+g)+_]=v[3*(r+g)+_];268435456&v[3*(r+g)+2]&&(this._extendedAttrs[t+g]=e._extendedAttrs[r+g])}else for(let g=0;g<i;g++){for(let _=0;_<3;_++)this._data[3*(t+g)+_]=v[3*(r+g)+_];268435456&v[3*(r+g)+2]&&(this._extendedAttrs[t+g]=e._extendedAttrs[r+g])}const l=Object.keys(e._combined);for(let g=0;g<l.length;g++){const _=parseInt(l[g],10);_>=r&&(this._combined[_-r+t]=e._combined[_])}}translateToString(e,r,t,i){r=r??0,t=t??this.length,e&&(t=Math.min(t,this.getTrimmedLength())),i&&(i.length=0);let h="";for(;r<t;){const v=this._data[3*r+0],l=2097151&v,g=2097152&v?this._combined[r]:l?(0,d.stringFromCodePoint)(l):n.WHITESPACE_CELL_CHAR;if(h+=g,i)for(let _=0;_<g.length;++_)i.push(r);r+=v>>22||1}return i&&i.push(r),h}}s.BufferLine=p},4841:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,c){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return c*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(B,s)=>{function a(c,u,n){if(u===c.length-1)return c[u].getTrimmedLength();const d=!c[u].hasContent(n-1)&&c[u].getWidth(n-1)===1,f=c[u+1].getWidth(0)===2;return d&&f?n-1:n}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,u,n,d,f){const p=[];for(let o=0;o<c.length-1;o++){let e=o,r=c.get(++e);if(!r.isWrapped)continue;const t=[c.get(o)];for(;e<c.length&&r.isWrapped;)t.push(r),r=c.get(++e);if(d>=o&&d<e){o+=t.length-1;continue}let i=0,h=a(t,i,u),v=1,l=0;for(;v<t.length;){const _=a(t,v,u),m=_-l,C=n-h,b=Math.min(m,C);t[i].copyCellsFrom(t[v],l,h,b,!1),h+=b,h===n&&(i++,h=0),l+=b,l===_&&(v++,l=0),h===0&&i!==0&&t[i-1].getWidth(n-1)===2&&(t[i].copyCellsFrom(t[i-1],n-1,h++,1,!1),t[i-1].setCell(n-1,f))}t[i].replaceCells(h,n,f);let g=0;for(let _=t.length-1;_>0&&(_>i||t[_].getTrimmedLength()===0);_--)g++;g>0&&(p.push(o+t.length-g),p.push(g)),o+=t.length-1}return p},s.reflowLargerCreateNewLayout=function(c,u){const n=[];let d=0,f=u[d],p=0;for(let o=0;o<c.length;o++)if(f===o){const e=u[++d];c.onDeleteEmitter.fire({index:o-p,amount:e}),o+=e-1,p+=e,f=u[++d]}else n.push(o);return{layout:n,countRemoved:p}},s.reflowLargerApplyNewLayout=function(c,u){const n=[];for(let d=0;d<u.length;d++)n.push(c.get(u[d]));for(let d=0;d<n.length;d++)c.set(d,n[d]);c.length=u.length},s.reflowSmallerGetNewLineLengths=function(c,u,n){const d=[],f=c.map(((r,t)=>a(c,t,u))).reduce(((r,t)=>r+t));let p=0,o=0,e=0;for(;e<f;){if(f-e<n){d.push(f-e);break}p+=n;const r=a(c,o,u);p>r&&(p-=r,o++);const t=c[o].getWidth(p-1)===2;t&&p--;const i=t?n-1:n;d.push(i),e+=i}return d},s.getWrappedLineTrimmedLength=a},5295:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=a(8460),u=a(844),n=a(9092);class d extends u.Disposable{constructor(p,o){super(),this._optionsService=p,this._bufferService=o,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.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(p){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(p),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(p,o){this._normal.resize(p,o),this._alt.resize(p,o),this.setupTabStops(p)}setupTabStops(p){this._normal.setupTabStops(p),this._alt.setupTabStops(p)}}s.BufferSet=d},511:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=a(482),u=a(643),n=a(3734);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(p){const o=new d;return o.setFromCharData(p),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(p){this.fg=p[u.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(p[u.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(p[u.CHAR_DATA_CHAR_INDEX].length===2){const e=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const r=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(e-55296)+r-56320+65536|p[u.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[u.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=p[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|p[u.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=d},643:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=a(8460),u=a(844);class n{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,u.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}s.Marker=n,n._nextId=1},7116:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(B,s)=>{var a,c,u;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
8
+ `,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""})(a||(s.C0=a={})),(function(n){n.PAD="€",n.HOP="",n.BPH="‚",n.NBH="ƒ",n.IND="„",n.NEL="…",n.SSA="†",n.ESA="‡",n.HTS="ˆ",n.HTJ="‰",n.VTS="Š",n.PLD="‹",n.PLU="Œ",n.RI="",n.SS2="Ž",n.SS3="",n.DCS="",n.PU1="‘",n.PU2="’",n.STS="“",n.CCH="”",n.MW="•",n.SPA="–",n.EPA="—",n.SOS="˜",n.SGCI="™",n.SCI="š",n.CSI="›",n.ST="œ",n.OSC="",n.PM="ž",n.APC="Ÿ"})(c||(s.C1=c={})),(function(n){n.ST=`${a.ESC}\\`})(u||(s.C1_ESCAPED=u={}))},7399:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=a(2584),u={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(n,d,f,p){const o={type:0,cancel:!1,key:void 0},e=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?o.key=d?c.C0.ESC+"OA":c.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?o.key=d?c.C0.ESC+"OD":c.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?o.key=d?c.C0.ESC+"OC":c.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(o.key=d?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:o.key=n.ctrlKey?"\b":c.C0.DEL,n.altKey&&(o.key=c.C0.ESC+o.key);break;case 9:if(n.shiftKey){o.key=c.C0.ESC+"[Z";break}o.key=c.C0.HT,o.cancel=!0;break;case 13:o.key=n.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,o.cancel=!0;break;case 27:o.key=c.C0.ESC,n.altKey&&(o.key=c.C0.ESC+c.C0.ESC),o.cancel=!0;break;case 37:if(n.metaKey)break;e?(o.key=c.C0.ESC+"[1;"+(e+1)+"D",o.key===c.C0.ESC+"[1;3D"&&(o.key=c.C0.ESC+(f?"b":"[1;5D"))):o.key=d?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(o.key=c.C0.ESC+"[1;"+(e+1)+"C",o.key===c.C0.ESC+"[1;3C"&&(o.key=c.C0.ESC+(f?"f":"[1;5C"))):o.key=d?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(o.key=c.C0.ESC+"[1;"+(e+1)+"A",f||o.key!==c.C0.ESC+"[1;3A"||(o.key=c.C0.ESC+"[1;5A")):o.key=d?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(o.key=c.C0.ESC+"[1;"+(e+1)+"B",f||o.key!==c.C0.ESC+"[1;3B"||(o.key=c.C0.ESC+"[1;5B")):o.key=d?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(o.key=c.C0.ESC+"[2~");break;case 46:o.key=e?c.C0.ESC+"[3;"+(e+1)+"~":c.C0.ESC+"[3~";break;case 36:o.key=e?c.C0.ESC+"[1;"+(e+1)+"H":d?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:o.key=e?c.C0.ESC+"[1;"+(e+1)+"F":d?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:n.shiftKey?o.type=2:n.ctrlKey?o.key=c.C0.ESC+"[5;"+(e+1)+"~":o.key=c.C0.ESC+"[5~";break;case 34:n.shiftKey?o.type=3:n.ctrlKey?o.key=c.C0.ESC+"[6;"+(e+1)+"~":o.key=c.C0.ESC+"[6~";break;case 112:o.key=e?c.C0.ESC+"[1;"+(e+1)+"P":c.C0.ESC+"OP";break;case 113:o.key=e?c.C0.ESC+"[1;"+(e+1)+"Q":c.C0.ESC+"OQ";break;case 114:o.key=e?c.C0.ESC+"[1;"+(e+1)+"R":c.C0.ESC+"OR";break;case 115:o.key=e?c.C0.ESC+"[1;"+(e+1)+"S":c.C0.ESC+"OS";break;case 116:o.key=e?c.C0.ESC+"[15;"+(e+1)+"~":c.C0.ESC+"[15~";break;case 117:o.key=e?c.C0.ESC+"[17;"+(e+1)+"~":c.C0.ESC+"[17~";break;case 118:o.key=e?c.C0.ESC+"[18;"+(e+1)+"~":c.C0.ESC+"[18~";break;case 119:o.key=e?c.C0.ESC+"[19;"+(e+1)+"~":c.C0.ESC+"[19~";break;case 120:o.key=e?c.C0.ESC+"[20;"+(e+1)+"~":c.C0.ESC+"[20~";break;case 121:o.key=e?c.C0.ESC+"[21;"+(e+1)+"~":c.C0.ESC+"[21~";break;case 122:o.key=e?c.C0.ESC+"[23;"+(e+1)+"~":c.C0.ESC+"[23~";break;case 123:o.key=e?c.C0.ESC+"[24;"+(e+1)+"~":c.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(f&&!p||!n.altKey||n.metaKey)!f||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?o.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(o.key=c.C0.US),n.key==="@"&&(o.key=c.C0.NUL)):n.keyCode===65&&(o.type=1);else{const r=u[n.keyCode],t=r==null?void 0:r[n.shiftKey?1:0];if(t)o.key=c.C0.ESC+t;else if(n.keyCode>=65&&n.keyCode<=90){const i=n.ctrlKey?n.keyCode-64:n.keyCode+32;let h=String.fromCharCode(i);n.shiftKey&&(h=h.toUpperCase()),o.key=c.C0.ESC+h}else if(n.keyCode===32)o.key=c.C0.ESC+(n.ctrlKey?c.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let i=n.code.slice(3,4);n.shiftKey||(i=i.toLowerCase()),o.key=c.C0.ESC+i,o.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?o.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?o.key=c.C0.NUL:n.keyCode>=51&&n.keyCode<=55?o.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?o.key=c.C0.DEL:n.keyCode===219?o.key=c.C0.ESC:n.keyCode===220?o.key=c.C0.FS:n.keyCode===221&&(o.key=c.C0.GS)}return o}},482:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,c=0,u=a.length){let n="";for(let d=c;d<u;++d){let f=a[d];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const u=a.length;if(!u)return 0;let n=0,d=0;if(this._interim){const f=a.charCodeAt(d++);56320<=f&&f<=57343?c[n++]=1024*(this._interim-55296)+f-56320+65536:(c[n++]=this._interim,c[n++]=f),this._interim=0}for(let f=d;f<u;++f){const p=a.charCodeAt(f);if(55296<=p&&p<=56319){if(++f>=u)return this._interim=p,n;const o=a.charCodeAt(f);56320<=o&&o<=57343?c[n++]=1024*(p-55296)+o-56320+65536:(c[n++]=p,c[n++]=o)}else p!==65279&&(c[n++]=p)}return n}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const u=a.length;if(!u)return 0;let n,d,f,p,o=0,e=0,r=0;if(this.interim[0]){let h=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let l,g=0;for(;(l=63&this.interim[++g])&&g<4;)v<<=6,v|=l;const _=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=_-g;for(;r<m;){if(r>=u)return 0;if(l=a[r++],(192&l)!=128){r--,h=!0;break}this.interim[g++]=l,v<<=6,v|=63&l}h||(_===2?v<128?r--:c[o++]=v:_===3?v<2048||v>=55296&&v<=57343||v===65279||(c[o++]=v):v<65536||v>1114111||(c[o++]=v)),this.interim.fill(0)}const t=u-4;let i=r;for(;i<u;){for(;!(!(i<t)||128&(n=a[i])||128&(d=a[i+1])||128&(f=a[i+2])||128&(p=a[i+3]));)c[o++]=n,c[o++]=d,c[o++]=f,c[o++]=p,i+=4;if(n=a[i++],n<128)c[o++]=n;else if((224&n)==192){if(i>=u)return this.interim[0]=n,o;if(d=a[i++],(192&d)!=128){i--;continue}if(e=(31&n)<<6|63&d,e<128){i--;continue}c[o++]=e}else if((240&n)==224){if(i>=u)return this.interim[0]=n,o;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,o;if(f=a[i++],(192&f)!=128){i--;continue}if(e=(15&n)<<12|(63&d)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;c[o++]=e}else if((248&n)==240){if(i>=u)return this.interim[0]=n,o;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,o;if(f=a[i++],(192&f)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=f,o;if(p=a[i++],(192&p)!=128){i--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&f)<<6|63&p,e<65536||e>1114111)continue;c[o++]=e}}return o}}},225:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(1480),u=[[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]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let d;s.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let f=0;f<u.length;++f)d.fill(0,u[f][0],u[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?d[f]:(function(p,o){let e,r=0,t=o.length-1;if(p<o[0][0]||p>o[t][1])return!1;for(;t>=r;)if(e=r+t>>1,p>o[e][1])r=e+1;else{if(!(p<o[e][0]))return!0;t=e-1}return!1})(f,n)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,p){let o=this.wcwidth(f),e=o===0&&p!==0;if(e){const r=c.UnicodeService.extractWidth(p);r===0?e=!1:r>o&&(o=r)}return c.UnicodeService.createPropertyValue(0,o,e)}}},5981:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=a(8460),u=a(844);class n extends u.Disposable{constructor(f){super(),this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,p){if(p!==void 0&&this._syncCalls>p)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let o;for(this._isSyncWriting=!0;o=this._writeBuffer.shift();){this._action(o);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,p){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+=f.length,this._writeBuffer.push(f),this._callbacks.push(p),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(p)}_innerWrite(f=0,p=!0){const o=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],r=this._action(e,p);if(r){const i=h=>Date.now()-o>=12?setTimeout((()=>this._innerWrite(0,h))):this._innerWrite(o,h);return void r.catch((h=>(queueMicrotask((()=>{throw h})),Promise.resolve(!1)))).then(i)}const t=this._callbacks[this._bufferOffset];if(t&&t(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-o>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=n},5941:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function u(n,d){const f=n.toString(16),p=f.length<2?"0"+f:f;switch(d){case 4:return f[0];case 8:return p;case 12:return(p+p).slice(0,3);default:return p+p}}s.parseColor=function(n){if(!n)return;let d=n.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const f=a.exec(d);if(f){const p=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/p*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/p*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/p*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),c.exec(d)&&[3,6,9,12].includes(d.length))){const f=d.length/3,p=[0,0,0];for(let o=0;o<3;++o){const e=parseInt(d.slice(f*o,f*o+f),16);p[o]=f===1?e<<4:f===2?e:f===3?e>>4:e>>8}return p}},s.toRgbString=function(n,d=16){const[f,p,o]=n;return`rgb:${u(f,d)}/${u(p,d)}/${u(o,d)}`}},5770:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=a(482),u=a(8742),n=a(5770),d=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(p,o){this._handlers[p]===void 0&&(this._handlers[p]=[]);const e=this._handlers[p];return e.push(o),{dispose:()=>{const r=e.indexOf(o);r!==-1&&e.splice(r,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}reset(){if(this._active.length)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(p,o){if(this.reset(),this._ident=p,this._active=this._handlers[p]||d,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(o);else this._handlerFb(this._ident,"HOOK",o)}put(p,o,e){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(p,o,e);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(p,o,e))}unhook(p,o=!0){if(this._active.length){let e=!1,r=this._active.length-1,t=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,e=o,t=this._stack.fallThrough,this._stack.paused=!1),!t&&e===!1){for(;r>=0&&(e=this._active[r].unhook(p),e!==!0);r--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,e;r--}for(;r>=0;r--)if(e=this._active[r].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",p);this._active=d,this._ident=0}};const f=new u.Params;f.addParam(0),s.DcsHandler=class{constructor(p){this._handler=p,this._data="",this._params=f,this._hitLimit=!1}hook(p){this._params=p.length>1||p.params[0]?p.clone():f,this._data="",this._hitLimit=!1}put(p,o,e){this._hitLimit||(this._data+=(0,c.utf32ToString)(p,o,e),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(p){let o=!1;if(this._hitLimit)o=!1;else if(p&&(o=this._handler(this._data,this._params),o instanceof Promise))return o.then((e=>(this._params=f,this._data="",this._hitLimit=!1,e)));return this._params=f,this._data="",this._hitLimit=!1,o}}},2015:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=a(844),u=a(8742),n=a(6242),d=a(6351);class f{constructor(r){this.table=new Uint8Array(r)}setDefault(r,t){this.table.fill(r<<4|t)}add(r,t,i,h){this.table[t<<8|r]=i<<4|h}addMany(r,t,i,h){for(let v=0;v<r.length;v++)this.table[t<<8|r[v]]=i<<4|h}}s.TransitionTable=f;const p=160;s.VT500_TRANSITION_TABLE=(function(){const e=new f(4095),r=Array.apply(null,Array(256)).map(((g,_)=>_)),t=(g,_)=>r.slice(g,_),i=t(32,127),h=t(0,24);h.push(25),h.push.apply(h,t(28,32));const v=t(0,14);let l;for(l in e.setDefault(1,0),e.addMany(i,0,2,0),v)e.addMany([24,26,153,154],l,3,0),e.addMany(t(128,144),l,3,0),e.addMany(t(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(h,0,3,0),e.addMany(h,1,3,1),e.add(127,1,0,1),e.addMany(h,8,0,8),e.addMany(h,3,3,3),e.add(127,3,0,3),e.addMany(h,4,3,4),e.add(127,4,0,4),e.addMany(h,6,3,6),e.addMany(h,5,3,5),e.add(127,5,0,5),e.addMany(h,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(t(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(h,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(t(64,127),3,7,0),e.addMany(t(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(t(48,60),4,8,4),e.addMany(t(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(t(32,64),6,0,6),e.add(127,6,0,6),e.addMany(t(64,127),6,0,0),e.addMany(t(32,48),3,9,5),e.addMany(t(32,48),5,9,5),e.addMany(t(48,64),5,0,6),e.addMany(t(64,127),5,7,0),e.addMany(t(32,48),4,9,5),e.addMany(t(32,48),1,9,2),e.addMany(t(32,48),2,9,2),e.addMany(t(48,127),2,10,0),e.addMany(t(48,80),1,10,0),e.addMany(t(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(t(96,127),1,10,0),e.add(80,1,11,9),e.addMany(h,9,0,9),e.add(127,9,0,9),e.addMany(t(28,32),9,0,9),e.addMany(t(32,48),9,9,12),e.addMany(t(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(h,11,0,11),e.addMany(t(32,128),11,0,11),e.addMany(t(28,32),11,0,11),e.addMany(h,10,0,10),e.add(127,10,0,10),e.addMany(t(28,32),10,0,10),e.addMany(t(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(t(32,48),10,9,12),e.addMany(h,12,0,12),e.add(127,12,0,12),e.addMany(t(28,32),12,0,12),e.addMany(t(32,48),12,9,12),e.addMany(t(48,64),12,0,11),e.addMany(t(64,127),12,12,13),e.addMany(t(64,127),10,12,13),e.addMany(t(64,127),9,12,13),e.addMany(h,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(p,0,2,0),e.add(p,8,5,8),e.add(p,6,0,6),e.add(p,11,0,11),e.add(p,13,13,13),e})();class o extends c.Disposable{constructor(r=s.VT500_TRANSITION_TABLE){super(),this._transitions=r,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new u.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,h)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(r,t=[64,126]){let i=0;if(r.prefix){if(r.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=r.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(r.intermediates){if(r.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let v=0;v<r.intermediates.length;++v){const l=r.intermediates.charCodeAt(v);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=l}}if(r.final.length!==1)throw new Error("final must be a single byte");const h=r.final.charCodeAt(0);if(t[0]>h||h>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=h,i}identToString(r){const t=[];for(;r;)t.push(String.fromCharCode(255&r)),r>>=8;return t.reverse().join("")}setPrintHandler(r){this._printHandler=r}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(r,t){const i=this._identifier(r,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);const h=this._escHandlers[i];return h.push(t),{dispose:()=>{const v=h.indexOf(t);v!==-1&&h.splice(v,1)}}}clearEscHandler(r){this._escHandlers[this._identifier(r,[48,126])]&&delete this._escHandlers[this._identifier(r,[48,126])]}setEscHandlerFallback(r){this._escHandlerFb=r}setExecuteHandler(r,t){this._executeHandlers[r.charCodeAt(0)]=t}clearExecuteHandler(r){this._executeHandlers[r.charCodeAt(0)]&&delete this._executeHandlers[r.charCodeAt(0)]}setExecuteHandlerFallback(r){this._executeHandlerFb=r}registerCsiHandler(r,t){const i=this._identifier(r);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);const h=this._csiHandlers[i];return h.push(t),{dispose:()=>{const v=h.indexOf(t);v!==-1&&h.splice(v,1)}}}clearCsiHandler(r){this._csiHandlers[this._identifier(r)]&&delete this._csiHandlers[this._identifier(r)]}setCsiHandlerFallback(r){this._csiHandlerFb=r}registerDcsHandler(r,t){return this._dcsParser.registerHandler(this._identifier(r),t)}clearDcsHandler(r){this._dcsParser.clearHandler(this._identifier(r))}setDcsHandlerFallback(r){this._dcsParser.setHandlerFallback(r)}registerOscHandler(r,t){return this._oscParser.registerHandler(r,t)}clearOscHandler(r){this._oscParser.clearHandler(r)}setOscHandlerFallback(r){this._oscParser.setHandlerFallback(r)}setErrorHandler(r){this._errorHandler=r}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(r,t,i,h,v){this._parseStack.state=r,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=h,this._parseStack.chunkPos=v}parse(r,t,i){let h,v=0,l=0,g=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,g=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");const _=this._parseStack.handlers;let m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&m>-1){for(;m>=0&&(h=_[m](this._params),h!==!0);m--)if(h instanceof Promise)return this._parseStack.handlerPos=m,h}this._parseStack.handlers=[];break;case 4:if(i===!1&&m>-1){for(;m>=0&&(h=_[m](),h!==!0);m--)if(h instanceof Promise)return this._parseStack.handlerPos=m,h}this._parseStack.handlers=[];break;case 6:if(v=r[this._parseStack.chunkPos],h=this._dcsParser.unhook(v!==24&&v!==26,i),h)return h;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(v=r[this._parseStack.chunkPos],h=this._oscParser.end(v!==24&&v!==26,i),h)return h;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,g=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let _=g;_<t;++_){switch(v=r[_],l=this._transitions.table[this.currentState<<8|(v<160?v:p)],l>>4){case 2:for(let w=_+1;;++w){if(w>=t||(v=r[w])<32||v>126&&v<p){this._printHandler(r,_,w),_=w-1;break}if(++w>=t||(v=r[w])<32||v>126&&v<p){this._printHandler(r,_,w),_=w-1;break}if(++w>=t||(v=r[w])<32||v>126&&v<p){this._printHandler(r,_,w),_=w-1;break}if(++w>=t||(v=r[w])<32||v>126&&v<p){this._printHandler(r,_,w),_=w-1;break}}break;case 3:this._executeHandlers[v]?this._executeHandlers[v]():this._executeHandlerFb(v),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:v,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const m=this._csiHandlers[this._collect<<8|v];let C=m?m.length-1:-1;for(;C>=0&&(h=m[C](this._params),h!==!0);C--)if(h instanceof Promise)return this._preserveStack(3,m,C,l,_),h;C<0&&this._csiHandlerFb(this._collect<<8|v,this._params),this.precedingJoinState=0;break;case 8:do switch(v){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(v-48)}while(++_<t&&(v=r[_])>47&&v<60);_--;break;case 9:this._collect<<=8,this._collect|=v;break;case 10:const b=this._escHandlers[this._collect<<8|v];let y=b?b.length-1:-1;for(;y>=0&&(h=b[y](),h!==!0);y--)if(h instanceof Promise)return this._preserveStack(4,b,y,l,_),h;y<0&&this._escHandlerFb(this._collect<<8|v),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|v,this._params);break;case 13:for(let w=_+1;;++w)if(w>=t||(v=r[w])===24||v===26||v===27||v>127&&v<p){this._dcsParser.put(r,_,w),_=w-1;break}break;case 14:if(h=this._dcsParser.unhook(v!==24&&v!==26),h)return this._preserveStack(6,[],0,l,_),h;v===27&&(l|=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 w=_+1;;w++)if(w>=t||(v=r[w])<32||v>127&&v<p){this._oscParser.put(r,_,w),_=w-1;break}break;case 6:if(h=this._oscParser.end(v!==24&&v!==26),h)return this._preserveStack(5,[],0,l,_),h;v===27&&(l|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&l}}}s.EscapeSequenceParser=o},6242:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=a(5770),u=a(482),n=[];s.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,f){this._handlers[d]===void 0&&(this._handlers[d]=[]);const p=this._handlers[d];return p.push(f),{dispose:()=>{const o=p.indexOf(f);o!==-1&&p.splice(o,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,f,p){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(d,f,p);else this._handlerFb(this._id,"PUT",(0,u.utf32ToString)(d,f,p))}start(){this.reset(),this._state=1}put(d,f,p){if(this._state!==3){if(this._state===1)for(;f<p;){const o=d[f++];if(o===59){this._state=2,this._start();break}if(o<48||57<o)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+o-48}this._state===2&&p-f>0&&this._put(d,f,p)}}end(d,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let p=!1,o=this._active.length-1,e=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,p=f,e=this._stack.fallThrough,this._stack.paused=!1),!e&&p===!1){for(;o>=0&&(p=this._active[o].end(d),p!==!0);o--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,p;o--}for(;o>=0;o--)if(p=this._active[o].end(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,p}else this._handlerFb(this._id,"END",d);this._active=n,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,f,p){this._hitLimit||(this._data+=(0,u.utf32ToString)(d,f,p),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let f=!1;if(this._hitLimit)f=!1;else if(d&&(f=this._handler(this._data),f instanceof Promise))return f.then((p=>(this._data="",this._hitLimit=!1,p)));return this._data="",this._hitLimit=!1,f}}},8742:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class c{static fromArray(n){const d=new c;if(!n.length)return d;for(let f=Array.isArray(n[0])?1:0;f<n.length;++f){const p=n[f];if(Array.isArray(p))for(let o=0;o<p.length;++o)d.addSubParam(p[o]);else d.addParam(p)}return d}constructor(n=32,d=32){if(this.maxLength=n,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new c(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let d=0;d<this.length;++d){n.push(this.params[d]);const f=this._subParamsIdx[d]>>8,p=255&this._subParamsIdx[d];p-f>0&&n.push(Array.prototype.slice.call(this._subParams,f,p))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>a?a:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>a?a:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const d=this._subParamsIdx[n]>>8,f=255&this._subParamsIdx[n];return f-d>0?this._subParams.subarray(d,f):null}getSubParamsAll(){const n={};for(let d=0;d<this.length;++d){const f=this._subParamsIdx[d]>>8,p=255&this._subParamsIdx[d];p-f>0&&(n[d]=this._subParams.slice(f,p))}return n}addDigit(n){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,p=f[d-1];f[d-1]=~p?Math.min(10*p+n,a):n}}s.Params=c},5741:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,c){const u={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(u),c.dispose=()=>this._wrappedAddonDispose(u),c.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let c=-1;for(let u=0;u<this._addons.length;u++)if(this._addons[u]===a){c=u;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(c,1)}}},8771:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=a(3785),u=a(511);s.BufferApiView=class{constructor(n,d){this._buffer=n,this.type=d}init(n){return this._buffer=n,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(n){const d=this._buffer.lines.get(n);if(d)return new c.BufferLineApiView(d)}getNullCell(){return new u.CellData}}},3785:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=a(511);s.BufferLineApiView=class{constructor(u){this._line=u}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(u,n){if(!(u<0||u>=this._line.length))return n?(this._line.loadCell(u,n),n):this._line.loadCell(u,new c.CellData)}translateToString(u,n,d){return this._line.translateToString(u,n,d)}}},8285:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=a(8771),u=a(8460),n=a(844);class d extends n.Disposable{constructor(p){super(),this._core=p,this._onBufferChange=this.register(new u.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=d},7975:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,c){return this._core.registerCsiHandler(a,(u=>c(u.toArray())))}addCsiHandler(a,c){return this.registerCsiHandler(a,c)}registerDcsHandler(a,c){return this._core.registerDcsHandler(a,((u,n)=>c(u,n.toArray())))}addDcsHandler(a,c){return this.registerDcsHandler(a,c)}registerEscHandler(a,c){return this._core.registerEscHandler(a,c)}addEscHandler(a,c){return this.registerEscHandler(a,c)}registerOscHandler(a,c){return this._core.registerOscHandler(a,c)}addOscHandler(a,c){return this.registerOscHandler(a,c)}}},7090:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(B,s,a){var c=this&&this.__decorate||function(e,r,t,i){var h,v=arguments.length,l=v<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,t,i);else for(var g=e.length-1;g>=0;g--)(h=e[g])&&(l=(v<3?h(l):v>3?h(r,t,l):h(r,t))||l);return v>3&&l&&Object.defineProperty(r,t,l),l},u=this&&this.__param||function(e,r){return function(t,i){r(t,i,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const n=a(8460),d=a(844),f=a(5295),p=a(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let o=s.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(e,this))}resize(e,r){this.cols=e,this.rows=r,this.buffers.resize(e,r),this._onResize.fire({cols:e,rows:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,r=!1){const t=this.buffer;let i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===e.fg&&i.getBg(0)===e.bg||(i=t.getBlankLine(e,r),this._cachedBlankLine=i),i.isWrapped=r;const h=t.ybase+t.scrollTop,v=t.ybase+t.scrollBottom;if(t.scrollTop===0){const l=t.lines.isFull;v===t.lines.length-1?l?t.lines.recycle().copyFrom(i):t.lines.push(i.clone()):t.lines.splice(v+1,0,i.clone()),l?this.isUserScrolling&&(t.ydisp=Math.max(t.ydisp-1,0)):(t.ybase++,this.isUserScrolling||t.ydisp++)}else{const l=v-h+1;t.lines.shiftElements(h+1,l-1,-1),t.lines.set(v,i.clone())}this.isUserScrolling||(t.ydisp=t.ybase),this._onScroll.fire(t.ydisp)}scrollLines(e,r,t){const i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);const h=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),h!==i.ydisp&&(r||this._onScroll.fire(i.ydisp))}};s.BufferService=o=c([u(0,p.IOptionsService)],o)},7994:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,c){this._charsets[a]=c,this.glevel===a&&(this.charset=c)}}},1753:function(B,s,a){var c=this&&this.__decorate||function(i,h,v,l){var g,_=arguments.length,m=_<3?h:l===null?l=Object.getOwnPropertyDescriptor(h,v):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,h,v,l);else for(var C=i.length-1;C>=0;C--)(g=i[C])&&(m=(_<3?g(m):_>3?g(h,v,m):g(h,v))||m);return _>3&&m&&Object.defineProperty(h,v,m),m},u=this&&this.__param||function(i,h){return function(v,l){h(v,l,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const n=a(2585),d=a(8460),f=a(844),p={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 o(i,h){let v=(i.ctrl?16:0)|(i.shift?4:0)|(i.alt?8:0);return i.button===4?(v|=64,v|=i.action):(v|=3&i.button,4&i.button&&(v|=64),8&i.button&&(v|=128),i.action===32?v|=32:i.action!==0||h||(v|=3)),v}const e=String.fromCharCode,r={DEFAULT:i=>{const h=[o(i,!1)+32,i.col+32,i.row+32];return h[0]>255||h[1]>255||h[2]>255?"":`\x1B[M${e(h[0])}${e(h[1])}${e(h[2])}`},SGR:i=>{const h=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${o(i,!0)};${i.col};${i.row}${h}`},SGR_PIXELS:i=>{const h=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${o(i,!0)};${i.x};${i.y}${h}`}};let t=s.CoreMouseService=class extends f.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 d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const v of Object.keys(p))this.addProtocol(v,p[v]);for(const v of Object.keys(r))this.addEncoding(v,r[v]);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;const 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,v){if(v){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}};s.CoreMouseService=t=c([u(0,n.IBufferService),u(1,n.ICoreService)],t)},6975:function(B,s,a){var c=this&&this.__decorate||function(t,i,h,v){var l,g=arguments.length,_=g<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(t,i,h,v);else for(var m=t.length-1;m>=0;m--)(l=t[m])&&(_=(g<3?l(_):g>3?l(i,h,_):l(i,h))||_);return g>3&&_&&Object.defineProperty(i,h,_),_},u=this&&this.__param||function(t,i){return function(h,v){i(h,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const n=a(1439),d=a(8460),f=a(844),p=a(2585),o=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let r=s.CoreService=class extends f.Disposable{constructor(t,i,h){super(),this._bufferService=t,this._logService=i,this._optionsService=h,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(o),this.decPrivateModes=(0,n.clone)(e)}reset(){this.modes=(0,n.clone)(o),this.decPrivateModes=(0,n.clone)(e)}triggerDataEvent(t,i=!1){if(this._optionsService.rawOptions.disableStdin)return;const 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 "${t}"`,(()=>t.split("").map((v=>v.charCodeAt(0))))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`,(()=>t.split("").map((i=>i.charCodeAt(0))))),this._onBinary.fire(t))}};s.CoreService=r=c([u(0,p.IBufferService),u(1,p.ILogService),u(2,p.IOptionsService)],r)},9074:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=a(8055),u=a(8460),n=a(844),d=a(6106);let f=0,p=0;class o extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList((t=>t==null?void 0:t.marker.line)),this._onDecorationRegistered=this.register(new u.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new u.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)((()=>this.reset())))}registerDecoration(t){if(t.marker.isDisposed)return;const i=new e(t);if(i){const 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(const t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,i,h){let v=0,l=0;for(const g of this._decorations.getKeyIterator(i))v=g.options.x??0,l=v+(g.options.width??1),t>=v&&t<l&&(!h||(g.options.layer??"bottom")===h)&&(yield g)}forEachDecorationAtCell(t,i,h,v){this._decorations.forEachByKey(i,(l=>{f=l.options.x??0,p=f+(l.options.width??1),t>=f&&t<p&&(!h||(l.options.layer??"bottom")===h)&&v(l)}))}}s.DecorationService=o;class e extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(t){super(),this.options=t,this.onRenderEmitter=this.register(new u.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=a(2585),u=a(8343);class n{constructor(...f){this._entries=new Map;for(const[p,o]of f)this.set(p,o)}set(f,p){const o=this._entries.get(f);return this._entries.set(f,p),o}forEach(f){for(const[p,o]of this._entries.entries())f(p,o)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}s.ServiceCollection=n,s.InstantiationService=class{constructor(){this._services=new n,this._services.set(c.IInstantiationService,this)}setService(d,f){this._services.set(d,f)}getService(d){return this._services.get(d)}createInstance(d,...f){const p=(0,u.getServiceDependencies)(d).sort(((r,t)=>r.index-t.index)),o=[];for(const r of p){const t=this._services.get(r.id);if(!t)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${r.id}.`);o.push(t)}const e=p.length>0?p[0].index:f.length;if(f.length!==e)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${e+1} conflicts with ${f.length} static arguments`);return new d(...f,...o)}}},7866:function(B,s,a){var c=this&&this.__decorate||function(e,r,t,i){var h,v=arguments.length,l=v<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,t,i);else for(var g=e.length-1;g>=0;g--)(h=e[g])&&(l=(v<3?h(l):v>3?h(r,t,l):h(r,t))||l);return v>3&&l&&Object.defineProperty(r,t,l),l},u=this&&this.__param||function(e,r){return function(t,i){r(t,i,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const n=a(844),d=a(2585),f={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let p,o=s.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),p=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let r=0;r<e.length;r++)typeof e[r]=="function"&&(e[r]=e[r]())}_log(e,r,t){this._evalLazyOptionalParams(t),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+r,...t)}trace(e,...r){var t;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.trace.bind(this._optionsService.options.logger))??console.log,e,r)}debug(e,...r){var t;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.debug.bind(this._optionsService.options.logger))??console.log,e,r)}info(e,...r){var t;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.info.bind(this._optionsService.options.logger))??console.info,e,r)}warn(e,...r){var t;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.warn.bind(this._optionsService.options.logger))??console.warn,e,r)}error(e,...r){var t;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.error.bind(this._optionsService.options.logger))??console.error,e,r)}};s.LogService=o=c([u(0,d.IOptionsService)],o),s.setTraceLogger=function(e){p=e},s.traceCall=function(e,r,t){if(typeof t.value!="function")throw new Error("not supported");const i=t.value;t.value=function(...h){if(p.logLevel!==d.LogLevelEnum.TRACE)return i.apply(this,h);p.trace(`GlyphRenderer#${i.name}(${h.map((l=>JSON.stringify(l))).join(", ")})`);const v=i.apply(this,h);return p.trace(`GlyphRenderer#${i.name} return`,v),v}}},7302:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=a(8460),u=a(844),n=a(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends u.Disposable{constructor(o){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e={...s.DEFAULT_OPTIONS};for(const r in o)if(r in e)try{const t=o[r];e[r]=this._sanitizeAndValidateOption(r,t)}catch(t){console.error(t)}this.rawOptions=e,this.options={...e},this._setupOptions(),this.register((0,u.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(o,e){return this.onOptionChange((r=>{r===o&&e(this.rawOptions[o])}))}onMultipleOptionChange(o,e){return this.onOptionChange((r=>{o.indexOf(r)!==-1&&e()}))}_setupOptions(){const o=r=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},e=(r,t)=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);t=this._sanitizeAndValidateOption(r,t),this.rawOptions[r]!==t&&(this.rawOptions[r]=t,this._onOptionChange.fire(r))};for(const r in this.rawOptions){const t={get:o.bind(this,r),set:e.bind(this,r)};Object.defineProperty(this.options,r,t)}}_sanitizeAndValidateOption(o,e){switch(o){case"cursorStyle":if(e||(e=s.DEFAULT_OPTIONS[o]),!(function(r){return r==="block"||r==="underline"||r==="bar"})(e))throw new Error(`"${e}" is not a valid value for ${o}`);break;case"wordSeparator":e||(e=s.DEFAULT_OPTIONS[o]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=d.includes(e)?e:s.DEFAULT_OPTIONS[o];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${o} cannot be less than 1, value: ${e}`);break;case"minimumContrastRatio":e=Math.max(1,Math.min(21,Math.round(10*e)/10));break;case"scrollback":if((e=Math.min(e,4294967295))<0)throw new Error(`${o} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${o} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${o} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}s.OptionsService=f},2660:function(B,s,a){var c=this&&this.__decorate||function(f,p,o,e){var r,t=arguments.length,i=t<3?p:e===null?e=Object.getOwnPropertyDescriptor(p,o):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(f,p,o,e);else for(var h=f.length-1;h>=0;h--)(r=f[h])&&(i=(t<3?r(i):t>3?r(p,o,i):r(p,o))||i);return t>3&&i&&Object.defineProperty(p,o,i),i},u=this&&this.__param||function(f,p){return function(o,e){p(o,e,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const n=a(2585);let d=s.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const p=this._bufferService.buffer;if(f.id===void 0){const h=p.addMarker(p.ybase+p.y),v={data:f,id:this._nextId++,lines:[h]};return h.onDispose((()=>this._removeMarkerFromLink(v,h))),this._dataByLinkId.set(v.id,v),v.id}const o=f,e=this._getEntryIdKey(o),r=this._entriesWithId.get(e);if(r)return this.addLineToLink(r.id,p.ybase+p.y),r.id;const t=p.addMarker(p.ybase+p.y),i={id:this._nextId++,key:this._getEntryIdKey(o),data:o,lines:[t]};return t.onDispose((()=>this._removeMarkerFromLink(i,t))),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(f,p){const o=this._dataByLinkId.get(f);if(o&&o.lines.every((e=>e.line!==p))){const e=this._bufferService.buffer.addMarker(p);o.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(o,e)))}}getLinkData(f){var p;return(p=this._dataByLinkId.get(f))==null?void 0:p.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,p){const o=f.lines.indexOf(p);o!==-1&&(f.lines.splice(o,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};s.OscLinkService=d=c([u(0,n.IBufferService)],d)},8343:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(u){return u[c]||[]},s.createDecorator=function(u){if(s.serviceRegistry.has(u))return s.serviceRegistry.get(u);const n=function(d,f,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,e,r){e[a]===e?e[c].push({id:o,index:r}):(e[c]=[{id:o,index:r}],e[a]=e)})(n,d,p)};return n.toString=()=>u,s.serviceRegistry.set(u,n),n}},2585:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(8343);var u;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(u||(s.LogLevelEnum=u={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(8460),u=a(225);class n{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,p,o=!1){return(16777215&f)<<3|(3&p)<<1|(o?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const f=new u.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let p=0,o=0;const e=f.length;for(let r=0;r<e;++r){let t=f.charCodeAt(r);if(55296<=t&&t<=56319){if(++r>=e)return p+this.wcwidth(t);const v=f.charCodeAt(r);56320<=v&&v<=57343?t=1024*(t-55296)+v-56320+65536:p+=this.wcwidth(v)}const i=this.charProperties(t,o);let h=n.extractWidth(i);n.extractShouldJoin(i)&&(h-=n.extractWidth(o)),p+=h,o=i}return p}charProperties(f,p){return this._activeProvider.charProperties(f,p)}}s.UnicodeService=n}},ne={};function re(B){var s=ne[B];if(s!==void 0)return s.exports;var a=ne[B]={exports:{}};return le[B].call(a.exports,a,a.exports,re),a.exports}var de={};return(()=>{var B=de;Object.defineProperty(B,"__esModule",{value:!0}),B.Terminal=void 0;const s=re(9042),a=re(3236),c=re(844),u=re(5741),n=re(8285),d=re(7975),f=re(7090),p=["cols","rows"];class o extends c.Disposable{constructor(r){super(),this._core=this.register(new a.Terminal(r)),this._addonManager=this.register(new u.AddonManager),this._publicOptions={...this._core.options};const t=h=>this._core.options[h],i=(h,v)=>{this._checkReadonlyOptions(h),this._core.options[h]=v};for(const h in this._core.options){const v={get:t.bind(this,h),set:i.bind(this,h)};Object.defineProperty(this._publicOptions,h,v)}}_checkReadonlyOptions(r){if(p.includes(r))throw new Error(`Option "${r}" 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 d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.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 n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const r=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:r.applicationCursorKeys,applicationKeypadMode:r.applicationKeypad,bracketedPasteMode:r.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:r.origin,reverseWraparoundMode:r.reverseWraparound,sendFocusMode:r.sendFocus,wraparoundMode:r.wraparound}}get options(){return this._publicOptions}set options(r){for(const t in r)this._publicOptions[t]=r[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(r,t=!0){this._core.input(r,t)}resize(r,t){this._verifyIntegers(r,t),this._core.resize(r,t)}open(r){this._core.open(r)}attachCustomKeyEventHandler(r){this._core.attachCustomKeyEventHandler(r)}attachCustomWheelEventHandler(r){this._core.attachCustomWheelEventHandler(r)}registerLinkProvider(r){return this._core.registerLinkProvider(r)}registerCharacterJoiner(r){return this._checkProposedApi(),this._core.registerCharacterJoiner(r)}deregisterCharacterJoiner(r){this._checkProposedApi(),this._core.deregisterCharacterJoiner(r)}registerMarker(r=0){return this._verifyIntegers(r),this._core.registerMarker(r)}registerDecoration(r){return this._checkProposedApi(),this._verifyPositiveIntegers(r.x??0,r.width??0,r.height??0),this._core.registerDecoration(r)}hasSelection(){return this._core.hasSelection()}select(r,t,i){this._verifyIntegers(r,t,i),this._core.select(r,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(r,t){this._verifyIntegers(r,t),this._core.selectLines(r,t)}dispose(){super.dispose()}scrollLines(r){this._verifyIntegers(r),this._core.scrollLines(r)}scrollPages(r){this._verifyIntegers(r),this._core.scrollPages(r)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(r){this._verifyIntegers(r),this._core.scrollToLine(r)}clear(){this._core.clear()}write(r,t){this._core.write(r,t)}writeln(r,t){this._core.write(r),this._core.write(`\r
9
+ `,t)}paste(r){this._core.paste(r)}refresh(r,t){this._verifyIntegers(r,t),this._core.refresh(r,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(r){this._addonManager.loadAddon(this,r)}static get strings(){return s}_verifyIntegers(...r){for(const t of r)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...r){for(const t of r)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}B.Terminal=o})(),de})()))})(Ce)),Ce.exports}var me={exports:{}},Oe=me.exports,Re;function Ie(){return Re||(Re=1,(function(ue,we){(function(le,ne){ue.exports=ne()})(Oe,(()=>(()=>{var le={433:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const c=a(938),u=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],n=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],d=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],f=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let p;function o(e,r){let t,i=0,h=r.length-1;if(e<r[0][0]||e>r[h][1])return!1;for(;h>=i;)if(t=i+h>>1,e>r[t][1])i=t+1;else{if(!(e<r[t][0]))return!0;h=t-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160);for(let e=0;e<u.length;++e)p.fill(0,u[e][0],u[e][1]+1);for(let e=0;e<d.length;++e)p.fill(2,d[e][0],d[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?p[e]:o(e,n)?0:o(e,f)?2:1}charProperties(e,r){let t=this.wcwidth(e),i=t===0&&r!==0;if(i){const h=c.UnicodeService.extractWidth(r);h===0?i=!1:h>t&&(t=h)}return c.UnicodeService.createPropertyValue(0,t,i)}}},345:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const u=[];for(let n=0;n<this._listeners.length;n++)u.push(this._listeners[n]);for(let n=0;n<u.length;n++)u[n].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((u=>c.fire(u)))},s.runAndSubscribe=function(a,c){return c(void 0),a((u=>c(u)))}},490:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=a(938),u=[[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]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let d;s.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let f=0;f<u.length;++f)d.fill(0,u[f][0],u[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?d[f]:(function(p,o){let e,r=0,t=o.length-1;if(p<o[0][0]||p>o[t][1])return!1;for(;t>=r;)if(e=r+t>>1,p>o[e][1])r=e+1;else{if(!(p<o[e][0]))return!0;t=e-1}return!1})(f,n)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,p){let o=this.wcwidth(f),e=o===0&&p!==0;if(e){const r=c.UnicodeService.extractWidth(p);r===0?e=!1:r>o&&(o=r)}return c.UnicodeService.createPropertyValue(0,o,e)}}},938:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=a(345),u=a(490);class n{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,p,o=!1){return(16777215&f)<<3|(3&p)<<1|(o?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const f=new u.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let p=0,o=0;const e=f.length;for(let r=0;r<e;++r){let t=f.charCodeAt(r);if(55296<=t&&t<=56319){if(++r>=e)return p+this.wcwidth(t);const v=f.charCodeAt(r);56320<=v&&v<=57343?t=1024*(t-55296)+v-56320+65536:p+=this.wcwidth(v)}const i=this.charProperties(t,o);let h=n.extractWidth(i);n.extractShouldJoin(i)&&(h-=n.extractWidth(o)),p+=h,o=i}return p}charProperties(f,p){return this._activeProvider.charProperties(f,p)}}s.UnicodeService=n}},ne={};function re(B){var s=ne[B];if(s!==void 0)return s.exports;var a=ne[B]={exports:{}};return le[B](a,a.exports,re),a.exports}var de={};return(()=>{var B=de;Object.defineProperty(B,"__esModule",{value:!0}),B.Unicode11Addon=void 0;const s=re(433);B.Unicode11Addon=class{activate(a){a.unicode.register(new s.UnicodeV11)}dispose(){}}})(),de})()))})(me)),me.exports}var be={exports:{}},ke;function He(){return ke||(ke=1,(function(ue,we){(function(le,ne){ue.exports=ne()})(self,(()=>(()=>{var le={903:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const c=a(274),u=a(627),n=a(237),d=a(860),f=a(374),p=a(296),o=a(345),e=a(859),r=a(399),t=a(855);class i extends e.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var l;return(l=this._charAtlas)==null?void 0:l.pages[0].canvas}constructor(l,g,_,m,C,b,y,w,R,D){super(),this._terminal=l,this._container=g,this._alpha=C,this._themeService=b,this._bufferService=y,this._optionsService=w,this._decorationService=R,this._coreBrowserService=D,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,p.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new e.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new c.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${_}-layer`),this._canvas.style.zIndex=m.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((P=>{this._refreshCharAtlas(P),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,e.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,f.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(l,g){}handleSelectionChanged(l,g,_=!1){this._selectionModel.update(this._terminal._core,l,g,_)}_setTransparency(l){if(l===this._alpha)return;const g=this._canvas;this._alpha=l,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,g),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(l){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,u.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,l,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,o.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let g=0;g<this._charAtlas.pages.length;g++)this._bitmapGenerator[g]=new h(this._charAtlas.pages[g].canvas)}}resize(l){this._deviceCellWidth=l.device.cell.width,this._deviceCellHeight=l.device.cell.height,this._deviceCharWidth=l.device.char.width,this._deviceCharHeight=l.device.char.height,this._deviceCharLeft=l.device.char.left,this._deviceCharTop=l.device.char.top,this._canvas.width=l.device.canvas.width,this._canvas.height=l.device.canvas.height,this._canvas.style.width=`${l.css.canvas.width}px`,this._canvas.style.height=`${l.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var l;(l=this._charAtlas)==null||l.clearTexture()}_fillCells(l,g,_,m){this._ctx.fillRect(l*this._deviceCellWidth,g*this._deviceCellHeight,_*this._deviceCellWidth,m*this._deviceCellHeight)}_fillMiddleLineAtCells(l,g,_=1){const m=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(l*this._deviceCellWidth,(g+1)*this._deviceCellHeight-m-this._coreBrowserService.dpr,_*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(l,g,_=1,m=0){this._ctx.fillRect(l*this._deviceCellWidth,(g+1)*this._deviceCellHeight+m-this._coreBrowserService.dpr-1,_*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(l,g,_=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const m=this._coreBrowserService.dpr;this._ctx.lineWidth=m;for(let C=0;C<_;C++){const b=(l+C)*this._deviceCellWidth,y=(l+C+.5)*this._deviceCellWidth,w=(l+C+1)*this._deviceCellWidth,R=(g+1)*this._deviceCellHeight-m-1,D=R-m,P=R+m;this._ctx.moveTo(b,R),this._ctx.bezierCurveTo(b,D,y,D,y,R),this._ctx.bezierCurveTo(y,P,w,P,w,R)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(l,g,_=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const m=this._coreBrowserService.dpr;this._ctx.lineWidth=m,this._ctx.setLineDash([2*m,m]);const C=l*this._deviceCellWidth,b=(g+1)*this._deviceCellHeight-m-1;this._ctx.moveTo(C,b);for(let y=0;y<_;y++){const w=(l+_+y)*this._deviceCellWidth;this._ctx.lineTo(w,b)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(l,g,_=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const m=this._coreBrowserService.dpr;this._ctx.lineWidth=m,this._ctx.setLineDash([4*m,3*m]);const C=l*this._deviceCellWidth,b=(l+_)*this._deviceCellWidth,y=(g+1)*this._deviceCellHeight-m-1;this._ctx.moveTo(C,y),this._ctx.lineTo(b,y),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(l,g,_){this._ctx.fillRect(l*this._deviceCellWidth,g*this._deviceCellHeight,this._coreBrowserService.dpr*_,this._deviceCellHeight)}_strokeRectAtCell(l,g,_,m){const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.strokeRect(l*this._deviceCellWidth+C/2,g*this._deviceCellHeight+C/2,_*this._deviceCellWidth-C,m*this._deviceCellHeight-C)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(l,g,_,m){this._alpha?this._ctx.clearRect(l*this._deviceCellWidth,g*this._deviceCellHeight,_*this._deviceCellWidth,m*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(l*this._deviceCellWidth,g*this._deviceCellHeight,_*this._deviceCellWidth,m*this._deviceCellHeight))}_fillCharTrueColor(l,g,_){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=n.TEXT_BASELINE,this._clipRow(_);let m=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(m=(0,d.tryDrawCustomChar)(this._ctx,l.getChars(),g*this._deviceCellWidth,_*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),m||this._ctx.fillText(l.getChars(),g*this._deviceCellWidth+this._deviceCharLeft,_*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(l,g,_){var R,D,P,T;const m=l.getChars(),C=l.getCode(),b=l.getWidth();if(this._cellColorResolver.resolve(l,g,this._bufferService.buffer.ydisp+_,this._deviceCellWidth),!this._charAtlas)return;let y;if(y=m&&m.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(m,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(l.getCode()||t.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!y.size.x||!y.size.y)return;this._ctx.save(),this._clipRow(_),this._bitmapGenerator[y.texturePage]&&this._charAtlas.pages[y.texturePage].canvas!==this._bitmapGenerator[y.texturePage].canvas&&((D=(R=this._bitmapGenerator[y.texturePage])==null?void 0:R.bitmap)==null||D.close(),delete this._bitmapGenerator[y.texturePage]),this._charAtlas.pages[y.texturePage].version!==((P=this._bitmapGenerator[y.texturePage])==null?void 0:P.version)&&(this._bitmapGenerator[y.texturePage]||(this._bitmapGenerator[y.texturePage]=new h(this._charAtlas.pages[y.texturePage].canvas)),this._bitmapGenerator[y.texturePage].refresh(),this._bitmapGenerator[y.texturePage].version=this._charAtlas.pages[y.texturePage].version);let w=y.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,f.allowRescaling)(C,b,y.size.x,this._deviceCellWidth)&&(w=this._deviceCellWidth-1),this._ctx.drawImage(((T=this._bitmapGenerator[y.texturePage])==null?void 0:T.bitmap)||this._charAtlas.pages[y.texturePage].canvas,y.texturePosition.x,y.texturePosition.y,y.size.x,y.size.y,g*this._deviceCellWidth+this._deviceCharLeft-y.offset.x,_*this._deviceCellHeight+this._deviceCharTop-y.offset.y,w,y.size.y),this._ctx.restore()}_clipRow(l){this._ctx.beginPath(),this._ctx.rect(0,l*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(l,g){return`${g?"italic":""} ${l?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}s.BaseRenderLayer=i;class h{get bitmap(){return this._bitmap}constructor(l){this.canvas=l,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var l;(l=this._bitmap)==null||l.close(),this._bitmap=void 0,r.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var l;this._state===0&&((l=this._bitmap)==null||l.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((g=>{this._state===2?this.refresh():this._bitmap=g,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CanvasRenderer=void 0;const c=a(627),u=a(56),n=a(374),d=a(345),f=a(859),p=a(873),o=a(43),e=a(630),r=a(744);class t extends f.Disposable{constructor(h,v,l,g,_,m,C,b,y,w,R){super(),this._terminal=h,this._screenElement=v,this._bufferService=g,this._charSizeService=_,this._optionsService=m,this._coreBrowserService=y,this._themeService=R,this._observerDisposable=this.register(new f.MutableDisposable),this._onRequestRedraw=this.register(new d.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new d.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new d.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const D=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new r.TextRenderLayer(this._terminal,this._screenElement,0,D,this._bufferService,this._optionsService,C,w,this._coreBrowserService,R),new e.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,w,this._optionsService,R),new o.LinkRenderLayer(this._terminal,this._screenElement,2,l,this._bufferService,this._optionsService,w,this._coreBrowserService,R),new p.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,b,this._coreBrowserService,w,R)];for(const P of this._renderLayers)(0,d.forwardEvent)(P.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,n.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,u.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((P,T)=>this._setCanvasDevicePixelDimensions(P,T))),this.register(this._coreBrowserService.onWindowChange((P=>{this._observerDisposable.value=(0,u.observeDevicePixelDimensions)(this._renderLayers[0].canvas,P,((T,A)=>this._setCanvasDevicePixelDimensions(T,A)))}))),this.register((0,f.toDisposable)((()=>{for(const P of this._renderLayers)P.dispose();(0,c.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(h,v){this._updateDimensions();for(const l of this._renderLayers)l.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((h=>h.handleBlur()))}handleFocus(){this._runOperation((h=>h.handleFocus()))}handleSelectionChanged(h,v,l=!1){this._runOperation((g=>g.handleSelectionChanged(h,v,l))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((h=>h.handleCursorMove()))}clear(){this._runOperation((h=>h.reset()))}_runOperation(h){for(const v of this._renderLayers)h(v)}renderRows(h,v){for(const l of this._renderLayers)l.handleGridChanged(h,v)}clearTextureAtlas(){for(const h of this._renderLayers)h.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const h=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*h),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*h),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/h),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/h),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(h,v){this.dimensions.device.canvas.height=v,this.dimensions.device.canvas.width=h;for(const l of this._renderLayers)l.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}s.CanvasRenderer=t},873:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorRenderLayer=void 0;const c=a(457),u=a(859),n=a(399),d=a(782),f=a(903);class p extends f.BaseRenderLayer{constructor(e,r,t,i,h,v,l,g,_,m){super(e,r,"cursor",t,!0,m,h,v,_,g),this._onRequestRedraw=i,this._coreService=l,this._cursorBlinkStateManager=this.register(new u.MutableDisposable),this._cell=new d.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(v.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;(e=this._cursorBlinkStateManager.value)==null||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;(e=this._cursorBlinkStateManager.value)==null||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new c.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation()}handleGridChanged(e,r){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const r=this._bufferService.buffer.ybase+this._bufferService.buffer.y,t=r-this._bufferService.buffer.ydisp;if(t<0||t>=this._bufferService.rows)return void this._clearCursor();const i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(r).loadCell(i,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const h=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;return v&&v!=="none"&&this._cursorRenderers[v](i,t,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=t,this._state.isFocused=!1,this._state.style=h,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===t&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](i,t,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=t,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(n.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(e,r,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,r,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,r,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,r,t.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(t,e,r),this._ctx.restore()}_renderUnderlineCursor(e,r,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,r),this._ctx.restore()}_renderOutlineCursor(e,r,t){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,r,t.getWidth(),1),this._ctx.restore()}}s.CursorRenderLayer=p},574:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GridCache=void 0,s.GridCache=class{constructor(){this.cache=[]}resize(a,c){for(let u=0;u<a;u++){this.cache.length<=u&&this.cache.push([]);for(let n=this.cache[u].length;n<c;n++)this.cache[u].push(void 0);this.cache[u].length=c}this.cache.length=a}clear(){for(let a=0;a<this.cache.length;a++)for(let c=0;c<this.cache[a].length;c++)this.cache[a][c]=void 0}}},43:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const c=a(197),u=a(237),n=a(903);class d extends n.BaseRenderLayer{constructor(p,o,e,r,t,i,h,v,l){super(p,o,"link",e,!0,l,t,i,h,v),this.register(r.onShowLinkUnderline((g=>this._handleShowLinkUnderline(g)))),this.register(r.onHideLinkUnderline((g=>this._handleHideLinkUnderline(g))))}resize(p){super.resize(p),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const p=this._state.y2-this._state.y1-1;p>0&&this._clearCells(0,this._state.y1+1,this._state.cols,p),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(p){if(p.fg===u.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:p.fg&&(0,c.is256Color)(p.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[p.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,p.y1===p.y2)this._fillBottomLineAtCells(p.x1,p.y1,p.x2-p.x1);else{this._fillBottomLineAtCells(p.x1,p.y1,p.cols-p.x1);for(let o=p.y1+1;o<p.y2;o++)this._fillBottomLineAtCells(0,o,p.cols);this._fillBottomLineAtCells(0,p.y2,p.x2)}this._state=p}_handleHideLinkUnderline(p){this._clearCurrentLink()}}s.LinkRenderLayer=d},630:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionRenderLayer=void 0;const c=a(903);class u extends c.BaseRenderLayer{constructor(d,f,p,o,e,r,t,i){super(d,f,"selection",p,!0,i,o,t,r,e),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(d){super.resize(d),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(d,f,p){super.handleSelectionChanged(d,f,p),this._redrawSelection(d,f,p)}_redrawSelection(d,f,p){if(!this._didStateChange(d,f,p,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!d||!f)return void this._clearState();const o=d[1]-this._bufferService.buffer.ydisp,e=f[1]-this._bufferService.buffer.ydisp,r=Math.max(o,0),t=Math.min(e,this._bufferService.rows-1);if(r>=this._bufferService.rows||t<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,p){const i=d[0],h=f[0]-i,v=t-r+1;this._fillCells(i,r,h,v)}else{const i=o===r?d[0]:0,h=r===e?f[0]:this._bufferService.cols;this._fillCells(i,r,h-i,1);const v=Math.max(t-r-1,0);if(this._fillCells(0,r+1,this._bufferService.cols,v),r!==t){const l=e===t?f[0]:this._bufferService.cols;this._fillCells(0,t,l,1)}}this._state.start=[d[0],d[1]],this._state.end=[f[0],f[1]],this._state.columnSelectMode=p,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(d,f,p,o){return!this._areCoordinatesEqual(d,this._state.start)||!this._areCoordinatesEqual(f,this._state.end)||p!==this._state.columnSelectMode||o!==this._state.ydisp}_areCoordinatesEqual(d,f){return!(!d||!f)&&d[0]===f[0]&&d[1]===f[1]}}s.SelectionRenderLayer=u},744:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextRenderLayer=void 0;const c=a(577),u=a(147),n=a(782),d=a(855),f=a(903),p=a(574);class o extends f.BaseRenderLayer{constructor(r,t,i,h,v,l,g,_,m,C){super(r,t,"text",i,h,C,v,l,_,m),this._characterJoinerService=g,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new n.CellData,this._state=new p.GridCache,this.register(l.onSpecificOptionChange("allowTransparency",(b=>this._setTransparency(b))))}resize(r){super.resize(r);const t=this._getFont(!1,!1);this._characterWidth===r.device.char.width&&this._characterFont===t||(this._characterWidth=r.device.char.width,this._characterFont=t,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(r,t,i){for(let h=r;h<=t;h++){const v=h+this._bufferService.buffer.ydisp,l=this._bufferService.buffer.lines.get(v),g=this._characterJoinerService.getJoinedCharacters(v);for(let _=0;_<this._bufferService.cols;_++){l.loadCell(_,this._workCell);let m=this._workCell,C=!1,b=_;if(m.getWidth()!==0){if(g.length>0&&_===g[0][0]){C=!0;const y=g.shift();m=new c.JoinedCellData(this._workCell,l.translateToString(!0,y[0],y[1]),y[1]-y[0]),b=y[1]-1}!C&&this._isOverlapping(m)&&b<l.length-1&&l.getCodePoint(b+1)===d.NULL_CELL_CODE&&(m.content&=-12582913,m.content|=8388608),i(m,_,h),_=b}}}}_drawBackground(r,t){const i=this._ctx,h=this._bufferService.cols;let v=0,l=0,g=null;i.save(),this._forEachCell(r,t,((_,m,C)=>{let b=null;_.isInverse()?b=_.isFgDefault()?this._themeService.colors.foreground.css:_.isFgRGB()?`rgb(${u.AttributeData.toColorRGB(_.getFgColor()).join(",")})`:this._themeService.colors.ansi[_.getFgColor()].css:_.isBgRGB()?b=`rgb(${u.AttributeData.toColorRGB(_.getBgColor()).join(",")})`:_.isBgPalette()&&(b=this._themeService.colors.ansi[_.getBgColor()].css);let y=!1;this._decorationService.forEachDecorationAtCell(m,this._bufferService.buffer.ydisp+C,void 0,(w=>{w.options.layer!=="top"&&y||(w.backgroundColorRGB&&(b=w.backgroundColorRGB.css),y=w.options.layer==="top")})),g===null&&(v=m,l=C),C!==l?(i.fillStyle=g||"",this._fillCells(v,l,h-v,1),v=m,l=C):g!==b&&(i.fillStyle=g||"",this._fillCells(v,l,m-v,1),v=m,l=C),g=b})),g!==null&&(i.fillStyle=g,this._fillCells(v,l,h-v,1)),i.restore()}_drawForeground(r,t){this._forEachCell(r,t,((i,h,v)=>this._drawChars(i,h,v)))}handleGridChanged(r,t){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,r,this._bufferService.cols,t-r+1),this._drawBackground(r,t),this._drawForeground(r,t))}_isOverlapping(r){if(r.getWidth()!==1||r.getCode()<256)return!1;const t=r.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;const i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i,i}}s.TextRenderLayer=o},274:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const c=a(855),u=a(160),n=a(374);let d,f=0,p=0,o=!1,e=!1,r=!1,t=0;s.CellColorResolver=class{constructor(i,h,v,l,g,_){this._terminal=i,this._optionService=h,this._selectionRenderModel=v,this._decorationService=l,this._coreBrowserService=g,this._themeService=_,this.result={fg:0,bg:0,ext:0}}resolve(i,h,v,l){if(this.result.bg=i.bg,this.result.fg=i.fg,this.result.ext=268435456&i.bg?i.extended.ext:0,p=0,f=0,e=!1,o=!1,r=!1,d=this._themeService.colors,t=0,i.getCode()!==c.NULL_CELL_CODE&&i.extended.underlineStyle===4){const g=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));t=h*l%(2*Math.round(g))}if(this._decorationService.forEachDecorationAtCell(h,v,"bottom",(g=>{g.backgroundColorRGB&&(p=g.backgroundColorRGB.rgba>>8&16777215,e=!0),g.foregroundColorRGB&&(f=g.foregroundColorRGB.rgba>>8&16777215,o=!0)})),r=this._selectionRenderModel.isCellSelected(this._terminal,h,v),r){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:p=(16777215&this.result.fg)<<8|255;break;default:p=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:p=(16777215&this.result.bg)<<8|255}p=u.rgba.blend(p,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else p=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,d.selectionForeground&&(f=d.selectionForeground.rgba>>8&16777215,o=!0),(0,n.treatGlyphAsBackgroundColor)(i.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)f=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:f=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:f=(16777215&this.result.fg)<<8|255;break;default:f=this._themeService.colors.foreground.rgba}f=u.rgba.blend(f,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(h,v,"top",(g=>{g.backgroundColorRGB&&(p=g.backgroundColorRGB.rgba>>8&16777215,e=!0),g.foregroundColorRGB&&(f=g.foregroundColorRGB.rgba>>8&16777215,o=!0)})),e&&(p=r?-16777216&i.bg&-134217729|p|50331648:-16777216&i.bg|p|50331648),o&&(f=-16777216&i.fg&-67108865|f|50331648),67108864&this.result.fg&&(e&&!o&&(f=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&d.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!e&&o&&(p=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&d.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,e=!0)),d=void 0,this.result.bg=e?p:this.result.bg,this.result.fg=o?f:this.result.fg,this.result.ext&=536870911,this.result.ext|=t<<29&3758096384}}},627:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const c=a(509),u=a(197),n=[];s.acquireTextureAtlas=function(d,f,p,o,e,r,t,i){const h=(0,u.generateConfig)(o,e,r,t,f,p,i);for(let g=0;g<n.length;g++){const _=n[g],m=_.ownedBy.indexOf(d);if(m>=0){if((0,u.configEquals)(_.config,h))return _.atlas;_.ownedBy.length===1?(_.atlas.dispose(),n.splice(g,1)):_.ownedBy.splice(m,1);break}}for(let g=0;g<n.length;g++){const _=n[g];if((0,u.configEquals)(_.config,h))return _.ownedBy.push(d),_.atlas}const v=d._core,l={atlas:new c.TextureAtlas(document,h,v.unicodeService),config:h,ownedBy:[d]};return n.push(l),l.atlas},s.removeTerminalFromCache=function(d){for(let f=0;f<n.length;f++){const p=n[f].ownedBy.indexOf(d);if(p!==-1){n[f].ownedBy.length===1?(n[f].atlas.dispose(),n.splice(f,1)):n[f].ownedBy.splice(p,1);break}}}},197:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const c=a(160);s.generateConfig=function(u,n,d,f,p,o,e){const r={foreground:o.foreground,background:o.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:p.customGlyphs,devicePixelRatio:e,letterSpacing:p.letterSpacing,lineHeight:p.lineHeight,deviceCellWidth:u,deviceCellHeight:n,deviceCharWidth:d,deviceCharHeight:f,fontFamily:p.fontFamily,fontSize:p.fontSize,fontWeight:p.fontWeight,fontWeightBold:p.fontWeightBold,allowTransparency:p.allowTransparency,drawBoldTextInBrightColors:p.drawBoldTextInBrightColors,minimumContrastRatio:p.minimumContrastRatio,colors:r}},s.configEquals=function(u,n){for(let d=0;d<u.colors.ansi.length;d++)if(u.colors.ansi[d].rgba!==n.colors.ansi[d].rgba)return!1;return u.devicePixelRatio===n.devicePixelRatio&&u.customGlyphs===n.customGlyphs&&u.lineHeight===n.lineHeight&&u.letterSpacing===n.letterSpacing&&u.fontFamily===n.fontFamily&&u.fontSize===n.fontSize&&u.fontWeight===n.fontWeight&&u.fontWeightBold===n.fontWeightBold&&u.allowTransparency===n.allowTransparency&&u.deviceCharWidth===n.deviceCharWidth&&u.deviceCharHeight===n.deviceCharHeight&&u.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&u.minimumContrastRatio===n.minimumContrastRatio&&u.colors.foreground.rgba===n.colors.foreground.rgba&&u.colors.background.rgba===n.colors.background.rgba},s.is256Color=function(u){return(50331648&u)==16777216||(50331648&u)==33554432}},237:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=a(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(a,c){this._renderCallback=a,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const c=a(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const u={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(o,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(o,e)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(o,e)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,e)=>`M1,${.5-e} L${.5-o},${.5-e} L${.5-o},1 M1,${.5+e} L${.5+o},${.5+e} L${.5+o},1`},"╕":{1:(o,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(o,e)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,e)=>`M0,${.5+e} L${.5-o},${.5+e} L${.5-o},1 M0,${.5-e} L${.5+o},${.5-e} L${.5+o},1`},"╘":{1:(o,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(o,e)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,e)=>`M1,${.5-e} L${.5+o},${.5-e} L${.5+o},0 M1,${.5+e} L${.5-o},${.5+e} L${.5-o},0`},"╛":{1:(o,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(o,e)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,e)=>`M0,${.5-e} L${.5-o},${.5-e} L${.5-o},0 M0,${.5+e} L${.5+o},${.5+e} L${.5+o},0`},"╞":{1:(o,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(o,e)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,e)=>`M${.5-o},0 L${.5-o},1 M1,${.5+e} L${.5+o},${.5+e} L${.5+o},1 M1,${.5-e} L${.5+o},${.5-e} L${.5+o},0`},"╡":{1:(o,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(o,e)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,e)=>`M${.5+o},0 L${.5+o},1 M0,${.5+e} L${.5-o},${.5+e} L${.5-o},1 M0,${.5-e} L${.5-o},${.5-e} L${.5-o},0`},"╤":{1:(o,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(o,e)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-o},${.5+e} L${.5-o},1 M1,${.5+e} L${.5+o},${.5+e} L${.5+o},1`},"╧":{1:(o,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(o,e)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-o},${.5-e} L${.5-o},0 M1,${.5-e} L${.5+o},${.5-e} L${.5+o},0`},"╪":{1:(o,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(o,e)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,e)=>`M0,${.5+e} L${.5-o},${.5+e} L${.5-o},1 M1,${.5+e} L${.5+o},${.5+e} L${.5+o},1 M0,${.5-e} L${.5-o},${.5-e} L${.5-o},0 M1,${.5-e} L${.5+o},${.5-e} L${.5+o},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(o,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(o,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(o,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(o,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(o,e,r,t,i,h,v,l){const g=s.blockElementDefinitions[e];if(g)return(function(b,y,w,R,D,P){for(let T=0;T<y.length;T++){const A=y[T],S=D/8,x=P/8;b.fillRect(w+A.x*S,R+A.y*x,A.w*S,A.h*x)}})(o,g,r,t,i,h),!0;const _=u[e];if(_)return(function(b,y,w,R,D,P){let T=n.get(y);T||(T=new Map,n.set(y,T));const A=b.fillStyle;if(typeof A!="string")throw new Error(`Unexpected fillStyle type "${A}"`);let S=T.get(A);if(!S){const x=y[0].length,E=y.length,k=b.canvas.ownerDocument.createElement("canvas");k.width=x,k.height=E;const I=(0,c.throwIfFalsy)(k.getContext("2d")),F=new ImageData(x,E);let N,z,M,L;if(A.startsWith("#"))N=parseInt(A.slice(1,3),16),z=parseInt(A.slice(3,5),16),M=parseInt(A.slice(5,7),16),L=A.length>7&&parseInt(A.slice(7,9),16)||1;else{if(!A.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${A}" when drawing pattern glyph`);[N,z,M,L]=A.substring(5,A.length-1).split(",").map((H=>parseFloat(H)))}for(let H=0;H<E;H++)for(let O=0;O<x;O++)F.data[4*(H*x+O)]=N,F.data[4*(H*x+O)+1]=z,F.data[4*(H*x+O)+2]=M,F.data[4*(H*x+O)+3]=y[H][O]*(255*L);I.putImageData(F,0,0),S=(0,c.throwIfFalsy)(b.createPattern(k,null)),T.set(A,S)}b.fillStyle=S,b.fillRect(w,R,D,P)})(o,_,r,t,i,h),!0;const m=s.boxDrawingDefinitions[e];if(m)return(function(b,y,w,R,D,P,T){b.strokeStyle=b.fillStyle;for(const[A,S]of Object.entries(y)){let x;b.beginPath(),b.lineWidth=T*Number.parseInt(A),x=typeof S=="function"?S(.15,.15/P*D):S;for(const E of x.split(" ")){const k=E[0],I=f[k];if(!I){console.error(`Could not find drawing instructions for "${k}"`);continue}const F=E.substring(1).split(",");F[0]&&F[1]&&I(b,p(F,D,P,w,R,!0,T))}b.stroke(),b.closePath()}})(o,m,r,t,i,h,l),!0;const C=s.powerlineDefinitions[e];return!!C&&((function(b,y,w,R,D,P,T,A){const S=new Path2D;S.rect(w,R,D,P),b.clip(S),b.beginPath();const x=T/12;b.lineWidth=A*x;for(const E of y.d.split(" ")){const k=E[0],I=f[k];if(!I){console.error(`Could not find drawing instructions for "${k}"`);continue}const F=E.substring(1).split(",");F[0]&&F[1]&&I(b,p(F,D,P,w,R,!1,A,(y.leftPadding??0)*(x/2),(y.rightPadding??0)*(x/2)))}y.type===1?(b.strokeStyle=b.fillStyle,b.stroke()):b.fill(),b.closePath()})(o,C,r,t,i,h,v,l),!0)};const n=new Map;function d(o,e,r=0){return Math.max(Math.min(o,e),r)}const f={C:(o,e)=>o.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(o,e)=>o.lineTo(e[0],e[1]),M:(o,e)=>o.moveTo(e[0],e[1])};function p(o,e,r,t,i,h,v,l=0,g=0){const _=o.map((m=>parseFloat(m)||parseInt(m)));if(_.length<2)throw new Error("Too few arguments for instruction");for(let m=0;m<_.length;m+=2)_[m]*=e-l*v-g*v,h&&_[m]!==0&&(_[m]=d(Math.round(_[m]+.5)-.5,e,0)),_[m]+=t+l*v;for(let m=1;m<_.length;m+=2)_[m]*=r,h&&_[m]!==0&&(_[m]=d(Math.round(_[m]+.5)-.5,r,0)),_[m]+=i;return _}},56:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const c=a(859);s.observeDevicePixelDimensions=function(u,n,d){let f=new n.ResizeObserver((p=>{const o=p.find((t=>t.target===u));if(!o)return;if(!("devicePixelContentBoxSize"in o))return f==null||f.disconnect(),void(f=void 0);const e=o.devicePixelContentBoxSize[0].inlineSize,r=o.devicePixelContentBoxSize[0].blockSize;e>0&&r>0&&d(e,r)}));try{f.observe(u,{box:["device-pixel-content-box"]})}catch{f.disconnect(),f=void 0}return(0,c.toDisposable)((()=>f==null?void 0:f.disconnect()))}},374:(B,s)=>{function a(u){return 57508<=u&&u<=57558}function c(u){return u>=128512&&u<=128591||u>=127744&&u<=128511||u>=128640&&u<=128767||u>=9728&&u<=9983||u>=9984&&u<=10175||u>=65024&&u<=65039||u>=129280&&u<=129535||u>=127462&&u<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(u){if(!u)throw new Error("value must not be falsy");return u},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},s.isEmoji=c,s.allowRescaling=function(u,n,d,f){return n===1&&d>Math.ceil(1.5*f)&&u!==void 0&&u>255&&!c(u)&&!a(u)&&!(function(p){return 57344<=p&&p<=63743})(u)},s.treatGlyphAsBackgroundColor=function(u){return a(u)||(function(n){return 9472<=n&&n<=9631})(u)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(u,n,d=0){return(u-(2*Math.round(n)-d))%(2*Math.round(n))}},296:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(u,n,d,f=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const p=u.buffers.active.ydisp,o=n[1]-p,e=d[1]-p,r=Math.max(o,0),t=Math.min(e,u.rows-1);r>=u.rows||t<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=o,this.viewportEndRow=e,this.viewportCappedStartRow=r,this.viewportCappedEndRow=t,this.startCol=n[0],this.endCol=d[0])}isCellSelected(u,n,d){return!!this.hasSelection&&(d-=u.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},509:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const c=a(237),u=a(860),n=a(374),d=a(160),f=a(345),p=a(485),o=a(385),e=a(147),r=a(855),t={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let i;class h{get pages(){return this._pages}constructor(m,C,b){this._document=m,this._config=C,this._unicodeService=b,this._didWarmUp=!1,this._cacheMap=new p.FourKeyMap,this._cacheMapCombined=new p.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new e.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new f.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new f.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=g(m,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,n.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const m of this.pages)m.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const m=new o.IdleTaskQueue;for(let C=33;C<126;C++)m.enqueue((()=>{if(!this._cacheMap.get(C,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT)){const b=this._drawToCache(C,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT);this._cacheMap.set(C,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT,b)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const m of this._pages)m.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(h.maxAtlasPages&&this._pages.length>=Math.max(4,h.maxAtlasPages)){const C=this._pages.filter((T=>2*T.canvas.width<=(h.maxTextureSize||4096))).sort(((T,A)=>A.canvas.width!==T.canvas.width?A.canvas.width-T.canvas.width:A.percentageUsed-T.percentageUsed));let b=-1,y=0;for(let T=0;T<C.length;T++)if(C[T].canvas.width!==y)b=T,y=C[T].canvas.width;else if(T-b==3)break;const w=C.slice(b,b+4),R=w.map((T=>T.glyphs[0].texturePage)).sort(((T,A)=>T>A?1:-1)),D=this.pages.length-w.length,P=this._mergePages(w,D);P.version++;for(let T=R.length-1;T>=0;T--)this._deletePage(R[T]);this.pages.push(P),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(P.canvas)}const m=new v(this._document,this._textureSize);return this._pages.push(m),this._activePages.push(m),this._onAddTextureAtlasCanvas.fire(m.canvas),m}_mergePages(m,C){const b=2*m[0].canvas.width,y=new v(this._document,b,m);for(const[w,R]of m.entries()){const D=w*R.canvas.width%b,P=Math.floor(w/2)*R.canvas.height;y.ctx.drawImage(R.canvas,D,P);for(const A of R.glyphs)A.texturePage=C,A.sizeClipSpace.x=A.size.x/b,A.sizeClipSpace.y=A.size.y/b,A.texturePosition.x+=D,A.texturePosition.y+=P,A.texturePositionClipSpace.x=A.texturePosition.x/b,A.texturePositionClipSpace.y=A.texturePosition.y/b;this._onRemoveTextureAtlasCanvas.fire(R.canvas);const T=this._activePages.indexOf(R);T!==-1&&this._activePages.splice(T,1)}return y}_deletePage(m){this._pages.splice(m,1);for(let C=m;C<this._pages.length;C++){const b=this._pages[C];for(const y of b.glyphs)y.texturePage--;b.version++}}getRasterizedGlyphCombinedChar(m,C,b,y,w){return this._getFromCacheMap(this._cacheMapCombined,m,C,b,y,w)}getRasterizedGlyph(m,C,b,y,w){return this._getFromCacheMap(this._cacheMap,m,C,b,y,w)}_getFromCacheMap(m,C,b,y,w,R=!1){return i=m.get(C,b,y,w),i||(i=this._drawToCache(C,b,y,w,R),m.set(C,b,y,w,i)),i}_getColorFromAnsiIndex(m){if(m>=this._config.colors.ansi.length)throw new Error("No color found for idx "+m);return this._config.colors.ansi[m]}_getBackgroundColor(m,C,b,y){if(this._config.allowTransparency)return d.NULL_COLOR;let w;switch(m){case 16777216:case 33554432:w=this._getColorFromAnsiIndex(C);break;case 50331648:const R=e.AttributeData.toColorRGB(C);w=d.channels.toColor(R[0],R[1],R[2]);break;default:w=b?d.color.opaque(this._config.colors.foreground):this._config.colors.background}return w}_getForegroundColor(m,C,b,y,w,R,D,P,T,A){const S=this._getMinimumContrastColor(m,C,b,y,w,R,D,T,P,A);if(S)return S;let x;switch(w){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&T&&R<8&&(R+=8),x=this._getColorFromAnsiIndex(R);break;case 50331648:const E=e.AttributeData.toColorRGB(R);x=d.channels.toColor(E[0],E[1],E[2]);break;default:x=D?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(x=d.color.opaque(x)),P&&(x=d.color.multiplyOpacity(x,c.DIM_OPACITY)),x}_resolveBackgroundRgba(m,C,b){switch(m){case 16777216:case 33554432:return this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return b?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(m,C,b,y){switch(m){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&y&&C<8&&(C+=8),this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return b?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(m,C,b,y,w,R,D,P,T,A){if(this._config.minimumContrastRatio===1||A)return;const S=this._getContrastCache(T),x=S.getColor(m,y);if(x!==void 0)return x||void 0;const E=this._resolveBackgroundRgba(C,b,D),k=this._resolveForegroundRgba(w,R,D,P),I=d.rgba.ensureContrastRatio(E,k,this._config.minimumContrastRatio/(T?2:1));if(!I)return void S.setColor(m,y,null);const F=d.channels.toColor(I>>24&255,I>>16&255,I>>8&255);return S.setColor(m,y,F),F}_getContrastCache(m){return m?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(m,C,b,y,w=!1){const R=typeof m=="number"?String.fromCharCode(m):m,D=Math.min(this._config.deviceCellWidth*Math.max(R.length,2)+4,this._textureSize);this._tmpCanvas.width<D&&(this._tmpCanvas.width=D);const P=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<P&&(this._tmpCanvas.height=P),this._tmpCtx.save(),this._workAttributeData.fg=b,this._workAttributeData.bg=C,this._workAttributeData.extended.ext=y,this._workAttributeData.isInvisible())return t;const T=!!this._workAttributeData.isBold(),A=!!this._workAttributeData.isInverse(),S=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),E=!!this._workAttributeData.isUnderline(),k=!!this._workAttributeData.isStrikethrough(),I=!!this._workAttributeData.isOverline();let F=this._workAttributeData.getFgColor(),N=this._workAttributeData.getFgColorMode(),z=this._workAttributeData.getBgColor(),M=this._workAttributeData.getBgColorMode();if(A){const U=F;F=z,z=U;const J=N;N=M,M=J}const L=this._getBackgroundColor(M,z,A,S);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const H=T?this._config.fontWeightBold:this._config.fontWeight,O=x?"italic":"";this._tmpCtx.font=`${O} ${H} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const $=R.length===1&&(0,n.isPowerlineGlyph)(R.charCodeAt(0)),W=R.length===1&&(0,n.isRestrictedPowerlineGlyph)(R.charCodeAt(0)),K=this._getForegroundColor(C,M,z,b,N,F,A,S,T,(0,n.treatGlyphAsBackgroundColor)(R.charCodeAt(0)));this._tmpCtx.fillStyle=K.css;const q=W?0:4;let Z=!1;this._config.customGlyphs!==!1&&(Z=(0,u.tryDrawCustomChar)(this._tmpCtx,R,q,q,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let ie,j=!$;if(ie=typeof m=="number"?this._unicodeService.wcwidth(m):this._unicodeService.getStringCellWidth(m),E){this._tmpCtx.save();const U=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),J=U%2==1?.5:0;if(this._tmpCtx.lineWidth=U,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())j=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{j=!1;let se=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&se<8&&(se+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(se).css}this._tmpCtx.beginPath();const te=q,ee=Math.ceil(q+this._config.deviceCharHeight)-J-(w?2*U:0),ce=ee+U,oe=ee+2*U;let ae=this._workAttributeData.getUnderlineVariantOffset();for(let se=0;se<ie;se++){this._tmpCtx.save();const Q=te+se*this._config.deviceCellWidth,G=te+(se+1)*this._config.deviceCellWidth,fe=Q+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Q,ee),this._tmpCtx.lineTo(G,ee),this._tmpCtx.moveTo(Q,oe),this._tmpCtx.lineTo(G,oe);break;case 3:const ve=U<=1?oe:Math.ceil(q+this._config.deviceCharHeight-U/2)-J,ge=U<=1?ee:Math.ceil(q+this._config.deviceCharHeight+U/2)-J,ye=new Path2D;ye.rect(Q,ee,this._config.deviceCellWidth,oe-ee),this._tmpCtx.clip(ye),this._tmpCtx.moveTo(Q-this._config.deviceCellWidth/2,ce),this._tmpCtx.bezierCurveTo(Q-this._config.deviceCellWidth/2,ge,Q,ge,Q,ce),this._tmpCtx.bezierCurveTo(Q,ve,fe,ve,fe,ce),this._tmpCtx.bezierCurveTo(fe,ge,G,ge,G,ce),this._tmpCtx.bezierCurveTo(G,ve,G+this._config.deviceCellWidth/2,ve,G+this._config.deviceCellWidth/2,ce);break;case 4:const pe=ae===0?0:ae>=U?2*U-ae:U-ae;ae>=U||pe===0?(this._tmpCtx.setLineDash([Math.round(U),Math.round(U)]),this._tmpCtx.moveTo(Q+pe,ee),this._tmpCtx.lineTo(G,ee)):(this._tmpCtx.setLineDash([Math.round(U),Math.round(U)]),this._tmpCtx.moveTo(Q,ee),this._tmpCtx.lineTo(Q+pe,ee),this._tmpCtx.moveTo(Q+pe+U,ee),this._tmpCtx.lineTo(G,ee)),ae=(0,n.computeNextVariantOffset)(G-Q,U,ae);break;case 5:const Ae=.6,Be=.3,Se=G-Q,Le=Math.floor(Ae*Se),xe=Math.floor(Be*Se),Te=Se-Le-xe;this._tmpCtx.setLineDash([Le,xe,Te]),this._tmpCtx.moveTo(Q,ee),this._tmpCtx.lineTo(G,ee);break;default:this._tmpCtx.moveTo(Q,ee),this._tmpCtx.lineTo(G,ee)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Z&&this._config.fontSize>=12&&!this._config.allowTransparency&&R!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const se=this._tmpCtx.measureText(R);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in se&&se.actualBoundingBoxDescent>0){this._tmpCtx.save();const Q=new Path2D;Q.rect(te,ee-Math.ceil(U/2),this._config.deviceCellWidth*ie,oe-ee+Math.ceil(U/2)),this._tmpCtx.clip(Q),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(R,q,q+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(I){const U=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),J=U%2==1?.5:0;this._tmpCtx.lineWidth=U,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(q,q+J),this._tmpCtx.lineTo(q+this._config.deviceCharWidth*ie,q+J),this._tmpCtx.stroke()}if(Z||this._tmpCtx.fillText(R,q,q+this._config.deviceCharHeight),R==="_"&&!this._config.allowTransparency){let U=l(this._tmpCtx.getImageData(q,q,this._config.deviceCellWidth,this._config.deviceCellHeight),L,K,j);if(U)for(let J=1;J<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(R,q,q+this._config.deviceCharHeight-J),U=l(this._tmpCtx.getImageData(q,q,this._config.deviceCellWidth,this._config.deviceCellHeight),L,K,j),U);J++);}if(k){const U=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),J=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=U,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(q,q+Math.floor(this._config.deviceCharHeight/2)-J),this._tmpCtx.lineTo(q+this._config.deviceCharWidth*ie,q+Math.floor(this._config.deviceCharHeight/2)-J),this._tmpCtx.stroke()}this._tmpCtx.restore();const he=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let _e;if(_e=this._config.allowTransparency?(function(U){for(let J=0;J<U.data.length;J+=4)if(U.data[J+3]>0)return!1;return!0})(he):l(he,L,K,j),_e)return t;const Y=this._findGlyphBoundingBox(he,this._workBoundingBox,D,W,Z,q);let V,X;for(;;){if(this._activePages.length===0){const U=this._createNewPage();V=U,X=U.currentRow,X.height=Y.size.y;break}V=this._activePages[this._activePages.length-1],X=V.currentRow;for(const U of this._activePages)Y.size.y<=U.currentRow.height&&(V=U,X=U.currentRow);for(let U=this._activePages.length-1;U>=0;U--)for(const J of this._activePages[U].fixedRows)J.height<=X.height&&Y.size.y<=J.height&&(V=this._activePages[U],X=J);if(X.y+Y.size.y>=V.canvas.height||X.height>Y.size.y+2){let U=!1;if(V.currentRow.y+V.currentRow.height+Y.size.y>=V.canvas.height){let J;for(const te of this._activePages)if(te.currentRow.y+te.currentRow.height+Y.size.y<te.canvas.height){J=te;break}if(J)V=J;else if(h.maxAtlasPages&&this._pages.length>=h.maxAtlasPages&&X.y+Y.size.y<=V.canvas.height&&X.height>=Y.size.y&&X.x+Y.size.x<=V.canvas.width)U=!0;else{const te=this._createNewPage();V=te,X=te.currentRow,X.height=Y.size.y,U=!0}}U||(V.currentRow.height>0&&V.fixedRows.push(V.currentRow),X={x:0,y:V.currentRow.y+V.currentRow.height,height:Y.size.y},V.fixedRows.push(X),V.currentRow={x:0,y:X.y+X.height,height:0})}if(X.x+Y.size.x<=V.canvas.width)break;X===V.currentRow?(X.x=0,X.y+=X.height,X.height=0):V.fixedRows.splice(V.fixedRows.indexOf(X),1)}return Y.texturePage=this._pages.indexOf(V),Y.texturePosition.x=X.x,Y.texturePosition.y=X.y,Y.texturePositionClipSpace.x=X.x/V.canvas.width,Y.texturePositionClipSpace.y=X.y/V.canvas.height,Y.sizeClipSpace.x/=V.canvas.width,Y.sizeClipSpace.y/=V.canvas.height,X.height=Math.max(X.height,Y.size.y),X.x+=Y.size.x,V.ctx.putImageData(he,Y.texturePosition.x-this._workBoundingBox.left,Y.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Y.size.x,Y.size.y),V.addGlyph(Y),V.version++,Y}_findGlyphBoundingBox(m,C,b,y,w,R){C.top=0;const D=y?this._config.deviceCellHeight:this._tmpCanvas.height,P=y?this._config.deviceCellWidth:b;let T=!1;for(let A=0;A<D;A++){for(let S=0;S<P;S++){const x=A*this._tmpCanvas.width*4+4*S+3;if(m.data[x]!==0){C.top=A,T=!0;break}}if(T)break}C.left=0,T=!1;for(let A=0;A<R+P;A++){for(let S=0;S<D;S++){const x=S*this._tmpCanvas.width*4+4*A+3;if(m.data[x]!==0){C.left=A,T=!0;break}}if(T)break}C.right=P,T=!1;for(let A=R+P-1;A>=R;A--){for(let S=0;S<D;S++){const x=S*this._tmpCanvas.width*4+4*A+3;if(m.data[x]!==0){C.right=A,T=!0;break}}if(T)break}C.bottom=D,T=!1;for(let A=D-1;A>=0;A--){for(let S=0;S<P;S++){const x=A*this._tmpCanvas.width*4+4*S+3;if(m.data[x]!==0){C.bottom=A,T=!0;break}}if(T)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:C.right-C.left+1,y:C.bottom-C.top+1},sizeClipSpace:{x:C.right-C.left+1,y:C.bottom-C.top+1},offset:{x:-C.left+R+(y||w?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-C.top+R+(y||w?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=h;class v{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(m){this._glyphs.push(m),this._usedPixels+=m.size.x*m.size.y}constructor(m,C,b){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],b)for(const y of b)this._glyphs.push(...y.glyphs),this._usedPixels+=y._usedPixels;this.canvas=g(m,C,C),this.ctx=(0,n.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function l(_,m,C,b){const y=m.rgba>>>24,w=m.rgba>>>16&255,R=m.rgba>>>8&255,D=C.rgba>>>24,P=C.rgba>>>16&255,T=C.rgba>>>8&255,A=Math.floor((Math.abs(y-D)+Math.abs(w-P)+Math.abs(R-T))/12);let S=!0;for(let x=0;x<_.data.length;x+=4)_.data[x]===y&&_.data[x+1]===w&&_.data[x+2]===R||b&&Math.abs(_.data[x]-y)+Math.abs(_.data[x+1]-w)+Math.abs(_.data[x+2]-R)<A?_.data[x+3]=0:S=!1;return S}function g(_,m,C){const b=_.createElement("canvas");return b.width=m,b.height=C,b}},577:function(B,s,a){var c=this&&this.__decorate||function(r,t,i,h){var v,l=arguments.length,g=l<3?t:h===null?h=Object.getOwnPropertyDescriptor(t,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,t,i,h);else for(var _=r.length-1;_>=0;_--)(v=r[_])&&(g=(l<3?v(g):l>3?v(t,i,g):v(t,i))||g);return l>3&&g&&Object.defineProperty(t,i,g),g},u=this&&this.__param||function(r,t){return function(i,h){t(i,h,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const n=a(147),d=a(855),f=a(782),p=a(97);class o extends n.AttributeData{constructor(t,i,h){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=i,this._width=h}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=o;let e=s.CharacterJoinerService=class De{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(t){const i={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(i),i.id}deregister(t){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===t)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(t);if(!i||i.length===0)return[];const h=[],v=i.translateToString(!0);let l=0,g=0,_=0,m=i.getFg(0),C=i.getBg(0);for(let b=0;b<i.getTrimmedLength();b++)if(i.loadCell(b,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==m||this._workCell.bg!==C){if(b-l>1){const y=this._getJoinedRanges(v,_,g,i,l);for(let w=0;w<y.length;w++)h.push(y[w])}l=b,_=g,m=this._workCell.fg,C=this._workCell.bg}g+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-l>1){const b=this._getJoinedRanges(v,_,g,i,l);for(let y=0;y<b.length;y++)h.push(b[y])}return h}_getJoinedRanges(t,i,h,v,l){const g=t.substring(i,h);let _=[];try{_=this._characterJoiners[0].handler(g)}catch(m){console.error(m)}for(let m=1;m<this._characterJoiners.length;m++)try{const C=this._characterJoiners[m].handler(g);for(let b=0;b<C.length;b++)De._mergeRanges(_,C[b])}catch(C){console.error(C)}return this._stringRangesToCellRanges(_,v,l),_}_stringRangesToCellRanges(t,i,h){let v=0,l=!1,g=0,_=t[v];if(_){for(let m=h;m<this._bufferService.cols;m++){const C=i.getWidth(m),b=i.getString(m).length||d.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!l&&_[0]<=g&&(_[0]=m,l=!0),_[1]<=g){if(_[1]=m,_=t[++v],!_)break;_[0]<=g?(_[0]=m,l=!0):l=!1}g+=b}}_&&(_[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let h=!1;for(let v=0;v<t.length;v++){const l=t[v];if(h){if(i[1]<=l[0])return t[v-1][1]=i[1],t;if(i[1]<=l[1])return t[v-1][1]=Math.max(i[1],l[1]),t.splice(v,1),t;t.splice(v,1),v--}else{if(i[1]<=l[0])return t.splice(v,0,i),t;if(i[1]<=l[1])return l[0]=Math.min(i[0],l[0]),t;i[0]<l[1]&&(l[0]=Math.min(i[0],l[0]),h=!0)}}return h?t[t.length-1][1]=i[1]:t.push(i),t}};s.CharacterJoinerService=e=c([u(0,p.IBufferService)],e)},160:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let a=0,c=0,u=0,n=0;var d,f,p,o,e;function r(i){const h=i.toString(16);return h.length<2?"0"+h:h}function t(i,h){return i<h?(h+.05)/(i+.05):(i+.05)/(h+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(i){i.toCss=function(h,v,l,g){return g!==void 0?`#${r(h)}${r(v)}${r(l)}${r(g)}`:`#${r(h)}${r(v)}${r(l)}`},i.toRgba=function(h,v,l,g=255){return(h<<24|v<<16|l<<8|g)>>>0},i.toColor=function(h,v,l,g){return{css:i.toCss(h,v,l,g),rgba:i.toRgba(h,v,l,g)}}})(d||(s.channels=d={})),(function(i){function h(v,l){return n=Math.round(255*l),[a,c,u]=e.toChannels(v.rgba),{css:d.toCss(a,c,u,n),rgba:d.toRgba(a,c,u,n)}}i.blend=function(v,l){if(n=(255&l.rgba)/255,n===1)return{css:l.css,rgba:l.rgba};const g=l.rgba>>24&255,_=l.rgba>>16&255,m=l.rgba>>8&255,C=v.rgba>>24&255,b=v.rgba>>16&255,y=v.rgba>>8&255;return a=C+Math.round((g-C)*n),c=b+Math.round((_-b)*n),u=y+Math.round((m-y)*n),{css:d.toCss(a,c,u),rgba:d.toRgba(a,c,u)}},i.isOpaque=function(v){return(255&v.rgba)==255},i.ensureContrastRatio=function(v,l,g){const _=e.ensureContrastRatio(v.rgba,l.rgba,g);if(_)return d.toColor(_>>24&255,_>>16&255,_>>8&255)},i.opaque=function(v){const l=(255|v.rgba)>>>0;return[a,c,u]=e.toChannels(l),{css:d.toCss(a,c,u),rgba:l}},i.opacity=h,i.multiplyOpacity=function(v,l){return n=255&v.rgba,h(v,n*l/255)},i.toColorRGB=function(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}})(f||(s.color=f={})),(function(i){let h,v;try{const l=document.createElement("canvas");l.width=1,l.height=1;const g=l.getContext("2d",{willReadFrequently:!0});g&&(h=g,h.globalCompositeOperation="copy",v=h.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return a=parseInt(l.slice(1,2).repeat(2),16),c=parseInt(l.slice(2,3).repeat(2),16),u=parseInt(l.slice(3,4).repeat(2),16),d.toColor(a,c,u);case 5:return a=parseInt(l.slice(1,2).repeat(2),16),c=parseInt(l.slice(2,3).repeat(2),16),u=parseInt(l.slice(3,4).repeat(2),16),n=parseInt(l.slice(4,5).repeat(2),16),d.toColor(a,c,u,n);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}const g=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return a=parseInt(g[1]),c=parseInt(g[2]),u=parseInt(g[3]),n=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),d.toColor(a,c,u,n);if(!h||!v)throw new Error("css.toColor: Unsupported css format");if(h.fillStyle=v,h.fillStyle=l,typeof h.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(h.fillRect(0,0,1,1),[a,c,u,n]=h.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,c,u,n),css:l}}})(p||(s.css=p={})),(function(i){function h(v,l,g){const _=v/255,m=l/255,C=g/255;return .2126*(_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}i.relativeLuminance=function(v){return h(v>>16&255,v>>8&255,255&v)},i.relativeLuminance2=h})(o||(s.rgb=o={})),(function(i){function h(l,g,_){const m=l>>24&255,C=l>>16&255,b=l>>8&255;let y=g>>24&255,w=g>>16&255,R=g>>8&255,D=t(o.relativeLuminance2(y,w,R),o.relativeLuminance2(m,C,b));for(;D<_&&(y>0||w>0||R>0);)y-=Math.max(0,Math.ceil(.1*y)),w-=Math.max(0,Math.ceil(.1*w)),R-=Math.max(0,Math.ceil(.1*R)),D=t(o.relativeLuminance2(y,w,R),o.relativeLuminance2(m,C,b));return(y<<24|w<<16|R<<8|255)>>>0}function v(l,g,_){const m=l>>24&255,C=l>>16&255,b=l>>8&255;let y=g>>24&255,w=g>>16&255,R=g>>8&255,D=t(o.relativeLuminance2(y,w,R),o.relativeLuminance2(m,C,b));for(;D<_&&(y<255||w<255||R<255);)y=Math.min(255,y+Math.ceil(.1*(255-y))),w=Math.min(255,w+Math.ceil(.1*(255-w))),R=Math.min(255,R+Math.ceil(.1*(255-R))),D=t(o.relativeLuminance2(y,w,R),o.relativeLuminance2(m,C,b));return(y<<24|w<<16|R<<8|255)>>>0}i.blend=function(l,g){if(n=(255&g)/255,n===1)return g;const _=g>>24&255,m=g>>16&255,C=g>>8&255,b=l>>24&255,y=l>>16&255,w=l>>8&255;return a=b+Math.round((_-b)*n),c=y+Math.round((m-y)*n),u=w+Math.round((C-w)*n),d.toRgba(a,c,u)},i.ensureContrastRatio=function(l,g,_){const m=o.relativeLuminance(l>>8),C=o.relativeLuminance(g>>8);if(t(m,C)<_){if(C<m){const w=h(l,g,_),R=t(m,o.relativeLuminance(w>>8));if(R<_){const D=v(l,g,_);return R>t(m,o.relativeLuminance(D>>8))?w:D}return w}const b=v(l,g,_),y=t(m,o.relativeLuminance(b>>8));if(y<_){const w=h(l,g,_);return y>t(m,o.relativeLuminance(w>>8))?b:w}return b}},i.reduceLuminance=h,i.increaseLuminance=v,i.toChannels=function(l){return[l>>24&255,l>>16&255,l>>8&255,255&l]}})(e||(s.rgba=e={})),s.toPaddedHex=r,s.contrastRatio=t},345:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===a)return void this._listeners.splice(c,1)}}})),this._event}fire(a,c){const u=[];for(let n=0;n<this._listeners.length;n++)u.push(this._listeners[n]);for(let n=0;n<u.length;n++)u[n].call(void 0,a,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,c){return a((u=>c.fire(u)))},s.runAndSubscribe=function(a,c){return c(void 0),a((u=>c(u)))}},859:(B,s)=>{function a(c){for(const u of c)u.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const u=this._disposables.indexOf(c);u!==-1&&this._disposables.splice(u,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var u;this._isDisposed||c===this._value||((u=this._value)==null||u.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=a,s.getDisposeArrayDisposable=function(c){return{dispose:()=>a(c)}}},485:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(u,n,d){this._data[u]||(this._data[u]={}),this._data[u][n]=d}get(u,n){return this._data[u]?this._data[u][n]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(c,u,n,d,f){this._data.get(c,u)||this._data.set(c,u,new a),this._data.get(c,u).set(n,d,f)}get(c,u,n,d){var f;return(f=this._data.get(c,u))==null?void 0:f.get(n,d)}clear(){this._data.clear()}}},399:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const a=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const u=a.match(/Version\/(\d+)/);return u===null||u.length<2?0:parseInt(u[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},385:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=a(399);class u{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let p=0,o=0,e=f.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(p=Date.now(),this._tasks[this._i]()||this._i++,p=Math.max(1,Date.now()-p),o=Math.max(p,o),r=f.timeRemaining(),1.5*o>r)return e-p<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-p))}ms`),void this._start();e=r}this.clear()}}class n extends u{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const p=Date.now()+f;return{timeRemaining:()=>Math.max(0,p-Date.now())}}}s.PriorityTaskQueue=n,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends u{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},147:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=a;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},782:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=a(133),u=a(855),n=a(147);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(p){const o=new d;return o.setFromCharData(p),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(p){this.fg=p[u.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(p[u.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(p[u.CHAR_DATA_CHAR_INDEX].length===2){const e=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const r=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(e-55296)+r-56320+65536|p[u.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[u.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=p[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|p[u.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=d},855:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,c=0,u=a.length){let n="";for(let d=c;d<u;++d){let f=a[d];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,c){const u=a.length;if(!u)return 0;let n=0,d=0;if(this._interim){const f=a.charCodeAt(d++);56320<=f&&f<=57343?c[n++]=1024*(this._interim-55296)+f-56320+65536:(c[n++]=this._interim,c[n++]=f),this._interim=0}for(let f=d;f<u;++f){const p=a.charCodeAt(f);if(55296<=p&&p<=56319){if(++f>=u)return this._interim=p,n;const o=a.charCodeAt(f);56320<=o&&o<=57343?c[n++]=1024*(p-55296)+o-56320+65536:(c[n++]=p,c[n++]=o)}else p!==65279&&(c[n++]=p)}return n}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,c){const u=a.length;if(!u)return 0;let n,d,f,p,o=0,e=0,r=0;if(this.interim[0]){let h=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let l,g=0;for(;(l=63&this.interim[++g])&&g<4;)v<<=6,v|=l;const _=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=_-g;for(;r<m;){if(r>=u)return 0;if(l=a[r++],(192&l)!=128){r--,h=!0;break}this.interim[g++]=l,v<<=6,v|=63&l}h||(_===2?v<128?r--:c[o++]=v:_===3?v<2048||v>=55296&&v<=57343||v===65279||(c[o++]=v):v<65536||v>1114111||(c[o++]=v)),this.interim.fill(0)}const t=u-4;let i=r;for(;i<u;){for(;!(!(i<t)||128&(n=a[i])||128&(d=a[i+1])||128&(f=a[i+2])||128&(p=a[i+3]));)c[o++]=n,c[o++]=d,c[o++]=f,c[o++]=p,i+=4;if(n=a[i++],n<128)c[o++]=n;else if((224&n)==192){if(i>=u)return this.interim[0]=n,o;if(d=a[i++],(192&d)!=128){i--;continue}if(e=(31&n)<<6|63&d,e<128){i--;continue}c[o++]=e}else if((240&n)==224){if(i>=u)return this.interim[0]=n,o;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,o;if(f=a[i++],(192&f)!=128){i--;continue}if(e=(15&n)<<12|(63&d)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;c[o++]=e}else if((248&n)==240){if(i>=u)return this.interim[0]=n,o;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,o;if(f=a[i++],(192&f)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=f,o;if(p=a[i++],(192&p)!=128){i--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&f)<<6|63&p,e<65536||e>1114111)continue;c[o++]=e}}return o}}},776:function(B,s,a){var c=this&&this.__decorate||function(e,r,t,i){var h,v=arguments.length,l=v<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,t,i);else for(var g=e.length-1;g>=0;g--)(h=e[g])&&(l=(v<3?h(l):v>3?h(r,t,l):h(r,t))||l);return v>3&&l&&Object.defineProperty(r,t,l),l},u=this&&this.__param||function(e,r){return function(t,i){r(t,i,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const n=a(859),d=a(97),f={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let p,o=s.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),p=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let r=0;r<e.length;r++)typeof e[r]=="function"&&(e[r]=e[r]())}_log(e,r,t){this._evalLazyOptionalParams(t),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+r,...t)}trace(e,...r){var t;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.trace.bind(this._optionsService.options.logger))??console.log,e,r)}debug(e,...r){var t;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.debug.bind(this._optionsService.options.logger))??console.log,e,r)}info(e,...r){var t;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.info.bind(this._optionsService.options.logger))??console.info,e,r)}warn(e,...r){var t;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.warn.bind(this._optionsService.options.logger))??console.warn,e,r)}error(e,...r){var t;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.error.bind(this._optionsService.options.logger))??console.error,e,r)}};s.LogService=o=c([u(0,d.IOptionsService)],o),s.setTraceLogger=function(e){p=e},s.traceCall=function(e,r,t){if(typeof t.value!="function")throw new Error("not supported");const i=t.value;t.value=function(...h){if(p.logLevel!==d.LogLevelEnum.TRACE)return i.apply(this,h);p.trace(`GlyphRenderer#${i.name}(${h.map((l=>JSON.stringify(l))).join(", ")})`);const v=i.apply(this,h);return p.trace(`GlyphRenderer#${i.name} return`,v),v}}},726:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(u){return u[c]||[]},s.createDecorator=function(u){if(s.serviceRegistry.has(u))return s.serviceRegistry.get(u);const n=function(d,f,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,e,r){e[a]===e?e[c].push({id:o,index:r}):(e[c]=[{id:o,index:r}],e[a]=e)})(n,d,p)};return n.toString=()=>u,s.serviceRegistry.set(u,n),n}},97:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=a(726);var u;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(u||(s.LogLevelEnum=u={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},ne={};function re(B){var s=ne[B];if(s!==void 0)return s.exports;var a=ne[B]={exports:{}};return le[B].call(a.exports,a,a.exports,re),a.exports}var de={};return(()=>{var B=de;Object.defineProperty(B,"__esModule",{value:!0}),B.CanvasAddon=void 0;const s=re(345),a=re(859),c=re(776),u=re(949);class n extends a.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var f;return(f=this._renderer)==null?void 0:f.textureAtlas}activate(f){const p=f._core;if(!f.element)return void this.register(p.onWillOpen((()=>this.activate(f))));this._terminal=f;const o=p.coreService,e=p.optionsService,r=p.screenElement,t=p.linkifier,i=p,h=i._bufferService,v=i._renderService,l=i._characterJoinerService,g=i._charSizeService,_=i._coreBrowserService,m=i._decorationService,C=i._logService,b=i._themeService;(0,c.setTraceLogger)(C),this._renderer=new u.CanvasRenderer(f,r,t,h,g,e,l,o,_,m,b),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),v.setRenderer(this._renderer),v.handleResize(h.cols,h.rows),this.register((0,a.toDisposable)((()=>{var y;v.setRenderer(this._terminal._core._createRenderer()),v.handleResize(f.cols,f.rows),(y=this._renderer)==null||y.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var f;(f=this._renderer)==null||f.clearTextureAtlas()}}B.CanvasAddon=n})(),de})()))})(be)),be.exports}export{Ie as a,He as b,Pe as r};