aicodeman 0.3.9 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/mux-interface.d.ts +4 -0
  2. package/dist/mux-interface.d.ts.map +1 -1
  3. package/dist/session.d.ts +5 -0
  4. package/dist/session.d.ts.map +1 -1
  5. package/dist/session.js +11 -11
  6. package/dist/session.js.map +1 -1
  7. package/dist/tmux-manager.d.ts.map +1 -1
  8. package/dist/tmux-manager.js +15 -3
  9. package/dist/tmux-manager.js.map +1 -1
  10. package/dist/types/session.d.ts +2 -0
  11. package/dist/types/session.d.ts.map +1 -1
  12. package/dist/web/public/api-client.eb389d1b.js.gz +0 -0
  13. package/dist/web/public/{app.94b71235.js → app.7924f22d.js} +10 -8
  14. package/dist/web/public/app.7924f22d.js.br +0 -0
  15. package/dist/web/public/app.7924f22d.js.gz +0 -0
  16. package/dist/web/public/{constants.5f627506.js → constants.7555acc0.js} +5 -65
  17. package/dist/web/public/constants.7555acc0.js.br +0 -0
  18. package/dist/web/public/constants.7555acc0.js.gz +0 -0
  19. package/dist/web/public/index.html +11 -4
  20. package/dist/web/public/index.html.br +0 -0
  21. package/dist/web/public/index.html.gz +0 -0
  22. package/dist/web/public/keyboard-accessory.30cd57bd.js.gz +0 -0
  23. package/dist/web/public/mobile-handlers.91ad48b8.js.gz +0 -0
  24. package/dist/web/public/mobile.42fde818.css +1 -0
  25. package/dist/web/public/mobile.42fde818.css.br +0 -0
  26. package/dist/web/public/mobile.42fde818.css.gz +0 -0
  27. package/dist/web/public/notification-manager.2e817554.js.gz +0 -0
  28. package/dist/web/public/ralph-wizard.44a8d04a.js.gz +0 -0
  29. package/dist/web/public/styles.a4b3aefc.css +1 -0
  30. package/dist/web/public/styles.a4b3aefc.css.br +0 -0
  31. package/dist/web/public/styles.a4b3aefc.css.gz +0 -0
  32. package/dist/web/public/subagent-windows.eb8470b0.js.gz +0 -0
  33. package/dist/web/public/sw.js.gz +0 -0
  34. package/dist/web/public/upload.html.gz +0 -0
  35. package/dist/web/public/vendor/xterm-addon-fit.min.js +1 -1
  36. package/dist/web/public/vendor/xterm-addon-fit.min.js.br +0 -0
  37. package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
  38. package/dist/web/public/vendor/xterm-addon-unicode11.min.js +25 -1
  39. package/dist/web/public/vendor/xterm-addon-unicode11.min.js.br +0 -0
  40. package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
  41. package/dist/web/public/vendor/xterm-addon-webgl.min.js +2 -2
  42. package/dist/web/public/vendor/xterm-addon-webgl.min.js.br +0 -0
  43. package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
  44. package/dist/web/public/vendor/xterm-zerolag-input.137ad9f0.js.gz +0 -0
  45. package/dist/web/public/vendor/xterm.css +81 -5
  46. package/dist/web/public/vendor/xterm.css.br +0 -0
  47. package/dist/web/public/vendor/xterm.css.gz +0 -0
  48. package/dist/web/public/vendor/xterm.min.js +32 -7
  49. package/dist/web/public/vendor/xterm.min.js.br +0 -0
  50. package/dist/web/public/vendor/xterm.min.js.gz +0 -0
  51. package/dist/web/public/voice-input.4c22ccd8.js.gz +0 -0
  52. package/dist/web/routes/session-routes.d.ts.map +1 -1
  53. package/dist/web/routes/session-routes.js +77 -0
  54. package/dist/web/routes/session-routes.js.map +1 -1
  55. package/dist/web/schemas.d.ts +18 -0
  56. package/dist/web/schemas.d.ts.map +1 -1
  57. package/dist/web/schemas.js +28 -0
  58. package/dist/web/schemas.js.map +1 -1
  59. package/dist/web/server.d.ts.map +1 -1
  60. package/dist/web/server.js +5 -12
  61. package/dist/web/server.js.map +1 -1
  62. package/package.json +5 -5
  63. package/scripts/postinstall.js +9 -9
  64. package/dist/web/public/app.94b71235.js.br +0 -0
  65. package/dist/web/public/app.94b71235.js.gz +0 -0
  66. package/dist/web/public/constants.5f627506.js.br +0 -0
  67. package/dist/web/public/constants.5f627506.js.gz +0 -0
  68. package/dist/web/public/mobile.fc25de7c.css +0 -1
  69. package/dist/web/public/mobile.fc25de7c.css.br +0 -0
  70. package/dist/web/public/mobile.fc25de7c.css.gz +0 -0
  71. package/dist/web/public/styles.df844b55.css +0 -1
  72. package/dist/web/public/styles.df844b55.css.br +0 -0
  73. package/dist/web/public/styles.df844b55.css.gz +0 -0
@@ -1,9 +1,34 @@
1
- (function(ae,Q){if(typeof exports=="object"&&typeof module=="object")module.exports=Q();else if(typeof define=="function"&&define.amd)define([],Q);else{var X=Q();for(var te in X)(typeof exports=="object"?exports:ae)[te]=X[te]}})(self,(()=>(()=>{"use strict";var ae={4567:function(I,r,a){var l=this&&this.__decorate||function(i,o,c,v){var m,h=arguments.length,g=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,o,c,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(g=(h<3?m(g):h>3?m(o,c,g):m(o,c))||g);return h>3&&g&&Object.defineProperty(o,c,g),g},u=this&&this.__param||function(i,o){return function(c,v){o(c,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),f=a(9924),p=a(844),_=a(5596),e=a(4725),s=a(3656);let t=r.AccessibilityManager=class extends p.Disposable{constructor(i,o){super(),this._terminal=i,this._renderService=o,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 c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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 f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((c=>this._handleResize(c.rows)))),this.register(this._terminal.onRender((c=>this._refreshRows(c.start,c.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((c=>this._handleChar(c)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
2
- `)))),this.register(this._terminal.onA11yTab((c=>this._handleTab(c)))),this.register(this._terminal.onKey((c=>this._handleKey(c.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new _.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,p.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(i){for(let o=0;o<i;o++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
3
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),d.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,d.isMac&&this._liveRegion.remove()}_handleKey(i){this._clearLiveRegion(),/\p{Control}/u.test(i)||this._charsToConsume.push(i)}_refreshRows(i,o){this._liveRegionDebouncer.refresh(i,o,this._terminal.rows)}_renderRows(i,o){const c=this._terminal.buffer,v=c.lines.length.toString();for(let m=i;m<=o;m++){const h=c.translateBufferLineToString(c.ydisp+m,!0),g=(c.ydisp+m+1).toString(),b=this._rowElements[m];b&&(h.length===0?b.innerText="\xA0":b.textContent=h,b.setAttribute("aria-posinset",g),b.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,o){const c=i.target,v=this._rowElements[o===0?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==v)return;let m,h;if(o===0?(m=c,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=c,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=t=l([u(1,e.IRenderService)],t)},3614:(I,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function l(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function u(d,f,p,_){d=l(d=a(d),p.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),p.triggerDataEvent(d,!0),f.value=""}function n(d,f,p){const _=p.getBoundingClientRect(),e=d.clientX-_.left-10,s=d.clientY-_.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=l,r.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,f,p,_){d.stopPropagation(),d.clipboardData&&u(d.clipboardData.getData("text/plain"),f,p,_)},r.paste=u,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,f,p,_,e){n(d,f,p),e&&_.rightClickSelect(d),f.value=_.selectionText,f.select()}},7239:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=a(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(u,n,d){this._css.set(u,n,d)}getCss(u,n){return this._css.get(u,n)}setColor(u,n,d){this._color.set(u,n,d)}getColor(u,n){return this._color.get(u,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,l,u,n){a.addEventListener(l,u,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,u,n))}}}},6465:function(I,r,a){var l=this&&this.__decorate||function(e,s,t,i){var o,c=arguments.length,v=c<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(v=(c<3?o(v):c>3?o(s,t,v):o(s,t))||v);return c>3&&v&&Object.defineProperty(s,t,v),v},u=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const n=a(3656),d=a(8460),f=a(844),p=a(2585);let _=r.Linkifier2=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const s=this._linkProviders.indexOf(e);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(e,s,t){this._element=e,this._mouseService=s,this._renderService=t,this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(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 t=e.composedPath();for(let i=0;i<t.length;i++){const o=t[i];if(o.classList.contains("xterm"))break;if(o.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 t,i;this._activeProviderReplies&&s||((t=this._activeProviderReplies)===null||t===void 0||t.forEach((c=>{c?.forEach((v=>{v.link.dispose&&v.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let o=!1;for(const[c,v]of this._linkProviders.entries())s?!((i=this._activeProviderReplies)===null||i===void 0)&&i.get(c)&&(o=this._checkLinkProviderResult(c,e,o)):v.provideLinks(e.y,(m=>{var h,g;if(this._isMouseOut)return;const b=m?.map((L=>({link:L})));(h=this._activeProviderReplies)===null||h===void 0||h.set(c,b),o=this._checkLinkProviderResult(c,e,o),((g=this._activeProviderReplies)===null||g===void 0?void 0:g.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,s){const t=new Set;for(let i=0;i<s.size;i++){const o=s.get(i);if(o)for(let c=0;c<o.length;c++){const v=o[c],m=v.link.range.start.y<e?0:v.link.range.start.x,h=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x;for(let g=m;g<=h;g++){if(t.has(g)){o.splice(c--,1);break}t.add(g)}}}}_checkLinkProviderResult(e,s,t){var i;if(!this._activeProviderReplies)return t;const o=this._activeProviderReplies.get(e);let c=!1;for(let v=0;v<e;v++)this._activeProviderReplies.has(v)&&!this._activeProviderReplies.get(v)||(c=!0);if(!c&&o){const v=o.find((m=>this._linkAtPosition(m.link,s)));v&&(t=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let v=0;v<this._activeProviderReplies.size;v++){const m=(i=this._activeProviderReplies.get(v))===null||i===void 0?void 0:i.find((h=>this._linkAtPosition(h.link,s)));if(m){t=!0,this._handleNewLink(m);break}}return t}_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,f.disposeArray)(this._linkCacheDisposables))}_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 t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.pointerCursor},set:t=>{var i,o;!((i=this._currentLink)===null||i===void 0)&&i.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((o=this._element)===null||o===void 0||o.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.underline},set:t=>{var i,o,c;!((i=this._currentLink)===null||i===void 0)&&i.state&&((c=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||c===void 0?void 0:c.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const i=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(i,o),this._lastMouseEvent&&this._element)){const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}}))))}_linkHover(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.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(t,s.text)}_fireUnderlineEvent(e,s){const t=e.range,i=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-i-1,t.end.x,t.end.y-i-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.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(t,s.text)}_linkAtPosition(e,s){const t=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,o=s.y*this._bufferService.cols+s.x;return t<=o&&o<=i}_positionFromMouseEvent(e,s,t){const i=t.getCoords(e,s,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,s,t,i,o){return{x1:e,y1:s,x2:t,y2:i,cols:this._bufferService.cols,fg:o}}};r.Linkifier2=_=l([u(0,p.IBufferService)],_)},9042:(I,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(I,r,a){var l=this&&this.__decorate||function(_,e,s,t){var i,o=arguments.length,c=o<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(_,e,s,t);else for(var v=_.length-1;v>=0;v--)(i=_[v])&&(c=(o<3?i(c):o>3?i(e,s,c):i(e,s))||c);return o>3&&c&&Object.defineProperty(e,s,c),c},u=this&&this.__param||function(_,e){return function(s,t){e(s,t,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=a(511),d=a(2585);let f=r.OscLinkProvider=class{constructor(_,e,s){this._bufferService=_,this._optionsService=e,this._oscLinkService=s}provideLinks(_,e){var s;const t=this._bufferService.buffer.lines.get(_-1);if(!t)return void e(void 0);const i=[],o=this._optionsService.rawOptions.linkHandler,c=new n.CellData,v=t.getTrimmedLength();let m=-1,h=-1,g=!1;for(let b=0;b<v;b++)if(h!==-1||t.hasContent(b)){if(t.loadCell(b,c),c.hasExtendedAttrs()&&c.extended.urlId){if(h===-1){h=b,m=c.extended.urlId;continue}g=c.extended.urlId!==m}else h!==-1&&(g=!0);if(g||h!==-1&&b===v-1){const L=(s=this._oscLinkService.getLinkData(m))===null||s===void 0?void 0:s.uri;if(L){const y={start:{x:h+1,y:_},end:{x:b+(g||b!==v-1?0:1),y:_}};let k=!1;if(!o?.allowNonHttpProtocols)try{const x=new URL(L);["http:","https:"].includes(x.protocol)||(k=!0)}catch{k=!0}k||i.push({text:L,range:y,activate:(x,T)=>o?o.activate(x,T,y):p(0,T),hover:(x,T)=>{var O;return(O=o?.hover)===null||O===void 0?void 0:O.call(o,x,T,y)},leave:(x,T)=>{var O;return(O=o?.leave)===null||O===void 0?void 0:O.call(o,x,T,y)}})}g=!1,c.hasExtendedAttrs()&&c.extended.urlId?(h=b,m=c.extended.urlId):(h=-1,m=-1)}}e(i)}};function p(_,e){if(confirm(`Do you want to navigate to ${e}?
1
+ (function(ke,Ee){if(typeof exports=="object"&&typeof module=="object")module.exports=Ee();else if(typeof define=="function"&&define.amd)define([],Ee);else{var ce=Ee();for(var Le in ce)(typeof exports=="object"?exports:ke)[Le]=ce[Le]}})(globalThis,(()=>(()=>{"use strict";var ke={2840:function(W,t,_){var i=this&&this.__decorate||function(s,e,r,a){var d,u=arguments.length,l=u<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,e,r,a);else for(var m=s.length-1;m>=0;m--)(d=s[m])&&(l=(u<3?d(l):u>3?d(e,r,l):d(e,r))||l);return u>3&&l&&Object.defineProperty(e,r,l),l},v=this&&this.__param||function(s,e){return function(r,a){e(r,a,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const o=_(7721),p=_(4292),f=_(7150),g=_(7098),c=_(6501),n=_(7093);let h=class extends f.Disposable{constructor(s,e,r,a){super(),this._terminal=s,this._coreBrowserService=r,this._renderService=a,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";const d=this._coreBrowserService.mainDocument;this._accessibilityContainer=d.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=d.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=d.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize((u=>this._handleResize(u.rows)))),this._register(this._terminal.onRender((u=>this._refreshRows(u.start,u.end)))),this._register(this._terminal.onScroll((()=>this._refreshRows()))),this._register(this._terminal.onA11yChar((u=>this._handleChar(u)))),this._register(this._terminal.onLineFeed((()=>this._handleChar(`
2
+ `)))),this._register(this._terminal.onA11yTab((u=>this._handleTab(u)))),this._register(this._terminal.onKey((u=>this._handleKey(u.key)))),this._register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this._register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._register((0,n.addDisposableListener)(d,"selectionchange",(()=>this._handleSelectionChange()))),this._register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRowsDimensions(),this._refreshRows(),this._register((0,f.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(s){for(let e=0;e<s;e++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
3
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),/\p{Control}/u.test(s)||this._charsToConsume.push(s)}_refreshRows(s,e){this._liveRegionDebouncer.refresh(s,e,this._terminal.rows)}_renderRows(s,e){const r=this._terminal.buffer,a=r.lines.length.toString();for(let d=s;d<=e;d++){const u=r.lines.get(r.ydisp+d),l=[],m=u?.translateToString(!0,void 0,void 0,l)||"",C=(r.ydisp+d+1).toString(),y=this._rowElements[d];y&&(m.length===0?(y.textContent="\xA0",this._rowColumns.set(y,[0,1])):(y.textContent=m,this._rowColumns.set(y,l)),y.setAttribute("aria-posinset",C),y.setAttribute("aria-setsize",a),this._alignRowWidth(y))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,e){const r=s.target,a=this._rowElements[e===0?1:this._rowElements.length-2];if(r.getAttribute("aria-posinset")===(e===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==a)return;let d,u;if(e===0?(d=r,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(d=this._rowElements.shift(),u=r,this._rowContainer.removeChild(d)),d.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const s=this._coreBrowserService.mainDocument.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let e={node:s.anchorNode,offset:s.anchorOffset},r={node:s.focusNode,offset:s.focusOffset};if((e.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===r.node&&e.offset>r.offset)&&([e,r]=[r,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;const a=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(a)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:a,offset:a.textContent?.length??0}),!this._rowContainer.contains(r.node))return;const d=({node:m,offset:C})=>{const y=m instanceof Text?m.parentNode:m;let b=parseInt(y?.getAttribute("aria-posinset"),10)-1;if(isNaN(b))return console.warn("row is invalid. Race condition?"),null;const D=this._rowColumns.get(y);if(!D)return console.warn("columns is null. Race condition?"),null;let T=C<D.length?D[C]:D.slice(-1)[0]+1;return T>=this._terminal.cols&&(++b,T=0),{row:b,column:T}},u=d(e),l=d(r);if(u&&l){if(u.row>l.row||u.row===l.row&&u.column>=l.column)throw new Error("invalid range");this._terminal.select(u.column,u.row,(l.row-u.row)*this._terminal.cols-u.column+l.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s]),this._alignRowWidth(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(s){s.style.transform="";const e=s.getBoundingClientRect().width,r=this._rowColumns.get(s)?.slice(-1)?.[0];if(!r)return;const a=r*this._renderService.dimensions.css.cell.width;s.style.transform=`scaleX(${a/e})`}};t.AccessibilityManager=h,t.AccessibilityManager=h=i([v(1,c.IInstantiationService),v(2,g.ICoreBrowserService),v(3,g.IRenderService)],h)},7861:(W,t)=>{function _(p){return p.replace(/\r?\n/g,"\r")}function i(p,f){return f?"\x1B[200~"+p+"\x1B[201~":p}function v(p,f,g,c){p=i(p=_(p),g.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(p,!0),f.value=""}function o(p,f,g){const c=g.getBoundingClientRect(),n=p.clientX-c.left-10,h=p.clientY-c.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${n}px`,f.style.top=`${h}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTextForTerminal=_,t.bracketTextForPaste=i,t.copyHandler=function(p,f){p.clipboardData&&p.clipboardData.setData("text/plain",f.selectionText),p.preventDefault()},t.handlePasteEvent=function(p,f,g,c){p.stopPropagation(),p.clipboardData&&v(p.clipboardData.getData("text/plain"),f,g,c)},t.paste=v,t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(p,f,g,c,n){o(p,f,g),n&&c.rightClickSelect(p),f.value=c.selectionText,f.select()}},7174:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const i=_(7710);t.ColorContrastCache=class{constructor(){this._color=new i.TwoKeyMap,this._css=new i.TwoKeyMap}setCss(v,o,p){this._css.set(v,o,p)}getCss(v,o){return this._css.get(v,o)}setColor(v,o,p){this._color.set(v,o,p)}getColor(v,o){return this._color.get(v,o)}clear(){this._color.clear(),this._css.clear()}}},1718:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserTerminal=void 0;const i=_(7861),v=_(7721),o=_(3285),p=_(4017),f=_(4196),g=_(9925),c=_(3618),n=_(3955),h=_(4792),s=_(945),e=_(9574),r=_(9820),a=_(9784),d=_(5783),u=_(2079),l=_(7098),m=_(9078),C=_(4103),y=_(5777),b=_(701),D=_(6107),T=_(3534),P=_(706),M=_(8693),B=_(4720),F=_(6501),S=_(2486),E=_(2840),w=_(8906),L=_(802),O=_(7093),N=_(7150);class H extends y.CoreTerminal{get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(x={}){super(x),this._linkifier=this._register(new N.MutableDisposable),this.browser=b,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new N.MutableDisposable),this._onCursorMove=this._register(new L.Emitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new L.Emitter),this.onKey=this._onKey.event,this._onRender=this._register(new L.Emitter),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new L.Emitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new L.Emitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new L.Emitter),this.onBell=this._onBell.event,this._onFocus=this._register(new L.Emitter),this._onBlur=this._register(new L.Emitter),this._onA11yCharEmitter=this._register(new L.Emitter),this._onA11yTabEmitter=this._register(new L.Emitter),this._onWillOpen=this._register(new L.Emitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(r.LinkProviderService),this._instantiationService.setService(l.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(o.OscLinkProvider)),this._register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this._register(this._inputHandler.onRequestRefreshRows((k=>this.refresh(k?.start??0,k?.end??this.rows-1)))),this._register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this._register(this._inputHandler.onRequestReset((()=>this.reset()))),this._register(this._inputHandler.onRequestWindowsOptionsReport((k=>this._reportWindowsOptions(k)))),this._register(this._inputHandler.onColor((k=>this._handleColorEvent(k)))),this._register(L.Event.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(L.Event.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(L.Event.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(L.Event.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize((k=>this._afterResize(k.cols,k.rows)))),this._register((0,N.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(x){if(this._themeService)for(const k of x){let V,z="";switch(k.index){case 256:V="foreground",z="10";break;case 257:V="background",z="11";break;case 258:V="cursor",z="12";break;default:V="ansi",z="4;"+k.index}switch(k.type){case 0:const G=C.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[k.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${T.C0.ESC}]${z};${(0,M.toRgbString)(G)}${T.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors((q=>q.ansi[k.index]=C.channels.toColor(...k.color)));else{const q=V;this._themeService.modifyColors((J=>J[q]=C.channels.toColor(...k.color)))}break;case 2:this._themeService.restoreColor(k.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(x){x?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(E.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(x){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const x=this.buffer.ybase+this.buffer.y,k=this.buffer.lines.get(x);if(!k)return;const V=Math.min(this.buffer.x,this.cols-1),z=this._renderService.dimensions.css.cell.height,G=k.getWidth(V),q=this._renderService.dimensions.css.cell.width*G,J=this.buffer.y*this._renderService.dimensions.css.cell.height,se=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=J+"px",this.textarea.style.width=q+"px",this.textarea.style.height=z+"px",this.textarea.style.lineHeight=z+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register((0,O.addDisposableListener)(this.element,"copy",(k=>{this.hasSelection()&&(0,i.copyHandler)(k,this._selectionService)})));const x=k=>(0,i.handlePasteEvent)(k,this.textarea,this.coreService,this.optionsService);this._register((0,O.addDisposableListener)(this.textarea,"paste",x)),this._register((0,O.addDisposableListener)(this.element,"paste",x)),b.isFirefox?this._register((0,O.addDisposableListener)(this.element,"mousedown",(k=>{k.button===2&&(0,i.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this._register((0,O.addDisposableListener)(this.element,"contextmenu",(k=>{(0,i.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),b.isLinux&&this._register((0,O.addDisposableListener)(this.element,"auxclick",(k=>{k.button===1&&(0,i.moveTextAreaUnderMouseCursor)(k,this.textarea,this.screenElement)})))}_bindKeys(){this._register((0,O.addDisposableListener)(this.textarea,"keyup",(x=>this._keyUp(x)),!0)),this._register((0,O.addDisposableListener)(this.textarea,"keydown",(x=>this._keyDown(x)),!0)),this._register((0,O.addDisposableListener)(this.textarea,"keypress",(x=>this._keyPress(x)),!0)),this._register((0,O.addDisposableListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this._register((0,O.addDisposableListener)(this.textarea,"compositionupdate",(x=>this._compositionHelper.compositionupdate(x)))),this._register((0,O.addDisposableListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this._register((0,O.addDisposableListener)(this.textarea,"input",(x=>this._inputEvent(x)),!0)),this._register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(x){if(!x)throw new Error("Terminal requires a parent element.");if(x.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=x.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),x.appendChild(this.element);const k=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),k.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register((0,O.addDisposableListener)(this.screenElement,"mousemove",(G=>this.updateCursorStyle(G)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),k.appendChild(this.screenElement);const V=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel.get()),b.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._register(this.optionsService.onSpecificOptionChange("disableStdin",(()=>V.readOnly=this.optionsService.rawOptions.disableStdin))),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(e.CoreBrowserService,this.textarea,x.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(l.ICoreBrowserService,this._coreBrowserService),this._register((0,O.addDisposableListener)(this.textarea,"focus",(G=>this._handleTextAreaFocus(G)))),this._register((0,O.addDisposableListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(l.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(m.ThemeService),this._instantiationService.setService(l.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(s.CharacterJoinerService),this._instantiationService.setService(l.ICharacterJoinerService,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(d.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(l.IRenderService,this._renderService),this._register(this._renderService.onRenderedViewportChange((G=>this._onRender.fire(G)))),this.onResize((G=>this._renderService.resize(G.cols,G.rows))),this._compositionView=this._document.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._mouseService=this._instantiationService.createInstance(a.MouseService),this._instantiationService.setService(l.IMouseService,this._mouseService);const z=this._linkifier.value=this._register(this._instantiationService.createInstance(w.Linkifier,this.screenElement));this.element.appendChild(k);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(p.Viewport,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines((G=>{super.scrollLines(G,!1),this.refresh(0,this.rows-1)}))),this._selectionService=this._register(this._instantiationService.createInstance(u.SelectionService,this.element,this.screenElement,z)),this._instantiationService.setService(l.ISelectionService,this._selectionService),this._register(this._selectionService.onRequestScrollLines((G=>this.scrollLines(G.amount,G.suppressScrollEvent)))),this._register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this._register(this._selectionService.onRequestRedraw((G=>this._renderService.handleSelectionChanged(G.start,G.end,G.columnSelectMode)))),this._register(this._selectionService.onLinuxMouseSelection((G=>{this.textarea.value=G,this.textarea.focus(),this.textarea.select()}))),this._register(L.Event.any(this._onScroll.event,this._inputHandler.onScroll)((()=>{this._selectionService.refresh(),this._viewport?.queueSync()}))),this._register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this._register((0,O.addDisposableListener)(this.element,"mousedown",(G=>this._selectionService.handleMouseDown(G)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(E.AccessibilityManager,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",(G=>this._handleScreenReaderModeOptionChange(G)))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",(G=>{!this._overviewRulerRenderer&&G&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(n.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const x=this,k=this.element;function V(q){const J=x._mouseService.getMouseReportCoords(q,x.screenElement);if(!J)return!1;let se,ie;switch(q.overrideType||q.type){case"mousemove":ie=32,q.buttons===void 0?(se=3,q.button!==void 0&&(se=q.button<3?q.button:3)):se=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":ie=0,se=q.button<3?q.button:3;break;case"mousedown":ie=1,se=q.button<3?q.button:3;break;case"wheel":if(x._customWheelEventHandler&&x._customWheelEventHandler(q)===!1)return!1;const re=q.deltaY;if(re===0||x.coreMouseService.consumeWheelEvent(q,x._renderService?.dimensions?.device?.cell?.height,x._coreBrowserService?.dpr)===0)return!1;ie=re<0?0:1,se=4;break;default:return!1}return!(ie===void 0||se===void 0||se>4)&&x.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:se,action:ie,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},G={mouseup:q=>(V(q),q.buttons||(this._document.removeEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.removeEventListener("mousemove",z.mousedrag)),this.cancel(q)),wheel:q=>(V(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&V(q)},mousemove:q=>{q.buttons||V(q)}};this._register(this.coreMouseService.onProtocolChange((q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),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&q?z.mousemove||(k.addEventListener("mousemove",G.mousemove),z.mousemove=G.mousemove):(k.removeEventListener("mousemove",z.mousemove),z.mousemove=null),16&q?z.wheel||(k.addEventListener("wheel",G.wheel,{passive:!1}),z.wheel=G.wheel):(k.removeEventListener("wheel",z.wheel),z.wheel=null),2&q?z.mouseup||(z.mouseup=G.mouseup):(this._document.removeEventListener("mouseup",z.mouseup),z.mouseup=null),4&q?z.mousedrag||(z.mousedrag=G.mousedrag):(this._document.removeEventListener("mousemove",z.mousedrag),z.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register((0,O.addDisposableListener)(k,"mousedown",(q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return V(q),z.mouseup&&this._document.addEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.addEventListener("mousemove",z.mousedrag),this.cancel(q)}))),this._register((0,O.addDisposableListener)(k,"wheel",(q=>{if(!z.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){if(q.deltaY===0)return!1;if(x.coreMouseService.consumeWheelEvent(q,x._renderService?.dimensions?.device?.cell?.height,x._coreBrowserService?.dpr)===0)return this.cancel(q,!0);const J=T.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(J,!0),this.cancel(q,!0)}}}),{passive:!1}))}refresh(x,k){this._renderService?.refreshRows(x,k)}updateCursorStyle(x){this._selectionService?.shouldColumnSelect(x)?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(x,k){this._viewport?this._viewport.scrollLines(x):super.scrollLines(x,k),this.refresh(0,this.rows-1)}scrollPages(x){this.scrollLines(x*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(x){x&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(x){const k=x-this._bufferService.buffer.ydisp;k!==0&&this.scrollLines(k)}paste(x){(0,i.paste)(x,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(x){this._customKeyEventHandler=x}attachCustomWheelEventHandler(x){this._customWheelEventHandler=x}registerLinkProvider(x){return this._linkProviderService.registerLinkProvider(x)}registerCharacterJoiner(x){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const k=this._characterJoinerService.register(x);return this.refresh(0,this.rows-1),k}deregisterCharacterJoiner(x){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(x)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(x){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+x)}registerDecoration(x){return this._decorationService.registerDecoration(x)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(x,k,V){this._selectionService.setSelection(x,k,V)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(x,k){this._selectionService?.selectLines(x,k)}_keyDown(x){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(x)===!1)return!1;const k=this.browser.isMac&&this.options.macOptionIsMeta&&x.altKey;if(!k&&!this._compositionHelper.keydown(x))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;k||x.key!=="Dead"&&x.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,P.evaluateKeyboardEvent)(x,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(x),V.type===3||V.type===2){const z=this.rows-1;return this.scrollLines(V.type===2?-z:z),this.cancel(x,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,x)||(V.cancel&&this.cancel(x,!0),!V.key||!!(x.key&&!x.ctrlKey&&!x.altKey&&!x.metaKey&&x.key.length===1&&x.key.charCodeAt(0)>=65&&x.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(V.key!==T.C0.ETX&&V.key!==T.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:x}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||x.altKey||x.ctrlKey?this.cancel(x,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(x,k){const V=x.isMac&&!this.options.macOptionIsMeta&&k.altKey&&!k.ctrlKey&&!k.metaKey||x.isWindows&&k.altKey&&k.ctrlKey&&!k.metaKey||x.isWindows&&k.getModifierState("AltGraph");return k.type==="keypress"?V:V&&(!k.keyCode||k.keyCode>47)}_keyUp(x){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(x)===!1||((function(k){return k.keyCode===16||k.keyCode===17||k.keyCode===18})(x)||this.focus(),this.updateCursorStyle(x),this._keyPressHandled=!1)}_keyPress(x){let k;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(x)===!1)return!1;if(this.cancel(x),x.charCode)k=x.charCode;else if(x.which===null||x.which===void 0)k=x.keyCode;else{if(x.which===0||x.charCode===0)return!1;k=x.which}return!(!k||(x.altKey||x.ctrlKey||x.metaKey)&&!this._isThirdLevelShift(this.browser,x)||(k=String.fromCharCode(k),this._onKey.fire({key:k,domEvent:x}),this._showCursor(),this.coreService.triggerDataEvent(k,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(x){if(x.data&&x.inputType==="insertText"&&(!x.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const k=x.data;return this.coreService.triggerDataEvent(k,!0),this.cancel(x),!0}return!1}resize(x,k){x!==this.cols||k!==this.rows?super.resize(x,k):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(x,k){this._charSizeService?.measure()}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 x=1;x<this.rows;x++)this.buffer.lines.push(this.buffer.getBlankLine(D.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const x=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=x,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(T.C0.ESC+"[I"):this.coreService.triggerDataEvent(T.C0.ESC+"[O")}_reportWindowsOptions(x){if(this._renderService)switch(x){case S.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const k=this._renderService.dimensions.css.canvas.width.toFixed(0),V=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[4;${V};${k}t`);break;case S.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const z=this._renderService.dimensions.css.cell.width.toFixed(0),G=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[6;${G};${z}t`)}}cancel(x,k){if(this.options.cancelEvents||k)return x.preventDefault(),x.stopPropagation(),!1}}t.CoreBrowserTerminal=H},8906:function(W,t,_){var i=this&&this.__decorate||function(h,s,e,r){var a,d=arguments.length,u=d<3?s:r===null?r=Object.getOwnPropertyDescriptor(s,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(h,s,e,r);else for(var l=h.length-1;l>=0;l--)(a=h[l])&&(u=(d<3?a(u):d>3?a(s,e,u):a(s,e))||u);return d>3&&u&&Object.defineProperty(s,e,u),u},v=this&&this.__param||function(h,s){return function(e,r){s(e,r,h)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const o=_(7150),p=_(6501),f=_(7098),g=_(802),c=_(7093);let n=class extends o.Disposable{get currentLink(){return this._currentLink}constructor(h,s,e,r,a){super(),this._element=h,this._mouseService=s,this._renderService=e,this._bufferService=r,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new g.Emitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new g.Emitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register((0,o.toDisposable)((()=>{(0,o.dispose)(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this._register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this._register((0,c.addDisposableListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this._register((0,c.addDisposableListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register((0,c.addDisposableListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register((0,c.addDisposableListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const s=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const e=h.composedPath();for(let r=0;r<e.length;r++){const a=e[r];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,s){this._activeProviderReplies&&s||(this._activeProviderReplies?.forEach((r=>{r?.forEach((a=>{a.link.dispose&&a.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let e=!1;for(const[r,a]of this._linkProviderService.linkProviders.entries())s?this._activeProviderReplies?.get(r)&&(e=this._checkLinkProviderResult(r,h,e)):a.provideLinks(h.y,(d=>{if(this._isMouseOut)return;const u=d?.map((l=>({link:l})));this._activeProviderReplies?.set(r,u),e=this._checkLinkProviderResult(r,h,e),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,s){const e=new Set;for(let r=0;r<s.size;r++){const a=s.get(r);if(a)for(let d=0;d<a.length;d++){const u=a[d],l=u.link.range.start.y<h?0:u.link.range.start.x,m=u.link.range.end.y>h?this._bufferService.cols:u.link.range.end.x;for(let C=l;C<=m;C++){if(e.has(C)){a.splice(d--,1);break}e.add(C)}}}}_checkLinkProviderResult(h,s,e){if(!this._activeProviderReplies)return e;const r=this._activeProviderReplies.get(h);let a=!1;for(let d=0;d<h;d++)this._activeProviderReplies.has(d)&&!this._activeProviderReplies.get(d)||(a=!0);if(!a&&r){const d=r.find((u=>this._linkAtPosition(u.link,s)));d&&(e=!0,this._handleNewLink(d))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!e)for(let d=0;d<this._activeProviderReplies.size;d++){const u=this._activeProviderReplies.get(d)?.find((l=>this._linkAtPosition(l.link,s)));if(u){e=!0,this._handleNewLink(u);break}}return e}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const s=this._positionFromMouseEvent(h,this._element,this._mouseService);var e,r;s&&this._mouseDownLink&&(e=this._mouseDownLink.link,r=this._currentLink.link,e.text===r.text&&e.range.start.x===r.range.start.x&&e.range.start.y===r.range.start.y&&e.range.end.x===r.range.end.x&&e.range.end.y===r.range.end.y)&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,s){this._currentLink&&this._lastMouseEvent&&(!h||!s||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,o.dispose)(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(h){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(h.link,s)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:e=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==e&&(this._currentLink.state.decorations.underline=e,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,e))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;const r=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(r,a),this._lastMouseEvent)){const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._askForLink(d,!1)}}))))}_linkHover(h,s,e){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(e,s.text)}_fireUnderlineEvent(h,s){const e=h.range,r=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(e.start.x-1,e.start.y-r-1,e.end.x,e.end.y-r-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(h,s,e){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(e,s.text)}_linkAtPosition(h,s){const e=h.range.start.y*this._bufferService.cols+h.range.start.x,r=h.range.end.y*this._bufferService.cols+h.range.end.x,a=s.y*this._bufferService.cols+s.x;return e<=a&&a<=r}_positionFromMouseEvent(h,s,e){const r=e.getCoords(h,s,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,s,e,r,a){return{x1:h,y1:s,x2:e,y2:r,cols:this._bufferService.cols,fg:a}}};t.Linkifier=n,t.Linkifier=n=i([v(1,f.IMouseService),v(2,f.IRenderService),v(3,p.IBufferService),v(4,f.ILinkProviderService)],n)},7721:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0;let _="Terminal input";const i={get:()=>_,set:p=>_=p};t.promptLabel=i;let v="Too much output to announce, navigate to rows manually to read";const o={get:()=>v,set:p=>v=p};t.tooMuchOutput=o},3285:function(W,t,_){var i=this&&this.__decorate||function(c,n,h,s){var e,r=arguments.length,a=r<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,h):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(c,n,h,s);else for(var d=c.length-1;d>=0;d--)(e=c[d])&&(a=(r<3?e(a):r>3?e(n,h,a):e(n,h))||a);return r>3&&a&&Object.defineProperty(n,h,a),a},v=this&&this.__param||function(c,n){return function(h,s){n(h,s,c)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const o=_(3055),p=_(6501);let f=class{constructor(c,n,h){this._bufferService=c,this._optionsService=n,this._oscLinkService=h}provideLinks(c,n){const h=this._bufferService.buffer.lines.get(c-1);if(!h)return void n(void 0);const s=[],e=this._optionsService.rawOptions.linkHandler,r=new o.CellData,a=h.getTrimmedLength();let d=-1,u=-1,l=!1;for(let m=0;m<a;m++)if(u!==-1||h.hasContent(m)){if(h.loadCell(m,r),r.hasExtendedAttrs()&&r.extended.urlId){if(u===-1){u=m,d=r.extended.urlId;continue}l=r.extended.urlId!==d}else u!==-1&&(l=!0);if(l||u!==-1&&m===a-1){const C=this._oscLinkService.getLinkData(d)?.uri;if(C){const y={start:{x:u+1,y:c},end:{x:m+(l||m!==a-1?0:1),y:c}};let b=!1;if(!e?.allowNonHttpProtocols)try{const D=new URL(C);["http:","https:"].includes(D.protocol)||(b=!0)}catch{b=!0}b||s.push({text:C,range:y,activate:(D,T)=>e?e.activate(D,T,y):g(0,T),hover:(D,T)=>e?.hover?.(D,T,y),leave:(D,T)=>e?.leave?.(D,T,y)})}l=!1,r.hasExtendedAttrs()&&r.extended.urlId?(u=m,d=r.extended.urlId):(u=-1,d=-1)}}n(s)}};function g(c,n){if(confirm(`Do you want to navigate to ${n}?
4
4
 
5
- WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=f=l([u(0,d.IBufferService),u(1,d.IOptionsService),u(2,d.IOscLinkService)],f)},6193:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(a,l){this._parentWindow=a,this._renderCallback=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,l,u){this._rowCount=u,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,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 a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const l=a(844);class u extends l.Disposable{constructor(d){super(),this._parentWindow=d,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,l.toDisposable)((()=>{this.clearListener()})))}setListener(d){this._listener&&this.clearListener(),this._listener=d,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var d;this._outerListener&&((d=this._resolutionMediaMatchList)===null||d===void 0||d.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=u},3236:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const l=a(3614),u=a(3656),n=a(6465),d=a(9042),f=a(3730),p=a(1680),_=a(3107),e=a(5744),s=a(2950),t=a(1296),i=a(428),o=a(4269),c=a(5114),v=a(8934),m=a(3230),h=a(9312),g=a(4725),b=a(6731),L=a(8055),y=a(8969),k=a(8460),x=a(844),T=a(6114),O=a(8437),M=a(2584),C=a(7399),w=a(5941),E=a(9074),D=a(2585),P=a(5435),H=a(4567),U=typeof window<"u"?window.document:null;class W extends y.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(S={}){super(S),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new x.MutableDisposable),this._onCursorMove=this.register(new k.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new k.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new k.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new k.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new k.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new k.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new k.EventEmitter),this._onBlur=this.register(new k.EventEmitter),this._onA11yCharEmitter=this.register(new k.EventEmitter),this._onA11yTabEmitter=this.register(new k.EventEmitter),this._onWillOpen=this.register(new k.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(n.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((R,B)=>this.refresh(R,B)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((R=>this._reportWindowsOptions(R)))),this.register(this._inputHandler.onColor((R=>this._handleColorEvent(R)))),this.register((0,k.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,k.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,k.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,k.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((R=>this._afterResize(R.cols,R.rows)))),this.register((0,x.toDisposable)((()=>{var R,B;this._customKeyEventHandler=void 0,(B=(R=this.element)===null||R===void 0?void 0:R.parentNode)===null||B===void 0||B.removeChild(this.element)})))}_handleColorEvent(S){if(this._themeService)for(const R of S){let B,A="";switch(R.index){case 256:B="foreground",A="10";break;case 257:B="background",A="11";break;case 258:B="cursor",A="12";break;default:B="ansi",A="4;"+R.index}switch(R.type){case 0:const N=L.color.toColorRGB(B==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[B]);this.coreService.triggerDataEvent(`${M.C0.ESC}]${A};${(0,w.toRgbString)(N)}${M.C1_ESCAPED.ST}`);break;case 1:if(B==="ansi")this._themeService.modifyColors((F=>F.ansi[R.index]=L.rgba.toColor(...R.color)));else{const F=B;this._themeService.modifyColors((j=>j[F]=L.rgba.toColor(...R.color)))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(S){S?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(S){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(M.C0.ESC+"[I"),this.updateCursorStyle(S),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var S;return(S=this.textarea)===null||S===void 0?void 0:S.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(M.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 S=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(S);if(!R)return;const B=Math.min(this.buffer.x,this.cols-1),A=this._renderService.dimensions.css.cell.height,N=R.getWidth(B),F=this._renderService.dimensions.css.cell.width*N,j=this.buffer.y*this._renderService.dimensions.css.cell.height,q=B*this._renderService.dimensions.css.cell.width;this.textarea.style.left=q+"px",this.textarea.style.top=j+"px",this.textarea.style.width=F+"px",this.textarea.style.height=A+"px",this.textarea.style.lineHeight=A+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,u.addDisposableDomListener)(this.element,"copy",(R=>{this.hasSelection()&&(0,l.copyHandler)(R,this._selectionService)})));const S=R=>(0,l.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,u.addDisposableDomListener)(this.textarea,"paste",S)),this.register((0,u.addDisposableDomListener)(this.element,"paste",S)),T.isFirefox?this.register((0,u.addDisposableDomListener)(this.element,"mousedown",(R=>{R.button===2&&(0,l.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,u.addDisposableDomListener)(this.element,"contextmenu",(R=>{(0,l.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),T.isLinux&&this.register((0,u.addDisposableDomListener)(this.element,"auxclick",(R=>{R.button===1&&(0,l.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,u.addDisposableDomListener)(this.textarea,"keyup",(S=>this._keyUp(S)),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"keydown",(S=>this._keyDown(S)),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"keypress",(S=>this._keyPress(S)),!0)),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionupdate",(S=>this._compositionHelper.compositionupdate(S)))),this.register((0,u.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,u.addDisposableDomListener)(this.textarea,"input",(S=>this._inputEvent(S)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(S){var R;if(!S)throw new Error("Terminal requires a parent element.");S.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=S.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),S.appendChild(this.element);const B=U.createDocumentFragment();this._viewportElement=U.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.appendChild(this._viewportElement),this._viewportScrollArea=U.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=U.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=U.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=U.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),T.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(c.CoreBrowserService,this.textarea,(R=this._document.defaultView)!==null&&R!==void 0?R:window),this._instantiationService.setService(g.ICoreBrowserService,this._coreBrowserService),this.register((0,u.addDisposableDomListener)(this.textarea,"focus",(A=>this._handleTextAreaFocus(A)))),this.register((0,u.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(g.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(b.ThemeService),this._instantiationService.setService(g.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(o.CharacterJoinerService),this._instantiationService.setService(g.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(g.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((A=>this._onRender.fire(A)))),this.onResize((A=>this._renderService.resize(A.cols,A.rows))),this._compositionView=U.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(v.MouseService),this._instantiationService.setService(g.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(p.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((A=>this.scrollLines(A.amount,A.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(g.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((A=>this.scrollLines(A.amount,A.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((A=>this._renderService.handleSelectionChanged(A.start,A.end,A.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((A=>{this.textarea.value=A,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((A=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,u.addDisposableDomListener)(this.element,"mousedown",(A=>this._selectionService.handleMouseDown(A)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(A=>this._handleScreenReaderModeOptionChange(A)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(A=>{!this._overviewRulerRenderer&&A&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const S=this,R=this.element;function B(F){const j=S._mouseService.getMouseReportCoords(F,S.screenElement);if(!j)return!1;let q,V;switch(F.overrideType||F.type){case"mousemove":V=32,F.buttons===void 0?(q=3,F.button!==void 0&&(q=F.button<3?F.button:3)):q=1&F.buttons?0:4&F.buttons?1:2&F.buttons?2:3;break;case"mouseup":V=0,q=F.button<3?F.button:3;break;case"mousedown":V=1,q=F.button<3?F.button:3;break;case"wheel":if(S.viewport.getLinesScrolled(F)===0)return!1;V=F.deltaY<0?0:1,q=4;break;default:return!1}return!(V===void 0||q===void 0||q>4)&&S.coreMouseService.triggerMouseEvent({col:j.col,row:j.row,x:j.x,y:j.y,button:q,action:V,ctrl:F.ctrlKey,alt:F.altKey,shift:F.shiftKey})}const A={mouseup:null,wheel:null,mousedrag:null,mousemove:null},N={mouseup:F=>(B(F),F.buttons||(this._document.removeEventListener("mouseup",A.mouseup),A.mousedrag&&this._document.removeEventListener("mousemove",A.mousedrag)),this.cancel(F)),wheel:F=>(B(F),this.cancel(F,!0)),mousedrag:F=>{F.buttons&&B(F)},mousemove:F=>{F.buttons||B(F)}};this.register(this.coreMouseService.onProtocolChange((F=>{F?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(F)),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&F?A.mousemove||(R.addEventListener("mousemove",N.mousemove),A.mousemove=N.mousemove):(R.removeEventListener("mousemove",A.mousemove),A.mousemove=null),16&F?A.wheel||(R.addEventListener("wheel",N.wheel,{passive:!1}),A.wheel=N.wheel):(R.removeEventListener("wheel",A.wheel),A.wheel=null),2&F?A.mouseup||(R.addEventListener("mouseup",N.mouseup),A.mouseup=N.mouseup):(this._document.removeEventListener("mouseup",A.mouseup),R.removeEventListener("mouseup",A.mouseup),A.mouseup=null),4&F?A.mousedrag||(A.mousedrag=N.mousedrag):(this._document.removeEventListener("mousemove",A.mousedrag),A.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,u.addDisposableDomListener)(R,"mousedown",(F=>{if(F.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(F))return B(F),A.mouseup&&this._document.addEventListener("mouseup",A.mouseup),A.mousedrag&&this._document.addEventListener("mousemove",A.mousedrag),this.cancel(F)}))),this.register((0,u.addDisposableDomListener)(R,"wheel",(F=>{if(!A.wheel){if(!this.buffer.hasScrollback){const j=this.viewport.getLinesScrolled(F);if(j===0)return;const q=M.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(F.deltaY<0?"A":"B");let V="";for(let ee=0;ee<Math.abs(j);ee++)V+=q;return this.coreService.triggerDataEvent(V,!0),this.cancel(F,!0)}return this.viewport.handleWheel(F)?this.cancel(F):void 0}}),{passive:!1})),this.register((0,u.addDisposableDomListener)(R,"touchstart",(F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(F),this.cancel(F)}),{passive:!0})),this.register((0,u.addDisposableDomListener)(R,"touchmove",(F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(F)?void 0:this.cancel(F)}),{passive:!1}))}refresh(S,R){var B;(B=this._renderService)===null||B===void 0||B.refreshRows(S,R)}updateCursorStyle(S){var R;!((R=this._selectionService)===null||R===void 0)&&R.shouldColumnSelect(S)?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(S,R,B=0){var A;B===1?(super.scrollLines(S,R,B),this.refresh(0,this.rows-1)):(A=this.viewport)===null||A===void 0||A.scrollLines(S)}paste(S){(0,l.paste)(S,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(S){this._customKeyEventHandler=S}registerLinkProvider(S){return this.linkifier2.registerLinkProvider(S)}registerCharacterJoiner(S){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(S);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(S){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(S)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(S){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+S)}registerDecoration(S){return this._decorationService.registerDecoration(S)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(S,R,B){this._selectionService.setSelection(S,R,B)}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 S;(S=this._selectionService)===null||S===void 0||S.clearSelection()}selectAll(){var S;(S=this._selectionService)===null||S===void 0||S.selectAll()}selectLines(S,R){var B;(B=this._selectionService)===null||B===void 0||B.selectLines(S,R)}_keyDown(S){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(S)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&S.altKey;if(!R&&!this._compositionHelper.keydown(S))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||S.key!=="Dead"&&S.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const B=(0,C.evaluateKeyboardEvent)(S,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(S),B.type===3||B.type===2){const A=this.rows-1;return this.scrollLines(B.type===2?-A:A),this.cancel(S,!0)}return B.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,S)||(B.cancel&&this.cancel(S,!0),!B.key||!!(S.key&&!S.ctrlKey&&!S.altKey&&!S.metaKey&&S.key.length===1&&S.key.charCodeAt(0)>=65&&S.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(B.key!==M.C0.ETX&&B.key!==M.C0.CR||(this.textarea.value=""),this._onKey.fire({key:B.key,domEvent:S}),this._showCursor(),this.coreService.triggerDataEvent(B.key,!0),!this.optionsService.rawOptions.screenReaderMode||S.altKey||S.ctrlKey?this.cancel(S,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(S,R){const B=S.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||S.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||S.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?B:B&&(!R.keyCode||R.keyCode>47)}_keyUp(S){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(S)===!1||((function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18})(S)||this.focus(),this.updateCursorStyle(S),this._keyPressHandled=!1)}_keyPress(S){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(S)===!1)return!1;if(this.cancel(S),S.charCode)R=S.charCode;else if(S.which===null||S.which===void 0)R=S.keyCode;else{if(S.which===0||S.charCode===0)return!1;R=S.which}return!(!R||(S.altKey||S.ctrlKey||S.metaKey)&&!this._isThirdLevelShift(this.browser,S)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:S}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(S){if(S.data&&S.inputType==="insertText"&&(!S.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=S.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(S),!0}return!1}resize(S,R){S!==this.cols||R!==this.rows?super.resize(S,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(S,R){var B,A;(B=this._charSizeService)===null||B===void 0||B.measure(),(A=this.viewport)===null||A===void 0||A.syncScrollArea(!0)}clear(){var S;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 R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine(O.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(S=this.viewport)===null||S===void 0||S.reset(),this.refresh(0,this.rows-1)}}reset(){var S,R;this.options.rows=this.rows,this.options.cols=this.cols;const B=this._customKeyEventHandler;this._setup(),super.reset(),(S=this._selectionService)===null||S===void 0||S.reset(),this._decorationService.reset(),(R=this.viewport)===null||R===void 0||R.reset(),this._customKeyEventHandler=B,this.refresh(0,this.rows-1)}clearTextureAtlas(){var S;(S=this._renderService)===null||S===void 0||S.clearTextureAtlas()}_reportFocus(){var S;!((S=this.element)===null||S===void 0)&&S.classList.contains("focus")?this.coreService.triggerDataEvent(M.C0.ESC+"[I"):this.coreService.triggerDataEvent(M.C0.ESC+"[O")}_reportWindowsOptions(S){if(this._renderService)switch(S){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),B=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${M.C0.ESC}[4;${B};${R}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const A=this._renderService.dimensions.css.cell.width.toFixed(0),N=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${M.C0.ESC}[6;${N};${A}t`)}}cancel(S,R){if(this.options.cancelEvents||R)return S.preventDefault(),S.stopPropagation(),!1}}r.Terminal=W},9924:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(a,l=1e3){this._renderCallback=a,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,l,u){this._rowCount=u,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=n-this._lastRefreshMs,f=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l)}}},1680:function(I,r,a){var l=this&&this.__decorate||function(s,t,i,o){var c,v=arguments.length,m=v<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,o);else for(var h=s.length-1;h>=0;h--)(c=s[h])&&(m=(v<3?c(m):v>3?c(t,i,m):c(t,i))||m);return v>3&&m&&Object.defineProperty(t,i,m),m},u=this&&this.__param||function(s,t){return function(i,o){t(i,o,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const n=a(3656),d=a(4725),f=a(8460),p=a(844),_=a(2585);let e=r.Viewport=class extends p.Disposable{constructor(s,t,i,o,c,v,m,h){super(),this._viewportElement=s,this._scrollArea=t,this._bufferService=i,this._optionsService=o,this._charSizeService=c,this._renderService=v,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((g=>this._activeBuffer=g.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((g=>this._renderDimensions=g))),this._handleThemeChange(h.colors),this.register(h.onChangeColors((g=>this._handleThemeChange(g)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(s){if(s)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(s,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&i<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){const t=this._getPixelsScrolled(s);return t!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(s,t))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const t=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let t=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(s,t){var i;let o,c="";const v=[],m=t??this._bufferService.buffer.lines.length,h=this._bufferService.buffer.lines;for(let g=s;g<m;g++){const b=h.get(g);if(!b)continue;const L=(i=h.get(g+1))===null||i===void 0?void 0:i.isWrapped;if(c+=b.translateToString(!L),!L||g===h.length-1){const y=document.createElement("div");y.textContent=c,v.push(y),c.length>0&&(o=y),c=""}}return{bufferElements:v,cursorElement:o}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let t=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(s,t){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&t.altKey||i==="ctrl"&&t.ctrlKey||i==="shift"&&t.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const t=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(s,t))}};r.Viewport=e=l([u(2,_.IBufferService),u(3,_.IOptionsService),u(4,d.ICharSizeService),u(5,d.IRenderService),u(6,d.ICoreBrowserService),u(7,d.IThemeService)],e)},3107:function(I,r,a){var l=this&&this.__decorate||function(e,s,t,i){var o,c=arguments.length,v=c<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(v=(c<3?o(v):c>3?o(s,t,v):o(s,t))||v);return c>3&&v&&Object.defineProperty(s,t,v),v},u=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const n=a(3656),d=a(4725),f=a(844),p=a(2585);let _=r.BufferDecorationRenderer=class extends f.Disposable{constructor(e,s,t,i){super(),this._screenElement=e,this._bufferService=s,this._decorationService=t,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,n.addDisposableDomListener)(window,"resize",(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((o=>this._removeDecoration(o)))),this.register((0,f.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(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,t;const i=document.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((s=e?.options)===null||s===void 0?void 0:s.layer)==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const o=(t=e.options.x)!==null&&t!==void 0?t:0;return o&&o>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_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 t=this._decorationElements.get(e);t||(t=this._createElement(e),e.element=t,this._decorationElements.set(e,t),this._container.appendChild(t),e.onDispose((()=>{this._decorationElements.delete(e),t.remove()}))),t.style.top=s*this._renderService.dimensions.css.cell.height+"px",t.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(t)}}_refreshXPosition(e,s=e.element){var t;if(!s)return;const i=(t=e.options.x)!==null&&t!==void 0?t:0;(e.options.anchor||"left")==="right"?s.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":s.style.left=i?i*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()}};r.BufferDecorationRenderer=_=l([u(1,p.IBufferService),u(2,p.IDecorationService),u(3,d.IRenderService)],_)},5871:(I,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(a){if(a.options.overviewRulerOptions){for(const l of this._zones)if(l.color===a.options.overviewRulerOptions.color&&l.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,a.marker.line))return;if(this._lineAdjacentToZone(l,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(l,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,l){return l>=a.startBufferLine&&l<=a.endBufferLine}_lineAdjacentToZone(a,l,u){return l>=a.startBufferLine-this._linePadding[u||"full"]&&l<=a.endBufferLine+this._linePadding[u||"full"]}_addLineToZone(a,l){a.startBufferLine=Math.min(a.startBufferLine,l),a.endBufferLine=Math.max(a.endBufferLine,l)}}},5744:function(I,r,a){var l=this&&this.__decorate||function(o,c,v,m){var h,g=arguments.length,b=g<3?c:m===null?m=Object.getOwnPropertyDescriptor(c,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,c,v,m);else for(var L=o.length-1;L>=0;L--)(h=o[L])&&(b=(g<3?h(b):g>3?h(c,v,b):h(c,v))||b);return g>3&&b&&Object.defineProperty(c,v,b),b},u=this&&this.__param||function(o,c){return function(v,m){c(v,m,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const n=a(5871),d=a(3656),f=a(4725),p=a(844),_=a(2585),e={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0};let i=r.OverviewRulerRenderer=class extends p.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(o,c,v,m,h,g,b){var L;super(),this._viewportElement=o,this._screenElement=c,this._bufferService=v,this._decorationService=m,this._renderService=h,this._optionsService=g,this._coreBrowseService=b,this._colorZoneStore=new n.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(),(L=this._viewportElement.parentElement)===null||L===void 0||L.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,p.toDisposable)((()=>{var k;(k=this._canvas)===null||k===void 0||k.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register((0,d.addDisposableDomListener)(this._coreBrowseService.window,"resize",(()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const o=Math.floor(this._canvas.width/3),c=Math.ceil(this._canvas.width/3);s.full=this._canvas.width,s.left=o,s.center=c,s.right=o,this._refreshDrawHeightConstants(),t.full=0,t.left=0,t.center=s.left,t.right=s.left+s.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const o=this._canvas.height/this._bufferService.buffer.lines.length,c=Math.round(Math.max(Math.min(o,12),6)*this._coreBrowseService.dpr);e.left=c,e.center=c,e.right=c}_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 c of this._decorationService.decorations)this._colorZoneStore.addDecoration(c);this._ctx.lineWidth=1;const o=this._colorZoneStore.zones;for(const c of o)c.position!=="full"&&this._renderColorZone(c);for(const c of o)c.position==="full"&&this._renderColorZone(c);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(o){this._ctx.fillStyle=o.color,this._ctx.fillRect(t[o.position||"full"],Math.round((this._canvas.height-1)*(o.startBufferLine/this._bufferService.buffers.active.lines.length)-e[o.position||"full"]/2),s[o.position||"full"],Math.round((this._canvas.height-1)*((o.endBufferLine-o.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[o.position||"full"]))}_queueRefresh(o,c){this._shouldUpdateDimensions=o||this._shouldUpdateDimensions,this._shouldUpdateAnchor=c||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=i=l([u(2,_.IBufferService),u(3,_.IDecorationService),u(4,f.IRenderService),u(5,_.IOptionsService),u(6,f.ICoreBrowserService)],i)},2950:function(I,r,a){var l=this&&this.__decorate||function(_,e,s,t){var i,o=arguments.length,c=o<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(_,e,s,t);else for(var v=_.length-1;v>=0;v--)(i=_[v])&&(c=(o<3?i(c):o>3?i(e,s,c):i(e,s))||c);return o>3&&c&&Object.defineProperty(e,s,c),c},u=this&&this.__param||function(_,e){return function(s,t){e(s,t,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const n=a(4725),d=a(2585),f=a(2584);let p=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,e,s,t,i,o){this._textarea=_,this._compositionView=e,this._bufferService=s,this._optionsService=t,this._coreService=i,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){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 _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const e=this._textarea.value,s=e.replace(_,"");this._dataAlreadySent=s,e.length>_.length?this._coreService.triggerDataEvent(s,!0):e.length<_.length?this._coreService.triggerDataEvent(`${f.C0.DEL}`,!0):e.length===_.length&&e!==_&&this._coreService.triggerDataEvent(e,!0)}}),0)}updateCompositionElements(_){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,t=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=t+"px",this._compositionView.style.height=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 o=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=t+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=p=l([u(2,d.IBufferService),u(3,d.IOptionsService),u(4,d.ICoreService),u(5,n.IRenderService)],p)},9806:(I,r)=>{function a(l,u,n){const d=n.getBoundingClientRect(),f=l.getComputedStyle(n),p=parseInt(f.getPropertyValue("padding-left")),_=parseInt(f.getPropertyValue("padding-top"));return[u.clientX-d.left-p,u.clientY-d.top-_]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=a,r.getCoords=function(l,u,n,d,f,p,_,e,s){if(!p)return;const t=a(l,u,n);return t?(t[0]=Math.ceil((t[0]+(s?_/2:0))/_),t[1]=Math.ceil(t[1]/e),t[0]=Math.min(Math.max(t[0],1),d+(s?1:0)),t[1]=Math.min(Math.max(t[1],1),f),t):void 0}},9504:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const l=a(2584);function u(e,s,t,i){const o=e-n(e,t),c=s-n(s,t),v=Math.abs(o-c)-(function(m,h,g){let b=0;const L=m-n(m,g),y=h-n(h,g);for(let k=0;k<Math.abs(L-y);k++){const x=d(m,h)==="A"?-1:1,T=g.buffer.lines.get(L+x*k);T?.isWrapped&&b++}return b})(e,s,t);return _(v,p(d(e,s),i))}function n(e,s){let t=0,i=s.buffer.lines.get(e),o=i?.isWrapped;for(;o&&e>=0&&e<s.rows;)t++,i=s.buffer.lines.get(--e),o=i?.isWrapped;return t}function d(e,s){return e>s?"A":"B"}function f(e,s,t,i,o,c){let v=e,m=s,h="";for(;v!==t||m!==i;)v+=o?1:-1,o&&v>c.cols-1?(h+=c.buffer.translateBufferLineToString(m,!1,e,v),v=0,e=0,m++):!o&&v<0&&(h+=c.buffer.translateBufferLineToString(m,!1,0,e+1),v=c.cols-1,e=v,m--);return h+c.buffer.translateBufferLineToString(m,!1,e,v)}function p(e,s){const t=s?"O":"[";return l.C0.ESC+t+e}function _(e,s){e=Math.floor(e);let t="";for(let i=0;i<e;i++)t+=s;return t}r.moveToCellSequence=function(e,s,t,i){const o=t.buffer.x,c=t.buffer.y;if(!t.buffer.hasScrollback)return(function(h,g,b,L,y,k){return u(g,L,y,k).length===0?"":_(f(h,g,h,g-n(g,y),!1,y).length,p("D",k))})(o,c,0,s,t,i)+u(c,s,t,i)+(function(h,g,b,L,y,k){let x;x=u(g,L,y,k).length>0?L-n(L,y):g;const T=L,O=(function(M,C,w,E,D,P){let H;return H=u(w,E,D,P).length>0?E-n(E,D):C,M<w&&H<=E||M>=w&&H<E?"C":"D"})(h,g,b,L,y,k);return _(f(h,x,b,T,O==="C",y).length,p(O,k))})(o,c,e,s,t,i);let v;if(c===s)return v=o>e?"D":"C",_(Math.abs(o-e),p(v,i));v=c>s?"D":"C";const m=Math.abs(c-s);return _((function(h,g){return g.cols-h})(c>s?e:o,t)+(m-1)*t.cols+1+((c>s?o:e)-1),p(v,i))}},1296:function(I,r,a){var l=this&&this.__decorate||function(y,k,x,T){var O,M=arguments.length,C=M<3?k:T===null?T=Object.getOwnPropertyDescriptor(k,x):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(y,k,x,T);else for(var w=y.length-1;w>=0;w--)(O=y[w])&&(C=(M<3?O(C):M>3?O(k,x,C):O(k,x))||C);return M>3&&C&&Object.defineProperty(k,x,C),C},u=this&&this.__param||function(y,k){return function(x,T){k(x,T,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const n=a(3787),d=a(2550),f=a(2223),p=a(6171),_=a(4725),e=a(8055),s=a(8460),t=a(844),i=a(2585),o="xterm-dom-renderer-owner-",c="xterm-rows",v="xterm-fg-",m="xterm-bg-",h="xterm-focus",g="xterm-selection";let b=1,L=r.DomRenderer=class extends t.Disposable{constructor(y,k,x,T,O,M,C,w,E,D){super(),this._element=y,this._screenElement=k,this._viewportElement=x,this._linkifier2=T,this._charSizeService=M,this._optionsService=C,this._bufferService=w,this._coreBrowserService=E,this._themeService=D,this._terminalClass=b++,this._rowElements=[],this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(c),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(g),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,p.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((P=>this._injectCss(P)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(o+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((P=>this._handleLinkHover(P)))),this.register(this._linkifier2.onHideLinkUnderline((P=>this._handleLinkLeave(P)))),this.register((0,t.toDisposable)((()=>{this._element.classList.remove(o+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new d.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const y=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*y,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*y),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/y),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/y),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 x of this._rowElements)x.style.width=`${this.dimensions.css.canvas.width}px`,x.style.height=`${this.dimensions.css.cell.height}px`,x.style.lineHeight=`${this.dimensions.css.cell.height}px`,x.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const k=`${this._terminalSelector} .${c} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=k,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(y){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let k=`${this._terminalSelector} .${c} { color: ${y.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;k+=`${this._terminalSelector} .${c} .xterm-dim { color: ${e.color.multiplyOpacity(y.foreground,.5).css};}`,k+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,k+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",k+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${y.cursor.css}; color: ${y.cursorAccent.css}; } 50% { background-color: inherit; color: ${y.cursor.css}; }}`,k+=`${this._terminalSelector} .${c}.${h} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${c}.${h} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-block { background-color: ${y.cursor.css}; color: ${y.cursorAccent.css};}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${y.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${y.cursor.css} inset;}${this._terminalSelector} .${c} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${y.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,k+=`${this._terminalSelector} .${g} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${g} div { position: absolute; background-color: ${y.selectionBackgroundOpaque.css};}${this._terminalSelector} .${g} div { position: absolute; background-color: ${y.selectionInactiveBackgroundOpaque.css};}`;for(const[x,T]of y.ansi.entries())k+=`${this._terminalSelector} .${v}${x} { color: ${T.css}; }${this._terminalSelector} .${v}${x}.xterm-dim { color: ${e.color.multiplyOpacity(T,.5).css}; }${this._terminalSelector} .${m}${x} { background-color: ${T.css}; }`;k+=`${this._terminalSelector} .${v}${f.INVERTED_DEFAULT_COLOR} { color: ${e.color.opaque(y.background).css}; }${this._terminalSelector} .${v}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${e.color.multiplyOpacity(e.color.opaque(y.background),.5).css}; }${this._terminalSelector} .${m}${f.INVERTED_DEFAULT_COLOR} { background-color: ${y.foreground.css}; }`,this._themeStyleElement.textContent=k}_setDefaultSpacing(){const y=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${y}px`,this._rowFactory.defaultSpacing=y}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(y,k){for(let x=this._rowElements.length;x<=k;x++){const T=document.createElement("div");this._rowContainer.appendChild(T),this._rowElements.push(T)}for(;this._rowElements.length>k;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(y,k){this._refreshRowElements(y,k),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(h)}handleFocus(){this._rowContainer.classList.add(h),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(y,k,x){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(y,k,x),this.renderRows(0,this._bufferService.rows-1),!y||!k)return;const T=y[1]-this._bufferService.buffer.ydisp,O=k[1]-this._bufferService.buffer.ydisp,M=Math.max(T,0),C=Math.min(O,this._bufferService.rows-1);if(M>=this._bufferService.rows||C<0)return;const w=document.createDocumentFragment();if(x){const E=y[0]>k[0];w.appendChild(this._createSelectionElement(M,E?k[0]:y[0],E?y[0]:k[0],C-M+1))}else{const E=T===M?y[0]:0,D=M===O?k[0]:this._bufferService.cols;w.appendChild(this._createSelectionElement(M,E,D));const P=C-M-1;if(w.appendChild(this._createSelectionElement(M+1,0,this._bufferService.cols,P)),M!==C){const H=O===C?k[0]:this._bufferService.cols;w.appendChild(this._createSelectionElement(C,0,H))}}this._selectionContainer.appendChild(w)}_createSelectionElement(y,k,x,T=1){const O=document.createElement("div");return O.style.height=T*this.dimensions.css.cell.height+"px",O.style.top=y*this.dimensions.css.cell.height+"px",O.style.left=k*this.dimensions.css.cell.width+"px",O.style.width=this.dimensions.css.cell.width*(x-k)+"px",O}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const y of this._rowElements)y.replaceChildren()}renderRows(y,k){const x=this._bufferService.buffer,T=x.ybase+x.y,O=Math.min(x.x,this._bufferService.cols-1),M=this._optionsService.rawOptions.cursorBlink,C=this._optionsService.rawOptions.cursorStyle,w=this._optionsService.rawOptions.cursorInactiveStyle;for(let E=y;E<=k;E++){const D=E+x.ydisp,P=this._rowElements[E],H=x.lines.get(D);if(!P||!H)break;P.replaceChildren(...this._rowFactory.createRow(H,D,D===T,C,w,O,M,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${o}${this._terminalClass}`}_handleLinkHover(y){this._setCellUnderline(y.x1,y.x2,y.y1,y.y2,y.cols,!0)}_handleLinkLeave(y){this._setCellUnderline(y.x1,y.x2,y.y1,y.y2,y.cols,!1)}_setCellUnderline(y,k,x,T,O,M){x<0&&(y=0),T<0&&(k=0);const C=this._bufferService.rows-1;x=Math.max(Math.min(x,C),0),T=Math.max(Math.min(T,C),0),O=Math.min(O,this._bufferService.cols);const w=this._bufferService.buffer,E=w.ybase+w.y,D=Math.min(w.x,O-1),P=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let W=x;W<=T;++W){const z=W+w.ydisp,S=this._rowElements[W],R=w.lines.get(z);if(!S||!R)break;S.replaceChildren(...this._rowFactory.createRow(R,z,z===E,H,U,D,P,this.dimensions.css.cell.width,this._widthCache,M?W===x?y:0:-1,M?(W===T?k:O)-1:-1))}}};r.DomRenderer=L=l([u(4,i.IInstantiationService),u(5,_.ICharSizeService),u(6,i.IOptionsService),u(7,i.IBufferService),u(8,_.ICoreBrowserService),u(9,_.IThemeService)],L)},3787:function(I,r,a){var l=this&&this.__decorate||function(v,m,h,g){var b,L=arguments.length,y=L<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,h):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(v,m,h,g);else for(var k=v.length-1;k>=0;k--)(b=v[k])&&(y=(L<3?b(y):L>3?b(m,h,y):b(m,h))||y);return L>3&&y&&Object.defineProperty(m,h,y),y},u=this&&this.__param||function(v,m){return function(h,g){m(h,g,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const n=a(2223),d=a(643),f=a(511),p=a(2585),_=a(8055),e=a(4725),s=a(4269),t=a(6171),i=a(3734);let o=r.DomRendererRowFactory=class{constructor(v,m,h,g,b,L,y){this._document=v,this._characterJoinerService=m,this._optionsService=h,this._coreBrowserService=g,this._coreService=b,this._decorationService=L,this._themeService=y,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(v,m,h){this._selectionStart=v,this._selectionEnd=m,this._columnSelectMode=h}createRow(v,m,h,g,b,L,y,k,x,T,O){const M=[],C=this._characterJoinerService.getJoinedCharacters(m),w=this._themeService.colors;let E,D=v.getNoBgTrimmedLength();h&&D<L+1&&(D=L+1);let P=0,H="",U=0,W=0,z=0,S=!1,R=0,B=!1,A=0;const N=[],F=T!==-1&&O!==-1;for(let j=0;j<D;j++){v.loadCell(j,this._workCell);let q=this._workCell.getWidth();if(q===0)continue;let V=!1,ee=j,$=this._workCell;if(C.length>0&&j===C[0][0]){V=!0;const K=C.shift();$=new s.JoinedCellData(this._workCell,v.translateToString(!0,K[0],K[1]),K[1]-K[0]),ee=K[1]-1,q=$.getWidth()}const ie=this._isCellInSelection(j,m),he=h&&j===L,ce=F&&j>=T&&j<=O;let le=!1;this._decorationService.forEachDecorationAtCell(j,m,void 0,(K=>{le=!0}));let oe=$.getChars()||d.WHITESPACE_CELL_CHAR;if(oe===" "&&($.isUnderline()||$.isOverline())&&(oe="\xA0"),A=q*k-x.get(oe,$.isBold(),$.isItalic()),E){if(P&&(ie&&B||!ie&&!B&&$.bg===U)&&(ie&&B&&w.selectionForeground||$.fg===W)&&$.extended.ext===z&&ce===S&&A===R&&!he&&!V&&!le){H+=oe,P++;continue}P&&(E.textContent=H),E=this._document.createElement("span"),P=0,H=""}else E=this._document.createElement("span");if(U=$.bg,W=$.fg,z=$.extended.ext,S=ce,R=A,B=ie,V&&L>=j&&L<=ee&&(L=j),!this._coreService.isCursorHidden&&he){if(N.push("xterm-cursor"),this._coreBrowserService.isFocused)y&&N.push("xterm-cursor-blink"),N.push(g==="bar"?"xterm-cursor-bar":g==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(b)switch(b){case"outline":N.push("xterm-cursor-outline");break;case"block":N.push("xterm-cursor-block");break;case"bar":N.push("xterm-cursor-bar");break;case"underline":N.push("xterm-cursor-underline")}}if($.isBold()&&N.push("xterm-bold"),$.isItalic()&&N.push("xterm-italic"),$.isDim()&&N.push("xterm-dim"),H=$.isInvisible()?d.WHITESPACE_CELL_CHAR:$.getChars()||d.WHITESPACE_CELL_CHAR,$.isUnderline()&&(N.push(`xterm-underline-${$.extended.underlineStyle}`),H===" "&&(H="\xA0"),!$.isUnderlineColorDefault()))if($.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB($.getUnderlineColor()).join(",")})`;else{let K=$.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&$.isBold()&&K<8&&(K+=8),E.style.textDecorationColor=w.ansi[K].css}$.isOverline()&&(N.push("xterm-overline"),H===" "&&(H="\xA0")),$.isStrikethrough()&&N.push("xterm-strikethrough"),ce&&(E.style.textDecoration="underline");let G=$.getFgColor(),se=$.getFgColorMode(),J=$.getBgColor(),re=$.getBgColorMode();const de=!!$.isInverse();if(de){const K=G;G=J,J=K;const fe=se;se=re,re=fe}let Y,_e,Z,ne=!1;switch(this._decorationService.forEachDecorationAtCell(j,m,void 0,(K=>{K.options.layer!=="top"&&ne||(K.backgroundColorRGB&&(re=50331648,J=K.backgroundColorRGB.rgba>>8&16777215,Y=K.backgroundColorRGB),K.foregroundColorRGB&&(se=50331648,G=K.foregroundColorRGB.rgba>>8&16777215,_e=K.foregroundColorRGB),ne=K.options.layer==="top")})),!ne&&ie&&(Y=this._coreBrowserService.isFocused?w.selectionBackgroundOpaque:w.selectionInactiveBackgroundOpaque,J=Y.rgba>>8&16777215,re=50331648,ne=!0,w.selectionForeground&&(se=50331648,G=w.selectionForeground.rgba>>8&16777215,_e=w.selectionForeground)),ne&&N.push("xterm-decoration-top"),re){case 16777216:case 33554432:Z=w.ansi[J],N.push(`xterm-bg-${J}`);break;case 50331648:Z=_.rgba.toColor(J>>16,J>>8&255,255&J),this._addStyle(E,`background-color:#${c((J>>>0).toString(16),"0",6)}`);break;default:de?(Z=w.foreground,N.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):Z=w.background}switch(Y||$.isDim()&&(Y=_.color.multiplyOpacity(Z,.5)),se){case 16777216:case 33554432:$.isBold()&&G<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(G+=8),this._applyMinimumContrast(E,Z,w.ansi[G],$,Y,void 0)||N.push(`xterm-fg-${G}`);break;case 50331648:const K=_.rgba.toColor(G>>16&255,G>>8&255,255&G);this._applyMinimumContrast(E,Z,K,$,Y,_e)||this._addStyle(E,`color:#${c(G.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(E,Z,w.foreground,$,Y,void 0)||de&&N.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}N.length&&(E.className=N.join(" "),N.length=0),he||V||le?E.textContent=H:P++,A!==this.defaultSpacing&&(E.style.letterSpacing=`${A}px`),M.push(E),j=ee}return E&&P&&(E.textContent=H),M}_applyMinimumContrast(v,m,h,g,b,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,t.excludeFromContrastRatioDemands)(g.getCode()))return!1;const y=this._getContrastCache(g);let k;if(b||L||(k=y.getColor(m.rgba,h.rgba)),k===void 0){const x=this._optionsService.rawOptions.minimumContrastRatio/(g.isDim()?2:1);k=_.color.ensureContrastRatio(b||m,L||h,x),y.setColor((b||m).rgba,(L||h).rgba,k??null)}return!!k&&(this._addStyle(v,`color:${k.css}`),!0)}_getContrastCache(v){return v.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(v,m){v.setAttribute("style",`${v.getAttribute("style")||""}${m};`)}_isCellInSelection(v,m){const h=this._selectionStart,g=this._selectionEnd;return!(!h||!g)&&(this._columnSelectMode?h[0]<=g[0]?v>=h[0]&&m>=h[1]&&v<g[0]&&m<=g[1]:v<h[0]&&m>=h[1]&&v>=g[0]&&m<=g[1]:m>h[1]&&m<g[1]||h[1]===g[1]&&m===h[1]&&v>=h[0]&&v<g[0]||h[1]<g[1]&&m===g[1]&&v<g[0]||h[1]<g[1]&&m===h[1]&&v>=h[0])}};function c(v,m,h){for(;v.length<h;)v=m+v;return v}r.DomRendererRowFactory=o=l([u(1,e.ICharacterJoinerService),u(2,p.IOptionsService),u(3,e.ICoreBrowserService),u(4,p.ICoreService),u(5,p.IDecorationService),u(6,e.IThemeService)],o)},2550:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const l=a.createElement("span"),u=a.createElement("span");u.style.fontWeight="bold";const n=a.createElement("span");n.style.fontStyle="italic";const d=a.createElement("span");d.style.fontWeight="bold",d.style.fontStyle="italic",this._measureElements=[l,u,n,d],this._container.appendChild(l),this._container.appendChild(u),this._container.appendChild(n),this._container.appendChild(d),a.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,l,u,n){a===this._font&&l===this._fontSize&&u===this._weight&&n===this._weightBold||(this._font=a,this._fontSize=l,this._weight=u,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${u}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${u}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(a,l,u){let n=0;if(!l&&!u&&a.length===1&&(n=a.charCodeAt(0))<256)return this._flat[n]!==-9999?this._flat[n]:this._flat[n]=this._measure(a,0);let d=a;l&&(d+="B"),u&&(d+="I");let f=this._holey.get(d);if(f===void 0){let p=0;l&&(p|=1),u&&(p|=2),f=this._measure(a,p),this._holey.set(d,f)}return f}_measure(a,l){const u=this._measureElements[l];return u.textContent=a.repeat(32),u.offsetWidth/32}}},2223:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const l=a(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(I,r)=>{function a(l){return 57508<=l&&l<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(l){if(!l)throw new Error("value must not be falsy");return l},r.isPowerlineGlyph=a,r.isRestrictedPowerlineGlyph=function(l){return 57520<=l&&l<=57527},r.excludeFromContrastRatioDemands=function(l){return a(l)||(function(u){return 9472<=u&&u<=9631})(l)},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:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,l=this.selectionEnd;return!(!a||!l)&&(a[1]>l[1]||a[1]===l[1]&&a[0]>l[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(I,r,a){var l=this&&this.__decorate||function(e,s,t,i){var o,c=arguments.length,v=c<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(v=(c<3?o(v):c>3?o(s,t,v):o(s,t))||v);return c>3&&v&&Object.defineProperty(s,t,v),v},u=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const n=a(2585),d=a(8460),f=a(844);let p=r.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,s,t){super(),this._optionsService=t,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new _(e,s,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}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())}};r.CharSizeService=p=l([u(2,n.IOptionsService)],p);class _{constructor(s,t,i){this._document=s,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const s={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return s.width!==0&&s.height!==0&&(this._result.width=s.width/32,this._result.height=Math.ceil(s.height)),this._result}}},4269:function(I,r,a){var l=this&&this.__decorate||function(s,t,i,o){var c,v=arguments.length,m=v<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,o);else for(var h=s.length-1;h>=0;h--)(c=s[h])&&(m=(v<3?c(m):v>3?c(t,i,m):c(t,i))||m);return v>3&&m&&Object.defineProperty(t,i,m),m},u=this&&this.__param||function(s,t){return function(i,o){t(i,o,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const n=a(3734),d=a(643),f=a(511),p=a(2585);class _ extends n.AttributeData{constructor(t,i,o){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=i,this._width=o}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=_;let e=r.CharacterJoinerService=class ue{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(t){const i={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(i),i.id}deregister(t){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===t)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(t);if(!i||i.length===0)return[];const o=[],c=i.translateToString(!0);let v=0,m=0,h=0,g=i.getFg(0),b=i.getBg(0);for(let L=0;L<i.getTrimmedLength();L++)if(i.loadCell(L,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==g||this._workCell.bg!==b){if(L-v>1){const y=this._getJoinedRanges(c,h,m,i,v);for(let k=0;k<y.length;k++)o.push(y[k])}v=L,h=m,g=this._workCell.fg,b=this._workCell.bg}m+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const L=this._getJoinedRanges(c,h,m,i,v);for(let y=0;y<L.length;y++)o.push(L[y])}return o}_getJoinedRanges(t,i,o,c,v){const m=t.substring(i,o);let h=[];try{h=this._characterJoiners[0].handler(m)}catch(g){console.error(g)}for(let g=1;g<this._characterJoiners.length;g++)try{const b=this._characterJoiners[g].handler(m);for(let L=0;L<b.length;L++)ue._mergeRanges(h,b[L])}catch(b){console.error(b)}return this._stringRangesToCellRanges(h,c,v),h}_stringRangesToCellRanges(t,i,o){let c=0,v=!1,m=0,h=t[c];if(h){for(let g=o;g<this._bufferService.cols;g++){const b=i.getWidth(g),L=i.getString(g).length||d.WHITESPACE_CELL_CHAR.length;if(b!==0){if(!v&&h[0]<=m&&(h[0]=g,v=!0),h[1]<=m){if(h[1]=g,h=t[++c],!h)break;h[0]<=m?(h[0]=g,v=!0):v=!1}m+=L}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let o=!1;for(let c=0;c<t.length;c++){const v=t[c];if(o){if(i[1]<=v[0])return t[c-1][1]=i[1],t;if(i[1]<=v[1])return t[c-1][1]=Math.max(i[1],v[1]),t.splice(c,1),t;t.splice(c,1),c--}else{if(i[1]<=v[0])return t.splice(c,0,i),t;if(i[1]<=v[1])return v[0]=Math.min(i[0],v[0]),t;i[0]<v[1]&&(v[0]=Math.min(i[0],v[0]),o=!0)}}return o?t[t.length-1][1]=i[1]:t.push(i),t}};r.CharacterJoinerService=e=l([u(0,p.IBufferService)],e)},5114:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(a,l){this._textarea=a,this.window=l,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(I,r,a){var l=this&&this.__decorate||function(p,_,e,s){var t,i=arguments.length,o=i<3?_:s===null?s=Object.getOwnPropertyDescriptor(_,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(p,_,e,s);else for(var c=p.length-1;c>=0;c--)(t=p[c])&&(o=(i<3?t(o):i>3?t(_,e,o):t(_,e))||o);return i>3&&o&&Object.defineProperty(_,e,o),o},u=this&&this.__param||function(p,_){return function(e,s){_(e,s,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const n=a(4725),d=a(9806);let f=r.MouseService=class{constructor(p,_){this._renderService=p,this._charSizeService=_}getCoords(p,_,e,s,t){return(0,d.getCoords)(window,p,_,e,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,t)}getMouseReportCoords(p,_){const e=(0,d.getCoordsRelativeToElement)(window,p,_);if(this._charSizeService.hasValidSize)return e[0]=Math.min(Math.max(e[0],0),this._renderService.dimensions.css.canvas.width-1),e[1]=Math.min(Math.max(e[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(e[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(e[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(e[0]),y:Math.floor(e[1])}}};r.MouseService=f=l([u(0,n.IRenderService),u(1,n.ICharSizeService)],f)},3230:function(I,r,a){var l=this&&this.__decorate||function(o,c,v,m){var h,g=arguments.length,b=g<3?c:m===null?m=Object.getOwnPropertyDescriptor(c,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,c,v,m);else for(var L=o.length-1;L>=0;L--)(h=o[L])&&(b=(g<3?h(b):g>3?h(c,v,b):h(c,v))||b);return g>3&&b&&Object.defineProperty(c,v,b),b},u=this&&this.__param||function(o,c){return function(v,m){c(v,m,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const n=a(3656),d=a(6193),f=a(5596),p=a(4725),_=a(8460),e=a(844),s=a(7226),t=a(2585);let i=r.RenderService=class extends e.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,c,v,m,h,g,b,L){if(super(),this._rowCount=o,this._charSizeService=m,this._renderer=this.register(new e.MutableDisposable),this._pausedResizeTask=new s.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._renderDebouncer=new d.RenderDebouncer(b.window,((y,k)=>this._renderRows(y,k))),this.register(this._renderDebouncer),this._screenDprMonitor=new f.ScreenDprMonitor(b.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(g.onResize((()=>this._fullRefresh()))),this.register(g.buffers.onBufferActivate((()=>{var y;return(y=this._renderer.value)===null||y===void 0?void 0:y.clear()}))),this.register(v.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(h.onDecorationRegistered((()=>this._fullRefresh()))),this.register(h.onDecorationRemoved((()=>this._fullRefresh()))),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],(()=>{this.clear(),this.handleResize(g.cols,g.rows),this._fullRefresh()}))),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(g.buffer.y,g.buffer.y,!0)))),this.register((0,n.addDisposableDomListener)(b.window,"resize",(()=>this.handleDevicePixelRatioChange()))),this.register(L.onChangeColors((()=>this._fullRefresh()))),"IntersectionObserver"in b.window){const y=new b.window.IntersectionObserver((k=>this._handleIntersectionChange(k[k.length-1])),{threshold:0});y.observe(c),this.register({dispose:()=>y.disconnect()})}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.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(o,c,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,c,this._rowCount))}_renderRows(o,c){this._renderer.value&&(o=Math.min(o,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(o,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:c}),this._onRender.fire({start:o,end:c}),this._isNextRenderRedrawOnly=!0)}resize(o,c){this._rowCount=c,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(o){this._renderer.value=o,this._renderer.value.onRequestRedraw((c=>this.refreshRows(c.start,c.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,c;this._renderer.value&&((c=(o=this._renderer.value).clearTextureAtlas)===null||c===void 0||c.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(o,c))):this._renderer.value.handleResize(o,c),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)===null||o===void 0||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)===null||o===void 0||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)===null||o===void 0||o.handleFocus()}handleSelectionChanged(o,c,v){var m;this._selectionState.start=o,this._selectionState.end=c,this._selectionState.columnSelectMode=v,(m=this._renderer.value)===null||m===void 0||m.handleSelectionChanged(o,c,v)}handleCursorMove(){var o;(o=this._renderer.value)===null||o===void 0||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)===null||o===void 0||o.clear()}};r.RenderService=i=l([u(2,t.IOptionsService),u(3,p.ICharSizeService),u(4,t.IDecorationService),u(5,t.IBufferService),u(6,p.ICoreBrowserService),u(7,p.IThemeService)],i)},9312:function(I,r,a){var l=this&&this.__decorate||function(h,g,b,L){var y,k=arguments.length,x=k<3?g:L===null?L=Object.getOwnPropertyDescriptor(g,b):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,g,b,L);else for(var T=h.length-1;T>=0;T--)(y=h[T])&&(x=(k<3?y(x):k>3?y(g,b,x):y(g,b))||x);return k>3&&x&&Object.defineProperty(g,b,x),x},u=this&&this.__param||function(h,g){return function(b,L){g(b,L,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const n=a(9806),d=a(9504),f=a(456),p=a(4725),_=a(8460),e=a(844),s=a(6114),t=a(4841),i=a(511),o=a(2585),c="\xA0",v=new RegExp(c,"g");let m=r.SelectionService=class extends e.Disposable{constructor(h,g,b,L,y,k,x,T,O){super(),this._element=h,this._screenElement=g,this._linkifier=b,this._bufferService=L,this._coreService=y,this._mouseService=k,this._optionsService=x,this._renderService=T,this._coreBrowserService=O,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new i.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.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 f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const h=this._model.finalSelectionStart,g=this._model.finalSelectionEnd;return!(!h||!g||h[0]===g[0]&&h[1]===g[1])}get selectionText(){const h=this._model.finalSelectionStart,g=this._model.finalSelectionEnd;if(!h||!g)return"";const b=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(h[0]===g[0])return"";const y=h[0]<g[0]?h[0]:g[0],k=h[0]<g[0]?g[0]:h[0];for(let x=h[1];x<=g[1];x++){const T=b.translateBufferLineToString(x,!0,y,k);L.push(T)}}else{const y=h[1]===g[1]?g[0]:void 0;L.push(b.translateBufferLineToString(h[1],!0,h[0],y));for(let k=h[1]+1;k<=g[1]-1;k++){const x=b.lines.get(k),T=b.translateBufferLineToString(k,!0);x?.isWrapped?L[L.length-1]+=T:L.push(T)}if(h[1]!==g[1]){const k=b.lines.get(g[1]),x=b.translateBufferLineToString(g[1],!0,0,g[0]);k&&k.isWrapped?L[L.length-1]+=x:L.push(x)}}return L.map((y=>y.replace(v," "))).join(s.isWindows?`\r
5
+ WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=f,t.OscLinkProvider=f=i([v(0,p.IBufferService),v(1,p.IOptionsService),v(2,p.IOscLinkService)],f)},4852:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(_,i){this._renderCallback=_,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(_){return this._refreshCallbacks.push(_),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(_,i,v){this._rowCount=v,_=_!==void 0?_:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,_):_,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const _=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(_,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const _ of this._refreshCallbacks)_(0);this._refreshCallbacks=[]}}},4292:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(_,i=1e3){this._renderCallback=_,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(_,i,v){this._rowCount=v,_=_!==void 0?_:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,_):_,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;const o=performance.now();if(o-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=o,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=o-this._lastRefreshMs,f=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const _=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(_,i)}}},9302:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_ANSI_COLORS=void 0;const i=_(4103);t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const v=[i.css.toColor("#2e3436"),i.css.toColor("#cc0000"),i.css.toColor("#4e9a06"),i.css.toColor("#c4a000"),i.css.toColor("#3465a4"),i.css.toColor("#75507b"),i.css.toColor("#06989a"),i.css.toColor("#d3d7cf"),i.css.toColor("#555753"),i.css.toColor("#ef2929"),i.css.toColor("#8ae234"),i.css.toColor("#fce94f"),i.css.toColor("#729fcf"),i.css.toColor("#ad7fa8"),i.css.toColor("#34e2e2"),i.css.toColor("#eeeeec")],o=[0,95,135,175,215,255];for(let p=0;p<216;p++){const f=o[p/36%6|0],g=o[p/6%6|0],c=o[p%6];v.push({css:i.channels.toCss(f,g,c),rgba:i.channels.toRgba(f,g,c)})}for(let p=0;p<24;p++){const f=8+10*p;v.push({css:i.channels.toCss(f,f,f),rgba:i.channels.toRgba(f,f,f)})}return v})())},4017:function(W,t,_){var i=this&&this.__decorate||function(e,r,a,d){var u,l=arguments.length,m=l<3?r:d===null?d=Object.getOwnPropertyDescriptor(r,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(e,r,a,d);else for(var C=e.length-1;C>=0;C--)(u=e[C])&&(m=(l<3?u(m):l>3?u(r,a,m):u(r,a))||m);return l>3&&m&&Object.defineProperty(r,a,m),m},v=this&&this.__param||function(e,r){return function(a,d){r(a,d,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const o=_(7098),p=_(7150),f=_(6501),g=_(7093),c=_(8234),n=_(802),h=_(9881);let s=class extends p.Disposable{constructor(e,r,a,d,u,l,m,C){super(),this._bufferService=a,this._optionsService=m,this._renderService=C,this._onRequestScrollLines=this._register(new n.Emitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;const y=this._register(new h.Scrollable({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:b=>(0,g.scheduleAtNextAnimationFrame)(d.window,b)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",(()=>{y.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)}))),this._scrollableElement=this._register(new c.SmoothScrollableElement(r,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},y)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],(()=>this._scrollableElement.updateOptions(this._getChangeOptions())))),this._register(u.onProtocolChange((b=>{this._scrollableElement.updateOptions({handleMouseWheel:!(16&b)})}))),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(n.Event.runAndSubscribe(l.onChangeColors,(()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css}))),e.appendChild(this._scrollableElement.getDomNode()),this._register((0,p.toDisposable)((()=>this._scrollableElement.getDomNode().remove()))),this._styleElement=d.mainDocument.createElement("style"),r.appendChild(this._styleElement),this._register((0,p.toDisposable)((()=>this._styleElement.remove()))),this._register(n.Event.runAndSubscribe(l.onChangeColors,(()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
6
+ `)}))),this._register(this._bufferService.onResize((()=>this.queueSync()))),this._register(this._bufferService.buffers.onBufferActivate((()=>{this._latestYDisp=void 0,this.queueSync()}))),this._register(this._bufferService.onScroll((()=>this._sync()))),this._register(this._scrollableElement.onScroll((b=>this._handleScroll(b))))}scrollLines(e){const r=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:r.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,r){r&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!r,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback((()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)})))}_sync(e=this._bufferService.buffer.ydisp){this._renderService&&!this._isSyncing&&(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;const r=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),a=r-this._bufferService.buffer.ydisp;a!==0&&(this._latestYDisp=r,this._onRequestScrollLines.fire(a)),this._isHandlingScroll=!1}};t.Viewport=s,t.Viewport=s=i([v(2,f.IBufferService),v(3,o.ICoreBrowserService),v(4,f.ICoreMouseService),v(5,o.IThemeService),v(6,f.IOptionsService),v(7,o.IRenderService)],s)},4196:function(W,t,_){var i=this&&this.__decorate||function(c,n,h,s){var e,r=arguments.length,a=r<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,h):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(c,n,h,s);else for(var d=c.length-1;d>=0;d--)(e=c[d])&&(a=(r<3?e(a):r>3?e(n,h,a):e(n,h))||a);return r>3&&a&&Object.defineProperty(n,h,a),a},v=this&&this.__param||function(c,n){return function(h,s){n(h,s,c)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const o=_(7098),p=_(7150),f=_(6501);let g=class extends p.Disposable{constructor(c,n,h,s,e){super(),this._screenElement=c,this._bufferService=n,this._coreBrowserService=h,this._decorationService=s,this._renderService=e,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this._register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this._register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this._register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this._register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this._register(this._decorationService.onDecorationRemoved((r=>this._removeDecoration(r)))),this._register((0,p.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 c of this._decorationService.decorations)this._renderDecoration(c);this._dimensionsChanged=!1}_renderDecoration(c){this._refreshStyle(c),this._dimensionsChanged&&this._refreshXPosition(c)}_createElement(c){const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",c?.options?.layer==="top"),n.style.width=`${Math.round((c.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(c.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(c.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=c.options.x??0;return h&&h>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(c,n),n}_refreshStyle(c){const n=c.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)c.element&&(c.element.style.display="none",c.onRenderEmitter.fire(c.element));else{let h=this._decorationElements.get(c);h||(h=this._createElement(c),c.element=h,this._decorationElements.set(c,h),this._container.appendChild(h),c.onDispose((()=>{this._decorationElements.delete(c),h.remove()}))),h.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(h.style.width=`${Math.round((c.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(c.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=n*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),c.onRenderEmitter.fire(h)}}_refreshXPosition(c,n=c.element){if(!n)return;const h=c.options.x??0;(c.options.anchor||"left")==="right"?n.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(c){this._decorationElements.get(c)?.remove(),this._decorationElements.delete(c),c.dispose()}};t.BufferDecorationRenderer=g,t.BufferDecorationRenderer=g=i([v(1,f.IBufferService),v(2,o.ICoreBrowserService),v(3,f.IDecorationService),v(4,o.IRenderService)],g)},957:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(_){if(_.options.overviewRulerOptions){for(const i of this._zones)if(i.color===_.options.overviewRulerOptions.color&&i.position===_.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,_.marker.line))return;if(this._lineAdjacentToZone(i,_.marker.line,_.options.overviewRulerOptions.position))return void this._addLineToZone(i,_.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=_.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=_.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=_.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=_.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:_.options.overviewRulerOptions.color,position:_.options.overviewRulerOptions.position,startBufferLine:_.marker.line,endBufferLine:_.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(_){this._linePadding=_}_lineIntersectsZone(_,i){return i>=_.startBufferLine&&i<=_.endBufferLine}_lineAdjacentToZone(_,i,v){return i>=_.startBufferLine-this._linePadding[v||"full"]&&i<=_.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(_,i){_.startBufferLine=Math.min(_.startBufferLine,i),_.endBufferLine=Math.max(_.endBufferLine,i)}}},9925:function(W,t,_){var i=this&&this.__decorate||function(e,r,a,d){var u,l=arguments.length,m=l<3?r:d===null?d=Object.getOwnPropertyDescriptor(r,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(e,r,a,d);else for(var C=e.length-1;C>=0;C--)(u=e[C])&&(m=(l<3?u(m):l>3?u(r,a,m):u(r,a))||m);return l>3&&m&&Object.defineProperty(r,a,m),m},v=this&&this.__param||function(e,r){return function(a,d){r(a,d,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const o=_(957),p=_(7098),f=_(7150),g=_(6501),c={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let s=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRuler?.width||0}constructor(e,r,a,d,u,l,m,C){super(),this._viewportElement=e,this._screenElement=r,this._bufferService=a,this._decorationService=d,this._renderService=u,this._optionsService=l,this._themeService=m,this._coreBrowserService=C,this._colorZoneStore=new o.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register((0,f.toDisposable)((()=>this._canvas?.remove())));const y=this._canvas.getContext("2d");if(!y)throw new Error("Ctx cannot be null");this._ctx=y,this._register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this._register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0)))),this._register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this._register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this._register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))),this._register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this._register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",(()=>this._queueRefresh(!0)))),this._register(this._themeService.onChangeColors((()=>this._queueRefresh()))),this._queueRefresh(!0)}_refreshDrawConstants(){const e=Math.floor((this._canvas.width-1)/3),r=Math.ceil((this._canvas.width-1)/3);n.full=this._canvas.width,n.left=e,n.center=r,n.right=e,this._refreshDrawHeightConstants(),h.full=1,h.left=1,h.center=1+n.left,h.right=1+n.left+n.center}_refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowserService.dpr);const e=this._canvas.height/this._bufferService.buffer.lines.length,r=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);c.left=r,c.center=r,c.right=r}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const r of this._decorationService.decorations)this._colorZoneStore.addDecoration(r);this._ctx.lineWidth=1,this._renderRulerOutline();const e=this._colorZoneStore.zones;for(const r of e)r.position!=="full"&&this._renderColorZone(r);for(const r of e)r.position==="full"&&this._renderColorZone(r);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(h[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-c[e.position||"full"]/2),n[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[e.position||"full"]))}_queueRefresh(e,r){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=r||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=s,t.OverviewRulerRenderer=s=i([v(2,g.IBufferService),v(3,g.IDecorationService),v(4,p.IRenderService),v(5,g.IOptionsService),v(6,p.IThemeService),v(7,p.ICoreBrowserService)],s)},3618:function(W,t,_){var i=this&&this.__decorate||function(c,n,h,s){var e,r=arguments.length,a=r<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,h):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(c,n,h,s);else for(var d=c.length-1;d>=0;d--)(e=c[d])&&(a=(r<3?e(a):r>3?e(n,h,a):e(n,h))||a);return r>3&&a&&Object.defineProperty(n,h,a),a},v=this&&this.__param||function(c,n){return function(h,s){n(h,s,c)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const o=_(7098),p=_(6501),f=_(3534);let g=class{get isComposing(){return this._isComposing}constructor(c,n,h,s,e,r){this._textarea=c,this._compositionView=n,this._bufferService=h,this._optionsService=s,this._coreService=e,this._renderService=r,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(c){this._compositionView.textContent=c.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(c){if(this._isComposing||this._isSendingComposition){if(c.keyCode===20||c.keyCode===229||c.keyCode===16||c.keyCode===17||c.keyCode===18)return!1;this._finalizeComposition(!1)}return c.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(c){if(this._compositionView.classList.remove("active"),this._isComposing=!1,c){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(n.start,this._compositionPosition.start):this._textarea.value.substring(n.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const c=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,h=n.replace(c,"");this._dataAlreadySent=h,n.length>c.length?this._coreService.triggerDataEvent(h,!0):n.length<c.length?this._coreService.triggerDataEvent(`${f.C0.DEL}`,!0):n.length===c.length&&n!==c&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(c){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,e=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=e+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const r=this._compositionView.getBoundingClientRect();this._textarea.style.left=e+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(r.width,1)+"px",this._textarea.style.height=Math.max(r.height,1)+"px",this._textarea.style.lineHeight=r.height+"px"}c||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=g,t.CompositionHelper=g=i([v(2,p.IBufferService),v(3,p.IOptionsService),v(4,p.ICoreService),v(5,o.IRenderService)],g)},5251:(W,t)=>{function _(i,v,o){const p=o.getBoundingClientRect(),f=i.getComputedStyle(o),g=parseInt(f.getPropertyValue("padding-left")),c=parseInt(f.getPropertyValue("padding-top"));return[v.clientX-p.left-g,v.clientY-p.top-c]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoordsRelativeToElement=_,t.getCoords=function(i,v,o,p,f,g,c,n,h){if(!g)return;const s=_(i,v,o);return s?(s[0]=Math.ceil((s[0]+(h?c/2:0))/c),s[1]=Math.ceil(s[1]/n),s[0]=Math.min(Math.max(s[0],1),p+(h?1:0)),s[1]=Math.min(Math.max(s[1],1),f),s):void 0}},9686:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=function(n,h,s,e){const r=s.buffer.x,a=s.buffer.y;if(!s.buffer.hasScrollback)return(function(l,m,C,y,b,D){return v(m,y,b,D).length===0?"":c(f(l,m,l,m-o(m,b),!1,b).length,g("D",D))})(r,a,0,h,s,e)+v(a,h,s,e)+(function(l,m,C,y,b,D){let T;T=v(m,y,b,D).length>0?y-o(y,b):m;const P=y,M=(function(B,F,S,E,w,L){let O;return O=v(S,E,w,L).length>0?E-o(E,w):F,B<S&&O<=E||B>=S&&O<E?"C":"D"})(l,m,C,y,b,D);return c(f(l,T,C,P,M==="C",b).length,g(M,D))})(r,a,n,h,s,e);let d;if(a===h)return d=r>n?"D":"C",c(Math.abs(r-n),g(d,e));d=a>h?"D":"C";const u=Math.abs(a-h);return c((function(l,m){return m.cols-l})(a>h?n:r,s)+(u-1)*s.cols+1+((a>h?r:n)-1),g(d,e))};const i=_(3534);function v(n,h,s,e){const r=n-o(n,s),a=h-o(h,s),d=Math.abs(r-a)-(function(u,l,m){let C=0;const y=u-o(u,m),b=l-o(l,m);for(let D=0;D<Math.abs(y-b);D++){const T=p(u,l)==="A"?-1:1;m.buffer.lines.get(y+T*D)?.isWrapped&&C++}return C})(n,h,s);return c(d,g(p(n,h),e))}function o(n,h){let s=0,e=h.buffer.lines.get(n),r=e?.isWrapped;for(;r&&n>=0&&n<h.rows;)s++,e=h.buffer.lines.get(--n),r=e?.isWrapped;return s}function p(n,h){return n>h?"A":"B"}function f(n,h,s,e,r,a){let d=n,u=h,l="";for(;(d!==s||u!==e)&&u>=0&&u<a.buffer.lines.length;)d+=r?1:-1,r&&d>a.cols-1?(l+=a.buffer.translateBufferLineToString(u,!1,n,d),d=0,n=0,u++):!r&&d<0&&(l+=a.buffer.translateBufferLineToString(u,!1,0,n+1),d=a.cols-1,n=d,u--);return l+a.buffer.translateBufferLineToString(u,!1,n,d)}function g(n,h){const s=h?"O":"[";return i.C0.ESC+s+n}function c(n,h){n=Math.floor(n);let s="";for(let e=0;e<n;e++)s+=h;return s}},3955:function(W,t,_){var i=this&&this.__decorate||function(D,T,P,M){var B,F=arguments.length,S=F<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,P):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(D,T,P,M);else for(var E=D.length-1;E>=0;E--)(B=D[E])&&(S=(F<3?B(S):F>3?B(T,P,S):B(T,P))||S);return F>3&&S&&Object.defineProperty(T,P,S),S},v=this&&this.__param||function(D,T){return function(P,M){T(P,M,D)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const o=_(1433),p=_(2744),f=_(9176),g=_(6181),c=_(2274),n=_(7098),h=_(4103),s=_(7150),e=_(6501),r=_(802),a="xterm-dom-renderer-owner-",d="xterm-rows",u="xterm-fg-",l="xterm-bg-",m="xterm-focus",C="xterm-selection";let y=1,b=class extends s.Disposable{constructor(D,T,P,M,B,F,S,E,w,L,O,N,H,j){super(),this._terminal=D,this._document=T,this._element=P,this._screenElement=M,this._viewportElement=B,this._helperContainer=F,this._linkifier2=S,this._charSizeService=w,this._optionsService=L,this._bufferService=O,this._coreService=N,this._coreBrowserService=H,this._themeService=j,this._terminalClass=y++,this._rowElements=[],this._selectionRenderModel=(0,c.createSelectionRenderModel)(),this.onRequestRedraw=this._register(new r.Emitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(d),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(C),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this._register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this._register(this._themeService.onChangeColors((x=>this._injectCss(x)))),this._injectCss(this._themeService.colors),this._rowFactory=E.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(a+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline((x=>this._handleLinkHover(x)))),this._register(this._linkifier2.onHideLinkUnderline((x=>this._handleLinkLeave(x)))),this._register((0,s.toDisposable)((()=>{this._element.classList.remove(a+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const P of this._rowElements)P.style.width=`${this.dimensions.css.canvas.width}px`,P.style.height=`${this.dimensions.css.cell.height}px`,P.style.lineHeight=`${this.dimensions.css.cell.height}px`,P.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const T=`${this._terminalSelector} .${d} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=T,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let T=`${this._terminalSelector} .${d} { pointer-events: none; color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;T+=`${this._terminalSelector} .${d} .xterm-dim { color: ${h.color.multiplyOpacity(D.foreground,.5).css};}`,T+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const P=`blink_underline_${this._terminalClass}`,M=`blink_bar_${this._terminalClass}`,B=`blink_block_${this._terminalClass}`;T+=`@keyframes ${P} { 50% { border-bottom-style: hidden; }}`,T+=`@keyframes ${M} { 50% { box-shadow: none; }}`,T+=`@keyframes ${B} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,T+=`${this._terminalSelector} .${d}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${d}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${M} 1s step-end infinite;}${this._terminalSelector} .${d}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${d} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${d} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${d} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${d} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${d} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,T+=`${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[F,S]of D.ansi.entries())T+=`${this._terminalSelector} .${u}${F} { color: ${S.css}; }${this._terminalSelector} .${u}${F}.xterm-dim { color: ${h.color.multiplyOpacity(S,.5).css}; }${this._terminalSelector} .${l}${F} { background-color: ${S.css}; }`;T+=`${this._terminalSelector} .${u}${f.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(D.background).css}; }${this._terminalSelector} .${u}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${l}${f.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=T}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,T){for(let P=this._rowElements.length;P<=T;P++){const M=this._document.createElement("div");this._rowContainer.appendChild(M),this._rowElements.push(M)}for(;this._rowElements.length>T;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,T){this._refreshRowElements(D,T),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(m),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(m),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,T,P){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,T,P),this.renderRows(0,this._bufferService.rows-1),!D||!T||(this._selectionRenderModel.update(this._terminal,D,T,P),!this._selectionRenderModel.hasSelection))return;const M=this._selectionRenderModel.viewportStartRow,B=this._selectionRenderModel.viewportEndRow,F=this._selectionRenderModel.viewportCappedStartRow,S=this._selectionRenderModel.viewportCappedEndRow,E=this._document.createDocumentFragment();if(P){const w=D[0]>T[0];E.appendChild(this._createSelectionElement(F,w?T[0]:D[0],w?D[0]:T[0],S-F+1))}else{const w=M===F?D[0]:0,L=F===B?T[0]:this._bufferService.cols;E.appendChild(this._createSelectionElement(F,w,L));const O=S-F-1;if(E.appendChild(this._createSelectionElement(F+1,0,this._bufferService.cols,O)),F!==S){const N=B===S?T[0]:this._bufferService.cols;E.appendChild(this._createSelectionElement(S,0,N))}}this._selectionContainer.appendChild(E)}_createSelectionElement(D,T,P,M=1){const B=this._document.createElement("div"),F=T*this.dimensions.css.cell.width;let S=this.dimensions.css.cell.width*(P-T);return F+S>this.dimensions.css.canvas.width&&(S=this.dimensions.css.canvas.width-F),B.style.height=M*this.dimensions.css.cell.height+"px",B.style.top=D*this.dimensions.css.cell.height+"px",B.style.left=`${F}px`,B.style.width=`${S}px`,B}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const D of this._rowElements)D.replaceChildren()}renderRows(D,T){const P=this._bufferService.buffer,M=P.ybase+P.y,B=Math.min(P.x,this._bufferService.cols-1),F=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,S=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,E=this._optionsService.rawOptions.cursorInactiveStyle;for(let w=D;w<=T;w++){const L=w+P.ydisp,O=this._rowElements[w],N=P.lines.get(L);if(!O||!N)break;O.replaceChildren(...this._rowFactory.createRow(N,L,L===M,S,E,B,F,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${a}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,T,P,M,B,F){P<0&&(D=0),M<0&&(T=0);const S=this._bufferService.rows-1;P=Math.max(Math.min(P,S),0),M=Math.max(Math.min(M,S),0),B=Math.min(B,this._bufferService.cols);const E=this._bufferService.buffer,w=E.ybase+E.y,L=Math.min(E.x,B-1),O=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,H=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=P;j<=M;++j){const x=j+E.ydisp,k=this._rowElements[j],V=E.lines.get(x);if(!k||!V)break;k.replaceChildren(...this._rowFactory.createRow(V,x,x===w,N,H,L,O,this.dimensions.css.cell.width,this._widthCache,F?j===P?D:0:-1,F?(j===M?T:B)-1:-1))}}};t.DomRenderer=b,t.DomRenderer=b=i([v(7,e.IInstantiationService),v(8,n.ICharSizeService),v(9,e.IOptionsService),v(10,e.IBufferService),v(11,e.ICoreService),v(12,n.ICoreBrowserService),v(13,n.IThemeService)],b)},1433:function(W,t,_){var i=this&&this.__decorate||function(d,u,l,m){var C,y=arguments.length,b=y<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,l):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(d,u,l,m);else for(var D=d.length-1;D>=0;D--)(C=d[D])&&(b=(y<3?C(b):y>3?C(u,l,b):C(u,l))||b);return y>3&&b&&Object.defineProperty(u,l,b),b},v=this&&this.__param||function(d,u){return function(l,m){u(l,m,d)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const o=_(9176),p=_(8938),f=_(3055),g=_(6501),c=_(4103),n=_(7098),h=_(945),s=_(6181),e=_(5451);let r=class{constructor(d,u,l,m,C,y,b){this._document=d,this._characterJoinerService=u,this._optionsService=l,this._coreBrowserService=m,this._coreService=C,this._decorationService=y,this._themeService=b,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(d,u,l){this._selectionStart=d,this._selectionEnd=u,this._columnSelectMode=l}createRow(d,u,l,m,C,y,b,D,T,P,M){const B=[],F=this._characterJoinerService.getJoinedCharacters(u),S=this._themeService.colors;let E,w=d.getNoBgTrimmedLength();l&&w<y+1&&(w=y+1);let L=0,O="",N=0,H=0,j=0,x=0,k=!1,V=0,z=!1,G=0,q=0;const J=[],se=P!==-1&&M!==-1;for(let ie=0;ie<w;ie++){d.loadCell(ie,this._workCell);let re=this._workCell.getWidth();if(re===0)continue;let ae=!1,ge=ie>=q,be=ie,ee=this._workCell;if(F.length>0&&ie===F[0][0]&&ge){const te=F.shift(),Re=this._isCellInSelection(te[0],u);for(N=te[0]+1;N<te[1];N++)ge&&=Re===this._isCellInSelection(N,u);ge&&=!l||y<te[0]||y>=te[1],ge?(ae=!0,ee=new h.JoinedCellData(this._workCell,d.translateToString(!0,te[0],te[1]),te[1]-te[0]),be=te[1]-1,re=ee.getWidth()):q=te[1]}const me=this._isCellInSelection(ie,u),Ae=l&&ie===y,he=se&&ie>=P&&ie<=M;let ve=!1;this._decorationService.forEachDecorationAtCell(ie,u,void 0,(te=>{ve=!0}));let Ce=ee.getChars()||p.WHITESPACE_CELL_CHAR;if(Ce===" "&&(ee.isUnderline()||ee.isOverline())&&(Ce="\xA0"),G=re*D-T.get(Ce,ee.isBold(),ee.isItalic()),E){if(L&&(me&&z||!me&&!z&&ee.bg===H)&&(me&&z&&S.selectionForeground||ee.fg===j)&&ee.extended.ext===x&&he===k&&G===V&&!Ae&&!ae&&!ve&&ge){ee.isInvisible()?O+=p.WHITESPACE_CELL_CHAR:O+=Ce,L++;continue}L&&(E.textContent=O),E=this._document.createElement("span"),L=0,O=""}else E=this._document.createElement("span");if(H=ee.bg,j=ee.fg,x=ee.extended.ext,k=he,V=G,z=me,ae&&y>=ie&&y<=be&&(y=ie),!this._coreService.isCursorHidden&&Ae&&this._coreService.isCursorInitialized){if(J.push("xterm-cursor"),this._coreBrowserService.isFocused)b&&J.push("xterm-cursor-blink"),J.push(m==="bar"?"xterm-cursor-bar":m==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(C)switch(C){case"outline":J.push("xterm-cursor-outline");break;case"block":J.push("xterm-cursor-block");break;case"bar":J.push("xterm-cursor-bar");break;case"underline":J.push("xterm-cursor-underline")}}if(ee.isBold()&&J.push("xterm-bold"),ee.isItalic()&&J.push("xterm-italic"),ee.isDim()&&J.push("xterm-dim"),O=ee.isInvisible()?p.WHITESPACE_CELL_CHAR:ee.getChars()||p.WHITESPACE_CELL_CHAR,ee.isUnderline()&&(J.push(`xterm-underline-${ee.extended.underlineStyle}`),O===" "&&(O="\xA0"),!ee.isUnderlineColorDefault()))if(ee.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${e.AttributeData.toColorRGB(ee.getUnderlineColor()).join(",")})`;else{let te=ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ee.isBold()&&te<8&&(te+=8),E.style.textDecorationColor=S.ansi[te].css}ee.isOverline()&&(J.push("xterm-overline"),O===" "&&(O="\xA0")),ee.isStrikethrough()&&J.push("xterm-strikethrough"),he&&(E.style.textDecoration="underline");let oe=ee.getFgColor(),de=ee.getFgColorMode(),le=ee.getBgColor(),Se=ee.getBgColorMode();const De=!!ee.isInverse();if(De){const te=oe;oe=le,le=te;const Re=de;de=Se,Se=Re}let ue,ye,_e,fe=!1;switch(this._decorationService.forEachDecorationAtCell(ie,u,void 0,(te=>{te.options.layer!=="top"&&fe||(te.backgroundColorRGB&&(Se=50331648,le=te.backgroundColorRGB.rgba>>8&16777215,ue=te.backgroundColorRGB),te.foregroundColorRGB&&(de=50331648,oe=te.foregroundColorRGB.rgba>>8&16777215,ye=te.foregroundColorRGB),fe=te.options.layer==="top")})),!fe&&me&&(ue=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,le=ue.rgba>>8&16777215,Se=50331648,fe=!0,S.selectionForeground&&(de=50331648,oe=S.selectionForeground.rgba>>8&16777215,ye=S.selectionForeground)),fe&&J.push("xterm-decoration-top"),Se){case 16777216:case 33554432:_e=S.ansi[le],J.push(`xterm-bg-${le}`);break;case 50331648:_e=c.channels.toColor(le>>16,le>>8&255,255&le),this._addStyle(E,`background-color:#${a((le>>>0).toString(16),"0",6)}`);break;default:De?(_e=S.foreground,J.push(`xterm-bg-${o.INVERTED_DEFAULT_COLOR}`)):_e=S.background}switch(ue||ee.isDim()&&(ue=c.color.multiplyOpacity(_e,.5)),de){case 16777216:case 33554432:ee.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(E,_e,S.ansi[oe],ee,ue,void 0)||J.push(`xterm-fg-${oe}`);break;case 50331648:const te=c.channels.toColor(oe>>16&255,oe>>8&255,255&oe);this._applyMinimumContrast(E,_e,te,ee,ue,ye)||this._addStyle(E,`color:#${a(oe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(E,_e,S.foreground,ee,ue,ye)||De&&J.push(`xterm-fg-${o.INVERTED_DEFAULT_COLOR}`)}J.length&&(E.className=J.join(" "),J.length=0),Ae||ae||ve||!ge?E.textContent=O:L++,G!==this.defaultSpacing&&(E.style.letterSpacing=`${G}px`),B.push(E),ie=be}return E&&L&&(E.textContent=O),B}_applyMinimumContrast(d,u,l,m,C,y){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(m.getCode()))return!1;const b=this._getContrastCache(m);let D;if(C||y||(D=b.getColor(u.rgba,l.rgba)),D===void 0){const T=this._optionsService.rawOptions.minimumContrastRatio/(m.isDim()?2:1);D=c.color.ensureContrastRatio(C||u,y||l,T),b.setColor((C||u).rgba,(y||l).rgba,D??null)}return!!D&&(this._addStyle(d,`color:${D.css}`),!0)}_getContrastCache(d){return d.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(d,u){d.setAttribute("style",`${d.getAttribute("style")||""}${u};`)}_isCellInSelection(d,u){const l=this._selectionStart,m=this._selectionEnd;return!(!l||!m)&&(this._columnSelectMode?l[0]<=m[0]?d>=l[0]&&u>=l[1]&&d<m[0]&&u<=m[1]:d<l[0]&&u>=l[1]&&d>=m[0]&&u<=m[1]:u>l[1]&&u<m[1]||l[1]===m[1]&&u===l[1]&&d>=l[0]&&d<m[0]||l[1]<m[1]&&u===m[1]&&d<m[0]||l[1]<m[1]&&u===l[1]&&d>=l[0])}};function a(d,u,l){for(;d.length<l;)d=u+d;return d}t.DomRendererRowFactory=r,t.DomRendererRowFactory=r=i([v(1,n.ICharacterJoinerService),v(2,g.IOptionsService),v(3,n.ICoreBrowserService),v(4,g.ICoreService),v(5,g.IDecorationService),v(6,n.IThemeService)],r)},2744:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(_,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=_.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const v=_.createElement("span");v.classList.add("xterm-char-measure-element");const o=_.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold";const p=_.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const f=_.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[v,o,p,f],this._container.appendChild(v),this._container.appendChild(o),this._container.appendChild(p),this._container.appendChild(f),i.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(_,i,v,o){_===this._font&&i===this._fontSize&&v===this._weight&&o===this._weightBold||(this._font=_,this._fontSize=i,this._weight=v,this._weightBold=o,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${o}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${o}`,this.clear())}get(_,i,v){let o=0;if(!i&&!v&&_.length===1&&(o=_.charCodeAt(0))<256){if(this._flat[o]!==-9999)return this._flat[o];const g=this._measure(_,0);return g>0&&(this._flat[o]=g),g}let p=_;i&&(p+="B"),v&&(p+="I");let f=this._holey.get(p);if(f===void 0){let g=0;i&&(g|=1),v&&(g|=2),f=this._measure(_,g),f>0&&this._holey.set(p,f)}return f}_measure(_,i){const v=this._measureElements[i];return v.textContent=_.repeat(32),v.offsetWidth/32}}},9176:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVERTED_DEFAULT_COLOR=void 0,t.INVERTED_DEFAULT_COLOR=257},6181:(W,t)=>{function _(v){return 57508<=v&&v<=57558}function i(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},t.isPowerlineGlyph=_,t.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},t.isEmoji=i,t.allowRescaling=function(v,o,p,f){return o===1&&p>Math.ceil(1.5*f)&&v!==void 0&&v>255&&!i(v)&&!_(v)&&!(function(g){return 57344<=g&&g<=63743})(v)},t.treatGlyphAsBackgroundColor=function(v){return _(v)||(function(o){return 9472<=o&&o<=9631})(v)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(v,o,p=0){return(v-(2*Math.round(o)-p))%(2*Math.round(o))}},2274:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=function(){return new _};class _{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,o,p,f=!1){if(this.selectionStart=o,this.selectionEnd=p,!o||!p||o[0]===p[0]&&o[1]===p[1])return void this.clear();const g=v.buffers.active.ydisp,c=o[1]-g,n=p[1]-g,h=Math.max(c,0),s=Math.min(n,v.rows-1);h>=v.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=c,this.viewportEndRow=n,this.viewportCappedStartRow=h,this.viewportCappedEndRow=s,this.startCol=o[0],this.endCol=p[0])}isCellSelected(v,o,p){return!!this.hasSelection&&(p-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&p>=this.viewportCappedStartRow&&o<this.endCol&&p<=this.viewportCappedEndRow:o<this.startCol&&p>=this.viewportCappedStartRow&&o>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&o>=this.startCol)}}},5959:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(_){this._bufferService=_,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 _=this.selectionStart[0]+this.selectionStartLength;return _>this._bufferService.cols?_%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(_/this._bufferService.cols)-1]:[_%this._bufferService.cols,this.selectionStart[1]+Math.floor(_/this._bufferService.cols)]:[_,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const _=this.selectionStart[0]+this.selectionStartLength;return _>this._bufferService.cols?[_%this._bufferService.cols,this.selectionStart[1]+Math.floor(_/this._bufferService.cols)]:[Math.max(_,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const _=this.selectionStart,i=this.selectionEnd;return!(!_||!i)&&(_[1]>i[1]||_[1]===i[1]&&_[0]>i[0])}handleTrim(_){return this.selectionStart&&(this.selectionStart[1]-=_),this.selectionEnd&&(this.selectionEnd[1]-=_),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},4792:function(W,t,_){var i=this&&this.__decorate||function(s,e,r,a){var d,u=arguments.length,l=u<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,e,r,a);else for(var m=s.length-1;m>=0;m--)(d=s[m])&&(l=(u<3?d(l):u>3?d(e,r,l):d(e,r))||l);return u>3&&l&&Object.defineProperty(e,r,l),l},v=this&&this.__param||function(s,e){return function(r,a){e(r,a,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const o=_(6501),p=_(7150),f=_(802);let g=class extends p.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,e,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new f.Emitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new h(this._optionsService))}catch{this._measureStrategy=this._register(new n(s,e,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};t.CharSizeService=g,t.CharSizeService=g=i([v(2,o.IOptionsService)],g);class c extends p.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,r){e!==void 0&&e>0&&r!==void 0&&r>0&&(this._result.width=e,this._result.height=r)}}class n extends c{constructor(e,r,a){super(),this._document=e,this._parentElement=r,this._optionsService=a,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class h extends c{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const r=this._ctx.measureText("W");if(!("width"in r&&"fontBoundingBoxAscent"in r&&"fontBoundingBoxDescent"in r))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}}},945:function(W,t,_){var i,v=this&&this.__decorate||function(s,e,r,a){var d,u=arguments.length,l=u<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,e,r,a);else for(var m=s.length-1;m>=0;m--)(d=s[m])&&(l=(u<3?d(l):u>3?d(e,r,l):d(e,r))||l);return u>3&&l&&Object.defineProperty(e,r,l),l},o=this&&this.__param||function(s,e){return function(r,a){e(r,a,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const p=_(5451),f=_(8938),g=_(3055),c=_(6501);class n extends p.AttributeData{constructor(e,r,a){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=r,this._width=a}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=n;let h=i=class{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(s){const e={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(e),e.id}deregister(s){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===s)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const e=this._bufferService.buffer.lines.get(s);if(!e||e.length===0)return[];const r=[],a=e.translateToString(!0);let d=0,u=0,l=0,m=e.getFg(0),C=e.getBg(0);for(let y=0;y<e.getTrimmedLength();y++)if(e.loadCell(y,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==m||this._workCell.bg!==C){if(y-d>1){const b=this._getJoinedRanges(a,l,u,e,d);for(let D=0;D<b.length;D++)r.push(b[D])}d=y,l=u,m=this._workCell.fg,C=this._workCell.bg}u+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-d>1){const y=this._getJoinedRanges(a,l,u,e,d);for(let b=0;b<y.length;b++)r.push(y[b])}return r}_getJoinedRanges(s,e,r,a,d){const u=s.substring(e,r);let l=[];try{l=this._characterJoiners[0].handler(u)}catch(m){console.error(m)}for(let m=1;m<this._characterJoiners.length;m++)try{const C=this._characterJoiners[m].handler(u);for(let y=0;y<C.length;y++)i._mergeRanges(l,C[y])}catch(C){console.error(C)}return this._stringRangesToCellRanges(l,a,d),l}_stringRangesToCellRanges(s,e,r){let a=0,d=!1,u=0,l=s[a];if(l){for(let m=r;m<this._bufferService.cols;m++){const C=e.getWidth(m),y=e.getString(m).length||f.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!d&&l[0]<=u&&(l[0]=m,d=!0),l[1]<=u){if(l[1]=m,l=s[++a],!l)break;l[0]<=u?(l[0]=m,d=!0):d=!1}u+=y}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(s,e){let r=!1;for(let a=0;a<s.length;a++){const d=s[a];if(r){if(e[1]<=d[0])return s[a-1][1]=e[1],s;if(e[1]<=d[1])return s[a-1][1]=Math.max(e[1],d[1]),s.splice(a,1),s;s.splice(a,1),a--}else{if(e[1]<=d[0])return s.splice(a,0,e),s;if(e[1]<=d[1])return d[0]=Math.min(e[0],d[0]),s;e[0]<d[1]&&(d[0]=Math.min(e[0],d[0]),r=!0)}}return r?s[s.length-1][1]=e[1]:s.push(e),s}};t.CharacterJoinerService=h,t.CharacterJoinerService=h=i=v([o(0,c.IBufferService)],h)},9574:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const i=_(802),v=_(7093),o=_(7150);class p extends o.Disposable{constructor(c,n,h){super(),this._textarea=c,this._window=n,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new f(this._window)),this._onDprChange=this._register(new i.Emitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new i.Emitter),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange((s=>this._screenDprMonitor.setWindow(s)))),this._register(i.Event.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register((0,v.addDisposableListener)(this._textarea,"focus",(()=>this._isFocused=!0))),this._register((0,v.addDisposableListener)(this._textarea,"blur",(()=>this._isFocused=!1)))}get window(){return this._window}set window(c){this._window!==c&&(this._window=c,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}t.CoreBrowserService=p;class f extends o.Disposable{constructor(c){super(),this._parentWindow=c,this._windowResizeListener=this._register(new o.MutableDisposable),this._onDprChange=this._register(new i.Emitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register((0,o.toDisposable)((()=>this.clearListener())))}setWindow(c){this._parentWindow=c,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,v.addDisposableListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},9820:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const i=_(7150);class v extends i.Disposable{constructor(){super(),this.linkProviders=[],this._register((0,i.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const f=this.linkProviders.indexOf(p);f!==-1&&this.linkProviders.splice(f,1)}}}}t.LinkProviderService=v},9784:function(W,t,_){var i=this&&this.__decorate||function(g,c,n,h){var s,e=arguments.length,r=e<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,n):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(g,c,n,h);else for(var a=g.length-1;a>=0;a--)(s=g[a])&&(r=(e<3?s(r):e>3?s(c,n,r):s(c,n))||r);return e>3&&r&&Object.defineProperty(c,n,r),r},v=this&&this.__param||function(g,c){return function(n,h){c(n,h,g)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const o=_(7098),p=_(5251);let f=class{constructor(g,c){this._renderService=g,this._charSizeService=c}getCoords(g,c,n,h,s){return(0,p.getCoords)(window,g,c,n,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(g,c){const n=(0,p.getCoordsRelativeToElement)(window,g,c);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};t.MouseService=f,t.MouseService=f=i([v(0,o.IRenderService),v(1,o.ICharSizeService)],f)},5783:function(W,t,_){var i=this&&this.__decorate||function(e,r,a,d){var u,l=arguments.length,m=l<3?r:d===null?d=Object.getOwnPropertyDescriptor(r,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(e,r,a,d);else for(var C=e.length-1;C>=0;C--)(u=e[C])&&(m=(l<3?u(m):l>3?u(r,a,m):u(r,a))||m);return l>3&&m&&Object.defineProperty(r,a,m),m},v=this&&this.__param||function(e,r){return function(a,d){r(a,d,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const o=_(4852),p=_(7098),f=_(7150),g=_(6168),c=_(6501),n=_(802);let h=class extends f.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,r,a,d,u,l,m,C,y){super(),this._rowCount=e,this._optionsService=a,this._charSizeService=d,this._coreService=u,this._coreBrowserService=C,this._renderer=this._register(new f.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._observerDisposable=this._register(new f.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new n.Emitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new n.Emitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new n.Emitter),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new n.Emitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o.RenderDebouncer(((b,D)=>this._renderRows(b,D)),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new s(this._coreBrowserService,this._coreService,(()=>this._fullRefresh())),this._register((0,f.toDisposable)((()=>this._syncOutputHandler.dispose()))),this._register(this._coreBrowserService.onDprChange((()=>this.handleDevicePixelRatioChange()))),this._register(m.onResize((()=>this._fullRefresh()))),this._register(m.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this._register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this._register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this._register(l.onDecorationRegistered((()=>this._fullRefresh()))),this._register(l.onDecorationRemoved((()=>this._fullRefresh()))),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(m.cols,m.rows),this._fullRefresh()}))),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(m.buffer.y,m.buffer.y,!0)))),this._register(y.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(this._coreBrowserService.window,r),this._register(this._coreBrowserService.onWindowChange((b=>this._registerIntersectionObserver(b,r))))}_registerIntersectionObserver(e,r){if("IntersectionObserver"in e){const a=new e.IntersectionObserver((d=>this._handleIntersectionChange(d[d.length-1])),{threshold:0});a.observe(r),this._observerDisposable.value=(0,f.toDisposable)((()=>a.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,r,a=!1){if(this._isPaused)return void(this._needsFullRefresh=!0);if(this._coreService.decPrivateModes.synchronizedOutput)return void this._syncOutputHandler.bufferRows(e,r);const d=this._syncOutputHandler.flush();d&&(e=Math.min(e,d.start),r=Math.max(r,d.end)),a||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,r,this._rowCount)}_renderRows(e,r){this._renderer.value&&(this._coreService.decPrivateModes.synchronizedOutput?this._syncOutputHandler.bufferRows(e,r):(e=Math.min(e,this._rowCount-1),r=Math.min(r,this._rowCount-1),this._renderer.value.renderRows(e,r),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:r}),this._onRender.fire({start:e,end:r}),this._isNextRenderRedrawOnly=!0))}resize(e,r){this._rowCount=r,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((r=>this.refreshRows(r.start,r.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,r){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(e,r))):this._renderer.value.handleResize(e,r),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,r,a){this._selectionState.start=e,this._selectionState.end=r,this._selectionState.columnSelectMode=a,this._renderer.value?.handleSelectionChanged(e,r,a)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};t.RenderService=h,t.RenderService=h=i([v(2,c.IOptionsService),v(3,p.ICharSizeService),v(4,c.ICoreService),v(5,c.IDecorationService),v(6,c.IBufferService),v(7,p.ICoreBrowserService),v(8,p.IThemeService)],h);class s{constructor(r,a,d){this._coreBrowserService=r,this._coreService=a,this._onTimeout=d,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(r,a){this._isBuffering?(this._start=Math.min(this._start,r),this._end=Math.max(this._end,a)):(this._start=r,this._end=a,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout((()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()}),1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;const r={start:this._start,end:this._end};return this._isBuffering=!1,r}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}}},2079:function(W,t,_){var i=this&&this.__decorate||function(l,m,C,y){var b,D=arguments.length,T=D<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,C):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(l,m,C,y);else for(var P=l.length-1;P>=0;P--)(b=l[P])&&(T=(D<3?b(T):D>3?b(m,C,T):b(m,C))||T);return D>3&&T&&Object.defineProperty(m,C,T),T},v=this&&this.__param||function(l,m){return function(C,y){m(C,y,l)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const o=_(5251),p=_(9686),f=_(5959),g=_(7098),c=_(7150),n=_(701),h=_(9384),s=_(3055),e=_(6501),r=_(802),a="\xA0",d=new RegExp(a,"g");let u=class extends c.Disposable{constructor(l,m,C,y,b,D,T,P,M){super(),this._element=l,this._screenElement=m,this._linkifier=C,this._bufferService=y,this._coreService=b,this._mouseService=D,this._optionsService=T,this._renderService=P,this._coreBrowserService=M,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new s.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new r.Emitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new r.Emitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new r.Emitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new r.Emitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=B=>this._handleMouseMove(B),this._mouseUpListener=B=>this._handleMouseUp(B),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((B=>this._handleTrim(B))),this._register(this._bufferService.buffers.onBufferActivate((B=>this._handleBufferActivate(B)))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this._register((0,c.toDisposable)((()=>{this._removeMouseDownListeners()}))),this._register(this._bufferService.onResize((B=>{B.rowsChanged&&this.clearSelection()})))}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,m=this._model.finalSelectionEnd;return!(!l||!m||l[0]===m[0]&&l[1]===m[1])}get selectionText(){const l=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;if(!l||!m)return"";const C=this._bufferService.buffer,y=[];if(this._activeSelectionMode===3){if(l[0]===m[0])return"";const b=l[0]<m[0]?l[0]:m[0],D=l[0]<m[0]?m[0]:l[0];for(let T=l[1];T<=m[1];T++){const P=C.translateBufferLineToString(T,!0,b,D);y.push(P)}}else{const b=l[1]===m[1]?m[0]:void 0;y.push(C.translateBufferLineToString(l[1],!0,l[0],b));for(let D=l[1]+1;D<=m[1]-1;D++){const T=C.lines.get(D),P=C.translateBufferLineToString(D,!0);T?.isWrapped?y[y.length-1]+=P:y.push(P)}if(l[1]!==m[1]){const D=C.lines.get(m[1]),T=C.translateBufferLineToString(m[1],!0,0,m[0]);D&&D.isWrapped?y[y.length-1]+=T:y.push(T)}}return y.map((b=>b.replace(d," "))).join(n.isWindows?`\r
6
7
  `:`
7
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(h){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),s.isLinux&&h&&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(h){const g=this._getMouseBufferCoords(h),b=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(b&&L&&g)&&this._areCoordsInSelection(g,b,L)}isCellInSelection(h,g){const b=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!b||!L)&&this._areCoordsInSelection([h,g],b,L)}_areCoordsInSelection(h,g,b){return h[1]>g[1]&&h[1]<b[1]||g[1]===b[1]&&h[1]===g[1]&&h[0]>=g[0]&&h[0]<b[0]||g[1]<b[1]&&h[1]===b[1]&&h[0]<b[0]||g[1]<b[1]&&h[1]===g[1]&&h[0]>=g[0]}_selectWordAtCursor(h,g){var b,L;const y=(L=(b=this._linkifier.currentLink)===null||b===void 0?void 0:b.link)===null||L===void 0?void 0:L.range;if(y)return this._model.selectionStart=[y.start.x-1,y.start.y-1],this._model.selectionStartLength=(0,t.getRangeLength)(y,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(h);return!!k&&(this._selectWordAt(k,g),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(h,g){this._model.clearSelection(),h=Math.max(h,0),g=Math.min(g,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,h],this._model.selectionEnd=[this._bufferService.cols,g],this.refresh(),this._onSelectionChange.fire()}_handleTrim(h){this._model.handleTrim(h)&&this.refresh()}_getMouseBufferCoords(h){const g=this._mouseService.getCoords(h,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(g)return g[0]--,g[1]--,g[1]+=this._bufferService.buffer.ydisp,g}_getMouseEventScrollAmount(h){let g=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,h,this._screenElement)[1];const b=this._renderService.dimensions.css.canvas.height;return g>=0&&g<=b?0:(g>b&&(g-=b),g=Math.min(Math.max(g,-50),50),g/=50,g/Math.abs(g)+Math.round(14*g))}shouldForceSelection(h){return s.isMac?h.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:h.shiftKey}handleMouseDown(h){if(this._mouseDownTimeStamp=h.timeStamp,(h.button!==2||!this.hasSelection)&&h.button===0){if(!this._enabled){if(!this.shouldForceSelection(h))return;h.stopPropagation()}h.preventDefault(),this._dragScrollAmount=0,this._enabled&&h.shiftKey?this._handleIncrementalClick(h):h.detail===1?this._handleSingleClick(h):h.detail===2?this._handleDoubleClick(h):h.detail===3&&this._handleTripleClick(h),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(h){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(h))}_handleSingleClick(h){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(h)?3:0,this._model.selectionStart=this._getMouseBufferCoords(h),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const g=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);g&&g.length!==this._model.selectionStart[0]&&g.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(h){this._selectWordAtCursor(h,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(h){const g=this._getMouseBufferCoords(h);g&&(this._activeSelectionMode=2,this._selectLineAt(g[1]))}shouldColumnSelect(h){return h.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(h){if(h.stopImmediatePropagation(),!this._model.selectionStart)return;const g=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(h),!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(h),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const b=this._bufferService.buffer;if(this._model.selectionEnd[1]<b.lines.length){const L=b.lines.get(this._model.selectionEnd[1]);L&&L.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}g&&g[0]===this._model.selectionEnd[0]&&g[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const h=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(h.ydisp+this._bufferService.rows,h.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=h.ydisp),this.refresh()}}_handleMouseUp(h){const g=h.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&g<500&&h.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const b=this._mouseService.getCoords(h,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(b&&b[0]!==void 0&&b[1]!==void 0){const L=(0,d.moveToCellSequence)(b[0]-1,b[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const h=this._model.finalSelectionStart,g=this._model.finalSelectionEnd,b=!(!h||!g||h[0]===g[0]&&h[1]===g[1]);b?h&&g&&(this._oldSelectionStart&&this._oldSelectionEnd&&h[0]===this._oldSelectionStart[0]&&h[1]===this._oldSelectionStart[1]&&g[0]===this._oldSelectionEnd[0]&&g[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(h,g,b)):this._oldHasSelection&&this._fireOnSelectionChange(h,g,b)}_fireOnSelectionChange(h,g,b){this._oldSelectionStart=h,this._oldSelectionEnd=g,this._oldHasSelection=b,this._onSelectionChange.fire()}_handleBufferActivate(h){this.clearSelection(),this._trimListener.dispose(),this._trimListener=h.activeBuffer.lines.onTrim((g=>this._handleTrim(g)))}_convertViewportColToCharacterIndex(h,g){let b=g;for(let L=0;g>=L;L++){const y=h.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?b--:y>1&&g!==L&&(b+=y-1)}return b}setSelection(h,g,b){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[h,g],this._model.selectionStartLength=b,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(h){this._isClickInSelection(h)||(this._selectWordAtCursor(h,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(h,g,b=!0,L=!0){if(h[0]>=this._bufferService.cols)return;const y=this._bufferService.buffer,k=y.lines.get(h[1]);if(!k)return;const x=y.translateBufferLineToString(h[1],!1);let T=this._convertViewportColToCharacterIndex(k,h[0]),O=T;const M=h[0]-T;let C=0,w=0,E=0,D=0;if(x.charAt(T)===" "){for(;T>0&&x.charAt(T-1)===" ";)T--;for(;O<x.length&&x.charAt(O+1)===" ";)O++}else{let U=h[0],W=h[0];k.getWidth(U)===0&&(C++,U--),k.getWidth(W)===2&&(w++,W++);const z=k.getString(W).length;for(z>1&&(D+=z-1,O+=z-1);U>0&&T>0&&!this._isCharWordSeparator(k.loadCell(U-1,this._workCell));){k.loadCell(U-1,this._workCell);const S=this._workCell.getChars().length;this._workCell.getWidth()===0?(C++,U--):S>1&&(E+=S-1,T-=S-1),T--,U--}for(;W<k.length&&O+1<x.length&&!this._isCharWordSeparator(k.loadCell(W+1,this._workCell));){k.loadCell(W+1,this._workCell);const S=this._workCell.getChars().length;this._workCell.getWidth()===2?(w++,W++):S>1&&(D+=S-1,O+=S-1),O++,W++}}O++;let P=T+M-C+E,H=Math.min(this._bufferService.cols,O-T+C+w-E-D);if(g||x.slice(T,O).trim()!==""){if(b&&P===0&&k.getCodePoint(0)!==32){const U=y.lines.get(h[1]-1);if(U&&k.isWrapped&&U.getCodePoint(this._bufferService.cols-1)!==32){const W=this._getWordAt([this._bufferService.cols-1,h[1]-1],!1,!0,!1);if(W){const z=this._bufferService.cols-W.start;P-=z,H+=z}}}if(L&&P+H===this._bufferService.cols&&k.getCodePoint(this._bufferService.cols-1)!==32){const U=y.lines.get(h[1]+1);if(U?.isWrapped&&U.getCodePoint(0)!==32){const W=this._getWordAt([0,h[1]+1],!1,!1,!0);W&&(H+=W.length)}}return{start:P,length:H}}}_selectWordAt(h,g){const b=this._getWordAt(h,g);if(b){for(;b.start<0;)b.start+=this._bufferService.cols,h[1]--;this._model.selectionStart=[b.start,h[1]],this._model.selectionStartLength=b.length}}_selectToWordAt(h){const g=this._getWordAt(h,!0);if(g){let b=h[1];for(;g.start<0;)g.start+=this._bufferService.cols,b--;if(!this._model.areSelectionValuesReversed())for(;g.start+g.length>this._bufferService.cols;)g.length-=this._bufferService.cols,b++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?g.start:g.start+g.length,b]}}_isCharWordSeparator(h){return h.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(h.getChars())>=0}_selectLineAt(h){const g=this._bufferService.buffer.getWrappedRangeForLine(h),b={start:{x:0,y:g.first},end:{x:this._bufferService.cols-1,y:g.last}};this._model.selectionStart=[0,g.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,t.getRangeLength)(b,this._bufferService.cols)}};r.SelectionService=m=l([u(3,o.IBufferService),u(4,o.ICoreService),u(5,p.IMouseService),u(6,o.IOptionsService),u(7,p.IRenderService),u(8,p.ICoreBrowserService)],m)},4725:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const l=a(8343);r.ICharSizeService=(0,l.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),r.IMouseService=(0,l.createDecorator)("MouseService"),r.IRenderService=(0,l.createDecorator)("RenderService"),r.ISelectionService=(0,l.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,l.createDecorator)("ThemeService")},6731:function(I,r,a){var l=this&&this.__decorate||function(m,h,g,b){var L,y=arguments.length,k=y<3?h:b===null?b=Object.getOwnPropertyDescriptor(h,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,h,g,b);else for(var x=m.length-1;x>=0;x--)(L=m[x])&&(k=(y<3?L(k):y>3?L(h,g,k):L(h,g))||k);return y>3&&k&&Object.defineProperty(h,g,k),k},u=this&&this.__param||function(m,h){return function(g,b){h(g,b,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const n=a(7239),d=a(8055),f=a(8460),p=a(844),_=a(2585),e=d.css.toColor("#ffffff"),s=d.css.toColor("#000000"),t=d.css.toColor("#ffffff"),i=d.css.toColor("#000000"),o={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],h=[0,95,135,175,215,255];for(let g=0;g<216;g++){const b=h[g/36%6|0],L=h[g/6%6|0],y=h[g%6];m.push({css:d.channels.toCss(b,L,y),rgba:d.channels.toRgba(b,L,y)})}for(let g=0;g<24;g++){const b=8+10*g;m.push({css:d.channels.toCss(b,b,b),rgba:d.channels.toRgba(b,b,b)})}return m})());let c=r.ThemeService=class extends p.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:s,cursor:t,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:o,selectionBackgroundOpaque:d.color.blend(s,o),selectionInactiveBackgroundTransparent:o,selectionInactiveBackgroundOpaque:d.color.blend(s,o),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(m={}){const h=this._colors;if(h.foreground=v(m.foreground,e),h.background=v(m.background,s),h.cursor=v(m.cursor,t),h.cursorAccent=v(m.cursorAccent,i),h.selectionBackgroundTransparent=v(m.selectionBackground,o),h.selectionBackgroundOpaque=d.color.blend(h.background,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundTransparent=v(m.selectionInactiveBackground,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundOpaque=d.color.blend(h.background,h.selectionInactiveBackgroundTransparent),h.selectionForeground=m.selectionForeground?v(m.selectionForeground,d.NULL_COLOR):void 0,h.selectionForeground===d.NULL_COLOR&&(h.selectionForeground=void 0),d.color.isOpaque(h.selectionBackgroundTransparent)&&(h.selectionBackgroundTransparent=d.color.opacity(h.selectionBackgroundTransparent,.3)),d.color.isOpaque(h.selectionInactiveBackgroundTransparent)&&(h.selectionInactiveBackgroundTransparent=d.color.opacity(h.selectionInactiveBackgroundTransparent,.3)),h.ansi=r.DEFAULT_ANSI_COLORS.slice(),h.ansi[0]=v(m.black,r.DEFAULT_ANSI_COLORS[0]),h.ansi[1]=v(m.red,r.DEFAULT_ANSI_COLORS[1]),h.ansi[2]=v(m.green,r.DEFAULT_ANSI_COLORS[2]),h.ansi[3]=v(m.yellow,r.DEFAULT_ANSI_COLORS[3]),h.ansi[4]=v(m.blue,r.DEFAULT_ANSI_COLORS[4]),h.ansi[5]=v(m.magenta,r.DEFAULT_ANSI_COLORS[5]),h.ansi[6]=v(m.cyan,r.DEFAULT_ANSI_COLORS[6]),h.ansi[7]=v(m.white,r.DEFAULT_ANSI_COLORS[7]),h.ansi[8]=v(m.brightBlack,r.DEFAULT_ANSI_COLORS[8]),h.ansi[9]=v(m.brightRed,r.DEFAULT_ANSI_COLORS[9]),h.ansi[10]=v(m.brightGreen,r.DEFAULT_ANSI_COLORS[10]),h.ansi[11]=v(m.brightYellow,r.DEFAULT_ANSI_COLORS[11]),h.ansi[12]=v(m.brightBlue,r.DEFAULT_ANSI_COLORS[12]),h.ansi[13]=v(m.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),h.ansi[14]=v(m.brightCyan,r.DEFAULT_ANSI_COLORS[14]),h.ansi[15]=v(m.brightWhite,r.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const g=Math.min(h.ansi.length-16,m.extendedAnsi.length);for(let b=0;b<g;b++)h.ansi[b+16]=v(m.extendedAnsi[b],r.DEFAULT_ANSI_COLORS[b+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[m]=this._restoreColors.ansi[m]}else for(let h=0;h<this._restoreColors.ansi.length;++h)this._colors.ansi[h]=this._restoreColors.ansi[h]}modifyColors(m){m(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function v(m,h){if(m!==void 0)try{return d.css.toColor(m)}catch{}return h}r.ThemeService=c=l([u(0,_.IOptionsService)],c)},6349:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const l=a(8460),u=a(844);class n extends u.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(f){if(this._maxLength===f)return;const p=new Array(f);for(let _=0;_<Math.min(f,this.length);_++)p[_]=this._array[this._getCyclicIndex(_)];this._array=p,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let p=this._length;p<f;p++)this._array[p]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,p){this._array[this._getCyclicIndex(f)]=p}push(f){this._array[this._getCyclicIndex(this._length)]=f,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(f,p,..._){if(p){for(let e=f;e<this._length-p;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+p)];this._length-=p,this.onDeleteEmitter.fire({index:f,amount:p})}for(let e=this._length-1;e>=f;e--)this._array[this._getCyclicIndex(e+_.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<_.length;e++)this._array[this._getCyclicIndex(f+e)]=_[e];if(_.length&&this.onInsertEmitter.fire({index:f,amount:_.length}),this._length+_.length>this._maxLength){const e=this._length+_.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=_.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,p,_){if(!(p<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let s=p-1;s>=0;s--)this.set(f+s+_,this.get(f+s));const e=f+p+_-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<p;e++)this.set(f+e+_,this.get(f+e))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}r.CircularList=n},1439:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function a(l,u=5){if(typeof l!="object")return l;const n=Array.isArray(l)?[]:{};for(const d in l)n[d]=u<=1?l[d]:l[d]&&a(l[d],u-1);return n}},8055:(I,r,a)=>{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 l=a(6114);let u=0,n=0,d=0,f=0;var p,_,e,s,t;function i(c){const v=c.toString(16);return v.length<2?"0"+v:v}function o(c,v){return c<v?(v+.05)/(c+.05):(c+.05)/(v+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(v,m,h,g){return g!==void 0?`#${i(v)}${i(m)}${i(h)}${i(g)}`:`#${i(v)}${i(m)}${i(h)}`},c.toRgba=function(v,m,h,g=255){return(v<<24|m<<16|h<<8|g)>>>0}})(p||(r.channels=p={})),(function(c){function v(m,h){return f=Math.round(255*h),[u,n,d]=t.toChannels(m.rgba),{css:p.toCss(u,n,d,f),rgba:p.toRgba(u,n,d,f)}}c.blend=function(m,h){if(f=(255&h.rgba)/255,f===1)return{css:h.css,rgba:h.rgba};const g=h.rgba>>24&255,b=h.rgba>>16&255,L=h.rgba>>8&255,y=m.rgba>>24&255,k=m.rgba>>16&255,x=m.rgba>>8&255;return u=y+Math.round((g-y)*f),n=k+Math.round((b-k)*f),d=x+Math.round((L-x)*f),{css:p.toCss(u,n,d),rgba:p.toRgba(u,n,d)}},c.isOpaque=function(m){return(255&m.rgba)==255},c.ensureContrastRatio=function(m,h,g){const b=t.ensureContrastRatio(m.rgba,h.rgba,g);if(b)return t.toColor(b>>24&255,b>>16&255,b>>8&255)},c.opaque=function(m){const h=(255|m.rgba)>>>0;return[u,n,d]=t.toChannels(h),{css:p.toCss(u,n,d),rgba:h}},c.opacity=v,c.multiplyOpacity=function(m,h){return f=255&m.rgba,v(m,f*h/255)},c.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}})(_||(r.color=_={})),(function(c){let v,m;if(!l.isNode){const h=document.createElement("canvas");h.width=1,h.height=1;const g=h.getContext("2d",{willReadFrequently:!0});g&&(v=g,v.globalCompositeOperation="copy",m=v.createLinearGradient(0,0,1,1))}c.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return u=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),d=parseInt(h.slice(3,4).repeat(2),16),t.toColor(u,n,d);case 5:return u=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),d=parseInt(h.slice(3,4).repeat(2),16),f=parseInt(h.slice(4,5).repeat(2),16),t.toColor(u,n,d,f);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const g=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return u=parseInt(g[1]),n=parseInt(g[2]),d=parseInt(g[3]),f=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),t.toColor(u,n,d,f);if(!v||!m)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=m,v.fillStyle=h,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[u,n,d,f]=v.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,n,d,f),css:h}}})(e||(r.css=e={})),(function(c){function v(m,h,g){const b=m/255,L=h/255,y=g/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))}c.relativeLuminance=function(m){return v(m>>16&255,m>>8&255,255&m)},c.relativeLuminance2=v})(s||(r.rgb=s={})),(function(c){function v(h,g,b){const L=h>>24&255,y=h>>16&255,k=h>>8&255;let x=g>>24&255,T=g>>16&255,O=g>>8&255,M=o(s.relativeLuminance2(x,T,O),s.relativeLuminance2(L,y,k));for(;M<b&&(x>0||T>0||O>0);)x-=Math.max(0,Math.ceil(.1*x)),T-=Math.max(0,Math.ceil(.1*T)),O-=Math.max(0,Math.ceil(.1*O)),M=o(s.relativeLuminance2(x,T,O),s.relativeLuminance2(L,y,k));return(x<<24|T<<16|O<<8|255)>>>0}function m(h,g,b){const L=h>>24&255,y=h>>16&255,k=h>>8&255;let x=g>>24&255,T=g>>16&255,O=g>>8&255,M=o(s.relativeLuminance2(x,T,O),s.relativeLuminance2(L,y,k));for(;M<b&&(x<255||T<255||O<255);)x=Math.min(255,x+Math.ceil(.1*(255-x))),T=Math.min(255,T+Math.ceil(.1*(255-T))),O=Math.min(255,O+Math.ceil(.1*(255-O))),M=o(s.relativeLuminance2(x,T,O),s.relativeLuminance2(L,y,k));return(x<<24|T<<16|O<<8|255)>>>0}c.ensureContrastRatio=function(h,g,b){const L=s.relativeLuminance(h>>8),y=s.relativeLuminance(g>>8);if(o(L,y)<b){if(y<L){const T=v(h,g,b),O=o(L,s.relativeLuminance(T>>8));if(O<b){const M=m(h,g,b);return O>o(L,s.relativeLuminance(M>>8))?T:M}return T}const k=m(h,g,b),x=o(L,s.relativeLuminance(k>>8));if(x<b){const T=v(h,g,b);return x>o(L,s.relativeLuminance(T>>8))?k:T}return k}},c.reduceLuminance=v,c.increaseLuminance=m,c.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]},c.toColor=function(h,g,b,L){return{css:p.toCss(h,g,b,L),rgba:p.toRgba(h,g,b,L)}}})(t||(r.rgba=t={})),r.toPaddedHex=i,r.contrastRatio=o},8969:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const l=a(844),u=a(2585),n=a(4348),d=a(7866),f=a(744),p=a(7302),_=a(6975),e=a(8460),s=a(1753),t=a(1480),i=a(7994),o=a(9282),c=a(5435),v=a(5981),m=a(2660);let h=!1;class g extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event((L=>{var y;(y=this._onScrollApi)===null||y===void 0||y.fire(L.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(L){for(const y in L)this.optionsService.options[y]=L[y]}constructor(L){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new p.OptionsService(L)),this._instantiationService.setService(u.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(u.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(u.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(u.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(u.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(t.UnicodeService)),this._instantiationService.setService(u.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(u.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(u.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new c.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 v.WriteBuffer(((y,k)=>this._inputHandler.parse(y,k)))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,y){this._writeBuffer.write(L,y)}writeSync(L,y){this._logService.logLevel<=u.LogLevelEnum.WARN&&!h&&(this._logService.warn("writeSync is unreliable and will be removed soon."),h=!0),this._writeBuffer.writeSync(L,y)}resize(L,y){isNaN(L)||isNaN(y)||(L=Math.max(L,f.MINIMUM_COLS),y=Math.max(y,f.MINIMUM_ROWS),this._bufferService.resize(L,y))}scroll(L,y=!1){this._bufferService.scroll(L,y)}scrollLines(L,y,k){this._bufferService.scrollLines(L,y,k)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const y=L-this._bufferService.buffer.ydisp;y!==0&&this.scrollLines(y)}registerEscHandler(L,y){return this._inputHandler.registerEscHandler(L,y)}registerDcsHandler(L,y){return this._inputHandler.registerDcsHandler(L,y)}registerCsiHandler(L,y){return this._inputHandler.registerCsiHandler(L,y)}registerOscHandler(L,y){return this._inputHandler.registerOscHandler(L,y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const y=this.optionsService.rawOptions.windowsPty;y&&y.buildNumber!==void 0&&y.buildNumber!==void 0?L=y.backend==="conpty"&&y.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(o.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},(()=>((0,o.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)((()=>{for(const y of L)y.dispose()}))}}}r.CoreTerminal=g},8460:(I,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=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const u=[];for(let n=0;n<this._listeners.length;n++)u.push(this._listeners[n]);for(let n=0;n<u.length;n++)u[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(a,l){return a((u=>l.fire(u)))}},5435:function(I,r,a){var l=this&&this.__decorate||function(M,C,w,E){var D,P=arguments.length,H=P<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(M,C,w,E);else for(var U=M.length-1;U>=0;U--)(D=M[U])&&(H=(P<3?D(H):P>3?D(C,w,H):D(C,w))||H);return P>3&&H&&Object.defineProperty(C,w,H),H},u=this&&this.__param||function(M,C){return function(w,E){C(w,E,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const n=a(2584),d=a(7116),f=a(2015),p=a(844),_=a(482),e=a(8437),s=a(8460),t=a(643),i=a(511),o=a(3734),c=a(2585),v=a(6242),m=a(6351),h=a(5941),g={"(":0,")":1,"*":2,"+":3,"-":1,".":2},b=131072;function L(M,C){if(M>24)return C.setWinLines||!1;switch(M){case 1:return!!C.restoreWin;case 2:return!!C.minimizeWin;case 3:return!!C.setWinPosition;case 4:return!!C.setWinSizePixels;case 5:return!!C.raiseWin;case 6:return!!C.lowerWin;case 7:return!!C.refreshWin;case 8:return!!C.setWinSizeChars;case 9:return!!C.maximizeWin;case 10:return!!C.fullscreenWin;case 11:return!!C.getWinState;case 13:return!!C.getWinPosition;case 14:return!!C.getWinSizePixels;case 15:return!!C.getScreenSizePixels;case 16:return!!C.getCellSizePixels;case 18:return!!C.getWinSizeChars;case 19:return!!C.getScreenSizeChars;case 20:return!!C.getIconTitle;case 21:return!!C.getWinTitle;case 22:return!!C.pushTitle;case 23:return!!C.popTitle;case 24:return!!C.setWinLines}return!1}var y;(function(M){M[M.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",M[M.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(y||(r.WindowsOptionsReportType=y={}));let k=0;class x extends p.Disposable{getAttrData(){return this._curAttrData}constructor(C,w,E,D,P,H,U,W,z=new f.EscapeSequenceParser){super(),this._bufferService=C,this._charsetService=w,this._coreService=E,this._logService=D,this._optionsService=P,this._oscLinkService=H,this._coreMouseService=U,this._unicodeService=W,this._parser=z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new i.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new 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 T(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((S=>this._activeBuffer=S.activeBuffer))),this._parser.setCsiHandlerFallback(((S,R)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(S),params:R.toArray()})})),this._parser.setEscHandlerFallback((S=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(S)})})),this._parser.setExecuteHandlerFallback((S=>{this._logService.debug("Unknown EXECUTE code: ",{code:S})})),this._parser.setOscHandlerFallback(((S,R,B)=>{this._logService.debug("Unknown OSC code: ",{identifier:S,action:R,data:B})})),this._parser.setDcsHandlerFallback(((S,R,B)=>{R==="HOOK"&&(B=B.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(S),action:R,payload:B})})),this._parser.setPrintHandler(((S,R,B)=>this.print(S,R,B))),this._parser.registerCsiHandler({final:"@"},(S=>this.insertChars(S))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(S=>this.scrollLeft(S))),this._parser.registerCsiHandler({final:"A"},(S=>this.cursorUp(S))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(S=>this.scrollRight(S))),this._parser.registerCsiHandler({final:"B"},(S=>this.cursorDown(S))),this._parser.registerCsiHandler({final:"C"},(S=>this.cursorForward(S))),this._parser.registerCsiHandler({final:"D"},(S=>this.cursorBackward(S))),this._parser.registerCsiHandler({final:"E"},(S=>this.cursorNextLine(S))),this._parser.registerCsiHandler({final:"F"},(S=>this.cursorPrecedingLine(S))),this._parser.registerCsiHandler({final:"G"},(S=>this.cursorCharAbsolute(S))),this._parser.registerCsiHandler({final:"H"},(S=>this.cursorPosition(S))),this._parser.registerCsiHandler({final:"I"},(S=>this.cursorForwardTab(S))),this._parser.registerCsiHandler({final:"J"},(S=>this.eraseInDisplay(S,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(S=>this.eraseInDisplay(S,!0))),this._parser.registerCsiHandler({final:"K"},(S=>this.eraseInLine(S,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(S=>this.eraseInLine(S,!0))),this._parser.registerCsiHandler({final:"L"},(S=>this.insertLines(S))),this._parser.registerCsiHandler({final:"M"},(S=>this.deleteLines(S))),this._parser.registerCsiHandler({final:"P"},(S=>this.deleteChars(S))),this._parser.registerCsiHandler({final:"S"},(S=>this.scrollUp(S))),this._parser.registerCsiHandler({final:"T"},(S=>this.scrollDown(S))),this._parser.registerCsiHandler({final:"X"},(S=>this.eraseChars(S))),this._parser.registerCsiHandler({final:"Z"},(S=>this.cursorBackwardTab(S))),this._parser.registerCsiHandler({final:"`"},(S=>this.charPosAbsolute(S))),this._parser.registerCsiHandler({final:"a"},(S=>this.hPositionRelative(S))),this._parser.registerCsiHandler({final:"b"},(S=>this.repeatPrecedingCharacter(S))),this._parser.registerCsiHandler({final:"c"},(S=>this.sendDeviceAttributesPrimary(S))),this._parser.registerCsiHandler({prefix:">",final:"c"},(S=>this.sendDeviceAttributesSecondary(S))),this._parser.registerCsiHandler({final:"d"},(S=>this.linePosAbsolute(S))),this._parser.registerCsiHandler({final:"e"},(S=>this.vPositionRelative(S))),this._parser.registerCsiHandler({final:"f"},(S=>this.hVPosition(S))),this._parser.registerCsiHandler({final:"g"},(S=>this.tabClear(S))),this._parser.registerCsiHandler({final:"h"},(S=>this.setMode(S))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(S=>this.setModePrivate(S))),this._parser.registerCsiHandler({final:"l"},(S=>this.resetMode(S))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(S=>this.resetModePrivate(S))),this._parser.registerCsiHandler({final:"m"},(S=>this.charAttributes(S))),this._parser.registerCsiHandler({final:"n"},(S=>this.deviceStatus(S))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(S=>this.deviceStatusPrivate(S))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(S=>this.softReset(S))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(S=>this.setCursorStyle(S))),this._parser.registerCsiHandler({final:"r"},(S=>this.setScrollRegion(S))),this._parser.registerCsiHandler({final:"s"},(S=>this.saveCursor(S))),this._parser.registerCsiHandler({final:"t"},(S=>this.windowOptions(S))),this._parser.registerCsiHandler({final:"u"},(S=>this.restoreCursor(S))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(S=>this.insertColumns(S))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(S=>this.deleteColumns(S))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(S=>this.selectProtected(S))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(S=>this.requestMode(S,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(S=>this.requestMode(S,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new v.OscHandler((S=>(this.setTitle(S),this.setIconName(S),!0)))),this._parser.registerOscHandler(1,new v.OscHandler((S=>this.setIconName(S)))),this._parser.registerOscHandler(2,new v.OscHandler((S=>this.setTitle(S)))),this._parser.registerOscHandler(4,new v.OscHandler((S=>this.setOrReportIndexedColor(S)))),this._parser.registerOscHandler(8,new v.OscHandler((S=>this.setHyperlink(S)))),this._parser.registerOscHandler(10,new v.OscHandler((S=>this.setOrReportFgColor(S)))),this._parser.registerOscHandler(11,new v.OscHandler((S=>this.setOrReportBgColor(S)))),this._parser.registerOscHandler(12,new v.OscHandler((S=>this.setOrReportCursorColor(S)))),this._parser.registerOscHandler(104,new v.OscHandler((S=>this.restoreIndexedColor(S)))),this._parser.registerOscHandler(110,new v.OscHandler((S=>this.restoreFgColor(S)))),this._parser.registerOscHandler(111,new v.OscHandler((S=>this.restoreBgColor(S)))),this._parser.registerOscHandler(112,new v.OscHandler((S=>this.restoreCursorColor(S)))),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 S in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:S},(()=>this.selectCharset("("+S))),this._parser.registerEscHandler({intermediates:")",final:S},(()=>this.selectCharset(")"+S))),this._parser.registerEscHandler({intermediates:"*",final:S},(()=>this.selectCharset("*"+S))),this._parser.registerEscHandler({intermediates:"+",final:S},(()=>this.selectCharset("+"+S))),this._parser.registerEscHandler({intermediates:"-",final:S},(()=>this.selectCharset("-"+S))),this._parser.registerEscHandler({intermediates:".",final:S},(()=>this.selectCharset("."+S))),this._parser.registerEscHandler({intermediates:"/",final:S},(()=>this.selectCharset("/"+S)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((S=>(this._logService.error("Parsing error: ",S),S))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler(((S,R)=>this.requestStatusString(S,R))))}_preserveStack(C,w,E,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=C,this._parseStack.cursorStartY=w,this._parseStack.decodedLength=E,this._parseStack.position=D}_logSlowResolvingAsync(C){this._logService.logLevel<=c.LogLevelEnum.WARN&&Promise.race([C,new Promise(((w,E)=>setTimeout((()=>E("#SLOW_TIMEOUT")),5e3)))]).catch((w=>{if(w!=="#SLOW_TIMEOUT")throw w;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(C,w){let E,D=this._activeBuffer.x,P=this._activeBuffer.y,H=0;const U=this._parseStack.paused;if(U){if(E=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,w))return this._logSlowResolvingAsync(E),E;D=this._parseStack.cursorStartX,P=this._parseStack.cursorStartY,this._parseStack.paused=!1,C.length>b&&(H=this._parseStack.position+b)}if(this._logService.logLevel<=c.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof C=="string"?` "${C}"`:` "${Array.prototype.map.call(C,(W=>String.fromCharCode(W))).join("")}"`),typeof C=="string"?C.split("").map((W=>W.charCodeAt(0))):C),this._parseBuffer.length<C.length&&this._parseBuffer.length<b&&(this._parseBuffer=new Uint32Array(Math.min(C.length,b))),U||this._dirtyRowTracker.clearRange(),C.length>b)for(let W=H;W<C.length;W+=b){const z=W+b<C.length?W+b:C.length,S=typeof C=="string"?this._stringDecoder.decode(C.substring(W,z),this._parseBuffer):this._utf8Decoder.decode(C.subarray(W,z),this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,S))return this._preserveStack(D,P,S,W),this._logSlowResolvingAsync(E),E}else if(!U){const W=typeof C=="string"?this._stringDecoder.decode(C,this._parseBuffer):this._utf8Decoder.decode(C,this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,W))return this._preserveStack(D,P,W,0),this._logSlowResolvingAsync(E),E}this._activeBuffer.x===D&&this._activeBuffer.y===P||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(C,w,E){let D,P;const H=this._charsetService.charset,U=this._optionsService.rawOptions.screenReaderMode,W=this._bufferService.cols,z=this._coreService.decPrivateModes.wraparound,S=this._coreService.modes.insertMode,R=this._curAttrData;let B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&E-w>0&&B.getWidth(this._activeBuffer.x-1)===2&&B.setCellFromCodePoint(this._activeBuffer.x-1,0,1,R.fg,R.bg,R.extended);for(let A=w;A<E;++A){if(D=C[A],P=this._unicodeService.wcwidth(D),D<127&&H){const N=H[String.fromCharCode(D)];N&&(D=N.charCodeAt(0))}if(U&&this._onA11yChar.fire((0,_.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),P||!this._activeBuffer.x){if(this._activeBuffer.x+P-1>=W){if(z){for(;this._activeBuffer.x<W;)B.setCellFromCodePoint(this._activeBuffer.x++,0,1,R.fg,R.bg,R.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),B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=W-1,P===2)continue}if(S&&(B.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(R),R),B.getWidth(W-1)===2&&B.setCellFromCodePoint(W-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,R.fg,R.bg,R.extended)),B.setCellFromCodePoint(this._activeBuffer.x++,D,P,R.fg,R.bg,R.extended),P>0)for(;--P;)B.setCellFromCodePoint(this._activeBuffer.x++,0,0,R.fg,R.bg,R.extended)}else B.getWidth(this._activeBuffer.x-1)?B.addCodepointToCell(this._activeBuffer.x-1,D):B.addCodepointToCell(this._activeBuffer.x-2,D)}E-w>0&&(B.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<W&&E-w>0&&B.getWidth(this._activeBuffer.x)===0&&!B.hasContent(this._activeBuffer.x)&&B.setCellFromCodePoint(this._activeBuffer.x,0,1,R.fg,R.bg,R.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(C,w){return C.final!=="t"||C.prefix||C.intermediates?this._parser.registerCsiHandler(C,w):this._parser.registerCsiHandler(C,(E=>!L(E.params[0],this._optionsService.rawOptions.windowOptions)||w(E)))}registerDcsHandler(C,w){return this._parser.registerDcsHandler(C,new m.DcsHandler(w))}registerEscHandler(C,w){return this._parser.registerEscHandler(C,w)}registerOscHandler(C,w){return this._parser.registerOscHandler(C,new v.OscHandler(w))}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 C;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&&(!((C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||C===void 0)&&C.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);w.hasWidth(this._activeBuffer.x)&&!w.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const C=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-C),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(C=this._bufferService.cols-1){this._activeBuffer.x=Math.min(C,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(C,w){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=C,this._activeBuffer.y=this._activeBuffer.scrollTop+w):(this._activeBuffer.x=C,this._activeBuffer.y=w),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(C,w){this._restrictCursor(),this._setCursor(this._activeBuffer.x+C,this._activeBuffer.y+w)}cursorUp(C){const w=this._activeBuffer.y-this._activeBuffer.scrollTop;return w>=0?this._moveCursor(0,-Math.min(w,C.params[0]||1)):this._moveCursor(0,-(C.params[0]||1)),!0}cursorDown(C){const w=this._activeBuffer.scrollBottom-this._activeBuffer.y;return w>=0?this._moveCursor(0,Math.min(w,C.params[0]||1)):this._moveCursor(0,C.params[0]||1),!0}cursorForward(C){return this._moveCursor(C.params[0]||1,0),!0}cursorBackward(C){return this._moveCursor(-(C.params[0]||1),0),!0}cursorNextLine(C){return this.cursorDown(C),this._activeBuffer.x=0,!0}cursorPrecedingLine(C){return this.cursorUp(C),this._activeBuffer.x=0,!0}cursorCharAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(C){return this._setCursor(C.length>=2?(C.params[1]||1)-1:0,(C.params[0]||1)-1),!0}charPosAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(C){return this._moveCursor(C.params[0]||1,0),!0}linePosAbsolute(C){return this._setCursor(this._activeBuffer.x,(C.params[0]||1)-1),!0}vPositionRelative(C){return this._moveCursor(0,C.params[0]||1),!0}hVPosition(C){return this.cursorPosition(C),!0}tabClear(C){const w=C.params[0];return w===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:w===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let w=C.params[0]||1;for(;w--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let w=C.params[0]||1;for(;w--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(C){const w=C.params[0];return w===1&&(this._curAttrData.bg|=536870912),w!==2&&w!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(C,w,E,D=!1,P=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);H.replaceCells(w,E,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),P),D&&(H.isWrapped=!1)}_resetBufferLine(C,w=!1){const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);E&&(E.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),w),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+C),E.isWrapped=!1)}eraseInDisplay(C,w=!1){let E;switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,w);E<this._bufferService.rows;E++)this._resetBufferLine(E,w);this._dirtyRowTracker.markDirty(E);break;case 1:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E,0,this._activeBuffer.x+1,!0,w),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(E+1).isWrapped=!1);E--;)this._resetBufferLine(E,w);this._dirtyRowTracker.markDirty(0);break;case 2:for(E=this._bufferService.rows,this._dirtyRowTracker.markDirty(E-1);E--;)this._resetBufferLine(E,w);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(C,w=!1){switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,w);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,w);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,w)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(C){this._restrictCursor();let w=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;w--;)this._activeBuffer.lines.splice(P-1,1),this._activeBuffer.lines.splice(E,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(C){this._restrictCursor();let w=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;w--;)this._activeBuffer.lines.splice(E,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(C){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.insertCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(C){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.deleteCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(C){let w=C.params[0]||1;for(;w--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(C){let w=C.params[0]||1;for(;w--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=C.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D.deleteCells(0,w,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=C.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D.insertCells(0,w,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=C.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D.insertCells(this._activeBuffer.x,w,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=C.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D.deleteCells(this._activeBuffer.x,w,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(C){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(C.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(C){if(!this._parser.precedingCodepoint)return!0;const w=C.params[0]||1,E=new Uint32Array(w);for(let D=0;D<w;++D)E[D]=this._parser.precedingCodepoint;return this.print(E,0,E.length),!0}sendDeviceAttributesPrimary(C){return C.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(C){return C.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(C.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(C){return(this._optionsService.rawOptions.termName+"").indexOf(C)===0}setMode(C){for(let w=0;w<C.length;w++)switch(C.params[w]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(C){for(let w=0;w<C.length;w++)switch(C.params[w]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(C){for(let w=0;w<C.length;w++)switch(C.params[w]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(C){for(let w=0;w<C.length;w++)switch(C.params[w]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),C.params[w]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(C,w){const E=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:P}=this._coreMouseService,H=this._coreService,{buffers:U,cols:W}=this._bufferService,{active:z,alt:S}=U,R=this._optionsService.rawOptions,B=j=>j?1:2,A=C.params[0];return N=A,F=w?A===2?4:A===4?B(H.modes.insertMode):A===12?3:A===20?B(R.convertEol):0:A===1?B(E.applicationCursorKeys):A===3?R.windowOptions.setWinLines?W===80?2:W===132?1:0:0:A===6?B(E.origin):A===7?B(E.wraparound):A===8?3:A===9?B(D==="X10"):A===12?B(R.cursorBlink):A===25?B(!H.isCursorHidden):A===45?B(E.reverseWraparound):A===66?B(E.applicationKeypad):A===67?4:A===1e3?B(D==="VT200"):A===1002?B(D==="DRAG"):A===1003?B(D==="ANY"):A===1004?B(E.sendFocus):A===1005?4:A===1006?B(P==="SGR"):A===1015?4:A===1016?B(P==="SGR_PIXELS"):A===1048?1:A===47||A===1047||A===1049?B(z===S):A===2004?B(E.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${w?"":"?"}${N};${F}$y`),!0;var N,F}_updateAttrColor(C,w,E,D,P){return w===2?(C|=50331648,C&=-16777216,C|=o.AttributeData.fromColorRGB([E,D,P])):w===5&&(C&=-50331904,C|=33554432|255&E),C}_extractColor(C,w,E){const D=[0,0,-1,0,0,0];let P=0,H=0;do{if(D[H+P]=C.params[w+H],C.hasSubParams(w+H)){const U=C.getSubParams(w+H);let W=0;do D[1]===5&&(P=1),D[H+W+1+P]=U[W];while(++W<U.length&&W+H+1+P<D.length);break}if(D[1]===5&&H+P>=2||D[1]===2&&H+P>=5)break;D[1]&&(P=1)}while(++H+w<C.length&&H+P<D.length);for(let U=2;U<D.length;++U)D[U]===-1&&(D[U]=0);switch(D[0]){case 38:E.fg=this._updateAttrColor(E.fg,D[1],D[3],D[4],D[5]);break;case 48:E.bg=this._updateAttrColor(E.bg,D[1],D[3],D[4],D[5]);break;case 58:E.extended=E.extended.clone(),E.extended.underlineColor=this._updateAttrColor(E.extended.underlineColor,D[1],D[3],D[4],D[5])}return H}_processUnderline(C,w){w.extended=w.extended.clone(),(!~C||C>5)&&(C=1),w.extended.underlineStyle=C,w.fg|=268435456,C===0&&(w.fg&=-268435457),w.updateExtended()}_processSGR0(C){C.fg=e.DEFAULT_ATTR_DATA.fg,C.bg=e.DEFAULT_ATTR_DATA.bg,C.extended=C.extended.clone(),C.extended.underlineStyle=0,C.extended.underlineColor&=-67108864,C.updateExtended()}charAttributes(C){if(C.length===1&&C.params[0]===0)return this._processSGR0(this._curAttrData),!0;const w=C.length;let E;const D=this._curAttrData;for(let P=0;P<w;P++)E=C.params[P],E>=30&&E<=37?(D.fg&=-50331904,D.fg|=16777216|E-30):E>=40&&E<=47?(D.bg&=-50331904,D.bg|=16777216|E-40):E>=90&&E<=97?(D.fg&=-50331904,D.fg|=16777224|E-90):E>=100&&E<=107?(D.bg&=-50331904,D.bg|=16777224|E-100):E===0?this._processSGR0(D):E===1?D.fg|=134217728:E===3?D.bg|=67108864:E===4?(D.fg|=268435456,this._processUnderline(C.hasSubParams(P)?C.getSubParams(P)[0]:1,D)):E===5?D.fg|=536870912:E===7?D.fg|=67108864:E===8?D.fg|=1073741824:E===9?D.fg|=2147483648:E===2?D.bg|=134217728:E===21?this._processUnderline(2,D):E===22?(D.fg&=-134217729,D.bg&=-134217729):E===23?D.bg&=-67108865:E===24?(D.fg&=-268435457,this._processUnderline(0,D)):E===25?D.fg&=-536870913:E===27?D.fg&=-67108865:E===28?D.fg&=-1073741825:E===29?D.fg&=2147483647:E===39?(D.fg&=-67108864,D.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):E===49?(D.bg&=-67108864,D.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):E===38||E===48||E===58?P+=this._extractColor(C,P,D):E===53?D.bg|=1073741824:E===55?D.bg&=-1073741825:E===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):E===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.",E);return!0}deviceStatus(C){switch(C.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const w=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${w};${E}R`)}return!0}deviceStatusPrivate(C){if(C.params[0]===6){const w=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${w};${E}R`)}return!0}softReset(C){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(C){const w=C.params[0]||1;switch(w){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const E=w%2==1;return this._optionsService.options.cursorBlink=E,!0}setScrollRegion(C){const w=C.params[0]||1;let E;return(C.length<2||(E=C.params[1])>this._bufferService.rows||E===0)&&(E=this._bufferService.rows),E>w&&(this._activeBuffer.scrollTop=w-1,this._activeBuffer.scrollBottom=E-1,this._setCursor(0,0)),!0}windowOptions(C){if(!L(C.params[0],this._optionsService.rawOptions.windowOptions))return!0;const w=C.length>1?C.params[1]:0;switch(C.params[0]){case 14:w!==2&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:w!==0&&w!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),w!==0&&w!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:w!==0&&w!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),w!==0&&w!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(C){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(C){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(C){return this._windowTitle=C,this._onTitleChange.fire(C),!0}setIconName(C){return this._iconName=C,!0}setOrReportIndexedColor(C){const w=[],E=C.split(";");for(;E.length>1;){const D=E.shift(),P=E.shift();if(/^\d+$/.exec(D)){const H=parseInt(D);if(O(H))if(P==="?")w.push({type:0,index:H});else{const U=(0,h.parseColor)(P);U&&w.push({type:1,index:H,color:U})}}}return w.length&&this._onColor.fire(w),!0}setHyperlink(C){const w=C.split(";");return!(w.length<2)&&(w[1]?this._createHyperlink(w[0],w[1]):!w[0]&&this._finishHyperlink())}_createHyperlink(C,w){this._getCurrentLinkId()&&this._finishHyperlink();const E=C.split(":");let D;const P=E.findIndex((H=>H.startsWith("id=")));return P!==-1&&(D=E[P].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:w}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(C,w){const E=C.split(";");for(let D=0;D<E.length&&!(w>=this._specialColors.length);++D,++w)if(E[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[w]}]);else{const P=(0,h.parseColor)(E[D]);P&&this._onColor.fire([{type:1,index:this._specialColors[w],color:P}])}return!0}setOrReportFgColor(C){return this._setOrReportSpecialColor(C,0)}setOrReportBgColor(C){return this._setOrReportSpecialColor(C,1)}setOrReportCursorColor(C){return this._setOrReportSpecialColor(C,2)}restoreIndexedColor(C){if(!C)return this._onColor.fire([{type:2}]),!0;const w=[],E=C.split(";");for(let D=0;D<E.length;++D)if(/^\d+$/.exec(E[D])){const P=parseInt(E[D]);O(P)&&w.push({type:2,index:P})}return w.length&&this._onColor.fire(w),!0}restoreFgColor(C){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(C){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(C){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),!0}selectCharset(C){return C.length!==2?(this.selectDefaultCharset(),!0):(C[0]==="/"||this._charsetService.setgCharset(g[C[0]],d.CHARSETS[C[1]]||d.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const C=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,C,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(C){return this._charsetService.setgLevel(C),!0}screenAlignmentPattern(){const C=new i.CellData;C.content=4194373,C.fg=this._curAttrData.fg,C.bg=this._curAttrData.bg,this._setCursor(0,0);for(let w=0;w<this._bufferService.rows;++w){const E=this._activeBuffer.ybase+this._activeBuffer.y+w,D=this._activeBuffer.lines.get(E);D&&(D.fill(C),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(C,w){const E=this._bufferService.buffer,D=this._optionsService.rawOptions;return(P=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${P}${n.C0.ESC}\\`),!0))(C==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:C==='"p'?'P1$r61;1"p':C==="r"?`P1$r${E.scrollTop+1};${E.scrollBottom+1}r`:C==="m"?"P1$r0m":C===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(C,w){this._dirtyRowTracker.markRangeDirty(C,w)}}r.InputHandler=x;let T=class{constructor(M){this._bufferService=M,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(M){M<this.start?this.start=M:M>this.end&&(this.end=M)}markRangeDirty(M,C){M>C&&(k=M,M=C,C=k),M<this.start&&(this.start=M),C>this.end&&(this.end=C)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function O(M){return 0<=M&&M<256}T=l([u(0,c.IBufferService)],T)},844:(I,r)=>{function a(l){for(const u of l)u.dispose();l.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const u=this._disposables.indexOf(l);u!==-1&&this._disposables.splice(u,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var u;this._isDisposed||l===this._value||((u=this._value)===null||u===void 0||u.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)===null||l===void 0||l.dispose(),this._value=void 0}},r.toDisposable=function(l){return{dispose:l}},r.disposeArray=a,r.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},1505:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(u,n,d){this._data[u]||(this._data[u]={}),this._data[u][n]=d}get(u,n){return this._data[u]?this._data[u][n]:void 0}clear(){this._data={}}}r.TwoKeyMap=a,r.FourKeyMap=class{constructor(){this._data=new a}set(l,u,n,d,f){this._data.get(l,u)||this._data.set(l,u,new a),this._data.get(l,u).set(n,d,f)}get(l,u,n,d){var f;return(f=this._data.get(l,u))===null||f===void 0?void 0:f.get(n,d)}clear(){this._data.clear()}}},6114:(I,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 a=r.isNode?"node":navigator.userAgent,l=r.isNode?"node":navigator.platform;r.isFirefox=a.includes("Firefox"),r.isLegacyEdge=a.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(a),r.getSafariVersion=function(){if(!r.isSafari)return 0;const u=a.match(/Version\/(\d+)/);return u===null||u.length<2?0:parseInt(u[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),r.isIpad=l==="iPad",r.isIphone=l==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),r.isLinux=l.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(a)},6106:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let a=0;r.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(a=this._search(this._getKey(l)),this._array.splice(a,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const u=this._getKey(l);if(u===void 0||(a=this._search(u),a===-1)||this._getKey(this._array[a])!==u)return!1;do if(this._array[a]===l)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===u);return!1}*getKeyIterator(l){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===l)}forEachByKey(l,u){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do u(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===l)}values(){return[...this._array].values()}_search(l){let u=0,n=this._array.length-1;for(;n>=u;){let d=u+n>>1;const f=this._getKey(this._array[d]);if(f>l)n=d-1;else{if(!(f<l)){for(;d>0&&this._getKey(this._array[d-1])===l;)d--;return d}u=d+1}}return u}}},7226:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const l=a(6114);class u{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(f){this._idleCallback=void 0;let p=0,_=0,e=f.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(p=Date.now(),this._tasks[this._i]()||this._i++,p=Math.max(1,Date.now()-p),_=Math.max(p,_),s=f.timeRemaining(),1.5*_>s)return e-p<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-p))}ms`),void this._start();e=s}this.clear()}}class n extends u{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const p=Date.now()+f;return{timeRemaining:()=>Math.max(0,p-Date.now())}}}r.PriorityTaskQueue=n,r.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends u{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const l=a(643);r.updateWindowsModeWrappedState=function(u){const n=u.buffer.lines.get(u.buffer.ybase+u.buffer.y-1),d=n?.get(u.cols-1),f=u.buffer.lines.get(u.buffer.ybase+u.buffer.y);f&&d&&(f.isWrapped=d[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&d[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=l},9092:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const l=a(6349),u=a(7226),n=a(3734),d=a(8437),f=a(4634),p=a(511),_=a(643),e=a(4863),s=a(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(t,i,o){this._hasScrollback=t,this._optionsService=i,this._bufferService=o,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=p.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=p.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new u.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(t,i){return new d.BufferLine(this._bufferService.cols,this.getNullCell(t),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;const i=t+this._optionsService.rawOptions.scrollback;return i>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:i}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=d.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,i){const o=this.getNullCell(d.DEFAULT_ATTR_DATA);let c=0;const v=this._getCorrectBufferLength(i);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols<t)for(let h=0;h<this.lines.length;h++)c+=+this.lines.get(h).resize(t,o);let m=0;if(this._rows<i)for(let h=this._rows;h<i;h++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new d.BufferLine(t,o)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(t,o)));else for(let h=this._rows;h>i;h--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v<this.lines.maxLength){const h=this.lines.length-v;h>0&&(this.lines.trimStart(h),this.ybase=Math.max(this.ybase-h,0),this.ydisp=Math.max(this.ydisp-h,0),this.savedY=Math.max(this.savedY-h,0)),this.lines.maxLength=v}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,i-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(t,i),this._cols>t))for(let m=0;m<this.lines.length;m++)c+=+this.lines.get(m).resize(t,o);this._cols=t,this._rows=i,this._memoryCleanupQueue.clear(),c>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return t}get _isReflowEnabled(){const t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,i){this._cols!==t&&(t>this._cols?this._reflowLarger(t,i):this._reflowSmaller(t,i))}_reflowLarger(t,i){const o=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(o.length>0){const c=(0,f.reflowLargerCreateNewLayout)(this.lines,o);(0,f.reflowLargerApplyNewLayout)(this.lines,c.layout),this._reflowLargerAdjustViewport(t,i,c.countRemoved)}}_reflowLargerAdjustViewport(t,i,o){const c=this.getNullCell(d.DEFAULT_ATTR_DATA);let v=o;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new d.BufferLine(t,c))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-o,0)}_reflowSmaller(t,i){const o=this.getNullCell(d.DEFAULT_ATTR_DATA),c=[];let v=0;for(let m=this.lines.length-1;m>=0;m--){let h=this.lines.get(m);if(!h||!h.isWrapped&&h.getTrimmedLength()<=t)continue;const g=[h];for(;h.isWrapped&&m>0;)h=this.lines.get(--m),g.unshift(h);const b=this.ybase+this.y;if(b>=m&&b<m+g.length)continue;const L=g[g.length-1].getTrimmedLength(),y=(0,f.reflowSmallerGetNewLineLengths)(g,this._cols,t),k=y.length-g.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 T=[];for(let D=0;D<k;D++){const P=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);T.push(P)}T.length>0&&(c.push({start:m+g.length+v,newLines:T}),v+=T.length),g.push(...T);let O=y.length-1,M=y[O];M===0&&(O--,M=y[O]);let C=g.length-k-1,w=L;for(;C>=0;){const D=Math.min(w,M);if(g[O]===void 0)break;if(g[O].copyCellsFrom(g[C],w-D,M-D,D,!0),M-=D,M===0&&(O--,M=y[O]),w-=D,w===0){C--;const P=Math.max(C,0);w=(0,f.getWrappedLineTrimmedLength)(g,P,this._cols)}}for(let D=0;D<g.length;D++)y[D]<t&&g[D].setCell(y[D],o);let E=k-x;for(;E-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+k,this.ybase+i-1)}if(c.length>0){const m=[],h=[];for(let O=0;O<this.lines.length;O++)h.push(this.lines.get(O));const g=this.lines.length;let b=g-1,L=0,y=c[L];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+v);let k=0;for(let O=Math.min(this.lines.maxLength-1,g+v-1);O>=0;O--)if(y&&y.start>b+k){for(let M=y.newLines.length-1;M>=0;M--)this.lines.set(O--,y.newLines[M]);O++,m.push({index:b+1,amount:y.newLines.length}),k+=y.newLines.length,y=c[++L]}else this.lines.set(O,h[b--]);let x=0;for(let O=m.length-1;O>=0;O--)m[O].index+=x,this.lines.onInsertEmitter.fire(m[O]),x+=m[O].amount;const T=Math.max(0,g+v-this.lines.maxLength);T>0&&this.lines.onTrimEmitter.fire(T)}}translateBufferLineToString(t,i,o=0,c){const v=this.lines.get(t);return v?v.translateToString(i,o,c):""}getWrappedRangeForLine(t){let i=t,o=t;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;o+1<this.lines.length&&this.lines.get(o+1).isWrapped;)o++;return{first:i,last:o}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===t&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose(),this.markers.splice(t--,1);this._isClearing=!1}addMarker(t){const i=new e.Marker(t);return this.markers.push(i),i.register(this.lines.onTrim((o=>{i.line-=o,i.line<0&&i.dispose()}))),i.register(this.lines.onInsert((o=>{i.line>=o.index&&(i.line+=o.amount)}))),i.register(this.lines.onDelete((o=>{i.line>=o.index&&i.line<o.index+o.amount&&i.dispose(),i.line>o.index&&(i.line-=o.amount)}))),i.register(i.onDispose((()=>this._removeMarker(i)))),i}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}}},8437:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const l=a(3734),u=a(511),n=a(643),d=a(482);r.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let f=0;class p{constructor(e,s,t=!1){this.isWrapped=t,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const i=s||u.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let o=0;o<e;++o)this.setCell(o,i);this.length=e}get(e){const s=this._data[3*e+0],t=2097151&s;return[this._data[3*e+1],2097152&s?this._combined[e]:t?(0,d.stringFromCodePoint)(t):"",s>>22,2097152&s?this._combined[e].charCodeAt(this._combined[e].length-1):t]}set(e,s){this._data[3*e+1]=s[n.CHAR_DATA_ATTR_INDEX],s[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=s[1],this._data[3*e+0]=2097152|e|s[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=s[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const s=this._data[3*e+0];return 2097152&s?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&s}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const s=this._data[3*e+0];return 2097152&s?this._combined[e]:2097151&s?(0,d.stringFromCodePoint)(2097151&s):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,s){return f=3*e,s.content=this._data[f+0],s.fg=this._data[f+1],s.bg=this._data[f+2],2097152&s.content&&(s.combinedData=this._combined[e]),268435456&s.bg&&(s.extended=this._extendedAttrs[e]),s}setCell(e,s){2097152&s.content&&(this._combined[e]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[e]=s.extended),this._data[3*e+0]=s.content,this._data[3*e+1]=s.fg,this._data[3*e+2]=s.bg}setCellFromCodePoint(e,s,t,i,o,c){268435456&o&&(this._extendedAttrs[e]=c),this._data[3*e+0]=s|t<<22,this._data[3*e+1]=i,this._data[3*e+2]=o}addCodepointToCell(e,s){let t=this._data[3*e+0];2097152&t?this._combined[e]+=(0,d.stringFromCodePoint)(s):(2097151&t?(this._combined[e]=(0,d.stringFromCodePoint)(2097151&t)+(0,d.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,this._data[3*e+0]=t)}insertCells(e,s,t,i){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new l.ExtendedAttrs),s<this.length-e){const o=new u.CellData;for(let c=this.length-e-s-1;c>=0;--c)this.setCell(e+s+c,this.loadCell(e+c,o));for(let c=0;c<s;++c)this.setCell(e+c,t)}else for(let o=e;o<this.length;++o)this.setCell(o,t);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new l.ExtendedAttrs)}deleteCells(e,s,t,i){if(e%=this.length,s<this.length-e){const o=new u.CellData;for(let c=0;c<this.length-e-s;++c)this.setCell(e+c,this.loadCell(e+s+c,o));for(let c=this.length-s;c<this.length;++c)this.setCell(c,t)}else for(let o=e;o<this.length;++o)this.setCell(o,t);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new l.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,i?.fg||0,i?.bg||0,i?.extended||new l.ExtendedAttrs)}replaceCells(e,s,t,i,o=!1){if(o)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new l.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodePoint(s,0,1,i?.fg||0,i?.bg||0,i?.extended||new l.ExtendedAttrs);e<s&&e<this.length;)this.isProtected(e)||this.setCell(e,t),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new l.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodePoint(s,0,1,i?.fg||0,i?.bg||0,i?.extended||new l.ExtendedAttrs);e<s&&e<this.length;)this.setCell(e++,t)}resize(e,s){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const t=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*t)this._data=new Uint32Array(this._data.buffer,0,t);else{const i=new Uint32Array(t);i.set(this._data),this._data=i}for(let i=this.length;i<e;++i)this.setCell(i,s)}else{this._data=this._data.subarray(0,t);const i=Object.keys(this._combined);for(let c=0;c<i.length;c++){const v=parseInt(i[c],10);v>=e&&delete this._combined[v]}const o=Object.keys(this._extendedAttrs);for(let c=0;c<o.length;c++){const v=parseInt(o[c],10);v>=e&&delete this._extendedAttrs[v]}}return this.length=e,4*t*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,s=!1){if(s)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const 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 p(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const s in this._combined)e._combined[s]=this._combined[s];for(const s in this._extendedAttrs)e._extendedAttrs[s]=this._extendedAttrs[s];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,s,t,i,o){const c=e._data;if(o)for(let m=i-1;m>=0;m--){for(let h=0;h<3;h++)this._data[3*(t+m)+h]=c[3*(s+m)+h];268435456&c[3*(s+m)+2]&&(this._extendedAttrs[t+m]=e._extendedAttrs[s+m])}else for(let m=0;m<i;m++){for(let h=0;h<3;h++)this._data[3*(t+m)+h]=c[3*(s+m)+h];268435456&c[3*(s+m)+2]&&(this._extendedAttrs[t+m]=e._extendedAttrs[s+m])}const v=Object.keys(e._combined);for(let m=0;m<v.length;m++){const h=parseInt(v[m],10);h>=s&&(this._combined[h-s+t]=e._combined[h])}}translateToString(e=!1,s=0,t=this.length){e&&(t=Math.min(t,this.getTrimmedLength()));let i="";for(;s<t;){const o=this._data[3*s+0],c=2097151&o;i+=2097152&o?this._combined[s]:c?(0,d.stringFromCodePoint)(c):n.WHITESPACE_CELL_CHAR,s+=o>>22||1}return i}}r.BufferLine=p},4841:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(a,l){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return l*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(I,r)=>{function a(l,u,n){if(u===l.length-1)return l[u].getTrimmedLength();const d=!l[u].hasContent(n-1)&&l[u].getWidth(n-1)===1,f=l[u+1].getWidth(0)===2;return d&&f?n-1:n}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(l,u,n,d,f){const p=[];for(let _=0;_<l.length-1;_++){let e=_,s=l.get(++e);if(!s.isWrapped)continue;const t=[l.get(_)];for(;e<l.length&&s.isWrapped;)t.push(s),s=l.get(++e);if(d>=_&&d<e){_+=t.length-1;continue}let i=0,o=a(t,i,u),c=1,v=0;for(;c<t.length;){const h=a(t,c,u),g=h-v,b=n-o,L=Math.min(g,b);t[i].copyCellsFrom(t[c],v,o,L,!1),o+=L,o===n&&(i++,o=0),v+=L,v===h&&(c++,v=0),o===0&&i!==0&&t[i-1].getWidth(n-1)===2&&(t[i].copyCellsFrom(t[i-1],n-1,o++,1,!1),t[i-1].setCell(n-1,f))}t[i].replaceCells(o,n,f);let m=0;for(let h=t.length-1;h>0&&(h>i||t[h].getTrimmedLength()===0);h--)m++;m>0&&(p.push(_+t.length-m),p.push(m)),_+=t.length-1}return p},r.reflowLargerCreateNewLayout=function(l,u){const n=[];let d=0,f=u[d],p=0;for(let _=0;_<l.length;_++)if(f===_){const e=u[++d];l.onDeleteEmitter.fire({index:_-p,amount:e}),_+=e-1,p+=e,f=u[++d]}else n.push(_);return{layout:n,countRemoved:p}},r.reflowLargerApplyNewLayout=function(l,u){const n=[];for(let d=0;d<u.length;d++)n.push(l.get(u[d]));for(let d=0;d<n.length;d++)l.set(d,n[d]);l.length=u.length},r.reflowSmallerGetNewLineLengths=function(l,u,n){const d=[],f=l.map(((s,t)=>a(l,t,u))).reduce(((s,t)=>s+t));let p=0,_=0,e=0;for(;e<f;){if(f-e<n){d.push(f-e);break}p+=n;const s=a(l,_,u);p>s&&(p-=s,_++);const t=l[_].getWidth(p-1)===2;t&&p--;const i=t?n-1:n;d.push(i),e+=i}return d},r.getWrappedLineTrimmedLength=a},5295:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const l=a(8460),u=a(844),n=a(9092);class d extends u.Disposable{constructor(p,_){super(),this._optionsService=p,this._bufferService=_,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(p){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(p),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(p,_){this._normal.resize(p,_),this._alt.resize(p,_),this.setupTabStops(p)}setupTabStops(p){this._normal.setupTabStops(p),this._alt.setupTabStops(p)}}r.BufferSet=d},511:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const l=a(482),u=a(643),n=a(3734);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(p){const _=new d;return _.setFromCharData(p),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(p){this.fg=p[u.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(p[u.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(p[u.CHAR_DATA_CHAR_INDEX].length===2){const e=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const s=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|p[u.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[u.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=p[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|p[u.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=d},643:(I,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:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const l=a(8460),u=a(844);class n{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,u.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}r.Marker=n,n._nextId=1},7116:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},r.CHARSETS.A={"#":"\xA3"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},r.CHARSETS.C=r.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},r.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},r.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},r.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},r.CHARSETS.E=r.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},r.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},r.CHARSETS.H=r.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(I,r)=>{var a,l,u;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
8
- `,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL="\x7F"})(a||(r.C0=a={})),(function(n){n.PAD="\x80",n.HOP="\x81",n.BPH="\x82",n.NBH="\x83",n.IND="\x84",n.NEL="\x85",n.SSA="\x86",n.ESA="\x87",n.HTS="\x88",n.HTJ="\x89",n.VTS="\x8A",n.PLD="\x8B",n.PLU="\x8C",n.RI="\x8D",n.SS2="\x8E",n.SS3="\x8F",n.DCS="\x90",n.PU1="\x91",n.PU2="\x92",n.STS="\x93",n.CCH="\x94",n.MW="\x95",n.SPA="\x96",n.EPA="\x97",n.SOS="\x98",n.SGCI="\x99",n.SCI="\x9A",n.CSI="\x9B",n.ST="\x9C",n.OSC="\x9D",n.PM="\x9E",n.APC="\x9F"})(l||(r.C1=l={})),(function(n){n.ST=`${a.ESC}\\`})(u||(r.C1_ESCAPED=u={}))},7399:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=a(2584),u={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(n,d,f,p){const _={type:0,cancel:!1,key:void 0},e=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?_.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?_.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?_.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(_.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:if(n.altKey){_.key=l.C0.ESC+l.C0.DEL;break}_.key=l.C0.DEL;break;case 9:if(n.shiftKey){_.key=l.C0.ESC+"[Z";break}_.key=l.C0.HT,_.cancel=!0;break;case 13:_.key=n.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,_.cancel=!0;break;case 27:_.key=l.C0.ESC,n.altKey&&(_.key=l.C0.ESC+l.C0.ESC),_.cancel=!0;break;case 37:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"D",_.key===l.C0.ESC+"[1;3D"&&(_.key=l.C0.ESC+(f?"b":"[1;5D"))):_.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"C",_.key===l.C0.ESC+"[1;3C"&&(_.key=l.C0.ESC+(f?"f":"[1;5C"))):_.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"A",f||_.key!==l.C0.ESC+"[1;3A"||(_.key=l.C0.ESC+"[1;5A")):_.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"B",f||_.key!==l.C0.ESC+"[1;3B"||(_.key=l.C0.ESC+"[1;5B")):_.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(_.key=l.C0.ESC+"[2~");break;case 46:_.key=e?l.C0.ESC+"[3;"+(e+1)+"~":l.C0.ESC+"[3~";break;case 36:_.key=e?l.C0.ESC+"[1;"+(e+1)+"H":d?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:_.key=e?l.C0.ESC+"[1;"+(e+1)+"F":d?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:n.shiftKey?_.type=2:n.ctrlKey?_.key=l.C0.ESC+"[5;"+(e+1)+"~":_.key=l.C0.ESC+"[5~";break;case 34:n.shiftKey?_.type=3:n.ctrlKey?_.key=l.C0.ESC+"[6;"+(e+1)+"~":_.key=l.C0.ESC+"[6~";break;case 112:_.key=e?l.C0.ESC+"[1;"+(e+1)+"P":l.C0.ESC+"OP";break;case 113:_.key=e?l.C0.ESC+"[1;"+(e+1)+"Q":l.C0.ESC+"OQ";break;case 114:_.key=e?l.C0.ESC+"[1;"+(e+1)+"R":l.C0.ESC+"OR";break;case 115:_.key=e?l.C0.ESC+"[1;"+(e+1)+"S":l.C0.ESC+"OS";break;case 116:_.key=e?l.C0.ESC+"[15;"+(e+1)+"~":l.C0.ESC+"[15~";break;case 117:_.key=e?l.C0.ESC+"[17;"+(e+1)+"~":l.C0.ESC+"[17~";break;case 118:_.key=e?l.C0.ESC+"[18;"+(e+1)+"~":l.C0.ESC+"[18~";break;case 119:_.key=e?l.C0.ESC+"[19;"+(e+1)+"~":l.C0.ESC+"[19~";break;case 120:_.key=e?l.C0.ESC+"[20;"+(e+1)+"~":l.C0.ESC+"[20~";break;case 121:_.key=e?l.C0.ESC+"[21;"+(e+1)+"~":l.C0.ESC+"[21~";break;case 122:_.key=e?l.C0.ESC+"[23;"+(e+1)+"~":l.C0.ESC+"[23~";break;case 123:_.key=e?l.C0.ESC+"[24;"+(e+1)+"~":l.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(f&&!p||!n.altKey||n.metaKey)!f||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?_.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(_.key=l.C0.US),n.key==="@"&&(_.key=l.C0.NUL)):n.keyCode===65&&(_.type=1);else{const s=u[n.keyCode],t=s?.[n.shiftKey?1:0];if(t)_.key=l.C0.ESC+t;else if(n.keyCode>=65&&n.keyCode<=90){const i=n.ctrlKey?n.keyCode-64:n.keyCode+32;let o=String.fromCharCode(i);n.shiftKey&&(o=o.toUpperCase()),_.key=l.C0.ESC+o}else if(n.keyCode===32)_.key=l.C0.ESC+(n.ctrlKey?l.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let i=n.code.slice(3,4);n.shiftKey||(i=i.toLowerCase()),_.key=l.C0.ESC+i,_.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?_.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?_.key=l.C0.NUL:n.keyCode>=51&&n.keyCode<=55?_.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?_.key=l.C0.DEL:n.keyCode===219?_.key=l.C0.ESC:n.keyCode===220?_.key=l.C0.FS:n.keyCode===221&&(_.key=l.C0.GS)}return _}},482:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},r.utf32ToString=function(a,l=0,u=a.length){let n="";for(let d=l;d<u;++d){let f=a[d];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const u=a.length;if(!u)return 0;let n=0,d=0;if(this._interim){const f=a.charCodeAt(d++);56320<=f&&f<=57343?l[n++]=1024*(this._interim-55296)+f-56320+65536:(l[n++]=this._interim,l[n++]=f),this._interim=0}for(let f=d;f<u;++f){const p=a.charCodeAt(f);if(55296<=p&&p<=56319){if(++f>=u)return this._interim=p,n;const _=a.charCodeAt(f);56320<=_&&_<=57343?l[n++]=1024*(p-55296)+_-56320+65536:(l[n++]=p,l[n++]=_)}else p!==65279&&(l[n++]=p)}return n}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const u=a.length;if(!u)return 0;let n,d,f,p,_=0,e=0,s=0;if(this.interim[0]){let o=!1,c=this.interim[0];c&=(224&c)==192?31:(240&c)==224?15:7;let v,m=0;for(;(v=63&this.interim[++m])&&m<4;)c<<=6,c|=v;const h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,g=h-m;for(;s<g;){if(s>=u)return 0;if(v=a[s++],(192&v)!=128){s--,o=!0;break}this.interim[m++]=v,c<<=6,c|=63&v}o||(h===2?c<128?s--:l[_++]=c:h===3?c<2048||c>=55296&&c<=57343||c===65279||(l[_++]=c):c<65536||c>1114111||(l[_++]=c)),this.interim.fill(0)}const t=u-4;let i=s;for(;i<u;){for(;!(!(i<t)||128&(n=a[i])||128&(d=a[i+1])||128&(f=a[i+2])||128&(p=a[i+3]));)l[_++]=n,l[_++]=d,l[_++]=f,l[_++]=p,i+=4;if(n=a[i++],n<128)l[_++]=n;else if((224&n)==192){if(i>=u)return this.interim[0]=n,_;if(d=a[i++],(192&d)!=128){i--;continue}if(e=(31&n)<<6|63&d,e<128){i--;continue}l[_++]=e}else if((240&n)==224){if(i>=u)return this.interim[0]=n,_;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,_;if(f=a[i++],(192&f)!=128){i--;continue}if(e=(15&n)<<12|(63&d)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;l[_++]=e}else if((248&n)==240){if(i>=u)return this.interim[0]=n,_;if(d=a[i++],(192&d)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,_;if(f=a[i++],(192&f)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=f,_;if(p=a[i++],(192&p)!=128){i--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&f)<<6|63&p,e<65536||e>1114111)continue;l[_++]=e}}return _}}},225:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const a=[[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]],l=[[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 u;r.UnicodeV6=class{constructor(){if(this.version="6",!u){u=new Uint8Array(65536),u.fill(1),u[0]=0,u.fill(0,1,32),u.fill(0,127,160),u.fill(2,4352,4448),u[9001]=2,u[9002]=2,u.fill(2,11904,42192),u[12351]=1,u.fill(2,44032,55204),u.fill(2,63744,64256),u.fill(2,65040,65050),u.fill(2,65072,65136),u.fill(2,65280,65377),u.fill(2,65504,65511);for(let n=0;n<a.length;++n)u.fill(0,a[n][0],a[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?u[n]:(function(d,f){let p,_=0,e=f.length-1;if(d<f[0][0]||d>f[e][1])return!1;for(;e>=_;)if(p=_+e>>1,d>f[p][1])_=p+1;else{if(!(d<f[p][0]))return!0;e=p-1}return!1})(n,l)?0:n>=131072&&n<=196605||n>=196608&&n<=262141?2:1}}},5981:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const l=a(8460),u=a(844);class n extends u.Disposable{constructor(f){super(),this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,p){if(p!==void 0&&this._syncCalls>p)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,p){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(p),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(p)}_innerWrite(f=0,p=!0){const _=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,p);if(s){const i=o=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,o))):this._innerWrite(_,o);return void s.catch((o=>(queueMicrotask((()=>{throw o})),Promise.resolve(!1)))).then(i)}const t=this._callbacks[this._bufferOffset];if(t&&t(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-_>=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=n},5941:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,l=/^[\da-f]+$/;function u(n,d){const f=n.toString(16),p=f.length<2?"0"+f:f;switch(d){case 4:return f[0];case 8:return p;case 12:return(p+p).slice(0,3);default:return p+p}}r.parseColor=function(n){if(!n)return;let d=n.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const f=a.exec(d);if(f){const p=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/p*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/p*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/p*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),l.exec(d)&&[3,6,9,12].includes(d.length))){const f=d.length/3,p=[0,0,0];for(let _=0;_<3;++_){const e=parseInt(d.slice(f*_,f*_+f),16);p[_]=f===1?e<<4:f===2?e:f===3?e>>4:e>>8}return p}},r.toRgbString=function(n,d=16){const[f,p,_]=n;return`rgb:${u(f,d)}/${u(p,d)}/${u(_,d)}`}},5770:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const l=a(482),u=a(8742),n=a(5770),d=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(p,_){this._handlers[p]===void 0&&(this._handlers[p]=[]);const e=this._handlers[p];return e.push(_),{dispose:()=>{const s=e.indexOf(_);s!==-1&&e.splice(s,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}reset(){if(this._active.length)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(p,_){if(this.reset(),this._ident=p,this._active=this._handlers[p]||d,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(p,_,e){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(p,_,e);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(p,_,e))}unhook(p,_=!0){if(this._active.length){let e=!1,s=this._active.length-1,t=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,e=_,t=this._stack.fallThrough,this._stack.paused=!1),!t&&e===!1){for(;s>=0&&(e=this._active[s].unhook(p),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",p);this._active=d,this._ident=0}};const f=new u.Params;f.addParam(0),r.DcsHandler=class{constructor(p){this._handler=p,this._data="",this._params=f,this._hitLimit=!1}hook(p){this._params=p.length>1||p.params[0]?p.clone():f,this._data="",this._hitLimit=!1}put(p,_,e){this._hitLimit||(this._data+=(0,l.utf32ToString)(p,_,e),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(p){let _=!1;if(this._hitLimit)_=!1;else if(p&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((e=>(this._params=f,this._data="",this._hitLimit=!1,e)));return this._params=f,this._data="",this._hitLimit=!1,_}}},2015:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const l=a(844),u=a(8742),n=a(6242),d=a(6351);class f{constructor(s){this.table=new Uint8Array(s)}setDefault(s,t){this.table.fill(s<<4|t)}add(s,t,i,o){this.table[t<<8|s]=i<<4|o}addMany(s,t,i,o){for(let c=0;c<s.length;c++)this.table[t<<8|s[c]]=i<<4|o}}r.TransitionTable=f;const p=160;r.VT500_TRANSITION_TABLE=(function(){const e=new f(4095),s=Array.apply(null,Array(256)).map(((m,h)=>h)),t=(m,h)=>s.slice(m,h),i=t(32,127),o=t(0,24);o.push(25),o.push.apply(o,t(28,32));const c=t(0,14);let v;for(v in e.setDefault(1,0),e.addMany(i,0,2,0),c)e.addMany([24,26,153,154],v,3,0),e.addMany(t(128,144),v,3,0),e.addMany(t(144,152),v,3,0),e.add(156,v,0,0),e.add(27,v,11,1),e.add(157,v,4,8),e.addMany([152,158,159],v,0,7),e.add(155,v,11,3),e.add(144,v,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(t(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(t(64,127),3,7,0),e.addMany(t(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(t(48,60),4,8,4),e.addMany(t(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(t(32,64),6,0,6),e.add(127,6,0,6),e.addMany(t(64,127),6,0,0),e.addMany(t(32,48),3,9,5),e.addMany(t(32,48),5,9,5),e.addMany(t(48,64),5,0,6),e.addMany(t(64,127),5,7,0),e.addMany(t(32,48),4,9,5),e.addMany(t(32,48),1,9,2),e.addMany(t(32,48),2,9,2),e.addMany(t(48,127),2,10,0),e.addMany(t(48,80),1,10,0),e.addMany(t(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(t(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(t(28,32),9,0,9),e.addMany(t(32,48),9,9,12),e.addMany(t(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(t(32,128),11,0,11),e.addMany(t(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(t(28,32),10,0,10),e.addMany(t(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(t(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(t(28,32),12,0,12),e.addMany(t(32,48),12,9,12),e.addMany(t(48,64),12,0,11),e.addMany(t(64,127),12,12,13),e.addMany(t(64,127),10,12,13),e.addMany(t(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(p,0,2,0),e.add(p,8,5,8),e.add(p,6,0,6),e.add(p,11,0,11),e.add(p,13,13,13),e})();class _ extends l.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 u.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(t,i,o)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(s,t=[64,126]){let i=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=s.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let c=0;c<s.intermediates.length;++c){const v=s.intermediates.charCodeAt(c);if(32>v||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=v}}if(s.final.length!==1)throw new Error("final must be a single byte");const o=s.final.charCodeAt(0);if(t[0]>o||o>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=o,i}identToString(s){const t=[];for(;s;)t.push(String.fromCharCode(255&s)),s>>=8;return t.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,t){const i=this._identifier(s,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);const o=this._escHandlers[i];return o.push(t),{dispose:()=>{const c=o.indexOf(t);c!==-1&&o.splice(c,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,t){this._executeHandlers[s.charCodeAt(0)]=t}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,t){const i=this._identifier(s);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);const o=this._csiHandlers[i];return o.push(t),{dispose:()=>{const c=o.indexOf(t);c!==-1&&o.splice(c,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,t){return this._dcsParser.registerHandler(this._identifier(s),t)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,t){return this._oscParser.registerHandler(s,t)}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,t,i,o,c){this._parseStack.state=s,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=o,this._parseStack.chunkPos=c}parse(s,t,i){let o,c=0,v=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const h=this._parseStack.handlers;let g=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&g>-1){for(;g>=0&&(o=h[g](this._params),o!==!0);g--)if(o instanceof Promise)return this._parseStack.handlerPos=g,o}this._parseStack.handlers=[];break;case 4:if(i===!1&&g>-1){for(;g>=0&&(o=h[g](),o!==!0);g--)if(o instanceof Promise)return this._parseStack.handlerPos=g,o}this._parseStack.handlers=[];break;case 6:if(c=s[this._parseStack.chunkPos],o=this._dcsParser.unhook(c!==24&&c!==26,i),o)return o;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(c=s[this._parseStack.chunkPos],o=this._oscParser.end(c!==24&&c!==26,i),o)return o;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let h=m;h<t;++h){switch(c=s[h],v=this._transitions.table[this.currentState<<8|(c<160?c:p)],v>>4){case 2:for(let k=h+1;;++k){if(k>=t||(c=s[k])<32||c>126&&c<p){this._printHandler(s,h,k),h=k-1;break}if(++k>=t||(c=s[k])<32||c>126&&c<p){this._printHandler(s,h,k),h=k-1;break}if(++k>=t||(c=s[k])<32||c>126&&c<p){this._printHandler(s,h,k),h=k-1;break}if(++k>=t||(c=s[k])<32||c>126&&c<p){this._printHandler(s,h,k),h=k-1;break}}break;case 3:this._executeHandlers[c]?this._executeHandlers[c]():this._executeHandlerFb(c),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:c,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const g=this._csiHandlers[this._collect<<8|c];let b=g?g.length-1:-1;for(;b>=0&&(o=g[b](this._params),o!==!0);b--)if(o instanceof Promise)return this._preserveStack(3,g,b,v,h),o;b<0&&this._csiHandlerFb(this._collect<<8|c,this._params),this.precedingCodepoint=0;break;case 8:do switch(c){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(c-48)}while(++h<t&&(c=s[h])>47&&c<60);h--;break;case 9:this._collect<<=8,this._collect|=c;break;case 10:const L=this._escHandlers[this._collect<<8|c];let y=L?L.length-1:-1;for(;y>=0&&(o=L[y](),o!==!0);y--)if(o instanceof Promise)return this._preserveStack(4,L,y,v,h),o;y<0&&this._escHandlerFb(this._collect<<8|c),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|c,this._params);break;case 13:for(let k=h+1;;++k)if(k>=t||(c=s[k])===24||c===26||c===27||c>127&&c<p){this._dcsParser.put(s,h,k),h=k-1;break}break;case 14:if(o=this._dcsParser.unhook(c!==24&&c!==26),o)return this._preserveStack(6,[],0,v,h),o;c===27&&(v|=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=h+1;;k++)if(k>=t||(c=s[k])<32||c>127&&c<p){this._oscParser.put(s,h,k),h=k-1;break}break;case 6:if(o=this._oscParser.end(c!==24&&c!==26),o)return this._preserveStack(5,[],0,v,h),o;c===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&v}}}r.EscapeSequenceParser=_},6242:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const l=a(5770),u=a(482),n=[];r.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,f){this._handlers[d]===void 0&&(this._handlers[d]=[]);const p=this._handlers[d];return p.push(f),{dispose:()=>{const _=p.indexOf(f);_!==-1&&p.splice(_,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,f,p){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(d,f,p);else this._handlerFb(this._id,"PUT",(0,u.utf32ToString)(d,f,p))}start(){this.reset(),this._state=1}put(d,f,p){if(this._state!==3){if(this._state===1)for(;f<p;){const _=d[f++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&p-f>0&&this._put(d,f,p)}}end(d,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let p=!1,_=this._active.length-1,e=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,p=f,e=this._stack.fallThrough,this._stack.paused=!1),!e&&p===!1){for(;_>=0&&(p=this._active[_].end(d),p!==!0);_--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,p;_--}for(;_>=0;_--)if(p=this._active[_].end(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,p}else this._handlerFb(this._id,"END",d);this._active=n,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,f,p){this._hitLimit||(this._data+=(0,u.utf32ToString)(d,f,p),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let f=!1;if(this._hitLimit)f=!1;else if(d&&(f=this._handler(this._data),f instanceof Promise))return f.then((p=>(this._data="",this._hitLimit=!1,p)));return this._data="",this._hitLimit=!1,f}}},8742:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const a=2147483647;class l{static fromArray(n){const d=new l;if(!n.length)return d;for(let f=Array.isArray(n[0])?1:0;f<n.length;++f){const p=n[f];if(Array.isArray(p))for(let _=0;_<p.length;++_)d.addSubParam(p[_]);else d.addParam(p)}return d}constructor(n=32,d=32){if(this.maxLength=n,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new l(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let d=0;d<this.length;++d){n.push(this.params[d]);const f=this._subParamsIdx[d]>>8,p=255&this._subParamsIdx[d];p-f>0&&n.push(Array.prototype.slice.call(this._subParams,f,p))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>a?a:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>a?a:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const d=this._subParamsIdx[n]>>8,f=255&this._subParamsIdx[n];return f-d>0?this._subParams.subarray(d,f):null}getSubParamsAll(){const n={};for(let d=0;d<this.length;++d){const f=this._subParamsIdx[d]>>8,p=255&this._subParamsIdx[d];p-f>0&&(n[d]=this._subParams.slice(f,p))}return n}addDigit(n){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,p=f[d-1];f[d-1]=~p?Math.min(10*p+n,a):n}}r.Params=l},5741:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,l){const u={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(u),l.dispose=()=>this._wrappedAddonDispose(u),l.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let l=-1;for(let u=0;u<this._addons.length;u++)if(this._addons[u]===a){l=u;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(l,1)}}},8771:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const l=a(3785),u=a(511);r.BufferApiView=class{constructor(n,d){this._buffer=n,this.type=d}init(n){return this._buffer=n,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(n){const d=this._buffer.lines.get(n);if(d)return new l.BufferLineApiView(d)}getNullCell(){return new u.CellData}}},3785:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const l=a(511);r.BufferLineApiView=class{constructor(u){this._line=u}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(u,n){if(!(u<0||u>=this._line.length))return n?(this._line.loadCell(u,n),n):this._line.loadCell(u,new l.CellData)}translateToString(u,n,d){return this._line.translateToString(u,n,d)}}},8285:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const l=a(8771),u=a(8460),n=a(844);class d extends n.Disposable{constructor(p){super(),this._core=p,this._onBufferChange=this.register(new u.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}r.BufferNamespaceApi=d},7975:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,l){return this._core.registerCsiHandler(a,(u=>l(u.toArray())))}addCsiHandler(a,l){return this.registerCsiHandler(a,l)}registerDcsHandler(a,l){return this._core.registerDcsHandler(a,((u,n)=>l(u,n.toArray())))}addDcsHandler(a,l){return this.registerDcsHandler(a,l)}registerEscHandler(a,l){return this._core.registerEscHandler(a,l)}addEscHandler(a,l){return this.registerEscHandler(a,l)}registerOscHandler(a,l){return this._core.registerOscHandler(a,l)}addOscHandler(a,l){return this.registerOscHandler(a,l)}}},7090:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(I,r,a){var l=this&&this.__decorate||function(e,s,t,i){var o,c=arguments.length,v=c<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(v=(c<3?o(v):c>3?o(s,t,v):o(s,t))||v);return c>3&&v&&Object.defineProperty(s,t,v),v},u=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const n=a(8460),d=a(844),f=a(5295),p=a(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let _=r.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(e,this))}resize(e,s){this.cols=e,this.rows=s,this.buffers.resize(e,s),this._onResize.fire({cols:e,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,s=!1){const t=this.buffer;let i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===e.fg&&i.getBg(0)===e.bg||(i=t.getBlankLine(e,s),this._cachedBlankLine=i),i.isWrapped=s;const o=t.ybase+t.scrollTop,c=t.ybase+t.scrollBottom;if(t.scrollTop===0){const v=t.lines.isFull;c===t.lines.length-1?v?t.lines.recycle().copyFrom(i):t.lines.push(i.clone()):t.lines.splice(c+1,0,i.clone()),v?this.isUserScrolling&&(t.ydisp=Math.max(t.ydisp-1,0)):(t.ybase++,this.isUserScrolling||t.ydisp++)}else{const v=c-o+1;t.lines.shiftElements(o+1,v-1,-1),t.lines.set(c,i.clone())}this.isUserScrolling||(t.ydisp=t.ybase),this._onScroll.fire(t.ydisp)}scrollLines(e,s,t){const i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);const o=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),o!==i.ydisp&&(s||this._onScroll.fire(i.ydisp))}};r.BufferService=_=l([u(0,p.IOptionsService)],_)},7994:(I,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(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,l){this._charsets[a]=l,this.glevel===a&&(this.charset=l)}}},1753:function(I,r,a){var l=this&&this.__decorate||function(i,o,c,v){var m,h=arguments.length,g=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,o,c,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(g=(h<3?m(g):h>3?m(o,c,g):m(o,c))||g);return h>3&&g&&Object.defineProperty(o,c,g),g},u=this&&this.__param||function(i,o){return function(c,v){o(c,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const n=a(2585),d=a(8460),f=a(844),p={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:i=>i.button!==4&&i.action===1&&(i.ctrl=!1,i.alt=!1,i.shift=!1,!0)},VT200:{events:19,restrict:i=>i.action!==32},DRAG:{events:23,restrict:i=>i.action!==32||i.button!==3},ANY:{events:31,restrict:i=>!0}};function _(i,o){let c=(i.ctrl?16:0)|(i.shift?4:0)|(i.alt?8:0);return i.button===4?(c|=64,c|=i.action):(c|=3&i.button,4&i.button&&(c|=64),8&i.button&&(c|=128),i.action===32?c|=32:i.action!==0||o||(c|=3)),c}const e=String.fromCharCode,s={DEFAULT:i=>{const o=[_(i,!1)+32,i.col+32,i.row+32];return o[0]>255||o[1]>255||o[2]>255?"":`\x1B[M${e(o[0])}${e(o[1])}${e(o[2])}`},SGR:i=>{const o=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${_(i,!0)};${i.col};${i.row}${o}`},SGR_PIXELS:i=>{const o=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${_(i,!0)};${i.x};${i.y}${o}`}};let t=r.CoreMouseService=class extends f.Disposable{constructor(i,o){super(),this._bufferService=i,this._coreService=o,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const c of Object.keys(p))this.addProtocol(c,p[c]);for(const c of Object.keys(s))this.addEncoding(c,s[c]);this.reset()}addProtocol(i,o){this._protocols[i]=o}addEncoding(i,o){this._encodings[i]=o}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(i){if(!this._protocols[i])throw new Error(`unknown protocol "${i}"`);this._activeProtocol=i,this._onProtocolChange.fire(this._protocols[i].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(i){if(!this._encodings[i])throw new Error(`unknown encoding "${i}"`);this._activeEncoding=i}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(i){if(i.col<0||i.col>=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows||i.button===4&&i.action===32||i.button===3&&i.action!==32||i.button!==4&&(i.action===2||i.action===3)||(i.col++,i.row++,i.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,i,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(i))return!1;const o=this._encodings[this._activeEncoding](i);return o&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(o):this._coreService.triggerDataEvent(o,!0)),this._lastEvent=i,!0}explainEvents(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}}_equalEvents(i,o,c){if(c){if(i.x!==o.x||i.y!==o.y)return!1}else if(i.col!==o.col||i.row!==o.row)return!1;return i.button===o.button&&i.action===o.action&&i.ctrl===o.ctrl&&i.alt===o.alt&&i.shift===o.shift}};r.CoreMouseService=t=l([u(0,n.IBufferService),u(1,n.ICoreService)],t)},6975:function(I,r,a){var l=this&&this.__decorate||function(t,i,o,c){var v,m=arguments.length,h=m<3?i:c===null?c=Object.getOwnPropertyDescriptor(i,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(t,i,o,c);else for(var g=t.length-1;g>=0;g--)(v=t[g])&&(h=(m<3?v(h):m>3?v(i,o,h):v(i,o))||h);return m>3&&h&&Object.defineProperty(i,o,h),h},u=this&&this.__param||function(t,i){return function(o,c){i(o,c,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const n=a(1439),d=a(8460),f=a(844),p=a(2585),_=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=r.CoreService=class extends f.Disposable{constructor(t,i,o){super(),this._bufferService=t,this._logService=i,this._optionsService=o,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(_),this.decPrivateModes=(0,n.clone)(e)}reset(){this.modes=(0,n.clone)(_),this.decPrivateModes=(0,n.clone)(e)}triggerDataEvent(t,i=!1){if(this._optionsService.rawOptions.disableStdin)return;const o=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&o.ybase!==o.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`,(()=>t.split("").map((c=>c.charCodeAt(0))))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`,(()=>t.split("").map((i=>i.charCodeAt(0))))),this._onBinary.fire(t))}};r.CoreService=s=l([u(0,p.IBufferService),u(1,p.ILogService),u(2,p.IOptionsService)],s)},9074:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const l=a(8055),u=a(8460),n=a(844),d=a(6106);let f=0,p=0;class _ extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList((t=>t?.marker.line)),this._onDecorationRegistered=this.register(new u.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new u.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)((()=>this.reset())))}registerDecoration(t){if(t.marker.isDisposed)return;const i=new e(t);if(i){const o=i.marker.onDispose((()=>i.dispose()));i.onDispose((()=>{i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),o.dispose())})),this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(const t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,i,o){var c,v,m;let h=0,g=0;for(const b of this._decorations.getKeyIterator(i))h=(c=b.options.x)!==null&&c!==void 0?c:0,g=h+((v=b.options.width)!==null&&v!==void 0?v:1),t>=h&&t<g&&(!o||((m=b.options.layer)!==null&&m!==void 0?m:"bottom")===o)&&(yield b)}forEachDecorationAtCell(t,i,o,c){this._decorations.forEachByKey(i,(v=>{var m,h,g;f=(m=v.options.x)!==null&&m!==void 0?m:0,p=f+((h=v.options.width)!==null&&h!==void 0?h:1),t>=f&&t<p&&(!o||((g=v.options.layer)!==null&&g!==void 0?g:"bottom")===o)&&c(v)}))}}r.DecorationService=_;class e extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(t){super(),this.options=t,this.onRenderEmitter=this.register(new u.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const l=a(2585),u=a(8343);class n{constructor(...f){this._entries=new Map;for(const[p,_]of f)this.set(p,_)}set(f,p){const _=this._entries.get(f);return this._entries.set(f,p),_}forEach(f){for(const[p,_]of this._entries.entries())f(p,_)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}r.ServiceCollection=n,r.InstantiationService=class{constructor(){this._services=new n,this._services.set(l.IInstantiationService,this)}setService(d,f){this._services.set(d,f)}getService(d){return this._services.get(d)}createInstance(d,...f){const p=(0,u.getServiceDependencies)(d).sort(((s,t)=>s.index-t.index)),_=[];for(const s of p){const t=this._services.get(s.id);if(!t)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${s.id}.`);_.push(t)}const e=p.length>0?p[0].index:f.length;if(f.length!==e)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${e+1} conflicts with ${f.length} static arguments`);return new d(...f,..._)}}},7866:function(I,r,a){var l=this&&this.__decorate||function(e,s,t,i){var o,c=arguments.length,v=c<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(v=(c<3?o(v):c>3?o(s,t,v):o(s,t))||v);return c>3&&v&&Object.defineProperty(s,t,v),v},u=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const n=a(844),d=a(2585),f={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let p,_=r.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),p=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let s=0;s<e.length;s++)typeof e[s]=="function"&&(e[s]=e[s]())}_log(e,s,t){this._evalLazyOptionalParams(t),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...t)}trace(e,...s){var t,i;this._logLevel<=d.LogLevelEnum.TRACE&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.trace.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,e,s)}debug(e,...s){var t,i;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.debug.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,e,s)}info(e,...s){var t,i;this._logLevel<=d.LogLevelEnum.INFO&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.info.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.info,e,s)}warn(e,...s){var t,i;this._logLevel<=d.LogLevelEnum.WARN&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.warn.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.warn,e,s)}error(e,...s){var t,i;this._logLevel<=d.LogLevelEnum.ERROR&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.error.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.error,e,s)}};r.LogService=_=l([u(0,d.IOptionsService)],_),r.setTraceLogger=function(e){p=e},r.traceCall=function(e,s,t){if(typeof t.value!="function")throw new Error("not supported");const i=t.value;t.value=function(...o){if(p.logLevel!==d.LogLevelEnum.TRACE)return i.apply(this,o);p.trace(`GlyphRenderer#${i.name}(${o.map((v=>JSON.stringify(v))).join(", ")})`);const c=i.apply(this,o);return p.trace(`GlyphRenderer#${i.name} return`,c),c}}},7302:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const l=a(8460),u=a(844),n=a(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends u.Disposable{constructor(_){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e=Object.assign({},r.DEFAULT_OPTIONS);for(const s in _)if(s in e)try{const t=_[s];e[s]=this._sanitizeAndValidateOption(s,t)}catch(t){console.error(t)}this.rawOptions=e,this.options=Object.assign({},e),this._setupOptions()}onSpecificOptionChange(_,e){return this.onOptionChange((s=>{s===_&&e(this.rawOptions[_])}))}onMultipleOptionChange(_,e){return this.onOptionChange((s=>{_.indexOf(s)!==-1&&e()}))}_setupOptions(){const _=s=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},e=(s,t)=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);t=this._sanitizeAndValidateOption(s,t),this.rawOptions[s]!==t&&(this.rawOptions[s]=t,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const t={get:_.bind(this,s),set:e.bind(this,s)};Object.defineProperty(this.options,s,t)}}_sanitizeAndValidateOption(_,e){switch(_){case"cursorStyle":if(e||(e=r.DEFAULT_OPTIONS[_]),!(function(s){return s==="block"||s==="underline"||s==="bar"})(e))throw new Error(`"${e}" is not a valid value for ${_}`);break;case"wordSeparator":e||(e=r.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=d.includes(e)?e:r.DEFAULT_OPTIONS[_];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${_} 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(`${_} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${_} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}r.OptionsService=f},2660:function(I,r,a){var l=this&&this.__decorate||function(f,p,_,e){var s,t=arguments.length,i=t<3?p:e===null?e=Object.getOwnPropertyDescriptor(p,_):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(f,p,_,e);else for(var o=f.length-1;o>=0;o--)(s=f[o])&&(i=(t<3?s(i):t>3?s(p,_,i):s(p,_))||i);return t>3&&i&&Object.defineProperty(p,_,i),i},u=this&&this.__param||function(f,p){return function(_,e){p(_,e,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const n=a(2585);let d=r.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const p=this._bufferService.buffer;if(f.id===void 0){const o=p.addMarker(p.ybase+p.y),c={data:f,id:this._nextId++,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(c,o))),this._dataByLinkId.set(c.id,c),c.id}const _=f,e=this._getEntryIdKey(_),s=this._entriesWithId.get(e);if(s)return this.addLineToLink(s.id,p.ybase+p.y),s.id;const t=p.addMarker(p.ybase+p.y),i={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[t]};return t.onDispose((()=>this._removeMarkerFromLink(i,t))),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(f,p){const _=this._dataByLinkId.get(f);if(_&&_.lines.every((e=>e.line!==p))){const e=this._bufferService.buffer.addMarker(p);_.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(_,e)))}}getLinkData(f){var p;return(p=this._dataByLinkId.get(f))===null||p===void 0?void 0:p.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,p){const _=f.lines.indexOf(p);_!==-1&&(f.lines.splice(_,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};r.OscLinkService=d=l([u(0,n.IBufferService)],d)},8343:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const a="di$target",l="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(u){return u[l]||[]},r.createDecorator=function(u){if(r.serviceRegistry.has(u))return r.serviceRegistry.get(u);const n=function(d,f,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,e,s){e[a]===e?e[l].push({id:_,index:s}):(e[l]=[{id:_,index:s}],e[a]=e)})(n,d,p)};return n.toString=()=>u,r.serviceRegistry.set(u,n),n}},2585:(I,r,a)=>{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 l=a(8343);var u;r.IBufferService=(0,l.createDecorator)("BufferService"),r.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),r.ICoreService=(0,l.createDecorator)("CoreService"),r.ICharsetService=(0,l.createDecorator)("CharsetService"),r.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(u||(r.LogLevelEnum=u={})),r.ILogService=(0,l.createDecorator)("LogService"),r.IOptionsService=(0,l.createDecorator)("OptionsService"),r.IOscLinkService=(0,l.createDecorator)("OscLinkService"),r.IUnicodeService=(0,l.createDecorator)("UnicodeService"),r.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const l=a(8460),u=a(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const n=new u.UnicodeV6;this.register(n),this._active=n.version,this._activeProvider=n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(n){if(!this._providers[n])throw new Error(`unknown Unicode version "${n}"`);this._active=n,this._activeProvider=this._providers[n],this._onChange.fire(n)}register(n){this._providers[n.version]=n}wcwidth(n){return this._activeProvider.wcwidth(n)}getStringCellWidth(n){let d=0;const f=n.length;for(let p=0;p<f;++p){let _=n.charCodeAt(p);if(55296<=_&&_<=56319){if(++p>=f)return d+this.wcwidth(_);const e=n.charCodeAt(p);56320<=e&&e<=57343?_=1024*(_-55296)+e-56320+65536:d+=this.wcwidth(e)}d+=this.wcwidth(_)}return d}}}},Q={};function X(I){var r=Q[I];if(r!==void 0)return r.exports;var a=Q[I]={exports:{}};return ae[I].call(a.exports,a,a.exports,X),a.exports}var te={};return(()=>{var I=te;Object.defineProperty(I,"__esModule",{value:!0}),I.Terminal=void 0;const r=X(9042),a=X(3236),l=X(844),u=X(5741),n=X(8285),d=X(7975),f=X(7090),p=["cols","rows"];class _ extends l.Disposable{constructor(s){super(),this._core=this.register(new a.Terminal(s)),this._addonManager=this.register(new u.AddonManager),this._publicOptions=Object.assign({},this._core.options);const t=o=>this._core.options[o],i=(o,c)=>{this._checkReadonlyOptions(o),this._core.options[o]=c};for(const o in this._core.options){const c={get:t.bind(this,o),set:i.bind(this,o)};Object.defineProperty(this._publicOptions,o,c)}}_checkReadonlyOptions(s){if(p.includes(s))throw new Error(`Option "${s}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const t in s)this._publicOptions[t]=s[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(s,t){this._verifyIntegers(s,t),this._core.resize(s,t)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){var t,i,o;return this._checkProposedApi(),this._verifyPositiveIntegers((t=s.x)!==null&&t!==void 0?t:0,(i=s.width)!==null&&i!==void 0?i:0,(o=s.height)!==null&&o!==void 0?o:0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,t,i){this._verifyIntegers(s,t,i),this._core.select(s,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,t){this._verifyIntegers(s,t),this._core.selectLines(s,t)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,t){this._core.write(s,t)}writeln(s,t){this._core.write(s),this._core.write(`\r
9
- `,t)}paste(s){this._core.paste(s)}refresh(s,t){this._verifyIntegers(s,t),this._core.refresh(s,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const t of s)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const t of s)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}I.Terminal=_})(),te})()));
8
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(l){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),n.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 m=this._getMouseBufferCoords(l),C=this._model.finalSelectionStart,y=this._model.finalSelectionEnd;return!!(C&&y&&m)&&this._areCoordsInSelection(m,C,y)}isCellInSelection(l,m){const C=this._model.finalSelectionStart,y=this._model.finalSelectionEnd;return!(!C||!y)&&this._areCoordsInSelection([l,m],C,y)}_areCoordsInSelection(l,m,C){return l[1]>m[1]&&l[1]<C[1]||m[1]===C[1]&&l[1]===m[1]&&l[0]>=m[0]&&l[0]<C[0]||m[1]<C[1]&&l[1]===C[1]&&l[0]<C[0]||m[1]<C[1]&&l[1]===m[1]&&l[0]>=m[0]}_selectWordAtCursor(l,m){const C=this._linkifier.currentLink?.link?.range;if(C)return this._model.selectionStart=[C.start.x-1,C.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)(C,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const y=this._getMouseBufferCoords(l);return!!y&&(this._selectWordAt(y,m),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,m){this._model.clearSelection(),l=Math.max(l,0),m=Math.min(m,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,m],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){const m=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(m)return m[0]--,m[1]--,m[1]+=this._bufferService.buffer.ydisp,m}_getMouseEventScrollAmount(l){let m=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1];const C=this._renderService.dimensions.css.canvas.height;return m>=0&&m<=C?0:(m>C&&(m-=C),m=Math.min(Math.max(m,-50),50),m/=50,m/Math.abs(m)+Math.round(14*m))}shouldForceSelection(l){return n.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 m=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);m&&m.length!==this._model.selectionStart[0]&&m.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){const m=this._getMouseBufferCoords(l);m&&(this._activeSelectionMode=2,this._selectLineAt(m[1]))}shouldColumnSelect(l){return l.altKey&&!(n.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;const m=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(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 C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){const y=C.lines.get(this._model.selectionEnd[1]);y&&y.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}m&&m[0]===this._model.selectionEnd[0]&&m[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const 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 m=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&m<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const C=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){const y=(0,p.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(y,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const l=this._model.finalSelectionStart,m=this._model.finalSelectionEnd,C=!(!l||!m||l[0]===m[0]&&l[1]===m[1]);C?l&&m&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&m[0]===this._oldSelectionEnd[0]&&m[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,m,C)):this._oldHasSelection&&this._fireOnSelectionChange(l,m,C)}_fireOnSelectionChange(l,m,C){this._oldSelectionStart=l,this._oldSelectionEnd=m,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim((m=>this._handleTrim(m)))}_convertViewportColToCharacterIndex(l,m){let C=m;for(let y=0;m>=y;y++){const b=l.loadCell(y,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:b>1&&m!==y&&(C+=b-1)}return C}setSelection(l,m,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,m],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,m,C=!0,y=!0){if(l[0]>=this._bufferService.cols)return;const b=this._bufferService.buffer,D=b.lines.get(l[1]);if(!D)return;const T=b.translateBufferLineToString(l[1],!1);let P=this._convertViewportColToCharacterIndex(D,l[0]),M=P;const B=l[0]-P;let F=0,S=0,E=0,w=0;if(T.charAt(P)===" "){for(;P>0&&T.charAt(P-1)===" ";)P--;for(;M<T.length&&T.charAt(M+1)===" ";)M++}else{let N=l[0],H=l[0];D.getWidth(N)===0&&(F++,N--),D.getWidth(H)===2&&(S++,H++);const j=D.getString(H).length;for(j>1&&(w+=j-1,M+=j-1);N>0&&P>0&&!this._isCharWordSeparator(D.loadCell(N-1,this._workCell));){D.loadCell(N-1,this._workCell);const x=this._workCell.getChars().length;this._workCell.getWidth()===0?(F++,N--):x>1&&(E+=x-1,P-=x-1),P--,N--}for(;H<D.length&&M+1<T.length&&!this._isCharWordSeparator(D.loadCell(H+1,this._workCell));){D.loadCell(H+1,this._workCell);const x=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,H++):x>1&&(w+=x-1,M+=x-1),M++,H++}}M++;let L=P+B-F+E,O=Math.min(this._bufferService.cols,M-P+F+S-E-w);if(m||T.slice(P,M).trim()!==""){if(C&&L===0&&D.getCodePoint(0)!==32){const N=b.lines.get(l[1]-1);if(N&&D.isWrapped&&N.getCodePoint(this._bufferService.cols-1)!==32){const H=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if(H){const j=this._bufferService.cols-H.start;L-=j,O+=j}}}if(y&&L+O===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const N=b.lines.get(l[1]+1);if(N?.isWrapped&&N.getCodePoint(0)!==32){const H=this._getWordAt([0,l[1]+1],!1,!1,!0);H&&(O+=H.length)}}return{start:L,length:O}}}_selectWordAt(l,m){const C=this._getWordAt(l,m);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[C.start,l[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(l){const m=this._getWordAt(l,!0);if(m){let C=l[1];for(;m.start<0;)m.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;m.start+m.length>this._bufferService.cols;)m.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?m.start:m.start+m.length,C]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){const m=this._bufferService.buffer.getWrappedRangeForLine(l),C={start:{x:0,y:m.first},end:{x:this._bufferService.cols-1,y:m.last}};this._model.selectionStart=[0,m.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)(C,this._bufferService.cols)}};t.SelectionService=u,t.SelectionService=u=i([v(3,e.IBufferService),v(4,e.ICoreService),v(5,g.IMouseService),v(6,e.IOptionsService),v(7,g.IRenderService),v(8,g.ICoreBrowserService)],u)},7098:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const i=_(6201);t.ICharSizeService=(0,i.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,i.createDecorator)("CoreBrowserService"),t.IMouseService=(0,i.createDecorator)("MouseService"),t.IRenderService=(0,i.createDecorator)("RenderService"),t.ISelectionService=(0,i.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,i.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,i.createDecorator)("ThemeService"),t.ILinkProviderService=(0,i.createDecorator)("LinkProviderService")},9078:function(W,t,_){var i=this&&this.__decorate||function(m,C,y,b){var D,T=arguments.length,P=T<3?C:b===null?b=Object.getOwnPropertyDescriptor(C,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(m,C,y,b);else for(var M=m.length-1;M>=0;M--)(D=m[M])&&(P=(T<3?D(P):T>3?D(C,y,P):D(C,y))||P);return T>3&&P&&Object.defineProperty(C,y,P),P},v=this&&this.__param||function(m,C){return function(y,b){C(y,b,m)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=void 0;const o=_(7174),p=_(9302),f=_(4103),g=_(7150),c=_(6501),n=_(802),h=f.css.toColor("#ffffff"),s=f.css.toColor("#000000"),e=f.css.toColor("#ffffff"),r=s,a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},d=h;let u=class extends g.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this._register(new n.Emitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:s,cursor:e,cursorAccent:r,selectionForeground:void 0,selectionBackgroundTransparent:a,selectionBackgroundOpaque:f.color.blend(s,a),selectionInactiveBackgroundTransparent:a,selectionInactiveBackgroundOpaque:f.color.blend(s,a),scrollbarSliderBackground:f.color.opacity(h,.2),scrollbarSliderHoverBackground:f.color.opacity(h,.4),scrollbarSliderActiveBackground:f.color.opacity(h,.5),overviewRulerBorder:h,ansi:p.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this._register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(m={}){const C=this._colors;if(C.foreground=l(m.foreground,h),C.background=l(m.background,s),C.cursor=f.color.blend(C.background,l(m.cursor,e)),C.cursorAccent=f.color.blend(C.background,l(m.cursorAccent,r)),C.selectionBackgroundTransparent=l(m.selectionBackground,a),C.selectionBackgroundOpaque=f.color.blend(C.background,C.selectionBackgroundTransparent),C.selectionInactiveBackgroundTransparent=l(m.selectionInactiveBackground,C.selectionBackgroundTransparent),C.selectionInactiveBackgroundOpaque=f.color.blend(C.background,C.selectionInactiveBackgroundTransparent),C.selectionForeground=m.selectionForeground?l(m.selectionForeground,f.NULL_COLOR):void 0,C.selectionForeground===f.NULL_COLOR&&(C.selectionForeground=void 0),f.color.isOpaque(C.selectionBackgroundTransparent)&&(C.selectionBackgroundTransparent=f.color.opacity(C.selectionBackgroundTransparent,.3)),f.color.isOpaque(C.selectionInactiveBackgroundTransparent)&&(C.selectionInactiveBackgroundTransparent=f.color.opacity(C.selectionInactiveBackgroundTransparent,.3)),C.scrollbarSliderBackground=l(m.scrollbarSliderBackground,f.color.opacity(C.foreground,.2)),C.scrollbarSliderHoverBackground=l(m.scrollbarSliderHoverBackground,f.color.opacity(C.foreground,.4)),C.scrollbarSliderActiveBackground=l(m.scrollbarSliderActiveBackground,f.color.opacity(C.foreground,.5)),C.overviewRulerBorder=l(m.overviewRulerBorder,d),C.ansi=p.DEFAULT_ANSI_COLORS.slice(),C.ansi[0]=l(m.black,p.DEFAULT_ANSI_COLORS[0]),C.ansi[1]=l(m.red,p.DEFAULT_ANSI_COLORS[1]),C.ansi[2]=l(m.green,p.DEFAULT_ANSI_COLORS[2]),C.ansi[3]=l(m.yellow,p.DEFAULT_ANSI_COLORS[3]),C.ansi[4]=l(m.blue,p.DEFAULT_ANSI_COLORS[4]),C.ansi[5]=l(m.magenta,p.DEFAULT_ANSI_COLORS[5]),C.ansi[6]=l(m.cyan,p.DEFAULT_ANSI_COLORS[6]),C.ansi[7]=l(m.white,p.DEFAULT_ANSI_COLORS[7]),C.ansi[8]=l(m.brightBlack,p.DEFAULT_ANSI_COLORS[8]),C.ansi[9]=l(m.brightRed,p.DEFAULT_ANSI_COLORS[9]),C.ansi[10]=l(m.brightGreen,p.DEFAULT_ANSI_COLORS[10]),C.ansi[11]=l(m.brightYellow,p.DEFAULT_ANSI_COLORS[11]),C.ansi[12]=l(m.brightBlue,p.DEFAULT_ANSI_COLORS[12]),C.ansi[13]=l(m.brightMagenta,p.DEFAULT_ANSI_COLORS[13]),C.ansi[14]=l(m.brightCyan,p.DEFAULT_ANSI_COLORS[14]),C.ansi[15]=l(m.brightWhite,p.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const y=Math.min(C.ansi.length-16,m.extendedAnsi.length);for(let b=0;b<y;b++)C.ansi[b+16]=l(m.extendedAnsi[b],p.DEFAULT_ANSI_COLORS[b+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[m]=this._restoreColors.ansi[m]}else for(let C=0;C<this._restoreColors.ansi.length;++C)this._colors.ansi[C]=this._restoreColors.ansi[C]}modifyColors(m){m(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function l(m,C){if(m!==void 0)try{return f.css.toColor(m)}catch{}return C}t.ThemeService=u,t.ThemeService=u=i([v(0,c.IOptionsService)],u)},5639:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const i=_(7150),v=_(802);class o extends i.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this._register(new v.Emitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new v.Emitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new v.Emitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(f){if(this._maxLength===f)return;const g=new Array(f);for(let c=0;c<Math.min(f,this.length);c++)g[c]=this._array[this._getCyclicIndex(c)];this._array=g,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let g=this._length;g<f;g++)this._array[g]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,g){this._array[this._getCyclicIndex(f)]=g}push(f){this._array[this._getCyclicIndex(this._length)]=f,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(f,g,...c){if(g){for(let n=f;n<this._length-g;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+g)];this._length-=g,this.onDeleteEmitter.fire({index:f,amount:g})}for(let n=this._length-1;n>=f;n--)this._array[this._getCyclicIndex(n+c.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<c.length;n++)this._array[this._getCyclicIndex(f+n)]=c[n];if(c.length&&this.onInsertEmitter.fire({index:f,amount:c.length}),this._length+c.length>this._maxLength){const n=this._length+c.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=c.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,g,c){if(!(g<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+c<0)throw new Error("Cannot shift elements in list beyond index 0");if(c>0){for(let h=g-1;h>=0;h--)this.set(f+h+c,this.get(f+h));const n=f+g+c-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<g;n++)this.set(f+n+c,this.get(f+n))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}t.CircularList=o},7453:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=function _(i,v=5){if(typeof i!="object")return i;const o=Array.isArray(i)?[]:{};for(const p in i)o[p]=v<=1?i[p]:i[p]&&_(i[p],v-1);return o}},4103:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0,t.toPaddedHex=h,t.contrastRatio=s;let _=0,i=0,v=0,o=0;var p,f,g,c,n;function h(e){const r=e.toString(16);return r.length<2?"0"+r:r}function s(e,r){return e<r?(r+.05)/(e+.05):(e+.05)/(r+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},(function(e){e.toCss=function(r,a,d,u){return u!==void 0?`#${h(r)}${h(a)}${h(d)}${h(u)}`:`#${h(r)}${h(a)}${h(d)}`},e.toRgba=function(r,a,d,u=255){return(r<<24|a<<16|d<<8|u)>>>0},e.toColor=function(r,a,d,u){return{css:e.toCss(r,a,d,u),rgba:e.toRgba(r,a,d,u)}}})(p||(t.channels=p={})),(function(e){function r(a,d){return o=Math.round(255*d),[_,i,v]=n.toChannels(a.rgba),{css:p.toCss(_,i,v,o),rgba:p.toRgba(_,i,v,o)}}e.blend=function(a,d){if(o=(255&d.rgba)/255,o===1)return{css:d.css,rgba:d.rgba};const u=d.rgba>>24&255,l=d.rgba>>16&255,m=d.rgba>>8&255,C=a.rgba>>24&255,y=a.rgba>>16&255,b=a.rgba>>8&255;return _=C+Math.round((u-C)*o),i=y+Math.round((l-y)*o),v=b+Math.round((m-b)*o),{css:p.toCss(_,i,v),rgba:p.toRgba(_,i,v)}},e.isOpaque=function(a){return!(255&~a.rgba)},e.ensureContrastRatio=function(a,d,u){const l=n.ensureContrastRatio(a.rgba,d.rgba,u);if(l)return p.toColor(l>>24&255,l>>16&255,l>>8&255)},e.opaque=function(a){const d=(255|a.rgba)>>>0;return[_,i,v]=n.toChannels(d),{css:p.toCss(_,i,v),rgba:d}},e.opacity=r,e.multiplyOpacity=function(a,d){return o=255&a.rgba,r(a,o*d/255)},e.toColorRGB=function(a){return[a.rgba>>24&255,a.rgba>>16&255,a.rgba>>8&255]}})(f||(t.color=f={})),(function(e){let r,a;try{const d=document.createElement("canvas");d.width=1,d.height=1;const u=d.getContext("2d",{willReadFrequently:!0});u&&(r=u,r.globalCompositeOperation="copy",a=r.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(d){if(d.match(/#[\da-f]{3,8}/i))switch(d.length){case 4:return _=parseInt(d.slice(1,2).repeat(2),16),i=parseInt(d.slice(2,3).repeat(2),16),v=parseInt(d.slice(3,4).repeat(2),16),p.toColor(_,i,v);case 5:return _=parseInt(d.slice(1,2).repeat(2),16),i=parseInt(d.slice(2,3).repeat(2),16),v=parseInt(d.slice(3,4).repeat(2),16),o=parseInt(d.slice(4,5).repeat(2),16),p.toColor(_,i,v,o);case 7:return{css:d,rgba:(parseInt(d.slice(1),16)<<8|255)>>>0};case 9:return{css:d,rgba:parseInt(d.slice(1),16)>>>0}}const u=d.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(u)return _=parseInt(u[1]),i=parseInt(u[2]),v=parseInt(u[3]),o=Math.round(255*(u[5]===void 0?1:parseFloat(u[5]))),p.toColor(_,i,v,o);if(!r||!a)throw new Error("css.toColor: Unsupported css format");if(r.fillStyle=a,r.fillStyle=d,typeof r.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(r.fillRect(0,0,1,1),[_,i,v,o]=r.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(_,i,v,o),css:d}}})(g||(t.css=g={})),(function(e){function r(a,d,u){const l=a/255,m=d/255,C=u/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}e.relativeLuminance=function(a){return r(a>>16&255,a>>8&255,255&a)},e.relativeLuminance2=r})(c||(t.rgb=c={})),(function(e){function r(d,u,l){const m=d>>24&255,C=d>>16&255,y=d>>8&255;let b=u>>24&255,D=u>>16&255,T=u>>8&255,P=s(c.relativeLuminance2(b,D,T),c.relativeLuminance2(m,C,y));for(;P<l&&(b>0||D>0||T>0);)b-=Math.max(0,Math.ceil(.1*b)),D-=Math.max(0,Math.ceil(.1*D)),T-=Math.max(0,Math.ceil(.1*T)),P=s(c.relativeLuminance2(b,D,T),c.relativeLuminance2(m,C,y));return(b<<24|D<<16|T<<8|255)>>>0}function a(d,u,l){const m=d>>24&255,C=d>>16&255,y=d>>8&255;let b=u>>24&255,D=u>>16&255,T=u>>8&255,P=s(c.relativeLuminance2(b,D,T),c.relativeLuminance2(m,C,y));for(;P<l&&(b<255||D<255||T<255);)b=Math.min(255,b+Math.ceil(.1*(255-b))),D=Math.min(255,D+Math.ceil(.1*(255-D))),T=Math.min(255,T+Math.ceil(.1*(255-T))),P=s(c.relativeLuminance2(b,D,T),c.relativeLuminance2(m,C,y));return(b<<24|D<<16|T<<8|255)>>>0}e.blend=function(d,u){if(o=(255&u)/255,o===1)return u;const l=u>>24&255,m=u>>16&255,C=u>>8&255,y=d>>24&255,b=d>>16&255,D=d>>8&255;return _=y+Math.round((l-y)*o),i=b+Math.round((m-b)*o),v=D+Math.round((C-D)*o),p.toRgba(_,i,v)},e.ensureContrastRatio=function(d,u,l){const m=c.relativeLuminance(d>>8),C=c.relativeLuminance(u>>8);if(s(m,C)<l){if(C<m){const D=r(d,u,l),T=s(m,c.relativeLuminance(D>>8));if(T<l){const P=a(d,u,l);return T>s(m,c.relativeLuminance(P>>8))?D:P}return D}const y=a(d,u,l),b=s(m,c.relativeLuminance(y>>8));if(b<l){const D=r(d,u,l);return b>s(m,c.relativeLuminance(D>>8))?y:D}return y}},e.reduceLuminance=r,e.increaseLuminance=a,e.toChannels=function(d){return[d>>24&255,d>>16&255,d>>8&255,255&d]}})(n||(t.rgba=n={}))},5777:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const i=_(6501),v=_(6025),o=_(7276),p=_(9640),f=_(56),g=_(4071),c=_(7792),n=_(6415),h=_(5746),s=_(5882),e=_(2486),r=_(3562),a=_(8811),d=_(802),u=_(7150);let l=!1;class m extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new d.Emitter),this._onScroll.event((y=>{this._onScrollApi?.fire(y.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(y){for(const b in y)this.optionsService.options[b]=y[b]}constructor(y){super(),this._windowsWrappingHeuristics=this._register(new u.MutableDisposable),this._onBinary=this._register(new d.Emitter),this.onBinary=this._onBinary.event,this._onData=this._register(new d.Emitter),this.onData=this._onData.event,this._onLineFeed=this._register(new d.Emitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new d.Emitter),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new d.Emitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new d.Emitter),this._instantiationService=new v.InstantiationService,this.optionsService=this._register(new f.OptionsService(y)),this._instantiationService.setService(i.IOptionsService,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(i.IBufferService,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(o.LogService)),this._instantiationService.setService(i.ILogService,this._logService),this.coreService=this._register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(i.ICoreService,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(i.ICoreMouseService,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(n.UnicodeService)),this._instantiationService.setService(i.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(i.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(a.OscLinkService),this._instantiationService.setService(i.IOscLinkService,this._oscLinkService),this._inputHandler=this._register(new e.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(d.Event.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(d.Event.forward(this._bufferService.onResize,this._onResize)),this._register(d.Event.forward(this.coreService.onData,this._onData)),this._register(d.Event.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom(!0)))),this._register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this._register(this._bufferService.onScroll((()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this._register(new r.WriteBuffer(((b,D)=>this._inputHandler.parse(b,D)))),this._register(d.Event.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(y,b){this._writeBuffer.write(y,b)}writeSync(y,b){this._logService.logLevel<=i.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(y,b)}input(y,b=!0){this.coreService.triggerDataEvent(y,b)}resize(y,b){isNaN(y)||isNaN(b)||(y=Math.max(y,p.MINIMUM_COLS),b=Math.max(b,p.MINIMUM_ROWS),this._bufferService.resize(y,b))}scroll(y,b=!1){this._bufferService.scroll(y,b)}scrollLines(y,b){this._bufferService.scrollLines(y,b)}scrollPages(y){this.scrollLines(y*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(y){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(y){const b=y-this._bufferService.buffer.ydisp;b!==0&&this.scrollLines(b)}registerEscHandler(y,b){return this._inputHandler.registerEscHandler(y,b)}registerDcsHandler(y,b){return this._inputHandler.registerDcsHandler(y,b)}registerCsiHandler(y,b){return this._inputHandler.registerCsiHandler(y,b)}registerOscHandler(y,b){return this._inputHandler.registerOscHandler(y,b)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let y=!1;const b=this.optionsService.rawOptions.windowsPty;b&&b.buildNumber!==void 0&&b.buildNumber!==void 0?y=b.backend==="conpty"&&b.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(y=!0),y?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const y=[];y.push(this.onLineFeed(s.updateWindowsModeWrappedState.bind(null,this._bufferService))),y.push(this.registerCsiHandler({final:"H"},(()=>((0,s.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const b of y)b.dispose()}))}}}t.CoreTerminal=m},2486:function(W,t,_){var i=this&&this.__decorate||function(F,S,E,w){var L,O=arguments.length,N=O<3?S:w===null?w=Object.getOwnPropertyDescriptor(S,E):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(F,S,E,w);else for(var H=F.length-1;H>=0;H--)(L=F[H])&&(N=(O<3?L(N):O>3?L(S,E,N):L(S,E))||N);return O>3&&N&&Object.defineProperty(S,E,N),N},v=this&&this.__param||function(F,S){return function(E,w){S(E,w,F)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0,t.isValidColorIndex=B;const o=_(3534),p=_(6760),f=_(6717),g=_(7150),c=_(726),n=_(6107),h=_(8938),s=_(3055),e=_(5451),r=_(6501),a=_(6415),d=_(1346),u=_(9823),l=_(8693),m=_(802),C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=131072;function b(F,S){if(F>24)return S.setWinLines||!1;switch(F){case 1:return!!S.restoreWin;case 2:return!!S.minimizeWin;case 3:return!!S.setWinPosition;case 4:return!!S.setWinSizePixels;case 5:return!!S.raiseWin;case 6:return!!S.lowerWin;case 7:return!!S.refreshWin;case 8:return!!S.setWinSizeChars;case 9:return!!S.maximizeWin;case 10:return!!S.fullscreenWin;case 11:return!!S.getWinState;case 13:return!!S.getWinPosition;case 14:return!!S.getWinSizePixels;case 15:return!!S.getScreenSizePixels;case 16:return!!S.getCellSizePixels;case 18:return!!S.getWinSizeChars;case 19:return!!S.getScreenSizeChars;case 20:return!!S.getIconTitle;case 21:return!!S.getWinTitle;case 22:return!!S.pushTitle;case 23:return!!S.popTitle;case 24:return!!S.setWinLines}return!1}var D;(function(F){F[F.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",F[F.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(t.WindowsOptionsReportType=D={}));let T=0;class P extends g.Disposable{getAttrData(){return this._curAttrData}constructor(S,E,w,L,O,N,H,j,x=new f.EscapeSequenceParser){super(),this._bufferService=S,this._charsetService=E,this._coreService=w,this._logService=L,this._optionsService=O,this._oscLinkService=N,this._coreMouseService=H,this._unicodeService=j,this._parser=x,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new c.StringToUtf32,this._utf8Decoder=new c.Utf8ToUtf32,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this._register(new m.Emitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new m.Emitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new m.Emitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new m.Emitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new m.Emitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new m.Emitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new m.Emitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new m.Emitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new m.Emitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new m.Emitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new m.Emitter),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new m.Emitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new m.Emitter),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 M(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate((k=>this._activeBuffer=k.activeBuffer))),this._parser.setCsiHandlerFallback(((k,V)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(k),params:V.toArray()})})),this._parser.setEscHandlerFallback((k=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(k)})})),this._parser.setExecuteHandlerFallback((k=>{this._logService.debug("Unknown EXECUTE code: ",{code:k})})),this._parser.setOscHandlerFallback(((k,V,z)=>{this._logService.debug("Unknown OSC code: ",{identifier:k,action:V,data:z})})),this._parser.setDcsHandlerFallback(((k,V,z)=>{V==="HOOK"&&(z=z.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(k),action:V,payload:z})})),this._parser.setPrintHandler(((k,V,z)=>this.print(k,V,z))),this._parser.registerCsiHandler({final:"@"},(k=>this.insertChars(k))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(k=>this.scrollLeft(k))),this._parser.registerCsiHandler({final:"A"},(k=>this.cursorUp(k))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(k=>this.scrollRight(k))),this._parser.registerCsiHandler({final:"B"},(k=>this.cursorDown(k))),this._parser.registerCsiHandler({final:"C"},(k=>this.cursorForward(k))),this._parser.registerCsiHandler({final:"D"},(k=>this.cursorBackward(k))),this._parser.registerCsiHandler({final:"E"},(k=>this.cursorNextLine(k))),this._parser.registerCsiHandler({final:"F"},(k=>this.cursorPrecedingLine(k))),this._parser.registerCsiHandler({final:"G"},(k=>this.cursorCharAbsolute(k))),this._parser.registerCsiHandler({final:"H"},(k=>this.cursorPosition(k))),this._parser.registerCsiHandler({final:"I"},(k=>this.cursorForwardTab(k))),this._parser.registerCsiHandler({final:"J"},(k=>this.eraseInDisplay(k,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(k=>this.eraseInDisplay(k,!0))),this._parser.registerCsiHandler({final:"K"},(k=>this.eraseInLine(k,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(k=>this.eraseInLine(k,!0))),this._parser.registerCsiHandler({final:"L"},(k=>this.insertLines(k))),this._parser.registerCsiHandler({final:"M"},(k=>this.deleteLines(k))),this._parser.registerCsiHandler({final:"P"},(k=>this.deleteChars(k))),this._parser.registerCsiHandler({final:"S"},(k=>this.scrollUp(k))),this._parser.registerCsiHandler({final:"T"},(k=>this.scrollDown(k))),this._parser.registerCsiHandler({final:"X"},(k=>this.eraseChars(k))),this._parser.registerCsiHandler({final:"Z"},(k=>this.cursorBackwardTab(k))),this._parser.registerCsiHandler({final:"`"},(k=>this.charPosAbsolute(k))),this._parser.registerCsiHandler({final:"a"},(k=>this.hPositionRelative(k))),this._parser.registerCsiHandler({final:"b"},(k=>this.repeatPrecedingCharacter(k))),this._parser.registerCsiHandler({final:"c"},(k=>this.sendDeviceAttributesPrimary(k))),this._parser.registerCsiHandler({prefix:">",final:"c"},(k=>this.sendDeviceAttributesSecondary(k))),this._parser.registerCsiHandler({final:"d"},(k=>this.linePosAbsolute(k))),this._parser.registerCsiHandler({final:"e"},(k=>this.vPositionRelative(k))),this._parser.registerCsiHandler({final:"f"},(k=>this.hVPosition(k))),this._parser.registerCsiHandler({final:"g"},(k=>this.tabClear(k))),this._parser.registerCsiHandler({final:"h"},(k=>this.setMode(k))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(k=>this.setModePrivate(k))),this._parser.registerCsiHandler({final:"l"},(k=>this.resetMode(k))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(k=>this.resetModePrivate(k))),this._parser.registerCsiHandler({final:"m"},(k=>this.charAttributes(k))),this._parser.registerCsiHandler({final:"n"},(k=>this.deviceStatus(k))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(k=>this.deviceStatusPrivate(k))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(k=>this.softReset(k))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(k=>this.setCursorStyle(k))),this._parser.registerCsiHandler({final:"r"},(k=>this.setScrollRegion(k))),this._parser.registerCsiHandler({final:"s"},(k=>this.saveCursor(k))),this._parser.registerCsiHandler({final:"t"},(k=>this.windowOptions(k))),this._parser.registerCsiHandler({final:"u"},(k=>this.restoreCursor(k))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(k=>this.insertColumns(k))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(k=>this.deleteColumns(k))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(k=>this.selectProtected(k))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(k=>this.requestMode(k,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(k=>this.requestMode(k,!1))),this._parser.setExecuteHandler(o.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(o.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(o.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(o.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(o.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(o.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(o.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(o.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(o.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new d.OscHandler((k=>(this.setTitle(k),this.setIconName(k),!0)))),this._parser.registerOscHandler(1,new d.OscHandler((k=>this.setIconName(k)))),this._parser.registerOscHandler(2,new d.OscHandler((k=>this.setTitle(k)))),this._parser.registerOscHandler(4,new d.OscHandler((k=>this.setOrReportIndexedColor(k)))),this._parser.registerOscHandler(8,new d.OscHandler((k=>this.setHyperlink(k)))),this._parser.registerOscHandler(10,new d.OscHandler((k=>this.setOrReportFgColor(k)))),this._parser.registerOscHandler(11,new d.OscHandler((k=>this.setOrReportBgColor(k)))),this._parser.registerOscHandler(12,new d.OscHandler((k=>this.setOrReportCursorColor(k)))),this._parser.registerOscHandler(104,new d.OscHandler((k=>this.restoreIndexedColor(k)))),this._parser.registerOscHandler(110,new d.OscHandler((k=>this.restoreFgColor(k)))),this._parser.registerOscHandler(111,new d.OscHandler((k=>this.restoreBgColor(k)))),this._parser.registerOscHandler(112,new d.OscHandler((k=>this.restoreCursorColor(k)))),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 k in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:k},(()=>this.selectCharset("("+k))),this._parser.registerEscHandler({intermediates:")",final:k},(()=>this.selectCharset(")"+k))),this._parser.registerEscHandler({intermediates:"*",final:k},(()=>this.selectCharset("*"+k))),this._parser.registerEscHandler({intermediates:"+",final:k},(()=>this.selectCharset("+"+k))),this._parser.registerEscHandler({intermediates:"-",final:k},(()=>this.selectCharset("-"+k))),this._parser.registerEscHandler({intermediates:".",final:k},(()=>this.selectCharset("."+k))),this._parser.registerEscHandler({intermediates:"/",final:k},(()=>this.selectCharset("/"+k)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((k=>(this._logService.error("Parsing error: ",k),k))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new u.DcsHandler(((k,V)=>this.requestStatusString(k,V))))}_preserveStack(S,E,w,L){this._parseStack.paused=!0,this._parseStack.cursorStartX=S,this._parseStack.cursorStartY=E,this._parseStack.decodedLength=w,this._parseStack.position=L}_logSlowResolvingAsync(S){this._logService.logLevel<=r.LogLevelEnum.WARN&&Promise.race([S,new Promise(((E,w)=>setTimeout((()=>w("#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(S,E){let w,L=this._activeBuffer.x,O=this._activeBuffer.y,N=0;const H=this._parseStack.paused;if(H){if(w=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,E))return this._logSlowResolvingAsync(w),w;L=this._parseStack.cursorStartX,O=this._parseStack.cursorStartY,this._parseStack.paused=!1,S.length>y&&(N=this._parseStack.position+y)}if(this._logService.logLevel<=r.LogLevelEnum.DEBUG&&this._logService.debug("parsing data "+(typeof S=="string"?` "${S}"`:` "${Array.prototype.map.call(S,(k=>String.fromCharCode(k))).join("")}"`)),this._logService.logLevel===r.LogLevelEnum.TRACE&&this._logService.trace("parsing data (codes)",typeof S=="string"?S.split("").map((k=>k.charCodeAt(0))):S),this._parseBuffer.length<S.length&&this._parseBuffer.length<y&&(this._parseBuffer=new Uint32Array(Math.min(S.length,y))),H||this._dirtyRowTracker.clearRange(),S.length>y)for(let k=N;k<S.length;k+=y){const V=k+y<S.length?k+y:S.length,z=typeof S=="string"?this._stringDecoder.decode(S.substring(k,V),this._parseBuffer):this._utf8Decoder.decode(S.subarray(k,V),this._parseBuffer);if(w=this._parser.parse(this._parseBuffer,z))return this._preserveStack(L,O,z,k),this._logSlowResolvingAsync(w),w}else if(!H){const k=typeof S=="string"?this._stringDecoder.decode(S,this._parseBuffer):this._utf8Decoder.decode(S,this._parseBuffer);if(w=this._parser.parse(this._parseBuffer,k))return this._preserveStack(L,O,k,0),this._logSlowResolvingAsync(w),w}this._activeBuffer.x===L&&this._activeBuffer.y===O||this._onCursorMove.fire();const j=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),x=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);x<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(x,this._bufferService.rows-1),end:Math.min(j,this._bufferService.rows-1)})}print(S,E,w){let L,O;const N=this._charsetService.charset,H=this._optionsService.rawOptions.screenReaderMode,j=this._bufferService.cols,x=this._coreService.decPrivateModes.wraparound,k=this._coreService.modes.insertMode,V=this._curAttrData;let z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&w-E>0&&z.getWidth(this._activeBuffer.x-1)===2&&z.setCellFromCodepoint(this._activeBuffer.x-1,0,1,V);let G=this._parser.precedingJoinState;for(let q=E;q<w;++q){if(L=S[q],L<127&&N){const re=N[String.fromCharCode(L)];re&&(L=re.charCodeAt(0))}const J=this._unicodeService.charProperties(L,G);O=a.UnicodeService.extractWidth(J);const se=a.UnicodeService.extractShouldJoin(J),ie=se?a.UnicodeService.extractWidth(G):0;if(G=J,H&&this._onA11yChar.fire((0,c.stringFromCodePoint)(L)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+O-ie>j){if(x){const re=z;let ae=this._activeBuffer.x-ie;for(this._activeBuffer.x=ie,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),z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ie>0&&z instanceof n.BufferLine&&z.copyCellsFrom(re,ae,0,ie,!1);ae<j;)re.setCellFromCodepoint(ae++,0,1,V)}else if(this._activeBuffer.x=j-1,O===2)continue}if(se&&this._activeBuffer.x){const re=z.getWidth(this._activeBuffer.x-1)?1:2;z.addCodepointToCell(this._activeBuffer.x-re,L,O);for(let ae=O-ie;--ae>=0;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}else if(k&&(z.insertCells(this._activeBuffer.x,O-ie,this._activeBuffer.getNullCell(V)),z.getWidth(j-1)===2&&z.setCellFromCodepoint(j-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,V)),z.setCellFromCodepoint(this._activeBuffer.x++,L,O,V),O>0)for(;--O;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}this._parser.precedingJoinState=G,this._activeBuffer.x<j&&w-E>0&&z.getWidth(this._activeBuffer.x)===0&&!z.hasContent(this._activeBuffer.x)&&z.setCellFromCodepoint(this._activeBuffer.x,0,1,V),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(S,E){return S.final!=="t"||S.prefix||S.intermediates?this._parser.registerCsiHandler(S,E):this._parser.registerCsiHandler(S,(w=>!b(w.params[0],this._optionsService.rawOptions.windowOptions)||E(w)))}registerDcsHandler(S,E){return this._parser.registerDcsHandler(S,new u.DcsHandler(E))}registerEscHandler(S,E){return this._parser.registerEscHandler(S,E)}registerOscHandler(S,E){return this._parser.registerOscHandler(S,new d.OscHandler(E))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);S.hasWidth(this._activeBuffer.x)&&!S.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const S=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-S),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(S=this._bufferService.cols-1){this._activeBuffer.x=Math.min(S,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(S,E){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=S,this._activeBuffer.y=this._activeBuffer.scrollTop+E):(this._activeBuffer.x=S,this._activeBuffer.y=E),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(S,E){this._restrictCursor(),this._setCursor(this._activeBuffer.x+S,this._activeBuffer.y+E)}cursorUp(S){const E=this._activeBuffer.y-this._activeBuffer.scrollTop;return E>=0?this._moveCursor(0,-Math.min(E,S.params[0]||1)):this._moveCursor(0,-(S.params[0]||1)),!0}cursorDown(S){const E=this._activeBuffer.scrollBottom-this._activeBuffer.y;return E>=0?this._moveCursor(0,Math.min(E,S.params[0]||1)):this._moveCursor(0,S.params[0]||1),!0}cursorForward(S){return this._moveCursor(S.params[0]||1,0),!0}cursorBackward(S){return this._moveCursor(-(S.params[0]||1),0),!0}cursorNextLine(S){return this.cursorDown(S),this._activeBuffer.x=0,!0}cursorPrecedingLine(S){return this.cursorUp(S),this._activeBuffer.x=0,!0}cursorCharAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(S){return this._setCursor(S.length>=2?(S.params[1]||1)-1:0,(S.params[0]||1)-1),!0}charPosAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(S){return this._moveCursor(S.params[0]||1,0),!0}linePosAbsolute(S){return this._setCursor(this._activeBuffer.x,(S.params[0]||1)-1),!0}vPositionRelative(S){return this._moveCursor(0,S.params[0]||1),!0}hVPosition(S){return this.cursorPosition(S),!0}tabClear(S){const E=S.params[0];return E===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:E===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=S.params[0]||1;for(;E--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=S.params[0]||1;for(;E--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(S){const E=S.params[0];return E===1&&(this._curAttrData.bg|=536870912),E!==2&&E!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(S,E,w,L=!1,O=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);N.replaceCells(E,w,this._activeBuffer.getNullCell(this._eraseAttrData()),O),L&&(N.isWrapped=!1)}_resetBufferLine(S,E=!1){const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);w&&(w.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),E),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+S),w.isWrapped=!1)}eraseInDisplay(S,E=!1){let w;switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:for(w=this._activeBuffer.y,this._dirtyRowTracker.markDirty(w),this._eraseInBufferLine(w++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,E);w<this._bufferService.rows;w++)this._resetBufferLine(w,E);this._dirtyRowTracker.markDirty(w);break;case 1:for(w=this._activeBuffer.y,this._dirtyRowTracker.markDirty(w),this._eraseInBufferLine(w,0,this._activeBuffer.x+1,!0,E),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(w+1).isWrapped=!1);w--;)this._resetBufferLine(w,E);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(w=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,w-1);w--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+w)?.getTrimmedLength(););for(;w>=0;w--)this._bufferService.scroll(this._eraseAttrData())}else{for(w=this._bufferService.rows,this._dirtyRowTracker.markDirty(w-1);w--;)this._resetBufferLine(w,E);this._dirtyRowTracker.markDirty(0)}break;case 3:const L=this._activeBuffer.lines.length-this._bufferService.rows;L>0&&(this._activeBuffer.lines.trimStart(L),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-L,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-L,0),this._onScroll.fire(0))}return!0}eraseInLine(S,E=!1){switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,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(S){this._restrictCursor();let E=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=this._activeBuffer.ybase+this._activeBuffer.y,L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-L+1;for(;E--;)this._activeBuffer.lines.splice(O-1,1),this._activeBuffer.lines.splice(w,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(S){this._restrictCursor();let E=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=this._activeBuffer.ybase+this._activeBuffer.y;let L;for(L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,L=this._bufferService.rows-1+this._activeBuffer.ybase-L;E--;)this._activeBuffer.lines.splice(w,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(S){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.insertCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(S){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.deleteCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(S){let E=S.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(S){let E=S.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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=S.params[0]||1;for(let w=this._activeBuffer.scrollTop;w<=this._activeBuffer.scrollBottom;++w){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+w);L.deleteCells(0,E,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=S.params[0]||1;for(let w=this._activeBuffer.scrollTop;w<=this._activeBuffer.scrollBottom;++w){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+w);L.insertCells(0,E,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=S.params[0]||1;for(let w=this._activeBuffer.scrollTop;w<=this._activeBuffer.scrollBottom;++w){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+w);L.insertCells(this._activeBuffer.x,E,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=S.params[0]||1;for(let w=this._activeBuffer.scrollTop;w<=this._activeBuffer.scrollBottom;++w){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+w);L.deleteCells(this._activeBuffer.x,E,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(S){this._restrictCursor();const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return E&&(E.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(S.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(S){const E=this._parser.precedingJoinState;if(!E)return!0;const w=S.params[0]||1,L=a.UnicodeService.extractWidth(E),O=this._activeBuffer.x-L,N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(O),H=new Uint32Array(N.length*w);let j=0;for(let k=0;k<N.length;){const V=N.codePointAt(k)||0;H[j++]=V,k+=V>65535?2:1}let x=j;for(let k=1;k<w;++k)H.copyWithin(x,0,j),x+=j;return this.print(H,0,x),!0}sendDeviceAttributesPrimary(S){return S.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(S){return S.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(S.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(S){return(this._optionsService.rawOptions.termName+"").indexOf(S)===0}setMode(S){for(let E=0;E<S.length;E++)switch(S.params[E]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(S){for(let E=0;E<S.length;E++)switch(S.params[E]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0}return!0}resetMode(S){for(let E=0;E<S.length;E++)switch(S.params[E]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(S){for(let E=0;E<S.length;E++)switch(S.params[E]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),S.params[E]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(S,E){const w=this._coreService.decPrivateModes,{activeProtocol:L,activeEncoding:O}=this._coreMouseService,N=this._coreService,{buffers:H,cols:j}=this._bufferService,{active:x,alt:k}=H,V=this._optionsService.rawOptions,z=se=>se?1:2,G=S.params[0];return q=G,J=E?G===2?4:G===4?z(N.modes.insertMode):G===12?3:G===20?z(V.convertEol):0:G===1?z(w.applicationCursorKeys):G===3?V.windowOptions.setWinLines?j===80?2:j===132?1:0:0:G===6?z(w.origin):G===7?z(w.wraparound):G===8?3:G===9?z(L==="X10"):G===12?z(V.cursorBlink):G===25?z(!N.isCursorHidden):G===45?z(w.reverseWraparound):G===66?z(w.applicationKeypad):G===67?4:G===1e3?z(L==="VT200"):G===1002?z(L==="DRAG"):G===1003?z(L==="ANY"):G===1004?z(w.sendFocus):G===1005?4:G===1006?z(O==="SGR"):G===1015?4:G===1016?z(O==="SGR_PIXELS"):G===1048?1:G===47||G===1047||G===1049?z(x===k):G===2004?z(w.bracketedPasteMode):G===2026?z(w.synchronizedOutput):0,N.triggerDataEvent(`${o.C0.ESC}[${E?"":"?"}${q};${J}$y`),!0;var q,J}_updateAttrColor(S,E,w,L,O){return E===2?(S|=50331648,S&=-16777216,S|=e.AttributeData.fromColorRGB([w,L,O])):E===5&&(S&=-50331904,S|=33554432|255&w),S}_extractColor(S,E,w){const L=[0,0,-1,0,0,0];let O=0,N=0;do{if(L[N+O]=S.params[E+N],S.hasSubParams(E+N)){const H=S.getSubParams(E+N);let j=0;do L[1]===5&&(O=1),L[N+j+1+O]=H[j];while(++j<H.length&&j+N+1+O<L.length);break}if(L[1]===5&&N+O>=2||L[1]===2&&N+O>=5)break;L[1]&&(O=1)}while(++N+E<S.length&&N+O<L.length);for(let H=2;H<L.length;++H)L[H]===-1&&(L[H]=0);switch(L[0]){case 38:w.fg=this._updateAttrColor(w.fg,L[1],L[3],L[4],L[5]);break;case 48:w.bg=this._updateAttrColor(w.bg,L[1],L[3],L[4],L[5]);break;case 58:w.extended=w.extended.clone(),w.extended.underlineColor=this._updateAttrColor(w.extended.underlineColor,L[1],L[3],L[4],L[5])}return N}_processUnderline(S,E){E.extended=E.extended.clone(),(!~S||S>5)&&(S=1),E.extended.underlineStyle=S,E.fg|=268435456,S===0&&(E.fg&=-268435457),E.updateExtended()}_processSGR0(S){S.fg=n.DEFAULT_ATTR_DATA.fg,S.bg=n.DEFAULT_ATTR_DATA.bg,S.extended=S.extended.clone(),S.extended.underlineStyle=0,S.extended.underlineColor&=-67108864,S.updateExtended()}charAttributes(S){if(S.length===1&&S.params[0]===0)return this._processSGR0(this._curAttrData),!0;const E=S.length;let w;const L=this._curAttrData;for(let O=0;O<E;O++)w=S.params[O],w>=30&&w<=37?(L.fg&=-50331904,L.fg|=16777216|w-30):w>=40&&w<=47?(L.bg&=-50331904,L.bg|=16777216|w-40):w>=90&&w<=97?(L.fg&=-50331904,L.fg|=16777224|w-90):w>=100&&w<=107?(L.bg&=-50331904,L.bg|=16777224|w-100):w===0?this._processSGR0(L):w===1?L.fg|=134217728:w===3?L.bg|=67108864:w===4?(L.fg|=268435456,this._processUnderline(S.hasSubParams(O)?S.getSubParams(O)[0]:1,L)):w===5?L.fg|=536870912:w===7?L.fg|=67108864:w===8?L.fg|=1073741824:w===9?L.fg|=2147483648:w===2?L.bg|=134217728:w===21?this._processUnderline(2,L):w===22?(L.fg&=-134217729,L.bg&=-134217729):w===23?L.bg&=-67108865:w===24?(L.fg&=-268435457,this._processUnderline(0,L)):w===25?L.fg&=-536870913:w===27?L.fg&=-67108865:w===28?L.fg&=-1073741825:w===29?L.fg&=2147483647:w===39?(L.fg&=-67108864,L.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):w===49?(L.bg&=-67108864,L.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):w===38||w===48||w===58?O+=this._extractColor(S,O,L):w===53?L.bg|=1073741824:w===55?L.bg&=-1073741825:w===59?(L.extended=L.extended.clone(),L.extended.underlineColor=-1,L.updateExtended()):w===100?(L.fg&=-67108864,L.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,L.bg&=-67108864,L.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",w);return!0}deviceStatus(S){switch(S.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:const E=this._activeBuffer.y+1,w=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${E};${w}R`)}return!0}deviceStatusPrivate(S){if(S.params[0]===6){const E=this._activeBuffer.y+1,w=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${E};${w}R`)}return!0}softReset(S){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(S){const E=S.length===0?1:S.params[0];if(E===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(E){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar"}const w=E%2==1;this._coreService.decPrivateModes.cursorBlink=w}return!0}setScrollRegion(S){const E=S.params[0]||1;let w;return(S.length<2||(w=S.params[1])>this._bufferService.rows||w===0)&&(w=this._bufferService.rows),w>E&&(this._activeBuffer.scrollTop=E-1,this._activeBuffer.scrollBottom=w-1,this._setCursor(0,0)),!0}windowOptions(S){if(!b(S.params[0],this._optionsService.rawOptions.windowOptions))return!0;const E=S.length>1?S.params[1]:0;switch(S.params[0]){case 14:E!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:E!==0&&E!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),E!==0&&E!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:E!==0&&E!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),E!==0&&E!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(S){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(S){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(S){return this._windowTitle=S,this._onTitleChange.fire(S),!0}setIconName(S){return this._iconName=S,!0}setOrReportIndexedColor(S){const E=[],w=S.split(";");for(;w.length>1;){const L=w.shift(),O=w.shift();if(/^\d+$/.exec(L)){const N=parseInt(L);if(B(N))if(O==="?")E.push({type:0,index:N});else{const H=(0,l.parseColor)(O);H&&E.push({type:1,index:N,color:H})}}}return E.length&&this._onColor.fire(E),!0}setHyperlink(S){const E=S.indexOf(";");if(E===-1)return!0;const w=S.slice(0,E).trim(),L=S.slice(E+1);return L?this._createHyperlink(w,L):!w.trim()&&this._finishHyperlink()}_createHyperlink(S,E){this._getCurrentLinkId()&&this._finishHyperlink();const w=S.split(":");let L;const O=w.findIndex((N=>N.startsWith("id=")));return O!==-1&&(L=w[O].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:L,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(S,E){const w=S.split(";");for(let L=0;L<w.length&&!(E>=this._specialColors.length);++L,++E)if(w[L]==="?")this._onColor.fire([{type:0,index:this._specialColors[E]}]);else{const O=(0,l.parseColor)(w[L]);O&&this._onColor.fire([{type:1,index:this._specialColors[E],color:O}])}return!0}setOrReportFgColor(S){return this._setOrReportSpecialColor(S,0)}setOrReportBgColor(S){return this._setOrReportSpecialColor(S,1)}setOrReportCursorColor(S){return this._setOrReportSpecialColor(S,2)}restoreIndexedColor(S){if(!S)return this._onColor.fire([{type:2}]),!0;const E=[],w=S.split(";");for(let L=0;L<w.length;++L)if(/^\d+$/.exec(w[L])){const O=parseInt(w[L]);B(O)&&E.push({type:2,index:O})}return E.length&&this._onColor.fire(E),!0}restoreFgColor(S){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(S){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(S){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(S){return S.length!==2?(this.selectDefaultCharset(),!0):(S[0]==="/"||this._charsetService.setgCharset(C[S[0]],p.CHARSETS[S[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const S=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,S,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(S){return this._charsetService.setgLevel(S),!0}screenAlignmentPattern(){const S=new s.CellData;S.content=4194373,S.fg=this._curAttrData.fg,S.bg=this._curAttrData.bg,this._setCursor(0,0);for(let E=0;E<this._bufferService.rows;++E){const w=this._activeBuffer.ybase+this._activeBuffer.y+E,L=this._activeBuffer.lines.get(w);L&&(L.fill(S),L.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(S,E){const w=this._bufferService.buffer,L=this._optionsService.rawOptions;return(O=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${O}${o.C0.ESC}\\`),!0))(S==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:S==='"p'?'P1$r61;1"p':S==="r"?`P1$r${w.scrollTop+1};${w.scrollBottom+1}r`:S==="m"?"P1$r0m":S===" q"?`P1$r${{block:2,underline:4,bar:6}[L.cursorStyle]-(L.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(S,E){this._dirtyRowTracker.markRangeDirty(S,E)}}t.InputHandler=P;let M=class{constructor(F){this._bufferService=F,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(F){F<this.start?this.start=F:F>this.end&&(this.end=F)}markRangeDirty(F,S){F>S&&(T=F,F=S,S=T),F<this.start&&(this.start=F),S>this.end&&(this.end=S)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function B(F){return 0<=F&&F<256}M=i([v(0,r.IBufferService)],M)},7710:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class _{constructor(){this._data={}}set(v,o,p){this._data[v]||(this._data[v]={}),this._data[v][o]=p}get(v,o){return this._data[v]?this._data[v][o]:void 0}clear(){this._data={}}}t.TwoKeyMap=_,t.FourKeyMap=class{constructor(){this._data=new _}set(i,v,o,p,f){this._data.get(i,v)||this._data.set(i,v,new _),this._data.get(i,v).set(o,p,f)}get(i,v,o,p){return this._data.get(i,v)?.get(o,p)}clear(){this._data.clear()}}},701:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.getSafariVersion=function(){if(!t.isSafari)return 0;const v=_.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},t.isNode=typeof process<"u"&&"title"in process;const _=t.isNode?"node":navigator.userAgent,i=t.isNode?"node":navigator.platform;t.isFirefox=_.includes("Firefox"),t.isLegacyEdge=_.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(_),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(i),t.isIpad=i==="iPad",t.isIphone=i==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(i),t.isLinux=i.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(_)},3087:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;const i=_(6168);let v=0;t.SortedList=class{constructor(o){this._getKey=o,this._array=[],this._insertedValues=[],this._flushInsertedTask=new i.IdleTaskQueue,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new i.IdleTaskQueue,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(o){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue((()=>this._flushInserted())),this._insertedValues.push(o)}_flushInserted(){const o=this._insertedValues.sort(((c,n)=>this._getKey(c)-this._getKey(n)));let p=0,f=0;const g=new Array(this._array.length+this._insertedValues.length);for(let c=0;c<g.length;c++)f>=this._array.length||this._getKey(o[p])<=this._getKey(this._array[f])?(g[c]=o[p],p++):g[c]=this._array[f++];this._array=g,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(o){if(this._flushCleanupInserted(),this._array.length===0)return!1;const p=this._getKey(o);if(p===void 0||(v=this._search(p),v===-1)||this._getKey(this._array[v])!==p)return!1;do if(this._array[v]===o)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue((()=>this._flushDeleted())),this._deletedIndices.push(v),!0;while(++v<this._array.length&&this._getKey(this._array[v])===p);return!1}_flushDeleted(){this._isFlushingDeleted=!0;const o=this._deletedIndices.sort(((c,n)=>c-n));let p=0;const f=new Array(this._array.length-o.length);let g=0;for(let c=0;c<this._array.length;c++)o[p]===c?p++:f[g++]=this._array[c];this._array=f,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(o){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(v=this._search(o),!(v<0||v>=this._array.length)&&this._getKey(this._array[v])===o))do yield this._array[v];while(++v<this._array.length&&this._getKey(this._array[v])===o)}forEachByKey(o,p){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(v=this._search(o),!(v<0||v>=this._array.length)&&this._getKey(this._array[v])===o))do p(this._array[v]);while(++v<this._array.length&&this._getKey(this._array[v])===o)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(o){let p=0,f=this._array.length-1;for(;f>=p;){let g=p+f>>1;const c=this._getKey(this._array[g]);if(c>o)f=g-1;else{if(!(c<o)){for(;g>0&&this._getKey(this._array[g-1])===o;)g--;return g}p=g+1}}return p}}},6168:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const i=_(701);class v{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(f){this._idleCallback=void 0;let g=0,c=0,n=f.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(g=performance.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,performance.now()-g),c=Math.max(g,c),h=f.timeRemaining(),1.5*c>h)return n-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-g))}ms`),void this._start();n=h}this.clear()}}class o extends v{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const g=performance.now()+f;return{timeRemaining:()=>Math.max(0,g-performance.now())}}}t.PriorityTaskQueue=o,t.IdleTaskQueue=!i.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:o,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},5882:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=function(v){const o=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),p=o?.get(v.cols-1),f=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);f&&p&&(f.isWrapped=p[i.CHAR_DATA_CODE_INDEX]!==i.NULL_CELL_CODE&&p[i.CHAR_DATA_CODE_INDEX]!==i.WHITESPACE_CELL_CODE)};const i=_(8938)},5451:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class _{constructor(){this.fg=0,this.bg=0,this.extended=new i}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new _;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return!(50331648&~this.fg)}isBgRGB(){return!(50331648&~this.bg)}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)}isBgDefault(){return!(50331648&this.bg)}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):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):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=_;class i{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,p=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=p}clone(){return new i(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=i},1073:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const i=_(5639),v=_(6168),o=_(5451),p=_(6107),f=_(732),g=_(3055),c=_(8938),n=_(8158),h=_(6760);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(s,e,r){this._hasScrollback=s,this._optionsService=e,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,c.WHITESPACE_CELL_CHAR,c.WHITESPACE_CELL_WIDTH,c.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,e){return new p.BufferLine(this._bufferService.cols,this.getNullCell(s),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const e=s+this._optionsService.rawOptions.scrollback;return e>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:e}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=p.DEFAULT_ATTR_DATA);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,e){const r=this.getNullCell(p.DEFAULT_ATTR_DATA);let a=0;const d=this._getCorrectBufferLength(e);if(d>this.lines.maxLength&&(this.lines.maxLength=d),this.lines.length>0){if(this._cols<s)for(let l=0;l<this.lines.length;l++)a+=+this.lines.get(l).resize(s,r);let u=0;if(this._rows<e)for(let l=this._rows;l<e;l++)this.lines.length<e+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(s,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+u+1?(this.ybase--,u++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(s,r)));else for(let l=this._rows;l>e;l--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(d<this.lines.maxLength){const l=this.lines.length-d;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=d}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,e-1),u&&(this.y+=u),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(s,e),this._cols>s))for(let u=0;u<this.lines.length;u++)a+=+this.lines.get(u).resize(s,r);this._cols=s,this._rows=e,this._memoryCleanupQueue.clear(),a>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let e=0;for(;this._memoryCleanupPosition<this.lines.length;)if(e+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),e>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,e){this._cols!==s&&(s>this._cols?this._reflowLarger(s,e):this._reflowSmaller(s,e))}_reflowLarger(s,e){const r=this._optionsService.rawOptions.reflowCursorLine,a=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA),r);if(a.length>0){const d=(0,f.reflowLargerCreateNewLayout)(this.lines,a);(0,f.reflowLargerApplyNewLayout)(this.lines,d.layout),this._reflowLargerAdjustViewport(s,e,d.countRemoved)}}_reflowLargerAdjustViewport(s,e,r){const a=this.getNullCell(p.DEFAULT_ATTR_DATA);let d=r;for(;d-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new p.BufferLine(s,a))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(s,e){const r=this._optionsService.rawOptions.reflowCursorLine,a=this.getNullCell(p.DEFAULT_ATTR_DATA),d=[];let u=0;for(let l=this.lines.length-1;l>=0;l--){let m=this.lines.get(l);if(!m||!m.isWrapped&&m.getTrimmedLength()<=s)continue;const C=[m];for(;m.isWrapped&&l>0;)m=this.lines.get(--l),C.unshift(m);if(!r){const w=this.ybase+this.y;if(w>=l&&w<l+C.length)continue}const y=C[C.length-1].getTrimmedLength(),b=(0,f.reflowSmallerGetNewLineLengths)(C,this._cols,s),D=b.length-C.length;let T;T=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const P=[];for(let w=0;w<D;w++){const L=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);P.push(L)}P.length>0&&(d.push({start:l+C.length+u,newLines:P}),u+=P.length),C.push(...P);let M=b.length-1,B=b[M];B===0&&(M--,B=b[M]);let F=C.length-D-1,S=y;for(;F>=0;){const w=Math.min(S,B);if(C[M]===void 0)break;if(C[M].copyCellsFrom(C[F],S-w,B-w,w,!0),B-=w,B===0&&(M--,B=b[M]),S-=w,S===0){F--;const L=Math.max(F,0);S=(0,f.getWrappedLineTrimmedLength)(C,L,this._cols)}}for(let w=0;w<C.length;w++)b[w]<s&&C[w].setCell(b[w],a);let E=D-T;for(;E-- >0;)this.ybase===0?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+u)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+e-1)}if(d.length>0){const l=[],m=[];for(let B=0;B<this.lines.length;B++)m.push(this.lines.get(B));const C=this.lines.length;let y=C-1,b=0,D=d[b];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+u);let T=0;for(let B=Math.min(this.lines.maxLength-1,C+u-1);B>=0;B--)if(D&&D.start>y+T){for(let F=D.newLines.length-1;F>=0;F--)this.lines.set(B--,D.newLines[F]);B++,l.push({index:y+1,amount:D.newLines.length}),T+=D.newLines.length,D=d[++b]}else this.lines.set(B,m[y--]);let P=0;for(let B=l.length-1;B>=0;B--)l[B].index+=P,this.lines.onInsertEmitter.fire(l[B]),P+=l[B].amount;const M=Math.max(0,C+u-this.lines.maxLength);M>0&&this.lines.onTrimEmitter.fire(M)}}translateBufferLineToString(s,e,r=0,a){const d=this.lines.get(s);return d?d.translateToString(e,r,a):""}getWrappedRangeForLine(s){let e=s,r=s;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:e,last:r}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===s&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose();this.markers.length=0,this._isClearing=!1}addMarker(s){const e=new n.Marker(s);return this.markers.push(e),e.register(this.lines.onTrim((r=>{e.line-=r,e.line<0&&e.dispose()}))),e.register(this.lines.onInsert((r=>{e.line>=r.index&&(e.line+=r.amount)}))),e.register(this.lines.onDelete((r=>{e.line>=r.index&&e.line<r.index+r.amount&&e.dispose(),e.line>r.index&&(e.line-=r.amount)}))),e.register(e.onDispose((()=>this._removeMarker(e)))),e}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},6107:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const i=_(5451),v=_(3055),o=_(8938),p=_(726);t.DEFAULT_ATTR_DATA=Object.freeze(new i.AttributeData);let f=0;class g{constructor(n,h,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const e=h||v.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]);for(let r=0;r<n;++r)this.setCell(r,e);this.length=n}get(n){const h=this._data[3*n+0],s=2097151&h;return[this._data[3*n+1],2097152&h?this._combined[n]:s?(0,p.stringFromCodePoint)(s):"",h>>22,2097152&h?this._combined[n].charCodeAt(this._combined[n].length-1):s]}set(n,h){this._data[3*n+1]=h[o.CHAR_DATA_ATTR_INDEX],h[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=h[1],this._data[3*n+0]=2097152|n|h[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=h[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[o.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const h=this._data[3*n+0];return 2097152&h?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&h}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const h=this._data[3*n+0];return 2097152&h?this._combined[n]:2097151&h?(0,p.stringFromCodePoint)(2097151&h):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,h){return f=3*n,h.content=this._data[f+0],h.fg=this._data[f+1],h.bg=this._data[f+2],2097152&h.content&&(h.combinedData=this._combined[n]),268435456&h.bg&&(h.extended=this._extendedAttrs[n]),h}setCell(n,h){2097152&h.content&&(this._combined[n]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[n]=h.extended),this._data[3*n+0]=h.content,this._data[3*n+1]=h.fg,this._data[3*n+2]=h.bg}setCellFromCodepoint(n,h,s,e){268435456&e.bg&&(this._extendedAttrs[n]=e.extended),this._data[3*n+0]=h|s<<22,this._data[3*n+1]=e.fg,this._data[3*n+2]=e.bg}addCodepointToCell(n,h,s){let e=this._data[3*n+0];2097152&e?this._combined[n]+=(0,p.stringFromCodePoint)(h):2097151&e?(this._combined[n]=(0,p.stringFromCodePoint)(2097151&e)+(0,p.stringFromCodePoint)(h),e&=-2097152,e|=2097152):e=h|4194304,s&&(e&=-12582913,e|=s<<22),this._data[3*n+0]=e}insertCells(n,h,s){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),h<this.length-n){const e=new v.CellData;for(let r=this.length-n-h-1;r>=0;--r)this.setCell(n+h+r,this.loadCell(n+r,e));for(let r=0;r<h;++r)this.setCell(n+r,s)}else for(let e=n;e<this.length;++e)this.setCell(e,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(n,h,s){if(n%=this.length,h<this.length-n){const e=new v.CellData;for(let r=0;r<this.length-n-h;++r)this.setCell(n+r,this.loadCell(n+h+r,e));for(let r=this.length-h;r<this.length;++r)this.setCell(r,s)}else for(let e=n;e<this.length;++e)this.setCell(e,s);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,s)}replaceCells(n,h,s,e=!1){if(e)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,s),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,s);n<h&&n<this.length;)this.isProtected(n)||this.setCell(n,s),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,s),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,s);n<h&&n<this.length;)this.setCell(n++,s)}resize(n,h){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const e=new Uint32Array(s);e.set(this._data),this._data=e}for(let e=this.length;e<n;++e)this.setCell(e,h)}else{this._data=this._data.subarray(0,s);const e=Object.keys(this._combined);for(let a=0;a<e.length;a++){const d=parseInt(e[a],10);d>=n&&delete this._combined[d]}const r=Object.keys(this._extendedAttrs);for(let a=0;a<r.length;a++){const d=parseInt(r[a],10);d>=n&&delete this._extendedAttrs[d]}}return this.length=n,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,h=!1){if(h)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,n);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const h in n._combined)this._combined[h]=n._combined[h];this._extendedAttrs={};for(const h in n._extendedAttrs)this._extendedAttrs[h]=n._extendedAttrs[h];this.isWrapped=n.isWrapped}clone(){const n=new g(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const h in this._combined)n._combined[h]=this._combined[h];for(const h in this._extendedAttrs)n._extendedAttrs[h]=this._extendedAttrs[h];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,h,s,e,r){const a=n._data;if(r)for(let u=e-1;u>=0;u--){for(let l=0;l<3;l++)this._data[3*(s+u)+l]=a[3*(h+u)+l];268435456&a[3*(h+u)+2]&&(this._extendedAttrs[s+u]=n._extendedAttrs[h+u])}else for(let u=0;u<e;u++){for(let l=0;l<3;l++)this._data[3*(s+u)+l]=a[3*(h+u)+l];268435456&a[3*(h+u)+2]&&(this._extendedAttrs[s+u]=n._extendedAttrs[h+u])}const d=Object.keys(n._combined);for(let u=0;u<d.length;u++){const l=parseInt(d[u],10);l>=h&&(this._combined[l-h+s]=n._combined[l])}}translateToString(n,h,s,e){h=h??0,s=s??this.length,n&&(s=Math.min(s,this.getTrimmedLength())),e&&(e.length=0);let r="";for(;h<s;){const a=this._data[3*h+0],d=2097151&a,u=2097152&a?this._combined[h]:d?(0,p.stringFromCodePoint)(d):o.WHITESPACE_CELL_CHAR;if(r+=u,e)for(let l=0;l<u.length;++l)e.push(h);h+=a>>22||1}return e&&e.push(h),r}}t.BufferLine=g},9384:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=function(_,i){if(_.start.y>_.end.y)throw new Error(`Buffer range end (${_.end.x}, ${_.end.y}) cannot be before start (${_.start.x}, ${_.start.y})`);return i*(_.end.y-_.start.y)+(_.end.x-_.start.x+1)}},732:(W,t)=>{function _(i,v,o){if(v===i.length-1)return i[v].getTrimmedLength();const p=!i[v].hasContent(o-1)&&i[v].getWidth(o-1)===1,f=i[v+1].getWidth(0)===2;return p&&f?o-1:o}Object.defineProperty(t,"__esModule",{value:!0}),t.reflowLargerGetLinesToRemove=function(i,v,o,p,f,g){const c=[];for(let n=0;n<i.length-1;n++){let h=n,s=i.get(++h);if(!s.isWrapped)continue;const e=[i.get(n)];for(;h<i.length&&s.isWrapped;)e.push(s),s=i.get(++h);if(!g&&p>=n&&p<h){n+=e.length-1;continue}let r=0,a=_(e,r,v),d=1,u=0;for(;d<e.length;){const m=_(e,d,v),C=m-u,y=o-a,b=Math.min(C,y);e[r].copyCellsFrom(e[d],u,a,b,!1),a+=b,a===o&&(r++,a=0),u+=b,u===m&&(d++,u=0),a===0&&r!==0&&e[r-1].getWidth(o-1)===2&&(e[r].copyCellsFrom(e[r-1],o-1,a++,1,!1),e[r-1].setCell(o-1,f))}e[r].replaceCells(a,o,f);let l=0;for(let m=e.length-1;m>0&&(m>r||e[m].getTrimmedLength()===0);m--)l++;l>0&&(c.push(n+e.length-l),c.push(l)),n+=e.length-1}return c},t.reflowLargerCreateNewLayout=function(i,v){const o=[];let p=0,f=v[p],g=0;for(let c=0;c<i.length;c++)if(f===c){const n=v[++p];i.onDeleteEmitter.fire({index:c-g,amount:n}),c+=n-1,g+=n,f=v[++p]}else o.push(c);return{layout:o,countRemoved:g}},t.reflowLargerApplyNewLayout=function(i,v){const o=[];for(let p=0;p<v.length;p++)o.push(i.get(v[p]));for(let p=0;p<o.length;p++)i.set(p,o[p]);i.length=v.length},t.reflowSmallerGetNewLineLengths=function(i,v,o){const p=[],f=i.map(((h,s)=>_(i,s,v))).reduce(((h,s)=>h+s));let g=0,c=0,n=0;for(;n<f;){if(f-n<o){p.push(f-n);break}g+=o;const h=_(i,c,v);g>h&&(g-=h,c++);const s=i[c].getWidth(g-1)===2;s&&g--;const e=s?o-1:o;p.push(e),n+=e}return p},t.getWrappedLineTrimmedLength=_},4097:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const i=_(7150),v=_(1073),o=_(802);class p extends i.Disposable{constructor(g,c){super(),this._optionsService=g,this._bufferService=c,this._onBufferActivate=this._register(new o.Emitter),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 v.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new v.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(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),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(g,c){this._normal.resize(g,c),this._alt.resize(g,c),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}t.BufferSet=p},3055:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const i=_(726),v=_(8938),o=_(5451);class p extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const c=new p;return c.setFromCharData(g),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,i.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let c=!1;if(g[v.CHAR_DATA_CHAR_INDEX].length>2)c=!0;else if(g[v.CHAR_DATA_CHAR_INDEX].length===2){const n=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const h=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(n-55296)+h-56320+65536|g[v.CHAR_DATA_WIDTH_INDEX]<<22:c=!0}else c=!0}else this.content=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[v.CHAR_DATA_WIDTH_INDEX]<<22;c&&(this.combinedData=g[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=p},8938:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=t.DEFAULT_COLOR<<9|256,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},8158:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const i=_(802),v=_(7150);class o{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=o._nextId++,this._onDispose=this.register(new i.Emitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.dispose)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}t.Marker=o,o._nextId=1},6760:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},t.CHARSETS.A={"#":"\xA3"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},t.CHARSETS.C=t.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},t.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},t.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},t.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},t.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},t.CHARSETS.E=t.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},t.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},t.CHARSETS.H=t.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},t.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},3534:(W,t)=>{var _,i,v;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,(function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT=" ",o.LF=`
9
+ `,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL="\x7F"})(_||(t.C0=_={})),(function(o){o.PAD="\x80",o.HOP="\x81",o.BPH="\x82",o.NBH="\x83",o.IND="\x84",o.NEL="\x85",o.SSA="\x86",o.ESA="\x87",o.HTS="\x88",o.HTJ="\x89",o.VTS="\x8A",o.PLD="\x8B",o.PLU="\x8C",o.RI="\x8D",o.SS2="\x8E",o.SS3="\x8F",o.DCS="\x90",o.PU1="\x91",o.PU2="\x92",o.STS="\x93",o.CCH="\x94",o.MW="\x95",o.SPA="\x96",o.EPA="\x97",o.SOS="\x98",o.SGCI="\x99",o.SCI="\x9A",o.CSI="\x9B",o.ST="\x9C",o.OSC="\x9D",o.PM="\x9E",o.APC="\x9F"})(i||(t.C1=i={})),(function(o){o.ST=`${_.ESC}\\`})(v||(t.C1_ESCAPED=v={}))},706:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=function(o,p,f,g){const c={type:0,cancel:!1,key:void 0},n=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?c.key=p?i.C0.ESC+"OA":i.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?c.key=p?i.C0.ESC+"OD":i.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?c.key=p?i.C0.ESC+"OC":i.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(c.key=p?i.C0.ESC+"OB":i.C0.ESC+"[B");break;case 8:c.key=o.ctrlKey?"\b":i.C0.DEL,o.altKey&&(c.key=i.C0.ESC+c.key);break;case 9:if(o.shiftKey){c.key=i.C0.ESC+"[Z";break}c.key=i.C0.HT,c.cancel=!0;break;case 13:c.key=o.altKey?i.C0.ESC+i.C0.CR:i.C0.CR,c.cancel=!0;break;case 27:c.key=i.C0.ESC,o.altKey&&(c.key=i.C0.ESC+i.C0.ESC),c.cancel=!0;break;case 37:if(o.metaKey)break;c.key=n?i.C0.ESC+"[1;"+(n+1)+"D":p?i.C0.ESC+"OD":i.C0.ESC+"[D";break;case 39:if(o.metaKey)break;c.key=n?i.C0.ESC+"[1;"+(n+1)+"C":p?i.C0.ESC+"OC":i.C0.ESC+"[C";break;case 38:if(o.metaKey)break;c.key=n?i.C0.ESC+"[1;"+(n+1)+"A":p?i.C0.ESC+"OA":i.C0.ESC+"[A";break;case 40:if(o.metaKey)break;c.key=n?i.C0.ESC+"[1;"+(n+1)+"B":p?i.C0.ESC+"OB":i.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(c.key=i.C0.ESC+"[2~");break;case 46:c.key=n?i.C0.ESC+"[3;"+(n+1)+"~":i.C0.ESC+"[3~";break;case 36:c.key=n?i.C0.ESC+"[1;"+(n+1)+"H":p?i.C0.ESC+"OH":i.C0.ESC+"[H";break;case 35:c.key=n?i.C0.ESC+"[1;"+(n+1)+"F":p?i.C0.ESC+"OF":i.C0.ESC+"[F";break;case 33:o.shiftKey?c.type=2:o.ctrlKey?c.key=i.C0.ESC+"[5;"+(n+1)+"~":c.key=i.C0.ESC+"[5~";break;case 34:o.shiftKey?c.type=3:o.ctrlKey?c.key=i.C0.ESC+"[6;"+(n+1)+"~":c.key=i.C0.ESC+"[6~";break;case 112:c.key=n?i.C0.ESC+"[1;"+(n+1)+"P":i.C0.ESC+"OP";break;case 113:c.key=n?i.C0.ESC+"[1;"+(n+1)+"Q":i.C0.ESC+"OQ";break;case 114:c.key=n?i.C0.ESC+"[1;"+(n+1)+"R":i.C0.ESC+"OR";break;case 115:c.key=n?i.C0.ESC+"[1;"+(n+1)+"S":i.C0.ESC+"OS";break;case 116:c.key=n?i.C0.ESC+"[15;"+(n+1)+"~":i.C0.ESC+"[15~";break;case 117:c.key=n?i.C0.ESC+"[17;"+(n+1)+"~":i.C0.ESC+"[17~";break;case 118:c.key=n?i.C0.ESC+"[18;"+(n+1)+"~":i.C0.ESC+"[18~";break;case 119:c.key=n?i.C0.ESC+"[19;"+(n+1)+"~":i.C0.ESC+"[19~";break;case 120:c.key=n?i.C0.ESC+"[20;"+(n+1)+"~":i.C0.ESC+"[20~";break;case 121:c.key=n?i.C0.ESC+"[21;"+(n+1)+"~":i.C0.ESC+"[21~";break;case 122:c.key=n?i.C0.ESC+"[23;"+(n+1)+"~":i.C0.ESC+"[23~";break;case 123:c.key=n?i.C0.ESC+"[24;"+(n+1)+"~":i.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(f&&!g||!o.altKey||o.metaKey)!f||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?c.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(c.key=i.C0.US),o.key==="@"&&(c.key=i.C0.NUL)):o.keyCode===65&&(c.type=1);else{const h=v[o.keyCode],s=h?.[o.shiftKey?1:0];if(s)c.key=i.C0.ESC+s;else if(o.keyCode>=65&&o.keyCode<=90){const e=o.ctrlKey?o.keyCode-64:o.keyCode+32;let r=String.fromCharCode(e);o.shiftKey&&(r=r.toUpperCase()),c.key=i.C0.ESC+r}else if(o.keyCode===32)c.key=i.C0.ESC+(o.ctrlKey?i.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let e=o.code.slice(3,4);o.shiftKey||(e=e.toLowerCase()),c.key=i.C0.ESC+e,c.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?c.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?c.key=i.C0.NUL:o.keyCode>=51&&o.keyCode<=55?c.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?c.key=i.C0.DEL:o.keyCode===219?c.key=i.C0.ESC:o.keyCode===220?c.key=i.C0.FS:o.keyCode===221&&(c.key=i.C0.GS)}return c};const i=_(3534),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:["'",'"']}},726:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=void 0,t.stringFromCodePoint=function(_){return _>65535?(_-=65536,String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):String.fromCharCode(_)},t.utf32ToString=function(_,i=0,v=_.length){let o="";for(let p=i;p<v;++p){let f=_[p];f>65535?(f-=65536,o+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):o+=String.fromCharCode(f)}return o},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(_,i){const v=_.length;if(!v)return 0;let o=0,p=0;if(this._interim){const f=_.charCodeAt(p++);56320<=f&&f<=57343?i[o++]=1024*(this._interim-55296)+f-56320+65536:(i[o++]=this._interim,i[o++]=f),this._interim=0}for(let f=p;f<v;++f){const g=_.charCodeAt(f);if(55296<=g&&g<=56319){if(++f>=v)return this._interim=g,o;const c=_.charCodeAt(f);56320<=c&&c<=57343?i[o++]=1024*(g-55296)+c-56320+65536:(i[o++]=g,i[o++]=c)}else g!==65279&&(i[o++]=g)}return o}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(_,i){const v=_.length;if(!v)return 0;let o,p,f,g,c=0,n=0,h=0;if(this.interim[0]){let r=!1,a=this.interim[0];a&=(224&a)==192?31:(240&a)==224?15:7;let d,u=0;for(;(d=63&this.interim[++u])&&u<4;)a<<=6,a|=d;const l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=l-u;for(;h<m;){if(h>=v)return 0;if(d=_[h++],(192&d)!=128){h--,r=!0;break}this.interim[u++]=d,a<<=6,a|=63&d}r||(l===2?a<128?h--:i[c++]=a:l===3?a<2048||a>=55296&&a<=57343||a===65279||(i[c++]=a):a<65536||a>1114111||(i[c++]=a)),this.interim.fill(0)}const s=v-4;let e=h;for(;e<v;){for(;!(!(e<s)||128&(o=_[e])||128&(p=_[e+1])||128&(f=_[e+2])||128&(g=_[e+3]));)i[c++]=o,i[c++]=p,i[c++]=f,i[c++]=g,e+=4;if(o=_[e++],o<128)i[c++]=o;else if((224&o)==192){if(e>=v)return this.interim[0]=o,c;if(p=_[e++],(192&p)!=128){e--;continue}if(n=(31&o)<<6|63&p,n<128){e--;continue}i[c++]=n}else if((240&o)==224){if(e>=v)return this.interim[0]=o,c;if(p=_[e++],(192&p)!=128){e--;continue}if(e>=v)return this.interim[0]=o,this.interim[1]=p,c;if(f=_[e++],(192&f)!=128){e--;continue}if(n=(15&o)<<12|(63&p)<<6|63&f,n<2048||n>=55296&&n<=57343||n===65279)continue;i[c++]=n}else if((248&o)==240){if(e>=v)return this.interim[0]=o,c;if(p=_[e++],(192&p)!=128){e--;continue}if(e>=v)return this.interim[0]=o,this.interim[1]=p,c;if(f=_[e++],(192&f)!=128){e--;continue}if(e>=v)return this.interim[0]=o,this.interim[1]=p,this.interim[2]=f,c;if(g=_[e++],(192&g)!=128){e--;continue}if(n=(7&o)<<18|(63&p)<<12|(63&f)<<6|63&g,n<65536||n>1114111)continue;i[c++]=n}}return c}}},7428:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const i=_(6415),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],o=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;t.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let f=0;f<v.length;++f)p.fill(0,v[f][0],v[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?p[f]:(function(g,c){let n,h=0,s=c.length-1;if(g<c[0][0]||g>c[s][1])return!1;for(;s>=h;)if(n=h+s>>1,g>c[n][1])h=n+1;else{if(!(g<c[n][0]))return!0;s=n-1}return!1})(f,o)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,g){let c=this.wcwidth(f),n=c===0&&g!==0;if(n){const h=i.UnicodeService.extractWidth(g);h===0?n=!1:h>c&&(c=h)}return i.UnicodeService.createPropertyValue(0,c,n)}}},3562:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const i=_(7150),v=_(802);class o extends i.Disposable{constructor(f){super(),this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new v.Emitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let c;for(this._isSyncWriting=!0;c=this._writeBuffer.shift();){this._action(c);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(g),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(g)}_innerWrite(f=0,g=!0){const c=f||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],h=this._action(n,g);if(h){const e=r=>performance.now()-c>=12?setTimeout((()=>this._innerWrite(0,r))):this._innerWrite(c,r);return void h.catch((r=>(queueMicrotask((()=>{throw r})),Promise.resolve(!1)))).then(e)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-c>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=o},8693:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseColor=function(o){if(!o)return;let p=o.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const f=_.exec(p);if(f){const g=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/g*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/g*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/g*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),i.exec(p)&&[3,6,9,12].includes(p.length))){const f=p.length/3,g=[0,0,0];for(let c=0;c<3;++c){const n=parseInt(p.slice(f*c,f*c+f),16);g[c]=f===1?n<<4:f===2?n:f===3?n>>4:n>>8}return g}},t.toRgbString=function(o,p=16){const[f,g,c]=o;return`rgb:${v(f,p)}/${v(g,p)}/${v(c,p)}`};const _=/^([\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})$/,i=/^[\da-f]+$/;function v(o,p){const f=o.toString(16),g=f.length<2?"0"+f:f;switch(p){case 4:return f[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}},1263:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},9823:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const i=_(726),v=_(7262),o=_(1263),p=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(g,c){this._handlers[g]===void 0&&(this._handlers[g]=[]);const n=this._handlers[g];return n.push(c),{dispose:()=>{const h=n.indexOf(c);h!==-1&&n.splice(h,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(g,c){if(this.reset(),this._ident=g,this._active=this._handlers[g]||p,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(c);else this._handlerFb(this._ident,"HOOK",c)}put(g,c,n){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(g,c,n);else this._handlerFb(this._ident,"PUT",(0,i.utf32ToString)(g,c,n))}unhook(g,c=!0){if(this._active.length){let n=!1,h=this._active.length-1,s=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,n=c,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;h>=0&&(n=this._active[h].unhook(g),n!==!0);h--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,n;h--}for(;h>=0;h--)if(n=this._active[h].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",g);this._active=p,this._ident=0}};const f=new v.Params;f.addParam(0),t.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=f,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():f,this._data="",this._hitLimit=!1}put(g,c,n){this._hitLimit||(this._data+=(0,i.utf32ToString)(g,c,n),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let c=!1;if(this._hitLimit)c=!1;else if(g&&(c=this._handler(this._data,this._params),c instanceof Promise))return c.then((n=>(this._params=f,this._data="",this._hitLimit=!1,n)));return this._params=f,this._data="",this._hitLimit=!1,c}}},6717:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const i=_(7150),v=_(7262),o=_(1346),p=_(9823);class f{constructor(h){this.table=new Uint8Array(h)}setDefault(h,s){this.table.fill(h<<4|s)}add(h,s,e,r){this.table[s<<8|h]=e<<4|r}addMany(h,s,e,r){for(let a=0;a<h.length;a++)this.table[s<<8|h[a]]=e<<4|r}}t.TransitionTable=f;const g=160;t.VT500_TRANSITION_TABLE=(function(){const n=new f(4095),h=Array.apply(null,Array(256)).map(((u,l)=>l)),s=(u,l)=>h.slice(u,l),e=s(32,127),r=s(0,24);r.push(25),r.push.apply(r,s(28,32));const a=s(0,14);let d;for(d in n.setDefault(1,0),n.addMany(e,0,2,0),a)n.addMany([24,26,153,154],d,3,0),n.addMany(s(128,144),d,3,0),n.addMany(s(144,152),d,3,0),n.add(156,d,0,0),n.add(27,d,11,1),n.add(157,d,4,8),n.addMany([152,158,159],d,0,7),n.add(155,d,11,3),n.add(144,d,11,9);return n.addMany(r,0,3,0),n.addMany(r,1,3,1),n.add(127,1,0,1),n.addMany(r,8,0,8),n.addMany(r,3,3,3),n.add(127,3,0,3),n.addMany(r,4,3,4),n.add(127,4,0,4),n.addMany(r,6,3,6),n.addMany(r,5,3,5),n.add(127,5,0,5),n.addMany(r,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(e,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(s(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(e,7,0,7),n.addMany(r,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(s(64,127),3,7,0),n.addMany(s(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(s(48,60),4,8,4),n.addMany(s(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(s(32,64),6,0,6),n.add(127,6,0,6),n.addMany(s(64,127),6,0,0),n.addMany(s(32,48),3,9,5),n.addMany(s(32,48),5,9,5),n.addMany(s(48,64),5,0,6),n.addMany(s(64,127),5,7,0),n.addMany(s(32,48),4,9,5),n.addMany(s(32,48),1,9,2),n.addMany(s(32,48),2,9,2),n.addMany(s(48,127),2,10,0),n.addMany(s(48,80),1,10,0),n.addMany(s(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(s(96,127),1,10,0),n.add(80,1,11,9),n.addMany(r,9,0,9),n.add(127,9,0,9),n.addMany(s(28,32),9,0,9),n.addMany(s(32,48),9,9,12),n.addMany(s(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(r,11,0,11),n.addMany(s(32,128),11,0,11),n.addMany(s(28,32),11,0,11),n.addMany(r,10,0,10),n.add(127,10,0,10),n.addMany(s(28,32),10,0,10),n.addMany(s(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(s(32,48),10,9,12),n.addMany(r,12,0,12),n.add(127,12,0,12),n.addMany(s(28,32),12,0,12),n.addMany(s(32,48),12,9,12),n.addMany(s(48,64),12,0,11),n.addMany(s(64,127),12,12,13),n.addMany(s(64,127),10,12,13),n.addMany(s(64,127),9,12,13),n.addMany(r,13,13,13),n.addMany(e,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(g,0,2,0),n.add(g,8,5,8),n.add(g,6,0,6),n.add(g,11,0,11),n.add(g,13,13,13),n})();class c extends i.Disposable{constructor(h=t.VT500_TRANSITION_TABLE){super(),this._transitions=h,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.precedingJoinState=0,this._printHandlerFb=(s,e,r)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,e)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register((0,i.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this._register(new o.OscParser),this._dcsParser=this._register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(h,s=[64,126]){let e=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(e=h.prefix.charCodeAt(0),e&&60>e||e>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let a=0;a<h.intermediates.length;++a){const d=h.intermediates.charCodeAt(a);if(32>d||d>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");e<<=8,e|=d}}if(h.final.length!==1)throw new Error("final must be a single byte");const r=h.final.charCodeAt(0);if(s[0]>r||r>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return e<<=8,e|=r,e}identToString(h){const s=[];for(;h;)s.push(String.fromCharCode(255&h)),h>>=8;return s.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,s){const e=this._identifier(h,[48,126]);this._escHandlers[e]===void 0&&(this._escHandlers[e]=[]);const r=this._escHandlers[e];return r.push(s),{dispose:()=>{const a=r.indexOf(s);a!==-1&&r.splice(a,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,s){this._executeHandlers[h.charCodeAt(0)]=s}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,s){const e=this._identifier(h);this._csiHandlers[e]===void 0&&(this._csiHandlers[e]=[]);const r=this._csiHandlers[e];return r.push(s),{dispose:()=>{const a=r.indexOf(s);a!==-1&&r.splice(a,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,s){return this._dcsParser.registerHandler(this._identifier(h),s)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,s){return this._oscParser.registerHandler(h,s)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(h,s,e,r,a){this._parseStack.state=h,this._parseStack.handlers=s,this._parseStack.handlerPos=e,this._parseStack.transition=r,this._parseStack.chunkPos=a}parse(h,s,e){let r,a=0,d=0,u=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,u=this._parseStack.chunkPos+1;else{if(e===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 m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(e===!1&&m>-1){for(;m>=0&&(r=l[m](this._params),r!==!0);m--)if(r instanceof Promise)return this._parseStack.handlerPos=m,r}this._parseStack.handlers=[];break;case 4:if(e===!1&&m>-1){for(;m>=0&&(r=l[m](),r!==!0);m--)if(r instanceof Promise)return this._parseStack.handlerPos=m,r}this._parseStack.handlers=[];break;case 6:if(a=h[this._parseStack.chunkPos],r=this._dcsParser.unhook(a!==24&&a!==26,e),r)return r;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(a=h[this._parseStack.chunkPos],r=this._oscParser.end(a!==24&&a!==26,e),r)return r;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,u=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let l=u;l<s;++l){switch(a=h[l],d=this._transitions.table[this.currentState<<8|(a<160?a:g)],d>>4){case 2:for(let D=l+1;;++D){if(D>=s||(a=h[D])<32||a>126&&a<g){this._printHandler(h,l,D),l=D-1;break}if(++D>=s||(a=h[D])<32||a>126&&a<g){this._printHandler(h,l,D),l=D-1;break}if(++D>=s||(a=h[D])<32||a>126&&a<g){this._printHandler(h,l,D),l=D-1;break}if(++D>=s||(a=h[D])<32||a>126&&a<g){this._printHandler(h,l,D),l=D-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingJoinState=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 m=this._csiHandlers[this._collect<<8|a];let C=m?m.length-1:-1;for(;C>=0&&(r=m[C](this._params),r!==!0);C--)if(r instanceof Promise)return this._preserveStack(3,m,C,d,l),r;C<0&&this._csiHandlerFb(this._collect<<8|a,this._params),this.precedingJoinState=0;break;case 8:do switch(a){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(a-48)}while(++l<s&&(a=h[l])>47&&a<60);l--;break;case 9:this._collect<<=8,this._collect|=a;break;case 10:const y=this._escHandlers[this._collect<<8|a];let b=y?y.length-1:-1;for(;b>=0&&(r=y[b](),r!==!0);b--)if(r instanceof Promise)return this._preserveStack(4,y,b,d,l),r;b<0&&this._escHandlerFb(this._collect<<8|a),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|a,this._params);break;case 13:for(let D=l+1;;++D)if(D>=s||(a=h[D])===24||a===26||a===27||a>127&&a<g){this._dcsParser.put(h,l,D),l=D-1;break}break;case 14:if(r=this._dcsParser.unhook(a!==24&&a!==26),r)return this._preserveStack(6,[],0,d,l),r;a===27&&(d|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let D=l+1;;D++)if(D>=s||(a=h[D])<32||a>127&&a<g){this._oscParser.put(h,l,D),l=D-1;break}break;case 6:if(r=this._oscParser.end(a!==24&&a!==26),r)return this._preserveStack(5,[],0,d,l),r;a===27&&(d|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&d}}}t.EscapeSequenceParser=c},1346:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const i=_(1263),v=_(726),o=[];t.OscParser=class{constructor(){this._state=0,this._active=o,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,f){this._handlers[p]===void 0&&(this._handlers[p]=[]);const g=this._handlers[p];return g.push(f),{dispose:()=>{const c=g.indexOf(f);c!==-1&&g.splice(c,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,f,g){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(p,f,g);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(p,f,g))}start(){this.reset(),this._state=1}put(p,f,g){if(this._state!==3){if(this._state===1)for(;f<g;){const c=p[f++];if(c===59){this._state=2,this._start();break}if(c<48||57<c)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+c-48}this._state===2&&g-f>0&&this._put(p,f,g)}}end(p,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,c=this._active.length-1,n=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,g=f,n=this._stack.fallThrough,this._stack.paused=!1),!n&&g===!1){for(;c>=0&&(g=this._active[c].end(p),g!==!0);c--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,g;c--}for(;c>=0;c--)if(g=this._active[c].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",p);this._active=o,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,f,g){this._hitLimit||(this._data+=(0,v.utf32ToString)(p,f,g),this._data.length>i.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let f=!1;if(this._hitLimit)f=!1;else if(p&&(f=this._handler(this._data),f instanceof Promise))return f.then((g=>(this._data="",this._hitLimit=!1,g)));return this._data="",this._hitLimit=!1,f}}},7262:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const _=2147483647;class i{static fromArray(o){const p=new i;if(!o.length)return p;for(let f=Array.isArray(o[0])?1:0;f<o.length;++f){const g=o[f];if(Array.isArray(g))for(let c=0;c<g.length;++c)p.addSubParam(g[c]);else p.addParam(g)}return p}constructor(o=32,p=32){if(this.maxLength=o,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const o=new i(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){const o=[];for(let p=0;p<this.length;++p){o.push(this.params[p]);const f=this._subParamsIdx[p]>>8,g=255&this._subParamsIdx[p];g-f>0&&o.push(Array.prototype.slice.call(this._subParams,f,g))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>_?_:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>_?_:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){const p=this._subParamsIdx[o]>>8,f=255&this._subParamsIdx[o];return f-p>0?this._subParams.subarray(p,f):null}getSubParamsAll(){const o={};for(let p=0;p<this.length;++p){const f=this._subParamsIdx[p]>>8,g=255&this._subParamsIdx[p];g-f>0&&(o[p]=this._subParams.slice(f,g))}return o}addDigit(o){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,g=f[p-1];f[p-1]=~g?Math.min(10*g+o,_):o}}t.Params=i},3027:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let _=this._addons.length-1;_>=0;_--)this._addons[_].instance.dispose()}loadAddon(_,i){const v={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(v),i.dispose=()=>this._wrappedAddonDispose(v),i.activate(_)}_wrappedAddonDispose(_){if(_.isDisposed)return;let i=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===_){i=v;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");_.isDisposed=!0,_.dispose.apply(_.instance),this._addons.splice(i,1)}}},3235:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const i=_(793),v=_(3055);t.BufferApiView=class{constructor(o,p){this._buffer=o,this.type=p}init(o){return this._buffer=o,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(o){const p=this._buffer.lines.get(o);if(p)return new i.BufferLineApiView(p)}getNullCell(){return new v.CellData}}},793:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const i=_(3055);t.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,o){if(!(v<0||v>=this._line.length))return o?(this._line.loadCell(v,o),o):this._line.loadCell(v,new i.CellData)}translateToString(v,o,p){return this._line.translateToString(v,o,p)}}},5101:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const i=_(3235),v=_(7150),o=_(802);class p extends v.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this._register(new o.Emitter),this.onBufferChange=this._onBufferChange.event,this._normal=new i.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new i.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}t.BufferNamespaceApi=p},6097:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(_){this._core=_}registerCsiHandler(_,i){return this._core.registerCsiHandler(_,(v=>i(v.toArray())))}addCsiHandler(_,i){return this.registerCsiHandler(_,i)}registerDcsHandler(_,i){return this._core.registerDcsHandler(_,((v,o)=>i(v,o.toArray())))}addDcsHandler(_,i){return this.registerDcsHandler(_,i)}registerEscHandler(_,i){return this._core.registerEscHandler(_,i)}addEscHandler(_,i){return this.registerEscHandler(_,i)}registerOscHandler(_,i){return this._core.registerOscHandler(_,i)}addOscHandler(_,i){return this.registerOscHandler(_,i)}}},4335:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(_){this._core=_}register(_){this._core.unicodeService.register(_)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(_){this._core.unicodeService.activeVersion=_}}},9640:function(W,t,_){var i=this&&this.__decorate||function(n,h,s,e){var r,a=arguments.length,d=a<3?h:e===null?e=Object.getOwnPropertyDescriptor(h,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,h,s,e);else for(var u=n.length-1;u>=0;u--)(r=n[u])&&(d=(a<3?r(d):a>3?r(h,s,d):r(h,s))||d);return a>3&&d&&Object.defineProperty(h,s,d),d},v=this&&this.__param||function(n,h){return function(s,e){h(s,e,n)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const o=_(7150),p=_(4097),f=_(6501),g=_(802);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let c=class extends o.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this._register(new g.Emitter),this.onResize=this._onResize.event,this._onScroll=this._register(new g.Emitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this._register(new p.BufferSet(n,this)),this._register(this.buffers.onBufferActivate((h=>{this._onScroll.fire(h.activeBuffer.ydisp)})))}resize(n,h){const s=this.cols!==n,e=this.rows!==h;this.cols=n,this.rows=h,this.buffers.resize(n,h),this._onResize.fire({cols:n,rows:h,colsChanged:s,rowsChanged:e})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,h=!1){const s=this.buffer;let e;e=this._cachedBlankLine,e&&e.length===this.cols&&e.getFg(0)===n.fg&&e.getBg(0)===n.bg||(e=s.getBlankLine(n,h),this._cachedBlankLine=e),e.isWrapped=h;const r=s.ybase+s.scrollTop,a=s.ybase+s.scrollBottom;if(s.scrollTop===0){const d=s.lines.isFull;a===s.lines.length-1?d?s.lines.recycle().copyFrom(e):s.lines.push(e.clone()):s.lines.splice(a+1,0,e.clone()),d?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const d=a-r+1;s.lines.shiftElements(r+1,d-1,-1),s.lines.set(a,e.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(n,h){const s=this.buffer;if(n<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else n+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const e=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+n,s.ybase),0),e!==s.ydisp&&(h||this._onScroll.fire(s.ydisp))}};t.BufferService=c,t.BufferService=c=i([v(0,f.IOptionsService)],c)},5746:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(_){this.glevel=_,this.charset=this._charsets[_]}setgCharset(_,i){this._charsets[_]=i,this.glevel===_&&(this.charset=i)}}},7792:function(W,t,_){var i=this&&this.__decorate||function(e,r,a,d){var u,l=arguments.length,m=l<3?r:d===null?d=Object.getOwnPropertyDescriptor(r,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(e,r,a,d);else for(var C=e.length-1;C>=0;C--)(u=e[C])&&(m=(l<3?u(m):l>3?u(r,a,m):u(r,a))||m);return l>3&&m&&Object.defineProperty(r,a,m),m},v=this&&this.__param||function(e,r){return function(a,d){r(a,d,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const o=_(6501),p=_(7150),f=_(802),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button!==4&&e.action===1&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function c(e,r){let a=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(a|=64,a|=e.action):(a|=3&e.button,4&e.button&&(a|=64),8&e.button&&(a|=128),e.action===32?a|=32:e.action!==0||r||(a|=3)),a}const n=String.fromCharCode,h={DEFAULT:e=>{const r=[c(e,!1)+32,e.col+32,e.row+32];return r[0]>255||r[1]>255||r[2]>255?"":`\x1B[M${n(r[0])}${n(r[1])}${n(r[2])}`},SGR:e=>{const r=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${c(e,!0)};${e.col};${e.row}${r}`},SGR_PIXELS:e=>{const r=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${c(e,!0)};${e.x};${e.y}${r}`}};let s=class extends p.Disposable{constructor(e,r,a){super(),this._bufferService=e,this._coreService=r,this._optionsService=a,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new f.Emitter),this.onProtocolChange=this._onProtocolChange.event;for(const d of Object.keys(g))this.addProtocol(d,g[d]);for(const d of Object.keys(h))this.addEncoding(d,h[d]);this.reset()}addProtocol(e,r){this._protocols[e]=r}addEncoding(e,r){this._encodings[e]=r}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,r,a){if(e.deltaY===0||e.shiftKey||r===void 0||a===void 0)return 0;const d=r/a;let u=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(u/=d+0,Math.abs(e.deltaY)<50&&(u*=.3),this._wheelPartialScroll+=u,u=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._bufferService.rows),u}_applyScrollModifier(e,r){return r.altKey||r.ctrlKey||r.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;const r=this._encodings[this._activeEncoding](e);return r&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(r):this._coreService.triggerDataEvent(r,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,r,a){if(a){if(e.x!==r.x||e.y!==r.y)return!1}else if(e.col!==r.col||e.row!==r.row)return!1;return e.button===r.button&&e.action===r.action&&e.ctrl===r.ctrl&&e.alt===r.alt&&e.shift===r.shift}};t.CoreMouseService=s,t.CoreMouseService=s=i([v(0,o.IBufferService),v(1,o.ICoreService),v(2,o.IOptionsService)],s)},4071:function(W,t,_){var i=this&&this.__decorate||function(s,e,r,a){var d,u=arguments.length,l=u<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,e,r,a);else for(var m=s.length-1;m>=0;m--)(d=s[m])&&(l=(u<3?d(l):u>3?d(e,r,l):d(e,r))||l);return u>3&&l&&Object.defineProperty(e,r,l),l},v=this&&this.__param||function(s,e){return function(r,a){e(r,a,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const o=_(7453),p=_(7150),f=_(6501),g=_(802),c=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0});let h=class extends p.Disposable{constructor(s,e,r){super(),this._bufferService=s,this._logService=e,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new g.Emitter),this.onData=this._onData.event,this._onUserInput=this._register(new g.Emitter),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new g.Emitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new g.Emitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,o.clone)(c),this.decPrivateModes=(0,o.clone)(n)}reset(){this.modes=(0,o.clone)(c),this.decPrivateModes=(0,o.clone)(n)}triggerDataEvent(s,e=!1){if(this._optionsService.rawOptions.disableStdin)return;const r=this._bufferService.buffer;e&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),e&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`),this._logService.trace("sending data (codes)",(()=>s.split("").map((a=>a.charCodeAt(0))))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`),this._logService.trace("sending binary (codes)",(()=>s.split("").map((e=>e.charCodeAt(0))))),this._onBinary.fire(s))}};t.CoreService=h,t.CoreService=h=i([v(0,f.IBufferService),v(1,f.ILogService),v(2,f.IOptionsService)],h)},4720:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const i=_(4103),v=_(7150),o=_(3087),p=_(802);let f=0,g=0;class c extends v.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new o.SortedList((s=>s?.marker.line)),this._onDecorationRegistered=this._register(new p.Emitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new p.Emitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register((0,v.toDisposable)((()=>this.reset())))}registerDecoration(s){if(s.marker.isDisposed)return;const e=new n(s);if(e){const r=e.marker.onDispose((()=>e.dispose())),a=e.onDispose((()=>{a.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),r.dispose())}));this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,e,r){let a=0,d=0;for(const u of this._decorations.getKeyIterator(e))a=u.options.x??0,d=a+(u.options.width??1),s>=a&&s<d&&(!r||(u.options.layer??"bottom")===r)&&(yield u)}forEachDecorationAtCell(s,e,r,a){this._decorations.forEachByKey(e,(d=>{f=d.options.x??0,g=f+(d.options.width??1),s>=f&&s<g&&(!r||(d.options.layer??"bottom")===r)&&a(d)}))}}t.DecorationService=c;class n extends v.DisposableStore{get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=i.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=i.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.add(new p.Emitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new p.Emitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},6025:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const i=_(6501),v=_(6201);class o{constructor(...f){this._entries=new Map;for(const[g,c]of f)this.set(g,c)}set(f,g){const c=this._entries.get(f);return this._entries.set(f,g),c}forEach(f){for(const[g,c]of this._entries.entries())f(g,c)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}t.ServiceCollection=o,t.InstantiationService=class{constructor(){this._services=new o,this._services.set(i.IInstantiationService,this)}setService(p,f){this._services.set(p,f)}getService(p){return this._services.get(p)}createInstance(p,...f){const g=(0,v.getServiceDependencies)(p).sort(((h,s)=>h.index-s.index)),c=[];for(const h of g){const s=this._services.get(h.id);if(!s)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${h.id._id}.`);c.push(s)}const n=g.length>0?g[0].index:f.length;if(f.length!==n)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${n+1} conflicts with ${f.length} static arguments`);return new p(...f,...c)}}},7276:function(W,t,_){var i=this&&this.__decorate||function(n,h,s,e){var r,a=arguments.length,d=a<3?h:e===null?e=Object.getOwnPropertyDescriptor(h,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(n,h,s,e);else for(var u=n.length-1;u>=0;u--)(r=n[u])&&(d=(a<3?r(d):a>3?r(h,s,d):r(h,s))||d);return a>3&&d&&Object.defineProperty(h,s,d),d},v=this&&this.__param||function(n,h){return function(s,e){h(s,e,n)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0,t.setTraceLogger=function(n){g=n},t.traceCall=function(n,h,s){if(typeof s.value!="function")throw new Error("not supported");const e=s.value;s.value=function(...r){if(g.logLevel!==p.LogLevelEnum.TRACE)return e.apply(this,r);g.trace(`GlyphRenderer#${e.name}(${r.map((d=>JSON.stringify(d))).join(", ")})`);const a=e.apply(this,r);return g.trace(`GlyphRenderer#${e.name} return`,a),a}};const o=_(7150),p=_(6501),f={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let g,c=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let h=0;h<n.length;h++)typeof n[h]=="function"&&(n[h]=n[h]())}_log(n,h,s){this._evalLazyOptionalParams(s),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...s)}trace(n,...h){this._logLevel<=p.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,n,h)}debug(n,...h){this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,n,h)}info(n,...h){this._logLevel<=p.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,n,h)}warn(n,...h){this._logLevel<=p.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,n,h)}error(n,...h){this._logLevel<=p.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,n,h)}};t.LogService=c,t.LogService=c=i([v(0,p.IOptionsService)],c)},56:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const i=_(7150),v=_(701),o=_(802);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:v.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends i.Disposable{constructor(c){super(),this._onOptionChange=this._register(new o.Emitter),this.onOptionChange=this._onOptionChange.event;const n={...t.DEFAULT_OPTIONS};for(const h in c)if(h in n)try{const s=c[h];n[h]=this._sanitizeAndValidateOption(h,s)}catch(s){console.error(s)}this.rawOptions=n,this.options={...n},this._setupOptions(),this._register((0,i.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(c,n){return this.onOptionChange((h=>{h===c&&n(this.rawOptions[c])}))}onMultipleOptionChange(c,n){return this.onOptionChange((h=>{c.indexOf(h)!==-1&&n()}))}_setupOptions(){const c=h=>{if(!(h in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},n=(h,s)=>{if(!(h in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);s=this._sanitizeAndValidateOption(h,s),this.rawOptions[h]!==s&&(this.rawOptions[h]=s,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const s={get:c.bind(this,h),set:n.bind(this,h)};Object.defineProperty(this.options,h,s)}}_sanitizeAndValidateOption(c,n){switch(c){case"cursorStyle":if(n||(n=t.DEFAULT_OPTIONS[c]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${c}`);break;case"wordSeparator":n||(n=t.DEFAULT_OPTIONS[c]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=p.includes(n)?n:t.DEFAULT_OPTIONS[c];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${c} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${c} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${c} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${c} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}t.OptionsService=f},8811:function(W,t,_){var i=this&&this.__decorate||function(f,g,c,n){var h,s=arguments.length,e=s<3?g:n===null?n=Object.getOwnPropertyDescriptor(g,c):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(f,g,c,n);else for(var r=f.length-1;r>=0;r--)(h=f[r])&&(e=(s<3?h(e):s>3?h(g,c,e):h(g,c))||e);return s>3&&e&&Object.defineProperty(g,c,e),e},v=this&&this.__param||function(f,g){return function(c,n){g(c,n,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const o=_(6501);let p=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const g=this._bufferService.buffer;if(f.id===void 0){const r=g.addMarker(g.ybase+g.y),a={data:f,id:this._nextId++,lines:[r]};return r.onDispose((()=>this._removeMarkerFromLink(a,r))),this._dataByLinkId.set(a.id,a),a.id}const c=f,n=this._getEntryIdKey(c),h=this._entriesWithId.get(n);if(h)return this.addLineToLink(h.id,g.ybase+g.y),h.id;const s=g.addMarker(g.ybase+g.y),e={id:this._nextId++,key:this._getEntryIdKey(c),data:c,lines:[s]};return s.onDispose((()=>this._removeMarkerFromLink(e,s))),this._entriesWithId.set(e.key,e),this._dataByLinkId.set(e.id,e),e.id}addLineToLink(f,g){const c=this._dataByLinkId.get(f);if(c&&c.lines.every((n=>n.line!==g))){const n=this._bufferService.buffer.addMarker(g);c.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(c,n)))}}getLinkData(f){return this._dataByLinkId.get(f)?.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,g){const c=f.lines.indexOf(g);c!==-1&&(f.lines.splice(c,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};t.OscLinkService=p,t.OscLinkService=p=i([v(0,o.IBufferService)],p)},6201:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.serviceRegistry=void 0,t.getServiceDependencies=function(v){return v[i]||[]},t.createDecorator=function(v){if(t.serviceRegistry.has(v))return t.serviceRegistry.get(v);const o=function(p,f,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,n,h){n[_]===n?n[i].push({id:c,index:h}):(n[i]=[{id:c,index:h}],n[_]=n)})(o,p,g)};return o._id=v,t.serviceRegistry.set(v,o),o};const _="di$target",i="di$dependencies";t.serviceRegistry=new Map},6501:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const i=_(6201);var v;t.IBufferService=(0,i.createDecorator)("BufferService"),t.ICoreMouseService=(0,i.createDecorator)("CoreMouseService"),t.ICoreService=(0,i.createDecorator)("CoreService"),t.ICharsetService=(0,i.createDecorator)("CharsetService"),t.IInstantiationService=(0,i.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(v||(t.LogLevelEnum=v={})),t.ILogService=(0,i.createDecorator)("LogService"),t.IOptionsService=(0,i.createDecorator)("OptionsService"),t.IOscLinkService=(0,i.createDecorator)("OscLinkService"),t.IUnicodeService=(0,i.createDecorator)("UnicodeService"),t.IDecorationService=(0,i.createDecorator)("DecorationService")},6415:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const i=_(7428),v=_(802);class o{static extractShouldJoin(f){return!!(1&f)}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,g,c=!1){return(16777215&f)<<3|(3&g)<<1|(c?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new v.Emitter,this.onChange=this._onChange.event;const f=new i.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let g=0,c=0;const n=f.length;for(let h=0;h<n;++h){let s=f.charCodeAt(h);if(55296<=s&&s<=56319){if(++h>=n)return g+this.wcwidth(s);const a=f.charCodeAt(h);56320<=a&&a<=57343?s=1024*(s-55296)+a-56320+65536:g+=this.wcwidth(a)}const e=this.charProperties(s,c);let r=o.extractWidth(e);o.extractShouldJoin(e)&&(r-=o.extractWidth(c)),g+=r,c=e}return g}charProperties(f,g){return this._activeProvider.charProperties(f,g)}}t.UnicodeService=o},4333:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isAndroid=t.isElectron=t.isWebkitWebView=t.isSafari=t.isChrome=t.isWebKit=t.isFirefox=t.onDidChangeFullscreen=t.onDidChangeZoomLevel=void 0,t.addMatchMediaChangeListener=p,t.setZoomLevel=function(c,n){o.INSTANCE.setZoomLevel(c,n)},t.getZoomLevel=function(c){return o.INSTANCE.getZoomLevel(c)},t.getZoomFactor=function(c){return o.INSTANCE.getZoomFactor(c)},t.setZoomFactor=function(c,n){o.INSTANCE.setZoomFactor(c,n)},t.setFullscreen=function(c,n){o.INSTANCE.setFullscreen(c,n)},t.isFullscreen=function(c){return o.INSTANCE.isFullscreen(c)},t.isStandalone=function(){return g},t.isWCOEnabled=function(){return navigator?.windowControlsOverlay?.visible},t.getWCOBoundingRect=function(){return navigator?.windowControlsOverlay?.getTitlebarAreaRect()};const i=_(4693),v=_(802);class o{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new v.Emitter,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new v.Emitter,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}static{this.INSTANCE=new o}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,h){if(this.getZoomLevel(h)===n)return;const s=this.getWindowId(h);this.mapWindowIdToZoomLevel.set(s,n),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,h){this.mapWindowIdToZoomFactor.set(this.getWindowId(h),n)}setFullscreen(n,h){if(this.isFullscreen(h)===n)return;const s=this.getWindowId(h);this.mapWindowIdToFullScreen.set(s,n),this._onDidChangeFullscreen.fire(s)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}}function p(c,n,h){typeof n=="string"&&(n=c.matchMedia(n)),n.addEventListener("change",h)}t.onDidChangeZoomLevel=o.INSTANCE.onDidChangeZoomLevel,t.onDidChangeFullscreen=o.INSTANCE.onDidChangeFullscreen;const f=typeof navigator=="object"?navigator.userAgent:"";t.isFirefox=f.indexOf("Firefox")>=0,t.isWebKit=f.indexOf("AppleWebKit")>=0,t.isChrome=f.indexOf("Chrome")>=0,t.isSafari=!t.isChrome&&f.indexOf("Safari")>=0,t.isWebkitWebView=!t.isChrome&&!t.isSafari&&t.isWebKit,t.isElectron=f.indexOf("Electron/")>=0,t.isAndroid=f.indexOf("Android")>=0;let g=!1;if(typeof i.mainWindow.matchMedia=="function"){const c=i.mainWindow.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=i.mainWindow.matchMedia("(display-mode: fullscreen)");g=c.matches,p(i.mainWindow,c,(({matches:h})=>{g&&n.matches||(g=h)}))}},7745:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(h,s,e,r){r===void 0&&(r=e);var a=Object.getOwnPropertyDescriptor(s,e);a&&!("get"in a?!s.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return s[e]}}),Object.defineProperty(h,r,a)}:function(h,s,e,r){r===void 0&&(r=e),h[r]=s[e]}),v=this&&this.__setModuleDefault||(Object.create?function(h,s){Object.defineProperty(h,"default",{enumerable:!0,value:s})}:function(h,s){h.default=s}),o=this&&this.__importStar||function(h){if(h&&h.__esModule)return h;var s={};if(h!=null)for(var e in h)e!=="default"&&Object.prototype.hasOwnProperty.call(h,e)&&i(s,h,e);return v(s,h),s};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserFeatures=t.KeyboardSupport=void 0;const p=o(_(4333)),f=_(4693),g=o(_(8163));var c;(function(h){h[h.Always=0]="Always",h[h.FullScreen=1]="FullScreen",h[h.None=2]="None"})(c||(t.KeyboardSupport=c={}));const n=typeof navigator=="object"?navigator:{};t.BrowserFeatures={clipboard:{writeText:g.isNative||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(n&&n.clipboard&&n.clipboard.writeText),readText:g.isNative||!!(n&&n.clipboard&&n.clipboard.readText)},keyboard:g.isNative||p.isStandalone()?c.Always:n.keyboard||p.isSafari?c.FullScreen:c.None,touch:"ontouchstart"in f.mainWindow||n.maxTouchPoints>0,pointerEvents:f.mainWindow.PointerEvent&&("ontouchstart"in f.mainWindow||navigator.maxTouchPoints>0)}},7093:function(W,t,_){var i,v=this&&this.__createBinding||(Object.create?function(A,R,I,U){U===void 0&&(U=I);var K=Object.getOwnPropertyDescriptor(R,I);K&&!("get"in K?!R.__esModule:K.writable||K.configurable)||(K={enumerable:!0,get:function(){return R[I]}}),Object.defineProperty(A,U,K)}:function(A,R,I,U){U===void 0&&(U=I),A[U]=R[I]}),o=this&&this.__setModuleDefault||(Object.create?function(A,R){Object.defineProperty(A,"default",{enumerable:!0,value:R})}:function(A,R){A.default=R}),p=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var R={};if(A!=null)for(var I in A)I!=="default"&&Object.prototype.hasOwnProperty.call(A,I)&&v(R,A,I);return o(R,A),R};Object.defineProperty(t,"__esModule",{value:!0}),t.SafeTriangle=t.DragAndDropObserver=t.ModifierKeyEmitter=t.DetectedFullscreenMode=t.Namespace=t.EventHelper=t.EventType=t.sharedMutationObserver=t.Dimension=t.WindowIntervalTimer=t.scheduleAtNextAnimationFrame=t.runAtThisOrScheduleAtNextAnimationFrame=t.WindowIdleValue=t.addStandardDisposableGenericMouseUpListener=t.addStandardDisposableGenericMouseDownListener=t.addStandardDisposableListener=t.onDidUnregisterWindow=t.onWillUnregisterWindow=t.onDidRegisterWindow=t.hasWindow=t.getWindowById=t.getWindowId=t.getWindowsCount=t.getWindows=t.getDocument=t.getWindow=t.registerWindow=void 0,t.clearNode=function(A){for(;A.firstChild;)A.firstChild.remove()},t.clearNodeRecursively=function A(R){for(;R.firstChild;){const I=R.firstChild;I.remove(),A(I)}},t.addDisposableListener=y,t.addDisposableGenericMouseDownListener=D,t.addDisposableGenericMouseMoveListener=function(A,R,I){return y(A,d.isIOS&&g.BrowserFeatures.pointerEvents?t.EventType.POINTER_MOVE:t.EventType.MOUSE_MOVE,R,I)},t.addDisposableGenericMouseUpListener=T,t.runWhenWindowIdle=function(A,R,I){return(0,h._runWhenIdle)(A,R,I)},t.disposableWindowInterval=function(A,R,I,U){let K=0;const $=A.setInterval((()=>{K++,(typeof U=="number"&&K>=U||R()===!0)&&X.dispose()}),I),X=(0,a.toDisposable)((()=>{A.clearInterval($)}));return X},t.measure=function(A,R){return(0,t.scheduleAtNextAnimationFrame)(A,R,1e4)},t.modify=function(A,R){return(0,t.scheduleAtNextAnimationFrame)(A,R,-1e4)},t.addDisposableThrottledListener=function(A,R,I,U,K){return new S(A,R,I,U,K)},t.getComputedStyle=E,t.getClientArea=function A(R,I){const U=(0,t.getWindow)(R),K=U.document;if(R!==K.body)return new L(R.clientWidth,R.clientHeight);if(d.isIOS&&U?.visualViewport)return new L(U.visualViewport.width,U.visualViewport.height);if(U?.innerWidth&&U.innerHeight)return new L(U.innerWidth,U.innerHeight);if(K.body&&K.body.clientWidth&&K.body.clientHeight)return new L(K.body.clientWidth,K.body.clientHeight);if(K.documentElement&&K.documentElement.clientWidth&&K.documentElement.clientHeight)return new L(K.documentElement.clientWidth,K.documentElement.clientHeight);if(I)return A(I);throw new Error("Unable to figure out browser width and height")},t.getTopLeftOffset=O,t.size=function(A,R,I){typeof R=="number"&&(A.style.width=`${R}px`),typeof I=="number"&&(A.style.height=`${I}px`)},t.position=function(A,R,I,U,K,$="absolute"){typeof R=="number"&&(A.style.top=`${R}px`),typeof I=="number"&&(A.style.right=`${I}px`),typeof U=="number"&&(A.style.bottom=`${U}px`),typeof K=="number"&&(A.style.left=`${K}px`),A.style.position=$},t.getDomNodePagePosition=function(A){const R=A.getBoundingClientRect(),I=(0,t.getWindow)(A);return{left:R.left+I.scrollX,top:R.top+I.scrollY,width:R.width,height:R.height}},t.getDomNodeZoomLevel=function(A){let R=A,I=1;do{const U=E(R).zoom;U!=null&&U!=="1"&&(I*=U),R=R.parentElement}while(R!==null&&R!==R.ownerDocument.documentElement);return I},t.getTotalWidth=N,t.getContentWidth=function(A){const R=w.getBorderLeftWidth(A)+w.getBorderRightWidth(A),I=w.getPaddingLeft(A)+w.getPaddingRight(A);return A.offsetWidth-R-I},t.getTotalScrollWidth=H,t.getContentHeight=function(A){const R=w.getBorderTopWidth(A)+w.getBorderBottomWidth(A),I=w.getPaddingTop(A)+w.getPaddingBottom(A);return A.offsetHeight-R-I},t.getTotalHeight=function(A){const R=w.getMarginTop(A)+w.getMarginBottom(A);return A.offsetHeight+R},t.getLargestChildWidth=function(A,R){const I=R.map((U=>Math.max(H(U),N(U))+(function(K,$){if(K===null)return 0;const X=O(K),Y=O($);return X.left-Y.left})(U,A)||0));return Math.max(...I)},t.isAncestor=j,t.setParentFlowTo=function(A,R){A.dataset[x]=R.id},t.isAncestorUsingFlowTo=function(A,R){let I=A;for(;I;){if(I===R)return!0;if(he(I)){const U=k(I);if(U){I=U;continue}}I=I.parentNode}return!1},t.findParentWithClass=V,t.hasParentWithClass=function(A,R,I){return!!V(A,R,I)},t.isShadowRoot=z,t.isInShadowDOM=function(A){return!!G(A)},t.getShadowRoot=G,t.getActiveElement=q,t.isActiveElement=function(A){return q()===A},t.isAncestorOfActiveElement=function(A){return j(q(),A)},t.isActiveDocument=function(A){return A.ownerDocument===J()},t.getActiveDocument=J,t.getActiveWindow=function(){return J().defaultView?.window??l.mainWindow},t.isGlobalStylesheet=function(A){return se.has(A)},t.createStyleSheet2=function(){return new ie},t.createStyleSheet=re,t.cloneGlobalStylesheets=function(A){const R=new a.DisposableStore;for(const[I,U]of se)R.add(ae(I,U,A));return R},t.createMetaElement=function(A=l.mainWindow.document.head){return ge("meta",A)},t.createLinkElement=function(A=l.mainWindow.document.head){return ge("link",A)},t.createCSSRule=function A(R,I,U=ee()){if(U&&I){U.sheet?.insertRule(`${R} {${I}}`,0);for(const K of se.get(U)??[])A(R,I,K)}},t.removeCSSRulesContainingSelector=function A(R,I=ee()){if(!I)return;const U=me(I),K=[];for(let $=0;$<U.length;$++){const X=U[$];Ae(X)&&X.selectorText.indexOf(R)!==-1&&K.push($)}for(let $=K.length-1;$>=0;$--)I.sheet?.deleteRule(K[$]);for(const $ of se.get(I)??[])A(R,$)},t.isHTMLElement=he,t.isHTMLAnchorElement=function(A){return A instanceof HTMLAnchorElement||A instanceof(0,t.getWindow)(A).HTMLAnchorElement},t.isHTMLSpanElement=function(A){return A instanceof HTMLSpanElement||A instanceof(0,t.getWindow)(A).HTMLSpanElement},t.isHTMLTextAreaElement=function(A){return A instanceof HTMLTextAreaElement||A instanceof(0,t.getWindow)(A).HTMLTextAreaElement},t.isHTMLInputElement=function(A){return A instanceof HTMLInputElement||A instanceof(0,t.getWindow)(A).HTMLInputElement},t.isHTMLButtonElement=function(A){return A instanceof HTMLButtonElement||A instanceof(0,t.getWindow)(A).HTMLButtonElement},t.isHTMLDivElement=function(A){return A instanceof HTMLDivElement||A instanceof(0,t.getWindow)(A).HTMLDivElement},t.isSVGElement=function(A){return A instanceof SVGElement||A instanceof(0,t.getWindow)(A).SVGElement},t.isMouseEvent=function(A){return A instanceof MouseEvent||A instanceof(0,t.getWindow)(A).MouseEvent},t.isKeyboardEvent=function(A){return A instanceof KeyboardEvent||A instanceof(0,t.getWindow)(A).KeyboardEvent},t.isPointerEvent=function(A){return A instanceof PointerEvent||A instanceof(0,t.getWindow)(A).PointerEvent},t.isDragEvent=function(A){return A instanceof DragEvent||A instanceof(0,t.getWindow)(A).DragEvent},t.isEventLike=function(A){const R=A;return!(!R||typeof R.preventDefault!="function"||typeof R.stopPropagation!="function")},t.saveParentsScrollTop=function(A){const R=[];for(let I=0;A&&A.nodeType===A.ELEMENT_NODE;I++)R[I]=A.scrollTop,A=A.parentNode;return R},t.restoreParentsScrollTop=function(A,R){for(let I=0;A&&A.nodeType===A.ELEMENT_NODE;I++)A.scrollTop!==R[I]&&(A.scrollTop=R[I]),A=A.parentNode},t.trackFocus=function(A){return new ve(A)},t.after=function(A,R){return A.after(R),R},t.append=Ce,t.prepend=function(A,R){return A.insertBefore(R,A.firstChild),R},t.reset=function(A,...R){A.innerText="",Ce(A,...R)},t.$=Se,t.join=function(A,R){const I=[];return A.forEach(((U,K)=>{K>0&&(R instanceof Node?I.push(R.cloneNode()):I.push(document.createTextNode(R))),I.push(U)})),I},t.setVisibility=function(A,...R){A?De(...R):ue(...R)},t.show=De,t.hide=ue,t.removeTabIndexAndUpdateFocus=function(A){A&&A.hasAttribute("tabIndex")&&(A.ownerDocument.activeElement===A&&(function(I){for(;I&&I.nodeType===I.ELEMENT_NODE;){if(he(I)&&I.hasAttribute("tabIndex"))return I;I=I.parentNode}return null})(A.parentElement)?.focus(),A.removeAttribute("tabindex"))},t.finalHandler=function(A){return R=>{R.preventDefault(),R.stopPropagation(),A(R)}},t.domContentLoaded=function(A){return new Promise((R=>{if(A.document.readyState==="complete"||A.document&&A.document.body!==null)R(void 0);else{const I=()=>{A.window.removeEventListener("DOMContentLoaded",I,!1),R()};A.window.addEventListener("DOMContentLoaded",I,!1)}}))},t.computeScreenAwareSize=function(A,R){const I=A.devicePixelRatio*R;return Math.max(1,Math.floor(I))/A.devicePixelRatio},t.windowOpenNoOpener=function(A){l.mainWindow.open(A,"_blank","noopener")},t.windowOpenPopup=function(A){const R=Math.floor(l.mainWindow.screenLeft+l.mainWindow.innerWidth/2-ye/2),I=Math.floor(l.mainWindow.screenTop+l.mainWindow.innerHeight/2-_e/2);l.mainWindow.open(A,"_blank",`width=${ye},height=${_e},top=${I},left=${R}`)},t.windowOpenWithSuccess=function(A,R=!0){const I=l.mainWindow.open();return!!I&&(R&&(I.opener=null),I.location.href=A,!0)},t.animate=function(A,R){const I=()=>{R(),U=(0,t.scheduleAtNextAnimationFrame)(A,I)};let U=(0,t.scheduleAtNextAnimationFrame)(A,I);return(0,a.toDisposable)((()=>U.dispose()))},t.asCSSPropertyValue=function(A){return`'${A.replace(/'/g,"%27")}'`},t.asCssValueWithDefault=function A(R,I){if(R!==void 0){const U=R.match(/^\s*var\((.+)\)$/);if(U){const K=U[1].split(",",2);return K.length===2&&(I=A(K[1].trim(),I)),`var(${K[0]}, ${I})`}return R}return I},t.detectFullscreen=function(A){return A.document.fullscreenElement||A.document.webkitFullscreenElement||A.document.webkitIsFullScreen?{mode:fe.DOCUMENT,guess:!1}:A.innerHeight===A.screen.height?{mode:fe.BROWSER,guess:!1}:(d.isMacintosh||d.isLinux)&&A.outerHeight===A.screen.height&&A.outerWidth===A.screen.width?{mode:fe.BROWSER,guess:!0}:null},t.multibyteAwareBtoa=function(A){return btoa((function(R){const I=new Uint16Array(R.length);for(let $=0;$<I.length;$++)I[$]=R.charCodeAt($);let U="";const K=new Uint8Array(I.buffer);for(let $=0;$<K.length;$++)U+=String.fromCharCode(K[$]);return U})(A))},t.getCookieValue=function(A){const R=document.cookie.match("(^|[^;]+)\\s*"+A+"\\s*=\\s*([^;]+)");return R?R.pop():void 0},t.h=function(A,...R){let I,U;Array.isArray(R[0])?(I={},U=R[0]):(I=R[0]||{},U=R[1]);const K=Oe.exec(A);if(!K||!K.groups)throw new Error("Bad use of h");const $=K.groups.tag||"div",X=document.createElement($);K.groups.id&&(X.id=K.groups.id);const Y=[];if(K.groups.class)for(const Z of K.groups.class.split("."))Z!==""&&Y.push(Z);if(I.className!==void 0)for(const Z of I.className.split("."))Z!==""&&Y.push(Z);Y.length>0&&(X.className=Y.join(" "));const Q={};if(K.groups.name&&(Q[K.groups.name]=X),U)for(const Z of U)he(Z)?X.appendChild(Z):typeof Z=="string"?X.append(Z):"root"in Z&&(Object.assign(Q,Z),X.appendChild(Z.root));for(const[Z,ne]of Object.entries(I))if(Z!=="className")if(Z==="style")for(const[pe,we]of Object.entries(ne))X.style.setProperty(Te(pe),typeof we=="number"?we+"px":""+we);else Z==="tabIndex"?X.tabIndex=ne:X.setAttribute(Te(Z),ne.toString());return Q.root=X,Q},t.svgElem=function(A,...R){let I,U;Array.isArray(R[0])?(I={},U=R[0]):(I=R[0]||{},U=R[1]);const K=Oe.exec(A);if(!K||!K.groups)throw new Error("Bad use of h");const $=K.groups.tag||"div",X=document.createElementNS("http://www.w3.org/2000/svg",$);K.groups.id&&(X.id=K.groups.id);const Y=[];if(K.groups.class)for(const Z of K.groups.class.split("."))Z!==""&&Y.push(Z);if(I.className!==void 0)for(const Z of I.className.split("."))Z!==""&&Y.push(Z);Y.length>0&&(X.className=Y.join(" "));const Q={};if(K.groups.name&&(Q[K.groups.name]=X),U)for(const Z of U)he(Z)?X.appendChild(Z):typeof Z=="string"?X.append(Z):"root"in Z&&(Object.assign(Q,Z),X.appendChild(Z.root));for(const[Z,ne]of Object.entries(I))if(Z!=="className")if(Z==="style")for(const[pe,we]of Object.entries(ne))X.style.setProperty(Te(pe),typeof we=="number"?we+"px":""+we);else Z==="tabIndex"?X.tabIndex=ne:X.setAttribute(Te(Z),ne.toString());return Q.root=X,Q},t.copyAttributes=Me,t.trackAttributes=function(A,R,I){Me(A,R,I);const U=new a.DisposableStore;return U.add(t.sharedMutationObserver.observe(A,U,{attributes:!0,attributeFilter:I})((K=>{for(const $ of K)$.type==="attributes"&&$.attributeName&&Ie(A,R,$.attributeName)}))),U};const f=p(_(4333)),g=_(7745),c=_(5394),n=_(5964),h=_(1758),s=_(9807),e=p(_(802)),r=_(7883),a=_(7150),d=p(_(8163)),u=_(6304),l=_(4693),m=_(7704);i=(function(){const A=new Map;(0,l.ensureCodeWindow)(l.mainWindow,1);const R={window:l.mainWindow,disposables:new a.DisposableStore};A.set(l.mainWindow.vscodeWindowId,R);const I=new e.Emitter,U=new e.Emitter,K=new e.Emitter;return{onDidRegisterWindow:I.event,onWillUnregisterWindow:K.event,onDidUnregisterWindow:U.event,registerWindow($){if(A.has($.vscodeWindowId))return a.Disposable.None;const X=new a.DisposableStore,Y={window:$,disposables:X.add(new a.DisposableStore)};return A.set($.vscodeWindowId,Y),X.add((0,a.toDisposable)((()=>{A.delete($.vscodeWindowId),U.fire($)}))),X.add(y($,t.EventType.BEFORE_UNLOAD,(()=>{K.fire($)}))),I.fire(Y),X},getWindows:()=>A.values(),getWindowsCount:()=>A.size,getWindowId:$=>$.vscodeWindowId,hasWindow:$=>A.has($),getWindowById:function($,X){return(typeof $=="number"?A.get($):void 0)??(X?R:void 0)},getWindow($){const X=$;if(X?.ownerDocument?.defaultView)return X.ownerDocument.defaultView.window;const Y=$;return Y?.view?Y.view.window:l.mainWindow},getDocument($){const X=$;return(0,t.getWindow)(X).document}}})(),t.registerWindow=i.registerWindow,t.getWindow=i.getWindow,t.getDocument=i.getDocument,t.getWindows=i.getWindows,t.getWindowsCount=i.getWindowsCount,t.getWindowId=i.getWindowId,t.getWindowById=i.getWindowById,t.hasWindow=i.hasWindow,t.onDidRegisterWindow=i.onDidRegisterWindow,t.onWillUnregisterWindow=i.onWillUnregisterWindow,t.onDidUnregisterWindow=i.onDidUnregisterWindow;class C{constructor(R,I,U,K){this._node=R,this._type=I,this._handler=U,this._options=K||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function y(A,R,I,U){return new C(A,R,I,U)}function b(A,R){return function(I){return R(new n.StandardMouseEvent(A,I))}}function D(A,R,I){return y(A,d.isIOS&&g.BrowserFeatures.pointerEvents?t.EventType.POINTER_DOWN:t.EventType.MOUSE_DOWN,R,I)}function T(A,R,I){return y(A,d.isIOS&&g.BrowserFeatures.pointerEvents?t.EventType.POINTER_UP:t.EventType.MOUSE_UP,R,I)}t.addStandardDisposableListener=function(A,R,I,U){let K=I;return R==="click"||R==="mousedown"||R==="contextmenu"?K=b((0,t.getWindow)(A),I):R!=="keydown"&&R!=="keypress"&&R!=="keyup"||(K=(function($){return function(X){return $(new c.StandardKeyboardEvent(X))}})(I)),y(A,R,K,U)},t.addStandardDisposableGenericMouseDownListener=function(A,R,I){return D(A,b((0,t.getWindow)(A),R),I)},t.addStandardDisposableGenericMouseUpListener=function(A,R,I){return T(A,b((0,t.getWindow)(A),R),I)};class P extends h.AbstractIdleValue{constructor(R,I){super(R,I)}}t.WindowIdleValue=P;class M extends h.IntervalTimer{constructor(R){super(),this.defaultTarget=R&&(0,t.getWindow)(R)}cancelAndSet(R,I,U){return super.cancelAndSet(R,I,U??this.defaultTarget)}}t.WindowIntervalTimer=M;class B{constructor(R,I=0){this._runner=R,this.priority=I,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(R){(0,s.onUnexpectedError)(R)}}static sort(R,I){return I.priority-R.priority}}(function(){const A=new Map,R=new Map,I=new Map,U=new Map;t.scheduleAtNextAnimationFrame=(K,$,X=0)=>{const Y=(0,t.getWindowId)(K),Q=new B($,X);let Z=A.get(Y);return Z||(Z=[],A.set(Y,Z)),Z.push(Q),I.get(Y)||(I.set(Y,!0),K.requestAnimationFrame((()=>(ne=>{I.set(ne,!1);const pe=A.get(ne)??[];for(R.set(ne,pe),A.set(ne,[]),U.set(ne,!0);pe.length>0;)pe.sort(B.sort),pe.shift().execute();U.set(ne,!1)})(Y)))),Q},t.runAtThisOrScheduleAtNextAnimationFrame=(K,$,X)=>{const Y=(0,t.getWindowId)(K);if(U.get(Y)){const Q=new B($,X);let Z=R.get(Y);return Z||(Z=[],R.set(Y,Z)),Z.push(Q),Q}return(0,t.scheduleAtNextAnimationFrame)(K,$,X)}})();const F=function(A,R){return R};class S extends a.Disposable{constructor(R,I,U,K=F,$=8){super();let X=null,Y=0;const Q=this._register(new h.TimeoutTimer),Z=()=>{Y=new Date().getTime(),U(X),X=null};this._register(y(R,I,(ne=>{X=K(X,ne);const pe=new Date().getTime()-Y;pe>=$?(Q.cancel(),Z()):Q.setIfNotSet(Z,$-pe)})))}}function E(A){return(0,t.getWindow)(A).getComputedStyle(A,null)}class w{static convertToPixels(R,I){return parseFloat(I)||0}static getDimension(R,I,U){const K=E(R),$=K?K.getPropertyValue(I):"0";return w.convertToPixels(R,$)}static getBorderLeftWidth(R){return w.getDimension(R,"border-left-width","borderLeftWidth")}static getBorderRightWidth(R){return w.getDimension(R,"border-right-width","borderRightWidth")}static getBorderTopWidth(R){return w.getDimension(R,"border-top-width","borderTopWidth")}static getBorderBottomWidth(R){return w.getDimension(R,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(R){return w.getDimension(R,"padding-left","paddingLeft")}static getPaddingRight(R){return w.getDimension(R,"padding-right","paddingRight")}static getPaddingTop(R){return w.getDimension(R,"padding-top","paddingTop")}static getPaddingBottom(R){return w.getDimension(R,"padding-bottom","paddingBottom")}static getMarginLeft(R){return w.getDimension(R,"margin-left","marginLeft")}static getMarginTop(R){return w.getDimension(R,"margin-top","marginTop")}static getMarginRight(R){return w.getDimension(R,"margin-right","marginRight")}static getMarginBottom(R){return w.getDimension(R,"margin-bottom","marginBottom")}}class L{static{this.None=new L(0,0)}constructor(R,I){this.width=R,this.height=I}with(R=this.width,I=this.height){return R!==this.width||I!==this.height?new L(R,I):this}static is(R){return typeof R=="object"&&typeof R.height=="number"&&typeof R.width=="number"}static lift(R){return R instanceof L?R:new L(R.width,R.height)}static equals(R,I){return R===I||!(!R||!I)&&R.width===I.width&&R.height===I.height}}function O(A){let R=A.offsetParent,I=A.offsetTop,U=A.offsetLeft;for(;(A=A.parentNode)!==null&&A!==A.ownerDocument.body&&A!==A.ownerDocument.documentElement;){I-=A.scrollTop;const K=z(A)?null:E(A);K&&(U-=K.direction!=="rtl"?A.scrollLeft:-A.scrollLeft),A===R&&(U+=w.getBorderLeftWidth(A),I+=w.getBorderTopWidth(A),I+=A.offsetTop,U+=A.offsetLeft,R=A.offsetParent)}return{left:U,top:I}}function N(A){const R=w.getMarginLeft(A)+w.getMarginRight(A);return A.offsetWidth+R}function H(A){const R=w.getMarginLeft(A)+w.getMarginRight(A);return A.scrollWidth+R}function j(A,R){return!!R?.contains(A)}t.Dimension=L;const x="parentFlowToElementId";function k(A){const R=A.dataset[x];return typeof R=="string"?A.ownerDocument.getElementById(R):null}function V(A,R,I){for(;A&&A.nodeType===A.ELEMENT_NODE;){if(A.classList.contains(R))return A;if(I){if(typeof I=="string"){if(A.classList.contains(I))return null}else if(A===I)return null}A=A.parentNode}return null}function z(A){return A&&!!A.host&&!!A.mode}function G(A){for(;A.parentNode;){if(A===A.ownerDocument?.body)return null;A=A.parentNode}return z(A)?A:null}function q(){let A=J().activeElement;for(;A?.shadowRoot;)A=A.shadowRoot.activeElement;return A}function J(){return(0,t.getWindowsCount)()<=1?l.mainWindow.document:Array.from((0,t.getWindows)()).map((({window:A})=>A.document)).find((A=>A.hasFocus()))??l.mainWindow.document}const se=new Map;class ie{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(R){R!==this._currentCssStyle&&(this._currentCssStyle=R,this._styleSheet?this._styleSheet.innerText=R:this._styleSheet=re(l.mainWindow.document.head,(I=>I.innerText=R)))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function re(A=l.mainWindow.document.head,R,I){const U=document.createElement("style");if(U.type="text/css",U.media="screen",R?.(U),A.appendChild(U),I&&I.add((0,a.toDisposable)((()=>U.remove()))),A===l.mainWindow.document.head){const K=new Set;se.set(U,K);for(const{window:$,disposables:X}of(0,t.getWindows)()){if($===l.mainWindow)continue;const Y=X.add(ae(U,K,$));I?.add(Y)}}return U}function ae(A,R,I){const U=new a.DisposableStore,K=A.cloneNode(!0);I.document.head.appendChild(K),U.add((0,a.toDisposable)((()=>K.remove())));for(const $ of me(A))K.sheet?.insertRule($.cssText,K.sheet?.cssRules.length);return U.add(t.sharedMutationObserver.observe(A,U,{childList:!0})((()=>{K.textContent=A.textContent}))),R.add(K),U.add((0,a.toDisposable)((()=>R.delete(K)))),U}function ge(A,R=l.mainWindow.document.head){const I=document.createElement(A);return R.appendChild(I),I}t.sharedMutationObserver=new class{constructor(){this.mutationObservers=new Map}observe(A,R,I){let U=this.mutationObservers.get(A);U||(U=new Map,this.mutationObservers.set(A,U));const K=(0,u.hash)(I);let $=U.get(K);if($)$.users+=1;else{const X=new e.Emitter,Y=new MutationObserver((Z=>X.fire(Z)));Y.observe(A,I);const Q=$={users:1,observer:Y,onDidMutate:X.event};R.add((0,a.toDisposable)((()=>{Q.users-=1,Q.users===0&&(X.dispose(),Y.disconnect(),U?.delete(K),U?.size===0&&this.mutationObservers.delete(A))}))),U.set(K,$)}return $.onDidMutate}};let be=null;function ee(){return be||(be=re()),be}function me(A){return A?.sheet?.rules?A.sheet.rules:A?.sheet?.cssRules?A.sheet.cssRules:[]}function Ae(A){return typeof A.selectorText=="string"}function he(A){return A instanceof HTMLElement||A instanceof(0,t.getWindow)(A).HTMLElement}t.EventType={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:f.isWebKit?"webkitAnimationStart":"animationstart",ANIMATION_END:f.isWebKit?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:f.isWebKit?"webkitAnimationIteration":"animationiteration"},t.EventHelper={stop:(A,R)=>(A.preventDefault(),R&&A.stopPropagation(),A)};class ve extends a.Disposable{static hasFocusWithin(R){if(he(R)){const I=G(R);return j(I?I.activeElement:R.ownerDocument.activeElement,R)}{const I=R;return j(I.document.activeElement,I.document)}}constructor(R){super(),this._onDidFocus=this._register(new e.Emitter),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new e.Emitter),this.onDidBlur=this._onDidBlur.event;let I=ve.hasFocusWithin(R),U=!1;const K=()=>{U=!1,I||(I=!0,this._onDidFocus.fire())},$=()=>{I&&(U=!0,(he(R)?(0,t.getWindow)(R):R).setTimeout((()=>{U&&(U=!1,I=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{ve.hasFocusWithin(R)!==I&&(I?$():K())},this._register(y(R,t.EventType.FOCUS,K,!0)),this._register(y(R,t.EventType.BLUR,$,!0)),he(R)&&(this._register(y(R,t.EventType.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(y(R,t.EventType.FOCUS_OUT,(()=>this._refreshStateHandler()))))}refreshState(){this._refreshStateHandler()}}function Ce(A,...R){if(A.append(...R),R.length===1&&typeof R[0]!="string")return R[0]}const oe=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var de;function le(A,R,I,...U){const K=oe.exec(R);if(!K)throw new Error("Bad use of emmet");const $=K[1]||"div";let X;return X=A!==de.HTML?document.createElementNS(A,$):document.createElement($),K[3]&&(X.id=K[3]),K[4]&&(X.className=K[4].replace(/\./g," ").trim()),I&&Object.entries(I).forEach((([Y,Q])=>{Q!==void 0&&(/^on\w+$/.test(Y)?X[Y]=Q:Y==="selected"?Q&&X.setAttribute(Y,"true"):X.setAttribute(Y,Q))})),X.append(...U),X}function Se(A,R,...I){return le(de.HTML,A,R,...I)}function De(...A){for(const R of A)R.style.display="",R.removeAttribute("aria-hidden")}function ue(...A){for(const R of A)R.style.display="none",R.setAttribute("aria-hidden","true")}(function(A){A.HTML="http://www.w3.org/1999/xhtml",A.SVG="http://www.w3.org/2000/svg"})(de||(t.Namespace=de={})),Se.SVG=function(A,R,...I){return le(de.SVG,A,R,...I)};const ye=780,_e=640;var fe;(function(A){A[A.DOCUMENT=1]="DOCUMENT",A[A.BROWSER=2]="BROWSER"})(fe||(t.DetectedFullscreenMode=fe={}));class te extends e.Emitter{constructor(){super(),this._subscriptions=new a.DisposableStore,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(e.Event.runAndSubscribe(t.onDidRegisterWindow,(({window:R,disposables:I})=>this.registerListeners(R,I)),{window:l.mainWindow,disposables:this._subscriptions}))}registerListeners(R,I){I.add(y(R,"keydown",(U=>{if(U.defaultPrevented)return;const K=new c.StandardKeyboardEvent(U);if(K.keyCode!==r.KeyCode.Alt||!U.repeat){if(U.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(U.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(U.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(U.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(K.keyCode===r.KeyCode.Alt)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=U.altKey,this._keyStatus.ctrlKey=U.ctrlKey,this._keyStatus.metaKey=U.metaKey,this._keyStatus.shiftKey=U.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=U,this.fire(this._keyStatus))}}),!0)),I.add(y(R,"keyup",(U=>{U.defaultPrevented||(!U.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!U.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!U.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!U.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=U.altKey,this._keyStatus.ctrlKey=U.ctrlKey,this._keyStatus.metaKey=U.metaKey,this._keyStatus.shiftKey=U.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=U,this.fire(this._keyStatus)))}),!0)),I.add(y(R.document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),I.add(y(R.document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),I.add(y(R.document.body,"mousemove",(U=>{U.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),I.add(y(R,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}get isModifierPressed(){return this._keyStatus.altKey||this._keyStatus.ctrlKey||this._keyStatus.metaKey||this._keyStatus.shiftKey}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return te.instance||(te.instance=new te),te.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}t.ModifierKeyEmitter=te;class Re extends a.Disposable{constructor(R,I){super(),this.element=R,this.callbacks=I,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(y(this.element,t.EventType.DRAG_START,(R=>{this.callbacks.onDragStart?.(R)}))),this.callbacks.onDrag&&this._register(y(this.element,t.EventType.DRAG,(R=>{this.callbacks.onDrag?.(R)}))),this._register(y(this.element,t.EventType.DRAG_ENTER,(R=>{this.counter++,this.dragStartTime=R.timeStamp,this.callbacks.onDragEnter?.(R)}))),this._register(y(this.element,t.EventType.DRAG_OVER,(R=>{R.preventDefault(),this.callbacks.onDragOver?.(R,R.timeStamp-this.dragStartTime)}))),this._register(y(this.element,t.EventType.DRAG_LEAVE,(R=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(R))}))),this._register(y(this.element,t.EventType.DRAG_END,(R=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(R)}))),this._register(y(this.element,t.EventType.DROP,(R=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(R)})))}}t.DragAndDropObserver=Re;const Oe=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function Te(A){return A.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Me(A,R,I){for(const{name:U,value:K}of A.attributes)I&&!I.includes(U)||R.setAttribute(U,K)}function Ie(A,R,I){const U=A.getAttribute(I);U?R.setAttribute(I,U):R.removeAttribute(I)}t.SafeTriangle=class{constructor(A,R,I){this.originX=A,this.originY=R,this.triangles=[];const{top:U,left:K,right:$,bottom:X}=I.getBoundingClientRect(),Y=this.triangles;let Q=0;Y[Q++]=K,Y[Q++]=U,Y[Q++]=$,Y[Q++]=U,Y[Q++]=K,Y[Q++]=U,Y[Q++]=K,Y[Q++]=X,Y[Q++]=$,Y[Q++]=U,Y[Q++]=$,Y[Q++]=X,Y[Q++]=K,Y[Q++]=X,Y[Q++]=$,Y[Q++]=X}contains(A,R){const{triangles:I,originX:U,originY:K}=this;for(let $=0;$<4;$++)if((0,m.isPointWithinTriangle)(A,R,U,K,I[2*$],I[2*$+1],I[2*$+2],I[2*$+3]))return!0;return!1}}},9675:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FastDomNode=void 0,t.createFastDomNode=function(v){return new _(v)};class _{constructor(o){this.domNode=o,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(o){const p=i(o);this._maxWidth!==p&&(this._maxWidth=p,this.domNode.style.maxWidth=this._maxWidth)}setWidth(o){const p=i(o);this._width!==p&&(this._width=p,this.domNode.style.width=this._width)}setHeight(o){const p=i(o);this._height!==p&&(this._height=p,this.domNode.style.height=this._height)}setTop(o){const p=i(o);this._top!==p&&(this._top=p,this.domNode.style.top=this._top)}setLeft(o){const p=i(o);this._left!==p&&(this._left=p,this.domNode.style.left=this._left)}setBottom(o){const p=i(o);this._bottom!==p&&(this._bottom=p,this.domNode.style.bottom=this._bottom)}setRight(o){const p=i(o);this._right!==p&&(this._right=p,this.domNode.style.right=this._right)}setPaddingTop(o){const p=i(o);this._paddingTop!==p&&(this._paddingTop=p,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(o){const p=i(o);this._paddingLeft!==p&&(this._paddingLeft=p,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(o){const p=i(o);this._paddingBottom!==p&&(this._paddingBottom=p,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(o){const p=i(o);this._paddingRight!==p&&(this._paddingRight=p,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(o){this._fontFamily!==o&&(this._fontFamily=o,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(o){this._fontWeight!==o&&(this._fontWeight=o,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(o){const p=i(o);this._fontSize!==p&&(this._fontSize=p,this.domNode.style.fontSize=this._fontSize)}setFontStyle(o){this._fontStyle!==o&&(this._fontStyle=o,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(o){this._fontFeatureSettings!==o&&(this._fontFeatureSettings=o,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(o){this._fontVariationSettings!==o&&(this._fontVariationSettings=o,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(o){this._textDecoration!==o&&(this._textDecoration=o,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(o){const p=i(o);this._lineHeight!==p&&(this._lineHeight=p,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(o){const p=i(o);this._letterSpacing!==p&&(this._letterSpacing=p,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(o){this._className!==o&&(this._className=o,this.domNode.className=this._className)}toggleClassName(o,p){this.domNode.classList.toggle(o,p),this._className=this.domNode.className}setDisplay(o){this._display!==o&&(this._display=o,this.domNode.style.display=this._display)}setPosition(o){this._position!==o&&(this._position=o,this.domNode.style.position=this._position)}setVisibility(o){this._visibility!==o&&(this._visibility=o,this.domNode.style.visibility=this._visibility)}setColor(o){this._color!==o&&(this._color=o,this.domNode.style.color=this._color)}setBackgroundColor(o){this._backgroundColor!==o&&(this._backgroundColor=o,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(o){this._layerHint!==o&&(this._layerHint=o,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(o){this._boxShadow!==o&&(this._boxShadow=o,this.domNode.style.boxShadow=o)}setContain(o){this._contain!==o&&(this._contain=o,this.domNode.style.contain=this._contain)}setAttribute(o,p){this.domNode.setAttribute(o,p)}removeAttribute(o){this.domNode.removeAttribute(o)}appendChild(o){this.domNode.appendChild(o.domNode)}removeChild(o){this.domNode.removeChild(o.domNode)}}function i(v){return typeof v=="number"?`${v}px`:v}t.FastDomNode=_},8328:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(g,c,n,h){h===void 0&&(h=n);var s=Object.getOwnPropertyDescriptor(c,n);s&&!("get"in s?!c.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return c[n]}}),Object.defineProperty(g,h,s)}:function(g,c,n,h){h===void 0&&(h=n),g[h]=c[n]}),v=this&&this.__setModuleDefault||(Object.create?function(g,c){Object.defineProperty(g,"default",{enumerable:!0,value:c})}:function(g,c){g.default=c}),o=this&&this.__importStar||function(g){if(g&&g.__esModule)return g;var c={};if(g!=null)for(var n in g)n!=="default"&&Object.prototype.hasOwnProperty.call(g,n)&&i(c,g,n);return v(c,g),c};Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalPointerMoveMonitor=void 0;const p=o(_(7093)),f=_(7150);t.GlobalPointerMoveMonitor=class{constructor(){this._hooks=new f.DisposableStore,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(g,c){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const n=this._onStopCallback;this._onStopCallback=null,g&&n&&n(c)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(g,c,n,h,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=h,this._onStopCallback=s;let e=g;try{g.setPointerCapture(c),this._hooks.add((0,f.toDisposable)((()=>{try{g.releasePointerCapture(c)}catch{}})))}catch{e=p.getWindow(g)}this._hooks.add(p.addDisposableListener(e,p.EventType.POINTER_MOVE,(r=>{r.buttons===n?(r.preventDefault(),this._pointerMoveCallback(r)):this.stopMonitoring(!0)}))),this._hooks.add(p.addDisposableListener(e,p.EventType.POINTER_UP,(r=>this.stopMonitoring(!0))))}}},6609:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IframeUtils=void 0,t.parentOriginHash=async function(v,o){if(!crypto.subtle)throw new Error("'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");const p=JSON.stringify({parentOrigin:v,salt:o}),f=new TextEncoder().encode(p);return(function(g){const c=Array.from(new Uint8Array(g)).map((n=>n.toString(16).padStart(2,"0"))).join("");return BigInt(`0x${c}`).toString(32).padStart(52,"0")})(await crypto.subtle.digest("sha-256",f))};const _=new WeakMap;function i(v){if(!v.parent||v.parent===v)return null;try{const o=v.location,p=v.parent.location;if(o.origin!=="null"&&p.origin!=="null"&&o.origin!==p.origin)return null}catch{return null}return v.parent}t.IframeUtils=class{static getSameOriginWindowChain(v){let o=_.get(v);if(!o){o=[],_.set(v,o);let p,f=v;do p=i(f),p?o.push({window:new WeakRef(f),iframeElement:f.frameElement||null}):o.push({window:new WeakRef(f),iframeElement:null}),f=p;while(f)}return o.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(v,o){if(!o||v===o)return{top:0,left:0};let p=0,f=0;const g=this.getSameOriginWindowChain(v);for(const c of g){const n=c.window.deref();if(p+=n?.scrollY??0,f+=n?.scrollX??0,n===o||!c.iframeElement)break;const h=c.iframeElement.getBoundingClientRect();p+=h.top,f+=h.left}return{top:p,left:f}}}},5394:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(r,a,d,u){u===void 0&&(u=d);var l=Object.getOwnPropertyDescriptor(a,d);l&&!("get"in l?!a.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return a[d]}}),Object.defineProperty(r,u,l)}:function(r,a,d,u){u===void 0&&(u=d),r[u]=a[d]}),v=this&&this.__setModuleDefault||(Object.create?function(r,a){Object.defineProperty(r,"default",{enumerable:!0,value:a})}:function(r,a){r.default=a}),o=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var a={};if(r!=null)for(var d in r)d!=="default"&&Object.prototype.hasOwnProperty.call(r,d)&&i(a,r,d);return v(a,r),a};Object.defineProperty(t,"__esModule",{value:!0}),t.StandardKeyboardEvent=void 0,t.printKeyboardEvent=function(r){const a=[];return r.ctrlKey&&a.push("ctrl"),r.shiftKey&&a.push("shift"),r.altKey&&a.push("alt"),r.metaKey&&a.push("meta"),`modifiers: [${a.join(",")}], code: ${r.code}, keyCode: ${r.keyCode}, key: ${r.key}`},t.printStandardKeyboardEvent=function(r){const a=[];return r.ctrlKey&&a.push("ctrl"),r.shiftKey&&a.push("shift"),r.altKey&&a.push("alt"),r.metaKey&&a.push("meta"),`modifiers: [${a.join(",")}], code: ${r.code}, keyCode: ${r.keyCode} ('${f.KeyCodeUtils.toString(r.keyCode)}')`};const p=o(_(4333)),f=_(7883),g=_(2811),c=o(_(8163)),n=c.isMacintosh?f.KeyMod.WinCtrl:f.KeyMod.CtrlCmd,h=f.KeyMod.Alt,s=f.KeyMod.Shift,e=c.isMacintosh?f.KeyMod.CtrlCmd:f.KeyMod.WinCtrl;t.StandardKeyboardEvent=class{constructor(r){this._standardKeyboardEventBrand=!0;const a=r;this.browserEvent=a,this.target=a.target,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.altKey=a.altKey,this.metaKey=a.metaKey,this.altGraphKey=a.getModifierState?.("AltGraph"),this.keyCode=(function(d){if(d.charCode){const l=String.fromCharCode(d.charCode).toUpperCase();return f.KeyCodeUtils.fromString(l)}const u=d.keyCode;if(u===3)return f.KeyCode.PauseBreak;if(p.isFirefox)switch(u){case 59:return f.KeyCode.Semicolon;case 60:if(c.isLinux)return f.KeyCode.IntlBackslash;break;case 61:return f.KeyCode.Equal;case 107:return f.KeyCode.NumpadAdd;case 109:return f.KeyCode.NumpadSubtract;case 173:return f.KeyCode.Minus;case 224:if(c.isMacintosh)return f.KeyCode.Meta}else if(p.isWebKit&&(c.isMacintosh&&u===93||!c.isMacintosh&&u===92))return f.KeyCode.Meta;return f.EVENT_KEY_CODE_MAP[u]||f.KeyCode.Unknown})(a),this.code=a.code,this.ctrlKey=this.ctrlKey||this.keyCode===f.KeyCode.Ctrl,this.altKey=this.altKey||this.keyCode===f.KeyCode.Alt,this.shiftKey=this.shiftKey||this.keyCode===f.KeyCode.Shift,this.metaKey=this.metaKey||this.keyCode===f.KeyCode.Meta,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(r){return this._asKeybinding===r}_computeKeybinding(){let r=f.KeyCode.Unknown;this.keyCode!==f.KeyCode.Ctrl&&this.keyCode!==f.KeyCode.Shift&&this.keyCode!==f.KeyCode.Alt&&this.keyCode!==f.KeyCode.Meta&&(r=this.keyCode);let a=0;return this.ctrlKey&&(a|=n),this.altKey&&(a|=h),this.shiftKey&&(a|=s),this.metaKey&&(a|=e),a|=r,a}_computeKeyCodeChord(){let r=f.KeyCode.Unknown;return this.keyCode!==f.KeyCode.Ctrl&&this.keyCode!==f.KeyCode.Shift&&this.keyCode!==f.KeyCode.Alt&&this.keyCode!==f.KeyCode.Meta&&(r=this.keyCode),new g.KeyCodeChord(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,r)}}},5964:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(n,h,s,e){e===void 0&&(e=s);var r=Object.getOwnPropertyDescriptor(h,s);r&&!("get"in r?!h.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return h[s]}}),Object.defineProperty(n,e,r)}:function(n,h,s,e){e===void 0&&(e=s),n[e]=h[s]}),v=this&&this.__setModuleDefault||(Object.create?function(n,h){Object.defineProperty(n,"default",{enumerable:!0,value:h})}:function(n,h){n.default=h}),o=this&&this.__importStar||function(n){if(n&&n.__esModule)return n;var h={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&i(h,n,s);return v(h,n),h};Object.defineProperty(t,"__esModule",{value:!0}),t.StandardWheelEvent=t.DragMouseEvent=t.StandardMouseEvent=void 0;const p=o(_(4333)),f=_(6609),g=o(_(8163));class c{constructor(h,s){this.timestamp=Date.now(),this.browserEvent=s,this.leftButton=s.button===0,this.middleButton=s.button===1,this.rightButton=s.button===2,this.buttons=s.buttons,this.target=s.target,this.detail=s.detail||1,s.type==="dblclick"&&(this.detail=2),this.ctrlKey=s.ctrlKey,this.shiftKey=s.shiftKey,this.altKey=s.altKey,this.metaKey=s.metaKey,typeof s.pageX=="number"?(this.posx=s.pageX,this.posy=s.pageY):(this.posx=s.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=s.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const e=f.IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(h,s.view);this.posx-=e.left,this.posy-=e.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}t.StandardMouseEvent=c,t.DragMouseEvent=class extends c{constructor(n,h){super(n,h),this.dataTransfer=h.dataTransfer}},t.StandardWheelEvent=class{constructor(n,h=0,s=0){this.browserEvent=n||null,this.target=n?n.target||n.targetNode||n.srcElement:null,this.deltaY=s,this.deltaX=h;let e=!1;if(p.isChrome){const r=navigator.userAgent.match(/Chrome\/(\d+)/);e=(r?parseInt(r[1]):123)<=122}if(n){const r=n,a=n,d=n.view?.devicePixelRatio||1;if(r.wheelDeltaY!==void 0)this.deltaY=e?r.wheelDeltaY/(120*d):r.wheelDeltaY/120;else if(a.VERTICAL_AXIS!==void 0&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(n.type==="wheel"){const u=n;u.deltaMode===u.DOM_DELTA_LINE?p.isFirefox&&!g.isMacintosh?this.deltaY=-n.deltaY/3:this.deltaY=-n.deltaY:this.deltaY=-n.deltaY/40}if(r.wheelDeltaX!==void 0)p.isSafari&&g.isWindows?this.deltaX=-r.wheelDeltaX/120:this.deltaX=e?r.wheelDeltaX/(120*d):r.wheelDeltaX/120;else if(a.HORIZONTAL_AXIS!==void 0&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-n.detail/3;else if(n.type==="wheel"){const u=n;u.deltaMode===u.DOM_DELTA_LINE?p.isFirefox&&!g.isMacintosh?this.deltaX=-n.deltaX/3:this.deltaX=-n.deltaX:this.deltaX=-n.deltaX/40}this.deltaY===0&&this.deltaX===0&&n.wheelDelta&&(this.deltaY=e?n.wheelDelta/(120*d):n.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}},8594:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(d,u,l,m){m===void 0&&(m=l);var C=Object.getOwnPropertyDescriptor(u,l);C&&!("get"in C?!u.__esModule:C.writable||C.configurable)||(C={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(d,m,C)}:function(d,u,l,m){m===void 0&&(m=l),d[m]=u[l]}),v=this&&this.__setModuleDefault||(Object.create?function(d,u){Object.defineProperty(d,"default",{enumerable:!0,value:u})}:function(d,u){d.default=u}),o=this&&this.__decorate||function(d,u,l,m){var C,y=arguments.length,b=y<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,l):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(d,u,l,m);else for(var D=d.length-1;D>=0;D--)(C=d[D])&&(b=(y<3?C(b):y>3?C(u,l,b):C(u,l))||b);return y>3&&b&&Object.defineProperty(u,l,b),b},p=this&&this.__importStar||function(d){if(d&&d.__esModule)return d;var u={};if(d!=null)for(var l in d)l!=="default"&&Object.prototype.hasOwnProperty.call(d,l)&&i(u,d,l);return v(u,d),u};Object.defineProperty(t,"__esModule",{value:!0}),t.Gesture=t.EventType=void 0;const f=p(_(7093)),g=_(4693),c=p(_(3058)),n=_(4838),h=_(802),s=_(7150),e=_(6317);var r;(function(d){d.Tap="-xterm-gesturetap",d.Change="-xterm-gesturechange",d.Start="-xterm-gesturestart",d.End="-xterm-gesturesend",d.Contextmenu="-xterm-gesturecontextmenu"})(r||(t.EventType=r={}));class a extends s.Disposable{static{this.SCROLL_FRICTION=-.005}static{this.HOLD_DELAY=700}static{this.CLEAR_TAP_COUNT_TIME=400}constructor(){super(),this.dispatched=!1,this.targets=new e.LinkedList,this.ignoreTargets=new e.LinkedList,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(h.Event.runAndSubscribe(f.onDidRegisterWindow,(({window:u,disposables:l})=>{l.add(f.addDisposableListener(u.document,"touchstart",(m=>this.onTouchStart(m)),{passive:!1})),l.add(f.addDisposableListener(u.document,"touchend",(m=>this.onTouchEnd(u,m)))),l.add(f.addDisposableListener(u.document,"touchmove",(m=>this.onTouchMove(m)),{passive:!1}))}),{window:g.mainWindow,disposables:this._store}))}static addTarget(u){if(!a.isTouchDevice())return s.Disposable.None;a.INSTANCE||(a.INSTANCE=(0,s.markAsSingleton)(new a));const l=a.INSTANCE.targets.push(u);return(0,s.toDisposable)(l)}static ignoreTarget(u){if(!a.isTouchDevice())return s.Disposable.None;a.INSTANCE||(a.INSTANCE=(0,s.markAsSingleton)(new a));const l=a.INSTANCE.ignoreTargets.push(u);return(0,s.toDisposable)(l)}static isTouchDevice(){return"ontouchstart"in g.mainWindow||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(u){const l=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let m=0,C=u.targetTouches.length;m<C;m++){const y=u.targetTouches.item(m);this.activeTouches[y.identifier]={id:y.identifier,initialTarget:y.target,initialTimeStamp:l,initialPageX:y.pageX,initialPageY:y.pageY,rollingTimestamps:[l],rollingPageX:[y.pageX],rollingPageY:[y.pageY]};const b=this.newGestureEvent(r.Start,y.target);b.pageX=y.pageX,b.pageY=y.pageY,this.dispatchEvent(b)}this.dispatched&&(u.preventDefault(),u.stopPropagation(),this.dispatched=!1)}onTouchEnd(u,l){const m=Date.now(),C=Object.keys(this.activeTouches).length;for(let y=0,b=l.changedTouches.length;y<b;y++){const D=l.changedTouches.item(y);if(!this.activeTouches.hasOwnProperty(String(D.identifier))){console.warn("move of an UNKNOWN touch",D);continue}const T=this.activeTouches[D.identifier],P=Date.now()-T.initialTimeStamp;if(P<a.HOLD_DELAY&&Math.abs(T.initialPageX-c.tail(T.rollingPageX))<30&&Math.abs(T.initialPageY-c.tail(T.rollingPageY))<30){const M=this.newGestureEvent(r.Tap,T.initialTarget);M.pageX=c.tail(T.rollingPageX),M.pageY=c.tail(T.rollingPageY),this.dispatchEvent(M)}else if(P>=a.HOLD_DELAY&&Math.abs(T.initialPageX-c.tail(T.rollingPageX))<30&&Math.abs(T.initialPageY-c.tail(T.rollingPageY))<30){const M=this.newGestureEvent(r.Contextmenu,T.initialTarget);M.pageX=c.tail(T.rollingPageX),M.pageY=c.tail(T.rollingPageY),this.dispatchEvent(M)}else if(C===1){const M=c.tail(T.rollingPageX),B=c.tail(T.rollingPageY),F=c.tail(T.rollingTimestamps)-T.rollingTimestamps[0],S=M-T.rollingPageX[0],E=B-T.rollingPageY[0],w=[...this.targets].filter((L=>T.initialTarget instanceof Node&&L.contains(T.initialTarget)));this.inertia(u,w,m,Math.abs(S)/F,S>0?1:-1,M,Math.abs(E)/F,E>0?1:-1,B)}this.dispatchEvent(this.newGestureEvent(r.End,T.initialTarget)),delete this.activeTouches[D.identifier]}this.dispatched&&(l.preventDefault(),l.stopPropagation(),this.dispatched=!1)}newGestureEvent(u,l){const m=document.createEvent("CustomEvent");return m.initEvent(u,!1,!0),m.initialTarget=l,m.tapCount=0,m}dispatchEvent(u){if(u.type===r.Tap){const l=new Date().getTime();let m=0;m=l-this._lastSetTapCountTime>a.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=l,u.tapCount=m}else u.type!==r.Change&&u.type!==r.Contextmenu||(this._lastSetTapCountTime=0);if(u.initialTarget instanceof Node){for(const m of this.ignoreTargets)if(m.contains(u.initialTarget))return;const l=[];for(const m of this.targets)if(m.contains(u.initialTarget)){let C=0,y=u.initialTarget;for(;y&&y!==m;)C++,y=y.parentElement;l.push([C,m])}l.sort(((m,C)=>m[0]-C[0]));for(const[m,C]of l)C.dispatchEvent(u),this.dispatched=!0}}inertia(u,l,m,C,y,b,D,T,P){this.handle=f.scheduleAtNextAnimationFrame(u,(()=>{const M=Date.now(),B=M-m;let F=0,S=0,E=!0;C+=a.SCROLL_FRICTION*B,D+=a.SCROLL_FRICTION*B,C>0&&(E=!1,F=y*C*B),D>0&&(E=!1,S=T*D*B);const w=this.newGestureEvent(r.Change);w.translationX=F,w.translationY=S,l.forEach((L=>L.dispatchEvent(w))),E||this.inertia(u,l,M,C,y,b+F,D,T,P+S)}))}onTouchMove(u){const l=Date.now();for(let m=0,C=u.changedTouches.length;m<C;m++){const y=u.changedTouches.item(m);if(!this.activeTouches.hasOwnProperty(String(y.identifier))){console.warn("end of an UNKNOWN touch",y);continue}const b=this.activeTouches[y.identifier],D=this.newGestureEvent(r.Change,b.initialTarget);D.translationX=y.pageX-c.tail(b.rollingPageX),D.translationY=y.pageY-c.tail(b.rollingPageY),D.pageX=y.pageX,D.pageY=y.pageY,this.dispatchEvent(D),b.rollingPageX.length>3&&(b.rollingPageX.shift(),b.rollingPageY.shift(),b.rollingTimestamps.shift()),b.rollingPageX.push(y.pageX),b.rollingPageY.push(y.pageY),b.rollingTimestamps.push(l)}this.dispatched&&(u.preventDefault(),u.stopPropagation(),this.dispatched=!1)}}t.Gesture=a,o([n.memoize],a,"isTouchDevice",null)},8801:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(r,a,d,u){u===void 0&&(u=d);var l=Object.getOwnPropertyDescriptor(a,d);l&&!("get"in l?!a.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return a[d]}}),Object.defineProperty(r,u,l)}:function(r,a,d,u){u===void 0&&(u=d),r[u]=a[d]}),v=this&&this.__setModuleDefault||(Object.create?function(r,a){Object.defineProperty(r,"default",{enumerable:!0,value:a})}:function(r,a){r.default=a}),o=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var a={};if(r!=null)for(var d in r)d!=="default"&&Object.prototype.hasOwnProperty.call(r,d)&&i(a,r,d);return v(a,r),a};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractScrollbar=void 0;const p=o(_(7093)),f=_(9675),g=_(8328),c=_(8974),n=_(79),h=_(8286),s=o(_(8163));class e extends h.Widget{constructor(a){super(),this._lazyRender=a.lazyRender,this._host=a.host,this._scrollable=a.scrollable,this._scrollByPage=a.scrollByPage,this._scrollbarState=a.scrollbarState,this._visibilityController=this._register(new n.ScrollbarVisibilityController(a.visibility,"visible scrollbar "+a.extraScrollbarClassName,"invisible scrollbar "+a.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new g.GlobalPointerMoveMonitor),this._shouldRender=!0,this.domNode=(0,f.createFastDomNode)(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(p.addDisposableListener(this.domNode.domNode,p.EventType.POINTER_DOWN,(d=>this._domNodePointerDown(d))))}_createArrow(a){const d=this._register(new c.ScrollbarArrow(a));this.domNode.domNode.appendChild(d.bgDomNode),this.domNode.domNode.appendChild(d.domNode)}_createSlider(a,d,u,l){this.slider=(0,f.createFastDomNode)(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(a),this.slider.setLeft(d),typeof u=="number"&&this.slider.setWidth(u),typeof l=="number"&&this.slider.setHeight(l),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(p.addDisposableListener(this.slider.domNode,p.EventType.POINTER_DOWN,(m=>{m.button===0&&(m.preventDefault(),this._sliderPointerDown(m))}))),this.onclick(this.slider.domNode,(m=>{m.leftButton&&m.stopPropagation()}))}_onElementSize(a){return this._scrollbarState.setVisibleSize(a)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(a){return this._scrollbarState.setScrollSize(a)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(a){return this._scrollbarState.setScrollPosition(a)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(a){a.target===this.domNode.domNode&&this._onPointerDown(a)}delegatePointerDown(a){const d=this.domNode.domNode.getClientRects()[0].top,u=d+this._scrollbarState.getSliderPosition(),l=d+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),m=this._sliderPointerPosition(a);u<=m&&m<=l?a.button===0&&(a.preventDefault(),this._sliderPointerDown(a)):this._onPointerDown(a)}_onPointerDown(a){let d,u;if(a.target===this.domNode.domNode&&typeof a.offsetX=="number"&&typeof a.offsetY=="number")d=a.offsetX,u=a.offsetY;else{const m=p.getDomNodePagePosition(this.domNode.domNode);d=a.pageX-m.left,u=a.pageY-m.top}const l=this._pointerDownRelativePosition(d,u);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(l):this._scrollbarState.getDesiredScrollPositionFromOffset(l)),a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))}_sliderPointerDown(a){if(!(a.target&&a.target instanceof Element))return;const d=this._sliderPointerPosition(a),u=this._sliderOrthogonalPointerPosition(a),l=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(a.target,a.pointerId,a.buttons,(m=>{const C=this._sliderOrthogonalPointerPosition(m),y=Math.abs(C-u);if(s.isWindows&&y>140)return void this._setDesiredScrollPositionNow(l.getScrollPosition());const b=this._sliderPointerPosition(m)-d;this._setDesiredScrollPositionNow(l.getDesiredScrollPositionFromDelta(b))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()})),this._host.onDragStart()}_setDesiredScrollPositionNow(a){const d={};this.writeScrollPosition(d,a),this._scrollable.setScrollPositionNow(d)}updateScrollbarSize(a){this._updateScrollbarSize(a),this._scrollbarState.setScrollbarSize(a),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}t.AbstractScrollbar=e},151:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HorizontalScrollbar=void 0;const i=_(8801),v=_(8245),o=_(9881);class p extends i.AbstractScrollbar{constructor(g,c,n){const h=g.getScrollDimensions(),s=g.getCurrentScrollPosition();if(super({lazyRender:c.lazyRender,host:n,scrollbarState:new v.ScrollbarState(c.horizontalHasArrows?c.arrowSize:0,c.horizontal===o.ScrollbarVisibility.Hidden?0:c.horizontalScrollbarSize,c.vertical===o.ScrollbarVisibility.Hidden?0:c.verticalScrollbarSize,h.width,h.scrollWidth,s.scrollLeft),visibility:c.horizontal,extraScrollbarClassName:"horizontal",scrollable:g,scrollByPage:c.scrollByPage}),c.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((c.horizontalScrollbarSize-c.horizontalSliderSize)/2),0,void 0,c.horizontalSliderSize)}_updateSlider(g,c){this.slider.setWidth(g),this.slider.setLeft(c)}_renderDomNode(g,c){this.domNode.setWidth(g),this.domNode.setHeight(c),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(g){return this._shouldRender=this._onElementScrollSize(g.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(g.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(g.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(g,c){return g}_sliderPointerPosition(g){return g.pageX}_sliderOrthogonalPointerPosition(g){return g.pageY}_updateScrollbarSize(g){this.slider.setHeight(g)}writeScrollPosition(g,c){g.scrollLeft=c}updateOptions(g){this.updateScrollbarSize(g.horizontal===o.ScrollbarVisibility.Hidden?0:g.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(g.vertical===o.ScrollbarVisibility.Hidden?0:g.verticalScrollbarSize),this._visibilityController.setVisibility(g.horizontal),this._scrollByPage=g.scrollByPage}}t.HorizontalScrollbar=p},8234:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(y,b,D,T){T===void 0&&(T=D);var P=Object.getOwnPropertyDescriptor(b,D);P&&!("get"in P?!b.__esModule:P.writable||P.configurable)||(P={enumerable:!0,get:function(){return b[D]}}),Object.defineProperty(y,T,P)}:function(y,b,D,T){T===void 0&&(T=D),y[T]=b[D]}),v=this&&this.__setModuleDefault||(Object.create?function(y,b){Object.defineProperty(y,"default",{enumerable:!0,value:b})}:function(y,b){y.default=b}),o=this&&this.__importStar||function(y){if(y&&y.__esModule)return y;var b={};if(y!=null)for(var D in y)D!=="default"&&Object.prototype.hasOwnProperty.call(y,D)&&i(b,y,D);return v(b,y),b};Object.defineProperty(t,"__esModule",{value:!0}),t.DomScrollableElement=t.SmoothScrollableElement=t.ScrollableElement=t.AbstractScrollableElement=t.MouseWheelClassifier=void 0;const p=_(4333),f=o(_(7093)),g=_(9675),c=_(5964),n=_(151),h=_(5473),s=_(8286),e=_(1758),r=_(802),a=_(7150),d=o(_(8163)),u=_(9881);class l{constructor(b,D,T){this.timestamp=b,this.deltaX=D,this.deltaY=T,this.score=0}}class m{static{this.INSTANCE=new m}constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let b=1,D=0,T=1,P=this._rear;for(;;){const M=P===this._front?b:Math.pow(2,-T);if(b-=M,D+=this._memory[P].score*M,P===this._front)break;P=(this._capacity+P-1)%this._capacity,T++}return D<=.5}acceptStandardWheelEvent(b){if(p.isChrome){const D=f.getWindow(b.browserEvent),T=(0,p.getZoomFactor)(D);this.accept(Date.now(),b.deltaX*T,b.deltaY*T)}else this.accept(Date.now(),b.deltaX,b.deltaY)}accept(b,D,T){let P=null;const M=new l(b,D,T);this._front===-1&&this._rear===-1?(this._memory[0]=M,this._front=0,this._rear=0):(P=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=M),M.score=this._computeScore(M,P)}_computeScore(b,D){if(Math.abs(b.deltaX)>0&&Math.abs(b.deltaY)>0)return 1;let T=.5;if(this._isAlmostInt(b.deltaX)&&this._isAlmostInt(b.deltaY)||(T+=.25),D){const P=Math.abs(b.deltaX),M=Math.abs(b.deltaY),B=Math.abs(D.deltaX),F=Math.abs(D.deltaY),S=Math.max(Math.min(P,B),1),E=Math.max(Math.min(M,F),1),w=Math.max(P,B),L=Math.max(M,F);w%S==0&&L%E==0&&(T-=.5)}return Math.min(Math.max(T,0),1)}_isAlmostInt(b){return Math.abs(Math.round(b)-b)<.01}}t.MouseWheelClassifier=m;class C extends s.Widget{get options(){return this._options}constructor(b,D,T){super(),this._onScroll=this._register(new r.Emitter),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new r.Emitter),this.onWillScroll=this._onWillScroll.event,this._options=(function(M){const B={lazyRender:M.lazyRender!==void 0&&M.lazyRender,className:M.className!==void 0?M.className:"",useShadows:M.useShadows===void 0||M.useShadows,handleMouseWheel:M.handleMouseWheel===void 0||M.handleMouseWheel,flipAxes:M.flipAxes!==void 0&&M.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:M.consumeMouseWheelIfScrollbarIsNeeded!==void 0&&M.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:M.alwaysConsumeMouseWheel!==void 0&&M.alwaysConsumeMouseWheel,scrollYToX:M.scrollYToX!==void 0&&M.scrollYToX,mouseWheelScrollSensitivity:M.mouseWheelScrollSensitivity!==void 0?M.mouseWheelScrollSensitivity:1,fastScrollSensitivity:M.fastScrollSensitivity!==void 0?M.fastScrollSensitivity:5,scrollPredominantAxis:M.scrollPredominantAxis===void 0||M.scrollPredominantAxis,mouseWheelSmoothScroll:M.mouseWheelSmoothScroll===void 0||M.mouseWheelSmoothScroll,arrowSize:M.arrowSize!==void 0?M.arrowSize:11,listenOnDomNode:M.listenOnDomNode!==void 0?M.listenOnDomNode:null,horizontal:M.horizontal!==void 0?M.horizontal:u.ScrollbarVisibility.Auto,horizontalScrollbarSize:M.horizontalScrollbarSize!==void 0?M.horizontalScrollbarSize:10,horizontalSliderSize:M.horizontalSliderSize!==void 0?M.horizontalSliderSize:0,horizontalHasArrows:M.horizontalHasArrows!==void 0&&M.horizontalHasArrows,vertical:M.vertical!==void 0?M.vertical:u.ScrollbarVisibility.Auto,verticalScrollbarSize:M.verticalScrollbarSize!==void 0?M.verticalScrollbarSize:10,verticalHasArrows:M.verticalHasArrows!==void 0&&M.verticalHasArrows,verticalSliderSize:M.verticalSliderSize!==void 0?M.verticalSliderSize:0,scrollByPage:M.scrollByPage!==void 0&&M.scrollByPage};return B.horizontalSliderSize=M.horizontalSliderSize!==void 0?M.horizontalSliderSize:B.horizontalScrollbarSize,B.verticalSliderSize=M.verticalSliderSize!==void 0?M.verticalSliderSize:B.verticalScrollbarSize,d.isMacintosh&&(B.className+=" mac"),B})(D),this._scrollable=T,this._register(this._scrollable.onScroll((M=>{this._onWillScroll.fire(M),this._onDidScroll(M),this._onScroll.fire(M)})));const P={onMouseWheel:M=>this._onMouseWheel(M),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new h.VerticalScrollbar(this._scrollable,this._options,P)),this._horizontalScrollbar=this._register(new n.HorizontalScrollbar(this._scrollable,this._options,P)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(b),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=(0,g.createFastDomNode)(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=(0,g.createFastDomNode)(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=(0,g.createFastDomNode)(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,(M=>this._onMouseOver(M))),this.onmouseleave(this._listenOnDomNode,(M=>this._onMouseLeave(M))),this._hideTimeout=this._register(new e.TimeoutTimer),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=(0,a.dispose)(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(b){this._verticalScrollbar.delegatePointerDown(b)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(b){this._scrollable.setScrollDimensions(b,!1)}updateClassName(b){this._options.className=b,d.isMacintosh&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(b){b.handleMouseWheel!==void 0&&(this._options.handleMouseWheel=b.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),b.mouseWheelScrollSensitivity!==void 0&&(this._options.mouseWheelScrollSensitivity=b.mouseWheelScrollSensitivity),b.fastScrollSensitivity!==void 0&&(this._options.fastScrollSensitivity=b.fastScrollSensitivity),b.scrollPredominantAxis!==void 0&&(this._options.scrollPredominantAxis=b.scrollPredominantAxis),b.horizontal!==void 0&&(this._options.horizontal=b.horizontal),b.vertical!==void 0&&(this._options.vertical=b.vertical),b.horizontalScrollbarSize!==void 0&&(this._options.horizontalScrollbarSize=b.horizontalScrollbarSize),b.verticalScrollbarSize!==void 0&&(this._options.verticalScrollbarSize=b.verticalScrollbarSize),b.scrollByPage!==void 0&&(this._options.scrollByPage=b.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(b){this._revealOnScroll=b}delegateScrollFromMouseWheelEvent(b){this._onMouseWheel(new c.StandardWheelEvent(b))}_setListeningToMouseWheel(b){if(this._mouseWheelToDispose.length>0!==b&&(this._mouseWheelToDispose=(0,a.dispose)(this._mouseWheelToDispose),b)){const D=T=>{this._onMouseWheel(new c.StandardWheelEvent(T))};this._mouseWheelToDispose.push(f.addDisposableListener(this._listenOnDomNode,f.EventType.MOUSE_WHEEL,D,{passive:!1}))}}_onMouseWheel(b){if(b.browserEvent?.defaultPrevented)return;const D=m.INSTANCE;D.acceptStandardWheelEvent(b);let T=!1;if(b.deltaY||b.deltaX){let M=b.deltaY*this._options.mouseWheelScrollSensitivity,B=b.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&B+M===0?B=M=0:Math.abs(M)>=Math.abs(B)?B=0:M=0),this._options.flipAxes&&([M,B]=[B,M]);const F=!d.isMacintosh&&b.browserEvent&&b.browserEvent.shiftKey;!this._options.scrollYToX&&!F||B||(B=M,M=0),b.browserEvent&&b.browserEvent.altKey&&(B*=this._options.fastScrollSensitivity,M*=this._options.fastScrollSensitivity);const S=this._scrollable.getFutureScrollPosition();let E={};if(M){const w=50*M,L=S.scrollTop-(w<0?Math.floor(w):Math.ceil(w));this._verticalScrollbar.writeScrollPosition(E,L)}if(B){const w=50*B,L=S.scrollLeft-(w<0?Math.floor(w):Math.ceil(w));this._horizontalScrollbar.writeScrollPosition(E,L)}E=this._scrollable.validateScrollPosition(E),(S.scrollLeft!==E.scrollLeft||S.scrollTop!==E.scrollTop)&&(this._options.mouseWheelSmoothScroll&&D.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(E):this._scrollable.setScrollPositionNow(E),T=!0)}let P=T;!P&&this._options.alwaysConsumeMouseWheel&&(P=!0),!P&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(P=!0),P&&(b.preventDefault(),b.stopPropagation())}_onDidScroll(b){this._shouldRender=this._horizontalScrollbar.onDidScroll(b)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(b)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const b=this._scrollable.getCurrentScrollPosition(),D=b.scrollTop>0,T=b.scrollLeft>0,P=T?" left":"",M=D?" top":"",B=T||D?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${P}`),this._topShadowDomNode.setClassName(`shadow${M}`),this._topLeftShadowDomNode.setClassName(`shadow${B}${M}${P}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(b){this._mouseIsOver=!1,this._hide()}_onMouseOver(b){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((()=>this._hide()),500)}}t.AbstractScrollableElement=C,t.ScrollableElement=class extends C{constructor(y,b){(b=b||{}).mouseWheelSmoothScroll=!1;const D=new u.Scrollable({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:T=>f.scheduleAtNextAnimationFrame(f.getWindow(y),T)});super(y,b,D),this._register(D)}setScrollPosition(y){this._scrollable.setScrollPositionNow(y)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},t.SmoothScrollableElement=class extends C{constructor(y,b,D){super(y,b,D)}setScrollPosition(y){y.reuseAnimation?this._scrollable.setScrollPositionSmooth(y,y.reuseAnimation):this._scrollable.setScrollPositionNow(y)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},t.DomScrollableElement=class extends C{constructor(y,b){(b=b||{}).mouseWheelSmoothScroll=!1;const D=new u.Scrollable({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:T=>f.scheduleAtNextAnimationFrame(f.getWindow(y),T)});super(y,b,D),this._register(D),this._element=y,this._register(this.onScroll((T=>{T.scrollTopChanged&&(this._element.scrollTop=T.scrollTop),T.scrollLeftChanged&&(this._element.scrollLeft=T.scrollLeft)}))),this.scanDomNode()}setScrollPosition(y){this._scrollable.setScrollPositionNow(y)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}},8974:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(h,s,e,r){r===void 0&&(r=e);var a=Object.getOwnPropertyDescriptor(s,e);a&&!("get"in a?!s.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return s[e]}}),Object.defineProperty(h,r,a)}:function(h,s,e,r){r===void 0&&(r=e),h[r]=s[e]}),v=this&&this.__setModuleDefault||(Object.create?function(h,s){Object.defineProperty(h,"default",{enumerable:!0,value:s})}:function(h,s){h.default=s}),o=this&&this.__importStar||function(h){if(h&&h.__esModule)return h;var s={};if(h!=null)for(var e in h)e!=="default"&&Object.prototype.hasOwnProperty.call(h,e)&&i(s,h,e);return v(s,h),s};Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollbarArrow=t.ARROW_IMG_SIZE=void 0;const p=_(8328),f=_(8286),g=_(1758),c=o(_(7093));t.ARROW_IMG_SIZE=11;class n extends f.Widget{constructor(s){super(),this._onActivate=s.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=s.bgWidth+"px",this.bgDomNode.style.height=s.bgHeight+"px",s.top!==void 0&&(this.bgDomNode.style.top="0px"),s.left!==void 0&&(this.bgDomNode.style.left="0px"),s.bottom!==void 0&&(this.bgDomNode.style.bottom="0px"),s.right!==void 0&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=s.className,this.domNode.style.position="absolute",this.domNode.style.width=t.ARROW_IMG_SIZE+"px",this.domNode.style.height=t.ARROW_IMG_SIZE+"px",s.top!==void 0&&(this.domNode.style.top=s.top+"px"),s.left!==void 0&&(this.domNode.style.left=s.left+"px"),s.bottom!==void 0&&(this.domNode.style.bottom=s.bottom+"px"),s.right!==void 0&&(this.domNode.style.right=s.right+"px"),this._pointerMoveMonitor=this._register(new p.GlobalPointerMoveMonitor),this._register(c.addStandardDisposableListener(this.bgDomNode,c.EventType.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._register(c.addStandardDisposableListener(this.domNode,c.EventType.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._pointerdownRepeatTimer=this._register(new c.WindowIntervalTimer),this._pointerdownScheduleRepeatTimer=this._register(new g.TimeoutTimer)}_arrowPointerDown(s){s.target&&s.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet((()=>{this._pointerdownRepeatTimer.cancelAndSet((()=>this._onActivate()),41.666666666666664,c.getWindow(s))}),200),this._pointerMoveMonitor.startMonitoring(s.target,s.pointerId,s.buttons,(e=>{}),(()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()})),s.preventDefault())}}t.ScrollbarArrow=n},8245:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollbarState=void 0;class _{constructor(v,o,p,f,g,c){this._scrollbarSize=Math.round(o),this._oppositeScrollbarSize=Math.round(p),this._arrowSize=Math.round(v),this._visibleSize=f,this._scrollSize=g,this._scrollPosition=c,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new _(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(v){const o=Math.round(v);return this._visibleSize!==o&&(this._visibleSize=o,this._refreshComputedValues(),!0)}setScrollSize(v){const o=Math.round(v);return this._scrollSize!==o&&(this._scrollSize=o,this._refreshComputedValues(),!0)}setScrollPosition(v){const o=Math.round(v);return this._scrollPosition!==o&&(this._scrollPosition=o,this._refreshComputedValues(),!0)}setScrollbarSize(v){this._scrollbarSize=Math.round(v)}setOppositeScrollbarSize(v){this._oppositeScrollbarSize=Math.round(v)}static _computeValues(v,o,p,f,g){const c=Math.max(0,p-v),n=Math.max(0,c-2*o),h=f>0&&f>p;if(!h)return{computedAvailableSize:Math.round(c),computedIsNeeded:h,computedSliderSize:Math.round(n),computedSliderRatio:0,computedSliderPosition:0};const s=Math.round(Math.max(20,Math.floor(p*n/f))),e=(n-s)/(f-p),r=g*e;return{computedAvailableSize:Math.round(c),computedIsNeeded:h,computedSliderSize:Math.round(s),computedSliderRatio:e,computedSliderPosition:Math.round(r)}}_refreshComputedValues(){const v=_._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=v.computedAvailableSize,this._computedIsNeeded=v.computedIsNeeded,this._computedSliderSize=v.computedSliderSize,this._computedSliderRatio=v.computedSliderRatio,this._computedSliderPosition=v.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(v){if(!this._computedIsNeeded)return 0;const o=v-this._arrowSize-this._computedSliderSize/2;return Math.round(o/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(v){if(!this._computedIsNeeded)return 0;const o=v-this._arrowSize;let p=this._scrollPosition;return o<this._computedSliderPosition?p-=this._visibleSize:p+=this._visibleSize,p}getDesiredScrollPositionFromDelta(v){if(!this._computedIsNeeded)return 0;const o=this._computedSliderPosition+v;return Math.round(o/this._computedSliderRatio)}}t.ScrollbarState=_},79:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollbarVisibilityController=void 0;const i=_(1758),v=_(7150),o=_(9881);class p extends v.Disposable{constructor(g,c,n){super(),this._visibility=g,this._visibleClassName=c,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new i.TimeoutTimer)}setVisibility(g){this._visibility!==g&&(this._visibility=g,this._updateShouldBeVisible())}setShouldBeVisible(g){this._rawShouldBeVisible=g,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility!==o.ScrollbarVisibility.Hidden&&(this._visibility===o.ScrollbarVisibility.Visible||this._rawShouldBeVisible)}_updateShouldBeVisible(){const g=this._applyVisibilitySetting();this._shouldBeVisible!==g&&(this._shouldBeVisible=g,this.ensureVisibility())}setIsNeeded(g){this._isNeeded!==g&&(this._isNeeded=g,this.ensureVisibility())}setDomNode(g){this._domNode=g,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{this._domNode?.setClassName(this._visibleClassName)}),0))}_hide(g){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(g?" fade":"")))}}t.ScrollbarVisibilityController=p},5473:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerticalScrollbar=void 0;const i=_(8801),v=_(8245),o=_(9881);class p extends i.AbstractScrollbar{constructor(g,c,n){const h=g.getScrollDimensions(),s=g.getCurrentScrollPosition();if(super({lazyRender:c.lazyRender,host:n,scrollbarState:new v.ScrollbarState(c.verticalHasArrows?c.arrowSize:0,c.vertical===o.ScrollbarVisibility.Hidden?0:c.verticalScrollbarSize,0,h.height,h.scrollHeight,s.scrollTop),visibility:c.vertical,extraScrollbarClassName:"vertical",scrollable:g,scrollByPage:c.scrollByPage}),c.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((c.verticalScrollbarSize-c.verticalSliderSize)/2),c.verticalSliderSize,void 0)}_updateSlider(g,c){this.slider.setHeight(g),this.slider.setTop(c)}_renderDomNode(g,c){this.domNode.setWidth(c),this.domNode.setHeight(g),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(g){return this._shouldRender=this._onElementScrollSize(g.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(g.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(g.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(g,c){return c}_sliderPointerPosition(g){return g.pageY}_sliderOrthogonalPointerPosition(g){return g.pageX}_updateScrollbarSize(g){this.slider.setWidth(g)}writeScrollPosition(g,c){g.scrollTop=c}updateOptions(g){this.updateScrollbarSize(g.vertical===o.ScrollbarVisibility.Hidden?0:g.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(g.vertical),this._scrollByPage=g.scrollByPage}}t.VerticalScrollbar=p},8286:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(s,e,r,a){a===void 0&&(a=r);var d=Object.getOwnPropertyDescriptor(e,r);d&&!("get"in d?!e.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(s,a,d)}:function(s,e,r,a){a===void 0&&(a=r),s[a]=e[r]}),v=this&&this.__setModuleDefault||(Object.create?function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}:function(s,e){s.default=e}),o=this&&this.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var r in s)r!=="default"&&Object.prototype.hasOwnProperty.call(s,r)&&i(e,s,r);return v(e,s),e};Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=void 0;const p=o(_(7093)),f=_(5394),g=_(5964),c=_(8594),n=_(7150);class h extends n.Disposable{onclick(e,r){this._register(p.addDisposableListener(e,p.EventType.CLICK,(a=>r(new g.StandardMouseEvent(p.getWindow(e),a)))))}onmousedown(e,r){this._register(p.addDisposableListener(e,p.EventType.MOUSE_DOWN,(a=>r(new g.StandardMouseEvent(p.getWindow(e),a)))))}onmouseover(e,r){this._register(p.addDisposableListener(e,p.EventType.MOUSE_OVER,(a=>r(new g.StandardMouseEvent(p.getWindow(e),a)))))}onmouseleave(e,r){this._register(p.addDisposableListener(e,p.EventType.MOUSE_LEAVE,(a=>r(new g.StandardMouseEvent(p.getWindow(e),a)))))}onkeydown(e,r){this._register(p.addDisposableListener(e,p.EventType.KEY_DOWN,(a=>r(new f.StandardKeyboardEvent(a)))))}onkeyup(e,r){this._register(p.addDisposableListener(e,p.EventType.KEY_UP,(a=>r(new f.StandardKeyboardEvent(a)))))}oninput(e,r){this._register(p.addDisposableListener(e,p.EventType.INPUT,r))}onblur(e,r){this._register(p.addDisposableListener(e,p.EventType.BLUR,r))}onfocus(e,r){this._register(p.addDisposableListener(e,p.EventType.FOCUS,r))}onchange(e,r){this._register(p.addDisposableListener(e,p.EventType.CHANGE,r))}ignoreGesture(e){return c.Gesture.ignoreTarget(e)}}t.Widget=h},4693:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mainWindow=void 0,t.ensureCodeWindow=function(_,i){},t.mainWindow=typeof window=="object"?window:globalThis},3058:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Permutation=t.CallbackIterable=t.ArrayQueue=t.booleanComparator=t.numberComparator=t.CompareResult=void 0,t.tail=function(r,a=0){return r[r.length-(1+a)]},t.tail2=function(r){if(r.length===0)throw new Error("Invalid tail call");return[r.slice(0,r.length-1),r[r.length-1]]},t.equals=function(r,a,d=(u,l)=>u===l){if(r===a)return!0;if(!r||!a||r.length!==a.length)return!1;for(let u=0,l=r.length;u<l;u++)if(!d(r[u],a[u]))return!1;return!0},t.removeFastWithoutKeepingOrder=function(r,a){const d=r.length-1;a<d&&(r[a]=r[d]),r.pop()},t.binarySearch=function(r,a,d){return o(r.length,(u=>d(r[u],a)))},t.binarySearch2=o,t.quickSelect=function r(a,d,u){if((a|=0)>=d.length)throw new TypeError("invalid index");const l=d[Math.floor(d.length*Math.random())],m=[],C=[],y=[];for(const b of d){const D=u(b,l);D<0?m.push(b):D>0?C.push(b):y.push(b)}return a<m.length?r(a,m,u):a<m.length+y.length?y[0]:r(a-(m.length+y.length),C,u)},t.groupBy=function(r,a){const d=[];let u;for(const l of r.slice(0).sort(a))u&&a(u[0],l)===0?u.push(l):(u=[l],d.push(u));return d},t.groupAdjacentBy=function*(r,a){let d,u;for(const l of r)u!==void 0&&a(u,l)?d.push(l):(d&&(yield d),d=[l]),u=l;d&&(yield d)},t.forEachAdjacent=function(r,a){for(let d=0;d<=r.length;d++)a(d===0?void 0:r[d-1],d===r.length?void 0:r[d])},t.forEachWithNeighbors=function(r,a){for(let d=0;d<r.length;d++)a(d===0?void 0:r[d-1],r[d],d+1===r.length?void 0:r[d+1])},t.sortedDiff=p,t.delta=function(r,a,d){const u=p(r,a,d),l=[],m=[];for(const C of u)l.push(...r.slice(C.start,C.start+C.deleteCount)),m.push(...C.toInsert);return{removed:l,added:m}},t.top=function(r,a,d){if(d===0)return[];const u=r.slice(0,d).sort(a);return f(r,a,u,d,r.length),u},t.topAsync=function(r,a,d,u,l){return d===0?Promise.resolve([]):new Promise(((m,C)=>{(async()=>{const y=r.length,b=r.slice(0,d).sort(a);for(let D=d,T=Math.min(d+u,y);D<y;D=T,T=Math.min(T+u,y)){if(D>d&&await new Promise((P=>setTimeout(P))),l&&l.isCancellationRequested)throw new i.CancellationError;f(r,a,b,D,T)}return b})().then(m,C)}))},t.coalesce=function(r){return r.filter((a=>!!a))},t.coalesceInPlace=function(r){let a=0;for(let d=0;d<r.length;d++)r[d]&&(r[a]=r[d],a+=1);r.length=a},t.move=function(r,a,d){r.splice(d,0,r.splice(a,1)[0])},t.isFalsyOrEmpty=function(r){return!Array.isArray(r)||r.length===0},t.isNonEmptyArray=function(r){return Array.isArray(r)&&r.length>0},t.distinct=function(r,a=d=>d){const d=new Set;return r.filter((u=>{const l=a(u);return!d.has(l)&&(d.add(l),!0)}))},t.uniqueFilter=function(r){const a=new Set;return d=>{const u=r(d);return!a.has(u)&&(a.add(u),!0)}},t.firstOrDefault=function(r,a){return r.length>0?r[0]:a},t.lastOrDefault=function(r,a){return r.length>0?r[r.length-1]:a},t.commonPrefixLength=function(r,a,d=(u,l)=>u===l){let u=0;for(let l=0,m=Math.min(r.length,a.length);l<m&&d(r[l],a[l]);l++)u++;return u},t.range=function(r,a){let d=typeof a=="number"?r:0;typeof a=="number"?d=r:(d=0,a=r);const u=[];if(d<=a)for(let l=d;l<a;l++)u.push(l);else for(let l=d;l>a;l--)u.push(l);return u},t.index=function(r,a,d){return r.reduce(((u,l)=>(u[a(l)]=d?d(l):l,u)),Object.create(null))},t.insert=function(r,a){return r.push(a),()=>g(r,a)},t.remove=g,t.arrayInsert=function(r,a,d){const u=r.slice(0,a),l=r.slice(a);return u.concat(d,l)},t.shuffle=function(r,a){let d;if(typeof a=="number"){let u=a;d=()=>{const l=179426549*Math.sin(u++);return l-Math.floor(l)}}else d=Math.random;for(let u=r.length-1;u>0;u-=1){const l=Math.floor(d()*(u+1)),m=r[u];r[u]=r[l],r[l]=m}},t.pushToStart=function(r,a){const d=r.indexOf(a);d>-1&&(r.splice(d,1),r.unshift(a))},t.pushToEnd=function(r,a){const d=r.indexOf(a);d>-1&&(r.splice(d,1),r.push(a))},t.pushMany=function(r,a){for(const d of a)r.push(d)},t.mapArrayOrNot=function(r,a){return Array.isArray(r)?r.map(a):a(r)},t.asArray=function(r){return Array.isArray(r)?r:[r]},t.getRandomElement=function(r){return r[Math.floor(Math.random()*r.length)]},t.insertInto=c,t.splice=function(r,a,d,u){const l=n(r,a);let m=r.splice(l,d);return m===void 0&&(m=[]),c(r,l,u),m},t.compareBy=function(r,a){return(d,u)=>a(r(d),r(u))},t.tieBreakComparators=function(...r){return(a,d)=>{for(const u of r){const l=u(a,d);if(!h.isNeitherLessOrGreaterThan(l))return l}return h.neitherLessOrGreaterThan}},t.reverseOrder=function(r){return(a,d)=>-r(a,d)};const i=_(9807),v=_(8297);function o(r,a){let d=0,u=r-1;for(;d<=u;){const l=(d+u)/2|0,m=a(l);if(m<0)d=l+1;else{if(!(m>0))return l;u=l-1}}return-(d+1)}function p(r,a,d){const u=[];function l(y,b,D){if(b===0&&D.length===0)return;const T=u[u.length-1];T&&T.start+T.deleteCount===y?(T.deleteCount+=b,T.toInsert.push(...D)):u.push({start:y,deleteCount:b,toInsert:D})}let m=0,C=0;for(;;){if(m===r.length){l(m,0,a.slice(C));break}if(C===a.length){l(m,r.length-m,[]);break}const y=r[m],b=a[C],D=d(y,b);D===0?(m+=1,C+=1):D<0?(l(m,1,[]),m+=1):D>0&&(l(m,0,[b]),C+=1)}return u}function f(r,a,d,u,l){for(const m=d.length;u<l;u++){const C=r[u];if(a(C,d[m-1])<0){d.pop();const y=(0,v.findFirstIdxMonotonousOrArrLen)(d,(b=>a(C,b)<0));d.splice(y,0,C)}}}function g(r,a){const d=r.indexOf(a);if(d>-1)return r.splice(d,1),a}function c(r,a,d){const u=n(r,a),l=r.length,m=d.length;r.length=l+m;for(let C=l-1;C>=u;C--)r[C+m]=r[C];for(let C=0;C<m;C++)r[C+u]=d[C]}function n(r,a){return a<0?Math.max(a+r.length,0):Math.min(a,r.length)}var h;(function(r){r.isLessThan=function(a){return a<0},r.isLessThanOrEqual=function(a){return a<=0},r.isGreaterThan=function(a){return a>0},r.isNeitherLessOrGreaterThan=function(a){return a===0},r.greaterThan=1,r.lessThan=-1,r.neitherLessOrGreaterThan=0})(h||(t.CompareResult=h={})),t.numberComparator=(r,a)=>r-a,t.booleanComparator=(r,a)=>(0,t.numberComparator)(r?1:0,a?1:0),t.ArrayQueue=class{constructor(r){this.items=r,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(r){let a=this.firstIdx;for(;a<this.items.length&&r(this.items[a]);)a++;const d=a===this.firstIdx?null:this.items.slice(this.firstIdx,a);return this.firstIdx=a,d}takeFromEndWhile(r){let a=this.lastIdx;for(;a>=0&&r(this.items[a]);)a--;const d=a===this.lastIdx?null:this.items.slice(a+1,this.lastIdx+1);return this.lastIdx=a,d}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){const r=this.items[this.firstIdx];return this.firstIdx++,r}removeLast(){const r=this.items[this.lastIdx];return this.lastIdx--,r}takeCount(r){const a=this.items.slice(this.firstIdx,this.firstIdx+r);return this.firstIdx+=r,a}};class s{static{this.empty=new s((a=>{}))}constructor(a){this.iterate=a}forEach(a){this.iterate((d=>(a(d),!0)))}toArray(){const a=[];return this.iterate((d=>(a.push(d),!0))),a}filter(a){return new s((d=>this.iterate((u=>!a(u)||d(u)))))}map(a){return new s((d=>this.iterate((u=>d(a(u))))))}some(a){let d=!1;return this.iterate((u=>(d=a(u),!d))),d}findFirst(a){let d;return this.iterate((u=>!a(u)||(d=u,!1))),d}findLast(a){let d;return this.iterate((u=>(a(u)&&(d=u),!0))),d}findLastMaxBy(a){let d,u=!0;return this.iterate((l=>((u||h.isGreaterThan(a(l,d)))&&(u=!1,d=l),!0))),d}}t.CallbackIterable=s;class e{constructor(a){this._indexMap=a}static createSortPermutation(a,d){const u=Array.from(a.keys()).sort(((l,m)=>d(a[l],a[m])));return new e(u)}apply(a){return a.map(((d,u)=>a[this._indexMap[u]]))}inverse(){const a=this._indexMap.slice();for(let d=0;d<this._indexMap.length;d++)a[this._indexMap[d]]=d;return new e(a)}}t.Permutation=e},8297:(W,t)=>{function _(f,g,c=f.length-1){for(let n=c;n>=0;n--)if(g(f[n]))return n;return-1}function i(f,g,c=0,n=f.length){let h=c,s=n;for(;h<s;){const e=Math.floor((h+s)/2);g(f[e])?h=e+1:s=e}return h-1}function v(f,g,c=0,n=f.length){let h=c,s=n;for(;h<s;){const e=Math.floor((h+s)/2);g(f[e])?s=e:h=e+1}return h}Object.defineProperty(t,"__esModule",{value:!0}),t.MonotonousArray=void 0,t.findLast=function(f,g){const c=_(f,g);if(c!==-1)return f[c]},t.findLastIdx=_,t.findLastMonotonous=function(f,g){const c=i(f,g);return c===-1?void 0:f[c]},t.findLastIdxMonotonous=i,t.findFirstMonotonous=function(f,g){const c=v(f,g);return c===f.length?void 0:f[c]},t.findFirstIdxMonotonousOrArrLen=v,t.findFirstIdxMonotonous=function(f,g,c=0,n=f.length){const h=v(f,g,c,n);return h===f.length?-1:h},t.findFirstMax=p,t.findLastMax=function(f,g){if(f.length===0)return;let c=f[0];for(let n=1;n<f.length;n++){const h=f[n];g(h,c)>=0&&(c=h)}return c},t.findFirstMin=function(f,g){return p(f,((c,n)=>-g(c,n)))},t.findMaxIdx=function(f,g){if(f.length===0)return-1;let c=0;for(let n=1;n<f.length;n++)g(f[n],f[c])>0&&(c=n);return c},t.mapFindFirst=function(f,g){for(const c of f){const n=g(c);if(n!==void 0)return n}};class o{static{this.assertInvariants=!1}constructor(g){this._array=g,this._findLastMonotonousLastIdx=0}findLastMonotonous(g){if(o.assertInvariants){if(this._prevFindLastPredicate){for(const n of this._array)if(this._prevFindLastPredicate(n)&&!g(n))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=g}const c=i(this._array,g,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=c+1,c===-1?void 0:this._array[c]}}function p(f,g){if(f.length===0)return;let c=f[0];for(let n=1;n<f.length;n++){const h=f[n];g(h,c)>0&&(c=h)}return c}t.MonotonousArray=o},1758:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncIterableSource=t.CancelableAsyncIterableObject=t.AsyncIterableObject=t.LazyStatefulPromise=t.StatefulPromise=t.Promises=t.DeferredPromise=t.IntervalCounter=t.TaskSequentializer=t.GlobalIdleValue=t.AbstractIdleValue=t._runWhenIdle=t.runWhenGlobalIdle=t.ThrottledWorker=t.RunOnceWorker=t.ProcessTimeRunOnceScheduler=t.RunOnceScheduler=t.IntervalTimer=t.TimeoutTimer=t.LimitedQueue=t.Queue=t.Limiter=t.AutoOpenBarrier=t.Barrier=t.ThrottledDelayer=t.Delayer=t.SequencerByKey=t.Sequencer=t.Throttler=void 0,t.isThenable=n,t.createCancelablePromise=h,t.raceCancellation=function(S,E,w){return new Promise(((L,O)=>{const N=E.onCancellationRequested((()=>{N.dispose(),L(w)}));S.then(L,O).finally((()=>N.dispose()))}))},t.raceCancellationError=function(S,E){return new Promise(((w,L)=>{const O=E.onCancellationRequested((()=>{O.dispose(),L(new v.CancellationError)}));S.then(w,L).finally((()=>O.dispose()))}))},t.raceCancellablePromises=async function(S){let E=-1;const w=S.map(((L,O)=>L.then((N=>(E=O,N)))));try{return await Promise.race(w)}finally{S.forEach(((L,O)=>{O!==E&&L.cancel()}))}},t.raceTimeout=function(S,E,w){let L;const O=setTimeout((()=>{L?.(void 0),w?.()}),E);return Promise.race([S.finally((()=>clearTimeout(O))),new Promise((N=>L=N))])},t.asPromise=function(S){return new Promise(((E,w)=>{const L=S();n(L)?L.then(E,w):E(L)}))},t.promiseWithResolvers=s,t.timeout=d,t.disposableTimeout=function(S,E=0,w){const L=setTimeout((()=>{S(),w&&O.dispose()}),E),O=(0,p.toDisposable)((()=>{clearTimeout(L),w?.deleteAndLeak(O)}));return w?.add(O),O},t.sequence=function(S){const E=[];let w=0;const L=S.length;return Promise.resolve(null).then((function O(N){N!=null&&E.push(N);const H=w<L?S[w++]():null;return H?H.then(O):Promise.resolve(E)}))},t.first=function(S,E=L=>!!L,w=null){let L=0;const O=S.length,N=()=>{if(L>=O)return Promise.resolve(w);const H=S[L++];return Promise.resolve(H()).then((j=>E(j)?Promise.resolve(j):N()))};return N()},t.firstParallel=function(S,E=L=>!!L,w=null){if(S.length===0)return Promise.resolve(w);let L=S.length;const O=()=>{L=-1;for(const N of S)N.cancel?.()};return new Promise(((N,H)=>{for(const j of S)j.then((x=>{--L>=0&&E(x)?(O(),N(x)):L===0&&N(w)})).catch((x=>{--L>=0&&(O(),H(x))}))}))},t.retry=async function(S,E,w){let L;for(let O=0;O<w;O++)try{return await S()}catch(N){L=N,await d(E)}throw L},t.createCancelableAsyncIterable=function(S){const E=new i.CancellationTokenSource,w=S(E.token);return new F(E,(async L=>{const O=E.token.onCancellationRequested((()=>{O.dispose(),E.dispose(),L.reject(new v.CancellationError)}));try{for await(const N of w){if(E.token.isCancellationRequested)return;L.emitOne(N)}O.dispose(),E.dispose()}catch(N){O.dispose(),E.dispose(),L.reject(N)}}))};const i=_(8447),v=_(9807),o=_(802),p=_(7150),f=_(8163),g=_(5015),c=_(626);function n(S){return!!S&&typeof S.then=="function"}function h(S){const E=new i.CancellationTokenSource,w=S(E.token),L=new Promise(((O,N)=>{const H=E.token.onCancellationRequested((()=>{H.dispose(),N(new v.CancellationError)}));Promise.resolve(w).then((j=>{H.dispose(),E.dispose(),O(j)}),(j=>{H.dispose(),E.dispose(),N(j)}))}));return new class{cancel(){E.cancel(),E.dispose()}then(O,N){return L.then(O,N)}catch(O){return this.then(void 0,O)}finally(O){return L.finally(O)}}}function s(){let S,E;return{promise:new Promise(((w,L)=>{S=w,E=L})),resolve:S,reject:E}}class e{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(E){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=E,!this.queuedPromise){const w=()=>{if(this.queuedPromise=null,this.isDisposed)return;const L=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,L};this.queuedPromise=new Promise((L=>{this.activePromise.then(w,w).then(L)}))}return new Promise(((w,L)=>{this.queuedPromise.then(w,L)}))}return this.activePromise=E(),new Promise(((w,L)=>{this.activePromise.then((O=>{this.activePromise=null,w(O)}),(O=>{this.activePromise=null,L(O)}))}))}dispose(){this.isDisposed=!0}}t.Throttler=e,t.Sequencer=class{constructor(){this.current=Promise.resolve(null)}queue(S){return this.current=this.current.then((()=>S()),(()=>S()))}},t.SequencerByKey=class{constructor(){this.promiseMap=new Map}queue(S,E){const w=(this.promiseMap.get(S)??Promise.resolve()).catch((()=>{})).then(E).finally((()=>{this.promiseMap.get(S)===w&&this.promiseMap.delete(S)}));return this.promiseMap.set(S,w),w}};class r{constructor(E){this.defaultDelay=E,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(E,w=this.defaultDelay){this.task=E,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((O,N)=>{this.doResolve=O,this.doReject=N})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const O=this.task;return this.task=null,O()}})));const L=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=w===g.MicrotaskDelay?(O=>{let N=!0;return queueMicrotask((()=>{N&&(N=!1,O())})),{isTriggered:()=>N,dispose:()=>{N=!1}}})(L):((O,N)=>{let H=!0;const j=setTimeout((()=>{H=!1,N()}),O);return{isTriggered:()=>H,dispose:()=>{clearTimeout(j),H=!1}}})(w,L),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new v.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}t.Delayer=r,t.ThrottledDelayer=class{constructor(S){this.delayer=new r(S),this.throttler=new e}trigger(S,E){return this.delayer.trigger((()=>this.throttler.queue(S)),E)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};class a{constructor(){this._isOpen=!1,this._promise=new Promise(((E,w)=>{this._completePromise=E}))}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}function d(S,E){return E?new Promise(((w,L)=>{const O=setTimeout((()=>{N.dispose(),w()}),S),N=E.onCancellationRequested((()=>{clearTimeout(O),N.dispose(),L(new v.CancellationError)}))})):h((w=>d(S,w)))}t.Barrier=a,t.AutoOpenBarrier=class extends a{constructor(S){super(),this._timeout=setTimeout((()=>this.open()),S)}open(){clearTimeout(this._timeout),super.open()}};class u{constructor(E){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=E,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new o.Emitter}whenIdle(){return this.size>0?o.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(E){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise(((w,L)=>{this.outstandingPromises.push({factory:E,c:w,e:L}),this.consume()}))}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const E=this.outstandingPromises.shift();this.runningPromises++;const w=E.factory();w.then(E.c,E.e),w.then((()=>this.consumed()),(()=>this.consumed()))}}consumed(){this._isDisposed||(this.runningPromises--,--this._size==0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}}t.Limiter=u,t.Queue=class extends u{constructor(){super(1)}},t.LimitedQueue=class{constructor(){this.sequentializer=new y,this.tasks=0}queue(S){return this.sequentializer.isRunning()?this.sequentializer.queue((()=>this.sequentializer.run(this.tasks++,S()))):this.sequentializer.run(this.tasks++,S())}},t.TimeoutTimer=class{constructor(S,E){this._isDisposed=!1,this._token=-1,typeof S=="function"&&typeof E=="number"&&this.setIfNotSet(S,E)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(S,E){if(this._isDisposed)throw new v.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout((()=>{this._token=-1,S()}),E)}setIfNotSet(S,E){if(this._isDisposed)throw new v.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout((()=>{this._token=-1,S()}),E))}},t.IntervalTimer=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(S,E,w=globalThis){if(this.isDisposed)throw new v.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const L=w.setInterval((()=>{S()}),E);this.disposable=(0,p.toDisposable)((()=>{w.clearInterval(L),this.disposable=void 0}))}dispose(){this.cancel(),this.isDisposed=!0}};class l{constructor(E,w){this.timeoutToken=-1,this.runner=E,this.timeout=w,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(E=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,E)}get delay(){return this.timeout}set delay(E){this.timeout=E}isScheduled(){return this.timeoutToken!==-1}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner?.()}}t.RunOnceScheduler=l,t.ProcessTimeRunOnceScheduler=class{constructor(S,E){E%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${E}ms is not a multiple of 1000ms.`),this.runner=S,this.timeout=E,this.counter=0,this.intervalToken=-1,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=-1)}schedule(S=this.timeout){S%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${S}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(S/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==-1}onInterval(){this.counter--,this.counter>0||(clearInterval(this.intervalToken),this.intervalToken=-1,this.runner?.())}},t.RunOnceWorker=class extends l{constructor(S,E){super(S,E),this.units=[]}work(S){this.units.push(S),this.isScheduled()||this.schedule()}doRun(){const S=this.units;this.units=[],this.runner?.(S)}dispose(){this.units=[],super.dispose()}};class m extends p.Disposable{constructor(E,w){super(),this.options=E,this.handler=w,this.pendingWork=[],this.throttler=this._register(new p.MutableDisposable),this.disposed=!1}get pending(){return this.pendingWork.length}work(E){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+E.length>this.options.maxBufferedWork)return!1}else if(this.pending+E.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(const w of E)this.pendingWork.push(w);return this.throttler.value||this.doWork(),!0}doWork(){this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&(this.throttler.value=new l((()=>{this.throttler.clear(),this.doWork()}),this.options.throttleDelay),this.throttler.value.schedule())}dispose(){super.dispose(),this.disposed=!0}}t.ThrottledWorker=m,typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?t._runWhenIdle=(S,E)=>{(0,f.setTimeout0)((()=>{if(w)return;const L=Date.now()+15;E(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,L-Date.now())}))}));let w=!1;return{dispose(){w||(w=!0)}}}:t._runWhenIdle=(S,E,w)=>{const L=S.requestIdleCallback(E,typeof w=="number"?{timeout:w}:void 0);let O=!1;return{dispose(){O||(O=!0,S.cancelIdleCallback(L))}}},t.runWhenGlobalIdle=S=>(0,t._runWhenIdle)(globalThis,S);class C{constructor(E,w){this._didRun=!1,this._executor=()=>{try{this._value=w()}catch(L){this._error=L}finally{this._didRun=!0}},this._handle=(0,t._runWhenIdle)(E,(()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}t.AbstractIdleValue=C,t.GlobalIdleValue=class extends C{constructor(S){super(globalThis,S)}};class y{isRunning(E){return typeof E=="number"?this._running?.taskId===E:!!this._running}get running(){return this._running?.promise}cancelRunning(){this._running?.cancel()}run(E,w,L){return this._running={taskId:E,cancel:()=>L?.(),promise:w},w.then((()=>this.doneRunning(E)),(()=>this.doneRunning(E))),w}doneRunning(E){this._running&&E===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){const E=this._queued;this._queued=void 0,E.run().then(E.promiseResolve,E.promiseReject)}}queue(E){if(this._queued)this._queued.run=E;else{const{promise:w,resolve:L,reject:O}=s();this._queued={run:E,promise:w,promiseResolve:L,promiseReject:O}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}}var b,D,T;t.TaskSequentializer=y,t.IntervalCounter=class{constructor(S,E=()=>Date.now()){this.interval=S,this.nowFn=E,this.lastIncrementTime=0,this.value=0}increment(){const S=this.nowFn();return S-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=S,this.value=0),this.value++,this.value}},(function(S){S[S.Resolved=0]="Resolved",S[S.Rejected=1]="Rejected"})(b||(b={}));class P{get isRejected(){return this.outcome?.outcome===b.Rejected}get isResolved(){return this.outcome?.outcome===b.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===b.Resolved?this.outcome?.value:void 0}constructor(){this.p=new Promise(((E,w)=>{this.completeCallback=E,this.errorCallback=w}))}complete(E){return new Promise((w=>{this.completeCallback(E),this.outcome={outcome:b.Resolved,value:E},w()}))}error(E){return new Promise((w=>{this.errorCallback(E),this.outcome={outcome:b.Rejected,value:E},w()}))}cancel(){return this.error(new v.CancellationError)}}t.DeferredPromise=P,(function(S){S.settled=async function(E){let w;const L=await Promise.all(E.map((O=>O.then((N=>N),(N=>{w||(w=N)})))));if(w!==void 0)throw w;return L},S.withAsyncBody=function(E){return new Promise((async(w,L)=>{try{await E(w,L)}catch(O){L(O)}}))}})(D||(t.Promises=D={}));class M{get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(E){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=E.then((w=>(this._value=w,this._isResolved=!0,w)),(w=>{throw this._error=w,this._isResolved=!0,w}))}requireValue(){if(!this._isResolved)throw new v.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}}t.StatefulPromise=M,t.LazyStatefulPromise=class{constructor(S){this._compute=S,this._promise=new c.Lazy((()=>new M(this._compute())))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}},(function(S){S[S.Initial=0]="Initial",S[S.DoneOK=1]="DoneOK",S[S.DoneError=2]="DoneError"})(T||(T={}));class B{static fromArray(E){return new B((w=>{w.emitMany(E)}))}static fromPromise(E){return new B((async w=>{w.emitMany(await E)}))}static fromPromises(E){return new B((async w=>{await Promise.all(E.map((async L=>w.emitOne(await L))))}))}static merge(E){return new B((async w=>{await Promise.all(E.map((async L=>{for await(const O of L)w.emitOne(O)})))}))}static{this.EMPTY=B.fromArray([])}constructor(E,w){this._state=T.Initial,this._results=[],this._error=null,this._onReturn=w,this._onStateChanged=new o.Emitter,queueMicrotask((async()=>{const L={emitOne:O=>this.emitOne(O),emitMany:O=>this.emitMany(O),reject:O=>this.reject(O)};try{await Promise.resolve(E(L)),this.resolve()}catch(O){this.reject(O)}finally{L.emitOne=void 0,L.emitMany=void 0,L.reject=void 0}}))}[Symbol.asyncIterator](){let E=0;return{next:async()=>{for(;;){if(this._state===T.DoneError)throw this._error;if(E<this._results.length)return{done:!1,value:this._results[E++]};if(this._state===T.DoneOK)return{done:!0,value:void 0};await o.Event.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(E,w){return new B((async L=>{for await(const O of E)L.emitOne(w(O))}))}map(E){return B.map(this,E)}static filter(E,w){return new B((async L=>{for await(const O of E)w(O)&&L.emitOne(O)}))}filter(E){return B.filter(this,E)}static coalesce(E){return B.filter(E,(w=>!!w))}coalesce(){return B.coalesce(this)}static async toPromise(E){const w=[];for await(const L of E)w.push(L);return w}toPromise(){return B.toPromise(this)}emitOne(E){this._state===T.Initial&&(this._results.push(E),this._onStateChanged.fire())}emitMany(E){this._state===T.Initial&&(this._results=this._results.concat(E),this._onStateChanged.fire())}resolve(){this._state===T.Initial&&(this._state=T.DoneOK,this._onStateChanged.fire())}reject(E){this._state===T.Initial&&(this._state=T.DoneError,this._error=E,this._onStateChanged.fire())}}t.AsyncIterableObject=B;class F extends B{constructor(E,w){super(w),this._source=E}cancel(){this._source.cancel()}}t.CancelableAsyncIterableObject=F,t.AsyncIterableSource=class{constructor(S){let E,w;this._deferred=new P,this._asyncIterable=new B((L=>{if(!E)return w&&L.emitMany(w),this._errorFn=O=>L.reject(O),this._emitFn=O=>L.emitOne(O),this._deferred.p;L.reject(E)}),S),this._emitFn=L=>{w||(w=[]),w.push(L)},this._errorFn=L=>{E||(E=L)}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(S){this._errorFn(S),this._deferred.complete()}emitOne(S){this._emitFn(S)}}},8447:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0,t.cancelOnDispose=function(g){const c=new f;return g.add({dispose(){c.cancel()}}),c.token};const i=_(802),v=Object.freeze((function(g,c){const n=setTimeout(g.bind(c),0);return{dispose(){clearTimeout(n)}}}));var o;(function(g){g.isCancellationToken=function(c){return c===g.None||c===g.Cancelled||c instanceof p||!(!c||typeof c!="object")&&typeof c.isCancellationRequested=="boolean"&&typeof c.onCancellationRequested=="function"},g.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),g.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:v})})(o||(t.CancellationToken=o={}));class p{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?v:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class f{constructor(c){this._token=void 0,this._parentListener=void 0,this._parentListener=c&&c.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new p),this._token}cancel(){this._token?this._token instanceof p&&this._token.cancel():this._token=o.Cancelled}dispose(c=!1){c&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof p&&this._token.dispose():this._token=o.None}}t.CancellationTokenSource=f},4869:(W,t)=>{var _;Object.defineProperty(t,"__esModule",{value:!0}),t.CharCode=void 0,(function(i){i[i.Null=0]="Null",i[i.Backspace=8]="Backspace",i[i.Tab=9]="Tab",i[i.LineFeed=10]="LineFeed",i[i.CarriageReturn=13]="CarriageReturn",i[i.Space=32]="Space",i[i.ExclamationMark=33]="ExclamationMark",i[i.DoubleQuote=34]="DoubleQuote",i[i.Hash=35]="Hash",i[i.DollarSign=36]="DollarSign",i[i.PercentSign=37]="PercentSign",i[i.Ampersand=38]="Ampersand",i[i.SingleQuote=39]="SingleQuote",i[i.OpenParen=40]="OpenParen",i[i.CloseParen=41]="CloseParen",i[i.Asterisk=42]="Asterisk",i[i.Plus=43]="Plus",i[i.Comma=44]="Comma",i[i.Dash=45]="Dash",i[i.Period=46]="Period",i[i.Slash=47]="Slash",i[i.Digit0=48]="Digit0",i[i.Digit1=49]="Digit1",i[i.Digit2=50]="Digit2",i[i.Digit3=51]="Digit3",i[i.Digit4=52]="Digit4",i[i.Digit5=53]="Digit5",i[i.Digit6=54]="Digit6",i[i.Digit7=55]="Digit7",i[i.Digit8=56]="Digit8",i[i.Digit9=57]="Digit9",i[i.Colon=58]="Colon",i[i.Semicolon=59]="Semicolon",i[i.LessThan=60]="LessThan",i[i.Equals=61]="Equals",i[i.GreaterThan=62]="GreaterThan",i[i.QuestionMark=63]="QuestionMark",i[i.AtSign=64]="AtSign",i[i.A=65]="A",i[i.B=66]="B",i[i.C=67]="C",i[i.D=68]="D",i[i.E=69]="E",i[i.F=70]="F",i[i.G=71]="G",i[i.H=72]="H",i[i.I=73]="I",i[i.J=74]="J",i[i.K=75]="K",i[i.L=76]="L",i[i.M=77]="M",i[i.N=78]="N",i[i.O=79]="O",i[i.P=80]="P",i[i.Q=81]="Q",i[i.R=82]="R",i[i.S=83]="S",i[i.T=84]="T",i[i.U=85]="U",i[i.V=86]="V",i[i.W=87]="W",i[i.X=88]="X",i[i.Y=89]="Y",i[i.Z=90]="Z",i[i.OpenSquareBracket=91]="OpenSquareBracket",i[i.Backslash=92]="Backslash",i[i.CloseSquareBracket=93]="CloseSquareBracket",i[i.Caret=94]="Caret",i[i.Underline=95]="Underline",i[i.BackTick=96]="BackTick",i[i.a=97]="a",i[i.b=98]="b",i[i.c=99]="c",i[i.d=100]="d",i[i.e=101]="e",i[i.f=102]="f",i[i.g=103]="g",i[i.h=104]="h",i[i.i=105]="i",i[i.j=106]="j",i[i.k=107]="k",i[i.l=108]="l",i[i.m=109]="m",i[i.n=110]="n",i[i.o=111]="o",i[i.p=112]="p",i[i.q=113]="q",i[i.r=114]="r",i[i.s=115]="s",i[i.t=116]="t",i[i.u=117]="u",i[i.v=118]="v",i[i.w=119]="w",i[i.x=120]="x",i[i.y=121]="y",i[i.z=122]="z",i[i.OpenCurlyBrace=123]="OpenCurlyBrace",i[i.Pipe=124]="Pipe",i[i.CloseCurlyBrace=125]="CloseCurlyBrace",i[i.Tilde=126]="Tilde",i[i.NoBreakSpace=160]="NoBreakSpace",i[i.U_Combining_Grave_Accent=768]="U_Combining_Grave_Accent",i[i.U_Combining_Acute_Accent=769]="U_Combining_Acute_Accent",i[i.U_Combining_Circumflex_Accent=770]="U_Combining_Circumflex_Accent",i[i.U_Combining_Tilde=771]="U_Combining_Tilde",i[i.U_Combining_Macron=772]="U_Combining_Macron",i[i.U_Combining_Overline=773]="U_Combining_Overline",i[i.U_Combining_Breve=774]="U_Combining_Breve",i[i.U_Combining_Dot_Above=775]="U_Combining_Dot_Above",i[i.U_Combining_Diaeresis=776]="U_Combining_Diaeresis",i[i.U_Combining_Hook_Above=777]="U_Combining_Hook_Above",i[i.U_Combining_Ring_Above=778]="U_Combining_Ring_Above",i[i.U_Combining_Double_Acute_Accent=779]="U_Combining_Double_Acute_Accent",i[i.U_Combining_Caron=780]="U_Combining_Caron",i[i.U_Combining_Vertical_Line_Above=781]="U_Combining_Vertical_Line_Above",i[i.U_Combining_Double_Vertical_Line_Above=782]="U_Combining_Double_Vertical_Line_Above",i[i.U_Combining_Double_Grave_Accent=783]="U_Combining_Double_Grave_Accent",i[i.U_Combining_Candrabindu=784]="U_Combining_Candrabindu",i[i.U_Combining_Inverted_Breve=785]="U_Combining_Inverted_Breve",i[i.U_Combining_Turned_Comma_Above=786]="U_Combining_Turned_Comma_Above",i[i.U_Combining_Comma_Above=787]="U_Combining_Comma_Above",i[i.U_Combining_Reversed_Comma_Above=788]="U_Combining_Reversed_Comma_Above",i[i.U_Combining_Comma_Above_Right=789]="U_Combining_Comma_Above_Right",i[i.U_Combining_Grave_Accent_Below=790]="U_Combining_Grave_Accent_Below",i[i.U_Combining_Acute_Accent_Below=791]="U_Combining_Acute_Accent_Below",i[i.U_Combining_Left_Tack_Below=792]="U_Combining_Left_Tack_Below",i[i.U_Combining_Right_Tack_Below=793]="U_Combining_Right_Tack_Below",i[i.U_Combining_Left_Angle_Above=794]="U_Combining_Left_Angle_Above",i[i.U_Combining_Horn=795]="U_Combining_Horn",i[i.U_Combining_Left_Half_Ring_Below=796]="U_Combining_Left_Half_Ring_Below",i[i.U_Combining_Up_Tack_Below=797]="U_Combining_Up_Tack_Below",i[i.U_Combining_Down_Tack_Below=798]="U_Combining_Down_Tack_Below",i[i.U_Combining_Plus_Sign_Below=799]="U_Combining_Plus_Sign_Below",i[i.U_Combining_Minus_Sign_Below=800]="U_Combining_Minus_Sign_Below",i[i.U_Combining_Palatalized_Hook_Below=801]="U_Combining_Palatalized_Hook_Below",i[i.U_Combining_Retroflex_Hook_Below=802]="U_Combining_Retroflex_Hook_Below",i[i.U_Combining_Dot_Below=803]="U_Combining_Dot_Below",i[i.U_Combining_Diaeresis_Below=804]="U_Combining_Diaeresis_Below",i[i.U_Combining_Ring_Below=805]="U_Combining_Ring_Below",i[i.U_Combining_Comma_Below=806]="U_Combining_Comma_Below",i[i.U_Combining_Cedilla=807]="U_Combining_Cedilla",i[i.U_Combining_Ogonek=808]="U_Combining_Ogonek",i[i.U_Combining_Vertical_Line_Below=809]="U_Combining_Vertical_Line_Below",i[i.U_Combining_Bridge_Below=810]="U_Combining_Bridge_Below",i[i.U_Combining_Inverted_Double_Arch_Below=811]="U_Combining_Inverted_Double_Arch_Below",i[i.U_Combining_Caron_Below=812]="U_Combining_Caron_Below",i[i.U_Combining_Circumflex_Accent_Below=813]="U_Combining_Circumflex_Accent_Below",i[i.U_Combining_Breve_Below=814]="U_Combining_Breve_Below",i[i.U_Combining_Inverted_Breve_Below=815]="U_Combining_Inverted_Breve_Below",i[i.U_Combining_Tilde_Below=816]="U_Combining_Tilde_Below",i[i.U_Combining_Macron_Below=817]="U_Combining_Macron_Below",i[i.U_Combining_Low_Line=818]="U_Combining_Low_Line",i[i.U_Combining_Double_Low_Line=819]="U_Combining_Double_Low_Line",i[i.U_Combining_Tilde_Overlay=820]="U_Combining_Tilde_Overlay",i[i.U_Combining_Short_Stroke_Overlay=821]="U_Combining_Short_Stroke_Overlay",i[i.U_Combining_Long_Stroke_Overlay=822]="U_Combining_Long_Stroke_Overlay",i[i.U_Combining_Short_Solidus_Overlay=823]="U_Combining_Short_Solidus_Overlay",i[i.U_Combining_Long_Solidus_Overlay=824]="U_Combining_Long_Solidus_Overlay",i[i.U_Combining_Right_Half_Ring_Below=825]="U_Combining_Right_Half_Ring_Below",i[i.U_Combining_Inverted_Bridge_Below=826]="U_Combining_Inverted_Bridge_Below",i[i.U_Combining_Square_Below=827]="U_Combining_Square_Below",i[i.U_Combining_Seagull_Below=828]="U_Combining_Seagull_Below",i[i.U_Combining_X_Above=829]="U_Combining_X_Above",i[i.U_Combining_Vertical_Tilde=830]="U_Combining_Vertical_Tilde",i[i.U_Combining_Double_Overline=831]="U_Combining_Double_Overline",i[i.U_Combining_Grave_Tone_Mark=832]="U_Combining_Grave_Tone_Mark",i[i.U_Combining_Acute_Tone_Mark=833]="U_Combining_Acute_Tone_Mark",i[i.U_Combining_Greek_Perispomeni=834]="U_Combining_Greek_Perispomeni",i[i.U_Combining_Greek_Koronis=835]="U_Combining_Greek_Koronis",i[i.U_Combining_Greek_Dialytika_Tonos=836]="U_Combining_Greek_Dialytika_Tonos",i[i.U_Combining_Greek_Ypogegrammeni=837]="U_Combining_Greek_Ypogegrammeni",i[i.U_Combining_Bridge_Above=838]="U_Combining_Bridge_Above",i[i.U_Combining_Equals_Sign_Below=839]="U_Combining_Equals_Sign_Below",i[i.U_Combining_Double_Vertical_Line_Below=840]="U_Combining_Double_Vertical_Line_Below",i[i.U_Combining_Left_Angle_Below=841]="U_Combining_Left_Angle_Below",i[i.U_Combining_Not_Tilde_Above=842]="U_Combining_Not_Tilde_Above",i[i.U_Combining_Homothetic_Above=843]="U_Combining_Homothetic_Above",i[i.U_Combining_Almost_Equal_To_Above=844]="U_Combining_Almost_Equal_To_Above",i[i.U_Combining_Left_Right_Arrow_Below=845]="U_Combining_Left_Right_Arrow_Below",i[i.U_Combining_Upwards_Arrow_Below=846]="U_Combining_Upwards_Arrow_Below",i[i.U_Combining_Grapheme_Joiner=847]="U_Combining_Grapheme_Joiner",i[i.U_Combining_Right_Arrowhead_Above=848]="U_Combining_Right_Arrowhead_Above",i[i.U_Combining_Left_Half_Ring_Above=849]="U_Combining_Left_Half_Ring_Above",i[i.U_Combining_Fermata=850]="U_Combining_Fermata",i[i.U_Combining_X_Below=851]="U_Combining_X_Below",i[i.U_Combining_Left_Arrowhead_Below=852]="U_Combining_Left_Arrowhead_Below",i[i.U_Combining_Right_Arrowhead_Below=853]="U_Combining_Right_Arrowhead_Below",i[i.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]="U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below",i[i.U_Combining_Right_Half_Ring_Above=855]="U_Combining_Right_Half_Ring_Above",i[i.U_Combining_Dot_Above_Right=856]="U_Combining_Dot_Above_Right",i[i.U_Combining_Asterisk_Below=857]="U_Combining_Asterisk_Below",i[i.U_Combining_Double_Ring_Below=858]="U_Combining_Double_Ring_Below",i[i.U_Combining_Zigzag_Above=859]="U_Combining_Zigzag_Above",i[i.U_Combining_Double_Breve_Below=860]="U_Combining_Double_Breve_Below",i[i.U_Combining_Double_Breve=861]="U_Combining_Double_Breve",i[i.U_Combining_Double_Macron=862]="U_Combining_Double_Macron",i[i.U_Combining_Double_Macron_Below=863]="U_Combining_Double_Macron_Below",i[i.U_Combining_Double_Tilde=864]="U_Combining_Double_Tilde",i[i.U_Combining_Double_Inverted_Breve=865]="U_Combining_Double_Inverted_Breve",i[i.U_Combining_Double_Rightwards_Arrow_Below=866]="U_Combining_Double_Rightwards_Arrow_Below",i[i.U_Combining_Latin_Small_Letter_A=867]="U_Combining_Latin_Small_Letter_A",i[i.U_Combining_Latin_Small_Letter_E=868]="U_Combining_Latin_Small_Letter_E",i[i.U_Combining_Latin_Small_Letter_I=869]="U_Combining_Latin_Small_Letter_I",i[i.U_Combining_Latin_Small_Letter_O=870]="U_Combining_Latin_Small_Letter_O",i[i.U_Combining_Latin_Small_Letter_U=871]="U_Combining_Latin_Small_Letter_U",i[i.U_Combining_Latin_Small_Letter_C=872]="U_Combining_Latin_Small_Letter_C",i[i.U_Combining_Latin_Small_Letter_D=873]="U_Combining_Latin_Small_Letter_D",i[i.U_Combining_Latin_Small_Letter_H=874]="U_Combining_Latin_Small_Letter_H",i[i.U_Combining_Latin_Small_Letter_M=875]="U_Combining_Latin_Small_Letter_M",i[i.U_Combining_Latin_Small_Letter_R=876]="U_Combining_Latin_Small_Letter_R",i[i.U_Combining_Latin_Small_Letter_T=877]="U_Combining_Latin_Small_Letter_T",i[i.U_Combining_Latin_Small_Letter_V=878]="U_Combining_Latin_Small_Letter_V",i[i.U_Combining_Latin_Small_Letter_X=879]="U_Combining_Latin_Small_Letter_X",i[i.LINE_SEPARATOR=8232]="LINE_SEPARATOR",i[i.PARAGRAPH_SEPARATOR=8233]="PARAGRAPH_SEPARATOR",i[i.NEXT_LINE=133]="NEXT_LINE",i[i.U_CIRCUMFLEX=94]="U_CIRCUMFLEX",i[i.U_GRAVE_ACCENT=96]="U_GRAVE_ACCENT",i[i.U_DIAERESIS=168]="U_DIAERESIS",i[i.U_MACRON=175]="U_MACRON",i[i.U_ACUTE_ACCENT=180]="U_ACUTE_ACCENT",i[i.U_CEDILLA=184]="U_CEDILLA",i[i.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]="U_MODIFIER_LETTER_LEFT_ARROWHEAD",i[i.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]="U_MODIFIER_LETTER_RIGHT_ARROWHEAD",i[i.U_MODIFIER_LETTER_UP_ARROWHEAD=708]="U_MODIFIER_LETTER_UP_ARROWHEAD",i[i.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]="U_MODIFIER_LETTER_DOWN_ARROWHEAD",i[i.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]="U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING",i[i.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]="U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING",i[i.U_MODIFIER_LETTER_UP_TACK=724]="U_MODIFIER_LETTER_UP_TACK",i[i.U_MODIFIER_LETTER_DOWN_TACK=725]="U_MODIFIER_LETTER_DOWN_TACK",i[i.U_MODIFIER_LETTER_PLUS_SIGN=726]="U_MODIFIER_LETTER_PLUS_SIGN",i[i.U_MODIFIER_LETTER_MINUS_SIGN=727]="U_MODIFIER_LETTER_MINUS_SIGN",i[i.U_BREVE=728]="U_BREVE",i[i.U_DOT_ABOVE=729]="U_DOT_ABOVE",i[i.U_RING_ABOVE=730]="U_RING_ABOVE",i[i.U_OGONEK=731]="U_OGONEK",i[i.U_SMALL_TILDE=732]="U_SMALL_TILDE",i[i.U_DOUBLE_ACUTE_ACCENT=733]="U_DOUBLE_ACUTE_ACCENT",i[i.U_MODIFIER_LETTER_RHOTIC_HOOK=734]="U_MODIFIER_LETTER_RHOTIC_HOOK",i[i.U_MODIFIER_LETTER_CROSS_ACCENT=735]="U_MODIFIER_LETTER_CROSS_ACCENT",i[i.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]="U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR",i[i.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]="U_MODIFIER_LETTER_HIGH_TONE_BAR",i[i.U_MODIFIER_LETTER_MID_TONE_BAR=743]="U_MODIFIER_LETTER_MID_TONE_BAR",i[i.U_MODIFIER_LETTER_LOW_TONE_BAR=744]="U_MODIFIER_LETTER_LOW_TONE_BAR",i[i.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]="U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR",i[i.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]="U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK",i[i.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]="U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK",i[i.U_MODIFIER_LETTER_UNASPIRATED=749]="U_MODIFIER_LETTER_UNASPIRATED",i[i.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]="U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD",i[i.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]="U_MODIFIER_LETTER_LOW_UP_ARROWHEAD",i[i.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]="U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD",i[i.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]="U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD",i[i.U_MODIFIER_LETTER_LOW_RING=755]="U_MODIFIER_LETTER_LOW_RING",i[i.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]="U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT",i[i.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT",i[i.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT",i[i.U_MODIFIER_LETTER_LOW_TILDE=759]="U_MODIFIER_LETTER_LOW_TILDE",i[i.U_MODIFIER_LETTER_RAISED_COLON=760]="U_MODIFIER_LETTER_RAISED_COLON",i[i.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]="U_MODIFIER_LETTER_BEGIN_HIGH_TONE",i[i.U_MODIFIER_LETTER_END_HIGH_TONE=762]="U_MODIFIER_LETTER_END_HIGH_TONE",i[i.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]="U_MODIFIER_LETTER_BEGIN_LOW_TONE",i[i.U_MODIFIER_LETTER_END_LOW_TONE=764]="U_MODIFIER_LETTER_END_LOW_TONE",i[i.U_MODIFIER_LETTER_SHELF=765]="U_MODIFIER_LETTER_SHELF",i[i.U_MODIFIER_LETTER_OPEN_SHELF=766]="U_MODIFIER_LETTER_OPEN_SHELF",i[i.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]="U_MODIFIER_LETTER_LOW_LEFT_ARROW",i[i.U_GREEK_LOWER_NUMERAL_SIGN=885]="U_GREEK_LOWER_NUMERAL_SIGN",i[i.U_GREEK_TONOS=900]="U_GREEK_TONOS",i[i.U_GREEK_DIALYTIKA_TONOS=901]="U_GREEK_DIALYTIKA_TONOS",i[i.U_GREEK_KORONIS=8125]="U_GREEK_KORONIS",i[i.U_GREEK_PSILI=8127]="U_GREEK_PSILI",i[i.U_GREEK_PERISPOMENI=8128]="U_GREEK_PERISPOMENI",i[i.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]="U_GREEK_DIALYTIKA_AND_PERISPOMENI",i[i.U_GREEK_PSILI_AND_VARIA=8141]="U_GREEK_PSILI_AND_VARIA",i[i.U_GREEK_PSILI_AND_OXIA=8142]="U_GREEK_PSILI_AND_OXIA",i[i.U_GREEK_PSILI_AND_PERISPOMENI=8143]="U_GREEK_PSILI_AND_PERISPOMENI",i[i.U_GREEK_DASIA_AND_VARIA=8157]="U_GREEK_DASIA_AND_VARIA",i[i.U_GREEK_DASIA_AND_OXIA=8158]="U_GREEK_DASIA_AND_OXIA",i[i.U_GREEK_DASIA_AND_PERISPOMENI=8159]="U_GREEK_DASIA_AND_PERISPOMENI",i[i.U_GREEK_DIALYTIKA_AND_VARIA=8173]="U_GREEK_DIALYTIKA_AND_VARIA",i[i.U_GREEK_DIALYTIKA_AND_OXIA=8174]="U_GREEK_DIALYTIKA_AND_OXIA",i[i.U_GREEK_VARIA=8175]="U_GREEK_VARIA",i[i.U_GREEK_OXIA=8189]="U_GREEK_OXIA",i[i.U_GREEK_DASIA=8190]="U_GREEK_DASIA",i[i.U_IDEOGRAPHIC_FULL_STOP=12290]="U_IDEOGRAPHIC_FULL_STOP",i[i.U_LEFT_CORNER_BRACKET=12300]="U_LEFT_CORNER_BRACKET",i[i.U_RIGHT_CORNER_BRACKET=12301]="U_RIGHT_CORNER_BRACKET",i[i.U_LEFT_BLACK_LENTICULAR_BRACKET=12304]="U_LEFT_BLACK_LENTICULAR_BRACKET",i[i.U_RIGHT_BLACK_LENTICULAR_BRACKET=12305]="U_RIGHT_BLACK_LENTICULAR_BRACKET",i[i.U_OVERLINE=8254]="U_OVERLINE",i[i.UTF8_BOM=65279]="UTF8_BOM",i[i.U_FULLWIDTH_SEMICOLON=65307]="U_FULLWIDTH_SEMICOLON",i[i.U_FULLWIDTH_COMMA=65292]="U_FULLWIDTH_COMMA"})(_||(t.CharCode=_={}))},9087:(W,t)=>{var _;Object.defineProperty(t,"__esModule",{value:!0}),t.SetWithKey=void 0,t.groupBy=function(v,o){const p=Object.create(null);for(const f of v){const g=o(f);let c=p[g];c||(c=p[g]=[]),c.push(f)}return p},t.diffSets=function(v,o){const p=[],f=[];for(const g of v)o.has(g)||p.push(g);for(const g of o)v.has(g)||f.push(g);return{removed:p,added:f}},t.diffMaps=function(v,o){const p=[],f=[];for(const[g,c]of v)o.has(g)||p.push(c);for(const[g,c]of o)v.has(g)||f.push(c);return{removed:p,added:f}},t.intersection=function(v,o){const p=new Set;for(const f of o)v.has(f)&&p.add(f);return p};class i{static{_=Symbol.toStringTag}constructor(o,p){this.toKey=p,this._map=new Map,this[_]="SetWithKey";for(const f of o)this.add(f)}get size(){return this._map.size}add(o){const p=this.toKey(o);return this._map.set(p,o),this}delete(o){return this._map.delete(this.toKey(o))}has(o){return this._map.has(this.toKey(o))}*entries(){for(const o of this._map.values())yield[o,o]}keys(){return this.values()}*values(){for(const o of this._map.values())yield o}clear(){this._map.clear()}forEach(o,p){this._map.forEach((f=>o.call(p,f,f,this)))}[Symbol.iterator](){return this.values()}}t.SetWithKey=i},4838:(W,t)=>{function _(i){return(v,o,p)=>{let f=null,g=null;if(typeof p.value=="function"?(f="value",g=p.value):typeof p.get=="function"&&(f="get",g=p.get),!g)throw new Error("not supported");p[f]=i(g,o)}}Object.defineProperty(t,"__esModule",{value:!0}),t.memoize=function(i,v,o){let p=null,f=null;if(typeof o.value=="function"?(p="value",f=o.value,f.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof o.get=="function"&&(p="get",f=o.get),!f)throw new Error("not supported");const g=`$memoize$${v}`;o[p]=function(...c){return this.hasOwnProperty(g)||Object.defineProperty(this,g,{configurable:!1,enumerable:!1,writable:!1,value:f.apply(this,c)}),this[g]}},t.debounce=function(i,v,o){return _(((p,f)=>{const g=`$debounce$${f}`,c=`$debounce$result$${f}`;return function(...n){this[c]||(this[c]=o?o():void 0),clearTimeout(this[g]),v&&(this[c]=v(this[c],...n),n=[this[c]]),this[g]=setTimeout((()=>{p.apply(this,n),this[c]=o?o():void 0}),i)}}))},t.throttle=function(i,v,o){return _(((p,f)=>{const g=`$throttle$timer$${f}`,c=`$throttle$result$${f}`,n=`$throttle$lastRun$${f}`,h=`$throttle$pending$${f}`;return function(...s){if(this[c]||(this[c]=o?o():void 0),this[n]!==null&&this[n]!==void 0||(this[n]=-Number.MAX_VALUE),v&&(this[c]=v(this[c],...s)),this[h])return;const e=this[n]+i;e<=Date.now()?(this[n]=Date.now(),p.apply(this,[this[c]]),this[c]=o?o():void 0):(this[h]=!0,this[g]=setTimeout((()=>{this[h]=!1,this[n]=Date.now(),p.apply(this,[this[c]]),this[c]=o?o():void 0}),e-Date.now()))}}))}},9807:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BugIndicatingError=t.ErrorNoTelemetry=t.ExpectedError=t.NotSupportedError=t.NotImplementedError=t.ReadonlyError=t.CancellationError=t.errorHandler=t.ErrorHandler=void 0,t.setUnexpectedErrorHandler=function(s){t.errorHandler.setUnexpectedErrorHandler(s)},t.isSigPipeError=function(s){if(!s||typeof s!="object")return!1;const e=s;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"},t.onUnexpectedError=function(s){v(s)||t.errorHandler.onUnexpectedError(s)},t.onUnexpectedExternalError=function(s){v(s)||t.errorHandler.onUnexpectedExternalError(s)},t.transformErrorForSerialization=function(s){if(s instanceof Error){const{name:e,message:r}=s;return{$isError:!0,name:e,message:r,stack:s.stacktrace||s.stack,noTelemetry:n.isErrorNoTelemetry(s)}}return s},t.transformErrorFromSerialization=function(s){let e;return s.noTelemetry?e=new n:(e=new Error,e.name=s.name),e.message=s.message,e.stack=s.stack,e},t.isCancellationError=v,t.canceled=function(){const s=new Error(i);return s.name=s.message,s},t.illegalArgument=function(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")},t.illegalState=function(s){return s?new Error(`Illegal state: ${s}`):new Error("Illegal state")},t.getErrorMessage=function(s){return s?s.message?s.message:s.stack?s.stack.split(`
10
+ `)[0]:String(s):"Error"};class _{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{throw e.stack?n.isErrorNoTelemetry(e)?new n(e.message+`
11
+
12
+ `+e.stack):new Error(e.message+`
13
+
14
+ `+e.stack):e}),0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach((r=>{r(e)}))}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}t.ErrorHandler=_,t.errorHandler=new _;const i="Canceled";function v(s){return s instanceof o||s instanceof Error&&s.name===i&&s.message===i}class o extends Error{constructor(){super(i),this.name=this.message}}t.CancellationError=o;class p extends TypeError{constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}}t.ReadonlyError=p;class f extends Error{constructor(e){super("NotImplemented"),e&&(this.message=e)}}t.NotImplementedError=f;class g extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}t.NotSupportedError=g;class c extends Error{constructor(){super(...arguments),this.isExpected=!0}}t.ExpectedError=c;class n extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof n)return e;const r=new n;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}t.ErrorNoTelemetry=n;class h extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,h.prototype)}}t.BugIndicatingError=h},802:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueWithChangeEvent=t.Relay=t.EventBufferer=t.DynamicListEventMultiplexer=t.EventMultiplexer=t.MicrotaskEmitter=t.DebounceEmitter=t.PauseableEmitter=t.AsyncEmitter=t.createEventDeliveryQueue=t.Emitter=t.ListenerRefusalError=t.ListenerLeakError=t.EventProfiling=t.Event=void 0,t.setGlobalLeakWarningThreshold=function(b){const D=n;return n=b,{dispose(){n=D}}};const i=_(9807),v=_(8841),o=_(7150),p=_(6317),f=_(9725);var g;(function(b){function D(w){return(L,O=null,N)=>{let H,j=!1;return H=w((x=>{if(!j)return H?H.dispose():j=!0,L.call(O,x)}),null,N),j&&H.dispose(),H}}function T(w,L,O){return M(((N,H=null,j)=>w((x=>N.call(H,L(x))),null,j)),O)}function P(w,L,O){return M(((N,H=null,j)=>w((x=>L(x)&&N.call(H,x)),null,j)),O)}function M(w,L){let O;const N=new u({onWillAddFirstListener(){O=w(N.fire,N)},onDidRemoveLastListener(){O?.dispose()}});return L?.add(N),N.event}function B(w,L,O=100,N=!1,H=!1,j,x){let k,V,z,G,q=0;const J=new u({leakWarningThreshold:j,onWillAddFirstListener(){k=w((se=>{q++,V=L(V,se),N&&!z&&(J.fire(V),V=void 0),G=()=>{const ie=V;V=void 0,z=void 0,(!N||q>1)&&J.fire(ie),q=0},typeof O=="number"?(clearTimeout(z),z=setTimeout(G,O)):z===void 0&&(z=0,queueMicrotask(G))}))},onWillRemoveListener(){H&&q>0&&G?.()},onDidRemoveLastListener(){G=void 0,k.dispose()}});return x?.add(J),J.event}b.None=()=>o.Disposable.None,b.defer=function(w,L){return B(w,(()=>{}),0,void 0,!0,void 0,L)},b.once=D,b.map=T,b.forEach=function(w,L,O){return M(((N,H=null,j)=>w((x=>{L(x),N.call(H,x)}),null,j)),O)},b.filter=P,b.signal=function(w){return w},b.any=function(...w){return(L,O=null,N)=>{return H=(0,o.combinedDisposable)(...w.map((x=>x((k=>L.call(O,k)))))),(j=N)instanceof Array?j.push(H):j&&j.add(H),H;var H,j}},b.reduce=function(w,L,O,N){let H=O;return T(w,(j=>(H=L(H,j),H)),N)},b.debounce=B,b.accumulate=function(w,L=0,O){return b.debounce(w,((N,H)=>N?(N.push(H),N):[H]),L,void 0,!0,void 0,O)},b.latch=function(w,L=(N,H)=>N===H,O){let N,H=!0;return P(w,(j=>{const x=H||!L(j,N);return H=!1,N=j,x}),O)},b.split=function(w,L,O){return[b.filter(w,L,O),b.filter(w,(N=>!L(N)),O)]},b.buffer=function(w,L=!1,O=[],N){let H=O.slice(),j=w((V=>{H?H.push(V):k.fire(V)}));N&&N.add(j);const x=()=>{H?.forEach((V=>k.fire(V))),H=null},k=new u({onWillAddFirstListener(){j||(j=w((V=>k.fire(V))),N&&N.add(j))},onDidAddFirstListener(){H&&(L?setTimeout(x):x())},onDidRemoveLastListener(){j&&j.dispose(),j=null}});return N&&N.add(k),k.event},b.chain=function(w,L){return(O,N,H)=>{const j=L(new S);return w((function(x){const k=j.evaluate(x);k!==F&&O.call(N,k)}),void 0,H)}};const F=Symbol("HaltChainable");class S{constructor(){this.steps=[]}map(L){return this.steps.push(L),this}forEach(L){return this.steps.push((O=>(L(O),O))),this}filter(L){return this.steps.push((O=>L(O)?O:F)),this}reduce(L,O){let N=O;return this.steps.push((H=>(N=L(N,H),N))),this}latch(L=(O,N)=>O===N){let O,N=!0;return this.steps.push((H=>{const j=N||!L(H,O);return N=!1,O=H,j?H:F})),this}evaluate(L){for(const O of this.steps)if((L=O(L))===F)break;return L}}b.fromNodeEventEmitter=function(w,L,O=N=>N){const N=(...j)=>H.fire(O(...j)),H=new u({onWillAddFirstListener:()=>w.on(L,N),onDidRemoveLastListener:()=>w.removeListener(L,N)});return H.event},b.fromDOMEventEmitter=function(w,L,O=N=>N){const N=(...j)=>H.fire(O(...j)),H=new u({onWillAddFirstListener:()=>w.addEventListener(L,N),onDidRemoveLastListener:()=>w.removeEventListener(L,N)});return H.event},b.toPromise=function(w){return new Promise((L=>D(w)(L)))},b.fromPromise=function(w){const L=new u;return w.then((O=>{L.fire(O)}),(()=>{L.fire(void 0)})).finally((()=>{L.dispose()})),L.event},b.forward=function(w,L){return w((O=>L.fire(O)))},b.runAndSubscribe=function(w,L,O){return L(O),w((N=>L(N)))};class E{constructor(L,O){this._observable=L,this._counter=0,this._hasChanged=!1;const N={onWillAddFirstListener:()=>{L.addObserver(this)},onDidRemoveLastListener:()=>{L.removeObserver(this)}};this.emitter=new u(N),O&&O.add(this.emitter)}beginUpdate(L){this._counter++}handlePossibleChange(L){}handleChange(L,O){this._hasChanged=!0}endUpdate(L){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}b.fromObservable=function(w,L){return new E(w,L).emitter.event},b.fromObservableLight=function(w){return(L,O,N)=>{let H=0,j=!1;const x={beginUpdate(){H++},endUpdate(){H--,H===0&&(w.reportChanges(),j&&(j=!1,L.call(O)))},handlePossibleChange(){},handleChange(){j=!0}};w.addObserver(x),w.reportChanges();const k={dispose(){w.removeObserver(x)}};return N instanceof o.DisposableStore?N.add(k):Array.isArray(N)&&N.push(k),k}}})(g||(t.Event=g={}));class c{static{this.all=new Set}static{this._idPool=0}constructor(D){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${D}_${c._idPool++}`,c.all.add(this)}start(D){this._stopWatch=new f.StopWatch,this.listenerCount=D}stop(){if(this._stopWatch){const D=this._stopWatch.elapsed();this.durations.push(D),this.elapsedOverall+=D,this.invocationCount+=1,this._stopWatch=void 0}}}t.EventProfiling=c;let n=-1;class h{static{this._idPool=1}constructor(D,T,P=(h._idPool++).toString(16).padStart(3,"0")){this._errorHandler=D,this.threshold=T,this.name=P,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(D,T){const P=this.threshold;if(P<=0||T<P)return;this._stacks||(this._stacks=new Map);const M=this._stacks.get(D.value)||0;if(this._stacks.set(D.value,M+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*P;const[B,F]=this.getMostFrequentStack(),S=`[${this.name}] potential listener LEAK detected, having ${T} listeners already. MOST frequent listener (${F}):`;console.warn(S),console.warn(B);const E=new e(S,B);this._errorHandler(E)}return()=>{const B=this._stacks.get(D.value)||0;this._stacks.set(D.value,B-1)}}getMostFrequentStack(){if(!this._stacks)return;let D,T=0;for(const[P,M]of this._stacks)(!D||T<M)&&(D=[P,M],T=M);return D}}class s{static create(){const D=new Error;return new s(D.stack??"")}constructor(D){this.value=D}print(){console.warn(this.value.split(`
15
+ `).slice(2).join(`
16
+ `))}}class e extends Error{constructor(D,T){super(D),this.name="ListenerLeakError",this.stack=T}}t.ListenerLeakError=e;class r extends Error{constructor(D,T){super(D),this.name="ListenerRefusalError",this.stack=T}}t.ListenerRefusalError=r;let a=0;class d{constructor(D){this.value=D,this.id=a++}}class u{constructor(D){this._size=0,this._options=D,this._leakageMon=n>0||this._options?.leakWarningThreshold?new h(D?.onListenerError??i.onUnexpectedError,this._options?.leakWarningThreshold??n):void 0,this._perfMon=this._options?._profName?new c(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(D,T,P)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const S=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(S);const E=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],w=new r(`${S}. HINT: Stack shows most frequent listener (${E[1]}-times)`,E[0]);return(this._options?.onListenerError||i.onUnexpectedError)(w),o.Disposable.None}if(this._disposed)return o.Disposable.None;T&&(D=D.bind(T));const M=new d(D);let B;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(M.stack=s.create(),B=this._leakageMon.check(M.stack,this._size+1)),this._listeners?this._listeners instanceof d?(this._deliveryQueue??=new l,this._listeners=[this._listeners,M]):this._listeners.push(M):(this._options?.onWillAddFirstListener?.(this),this._listeners=M,this._options?.onDidAddFirstListener?.(this)),this._size++;const F=(0,o.toDisposable)((()=>{B?.(),this._removeListener(M)}));return P instanceof o.DisposableStore?P.add(F):Array.isArray(P)&&P.push(F),F},this._event}_removeListener(D){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1)return this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),void(this._size=0);const T=this._listeners,P=T.indexOf(D);if(P===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,T[P]=void 0;const M=this._deliveryQueue.current===this;if(2*this._size<=T.length){let B=0;for(let F=0;F<T.length;F++)T[F]?T[B++]=T[F]:M&&(this._deliveryQueue.end--,B<this._deliveryQueue.i&&this._deliveryQueue.i--);T.length=B}}_deliver(D,T){if(!D)return;const P=this._options?.onListenerError||i.onUnexpectedError;if(P)try{D.value(T)}catch(M){P(M)}else D.value(T)}_deliverQueue(D){const T=D.current._listeners;for(;D.i<D.end;)this._deliver(T[D.i++],D.value);D.reset()}fire(D){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof d)this._deliver(this._listeners,D);else{const T=this._deliveryQueue;T.enqueue(this,D,this._listeners.length),this._deliverQueue(T)}this._perfMon?.stop()}hasListeners(){return this._size>0}}t.Emitter=u,t.createEventDeliveryQueue=()=>new l;class l{constructor(){this.i=-1,this.end=0}enqueue(D,T,P){this.i=0,this.end=P,this.current=D,this.value=T}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}t.AsyncEmitter=class extends u{async fireAsync(b,D,T){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new p.LinkedList),((P,M)=>{if(P instanceof d)M(P);else for(let B=0;B<P.length;B++){const F=P[B];F&&M(F)}})(this._listeners,(P=>this._asyncDeliveryQueue.push([P.value,b])));this._asyncDeliveryQueue.size>0&&!D.isCancellationRequested;){const[P,M]=this._asyncDeliveryQueue.shift(),B=[],F={...M,token:D,waitUntil:S=>{if(Object.isFrozen(B))throw new Error("waitUntil can NOT be called asynchronous");T&&(S=T(S,P)),B.push(S)}};try{P(F)}catch(S){(0,i.onUnexpectedError)(S);continue}Object.freeze(B),await Promise.allSettled(B).then((S=>{for(const E of S)E.status==="rejected"&&(0,i.onUnexpectedError)(E.reason)}))}}};class m extends u{get isPaused(){return this._isPaused!==0}constructor(D){super(D),this._isPaused=0,this._eventQueue=new p.LinkedList,this._mergeFn=D?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused==0)if(this._mergeFn){if(this._eventQueue.size>0){const D=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(D))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(D){this._size&&(this._isPaused!==0?this._eventQueue.push(D):super.fire(D))}}t.PauseableEmitter=m,t.DebounceEmitter=class extends m{constructor(b){super(b),this._delay=b.delay??100}fire(b){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(b)}},t.MicrotaskEmitter=class extends u{constructor(b){super(b),this._queuedEvents=[],this._mergeFn=b?.merge}fire(b){this.hasListeners()&&(this._queuedEvents.push(b),this._queuedEvents.length===1&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((D=>super.fire(D))),this._queuedEvents=[]})))}};class C{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new u({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(D){const T={event:D,listener:null};return this.events.push(T),this.hasListeners&&this.hook(T),(0,o.toDisposable)((0,v.createSingleCallFunction)((()=>{this.hasListeners&&this.unhook(T);const P=this.events.indexOf(T);this.events.splice(P,1)})))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach((D=>this.hook(D)))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach((D=>this.unhook(D)))}hook(D){D.listener=D.event((T=>this.emitter.fire(T)))}unhook(D){D.listener?.dispose(),D.listener=null}dispose(){this.emitter.dispose();for(const D of this.events)D.listener?.dispose();this.events=[]}}t.EventMultiplexer=C,t.DynamicListEventMultiplexer=class{constructor(b,D,T,P){this._store=new o.DisposableStore;const M=this._store.add(new C),B=this._store.add(new o.DisposableMap);function F(S){B.set(S,M.add(P(S)))}for(const S of b)F(S);this._store.add(D((S=>{F(S)}))),this._store.add(T((S=>{B.deleteAndDispose(S)}))),this.event=M.event}dispose(){this._store.dispose()}},t.EventBufferer=class{constructor(){this.data=[]}wrapEvent(b,D,T){return(P,M,B)=>b((F=>{const S=this.data[this.data.length-1];if(!D)return void(S?S.buffers.push((()=>P.call(M,F))):P.call(M,F));const E=S;E?(E.items??=[],E.items.push(F),E.buffers.length===0&&S.buffers.push((()=>{E.reducedResult??=T?E.items.reduce(D,T):E.items.reduce(D),P.call(M,E.reducedResult)}))):P.call(M,D(T,F))}),void 0,B)}bufferEvents(b){const D={buffers:new Array};this.data.push(D);const T=b();return this.data.pop(),D.buffers.forEach((P=>P())),T}},t.Relay=class{constructor(){this.listening=!1,this.inputEvent=g.None,this.inputEventListener=o.Disposable.None,this.emitter=new u({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(b){this.inputEvent=b,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=b(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}},t.ValueWithChangeEvent=class{static const(b){return new y(b)}constructor(b){this._value=b,this._onDidChange=new u,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(b){b!==this._value&&(this._value=b,this._onDidChange.fire(void 0))}};class y{constructor(D){this.value=D,this.onDidChange=g.None}}},8841:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSingleCallFunction=function(_,i){const v=this;let o,p=!1;return function(){if(p)return o;if(p=!0,i)try{o=_.apply(v,arguments)}finally{i()}else o=_.apply(v,arguments);return o}}},6304:function(W,t,_){var i=this&&this.__createBinding||(Object.create?function(a,d,u,l){l===void 0&&(l=u);var m=Object.getOwnPropertyDescriptor(d,u);m&&!("get"in m?!d.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return d[u]}}),Object.defineProperty(a,l,m)}:function(a,d,u,l){l===void 0&&(l=u),a[l]=d[u]}),v=this&&this.__setModuleDefault||(Object.create?function(a,d){Object.defineProperty(a,"default",{enumerable:!0,value:d})}:function(a,d){a.default=d}),o=this&&this.__importStar||function(a){if(a&&a.__esModule)return a;var d={};if(a!=null)for(var u in a)u!=="default"&&Object.prototype.hasOwnProperty.call(a,u)&&i(d,a,u);return v(d,a),d};Object.defineProperty(t,"__esModule",{value:!0}),t.StringSHA1=t.Hasher=void 0,t.hash=function(a){return f(a,0)},t.doHash=f,t.numberHash=g,t.stringHash=c,t.toHexString=e;const p=o(_(1316));function f(a,d){switch(typeof a){case"object":return a===null?g(349,d):Array.isArray(a)?(u=a,l=g(104579,l=d),u.reduce(((m,C)=>f(C,m)),l)):(function(m,C){return C=g(181387,C),Object.keys(m).sort().reduce(((y,b)=>(y=c(b,y),f(m[b],y))),C)})(a,d);case"string":return c(a,d);case"boolean":return(function(m,C){return g(m?433:863,C)})(a,d);case"number":return g(a,d);case"undefined":return g(937,d);default:return g(617,d)}var u,l}function g(a,d){return(d<<5)-d+a|0}function c(a,d){d=g(149417,d);for(let u=0,l=a.length;u<l;u++)d=g(a.charCodeAt(u),d);return d}var n;function h(a,d,u=32){const l=u-d;return(a<<d|(~((1<<l)-1)&a)>>>l)>>>0}function s(a,d=0,u=a.byteLength,l=0){for(let m=0;m<u;m++)a[d+m]=l}function e(a,d=32){return a instanceof ArrayBuffer?Array.from(new Uint8Array(a)).map((u=>u.toString(16).padStart(2,"0"))).join(""):(function(u,l,m="0"){for(;u.length<l;)u=m+u;return u})((a>>>0).toString(16),d/4)}t.Hasher=class{constructor(){this._value=0}get value(){return this._value}hash(a){return this._value=f(a,this._value),this._value}},(function(a){a[a.BLOCK_SIZE=64]="BLOCK_SIZE",a[a.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(n||(n={}));class r{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(n.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(d){const u=d.length;if(u===0)return;const l=this._buff;let m,C,y=this._buffLen,b=this._leftoverHighSurrogate;for(b!==0?(m=b,C=-1,b=0):(m=d.charCodeAt(0),C=0);;){let D=m;if(p.isHighSurrogate(m)){if(!(C+1<u)){b=m;break}{const T=d.charCodeAt(C+1);p.isLowSurrogate(T)?(C++,D=p.computeCodePoint(m,T)):D=n.UNICODE_REPLACEMENT}}else p.isLowSurrogate(m)&&(D=n.UNICODE_REPLACEMENT);if(y=this._push(l,y,D),C++,!(C<u))break;m=d.charCodeAt(C)}this._buffLen=y,this._leftoverHighSurrogate=b}_push(d,u,l){return l<128?d[u++]=l:l<2048?(d[u++]=192|(1984&l)>>>6,d[u++]=128|(63&l)>>>0):l<65536?(d[u++]=224|(61440&l)>>>12,d[u++]=128|(4032&l)>>>6,d[u++]=128|(63&l)>>>0):(d[u++]=240|(1835008&l)>>>18,d[u++]=128|(258048&l)>>>12,d[u++]=128|(4032&l)>>>6,d[u++]=128|(63&l)>>>0),u>=n.BLOCK_SIZE&&(this._step(),u-=n.BLOCK_SIZE,this._totalLen+=n.BLOCK_SIZE,d[0]=d[n.BLOCK_SIZE+0],d[1]=d[n.BLOCK_SIZE+1],d[2]=d[n.BLOCK_SIZE+2]),u}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,n.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),e(this._h0)+e(this._h1)+e(this._h2)+e(this._h3)+e(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,s(this._buff,this._buffLen),this._buffLen>56&&(this._step(),s(this._buff));const d=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(d/4294967296),!1),this._buffDV.setUint32(60,d%4294967296,!1),this._step()}_step(){const d=r._bigBlock32,u=this._buffDV;for(let M=0;M<64;M+=4)d.setUint32(M,u.getUint32(M,!1),!1);for(let M=64;M<320;M+=4)d.setUint32(M,h(d.getUint32(M-12,!1)^d.getUint32(M-32,!1)^d.getUint32(M-56,!1)^d.getUint32(M-64,!1),1),!1);let l,m,C,y=this._h0,b=this._h1,D=this._h2,T=this._h3,P=this._h4;for(let M=0;M<80;M++)M<20?(l=b&D|~b&T,m=1518500249):M<40?(l=b^D^T,m=1859775393):M<60?(l=b&D|b&T|D&T,m=2400959708):(l=b^D^T,m=3395469782),C=h(y,5)+l+P+m+d.getUint32(4*M,!1)&4294967295,P=T,T=D,D=h(b,30),b=y,y=C;this._h0=this._h0+y&4294967295,this._h1=this._h1+b&4294967295,this._h2=this._h2+D&4294967295,this._h3=this._h3+T&4294967295,this._h4=this._h4+P&4294967295}}t.StringSHA1=r},4218:(W,t)=>{var _;Object.defineProperty(t,"__esModule",{value:!0}),t.Iterable=void 0,(function(i){function v(f){return f&&typeof f=="object"&&typeof f[Symbol.iterator]=="function"}i.is=v;const o=Object.freeze([]);function*p(f){yield f}i.empty=function(){return o},i.single=p,i.wrap=function(f){return v(f)?f:p(f)},i.from=function(f){return f||o},i.reverse=function*(f){for(let g=f.length-1;g>=0;g--)yield f[g]},i.isEmpty=function(f){return!f||f[Symbol.iterator]().next().done===!0},i.first=function(f){return f[Symbol.iterator]().next().value},i.some=function(f,g){let c=0;for(const n of f)if(g(n,c++))return!0;return!1},i.find=function(f,g){for(const c of f)if(g(c))return c},i.filter=function*(f,g){for(const c of f)g(c)&&(yield c)},i.map=function*(f,g){let c=0;for(const n of f)yield g(n,c++)},i.flatMap=function*(f,g){let c=0;for(const n of f)yield*g(n,c++)},i.concat=function*(...f){for(const g of f)yield*g},i.reduce=function(f,g,c){let n=c;for(const h of f)n=g(n,h);return n},i.slice=function*(f,g,c=f.length){for(g<0&&(g+=f.length),c<0?c+=f.length:c>f.length&&(c=f.length);g<c;g++)yield f[g]},i.consume=function(f,g=Number.POSITIVE_INFINITY){const c=[];if(g===0)return[c,f];const n=f[Symbol.iterator]();for(let h=0;h<g;h++){const s=n.next();if(s.done)return[c,i.empty()];c.push(s.value)}return[c,{[Symbol.iterator]:()=>n}]},i.asyncToArray=async function(f){const g=[];for await(const c of f)g.push(c);return Promise.resolve(g)}})(_||(t.Iterable=_={}))},7883:(W,t)=>{var _,i;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyMod=t.KeyCodeUtils=t.ScanCodeUtils=t.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE=t.EVENT_KEY_CODE_MAP=t.ScanCode=t.KeyCode=void 0,t.KeyChord=function(e,r){return(e|(65535&r)<<16>>>0)>>>0},(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"})(_||(t.KeyCode=_={})),(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.None=0]="None",e[e.Hyper=1]="Hyper",e[e.Super=2]="Super",e[e.Fn=3]="Fn",e[e.FnLock=4]="FnLock",e[e.Suspend=5]="Suspend",e[e.Resume=6]="Resume",e[e.Turbo=7]="Turbo",e[e.Sleep=8]="Sleep",e[e.WakeUp=9]="WakeUp",e[e.KeyA=10]="KeyA",e[e.KeyB=11]="KeyB",e[e.KeyC=12]="KeyC",e[e.KeyD=13]="KeyD",e[e.KeyE=14]="KeyE",e[e.KeyF=15]="KeyF",e[e.KeyG=16]="KeyG",e[e.KeyH=17]="KeyH",e[e.KeyI=18]="KeyI",e[e.KeyJ=19]="KeyJ",e[e.KeyK=20]="KeyK",e[e.KeyL=21]="KeyL",e[e.KeyM=22]="KeyM",e[e.KeyN=23]="KeyN",e[e.KeyO=24]="KeyO",e[e.KeyP=25]="KeyP",e[e.KeyQ=26]="KeyQ",e[e.KeyR=27]="KeyR",e[e.KeyS=28]="KeyS",e[e.KeyT=29]="KeyT",e[e.KeyU=30]="KeyU",e[e.KeyV=31]="KeyV",e[e.KeyW=32]="KeyW",e[e.KeyX=33]="KeyX",e[e.KeyY=34]="KeyY",e[e.KeyZ=35]="KeyZ",e[e.Digit1=36]="Digit1",e[e.Digit2=37]="Digit2",e[e.Digit3=38]="Digit3",e[e.Digit4=39]="Digit4",e[e.Digit5=40]="Digit5",e[e.Digit6=41]="Digit6",e[e.Digit7=42]="Digit7",e[e.Digit8=43]="Digit8",e[e.Digit9=44]="Digit9",e[e.Digit0=45]="Digit0",e[e.Enter=46]="Enter",e[e.Escape=47]="Escape",e[e.Backspace=48]="Backspace",e[e.Tab=49]="Tab",e[e.Space=50]="Space",e[e.Minus=51]="Minus",e[e.Equal=52]="Equal",e[e.BracketLeft=53]="BracketLeft",e[e.BracketRight=54]="BracketRight",e[e.Backslash=55]="Backslash",e[e.IntlHash=56]="IntlHash",e[e.Semicolon=57]="Semicolon",e[e.Quote=58]="Quote",e[e.Backquote=59]="Backquote",e[e.Comma=60]="Comma",e[e.Period=61]="Period",e[e.Slash=62]="Slash",e[e.CapsLock=63]="CapsLock",e[e.F1=64]="F1",e[e.F2=65]="F2",e[e.F3=66]="F3",e[e.F4=67]="F4",e[e.F5=68]="F5",e[e.F6=69]="F6",e[e.F7=70]="F7",e[e.F8=71]="F8",e[e.F9=72]="F9",e[e.F10=73]="F10",e[e.F11=74]="F11",e[e.F12=75]="F12",e[e.PrintScreen=76]="PrintScreen",e[e.ScrollLock=77]="ScrollLock",e[e.Pause=78]="Pause",e[e.Insert=79]="Insert",e[e.Home=80]="Home",e[e.PageUp=81]="PageUp",e[e.Delete=82]="Delete",e[e.End=83]="End",e[e.PageDown=84]="PageDown",e[e.ArrowRight=85]="ArrowRight",e[e.ArrowLeft=86]="ArrowLeft",e[e.ArrowDown=87]="ArrowDown",e[e.ArrowUp=88]="ArrowUp",e[e.NumLock=89]="NumLock",e[e.NumpadDivide=90]="NumpadDivide",e[e.NumpadMultiply=91]="NumpadMultiply",e[e.NumpadSubtract=92]="NumpadSubtract",e[e.NumpadAdd=93]="NumpadAdd",e[e.NumpadEnter=94]="NumpadEnter",e[e.Numpad1=95]="Numpad1",e[e.Numpad2=96]="Numpad2",e[e.Numpad3=97]="Numpad3",e[e.Numpad4=98]="Numpad4",e[e.Numpad5=99]="Numpad5",e[e.Numpad6=100]="Numpad6",e[e.Numpad7=101]="Numpad7",e[e.Numpad8=102]="Numpad8",e[e.Numpad9=103]="Numpad9",e[e.Numpad0=104]="Numpad0",e[e.NumpadDecimal=105]="NumpadDecimal",e[e.IntlBackslash=106]="IntlBackslash",e[e.ContextMenu=107]="ContextMenu",e[e.Power=108]="Power",e[e.NumpadEqual=109]="NumpadEqual",e[e.F13=110]="F13",e[e.F14=111]="F14",e[e.F15=112]="F15",e[e.F16=113]="F16",e[e.F17=114]="F17",e[e.F18=115]="F18",e[e.F19=116]="F19",e[e.F20=117]="F20",e[e.F21=118]="F21",e[e.F22=119]="F22",e[e.F23=120]="F23",e[e.F24=121]="F24",e[e.Open=122]="Open",e[e.Help=123]="Help",e[e.Select=124]="Select",e[e.Again=125]="Again",e[e.Undo=126]="Undo",e[e.Cut=127]="Cut",e[e.Copy=128]="Copy",e[e.Paste=129]="Paste",e[e.Find=130]="Find",e[e.AudioVolumeMute=131]="AudioVolumeMute",e[e.AudioVolumeUp=132]="AudioVolumeUp",e[e.AudioVolumeDown=133]="AudioVolumeDown",e[e.NumpadComma=134]="NumpadComma",e[e.IntlRo=135]="IntlRo",e[e.KanaMode=136]="KanaMode",e[e.IntlYen=137]="IntlYen",e[e.Convert=138]="Convert",e[e.NonConvert=139]="NonConvert",e[e.Lang1=140]="Lang1",e[e.Lang2=141]="Lang2",e[e.Lang3=142]="Lang3",e[e.Lang4=143]="Lang4",e[e.Lang5=144]="Lang5",e[e.Abort=145]="Abort",e[e.Props=146]="Props",e[e.NumpadParenLeft=147]="NumpadParenLeft",e[e.NumpadParenRight=148]="NumpadParenRight",e[e.NumpadBackspace=149]="NumpadBackspace",e[e.NumpadMemoryStore=150]="NumpadMemoryStore",e[e.NumpadMemoryRecall=151]="NumpadMemoryRecall",e[e.NumpadMemoryClear=152]="NumpadMemoryClear",e[e.NumpadMemoryAdd=153]="NumpadMemoryAdd",e[e.NumpadMemorySubtract=154]="NumpadMemorySubtract",e[e.NumpadClear=155]="NumpadClear",e[e.NumpadClearEntry=156]="NumpadClearEntry",e[e.ControlLeft=157]="ControlLeft",e[e.ShiftLeft=158]="ShiftLeft",e[e.AltLeft=159]="AltLeft",e[e.MetaLeft=160]="MetaLeft",e[e.ControlRight=161]="ControlRight",e[e.ShiftRight=162]="ShiftRight",e[e.AltRight=163]="AltRight",e[e.MetaRight=164]="MetaRight",e[e.BrightnessUp=165]="BrightnessUp",e[e.BrightnessDown=166]="BrightnessDown",e[e.MediaPlay=167]="MediaPlay",e[e.MediaRecord=168]="MediaRecord",e[e.MediaFastForward=169]="MediaFastForward",e[e.MediaRewind=170]="MediaRewind",e[e.MediaTrackNext=171]="MediaTrackNext",e[e.MediaTrackPrevious=172]="MediaTrackPrevious",e[e.MediaStop=173]="MediaStop",e[e.Eject=174]="Eject",e[e.MediaPlayPause=175]="MediaPlayPause",e[e.MediaSelect=176]="MediaSelect",e[e.LaunchMail=177]="LaunchMail",e[e.LaunchApp2=178]="LaunchApp2",e[e.LaunchApp1=179]="LaunchApp1",e[e.SelectTask=180]="SelectTask",e[e.LaunchScreenSaver=181]="LaunchScreenSaver",e[e.BrowserSearch=182]="BrowserSearch",e[e.BrowserHome=183]="BrowserHome",e[e.BrowserBack=184]="BrowserBack",e[e.BrowserForward=185]="BrowserForward",e[e.BrowserStop=186]="BrowserStop",e[e.BrowserRefresh=187]="BrowserRefresh",e[e.BrowserFavorites=188]="BrowserFavorites",e[e.ZoomToggle=189]="ZoomToggle",e[e.MailReply=190]="MailReply",e[e.MailForward=191]="MailForward",e[e.MailSend=192]="MailSend",e[e.MAX_VALUE=193]="MAX_VALUE"})(i||(t.ScanCode=i={}));class v{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(r,a){this._keyCodeToStr[r]=a,this._strToKeyCode[a.toLowerCase()]=r}keyCodeToStr(r){return this._keyCodeToStr[r]}strToKeyCode(r){return this._strToKeyCode[r.toLowerCase()]||_.Unknown}}const o=new v,p=new v,f=new v;t.EVENT_KEY_CODE_MAP=new Array(230),t.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE={};const g=[],c=Object.create(null),n=Object.create(null);var h,s;t.ScanCodeUtils={lowerCaseToEnum:e=>n[e]||i.None,toEnum:e=>c[e]||i.None,toString:e=>g[e]||"None"},(function(e){e.toString=function(r){return o.keyCodeToStr(r)},e.fromString=function(r){return o.strToKeyCode(r)},e.toUserSettingsUS=function(r){return p.keyCodeToStr(r)},e.toUserSettingsGeneral=function(r){return f.keyCodeToStr(r)},e.fromUserSettings=function(r){return p.strToKeyCode(r)||f.strToKeyCode(r)},e.toElectronAccelerator=function(r){if(r>=_.Numpad0&&r<=_.NumpadDivide)return null;switch(r){case _.UpArrow:return"Up";case _.DownArrow:return"Down";case _.LeftArrow:return"Left";case _.RightArrow:return"Right"}return o.keyCodeToStr(r)}})(h||(t.KeyCodeUtils=h={})),(function(e){e[e.CtrlCmd=2048]="CtrlCmd",e[e.Shift=1024]="Shift",e[e.Alt=512]="Alt",e[e.WinCtrl=256]="WinCtrl"})(s||(t.KeyMod=s={}))},2811:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResolvedKeybinding=t.ResolvedChord=t.Keybinding=t.ScanCodeChord=t.KeyCodeChord=void 0,t.decodeKeybinding=function(h,s){if(typeof h=="number"){if(h===0)return null;const e=(65535&h)>>>0,r=(4294901760&h)>>>16;return new n(r!==0?[f(e,s),f(r,s)]:[f(e,s)])}{const e=[];for(let r=0;r<h.length;r++)e.push(f(h[r],s));return new n(e)}},t.createSimpleKeybinding=f;const i=_(9807),v=_(7883),o=_(8163);var p;function f(h,s){const e=!!(h&p.CtrlCmd),r=!!(h&p.WinCtrl),a=s===o.OperatingSystem.Macintosh?r:e,d=!!(h&p.Shift),u=!!(h&p.Alt),l=s===o.OperatingSystem.Macintosh?e:r,m=h&p.KeyCode;return new g(a,d,u,l,m)}(function(h){h[h.CtrlCmd=2048]="CtrlCmd",h[h.Shift=1024]="Shift",h[h.Alt=512]="Alt",h[h.WinCtrl=256]="WinCtrl",h[h.KeyCode=255]="KeyCode"})(p||(p={}));class g{constructor(s,e,r,a,d){this.ctrlKey=s,this.shiftKey=e,this.altKey=r,this.metaKey=a,this.keyCode=d}equals(s){return s instanceof g&&this.ctrlKey===s.ctrlKey&&this.shiftKey===s.shiftKey&&this.altKey===s.altKey&&this.metaKey===s.metaKey&&this.keyCode===s.keyCode}getHashCode(){return`K${this.ctrlKey?"1":"0"}${this.shiftKey?"1":"0"}${this.altKey?"1":"0"}${this.metaKey?"1":"0"}${this.keyCode}`}isModifierKey(){return this.keyCode===v.KeyCode.Unknown||this.keyCode===v.KeyCode.Ctrl||this.keyCode===v.KeyCode.Meta||this.keyCode===v.KeyCode.Alt||this.keyCode===v.KeyCode.Shift}toKeybinding(){return new n([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===v.KeyCode.Ctrl||this.shiftKey&&this.keyCode===v.KeyCode.Shift||this.altKey&&this.keyCode===v.KeyCode.Alt||this.metaKey&&this.keyCode===v.KeyCode.Meta}}t.KeyCodeChord=g;class c{constructor(s,e,r,a,d){this.ctrlKey=s,this.shiftKey=e,this.altKey=r,this.metaKey=a,this.scanCode=d}equals(s){return s instanceof c&&this.ctrlKey===s.ctrlKey&&this.shiftKey===s.shiftKey&&this.altKey===s.altKey&&this.metaKey===s.metaKey&&this.scanCode===s.scanCode}getHashCode(){return`S${this.ctrlKey?"1":"0"}${this.shiftKey?"1":"0"}${this.altKey?"1":"0"}${this.metaKey?"1":"0"}${this.scanCode}`}isDuplicateModifierCase(){return this.ctrlKey&&(this.scanCode===v.ScanCode.ControlLeft||this.scanCode===v.ScanCode.ControlRight)||this.shiftKey&&(this.scanCode===v.ScanCode.ShiftLeft||this.scanCode===v.ScanCode.ShiftRight)||this.altKey&&(this.scanCode===v.ScanCode.AltLeft||this.scanCode===v.ScanCode.AltRight)||this.metaKey&&(this.scanCode===v.ScanCode.MetaLeft||this.scanCode===v.ScanCode.MetaRight)}}t.ScanCodeChord=c;class n{constructor(s){if(s.length===0)throw(0,i.illegalArgument)("chords");this.chords=s}getHashCode(){let s="";for(let e=0,r=this.chords.length;e<r;e++)e!==0&&(s+=";"),s+=this.chords[e].getHashCode();return s}equals(s){if(s===null||this.chords.length!==s.chords.length)return!1;for(let e=0;e<this.chords.length;e++)if(!this.chords[e].equals(s.chords[e]))return!1;return!0}}t.Keybinding=n,t.ResolvedChord=class{constructor(h,s,e,r,a,d){this.ctrlKey=h,this.shiftKey=s,this.altKey=e,this.metaKey=r,this.keyLabel=a,this.keyAriaLabel=d}},t.ResolvedKeybinding=class{}},626:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Lazy=void 0,t.Lazy=class{constructor(_){this.executor=_,this._didRun=!1}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(_){this._error=_}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}},7150:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DisposableMap=t.ImmortalReference=t.AsyncReferenceCollection=t.ReferenceCollection=t.SafeDisposable=t.RefCountedDisposable=t.MandatoryMutableDisposable=t.MutableDisposable=t.Disposable=t.DisposableStore=t.DisposableTracker=void 0,t.setDisposableTracker=function(C){g=C},t.trackDisposable=n,t.markAsDisposed=h,t.markAsSingleton=function(C){return g?.markAsSingleton(C),C},t.isDisposable=e,t.dispose=r,t.disposeIfDisposable=function(C){for(const y of C)e(y)&&y.dispose();return[]},t.combinedDisposable=function(...C){const y=a((()=>r(C)));return(function(b,D){if(g)for(const T of b)g.setParent(T,D)})(C,y),y},t.toDisposable=a,t.disposeOnReturn=function(C){const y=new d;try{C(y)}finally{y.dispose()}};const i=_(3058),v=_(9087),o=_(2608),p=_(8841),f=_(4218);let g=null;class c{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(y){let b=this.livingDisposables.get(y);return b||(b={parent:null,source:null,isSingleton:!1,value:y,idx:c.idx++},this.livingDisposables.set(y,b)),b}trackDisposable(y){const b=this.getDisposableData(y);b.source||(b.source=new Error().stack)}setParent(y,b){this.getDisposableData(y).parent=b}markAsDisposed(y){this.livingDisposables.delete(y)}markAsSingleton(y){this.getDisposableData(y).isSingleton=!0}getRootParent(y,b){const D=b.get(y);if(D)return D;const T=y.parent?this.getRootParent(this.getDisposableData(y.parent),b):y;return b.set(y,T),T}getTrackedDisposables(){const y=new Map;return[...this.livingDisposables.entries()].filter((([,b])=>b.source!==null&&!this.getRootParent(b,y).isSingleton)).flatMap((([b])=>b))}computeLeakingDisposables(y=10,b){let D;if(b)D=b;else{const F=new Map,S=[...this.livingDisposables.values()].filter((w=>w.source!==null&&!this.getRootParent(w,F).isSingleton));if(S.length===0)return;const E=new Set(S.map((w=>w.value)));if(D=S.filter((w=>!(w.parent&&E.has(w.parent)))),D.length===0)throw new Error("There are cyclic diposable chains!")}if(!D)return;function T(F){const S=F.source.split(`
17
+ `).map((E=>E.trim().replace("at ",""))).filter((E=>E!==""));return(function(E,w){for(;E.length>0&&w.some((L=>typeof L=="string"?L===E[0]:E[0].match(L)));)E.shift()})(S,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),S.reverse()}const P=new o.SetMap;for(const F of D){const S=T(F);for(let E=0;E<=S.length;E++)P.add(S.slice(0,E).join(`
18
+ `),F)}D.sort((0,i.compareBy)((F=>F.idx),i.numberComparator));let M="",B=0;for(const F of D.slice(0,y)){B++;const S=T(F),E=[];for(let w=0;w<S.length;w++){let L=S[w];L=`(shared with ${P.get(S.slice(0,w+1).join(`
19
+ `)).size}/${D.length} leaks) at ${L}`;const O=P.get(S.slice(0,w).join(`
20
+ `)),N=(0,v.groupBy)([...O].map((H=>T(H)[w])),(H=>H));delete N[S[w]];for(const[H,j]of Object.entries(N))E.unshift(` - stacktraces of ${j.length} other leaks continue with ${H}`);E.unshift(L)}M+=`
21
+
22
+
23
+ ==================== Leaking disposable ${B}/${D.length}: ${F.value.constructor.name} ====================
24
+ ${E.join(`
25
+ `)}
26
+ ============================================================
27
+
28
+ `}return D.length>y&&(M+=`
29
+
30
+
31
+ ... and ${D.length-y} more leaking disposables
32
+
33
+ `),{leaks:D,details:M}}}function n(C){return g?.trackDisposable(C),C}function h(C){g?.markAsDisposed(C)}function s(C,y){g?.setParent(C,y)}function e(C){return typeof C=="object"&&C!==null&&typeof C.dispose=="function"&&C.dispose.length===0}function r(C){if(f.Iterable.is(C)){const y=[];for(const b of C)if(b)try{b.dispose()}catch(D){y.push(D)}if(y.length===1)throw y[0];if(y.length>1)throw new AggregateError(y,"Encountered errors while disposing of store");return Array.isArray(C)?[]:C}if(C)return C.dispose(),C}function a(C){const y=n({dispose:(0,p.createSingleCallFunction)((()=>{h(y),C()}))});return y}t.DisposableTracker=c;class d{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,n(this)}dispose(){this._isDisposed||(h(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{r(this._toDispose)}finally{this._toDispose.clear()}}add(y){if(!y)return y;if(y===this)throw new Error("Cannot register a disposable on itself!");return s(y,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(y),y}delete(y){if(y){if(y===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(y),y.dispose()}}deleteAndLeak(y){y&&this._toDispose.has(y)&&(this._toDispose.delete(y),s(y,null))}}t.DisposableStore=d;class u{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new d,n(this),s(this._store,this)}dispose(){h(this),this._store.dispose()}_register(y){if(y===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(y)}}t.Disposable=u;class l{constructor(){this._isDisposed=!1,n(this)}get value(){return this._isDisposed?void 0:this._value}set value(y){this._isDisposed||y===this._value||(this._value?.dispose(),y&&s(y,this),this._value=y)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,h(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){const y=this._value;return this._value=void 0,y&&s(y,null),y}}t.MutableDisposable=l,t.MandatoryMutableDisposable=class{constructor(C){this._disposable=new l,this._isDisposed=!1,this._disposable.value=C}get value(){return this._disposable.value}set value(C){this._isDisposed||C===this._disposable.value||(this._disposable.value=C)}dispose(){this._isDisposed=!0,this._disposable.dispose()}},t.RefCountedDisposable=class{constructor(C){this._disposable=C,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter==0&&this._disposable.dispose(),this}},t.SafeDisposable=class{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1,n(this)}set(C){let y=C;return this.unset=()=>y=void 0,this.isset=()=>y!==void 0,this.dispose=()=>{y&&(y(),y=void 0,h(this))},this}},t.ReferenceCollection=class{constructor(){this.references=new Map}acquire(C,...y){let b=this.references.get(C);b||(b={counter:0,object:this.createReferencedObject(C,...y)},this.references.set(C,b));const{object:D}=b,T=(0,p.createSingleCallFunction)((()=>{--b.counter==0&&(this.destroyReferencedObject(C,b.object),this.references.delete(C))}));return b.counter++,{object:D,dispose:T}}},t.AsyncReferenceCollection=class{constructor(C){this.referenceCollection=C}async acquire(C,...y){const b=this.referenceCollection.acquire(C,...y);try{return{object:await b.object,dispose:()=>b.dispose()}}catch(D){throw b.dispose(),D}}},t.ImmortalReference=class{constructor(C){this.object=C}dispose(){}};class m{constructor(){this._store=new Map,this._isDisposed=!1,n(this)}dispose(){h(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{r(this._store.values())}finally{this._store.clear()}}has(y){return this._store.has(y)}get size(){return this._store.size}get(y){return this._store.get(y)}set(y,b,D=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),D||this._store.get(y)?.dispose(),this._store.set(y,b)}deleteAndDispose(y){this._store.get(y)?.dispose(),this._store.delete(y)}deleteAndLeak(y){const b=this._store.get(y);return this._store.delete(y),b}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}t.DisposableMap=m},6317:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedList=void 0;class _{static{this.Undefined=new _(void 0)}constructor(o){this.element=o,this.next=_.Undefined,this.prev=_.Undefined}}class i{constructor(){this._first=_.Undefined,this._last=_.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===_.Undefined}clear(){let o=this._first;for(;o!==_.Undefined;){const p=o.next;o.prev=_.Undefined,o.next=_.Undefined,o=p}this._first=_.Undefined,this._last=_.Undefined,this._size=0}unshift(o){return this._insert(o,!1)}push(o){return this._insert(o,!0)}_insert(o,p){const f=new _(o);if(this._first===_.Undefined)this._first=f,this._last=f;else if(p){const c=this._last;this._last=f,f.prev=c,c.next=f}else{const c=this._first;this._first=f,f.next=c,c.prev=f}this._size+=1;let g=!1;return()=>{g||(g=!0,this._remove(f))}}shift(){if(this._first!==_.Undefined){const o=this._first.element;return this._remove(this._first),o}}pop(){if(this._last!==_.Undefined){const o=this._last.element;return this._remove(this._last),o}}_remove(o){if(o.prev!==_.Undefined&&o.next!==_.Undefined){const p=o.prev;p.next=o.next,o.next.prev=p}else o.prev===_.Undefined&&o.next===_.Undefined?(this._first=_.Undefined,this._last=_.Undefined):o.next===_.Undefined?(this._last=this._last.prev,this._last.next=_.Undefined):o.prev===_.Undefined&&(this._first=this._first.next,this._first.prev=_.Undefined);this._size-=1}*[Symbol.iterator](){let o=this._first;for(;o!==_.Undefined;)yield o.element,o=o.next}}t.LinkedList=i},2608:(W,t)=>{var _;Object.defineProperty(t,"__esModule",{value:!0}),t.SetMap=t.BidirectionalMap=t.CounterSet=t.Touch=void 0,t.getOrSet=function(i,v,o){let p=i.get(v);return p===void 0&&(p=o,i.set(v,p)),p},t.mapToString=function(i){const v=[];return i.forEach(((o,p)=>{v.push(`${p} => ${o}`)})),`Map(${i.size}) {${v.join(", ")}}`},t.setToString=function(i){const v=[];return i.forEach((o=>{v.push(o)})),`Set(${i.size}) {${v.join(", ")}}`},t.mapsStrictEqualIgnoreOrder=function(i,v){if(i===v)return!0;if(i.size!==v.size)return!1;for(const[o,p]of i)if(!v.has(o)||v.get(o)!==p)return!1;for(const[o]of v)if(!i.has(o))return!1;return!0},(function(i){i[i.None=0]="None",i[i.AsOld=1]="AsOld",i[i.AsNew=2]="AsNew"})(_||(t.Touch=_={})),t.CounterSet=class{constructor(){this.map=new Map}add(i){return this.map.set(i,(this.map.get(i)||0)+1),this}delete(i){let v=this.map.get(i)||0;return v!==0&&(v--,v===0?this.map.delete(i):this.map.set(i,v),!0)}has(i){return this.map.has(i)}},t.BidirectionalMap=class{constructor(i){if(this._m1=new Map,this._m2=new Map,i)for(const[v,o]of i)this.set(v,o)}clear(){this._m1.clear(),this._m2.clear()}set(i,v){this._m1.set(i,v),this._m2.set(v,i)}get(i){return this._m1.get(i)}getKey(i){return this._m2.get(i)}delete(i){const v=this._m1.get(i);return v!==void 0&&(this._m1.delete(i),this._m2.delete(v),!0)}forEach(i,v){this._m1.forEach(((o,p)=>{i.call(v,o,p,this)}))}keys(){return this._m1.keys()}values(){return this._m1.values()}},t.SetMap=class{constructor(){this.map=new Map}add(i,v){let o=this.map.get(i);o||(o=new Set,this.map.set(i,o)),o.add(v)}delete(i,v){const o=this.map.get(i);o&&(o.delete(v),o.size===0&&this.map.delete(i))}forEach(i,v){const o=this.map.get(i);o&&o.forEach(v)}get(i){return this.map.get(i)||new Set}}},7704:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SlidingWindowAverage=t.MovingAverage=t.Counter=void 0,t.clamp=function(_,i,v){return Math.min(Math.max(_,i),v)},t.rot=function(_,i){return(i+_%i)%i},t.isPointWithinTriangle=function(_,i,v,o,p,f,g,c){const n=g-v,h=c-o,s=p-v,e=f-o,r=_-v,a=i-o,d=n*n+h*h,u=n*s+h*e,l=n*r+h*a,m=s*s+e*e,C=s*r+e*a,y=1/(d*m-u*u),b=(m*l-u*C)*y,D=(d*C-u*l)*y;return b>=0&&D>=0&&b+D<1},t.Counter=class{constructor(){this._next=0}getNext(){return this._next++}},t.MovingAverage=class{constructor(){this._n=1,this._val=0}update(_){return this._val=this._val+(_-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}},t.SlidingWindowAverage=class{constructor(_){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(_),this._values.fill(0,0,_)}update(_){const i=this._values[this._index];return this._values[this._index]=_,this._index=(this._index+1)%this._values.length,this._sum-=i,this._sum+=_,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}},8163:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isAndroid=t.isEdge=t.isSafari=t.isFirefox=t.isChrome=t.OS=t.OperatingSystem=t.setTimeout0=t.setTimeout0IsFaster=t.translationsConfigFile=t.platformLocale=t.locale=t.Language=t.language=t.userAgent=t.platform=t.isCI=t.isMobile=t.isIOS=t.webWorkerOrigin=t.isWebWorker=t.isWeb=t.isElectron=t.isNative=t.isLinuxSnap=t.isLinux=t.isMacintosh=t.isWindows=t.Platform=t.LANGUAGE_DEFAULT=void 0,t.PlatformToString=function(B){switch(B){case y.Web:return"Web";case y.Mac:return"Mac";case y.Linux:return"Linux";case y.Windows:return"Windows"}},t.isLittleEndian=function(){if(!M){M=!0;const B=new Uint8Array(2);B[0]=1,B[1]=2,P=new Uint16Array(B.buffer)[0]===513}return P},t.isBigSurOrNewer=function(B){return parseFloat(B)>=20},t.LANGUAGE_DEFAULT="en";let _,i,v,o=!1,p=!1,f=!1,g=!1,c=!1,n=!1,h=!1,s=!1,e=!1,r=!1,a=t.LANGUAGE_DEFAULT,d=t.LANGUAGE_DEFAULT;const u=globalThis;let l;u.vscode!==void 0&&u.vscode.process!==void 0?l=u.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(l=process);const m=typeof l?.versions?.electron=="string",C=m&&l?.type==="renderer";if(typeof l=="object"){o=l.platform==="win32",p=l.platform==="darwin",f=l.platform==="linux",g=f&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,h=m,e=!!l.env.CI||!!l.env.BUILD_ARTIFACTSTAGINGDIRECTORY,_=t.LANGUAGE_DEFAULT,a=t.LANGUAGE_DEFAULT;const B=l.env.VSCODE_NLS_CONFIG;if(B)try{const F=JSON.parse(B);_=F.userLocale,d=F.osLocale,a=F.resolvedLanguage||t.LANGUAGE_DEFAULT,i=F.languagePack?.translationsConfigFile}catch{}c=!0}else typeof navigator!="object"||C?console.error("Unable to resolve platform."):(v=navigator.userAgent,o=v.indexOf("Windows")>=0,p=v.indexOf("Macintosh")>=0,s=(v.indexOf("Macintosh")>=0||v.indexOf("iPad")>=0||v.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,f=v.indexOf("Linux")>=0,r=v?.indexOf("Mobi")>=0,n=!0,a=globalThis._VSCODE_NLS_LANGUAGE||t.LANGUAGE_DEFAULT,_=navigator.language.toLowerCase(),d=_);var y;(function(B){B[B.Web=0]="Web",B[B.Mac=1]="Mac",B[B.Linux=2]="Linux",B[B.Windows=3]="Windows"})(y||(t.Platform=y={}));let b=y.Web;var D,T;p?b=y.Mac:o?b=y.Windows:f&&(b=y.Linux),t.isWindows=o,t.isMacintosh=p,t.isLinux=f,t.isLinuxSnap=g,t.isNative=c,t.isElectron=h,t.isWeb=n,t.isWebWorker=n&&typeof u.importScripts=="function",t.webWorkerOrigin=t.isWebWorker?u.origin:void 0,t.isIOS=s,t.isMobile=r,t.isCI=e,t.platform=b,t.userAgent=v,t.language=a,(function(B){B.value=function(){return t.language},B.isDefaultVariant=function(){return t.language.length===2?t.language==="en":t.language.length>=3&&t.language[0]==="e"&&t.language[1]==="n"&&t.language[2]==="-"},B.isDefault=function(){return t.language==="en"}})(D||(t.Language=D={})),t.locale=_,t.platformLocale=d,t.translationsConfigFile=i,t.setTimeout0IsFaster=typeof u.postMessage=="function"&&!u.importScripts,t.setTimeout0=(()=>{if(t.setTimeout0IsFaster){const B=[];u.addEventListener("message",(S=>{if(S.data&&S.data.vscodeScheduleAsyncWork)for(let E=0,w=B.length;E<w;E++){const L=B[E];if(L.id===S.data.vscodeScheduleAsyncWork)return B.splice(E,1),void L.callback()}}));let F=0;return S=>{const E=++F;B.push({id:E,callback:S}),u.postMessage({vscodeScheduleAsyncWork:E},"*")}}return B=>setTimeout(B)})(),(function(B){B[B.Windows=1]="Windows",B[B.Macintosh=2]="Macintosh",B[B.Linux=3]="Linux"})(T||(t.OperatingSystem=T={})),t.OS=p||s?T.Macintosh:o?T.Windows:T.Linux;let P=!0,M=!1;t.isChrome=!!(t.userAgent&&t.userAgent.indexOf("Chrome")>=0),t.isFirefox=!!(t.userAgent&&t.userAgent.indexOf("Firefox")>=0),t.isSafari=!!(!t.isChrome&&t.userAgent&&t.userAgent.indexOf("Safari")>=0),t.isEdge=!!(t.userAgent&&t.userAgent.indexOf("Edg/")>=0),t.isAndroid=!!(t.userAgent&&t.userAgent.indexOf("Android")>=0)},9881:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmoothScrollingOperation=t.SmoothScrollingUpdate=t.Scrollable=t.ScrollState=t.ScrollbarVisibility=void 0;const i=_(802),v=_(7150);var o;(function(h){h[h.Auto=1]="Auto",h[h.Hidden=2]="Hidden",h[h.Visible=3]="Visible"})(o||(t.ScrollbarVisibility=o={}));class p{constructor(s,e,r,a,d,u,l){this._forceIntegerValues=s,this._scrollStateBrand=void 0,this._forceIntegerValues&&(e|=0,r|=0,a|=0,d|=0,u|=0,l|=0),this.rawScrollLeft=a,this.rawScrollTop=l,e<0&&(e=0),a+e>r&&(a=r-e),a<0&&(a=0),d<0&&(d=0),l+d>u&&(l=u-d),l<0&&(l=0),this.width=e,this.scrollWidth=r,this.scrollLeft=a,this.height=d,this.scrollHeight=u,this.scrollTop=l}equals(s){return this.rawScrollLeft===s.rawScrollLeft&&this.rawScrollTop===s.rawScrollTop&&this.width===s.width&&this.scrollWidth===s.scrollWidth&&this.scrollLeft===s.scrollLeft&&this.height===s.height&&this.scrollHeight===s.scrollHeight&&this.scrollTop===s.scrollTop}withScrollDimensions(s,e){return new p(this._forceIntegerValues,s.width!==void 0?s.width:this.width,s.scrollWidth!==void 0?s.scrollWidth:this.scrollWidth,e?this.rawScrollLeft:this.scrollLeft,s.height!==void 0?s.height:this.height,s.scrollHeight!==void 0?s.scrollHeight:this.scrollHeight,e?this.rawScrollTop:this.scrollTop)}withScrollPosition(s){return new p(this._forceIntegerValues,this.width,this.scrollWidth,s.scrollLeft!==void 0?s.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,s.scrollTop!==void 0?s.scrollTop:this.rawScrollTop)}createScrollEvent(s,e){const r=this.width!==s.width,a=this.scrollWidth!==s.scrollWidth,d=this.scrollLeft!==s.scrollLeft,u=this.height!==s.height,l=this.scrollHeight!==s.scrollHeight,m=this.scrollTop!==s.scrollTop;return{inSmoothScrolling:e,oldWidth:s.width,oldScrollWidth:s.scrollWidth,oldScrollLeft:s.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:s.height,oldScrollHeight:s.scrollHeight,oldScrollTop:s.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:a,scrollLeftChanged:d,heightChanged:u,scrollHeightChanged:l,scrollTopChanged:m}}}t.ScrollState=p;class f extends v.Disposable{constructor(s){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new i.Emitter),this.onScroll=this._onScroll.event,this._smoothScrollDuration=s.smoothScrollDuration,this._scheduleAtNextAnimationFrame=s.scheduleAtNextAnimationFrame,this._state=new p(s.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(s){this._smoothScrollDuration=s}validateScrollPosition(s){return this._state.withScrollPosition(s)}getScrollDimensions(){return this._state}setScrollDimensions(s,e){const r=this._state.withScrollDimensions(s,e);this._setState(r,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(s){const e=this._state.withScrollPosition(s);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(s,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(s);if(this._smoothScrolling){s={scrollLeft:s.scrollLeft===void 0?this._smoothScrolling.to.scrollLeft:s.scrollLeft,scrollTop:s.scrollTop===void 0?this._smoothScrolling.to.scrollTop:s.scrollTop};const r=this._state.withScrollPosition(s);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let a;a=e?new n(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=a}else{const r=this._state.withScrollPosition(s);this._smoothScrolling=n.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const s=this._smoothScrolling.tick(),e=this._state.withScrollPosition(s);return this._setState(e,!0),this._smoothScrolling?s.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(s,e){const r=this._state;r.equals(s)||(this._state=s,this._onScroll.fire(this._state.createScrollEvent(r,e)))}}t.Scrollable=f;class g{constructor(s,e,r){this.scrollLeft=s,this.scrollTop=e,this.isDone=r}}function c(h,s){const e=s-h;return function(r){return h+e*(1-(a=1-r,Math.pow(a,3)));var a}}t.SmoothScrollingUpdate=g;class n{constructor(s,e,r,a){this.from=s,this.to=e,this.duration=a,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(s,e,r){if(Math.abs(s-e)>2.5*r){let l,m;return s<e?(l=s+.75*r,m=e-.75*r):(l=s-.75*r,m=e+.75*r),a=c(s,l),d=c(m,e),u=.33,function(C){return C<u?a(C/u):d((C-u)/(1-u))}}var a,d,u;return c(s,e)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(s){this.to=s.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(s){const e=(s-this.startTime)/this.duration;if(e<1){const r=this.scrollLeft(e),a=this.scrollTop(e);return new g(r,a,!1)}return new g(this.to.scrollLeft,this.to.scrollTop,!0)}combine(s,e,r){return n.start(s,e,r)}static start(s,e,r){r+=10;const a=Date.now()-10;return new n(s,e,a,r)}}t.SmoothScrollingOperation=n},9725:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StopWatch=void 0;const _=globalThis.performance&&typeof globalThis.performance.now=="function";class i{static create(o){return new i(o)}constructor(o){this._now=_&&o===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}t.StopWatch=i},1316:(W,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.noBreakWhitespace=t.CodePointIterator=void 0,t.isFalsyOrWhitespace=function(u){return!u||typeof u!="string"||u.trim().length===0},t.format=function(u,...l){return l.length===0?u:u.replace(o,(function(m,C){const y=parseInt(C,10);return isNaN(y)||y<0||y>=l.length?m:l[y]}))},t.format2=function(u,l){return Object.keys(l).length===0?u:u.replace(p,((m,C)=>l[C]??m))},t.htmlAttributeEncodeValue=function(u){return u.replace(/[<>"'&]/g,(l=>{switch(l){case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&apos;";case"&":return"&amp;"}return l}))},t.escape=function(u){return u.replace(/[<>&]/g,(function(l){switch(l){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return l}}))},t.escapeRegExpCharacters=f,t.count=function(u,l){let m=0,C=u.indexOf(l);for(;C!==-1;)m++,C=u.indexOf(l,C+l.length);return m},t.truncate=function(u,l,m="\u2026"){return u.length<=l?u:`${u.substr(0,l)}${m}`},t.truncateMiddle=function(u,l,m="\u2026"){if(u.length<=l)return u;const C=Math.ceil(l/2)-m.length/2,y=Math.floor(l/2)-m.length/2;return`${u.substr(0,C)}${m}${u.substr(u.length-y)}`},t.trim=function(u,l=" "){return c(g(u,l),l)},t.ltrim=g,t.rtrim=c,t.convertSimple2RegExpPattern=function(u){return u.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")},t.stripWildcards=function(u){return u.replace(/\*/g,"")},t.createRegExp=function(u,l,m={}){if(!u)throw new Error("Cannot create regex from empty string");l||(u=f(u)),m.wholeWord&&(/\B/.test(u.charAt(0))||(u="\\b"+u),/\B/.test(u.charAt(u.length-1))||(u+="\\b"));let C="";return m.global&&(C+="g"),m.matchCase||(C+="i"),m.multiline&&(C+="m"),m.unicode&&(C+="u"),new RegExp(u,C)},t.regExpLeadsToEndlessLoop=function(u){return u.source!=="^"&&u.source!=="^$"&&u.source!=="$"&&u.source!=="^\\s*$"&&!(!u.exec("")||u.lastIndex!==0)},t.splitLines=function(u){return u.split(/\r\n|\r|\n/)},t.splitLinesIncludeSeparators=function(u){const l=[],m=u.split(/(\r\n|\r|\n)/);for(let C=0;C<Math.ceil(m.length/2);C++)l.push(m[2*C]+(m[2*C+1]??""));return l},t.firstNonWhitespaceIndex=function(u){for(let l=0,m=u.length;l<m;l++){const C=u.charCodeAt(l);if(C!==i.CharCode.Space&&C!==i.CharCode.Tab)return l}return-1},t.getLeadingWhitespace=function(u,l=0,m=u.length){for(let C=l;C<m;C++){const y=u.charCodeAt(C);if(y!==i.CharCode.Space&&y!==i.CharCode.Tab)return u.substring(l,C)}return u.substring(l,m)},t.lastNonWhitespaceIndex=function(u,l=u.length-1){for(let m=l;m>=0;m--){const C=u.charCodeAt(m);if(C!==i.CharCode.Space&&C!==i.CharCode.Tab)return m}return-1},t.replaceAsync=function(u,l,m){const C=[];let y=0;for(const b of u.matchAll(l)){if(C.push(u.slice(y,b.index)),b.index===void 0)throw new Error("match.index should be defined");y=b.index+b[0].length,C.push(m(b[0],...b.slice(1),b.index,u,b.groups))}return C.push(u.slice(y)),Promise.all(C).then((b=>b.join("")))},t.compare=function(u,l){return u<l?-1:u>l?1:0},t.compareSubstring=n,t.compareIgnoreCase=function(u,l){return h(u,l,0,u.length,0,l.length)},t.compareSubstringIgnoreCase=h,t.isAsciiDigit=function(u){return u>=i.CharCode.Digit0&&u<=i.CharCode.Digit9},t.isLowerAsciiLetter=s,t.isUpperAsciiLetter=function(u){return u>=i.CharCode.A&&u<=i.CharCode.Z},t.equalsIgnoreCase=function(u,l){return u.length===l.length&&h(u,l)===0},t.startsWithIgnoreCase=function(u,l){const m=l.length;return!(l.length>u.length)&&h(u,l,0,m)===0},t.commonPrefixLength=function(u,l){const m=Math.min(u.length,l.length);let C;for(C=0;C<m;C++)if(u.charCodeAt(C)!==l.charCodeAt(C))return C;return m},t.commonSuffixLength=function(u,l){const m=Math.min(u.length,l.length);let C;const y=u.length-1,b=l.length-1;for(C=0;C<m;C++)if(u.charCodeAt(y-C)!==l.charCodeAt(b-C))return C;return m},t.isHighSurrogate=e,t.isLowSurrogate=r,t.computeCodePoint=a,t.getNextCodePoint=d;const i=_(4869),v=_(8960),o=/{(\d+)}/g,p=/{([^}]+)}/g;function f(u){return u.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function g(u,l){if(!u||!l)return u;const m=l.length;if(m===0||u.length===0)return u;let C=0;for(;u.indexOf(l,C)===C;)C+=m;return u.substring(C)}function c(u,l){if(!u||!l)return u;const m=l.length,C=u.length;if(m===0||C===0)return u;let y=C,b=-1;for(;b=u.lastIndexOf(l,y-1),b!==-1&&b+m===y;){if(b===0)return"";y=b}return u.substring(0,y)}function n(u,l,m=0,C=u.length,y=0,b=l.length){for(;m<C&&y<b;m++,y++){const P=u.charCodeAt(m),M=l.charCodeAt(y);if(P<M)return-1;if(P>M)return 1}const D=C-m,T=b-y;return D<T?-1:D>T?1:0}function h(u,l,m=0,C=u.length,y=0,b=l.length){for(;m<C&&y<b;m++,y++){let P=u.charCodeAt(m),M=l.charCodeAt(y);if(P===M)continue;if(P>=128||M>=128)return n(u.toLowerCase(),l.toLowerCase(),m,C,y,b);s(P)&&(P-=32),s(M)&&(M-=32);const B=P-M;if(B!==0)return B}const D=C-m,T=b-y;return D<T?-1:D>T?1:0}function s(u){return u>=i.CharCode.a&&u<=i.CharCode.z}function e(u){return 55296<=u&&u<=56319}function r(u){return 56320<=u&&u<=57343}function a(u,l){return l-56320+(u-55296<<10)+65536}function d(u,l,m){const C=u.charCodeAt(m);if(e(C)&&m+1<l){const y=u.charCodeAt(m+1);if(r(y))return a(C,y)}return C}t.CodePointIterator=class{get offset(){return this._offset}constructor(u,l=0){this._str=u,this._len=u.length,this._offset=l}setOffset(u){this._offset=u}prevCodePoint(){const u=(function(l,m){const C=l.charCodeAt(m-1);if(r(C)&&m>1){const y=l.charCodeAt(m-2);if(e(y))return a(y,C)}return C})(this._str,this._offset);return this._offset-=u>=v.Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,u}nextCodePoint(){const u=d(this._str,this._len,this._offset);return this._offset+=u>=v.Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,u}eol(){return this._offset>=this._len}},t.noBreakWhitespace="\xA0"},5015:(W,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MicrotaskDelay=void 0,t.MicrotaskDelay=Symbol("MicrotaskDelay")},8960:(W,t)=>{var _;Object.defineProperty(t,"__esModule",{value:!0}),t.Constants=void 0,t.toUint8=function(i){return i<0?0:i>_.MAX_UINT_8?_.MAX_UINT_8:0|i},t.toUint32=function(i){return i<0?0:i>_.MAX_UINT_32?_.MAX_UINT_32:0|i},(function(i){i[i.MAX_SAFE_SMALL_INTEGER=1073741824]="MAX_SAFE_SMALL_INTEGER",i[i.MIN_SAFE_SMALL_INTEGER=-1073741824]="MIN_SAFE_SMALL_INTEGER",i[i.MAX_UINT_8=255]="MAX_UINT_8",i[i.MAX_UINT_16=65535]="MAX_UINT_16",i[i.MAX_UINT_32=4294967295]="MAX_UINT_32",i[i.UNICODE_SUPPLEMENTARY_PLANE_BEGIN=65536]="UNICODE_SUPPLEMENTARY_PLANE_BEGIN"})(_||(t.Constants=_={}))}},Ee={};function ce(W){var t=Ee[W];if(t!==void 0)return t.exports;var _=Ee[W]={exports:{}};return ke[W].call(_.exports,_,_.exports,ce),_.exports}var Le={};return(()=>{var W=Le;Object.defineProperty(W,"__esModule",{value:!0}),W.Terminal=void 0;const t=ce(7721),_=ce(1718),i=ce(7150),v=ce(3027),o=ce(5101),p=ce(6097),f=ce(4335),g=["cols","rows"];let c=0;class n extends i.Disposable{constructor(s){super(),this._core=this._register(new _.CoreBrowserTerminal(s)),this._addonManager=this._register(new v.AddonManager),this._publicOptions={...this._core.options};const e=a=>this._core.options[a],r=(a,d)=>{this._checkReadonlyOptions(a),this._core.options[a]=d};for(const a in this._core.options){const d={get:e.bind(this,a),set:r.bind(this,a)};Object.defineProperty(this._publicOptions,a,d)}}_checkReadonlyOptions(s){if(g.includes(s))throw new Error(`Option "${s}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,synchronizedOutputMode:s.synchronizedOutput,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const e in s)this._publicOptions[e]=s[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,e=!0){this._core.input(s,e)}resize(s,e){this._verifyIntegers(s,e),this._core.resize(s,e)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,e,r){this._verifyIntegers(s,e,r),this._core.select(s,e,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,e){this._verifyIntegers(s,e),this._core.selectLines(s,e)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,e){this._core.write(s,e)}writeln(s,e){this._core.write(s),this._core.write(`\r
34
+ `,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return{get promptLabel(){return t.promptLabel.get()},set promptLabel(s){t.promptLabel.set(s)},get tooMuchOutput(){return t.tooMuchOutput.get()},set tooMuchOutput(s){t.tooMuchOutput.set(s)}}}_verifyIntegers(...s){for(c of s)if(c===1/0||isNaN(c)||c%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(c of s)if(c&&(c===1/0||isNaN(c)||c%1!=0||c<0))throw new Error("This API only accepts positive integers")}}W.Terminal=n})(),Le})()));