1import{g as se}from"./_commonjsHelpers.725317a4.js";function re(Y,Z){for(var G=0;G<Z.length;G++){const q=Z[G];if(typeof q!="string"&&!Array.isArray(q)){for(const K in q)if(K!=="default"&&!(K in Y)){const X=Object.getOwnPropertyDescriptor(q,K);X&&Object.defineProperty(Y,K,X.get?X:{enumerable:!0,get:()=>q[K]})}}}return Object.freeze(Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}))}var Q={exports:{}};(function(Y,Z){(function(G,q){Y.exports=q()})(self,()=>(()=>{var G={4567:function(O,r,o){var c=this&&this.__decorate||function(t,n,a,f){var S,l=arguments.length,p=l<3?n:f===null?f=Object.getOwnPropertyDescriptor(n,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,n,a,f);else for(var w=t.length-1;w>=0;w--)(S=t[w])&&(p=(l<3?S(p):l>3?S(n,a,p):S(n,a))||p);return l>3&&p&&Object.defineProperty(n,a,p),p},v=this&&this.__param||function(t,n){return function(a,f){n(a,f,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const d=o(9042),_=o(6114),g=o(9924),u=o(844),h=o(5596),e=o(4725),s=o(3656);let i=class extends u.Disposable{constructor(t,n){super(),this._terminal=t,this._renderService=n,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,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=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new g.TimeBasedDebouncer(this._announceCharacters.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._liveRegionDebouncer),this.register(this._terminal.onResize(a=>this._handleResize(a.rows))),this.register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(a=>this._handleChar(a))),this.register(this._terminal.onLineFeed(()=>this._handleChar(` 2`))),this.register(this._terminal.onA11yTab(a=>this._handleTab(a))),this.register(this._terminal.onKey(a=>this._handleKey(a.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new h.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,s.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,u.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let n=0;n<t;n++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===` 3`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),_.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,_.isMac&&this._liveRegion.remove()}_handleKey(t){this._clearLiveRegion(),/\p{Control}/u.test(t)||this._charsToConsume.push(t)}
vendor: 4,626 bytes, line 3
3_refreshRows(t,n){this._liveRegionDebouncer.refresh(t,n,this._terminal.rows)}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,n){const a=t.target,f=this._rowElements[n===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||t.relatedTarget!==f)return;let S,l;if(n===0?(S=a,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(S=this._rowElements.shift(),l=a,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),n===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i=c([v(1,e.IRenderService)],i),r.AccessibilityManager=i},3614:(O,r)=>{function o(_){return _.replace(/\r?\n/g,"\r")}function c(_,g){return g?"\x1B[200~"+_+"\x1B[201~":_}function v(_,g,u){_=c(_=o(_),u.decPrivateModes.bracketedPasteMode),u.triggerDataEvent(_,!0),g.value=""}function d(_,g,u){const h=u.getBoundingClientRect(),e=_.clientX-h.left-10,s=_.clientY-h.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${e}px`,g.style.top=`${s}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=c,r.copyHandler=function(_,g){_.clipboardData&&_.clipboardData.setData("text/plain",g.selectionText),_.preventDefault()},r.handlePasteEvent=function(_,g,u){_.stopPropagation(),_.clipboardData&&v(_.clipboardData.getData("text/plain"),g,u)},r.paste=v,r.moveTextAreaUnderMouseCursor=d,r.rightClickHandler=function(_,g,u,h,e){d(_,g,u),e&&h.rightClickSelect(_),g.value=h.selectionText,g.select()}},7239:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const c=o(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(v,d,_){this._css.set(v,d,_)}getCss(v,d){return this._css.get(v,d)}setColor(v,d,_){this._color.set(v,d,_)}getColor(v,d){return this._color.get(v,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,c,v,d){o.addEventListener(c,v,d);let _=!1;return{dispose:()=>{_||(_=!0,o.removeEventListener(c,v,d))}}}},6465:function(O,r,o){var c=this&&this.__decorate||function(e,s,i,t){var n,a=arguments.length,f=a<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,i,t);else for(var S=e.length-1;S>=0;S--)(n=e[S])&&(f=(a<3?n(f):a>3?n(s,i,f):n(s,i))||f);return a>3&&f&&Object.defineProperty(s,i,f),f},v=this&&this.__param||function(e,s){return function(i,t){s(i,t,e)}};
3Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const d=o(2585),_=o(8460),g=o(844),u=o(3656);let h=class extends g.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}get currentLink(){return this._currentLink}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const s=this._linkProviders.indexOf(e);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(e,s,i){this._element=e,this._mouseService=s,this._renderService=i,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const i=e.composedPath();for(let t=0;t<i.length;t++){const n=i[t];if(n.classList.contains("xterm"))break;if(n.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,s){var i,t;this._activeProviderReplies&&s||((i=this._activeProviderReplies)===null||i===void 0||i.forEach(a=>{a==null||a.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(const[a,f]of this._linkProviders.entries())s?!((t=this._activeProviderReplies)===null||t===void 0)&&t.get(a)&&(n=this._checkLinkProviderResult(a,e,n)):f.provideLinks(e.y,S=>{var l,p;if(this._isMouseOut)return;const w=S==null?void 0:S.map(b=>({link:b}));(l=this._activeProviderReplies)===null||l===void 0||l.set(a,w),n=this._checkLinkProviderResult(a,e,n),((p=this._activeProviderReplies)===null||p===void 0?void 0:p.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,s){const i=new Set;for(let t=0;t<s.size;t++){const n=s.get(t);if(n)for(let a=0;a<n.length;a++){const f=n[a],S=f.link.range.start.y<e?0:f.link.range.start.x,l=f.link.range.end.y>e?this._bufferService.cols:f.link.range.end.x;for(let p=S;p<=l;p++){if(i.has(p)){n.splice(a--,1);break}i.add(p)}}}}_checkLinkProviderResult(e,s,i){var t;if(!this._activeProviderReplies)return i;const n=this._activeProviderReplies.get(e);let a=!1;for(let f=0;f<e;f++)this._activeProviderReplies.has(f)&&!this._activeProviderReplies.get(f)||(a=!0);if(!a&&n){const f=n.find(S=>this._linkAtPosition(S.link,s));f&&(i=!0,this._handleNewLink(f))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(let f=0;f<this._activeProviderReplies.size;f++){const S=(t=this._activeProviderReplies.get(f))===null||t===void 0?void 0:t.find(l=>this._linkAtPosition(l.link,s));if(S){i=!0,this._handleNewLink(S);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,s){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!s||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables)
3)}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(e.link,s)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var i,t;return(t=(i=this._currentLink)===null||i===void 0?void 0:i.state)===null||t===void 0?void 0:t.decorations.pointerCursor},set:i=>{var t,n;!((t=this._currentLink)===null||t===void 0)&&t.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&((n=this._element)===null||n===void 0||n.classList.toggle("xterm-cursor-pointer",i)))}},underline:{get:()=>{var i,t;return(t=(i=this._currentLink)===null||i===void 0?void 0:i.state)===null||t===void 0?void 0:t.decorations.underline},set:i=>{var t,n,a;!((t=this._currentLink)===null||t===void 0)&&t.state&&((a=(n=this._currentLink)===null||n===void 0?void 0:n.state)===null||a===void 0?void 0:a.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;const t=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent&&this._element)){const a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,s,i){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(i,s.text)}_fireUnderlineEvent(e,s){const i=e.range,t=this._bufferService.buffer.ydisp,n=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-t-1,i.end.x,i.end.y-t-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(n)}_linkLeave(e,s,i){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(i,s.text)}_linkAtPosition(e,s){const i=e.range.start.y*this._bufferService.cols+e.range.start.x,t=e.range.end.y*this._bufferService.cols+e.range.end.x,n=s.y*this._bufferService.cols+s.x;return i<=n&&n<=t}_positionFromMouseEvent(e,s,i){const t=i.getCoords(e,s,this._bufferService.cols,this._bufferService.rows);if(t)return{x:t[0],y:t[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,s,i,t,n){return{x1:e,y1:s,x2:i,y2:t,cols:this._bufferService.cols,fg:n}}};h=c([v(0,d.IBufferService)],h),r.Linkifier2=h},9042:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,r,o){var c=this&&this.__decorate||function(h,e,s,i){var t,n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(h,e,s,i);else for(var f=h.length-1;f>=0;f--)(t=h[f])&&(a=(n<3?t(a):n>3?t(e,s,a):t(e,s))||a);return n>3&&a&&Object.defineProperty(e,s,a),a},v=this&&this.__param||function(h,e){return function(s,i){e(s,i,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const d=o(511),_=o(2585);let g=class{constructor(h,e,s){this._bufferService=h,this._optionsService=e,this._oscLinkService=s}provideLinks(h,e){var s;const i=this._bufferService.buffer.lines.get(h-1);if(!i)return void e(void 0);const t=[],n=this._optionsService.rawOptions.linkHandler,a=new d.CellData,f=i.getTrimmedLength();let S=-1,l=-1,p=!1;for(let w=0;w<f;
3w++)if(l!==-1||i.hasContent(w)){if(i.loadCell(w,a),a.hasExtendedAttrs()&&a.extended.urlId){if(l===-1){l=w,S=a.extended.urlId;continue}p=a.extended.urlId!==S}else l!==-1&&(p=!0);if(p||l!==-1&&w===f-1){const b=(s=this._oscLinkService.getLinkData(S))===null||s===void 0?void 0:s.uri;if(b){const y={start:{x:l+1,y:h},end:{x:w+(p||w!==f-1?0:1),y:h}};let k=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{const x=new URL(b);["http:","https:"].includes(x.protocol)||(k=!0)}catch{k=!0}k||t.push({text:b,range:y,activate:(x,I)=>n?n.activate(x,I,y):u(0,I),hover:(x,I)=>{var A;return(A=n==null?void 0:n.hover)===null||A===void 0?void 0:A.call(n,x,I,y)},leave:(x,I)=>{var A;return(A=n==null?void 0:n.leave)===null||A===void 0?void 0:A.call(n,x,I,y)}})}p=!1,a.hasExtendedAttrs()&&a.extended.urlId?(l=w,S=a.extended.urlId):(l=-1,S=-1)}}e(t)}};function u(h,e){if(confirm(`Do you want to navigate to ${e}? 4 5WARNING: 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")}}g=c([v(0,_.IBufferService),v(1,_.IOptionsService),v(2,_.IOscLinkService)],g),r.OscLinkProvider=g},6193:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,c){this._parentWindow=o,this._renderCallback=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,v){this._rowCount=v,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._parentWindow.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 o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},5596:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const c=o(844);class v extends c.Disposable{constructor(_){super(),this._parentWindow=_,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,c.toDisposable)(()=>{this.clearListener()}))}setListener(_){this._listener&&this.clearListener(),this._listener=_,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)===null||_===void 0||_.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=v},3236:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const c=o(2950),v=o(1680),d=o(3614),_=o(2584),g=o(5435),u=o(9312),h=o(6114),e=o(3656),s=o(9042),i=o(4567),t=o(1296),n=o(7399),a=o(8460),f=o(8437),S=o(3230),l=o(4725),p=o(428),w=o(8934),b=o(6465),y=o(5114),k=o(8969),x=(o(8055),o(4269)),I=(o(5941),o(3107)),A=o(5744),m=o(9074),E=o(2585),R=o(3730),D=o(844),B=o(6731),F=typeof window<"u"?window.document:null;class U extends k.CoreTerminal{constructor(L={}){super(L),this.browser=h,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new a.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new a.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new a.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new a.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new a.EventEmitter),this._onBlur=this.register(new a.EventEmitter),this._onA11yCharEmitter=this.register(new a.EventEmitter),this._onA11yTabEmitter=this.register(new a.EventEmitter),this._onWillOpen=this.register(new a.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(b.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(R.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(m.DecorationService),this._instantiationService.setService(E.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((C,T)=>this.refresh(C,T))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(C=>this._reportWindowsOptions(C))),this.register(this._inputHandler.onColor(C=>this._handleColorEvent(C))),this.register((0,a.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,a.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,a.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,a.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(C=>
5this._afterResize(C.cols,C.rows))),this.register((0,D.toDisposable)(()=>{var C,T;this._customKeyEventHandler=void 0,(T=(C=this.element)===null||C===void 0?void 0:C.parentNode)===null||T===void 0||T.removeChild(this.element)}))}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}_handleColorEvent(L){}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(L){var C;L?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=this._instantiationService.createInstance(i.AccessibilityManager,this)):((C=this._accessibilityManager)===null||C===void 0||C.dispose(),this._accessibilityManager=void 0)}_handleTextAreaFocus(L){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(_.C0.ESC+"[I"),this.updateCursorStyle(L),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var L;return(L=this.textarea)===null||L===void 0?void 0:L.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(_.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 L=this.buffer.ybase+this.buffer.y,C=this.buffer.lines.get(L);if(!C)return;const T=Math.min(this.buffer.x,this.cols-1),M=this._renderService.dimensions.css.cell.height,N=C.getWidth(T),H=this._renderService.dimensions.css.cell.width*N,$=this.buffer.y*this._renderService.dimensions.css.cell.height,j=T*this._renderService.dimensions.css.cell.width;this.textarea.style.left=j+"px",this.textarea.style.top=$+"px",this.textarea.style.width=H+"px",this.textarea.style.height=M+"px",this.textarea.style.lineHeight=M+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,e.addDisposableDomListener)(this.element,"copy",C=>{this.hasSelection()&&(0,d.copyHandler)(C,this._selectionService)}));const L=C=>(0,d.handlePasteEvent)(C,this.textarea,this.coreService);this.register((0,e.addDisposableDomListener)(this.textarea,"paste",L)),this.register((0,e.addDisposableDomListener)(this.element,"paste",L)),h.isFirefox?this.register((0,e.addDisposableDomListener)(this.element,"mousedown",C=>{C.button===2&&(0,d.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,e.addDisposableDomListener)(this.element,"contextmenu",C=>
5{(0,d.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),h.isLinux&&this.register((0,e.addDisposableDomListener)(this.element,"auxclick",C=>{C.button===1&&(0,d.moveTextAreaUnderMouseCursor)(C,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,e.addDisposableDomListener)(this.textarea,"keyup",L=>this._keyUp(L),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keydown",L=>this._keyDown(L),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keypress",L=>this._keyPress(L),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionupdate",L=>this._compositionHelper.compositionupdate(L))),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,e.addDisposableDomListener)(this.textarea,"input",L=>this._inputEvent(L),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(L){var C;if(!L)throw new Error("Terminal requires a parent element.");L.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=L.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),L.appendChild(this.element);const T=F.createDocumentFragment();this._viewportElement=F.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),T.appendChild(this._viewportElement),this._viewportScrollArea=F.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=F.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=F.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),T.appendChild(this.screenElement),this.textarea=F.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",s.promptLabel),h.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._instantiationService.createInstance(y.CoreBrowserService,this.textarea,(C=this._document.defaultView)!==null&&C!==void 0?C:window),this._instantiationService.setService(l.ICoreBrowserService,this._coreBrowserService),this.register((0,e.addDisposableDomListener)(this.textarea,"focus",M=>this._handleTextAreaFocus(M))),this.register((0,e.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(l.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(l.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(x.CharacterJoinerService),this._instantiationService.setService(l.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(l.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(M=>this._onRender.fire(M))),this.onResize(M=>this._renderService.resize(M.cols,M.rows)),this._compositionView=F.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(T);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(w.MouseService),this._instantiationService.setService(l.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(v.Viewport,M=>this.scrollLines(M,!0,1),this._viewportElement,this._viewportScrollArea),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(u.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(l.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(M=>this.scrollLines(M.amount,M.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()}
5)),this.register(this._onScroll.event(M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,e.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(I.BufferDecorationRenderer,this.screenElement)),this.register((0,e.addDisposableDomListener)(this.element,"mousedown",M=>this._selectionService.handleMouseDown(M))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=this._instantiationService.createInstance(i.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",M=>this._handleScreenReaderModeOptionChange(M))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const L=this,C=this.element;function T(H){const $=L._mouseService.getMouseReportCoords(H,L.screenElement);if(!$)return!1;let j,z;switch(H.overrideType||H.type){case"mousemove":z=32,H.buttons===void 0?(j=3,H.button!==void 0&&(j=H.button<3?H.button:3)):j=1&H.buttons?0:4&H.buttons?1:2&H.buttons?2:3;break;case"mouseup":z=0,j=H.button<3?H.button:3;break;case"mousedown":z=1,j=H.button<3?H.button:3;break;case"wheel":if(L.viewport.getLinesScrolled(H)===0)return!1;z=H.deltaY<0?0:1,j=4;break;default:return!1}return!(z===void 0||j===void 0||j>4)&&L.coreMouseService.triggerMouseEvent({col:$.col,row:$.row,x:$.x,y:$.y,button:j,action:z,ctrl:H.ctrlKey,alt:H.altKey,shift:H.shiftKey})}const M={mouseup:null,wheel:null,mousedrag:null,mousemove:null},N={mouseup:H=>(T(H),H.buttons||(this._document.removeEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.removeEventListener("mousemove",M.mousedrag)),this.cancel(H)),wheel:H=>(T(H),this.cancel(H,!0)),mousedrag:H=>{H.buttons&&T(H)},mousemove:H=>{H.buttons||T(H)}};this.register(this.coreMouseService.onProtocolChange(H=>{H?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(H)),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&H?M.mousemove||(C.addEventListener("mousemove",N.mousemove),M.mousemove=N.mousemove):(C.removeEventListener("mousemove",M.mousemove),M.mousemove=null),16&H?M.wheel||(C.addEventListener("wheel",N.wheel,{passive:!1}),M.wheel=N.wheel):(C.removeEventListener("wheel",M.wheel),M.wheel=null),2&H?M.mouseup||(M.mouseup=N.mouseup):(this._document.removeEventListener("mouseup",M.mouseup),M.mouseup=null),4&H?M.mousedrag||(M.mousedrag=N.mousedrag):(this._document.removeEventListener("mousemove",M.mousedrag),M.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,e.addDisposableDomListener)(C,"mousedown",H=>{if(H.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(H))return T(H),M.mouseup&&this._document.addEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.addEventListener("mousemove",M.mousedrag),this.cancel(H)})),this.register((0,e.addDisposableDomListener)(C,"wheel",H=>{if(!M.wheel){if(!this.buffer.hasScrollback){const $=this.viewport.getLinesScrolled(H);if($===0)return;const j=_.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(H.deltaY<0?"A":"B");let z="";for(let J=0;J<Math.abs($);J++)z+=j;return this.coreService.triggerDataEvent(z,!0),this.cancel(H,!0)}return this.viewport.handleWheel(H)?this.cancel(H):void 0}},{passive:!1})),this.register((0,e.addDisposableDomListener)(C,"touchstart",H=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(H),this.cancel(H)},{passive:!0})),this.register((0,e.addDisposableDomListener)(C,"touchmove",H=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(H)?void 0:this.cancel(H)},{passive:!1}))}refresh(L,C){var T;(T=this._renderService)===null||T===void 0||T.refreshRows(L,C)}updateCursorStyle(L){var C;!((C=this._selectionService)===null||C===void 0)&&C.shouldColumnSelect(L)?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(L,C,T=0){super.scrollLines(L,C,T),this.refresh(0,this.rows-1)}paste(L){(0,d.paste)(L,this.textarea,this.coreService)}attachCustomKeyEventHandler(L){this._customKeyEventHandler=L}
5registerLinkProvider(L){return this.linkifier2.registerLinkProvider(L)}registerCharacterJoiner(L){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const C=this._characterJoinerService.register(L);return this.refresh(0,this.rows-1),C}deregisterCharacterJoiner(L){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(L)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(L){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+L)}registerDecoration(L){return this._decorationService.registerDecoration(L)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(L,C,T){this._selectionService.setSelection(L,C,T)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var L;(L=this._selectionService)===null||L===void 0||L.clearSelection()}selectAll(){var L;(L=this._selectionService)===null||L===void 0||L.selectAll()}selectLines(L,C){var T;(T=this._selectionService)===null||T===void 0||T.selectLines(L,C)}_keyDown(L){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1)return!1;const C=this.browser.isMac&&this.options.macOptionIsMeta&&L.altKey;if(!C&&!this._compositionHelper.keydown(L))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;C||L.key!=="Dead"&&L.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const T=(0,n.evaluateKeyboardEvent)(L,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(L),T.type===3||T.type===2){const M=this.rows-1;return this.scrollLines(T.type===2?-M:M),this.cancel(L,!0)}return T.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,L)||(T.cancel&&this.cancel(L,!0),!T.key||!!(L.key&&!L.ctrlKey&&!L.altKey&&!L.metaKey&&L.key.length===1&&L.key.charCo
5deAt(0)>=65&&L.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(T.key!==_.C0.ETX&&T.key!==_.C0.CR||(this.textarea.value=""),this._onKey.fire({key:T.key,domEvent:L}),this._showCursor(),this.coreService.triggerDataEvent(T.key,!0),!this.optionsService.rawOptions.screenReaderMode||L.altKey||L.ctrlKey?this.cancel(L,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(L,C){const T=L.isMac&&!this.options.macOptionIsMeta&&C.altKey&&!C.ctrlKey&&!C.metaKey||L.isWindows&&C.altKey&&C.ctrlKey&&!C.metaKey||L.isWindows&&C.getModifierState("AltGraph");return C.type==="keypress"?T:T&&(!C.keyCode||C.keyCode>47)}_keyUp(L){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1||(function(C){return C.keyCode===16||C.keyCode===17||C.keyCode===18}(L)||this.focus(),this.updateCursorStyle(L),this._keyPressHandled=!1)}_keyPress(L){let C;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(L)===!1)return!1;if(this.cancel(L),L.charCode)C=L.charCode;else if(L.which===null||L.which===void 0)C=L.keyCode;else{if(L.which===0||L.charCode===0)return!1;C=L.which}return!(!C||(L.altKey||L.ctrlKey||L.metaKey)&&!this._isThirdLevelShift(this.browser,L)||(C=String.fromCharCode(C),this._onKey.fire({key:C,domEvent:L}),this._showCursor(),this.coreService.triggerDataEvent(C,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(L){if(L.data&&L.inputType==="insertText"&&(!L.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const C=L.data;return this.coreService.triggerDataEvent(C,!0),this.cancel(L),!0}return!1}resize(L,C){L!==this.cols||C!==this.rows?super.resize(L,C):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(L,C){var T,M;(T=this._charSizeService)===null||T===void 0||T.measure(),(M=this.viewport)===null||M===void 0||M.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 L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(f.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){var L,C;this.options.rows=this.rows,this.options.cols=this.cols;const T=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)===null||L===void 0||L.reset(),this._decorationService.reset(),this._customKeyEventHandler=T,this.refresh(0,this.rows-1),(C=this.viewport)===null||C===void 0||C.syncScrollArea()}clearTextureAtlas(){var L;(L=this._renderService)===null||L===void 0||L.clearTextureAtlas()}_reportFocus(){}_reportWindowsOptions(L){if(this._renderService)switch(L){case g.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const C=this._renderService.dimensions.css.canvas.width.toFixed(0),T=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${_.C0.ESC}[4;${T};${C}t`);break;case g.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const M=this._renderService.dimensions.css.cell.width.toFixed(0),N=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${_.C0.ESC}[6;${N};${M}t`)}}cancel(L,C){if(this.options.cancelEvents||C)return L.preventDefault(),L.stopPropagation(),!1}}r.Terminal=U},9924:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,v){this._rowCount=v,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,g=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(O,r,o){var c=this&&this.__decorate||function(e,s,i,t){var n,a=arguments.length,f=a<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,i,t);else for(var S=e.length-1;S>=0;S--)(n=e[S])&&(f=(a<3?n(f):a>3?n(s,i,f):n(s,i))||f);return a>3&&f&&Object.defineProperty(s,i,f),f},v=this&&this.__param||function(e,s){return function(i,t){s(i,t,e)}};
5Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const d=o(844),_=o(3656),g=o(4725),u=o(2585);let h=class extends d.Disposable{constructor(e,s,i,t,n,a,f,S,l){super(),this._scrollLines=e,this._viewportElement=s,this._scrollArea=i,this._bufferService=t,this._optionsService=n,this._charSizeService=a,this._renderService=f,this._coreBrowserService=S,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.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(p=>this._activeBuffer=p.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(p=>this._renderDimensions=p)),this._handleThemeChange(l.colors),this.register(l.onChangeColors(p=>this._handleThemeChange(p))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea(),0)}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){if(e)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._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(s)}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<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(e,s){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHe
5ight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){const s=this._getPixelsScrolled(e);return s!==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+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(e,s))}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(e,s){var i;let t,n="";const a=[],f=s??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let l=e;l<f;l++){const p=S.get(l);if(!p)continue;const w=(i=S.get(l+1))===null||i===void 0?void 0:i.isWrapped;if(n+=p.translateToString(!w),!w||l===S.length-1){const b=document.createElement("div");b.textContent=n,a.push(b),n.length>0&&(t=b),n=""}}return{bufferElements:a,cursorElement:t}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(e,s){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&s.altKey||i==="ctrl"&&s.ctrlKey||i==="shift"&&s.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){const s=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(e,s))}};h=c([v(3,u.IBufferService),v(4,u.IOptionsService),v(5,g.ICharSizeService),v(6,g.IRenderService),v(7,g.ICoreBrowserService),v(8,g.IThemeService)],h),r.Viewport=h},3107:function(O,r,o){var c=this&&this.__decorate||function(e,s,i,t){var n,a=arguments.length,f=a<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,i,t);else for(var S=e.length-1;S>=0;S--)(n=e[S])&&(f=(a<3?n(f):a>3?n(s,i,f):n(s,i))||f);return a>3&&f&&Object.defineProperty(s,i,f),f},v=this&&this.__param||function(e,s){return function(i,t){s(i,t,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const d=o(3656),_=o(4725),g=o(844),u=o(2585);let h=class extends g.Disposable{constructor(e,s,i,t){super(),this._screenElement=e,this._bufferService=s,this._decorationService=i,this._renderService=t,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((0,d.addDisposableDomListener)(window,"resize",()=>
5this._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(n=>this._removeDecoration(n))),this.register((0,g.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 e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var s,i;const t=document.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((s=e==null?void 0:e.options)===null||s===void 0?void 0:s.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const n=(i=e.options.x)!==null&&i!==void 0?i:0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){const s=e.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i)),i.style.top=s*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(i)}}_refreshXPosition(e,s=e.element){var i;if(!s)return;const t=(i=e.options.x)!==null&&i!==void 0?i:0;(e.options.anchor||"left")==="right"?s.style.right=t?t*this._renderService.dimensions.css.cell.width+"px":"":s.style.left=t?t*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){var s;(s=this._decorationElements.get(e))===null||s===void 0||s.remove(),this._decorationElements.delete(e),e.dispose()}};h=c([v(1,u.IBufferService),v(2,u.IDecorationService),v(3,_.IRenderService)],h),r.BufferDecorationRenderer=h},5871:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,v){return c>=o.startBufferLine-this._linePadding[v||"full"]&&c<=o.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(O,r,o){var c=this&&this.__decorate||function(n,a,f,S){var l,p=arguments.length,w=p<3?a:S===null?S=Object.getOwnPropertyDescriptor(a,f):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,a,f,S);else for(var b=n.length-1;b>=0;b--)(l=n[b])&&(w=(p<3?l(w):p>
53?l(a,f,w):l(a,f))||w);return p>3&&w&&Object.defineProperty(a,f,w),w},v=this&&this.__param||function(n,a){return function(f,S){a(f,S,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const d=o(5871),_=o(3656),g=o(4725),u=o(844),h=o(2585),e={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0};let t=class extends u.Disposable{constructor(n,a,f,S,l,p,w){var b;super(),this._viewportElement=n,this._screenElement=a,this._bufferService=f,this._decorationService=S,this._renderService=l,this._optionsService=p,this._coreBrowseService=w,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(b=this._viewportElement.parentElement)===null||b===void 0||b.insertBefore(this._canvas,this._viewportElement);const y=this._canvas.getContext("2d");if(!y)throw new Error("Ctx cannot be null");this._ctx=y,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,u.toDisposable)(()=>{var k;(k=this._canvas)===null||k===void 0||k.remove()}))}get _width(){return this._optionsService.options.overviewRulerWidth||0}_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(()=>
5this._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((0,_.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const n=Math.floor(this._canvas.width/3),a=Math.ceil(this._canvas.width/3);s.full=this._canvas.width,s.left=n,s.center=a,s.right=n,this._refreshDrawHeightConstants(),i.full=0,i.left=0,i.center=s.left,i.right=s.left+s.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,a=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowseService.dpr);e.left=a,e.center=a,e.right=a}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.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 a of this._decorationService.decorations)this._colorZoneStore.addDecoration(a);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const a of n)a.position!=="full"&&this._renderColorZone(a);for(const a of n)a.position==="full"&&this._renderColorZone(a);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(i[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-e[n.position||"full"]/2),s[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[n.position||"full"]))}_queueRefresh(n,a){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=a||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};t=c([v(2,h.IBufferService),v(3,h.IDecorationService),v(4,g.IRenderService),v(5,h.IOptionsService),v(6,g.ICoreBrowserService)],t),r.OverviewRulerRenderer=t},2950:function(O,r,o){var c=this&&this.__decorate||function(h,e,s,i){var t,n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(h,e,s,i);else for(var f=h.length-1;f>=0;f--)(t=h[f])&&(a=(n<3?t(a):n>3?t(e,s,a):t(e,s))||a);return n>3&&a&&Object.defineProperty(e,s,a),a},v=this&&this.__param||function(h,e){return function(s,i){e(s,i,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const d=o(4725),_=o(2585),g=o(2584);let u=class{constructor(h,e,s,i,t,n){this._textarea=h,this._compositionView=e,this._bufferService=s,this._optionsService=i,this._coreService=t,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}
5,this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){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 h=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,s=e.replace(h,"");this._dataAlreadySent=s,e.length>h.length?this._coreService.triggerDataEvent(s,!0):e.length<h.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):e.length===h.length&&e!==h&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(h){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,t=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=t+"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 n=this._compositionView.getBoundingClientRect();this._textarea.style.left=t+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}h||setTimeout(()=>this.updateCompositionElements(!0),0)}}};u=c([v(2,_.IBufferService),v(3,_.IOptionsService),v(4,_.ICoreService),v(5,d.IRenderService)],u),r.CompositionHelper=u},9806:(O,r)=>{function o(c,v,d){const _=d.getBoundingClientRect(),g=c.getComputedStyle(d),u=parseInt(g.getPropertyValue("padding-left")),h=parseInt(g.getPropertyValue("padding-top")),e=d.clientWidth/_.width;return[e*(v.clientX-_.left)-u,e*(v.clientY-_.top)-h]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=o,r.getCoords=function(c,v,d,_,g,u,h,e,s){if(!u)return;const i=o(c,v,d);return i?(i[0]=Math.ceil((i[0]+(s?h/2:0))/h),i[1]=Math.ceil(i[1]/e),i[0]=Math.min(Math.max(i[0],1),_+(s?1:0)),i[1]=Math.min(Math.max(i[1],1),g),i):void 0}},9504:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const c=o(2584);function v(e,s,i,t){const n=e-d(e,i),a=s-d(s,i),f=Math.abs(n-a)-function(S,l,p){let w=0;const b=S-d(S,p),y=l-d(l,p);for(let k=0;k<Math.abs(b-y);k++){const x=_(S,l)==="A"?-1:1,I=p.buffer.lines.get(b+x*k);I!=null&&I.isWrapped&&w++}return w}(e,s,i);return h(f,u(_(e,s),t))}function d(e,s){let i=0,t=s.buffer.lines.get(e),n=t==null?void 0:t.isWrapped;for(;n&&e>=0&&e<s.rows;)i++,t=s.buffer.lines.get(--e),n=t==null?void 0:t.isWrapped;return i}function _(e,s){return e>s?"A":"B"}function g(e,s,i,t,n,a){let f=e,S=s,l="";for(;f!==i||S!==t;)f+=n?1:-1,n&&f>a.cols-1?(l+=a.buffer.translateBufferLineToString(S,!1,e,f),f=0,e=0,S++):!n&&f<0&&(l+=a.buffer.translateBufferLineToString(S,!1,0,e+1),f=a.cols-1,e=f,S--);return l+a.buffer.translateBufferLineToString(S,!1,e,f)}function u(e,s){const i=s?"O":"[";return c.C0.ESC+i+e}function h(e,s){e=Math.floor(e);let i="";for(let t=0;t<e;t++)i+=s;return i}r.moveToCellSequence=function(e,s,i,t){const n=i.buffer.x,a=i.buffer.y;if(!i.buffer.hasScrollback)return function(l,p,w,b,y,k){return v(p,b,y,k).length===0?"":h(g(l,p,l,p-d(p,y),!1,y).length,u("D",k))}(n,a,0,s,i,t)+v(a,s,i,t)+function(l,p,w,b,y,k){let x;x=v(p,b,y,k).length>
50?b-d(b,y):p;const I=b,A=function(m,E,R,D,B,F){let U;return U=v(R,D,B,F).length>0?D-d(D,B):E,m<R&&U<=D||m>=R&&U<D?"C":"D"}(l,p,w,b,y,k);return h(g(l,x,w,I,A==="C",y).length,u(A,k))}(n,a,e,s,i,t);let f;if(a===s)return f=n>e?"D":"C",h(Math.abs(n-e),u(f,t));f=a>s?"D":"C";const S=Math.abs(a-s);return h(function(l,p){return p.cols-l}(a>s?e:n,i)+(S-1)*i.cols+1+((a>s?n:e)-1),u(f,t))}},1296:function(O,r,o){var c=this&&this.__decorate||function(b,y,k,x){var I,A=arguments.length,m=A<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,k):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(b,y,k,x);else for(var E=b.length-1;E>=0;E--)(I=b[E])&&(m=(A<3?I(m):A>3?I(y,k,m):I(y,k))||m);return A>3&&m&&Object.defineProperty(y,k,m),m},v=this&&this.__param||function(b,y){return function(k,x){y(k,x,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const d=o(3787),_=o(2223),g=o(6171),u=o(4725),h=o(8055),e=o(8460),s=o(844),i=o(2585),t="xterm-dom-renderer-owner-",n="xterm-rows",a="xterm-fg-",f="xterm-bg-",S="xterm-focus",l="xterm-selection";let p=1,w=class extends s.Disposable{constructor(b,y,k,x,I,A,m,E,R,D){super(),this._element=b,this._screenElement=y,this._viewportElement=k,this._linkifier2=x,this._charSizeService=A,this._optionsService=m,this._bufferService=E,this._coreBrowserService=R,this._themeService=D,this._terminalClass=p++,this._rowElements=[],this._cellToRowElements=[],this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(n),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(l),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(B=>this._injectCss(B))),this._injectCss(this._themeService.colors),this._rowFactory=I.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(t+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(B=>this._handleLinkHover(B))),this.register(this._linkifier2.onHideLinkUnderline(B=>this._handleLinkLeave(B))),this.register((0,s.toDisposable)(()=>{this._element.classList.remove(t+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))}_updateDimensions(){const b=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*b,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*b),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/b),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/b),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 k of this._rowElements)k.style.width=`${this.dimensions.css.canvas.width}px`,k.style.height=`${this.dimensions.css.cell.height}px`,k.style.lineHeight=`${this.dimensions.css.cell.height}px`,k.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const y=`${this._terminalSelector} .${n} span { display: inline-block; height: 100%; vertical-align: top;
5 width: ${this.dimensions.css.cell.width}px}`;this._dimensionsStyleElement.textContent=y,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(b){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let y=`${this._terminalSelector} .${n} { color: ${b.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;y+=`${this._terminalSelector} .${n} .xterm-dim { color: ${h.color.multiplyOpacity(b.foreground,.5).css};}`,y+=`${this._terminalSelector} span:not(.${d.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${d.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${d.ITALIC_CLASS} { font-style: italic;}`,y+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",y+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${b.cursor.css}; color: ${b.cursorAccent.css}; } 50% { background-color: ${b.cursorAccent.css}; color: ${b.cursor.css}; }}`,y+=`${this._terminalSelector} .${n}:not(.${S}) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} ,${this._terminalSelector} .${n}:not(.${S}) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BAR_CLASS} ,${this._terminalSelector} .${n}:not(.${S}) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_UNDERLINE_CLASS} { outline: 1px solid ${b.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${n}.${S} .${d.CURSOR_CLASS}.${d.CURSOR_BLINK_CLASS}:not(.${d.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${n}.${S} .${d.CURSOR_CLASS}.${d.CURSOR_BLINK_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${n}.${S} .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} { background-color: ${b.cursor.css}; color: ${b.cursorAccent.css};}${this._terminalSelector} .${n} .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BAR_CLASS} { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${b.cursor.css} inset;}${this._terminalSelector} .${n} .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_UNDERLINE_CLASS} { box-shadow: 0 -1px 0 ${b.cursor.css} inset;}`,y+=`${this._terminalSelector} .${l} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${l} div { position: absolute; background-color: ${b.selectionBackgroundOpaque.css};}${this._terminalSelector} .${l} div { position: absolute; background-color: ${b.selectionInactiveBackgroundOpaque.css};}`;for(const[k,x]of b.ansi.entries())y+=`${this._terminalSelector} .${a}${k} { color: ${x.css}; }${this._terminalSelector} .${a}${k}.${d.DIM_CLASS} { color: ${h.color.multiplyOpacity(x,.5).css}; }${this._terminalSelector} .${f}${k} { background-color: ${x.css}; }`;y+=`${this._terminalSelector} .${a}${_.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(b.background).css}; }${this._terminalSelector} .${a}${_.INVERTED_DEFAULT_COLOR}.${d.DIM_CLASS} { color: ${h.color.multiplyOpacity(h.color.opaque(b.background),.5).css}; }${this._terminalSelector} .${f}${_.INVERTED_DEFAULT_COLOR} { background-color: ${b.foreground.css}; }`,this._themeStyleElement.textContent=y}handleDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(b,y){for(let k=this._rowElements.length;k<=y;k++){const x=document.createElement("div");this._rowContainer.appendChild(x),this._rowElements.push(x)}for(;this._rowElements.length>y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(b,y){this._refreshRowElements(b,y),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions()}handleBlur(){this._rowContainer.classList.remove(S)}handleFocus(){this._rowContainer.classList.add(S)}handleSelectionChanged(b,y,k){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.handleSelectionChanged(b,y,k),this.renderRows(0,this._bufferService.rows-1),!b||!y)return;const x=b[1]-this._bufferService.buffer.ydisp,I=y[1]-this._bufferService.buffer.ydisp,A=Math.max(x,0),m=Math.min(I,this._bufferService.rows-1);if(A>=this._bufferService.rows||m<0)return;const E=document.createDocumentFragment();if(k){const R=b[0]>y[0];E.appendChild(this._createSelectionElement(A,R?y[0]:b[0],R?b[0]:y[0],m-A+1))}else{const R=x===A?b[0]:0,D=A===I?y[0]:this._bufferService.cols;E.appendChild(this._createSelectionElement(A,R,D));const B=m-A-1;if(E.appendChild(this._createSelectionElement(A+1,0,this._bufferService.cols,B)),A!==m){const F=I===m?y[0]:this._bufferService.cols;E.appendChild(this._createSelectionElement(m,0,F))}}this._selectionContainer.appendChild(E)}_createSelectionElement(b,y,k,x=1){const I=document.createElement("div");
5return I.style.height=x*this.dimensions.css.cell.height+"px",I.style.top=b*this.dimensions.css.cell.height+"px",I.style.left=y*this.dimensions.css.cell.width+"px",I.style.width=this.dimensions.css.cell.width*(k-y)+"px",I}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors)}clear(){for(const b of this._rowElements)b.replaceChildren()}renderRows(b,y){const k=this._bufferService.buffer.ybase+this._bufferService.buffer.y,x=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink;for(let A=b;A<=y;A++){const m=this._rowElements[A],E=A+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.lines.get(E),D=this._optionsService.rawOptions.cursorStyle;this._cellToRowElements[A]&&this._cellToRowElements[A].length===this._bufferService.cols||(this._cellToRowElements[A]=new Int16Array(this._bufferService.cols)),m.replaceChildren(this._rowFactory.createRow(R,E,E===k,D,x,I,this.dimensions.css.cell.width,this._bufferService.cols,this._cellToRowElements[A]))}}get _terminalSelector(){return`.${t}${this._terminalClass}`}_handleLinkHover(b){this._setCellUnderline(b.x1,b.x2,b.y1,b.y2,b.cols,!0)}_handleLinkLeave(b){this._setCellUnderline(b.x1,b.x2,b.y1,b.y2,b.cols,!1)}_setCellUnderline(b,y,k,x,I,A){k<0&&(b=0),x<0&&(y=0);const m=this._cellToRowElements.length-1;k=Math.max(Math.min(k,m),0),x=Math.max(Math.min(x,m),0);const E=this._cellToRowElements[k],R=this._cellToRowElements[x];if(!(b>=E.length||y>=R.length)&&(b=E[b],y=R[y],b!==-1&&y!==-1))for(;b!==y||k!==x;){const D=this._rowElements[k];if(!D)return;const B=D.children[b];B&&(B.style.textDecoration=A?"underline":"none"),++b>=I&&(b=0,k++)}}};w=c([v(4,i.IInstantiationService),v(5,u.ICharSizeService),v(6,i.IOptionsService),v(7,i.IBufferService),v(8,u.ICoreBrowserService),v(9,u.IThemeService)],w),r.DomRenderer=w},3787:function(O,r,o){var c=this&&this.__decorate||function(f,S,l,p){var w,b=arguments.length,y=b<3?S:p===null?p=Object.getOwnPropertyDescriptor(S,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,S,l,p);else for(var k=f.length-1;k>=0;k--)(w=f[k])&&(y=(b<3?w(y):b>3?w(S,l,y):w(S,l))||y);return b>3&&y&&Object.defineProperty(S,l,y),y},v=this&&this.__param||function(f,S){return function(l,p){S(l,p,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=r.CURSOR_STYLE_UNDERLINE_CLASS=r.CURSOR_STYLE_BAR_CLASS=r.CURSOR_STYLE_BLOCK_CLASS=r.CURSOR_BLINK_CLASS=r.CURSOR_CLASS=r.STRIKETHROUGH_CLASS=r.OVERLINE_CLASS=r.UNDERLINE_CLASS=r.ITALIC_CLASS=r.DIM_CLASS=r.BOLD_CLASS=void 0;const d=o(2223),_=o(643),g=o(511),u=o(2585),h=o(8055),e=o(4725),s=o(4269),i=o(6171),t=o(3734);r.BOLD_CLASS="xterm-bold",r.DIM_CLASS="xterm-dim",r.ITALIC_CLASS="xterm-italic",r.UNDERLINE_CLASS="xterm-underline",r.OVERLINE_CLASS="xterm-overline",r.STRIKETHROUGH_CLASS="xterm-strikethrough",r.CURSOR_CLASS="xterm-cursor",r.CURSOR_BLINK_CLASS="xterm-cursor-blink",r.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",r.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",r.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";let n=class{constructor(f,S,l,p,w,b,y){this._document=f,this._characterJoinerService=S,this._optionsService=l,this._coreBrowserService=p,this._coreService=w,this._decorationService=b,this._themeService=y,this._workCell=new g.CellData,this._columnSelectMode=!1}handleSelectionChanged(f,S,l){this._selectionStart=f,this._selectionEnd=S,this._columnSelectMode=l}createRow(f,S,l,p,w,b,y,k,x){const I=this._document.createDocumentFragment(),A=this._characterJoinerService.getJoinedCharacters(S);let m=0;for(let B=Math.min(f.length,k)-1;B>=0;B--)if(f.loadCell(B,this._workCell).getCode()!==_.NULL_CELL_CODE||l&&B===w){m=B+1;break}const E=this._themeService.colors;let R=-1,D=0;for(;D<m;D++){f.loadCell(D,this._workCell);let B=this._workCell.getWidth();if(B===0){x[D]=R;continue}let F=!1,U=D,P=this._workCell;if(A.length>0&&D===A[0][0]){F=!0;const W=A.shift();P=new s.JoinedCellData(this._workCell,f.translateToString(!0,W[0],W[1]),W[1]-W[0]),U=W[1]-1,B=P.getWidth()}const L=this._document.createElement("span");if(B>1&&(L.style.width=y*B+"px"),F&&(L.style.display="inline",w>=D&&w<=U&&(w=D)),!this._coreService.isCursorHidden&&l&&D===w)switch(L.classList.add(r.CURSOR_CLASS),b&&L.classList.add(r.CURSOR_BLINK_CLASS),p){case"bar":L.classList.add(r.CURSOR_STYLE_BAR_CLASS);break;case"underline":L.classList.add(r.CURSOR_STYLE_UNDERLINE_CLASS);break;default:L.classList.add(r.CURSOR_STYLE_BLOCK_CLASS)}if(P.isBold()&&L.classList.add(r.BOLD_CLASS),P.isItalic()&&L.classList.add(r.ITALIC_CLASS),P.isDim()&&L.classList.add(r.DIM_CLASS),P.isInvisible()?L.textContent=_.WHITESPACE_CELL_CHAR:L.textContent=P.getChars()||_.WHITESPACE_CELL_CHAR,P.isUnderline()&&(L.classList.add(`${r.UNDERLINE_CLASS}-${P.extended.underlineStyle}`),L.textContent===" "&&(L.textContent="Â "),!P.isUnderlineColorDefault()))if(P.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB(P.getUnderlineColor()).join(",")})`;else{let W=P.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&P.isBold()&&W<8&&(W+=8),L.style.textDecorationColor=E.ansi[W].css}P.isOverline()&&(L.classList.add(r.OVERLINE_CLASS),L.textContent===" "&&(L.textContent="Â ")),P.isStrikethrough()&&L.classList.add(r.STRIKETHROUGH_CLASS);let C=P.getFgColor(),T=P.getFgColorMode(),M=P.getBgColor(),N=P.getBgColorMode();const H=!!P.isInverse();if(H){const W=C;C=M,M=W;const ie=T;T=N,N=ie}let $,j,z=!1;this._decorationService.forEachDecorationAtCell(D,S,void 0,W=>{W.options.layer!=="top"&&z||(W.backgroundColorRGB&&(N=50331648,M=W.backgroundColorRGB.rgba>>8&16777215,$=W.backgroundColorRGB),W.foregroundColorRGB&&(T=50331648,C=W.foregroundColorRGB.rgba>>8&16777215,j=W.foregroundColorRGB),z=W.options.layer==="top")});const J=this._isCellInSelection(D,S);let V;switch(z||E.selectionForeground&&J&&(T=50331648,C=E.selectionForeground.rgba>>8&16777215,j=E.selectionForeground),J&&($=this._coreBrowserService.isFocused?E.selectionBackgroun
5dOpaque:E.selectionInactiveBackgroundOpaque,z=!0),z&&L.classList.add("xterm-decoration-top"),N){case 16777216:case 33554432:V=E.ansi[M],L.classList.add(`xterm-bg-${M}`);break;case 50331648:V=h.rgba.toColor(M>>16,M>>8&255,255&M),this._addStyle(L,`background-color:#${a((M>>>0).toString(16),"0",6)}`);break;default:H?(V=E.foreground,L.classList.add(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):V=E.background}switch($||P.isDim()&&($=h.color.multiplyOpacity(V,.5)),T){case 16777216:case 33554432:P.isBold()&&C<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(C+=8),this._applyMinimumContrast(L,V,E.ansi[C],P,$,void 0)||L.classList.add(`xterm-fg-${C}`);break;case 50331648:const W=h.rgba.toColor(C>>16&255,C>>8&255,255&C);this._applyMinimumContrast(L,V,W,P,$,j)||this._addStyle(L,`color:#${a(C.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,V,E.foreground,P,$,void 0)||H&&L.classList.add(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}I.appendChild(L),x[D]=++R,D=U}return D<k-1&&x.subarray(D).fill(++R),I}_applyMinimumContrast(f,S,l,p,w,b){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.excludeFromContrastRatioDemands)(p.getCode()))return!1;let y;return w||b||(y=this._themeService.colors.contrastCache.getColor(S.rgba,l.rgba)),y===void 0&&(y=h.color.ensureContrastRatio(w||S,b||l,this._optionsService.rawOptions.minimumContrastRatio),this._themeService.colors.contrastCache.setColor((w||S).rgba,(b||l).rgba,y??null)),!!y&&(this._addStyle(f,`color:${y.css}`),!0)}_addStyle(f,S){f.setAttribute("style",`${f.getAttribute("style")||""}${S};`)}_isCellInSelection(f,S){const l=this._selectionStart,p=this._selectionEnd;return!(!l||!p)&&(this._columnSelectMode?l[0]<=p[0]?f>=l[0]&&S>=l[1]&&f<p[0]&&S<=p[1]:f<l[0]&&S>=l[1]&&f>=p[0]&&S<=p[1]:S>l[1]&&S<p[1]||l[1]===p[1]&&S===l[1]&&f>=l[0]&&f<p[0]||l[1]<p[1]&&S===p[1]&&f<p[0]||l[1]<p[1]&&S===l[1]&&f>=l[0])}};function a(f,S,l){for(;f.length<l;)f=S+f;return f}n=c([v(1,e.ICharacterJoinerService),v(2,u.IOptionsService),v(3,e.ICoreBrowserService),v(4,u.ICoreService),v(5,u.IDecorationService),v(6,e.IThemeService)],n),r.DomRendererRowFactory=n},2223:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(O,r)=>{function o(c){return 57508<=c&&c<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},r.excludeFromContrastRatioDemands=function(c){return o(c)||function(v){return 9472<=v&&v<=9631}(c)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(O,r,o){var c=this&&this.__decorate||function(e,s,i,t){var n,a=arguments.length,f=a<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,i,t);else for(var S=e.length-1;S>=0;S--)(n=e[S])&&(f=(a<3?n(f):a>3?n(s,i,f):n(s,i))||f);return a>3&&f&&Object.defineProperty(s,i,f),f},v=this&&this.__param||function(e,s){return function(i,t){s(i,t,e)}};
5Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const d=o(2585),_=o(8460),g=o(844);let u=class extends g.Disposable{constructor(e,s,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new h(e,s,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};u=c([v(2,d.IOptionsService)],u),r.CharSizeService=u;class h{constructor(s,i,t){this._document=s,this._parentElement=i,this._optionsService=t,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const s=this._measureElement.getBoundingClientRect();return s.width!==0&&s.height!==0&&(this._result.width=this._measureElement.clientWidth,this._result.height=Math.ceil(this._measureElement.clientHeight)),this._result}}},4269:function(O,r,o){var c=this&&this.__decorate||function(s,i,t,n){var a,f=arguments.length,S=f<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,t):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,i,t,n);else for(var l=s.length-1;l>=0;l--)(a=s[l])&&(S=(f<3?a(S):f>3?a(i,t,S):a(i,t))||S);return f>3&&S&&Object.defineProperty(i,t,S),S},v=this&&this.__param||function(s,i){return function(t,n){i(t,n,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const d=o(3734),_=o(643),g=o(511),u=o(2585);class h extends d.AttributeData{constructor(i,t,n){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=t,this._width=n}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()]}}r.JoinedCellData=h;let e=class ee{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(i){const t={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(t),t.id}deregister(i){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===i)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const t=this._bufferService.buffer.lines.get(i);if(!t||t.length===0)return[];const n=[],a=t.translateToString(!0);let f=0,S=0,l=0,p=t.getFg(0),w=t.getBg(0);for(let b=0;b<t.getTrimmedLength();b++)if(t.loadCell(b,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==p||this._workCell.bg!==w){if(b-f>1){const y=this._getJoinedRanges(a,l,S,t,f);for(let k=0;k<y.length;k++)n.push(y[k])}f=b,l=S,p=this._workCell.fg,w=this._workCell.bg}S+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-f>1){const b=this._getJoinedRanges(a,l,S,t,f);for(let y=0;y<b.length;y++)n.push(b[y])}return n}_getJoinedRanges(i,t,n,a,f){const S=i.substring(t,n);let l=[];try{l=this._characterJoiners[0].handler(S)}catch(p){console.error(p)}for(let p=1;p<this._characterJoiners.length;p++)try{const w=this._characterJoiners[p].handler(S);for(let b=0;b<w.length;b++)ee._mergeRanges(l,w[b])}catch(w){console.error(w)}return this._stringRangesToCellRanges(l,a,f),l}_stringRangesToCellRanges(i,t,n){let a=0,f=!1,S=0,l=i[a];if(l){for(let p=n;p<this._bufferService.cols;p++){const w=t.getWidth(p),b=t.getString(p).length||_.WHITESPACE_CELL_CHAR.length;if(w!==0){if(!f&&l[0]<=S&&(l[0]=p,f=!0),l[1]<=S){if(l[1]=p,l=i[++a],!l)break;l[0]<=S?(l[0]=p,f=!0):f=!1}S+=b}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(i,t){let n=!1;for(let a=0;a<i.length;a++){const f=i[a];
5if(n){if(t[1]<=f[0])return i[a-1][1]=t[1],i;if(t[1]<=f[1])return i[a-1][1]=Math.max(t[1],f[1]),i.splice(a,1),i;i.splice(a,1),a--}else{if(t[1]<=f[0])return i.splice(a,0,t),i;if(t[1]<=f[1])return f[0]=Math.min(t[0],f[0]),i;t[0]<f[1]&&(f[0]=Math.min(t[0],f[0]),n=!0)}}return n?i[i.length-1][1]=t[1]:i.push(t),i}};e=c([v(0,u.IBufferService)],e),r.CharacterJoinerService=e},5114:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(o,c){this._textarea=o,this.window=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(O,r,o){var c=this&&this.__decorate||function(u,h,e,s){var i,t=arguments.length,n=t<3?h:s===null?s=Object.getOwnPropertyDescriptor(h,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(u,h,e,s);else for(var a=u.length-1;a>=0;a--)(i=u[a])&&(n=(t<3?i(n):t>3?i(h,e,n):i(h,e))||n);return t>3&&n&&Object.defineProperty(h,e,n),n},v=this&&this.__param||function(u,h){return function(e,s){h(e,s,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const d=o(4725),_=o(9806);let g=class{constructor(u,h){this._renderService=u,this._charSizeService=h}getCoords(u,h,e,s,i){return(0,_.getCoords)(window,u,h,e,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(u,h){const e=(0,_.getCoordsRelativeToElement)(window,u,h);if(!(!this._charSizeService.hasValidSize||e[0]<0||e[1]<0||e[0]>=this._renderService.dimensions.css.canvas.width||e[1]>=this._renderService.dimensions.css.canvas.height))return{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])}}};g=c([v(0,d.IRenderService),v(1,d.ICharSizeService)],g),r.MouseService=g},3230:function(O,r,o){var c=this&&this.__decorate||function(n,a,f,S){var l,p=arguments.length,w=p<3?a:S===null?S=Object.getOwnPropertyDescriptor(a,f):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,a,f,S);else for(var b=n.length-1;b>=0;b--)(l=n[b])&&(w=(p<3?l(w):p>
53?l(a,f,w):l(a,f))||w);return p>3&&w&&Object.defineProperty(a,f,w),w},v=this&&this.__param||function(n,a){return function(f,S){a(f,S,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const d=o(6193),_=o(8460),g=o(844),u=o(5596),h=o(3656),e=o(2585),s=o(4725),i=o(7226);let t=class extends g.Disposable{constructor(n,a,f,S,l,p,w,b){if(super(),this._rowCount=n,this._charSizeService=S,this._pausedResizeTask=new i.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this.register({dispose:()=>{var y;return(y=this._renderer)===null||y===void 0?void 0:y.dispose()}}),this._renderDebouncer=new d.RenderDebouncer(w.window,(y,k)=>this._renderRows(y,k)),this.register(this._renderDebouncer),this._screenDprMonitor=new u.ScreenDprMonitor(w.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(p.onResize(()=>
5this._fullRefresh())),this.register(p.buffers.onBufferActivate(()=>{var y;return(y=this._renderer)===null||y===void 0?void 0:y.clear()})),this.register(f.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(l.onDecorationRegistered(()=>this._fullRefresh())),this.register(l.onDecorationRemoved(()=>this._fullRefresh())),this.register(f.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()})),this.register(f.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(p.buffer.y,p.buffer.y,!0))),this.register((0,h.addDisposableDomListener)(w.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(b.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in w.window){const y=new w.window.IntersectionObserver(k=>this._handleIntersectionChange(k[k.length-1]),{threshold:0});y.observe(a),this.register({dispose:()=>y.disconnect()})}}get dimensions(){return this._renderer.dimensions}_handleIntersectionChange(n){this._isPaused=n.isIntersecting===void 0?n.intersectionRatio===0:!n.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(n,a,f=!1){this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(n,a,this._rowCount))}_renderRows(n,a){this._renderer&&(n=Math.min(n,this._rowCount-1),a=Math.min(a,this._rowCount-1),this._renderer.renderRows(n,a),this._needsSelectionRefresh&&(this._renderer.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:n,end:a}),this._onRender.fire({start:n,end:a}),this._isNextRenderRedrawOnly=!0)}resize(n,a){this._rowCount=a,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer&&(this._renderer.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions))}hasRenderer(){return!!this._renderer}setRenderer(n){var a;(a=this._renderer)===null||a===void 0||a.dispose(),this._renderer=n,this._renderer.onRequestRedraw(f=>this.refreshRows(f.start,f.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(n){return this._renderDebouncer.addRefreshCallback(n)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var n,a;this._renderer&&((a=(n=this._renderer).clearTextureAtlas)===null||a===void 0||a.call(n),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer&&(this._renderer.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(n,a){this._renderer&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.handleResize(n,a)):this._renderer.handleResize(n,a),this._fullRefresh())}handleCharSizeChanged(){var n;(n=this._renderer)===null||n===void 0||n.handleCharSizeChanged()}handleBlur(){var n;(n=this._renderer)===null||n===void 0||n.handleBlur()}handleFocus(){var n;(n=this._renderer)===null||n===void 0||n.handleFocus()}handleSelectionChanged(n,a,f){var S;this._selectionState.start=n,this._selectionState.end=a,this._selectionState.columnSelectMode=f,(S=this._renderer)===null||S===void 0||S.handleSelectionChanged(n,a,f)}handleCursorMove(){var n;(n=this._renderer)===null||n===void 0||n.handleCursorMove()}clear(){var n;(n=this._renderer)===null||n===void 0||n.clear()}};t=c([v(2,e.IOptionsService),v(3,s.ICharSizeService),v(4,e.IDecorationService),v(5,e.IBufferService),v(6,s.ICoreBrowserService),v(7,s.IThemeService)],t),r.RenderService=t},9312:function(O,r,o){var c=this&&this.__decorate||function(l,p,w,b){var y,k=arguments.length,x=k<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,p,w,b);else for(var I=l.length-1;I>=0;
vendor: 5,183 bytes, lines 5-7
5I--)(y=l[I])&&(x=(k<3?y(x):k>3?y(p,w,x):y(p,w))||x);return k>3&&x&&Object.defineProperty(p,w,x),x},v=this&&this.__param||function(l,p){return function(w,b){p(w,b,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const d=o(6114),_=o(456),g=o(511),u=o(8460),h=o(4725),e=o(2585),s=o(9806),i=o(9504),t=o(844),n=o(4841),a=String.fromCharCode(160),f=new RegExp(a,"g");let S=class extends t.Disposable{constructor(l,p,w,b,y,k,x,I,A){super(),this._element=l,this._screenElement=p,this._linkifier=w,this._bufferService=b,this._coreService=y,this._mouseService=k,this._optionsService=x,this._renderService=I,this._coreBrowserService=A,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new g.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=m=>this._handleMouseMove(m),this._mouseUpListener=m=>this._handleMouseUp(m),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(m=>this._handleTrim(m)),this.register(this._bufferService.buffers.onBufferActivate(m=>this._handleBufferActivate(m))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const l=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;return!(!l||!p||l[0]===p[0]&&l[1]===p[1])}get selectionText(){const l=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;if(!l||!p)return"";const w=this._bufferService.buffer,b=[];if(this._activeSelectionMode===3){if(l[0]===p[0])return"";const y=l[0]<p[0]?l[0]:p[0],k=l[0]<p[0]?p[0]:l[0];for(let x=l[1];x<=p[1];x++){const I=w.translateBufferLineToString(x,!0,y,k);b.push(I)}}else{const y=l[1]===p[1]?p[0]:void 0;b.push(w.translateBufferLineToString(l[1],!0,l[0],y));for(let k=l[1]+1;k<=p[1]-1;k++){const x=w.lines.get(k),I=w.translateBufferLineToString(k,!0);x!=null&&x.isWrapped?b[b.length-1]+=I:b.push(I)}if(l[1]!==p[1]){const k=w.lines.get(p[1]),x=w.translateBufferLineToString(p[1],!0,0,p[0]);k&&k.isWrapped?b[b.length-1]+=x:b.push(x)}}return b.map(y=>y.replace(f," ")).join(d.isWindows?`\r 6`:` 7`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(l){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),d.isLinux&&l&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(l){const p=this._getMouseBufferCoords(l),w=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!!(w&&b&&p)&&this._areCoordsInSelection(p,w,b)}isCellInSelection(l,p){const w=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!w||!b)&&this._areCoordsInSelection([l,p],w,b)}_areCoordsInSelection(l,p,w){return l[1]>p[1]&&l[1]<w[1]||p[1]===w[1]&&l[1]===p[1]&&l[0]>=p[0]&&l[0]<w[0]||p[1]<w[1]&&l[1]===w[1]&&l[0]<w[0]||p[1]<w[1]&&l[1]===p[1]&&l[0]>=p[0]}_selectWordAtCursor(l,p){var w,b;const y=(b=(w=this._linkifier.currentLink)===null||w===void 0?void 0:w.link)===null||b===void 0?void 0:b.range;if(y)return this._model.selectionStart=[y.start.x-1,y.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(y,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(l);return!!k&&(this._selectWordAt(k,p),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,p){this._model.clearSelection(),l=Math.max(l,0),p=Math.min(p,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,p],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){const p=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(p)return p[0]--,p[1]--,p[1]+=this._bufferService.buffer.ydisp,p}_getMouseEventScrollAmount(l){let p=(0,s.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1];
vendor: 5,665 bytes, line 7
7const w=this._renderService.dimensions.css.canvas.height;return p>=0&&p<=w?0:(p>w&&(p-=w),p=Math.min(Math.max(p,-50),50),p/=50,p/Math.abs(p)+Math.round(14*p))}shouldForceSelection(l){return d.isMac?l.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:l.shiftKey}handleMouseDown(l){if(this._mouseDownTimeStamp=l.timeStamp,(l.button!==2||!this.hasSelection)&&l.button===0){if(!this._enabled){if(!this.shouldForceSelection(l))return;l.stopPropagation()}l.preventDefault(),this._dragScrollAmount=0,this._enabled&&l.shiftKey?this._handleIncrementalClick(l):l.detail===1?this._handleSingleClick(l):l.detail===2?this._handleDoubleClick(l):l.detail===3&&this._handleTripleClick(l),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(l){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(l))}_handleSingleClick(l){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(l)?3:0,this._model.selectionStart=this._getMouseBufferCoords(l),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const p=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);p&&p.length!==this._model.selectionStart[0]&&p.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){const p=this._getMouseBufferCoords(l);p&&(this._activeSelectionMode=2,this._selectLineAt(p[1]))}shouldColumnSelect(l){return l.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;const p=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(l),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(l),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const w=this._bufferService.buffer;if(this._model.selectionEnd[1]<w.lines.length){const b=w.lines.get(this._model.selectionEnd[1]);b&&b.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}p&&p[0]===this._model.selectionEnd[0]&&p[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 l=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(l.ydisp+this._bufferService.rows,l.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=l.ydisp),this.refresh()}}_handleMouseUp(l){const p=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&p<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const w=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(w&&w[0]!==void 0&&w[1]!==void 0){const b=(0,i.moveToCellSequence)(w[0]-1,w[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(b,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const l=this._model.finalSelectionStart,p=this._model.finalSelectionEnd,w=!(!l||!p||l[0]===p[0]&&l[1]===p[1]);w?l&&p&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&p[0]===this._oldSelectionEnd[0]&&p[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,p,w)):this._oldHasSelection&&this._fireOnSelectionChange(l,p,w)}_fireOnSelectionChange(l,p,w){this._oldSelectionStart=l,this._oldSelectionEnd=p,this._oldHasSelection=w,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim(p=>this._handleTrim(p))}_convertViewportColToCharacterIndex(l,p){let w=p;for(let b=0;p>=b;b++){const y=l.loadCell(b,this._workCell).getChars().length;this._workCell.getWidth()===0?w--:y>1&&p!==b&&(w+=y-1)}return w}setSelection(l,p,w){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,p],this._model.selectionStartLength=w,this.refresh(),this._fireEventIfSelectionChanged()}
7rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,p,w=!0,b=!0){if(l[0]>=this._bufferService.cols)return;const y=this._bufferService.buffer,k=y.lines.get(l[1]);if(!k)return;const x=y.translateBufferLineToString(l[1],!1);let I=this._convertViewportColToCharacterIndex(k,l[0]),A=I;const m=l[0]-I;let E=0,R=0,D=0,B=0;if(x.charAt(I)===" "){for(;I>0&&x.charAt(I-1)===" ";)I--;for(;A<x.length&&x.charAt(A+1)===" ";)A++}else{let P=l[0],L=l[0];k.getWidth(P)===0&&(E++,P--),k.getWidth(L)===2&&(R++,L++);const C=k.getString(L).length;for(C>1&&(B+=C-1,A+=C-1);P>0&&I>0&&!this._isCharWordSeparator(k.loadCell(P-1,this._workCell));){k.loadCell(P-1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===0?(E++,P--):T>1&&(D+=T-1,I-=T-1),I--,P--}for(;L<k.length&&A+1<x.length&&!this._isCharWordSeparator(k.loadCell(L+1,this._workCell));){k.loadCell(L+1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,L++):T>1&&(B+=T-1,A+=T-1),A++,L++}}A++;let F=I+m-E+D,U=Math.min(this._bufferService.cols,A-I+E+R-D-B);if(p||x.slice(I,A).trim()!==""){if(w&&F===0&&k.getCodePoint(0)!==32){const P=y.lines.get(l[1]-1);if(P&&k.isWrapped&&P.getCodePoint(this._bufferService.cols-1)!==32){const L=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if(L){const C=this._bufferService.cols-L.start;F-=C,U+=C}}}if(b&&F+U===this._bufferService.cols&&k.getCodePoint(this._bufferService.cols-1)!==32){const P=y.lines.get(l[1]+1);if(P!=null&&P.isWrapped&&P.getCodePoint(0)!==32){const L=this._getWordAt([0,l[1]+1],!1,!1,!0);L&&(U+=L.length)}}return{start:F,length:U}}}_selectWordAt(l,p){const w=this._getWordAt(l,p);if(w){for(;w.start<0;)w.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[w.start,l[1]],this._model.selectionStartLength=w.length}}_selectToWordAt(l){const p=this._getWordAt(l,!0);if(p){let w=l[1];for(;p.start<0;)p.start+=this._bufferService.cols,w--;if(!this._model.areSelectionValuesReversed())for(;p.start+p.length>this._bufferService.cols;)p.length-=this._bufferService.cols,w++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?p.start:p.start+p.length,w]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){const p=this._bufferService.buffer.getWrappedRangeForLine(l),w={start:{x:0,y:p.first},end:{x:this._bufferService.cols-1,y:p.last}};this._model.selectionStart=[0,p.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(w,this._bufferService.cols)}};S=c([v(3,e.IBufferService),v(4,e.ICoreService),v(5,h.IMouseService),v(6,e.IOptionsService),v(7,h.IRenderService),v(8,h.ICoreBrowserService)],S),r.SelectionService=S},4725:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const c=o(8343);r.ICharSizeService=(0,c.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),r.IMouseService=(0,c.createDecorator)("MouseService"),r.IRenderService=(0,c.createDecorator)("RenderService"),r.ISelectionService=(0,c.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(O,r,o){var c=this&&this.__decorate||function(S,l,p,w){var b,y=arguments.length,k=y<3?l:w===null?w=Object.getOwnPropertyDescriptor(l,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(S,l,p,w);else for(var x=S.length-1;x>=0;x--)(b=S[x])&&(k=(y<3?b(k):y>3?b(l,p,k):b(l,p))||k);return y>3&&k&&Object.defineProperty(l,p,k),k},v=this&&this.__param||function(S,l){return function(p,w){l(p,w,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const d=o(7239),_=o(8055),g=o(8460),u=o(844),h=o(2585),e=_.css.toColor("#ffffff"),s=_.css.toColor("#000000"),i=_.css.toColor("#ffffff"),t=_.css.toColor("#000000"),n={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const S=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],l=[0,95,135,175,215,255];for(let p=0;p<216;p++){const w=l[p/36%6|0],b=l[p/6%6|0],y=l[p%6];S.push({css:_.channels.toCss(w,b,y),rgba:_.channels.toRgba(w,b,y)})}for(let p=0;p<24;p++){const w=8+10*p;S.push({css:_.channels.toCss(w,w,w),rgba:_.channels.toRgba(w,w,w)})}return S})());let a=class extends u.Disposable{constructor(S){super(),this._optionsService=S,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._contrastCache=new d.ColorContrastCache,this._colors={foreground:e,background:s,cursor:i,cursorAccent:t,selectionForeground:void 0,selectionBackgroun
7dTransparent:n,selectionBackgroundOpaque:_.color.blend(s,n),selectionInactiveBackgroundTransparent:n,selectionInactiveBackgroundOpaque:_.color.blend(s,n),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},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)))}get colors(){return this._colors}_setTheme(S={}){const l=this._colors;if(l.foreground=f(S.foreground,e),l.background=f(S.background,s),l.cursor=f(S.cursor,i),l.cursorAccent=f(S.cursorAccent,t),l.selectionBackgroundTransparent=f(S.selectionBackground,n),l.selectionBackgroundOpaque=_.color.blend(l.background,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundTransparent=f(S.selectionInactiveBackground,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundOpaque=_.color.blend(l.background,l.selectionInactiveBackgroundTransparent),l.selectionForeground=S.selectionForeground?f(S.selectionForeground,_.NULL_COLOR):void 0,l.selectionForeground===_.NULL_COLOR&&(l.selectionForeground=void 0),_.color.isOpaque(l.selectionBackgroundTransparent)&&(l.selectionBackgroundTransparent=_.color.opacity(l.selectionBackgroundTransparent,.3)),_.color.isOpaque(l.selectionInactiveBackgroundTransparent)&&(l.selectionInactiveBackgroundTransparent=_.color.opacity(l.selectionInactiveBackgroundTransparent,.3)),l.ansi=r.DEFAULT_ANSI_COLORS.slice(),l.ansi[0]=f(S.black,r.DEFAULT_ANSI_COLORS[0]),l.ansi[1]=f(S.red,r.DEFAULT_ANSI_COLORS[1]),l.ansi[2]=f(S.green,r.DEFAULT_ANSI_COLORS[2]),l.ansi[3]=f(S.yellow,r.DEFAULT_ANSI_COLORS[3]),l.ansi[4]=f(S.blue,r.DEFAULT_ANSI_COLORS[4]),l.ansi[5]=f(S.magenta,r.DEFAULT_ANSI_COLORS[5]),l.ansi[6]=f(S.cyan,r.DEFAULT_ANSI_COLORS[6]),l.ansi[7]=f(S.white,r.DEFAULT_ANSI_COLORS[7]),l.ansi[8]=f(S.brightBlack,r.DEFAULT_ANSI_COLORS[8]),l.ansi[9]=f(S.brightRed,r.DEFAULT_ANSI_COLORS[9]),l.ansi[10]=f(S.brightGreen,r.DEFAULT_ANSI_COLORS[10]),l.ansi[11]=f(S.brightYellow,r.DEFAULT_ANSI_COLORS[11]),l.ansi[12]=f(S.brightBlue,r.DEFAULT_ANSI_COLORS[12]),l.ansi[13]=f(S.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),l.ansi[14]=f(S.brightCyan,r.DEFAULT_ANSI_COLORS[14]),l.ansi[15]=f(S.brightWhite,r.DEFAULT_ANSI_COLORS[15]),S.extendedAnsi){const p=Math.min(l.ansi.length-16,S.extendedAnsi.length);for(let w=0;w<p;w++)l.ansi[w+16]=f(S.extendedAnsi[w],r.DEFAULT_ANSI_COLORS[w+16])}this._contrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(S){this._restoreColor(S),this._onChangeColors.fire(this.colors)}_restoreColor(S){if(S!==void 0)switch(S){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[S]=this._restoreColors.ansi[S]}else for(let l=0;l<this._restoreColors.ansi.length;++l)this._colors.ansi[l]=this._restoreColors.ansi[l]}modifyColors(S){S(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 f(S,l){if(S!==void 0)try{return _.css.toColor(S)}catch{}return l}a=c([v(0,h.IOptionsService)],a),r.ThemeService=a},6349:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const c=o(8460),v=o(844);class d extends v.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const u=new Array(g);for(let h=0;h<Math.min(g,this.length);h++)u[h]=this._array[this._getCyclicIndex(h)];this._array=u,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let u=this._length;u<g;u++)this._array[u]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,u){this._array[this._getCyclicIndex(g)]=u}push(g){this._array[this._getCyclicIndex(this._length)]=g,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.f
vendor: 5,922 bytes, line 7
7ire(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(g,u,...h){if(u){for(let e=g;e<this._length-u;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+u)];this._length-=u,this.onDeleteEmitter.fire({index:g,amount:u})}for(let e=this._length-1;e>=g;e--)this._array[this._getCyclicIndex(e+h.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<h.length;e++)this._array[this._getCyclicIndex(g+e)]=h[e];if(h.length&&this.onInsertEmitter.fire({index:g,amount:h.length}),this._length+h.length>this._maxLength){const e=this._length+h.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=h.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,u,h){if(!(u<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let s=u-1;s>=0;s--)this.set(g+s+h,this.get(g+s));const e=g+u+h-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<u;e++)this.set(g+e+h,this.get(g+e))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}r.CircularList=d},1439:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function o(c,v=5){if(typeof c!="object")return c;const d=Array.isArray(c)?[]:{};for(const _ in c)d[_]=v<=1?c[_]:c[_]&&o(c[_],v-1);return d}},8055:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const c=o(6114);let v=0,d=0,_=0,g=0;var u,h,e;function s(t){const n=t.toString(16);return n.length<2?"0"+n:n}function i(t,n){return t<n?(n+.05)/(t+.05):(t+.05)/(n+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(t){t.toCss=function(n,a,f,S){return S!==void 0?`#${s(n)}${s(a)}${s(f)}${s(S)}`:`#${s(n)}${s(a)}${s(f)}`},t.toRgba=function(n,a,f,S=255){return(n<<24|a<<16|f<<8|S)>>>0}}(u=r.channels||(r.channels={})),function(t){function n(a,f){return g=Math.round(255*f),[v,d,_]=e.toChannels(a.rgba),{css:u.toCss(v,d,_,g),rgba:u.toRgba(v,d,_,g)}}t.blend=function(a,f){if(g=(255&f.rgba)/255,g===1)return{css:f.css,rgba:f.rgba};const S=f.rgba>>24&255,l=f.rgba>>16&255,p=f.rgba>>8&255,w=a.rgba>>24&255,b=a.rgba>>16&255,y=a.rgba>>8&255;return v=w+Math.round((S-w)*g),d=b+Math.round((l-b)*g),_=y+Math.round((p-y)*g),{css:u.toCss(v,d,_),rgba:u.toRgba(v,d,_)}},t.isOpaque=function(a){return(255&a.rgba)==255},t.ensureContrastRatio=function(a,f,S){const l=e.ensureContrastRatio(a.rgba,f.rgba,S);if(l)return e.toColor(l>>24&255,l>>16&255,l>>8&255)},t.opaque=function(a){const f=(255|a.rgba)>>>0;return[v,d,_]=e.toChannels(f),{css:u.toCss(v,d,_),rgba:f}},t.opacity=n,t.multiplyOpacity=function(a,f){return g=255&a.rgba,n(a,g*f/255)},t.toColorRGB=function(a){return[a.rgba>>24&255,a.rgba>>16&255,a.rgba>>8&255]}}(r.color||(r.color={})),function(t){let n,a;if(!c.isNode){const f=document.createElement("canvas");f.width=1,f.height=1;const S=f.getContext("2d",{willReadFrequently:!0});S&&(n=S,n.globalCompositeOperation="copy",a=n.createLinearGradient(0,0,1,1))}t.toColor=function(f){if(f.match(/#[\da-f]{3,8}/i))switch(f.length){case 4:return v=parseInt(f.slice(1,2).repeat(2),16),d=parseInt(f.slice(2,3).repeat(2),16),_=parseInt(f.slice(3,4).repeat(2),16),e.toColor(v,d,_);case 5:return v=parseInt(f.slice(1,2).repeat(2),16),d=parseInt(f.slice(2,3).repeat(2),16),_=parseInt(f.slice(3,4).repeat(2),16),g=parseInt(f.slice(4,5).repeat(2),16),e.toColor(v,d,_,g);case 7:return{css:f,rgba:(parseInt(f.slice(1),16)<<8|255)>>>0};case 9:return{css:f,rgba:parseInt(f.slice(1),16)>>>0}}const S=f.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(S)return v=parseInt(S[1]),d=parseInt(S[2]),_=parseInt(S[3]),g=Math.round(255*(S[5]===void 0?1:parseFloat(S[5]))),e.toColor(v,d,_,g);if(!n||!a)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=a,n.fillStyle=f,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[v,d,_,g]=n.getImageData(0,0,1,1).data,g!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:u.toRgba(v,d,_,g),css:f}}}(r.css||(r.css={})),function(t){function n(a,f,S){const l=a/255,p=f/255,w=S/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.0722*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))}t.relativeLuminance=function(a){return n(a>>16&255,a>>8&255,255&a)},t.relativeLuminance2=n}(h=r.rgb||(r.rgb={})),function(t){function n(f,S,l){const p=f>>24&255,w=f>>16&255,b=f>>8&255;let y=S>>24&255,k=S>>16&255,x=S>>8&255,I=i(h.relativeLuminance2(y,k,x),h.relativeLuminance2(p,w,b));for(;I<l&&(y>0||k>0||x>0);)y-=Math.max(0,Math.ceil(.1*y)),k-=Math.max(0,Math.ceil(.1*k)),x-=Math.max(0,Math.ceil(.1*x)),I=i(h.relativeLuminance2(y,k,x),h.relativeLuminance2(p,w,b));return(y<<24|k<<16|x<<8|255)>>>0}function a(f,S,l){const p=f>>24&255,w=f>>16&255,b=f>>8&255;let y=S>>24&255,k=S>>16&255,x=S>>8&255,I=i(h.relativeLuminance2(y,k,x),h.relativeLuminance2(p,w,b));for(;I<l&&(y<255||k<255||x<255);)y=Math.min(255,y+Math.ceil(.1*(255-y))),k=Math.min(255,k+Math.ceil(.1*(255-k))),x=Math.min(255,x+Math.ceil(.1*(255-x))),I=i(h.relativeLuminance2(y,k,x),h.relativeLuminance2(p,w,b));return(y<<24|k<<16|x<<8|255)>>>0}t.ensureContrastRatio=function(f,S,l){const p=h.relativeLuminance(f>>8),w=h.relativeLuminance(S>>8);
7if(i(p,w)<l){if(w<p){const k=n(f,S,l),x=i(p,h.relativeLuminance(k>>8));if(x<l){const I=a(f,S,l);return x>i(p,h.relativeLuminance(I>>8))?k:I}return k}const b=a(f,S,l),y=i(p,h.relativeLuminance(b>>8));if(y<l){const k=n(f,S,l);return y>i(p,h.relativeLuminance(k>>8))?b:k}return b}},t.reduceLuminance=n,t.increaseLuminance=a,t.toChannels=function(f){return[f>>24&255,f>>16&255,f>>8&255,255&f]},t.toColor=function(f,S,l,p){return{css:u.toCss(f,S,l,p),rgba:u.toRgba(f,S,l,p)}}}(e=r.rgba||(r.rgba={})),r.toPaddedHex=s,r.contrastRatio=i},8969:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const c=o(844),v=o(2585),d=o(4348),_=o(7866),g=o(744),u=o(7302),h=o(6975),e=o(8460),s=o(1753),i=o(1480),t=o(7994),n=o(9282),a=o(5435),f=o(5981),S=o(2660);let l=!1;class p extends c.Disposable{constructor(b){super(),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 d.InstantiationService,this.optionsService=this.register(new u.OptionsService(b)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new a.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new f.WriteBuffer((y,k)=>this._inputHandler.parse(y,k))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed)),this.register((0,c.toDisposable)(()=>{var y;(y=this._windowsWrappingHeuristics)===null||y===void 0||y.dispose(),this._windowsWrappingHeuristics=void 0}))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(b=>{var y;(y=this._onScrollApi)===null||y===void 0||y.fire(b.position)})),this._onScrollApi.event}
7get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(b){for(const y in b)this.optionsService.options[y]=b[y]}write(b,y){this._writeBuffer.write(b,y)}writeSync(b,y){this._logService.logLevel<=v.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(b,y)}resize(b,y){isNaN(b)||isNaN(y)||(b=Math.max(b,g.MINIMUM_COLS),y=Math.max(y,g.MINIMUM_ROWS),this._bufferService.resize(b,y))}scroll(b,y=!1){this._bufferService.scroll(b,y)}scrollLines(b,y,k){this._bufferService.scrollLines(b,y,k)}scrollPages(b){this._bufferService.scrollPages(b)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(b){this._bufferService.scrollToLine(b)}registerEscHandler(b,y){return this._inputHandler.registerEscHandler(b,y)}registerDcsHandler(b,y){return this._inputHandler.registerDcsHandler(b,y)}registerCsiHandler(b,y){return this._inputHandler.registerCsiHandler(b,y)}registerOscHandler(b,y){return this._inputHandler.registerOscHandler(b,y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){var b;let y=!1;const k=this.optionsService.rawOptions.windowsPty;k&&k.buildNumber!==void 0&&k.buildNumber!==void 0?y=k.backend==="conpty"&&k.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(y=!0),y?this._enableWindowsWrappingHeuristics():((b=this._windowsWrappingHeuristics)===null||b===void 0||b.dispose(),this._windowsWrappingHeuristics=void 0)}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics){const b=[];b.push(this.onLineFeed(n.updateWindowsModeWrappedState.bind(null,this._bufferService))),b.push(this.registerCsiHandler({final:"H"},()=>((0,n.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics=(0,c.toDisposable)(()=>{for(const y of b)y.dispose()})}}}r.CoreTerminal=p},8460:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const v=[];for(let d=0;d<this._listeners.length;d++)v.push(this._listeners[d]);for(let d=0;d<v.length;d++)v[d].call(void 0,o,c)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},r.forwardEvent=function(o,c){return o(v=>c.fire(v))}},5435:function(O,r,o){var c=this&&this.__decorate||function(A,m,E,R){var D,B=arguments.length,F=B<3?m:R===null?R=Object.getOwnPropertyDescriptor(m,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(A,m,E,R);else for(var U=A.length-1;U>=0;U--)(D=A[U])&&(F=(B<3?D(F):B>3?D(m,E,F):D(m,E))||F);return B>3&&F&&Object.defineProperty(m,E,F),F},v=this&&this.__param||function(A,m){return function(E,R){m(E,R,A)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const d=o(2584),_=o(7116),g=o(2015),u=o(844),h=o(482),e=o(8437),s=o(8460),i=o(643),t=o(511),n=o(3734),a=o(2585),f=o(6242),S=o(6351),l=o(5941),p={"(":0,")":1,"*":2,"+":3,"-":1,".":2},w=131072;function b(A,m){if(A>24)return m.setWinLines||!1;switch(A){case 1:return!!m.restoreWin;case 2:return!!m.minimizeWin;case 3:return!!m.setWinPosition;case 4:return!!m.setWinSizePixels;case 5:return!!m.raiseWin;case 6:return!!m.lowerWin;case 7:return!!m.refreshWin;case 8:return!!m.setWinSizeChars;case 9:return!!m.maximizeWin;case 10:return!!m.fullscreenWin;case 11:return!!m.getWinState;case 13:return!!m.getWinPosition;case 14:return!!m.getWinSizePixels;case 15:return!!m.getScreenSizePixels;case 16:return!!m.getCellSizePixels;case 18:return!!m.getWinSizeChars;case 19:return!!m.getScreenSizeChars;case 20:return!!m.getIconTitle;case 21:return!!m.getWinTitle;case 22:return!!m.pushTitle;case 23:return!!m.popTitle;case 24:return!!m.setWinLines}return!1}var y;(function(A){A[A.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",A[A.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(y=r.WindowsOptionsReportType||(r.WindowsOptionsReportType={}));let k=0;class x extends u.Disposable{constructor(m,E,R,D,B,F,U,P,L=new g.EscapeSequenceParser){super(),this._bufferService=m,this._charsetService=E,this._coreService=R,this._logService=D,this._optionsService=B,this._oscLinkService=F,this._coreMouseService=U,this._unicodeService=P,this._parser=L,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new t.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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(C=>
vendor: 5,832 bytes, line 7
7this._activeBuffer=C.activeBuffer)),this._parser.setCsiHandlerFallback((C,T)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(C),params:T.toArray()})}),this._parser.setEscHandlerFallback(C=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(C)})}),this._parser.setExecuteHandlerFallback(C=>{this._logService.debug("Unknown EXECUTE code: ",{code:C})}),this._parser.setOscHandlerFallback((C,T,M)=>{this._logService.debug("Unknown OSC code: ",{identifier:C,action:T,data:M})}),this._parser.setDcsHandlerFallback((C,T,M)=>{T==="HOOK"&&(M=M.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(C),action:T,payload:M})}),this._parser.setPrintHandler((C,T,M)=>this.print(C,T,M)),this._parser.registerCsiHandler({final:"@"},C=>this.insertChars(C)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},C=>this.scrollLeft(C)),this._parser.registerCsiHandler({final:"A"},C=>this.cursorUp(C)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},C=>this.scrollRight(C)),this._parser.registerCsiHandler({final:"B"},C=>this.cursorDown(C)),this._parser.registerCsiHandler({final:"C"},C=>this.cursorForward(C)),this._parser.registerCsiHandler({final:"D"},C=>this.cursorBackward(C)),this._parser.registerCsiHandler({final:"E"},C=>this.cursorNextLine(C)),this._parser.registerCsiHandler({final:"F"},C=>this.cursorPrecedingLine(C)),this._parser.registerCsiHandler({final:"G"},C=>this.cursorCharAbsolute(C)),this._parser.registerCsiHandler({final:"H"},C=>this.cursorPosition(C)),this._parser.registerCsiHandler({final:"I"},C=>this.cursorForwardTab(C)),this._parser.registerCsiHandler({final:"J"},C=>this.eraseInDisplay(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},C=>this.eraseInDisplay(C,!0)),this._parser.registerCsiHandler({final:"K"},C=>this.eraseInLine(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},C=>this.eraseInLine(C,!0)),this._parser.registerCsiHandler({final:"L"},C=>this.insertLines(C)),this._parser.registerCsiHandler({final:"M"},C=>this.deleteLines(C)),this._parser.registerCsiHandler({final:"P"},C=>this.deleteChars(C)),this._parser.registerCsiHandler({final:"S"},C=>this.scrollUp(C)),this._parser.registerCsiHandler({final:"T"},C=>this.scrollDown(C)),this._parser.registerCsiHandler({final:"X"},C=>this.eraseChars(C)),this._parser.registerCsiHandler({final:"Z"},C=>this.cursorBackwardTab(C)),this._parser.registerCsiHandler({final:"`"},C=>this.charPosAbsolute(C)),this._parser.registerCsiHandler({final:"a"},C=>this.hPositionRelative(C)),this._parser.registerCsiHandler({final:"b"},C=>this.repeatPrecedingCharacter(C)),this._parser.registerCsiHandler({final:"c"},C=>this.sendDeviceAttributesPrimary(C)),this._parser.registerCsiHandler({prefix:">",final:"c"},C=>this.sendDeviceAttributesSecondary(C)),this._parser.registerCsiHandler({final:"d"},C=>this.linePosAbsolute(C)),this._parser.registerCsiHandler({final:"e"},C=>this.vPositionRelative(C)),this._parser.registerCsiHandler({final:"f"},C=>this.hVPosition(C)),this._parser.registerCsiHandler({final:"g"},C=>this.tabClear(C)),this._parser.registerCsiHandler({final:"h"},C=>this.setMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"h"},C=>this.setModePrivate(C)),this._parser.registerCsiHandler({final:"l"},C=>this.resetMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"l"},C=>this.resetModePrivate(C)),this._parser.registerCsiHandler({final:"m"},C=>this.charAttributes(C)),this._parser.registerCsiHandler({final:"n"},C=>this.deviceStatus(C)),this._parser.registerCsiHandler({prefix:"?",final:"n"},C=>this.deviceStatusPrivate(C)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},C=>this.softReset(C)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},C=>this.setCursorStyle(C)),this._parser.registerCsiHandler({final:"r"},C=>this.setScrollRegion(C)),this._parser.registerCsiHandler({final:"s"},C=>this.saveCursor(C)),this._parser.registerCsiHandler({final:"t"},C=>this.windowOptions(C)),this._parser.registerCsiHandler({final:"u"},C=>this.restoreCursor(C)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},C=>this.insertColumns(C)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},C=>this.deleteColumns(C)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},C=>this.selectProtected(C)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},C=>this.requestMode(C,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},C=>this.requestMode(C,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new f.OscHandler(C=>(this.setTitle(C),this.setIconName(C),!0))),this._parser.registerOscHandler(1,new f.OscHandler(C=>this.setIconName(C))),this._parser.registerOscHandler(2,new f.OscHandler(C=>this.setTitle(C))),this._parser.registerOscHandler(4,new f.OscHandler(C=>this.setOrReportIndexedColor(C))),this._parser.registerOscHandler(8,new f.OscHandler(C=>this.setHyperlink(C))),this._parser.registerOscHandler(10,new f.OscHandler(C=>this.setOrReportFgColor(C))),this._parser.registerOscHandler(11,new f.OscHandler(C=>
7this.setOrReportBgColor(C))),this._parser.registerOscHandler(12,new f.OscHandler(C=>this.setOrReportCursorColor(C))),this._parser.registerOscHandler(104,new f.OscHandler(C=>this.restoreIndexedColor(C))),this._parser.registerOscHandler(110,new f.OscHandler(C=>this.restoreFgColor(C))),this._parser.registerOscHandler(111,new f.OscHandler(C=>this.restoreBgColor(C))),this._parser.registerOscHandler(112,new f.OscHandler(C=>this.restoreCursorColor(C))),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 C in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:C},()=>this.selectCharset("("+C)),this._parser.registerEscHandler({intermediates:")",final:C},()=>this.selectCharset(")"+C)),this._parser.registerEscHandler({intermediates:"*",final:C},()=>this.selectCharset("*"+C)),this._parser.registerEscHandler({intermediates:"+",final:C},()=>this.selectCharset("+"+C)),this._parser.registerEscHandler({intermediates:"-",final:C},()=>this.selectCharset("-"+C)),this._parser.registerEscHandler({intermediates:".",final:C},()=>this.selectCharset("."+C)),this._parser.registerEscHandler({intermediates:"/",final:C},()=>this.selectCharset("/"+C));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(C=>(this._logService.error("Parsing error: ",C),C)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new S.DcsHandler((C,T)=>this.requestStatusString(C,T)))}getAttrData(){return this._curAttrData}_preserveStack(m,E,R,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=m,this._parseStack.cursorStartY=E,this._parseStack.decodedLength=R,this._parseStack.position=D}_logSlowResolvingAsync(m){this._logService.logLevel<=a.LogLevelEnum.WARN&&Promise.race([m,new Promise((E,R)=>setTimeout(()=>R("#SLOW_TIMEOUT"),5e3))]).catch(E=>{if(E!=="#SLOW_TIMEOUT")throw E;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(m,E){let R,D=this._activeBuffer.x,B=this._activeBuffer.y,F=0;const U=this._parseStack.paused;if(U){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,E))return this._logSlowResolvingAsync(R),R;D=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,m.length>w&&(F=this._parseStack.position+w)}if(this._logService.logLevel<=a.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof m=="string"?` "${m}"`:` "${Array.prototype.map.call(m,P=>String.fromCharCode(P)).join("")}"`),typeof m=="string"?m.split("").map(P=>P.charCodeAt(0)):m),this._parseBuffer.length<m.length&&this._parseBuffer.length<w&&(this._parseBuffer=new Uint32Array(Math.min(m.length,w))),U||this._dirtyRowTracker.clearRange(),m.length>w)for(let P=F;P<m.length;P+=w){const L=P+w<m.length?P+w:m.length,C=typeof m=="string"?this._stringDecoder.decode(m.substring(P,L),this._parseBuffer):this._utf8Decoder.decode(m.subarray(P,L),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,C))return this._preserveStack(D,B,C,P),this._logSlowResolvingAsync(R),R}else if(!U){const P=typeof m=="string"?this._stringDecoder.decode(m,this._parseBuffer):this._utf8Decoder.decode(m,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,P))return this._preserveStack(D,B,P,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===D&&this._activeBuffer.y===B||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(m,E,R){let D,B;const F=this._charsetService.charset,U=this._optionsService.rawOptions.screenReaderMode,P=this._bufferService.cols,L=this._coreService.decPrivateModes.wraparound,C=this._coreService.modes.insertMode,T=this._curAttrData;let M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-E>0&&M.getWidth(this._activeBuffer.x-1)===2&&M.setCellFromCodePoint(this._activeBuffer.x-1,0,1,T.fg,T.bg,T.extended);for(let N=E;N<R;++N){if(D=m[N],B=this._unicodeService.wcwidth(D),D<127&&F){const H=F[String.fromCharCode(D)];
7H&&(D=H.charCodeAt(0))}if(U&&this._onA11yChar.fire((0,h.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),B||!this._activeBuffer.x){if(this._activeBuffer.x+B-1>=P){if(L){for(;this._activeBuffer.x<P;)M.setCellFromCodePoint(this._activeBuffer.x++,0,1,T.fg,T.bg,T.extended);this._activeBuffer.x=0,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),M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=P-1,B===2)continue}if(C&&(M.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(T),T),M.getWidth(P-1)===2&&M.setCellFromCodePoint(P-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,T.fg,T.bg,T.extended)),M.setCellFromCodePoint(this._activeBuffer.x++,D,B,T.fg,T.bg,T.extended),B>0)for(;--B;)M.setCellFromCodePoint(this._activeBuffer.x++,0,0,T.fg,T.bg,T.extended)}else M.getWidth(this._activeBuffer.x-1)?M.addCodepointToCell(this._activeBuffer.x-1,D):M.addCodepointToCell(this._activeBuffer.x-2,D)}R-E>0&&(M.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<P&&R-E>0&&M.getWidth(this._activeBuffer.x)===0&&!M.hasContent(this._activeBuffer.x)&&M.setCellFromCodePoint(this._activeBuffer.x,0,1,T.fg,T.bg,T.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(m,E){return m.final!=="t"||m.prefix||m.intermediates?this._parser.registerCsiHandler(m,E):this._parser.registerCsiHandler(m,R=>!b(R.params[0],this._optionsService.rawOptions.windowOptions)||E(R))}registerDcsHandler(m,E){return this._parser.registerDcsHandler(m,new S.DcsHandler(E))}registerEscHandler(m,E){return this._parser.registerEscHandler(m,E)}registerOscHandler(m,E){return this._parser.registerOscHandler(m,new f.OscHandler(E))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var m;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&&(!((m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||m===void 0)&&m.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);E.hasWidth(this._activeBuffer.x)&&!E.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const m=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-m),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(m=this._bufferService.cols-1){this._activeBuffer.x=Math.min(m,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(m,E){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=m,this._activeBuffer.y=this._activeBuffer.scrollTop+E):(this._activeBuffer.x=m,this._activeBuffer.y=E),this._restrictCursor(
vendor: 4,547 bytes, line 7
7),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(m,E){this._restrictCursor(),this._setCursor(this._activeBuffer.x+m,this._activeBuffer.y+E)}cursorUp(m){const E=this._activeBuffer.y-this._activeBuffer.scrollTop;return E>=0?this._moveCursor(0,-Math.min(E,m.params[0]||1)):this._moveCursor(0,-(m.params[0]||1)),!0}cursorDown(m){const E=this._activeBuffer.scrollBottom-this._activeBuffer.y;return E>=0?this._moveCursor(0,Math.min(E,m.params[0]||1)):this._moveCursor(0,m.params[0]||1),!0}cursorForward(m){return this._moveCursor(m.params[0]||1,0),!0}cursorBackward(m){return this._moveCursor(-(m.params[0]||1),0),!0}cursorNextLine(m){return this.cursorDown(m),this._activeBuffer.x=0,!0}cursorPrecedingLine(m){return this.cursorUp(m),this._activeBuffer.x=0,!0}cursorCharAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(m){return this._setCursor(m.length>=2?(m.params[1]||1)-1:0,(m.params[0]||1)-1),!0}charPosAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(m){return this._moveCursor(m.params[0]||1,0),!0}linePosAbsolute(m){return this._setCursor(this._activeBuffer.x,(m.params[0]||1)-1),!0}vPositionRelative(m){return this._moveCursor(0,m.params[0]||1),!0}hVPosition(m){return this.cursorPosition(m),!0}tabClear(m){const E=m.params[0];return E===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:E===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=m.params[0]||1;for(;E--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=m.params[0]||1;for(;E--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(m){const E=m.params[0];return E===1&&(this._curAttrData.bg|=536870912),E!==2&&E!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(m,E,R,D=!1,B=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);F.replaceCells(E,R,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),B),D&&(F.isWrapped=!1)}_resetBufferLine(m,E=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),E),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+m),R.isWrapped=!1)}eraseInDisplay(m,E=!1){let R;switch(this._restrictCursor(this._bufferService.cols),m.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,E);R<this._bufferService.rows;R++)this._resetBufferLine(R,E);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,E),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,E);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,E);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(m,E=!1){switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,E);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,E);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,E)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(m){this._restrictCursor();let E=m.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,B=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;E--;)this._activeBuffer.lines.splice(B-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}
vendor: 4,135 bytes, line 7
7deleteLines(m){this._restrictCursor();let E=m.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;E--;)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(m){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.insertCells(this._activeBuffer.x,m.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(m){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.deleteCells(this._activeBuffer.x,m.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(m){let E=m.params[0]||1;for(;E--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(m){let E=m.params[0]||1;for(;E--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=m.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,E,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=m.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,E,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=m.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,E,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=m.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,E,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}
7eraseChars(m){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(m.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(m){if(!this._parser.precedingCodepoint)return!0;const E=m.params[0]||1,R=new Uint32Array(E);for(let D=0;D<E;++D)R[D]=this._parser.precedingCodepoint;return this.print(R,0,R.length),!0}sendDeviceAttributesPrimary(m){return!0}sendDeviceAttributesSecondary(m){return!0}_is(m){return(this._optionsService.rawOptions.termName+"").indexOf(m)===0}setMode(m){for(let E=0;E<m.length;E++)switch(m.params[E]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(m){for(let E=0;E<m.length;E++)switch(m.params[E]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(m){for(let E=0;E<m.length;E++)switch(m.params[E]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(m){for(let E=0;E<m.length;E++)switch(m.params[E]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;
7case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),m.params[E]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(m,E){return!0}_updateAttrColor(m,E,R,D,B){return E===2?(m|=50331648,m&=-16777216,m|=n.AttributeData.fromColorRGB([R,D,B])):E===5&&(m&=-50331904,m|=33554432|255&R),m}_extractColor(m,E,R){const D=[0,0,-1,0,0,0];let B=0,F=0;do{if(D[F+B]=m.params[E+F],m.hasSubParams(E+F)){const U=m.getSubParams(E+F);let P=0;do D[1]===5&&(B=1),D[F+P+1+B]=U[P];while(++P<U.length&&P+F+1+B<D.length);break}if(D[1]===5&&F+B>=2||D[1]===2&&F+B>=5)break;D[1]&&(B=1)}while(++F+E<m.length&&F+B<D.length);for(let U=2;U<D.length;++U)D[U]===-1&&(D[U]=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 F}_processUnderline(m,E){E.extended=E.extended.clone(),(!~m||m>5)&&(m=1),E.extended.underlineStyle=m,E.fg|=268435456,m===0&&(E.fg&=-268435457),E.updateExtended()}_processSGR0(m){m.fg=e.DEFAULT_ATTR_DATA.fg,m.bg=e.DEFAULT_ATTR_DATA.bg,m.extended=m.extended.clone(),m.extended.underlineStyle=0,m.extended.underlineColor&=-67108864,m.updateExtended()}charAttributes(m){if(m.length===1&&m.params[0]===0)return this._processSGR0(this._curAttrData),!0;const E=m.length;let R;const D=this._curAttrData;for(let B=0;B<E;B++)R=m.params[B],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(m.hasSubParams(B)?m.getSubParams(B)[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?B+=this._extractColor(m,B,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(m){return!0}deviceStatusPrivate(m){return!0}softReset(m){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(m){const E=m.params[0]||1;switch(E){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const R=E%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(m){const E=m.params[0]||1;let R;return(m.length<2||(R=m.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>E&&(this._activeBuffer.scrollTop=E-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(m){if(!b(m.params[0],this._optionsService.rawOptions.windowOptions))return!0;const E=m.length>1?m.params[1]:0;switch(m.params[0]){case 14:E!==2&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:break;case 22:E!==0&&E!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),E!==0&&E!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:E!==0&&E!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),E!==0&&E!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(m){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(m){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(
7),!0}setTitle(m){return this._windowTitle=m,this._onTitleChange.fire(m),!0}setIconName(m){return this._iconName=m,!0}setOrReportIndexedColor(m){const E=[],R=m.split(";");for(;R.length>1;){const D=R.shift(),B=R.shift();if(/^\d+$/.exec(D)){const F=parseInt(D);if(0<=F&&F<256)if(B==="?")E.push({type:0,index:F});else{const U=(0,l.parseColor)(B);U&&E.push({type:1,index:F,color:U})}}}return E.length&&this._onColor.fire(E),!0}setHyperlink(m){const E=m.split(";");return!(E.length<2)&&(E[1]?this._createHyperlink(E[0],E[1]):!E[0]&&this._finishHyperlink())}_createHyperlink(m,E){this._getCurrentLinkId()&&this._finishHyperlink();const R=m.split(":");let D;const B=R.findIndex(F=>F.startsWith("id="));return B!==-1&&(D=R[B].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:E}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(m,E){const R=m.split(";");for(let D=0;D<R.length&&!(E>=this._specialColors.length);++D,++E)if(R[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[E]}]);else{const B=(0,l.parseColor)(R[D]);B&&this._onColor.fire([{type:1,index:this._specialColors[E],color:B}])}return!0}setOrReportFgColor(m){return this._setOrReportSpecialColor(m,0)}setOrReportBgColor(m){return this._setOrReportSpecialColor(m,1)}setOrReportCursorColor(m){return this._setOrReportSpecialColor(m,2)}restoreIndexedColor(m){if(!m)return this._onColor.fire([{type:2}]),!0;const E=[],R=m.split(";");for(let D=0;D<R.length;++D)if(/^\d+$/.exec(R[D])){const B=parseInt(R[D]);0<=B&&B<256&&E.push({type:2,index:B})}return E.length&&this._onColor.fire(E),!0}restoreFgColor(m){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(m){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(m){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,_.DEFAULT_CHARSET),!0}selectCharset(m){return m.length!==2?(this.selectDefaultCharset(),!0):(m[0]==="/"||this._charsetService.setgCharset(p[m[0]],_.CHARSETS[m[1]]||_.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 m=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,m,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(m){return this._charsetService.setgLevel(m),!0}screenAlignmentPattern(){const m=new t.CellData;m.content=4194304|"E".charCodeAt(0),m.fg=this._curAttrData.fg,m.bg=this._curAttrData.bg,this._setCursor(0,0);for(let E=0;E<this._bufferService.rows;++E){const R=this._activeBuffer.ybase+this._activeBuffer.y+E,D=this._activeBuffer.lines.get(R);D&&(D.fill(m),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(m,E){return!0}markRangeDirty(m,E){this._dirtyRowTracker.markRangeDirty(m,E)}}r.InputHandler=x;let I=class{constructor(A){this._bufferService=A,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(A){A<this.start?this.start=A:A>this.end&&(this.end=A)}markRangeDirty(A,m){A>m&&(k=A,A=m,m=k),A<this.start&&(this.start=A),m>this.end&&(this.end=m)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};I=c([v(0,a.IBufferService)],I)},844:(O,r)=>{function o(c){for(const v of c)v.dispose();c.length=0}
7Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const v=this._disposables.indexOf(c);v!==-1&&this._disposables.splice(v,1)}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(v,d,_){this._data[v]||(this._data[v]={}),this._data[v][d]=_}get(v,d){return this._data[v]?this._data[v][d]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(c,v,d,_,g){this._data.get(c,v)||this._data.set(c,v,new o),this._data.get(c,v).set(d,_,g)}get(c,v,d,_){var g;return(g=this._data.get(c,v))===null||g===void 0?void 0:g.get(d,_)}clear(){this._data.clear()}}},6114:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,c=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=o.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),r.isIpad=c==="iPad",r.isIphone=c==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),r.isLinux=c.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},6106:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let o=0;r.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c),0,this._array.length-1),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const v=this._getKey(c);if(v===void 0||(o=this._search(v,0,this._array.length-1),o===-1)||this._getKey(this._array[o])!==v)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===v);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c,0,this._array.length-1),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,v){if(this._array.length!==0&&(o=this._search(c,0,this._array.length-1),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do v(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return this._array.values()}_search(c,v,d){if(d<v)return v;let _=Math.floor((v+d)/2);const g=this._getKey(this._array[_]);if(g>c)return this._search(c,v,_-1);if(g<c)return this._search(c,_+1,d);for(;_>0&&this._getKey(this._array[_-1])===c;)_--;return _}}},7226:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const c=o(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let u=0,h=0,e=g.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(u=Date.now(),this._tasks[this._i]()||this._i++,u=Math.max(1,Date.now()-u),h=Math.max(u,h),s=g.timeRemaining(),1.5*h>s)return e-u<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-u))}ms`),void this._start();e=s}this.clear()}}class d extends v{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const u=Date.now()+g;return{timeRemaining:()=>
vendor: 4,152 bytes, line 7
7Math.max(0,u-Date.now())}}}r.PriorityTaskQueue=d,r.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const c=o(643);r.updateWindowsModeWrappedState=function(v){const d=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),_=d==null?void 0:d.get(v.cols-1),g=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);g&&_&&(g.isWrapped=_[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&_[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new o;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}r.AttributeData=o;class c{constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=c},9092:(O,r,o)=>
vendor: 4,479 bytes, line 7
7{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const c=o(6349),v=o(8437),d=o(511),_=o(643),g=o(4634),u=o(4863),h=o(7116),e=o(3734),s=o(7226);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(i,t,n){this._hasScrollback=i,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=d.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=d.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new s.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(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 e.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 e.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,t){return new v.BufferLine(this._bufferService.cols,this.getNullCell(i),t)}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 t=i+this._optionsService.rawOptions.scrollback;return t>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:t}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=v.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,t){const n=this.getNullCell(v.DEFAULT_ATTR_DATA);let a=0;const f=this._getCorrectBufferLength(t);if(f>this.lines.maxLength&&(this.lines.maxLength=f),this.lines.length>0){if(this._cols<i)for(let l=0;l<this.lines.length;l++)a+=+this.lines.get(l).resize(i,n);let S=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(i,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+S+1?(this.ybase--,S++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(i,n)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(f<this.lines.maxLength){const l=this.lines.length-f;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=f}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,t-1),S&&(this.y+=S),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(i,t),this._cols>i))for(let S=0;S<this.lines.length;S++)a+=+this.lines.get(S).resize(i,n);this._cols=i,this._rows=t,this._memoryCleanupQueue.clear(),a>.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 t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>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,t){this._cols!==i&&(i>this._cols?this._reflowLarger(i,t):this._reflowSmaller(i,t))}_reflowLarger(i,t){const n=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNull
7Cell(v.DEFAULT_ATTR_DATA));if(n.length>0){const a=(0,g.reflowLargerCreateNewLayout)(this.lines,n);(0,g.reflowLargerApplyNewLayout)(this.lines,a.layout),this._reflowLargerAdjustViewport(i,t,a.countRemoved)}}_reflowLargerAdjustViewport(i,t,n){const a=this.getNullCell(v.DEFAULT_ATTR_DATA);let f=n;for(;f-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new v.BufferLine(i,a))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(i,t){const n=this.getNullCell(v.DEFAULT_ATTR_DATA),a=[];let f=0;for(let S=this.lines.length-1;S>=0;S--){let l=this.lines.get(S);if(!l||!l.isWrapped&&l.getTrimmedLength()<=i)continue;const p=[l];for(;l.isWrapped&&S>0;)l=this.lines.get(--S),p.unshift(l);const w=this.ybase+this.y;if(w>=S&&w<S+p.length)continue;const b=p[p.length-1].getTrimmedLength(),y=(0,g.reflowSmallerGetNewLineLengths)(p,this._cols,i),k=y.length-p.length;let x;x=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+k):Math.max(0,this.lines.length-this.lines.maxLength+k);const I=[];for(let B=0;B<k;B++){const F=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);I.push(F)}I.length>0&&(a.push({start:S+p.length+f,newLines:I}),f+=I.length),p.push(...I);let A=y.length-1,m=y[A];m===0&&(A--,m=y[A]);let E=p.length-k-1,R=b;for(;E>=0;){const B=Math.min(R,m);if(p[A]===void 0)break;if(p[A].copyCellsFrom(p[E],R-B,m-B,B,!0),m-=B,m===0&&(A--,m=y[A]),R-=B,R===0){E--;const F=Math.max(E,0);R=(0,g.getWrappedLineTrimmedLength)(p,F,this._cols)}}for(let B=0;B<p.length;B++)y[B]<i&&p[B].setCell(y[B],n);let D=k-x;for(;D-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+k,this.ybase+t-1)}if(a.length>0){const S=[],l=[];for(let A=0;A<this.lines.length;A++)l.push(this.lines.get(A));const p=this.lines.length;let w=p-1,b=0,y=a[b];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);let k=0;for(let A=Math.min(this.lines.maxLength-1,p+f-1);A>=0;A--)if(y&&y.start>w+k){for(let m=y.newLines.length-1;m>=0;m--)this.lines.set(A--,y.newLines[m]);A++,S.push({index:w+1,amount:y.newLines.length}),k+=y.newLines.length,y=a[++b]}else this.lines.set(A,l[w--]);let x=0;for(let A=S.length-1;A>=0;A--)S[A].index+=x,this.lines.onInsertEmitter.fire(S[A]),x+=S[A].amount;const I=Math.max(0,p+f-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(i,t,n=0,a){const f=this.lines.get(i);return f?f.translateToString(t,n,a):""}getWrappedRangeForLine(i){let t=i,n=i;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}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 t=0;t<this.markers.length;t++)this.markers[t].line===i&&(this.markers[t].dispose(),this.markers.splice(t--,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}
7addMarker(i){const t=new u.Marker(i);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const c=o(482),v=o(643),d=o(511),_=o(3734);r.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let g=0;class u{constructor(e,s,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const t=s||d.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]);for(let n=0;n<e;++n)this.setCell(n,t);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,c.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[v.CHAR_DATA_ATTR_INDEX],s[v.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=s[1],this._data[3*e+0]=2097152|e|s[v.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=s[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[v.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,c.stringFromCodePoint)(2097151&s):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,s){return g=3*e,s.content=this._data[g+0],s.fg=this._data[g+1],s.bg=this._data[g+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,t,n,a){268435456&n&&(this._extendedAttrs[e]=a),this._data[3*e+0]=s|i<<22,this._data[3*e+1]=t,this._data[3*e+2]=n}addCodepointToCell(e,s){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,c.stringFromCodePoint)(s):(2097151&i?(this._combined[e]=(0,c.stringFromCodePoint)(2097151&i)+(0,c.stringFromCodePoint)(s),i&=-2097152,i|=2097152):i=s|4194304,this._data[3*e+0]=i)}insertCells(e,s,i,t){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new _.ExtendedAttrs),s<this.length-e){const n=new d.CellData;for(let a=this.length-e-s-1;a>=0;--a)this.setCell(e+s+a,this.loadCell(e+a,n));for(let a=0;a<s;++a)this.setCell(e+a,i)}else for(let n=e;n<this.length;++n)this.setCell(n,i);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new _.ExtendedAttrs)}deleteCells(e,s,i,t){if(e%=this.length,s<this.length-e){const n=new d.CellData;for(let a=0;a<this.length-e-s;++a)this.setCell(e+a,this.loadCell(e+s+a,n));for(let a=this.length-s;a<this.length;++a)this.setCell(a,i)}else for(let n=e;n<this.length;++n)this.setCell(n,i);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new _.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new _.ExtendedAttrs)}replaceCells(e,s,i,t,n=!1){if(n)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new _.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodePoint(s,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new _.ExtendedAttrs);e<s&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;
7else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new _.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodePoint(s,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new _.ExtendedAttrs);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 t=new Uint32Array(i);t.set(this._data),this._data=t}for(let t=this.length;t<e;++t)this.setCell(t,s)}else{this._data=this._data.subarray(0,i);const t=Object.keys(this._combined);for(let a=0;a<t.length;a++){const f=parseInt(t[a],10);f>=e&&delete this._combined[f]}const n=Object.keys(this._extendedAttrs);for(let a=0;a<n.length;a++){const f=parseInt(n[a],10);f>=e&&delete this._extendedAttrs[f]}}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 u(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}copyCellsFrom(e,s,i,t,n){const a=e._data;if(n)for(let S=t-1;S>=0;S--){for(let l=0;l<3;l++)this._data[3*(i+S)+l]=a[3*(s+S)+l];268435456&a[3*(s+S)+2]&&(this._extendedAttrs[i+S]=e._extendedAttrs[s+S])}else for(let S=0;S<t;S++){for(let l=0;l<3;l++)this._data[3*(i+S)+l]=a[3*(s+S)+l];268435456&a[3*(s+S)+2]&&(this._extendedAttrs[i+S]=e._extendedAttrs[s+S])}const f=Object.keys(e._combined);for(let S=0;S<f.length;S++){const l=parseInt(f[S],10);l>=s&&(this._combined[l-s+i]=e._combined[l])}}translateToString(e=!1,s=0,i=this.length){e&&(i=Math.min(i,this.getTrimmedLength()));let t="";for(;s<i;){const n=this._data[3*s+0],a=2097151&n;t+=2097152&n?this._combined[s]:a?(0,c.stringFromCodePoint)(a):v.WHITESPACE_CELL_CHAR,s+=n>>22||1}return t}}r.BufferLine=u},4841:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(O,r)=>{function o(c,v,d){if(v===c.length-1)return c[v].getTrimmedLength();const _=!c[v].hasContent(d-1)&&c[v].getWidth(d-1)===1,g=c[v+1].getWidth(0)===2;return _&&g?d-1:d}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(c,v,d,_,g){const u=[];for(let h=0;h<c.length-1;h++){let e=h,s=c.get(++e);if(!s.isWrapped)continue;const i=[c.get(h)];for(;e<c.length&&s.isWrapped;)i.push(s),s=c.get(++e);if(_>=h&&_<e){h+=i.length-1;continue}let t=0,n=o(i,t,v),a=1,f=0;for(;a<i.length;){const l=o(i,a,v),p=l-f,w=d-n,b=Math.min(p,w);i[t].copyCellsFrom(i[a],f,n,b,!1),n+=b,n===d&&(t++,n=0),f+=b,f===l&&(a++,f=0),n===0&&t!==0&&i[t-1].getWidth(d-1)===2&&(i[t].copyCellsFrom(i[t-1],d-1,n++,1,!1),i[t-1].setCell(d-1,g))}i[t].replaceCells(n,d,g);let S=0;for(let l=i.length-1;l>0&&(l>t||i[l].getTrimmedLength()===0);l--)S++;S>
vendor: 4,437 bytes, line 7
70&&(u.push(h+i.length-S),u.push(S)),h+=i.length-1}return u},r.reflowLargerCreateNewLayout=function(c,v){const d=[];let _=0,g=v[_],u=0;for(let h=0;h<c.length;h++)if(g===h){const e=v[++_];c.onDeleteEmitter.fire({index:h-u,amount:e}),h+=e-1,u+=e,g=v[++_]}else d.push(h);return{layout:d,countRemoved:u}},r.reflowLargerApplyNewLayout=function(c,v){const d=[];for(let _=0;_<v.length;_++)d.push(c.get(v[_]));for(let _=0;_<d.length;_++)c.set(_,d[_]);c.length=v.length},r.reflowSmallerGetNewLineLengths=function(c,v,d){const _=[],g=c.map((s,i)=>o(c,i,v)).reduce((s,i)=>s+i);let u=0,h=0,e=0;for(;e<g;){if(g-e<d){_.push(g-e);break}u+=d;const s=o(c,h,v);u>s&&(u-=s,h++);const i=c[h].getWidth(u-1)===2;i&&u--;const t=i?d-1:d;_.push(t),e+=t}return _},r.getWrappedLineTrimmedLength=o},5295:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const c=o(9092),v=o(8460),d=o(844);class _ extends d.Disposable{constructor(u,h){super(),this._optionsService=u,this._bufferService=h,this._onBufferActivate=this.register(new v.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 c.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new c.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(u){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(u),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(u,h){this._normal.resize(u,h),this._alt.resize(u,h),this.setupTabStops(u)}setupTabStops(u){this._normal.setupTabStops(u),this._alt.setupTabStops(u)}}r.BufferSet=_},511:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const c=o(482),v=o(643),d=o(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(u){const h=new _;return h.setFromCharData(u),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(u){this.fg=u[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(u[v.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(u[v.CHAR_DATA_CHAR_INDEX].length===2){const e=u[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const s=u[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|u[v.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=u[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[v.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=u[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|u[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=_},643:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(O,r,o)=>
7{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const c=o(8460),v=o(844);class d{constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}r.Marker=d,d._nextId=1},7116:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"â",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:"â¥","{":"Ï","|":"â ","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ã","\\":"Ã","]":"à ","^":"Ã","`":"é","{":"ä","|":"ö","}":"Ã¥","~":"ü"},r.CHARSETS.R={"#":"£","@":"à ","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à ","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ã","\\":"Ã","]":"Ã","{":"ä","|":"ö","}":"ü","~":"Ã"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à ","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ã","[":"Ã","\\":"Ã","]":"à ","^":"Ã","`":"ä","{":"æ","|":"ø","}":"Ã¥","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ã","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"Ã","[":"Ã","\\":"Ã","]":"à ","^":"Ã","`":"é","{":"ä","|":"ö","}":"Ã¥","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à ","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(O,r)=>{var o,c;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(v){v.NUL="\0",v.SOH="�",v.STX="�",v.ETX="�",v.EOT="�",v.ENQ="�",v.ACK="�",v.BEL="\x07",v.BS="\b",v.HT=" ",v.LF=` 8`,v.VT="\v",v.FF="\f",v.CR="\r",v.SO="�",v.SI="�",v.DLE="�",v.DC1="�",v.DC2="�",v.DC3="�",v.DC4="�",v.NAK="�",v.SYN="�",v.ETB="�",v.CAN="�",v.EM="�",v.SUB="�",v.ESC="\x1B",v.FS="�",v.GS="�",v.RS="�",v.US="�",v.SP=" ",v.DEL="�"}(o=r.C0||(r.C0={})),(c=r.C1||(r.C1={})).PAD="Â",c.HOP="Â",c.BPH="Â",c.NBH="Â",c.IND="Â",c.NEL=" ",c.SSA="Â",c.ESA="Â",c.HTS="Â",c.HTJ="Â",c.VTS="Â",c.PLD="Â",c.PLU="Â",c.RI="Â",c.SS2="Â",c.SS3="Â",c.DCS="Â",c.PU1="Â",c.PU2="Â",c.STS="Â",c.CCH="Â",c.MW="Â",c.SPA="Â",c.EPA="Â",c.SOS="Â",c.SGCI="Â",c.SCI="Â",c.CSI="Â",c.ST="Â",c.OSC="Â",c.PM="Â",c.APC="Â",(r.C1_ESCAPED||(r.C1_ESCAPED={})).ST=`${o.ESC}\\`},7399:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const c=o(2584),v={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(d,_,g,u){const h={type:0,cancel:!1,key:void 0},e=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?h.key=_?c.C0.ESC+"OA":c.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?h.key=_?c.C0.ESC+"OD":c.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?h.key=_?c.C0.ESC+"OC":c.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(h.key=_?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:if(d.altKey){h.key=c.C0.ESC+c.C0.DEL;break}h.key=c.C0.DEL;break;case 9:if(d.shiftKey){h.key=c.C0.ESC+"[Z";break}h.key=c.C0.HT,h.cancel=!0;break;case 13:h.key=d.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,h.cancel=!0;break;case 27:h.key=c.C0.ESC,d.altKey&&(h.key=c.C0.ESC+c.C0.ESC),h.cancel=!0;break;case 37:if(d.metaKey)break;e?(h.key=c.C0.ESC+"[1;"+(e+1)+"D",h.key===c.C0.ESC+"[1;3D"&&(h.key=c.C0.ESC+(g?"b":"[1;5D"))):h.key=_?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(d.metaKey)break;e?(h.key=c.C0.ESC+"[1;"+(e+1)+"C",h.key===c.C0.ESC+"[1;3C"&&(h.key=c.C0.ESC+(g?"f":"[1;5C"))):h.key=_?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(d.metaKey)break;e?(h.key=c.C0.ESC+"[1;"+(e+1)+"A",g||h.key!==c.C0.ESC+"[1;3A"||(h.key=c.C0.ESC+"[1;5A")):h.key=_?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(d.metaKey)break;e?(h.key=c.C0.ESC+"[1;"+(e+1)+"B",g||h.key!==c.C0.ESC+"[1;3B"||(h.key=c.C0.ESC+"[1;
85B")):h.key=_?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(h.key=c.C0.ESC+"[2~");break;case 46:h.key=e?c.C0.ESC+"[3;"+(e+1)+"~":c.C0.ESC+"[3~";break;case 36:h.key=e?c.C0.ESC+"[1;"+(e+1)+"H":_?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:h.key=e?c.C0.ESC+"[1;"+(e+1)+"F":_?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:d.shiftKey?h.type=2:d.ctrlKey?h.key=c.C0.ESC+"[5;"+(e+1)+"~":h.key=c.C0.ESC+"[5~";break;case 34:d.shiftKey?h.type=3:d.ctrlKey?h.key=c.C0.ESC+"[6;"+(e+1)+"~":h.key=c.C0.ESC+"[6~";break;case 112:h.key=e?c.C0.ESC+"[1;"+(e+1)+"P":c.C0.ESC+"OP";break;case 113:h.key=e?c.C0.ESC+"[1;"+(e+1)+"Q":c.C0.ESC+"OQ";break;case 114:h.key=e?c.C0.ESC+"[1;"+(e+1)+"R":c.C0.ESC+"OR";break;case 115:h.key=e?c.C0.ESC+"[1;"+(e+1)+"S":c.C0.ESC+"OS";break;case 116:h.key=e?c.C0.ESC+"[15;"+(e+1)+"~":c.C0.ESC+"[15~";break;case 117:h.key=e?c.C0.ESC+"[17;"+(e+1)+"~":c.C0.ESC+"[17~";break;case 118:h.key=e?c.C0.ESC+"[18;"+(e+1)+"~":c.C0.ESC+"[18~";break;case 119:h.key=e?c.C0.ESC+"[19;"+(e+1)+"~":c.C0.ESC+"[19~";break;case 120:h.key=e?c.C0.ESC+"[20;"+(e+1)+"~":c.C0.ESC+"[20~";break;case 121:h.key=e?c.C0.ESC+"[21;"+(e+1)+"~":c.C0.ESC+"[21~";break;case 122:h.key=e?c.C0.ESC+"[23;"+(e+1)+"~":c.C0.ESC+"[23~";break;case 123:h.key=e?c.C0.ESC+"[24;"+(e+1)+"~":c.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(g&&!u||!d.altKey||d.metaKey)!g||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?h.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(h.key=c.C0.US),d.key==="@"&&(h.key=c.C0.NUL)):d.keyCode===65&&(h.type=1);else{const s=v[d.keyCode],i=s==null?void 0:s[d.shiftKey?1:0];if(i)h.key=c.C0.ESC+i;else if(d.keyCode>=65&&d.keyCode<=90){const t=d.ctrlKey?d.keyCode-64:d.keyCode+32;let n=String.fromCharCode(t);d.shiftKey&&(n=n.toUpperCase()),h.key=c.C0.ESC+n}else if(d.keyCode===32)h.key=c.C0.ESC+(d.ctrlKey?c.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let t=d.code.slice(3,4);d.shiftKey||(t=t.toLowerCase()),h.key=c.C0.ESC+t,h.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?h.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?h.key=c.C0.NUL:d.keyCode>=51&&d.keyCode<=55?h.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?h.key=c.C0.DEL:d.keyCode===219?h.key=c.C0.ESC:d.keyCode===220?h.key=c.C0.FS:d.keyCode===221&&(h.key=c.C0.GS)}return h}},482:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,c=0,v=o.length){let d="";for(let _=c;_<v;++_){let g=o[_];g>65535?(g-=65536,d+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):d+=String.fromCharCode(g)}return d},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const v=o.length;if(!v)return 0;let d=0,_=0;if(this._interim){const g=o.charCodeAt(_++);56320<=g&&g<=57343?c[d++]=1024*(this._interim-55296)+g-56320+65536:(c[d++]=this._interim,c[d++]=g),this._interim=0}for(let g=_;g<v;++g){const u=o.charCodeAt(g);if(55296<=u&&u<=56319){if(++g>=v)return this._interim=u,d;const h=o.charCodeAt(g);56320<=h&&h<=57343?c[d++]=1024*(u-55296)+h-56320+65536:(c[d++]=u,c[d++]=h)}else u!==65279&&(c[d++]=u)}return d}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const v=o.length;if(!v)return 0;let d,_,g,u,h=0,e=0,s=0;if(this.interim[0]){let n=!1,a=this.interim[0];a&=(224&a)==192?31:(240&a)==224?15:7;let f,S=0;for(;(f=63&this.interim[++S])&&S<4;)a<<=6,a|=f;const l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=l-S;for(;s<p;){if(s>=v)return 0;if(f=o[s++],(192&f)!=128){s--,n=!0;break}this.interim[S++]=f,a<<=6,a|=63&f}n||(l===2?a<128?s--:c[h++]=a:l===3?a<2048||a>=55296&&a<=57343||a===65279||(c[h++]=a):a<65536||a>1114111||(c[h++]=a)),this.interim.fill(0)}const i=v-4;let t=s;for(;t<v;){for(;!(!(t<i)||128&(d=o[t])||128&(_=o[t+1])||128&(g=o[t+2])||128&(u=o[t+3]));)c[h++]=d,c[h++]=_,c[h++]=g,c[h++]=u,t+=4;if(d=o[t++],d<128)c[h++]=d;else if((224&d)==192){if(t>=v)return this.interim[0]=d,h;if(_=o[t++],(192&_)!=128){t--;continue}if(e=(31&d)<<6|63&_,e<128){t--;continue}c[h++]=e}else if((240&d)==224){if(t>=v)return this.interim[0]=d,h;if(_=o[t++],(192&_)!=128){t--;continue}if(t>=v)return this.interim[0]=d,this.interim[1]=_,h;if(g=o[t++],(192&g)!=128){t--;continue}if(e=(15&d)<<12|(63&_)<<6|63&g,e<2048||e>=55296&&e<=57343||e===65279)continue;c[h++]=e}else if((248&d)==240){if(t>=v)return this.interim[0]=d,h;if(_=o[t++],(192&_)!=128){t--;continue}if(t>=v)return this.interim[0]=d,this.interim[1]=_,h;if(g=o[t++],(192&g)!=128){t--;continue}if(t>=v)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=g,h;if(u=o[t++],(192&u)!=128){t--;continue}if(e=(7&d)<<18|(63&_)<<12|(63&g)<<6|63&u,e<65536||e>1114111)continue;c[h++]=e}}return h}}},225:(O,r)=>
vendor: 12,323 bytes, line 8
8{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const o=[[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]],c=[[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 v;r.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let d=0;d<o.length;++d)v.fill(0,o[d][0],o[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?v[d]:function(_,g){let u,h=0,e=g.length-1;if(_<g[0][0]||_>g[e][1])return!1;for(;e>=h;)if(u=h+e>>1,_>g[u][1])h=u+1;else{if(!(_<g[u][0]))return!0;e=u-1}return!1}(d,c)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const c=o(8460),v=o(844);class d extends v.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,u){if(u!==void 0&&this._syncCalls>u)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let h;for(this._isSyncWriting=!0;h=this._writeBuffer.shift();){this._action(h);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,u){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+=g.length,this._writeBuffer.push(g),this._callbacks.push(u),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(u)}_innerWrite(g=0,u=!0){const h=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,u);if(s){const t=n=>Date.now()-h>=12?setTimeout(()=>this._innerWrite(0,n)):this._innerWrite(h,n);return void s.catch(n=>(queueMicrotask(()=>{throw n}),Promise.resolve(!1))).then(t)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-h>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}r.WriteBuffer=d},5941:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function v(d,_){const g=d.toString(16),u=g.length<2?"0"+g:g;switch(_){case 4:return g[0];case 8:return u;case 12:return(u+u).slice(0,3);default:return u+u}}r.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const g=o.exec(_);if(g){const u=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/u*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/u*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/u*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),c.exec(_)&&[3,6,9,12].includes(_.length))){const g=_.length/3,u=[0,0,0];for(let h=0;h<3;++h){const e=parseInt(_.slice(g*h,g*h+g),16);u[h]=g===1?e<<4:g===2?e:g===3?e>>4:e>>8}return u}},r.toRgbString=function(d,_=16){const[g,u,h]=d;return`rgb:${v(g,_)}/${v(u,_)}/${v(h,_)}`}},5770:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const c=o(482),v=o(8742),d=o(5770),_=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(u,h){this._handlers[u]===void 0&&(this._handlers[u]=[]);const e=this._handlers[u];return e.push(h),{dispose:()=>{const s=e.indexOf(h);s!==-1&&e.splice(s,1)}}}clearHandler(u){this._handlers[u]&&delete this._handlers[u]}setHandlerFallback(u){this._handlerFb=u}reset(){if(this._active.length)for(let u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(u,h){if(this.reset(),this._ident=u,this._active=this._handlers[u]||_,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(h);else this._handlerFb(this._ident,"HOOK",h)}put(u,h,e){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(u,h,e);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(u,h,e))}unhook(u,h=!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=h,i=this._stack.fallThrough,this._stack.paused=!1),!i&&e===!1){for(;s>=0&&(e=this._active[s].unhook(u),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",u);this._active=_,this._ident=0}};const g=new v.Params;g.addParam(0),r.DcsHandler=class{constructor(u){this._handler=u,this._data="",this._params=g,this._hitLimit=!1}hook(u){this._params=u.length>1||u.params[0]?u.clone():g,this._data="",this._hitLimit=!1}put(u,h,e){this._hitLimit||(this._data+=(0,c.utf32ToString)(u,h,e),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(u){let h=!1;if(this._hitLimit)h=!1;else if(u&&(h=this._handler(this._data,this._params),h instanceof Promise))return h.then(e=>(this._params=g,this._data="",this._hitLimit=!1,e));return this._params=g,this._data="",this._hitLimit=!1,h}}},2015:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const c=o(844),v=o(8742),d=o(6242),_=o(6351);class g{constructor(s){this.table=new Uint8Array(s)}setDefault(s,i){this.table.fill(s<<4|i)}add(s,i,t,n){this.table[i<<8|s]=t<<4|n}addMany(s,i,t,n){for(let a=0;a<s.length;a++)this.table[i<<8|s[a]]=t<<4|n}}r.TransitionTable=g;const u=160;r.VT500_TRANSITION_TABLE=function(){const e=new g(4095),s=Array.apply(null,Array(256)).map((S,l)=>l),i=(S,l)=>s.slice(S,l),t=i(32,127),n=i(0,24);n.push(25),n.push.apply(n,i(28,32));const a=i(0,14);let f;for(f in e.setDefault(1,0),e.addMany(t,0,2,0),a)e.addMany([24,26,153,154],f,3,0),e.addMany(i(128,144),f,3,0),e.addMany(i(144,152),f,3,0),e.add(156,f,0,0),e.add(27,f,11,1),e.add(157,f,4,8),e.addMany([152,158,159],f,0,7),e.add(155,f,11,3),e.add(144,f,11,9);return e.addMany(n,0,3,0),e.addMany(n,1,3,1),e.add(127,1,0,1),e.addMany(n,8,0,8),e.addMany(n,3,3,3),e.add(127,3,0,3),e.addMany(n,4,3,4),e.add(127,4,0,4),e.addMany(n,6,3,6),e.addMany(n,5,3,5),e.add(127,5,0,5),e.addMany(n,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(t,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(t,7,0,7),e.addMany(n,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(n,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(n,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(n,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(n,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(n,13,13,13),e.addMany(t,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(u,0,2,0),e.add(u,8,5,8),e.add(u,6,0,6),e.add(u,11,0,11),e.add(u,13,13,13),e}();class h extends c.Disposable{constructor(s=r.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(i,t,n)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,t)=>{},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,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(s,i=[64,126]){let t=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=s.prefix.charCodeAt(0),t&&60>t||t>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 a=0;a<s.intermediates.length;
8++a){const f=s.intermediates.charCodeAt(a);if(32>f||f>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=f}}if(s.final.length!==1)throw new Error("final must be a single byte");const n=s.final.charCodeAt(0);if(i[0]>n||n>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return t<<=8,t|=n,t}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 t=this._identifier(s,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const n=this._escHandlers[t];return n.push(i),{dispose:()=>{const a=n.indexOf(i);a!==-1&&n.splice(a,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 t=this._identifier(s);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const n=this._csiHandlers[t];return n.push(i),{dispose:()=>{const a=n.indexOf(i);a!==-1&&n.splice(a,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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(s,i,t,n,a){this._parseStack.state=s,this._parseStack.handlers=i,this._parseStack.handlerPos=t,this._parseStack.transition=n,this._parseStack.chunkPos=a}parse(s,i,t){let n,a=0,f=0,S=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,S=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const l=this._parseStack.handlers;let p=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&p>-1){for(;p>=0&&(n=l[p](this._params),n!==!0);p--)if(n instanceof Promise)return this._parseStack.handlerPos=p,n}this._parseStack.handlers=[];break;case 4:if(t===!1&&p>-1){for(;p>=0&&(n=l[p](),n!==!0);p--)if(n instanceof Promise)return this._parseStack.handlerPos=p,n}this._parseStack.handlers=[];break;case 6:if(a=s[this._parseStack.chunkPos],n=this._dcsParser.unhook(a!==24&&a!==26,t),n)return n;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(a=s[this._parseStack.chunkPos],n=this._oscParser.end(a!==24&&a!==26,t),n)return n;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,S=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let l=S;l<i;++l){switch(a=s[l],f=this._transitions.table[this.currentState<<8|(a<160?a:u)],f>>4){case 2:for(let k=l+1;;++k){if(k>=i||(a=s[k])<32||a>126&&a<u){this._printHandler(s,l,k),l=k-1;break}if(++k>=i||(a=s[k])<32||a>126&&a<u){this._printHandler(s,l,k),l=k-1;break}if(++k>=i||(a=s[k])<32||a>126&&a<u){this._printHandler(s,l,k),l=k-1;break}if(++k>=i||(a=s[k])<32||a>126&&a<u){this._printHandler(s,l,k),l=k-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:a,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const p=this._csiHandlers[this._collect<<8|a];let w=p?p.length-1:-1;for(;w>=0&&(n=p[w](this._params),n!==!0);w--)if(n instanceof Promise)return this._preserveStack(3,p,w,f,l),n;w<0&&this._csiHandlerFb(this._collect<<8|a,this._params),this.precedingCodepoint=0;break;case 8:do switch(a){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;
8default:this._params.addDigit(a-48)}while(++l<i&&(a=s[l])>47&&a<60);l--;break;case 9:this._collect<<=8,this._collect|=a;break;case 10:const b=this._escHandlers[this._collect<<8|a];let y=b?b.length-1:-1;for(;y>=0&&(n=b[y](),n!==!0);y--)if(n instanceof Promise)return this._preserveStack(4,b,y,f,l),n;y<0&&this._escHandlerFb(this._collect<<8|a),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|a,this._params);break;case 13:for(let k=l+1;;++k)if(k>=i||(a=s[k])===24||a===26||a===27||a>127&&a<u){this._dcsParser.put(s,l,k),l=k-1;break}break;case 14:if(n=this._dcsParser.unhook(a!==24&&a!==26),n)return this._preserveStack(6,[],0,f,l),n;a===27&&(f|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let k=l+1;;k++)if(k>=i||(a=s[k])<32||a>127&&a<u){this._oscParser.put(s,l,k),l=k-1;break}break;case 6:if(n=this._oscParser.end(a!==24&&a!==26),n)return this._preserveStack(5,[],0,f,l),n;a===27&&(f|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&f}}}r.EscapeSequenceParser=h},6242:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const c=o(5770),v=o(482),d=[];r.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,g){this._handlers[_]===void 0&&(this._handlers[_]=[]);const u=this._handlers[_];return u.push(g),{dispose:()=>{const h=u.indexOf(g);h!==-1&&u.splice(h,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,g,u){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(_,g,u);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(_,g,u))}start(){this.reset(),this._state=1}put(_,g,u){if(this._state!==3){if(this._state===1)for(;g<u;){const h=_[g++];if(h===59){this._state=2,this._start();break}if(h<48||57<h)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+h-48}this._state===2&&u-g>0&&this._put(_,g,u)}}end(_,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let u=!1,h=this._active.length-1,e=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,u=g,e=this._stack.fallThrough,this._stack.paused=!1),!e&&u===!1){for(;h>=0&&(u=this._active[h].end(_),u!==!0);h--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,u;h--}for(;h>=0;h--)if(u=this._active[h].end(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,u}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,g,u){this._hitLimit||(this._data+=(0,v.utf32ToString)(_,g,u),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let g=!1;if(this._hitLimit)g=!1;else if(_&&(g=this._handler(this._data),g instanceof Promise))return g.then(u=>(this._data="",this._hitLimit=!1,u));return this._data="",this._hitLimit=!1,g}}},8742:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const o=2147483647;class c{constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(d){const _=new c;if(!d.length)return _;for(let g=Array.isArray(d[0])?1:0;g<d.length;++g){const u=d[g];if(Array.isArray(u))for(let h=0;h<u.length;++h)_.addSubParam(u[h]);else _.addParam(u)}return _}clone(){const d=new c(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const g=this._subParamsIdx[_]>>8,u=255&this._subParamsIdx[_];u-g>0&&d.push(Array.prototype.slice.call(this._subParams,g,u))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>o?o:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>o?o:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];return g-_>0?this._subParams.subarray(_,g):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const g=this._subParamsIdx[_]>>8,u=255&this._subParamsIdx[_];u-g>0&&(d[_]=this._subParams.slice(g,u))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,u=g[_-1];g[_-1]=~u?Math.min(10*u+d,o):d}}r.Params=c},5741:(O,r)=>
vendor: 4,869 bytes, line 8
8{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const v={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(v),c.dispose=()=>this._wrappedAddonDispose(v),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===o){c=v;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(c,1)}}},8771:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const c=o(3785),v=o(511);r.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,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(d){const _=this._buffer.lines.get(d);if(_)return new c.BufferLineApiView(_)}getNullCell(){return new v.CellData}}},3785:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const c=o(511);r.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,d){if(!(v<0||v>=this._line.length))return d?(this._line.loadCell(v,d),d):this._line.loadCell(v,new c.CellData)}translateToString(v,d,_){return this._line.translateToString(v,d,_)}}},8285:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const c=o(8771),v=o(8460);r.BufferNamespaceApi=class{constructor(d){this._core=d,this._onBufferChange=new v.EventEmitter,this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},7975:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,v=>c(v.toArray()))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,(v,d)=>c(v,d.toArray()))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(O,r,o){var c=this&&this.__decorate||function(e,s,i,t){var n,a=arguments.length,f=a<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,i,t);else for(var S=e.length-1;S>=0;S--)(n=e[S])&&(f=(a<3?n(f):a>3?n(s,i,f):n(s,i))||f);return a>3&&f&&Object.defineProperty(s,i,f),f},v=this&&this.__param||function(e,s){return function(i,t){s(i,t,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const d=o(2585),_=o(5295),g=o(8460),u=o(844);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let h=class extends u.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(e,this))}get buffer(){return this.buffers.active}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 t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===e.fg&&t.getBg(0)===e.bg||(t=i.getBlankLine(e,s),this._cachedBlankLine
8=t),t.isWrapped=s;const n=i.ybase+i.scrollTop,a=i.ybase+i.scrollBottom;if(i.scrollTop===0){const f=i.lines.isFull;a===i.lines.length-1?f?i.lines.recycle().copyFrom(t):i.lines.push(t.clone()):i.lines.splice(a+1,0,t.clone()),f?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const f=a-n+1;i.lines.shiftElements(n+1,f-1,-1),i.lines.set(a,t.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,s,i){const t=this.buffer;if(e<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else e+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const n=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+e,t.ybase),0),n!==t.ydisp&&(s||this._onScroll.fire(t.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const s=e-this.buffer.ydisp;s!==0&&this.scrollLines(s)}};h=c([v(0,d.IOptionsService)],h),r.BufferService=h},7994:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(O,r,o){var c=this&&this.__decorate||function(t,n,a,f){var S,l=arguments.length,p=l<3?n:f===null?f=Object.getOwnPropertyDescriptor(n,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,n,a,f);else for(var w=t.length-1;w>=0;w--)(S=t[w])&&(p=(l<3?S(p):l>3?S(n,a,p):S(n,a))||p);return l>3&&p&&Object.defineProperty(n,a,p),p},v=this&&this.__param||function(t,n){return function(a,f){n(a,f,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const d=o(2585),_=o(8460),g=o(844),u={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function h(t,n){let a=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(a|=64,a|=t.action):(a|=3&t.button,4&t.button&&(a|=64),8&t.button&&(a|=128),t.action===32?a|=32:t.action!==0||n||(a|=3)),a}const e=String.fromCharCode,s={DEFAULT:t=>{const n=[h(t,!1)+32,t.col+32,t.row+32];return n[0]>255||n[1]>255||n[2]>255?"":`\x1B[M${e(n[0])}${e(n[1])}${e(n[2])}`},SGR:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${h(t,!0)};${t.col};${t.row}${n}`},SGR_PIXELS:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${h(t,!0)};${t.x};${t.y}${n}`}};let i=class extends g.Disposable{constructor(t,n){super(),this._bufferService=t,this._coreService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const a of Object.keys(u))this.addProtocol(a,u[a]);for(const a of Object.keys(s))this.addEncoding(a,s[a]);this.reset()}addProtocol(t,n){this._protocols[t]=n}addEncoding(t,n){this._encodings[t]=n}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const n=this._encodings[this._activeEncoding](t);return n&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(n):this._coreService.triggerDataEvent(n,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,n,a){if(a){if(t.x!==n.x||t.y!==n.y)return!1}else if(t.col!==n.col||t.row!==n.row)return!1;return t.button===n.button&&t.action===n.action&&t.ctrl===n.ctrl&&t.alt===n.alt&&t.shift===n.shift}};i=c([v(0,d.IBufferService),v(1,d.ICoreService)],i),r.CoreMouseService=i},6975:function(O,r,o){var c=this&&this.__decorate||function(i,t,n,a){var f,S=arguments.length,l=S<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(i,t,n,a);else for(var p=i.length-1;p>=0;p--)(f=i[p])&&(l=(S<3?f(l):S>3?f(t,n,l):f(t,n))||l);return S>3&&l&&Object.defineProperty(t,n,l),l},v=this&&this.__param||function(i,t){return function(n,a){t(n,a,i)}};
8Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const d=o(2585),_=o(8460),g=o(1439),u=o(844),h=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=class extends u.Disposable{constructor(i,t,n){super(),this._bufferService=i,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,g.clone)(h),this.decPrivateModes=(0,g.clone)(e)}reset(){this.modes=(0,g.clone)(h),this.decPrivateModes=(0,g.clone)(e)}triggerDataEvent(i,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.f
8ire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(a=>a.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(i))}};s=c([v(0,d.IBufferService),v(1,d.ILogService),v(2,d.IOptionsService)],s),r.CoreService=s},9074:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const c=o(8055),v=o(8460),d=o(844),_=o(6106);let g=0,u=0;class h extends d.Disposable{constructor(){super(),this._decorations=new _.SortedList(i=>i==null?void 0:i.marker.line),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>{for(const i of this._decorations.values())this._onDecorationRemoved.fire(i);this.reset()}))}get decorations(){return this._decorations.values()}registerDecoration(i){if(i.marker.isDisposed)return;const t=new e(i);if(t){const n=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,t,n){var a,f,S;let l=0,p=0;for(const w of this._decorations.getKeyIterator(t))l=(a=w.options.x)!==null&&a!==void 0?a:0,p=l+((f=w.options.width)!==null&&f!==void 0?f:1),i>=l&&i<p&&(!n||((S=w.options.layer)!==null&&S!==void 0?S:"bottom")===n)&&(yield w)}forEachDecorationAtCell(i,t,n,a){this._decorations.forEachByKey(t,f=>{var S,l,p;g=(S=f.options.x)!==null&&S!==void 0?S:0,u=g+((l=f.options.width)!==null&&l!==void 0?l:1),i>=g&&i<u&&(!n||((p=f.options.layer)!==null&&p!==void 0?p:"bottom")===n)&&a(f)})}dispose(){for(const i of this._decorations.values())this._onDecorationRemoved.fire(i);this.reset()}}r.DecorationService=h;class e extends d.Disposable{constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.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")}get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const c=o(2585),v=o(8343);class d{constructor(...g){this._entries=new Map;for(const[u,h]of g)this.set(u,h)}set(g,u){const h=this._entries.get(g);return this._entries.set(g,u),h}forEach(g){for(const[u,h]of this._entries.entries())g(u,h)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}r.ServiceCollection=d,r.InstantiationService=class{constructor(){this._services=new d,this._services.set(c.IInstantiationService,this)}setService(_,g){this._services.set(_,g)}getService(_){return this._services.get(_)}createInstance(_,...g){const u=(0,v.getServiceDependencies)(_).sort((s,i)=>s.index-i.index),h=[];for(const s of u){const i=this._services.get(s.id);if(!i)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${s.id}.`);h.push(i)}const e=u.length>0?u[0].index:g.length;if(g.length!==e)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${e+1} conflicts with ${g.length} static arguments`);return new _(...g,...h)}}},7866:function(O,r,o){var c=this&&this.__decorate||function(h,e,s,i){var t,n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(h,e,s,i);else for(var f=h.length-1;f>=0;f--)(t=h[f])&&(a=(n<3?t(a):n>3?t(e,s,a):t(e,s))||a);return n>3&&a&&Object.defineProperty(e,s,a),a},v=this&&this.__param||function(h,e){return function(s,i){e(s,i,h)}};
8Object.defineProperty(r,"__esModule",{value:!0}),r.LogService=void 0;const d=o(844),_=o(2585),g={debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let u=class extends d.Disposable{constructor(h){super(),this._optionsService=h,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let e=0;e<h.length;e++)typeof h[e]=="function"&&(h[e]=h[e]())}_log(h,e,s){this._evalLazyOptionalParams(s),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+e,...s)}debug(h,...e){var s,i;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log((i=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.debug.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,h,e)}info(h,...e){var s,i;this._logLevel<=_.LogLevelEnum.INFO&&this._log((i=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.info.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.info,h,e)}warn(h,...e){var s,i;this._logLevel<=_.LogLevelEnum.WARN&&this._log((i=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.warn.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.warn,h,e)}error(h,...e){var s,i;this._logLevel<=_.LogLevelEnum.ERROR&&this._log((i=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.error.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.error,h,e)}};u=c([v(0,_.IOptionsService)],u),r.LogService=u},7302:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const c=o(8460),v=o(6114),d=o(844);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",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:{},rightClickSelectsWord:v.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends d.Disposable{constructor(h){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e=Object.assign({},r.DEFAULT_OPTIONS);for(const s in h)if(s in e)try{const i=h[s];e[s]=this._sanitizeAndValidateOption(s,i)}catch(i){console.error(i)}this.rawOptions=e,this.options=Object.assign({},e),this._setupOptions()}onSpecificOptionChange(h,e){return this.onOptionChange(s=>{s===h&&e(this.rawOptions[h])})}onMultipleOptionChange(h,e){return this.onOptionChange(s=>{h.indexOf(s)!==-1&&e()})}_setupOptions(){const h=s=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},e=(s,i)=>{if(!(s in r.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:h.bind(this,s),set:e.bind(this,s)};Object.defineProperty(this.options,s,i)}}_sanitizeAndValidateOption(h,e){switch(h){case"cursorStyle":if(e||(e=r.DEFAULT_OPTIONS[h]),!function(s){return s==="block"||s==="underline"||s==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${h}`);break;case"wordSeparator":e||(e=r.DEFAULT_OPTIONS[h]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=_.includes(e)?e:r.DEFAULT_OPTIONS[h];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${h} 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(`${h} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${h} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${h} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}r.OptionsService=g},2660:function(O,r,o){var c=this&&this.__decorate||function(g,u,h,e){var s,i=arguments.length,t=i<3?u:e===null?e=Object.getOwnPropertyDescriptor(u,h):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(g,u,h,e);else for(var n=g.length-1;n>=0;n--)(s=g[n])&&(t=(i<3?s(t):i>3?s(u,h,t):s(u,h))||t);return i>3&&t&&Object.defineProperty(u,h,t),t},v=this&&this.__param||function(g,u){return function(h,e){u(h,e,g)}};
8Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const d=o(2585);let _=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const u=this._bufferService.buffer;if(g.id===void 0){const n=u.addMarker(u.ybase+u.y),a={data:g,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(a,n)),this._dataByLinkId.set(a.id,a),a.id}const h=g,e=this._getEntryIdKey(h),s=this._entriesWithId.get(e);if(s)return this.addLineToLink(s.id,u.ybase+u.y),s.id;const i=u.addMarker(u.ybase+u.y),t={id:this._nextId++,key:this._getEntryIdKey(h),data:h,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(t,i)),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(g,u){const h=this._dataByLinkId.get(g);if(h&&h.lines.every(e=>e.line!==u)){const e=this._bufferService.buffer.addMarker(u);h.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(h,e))}}getLinkData(g){var u;return(u=this._dataByLinkId.get(g))===null||u===void 0?void 0:u.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,u){const h=g.lines.indexOf(u);h!==-1&&(g.lines.splice(h,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};_=c([v(0,d.IBufferService)],_),r.OscLinkService=_},8343:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",c="di$dependencies";function v(d,_,g){_[o]===_?_[c].push({id:d,index:g}):(_[c]=[{id:d,index:g}],_[o]=_)}r.serviceRegistry=new Map,r.getServiceDependencies=function(d){return d[c]||[]},r.createDecorator=function(d){if(r.serviceRegistry.has(d))return r.serviceRegistry.get(d);const _=function(g,u,h){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");v(_,g,h)};return _.toString=()=>d,r.serviceRegistry.set(d,_),_}},2585:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const c=o(8343);var v;r.IBufferService=(0,c.createDecorator)("BufferService"),r.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),r.ICoreService=(0,c.createDecorator)("CoreService"),r.ICharsetService=(0,c.createDecorator)("CharsetService"),r.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(v=r.LogLevelEnum||(r.LogLevelEnum={}))[v.DEBUG=0]="DEBUG",v[v.INFO=1]="INFO",v[v.WARN=2]="WARN",v[v.ERROR=3]="ERROR",v[v.OFF=4]="OFF",r.ILogService=(0,c.createDecorator)("LogService"),r.IOptionsService=(0,c.createDecorator)("OptionsService"),r.IOscLinkService=(0,c.createDecorator)("OscLinkService"),r.IUnicodeService=(0,c.createDecorator)("UnicodeService"),r.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const c=o(8460),v=o(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const d=new v.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let _=0;const g=d.length;for(let u=0;u<g;++u){let h=d.charCodeAt(u);if(55296<=h&&h<=56319){if(++u>=g)return _+this.wcwidth(h);const e=d.charCodeAt(u);56320<=e&&e<=57343?h=1024*(h-55296)+e-56320+65536:_+=this.wcwidth(e)}_+=this.wcwidth(h)}return _}}}},q={};function K(O){var r=q[O];if(r!==void 0)return r.exports;var o=q[O]={exports:{}};return G[O].call(o.exports,o,o.exports,K),o.exports}var X={};return(()=>{var O=X;
8Object.defineProperty(O,"__esModule",{value:!0}),O.Terminal=void 0;const r=K(3236),o=K(9042),c=K(7975),v=K(7090),d=K(5741),_=K(8285),g=["cols","rows"];O.Terminal=class{constructor(u){this._core=new r.Terminal(u),this._addonManager=new d.AddonManager,this._publicOptions=Object.assign({},this._core.options);const h=s=>this._core.options[s],e=(s,i)=>{this._checkReadonlyOptions(s),this._core.options[s]=i};for(const s in this._core.options){const i={get:h.bind(this,s),set:e.bind(this,s)};Object.defineProperty(this._publicOptions,s,i)}}_checkReadonlyOptions(u){if(g.includes(u))throw new Error(`Option "${u}" 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 c.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=new _.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const h in u)this._publicOptions[h]=u[h]}blur(){this._core.blur()}focus(){this._core.focus()}resize(u,h){this._verifyIntegers(u,h),this._core.resize(u,h)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.addMarker(u)}registerDecoration(u){var h,e,s;return this._checkProposedApi(),this._verifyPositiveIntegers((h=u.x)!==null&&h!==void 0?h:0,(e=u.width)!==null&&e!==void 0?e:0,(s=u.height)!==null&&s!==void 0?s:0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,h,e){this._verifyIntegers(u,h,e),this._core.select(u,h,e)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,h){this._verifyIntegers(u,h),this._core.selectLines(u,h)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,h){this._core.write(u,h)}writeln(u,h){this._core.write(u),this._core.write(`\r 9`,h)}paste(u){this._core.paste(u)}refresh(u,h){this._verifyIntegers(u,h),this._core.refresh(u,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){return this._addonManager.loadAddon(this,u)}static get strings(){return o}_verifyIntegers(...u){for(const h of u)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const h of u)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}})(),X})())})(Q);var te=Q.exports;const ne=se(te),ae=re({__proto__:null,default:ne},[te]);export{ae as x};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.