@siteboon/claude-code-ui 1.8.12 → 1.9.0

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,66 @@
1
+ var Ce={exports:{}},Re;function Pe(){return Re||(Re=1,function(ue,me){(function(he,re){ue.exports=re()})(globalThis,()=>(()=>{var he={4567:function(O,t,a){var h=this&&this.__decorate||function(i,r,u,p){var _,m=arguments.length,c=m<3?r:p===null?p=Object.getOwnPropertyDescriptor(r,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(i,r,u,p);else for(var g=i.length-1;g>=0;g--)(_=i[g])&&(c=(m<3?_(c):m>3?_(r,u,c):_(r,u))||c);return m>3&&c&&Object.defineProperty(r,u,c),c},d=this&&this.__param||function(i,r){return function(u,p){r(u,p,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=a(9042),l=a(9924),f=a(844),v=a(4725),o=a(2585),e=a(3656);let s=t.AccessibilityManager=class extends f.Disposable{constructor(i,r,u,p){super(),this._terminal=i,this._coreBrowserService=u,this._renderService=p,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 _=0;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);if(this._topBoundaryFocusListener=_=>this._handleBoundaryFocus(_,0),this._bottomBoundaryFocusListener=_=>this._handleBoundaryFocus(_,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 l.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(_=>this._handleResize(_.rows))),this.register(this._terminal.onRender(_=>this._refreshRows(_.start,_.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(_=>this._handleChar(_))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
+ `))),this.register(this._terminal.onA11yTab(_=>this._handleTab(_))),this.register(this._terminal.onKey(_=>this._handleKey(_.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(i){for(let r=0;r<i;r++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
3
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,r){this._liveRegionDebouncer.refresh(i,r,this._terminal.rows)}_renderRows(i,r){const u=this._terminal.buffer,p=u.lines.length.toString();for(let _=i;_<=r;_++){const m=u.lines.get(u.ydisp+_),c=[],g=m?.translateToString(!0,void 0,void 0,c)||"",S=(u.ydisp+_+1).toString(),y=this._rowElements[_];y&&(g.length===0?(y.innerText=" ",this._rowColumns.set(y,[0,1])):(y.textContent=g,this._rowColumns.set(y,c)),y.setAttribute("aria-posinset",S),y.setAttribute("aria-setsize",p))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,r){const u=i.target,p=this._rowElements[r===0?1:this._rowElements.length-2];if(u.getAttribute("aria-posinset")===(r===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==p)return;let _,m;if(r===0?(_=u,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(_=this._rowElements.shift(),m=u,this._rowContainer.removeChild(_)),_.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),r===0){const c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{const c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(r===0?-1:1),this._rowElements[r===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const i=document.getSelection();if(!i)return;if(i.isCollapsed)return void(this._rowContainer.contains(i.anchorNode)&&this._terminal.clearSelection());if(!i.anchorNode||!i.focusNode)return void console.error("anchorNode and/or focusNode are null");let r={node:i.anchorNode,offset:i.anchorOffset},u={node:i.focusNode,offset:i.focusOffset};if((r.node.compareDocumentPosition(u.node)&Node.DOCUMENT_POSITION_PRECEDING||r.node===u.node&&r.offset>u.offset)&&([r,u]=[u,r]),r.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(r={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(r.node))return;const p=this._rowElements.slice(-1)[0];if(u.node.compareDocumentPosition(p)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(u={node:p,offset:p.textContent?.length??0}),!this._rowContainer.contains(u.node))return;const _=({node:g,offset:S})=>{const y=g instanceof Text?g.parentNode:g;let b=parseInt(y?.getAttribute("aria-posinset"),10)-1;if(isNaN(b))return console.warn("row is invalid. Race condition?"),null;const w=this._rowColumns.get(y);if(!w)return console.warn("columns is null. Race condition?"),null;let x=S<w.length?w[S]:w.slice(-1)[0]+1;return x>=this._terminal.cols&&(++b,x=0),{row:b,column:x}},m=_(r),c=_(u);if(m&&c){if(m.row>c.row||m.row===c.row&&m.column>=c.column)throw new Error("invalid range");this._terminal.select(m.column,m.row,(c.row-m.row)*this._terminal.cols-m.column+c.column)}}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let r=this._rowContainer.children.length;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=this._coreBrowserService.mainDocument.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_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 i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=s=h([d(1,o.IInstantiationService),d(2,v.ICoreBrowserService),d(3,v.IRenderService)],s)},3614:(O,t)=>{function a(l){return l.replace(/\r?\n/g,"\r")}function h(l,f){return f?"\x1B[200~"+l+"\x1B[201~":l}function d(l,f,v,o){l=h(l=a(l),v.decPrivateModes.bracketedPasteMode&&o.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(l,!0),f.value=""}function n(l,f,v){const o=v.getBoundingClientRect(),e=l.clientX-o.left-10,s=l.clientY-o.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=a,t.bracketTextForPaste=h,t.copyHandler=function(l,f){l.clipboardData&&l.clipboardData.setData("text/plain",f.selectionText),l.preventDefault()},t.handlePasteEvent=function(l,f,v,o){l.stopPropagation(),l.clipboardData&&d(l.clipboardData.getData("text/plain"),f,v,o)},t.paste=d,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(l,f,v,o,e){n(l,f,v),e&&o.rightClickSelect(l),f.value=o.selectionText,f.select()}},7239:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const h=a(1505);t.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(d,n,l){this._css.set(d,n,l)}getCss(d,n){return this._css.get(d,n)}setColor(d,n,l){this._color.set(d,n,l)}getColor(d,n){return this._color.get(d,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,h,d,n){a.addEventListener(h,d,n);let l=!1;return{dispose:()=>{l||(l=!0,a.removeEventListener(h,d,n))}}}},3551:function(O,t,a){var h=this&&this.__decorate||function(s,i,r,u){var p,_=arguments.length,m=_<3?i:u===null?u=Object.getOwnPropertyDescriptor(i,r):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,i,r,u);else for(var c=s.length-1;c>=0;c--)(p=s[c])&&(m=(_<3?p(m):_>3?p(i,r,m):p(i,r))||m);return _>3&&m&&Object.defineProperty(i,r,m),m},d=this&&this.__param||function(s,i){return function(r,u){i(r,u,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const n=a(3656),l=a(8460),f=a(844),v=a(2585),o=a(4725);let e=t.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(s,i,r,u,p){super(),this._element=s,this._mouseService=i,this._renderService=r,this._bufferService=u,this._linkProviderService=p,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new l.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new l.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.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(s){this._lastMouseEvent=s;const i=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const r=s.composedPath();for(let u=0;u<r.length;u++){const p=r[u];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,i){this._activeProviderReplies&&i||(this._activeProviderReplies?.forEach(u=>{u?.forEach(p=>{p.link.dispose&&p.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=s.y);let r=!1;for(const[u,p]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(u)&&(r=this._checkLinkProviderResult(u,s,r)):p.provideLinks(s.y,_=>{if(this._isMouseOut)return;const m=_?.map(c=>({link:c}));this._activeProviderReplies?.set(u,m),r=this._checkLinkProviderResult(u,s,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)})}_removeIntersectingLinks(s,i){const r=new Set;for(let u=0;u<i.size;u++){const p=i.get(u);if(p)for(let _=0;_<p.length;_++){const m=p[_],c=m.link.range.start.y<s?0:m.link.range.start.x,g=m.link.range.end.y>s?this._bufferService.cols:m.link.range.end.x;for(let S=c;S<=g;S++){if(r.has(S)){p.splice(_--,1);break}r.add(S)}}}}_checkLinkProviderResult(s,i,r){if(!this._activeProviderReplies)return r;const u=this._activeProviderReplies.get(s);let p=!1;for(let _=0;_<s;_++)this._activeProviderReplies.has(_)&&!this._activeProviderReplies.get(_)||(p=!0);if(!p&&u){const _=u.find(m=>this._linkAtPosition(m.link,i));_&&(r=!0,this._handleNewLink(_))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let _=0;_<this._activeProviderReplies.size;_++){const m=this._activeProviderReplies.get(_)?.find(c=>this._linkAtPosition(c.link,i));if(m){r=!0,this._handleNewLink(m);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const i=this._positionFromMouseEvent(s,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,i){this._currentLink&&this._lastMouseEvent&&(!s||!i||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(s.link,i)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;const u=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(u,p),this._lastMouseEvent)){const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._askForLink(_,!1)}})))}_linkHover(s,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(r,i.text)}_fireUnderlineEvent(s,i){const r=s.range,u=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-u-1,r.end.x,r.end.y-u-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(s,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(r,i.text)}_linkAtPosition(s,i){const r=s.range.start.y*this._bufferService.cols+s.range.start.x,u=s.range.end.y*this._bufferService.cols+s.range.end.x,p=i.y*this._bufferService.cols+i.x;return r<=p&&p<=u}_positionFromMouseEvent(s,i,r){const u=r.getCoords(s,i,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,i,r,u,p){return{x1:s,y1:i,x2:r,y2:u,cols:this._bufferService.cols,fg:p}}};t.Linkifier=e=h([d(1,o.IMouseService),d(2,o.IRenderService),d(3,v.IBufferService),d(4,o.ILinkProviderService)],e)},9042:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,t,a){var h=this&&this.__decorate||function(o,e,s,i){var r,u=arguments.length,p=u<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,e,s,i);else for(var _=o.length-1;_>=0;_--)(r=o[_])&&(p=(u<3?r(p):u>3?r(e,s,p):r(e,s))||p);return u>3&&p&&Object.defineProperty(e,s,p),p},d=this&&this.__param||function(o,e){return function(s,i){e(s,i,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=a(511),l=a(2585);let f=t.OscLinkProvider=class{constructor(o,e,s){this._bufferService=o,this._optionsService=e,this._oscLinkService=s}provideLinks(o,e){const s=this._bufferService.buffer.lines.get(o-1);if(!s)return void e(void 0);const i=[],r=this._optionsService.rawOptions.linkHandler,u=new n.CellData,p=s.getTrimmedLength();let _=-1,m=-1,c=!1;for(let g=0;g<p;g++)if(m!==-1||s.hasContent(g)){if(s.loadCell(g,u),u.hasExtendedAttrs()&&u.extended.urlId){if(m===-1){m=g,_=u.extended.urlId;continue}c=u.extended.urlId!==_}else m!==-1&&(c=!0);if(c||m!==-1&&g===p-1){const S=this._oscLinkService.getLinkData(_)?.uri;if(S){const y={start:{x:m+1,y:o},end:{x:g+(c||g!==p-1?0:1),y:o}};let b=!1;if(!r?.allowNonHttpProtocols)try{const w=new URL(S);["http:","https:"].includes(w.protocol)||(b=!0)}catch{b=!0}b||i.push({text:S,range:y,activate:(w,x)=>r?r.activate(w,x,y):v(0,x),hover:(w,x)=>r?.hover?.(w,x,y),leave:(w,x)=>r?.leave?.(w,x,y)})}c=!1,u.hasExtendedAttrs()&&u.extended.urlId?(m=g,_=u.extended.urlId):(m=-1,_=-1)}}e(i)}};function v(o,e){if(confirm(`Do you want to navigate to ${e}?
4
+
5
+ WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=f=h([d(0,l.IBufferService),d(1,l.IOptionsService),d(2,l.IOscLinkService)],f)},6193:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(a,h){this._renderCallback=a,this._coreBrowserService=h,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,h,d){this._rowCount=d,a=a!==void 0?a:0,h=h!==void 0?h: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,h):h,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),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const h=a(3614),d=a(3656),n=a(3551),l=a(9042),f=a(3730),v=a(1680),o=a(3107),e=a(5744),s=a(2950),i=a(1296),r=a(428),u=a(4269),p=a(5114),_=a(8934),m=a(3230),c=a(9312),g=a(4725),S=a(6731),y=a(8055),b=a(8969),w=a(8460),x=a(844),T=a(6114),P=a(8437),B=a(2584),k=a(7399),C=a(5941),L=a(9074),R=a(2585),D=a(5435),H=a(4567),W=a(779);class N extends b.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(M={}){super(M),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new x.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(L.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(W.LinkProviderService),this._instantiationService.setService(g.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((E,I)=>this.refresh(E,I))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(E=>this._reportWindowsOptions(E))),this.register(this._inputHandler.onColor(E=>this._handleColorEvent(E))),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(E=>this._afterResize(E.cols,E.rows))),this.register((0,x.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(M){if(this._themeService)for(const E of M){let I,A="";switch(E.index){case 256:I="foreground",A="10";break;case 257:I="background",A="11";break;case 258:I="cursor",A="12";break;default:I="ansi",A="4;"+E.index}switch(E.type){case 0:const F=y.color.toColorRGB(I==="ansi"?this._themeService.colors.ansi[E.index]:this._themeService.colors[I]);this.coreService.triggerDataEvent(`${B.C0.ESC}]${A};${(0,C.toRgbString)(F)}${B.C1_ESCAPED.ST}`);break;case 1:if(I==="ansi")this._themeService.modifyColors($=>$.ansi[E.index]=y.channels.toColor(...E.color));else{const $=I;this._themeService.modifyColors(G=>G[$]=y.channels.toColor(...E.color))}break;case 2:this._themeService.restoreColor(E.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(H.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(M){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(B.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(B.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,E=this.buffer.lines.get(M);if(!E)return;const I=Math.min(this.buffer.x,this.cols-1),A=this._renderService.dimensions.css.cell.height,F=E.getWidth(I),$=this._renderService.dimensions.css.cell.width*F,G=this.buffer.y*this._renderService.dimensions.css.cell.height,j=I*this._renderService.dimensions.css.cell.width;this.textarea.style.left=j+"px",this.textarea.style.top=G+"px",this.textarea.style.width=$+"px",this.textarea.style.height=A+"px",this.textarea.style.lineHeight=A+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",E=>{this.hasSelection()&&(0,h.copyHandler)(E,this._selectionService)}));const M=E=>(0,h.handlePasteEvent)(E,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",M)),this.register((0,d.addDisposableDomListener)(this.element,"paste",M)),T.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",E=>{E.button===2&&(0,h.rightClickHandler)(E,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",E=>{(0,h.rightClickHandler)(E,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),T.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",E=>{E.button===1&&(0,h.moveTextAreaUnderMouseCursor)(E,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",M=>this._keyUp(M),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",M=>this._keyDown(M),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",M=>this._keyPress(M),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",M=>this._compositionHelper.compositionupdate(M))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,d.addDisposableDomListener)(this.textarea,"input",M=>this._inputEvent(M),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(M){if(!M)throw new Error("Terminal requires a parent element.");if(M.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=M.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),M.appendChild(this.element);const E=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),E.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,d.addDisposableDomListener)(this.screenElement,"mousemove",I=>this.updateCursorStyle(I))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),E.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",l.promptLabel),T.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(p.CoreBrowserService,this.textarea,M.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(g.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",I=>this._handleTextAreaFocus(I))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(r.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(g.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(S.ThemeService),this._instantiationService.setService(g.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(u.CharacterJoinerService),this._instantiationService.setService(g.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(g.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(I=>this._onRender.fire(I))),this.onResize(I=>this._renderService.resize(I.cols,I.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(_.MouseService),this._instantiationService.setService(g.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(E);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(v.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(I=>this.scrollLines(I.amount,I.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(c.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(g.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(I=>this.scrollLines(I.amount,I.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(I=>this._renderService.handleSelectionChanged(I.start,I.end,I.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(I=>{this.textarea.value=I,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(I=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(o.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",I=>this._selectionService.handleMouseDown(I))),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(H.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",I=>this._handleScreenReaderModeOptionChange(I))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",I=>{!this._overviewRulerRenderer&&I&&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(i.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const M=this,E=this.element;function I($){const G=M._mouseService.getMouseReportCoords($,M.screenElement);if(!G)return!1;let j,K;switch($.overrideType||$.type){case"mousemove":K=32,$.buttons===void 0?(j=3,$.button!==void 0&&(j=$.button<3?$.button:3)):j=1&$.buttons?0:4&$.buttons?1:2&$.buttons?2:3;break;case"mouseup":K=0,j=$.button<3?$.button:3;break;case"mousedown":K=1,j=$.button<3?$.button:3;break;case"wheel":if(M._customWheelEventHandler&&M._customWheelEventHandler($)===!1||M.viewport.getLinesScrolled($)===0)return!1;K=$.deltaY<0?0:1,j=4;break;default:return!1}return!(K===void 0||j===void 0||j>4)&&M.coreMouseService.triggerMouseEvent({col:G.col,row:G.row,x:G.x,y:G.y,button:j,action:K,ctrl:$.ctrlKey,alt:$.altKey,shift:$.shiftKey})}const A={mouseup:null,wheel:null,mousedrag:null,mousemove:null},F={mouseup:$=>(I($),$.buttons||(this._document.removeEventListener("mouseup",A.mouseup),A.mousedrag&&this._document.removeEventListener("mousemove",A.mousedrag)),this.cancel($)),wheel:$=>(I($),this.cancel($,!0)),mousedrag:$=>{$.buttons&&I($)},mousemove:$=>{$.buttons||I($)}};this.register(this.coreMouseService.onProtocolChange($=>{$?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents($)),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&$?A.mousemove||(E.addEventListener("mousemove",F.mousemove),A.mousemove=F.mousemove):(E.removeEventListener("mousemove",A.mousemove),A.mousemove=null),16&$?A.wheel||(E.addEventListener("wheel",F.wheel,{passive:!1}),A.wheel=F.wheel):(E.removeEventListener("wheel",A.wheel),A.wheel=null),2&$?A.mouseup||(A.mouseup=F.mouseup):(this._document.removeEventListener("mouseup",A.mouseup),A.mouseup=null),4&$?A.mousedrag||(A.mousedrag=F.mousedrag):(this._document.removeEventListener("mousemove",A.mousedrag),A.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(E,"mousedown",$=>{if($.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection($))return I($),A.mouseup&&this._document.addEventListener("mouseup",A.mouseup),A.mousedrag&&this._document.addEventListener("mousemove",A.mousedrag),this.cancel($)})),this.register((0,d.addDisposableDomListener)(E,"wheel",$=>{if(!A.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler($)===!1)return!1;if(!this.buffer.hasScrollback){const G=this.viewport.getLinesScrolled($);if(G===0)return;const j=B.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+($.deltaY<0?"A":"B");let K="";for(let ie=0;ie<Math.abs(G);ie++)K+=j;return this.coreService.triggerDataEvent(K,!0),this.cancel($,!0)}return this.viewport.handleWheel($)?this.cancel($):void 0}},{passive:!1})),this.register((0,d.addDisposableDomListener)(E,"touchstart",$=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart($),this.cancel($)},{passive:!0})),this.register((0,d.addDisposableDomListener)(E,"touchmove",$=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove($)?void 0:this.cancel($)},{passive:!1}))}refresh(M,E){this._renderService?.refreshRows(M,E)}updateCursorStyle(M){this._selectionService?.shouldColumnSelect(M)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(M,E,I=0){I===1?(super.scrollLines(M,E,I),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(M)}paste(M){(0,h.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 E=this._characterJoinerService.register(M);return this.refresh(0,this.rows-1),E}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,E,I){this._selectionService.setSelection(M,E,I)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(M,E){this._selectionService?.selectLines(M,E)}_keyDown(M){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;const E=this.browser.isMac&&this.options.macOptionIsMeta&&M.altKey;if(!E&&!this._compositionHelper.keydown(M))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;E||M.key!=="Dead"&&M.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const I=(0,k.evaluateKeyboardEvent)(M,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(M),I.type===3||I.type===2){const A=this.rows-1;return this.scrollLines(I.type===2?-A:A),this.cancel(M,!0)}return I.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,M)||(I.cancel&&this.cancel(M,!0),!I.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):(I.key!==B.C0.ETX&&I.key!==B.C0.CR||(this.textarea.value=""),this._onKey.fire({key:I.key,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(I.key,!0),!this.optionsService.rawOptions.screenReaderMode||M.altKey||M.ctrlKey?this.cancel(M,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(M,E){const I=M.isMac&&!this.options.macOptionIsMeta&&E.altKey&&!E.ctrlKey&&!E.metaKey||M.isWindows&&E.altKey&&E.ctrlKey&&!E.metaKey||M.isWindows&&E.getModifierState("AltGraph");return E.type==="keypress"?I:I&&(!E.keyCode||E.keyCode>47)}_keyUp(M){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1||(function(E){return E.keyCode===16||E.keyCode===17||E.keyCode===18}(M)||this.focus(),this.updateCursorStyle(M),this._keyPressHandled=!1)}_keyPress(M){let E;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(M)===!1)return!1;if(this.cancel(M),M.charCode)E=M.charCode;else if(M.which===null||M.which===void 0)E=M.keyCode;else{if(M.which===0||M.charCode===0)return!1;E=M.which}return!(!E||(M.altKey||M.ctrlKey||M.metaKey)&&!this._isThirdLevelShift(this.browser,M)||(E=String.fromCharCode(E),this._onKey.fire({key:E,domEvent:M}),this._showCursor(),this.coreService.triggerDataEvent(E,!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 E=M.data;return this.coreService.triggerDataEvent(E,!0),this.cancel(M),!0}return!1}resize(M,E){M!==this.cols||E!==this.rows?super.resize(M,E):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(M,E){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let M=1;M<this.rows;M++)this.buffer.lines.push(this.buffer.getBlankLine(P.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const M=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=M,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(B.C0.ESC+"[I"):this.coreService.triggerDataEvent(B.C0.ESC+"[O")}_reportWindowsOptions(M){if(this._renderService)switch(M){case D.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const E=this._renderService.dimensions.css.canvas.width.toFixed(0),I=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${B.C0.ESC}[4;${I};${E}t`);break;case D.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const A=this._renderService.dimensions.css.cell.width.toFixed(0),F=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${B.C0.ESC}[6;${F};${A}t`)}}cancel(M,E){if(this.options.cancelEvents||E)return M.preventDefault(),M.stopPropagation(),!1}}t.Terminal=N},9924:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(a,h=1e3){this._renderCallback=a,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,h,d){this._rowCount=d,a=a!==void 0?a:0,h=h!==void 0?h: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,h):h;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const l=n-this._lastRefreshMs,f=this._debounceThresholdMS-l;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),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h)}}},1680:function(O,t,a){var h=this&&this.__decorate||function(s,i,r,u){var p,_=arguments.length,m=_<3?i:u===null?u=Object.getOwnPropertyDescriptor(i,r):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,i,r,u);else for(var c=s.length-1;c>=0;c--)(p=s[c])&&(m=(_<3?p(m):_>3?p(i,r,m):p(i,r))||m);return _>3&&m&&Object.defineProperty(i,r,m),m},d=this&&this.__param||function(s,i){return function(r,u){i(r,u,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=a(3656),l=a(4725),f=a(8460),v=a(844),o=a(2585);let e=t.Viewport=class extends v.Disposable{constructor(s,i,r,u,p,_,m,c){super(),this._viewportElement=s,this._scrollArea=i,this._bufferService=r,this._optionsService=u,this._charSizeService=p,this._renderService=_,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new 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(g=>this._activeBuffer=g.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(g=>this._renderDimensions=g)),this._handleThemeChange(c.colors),this.register(c.onChangeColors(g=>this._handleThemeChange(g))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(s){if(s)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const i=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==i&&(this._lastRecordedBufferHeight=i,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(s,i){const r=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&r<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){const i=this._getPixelsScrolled(s);return i!==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+i:this._smoothScrollState.target+=i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=i,this._bubbleScroll(s,i))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const i=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let i=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i}getBufferElements(s,i){let r,u="";const p=[],_=i??this._bufferService.buffer.lines.length,m=this._bufferService.buffer.lines;for(let c=s;c<_;c++){const g=m.get(c);if(!g)continue;const S=m.get(c+1)?.isWrapped;if(u+=g.translateToString(!S),!S||c===m.length-1){const y=document.createElement("div");y.textContent=u,p.push(y),u.length>0&&(r=y),u=""}}return{bufferElements:p,cursorElement:r}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let i=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(s,i){const r=this._optionsService.rawOptions.fastScrollModifier;return r==="alt"&&i.altKey||r==="ctrl"&&i.ctrlKey||r==="shift"&&i.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const i=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(s,i))}};t.Viewport=e=h([d(2,o.IBufferService),d(3,o.IOptionsService),d(4,l.ICharSizeService),d(5,l.IRenderService),d(6,l.ICoreBrowserService),d(7,l.IThemeService)],e)},3107:function(O,t,a){var h=this&&this.__decorate||function(o,e,s,i){var r,u=arguments.length,p=u<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,e,s,i);else for(var _=o.length-1;_>=0;_--)(r=o[_])&&(p=(u<3?r(p):u>3?r(e,s,p):r(e,s))||p);return u>3&&p&&Object.defineProperty(e,s,p),p},d=this&&this.__param||function(o,e){return function(s,i){e(s,i,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=a(4725),l=a(844),f=a(2585);let v=t.BufferDecorationRenderer=class extends l.Disposable{constructor(o,e,s,i,r){super(),this._screenElement=o,this._bufferService=e,this._coreBrowserService=s,this._decorationService=i,this._renderService=r,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(u=>this._removeDecoration(u))),this.register((0,l.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){const e=this._coreBrowserService.mainDocument.createElement("div");e.classList.add("xterm-decoration"),e.classList.toggle("xterm-decoration-top-layer",o?.options?.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 s=o.options.x??0;return s&&s>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 s=this._decorationElements.get(o);s||(s=this._createElement(o),o.element=s,this._decorationElements.set(o,s),this._container.appendChild(s),o.onDispose(()=>{this._decorationElements.delete(o),s.remove()})),s.style.top=e*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",o.onRenderEmitter.fire(s)}}_refreshXPosition(o,e=o.element){if(!e)return;const s=o.options.x??0;(o.options.anchor||"left")==="right"?e.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":e.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(o){this._decorationElements.get(o)?.remove(),this._decorationElements.delete(o),o.dispose()}};t.BufferDecorationRenderer=v=h([d(1,f.IBufferService),d(2,n.ICoreBrowserService),d(3,f.IDecorationService),d(4,n.IRenderService)],v)},5871:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.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 h of this._zones)if(h.color===a.options.overviewRulerOptions.color&&h.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,a.marker.line))return;if(this._lineAdjacentToZone(h,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(h,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,h){return h>=a.startBufferLine&&h<=a.endBufferLine}_lineAdjacentToZone(a,h,d){return h>=a.startBufferLine-this._linePadding[d||"full"]&&h<=a.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(a,h){a.startBufferLine=Math.min(a.startBufferLine,h),a.endBufferLine=Math.max(a.endBufferLine,h)}}},5744:function(O,t,a){var h=this&&this.__decorate||function(r,u,p,_){var m,c=arguments.length,g=c<3?u:_===null?_=Object.getOwnPropertyDescriptor(u,p):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,u,p,_);else for(var S=r.length-1;S>=0;S--)(m=r[S])&&(g=(c<3?m(g):c>3?m(u,p,g):m(u,p))||g);return c>3&&g&&Object.defineProperty(u,p,g),g},d=this&&this.__param||function(r,u){return function(p,_){u(p,_,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=a(5871),l=a(4725),f=a(844),v=a(2585),o={full:0,left:0,center:0,right:0},e={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let i=t.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(r,u,p,_,m,c,g){super(),this._viewportElement=r,this._screenElement=u,this._bufferService=p,this._decorationService=_,this._renderService=m,this._optionsService=c,this._coreBrowserService=g,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const S=this._canvas.getContext("2d");if(!S)throw new Error("Ctx cannot be null");this._ctx=S,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)(()=>{this._canvas?.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const r=Math.floor(this._canvas.width/3),u=Math.ceil(this._canvas.width/3);e.full=this._canvas.width,e.left=r,e.center=u,e.right=r,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=e.left,s.right=e.left+e.center}_refreshDrawHeightConstants(){o.full=Math.round(2*this._coreBrowserService.dpr);const r=this._canvas.height/this._bufferService.buffer.lines.length,u=Math.round(Math.max(Math.min(r,12),6)*this._coreBrowserService.dpr);o.left=u,o.center=u,o.right=u}_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 u of this._decorationService.decorations)this._colorZoneStore.addDecoration(u);this._ctx.lineWidth=1;const r=this._colorZoneStore.zones;for(const u of r)u.position!=="full"&&this._renderColorZone(u);for(const u of r)u.position==="full"&&this._renderColorZone(u);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(r){this._ctx.fillStyle=r.color,this._ctx.fillRect(s[r.position||"full"],Math.round((this._canvas.height-1)*(r.startBufferLine/this._bufferService.buffers.active.lines.length)-o[r.position||"full"]/2),e[r.position||"full"],Math.round((this._canvas.height-1)*((r.endBufferLine-r.startBufferLine)/this._bufferService.buffers.active.lines.length)+o[r.position||"full"]))}_queueRefresh(r,u){this._shouldUpdateDimensions=r||this._shouldUpdateDimensions,this._shouldUpdateAnchor=u||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};t.OverviewRulerRenderer=i=h([d(2,v.IBufferService),d(3,v.IDecorationService),d(4,l.IRenderService),d(5,v.IOptionsService),d(6,l.ICoreBrowserService)],i)},2950:function(O,t,a){var h=this&&this.__decorate||function(o,e,s,i){var r,u=arguments.length,p=u<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,e,s,i);else for(var _=o.length-1;_>=0;_--)(r=o[_])&&(p=(u<3?r(p):u>3?r(e,s,p):r(e,s))||p);return u>3&&p&&Object.defineProperty(e,s,p),p},d=this&&this.__param||function(o,e){return function(s,i){e(s,i,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=a(4725),l=a(2585),f=a(2584);let v=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(o,e,s,i,r,u){this._textarea=o,this._compositionView=e,this._bufferService=s,this._optionsService=i,this._coreService=r,this._renderService=u,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 s;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),s.length>0&&this._coreService.triggerDataEvent(s,!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,s=e.replace(o,"");this._dataAlreadySent=s,e.length>o.length?this._coreService.triggerDataEvent(s,!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),s=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const u=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(u.width,1)+"px",this._textarea.style.height=Math.max(u.height,1)+"px",this._textarea.style.lineHeight=u.height+"px"}o||setTimeout(()=>this.updateCompositionElements(!0),0)}}};t.CompositionHelper=v=h([d(2,l.IBufferService),d(3,l.IOptionsService),d(4,l.ICoreService),d(5,n.IRenderService)],v)},9806:(O,t)=>{function a(h,d,n){const l=n.getBoundingClientRect(),f=h.getComputedStyle(n),v=parseInt(f.getPropertyValue("padding-left")),o=parseInt(f.getPropertyValue("padding-top"));return[d.clientX-l.left-v,d.clientY-l.top-o]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=a,t.getCoords=function(h,d,n,l,f,v,o,e,s){if(!v)return;const i=a(h,d,n);return i?(i[0]=Math.ceil((i[0]+(s?o/2:0))/o),i[1]=Math.ceil(i[1]/e),i[0]=Math.min(Math.max(i[0],1),l+(s?1:0)),i[1]=Math.min(Math.max(i[1],1),f),i):void 0}},9504:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const h=a(2584);function d(e,s,i,r){const u=e-n(e,i),p=s-n(s,i),_=Math.abs(u-p)-function(m,c,g){let S=0;const y=m-n(m,g),b=c-n(c,g);for(let w=0;w<Math.abs(y-b);w++){const x=l(m,c)==="A"?-1:1;g.buffer.lines.get(y+x*w)?.isWrapped&&S++}return S}(e,s,i);return o(_,v(l(e,s),r))}function n(e,s){let i=0,r=s.buffer.lines.get(e),u=r?.isWrapped;for(;u&&e>=0&&e<s.rows;)i++,r=s.buffer.lines.get(--e),u=r?.isWrapped;return i}function l(e,s){return e>s?"A":"B"}function f(e,s,i,r,u,p){let _=e,m=s,c="";for(;_!==i||m!==r;)_+=u?1:-1,u&&_>p.cols-1?(c+=p.buffer.translateBufferLineToString(m,!1,e,_),_=0,e=0,m++):!u&&_<0&&(c+=p.buffer.translateBufferLineToString(m,!1,0,e+1),_=p.cols-1,e=_,m--);return c+p.buffer.translateBufferLineToString(m,!1,e,_)}function v(e,s){const i=s?"O":"[";return h.C0.ESC+i+e}function o(e,s){e=Math.floor(e);let i="";for(let r=0;r<e;r++)i+=s;return i}t.moveToCellSequence=function(e,s,i,r){const u=i.buffer.x,p=i.buffer.y;if(!i.buffer.hasScrollback)return function(c,g,S,y,b,w){return d(g,y,b,w).length===0?"":o(f(c,g,c,g-n(g,b),!1,b).length,v("D",w))}(u,p,0,s,i,r)+d(p,s,i,r)+function(c,g,S,y,b,w){let x;x=d(g,y,b,w).length>0?y-n(y,b):g;const T=y,P=function(B,k,C,L,R,D){let H;return H=d(C,L,R,D).length>0?L-n(L,R):k,B<C&&H<=L||B>=C&&H<L?"C":"D"}(c,g,S,y,b,w);return o(f(c,x,S,T,P==="C",b).length,v(P,w))}(u,p,e,s,i,r);let _;if(p===s)return _=u>e?"D":"C",o(Math.abs(u-e),v(_,r));_=p>s?"D":"C";const m=Math.abs(p-s);return o(function(c,g){return g.cols-c}(p>s?e:u,i)+(m-1)*i.cols+1+((p>s?u:e)-1),v(_,r))}},1296:function(O,t,a){var h=this&&this.__decorate||function(w,x,T,P){var B,k=arguments.length,C=k<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,T):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(w,x,T,P);else for(var L=w.length-1;L>=0;L--)(B=w[L])&&(C=(k<3?B(C):k>3?B(x,T,C):B(x,T))||C);return k>3&&C&&Object.defineProperty(x,T,C),C},d=this&&this.__param||function(w,x){return function(T,P){x(T,P,w)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=a(3787),l=a(2550),f=a(2223),v=a(6171),o=a(6052),e=a(4725),s=a(8055),i=a(8460),r=a(844),u=a(2585),p="xterm-dom-renderer-owner-",_="xterm-rows",m="xterm-fg-",c="xterm-bg-",g="xterm-focus",S="xterm-selection";let y=1,b=t.DomRenderer=class extends r.Disposable{constructor(w,x,T,P,B,k,C,L,R,D,H,W,N){super(),this._terminal=w,this._document=x,this._element=T,this._screenElement=P,this._viewportElement=B,this._helperContainer=k,this._linkifier2=C,this._charSizeService=R,this._optionsService=D,this._bufferService=H,this._coreBrowserService=W,this._themeService=N,this._terminalClass=y++,this._rowElements=[],this._selectionRenderModel=(0,o.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(_),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(S),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,v.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(U=>this._injectCss(U))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(U=>this._handleLinkHover(U))),this.register(this._linkifier2.onHideLinkUnderline(U=>this._handleLinkLeave(U))),this.register((0,r.toDisposable)(()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new l.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 T of this._rowElements)T.style.width=`${this.dimensions.css.canvas.width}px`,T.style.height=`${this.dimensions.css.cell.height}px`,T.style.lineHeight=`${this.dimensions.css.cell.height}px`,T.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const x=`${this._terminalSelector} .${_} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=x,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 x=`${this._terminalSelector} .${_} { color: ${w.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;x+=`${this._terminalSelector} .${_} .xterm-dim { color: ${s.color.multiplyOpacity(w.foreground,.5).css};}`,x+=`${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 T=`blink_underline_${this._terminalClass}`,P=`blink_bar_${this._terminalClass}`,B=`blink_block_${this._terminalClass}`;x+=`@keyframes ${T} { 50% { border-bottom-style: hidden; }}`,x+=`@keyframes ${P} { 50% { box-shadow: none; }}`,x+=`@keyframes ${B} { 0% { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css}; } 50% { background-color: inherit; color: ${w.cursor.css}; }}`,x+=`${this._terminalSelector} .${_}.${g} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${T} 1s step-end infinite;}${this._terminalSelector} .${_}.${g} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${_}.${g} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-block { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css};}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${w.cursor.css} !important; color: ${w.cursorAccent.css} !important;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${w.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${w.cursor.css} inset;}${this._terminalSelector} .${_} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${w.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,x+=`${this._terminalSelector} .${S} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${S} div { position: absolute; background-color: ${w.selectionBackgroundOpaque.css};}${this._terminalSelector} .${S} div { position: absolute; background-color: ${w.selectionInactiveBackgroundOpaque.css};}`;for(const[k,C]of w.ansi.entries())x+=`${this._terminalSelector} .${m}${k} { color: ${C.css}; }${this._terminalSelector} .${m}${k}.xterm-dim { color: ${s.color.multiplyOpacity(C,.5).css}; }${this._terminalSelector} .${c}${k} { background-color: ${C.css}; }`;x+=`${this._terminalSelector} .${m}${f.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(w.background).css}; }${this._terminalSelector} .${m}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(w.background),.5).css}; }${this._terminalSelector} .${c}${f.INVERTED_DEFAULT_COLOR} { background-color: ${w.foreground.css}; }`,this._themeStyleElement.textContent=x}_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,x){for(let T=this._rowElements.length;T<=x;T++){const P=this._document.createElement("div");this._rowContainer.appendChild(P),this._rowElements.push(P)}for(;this._rowElements.length>x;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(w,x){this._refreshRowElements(w,x),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(g),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(g),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(w,x,T){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(w,x,T),this.renderRows(0,this._bufferService.rows-1),!w||!x)return;this._selectionRenderModel.update(this._terminal,w,x,T);const P=this._selectionRenderModel.viewportStartRow,B=this._selectionRenderModel.viewportEndRow,k=this._selectionRenderModel.viewportCappedStartRow,C=this._selectionRenderModel.viewportCappedEndRow;if(k>=this._bufferService.rows||C<0)return;const L=this._document.createDocumentFragment();if(T){const R=w[0]>x[0];L.appendChild(this._createSelectionElement(k,R?x[0]:w[0],R?w[0]:x[0],C-k+1))}else{const R=P===k?w[0]:0,D=k===B?x[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(k,R,D));const H=C-k-1;if(L.appendChild(this._createSelectionElement(k+1,0,this._bufferService.cols,H)),k!==C){const W=B===C?x[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(C,0,W))}}this._selectionContainer.appendChild(L)}_createSelectionElement(w,x,T,P=1){const B=this._document.createElement("div"),k=x*this.dimensions.css.cell.width;let C=this.dimensions.css.cell.width*(T-x);return k+C>this.dimensions.css.canvas.width&&(C=this.dimensions.css.canvas.width-k),B.style.height=P*this.dimensions.css.cell.height+"px",B.style.top=w*this.dimensions.css.cell.height+"px",B.style.left=`${k}px`,B.style.width=`${C}px`,B}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,x){const T=this._bufferService.buffer,P=T.ybase+T.y,B=Math.min(T.x,this._bufferService.cols-1),k=this._optionsService.rawOptions.cursorBlink,C=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=w;R<=x;R++){const D=R+T.ydisp,H=this._rowElements[R],W=T.lines.get(D);if(!H||!W)break;H.replaceChildren(...this._rowFactory.createRow(W,D,D===P,C,L,B,k,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${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,x,T,P,B,k){T<0&&(w=0),P<0&&(x=0);const C=this._bufferService.rows-1;T=Math.max(Math.min(T,C),0),P=Math.max(Math.min(P,C),0),B=Math.min(B,this._bufferService.cols);const L=this._bufferService.buffer,R=L.ybase+L.y,D=Math.min(L.x,B-1),H=this._optionsService.rawOptions.cursorBlink,W=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let U=T;U<=P;++U){const M=U+L.ydisp,E=this._rowElements[U],I=L.lines.get(M);if(!E||!I)break;E.replaceChildren(...this._rowFactory.createRow(I,M,M===R,W,N,D,H,this.dimensions.css.cell.width,this._widthCache,k?U===T?w:0:-1,k?(U===P?x:B)-1:-1))}}};t.DomRenderer=b=h([d(7,u.IInstantiationService),d(8,e.ICharSizeService),d(9,u.IOptionsService),d(10,u.IBufferService),d(11,e.ICoreBrowserService),d(12,e.IThemeService)],b)},3787:function(O,t,a){var h=this&&this.__decorate||function(_,m,c,g){var S,y=arguments.length,b=y<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,c):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(_,m,c,g);else for(var w=_.length-1;w>=0;w--)(S=_[w])&&(b=(y<3?S(b):y>3?S(m,c,b):S(m,c))||b);return y>3&&b&&Object.defineProperty(m,c,b),b},d=this&&this.__param||function(_,m){return function(c,g){m(c,g,_)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const n=a(2223),l=a(643),f=a(511),v=a(2585),o=a(8055),e=a(4725),s=a(4269),i=a(6171),r=a(3734);let u=t.DomRendererRowFactory=class{constructor(_,m,c,g,S,y,b){this._document=_,this._characterJoinerService=m,this._optionsService=c,this._coreBrowserService=g,this._coreService=S,this._decorationService=y,this._themeService=b,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(_,m,c){this._selectionStart=_,this._selectionEnd=m,this._columnSelectMode=c}createRow(_,m,c,g,S,y,b,w,x,T,P){const B=[],k=this._characterJoinerService.getJoinedCharacters(m),C=this._themeService.colors;let L,R=_.getNoBgTrimmedLength();c&&R<y+1&&(R=y+1);let D=0,H="",W=0,N=0,U=0,M=!1,E=0,I=!1,A=0;const F=[],$=T!==-1&&P!==-1;for(let G=0;G<R;G++){_.loadCell(G,this._workCell);let j=this._workCell.getWidth();if(j===0)continue;let K=!1,ie=G,q=this._workCell;if(k.length>0&&G===k[0][0]){K=!0;const V=k.shift();q=new s.JoinedCellData(this._workCell,_.translateToString(!0,V[0],V[1]),V[1]-V[0]),ie=V[1]-1,j=q.getWidth()}const ce=this._isCellInSelection(G,m),_e=c&&G===y,Q=$&&G>=T&&G<=P;let X=!1;this._decorationService.forEachDecorationAtCell(G,m,void 0,V=>{X=!0});let Y=q.getChars()||l.WHITESPACE_CELL_CHAR;if(Y===" "&&(q.isUnderline()||q.isOverline())&&(Y=" "),A=j*w-x.get(Y,q.isBold(),q.isItalic()),L){if(D&&(ce&&I||!ce&&!I&&q.bg===W)&&(ce&&I&&C.selectionForeground||q.fg===N)&&q.extended.ext===U&&Q===M&&A===E&&!_e&&!K&&!X){q.isInvisible()?H+=l.WHITESPACE_CELL_CHAR:H+=Y,D++;continue}D&&(L.textContent=H),L=this._document.createElement("span"),D=0,H=""}else L=this._document.createElement("span");if(W=q.bg,N=q.fg,U=q.extended.ext,M=Q,E=A,I=ce,K&&y>=G&&y<=ie&&(y=G),!this._coreService.isCursorHidden&&_e&&this._coreService.isCursorInitialized){if(F.push("xterm-cursor"),this._coreBrowserService.isFocused)b&&F.push("xterm-cursor-blink"),F.push(g==="bar"?"xterm-cursor-bar":g==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(S)switch(S){case"outline":F.push("xterm-cursor-outline");break;case"block":F.push("xterm-cursor-block");break;case"bar":F.push("xterm-cursor-bar");break;case"underline":F.push("xterm-cursor-underline")}}if(q.isBold()&&F.push("xterm-bold"),q.isItalic()&&F.push("xterm-italic"),q.isDim()&&F.push("xterm-dim"),H=q.isInvisible()?l.WHITESPACE_CELL_CHAR:q.getChars()||l.WHITESPACE_CELL_CHAR,q.isUnderline()&&(F.push(`xterm-underline-${q.extended.underlineStyle}`),H===" "&&(H=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${r.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let V=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&V<8&&(V+=8),L.style.textDecorationColor=C.ansi[V].css}q.isOverline()&&(F.push("xterm-overline"),H===" "&&(H=" ")),q.isStrikethrough()&&F.push("xterm-strikethrough"),Q&&(L.style.textDecoration="underline");let z=q.getFgColor(),J=q.getFgColorMode(),se=q.getBgColor(),te=q.getBgColorMode();const de=!!q.isInverse();if(de){const V=z;z=se,se=V;const fe=J;J=te,te=fe}let ae,le,ne,ee=!1;switch(this._decorationService.forEachDecorationAtCell(G,m,void 0,V=>{V.options.layer!=="top"&&ee||(V.backgroundColorRGB&&(te=50331648,se=V.backgroundColorRGB.rgba>>8&16777215,ae=V.backgroundColorRGB),V.foregroundColorRGB&&(J=50331648,z=V.foregroundColorRGB.rgba>>8&16777215,le=V.foregroundColorRGB),ee=V.options.layer==="top")}),!ee&&ce&&(ae=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,se=ae.rgba>>8&16777215,te=50331648,ee=!0,C.selectionForeground&&(J=50331648,z=C.selectionForeground.rgba>>8&16777215,le=C.selectionForeground)),ee&&F.push("xterm-decoration-top"),te){case 16777216:case 33554432:ne=C.ansi[se],F.push(`xterm-bg-${se}`);break;case 50331648:ne=o.channels.toColor(se>>16,se>>8&255,255&se),this._addStyle(L,`background-color:#${p((se>>>0).toString(16),"0",6)}`);break;default:de?(ne=C.foreground,F.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):ne=C.background}switch(ae||q.isDim()&&(ae=o.color.multiplyOpacity(ne,.5)),J){case 16777216:case 33554432:q.isBold()&&z<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(z+=8),this._applyMinimumContrast(L,ne,C.ansi[z],q,ae,void 0)||F.push(`xterm-fg-${z}`);break;case 50331648:const V=o.channels.toColor(z>>16&255,z>>8&255,255&z);this._applyMinimumContrast(L,ne,V,q,ae,le)||this._addStyle(L,`color:#${p(z.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,ne,C.foreground,q,ae,le)||de&&F.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}F.length&&(L.className=F.join(" "),F.length=0),_e||K||X?L.textContent=H:D++,A!==this.defaultSpacing&&(L.style.letterSpacing=`${A}px`),B.push(L),G=ie}return L&&D&&(L.textContent=H),B}_applyMinimumContrast(_,m,c,g,S,y){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.treatGlyphAsBackgroundColor)(g.getCode()))return!1;const b=this._getContrastCache(g);let w;if(S||y||(w=b.getColor(m.rgba,c.rgba)),w===void 0){const x=this._optionsService.rawOptions.minimumContrastRatio/(g.isDim()?2:1);w=o.color.ensureContrastRatio(S||m,y||c,x),b.setColor((S||m).rgba,(y||c).rgba,w??null)}return!!w&&(this._addStyle(_,`color:${w.css}`),!0)}_getContrastCache(_){return _.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(_,m){_.setAttribute("style",`${_.getAttribute("style")||""}${m};`)}_isCellInSelection(_,m){const c=this._selectionStart,g=this._selectionEnd;return!(!c||!g)&&(this._columnSelectMode?c[0]<=g[0]?_>=c[0]&&m>=c[1]&&_<g[0]&&m<=g[1]:_<c[0]&&m>=c[1]&&_>=g[0]&&m<=g[1]:m>c[1]&&m<g[1]||c[1]===g[1]&&m===c[1]&&_>=c[0]&&_<g[0]||c[1]<g[1]&&m===g[1]&&_<g[0]||c[1]<g[1]&&m===c[1]&&_>=c[0])}};function p(_,m,c){for(;_.length<c;)_=m+_;return _}t.DomRendererRowFactory=u=h([d(1,e.ICharacterJoinerService),d(2,v.IOptionsService),d(3,e.ICoreBrowserService),d(4,v.ICoreService),d(5,v.IDecorationService),d(6,e.IThemeService)],u)},2550:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(a,h){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 d=a.createElement("span");d.classList.add("xterm-char-measure-element");const n=a.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const l=a.createElement("span");l.classList.add("xterm-char-measure-element"),l.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=[d,n,l,f],this._container.appendChild(d),this._container.appendChild(n),this._container.appendChild(l),this._container.appendChild(f),h.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,h,d,n){a===this._font&&h===this._fontSize&&d===this._weight&&n===this._weightBold||(this._font=a,this._fontSize=h,this._weight=d,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(a,h,d){let n=0;if(!h&&!d&&a.length===1&&(n=a.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const v=this._measure(a,0);return v>0&&(this._flat[n]=v),v}let l=a;h&&(l+="B"),d&&(l+="I");let f=this._holey.get(l);if(f===void 0){let v=0;h&&(v|=1),d&&(v|=2),f=this._measure(a,v),f>0&&this._holey.set(l,f)}return f}_measure(a,h){const d=this._measureElements[h];return d.textContent=a.repeat(32),d.offsetWidth/32}}},2223:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const h=a(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(O,t)=>{function a(d){return 57508<=d&&d<=57558}function h(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},t.isEmoji=h,t.allowRescaling=function(d,n,l,f){return n===1&&l>Math.ceil(1.5*f)&&d!==void 0&&d>255&&!h(d)&&!a(d)&&!function(v){return 57344<=v&&v<=63743}(d)},t.treatGlyphAsBackgroundColor=function(d){return a(d)||function(n){return 9472<=n&&n<=9631}(d)},t.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}}}},t.computeNextVariantOffset=function(d,n,l=0){return(d-(2*Math.round(n)-l))%(2*Math.round(n))}},6052:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.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(d,n,l,f=!1){if(this.selectionStart=n,this.selectionEnd=l,!n||!l||n[0]===l[0]&&n[1]===l[1])return void this.clear();const v=d.buffers.active.ydisp,o=n[1]-v,e=l[1]-v,s=Math.max(o,0),i=Math.min(e,d.rows-1);s>=d.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=o,this.viewportEndRow=e,this.viewportCappedStartRow=s,this.viewportCappedEndRow=i,this.startCol=n[0],this.endCol=l[0])}isCellSelected(d,n,l){return!!this.hasSelection&&(l-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&l>=this.viewportCappedStartRow&&n<this.endCol&&l<=this.viewportCappedEndRow:n<this.startCol&&l>=this.viewportCappedStartRow&&n>=this.endCol&&l<=this.viewportCappedEndRow:l>this.viewportStartRow&&l<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&l===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},456:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.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,h=this.selectionEnd;return!(!a||!h)&&(a[1]>h[1]||a[1]===h[1]&&a[0]>h[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(O,t,a){var h=this&&this.__decorate||function(i,r,u,p){var _,m=arguments.length,c=m<3?r:p===null?p=Object.getOwnPropertyDescriptor(r,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(i,r,u,p);else for(var g=i.length-1;g>=0;g--)(_=i[g])&&(c=(m<3?_(c):m>3?_(r,u,c):_(r,u))||c);return m>3&&c&&Object.defineProperty(r,u,c),c},d=this&&this.__param||function(i,r){return function(u,p){r(u,p,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=a(2585),l=a(8460),f=a(844);let v=t.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(i,r,u){super(),this._optionsService=u,this.width=0,this.height=0,this._onCharSizeChange=this.register(new l.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new e(i,r,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};t.CharSizeService=v=h([d(2,n.IOptionsService)],v);class o extends f.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(r,u){r!==void 0&&r>0&&u!==void 0&&u>0&&(this._result.width=r,this._result.height=u)}}class e extends o{constructor(r,u,p){super(),this._document=r,this._parentElement=u,this._optionsService=p,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class s extends o{constructor(r){super(),this._optionsService=r,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const u=this._ctx.measureText("W");if(!("width"in u&&"fontBoundingBoxAscent"in u&&"fontBoundingBoxDescent"in u))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const r=this._ctx.measureText("W");return this._validateAndSet(r.width,r.fontBoundingBoxAscent+r.fontBoundingBoxDescent),this._result}}},4269:function(O,t,a){var h=this&&this.__decorate||function(s,i,r,u){var p,_=arguments.length,m=_<3?i:u===null?u=Object.getOwnPropertyDescriptor(i,r):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,i,r,u);else for(var c=s.length-1;c>=0;c--)(p=s[c])&&(m=(_<3?p(m):_>3?p(i,r,m):p(i,r))||m);return _>3&&m&&Object.defineProperty(i,r,m),m},d=this&&this.__param||function(s,i){return function(r,u){i(r,u,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=a(3734),l=a(643),f=a(511),v=a(2585);class o extends n.AttributeData{constructor(i,r,u){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=r,this._width=u}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=o;let e=t.CharacterJoinerService=class ke{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(i){const r={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(r),r.id}deregister(i){for(let r=0;r<this._characterJoiners.length;r++)if(this._characterJoiners[r].id===i)return this._characterJoiners.splice(r,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const r=this._bufferService.buffer.lines.get(i);if(!r||r.length===0)return[];const u=[],p=r.translateToString(!0);let _=0,m=0,c=0,g=r.getFg(0),S=r.getBg(0);for(let y=0;y<r.getTrimmedLength();y++)if(r.loadCell(y,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==g||this._workCell.bg!==S){if(y-_>1){const b=this._getJoinedRanges(p,c,m,r,_);for(let w=0;w<b.length;w++)u.push(b[w])}_=y,c=m,g=this._workCell.fg,S=this._workCell.bg}m+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-_>1){const y=this._getJoinedRanges(p,c,m,r,_);for(let b=0;b<y.length;b++)u.push(y[b])}return u}_getJoinedRanges(i,r,u,p,_){const m=i.substring(r,u);let c=[];try{c=this._characterJoiners[0].handler(m)}catch(g){console.error(g)}for(let g=1;g<this._characterJoiners.length;g++)try{const S=this._characterJoiners[g].handler(m);for(let y=0;y<S.length;y++)ke._mergeRanges(c,S[y])}catch(S){console.error(S)}return this._stringRangesToCellRanges(c,p,_),c}_stringRangesToCellRanges(i,r,u){let p=0,_=!1,m=0,c=i[p];if(c){for(let g=u;g<this._bufferService.cols;g++){const S=r.getWidth(g),y=r.getString(g).length||l.WHITESPACE_CELL_CHAR.length;if(S!==0){if(!_&&c[0]<=m&&(c[0]=g,_=!0),c[1]<=m){if(c[1]=g,c=i[++p],!c)break;c[0]<=m?(c[0]=g,_=!0):_=!1}m+=y}}c&&(c[1]=this._bufferService.cols)}}static _mergeRanges(i,r){let u=!1;for(let p=0;p<i.length;p++){const _=i[p];if(u){if(r[1]<=_[0])return i[p-1][1]=r[1],i;if(r[1]<=_[1])return i[p-1][1]=Math.max(r[1],_[1]),i.splice(p,1),i;i.splice(p,1),p--}else{if(r[1]<=_[0])return i.splice(p,0,r),i;if(r[1]<=_[1])return _[0]=Math.min(r[0],_[0]),i;r[0]<_[1]&&(_[0]=Math.min(r[0],_[0]),u=!0)}}return u?i[i.length-1][1]=r[1]:i.push(r),i}};t.CharacterJoinerService=e=h([d(0,v.IBufferService)],e)},5114:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const h=a(844),d=a(8460),n=a(3656);class l extends h.Disposable{constructor(o,e,s){super(),this._textarea=o,this._window=e,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this.register((0,d.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}}t.CoreBrowserService=l;class f extends h.Disposable{constructor(o){super(),this._parentWindow=o,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.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(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const h=a(844);class d extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(l){return this.linkProviders.push(l),{dispose:()=>{const f=this.linkProviders.indexOf(l);f!==-1&&this.linkProviders.splice(f,1)}}}}t.LinkProviderService=d},8934:function(O,t,a){var h=this&&this.__decorate||function(v,o,e,s){var i,r=arguments.length,u=r<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(v,o,e,s);else for(var p=v.length-1;p>=0;p--)(i=v[p])&&(u=(r<3?i(u):r>3?i(o,e,u):i(o,e))||u);return r>3&&u&&Object.defineProperty(o,e,u),u},d=this&&this.__param||function(v,o){return function(e,s){o(e,s,v)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=a(4725),l=a(9806);let f=t.MouseService=class{constructor(v,o){this._renderService=v,this._charSizeService=o}getCoords(v,o,e,s,i){return(0,l.getCoords)(window,v,o,e,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(v,o){const e=(0,l.getCoordsRelativeToElement)(window,v,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])}}};t.MouseService=f=h([d(0,n.IRenderService),d(1,n.ICharSizeService)],f)},3230:function(O,t,a){var h=this&&this.__decorate||function(i,r,u,p){var _,m=arguments.length,c=m<3?r:p===null?p=Object.getOwnPropertyDescriptor(r,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(i,r,u,p);else for(var g=i.length-1;g>=0;g--)(_=i[g])&&(c=(m<3?_(c):m>3?_(r,u,c):_(r,u))||c);return m>3&&c&&Object.defineProperty(r,u,c),c},d=this&&this.__param||function(i,r){return function(u,p){r(u,p,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=a(6193),l=a(4725),f=a(8460),v=a(844),o=a(7226),e=a(2585);let s=t.RenderService=class extends v.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(i,r,u,p,_,m,c,g){super(),this._rowCount=i,this._charSizeService=p,this._renderer=this.register(new v.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,this._observerDisposable=this.register(new v.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((S,y)=>this._renderRows(S,y),c),this.register(this._renderDebouncer),this.register(c.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(m.onResize(()=>this._fullRefresh())),this.register(m.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(u.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(_.onDecorationRegistered(()=>this._fullRefresh())),this.register(_.onDecorationRemoved(()=>this._fullRefresh())),this.register(u.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(m.cols,m.rows),this._fullRefresh()})),this.register(u.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(m.buffer.y,m.buffer.y,!0))),this.register(g.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(c.window,r),this.register(c.onWindowChange(S=>this._registerIntersectionObserver(S,r)))}_registerIntersectionObserver(i,r){if("IntersectionObserver"in i){const u=new i.IntersectionObserver(p=>this._handleIntersectionChange(p[p.length-1]),{threshold:0});u.observe(r),this._observerDisposable.value=(0,v.toDisposable)(()=>u.disconnect())}}_handleIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.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(i,r,u=!1){this._isPaused?this._needsFullRefresh=!0:(u||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,r,this._rowCount))}_renderRows(i,r){this._renderer.value&&(i=Math.min(i,this._rowCount-1),r=Math.min(r,this._rowCount-1),this._renderer.value.renderRows(i,r),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:r}),this._onRender.fire({start:i,end:r}),this._isNextRenderRedrawOnly=!0)}resize(i,r){this._rowCount=r,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(i){this._renderer.value=i,this._renderer.value&&(this._renderer.value.onRequestRedraw(r=>this.refreshRows(r.start,r.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(i,r){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(i,r)):this._renderer.value.handleResize(i,r),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(i,r,u){this._selectionState.start=i,this._selectionState.end=r,this._selectionState.columnSelectMode=u,this._renderer.value?.handleSelectionChanged(i,r,u)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};t.RenderService=s=h([d(2,e.IOptionsService),d(3,l.ICharSizeService),d(4,e.IDecorationService),d(5,e.IBufferService),d(6,l.ICoreBrowserService),d(7,l.IThemeService)],s)},9312:function(O,t,a){var h=this&&this.__decorate||function(c,g,S,y){var b,w=arguments.length,x=w<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,g,S,y);else for(var T=c.length-1;T>=0;T--)(b=c[T])&&(x=(w<3?b(x):w>3?b(g,S,x):b(g,S))||x);return w>3&&x&&Object.defineProperty(g,S,x),x},d=this&&this.__param||function(c,g){return function(S,y){g(S,y,c)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=a(9806),l=a(9504),f=a(456),v=a(4725),o=a(8460),e=a(844),s=a(6114),i=a(4841),r=a(511),u=a(2585),p=" ",_=new RegExp(p,"g");let m=t.SelectionService=class extends e.Disposable{constructor(c,g,S,y,b,w,x,T,P){super(),this._element=c,this._screenElement=g,this._linkifier=S,this._bufferService=y,this._coreService=b,this._mouseService=w,this._optionsService=x,this._renderService=T,this._coreBrowserService=P,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new r.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=B=>this._handleMouseMove(B),this._mouseUpListener=B=>this._handleMouseUp(B),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(B=>this._handleTrim(B)),this.register(this._bufferService.buffers.onBufferActivate(B=>this._handleBufferActivate(B))),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 c=this._model.finalSelectionStart,g=this._model.finalSelectionEnd;return!(!c||!g||c[0]===g[0]&&c[1]===g[1])}get selectionText(){const c=this._model.finalSelectionStart,g=this._model.finalSelectionEnd;if(!c||!g)return"";const S=this._bufferService.buffer,y=[];if(this._activeSelectionMode===3){if(c[0]===g[0])return"";const b=c[0]<g[0]?c[0]:g[0],w=c[0]<g[0]?g[0]:c[0];for(let x=c[1];x<=g[1];x++){const T=S.translateBufferLineToString(x,!0,b,w);y.push(T)}}else{const b=c[1]===g[1]?g[0]:void 0;y.push(S.translateBufferLineToString(c[1],!0,c[0],b));for(let w=c[1]+1;w<=g[1]-1;w++){const x=S.lines.get(w),T=S.translateBufferLineToString(w,!0);x?.isWrapped?y[y.length-1]+=T:y.push(T)}if(c[1]!==g[1]){const w=S.lines.get(g[1]),x=S.translateBufferLineToString(g[1],!0,0,g[0]);w&&w.isWrapped?y[y.length-1]+=x:y.push(x)}}return y.map(b=>b.replace(_," ")).join(s.isWindows?`\r
6
+ `:`
7
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(c){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),s.isLinux&&c&&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(c){const g=this._getMouseBufferCoords(c),S=this._model.finalSelectionStart,y=this._model.finalSelectionEnd;return!!(S&&y&&g)&&this._areCoordsInSelection(g,S,y)}isCellInSelection(c,g){const S=this._model.finalSelectionStart,y=this._model.finalSelectionEnd;return!(!S||!y)&&this._areCoordsInSelection([c,g],S,y)}_areCoordsInSelection(c,g,S){return c[1]>g[1]&&c[1]<S[1]||g[1]===S[1]&&c[1]===g[1]&&c[0]>=g[0]&&c[0]<S[0]||g[1]<S[1]&&c[1]===S[1]&&c[0]<S[0]||g[1]<S[1]&&c[1]===g[1]&&c[0]>=g[0]}_selectWordAtCursor(c,g){const S=this._linkifier.currentLink?.link?.range;if(S)return this._model.selectionStart=[S.start.x-1,S.start.y-1],this._model.selectionStartLength=(0,i.getRangeLength)(S,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const y=this._getMouseBufferCoords(c);return!!y&&(this._selectWordAt(y,g),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(c,g){this._model.clearSelection(),c=Math.max(c,0),g=Math.min(g,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,c],this._model.selectionEnd=[this._bufferService.cols,g],this.refresh(),this._onSelectionChange.fire()}_handleTrim(c){this._model.handleTrim(c)&&this.refresh()}_getMouseBufferCoords(c){const g=this._mouseService.getCoords(c,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(g)return g[0]--,g[1]--,g[1]+=this._bufferService.buffer.ydisp,g}_getMouseEventScrollAmount(c){let g=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,c,this._screenElement)[1];const S=this._renderService.dimensions.css.canvas.height;return g>=0&&g<=S?0:(g>S&&(g-=S),g=Math.min(Math.max(g,-50),50),g/=50,g/Math.abs(g)+Math.round(14*g))}shouldForceSelection(c){return s.isMac?c.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:c.shiftKey}handleMouseDown(c){if(this._mouseDownTimeStamp=c.timeStamp,(c.button!==2||!this.hasSelection)&&c.button===0){if(!this._enabled){if(!this.shouldForceSelection(c))return;c.stopPropagation()}c.preventDefault(),this._dragScrollAmount=0,this._enabled&&c.shiftKey?this._handleIncrementalClick(c):c.detail===1?this._handleSingleClick(c):c.detail===2?this._handleDoubleClick(c):c.detail===3&&this._handleTripleClick(c),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(c){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(c))}_handleSingleClick(c){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(c)?3:0,this._model.selectionStart=this._getMouseBufferCoords(c),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const g=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);g&&g.length!==this._model.selectionStart[0]&&g.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(c){this._selectWordAtCursor(c,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(c){const g=this._getMouseBufferCoords(c);g&&(this._activeSelectionMode=2,this._selectLineAt(g[1]))}shouldColumnSelect(c){return c.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(c){if(c.stopImmediatePropagation(),!this._model.selectionStart)return;const g=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(c),!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(c),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const S=this._bufferService.buffer;if(this._model.selectionEnd[1]<S.lines.length){const y=S.lines.get(this._model.selectionEnd[1]);y&&y.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}g&&g[0]===this._model.selectionEnd[0]&&g[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 c=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(c.ydisp+this._bufferService.rows,c.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=c.ydisp),this.refresh()}}_handleMouseUp(c){const g=c.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&g<500&&c.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const S=this._mouseService.getCoords(c,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(S&&S[0]!==void 0&&S[1]!==void 0){const y=(0,l.moveToCellSequence)(S[0]-1,S[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(y,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const c=this._model.finalSelectionStart,g=this._model.finalSelectionEnd,S=!(!c||!g||c[0]===g[0]&&c[1]===g[1]);S?c&&g&&(this._oldSelectionStart&&this._oldSelectionEnd&&c[0]===this._oldSelectionStart[0]&&c[1]===this._oldSelectionStart[1]&&g[0]===this._oldSelectionEnd[0]&&g[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(c,g,S)):this._oldHasSelection&&this._fireOnSelectionChange(c,g,S)}_fireOnSelectionChange(c,g,S){this._oldSelectionStart=c,this._oldSelectionEnd=g,this._oldHasSelection=S,this._onSelectionChange.fire()}_handleBufferActivate(c){this.clearSelection(),this._trimListener.dispose(),this._trimListener=c.activeBuffer.lines.onTrim(g=>this._handleTrim(g))}_convertViewportColToCharacterIndex(c,g){let S=g;for(let y=0;g>=y;y++){const b=c.loadCell(y,this._workCell).getChars().length;this._workCell.getWidth()===0?S--:b>1&&g!==y&&(S+=b-1)}return S}setSelection(c,g,S){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[c,g],this._model.selectionStartLength=S,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(c){this._isClickInSelection(c)||(this._selectWordAtCursor(c,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(c,g,S=!0,y=!0){if(c[0]>=this._bufferService.cols)return;const b=this._bufferService.buffer,w=b.lines.get(c[1]);if(!w)return;const x=b.translateBufferLineToString(c[1],!1);let T=this._convertViewportColToCharacterIndex(w,c[0]),P=T;const B=c[0]-T;let k=0,C=0,L=0,R=0;if(x.charAt(T)===" "){for(;T>0&&x.charAt(T-1)===" ";)T--;for(;P<x.length&&x.charAt(P+1)===" ";)P++}else{let W=c[0],N=c[0];w.getWidth(W)===0&&(k++,W--),w.getWidth(N)===2&&(C++,N++);const U=w.getString(N).length;for(U>1&&(R+=U-1,P+=U-1);W>0&&T>0&&!this._isCharWordSeparator(w.loadCell(W-1,this._workCell));){w.loadCell(W-1,this._workCell);const M=this._workCell.getChars().length;this._workCell.getWidth()===0?(k++,W--):M>1&&(L+=M-1,T-=M-1),T--,W--}for(;N<w.length&&P+1<x.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?(C++,N++):M>1&&(R+=M-1,P+=M-1),P++,N++}}P++;let D=T+B-k+L,H=Math.min(this._bufferService.cols,P-T+k+C-L-R);if(g||x.slice(T,P).trim()!==""){if(S&&D===0&&w.getCodePoint(0)!==32){const W=b.lines.get(c[1]-1);if(W&&w.isWrapped&&W.getCodePoint(this._bufferService.cols-1)!==32){const N=this._getWordAt([this._bufferService.cols-1,c[1]-1],!1,!0,!1);if(N){const U=this._bufferService.cols-N.start;D-=U,H+=U}}}if(y&&D+H===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const W=b.lines.get(c[1]+1);if(W?.isWrapped&&W.getCodePoint(0)!==32){const N=this._getWordAt([0,c[1]+1],!1,!1,!0);N&&(H+=N.length)}}return{start:D,length:H}}}_selectWordAt(c,g){const S=this._getWordAt(c,g);if(S){for(;S.start<0;)S.start+=this._bufferService.cols,c[1]--;this._model.selectionStart=[S.start,c[1]],this._model.selectionStartLength=S.length}}_selectToWordAt(c){const g=this._getWordAt(c,!0);if(g){let S=c[1];for(;g.start<0;)g.start+=this._bufferService.cols,S--;if(!this._model.areSelectionValuesReversed())for(;g.start+g.length>this._bufferService.cols;)g.length-=this._bufferService.cols,S++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?g.start:g.start+g.length,S]}}_isCharWordSeparator(c){return c.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(c.getChars())>=0}_selectLineAt(c){const g=this._bufferService.buffer.getWrappedRangeForLine(c),S={start:{x:0,y:g.first},end:{x:this._bufferService.cols-1,y:g.last}};this._model.selectionStart=[0,g.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,i.getRangeLength)(S,this._bufferService.cols)}};t.SelectionService=m=h([d(3,u.IBufferService),d(4,u.ICoreService),d(5,v.IMouseService),d(6,u.IOptionsService),d(7,v.IRenderService),d(8,v.ICoreBrowserService)],m)},4725:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const h=a(8343);t.ICharSizeService=(0,h.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),t.IMouseService=(0,h.createDecorator)("MouseService"),t.IRenderService=(0,h.createDecorator)("RenderService"),t.ISelectionService=(0,h.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,h.createDecorator)("ThemeService"),t.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(O,t,a){var h=this&&this.__decorate||function(m,c,g,S){var y,b=arguments.length,w=b<3?c:S===null?S=Object.getOwnPropertyDescriptor(c,g):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(m,c,g,S);else for(var x=m.length-1;x>=0;x--)(y=m[x])&&(w=(b<3?y(w):b>3?y(c,g,w):y(c,g))||w);return b>3&&w&&Object.defineProperty(c,g,w),w},d=this&&this.__param||function(m,c){return function(g,S){c(g,S,m)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const n=a(7239),l=a(8055),f=a(8460),v=a(844),o=a(2585),e=l.css.toColor("#ffffff"),s=l.css.toColor("#000000"),i=l.css.toColor("#ffffff"),r=l.css.toColor("#000000"),u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[l.css.toColor("#2e3436"),l.css.toColor("#cc0000"),l.css.toColor("#4e9a06"),l.css.toColor("#c4a000"),l.css.toColor("#3465a4"),l.css.toColor("#75507b"),l.css.toColor("#06989a"),l.css.toColor("#d3d7cf"),l.css.toColor("#555753"),l.css.toColor("#ef2929"),l.css.toColor("#8ae234"),l.css.toColor("#fce94f"),l.css.toColor("#729fcf"),l.css.toColor("#ad7fa8"),l.css.toColor("#34e2e2"),l.css.toColor("#eeeeec")],c=[0,95,135,175,215,255];for(let g=0;g<216;g++){const S=c[g/36%6|0],y=c[g/6%6|0],b=c[g%6];m.push({css:l.channels.toCss(S,y,b),rgba:l.channels.toRgba(S,y,b)})}for(let g=0;g<24;g++){const S=8+10*g;m.push({css:l.channels.toCss(S,S,S),rgba:l.channels.toRgba(S,S,S)})}return m})());let p=t.ThemeService=class extends v.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,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:s,cursor:i,cursorAccent:r,selectionForeground:void 0,selectionBackgroundTransparent:u,selectionBackgroundOpaque:l.color.blend(s,u),selectionInactiveBackgroundTransparent:u,selectionInactiveBackgroundOpaque:l.color.blend(s,u),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(m={}){const c=this._colors;if(c.foreground=_(m.foreground,e),c.background=_(m.background,s),c.cursor=_(m.cursor,i),c.cursorAccent=_(m.cursorAccent,r),c.selectionBackgroundTransparent=_(m.selectionBackground,u),c.selectionBackgroundOpaque=l.color.blend(c.background,c.selectionBackgroundTransparent),c.selectionInactiveBackgroundTransparent=_(m.selectionInactiveBackground,c.selectionBackgroundTransparent),c.selectionInactiveBackgroundOpaque=l.color.blend(c.background,c.selectionInactiveBackgroundTransparent),c.selectionForeground=m.selectionForeground?_(m.selectionForeground,l.NULL_COLOR):void 0,c.selectionForeground===l.NULL_COLOR&&(c.selectionForeground=void 0),l.color.isOpaque(c.selectionBackgroundTransparent)&&(c.selectionBackgroundTransparent=l.color.opacity(c.selectionBackgroundTransparent,.3)),l.color.isOpaque(c.selectionInactiveBackgroundTransparent)&&(c.selectionInactiveBackgroundTransparent=l.color.opacity(c.selectionInactiveBackgroundTransparent,.3)),c.ansi=t.DEFAULT_ANSI_COLORS.slice(),c.ansi[0]=_(m.black,t.DEFAULT_ANSI_COLORS[0]),c.ansi[1]=_(m.red,t.DEFAULT_ANSI_COLORS[1]),c.ansi[2]=_(m.green,t.DEFAULT_ANSI_COLORS[2]),c.ansi[3]=_(m.yellow,t.DEFAULT_ANSI_COLORS[3]),c.ansi[4]=_(m.blue,t.DEFAULT_ANSI_COLORS[4]),c.ansi[5]=_(m.magenta,t.DEFAULT_ANSI_COLORS[5]),c.ansi[6]=_(m.cyan,t.DEFAULT_ANSI_COLORS[6]),c.ansi[7]=_(m.white,t.DEFAULT_ANSI_COLORS[7]),c.ansi[8]=_(m.brightBlack,t.DEFAULT_ANSI_COLORS[8]),c.ansi[9]=_(m.brightRed,t.DEFAULT_ANSI_COLORS[9]),c.ansi[10]=_(m.brightGreen,t.DEFAULT_ANSI_COLORS[10]),c.ansi[11]=_(m.brightYellow,t.DEFAULT_ANSI_COLORS[11]),c.ansi[12]=_(m.brightBlue,t.DEFAULT_ANSI_COLORS[12]),c.ansi[13]=_(m.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),c.ansi[14]=_(m.brightCyan,t.DEFAULT_ANSI_COLORS[14]),c.ansi[15]=_(m.brightWhite,t.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const g=Math.min(c.ansi.length-16,m.extendedAnsi.length);for(let S=0;S<g;S++)c.ansi[S+16]=_(m.extendedAnsi[S],t.DEFAULT_ANSI_COLORS[S+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[m]=this._restoreColors.ansi[m]}else for(let c=0;c<this._restoreColors.ansi.length;++c)this._colors.ansi[c]=this._restoreColors.ansi[c]}modifyColors(m){m(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function _(m,c){if(m!==void 0)try{return l.css.toColor(m)}catch{}return c}t.ThemeService=p=h([d(0,o.IOptionsService)],p)},6349:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const h=a(8460),d=a(844);class n extends d.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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 v=new Array(f);for(let o=0;o<Math.min(f,this.length);o++)v[o]=this._array[this._getCyclicIndex(o)];this._array=v,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let v=this._length;v<f;v++)this._array[v]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,v){this._array[this._getCyclicIndex(f)]=v}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,v,...o){if(v){for(let e=f;e<this._length-v;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+v)];this._length-=v,this.onDeleteEmitter.fire({index:f,amount:v})}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,v,o){if(!(v<=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 s=v-1;s>=0;s--)this.set(f+s+o,this.get(f+s));const e=f+v+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<v;e++)this.set(f+e+o,this.get(f+e))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}t.CircularList=n},1439:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function a(h,d=5){if(typeof h!="object")return h;const n=Array.isArray(h)?[]:{};for(const l in h)n[l]=d<=1?h[l]:h[l]&&a(h[l],d-1);return n}},8055:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,h=0,d=0,n=0;var l,f,v,o,e;function s(r){const u=r.toString(16);return u.length<2?"0"+u:u}function i(r,u){return r<u?(u+.05)/(r+.05):(r+.05)/(u+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(r){r.toCss=function(u,p,_,m){return m!==void 0?`#${s(u)}${s(p)}${s(_)}${s(m)}`:`#${s(u)}${s(p)}${s(_)}`},r.toRgba=function(u,p,_,m=255){return(u<<24|p<<16|_<<8|m)>>>0},r.toColor=function(u,p,_,m){return{css:r.toCss(u,p,_,m),rgba:r.toRgba(u,p,_,m)}}}(l||(t.channels=l={})),function(r){function u(p,_){return n=Math.round(255*_),[a,h,d]=e.toChannels(p.rgba),{css:l.toCss(a,h,d,n),rgba:l.toRgba(a,h,d,n)}}r.blend=function(p,_){if(n=(255&_.rgba)/255,n===1)return{css:_.css,rgba:_.rgba};const m=_.rgba>>24&255,c=_.rgba>>16&255,g=_.rgba>>8&255,S=p.rgba>>24&255,y=p.rgba>>16&255,b=p.rgba>>8&255;return a=S+Math.round((m-S)*n),h=y+Math.round((c-y)*n),d=b+Math.round((g-b)*n),{css:l.toCss(a,h,d),rgba:l.toRgba(a,h,d)}},r.isOpaque=function(p){return(255&p.rgba)==255},r.ensureContrastRatio=function(p,_,m){const c=e.ensureContrastRatio(p.rgba,_.rgba,m);if(c)return l.toColor(c>>24&255,c>>16&255,c>>8&255)},r.opaque=function(p){const _=(255|p.rgba)>>>0;return[a,h,d]=e.toChannels(_),{css:l.toCss(a,h,d),rgba:_}},r.opacity=u,r.multiplyOpacity=function(p,_){return n=255&p.rgba,u(p,n*_/255)},r.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}}(f||(t.color=f={})),function(r){let u,p;try{const _=document.createElement("canvas");_.width=1,_.height=1;const m=_.getContext("2d",{willReadFrequently:!0});m&&(u=m,u.globalCompositeOperation="copy",p=u.createLinearGradient(0,0,1,1))}catch{}r.toColor=function(_){if(_.match(/#[\da-f]{3,8}/i))switch(_.length){case 4:return a=parseInt(_.slice(1,2).repeat(2),16),h=parseInt(_.slice(2,3).repeat(2),16),d=parseInt(_.slice(3,4).repeat(2),16),l.toColor(a,h,d);case 5:return a=parseInt(_.slice(1,2).repeat(2),16),h=parseInt(_.slice(2,3).repeat(2),16),d=parseInt(_.slice(3,4).repeat(2),16),n=parseInt(_.slice(4,5).repeat(2),16),l.toColor(a,h,d,n);case 7:return{css:_,rgba:(parseInt(_.slice(1),16)<<8|255)>>>0};case 9:return{css:_,rgba:parseInt(_.slice(1),16)>>>0}}const m=_.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),h=parseInt(m[2]),d=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),l.toColor(a,h,d,n);if(!u||!p)throw new Error("css.toColor: Unsupported css format");if(u.fillStyle=p,u.fillStyle=_,typeof u.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[a,h,d,n]=u.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:l.toRgba(a,h,d,n),css:_}}}(v||(t.css=v={})),function(r){function u(p,_,m){const c=p/255,g=_/255,S=m/255;return .2126*(c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4))+.7152*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}r.relativeLuminance=function(p){return u(p>>16&255,p>>8&255,255&p)},r.relativeLuminance2=u}(o||(t.rgb=o={})),function(r){function u(_,m,c){const g=_>>24&255,S=_>>16&255,y=_>>8&255;let b=m>>24&255,w=m>>16&255,x=m>>8&255,T=i(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));for(;T<c&&(b>0||w>0||x>0);)b-=Math.max(0,Math.ceil(.1*b)),w-=Math.max(0,Math.ceil(.1*w)),x-=Math.max(0,Math.ceil(.1*x)),T=i(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));return(b<<24|w<<16|x<<8|255)>>>0}function p(_,m,c){const g=_>>24&255,S=_>>16&255,y=_>>8&255;let b=m>>24&255,w=m>>16&255,x=m>>8&255,T=i(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));for(;T<c&&(b<255||w<255||x<255);)b=Math.min(255,b+Math.ceil(.1*(255-b))),w=Math.min(255,w+Math.ceil(.1*(255-w))),x=Math.min(255,x+Math.ceil(.1*(255-x))),T=i(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));return(b<<24|w<<16|x<<8|255)>>>0}r.blend=function(_,m){if(n=(255&m)/255,n===1)return m;const c=m>>24&255,g=m>>16&255,S=m>>8&255,y=_>>24&255,b=_>>16&255,w=_>>8&255;return a=y+Math.round((c-y)*n),h=b+Math.round((g-b)*n),d=w+Math.round((S-w)*n),l.toRgba(a,h,d)},r.ensureContrastRatio=function(_,m,c){const g=o.relativeLuminance(_>>8),S=o.relativeLuminance(m>>8);if(i(g,S)<c){if(S<g){const w=u(_,m,c),x=i(g,o.relativeLuminance(w>>8));if(x<c){const T=p(_,m,c);return x>i(g,o.relativeLuminance(T>>8))?w:T}return w}const y=p(_,m,c),b=i(g,o.relativeLuminance(y>>8));if(b<c){const w=u(_,m,c);return b>i(g,o.relativeLuminance(w>>8))?y:w}return y}},r.reduceLuminance=u,r.increaseLuminance=p,r.toChannels=function(_){return[_>>24&255,_>>16&255,_>>8&255,255&_]}}(e||(t.rgba=e={})),t.toPaddedHex=s,t.contrastRatio=i},8969:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const h=a(844),d=a(2585),n=a(4348),l=a(7866),f=a(744),v=a(7302),o=a(6975),e=a(8460),s=a(1753),i=a(1480),r=a(7994),u=a(9282),p=a(5435),_=a(5981),m=a(2660);let c=!1;class g extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(y=>{this._onScrollApi?.fire(y.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(y){for(const b in y)this.optionsService.options[b]=y[b]}constructor(y){super(),this._windowsWrappingHeuristics=this.register(new h.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 v.OptionsService(y)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(l.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(o.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(r.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new p.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(b=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(b=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new _.WriteBuffer((b,w)=>this._inputHandler.parse(b,w))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(y,b){this._writeBuffer.write(y,b)}writeSync(y,b){this._logService.logLevel<=d.LogLevelEnum.WARN&&!c&&(this._logService.warn("writeSync is unreliable and will be removed soon."),c=!0),this._writeBuffer.writeSync(y,b)}input(y,b=!0){this.coreService.triggerDataEvent(y,b)}resize(y,b){isNaN(y)||isNaN(b)||(y=Math.max(y,f.MINIMUM_COLS),b=Math.max(b,f.MINIMUM_ROWS),this._bufferService.resize(y,b))}scroll(y,b=!1){this._bufferService.scroll(y,b)}scrollLines(y,b,w){this._bufferService.scrollLines(y,b,w)}scrollPages(y){this.scrollLines(y*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(y){const b=y-this._bufferService.buffer.ydisp;b!==0&&this.scrollLines(b)}registerEscHandler(y,b){return this._inputHandler.registerEscHandler(y,b)}registerDcsHandler(y,b){return this._inputHandler.registerDcsHandler(y,b)}registerCsiHandler(y,b){return this._inputHandler.registerCsiHandler(y,b)}registerOscHandler(y,b){return this._inputHandler.registerOscHandler(y,b)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let y=!1;const b=this.optionsService.rawOptions.windowsPty;b&&b.buildNumber!==void 0&&b.buildNumber!==void 0?y=b.backend==="conpty"&&b.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(y=!0),y?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const y=[];y.push(this.onLineFeed(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),y.push(this.registerCsiHandler({final:"H"},()=>((0,u.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)(()=>{for(const b of y)b.dispose()})}}}t.CoreTerminal=g},8460:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.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 h=0;h<this._listeners.length;h++)if(this._listeners[h]===a)return void this._listeners.splice(h,1)}}})),this._event}fire(a,h){const d=[];for(let n=0;n<this._listeners.length;n++)d.push(this._listeners[n]);for(let n=0;n<d.length;n++)d[n].call(void 0,a,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,h){return a(d=>h.fire(d))},t.runAndSubscribe=function(a,h){return h(void 0),a(d=>h(d))}},5435:function(O,t,a){var h=this&&this.__decorate||function(k,C,L,R){var D,H=arguments.length,W=H<3?C:R===null?R=Object.getOwnPropertyDescriptor(C,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(k,C,L,R);else for(var N=k.length-1;N>=0;N--)(D=k[N])&&(W=(H<3?D(W):H>3?D(C,L,W):D(C,L))||W);return H>3&&W&&Object.defineProperty(C,L,W),W},d=this&&this.__param||function(k,C){return function(L,R){C(L,R,k)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const n=a(2584),l=a(7116),f=a(2015),v=a(844),o=a(482),e=a(8437),s=a(8460),i=a(643),r=a(511),u=a(3734),p=a(2585),_=a(1480),m=a(6242),c=a(6351),g=a(5941),S={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=131072;function b(k,C){if(k>24)return C.setWinLines||!1;switch(k){case 1:return!!C.restoreWin;case 2:return!!C.minimizeWin;case 3:return!!C.setWinPosition;case 4:return!!C.setWinSizePixels;case 5:return!!C.raiseWin;case 6:return!!C.lowerWin;case 7:return!!C.refreshWin;case 8:return!!C.setWinSizeChars;case 9:return!!C.maximizeWin;case 10:return!!C.fullscreenWin;case 11:return!!C.getWinState;case 13:return!!C.getWinPosition;case 14:return!!C.getWinSizePixels;case 15:return!!C.getScreenSizePixels;case 16:return!!C.getCellSizePixels;case 18:return!!C.getWinSizeChars;case 19:return!!C.getScreenSizeChars;case 20:return!!C.getIconTitle;case 21:return!!C.getWinTitle;case 22:return!!C.pushTitle;case 23:return!!C.popTitle;case 24:return!!C.setWinLines}return!1}var w;(function(k){k[k.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",k[k.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(t.WindowsOptionsReportType=w={}));let x=0;class T extends v.Disposable{getAttrData(){return this._curAttrData}constructor(C,L,R,D,H,W,N,U,M=new f.EscapeSequenceParser){super(),this._bufferService=C,this._charsetService=L,this._coreService=R,this._logService=D,this._optionsService=H,this._oscLinkService=W,this._coreMouseService=N,this._unicodeService=U,this._parser=M,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new o.StringToUtf32,this._utf8Decoder=new o.Utf8ToUtf32,this._workCell=new r.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 s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new P(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._parser.setCsiHandlerFallback((E,I)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(E),params:I.toArray()})}),this._parser.setEscHandlerFallback(E=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(E)})}),this._parser.setExecuteHandlerFallback(E=>{this._logService.debug("Unknown EXECUTE code: ",{code:E})}),this._parser.setOscHandlerFallback((E,I,A)=>{this._logService.debug("Unknown OSC code: ",{identifier:E,action:I,data:A})}),this._parser.setDcsHandlerFallback((E,I,A)=>{I==="HOOK"&&(A=A.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(E),action:I,payload:A})}),this._parser.setPrintHandler((E,I,A)=>this.print(E,I,A)),this._parser.registerCsiHandler({final:"@"},E=>this.insertChars(E)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},E=>this.scrollLeft(E)),this._parser.registerCsiHandler({final:"A"},E=>this.cursorUp(E)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},E=>this.scrollRight(E)),this._parser.registerCsiHandler({final:"B"},E=>this.cursorDown(E)),this._parser.registerCsiHandler({final:"C"},E=>this.cursorForward(E)),this._parser.registerCsiHandler({final:"D"},E=>this.cursorBackward(E)),this._parser.registerCsiHandler({final:"E"},E=>this.cursorNextLine(E)),this._parser.registerCsiHandler({final:"F"},E=>this.cursorPrecedingLine(E)),this._parser.registerCsiHandler({final:"G"},E=>this.cursorCharAbsolute(E)),this._parser.registerCsiHandler({final:"H"},E=>this.cursorPosition(E)),this._parser.registerCsiHandler({final:"I"},E=>this.cursorForwardTab(E)),this._parser.registerCsiHandler({final:"J"},E=>this.eraseInDisplay(E,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},E=>this.eraseInDisplay(E,!0)),this._parser.registerCsiHandler({final:"K"},E=>this.eraseInLine(E,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},E=>this.eraseInLine(E,!0)),this._parser.registerCsiHandler({final:"L"},E=>this.insertLines(E)),this._parser.registerCsiHandler({final:"M"},E=>this.deleteLines(E)),this._parser.registerCsiHandler({final:"P"},E=>this.deleteChars(E)),this._parser.registerCsiHandler({final:"S"},E=>this.scrollUp(E)),this._parser.registerCsiHandler({final:"T"},E=>this.scrollDown(E)),this._parser.registerCsiHandler({final:"X"},E=>this.eraseChars(E)),this._parser.registerCsiHandler({final:"Z"},E=>this.cursorBackwardTab(E)),this._parser.registerCsiHandler({final:"`"},E=>this.charPosAbsolute(E)),this._parser.registerCsiHandler({final:"a"},E=>this.hPositionRelative(E)),this._parser.registerCsiHandler({final:"b"},E=>this.repeatPrecedingCharacter(E)),this._parser.registerCsiHandler({final:"c"},E=>this.sendDeviceAttributesPrimary(E)),this._parser.registerCsiHandler({prefix:">",final:"c"},E=>this.sendDeviceAttributesSecondary(E)),this._parser.registerCsiHandler({final:"d"},E=>this.linePosAbsolute(E)),this._parser.registerCsiHandler({final:"e"},E=>this.vPositionRelative(E)),this._parser.registerCsiHandler({final:"f"},E=>this.hVPosition(E)),this._parser.registerCsiHandler({final:"g"},E=>this.tabClear(E)),this._parser.registerCsiHandler({final:"h"},E=>this.setMode(E)),this._parser.registerCsiHandler({prefix:"?",final:"h"},E=>this.setModePrivate(E)),this._parser.registerCsiHandler({final:"l"},E=>this.resetMode(E)),this._parser.registerCsiHandler({prefix:"?",final:"l"},E=>this.resetModePrivate(E)),this._parser.registerCsiHandler({final:"m"},E=>this.charAttributes(E)),this._parser.registerCsiHandler({final:"n"},E=>this.deviceStatus(E)),this._parser.registerCsiHandler({prefix:"?",final:"n"},E=>this.deviceStatusPrivate(E)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},E=>this.softReset(E)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},E=>this.setCursorStyle(E)),this._parser.registerCsiHandler({final:"r"},E=>this.setScrollRegion(E)),this._parser.registerCsiHandler({final:"s"},E=>this.saveCursor(E)),this._parser.registerCsiHandler({final:"t"},E=>this.windowOptions(E)),this._parser.registerCsiHandler({final:"u"},E=>this.restoreCursor(E)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},E=>this.insertColumns(E)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},E=>this.deleteColumns(E)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},E=>this.selectProtected(E)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},E=>this.requestMode(E,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},E=>this.requestMode(E,!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 m.OscHandler(E=>(this.setTitle(E),this.setIconName(E),!0))),this._parser.registerOscHandler(1,new m.OscHandler(E=>this.setIconName(E))),this._parser.registerOscHandler(2,new m.OscHandler(E=>this.setTitle(E))),this._parser.registerOscHandler(4,new m.OscHandler(E=>this.setOrReportIndexedColor(E))),this._parser.registerOscHandler(8,new m.OscHandler(E=>this.setHyperlink(E))),this._parser.registerOscHandler(10,new m.OscHandler(E=>this.setOrReportFgColor(E))),this._parser.registerOscHandler(11,new m.OscHandler(E=>this.setOrReportBgColor(E))),this._parser.registerOscHandler(12,new m.OscHandler(E=>this.setOrReportCursorColor(E))),this._parser.registerOscHandler(104,new m.OscHandler(E=>this.restoreIndexedColor(E))),this._parser.registerOscHandler(110,new m.OscHandler(E=>this.restoreFgColor(E))),this._parser.registerOscHandler(111,new m.OscHandler(E=>this.restoreBgColor(E))),this._parser.registerOscHandler(112,new m.OscHandler(E=>this.restoreCursorColor(E))),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 E in l.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:E},()=>this.selectCharset("("+E)),this._parser.registerEscHandler({intermediates:")",final:E},()=>this.selectCharset(")"+E)),this._parser.registerEscHandler({intermediates:"*",final:E},()=>this.selectCharset("*"+E)),this._parser.registerEscHandler({intermediates:"+",final:E},()=>this.selectCharset("+"+E)),this._parser.registerEscHandler({intermediates:"-",final:E},()=>this.selectCharset("-"+E)),this._parser.registerEscHandler({intermediates:".",final:E},()=>this.selectCharset("."+E)),this._parser.registerEscHandler({intermediates:"/",final:E},()=>this.selectCharset("/"+E));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(E=>(this._logService.error("Parsing error: ",E),E)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new c.DcsHandler((E,I)=>this.requestStatusString(E,I)))}_preserveStack(C,L,R,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=C,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=R,this._parseStack.position=D}_logSlowResolvingAsync(C){this._logService.logLevel<=p.LogLevelEnum.WARN&&Promise.race([C,new Promise((L,R)=>setTimeout(()=>R("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(C,L){let R,D=this._activeBuffer.x,H=this._activeBuffer.y,W=0;const N=this._parseStack.paused;if(N){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(R),R;D=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,C.length>y&&(W=this._parseStack.position+y)}if(this._logService.logLevel<=p.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof C=="string"?` "${C}"`:` "${Array.prototype.map.call(C,E=>String.fromCharCode(E)).join("")}"`),typeof C=="string"?C.split("").map(E=>E.charCodeAt(0)):C),this._parseBuffer.length<C.length&&this._parseBuffer.length<y&&(this._parseBuffer=new Uint32Array(Math.min(C.length,y))),N||this._dirtyRowTracker.clearRange(),C.length>y)for(let E=W;E<C.length;E+=y){const I=E+y<C.length?E+y:C.length,A=typeof C=="string"?this._stringDecoder.decode(C.substring(E,I),this._parseBuffer):this._utf8Decoder.decode(C.subarray(E,I),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,A))return this._preserveStack(D,H,A,E),this._logSlowResolvingAsync(R),R}else if(!N){const E=typeof C=="string"?this._stringDecoder.decode(C,this._parseBuffer):this._utf8Decoder.decode(C,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,E))return this._preserveStack(D,H,E,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===D&&this._activeBuffer.y===H||this._onCursorMove.fire();const U=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(U,this._bufferService.rows-1))}print(C,L,R){let D,H;const W=this._charsetService.charset,N=this._optionsService.rawOptions.screenReaderMode,U=this._bufferService.cols,M=this._coreService.decPrivateModes.wraparound,E=this._coreService.modes.insertMode,I=this._curAttrData;let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-L>0&&A.getWidth(this._activeBuffer.x-1)===2&&A.setCellFromCodepoint(this._activeBuffer.x-1,0,1,I);let F=this._parser.precedingJoinState;for(let $=L;$<R;++$){if(D=C[$],D<127&&W){const ie=W[String.fromCharCode(D)];ie&&(D=ie.charCodeAt(0))}const G=this._unicodeService.charProperties(D,F);H=_.UnicodeService.extractWidth(G);const j=_.UnicodeService.extractShouldJoin(G),K=j?_.UnicodeService.extractWidth(F):0;if(F=G,N&&this._onA11yChar.fire((0,o.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+H-K>U){if(M){const ie=A;let q=this._activeBuffer.x-K;for(this._activeBuffer.x=K,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),A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),K>0&&A instanceof e.BufferLine&&A.copyCellsFrom(ie,q,0,K,!1);q<U;)ie.setCellFromCodepoint(q++,0,1,I)}else if(this._activeBuffer.x=U-1,H===2)continue}if(j&&this._activeBuffer.x){const ie=A.getWidth(this._activeBuffer.x-1)?1:2;A.addCodepointToCell(this._activeBuffer.x-ie,D,H);for(let q=H-K;--q>=0;)A.setCellFromCodepoint(this._activeBuffer.x++,0,0,I)}else if(E&&(A.insertCells(this._activeBuffer.x,H-K,this._activeBuffer.getNullCell(I)),A.getWidth(U-1)===2&&A.setCellFromCodepoint(U-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,I)),A.setCellFromCodepoint(this._activeBuffer.x++,D,H,I),H>0)for(;--H;)A.setCellFromCodepoint(this._activeBuffer.x++,0,0,I)}this._parser.precedingJoinState=F,this._activeBuffer.x<U&&R-L>0&&A.getWidth(this._activeBuffer.x)===0&&!A.hasContent(this._activeBuffer.x)&&A.setCellFromCodepoint(this._activeBuffer.x,0,1,I),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(C,L){return C.final!=="t"||C.prefix||C.intermediates?this._parser.registerCsiHandler(C,L):this._parser.registerCsiHandler(C,R=>!b(R.params[0],this._optionsService.rawOptions.windowOptions)||L(R))}registerDcsHandler(C,L){return this._parser.registerDcsHandler(C,new c.DcsHandler(L))}registerEscHandler(C,L){return this._parser.registerEscHandler(C,L)}registerOscHandler(C,L){return this._parser.registerOscHandler(C,new m.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);C.hasWidth(this._activeBuffer.x)&&!C.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const C=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-C),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(C=this._bufferService.cols-1){this._activeBuffer.x=Math.min(C,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(C,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=C,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=C,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(C,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+C,this._activeBuffer.y+L)}cursorUp(C){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,C.params[0]||1)):this._moveCursor(0,-(C.params[0]||1)),!0}cursorDown(C){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,C.params[0]||1)):this._moveCursor(0,C.params[0]||1),!0}cursorForward(C){return this._moveCursor(C.params[0]||1,0),!0}cursorBackward(C){return this._moveCursor(-(C.params[0]||1),0),!0}cursorNextLine(C){return this.cursorDown(C),this._activeBuffer.x=0,!0}cursorPrecedingLine(C){return this.cursorUp(C),this._activeBuffer.x=0,!0}cursorCharAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(C){return this._setCursor(C.length>=2?(C.params[1]||1)-1:0,(C.params[0]||1)-1),!0}charPosAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(C){return this._moveCursor(C.params[0]||1,0),!0}linePosAbsolute(C){return this._setCursor(this._activeBuffer.x,(C.params[0]||1)-1),!0}vPositionRelative(C){return this._moveCursor(0,C.params[0]||1),!0}hVPosition(C){return this.cursorPosition(C),!0}tabClear(C){const L=C.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=C.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=C.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(C){const L=C.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(C,L,R,D=!1,H=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);W.replaceCells(L,R,this._activeBuffer.getNullCell(this._eraseAttrData()),H),D&&(W.isWrapped=!1)}_resetBufferLine(C,L=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+C),R.isWrapped=!1)}eraseInDisplay(C,L=!1){let R;switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);R<this._bufferService.rows;R++)this._resetBufferLine(R,L);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,L);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(C,L=!1){switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(C){this._restrictCursor();let L=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;L--;)this._activeBuffer.lines.splice(H-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(C){this._restrictCursor();let L=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;L--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(C){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(C){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(C){let L=C.params[0]||1;for(;L--;)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(C){let L=C.params[0]||1;for(;L--;)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(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=C.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=C.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=C.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=C.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(C){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(C.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(C){const L=this._parser.precedingJoinState;if(!L)return!0;const R=C.params[0]||1,D=_.UnicodeService.extractWidth(L),H=this._activeBuffer.x-D,W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(H),N=new Uint32Array(W.length*R);let U=0;for(let E=0;E<W.length;){const I=W.codePointAt(E)||0;N[U++]=I,E+=I>65535?2:1}let M=U;for(let E=1;E<R;++E)N.copyWithin(M,0,U),M+=U;return this.print(N,0,M),!0}sendDeviceAttributesPrimary(C){return C.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(C){return C.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(C.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(C){return(this._optionsService.rawOptions.termName+"").indexOf(C)===0}setMode(C){for(let L=0;L<C.length;L++)switch(C.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(C){for(let L=0;L<C.length;L++)switch(C.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,l.DEFAULT_CHARSET),this._charsetService.setgCharset(1,l.DEFAULT_CHARSET),this._charsetService.setgCharset(2,l.DEFAULT_CHARSET),this._charsetService.setgCharset(3,l.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(C){for(let L=0;L<C.length;L++)switch(C.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(C){for(let L=0;L<C.length;L++)switch(C.params[L]){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(),C.params[L]===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(C,L){const R=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:H}=this._coreMouseService,W=this._coreService,{buffers:N,cols:U}=this._bufferService,{active:M,alt:E}=N,I=this._optionsService.rawOptions,A=j=>j?1:2,F=C.params[0];return $=F,G=L?F===2?4:F===4?A(W.modes.insertMode):F===12?3:F===20?A(I.convertEol):0:F===1?A(R.applicationCursorKeys):F===3?I.windowOptions.setWinLines?U===80?2:U===132?1:0:0:F===6?A(R.origin):F===7?A(R.wraparound):F===8?3:F===9?A(D==="X10"):F===12?A(I.cursorBlink):F===25?A(!W.isCursorHidden):F===45?A(R.reverseWraparound):F===66?A(R.applicationKeypad):F===67?4:F===1e3?A(D==="VT200"):F===1002?A(D==="DRAG"):F===1003?A(D==="ANY"):F===1004?A(R.sendFocus):F===1005?4:F===1006?A(H==="SGR"):F===1015?4:F===1016?A(H==="SGR_PIXELS"):F===1048?1:F===47||F===1047||F===1049?A(M===E):F===2004?A(R.bracketedPasteMode):0,W.triggerDataEvent(`${n.C0.ESC}[${L?"":"?"}${$};${G}$y`),!0;var $,G}_updateAttrColor(C,L,R,D,H){return L===2?(C|=50331648,C&=-16777216,C|=u.AttributeData.fromColorRGB([R,D,H])):L===5&&(C&=-50331904,C|=33554432|255&R),C}_extractColor(C,L,R){const D=[0,0,-1,0,0,0];let H=0,W=0;do{if(D[W+H]=C.params[L+W],C.hasSubParams(L+W)){const N=C.getSubParams(L+W);let U=0;do D[1]===5&&(H=1),D[W+U+1+H]=N[U];while(++U<N.length&&U+W+1+H<D.length);break}if(D[1]===5&&W+H>=2||D[1]===2&&W+H>=5)break;D[1]&&(H=1)}while(++W+L<C.length&&W+H<D.length);for(let N=2;N<D.length;++N)D[N]===-1&&(D[N]=0);switch(D[0]){case 38:R.fg=this._updateAttrColor(R.fg,D[1],D[3],D[4],D[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,D[1],D[3],D[4],D[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,D[1],D[3],D[4],D[5])}return W}_processUnderline(C,L){L.extended=L.extended.clone(),(!~C||C>5)&&(C=1),L.extended.underlineStyle=C,L.fg|=268435456,C===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(C){C.fg=e.DEFAULT_ATTR_DATA.fg,C.bg=e.DEFAULT_ATTR_DATA.bg,C.extended=C.extended.clone(),C.extended.underlineStyle=0,C.extended.underlineColor&=-67108864,C.updateExtended()}charAttributes(C){if(C.length===1&&C.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=C.length;let R;const D=this._curAttrData;for(let H=0;H<L;H++)R=C.params[H],R>=30&&R<=37?(D.fg&=-50331904,D.fg|=16777216|R-30):R>=40&&R<=47?(D.bg&=-50331904,D.bg|=16777216|R-40):R>=90&&R<=97?(D.fg&=-50331904,D.fg|=16777224|R-90):R>=100&&R<=107?(D.bg&=-50331904,D.bg|=16777224|R-100):R===0?this._processSGR0(D):R===1?D.fg|=134217728:R===3?D.bg|=67108864:R===4?(D.fg|=268435456,this._processUnderline(C.hasSubParams(H)?C.getSubParams(H)[0]:1,D)):R===5?D.fg|=536870912:R===7?D.fg|=67108864:R===8?D.fg|=1073741824:R===9?D.fg|=2147483648:R===2?D.bg|=134217728:R===21?this._processUnderline(2,D):R===22?(D.fg&=-134217729,D.bg&=-134217729):R===23?D.bg&=-67108865:R===24?(D.fg&=-268435457,this._processUnderline(0,D)):R===25?D.fg&=-536870913:R===27?D.fg&=-67108865:R===28?D.fg&=-1073741825:R===29?D.fg&=2147483647:R===39?(D.fg&=-67108864,D.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):R===49?(D.bg&=-67108864,D.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?H+=this._extractColor(C,H,D):R===53?D.bg|=1073741824:R===55?D.bg&=-1073741825:R===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):R===100?(D.fg&=-67108864,D.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(C){switch(C.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${L};${R}R`)}return!0}deviceStatusPrivate(C){if(C.params[0]===6){const L=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${L};${R}R`)}return!0}softReset(C){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(C){const L=C.params[0]||1;switch(L){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 R=L%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(C){const L=C.params[0]||1;let R;return(C.length<2||(R=C.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(C){if(!b(C.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=C.length>1?C.params[1]:0;switch(C.params[0]){case 14:L!==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:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(C){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(C){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(C){return this._windowTitle=C,this._onTitleChange.fire(C),!0}setIconName(C){return this._iconName=C,!0}setOrReportIndexedColor(C){const L=[],R=C.split(";");for(;R.length>1;){const D=R.shift(),H=R.shift();if(/^\d+$/.exec(D)){const W=parseInt(D);if(B(W))if(H==="?")L.push({type:0,index:W});else{const N=(0,g.parseColor)(H);N&&L.push({type:1,index:W,color:N})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(C){const L=C.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(C,L){this._getCurrentLinkId()&&this._finishHyperlink();const R=C.split(":");let D;const H=R.findIndex(W=>W.startsWith("id="));return H!==-1&&(D=R[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(C,L){const R=C.split(";");for(let D=0;D<R.length&&!(L>=this._specialColors.length);++D,++L)if(R[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const H=(0,g.parseColor)(R[D]);H&&this._onColor.fire([{type:1,index:this._specialColors[L],color:H}])}return!0}setOrReportFgColor(C){return this._setOrReportSpecialColor(C,0)}setOrReportBgColor(C){return this._setOrReportSpecialColor(C,1)}setOrReportCursorColor(C){return this._setOrReportSpecialColor(C,2)}restoreIndexedColor(C){if(!C)return this._onColor.fire([{type:2}]),!0;const L=[],R=C.split(";");for(let D=0;D<R.length;++D)if(/^\d+$/.exec(R[D])){const H=parseInt(R[D]);B(H)&&L.push({type:2,index:H})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(C){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(C){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(C){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,l.DEFAULT_CHARSET),!0}selectCharset(C){return C.length!==2?(this.selectDefaultCharset(),!0):(C[0]==="/"||this._charsetService.setgCharset(S[C[0]],l.CHARSETS[C[1]]||l.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 C=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,C,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(C){return this._charsetService.setgLevel(C),!0}screenAlignmentPattern(){const C=new r.CellData;C.content=4194373,C.fg=this._curAttrData.fg,C.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const R=this._activeBuffer.ybase+this._activeBuffer.y+L,D=this._activeBuffer.lines.get(R);D&&(D.fill(C),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(C,L){const R=this._bufferService.buffer,D=this._optionsService.rawOptions;return(H=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${H}${n.C0.ESC}\\`),!0))(C==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:C==='"p'?'P1$r61;1"p':C==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:C==="m"?"P1$r0m":C===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(C,L){this._dirtyRowTracker.markRangeDirty(C,L)}}t.InputHandler=T;let P=class{constructor(k){this._bufferService=k,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(k){k<this.start?this.start=k:k>this.end&&(this.end=k)}markRangeDirty(k,C){k>C&&(x=k,k=C,C=x),k<this.start&&(this.start=k),C>this.end&&(this.end=C)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function B(k){return 0<=k&&k<256}P=h([d(0,p.IBufferService)],P)},844:(O,t)=>{function a(h){for(const d of h)d.dispose();h.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const d=this._disposables.indexOf(h);d!==-1&&this._disposables.splice(d,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(h){return{dispose:h}},t.disposeArray=a,t.getDisposeArrayDisposable=function(h){return{dispose:()=>a(h)}}},1505:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(d,n,l){this._data[d]||(this._data[d]={}),this._data[d][n]=l}get(d,n){return this._data[d]?this._data[d][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(h,d,n,l,f){this._data.get(h,d)||this._data.set(h,d,new a),this._data.get(h,d).set(n,l,f)}get(h,d,n,l){return this._data.get(h,d)?.get(n,l)}clear(){this._data.clear()}}},6114:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,h=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const d=a.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),t.isIpad=h==="iPad",t.isIphone=h==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),t.isLinux=h.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},6106:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let a=0;t.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(a=this._search(this._getKey(h)),this._array.splice(a,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const d=this._getKey(h);if(d===void 0||(a=this._search(d),a===-1)||this._getKey(this._array[a])!==d)return!1;do if(this._array[a]===h)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===d);return!1}*getKeyIterator(h){if(this._array.length!==0&&(a=this._search(h),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===h)}forEachByKey(h,d){if(this._array.length!==0&&(a=this._search(h),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do d(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===h)}values(){return[...this._array].values()}_search(h){let d=0,n=this._array.length-1;for(;n>=d;){let l=d+n>>1;const f=this._getKey(this._array[l]);if(f>h)n=l-1;else{if(!(f<h)){for(;l>0&&this._getKey(this._array[l-1])===h;)l--;return l}d=l+1}}return d}}},7226:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const h=a(6114);class d{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 v=0,o=0,e=f.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),o=Math.max(v,o),s=f.timeRemaining(),1.5*o>s)return e-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-v))}ms`),void this._start();e=s}this.clear()}}class n extends d{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const v=Date.now()+f;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(l){return requestIdleCallback(l)}_cancelCallback(l){cancelIdleCallback(l)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(l){this._queue.clear(),this._queue.enqueue(l)}flush(){this._queue.flush()}}},9282:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const h=a(643);t.updateWindowsModeWrappedState=function(d){const n=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),l=n?.get(d.cols-1),f=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);f&&l&&(f.isWrapped=l[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&l[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new h}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}}t.AttributeData=a;class h{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,l=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=l}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=h},9092:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const h=a(6349),d=a(7226),n=a(3734),l=a(8437),f=a(4634),v=a(511),o=a(643),e=a(4863),s=a(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(i,r,u){this._hasScrollback=i,this._optionsService=r,this._bufferService=u,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=l.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=v.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=v.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,r){return new l.BufferLine(this._bufferService.cols,this.getNullCell(i),r)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const r=i+this._optionsService.rawOptions.scrollback;return r>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:r}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=l.DEFAULT_ATTR_DATA);let r=this._rows;for(;r--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,r){const u=this.getNullCell(l.DEFAULT_ATTR_DATA);let p=0;const _=this._getCorrectBufferLength(r);if(_>this.lines.maxLength&&(this.lines.maxLength=_),this.lines.length>0){if(this._cols<i)for(let c=0;c<this.lines.length;c++)p+=+this.lines.get(c).resize(i,u);let m=0;if(this._rows<r)for(let c=this._rows;c<r;c++)this.lines.length<r+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new l.BufferLine(i,u)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new l.BufferLine(i,u)));else for(let c=this._rows;c>r;c--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(_<this.lines.maxLength){const c=this.lines.length-_;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=_}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,r-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(i,r),this._cols>i))for(let m=0;m<this.lines.length;m++)p+=+this.lines.get(m).resize(i,u);this._cols=i,this._rows=r,this._memoryCleanupQueue.clear(),p>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let r=0;for(;this._memoryCleanupPosition<this.lines.length;)if(r+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),r>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,r){this._cols!==i&&(i>this._cols?this._reflowLarger(i,r):this._reflowSmaller(i,r))}_reflowLarger(i,r){const u=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(l.DEFAULT_ATTR_DATA));if(u.length>0){const p=(0,f.reflowLargerCreateNewLayout)(this.lines,u);(0,f.reflowLargerApplyNewLayout)(this.lines,p.layout),this._reflowLargerAdjustViewport(i,r,p.countRemoved)}}_reflowLargerAdjustViewport(i,r,u){const p=this.getNullCell(l.DEFAULT_ATTR_DATA);let _=u;for(;_-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new l.BufferLine(i,p))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-u,0)}_reflowSmaller(i,r){const u=this.getNullCell(l.DEFAULT_ATTR_DATA),p=[];let _=0;for(let m=this.lines.length-1;m>=0;m--){let c=this.lines.get(m);if(!c||!c.isWrapped&&c.getTrimmedLength()<=i)continue;const g=[c];for(;c.isWrapped&&m>0;)c=this.lines.get(--m),g.unshift(c);const S=this.ybase+this.y;if(S>=m&&S<m+g.length)continue;const y=g[g.length-1].getTrimmedLength(),b=(0,f.reflowSmallerGetNewLineLengths)(g,this._cols,i),w=b.length-g.length;let x;x=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 T=[];for(let R=0;R<w;R++){const D=this.getBlankLine(l.DEFAULT_ATTR_DATA,!0);T.push(D)}T.length>0&&(p.push({start:m+g.length+_,newLines:T}),_+=T.length),g.push(...T);let P=b.length-1,B=b[P];B===0&&(P--,B=b[P]);let k=g.length-w-1,C=y;for(;k>=0;){const R=Math.min(C,B);if(g[P]===void 0)break;if(g[P].copyCellsFrom(g[k],C-R,B-R,R,!0),B-=R,B===0&&(P--,B=b[P]),C-=R,C===0){k--;const D=Math.max(k,0);C=(0,f.getWrappedLineTrimmedLength)(g,D,this._cols)}}for(let R=0;R<g.length;R++)b[R]<i&&g[R].setCell(b[R],u);let L=w-x;for(;L-- >0;)this.ybase===0?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+_)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+w,this.ybase+r-1)}if(p.length>0){const m=[],c=[];for(let P=0;P<this.lines.length;P++)c.push(this.lines.get(P));const g=this.lines.length;let S=g-1,y=0,b=p[y];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+_);let w=0;for(let P=Math.min(this.lines.maxLength-1,g+_-1);P>=0;P--)if(b&&b.start>S+w){for(let B=b.newLines.length-1;B>=0;B--)this.lines.set(P--,b.newLines[B]);P++,m.push({index:S+1,amount:b.newLines.length}),w+=b.newLines.length,b=p[++y]}else this.lines.set(P,c[S--]);let x=0;for(let P=m.length-1;P>=0;P--)m[P].index+=x,this.lines.onInsertEmitter.fire(m[P]),x+=m[P].amount;const T=Math.max(0,g+_-this.lines.maxLength);T>0&&this.lines.onTrimEmitter.fire(T)}}translateBufferLineToString(i,r,u=0,p){const _=this.lines.get(i);return _?_.translateToString(r,u,p):""}getWrappedRangeForLine(i){let r=i,u=i;for(;r>0&&this.lines.get(r).isWrapped;)r--;for(;u+1<this.lines.length&&this.lines.get(u+1).isWrapped;)u++;return{first:r,last:u}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let r=0;r<this.markers.length;r++)this.markers[r].line===i&&(this.markers[r].dispose(),this.markers.splice(r--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const r=new e.Marker(i);return this.markers.push(r),r.register(this.lines.onTrim(u=>{r.line-=u,r.line<0&&r.dispose()})),r.register(this.lines.onInsert(u=>{r.line>=u.index&&(r.line+=u.amount)})),r.register(this.lines.onDelete(u=>{r.line>=u.index&&r.line<u.index+u.amount&&r.dispose(),r.line>u.index&&(r.line-=u.amount)})),r.register(r.onDispose(()=>this._removeMarker(r))),r}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const h=a(3734),d=a(511),n=a(643),l=a(482);t.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let f=0;class v{constructor(e,s,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const r=s||d.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let u=0;u<e;++u)this.setCell(u,r);this.length=e}get(e){const s=this._data[3*e+0],i=2097151&s;return[this._data[3*e+1],2097152&s?this._combined[e]:i?(0,l.stringFromCodePoint)(i):"",s>>22,2097152&s?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,s){this._data[3*e+1]=s[n.CHAR_DATA_ATTR_INDEX],s[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=s[1],this._data[3*e+0]=2097152|e|s[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=s[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[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 s=this._data[3*e+0];return 2097152&s?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&s}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const s=this._data[3*e+0];return 2097152&s?this._combined[e]:2097151&s?(0,l.stringFromCodePoint)(2097151&s):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,s){return f=3*e,s.content=this._data[f+0],s.fg=this._data[f+1],s.bg=this._data[f+2],2097152&s.content&&(s.combinedData=this._combined[e]),268435456&s.bg&&(s.extended=this._extendedAttrs[e]),s}setCell(e,s){2097152&s.content&&(this._combined[e]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[e]=s.extended),this._data[3*e+0]=s.content,this._data[3*e+1]=s.fg,this._data[3*e+2]=s.bg}setCellFromCodepoint(e,s,i,r){268435456&r.bg&&(this._extendedAttrs[e]=r.extended),this._data[3*e+0]=s|i<<22,this._data[3*e+1]=r.fg,this._data[3*e+2]=r.bg}addCodepointToCell(e,s,i){let r=this._data[3*e+0];2097152&r?this._combined[e]+=(0,l.stringFromCodePoint)(s):2097151&r?(this._combined[e]=(0,l.stringFromCodePoint)(2097151&r)+(0,l.stringFromCodePoint)(s),r&=-2097152,r|=2097152):r=s|4194304,i&&(r&=-12582913,r|=i<<22),this._data[3*e+0]=r}insertCells(e,s,i){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,i),s<this.length-e){const r=new d.CellData;for(let u=this.length-e-s-1;u>=0;--u)this.setCell(e+s+u,this.loadCell(e+u,r));for(let u=0;u<s;++u)this.setCell(e+u,i)}else for(let r=e;r<this.length;++r)this.setCell(r,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(e,s,i){if(e%=this.length,s<this.length-e){const r=new d.CellData;for(let u=0;u<this.length-e-s;++u)this.setCell(e+u,this.loadCell(e+s+u,r));for(let u=this.length-s;u<this.length;++u)this.setCell(u,i)}else for(let r=e;r<this.length;++r)this.setCell(r,i);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,i),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,i)}replaceCells(e,s,i,r=!1){if(r)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,i),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,i);e<s&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,i),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,i);e<s&&e<this.length;)this.setCell(e++,i)}resize(e,s){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const r=new Uint32Array(i);r.set(this._data),this._data=r}for(let r=this.length;r<e;++r)this.setCell(r,s)}else{this._data=this._data.subarray(0,i);const r=Object.keys(this._combined);for(let p=0;p<r.length;p++){const _=parseInt(r[p],10);_>=e&&delete this._combined[_]}const u=Object.keys(this._extendedAttrs);for(let p=0;p<u.length;p++){const _=parseInt(u[p],10);_>=e&&delete this._extendedAttrs[_]}}return this.length=e,4*i*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,s=!1){if(s)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,e);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,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 s in e._combined)this._combined[s]=e._combined[s];this._extendedAttrs={};for(const s in e._extendedAttrs)this._extendedAttrs[s]=e._extendedAttrs[s];this.isWrapped=e.isWrapped}clone(){const e=new v(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const s in this._combined)e._combined[s]=this._combined[s];for(const s in this._extendedAttrs)e._extendedAttrs[s]=this._extendedAttrs[s];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,s,i,r,u){const p=e._data;if(u)for(let m=r-1;m>=0;m--){for(let c=0;c<3;c++)this._data[3*(i+m)+c]=p[3*(s+m)+c];268435456&p[3*(s+m)+2]&&(this._extendedAttrs[i+m]=e._extendedAttrs[s+m])}else for(let m=0;m<r;m++){for(let c=0;c<3;c++)this._data[3*(i+m)+c]=p[3*(s+m)+c];268435456&p[3*(s+m)+2]&&(this._extendedAttrs[i+m]=e._extendedAttrs[s+m])}const _=Object.keys(e._combined);for(let m=0;m<_.length;m++){const c=parseInt(_[m],10);c>=s&&(this._combined[c-s+i]=e._combined[c])}}translateToString(e,s,i,r){s=s??0,i=i??this.length,e&&(i=Math.min(i,this.getTrimmedLength())),r&&(r.length=0);let u="";for(;s<i;){const p=this._data[3*s+0],_=2097151&p,m=2097152&p?this._combined[s]:_?(0,l.stringFromCodePoint)(_):n.WHITESPACE_CELL_CHAR;if(u+=m,r)for(let c=0;c<m.length;++c)r.push(s);s+=p>>22||1}return r&&r.push(s),u}}t.BufferLine=v},4841:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(a,h){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 h*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(O,t)=>{function a(h,d,n){if(d===h.length-1)return h[d].getTrimmedLength();const l=!h[d].hasContent(n-1)&&h[d].getWidth(n-1)===1,f=h[d+1].getWidth(0)===2;return l&&f?n-1:n}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(h,d,n,l,f){const v=[];for(let o=0;o<h.length-1;o++){let e=o,s=h.get(++e);if(!s.isWrapped)continue;const i=[h.get(o)];for(;e<h.length&&s.isWrapped;)i.push(s),s=h.get(++e);if(l>=o&&l<e){o+=i.length-1;continue}let r=0,u=a(i,r,d),p=1,_=0;for(;p<i.length;){const c=a(i,p,d),g=c-_,S=n-u,y=Math.min(g,S);i[r].copyCellsFrom(i[p],_,u,y,!1),u+=y,u===n&&(r++,u=0),_+=y,_===c&&(p++,_=0),u===0&&r!==0&&i[r-1].getWidth(n-1)===2&&(i[r].copyCellsFrom(i[r-1],n-1,u++,1,!1),i[r-1].setCell(n-1,f))}i[r].replaceCells(u,n,f);let m=0;for(let c=i.length-1;c>0&&(c>r||i[c].getTrimmedLength()===0);c--)m++;m>0&&(v.push(o+i.length-m),v.push(m)),o+=i.length-1}return v},t.reflowLargerCreateNewLayout=function(h,d){const n=[];let l=0,f=d[l],v=0;for(let o=0;o<h.length;o++)if(f===o){const e=d[++l];h.onDeleteEmitter.fire({index:o-v,amount:e}),o+=e-1,v+=e,f=d[++l]}else n.push(o);return{layout:n,countRemoved:v}},t.reflowLargerApplyNewLayout=function(h,d){const n=[];for(let l=0;l<d.length;l++)n.push(h.get(d[l]));for(let l=0;l<n.length;l++)h.set(l,n[l]);h.length=d.length},t.reflowSmallerGetNewLineLengths=function(h,d,n){const l=[],f=h.map((s,i)=>a(h,i,d)).reduce((s,i)=>s+i);let v=0,o=0,e=0;for(;e<f;){if(f-e<n){l.push(f-e);break}v+=n;const s=a(h,o,d);v>s&&(v-=s,o++);const i=h[o].getWidth(v-1)===2;i&&v--;const r=i?n-1:n;l.push(r),e+=r}return l},t.getWrappedLineTrimmedLength=a},5295:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const h=a(8460),d=a(844),n=a(9092);class l extends d.Disposable{constructor(v,o){super(),this._optionsService=v,this._bufferService=o,this._onBufferActivate=this.register(new h.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(v){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(v),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(v,o){this._normal.resize(v,o),this._alt.resize(v,o),this.setupTabStops(v)}setupTabStops(v){this._normal.setupTabStops(v),this._alt.setupTabStops(v)}}t.BufferSet=l},511:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const h=a(482),d=a(643),n=a(3734);class l extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(v){const o=new l;return o.setFromCharData(v),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(v){this.fg=v[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(v[d.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(v[d.CHAR_DATA_CHAR_INDEX].length===2){const e=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const s=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|v[d.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[d.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=v[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=l},643:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const h=a(8460),d=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 h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}t.Marker=n,n._nextId=1},7116:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.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:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(O,t)=>{var a,h,d;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.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||(t.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="Ÿ"}(h||(t.C1=h={})),function(n){n.ST=`${a.ESC}\\`}(d||(t.C1_ESCAPED=d={}))},7399:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const h=a(2584),d={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:["'",'"']};t.evaluateKeyboardEvent=function(n,l,f,v){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=l?h.C0.ESC+"OA":h.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?o.key=l?h.C0.ESC+"OD":h.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?o.key=l?h.C0.ESC+"OC":h.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(o.key=l?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:o.key=n.ctrlKey?"\b":h.C0.DEL,n.altKey&&(o.key=h.C0.ESC+o.key);break;case 9:if(n.shiftKey){o.key=h.C0.ESC+"[Z";break}o.key=h.C0.HT,o.cancel=!0;break;case 13:o.key=n.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,o.cancel=!0;break;case 27:o.key=h.C0.ESC,n.altKey&&(o.key=h.C0.ESC+h.C0.ESC),o.cancel=!0;break;case 37:if(n.metaKey)break;e?(o.key=h.C0.ESC+"[1;"+(e+1)+"D",o.key===h.C0.ESC+"[1;3D"&&(o.key=h.C0.ESC+(f?"b":"[1;5D"))):o.key=l?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(o.key=h.C0.ESC+"[1;"+(e+1)+"C",o.key===h.C0.ESC+"[1;3C"&&(o.key=h.C0.ESC+(f?"f":"[1;5C"))):o.key=l?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(o.key=h.C0.ESC+"[1;"+(e+1)+"A",f||o.key!==h.C0.ESC+"[1;3A"||(o.key=h.C0.ESC+"[1;5A")):o.key=l?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(o.key=h.C0.ESC+"[1;"+(e+1)+"B",f||o.key!==h.C0.ESC+"[1;3B"||(o.key=h.C0.ESC+"[1;5B")):o.key=l?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(o.key=h.C0.ESC+"[2~");break;case 46:o.key=e?h.C0.ESC+"[3;"+(e+1)+"~":h.C0.ESC+"[3~";break;case 36:o.key=e?h.C0.ESC+"[1;"+(e+1)+"H":l?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:o.key=e?h.C0.ESC+"[1;"+(e+1)+"F":l?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:n.shiftKey?o.type=2:n.ctrlKey?o.key=h.C0.ESC+"[5;"+(e+1)+"~":o.key=h.C0.ESC+"[5~";break;case 34:n.shiftKey?o.type=3:n.ctrlKey?o.key=h.C0.ESC+"[6;"+(e+1)+"~":o.key=h.C0.ESC+"[6~";break;case 112:o.key=e?h.C0.ESC+"[1;"+(e+1)+"P":h.C0.ESC+"OP";break;case 113:o.key=e?h.C0.ESC+"[1;"+(e+1)+"Q":h.C0.ESC+"OQ";break;case 114:o.key=e?h.C0.ESC+"[1;"+(e+1)+"R":h.C0.ESC+"OR";break;case 115:o.key=e?h.C0.ESC+"[1;"+(e+1)+"S":h.C0.ESC+"OS";break;case 116:o.key=e?h.C0.ESC+"[15;"+(e+1)+"~":h.C0.ESC+"[15~";break;case 117:o.key=e?h.C0.ESC+"[17;"+(e+1)+"~":h.C0.ESC+"[17~";break;case 118:o.key=e?h.C0.ESC+"[18;"+(e+1)+"~":h.C0.ESC+"[18~";break;case 119:o.key=e?h.C0.ESC+"[19;"+(e+1)+"~":h.C0.ESC+"[19~";break;case 120:o.key=e?h.C0.ESC+"[20;"+(e+1)+"~":h.C0.ESC+"[20~";break;case 121:o.key=e?h.C0.ESC+"[21;"+(e+1)+"~":h.C0.ESC+"[21~";break;case 122:o.key=e?h.C0.ESC+"[23;"+(e+1)+"~":h.C0.ESC+"[23~";break;case 123:o.key=e?h.C0.ESC+"[24;"+(e+1)+"~":h.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(f&&!v||!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=h.C0.US),n.key==="@"&&(o.key=h.C0.NUL)):n.keyCode===65&&(o.type=1);else{const s=d[n.keyCode],i=s?.[n.shiftKey?1:0];if(i)o.key=h.C0.ESC+i;else if(n.keyCode>=65&&n.keyCode<=90){const r=n.ctrlKey?n.keyCode-64:n.keyCode+32;let u=String.fromCharCode(r);n.shiftKey&&(u=u.toUpperCase()),o.key=h.C0.ESC+u}else if(n.keyCode===32)o.key=h.C0.ESC+(n.ctrlKey?h.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let r=n.code.slice(3,4);n.shiftKey||(r=r.toLowerCase()),o.key=h.C0.ESC+r,o.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?o.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?o.key=h.C0.NUL:n.keyCode>=51&&n.keyCode<=55?o.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?o.key=h.C0.DEL:n.keyCode===219?o.key=h.C0.ESC:n.keyCode===220?o.key=h.C0.FS:n.keyCode===221&&(o.key=h.C0.GS)}return o}},482:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,h=0,d=a.length){let n="";for(let l=h;l<d;++l){let f=a[l];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,h){const d=a.length;if(!d)return 0;let n=0,l=0;if(this._interim){const f=a.charCodeAt(l++);56320<=f&&f<=57343?h[n++]=1024*(this._interim-55296)+f-56320+65536:(h[n++]=this._interim,h[n++]=f),this._interim=0}for(let f=l;f<d;++f){const v=a.charCodeAt(f);if(55296<=v&&v<=56319){if(++f>=d)return this._interim=v,n;const o=a.charCodeAt(f);56320<=o&&o<=57343?h[n++]=1024*(v-55296)+o-56320+65536:(h[n++]=v,h[n++]=o)}else v!==65279&&(h[n++]=v)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,h){const d=a.length;if(!d)return 0;let n,l,f,v,o=0,e=0,s=0;if(this.interim[0]){let u=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let _,m=0;for(;(_=63&this.interim[++m])&&m<4;)p<<=6,p|=_;const c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,g=c-m;for(;s<g;){if(s>=d)return 0;if(_=a[s++],(192&_)!=128){s--,u=!0;break}this.interim[m++]=_,p<<=6,p|=63&_}u||(c===2?p<128?s--:h[o++]=p:c===3?p<2048||p>=55296&&p<=57343||p===65279||(h[o++]=p):p<65536||p>1114111||(h[o++]=p)),this.interim.fill(0)}const i=d-4;let r=s;for(;r<d;){for(;!(!(r<i)||128&(n=a[r])||128&(l=a[r+1])||128&(f=a[r+2])||128&(v=a[r+3]));)h[o++]=n,h[o++]=l,h[o++]=f,h[o++]=v,r+=4;if(n=a[r++],n<128)h[o++]=n;else if((224&n)==192){if(r>=d)return this.interim[0]=n,o;if(l=a[r++],(192&l)!=128){r--;continue}if(e=(31&n)<<6|63&l,e<128){r--;continue}h[o++]=e}else if((240&n)==224){if(r>=d)return this.interim[0]=n,o;if(l=a[r++],(192&l)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=l,o;if(f=a[r++],(192&f)!=128){r--;continue}if(e=(15&n)<<12|(63&l)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;h[o++]=e}else if((248&n)==240){if(r>=d)return this.interim[0]=n,o;if(l=a[r++],(192&l)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=l,o;if(f=a[r++],(192&f)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=l,this.interim[2]=f,o;if(v=a[r++],(192&v)!=128){r--;continue}if(e=(7&n)<<18|(63&l)<<12|(63&f)<<6|63&v,e<65536||e>1114111)continue;h[o++]=e}}return o}}},225:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const h=a(1480),d=[[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 l;t.UnicodeV6=class{constructor(){if(this.version="6",!l){l=new Uint8Array(65536),l.fill(1),l[0]=0,l.fill(0,1,32),l.fill(0,127,160),l.fill(2,4352,4448),l[9001]=2,l[9002]=2,l.fill(2,11904,42192),l[12351]=1,l.fill(2,44032,55204),l.fill(2,63744,64256),l.fill(2,65040,65050),l.fill(2,65072,65136),l.fill(2,65280,65377),l.fill(2,65504,65511);for(let f=0;f<d.length;++f)l.fill(0,d[f][0],d[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?l[f]:function(v,o){let e,s=0,i=o.length-1;if(v<o[0][0]||v>o[i][1])return!1;for(;i>=s;)if(e=s+i>>1,v>o[e][1])s=e+1;else{if(!(v<o[e][0]))return!0;i=e-1}return!1}(f,n)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,v){let o=this.wcwidth(f),e=o===0&&v!==0;if(e){const s=h.UnicodeService.extractWidth(v);s===0?e=!1:s>o&&(o=s)}return h.UnicodeService.createPropertyValue(0,o,e)}}},5981:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const h=a(8460),d=a(844);class n extends d.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 h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,v){if(v!==void 0&&this._syncCalls>v)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,v){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(v),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(v)}_innerWrite(f=0,v=!0){const o=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,v);if(s){const r=u=>Date.now()-o>=12?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(o,u);return void s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(r)}const i=this._callbacks[this._bufferOffset];if(i&&i(),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()}}t.WriteBuffer=n},5941:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.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})$/,h=/^[\da-f]+$/;function d(n,l){const f=n.toString(16),v=f.length<2?"0"+f:f;switch(l){case 4:return f[0];case 8:return v;case 12:return(v+v).slice(0,3);default:return v+v}}t.parseColor=function(n){if(!n)return;let l=n.toLowerCase();if(l.indexOf("rgb:")===0){l=l.slice(4);const f=a.exec(l);if(f){const v=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/v*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/v*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/v*255)]}}else if(l.indexOf("#")===0&&(l=l.slice(1),h.exec(l)&&[3,6,9,12].includes(l.length))){const f=l.length/3,v=[0,0,0];for(let o=0;o<3;++o){const e=parseInt(l.slice(f*o,f*o+f),16);v[o]=f===1?e<<4:f===2?e:f===3?e>>4:e>>8}return v}},t.toRgbString=function(n,l=16){const[f,v,o]=n;return`rgb:${d(f,l)}/${d(v,l)}/${d(o,l)}`}},5770:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const h=a(482),d=a(8742),n=a(5770),l=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=l,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}registerHandler(v,o){this._handlers[v]===void 0&&(this._handlers[v]=[]);const e=this._handlers[v];return e.push(o),{dispose:()=>{const s=e.indexOf(o);s!==-1&&e.splice(s,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}reset(){if(this._active.length)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].unhook(!1);this._stack.paused=!1,this._active=l,this._ident=0}hook(v,o){if(this.reset(),this._ident=v,this._active=this._handlers[v]||l,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(v,o,e){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(v,o,e);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(v,o,e))}unhook(v,o=!0){if(this._active.length){let e=!1,s=this._active.length-1,i=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,e=o,i=this._stack.fallThrough,this._stack.paused=!1),!i&&e===!1){for(;s>=0&&(e=this._active[s].unhook(v),e!==!0);s--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,e;s--}for(;s>=0;s--)if(e=this._active[s].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",v);this._active=l,this._ident=0}};const f=new d.Params;f.addParam(0),t.DcsHandler=class{constructor(v){this._handler=v,this._data="",this._params=f,this._hitLimit=!1}hook(v){this._params=v.length>1||v.params[0]?v.clone():f,this._data="",this._hitLimit=!1}put(v,o,e){this._hitLimit||(this._data+=(0,h.utf32ToString)(v,o,e),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(v){let o=!1;if(this._hitLimit)o=!1;else if(v&&(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:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const h=a(844),d=a(8742),n=a(6242),l=a(6351);class f{constructor(s){this.table=new Uint8Array(s)}setDefault(s,i){this.table.fill(s<<4|i)}add(s,i,r,u){this.table[i<<8|s]=r<<4|u}addMany(s,i,r,u){for(let p=0;p<s.length;p++)this.table[i<<8|s[p]]=r<<4|u}}t.TransitionTable=f;const v=160;t.VT500_TRANSITION_TABLE=function(){const e=new f(4095),s=Array.apply(null,Array(256)).map((m,c)=>c),i=(m,c)=>s.slice(m,c),r=i(32,127),u=i(0,24);u.push(25),u.push.apply(u,i(28,32));const p=i(0,14);let _;for(_ in e.setDefault(1,0),e.addMany(r,0,2,0),p)e.addMany([24,26,153,154],_,3,0),e.addMany(i(128,144),_,3,0),e.addMany(i(144,152),_,3,0),e.add(156,_,0,0),e.add(27,_,11,1),e.add(157,_,4,8),e.addMany([152,158,159],_,0,7),e.add(155,_,11,3),e.add(144,_,11,9);return e.addMany(u,0,3,0),e.addMany(u,1,3,1),e.add(127,1,0,1),e.addMany(u,8,0,8),e.addMany(u,3,3,3),e.add(127,3,0,3),e.addMany(u,4,3,4),e.add(127,4,0,4),e.addMany(u,6,3,6),e.addMany(u,5,3,5),e.add(127,5,0,5),e.addMany(u,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(u,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(u,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(u,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(u,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(u,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(u,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(v,0,2,0),e.add(v,8,5,8),e.add(v,6,0,6),e.add(v,11,0,11),e.add(v,13,13,13),e}();class o extends h.Disposable{constructor(s=t.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,r,u)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,r)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.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 l.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(s,i=[64,126]){let r=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=s.prefix.charCodeAt(0),r&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let p=0;p<s.intermediates.length;++p){const _=s.intermediates.charCodeAt(p);if(32>_||_>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=_}}if(s.final.length!==1)throw new Error("final must be a single byte");const u=s.final.charCodeAt(0);if(i[0]>u||u>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return r<<=8,r|=u,r}identToString(s){const i=[];for(;s;)i.push(String.fromCharCode(255&s)),s>>=8;return i.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,i){const r=this._identifier(s,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);const u=this._escHandlers[r];return u.push(i),{dispose:()=>{const p=u.indexOf(i);p!==-1&&u.splice(p,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,i){this._executeHandlers[s.charCodeAt(0)]=i}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,i){const r=this._identifier(s);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);const u=this._csiHandlers[r];return u.push(i),{dispose:()=>{const p=u.indexOf(i);p!==-1&&u.splice(p,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,i){return this._dcsParser.registerHandler(this._identifier(s),i)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,i){return this._oscParser.registerHandler(s,i)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(s,i,r,u,p){this._parseStack.state=s,this._parseStack.handlers=i,this._parseStack.handlerPos=r,this._parseStack.transition=u,this._parseStack.chunkPos=p}parse(s,i,r){let u,p=0,_=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const c=this._parseStack.handlers;let g=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&g>-1){for(;g>=0&&(u=c[g](this._params),u!==!0);g--)if(u instanceof Promise)return this._parseStack.handlerPos=g,u}this._parseStack.handlers=[];break;case 4:if(r===!1&&g>-1){for(;g>=0&&(u=c[g](),u!==!0);g--)if(u instanceof Promise)return this._parseStack.handlerPos=g,u}this._parseStack.handlers=[];break;case 6:if(p=s[this._parseStack.chunkPos],u=this._dcsParser.unhook(p!==24&&p!==26,r),u)return u;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(p=s[this._parseStack.chunkPos],u=this._oscParser.end(p!==24&&p!==26,r),u)return u;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let c=m;c<i;++c){switch(p=s[c],_=this._transitions.table[this.currentState<<8|(p<160?p:v)],_>>4){case 2:for(let w=c+1;;++w){if(w>=i||(p=s[w])<32||p>126&&p<v){this._printHandler(s,c,w),c=w-1;break}if(++w>=i||(p=s[w])<32||p>126&&p<v){this._printHandler(s,c,w),c=w-1;break}if(++w>=i||(p=s[w])<32||p>126&&p<v){this._printHandler(s,c,w),c=w-1;break}if(++w>=i||(p=s[w])<32||p>126&&p<v){this._printHandler(s,c,w),c=w-1;break}}break;case 3:this._executeHandlers[p]?this._executeHandlers[p]():this._executeHandlerFb(p),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:c,code:p,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const g=this._csiHandlers[this._collect<<8|p];let S=g?g.length-1:-1;for(;S>=0&&(u=g[S](this._params),u!==!0);S--)if(u instanceof Promise)return this._preserveStack(3,g,S,_,c),u;S<0&&this._csiHandlerFb(this._collect<<8|p,this._params),this.precedingJoinState=0;break;case 8:do switch(p){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(p-48)}while(++c<i&&(p=s[c])>47&&p<60);c--;break;case 9:this._collect<<=8,this._collect|=p;break;case 10:const y=this._escHandlers[this._collect<<8|p];let b=y?y.length-1:-1;for(;b>=0&&(u=y[b](),u!==!0);b--)if(u instanceof Promise)return this._preserveStack(4,y,b,_,c),u;b<0&&this._escHandlerFb(this._collect<<8|p),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|p,this._params);break;case 13:for(let w=c+1;;++w)if(w>=i||(p=s[w])===24||p===26||p===27||p>127&&p<v){this._dcsParser.put(s,c,w),c=w-1;break}break;case 14:if(u=this._dcsParser.unhook(p!==24&&p!==26),u)return this._preserveStack(6,[],0,_,c),u;p===27&&(_|=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=c+1;;w++)if(w>=i||(p=s[w])<32||p>127&&p<v){this._oscParser.put(s,c,w),c=w-1;break}break;case 6:if(u=this._oscParser.end(p!==24&&p!==26),u)return this._preserveStack(5,[],0,_,c),u;p===27&&(_|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&_}}}t.EscapeSequenceParser=o},6242:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const h=a(5770),d=a(482),n=[];t.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(l,f){this._handlers[l]===void 0&&(this._handlers[l]=[]);const v=this._handlers[l];return v.push(f),{dispose:()=>{const o=v.indexOf(f);o!==-1&&v.splice(o,1)}}}clearHandler(l){this._handlers[l]&&delete this._handlers[l]}setHandlerFallback(l){this._handlerFb=l}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let l=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;l>=0;--l)this._active[l].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 l=this._active.length-1;l>=0;l--)this._active[l].start();else this._handlerFb(this._id,"START")}_put(l,f,v){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(l,f,v);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(l,f,v))}start(){this.reset(),this._state=1}put(l,f,v){if(this._state!==3){if(this._state===1)for(;f<v;){const o=l[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&&v-f>0&&this._put(l,f,v)}}end(l,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let v=!1,o=this._active.length-1,e=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,v=f,e=this._stack.fallThrough,this._stack.paused=!1),!e&&v===!1){for(;o>=0&&(v=this._active[o].end(l),v!==!0);o--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,v;o--}for(;o>=0;o--)if(v=this._active[o].end(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,v}else this._handlerFb(this._id,"END",l);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(l){this._handler=l,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(l,f,v){this._hitLimit||(this._data+=(0,d.utf32ToString)(l,f,v),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(l){let f=!1;if(this._hitLimit)f=!1;else if(l&&(f=this._handler(this._data),f instanceof Promise))return f.then(v=>(this._data="",this._hitLimit=!1,v));return this._data="",this._hitLimit=!1,f}}},8742:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const a=2147483647;class h{static fromArray(n){const l=new h;if(!n.length)return l;for(let f=Array.isArray(n[0])?1:0;f<n.length;++f){const v=n[f];if(Array.isArray(v))for(let o=0;o<v.length;++o)l.addSubParam(v[o]);else l.addParam(v)}return l}constructor(n=32,l=32){if(this.maxLength=n,this.maxSubParamsLength=l,l>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(l),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new h(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 l=0;l<this.length;++l){n.push(this.params[l]);const f=this._subParamsIdx[l]>>8,v=255&this._subParamsIdx[l];v-f>0&&n.push(Array.prototype.slice.call(this._subParams,f,v))}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 l=this._subParamsIdx[n]>>8,f=255&this._subParamsIdx[n];return f-l>0?this._subParams.subarray(l,f):null}getSubParamsAll(){const n={};for(let l=0;l<this.length;++l){const f=this._subParamsIdx[l]>>8,v=255&this._subParamsIdx[l];v-f>0&&(n[l]=this._subParams.slice(f,v))}return n}addDigit(n){let l;if(this._rejectDigits||!(l=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,v=f[l-1];f[l-1]=~v?Math.min(10*v+n,a):n}}t.Params=h},5741:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,h){const d={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(d),h.dispose=()=>this._wrappedAddonDispose(d),h.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let h=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===a){h=d;break}if(h===-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(h,1)}}},8771:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const h=a(3785),d=a(511);t.BufferApiView=class{constructor(n,l){this._buffer=n,this.type=l}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 l=this._buffer.lines.get(n);if(l)return new h.BufferLineApiView(l)}getNullCell(){return new d.CellData}}},3785:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const h=a(511);t.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,n){if(!(d<0||d>=this._line.length))return n?(this._line.loadCell(d,n),n):this._line.loadCell(d,new h.CellData)}translateToString(d,n,l){return this._line.translateToString(d,n,l)}}},8285:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const h=a(8771),d=a(8460),n=a(844);class l extends n.Disposable{constructor(v){super(),this._core=v,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}t.BufferNamespaceApi=l},7975:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,h){return this._core.registerCsiHandler(a,d=>h(d.toArray()))}addCsiHandler(a,h){return this.registerCsiHandler(a,h)}registerDcsHandler(a,h){return this._core.registerDcsHandler(a,(d,n)=>h(d,n.toArray()))}addDcsHandler(a,h){return this.registerDcsHandler(a,h)}registerEscHandler(a,h){return this._core.registerEscHandler(a,h)}addEscHandler(a,h){return this.registerEscHandler(a,h)}registerOscHandler(a,h){return this._core.registerOscHandler(a,h)}addOscHandler(a,h){return this.registerOscHandler(a,h)}}},7090:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.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(O,t,a){var h=this&&this.__decorate||function(e,s,i,r){var u,p=arguments.length,_=p<3?s:r===null?r=Object.getOwnPropertyDescriptor(s,i):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(e,s,i,r);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(_=(p<3?u(_):p>3?u(s,i,_):u(s,i))||_);return p>3&&_&&Object.defineProperty(s,i,_),_},d=this&&this.__param||function(e,s){return function(i,r){s(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=a(8460),l=a(844),f=a(5295),v=a(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let o=t.BufferService=class extends l.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,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(e,this))}resize(e,s){this.cols=e,this.rows=s,this.buffers.resize(e,s),this._onResize.fire({cols:e,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,s=!1){const i=this.buffer;let r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=i.getBlankLine(e,s),this._cachedBlankLine=r),r.isWrapped=s;const u=i.ybase+i.scrollTop,p=i.ybase+i.scrollBottom;if(i.scrollTop===0){const _=i.lines.isFull;p===i.lines.length-1?_?i.lines.recycle().copyFrom(r):i.lines.push(r.clone()):i.lines.splice(p+1,0,r.clone()),_?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const _=p-u+1;i.lines.shiftElements(u+1,_-1,-1),i.lines.set(p,r.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,s,i){const r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);const u=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),u!==r.ydisp&&(s||this._onScroll.fire(r.ydisp))}};t.BufferService=o=h([d(0,v.IOptionsService)],o)},7994:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.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,h){this._charsets[a]=h,this.glevel===a&&(this.charset=h)}}},1753:function(O,t,a){var h=this&&this.__decorate||function(r,u,p,_){var m,c=arguments.length,g=c<3?u:_===null?_=Object.getOwnPropertyDescriptor(u,p):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,u,p,_);else for(var S=r.length-1;S>=0;S--)(m=r[S])&&(g=(c<3?m(g):c>3?m(u,p,g):m(u,p))||g);return c>3&&g&&Object.defineProperty(u,p,g),g},d=this&&this.__param||function(r,u){return function(p,_){u(p,_,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=a(2585),l=a(8460),f=a(844),v={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:r=>r.button!==4&&r.action===1&&(r.ctrl=!1,r.alt=!1,r.shift=!1,!0)},VT200:{events:19,restrict:r=>r.action!==32},DRAG:{events:23,restrict:r=>r.action!==32||r.button!==3},ANY:{events:31,restrict:r=>!0}};function o(r,u){let p=(r.ctrl?16:0)|(r.shift?4:0)|(r.alt?8:0);return r.button===4?(p|=64,p|=r.action):(p|=3&r.button,4&r.button&&(p|=64),8&r.button&&(p|=128),r.action===32?p|=32:r.action!==0||u||(p|=3)),p}const e=String.fromCharCode,s={DEFAULT:r=>{const u=[o(r,!1)+32,r.col+32,r.row+32];return u[0]>255||u[1]>255||u[2]>255?"":`\x1B[M${e(u[0])}${e(u[1])}${e(u[2])}`},SGR:r=>{const u=r.action===0&&r.button!==4?"m":"M";return`\x1B[<${o(r,!0)};${r.col};${r.row}${u}`},SGR_PIXELS:r=>{const u=r.action===0&&r.button!==4?"m":"M";return`\x1B[<${o(r,!0)};${r.x};${r.y}${u}`}};let i=t.CoreMouseService=class extends f.Disposable{constructor(r,u){super(),this._bufferService=r,this._coreService=u,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new l.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const p of Object.keys(v))this.addProtocol(p,v[p]);for(const p of Object.keys(s))this.addEncoding(p,s[p]);this.reset()}addProtocol(r,u){this._protocols[r]=u}addEncoding(r,u){this._encodings[r]=u}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(r){if(!this._protocols[r])throw new Error(`unknown protocol "${r}"`);this._activeProtocol=r,this._onProtocolChange.fire(this._protocols[r].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(r){if(!this._encodings[r])throw new Error(`unknown encoding "${r}"`);this._activeEncoding=r}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(r){if(r.col<0||r.col>=this._bufferService.cols||r.row<0||r.row>=this._bufferService.rows||r.button===4&&r.action===32||r.button===3&&r.action!==32||r.button!==4&&(r.action===2||r.action===3)||(r.col++,r.row++,r.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,r,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(r))return!1;const u=this._encodings[this._activeEncoding](r);return u&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(u):this._coreService.triggerDataEvent(u,!0)),this._lastEvent=r,!0}explainEvents(r){return{down:!!(1&r),up:!!(2&r),drag:!!(4&r),move:!!(8&r),wheel:!!(16&r)}}_equalEvents(r,u,p){if(p){if(r.x!==u.x||r.y!==u.y)return!1}else if(r.col!==u.col||r.row!==u.row)return!1;return r.button===u.button&&r.action===u.action&&r.ctrl===u.ctrl&&r.alt===u.alt&&r.shift===u.shift}};t.CoreMouseService=i=h([d(0,n.IBufferService),d(1,n.ICoreService)],i)},6975:function(O,t,a){var h=this&&this.__decorate||function(i,r,u,p){var _,m=arguments.length,c=m<3?r:p===null?p=Object.getOwnPropertyDescriptor(r,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(i,r,u,p);else for(var g=i.length-1;g>=0;g--)(_=i[g])&&(c=(m<3?_(c):m>3?_(r,u,c):_(r,u))||c);return m>3&&c&&Object.defineProperty(r,u,c),c},d=this&&this.__param||function(i,r){return function(u,p){r(u,p,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=a(1439),l=a(8460),f=a(844),v=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 s=t.CoreService=class extends f.Disposable{constructor(i,r,u){super(),this._bufferService=i,this._logService=r,this._optionsService=u,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new l.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new l.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(i,r=!1){if(this._optionsService.rawOptions.disableStdin)return;const u=this._bufferService.buffer;r&&this._optionsService.rawOptions.scrollOnUserInput&&u.ybase!==u.ydisp&&this._onRequestScrollToBottom.fire(),r&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(p=>p.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(r=>r.charCodeAt(0))),this._onBinary.fire(i))}};t.CoreService=s=h([d(0,v.IBufferService),d(1,v.ILogService),d(2,v.IOptionsService)],s)},9074:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const h=a(8055),d=a(8460),n=a(844),l=a(6106);let f=0,v=0;class o extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new l.SortedList(i=>i?.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)(()=>this.reset()))}registerDecoration(i){if(i.marker.isDisposed)return;const r=new e(i);if(r){const u=r.marker.onDispose(()=>r.dispose());r.onDispose(()=>{r&&(this._decorations.delete(r)&&this._onDecorationRemoved.fire(r),u.dispose())}),this._decorations.insert(r),this._onDecorationRegistered.fire(r)}return r}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,r,u){let p=0,_=0;for(const m of this._decorations.getKeyIterator(r))p=m.options.x??0,_=p+(m.options.width??1),i>=p&&i<_&&(!u||(m.options.layer??"bottom")===u)&&(yield m)}forEachDecorationAtCell(i,r,u,p){this._decorations.forEachByKey(r,_=>{f=_.options.x??0,v=f+(_.options.width??1),i>=f&&i<v&&(!u||(_.options.layer??"bottom")===u)&&p(_)})}}t.DecorationService=o;class e extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const h=a(2585),d=a(8343);class n{constructor(...f){this._entries=new Map;for(const[v,o]of f)this.set(v,o)}set(f,v){const o=this._entries.get(f);return this._entries.set(f,v),o}forEach(f){for(const[v,o]of this._entries.entries())f(v,o)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(h.IInstantiationService,this)}setService(l,f){this._services.set(l,f)}getService(l){return this._services.get(l)}createInstance(l,...f){const v=(0,d.getServiceDependencies)(l).sort((s,i)=>s.index-i.index),o=[];for(const s of v){const i=this._services.get(s.id);if(!i)throw new Error(`[createInstance] ${l.name} depends on UNKNOWN service ${s.id}.`);o.push(i)}const e=v.length>0?v[0].index:f.length;if(f.length!==e)throw new Error(`[createInstance] First service dependency of ${l.name} at position ${e+1} conflicts with ${f.length} static arguments`);return new l(...f,...o)}}},7866:function(O,t,a){var h=this&&this.__decorate||function(e,s,i,r){var u,p=arguments.length,_=p<3?s:r===null?r=Object.getOwnPropertyDescriptor(s,i):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(e,s,i,r);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(_=(p<3?u(_):p>3?u(s,i,_):u(s,i))||_);return p>3&&_&&Object.defineProperty(s,i,_),_},d=this&&this.__param||function(e,s){return function(i,r){s(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(844),l=a(2585),f={trace:l.LogLevelEnum.TRACE,debug:l.LogLevelEnum.DEBUG,info:l.LogLevelEnum.INFO,warn:l.LogLevelEnum.WARN,error:l.LogLevelEnum.ERROR,off:l.LogLevelEnum.OFF};let v,o=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=l.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),v=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let s=0;s<e.length;s++)typeof e[s]=="function"&&(e[s]=e[s]())}_log(e,s,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...i)}trace(e,...s){this._logLevel<=l.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,s)}debug(e,...s){this._logLevel<=l.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,s)}info(e,...s){this._logLevel<=l.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,s)}warn(e,...s){this._logLevel<=l.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,s)}error(e,...s){this._logLevel<=l.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,s)}};t.LogService=o=h([d(0,l.IOptionsService)],o),t.setTraceLogger=function(e){v=e},t.traceCall=function(e,s,i){if(typeof i.value!="function")throw new Error("not supported");const r=i.value;i.value=function(...u){if(v.logLevel!==l.LogLevelEnum.TRACE)return r.apply(this,u);v.trace(`GlyphRenderer#${r.name}(${u.map(_=>JSON.stringify(_)).join(", ")})`);const p=r.apply(this,u);return v.trace(`GlyphRenderer#${r.name} return`,p),p}}},7302:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const h=a(8460),d=a(844),n=a(6114);t.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 l=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends d.Disposable{constructor(o){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e={...t.DEFAULT_OPTIONS};for(const s in o)if(s in e)try{const i=o[s];e[s]=this._sanitizeAndValidateOption(s,i)}catch(i){console.error(i)}this.rawOptions=e,this.options={...e},this._setupOptions(),this.register((0,d.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(o,e){return this.onOptionChange(s=>{s===o&&e(this.rawOptions[o])})}onMultipleOptionChange(o,e){return this.onOptionChange(s=>{o.indexOf(s)!==-1&&e()})}_setupOptions(){const o=s=>{if(!(s in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},e=(s,i)=>{if(!(s in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);i=this._sanitizeAndValidateOption(s,i),this.rawOptions[s]!==i&&(this.rawOptions[s]=i,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const i={get:o.bind(this,s),set:e.bind(this,s)};Object.defineProperty(this.options,s,i)}}_sanitizeAndValidateOption(o,e){switch(o){case"cursorStyle":if(e||(e=t.DEFAULT_OPTIONS[o]),!function(s){return s==="block"||s==="underline"||s==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${o}`);break;case"wordSeparator":e||(e=t.DEFAULT_OPTIONS[o]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=l.includes(e)?e:t.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}}t.OptionsService=f},2660:function(O,t,a){var h=this&&this.__decorate||function(f,v,o,e){var s,i=arguments.length,r=i<3?v:e===null?e=Object.getOwnPropertyDescriptor(v,o):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(f,v,o,e);else for(var u=f.length-1;u>=0;u--)(s=f[u])&&(r=(i<3?s(r):i>3?s(v,o,r):s(v,o))||r);return i>3&&r&&Object.defineProperty(v,o,r),r},d=this&&this.__param||function(f,v){return function(o,e){v(o,e,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=a(2585);let l=t.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const v=this._bufferService.buffer;if(f.id===void 0){const u=v.addMarker(v.ybase+v.y),p={data:f,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(p,u)),this._dataByLinkId.set(p.id,p),p.id}const o=f,e=this._getEntryIdKey(o),s=this._entriesWithId.get(e);if(s)return this.addLineToLink(s.id,v.ybase+v.y),s.id;const i=v.addMarker(v.ybase+v.y),r={id:this._nextId++,key:this._getEntryIdKey(o),data:o,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(r,i)),this._entriesWithId.set(r.key,r),this._dataByLinkId.set(r.id,r),r.id}addLineToLink(f,v){const o=this._dataByLinkId.get(f);if(o&&o.lines.every(e=>e.line!==v)){const e=this._bufferService.buffer.addMarker(v);o.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(o,e))}}getLinkData(f){return this._dataByLinkId.get(f)?.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,v){const o=f.lines.indexOf(v);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)))}};t.OscLinkService=l=h([d(0,n.IBufferService)],l)},8343:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",h="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(d){return d[h]||[]},t.createDecorator=function(d){if(t.serviceRegistry.has(d))return t.serviceRegistry.get(d);const n=function(l,f,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,e,s){e[a]===e?e[h].push({id:o,index:s}):(e[h]=[{id:o,index:s}],e[a]=e)})(n,l,v)};return n.toString=()=>d,t.serviceRegistry.set(d,n),n}},2585:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const h=a(8343);var d;t.IBufferService=(0,h.createDecorator)("BufferService"),t.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),t.ICoreService=(0,h.createDecorator)("CoreService"),t.ICharsetService=(0,h.createDecorator)("CharsetService"),t.IInstantiationService=(0,h.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"}(d||(t.LogLevelEnum=d={})),t.ILogService=(0,h.createDecorator)("LogService"),t.IOptionsService=(0,h.createDecorator)("OptionsService"),t.IOscLinkService=(0,h.createDecorator)("OscLinkService"),t.IUnicodeService=(0,h.createDecorator)("UnicodeService"),t.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const h=a(8460),d=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,v,o=!1){return(16777215&f)<<3|(3&v)<<1|(o?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const f=new d.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 v=0,o=0;const e=f.length;for(let s=0;s<e;++s){let i=f.charCodeAt(s);if(55296<=i&&i<=56319){if(++s>=e)return v+this.wcwidth(i);const p=f.charCodeAt(s);56320<=p&&p<=57343?i=1024*(i-55296)+p-56320+65536:v+=this.wcwidth(p)}const r=this.charProperties(i,o);let u=n.extractWidth(r);n.extractShouldJoin(r)&&(u-=n.extractWidth(o)),v+=u,o=r}return v}charProperties(f,v){return this._activeProvider.charProperties(f,v)}}t.UnicodeService=n}},re={};function Z(O){var t=re[O];if(t!==void 0)return t.exports;var a=re[O]={exports:{}};return he[O].call(a.exports,a,a.exports,Z),a.exports}var oe={};return(()=>{var O=oe;Object.defineProperty(O,"__esModule",{value:!0}),O.Terminal=void 0;const t=Z(9042),a=Z(3236),h=Z(844),d=Z(5741),n=Z(8285),l=Z(7975),f=Z(7090),v=["cols","rows"];class o extends h.Disposable{constructor(s){super(),this._core=this.register(new a.Terminal(s)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const i=u=>this._core.options[u],r=(u,p)=>{this._checkReadonlyOptions(u),this._core.options[u]=p};for(const u in this._core.options){const p={get:i.bind(this,u),set:r.bind(this,u)};Object.defineProperty(this._publicOptions,u,p)}}_checkReadonlyOptions(s){if(v.includes(s))throw new Error(`Option "${s}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new l.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 s=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const i in s)this._publicOptions[i]=s[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,i=!0){this._core.input(s,i)}resize(s,i){this._verifyIntegers(s,i),this._core.resize(s,i)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,i,r){this._verifyIntegers(s,i,r),this._core.select(s,i,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,i){this._verifyIntegers(s,i),this._core.selectLines(s,i)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,i){this._core.write(s,i)}writeln(s,i){this._core.write(s),this._core.write(`\r
9
+ `,i)}paste(s){this._core.paste(s)}refresh(s,i){this._verifyIntegers(s,i),this._core.refresh(s,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return t}_verifyIntegers(...s){for(const i of s)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const i of s)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}O.Terminal=o})(),oe})())}(Ce)),Ce.exports}var be={exports:{}},De;function Ie(){return De||(De=1,function(ue,me){(function(he,re){ue.exports=re()})(self,()=>(()=>{var he={};return(()=>{var re=he;Object.defineProperty(re,"__esModule",{value:!0}),re.FitAddon=void 0,re.FitAddon=class{activate(Z){this._terminal=Z}dispose(){}fit(){const Z=this.proposeDimensions();if(!Z||!this._terminal||isNaN(Z.cols)||isNaN(Z.rows))return;const oe=this._terminal._core;this._terminal.rows===Z.rows&&this._terminal.cols===Z.cols||(oe._renderService.clear(),this._terminal.resize(Z.cols,Z.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const Z=this._terminal._core,oe=Z._renderService.dimensions;if(oe.css.cell.width===0||oe.css.cell.height===0)return;const O=this._terminal.options.scrollback===0?0:Z.viewport.scrollBarWidth,t=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(t.getPropertyValue("height")),h=Math.max(0,parseInt(t.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),n=a-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),l=h-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-O;return{cols:Math.max(2,Math.floor(l/oe.css.cell.width)),rows:Math.max(1,Math.floor(n/oe.css.cell.height))}}}})(),he})())}(be)),be.exports}var we={exports:{}},Ae;function Fe(){return Ae||(Ae=1,function(ue,me){(function(he,re){ue.exports=re()})(self,()=>(()=>{var he={575:function(O,t,a){typeof self<"u"||typeof window<"u"||a.g!==void 0&&a.g,O.exports=function(){var h,d="3.7.7",n=d,l=typeof Buffer=="function",f=typeof TextDecoder=="function"?new TextDecoder:void 0,v=typeof TextEncoder=="function"?new TextEncoder:void 0,o=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),e=(h={},o.forEach(function(A,F){return h[A]=F}),h),s=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,i=String.fromCharCode.bind(String),r=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(A){return new Uint8Array(Array.prototype.slice.call(A,0))},u=function(A){return A.replace(/=/g,"").replace(/[+\/]/g,function(F){return F=="+"?"-":"_"})},p=function(A){return A.replace(/[^A-Za-z0-9\+\/]/g,"")},_=function(A){for(var F,$,G,j,K="",ie=A.length%3,q=0;q<A.length;){if(($=A.charCodeAt(q++))>255||(G=A.charCodeAt(q++))>255||(j=A.charCodeAt(q++))>255)throw new TypeError("invalid character found");K+=o[(F=$<<16|G<<8|j)>>18&63]+o[F>>12&63]+o[F>>6&63]+o[63&F]}return ie?K.slice(0,ie-3)+"===".substring(ie):K},m=typeof btoa=="function"?function(A){return btoa(A)}:l?function(A){return Buffer.from(A,"binary").toString("base64")}:_,c=l?function(A){return Buffer.from(A).toString("base64")}:function(A){for(var F=[],$=0,G=A.length;$<G;$+=4096)F.push(i.apply(null,A.subarray($,$+4096)));return m(F.join(""))},g=function(A,F){return F===void 0&&(F=!1),F?u(c(A)):c(A)},S=function(A){if(A.length<2)return(F=A.charCodeAt(0))<128?A:F<2048?i(192|F>>>6)+i(128|63&F):i(224|F>>>12&15)+i(128|F>>>6&63)+i(128|63&F);var F=65536+1024*(A.charCodeAt(0)-55296)+(A.charCodeAt(1)-56320);return i(240|F>>>18&7)+i(128|F>>>12&63)+i(128|F>>>6&63)+i(128|63&F)},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=function(A){return A.replace(y,S)},w=l?function(A){return Buffer.from(A,"utf8").toString("base64")}:v?function(A){return c(v.encode(A))}:function(A){return m(b(A))},x=function(A,F){return F===void 0&&(F=!1),F?u(w(A)):w(A)},T=function(A){return x(A,!0)},P=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,B=function(A){switch(A.length){case 4:var F=((7&A.charCodeAt(0))<<18|(63&A.charCodeAt(1))<<12|(63&A.charCodeAt(2))<<6|63&A.charCodeAt(3))-65536;return i(55296+(F>>>10))+i(56320+(1023&F));case 3:return i((15&A.charCodeAt(0))<<12|(63&A.charCodeAt(1))<<6|63&A.charCodeAt(2));default:return i((31&A.charCodeAt(0))<<6|63&A.charCodeAt(1))}},k=function(A){return A.replace(P,B)},C=function(A){if(A=A.replace(/\s+/g,""),!s.test(A))throw new TypeError("malformed base64.");A+="==".slice(2-(3&A.length));for(var F,$,G,j="",K=0;K<A.length;)F=e[A.charAt(K++)]<<18|e[A.charAt(K++)]<<12|($=e[A.charAt(K++)])<<6|(G=e[A.charAt(K++)]),j+=$===64?i(F>>16&255):G===64?i(F>>16&255,F>>8&255):i(F>>16&255,F>>8&255,255&F);return j},L=typeof atob=="function"?function(A){return atob(p(A))}:l?function(A){return Buffer.from(A,"base64").toString("binary")}:C,R=l?function(A){return r(Buffer.from(A,"base64"))}:function(A){return r(L(A).split("").map(function(F){return F.charCodeAt(0)}))},D=function(A){return R(W(A))},H=l?function(A){return Buffer.from(A,"base64").toString("utf8")}:f?function(A){return f.decode(R(A))}:function(A){return k(L(A))},W=function(A){return p(A.replace(/[-_]/g,function(F){return F=="-"?"+":"/"}))},N=function(A){return H(W(A))},U=function(A){return{value:A,enumerable:!1,writable:!0,configurable:!0}},M=function(){var A=function(F,$){return Object.defineProperty(String.prototype,F,U($))};A("fromBase64",function(){return N(this)}),A("toBase64",function(F){return x(this,F)}),A("toBase64URI",function(){return x(this,!0)}),A("toBase64URL",function(){return x(this,!0)}),A("toUint8Array",function(){return D(this)})},E=function(){var A=function(F,$){return Object.defineProperty(Uint8Array.prototype,F,U($))};A("toBase64",function(F){return g(this,F)}),A("toBase64URI",function(){return g(this,!0)}),A("toBase64URL",function(){return g(this,!0)})},I={version:d,VERSION:n,atob:L,atobPolyfill:C,btoa:m,btoaPolyfill:_,fromBase64:N,toBase64:x,encode:x,encodeURI:T,encodeURL:T,utob:b,btou:k,decode:N,isValid:function(A){if(typeof A!="string")return!1;var F=A.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(F)||!/[^\s0-9a-zA-Z\-_]/.test(F)},fromUint8Array:g,toUint8Array:D,extendString:M,extendUint8Array:E,extendBuiltins:function(){M(),E()},Base64:{}};return Object.keys(I).forEach(function(A){return I.Base64[A]=I[A]}),I}()}},re={};function Z(O){var t=re[O];if(t!==void 0)return t.exports;var a=re[O]={exports:{}};return he[O].call(a.exports,a,a.exports,Z),a.exports}Z.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var oe={};return(()=>{var O=oe;Object.defineProperty(O,"__esModule",{value:!0}),O.Base64=O.BrowserClipboardProvider=O.ClipboardAddon=void 0;const t=Z(575);O.ClipboardAddon=class{constructor(d=new h,n=new a){this._base64=d,this._provider=n}activate(d){this._terminal=d,this._disposable=d.parser.registerOscHandler(52,n=>this._setOrReportClipboard(n))}dispose(){return this._disposable?.dispose()}_readText(d,n){const l=this._base64.encodeText(n);this._terminal?.input(`\x1B]52;${d};${l}\x07`,!1)}_setOrReportClipboard(d){const n=d.split(";");if(n.length<2)return!0;const l=n[0],f=n[1];if(f==="?"){const e=this._provider.readText(l);return e instanceof Promise?e.then(s=>(this._readText(l,s),!0)):(this._readText(l,e),!0)}let v="";try{v=this._base64.decodeText(f)}catch{}const o=this._provider.writeText(l,v);return!(o instanceof Promise)||o.then(()=>!0)}};class a{async readText(n){return n!=="c"?Promise.resolve(""):navigator.clipboard.readText()}async writeText(n,l){return n!=="c"?Promise.resolve():navigator.clipboard.writeText(l)}}O.BrowserClipboardProvider=a;class h{encodeText(n){return t.Base64.encode(n)}decodeText(n){const l=t.Base64.decode(n);return t.Base64.isValid(n)&&t.Base64.encode(l)===n?l:""}}O.Base64=h})(),oe})())}(we)),we.exports}var ye={exports:{}},Me;function He(){return Me||(Me=1,function(ue,me){(function(he,re){ue.exports=re()})(self,()=>(()=>{var he={965:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphRenderer=void 0;const h=a(374),d=a(509),n=a(855),l=a(859),f=a(381),v=11,o=v*Float32Array.BYTES_PER_ELEMENT;let e,s=0,i=0,r=0;class u extends l.Disposable{constructor(_,m,c,g){super(),this._terminal=_,this._gl=m,this._dimensions=c,this._optionsService=g,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const S=this._gl;d.TextureAtlas.maxAtlasPages===void 0&&(d.TextureAtlas.maxAtlasPages=Math.min(32,(0,h.throwIfFalsy)(S.getParameter(S.MAX_TEXTURE_IMAGE_UNITS))),d.TextureAtlas.maxTextureSize=(0,h.throwIfFalsy)(S.getParameter(S.MAX_TEXTURE_SIZE))),this._program=(0,h.throwIfFalsy)((0,f.createProgram)(S,`#version 300 es
10
+ layout (location = 0) in vec2 a_unitquad;
11
+ layout (location = 1) in vec2 a_cellpos;
12
+ layout (location = 2) in vec2 a_offset;
13
+ layout (location = 3) in vec2 a_size;
14
+ layout (location = 4) in float a_texpage;
15
+ layout (location = 5) in vec2 a_texcoord;
16
+ layout (location = 6) in vec2 a_texsize;
17
+
18
+ uniform mat4 u_projection;
19
+ uniform vec2 u_resolution;
20
+
21
+ out vec2 v_texcoord;
22
+ flat out int v_texpage;
23
+
24
+ void main() {
25
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
26
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
27
+ v_texpage = int(a_texpage);
28
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
29
+ }`,function(P){let B="";for(let k=1;k<P;k++)B+=` else if (v_texpage == ${k}) { outColor = texture(u_texture[${k}], v_texcoord); }`;return`#version 300 es
30
+ precision lowp float;
31
+
32
+ in vec2 v_texcoord;
33
+ flat in int v_texpage;
34
+
35
+ uniform sampler2D u_texture[${P}];
36
+
37
+ out vec4 outColor;
38
+
39
+ void main() {
40
+ if (v_texpage == 0) {
41
+ outColor = texture(u_texture[0], v_texcoord);
42
+ } ${B}
43
+ }`}(d.TextureAtlas.maxAtlasPages))),this.register((0,l.toDisposable)(()=>S.deleteProgram(this._program))),this._projectionLocation=(0,h.throwIfFalsy)(S.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,h.throwIfFalsy)(S.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,h.throwIfFalsy)(S.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);const y=new Float32Array([0,0,1,0,0,1,1,1]),b=S.createBuffer();this.register((0,l.toDisposable)(()=>S.deleteBuffer(b))),S.bindBuffer(S.ARRAY_BUFFER,b),S.bufferData(S.ARRAY_BUFFER,y,S.STATIC_DRAW),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const w=new Uint8Array([0,1,2,3]),x=S.createBuffer();this.register((0,l.toDisposable)(()=>S.deleteBuffer(x))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,x),S.bufferData(S.ELEMENT_ARRAY_BUFFER,w,S.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(S.createBuffer()),this.register((0,l.toDisposable)(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,2,S.FLOAT,!1,o,0),S.vertexAttribDivisor(2,1),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,S.FLOAT,!1,o,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(3,1),S.enableVertexAttribArray(4),S.vertexAttribPointer(4,1,S.FLOAT,!1,o,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(4,1),S.enableVertexAttribArray(5),S.vertexAttribPointer(5,2,S.FLOAT,!1,o,5*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(5,1),S.enableVertexAttribArray(6),S.vertexAttribPointer(6,2,S.FLOAT,!1,o,7*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(6,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,o,9*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.useProgram(this._program);const T=new Int32Array(d.TextureAtlas.maxAtlasPages);for(let P=0;P<d.TextureAtlas.maxAtlasPages;P++)T[P]=P;S.uniform1iv(this._textureLocation,T),S.uniformMatrix4fv(this._projectionLocation,!1,f.PROJECTION_MATRIX),this._atlasTextures=[];for(let P=0;P<d.TextureAtlas.maxAtlasPages;P++){const B=new f.GLTexture((0,h.throwIfFalsy)(S.createTexture()));this.register((0,l.toDisposable)(()=>S.deleteTexture(B.texture))),S.activeTexture(S.TEXTURE0+P),S.bindTexture(S.TEXTURE_2D,B.texture),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,1,1,0,S.RGBA,S.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[P]=B}S.enable(S.BLEND),S.blendFunc(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(_,m,c,g,S,y,b,w,x){this._updateCell(this._vertices.attributes,_,m,c,g,S,y,b,w,x)}_updateCell(_,m,c,g,S,y,b,w,x,T){s=(c*this._terminal.cols+m)*v,g!==n.NULL_CELL_CODE&&g!==void 0?this._atlas&&(e=w&&w.length>1?this._atlas.getRasterizedGlyphCombinedChar(w,S,y,b,!1):this._atlas.getRasterizedGlyph(g,S,y,b,!1),i=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),S!==T&&e.offset.x>i?(r=e.offset.x-i,_[s]=-(e.offset.x-r)+this._dimensions.device.char.left,_[s+1]=-e.offset.y+this._dimensions.device.char.top,_[s+2]=(e.size.x-r)/this._dimensions.device.canvas.width,_[s+3]=e.size.y/this._dimensions.device.canvas.height,_[s+4]=e.texturePage,_[s+5]=e.texturePositionClipSpace.x+r/this._atlas.pages[e.texturePage].canvas.width,_[s+6]=e.texturePositionClipSpace.y,_[s+7]=e.sizeClipSpace.x-r/this._atlas.pages[e.texturePage].canvas.width,_[s+8]=e.sizeClipSpace.y):(_[s]=-e.offset.x+this._dimensions.device.char.left,_[s+1]=-e.offset.y+this._dimensions.device.char.top,_[s+2]=e.size.x/this._dimensions.device.canvas.width,_[s+3]=e.size.y/this._dimensions.device.canvas.height,_[s+4]=e.texturePage,_[s+5]=e.texturePositionClipSpace.x,_[s+6]=e.texturePositionClipSpace.y,_[s+7]=e.sizeClipSpace.x,_[s+8]=e.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,h.allowRescaling)(g,x,e.size.x,this._dimensions.device.cell.width)&&(_[s+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):_.fill(0,s,s+v-1-2)}clear(){const _=this._terminal,m=_.cols*_.rows*v;this._vertices.count!==m?this._vertices.attributes=new Float32Array(m):this._vertices.attributes.fill(0);let c=0;for(;c<this._vertices.attributesBuffers.length;c++)this._vertices.count!==m?this._vertices.attributesBuffers[c]=new Float32Array(m):this._vertices.attributesBuffers[c].fill(0);this._vertices.count=m,c=0;for(let g=0;g<_.rows;g++)for(let S=0;S<_.cols;S++)this._vertices.attributes[c+9]=S/_.cols,this._vertices.attributes[c+10]=g/_.rows,c+=v}handleResize(){const _=this._gl;_.useProgram(this._program),_.viewport(0,0,_.canvas.width,_.canvas.height),_.uniform2f(this._resolutionLocation,_.canvas.width,_.canvas.height),this.clear()}render(_){if(!this._atlas)return;const m=this._gl;m.useProgram(this._program),m.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const c=this._vertices.attributesBuffers[this._activeBuffer];let g=0;for(let S=0;S<_.lineLengths.length;S++){const y=S*this._terminal.cols*v,b=this._vertices.attributes.subarray(y,y+_.lineLengths[S]*v);c.set(b,g),g+=b.length}m.bindBuffer(m.ARRAY_BUFFER,this._attributesBuffer),m.bufferData(m.ARRAY_BUFFER,c.subarray(0,g),m.STREAM_DRAW);for(let S=0;S<this._atlas.pages.length;S++)this._atlas.pages[S].version!==this._atlasTextures[S].version&&this._bindAtlasPageTexture(m,this._atlas,S);m.drawElementsInstanced(m.TRIANGLE_STRIP,4,m.UNSIGNED_BYTE,0,g/v)}setAtlas(_){this._atlas=_;for(const m of this._atlasTextures)m.version=-1}_bindAtlasPageTexture(_,m,c){_.activeTexture(_.TEXTURE0+c),_.bindTexture(_.TEXTURE_2D,this._atlasTextures[c].texture),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,_.CLAMP_TO_EDGE),_.texImage2D(_.TEXTURE_2D,0,_.RGBA,_.RGBA,_.UNSIGNED_BYTE,m.pages[c].canvas),_.generateMipmap(_.TEXTURE_2D),this._atlasTextures[c].version=m.pages[c].version}setDimensions(_){this._dimensions=_}}t.GlyphRenderer=u},742:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RectangleRenderer=void 0;const h=a(374),d=a(859),n=a(310),l=a(381),f=8*Float32Array.BYTES_PER_ELEMENT;class v{constructor(){this.attributes=new Float32Array(160),this.count=0}}let o=0,e=0,s=0,i=0,r=0,u=0,p=0;class _ extends d.Disposable{constructor(c,g,S,y){super(),this._terminal=c,this._gl=g,this._dimensions=S,this._themeService=y,this._vertices=new v,this._verticesCursor=new v;const b=this._gl;this._program=(0,h.throwIfFalsy)((0,l.createProgram)(b,`#version 300 es
44
+ layout (location = 0) in vec2 a_position;
45
+ layout (location = 1) in vec2 a_size;
46
+ layout (location = 2) in vec4 a_color;
47
+ layout (location = 3) in vec2 a_unitquad;
48
+
49
+ uniform mat4 u_projection;
50
+
51
+ out vec4 v_color;
52
+
53
+ void main() {
54
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
55
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
56
+ v_color = a_color;
57
+ }`,`#version 300 es
58
+ precision lowp float;
59
+
60
+ in vec4 v_color;
61
+
62
+ out vec4 outColor;
63
+
64
+ void main() {
65
+ outColor = v_color;
66
+ }`)),this.register((0,d.toDisposable)(()=>b.deleteProgram(this._program))),this._projectionLocation=(0,h.throwIfFalsy)(b.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=b.createVertexArray(),b.bindVertexArray(this._vertexArrayObject);const w=new Float32Array([0,0,1,0,0,1,1,1]),x=b.createBuffer();this.register((0,d.toDisposable)(()=>b.deleteBuffer(x))),b.bindBuffer(b.ARRAY_BUFFER,x),b.bufferData(b.ARRAY_BUFFER,w,b.STATIC_DRAW),b.enableVertexAttribArray(3),b.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const T=new Uint8Array([0,1,2,3]),P=b.createBuffer();this.register((0,d.toDisposable)(()=>b.deleteBuffer(P))),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,P),b.bufferData(b.ELEMENT_ARRAY_BUFFER,T,b.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(b.createBuffer()),this.register((0,d.toDisposable)(()=>b.deleteBuffer(this._attributesBuffer))),b.bindBuffer(b.ARRAY_BUFFER,this._attributesBuffer),b.enableVertexAttribArray(0),b.vertexAttribPointer(0,2,b.FLOAT,!1,f,0),b.vertexAttribDivisor(0,1),b.enableVertexAttribArray(1),b.vertexAttribPointer(1,2,b.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),b.vertexAttribDivisor(1,1),b.enableVertexAttribArray(2),b.vertexAttribPointer(2,4,b.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),b.vertexAttribDivisor(2,1),this._updateCachedColors(y.colors),this.register(this._themeService.onChangeColors(B=>{this._updateCachedColors(B),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(c){const g=this._gl;g.useProgram(this._program),g.bindVertexArray(this._vertexArrayObject),g.uniformMatrix4fv(this._projectionLocation,!1,l.PROJECTION_MATRIX),g.bindBuffer(g.ARRAY_BUFFER,this._attributesBuffer),g.bufferData(g.ARRAY_BUFFER,c.attributes,g.DYNAMIC_DRAW),g.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,g.UNSIGNED_BYTE,0,c.count)}handleResize(){this._updateViewportRectangle()}setDimensions(c){this._dimensions=c}_updateCachedColors(c){this._bgFloat=this._colorToFloat32Array(c.background),this._cursorFloat=this._colorToFloat32Array(c.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(c){const g=this._terminal,S=this._vertices;let y,b,w,x,T,P,B,k,C,L,R,D=1;for(y=0;y<g.rows;y++){for(w=-1,x=0,T=0,P=!1,b=0;b<g.cols;b++)B=(y*g.cols+b)*n.RENDER_MODEL_INDICIES_PER_CELL,k=c.cells[B+n.RENDER_MODEL_BG_OFFSET],C=c.cells[B+n.RENDER_MODEL_FG_OFFSET],L=!!(67108864&C),(k!==x||C!==T&&(P||L))&&((x!==0||P&&T!==0)&&(R=8*D++,this._updateRectangle(S,R,T,x,w,b,y)),w=b,x=k,T=C,P=L);(x!==0||P&&T!==0)&&(R=8*D++,this._updateRectangle(S,R,T,x,w,g.cols,y))}S.count=D}updateCursor(c){const g=this._verticesCursor,S=c.cursor;if(!S||S.style==="block")return void(g.count=0);let y,b=0;S.style!=="bar"&&S.style!=="outline"||(y=8*b++,this._addRectangleFloat(g.attributes,y,S.x*this._dimensions.device.cell.width,S.y*this._dimensions.device.cell.height,S.style==="bar"?S.dpr*S.cursorWidth:S.dpr,this._dimensions.device.cell.height,this._cursorFloat)),S.style!=="underline"&&S.style!=="outline"||(y=8*b++,this._addRectangleFloat(g.attributes,y,S.x*this._dimensions.device.cell.width,(S.y+1)*this._dimensions.device.cell.height-S.dpr,S.width*this._dimensions.device.cell.width,S.dpr,this._cursorFloat)),S.style==="outline"&&(y=8*b++,this._addRectangleFloat(g.attributes,y,S.x*this._dimensions.device.cell.width,S.y*this._dimensions.device.cell.height,S.width*this._dimensions.device.cell.width,S.dpr,this._cursorFloat),y=8*b++,this._addRectangleFloat(g.attributes,y,(S.x+S.width)*this._dimensions.device.cell.width-S.dpr,S.y*this._dimensions.device.cell.height,S.dpr,this._dimensions.device.cell.height,this._cursorFloat)),g.count=b}_updateRectangle(c,g,S,y,b,w,x){if(67108864&S)switch(50331648&S){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&S].rgba;break;case 50331648:o=(16777215&S)<<8;break;default:o=this._themeService.colors.foreground.rgba}else switch(50331648&y){case 16777216:case 33554432:o=this._themeService.colors.ansi[255&y].rgba;break;case 50331648:o=(16777215&y)<<8;break;default:o=this._themeService.colors.background.rgba}c.attributes.length<g+4&&(c.attributes=(0,l.expandFloat32Array)(c.attributes,this._terminal.rows*this._terminal.cols*8)),e=b*this._dimensions.device.cell.width,s=x*this._dimensions.device.cell.height,i=(o>>24&255)/255,r=(o>>16&255)/255,u=(o>>8&255)/255,p=1,this._addRectangle(c.attributes,g,e,s,(w-b)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,i,r,u,p)}_addRectangle(c,g,S,y,b,w,x,T,P,B){c[g]=S/this._dimensions.device.canvas.width,c[g+1]=y/this._dimensions.device.canvas.height,c[g+2]=b/this._dimensions.device.canvas.width,c[g+3]=w/this._dimensions.device.canvas.height,c[g+4]=x,c[g+5]=T,c[g+6]=P,c[g+7]=B}_addRectangleFloat(c,g,S,y,b,w,x){c[g]=S/this._dimensions.device.canvas.width,c[g+1]=y/this._dimensions.device.canvas.height,c[g+2]=b/this._dimensions.device.canvas.width,c[g+3]=w/this._dimensions.device.canvas.height,c[g+4]=x[0],c[g+5]=x[1],c[g+6]=x[2],c[g+7]=x[3]}_colorToFloat32Array(c){return new Float32Array([(c.rgba>>24&255)/255,(c.rgba>>16&255)/255,(c.rgba>>8&255)/255,(255&c.rgba)/255])}}t.RectangleRenderer=_},310:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;const h=a(296);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,h.createSelectionRenderModel)()}resize(d,n){const l=d*n*t.RENDER_MODEL_INDICIES_PER_CELL;l!==this.cells.length&&(this.cells=new Uint32Array(l),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;const h=a(820),d=a(274),n=a(627),l=a(457),f=a(56),v=a(374),o=a(345),e=a(859),s=a(147),i=a(782),r=a(855),u=a(965),p=a(742),_=a(310),m=a(733);class c extends e.Disposable{constructor(b,w,x,T,P,B,k,C,L){super(),this._terminal=b,this._characterJoinerService=w,this._charSizeService=x,this._coreBrowserService=T,this._coreService=P,this._decorationService=B,this._optionsService=k,this._themeService=C,this._cursorBlinkStateManager=new e.MutableDisposable,this._charAtlasDisposable=this.register(new e.MutableDisposable),this._observerDisposable=this.register(new e.MutableDisposable),this._model=new _.RenderModel,this._workCell=new i.CellData,this._workCell2=new i.CellData,this._rectangleRenderer=this.register(new e.MutableDisposable),this._glyphRenderer=this.register(new e.MutableDisposable),this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new o.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new o.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new o.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new d.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new m.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,k,this._themeService)],this.dimensions=(0,v.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(k.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const R={antialias:!1,depth:!1,preserveDrawingBuffer:L};if(this._gl=this._canvas.getContext("webgl2",R),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextlost",D=>{console.log("webglcontextlost event received"),D.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(D)},3e3)})),this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextrestored",D=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,n.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(D,H)=>this._setCanvasDevicePixelDimensions(D,H)),this.register(this._coreBrowserService.onWindowChange(D=>{this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._canvas,D,(H,W)=>this._setCanvasDevicePixelDimensions(H,W))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,e.toDisposable)(()=>{for(const D of this._renderLayers)D.dispose();this._canvas.parentElement?.removeChild(this._canvas),(0,n.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(b,w){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const x of this._renderLayers)x.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(const b of this._renderLayers)b.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(const b of this._renderLayers)b.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(b,w,x){for(const T of this._renderLayers)T.handleSelectionChanged(this._terminal,b,w,x);this._model.selection.update(this._core,b,w,x),this._requestRedrawViewport()}handleCursorMove(){for(const b of this._renderLayers)b.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new p.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new u.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const b=(0,n.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==b&&(this._onChangeTextureAtlas.fire(b.pages[0].canvas),this._charAtlasDisposable.value=(0,e.getDisposeArrayDisposable)([(0,o.forwardEvent)(b.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,o.forwardEvent)(b.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=b,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(b){this._model.clear(),b&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const b of this._renderLayers)b.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(b){return-1}deregisterCharacterJoiner(b){return!1}renderRows(b,w){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const x of this._renderLayers)x.handleGridChanged(this._terminal,b,w);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(b,w),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new l.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(b,w){const x=this._core;let T,P,B,k,C,L,R,D,H,W,N,U,M,E,I=this._workCell;b=S(b,x.rows-1,0),w=S(w,x.rows-1,0);const A=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,F=A-x.buffer.ydisp,$=Math.min(this._terminal.buffer.active.cursorX,x.cols-1);let G=-1;const j=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let K=!1;for(P=b;P<=w;P++)for(B=P+x.buffer.ydisp,k=x.buffer.lines.get(B),this._model.lineLengths[P]=0,C=this._characterJoinerService.getJoinedCharacters(B),M=0;M<x.cols;M++)if(T=this._cellColorResolver.result.bg,k.loadCell(M,I),M===0&&(T=this._cellColorResolver.result.bg),L=!1,R=M,C.length>0&&M===C[0][0]&&(L=!0,D=C.shift(),I=new g(I,k.translateToString(!0,D[0],D[1]),D[1]-D[0]),R=D[1]-1),H=I.getChars(),W=I.getCode(),U=(P*x.cols+M)*_.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(I,M,B,this.dimensions.device.cell.width),j&&B===A&&(M===$&&(this._model.cursor={x:$,y:F,width:I.getWidth(),style:this._coreBrowserService.isFocused?x.options.cursorStyle||"block":x.options.cursorInactiveStyle,cursorWidth:x.options.cursorWidth,dpr:this._devicePixelRatio},G=$+I.getWidth()-1),M>=$&&M<=G&&(this._coreBrowserService.isFocused&&(x.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&x.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),W!==r.NULL_CELL_CODE&&(this._model.lineLengths[P]=M+1),(this._model.cells[U]!==W||this._model.cells[U+_.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[U+_.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[U+_.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(K=!0,H.length>1&&(W|=_.COMBINED_CHAR_BIT_MASK),this._model.cells[U]=W,this._model.cells[U+_.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[U+_.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[U+_.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,N=I.getWidth(),this._glyphRenderer.value.updateCell(M,P,W,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,H,N,T),L))for(I=this._workCell,M++;M<R;M++)E=(P*x.cols+M)*_.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(M,P,r.NULL_CELL_CODE,0,0,0,r.NULL_CELL_CHAR,0,0),this._model.cells[E]=r.NULL_CELL_CODE,this._model.cells[E+_.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[E+_.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[E+_.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;K&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),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._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(b,w){this._canvas.width===b&&this._canvas.height===w||(this._canvas.width=b,this._canvas.height=w,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const b=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:b,end:b})}}t.WebglRenderer=c;class g extends s.AttributeData{constructor(b,w,x){super(),this.content=0,this.combinedData="",this.fg=b.fg,this.bg=b.bg,this.combinedData=w,this._width=x}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(b){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function S(y,b,w=0){return Math.max(Math.min(y,b),w)}t.JoinedCellData=g},381:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GLTexture=t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0;const h=a(374);function d(n,l,f){const v=(0,h.throwIfFalsy)(n.createShader(l));if(n.shaderSource(v,f),n.compileShader(v),n.getShaderParameter(v,n.COMPILE_STATUS))return v;console.error(n.getShaderInfoLog(v)),n.deleteShader(v)}t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(n,l,f){const v=(0,h.throwIfFalsy)(n.createProgram());if(n.attachShader(v,(0,h.throwIfFalsy)(d(n,n.VERTEX_SHADER,l))),n.attachShader(v,(0,h.throwIfFalsy)(d(n,n.FRAGMENT_SHADER,f))),n.linkProgram(v),n.getProgramParameter(v,n.LINK_STATUS))return v;console.error(n.getProgramInfoLog(v)),n.deleteProgram(v)},t.createShader=d,t.expandFloat32Array=function(n,l){const f=Math.min(2*n.length,l),v=new Float32Array(f);for(let o=0;o<n.length;o++)v[o]=n[o];return v},t.GLTexture=class{constructor(n){this.texture=n,this.version=-1}}},592:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const h=a(627),d=a(237),n=a(374),l=a(859);class f extends l.Disposable{constructor(o,e,s,i,r,u,p,_){super(),this._container=e,this._alpha=r,this._coreBrowserService=u,this._optionsService=p,this._themeService=_,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${s}-layer`),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(m=>{this._refreshCharAtlas(o,m),this.reset(o)})),this.register((0,l.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,n.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(o){}handleFocus(o){}handleCursorMove(o){}handleGridChanged(o,e,s){}handleSelectionChanged(o,e,s,i=!1){}_setTransparency(o,e){if(e===this._alpha)return;const s=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,s),this._refreshCharAtlas(o,this._themeService.colors),this.handleGridChanged(o,0,o.rows-1)}_refreshCharAtlas(o,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,h.acquireTextureAtlas)(o,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(o,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(o,this._themeService.colors)}_fillBottomLineAtCells(o,e,s=1){this._ctx.fillRect(o*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,s*this._deviceCellWidth,this._coreBrowserService.dpr)}_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(o,e,s,i){this._alpha?this._ctx.clearRect(o*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,i*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(o*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,i*this._deviceCellHeight))}_fillCharTrueColor(o,e,s,i){this._ctx.font=this._getFont(o,!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipCell(s,i,e.getWidth()),this._ctx.fillText(e.getChars(),s*this._deviceCellWidth+this._deviceCharLeft,i*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(o,e,s){this._ctx.beginPath(),this._ctx.rect(o*this._deviceCellWidth,e*this._deviceCellHeight,s*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(o,e,s){return`${s?"italic":""} ${e?o.options.fontWeightBold:o.options.fontWeight} ${o.options.fontSize*this._coreBrowserService.dpr}px ${o.options.fontFamily}`}}t.BaseRenderLayer=f},733:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const h=a(197),d=a(237),n=a(592);class l extends n.BaseRenderLayer{constructor(v,o,e,s,i,r,u){super(e,v,"link",o,!0,i,r,u),this.register(s.onShowLinkUnderline(p=>this._handleShowLinkUnderline(p))),this.register(s.onHideLinkUnderline(p=>this._handleHideLinkUnderline(p)))}resize(v,o){super.resize(v,o),this._state=void 0}reset(v){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const v=this._state.y2-this._state.y1-1;v>0&&this._clearCells(0,this._state.y1+1,this._state.cols,v),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(v){if(v.fg===d.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:v.fg!==void 0&&(0,h.is256Color)(v.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[v.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,v.y1===v.y2)this._fillBottomLineAtCells(v.x1,v.y1,v.x2-v.x1);else{this._fillBottomLineAtCells(v.x1,v.y1,v.cols-v.x1);for(let o=v.y1+1;o<v.y2;o++)this._fillBottomLineAtCells(0,o,v.cols);this._fillBottomLineAtCells(0,v.y2,v.x2)}this._state=v}_handleHideLinkUnderline(v){this._clearCurrentLink()}}t.LinkRenderLayer=l},820:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,h,d,n){a.addEventListener(h,d,n);let l=!1;return{dispose:()=>{l||(l=!0,a.removeEventListener(h,d,n))}}}},274:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;const h=a(855),d=a(160),n=a(374);let l,f=0,v=0,o=!1,e=!1,s=!1,i=0;t.CellColorResolver=class{constructor(r,u,p,_,m,c){this._terminal=r,this._optionService=u,this._selectionRenderModel=p,this._decorationService=_,this._coreBrowserService=m,this._themeService=c,this.result={fg:0,bg:0,ext:0}}resolve(r,u,p,_){if(this.result.bg=r.bg,this.result.fg=r.fg,this.result.ext=268435456&r.bg?r.extended.ext:0,v=0,f=0,e=!1,o=!1,s=!1,l=this._themeService.colors,i=0,r.getCode()!==h.NULL_CELL_CODE&&r.extended.underlineStyle===4){const m=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));i=u*_%(2*Math.round(m))}if(this._decorationService.forEachDecorationAtCell(u,p,"bottom",m=>{m.backgroundColorRGB&&(v=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(f=m.foregroundColorRGB.rgba>>8&16777215,o=!0)}),s=this._selectionRenderModel.isCellSelected(this._terminal,u,p),s){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:v=(16777215&this.result.fg)<<8|255;break;default:v=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:v=(16777215&this.result.bg)<<8|255}v=d.rgba.blend(v,4294967040&(this._coreBrowserService.isFocused?l.selectionBackgroundOpaque:l.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else v=(this._coreBrowserService.isFocused?l.selectionBackgroundOpaque:l.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,l.selectionForeground&&(f=l.selectionForeground.rgba>>8&16777215,o=!0),(0,n.treatGlyphAsBackgroundColor)(r.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)f=(this._coreBrowserService.isFocused?l.selectionBackgroundOpaque:l.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=d.rgba.blend(f,4294967040&(this._coreBrowserService.isFocused?l.selectionBackgroundOpaque:l.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(u,p,"top",m=>{m.backgroundColorRGB&&(v=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(f=m.foregroundColorRGB.rgba>>8&16777215,o=!0)}),e&&(v=s?-16777216&r.bg&-134217729|v|50331648:-16777216&r.bg|v|50331648),o&&(f=-16777216&r.fg&-67108865|f|50331648),67108864&this.result.fg&&(e&&!o&&(f=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&l.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!e&&o&&(v=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&l.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,e=!0)),l=void 0,this.result.bg=e?v:this.result.bg,this.result.fg=o?f:this.result.fg,this.result.ext&=536870911,this.result.ext|=i<<29&3758096384}}},627:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const h=a(509),d=a(197),n=[];t.acquireTextureAtlas=function(l,f,v,o,e,s,i,r){const u=(0,d.generateConfig)(o,e,s,i,f,v,r);for(let m=0;m<n.length;m++){const c=n[m],g=c.ownedBy.indexOf(l);if(g>=0){if((0,d.configEquals)(c.config,u))return c.atlas;c.ownedBy.length===1?(c.atlas.dispose(),n.splice(m,1)):c.ownedBy.splice(g,1);break}}for(let m=0;m<n.length;m++){const c=n[m];if((0,d.configEquals)(c.config,u))return c.ownedBy.push(l),c.atlas}const p=l._core,_={atlas:new h.TextureAtlas(document,u,p.unicodeService),config:u,ownedBy:[l]};return n.push(_),_.atlas},t.removeTerminalFromCache=function(l){for(let f=0;f<n.length;f++){const v=n[f].ownedBy.indexOf(l);if(v!==-1){n[f].ownedBy.length===1?(n[f].atlas.dispose(),n.splice(f,1)):n[f].ownedBy.splice(v,1);break}}}},197:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const h=a(160);t.generateConfig=function(d,n,l,f,v,o,e){const s={foreground:o.foreground,background:o.background,cursor:h.NULL_COLOR,cursorAccent:h.NULL_COLOR,selectionForeground:h.NULL_COLOR,selectionBackgroundTransparent:h.NULL_COLOR,selectionBackgroundOpaque:h.NULL_COLOR,selectionInactiveBackgroundTransparent:h.NULL_COLOR,selectionInactiveBackgroundOpaque:h.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:v.customGlyphs,devicePixelRatio:e,letterSpacing:v.letterSpacing,lineHeight:v.lineHeight,deviceCellWidth:d,deviceCellHeight:n,deviceCharWidth:l,deviceCharHeight:f,fontFamily:v.fontFamily,fontSize:v.fontSize,fontWeight:v.fontWeight,fontWeightBold:v.fontWeightBold,allowTransparency:v.allowTransparency,drawBoldTextInBrightColors:v.drawBoldTextInBrightColors,minimumContrastRatio:v.minimumContrastRatio,colors:s}},t.configEquals=function(d,n){for(let l=0;l<d.colors.ansi.length;l++)if(d.colors.ansi[l].rgba!==n.colors.ansi[l].rgba)return!1;return d.devicePixelRatio===n.devicePixelRatio&&d.customGlyphs===n.customGlyphs&&d.lineHeight===n.lineHeight&&d.letterSpacing===n.letterSpacing&&d.fontFamily===n.fontFamily&&d.fontSize===n.fontSize&&d.fontWeight===n.fontWeight&&d.fontWeightBold===n.fontWeightBold&&d.allowTransparency===n.allowTransparency&&d.deviceCharWidth===n.deviceCharWidth&&d.deviceCharHeight===n.deviceCharHeight&&d.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&d.minimumContrastRatio===n.minimumContrastRatio&&d.colors.foreground.rgba===n.colors.foreground.rgba&&d.colors.background.rgba===n.colors.background.rgba},t.is256Color=function(d){return(50331648&d)==16777216||(50331648&d)==33554432}},237:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const h=a(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},457:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(a,h){this._renderCallback=a,this._coreBrowserService=h,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 h=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,h>0)return void this._restartInterval(h)}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 h=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(h)}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:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const h=a(374);t.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 d={"░":[[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]]};t.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`}},t.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}},t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.tryDrawCustomChar=function(o,e,s,i,r,u,p,_){const m=t.blockElementDefinitions[e];if(m)return function(y,b,w,x,T,P){for(let B=0;B<b.length;B++){const k=b[B],C=T/8,L=P/8;y.fillRect(w+k.x*C,x+k.y*L,k.w*C,k.h*L)}}(o,m,s,i,r,u),!0;const c=d[e];if(c)return function(y,b,w,x,T,P){let B=n.get(b);B||(B=new Map,n.set(b,B));const k=y.fillStyle;if(typeof k!="string")throw new Error(`Unexpected fillStyle type "${k}"`);let C=B.get(k);if(!C){const L=b[0].length,R=b.length,D=y.canvas.ownerDocument.createElement("canvas");D.width=L,D.height=R;const H=(0,h.throwIfFalsy)(D.getContext("2d")),W=new ImageData(L,R);let N,U,M,E;if(k.startsWith("#"))N=parseInt(k.slice(1,3),16),U=parseInt(k.slice(3,5),16),M=parseInt(k.slice(5,7),16),E=k.length>7&&parseInt(k.slice(7,9),16)||1;else{if(!k.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${k}" when drawing pattern glyph`);[N,U,M,E]=k.substring(5,k.length-1).split(",").map(I=>parseFloat(I))}for(let I=0;I<R;I++)for(let A=0;A<L;A++)W.data[4*(I*L+A)]=N,W.data[4*(I*L+A)+1]=U,W.data[4*(I*L+A)+2]=M,W.data[4*(I*L+A)+3]=b[I][A]*(255*E);H.putImageData(W,0,0),C=(0,h.throwIfFalsy)(y.createPattern(D,null)),B.set(k,C)}y.fillStyle=C,y.fillRect(w,x,T,P)}(o,c,s,i,r,u),!0;const g=t.boxDrawingDefinitions[e];if(g)return function(y,b,w,x,T,P,B){y.strokeStyle=y.fillStyle;for(const[k,C]of Object.entries(b)){let L;y.beginPath(),y.lineWidth=B*Number.parseInt(k),L=typeof C=="function"?C(.15,.15/P*T):C;for(const R of L.split(" ")){const D=R[0],H=f[D];if(!H){console.error(`Could not find drawing instructions for "${D}"`);continue}const W=R.substring(1).split(",");W[0]&&W[1]&&H(y,v(W,T,P,w,x,!0,B))}y.stroke(),y.closePath()}}(o,g,s,i,r,u,_),!0;const S=t.powerlineDefinitions[e];return!!S&&(function(y,b,w,x,T,P,B,k){const C=new Path2D;C.rect(w,x,T,P),y.clip(C),y.beginPath();const L=B/12;y.lineWidth=k*L;for(const R of b.d.split(" ")){const D=R[0],H=f[D];if(!H){console.error(`Could not find drawing instructions for "${D}"`);continue}const W=R.substring(1).split(",");W[0]&&W[1]&&H(y,v(W,T,P,w,x,!1,k,(b.leftPadding??0)*(L/2),(b.rightPadding??0)*(L/2)))}b.type===1?(y.strokeStyle=y.fillStyle,y.stroke()):y.fill(),y.closePath()}(o,S,s,i,r,u,p,_),!0)};const n=new Map;function l(o,e,s=0){return Math.max(Math.min(o,e),s)}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 v(o,e,s,i,r,u,p,_=0,m=0){const c=o.map(g=>parseFloat(g)||parseInt(g));if(c.length<2)throw new Error("Too few arguments for instruction");for(let g=0;g<c.length;g+=2)c[g]*=e-_*p-m*p,u&&c[g]!==0&&(c[g]=l(Math.round(c[g]+.5)-.5,e,0)),c[g]+=i+_*p;for(let g=1;g<c.length;g+=2)c[g]*=s,u&&c[g]!==0&&(c[g]=l(Math.round(c[g]+.5)-.5,s,0)),c[g]+=r;return c}},56:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const h=a(859);t.observeDevicePixelDimensions=function(d,n,l){let f=new n.ResizeObserver(v=>{const o=v.find(i=>i.target===d);if(!o)return;if(!("devicePixelContentBoxSize"in o))return f?.disconnect(),void(f=void 0);const e=o.devicePixelContentBoxSize[0].inlineSize,s=o.devicePixelContentBoxSize[0].blockSize;e>0&&s>0&&l(e,s)});try{f.observe(d,{box:["device-pixel-content-box"]})}catch{f.disconnect(),f=void 0}return(0,h.toDisposable)(()=>f?.disconnect())}},374:(O,t)=>{function a(d){return 57508<=d&&d<=57558}function h(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},t.isEmoji=h,t.allowRescaling=function(d,n,l,f){return n===1&&l>Math.ceil(1.5*f)&&d!==void 0&&d>255&&!h(d)&&!a(d)&&!function(v){return 57344<=v&&v<=63743}(d)},t.treatGlyphAsBackgroundColor=function(d){return a(d)||function(n){return 9472<=n&&n<=9631}(d)},t.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}}}},t.computeNextVariantOffset=function(d,n,l=0){return(d-(2*Math.round(n)-l))%(2*Math.round(n))}},296:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.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(d,n,l,f=!1){if(this.selectionStart=n,this.selectionEnd=l,!n||!l||n[0]===l[0]&&n[1]===l[1])return void this.clear();const v=d.buffers.active.ydisp,o=n[1]-v,e=l[1]-v,s=Math.max(o,0),i=Math.min(e,d.rows-1);s>=d.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=o,this.viewportEndRow=e,this.viewportCappedStartRow=s,this.viewportCappedEndRow=i,this.startCol=n[0],this.endCol=l[0])}isCellSelected(d,n,l){return!!this.hasSelection&&(l-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&l>=this.viewportCappedStartRow&&n<this.endCol&&l<=this.viewportCappedEndRow:n<this.startCol&&l>=this.viewportCappedStartRow&&n>=this.endCol&&l<=this.viewportCappedEndRow:l>this.viewportStartRow&&l<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&l===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},509:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const h=a(237),d=a(860),n=a(374),l=a(160),f=a(345),v=a(485),o=a(385),e=a(147),s=a(855),i={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 r;class u{get pages(){return this._pages}constructor(g,S,y){this._document=g,this._config=S,this._unicodeService=y,this._didWarmUp=!1,this._cacheMap=new v.FourKeyMap,this._cacheMapCombined=new v.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=m(g,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 g of this.pages)g.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const g=new o.IdleTaskQueue;for(let S=33;S<126;S++)g.enqueue(()=>{if(!this._cacheMap.get(S,s.DEFAULT_COLOR,s.DEFAULT_COLOR,s.DEFAULT_EXT)){const y=this._drawToCache(S,s.DEFAULT_COLOR,s.DEFAULT_COLOR,s.DEFAULT_EXT);this._cacheMap.set(S,s.DEFAULT_COLOR,s.DEFAULT_COLOR,s.DEFAULT_EXT,y)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const g of this._pages)g.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(u.maxAtlasPages&&this._pages.length>=Math.max(4,u.maxAtlasPages)){const S=this._pages.filter(B=>2*B.canvas.width<=(u.maxTextureSize||4096)).sort((B,k)=>k.canvas.width!==B.canvas.width?k.canvas.width-B.canvas.width:k.percentageUsed-B.percentageUsed);let y=-1,b=0;for(let B=0;B<S.length;B++)if(S[B].canvas.width!==b)y=B,b=S[B].canvas.width;else if(B-y==3)break;const w=S.slice(y,y+4),x=w.map(B=>B.glyphs[0].texturePage).sort((B,k)=>B>k?1:-1),T=this.pages.length-w.length,P=this._mergePages(w,T);P.version++;for(let B=x.length-1;B>=0;B--)this._deletePage(x[B]);this.pages.push(P),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(P.canvas)}const g=new p(this._document,this._textureSize);return this._pages.push(g),this._activePages.push(g),this._onAddTextureAtlasCanvas.fire(g.canvas),g}_mergePages(g,S){const y=2*g[0].canvas.width,b=new p(this._document,y,g);for(const[w,x]of g.entries()){const T=w*x.canvas.width%y,P=Math.floor(w/2)*x.canvas.height;b.ctx.drawImage(x.canvas,T,P);for(const k of x.glyphs)k.texturePage=S,k.sizeClipSpace.x=k.size.x/y,k.sizeClipSpace.y=k.size.y/y,k.texturePosition.x+=T,k.texturePosition.y+=P,k.texturePositionClipSpace.x=k.texturePosition.x/y,k.texturePositionClipSpace.y=k.texturePosition.y/y;this._onRemoveTextureAtlasCanvas.fire(x.canvas);const B=this._activePages.indexOf(x);B!==-1&&this._activePages.splice(B,1)}return b}_deletePage(g){this._pages.splice(g,1);for(let S=g;S<this._pages.length;S++){const y=this._pages[S];for(const b of y.glyphs)b.texturePage--;y.version++}}getRasterizedGlyphCombinedChar(g,S,y,b,w){return this._getFromCacheMap(this._cacheMapCombined,g,S,y,b,w)}getRasterizedGlyph(g,S,y,b,w){return this._getFromCacheMap(this._cacheMap,g,S,y,b,w)}_getFromCacheMap(g,S,y,b,w,x=!1){return r=g.get(S,y,b,w),r||(r=this._drawToCache(S,y,b,w,x),g.set(S,y,b,w,r)),r}_getColorFromAnsiIndex(g){if(g>=this._config.colors.ansi.length)throw new Error("No color found for idx "+g);return this._config.colors.ansi[g]}_getBackgroundColor(g,S,y,b){if(this._config.allowTransparency)return l.NULL_COLOR;let w;switch(g){case 16777216:case 33554432:w=this._getColorFromAnsiIndex(S);break;case 50331648:const x=e.AttributeData.toColorRGB(S);w=l.channels.toColor(x[0],x[1],x[2]);break;default:w=y?l.color.opaque(this._config.colors.foreground):this._config.colors.background}return w}_getForegroundColor(g,S,y,b,w,x,T,P,B,k){const C=this._getMinimumContrastColor(g,S,y,b,w,x,T,B,P,k);if(C)return C;let L;switch(w){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&B&&x<8&&(x+=8),L=this._getColorFromAnsiIndex(x);break;case 50331648:const R=e.AttributeData.toColorRGB(x);L=l.channels.toColor(R[0],R[1],R[2]);break;default:L=T?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(L=l.color.opaque(L)),P&&(L=l.color.multiplyOpacity(L,h.DIM_OPACITY)),L}_resolveBackgroundRgba(g,S,y){switch(g){case 16777216:case 33554432:return this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return y?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(g,S,y,b){switch(g){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&b&&S<8&&(S+=8),this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return y?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(g,S,y,b,w,x,T,P,B,k){if(this._config.minimumContrastRatio===1||k)return;const C=this._getContrastCache(B),L=C.getColor(g,b);if(L!==void 0)return L||void 0;const R=this._resolveBackgroundRgba(S,y,T),D=this._resolveForegroundRgba(w,x,T,P),H=l.rgba.ensureContrastRatio(R,D,this._config.minimumContrastRatio/(B?2:1));if(!H)return void C.setColor(g,b,null);const W=l.channels.toColor(H>>24&255,H>>16&255,H>>8&255);return C.setColor(g,b,W),W}_getContrastCache(g){return g?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(g,S,y,b,w=!1){const x=typeof g=="number"?String.fromCharCode(g):g,T=Math.min(this._config.deviceCellWidth*Math.max(x.length,2)+4,this._textureSize);this._tmpCanvas.width<T&&(this._tmpCanvas.width=T);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=y,this._workAttributeData.bg=S,this._workAttributeData.extended.ext=b,this._workAttributeData.isInvisible())return i;const B=!!this._workAttributeData.isBold(),k=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),L=!!this._workAttributeData.isItalic(),R=!!this._workAttributeData.isUnderline(),D=!!this._workAttributeData.isStrikethrough(),H=!!this._workAttributeData.isOverline();let W=this._workAttributeData.getFgColor(),N=this._workAttributeData.getFgColorMode(),U=this._workAttributeData.getBgColor(),M=this._workAttributeData.getBgColorMode();if(k){const z=W;W=U,U=z;const J=N;N=M,M=J}const E=this._getBackgroundColor(M,U,k,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const I=B?this._config.fontWeightBold:this._config.fontWeight,A=L?"italic":"";this._tmpCtx.font=`${A} ${I} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=h.TEXT_BASELINE;const F=x.length===1&&(0,n.isPowerlineGlyph)(x.charCodeAt(0)),$=x.length===1&&(0,n.isRestrictedPowerlineGlyph)(x.charCodeAt(0)),G=this._getForegroundColor(S,M,U,y,N,W,k,C,B,(0,n.treatGlyphAsBackgroundColor)(x.charCodeAt(0)));this._tmpCtx.fillStyle=G.css;const j=$?0:4;let K=!1;this._config.customGlyphs!==!1&&(K=(0,d.tryDrawCustomChar)(this._tmpCtx,x,j,j,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let ie,q=!F;if(ie=typeof g=="number"?this._unicodeService.wcwidth(g):this._unicodeService.getStringCellWidth(g),R){this._tmpCtx.save();const z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),J=z%2==1?.5:0;if(this._tmpCtx.lineWidth=z,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())q=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{q=!1;let ne=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ne<8&&(ne+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ne).css}this._tmpCtx.beginPath();const se=j,te=Math.ceil(j+this._config.deviceCharHeight)-J-(w?2*z:0),de=te+z,ae=te+2*z;let le=this._workAttributeData.getUnderlineVariantOffset();for(let ne=0;ne<ie;ne++){this._tmpCtx.save();const ee=se+ne*this._config.deviceCellWidth,V=se+(ne+1)*this._config.deviceCellWidth,fe=ee+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ee,te),this._tmpCtx.lineTo(V,te),this._tmpCtx.moveTo(ee,ae),this._tmpCtx.lineTo(V,ae);break;case 3:const ve=z<=1?ae:Math.ceil(j+this._config.deviceCharHeight-z/2)-J,ge=z<=1?te:Math.ceil(j+this._config.deviceCharHeight+z/2)-J,Ee=new Path2D;Ee.rect(ee,te,this._config.deviceCellWidth,ae-te),this._tmpCtx.clip(Ee),this._tmpCtx.moveTo(ee-this._config.deviceCellWidth/2,de),this._tmpCtx.bezierCurveTo(ee-this._config.deviceCellWidth/2,ge,ee,ge,ee,de),this._tmpCtx.bezierCurveTo(ee,ve,fe,ve,fe,de),this._tmpCtx.bezierCurveTo(fe,ge,V,ge,V,de),this._tmpCtx.bezierCurveTo(V,ve,V+this._config.deviceCellWidth/2,ve,V+this._config.deviceCellWidth/2,de);break;case 4:const pe=le===0?0:le>=z?2*z-le:z-le;le>=z||pe===0?(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo(ee+pe,te),this._tmpCtx.lineTo(V,te)):(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo(ee,te),this._tmpCtx.lineTo(ee+pe,te),this._tmpCtx.moveTo(ee+pe+z,te),this._tmpCtx.lineTo(V,te)),le=(0,n.computeNextVariantOffset)(V-ee,z,le);break;case 5:const Te=.6,Be=.3,Se=V-ee,Le=Math.floor(Te*Se),xe=Math.floor(Be*Se),Oe=Se-Le-xe;this._tmpCtx.setLineDash([Le,xe,Oe]),this._tmpCtx.moveTo(ee,te),this._tmpCtx.lineTo(V,te);break;default:this._tmpCtx.moveTo(ee,te),this._tmpCtx.lineTo(V,te)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!K&&this._config.fontSize>=12&&!this._config.allowTransparency&&x!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const ne=this._tmpCtx.measureText(x);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ne&&ne.actualBoundingBoxDescent>0){this._tmpCtx.save();const ee=new Path2D;ee.rect(se,te-Math.ceil(z/2),this._config.deviceCellWidth*ie,ae-te+Math.ceil(z/2)),this._tmpCtx.clip(ee),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(x,j,j+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(H){const z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),J=z%2==1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+J),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*ie,j+J),this._tmpCtx.stroke()}if(K||this._tmpCtx.fillText(x,j,j+this._config.deviceCharHeight),x==="_"&&!this._config.allowTransparency){let z=_(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),E,G,q);if(z)for(let J=1;J<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(x,j,j+this._config.deviceCharHeight-J),z=_(this._tmpCtx.getImageData(j,j,this._config.deviceCellWidth,this._config.deviceCellHeight),E,G,q),z);J++);}if(D){const z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),J=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(j,j+Math.floor(this._config.deviceCharHeight/2)-J),this._tmpCtx.lineTo(j+this._config.deviceCharWidth*ie,j+Math.floor(this._config.deviceCharHeight/2)-J),this._tmpCtx.stroke()}this._tmpCtx.restore();const ce=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let _e;if(_e=this._config.allowTransparency?function(z){for(let J=0;J<z.data.length;J+=4)if(z.data[J+3]>0)return!1;return!0}(ce):_(ce,E,G,q),_e)return i;const Q=this._findGlyphBoundingBox(ce,this._workBoundingBox,T,$,K,j);let X,Y;for(;;){if(this._activePages.length===0){const z=this._createNewPage();X=z,Y=z.currentRow,Y.height=Q.size.y;break}X=this._activePages[this._activePages.length-1],Y=X.currentRow;for(const z of this._activePages)Q.size.y<=z.currentRow.height&&(X=z,Y=z.currentRow);for(let z=this._activePages.length-1;z>=0;z--)for(const J of this._activePages[z].fixedRows)J.height<=Y.height&&Q.size.y<=J.height&&(X=this._activePages[z],Y=J);if(Y.y+Q.size.y>=X.canvas.height||Y.height>Q.size.y+2){let z=!1;if(X.currentRow.y+X.currentRow.height+Q.size.y>=X.canvas.height){let J;for(const se of this._activePages)if(se.currentRow.y+se.currentRow.height+Q.size.y<se.canvas.height){J=se;break}if(J)X=J;else if(u.maxAtlasPages&&this._pages.length>=u.maxAtlasPages&&Y.y+Q.size.y<=X.canvas.height&&Y.height>=Q.size.y&&Y.x+Q.size.x<=X.canvas.width)z=!0;else{const se=this._createNewPage();X=se,Y=se.currentRow,Y.height=Q.size.y,z=!0}}z||(X.currentRow.height>0&&X.fixedRows.push(X.currentRow),Y={x:0,y:X.currentRow.y+X.currentRow.height,height:Q.size.y},X.fixedRows.push(Y),X.currentRow={x:0,y:Y.y+Y.height,height:0})}if(Y.x+Q.size.x<=X.canvas.width)break;Y===X.currentRow?(Y.x=0,Y.y+=Y.height,Y.height=0):X.fixedRows.splice(X.fixedRows.indexOf(Y),1)}return Q.texturePage=this._pages.indexOf(X),Q.texturePosition.x=Y.x,Q.texturePosition.y=Y.y,Q.texturePositionClipSpace.x=Y.x/X.canvas.width,Q.texturePositionClipSpace.y=Y.y/X.canvas.height,Q.sizeClipSpace.x/=X.canvas.width,Q.sizeClipSpace.y/=X.canvas.height,Y.height=Math.max(Y.height,Q.size.y),Y.x+=Q.size.x,X.ctx.putImageData(ce,Q.texturePosition.x-this._workBoundingBox.left,Q.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Q.size.x,Q.size.y),X.addGlyph(Q),X.version++,Q}_findGlyphBoundingBox(g,S,y,b,w,x){S.top=0;const T=b?this._config.deviceCellHeight:this._tmpCanvas.height,P=b?this._config.deviceCellWidth:y;let B=!1;for(let k=0;k<T;k++){for(let C=0;C<P;C++){const L=k*this._tmpCanvas.width*4+4*C+3;if(g.data[L]!==0){S.top=k,B=!0;break}}if(B)break}S.left=0,B=!1;for(let k=0;k<x+P;k++){for(let C=0;C<T;C++){const L=C*this._tmpCanvas.width*4+4*k+3;if(g.data[L]!==0){S.left=k,B=!0;break}}if(B)break}S.right=P,B=!1;for(let k=x+P-1;k>=x;k--){for(let C=0;C<T;C++){const L=C*this._tmpCanvas.width*4+4*k+3;if(g.data[L]!==0){S.right=k,B=!0;break}}if(B)break}S.bottom=T,B=!1;for(let k=T-1;k>=0;k--){for(let C=0;C<P;C++){const L=k*this._tmpCanvas.width*4+4*C+3;if(g.data[L]!==0){S.bottom=k,B=!0;break}}if(B)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:S.right-S.left+1,y:S.bottom-S.top+1},sizeClipSpace:{x:S.right-S.left+1,y:S.bottom-S.top+1},offset:{x:-S.left+x+(b||w?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-S.top+x+(b||w?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=u;class p{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(g){this._glyphs.push(g),this._usedPixels+=g.size.x*g.size.y}constructor(g,S,y){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],y)for(const b of y)this._glyphs.push(...b.glyphs),this._usedPixels+=b._usedPixels;this.canvas=m(g,S,S),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 _(c,g,S,y){const b=g.rgba>>>24,w=g.rgba>>>16&255,x=g.rgba>>>8&255,T=S.rgba>>>24,P=S.rgba>>>16&255,B=S.rgba>>>8&255,k=Math.floor((Math.abs(b-T)+Math.abs(w-P)+Math.abs(x-B))/12);let C=!0;for(let L=0;L<c.data.length;L+=4)c.data[L]===b&&c.data[L+1]===w&&c.data[L+2]===x||y&&Math.abs(c.data[L]-b)+Math.abs(c.data[L+1]-w)+Math.abs(c.data[L+2]-x)<k?c.data[L+3]=0:C=!1;return C}function m(c,g,S){const y=c.createElement("canvas");return y.width=g,y.height=S,y}},160:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,h=0,d=0,n=0;var l,f,v,o,e;function s(r){const u=r.toString(16);return u.length<2?"0"+u:u}function i(r,u){return r<u?(u+.05)/(r+.05):(r+.05)/(u+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(r){r.toCss=function(u,p,_,m){return m!==void 0?`#${s(u)}${s(p)}${s(_)}${s(m)}`:`#${s(u)}${s(p)}${s(_)}`},r.toRgba=function(u,p,_,m=255){return(u<<24|p<<16|_<<8|m)>>>0},r.toColor=function(u,p,_,m){return{css:r.toCss(u,p,_,m),rgba:r.toRgba(u,p,_,m)}}}(l||(t.channels=l={})),function(r){function u(p,_){return n=Math.round(255*_),[a,h,d]=e.toChannels(p.rgba),{css:l.toCss(a,h,d,n),rgba:l.toRgba(a,h,d,n)}}r.blend=function(p,_){if(n=(255&_.rgba)/255,n===1)return{css:_.css,rgba:_.rgba};const m=_.rgba>>24&255,c=_.rgba>>16&255,g=_.rgba>>8&255,S=p.rgba>>24&255,y=p.rgba>>16&255,b=p.rgba>>8&255;return a=S+Math.round((m-S)*n),h=y+Math.round((c-y)*n),d=b+Math.round((g-b)*n),{css:l.toCss(a,h,d),rgba:l.toRgba(a,h,d)}},r.isOpaque=function(p){return(255&p.rgba)==255},r.ensureContrastRatio=function(p,_,m){const c=e.ensureContrastRatio(p.rgba,_.rgba,m);if(c)return l.toColor(c>>24&255,c>>16&255,c>>8&255)},r.opaque=function(p){const _=(255|p.rgba)>>>0;return[a,h,d]=e.toChannels(_),{css:l.toCss(a,h,d),rgba:_}},r.opacity=u,r.multiplyOpacity=function(p,_){return n=255&p.rgba,u(p,n*_/255)},r.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}}(f||(t.color=f={})),function(r){let u,p;try{const _=document.createElement("canvas");_.width=1,_.height=1;const m=_.getContext("2d",{willReadFrequently:!0});m&&(u=m,u.globalCompositeOperation="copy",p=u.createLinearGradient(0,0,1,1))}catch{}r.toColor=function(_){if(_.match(/#[\da-f]{3,8}/i))switch(_.length){case 4:return a=parseInt(_.slice(1,2).repeat(2),16),h=parseInt(_.slice(2,3).repeat(2),16),d=parseInt(_.slice(3,4).repeat(2),16),l.toColor(a,h,d);case 5:return a=parseInt(_.slice(1,2).repeat(2),16),h=parseInt(_.slice(2,3).repeat(2),16),d=parseInt(_.slice(3,4).repeat(2),16),n=parseInt(_.slice(4,5).repeat(2),16),l.toColor(a,h,d,n);case 7:return{css:_,rgba:(parseInt(_.slice(1),16)<<8|255)>>>0};case 9:return{css:_,rgba:parseInt(_.slice(1),16)>>>0}}const m=_.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),h=parseInt(m[2]),d=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),l.toColor(a,h,d,n);if(!u||!p)throw new Error("css.toColor: Unsupported css format");if(u.fillStyle=p,u.fillStyle=_,typeof u.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[a,h,d,n]=u.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:l.toRgba(a,h,d,n),css:_}}}(v||(t.css=v={})),function(r){function u(p,_,m){const c=p/255,g=_/255,S=m/255;return .2126*(c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4))+.7152*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}r.relativeLuminance=function(p){return u(p>>16&255,p>>8&255,255&p)},r.relativeLuminance2=u}(o||(t.rgb=o={})),function(r){function u(_,m,c){const g=_>>24&255,S=_>>16&255,y=_>>8&255;let b=m>>24&255,w=m>>16&255,x=m>>8&255,T=i(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));for(;T<c&&(b>0||w>0||x>0);)b-=Math.max(0,Math.ceil(.1*b)),w-=Math.max(0,Math.ceil(.1*w)),x-=Math.max(0,Math.ceil(.1*x)),T=i(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));return(b<<24|w<<16|x<<8|255)>>>0}function p(_,m,c){const g=_>>24&255,S=_>>16&255,y=_>>8&255;let b=m>>24&255,w=m>>16&255,x=m>>8&255,T=i(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));for(;T<c&&(b<255||w<255||x<255);)b=Math.min(255,b+Math.ceil(.1*(255-b))),w=Math.min(255,w+Math.ceil(.1*(255-w))),x=Math.min(255,x+Math.ceil(.1*(255-x))),T=i(o.relativeLuminance2(b,w,x),o.relativeLuminance2(g,S,y));return(b<<24|w<<16|x<<8|255)>>>0}r.blend=function(_,m){if(n=(255&m)/255,n===1)return m;const c=m>>24&255,g=m>>16&255,S=m>>8&255,y=_>>24&255,b=_>>16&255,w=_>>8&255;return a=y+Math.round((c-y)*n),h=b+Math.round((g-b)*n),d=w+Math.round((S-w)*n),l.toRgba(a,h,d)},r.ensureContrastRatio=function(_,m,c){const g=o.relativeLuminance(_>>8),S=o.relativeLuminance(m>>8);if(i(g,S)<c){if(S<g){const w=u(_,m,c),x=i(g,o.relativeLuminance(w>>8));if(x<c){const T=p(_,m,c);return x>i(g,o.relativeLuminance(T>>8))?w:T}return w}const y=p(_,m,c),b=i(g,o.relativeLuminance(y>>8));if(b<c){const w=u(_,m,c);return b>i(g,o.relativeLuminance(w>>8))?y:w}return y}},r.reduceLuminance=u,r.increaseLuminance=p,r.toChannels=function(_){return[_>>24&255,_>>16&255,_>>8&255,255&_]}}(e||(t.rgba=e={})),t.toPaddedHex=s,t.contrastRatio=i},345:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.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 h=0;h<this._listeners.length;h++)if(this._listeners[h]===a)return void this._listeners.splice(h,1)}}})),this._event}fire(a,h){const d=[];for(let n=0;n<this._listeners.length;n++)d.push(this._listeners[n]);for(let n=0;n<d.length;n++)d[n].call(void 0,a,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,h){return a(d=>h.fire(d))},t.runAndSubscribe=function(a,h){return h(void 0),a(d=>h(d))}},859:(O,t)=>{function a(h){for(const d of h)d.dispose();h.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const d=this._disposables.indexOf(h);d!==-1&&this._disposables.splice(d,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(h){return{dispose:h}},t.disposeArray=a,t.getDisposeArrayDisposable=function(h){return{dispose:()=>a(h)}}},485:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(d,n,l){this._data[d]||(this._data[d]={}),this._data[d][n]=l}get(d,n){return this._data[d]?this._data[d][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(h,d,n,l,f){this._data.get(h,d)||this._data.set(h,d,new a),this._data.get(h,d).set(n,l,f)}get(h,d,n,l){return this._data.get(h,d)?.get(n,l)}clear(){this._data.clear()}}},399:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,h=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const d=a.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),t.isIpad=h==="iPad",t.isIphone=h==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),t.isLinux=h.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},385:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const h=a(399);class d{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 v=0,o=0,e=f.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),o=Math.max(v,o),s=f.timeRemaining(),1.5*o>s)return e-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-v))}ms`),void this._start();e=s}this.clear()}}class n extends d{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const v=Date.now()+f;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(l){return requestIdleCallback(l)}_cancelCallback(l){cancelIdleCallback(l)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(l){this._queue.clear(),this._queue.enqueue(l)}flush(){this._queue.flush()}}},147:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new h}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}}t.AttributeData=a;class h{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,l=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=l}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=h},782:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const h=a(133),d=a(855),n=a(147);class l extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(v){const o=new l;return o.setFromCharData(v),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(v){this.fg=v[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(v[d.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(v[d.CHAR_DATA_CHAR_INDEX].length===2){const e=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const s=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|v[d.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[d.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=v[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=l},855:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,h=0,d=a.length){let n="";for(let l=h;l<d;++l){let f=a[l];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,h){const d=a.length;if(!d)return 0;let n=0,l=0;if(this._interim){const f=a.charCodeAt(l++);56320<=f&&f<=57343?h[n++]=1024*(this._interim-55296)+f-56320+65536:(h[n++]=this._interim,h[n++]=f),this._interim=0}for(let f=l;f<d;++f){const v=a.charCodeAt(f);if(55296<=v&&v<=56319){if(++f>=d)return this._interim=v,n;const o=a.charCodeAt(f);56320<=o&&o<=57343?h[n++]=1024*(v-55296)+o-56320+65536:(h[n++]=v,h[n++]=o)}else v!==65279&&(h[n++]=v)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,h){const d=a.length;if(!d)return 0;let n,l,f,v,o=0,e=0,s=0;if(this.interim[0]){let u=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let _,m=0;for(;(_=63&this.interim[++m])&&m<4;)p<<=6,p|=_;const c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,g=c-m;for(;s<g;){if(s>=d)return 0;if(_=a[s++],(192&_)!=128){s--,u=!0;break}this.interim[m++]=_,p<<=6,p|=63&_}u||(c===2?p<128?s--:h[o++]=p:c===3?p<2048||p>=55296&&p<=57343||p===65279||(h[o++]=p):p<65536||p>1114111||(h[o++]=p)),this.interim.fill(0)}const i=d-4;let r=s;for(;r<d;){for(;!(!(r<i)||128&(n=a[r])||128&(l=a[r+1])||128&(f=a[r+2])||128&(v=a[r+3]));)h[o++]=n,h[o++]=l,h[o++]=f,h[o++]=v,r+=4;if(n=a[r++],n<128)h[o++]=n;else if((224&n)==192){if(r>=d)return this.interim[0]=n,o;if(l=a[r++],(192&l)!=128){r--;continue}if(e=(31&n)<<6|63&l,e<128){r--;continue}h[o++]=e}else if((240&n)==224){if(r>=d)return this.interim[0]=n,o;if(l=a[r++],(192&l)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=l,o;if(f=a[r++],(192&f)!=128){r--;continue}if(e=(15&n)<<12|(63&l)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;h[o++]=e}else if((248&n)==240){if(r>=d)return this.interim[0]=n,o;if(l=a[r++],(192&l)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=l,o;if(f=a[r++],(192&f)!=128){r--;continue}if(r>=d)return this.interim[0]=n,this.interim[1]=l,this.interim[2]=f,o;if(v=a[r++],(192&v)!=128){r--;continue}if(e=(7&n)<<18|(63&l)<<12|(63&f)<<6|63&v,e<65536||e>1114111)continue;h[o++]=e}}return o}}},776:function(O,t,a){var h=this&&this.__decorate||function(e,s,i,r){var u,p=arguments.length,_=p<3?s:r===null?r=Object.getOwnPropertyDescriptor(s,i):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(e,s,i,r);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(_=(p<3?u(_):p>3?u(s,i,_):u(s,i))||_);return p>3&&_&&Object.defineProperty(s,i,_),_},d=this&&this.__param||function(e,s){return function(i,r){s(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(859),l=a(97),f={trace:l.LogLevelEnum.TRACE,debug:l.LogLevelEnum.DEBUG,info:l.LogLevelEnum.INFO,warn:l.LogLevelEnum.WARN,error:l.LogLevelEnum.ERROR,off:l.LogLevelEnum.OFF};let v,o=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=l.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),v=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let s=0;s<e.length;s++)typeof e[s]=="function"&&(e[s]=e[s]())}_log(e,s,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...i)}trace(e,...s){this._logLevel<=l.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,s)}debug(e,...s){this._logLevel<=l.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,s)}info(e,...s){this._logLevel<=l.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,s)}warn(e,...s){this._logLevel<=l.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,s)}error(e,...s){this._logLevel<=l.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,s)}};t.LogService=o=h([d(0,l.IOptionsService)],o),t.setTraceLogger=function(e){v=e},t.traceCall=function(e,s,i){if(typeof i.value!="function")throw new Error("not supported");const r=i.value;i.value=function(...u){if(v.logLevel!==l.LogLevelEnum.TRACE)return r.apply(this,u);v.trace(`GlyphRenderer#${r.name}(${u.map(_=>JSON.stringify(_)).join(", ")})`);const p=r.apply(this,u);return v.trace(`GlyphRenderer#${r.name} return`,p),p}}},726:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",h="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(d){return d[h]||[]},t.createDecorator=function(d){if(t.serviceRegistry.has(d))return t.serviceRegistry.get(d);const n=function(l,f,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(o,e,s){e[a]===e?e[h].push({id:o,index:s}):(e[h]=[{id:o,index:s}],e[a]=e)})(n,l,v)};return n.toString=()=>d,t.serviceRegistry.set(d,n),n}},97:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const h=a(726);var d;t.IBufferService=(0,h.createDecorator)("BufferService"),t.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),t.ICoreService=(0,h.createDecorator)("CoreService"),t.ICharsetService=(0,h.createDecorator)("CharsetService"),t.IInstantiationService=(0,h.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"}(d||(t.LogLevelEnum=d={})),t.ILogService=(0,h.createDecorator)("LogService"),t.IOptionsService=(0,h.createDecorator)("OptionsService"),t.IOscLinkService=(0,h.createDecorator)("OscLinkService"),t.IUnicodeService=(0,h.createDecorator)("UnicodeService"),t.IDecorationService=(0,h.createDecorator)("DecorationService")}},re={};function Z(O){var t=re[O];if(t!==void 0)return t.exports;var a=re[O]={exports:{}};return he[O].call(a.exports,a,a.exports,Z),a.exports}var oe={};return(()=>{var O=oe;Object.defineProperty(O,"__esModule",{value:!0}),O.WebglAddon=void 0;const t=Z(345),a=Z(859),h=Z(399),d=Z(666),n=Z(776);class l extends a.Disposable{constructor(v){if(h.isSafari&&(0,h.getSafariVersion)()<16){const o={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",o))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=v,this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new t.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new t.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(v){const o=v._core;if(!v.element)return void this.register(o.onWillOpen(()=>this.activate(v)));this._terminal=v;const e=o.coreService,s=o.optionsService,i=o,r=i._renderService,u=i._characterJoinerService,p=i._charSizeService,_=i._coreBrowserService,m=i._decorationService,c=i._logService,g=i._themeService;(0,n.setTraceLogger)(c),this._renderer=this.register(new d.WebglRenderer(v,u,p,_,e,m,s,g,this._preserveDrawingBuffer)),this.register((0,t.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,t.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this.register((0,a.toDisposable)(()=>{const S=this._terminal._core._renderService;S.setRenderer(this._terminal._core._createRenderer()),S.handleResize(v.cols,v.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}O.WebglAddon=l})(),oe})())}(ye)),ye.exports}export{Ie as a,Fe as b,He as c,Pe as r};