@sma1lboy/rove 0.9.166 → 0.9.168

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 (63) hide show
  1. package/dist/cli/{chunk-f2w2c77j.js → chunk-01w901sf.js} +1 -1
  2. package/dist/cli/{chunk-mn1c17zf.js → chunk-12gr0411.js} +1 -1
  3. package/dist/cli/{chunk-svfheeb2.js → chunk-1825qgp2.js} +1 -1
  4. package/dist/cli/{chunk-v027zrx5.js → chunk-2e572bj0.js} +2 -2
  5. package/dist/cli/{chunk-w0m1q23m.js → chunk-3p2e2ry4.js} +1 -1
  6. package/dist/cli/{chunk-p8bj0t7j.js → chunk-58rxg1df.js} +1 -1
  7. package/dist/cli/{chunk-3v1hzr8z.js → chunk-5agemmmn.js} +1 -1
  8. package/dist/cli/{chunk-m4vgx1sc.js → chunk-5jbj7b9t.js} +1 -1
  9. package/dist/cli/{chunk-pkzyrwhv.js → chunk-5t914d0v.js} +3 -3
  10. package/dist/cli/{chunk-jw134zg6.js → chunk-7af7g1sj.js} +2 -2
  11. package/dist/cli/chunk-8d8q901q.js +7 -0
  12. package/dist/cli/{chunk-sq5kj4za.js → chunk-8wrzdj5x.js} +1 -1
  13. package/dist/cli/{chunk-jjt118jt.js → chunk-ahrjn20k.js} +1 -1
  14. package/dist/cli/{chunk-b82bc173.js → chunk-ann3wt0v.js} +1 -1
  15. package/dist/cli/{chunk-dqse88xv.js → chunk-av4fw4ny.js} +1 -1
  16. package/dist/cli/{chunk-3try2twp.js → chunk-bggpzxk2.js} +1 -1
  17. package/dist/cli/{chunk-fw6nqqpg.js → chunk-bn1ta0qc.js} +1 -1
  18. package/dist/cli/{chunk-hnesjhs0.js → chunk-bz9mqybr.js} +2 -2
  19. package/dist/cli/chunk-c4rng97h.js +2 -0
  20. package/dist/cli/{chunk-4wajaa3z.js → chunk-c562kjgk.js} +1 -1
  21. package/dist/cli/{chunk-dqx9n8mn.js → chunk-cec5fc4d.js} +1 -1
  22. package/dist/cli/chunk-dt51afhh.js +5 -0
  23. package/dist/cli/{chunk-3g5qzq5g.js → chunk-dx6v0yw8.js} +1 -1
  24. package/dist/cli/{chunk-hnktpxpj.js → chunk-ex03xpcs.js} +2 -2
  25. package/dist/cli/{chunk-sp7jf5mx.js → chunk-fg6wc4bh.js} +6 -6
  26. package/dist/cli/{chunk-pnzk2rhm.js → chunk-h22qmj1w.js} +1 -1
  27. package/dist/cli/{chunk-zhzpmdd5.js → chunk-hmzjmhhj.js} +1 -1
  28. package/dist/cli/{chunk-zdtq90cz.js → chunk-ht4saept.js} +1 -1
  29. package/dist/cli/{chunk-qs80x1cd.js → chunk-hxfj85yw.js} +1 -1
  30. package/dist/cli/{chunk-apdy1yh2.js → chunk-jb7hgakq.js} +1 -1
  31. package/dist/cli/{chunk-avf82zmm.js → chunk-jn5dd6bv.js} +1 -1
  32. package/dist/cli/{chunk-g3vn40x3.js → chunk-k8w362qx.js} +1 -1
  33. package/dist/cli/{chunk-da9tb8av.js → chunk-m0g17ckn.js} +1 -1
  34. package/dist/cli/{chunk-bzhtt3sq.js → chunk-m66t4fvt.js} +1 -1
  35. package/dist/cli/{chunk-7mx1xz2b.js → chunk-mjmfr8de.js} +1 -1
  36. package/dist/cli/{chunk-ggaad0r0.js → chunk-p3qnztxm.js} +1 -1
  37. package/dist/cli/{chunk-130kknp8.js → chunk-pea31je5.js} +1 -1
  38. package/dist/cli/{chunk-n5c3k1dg.js → chunk-phftxm0p.js} +1 -1
  39. package/dist/cli/{chunk-0mzgrnqb.js → chunk-ppeav4ns.js} +4 -4
  40. package/dist/cli/{chunk-pabqr39m.js → chunk-qqw3p4fc.js} +1 -1
  41. package/dist/cli/{chunk-12z4a3j8.js → chunk-qs63g8qa.js} +1 -1
  42. package/dist/cli/{chunk-97z6a25c.js → chunk-rzme162d.js} +1 -1
  43. package/dist/cli/{chunk-r79ht9kg.js → chunk-skysscx4.js} +1 -1
  44. package/dist/cli/{chunk-wfwaa4n8.js → chunk-srn281km.js} +1 -1
  45. package/dist/cli/chunk-v2cpe974.js +3 -0
  46. package/dist/cli/{chunk-7rx93fhy.js → chunk-vfarq0sq.js} +1 -1
  47. package/dist/cli/{chunk-mg4r96nk.js → chunk-w9gzjcja.js} +1 -1
  48. package/dist/cli/{chunk-bgnvgcsp.js → chunk-ws17t64k.js} +1 -1
  49. package/dist/cli/{chunk-d4xhc9th.js → chunk-xhw8s2es.js} +3 -3
  50. package/dist/cli/{chunk-rvybphrq.js → chunk-xwekyjat.js} +1 -1
  51. package/dist/cli/chunk-xyf8qy8m.js +2 -0
  52. package/dist/cli/{chunk-ym78sw9a.js → chunk-y0nq7amn.js} +1 -1
  53. package/dist/cli/index.js +3 -3
  54. package/dist/cli/kobe.js +1 -1
  55. package/dist/cli/pty-host-node.mjs +6 -6
  56. package/dist/cli/rove.js +1 -1
  57. package/dist/skills/rove/references/api-flags.md +1 -1
  58. package/package.json +1 -1
  59. package/dist/cli/chunk-6tvrvekq.js +0 -4
  60. package/dist/cli/chunk-a56ygbrm.js +0 -2
  61. package/dist/cli/chunk-kemnxd03.js +0 -7
  62. package/dist/cli/chunk-tsmzqp49.js +0 -2
  63. package/dist/cli/chunk-xhb03ybc.js +0 -3
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{remoteKeyForRepo}from"./chunk-rhsvvdcn.js";import{ensurePtyHostReachable}from"./chunk-zhbws9n3.js";import{protocolEntry,sessionProtocol}from"./chunk-pabqr39m.js";import{toPosixPath}from"./chunk-b99tf0jr.js";import{DEFAULT_TERMINAL_COLORS,parseTerminalDefaultColors}from"./chunk-7q67dz4c.js";import{resolveEngineLaunchInit}from"./chunk-h8m37225.js";import{kobeApiInvocation}from"./chunk-3v1hzr8z.js";import{BUNDLED_THEMES,DEFAULT_THEME,readPersistedUiPrefs}from"./chunk-ym78sw9a.js";import{loadUserThemes}from"./chunk-zqfbyq0a.js";import{terminalRows}from"./chunk-w25b7xxz.js";import{argvHasFlag}from"./chunk-jvxh93nz.js";import{KobeDaemonClient}from"./chunk-0gepyh6e.js";import{engineProcessIn,parsePsSnapshot,psSnapshot}from"./chunk-avf82zmm.js";import{engineEntry}from"./chunk-d4xhc9th.js";import{quoteShellArg,quoteShellArgv}from"./chunk-2fypr41w.js";import{getPersistedBool,loadStateFile}from"./chunk-j75axe29.js";import{BUILTIN_VENDORS}from"./chunk-bq3fyc0p.js";import{roveStateDir,worktreeInitMarkerPath}from"./chunk-ch9b1d5y.js";import{defaultPtyHostSocketPath}from"./chunk-mcdv19rs.js";import{readRoveEnv}from"./chunk-r3k9rbwm.js";import{__commonJS,__toESM}from"./chunk-wqfp8d9w.js";var require_xterm_headless=__commonJS((exports)=>{(()=>{var e={5639:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.CircularList=void 0;let i2=s2(7150),r6=s2(802);class n2 extends i2.Disposable{constructor(e3){super(),this._maxLength=e3,this.onDeleteEmitter=this._register(new r6.Emitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new r6.Emitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new r6.Emitter),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e3){if(this._maxLength===e3)return;let t3=Array(e3);for(let s3=0;s3<Math.min(e3,this.length);s3++)t3[s3]=this._array[this._getCyclicIndex(s3)];this._array=t3,this._maxLength=e3,this._startIndex=0}get length(){return this._length}set length(e3){if(e3>this._length)for(let t3=this._length;t3<e3;t3++)this._array[t3]=void 0;this._length=e3}get(e3){return this._array[this._getCyclicIndex(e3)]}set(e3,t3){this._array[this._getCyclicIndex(e3)]=t3}push(e3){this._array[this._getCyclicIndex(this._length)]=e3,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw 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(e3,t3,...s3){if(t3){for(let s4=e3;s4<this._length-t3;s4++)this._array[this._getCyclicIndex(s4)]=this._array[this._getCyclicIndex(s4+t3)];this._length-=t3,this.onDeleteEmitter.fire({index:e3,amount:t3})}for(let t4=this._length-1;t4>=e3;t4--)this._array[this._getCyclicIndex(t4+s3.length)]=this._array[this._getCyclicIndex(t4)];for(let t4=0;t4<s3.length;t4++)this._array[this._getCyclicIndex(e3+t4)]=s3[t4];if(s3.length&&this.onInsertEmitter.fire({index:e3,amount:s3.length}),this._length+s3.length>this._maxLength){let e4=this._length+s3.length-this._maxLength;this._startIndex+=e4,this._length=this._maxLength,this.onTrimEmitter.fire(e4)}else this._length+=s3.length}trimStart(e3){e3>this._length&&(e3=this._length),this._startIndex+=e3,this._length-=e3,this.onTrimEmitter.fire(e3)}shiftElements(e3,t3,s3){if(!(t3<=0)){if(e3<0||e3>=this._length)throw Error("start argument out of range");if(e3+s3<0)throw Error("Cannot shift elements in list beyond index 0");if(s3>0){for(let i4=t3-1;i4>=0;i4--)this.set(e3+i4+s3,this.get(e3+i4));let i3=e3+t3+s3-this._length;if(i3>0)for(this._length+=i3;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i3=0;i3<t3;i3++)this.set(e3+i3+s3,this.get(e3+i3))}}_getCyclicIndex(e3){return(this._startIndex+e3)%this._maxLength}}t2.CircularList=n2},7453:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.clone=function e3(t3,s2=5){if(typeof t3!="object")return t3;let i2=Array.isArray(t3)?[]:{};for(let r6 in t3)i2[r6]=s2<=1?t3[r6]:t3[r6]&&e3(t3[r6],s2-1);return i2}},5777:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.CoreTerminal=void 0;let i2=s2(6501),r6=s2(6025),n2=s2(7276),o=s2(9640),a=s2(56),h=s2(4071),c=s2(7792),l=s2(6415),u=s2(5746),d=s2(5882),f=s2(2486),_2=s2(3562),p=s2(8811),g=s2(802),v=s2(7150),m=!1;class b extends v.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new g.Emitter),this._onScroll.event((e3)=>{this._onScrollApi?.fire(e3.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(e3){for(let t3 in e3)this.optionsService.options[t3]=e3[t3]}constructor(e3){super(),this._windowsWrappingHeuristics=this._register(new v.MutableDisposable),this._onBinary=this._register(new g.Emitter),this.onBinary=this._onBinary.event,this._onData=this._register(new g.Emitter),this.onData=this._onData.event,this._onLineFeed=this._register(new g.Emitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new g.Emitter),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new g.Emitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new g.Emitter),this._instantiationService=new r6.InstantiationService,this.optionsService=this._register(new a.OptionsService(e3)),this._instantiationService.setService(i2.IOptionsService,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(o.BufferService)),this._instantiationService.setService(i2.IBufferService,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(n2.LogService)),this._instantiationService.setService(i2.ILogService,this._logService),this.coreService=this._register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(i2.ICoreService,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(i2.ICoreMouseService,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(i2.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(i2.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(i2.IOscLinkService,this._oscLinkService),this._inputHandler=this._register(new f.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(g.Event.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(g.Event.forward(this._bufferService.onResize,this._onResize)),this._register(g.Event.forward(this.coreService.onData,this._onData)),this._register(g.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 _2.WriteBuffer((e4,t3)=>this._inputHandler.parse(e4,t3))),this._register(g.Event.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(e3,t3){this._writeBuffer.write(e3,t3)}writeSync(e3,t3){this._logService.logLevel<=i2.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e3,t3)}input(e3,t3=!0){this.coreService.triggerDataEvent(e3,t3)}resize(e3,t3){isNaN(e3)||isNaN(t3)||(e3=Math.max(e3,o.MINIMUM_COLS),t3=Math.max(t3,o.MINIMUM_ROWS),this._bufferService.resize(e3,t3))}scroll(e3,t3=!1){this._bufferService.scroll(e3,t3)}scrollLines(e3,t3){this._bufferService.scrollLines(e3,t3)}scrollPages(e3){this.scrollLines(e3*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e3){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e3){let t3=e3-this._bufferService.buffer.ydisp;t3!==0&&this.scrollLines(t3)}registerEscHandler(e3,t3){return this._inputHandler.registerEscHandler(e3,t3)}registerDcsHandler(e3,t3){return this._inputHandler.registerDcsHandler(e3,t3)}registerCsiHandler(e3,t3){return this._inputHandler.registerCsiHandler(e3,t3)}registerOscHandler(e3,t3){return this._inputHandler.registerOscHandler(e3,t3)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e3=!1,t3=this.optionsService.rawOptions.windowsPty;t3&&t3.buildNumber!==void 0&&t3.buildNumber!==void 0?e3=t3.backend==="conpty"&&t3.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e3=!0),e3?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e3=[];e3.push(this.onLineFeed(d.updateWindowsModeWrappedState.bind(null,this._bufferService))),e3.push(this.registerCsiHandler({final:"H"},()=>((0,d.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,v.toDisposable)(()=>{for(let t3 of e3)t3.dispose()})}}}t2.CoreTerminal=b},2486:function(e2,t2,s2){var i2=this&&this.__decorate||function(e3,t3,s3,i3){var r7,n3=arguments.length,o2=n3<3?t3:i3===null?i3=Object.getOwnPropertyDescriptor(t3,s3):i3;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o2=Reflect.decorate(e3,t3,s3,i3);else for(var a2=e3.length-1;a2>=0;a2--)(r7=e3[a2])&&(o2=(n3<3?r7(o2):n3>3?r7(t3,s3,o2):r7(t3,s3))||o2);return n3>3&&o2&&Object.defineProperty(t3,s3,o2),o2},r6=this&&this.__param||function(e3,t3){return function(s3,i3){t3(s3,i3,e3)}};Object.defineProperty(t2,"__esModule",{value:!0}),t2.InputHandler=t2.WindowsOptionsReportType=void 0,t2.isValidColorIndex=k;let n2=s2(3534),o=s2(6760),a=s2(6717),h=s2(7150),c=s2(726),l=s2(6107),u=s2(8938),d=s2(3055),f=s2(5451),_2=s2(6501),p=s2(6415),g=s2(1346),v=s2(9823),m=s2(8693),b=s2(802),S={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=131072;function C2(e3,t3){if(e3>24)return t3.setWinLines||!1;switch(e3){case 1:return!!t3.restoreWin;case 2:return!!t3.minimizeWin;case 3:return!!t3.setWinPosition;case 4:return!!t3.setWinSizePixels;case 5:return!!t3.raiseWin;case 6:return!!t3.lowerWin;case 7:return!!t3.refreshWin;case 8:return!!t3.setWinSizeChars;case 9:return!!t3.maximizeWin;case 10:return!!t3.fullscreenWin;case 11:return!!t3.getWinState;case 13:return!!t3.getWinPosition;case 14:return!!t3.getWinSizePixels;case 15:return!!t3.getScreenSizePixels;case 16:return!!t3.getCellSizePixels;case 18:return!!t3.getWinSizeChars;case 19:return!!t3.getScreenSizeChars;case 20:return!!t3.getIconTitle;case 21:return!!t3.getWinTitle;case 22:return!!t3.pushTitle;case 23:return!!t3.popTitle;case 24:return!!t3.setWinLines}return!1}var w2;(function(e3){e3[e3.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e3[e3.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w2||(t2.WindowsOptionsReportType=w2={}));let E=0;class A2 extends h.Disposable{getAttrData(){return this._curAttrData}constructor(e3,t3,s3,i3,r7,h2,u2,d2,f2=new a.EscapeSequenceParser){super(),this._bufferService=e3,this._charsetService=t3,this._coreService=s3,this._logService=i3,this._optionsService=r7,this._oscLinkService=h2,this._coreMouseService=u2,this._unicodeService=d2,this._parser=f2,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this._register(new b.Emitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new b.Emitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new b.Emitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new b.Emitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new b.Emitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new b.Emitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new b.Emitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new b.Emitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new b.Emitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new b.Emitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new b.Emitter),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new b.Emitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new b.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 L(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate((e4)=>this._activeBuffer=e4.activeBuffer)),this._parser.setCsiHandlerFallback((e4,t4)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e4),params:t4.toArray()})}),this._parser.setEscHandlerFallback((e4)=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e4)})}),this._parser.setExecuteHandlerFallback((e4)=>{this._logService.debug("Unknown EXECUTE code: ",{code:e4})}),this._parser.setOscHandlerFallback((e4,t4,s4)=>{this._logService.debug("Unknown OSC code: ",{identifier:e4,action:t4,data:s4})}),this._parser.setDcsHandlerFallback((e4,t4,s4)=>{t4==="HOOK"&&(s4=s4.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e4),action:t4,payload:s4})}),this._parser.setPrintHandler((e4,t4,s4)=>this.print(e4,t4,s4)),this._parser.registerCsiHandler({final:"@"},(e4)=>this.insertChars(e4)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(e4)=>this.scrollLeft(e4)),this._parser.registerCsiHandler({final:"A"},(e4)=>this.cursorUp(e4)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(e4)=>this.scrollRight(e4)),this._parser.registerCsiHandler({final:"B"},(e4)=>this.cursorDown(e4)),this._parser.registerCsiHandler({final:"C"},(e4)=>this.cursorForward(e4)),this._parser.registerCsiHandler({final:"D"},(e4)=>this.cursorBackward(e4)),this._parser.registerCsiHandler({final:"E"},(e4)=>this.cursorNextLine(e4)),this._parser.registerCsiHandler({final:"F"},(e4)=>this.cursorPrecedingLine(e4)),this._parser.registerCsiHandler({final:"G"},(e4)=>this.cursorCharAbsolute(e4)),this._parser.registerCsiHandler({final:"H"},(e4)=>this.cursorPosition(e4)),this._parser.registerCsiHandler({final:"I"},(e4)=>this.cursorForwardTab(e4)),this._parser.registerCsiHandler({final:"J"},(e4)=>this.eraseInDisplay(e4,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},(e4)=>this.eraseInDisplay(e4,!0)),this._parser.registerCsiHandler({final:"K"},(e4)=>this.eraseInLine(e4,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},(e4)=>this.eraseInLine(e4,!0)),this._parser.registerCsiHandler({final:"L"},(e4)=>this.insertLines(e4)),this._parser.registerCsiHandler({final:"M"},(e4)=>this.deleteLines(e4)),this._parser.registerCsiHandler({final:"P"},(e4)=>this.deleteChars(e4)),this._parser.registerCsiHandler({final:"S"},(e4)=>this.scrollUp(e4)),this._parser.registerCsiHandler({final:"T"},(e4)=>this.scrollDown(e4)),this._parser.registerCsiHandler({final:"X"},(e4)=>this.eraseChars(e4)),this._parser.registerCsiHandler({final:"Z"},(e4)=>this.cursorBackwardTab(e4)),this._parser.registerCsiHandler({final:"`"},(e4)=>this.charPosAbsolute(e4)),this._parser.registerCsiHandler({final:"a"},(e4)=>this.hPositionRelative(e4)),this._parser.registerCsiHandler({final:"b"},(e4)=>this.repeatPrecedingCharacter(e4)),this._parser.registerCsiHandler({final:"c"},(e4)=>this.sendDeviceAttributesPrimary(e4)),this._parser.registerCsiHandler({prefix:">",final:"c"},(e4)=>this.sendDeviceAttributesSecondary(e4)),this._parser.registerCsiHandler({final:"d"},(e4)=>this.linePosAbsolute(e4)),this._parser.registerCsiHandler({final:"e"},(e4)=>this.vPositionRelative(e4)),this._parser.registerCsiHandler({final:"f"},(e4)=>this.hVPosition(e4)),this._parser.registerCsiHandler({final:"g"},(e4)=>this.tabClear(e4)),this._parser.registerCsiHandler({final:"h"},(e4)=>this.setMode(e4)),this._parser.registerCsiHandler({prefix:"?",final:"h"},(e4)=>this.setModePrivate(e4)),this._parser.registerCsiHandler({final:"l"},(e4)=>this.resetMode(e4)),this._parser.registerCsiHandler({prefix:"?",final:"l"},(e4)=>this.resetModePrivate(e4)),this._parser.registerCsiHandler({final:"m"},(e4)=>this.charAttributes(e4)),this._parser.registerCsiHandler({final:"n"},(e4)=>this.deviceStatus(e4)),this._parser.registerCsiHandler({prefix:"?",final:"n"},(e4)=>this.deviceStatusPrivate(e4)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(e4)=>this.softReset(e4)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(e4)=>this.setCursorStyle(e4)),this._parser.registerCsiHandler({final:"r"},(e4)=>this.setScrollRegion(e4)),this._parser.registerCsiHandler({final:"s"},(e4)=>this.saveCursor(e4)),this._parser.registerCsiHandler({final:"t"},(e4)=>this.windowOptions(e4)),this._parser.registerCsiHandler({final:"u"},(e4)=>this.restoreCursor(e4)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(e4)=>this.insertColumns(e4)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(e4)=>this.deleteColumns(e4)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(e4)=>this.selectProtected(e4)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(e4)=>this.requestMode(e4,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(e4)=>this.requestMode(e4,!1)),this._parser.setExecuteHandler(n2.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n2.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n2.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n2.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n2.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n2.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n2.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n2.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n2.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n2.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n2.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n2.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new g.OscHandler((e4)=>(this.setTitle(e4),this.setIconName(e4),!0))),this._parser.registerOscHandler(1,new g.OscHandler((e4)=>this.setIconName(e4))),this._parser.registerOscHandler(2,new g.OscHandler((e4)=>this.setTitle(e4))),this._parser.registerOscHandler(4,new g.OscHandler((e4)=>this.setOrReportIndexedColor(e4))),this._parser.registerOscHandler(8,new g.OscHandler((e4)=>this.setHyperlink(e4))),this._parser.registerOscHandler(10,new g.OscHandler((e4)=>this.setOrReportFgColor(e4))),this._parser.registerOscHandler(11,new g.OscHandler((e4)=>this.setOrReportBgColor(e4))),this._parser.registerOscHandler(12,new g.OscHandler((e4)=>this.setOrReportCursorColor(e4))),this._parser.registerOscHandler(104,new g.OscHandler((e4)=>this.restoreIndexedColor(e4))),this._parser.registerOscHandler(110,new g.OscHandler((e4)=>this.restoreFgColor(e4))),this._parser.registerOscHandler(111,new g.OscHandler((e4)=>this.restoreBgColor(e4))),this._parser.registerOscHandler(112,new g.OscHandler((e4)=>this.restoreCursorColor(e4))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let e4 in o.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e4},()=>this.selectCharset("("+e4)),this._parser.registerEscHandler({intermediates:")",final:e4},()=>this.selectCharset(")"+e4)),this._parser.registerEscHandler({intermediates:"*",final:e4},()=>this.selectCharset("*"+e4)),this._parser.registerEscHandler({intermediates:"+",final:e4},()=>this.selectCharset("+"+e4)),this._parser.registerEscHandler({intermediates:"-",final:e4},()=>this.selectCharset("-"+e4)),this._parser.registerEscHandler({intermediates:".",final:e4},()=>this.selectCharset("."+e4)),this._parser.registerEscHandler({intermediates:"/",final:e4},()=>this.selectCharset("/"+e4));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler((e4)=>(this._logService.error("Parsing error: ",e4),e4)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler((e4,t4)=>this.requestStatusString(e4,t4)))}_preserveStack(e3,t3,s3,i3){this._parseStack.paused=!0,this._parseStack.cursorStartX=e3,this._parseStack.cursorStartY=t3,this._parseStack.decodedLength=s3,this._parseStack.position=i3}_logSlowResolvingAsync(e3){this._logService.logLevel<=_2.LogLevelEnum.WARN&&Promise.race([e3,new Promise((e4,t3)=>setTimeout(()=>t3("#SLOW_TIMEOUT"),5000))]).catch((e4)=>{if(e4!=="#SLOW_TIMEOUT")throw e4;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e3,t3){let s3,i3=this._activeBuffer.x,r7=this._activeBuffer.y,n3=0,o2=this._parseStack.paused;if(o2){if(s3=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t3))return this._logSlowResolvingAsync(s3),s3;i3=this._parseStack.cursorStartX,r7=this._parseStack.cursorStartY,this._parseStack.paused=!1,e3.length>y&&(n3=this._parseStack.position+y)}if(this._logService.logLevel<=_2.LogLevelEnum.DEBUG&&this._logService.debug("parsing data "+(typeof e3=="string"?` "${e3}"`:` "${Array.prototype.map.call(e3,(e4)=>String.fromCharCode(e4)).join("")}"`)),this._logService.logLevel===_2.LogLevelEnum.TRACE&&this._logService.trace("parsing data (codes)",typeof e3=="string"?e3.split("").map((e4)=>e4.charCodeAt(0)):e3),this._parseBuffer.length<e3.length&&this._parseBuffer.length<y&&(this._parseBuffer=new Uint32Array(Math.min(e3.length,y))),o2||this._dirtyRowTracker.clearRange(),e3.length>y)for(let t4=n3;t4<e3.length;t4+=y){let n4=t4+y<e3.length?t4+y:e3.length,o3=typeof e3=="string"?this._stringDecoder.decode(e3.substring(t4,n4),this._parseBuffer):this._utf8Decoder.decode(e3.subarray(t4,n4),this._parseBuffer);if(s3=this._parser.parse(this._parseBuffer,o3))return this._preserveStack(i3,r7,o3,t4),this._logSlowResolvingAsync(s3),s3}else if(!o2){let t4=typeof e3=="string"?this._stringDecoder.decode(e3,this._parseBuffer):this._utf8Decoder.decode(e3,this._parseBuffer);if(s3=this._parser.parse(this._parseBuffer,t4))return this._preserveStack(i3,r7,t4,0),this._logSlowResolvingAsync(s3),s3}this._activeBuffer.x===i3&&this._activeBuffer.y===r7||this._onCursorMove.fire();let a2=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),h2=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h2<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h2,this._bufferService.rows-1),end:Math.min(a2,this._bufferService.rows-1)})}print(e3,t3,s3){let i3,r7,n3=this._charsetService.charset,o2=this._optionsService.rawOptions.screenReaderMode,a2=this._bufferService.cols,h2=this._coreService.decPrivateModes.wraparound,d2=this._coreService.modes.insertMode,f2=this._curAttrData,_3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&s3-t3>0&&_3.getWidth(this._activeBuffer.x-1)===2&&_3.setCellFromCodepoint(this._activeBuffer.x-1,0,1,f2);let g2=this._parser.precedingJoinState;for(let v2=t3;v2<s3;++v2){if(i3=e3[v2],i3<127&&n3){let e4=n3[String.fromCharCode(i3)];e4&&(i3=e4.charCodeAt(0))}let t4=this._unicodeService.charProperties(i3,g2);r7=p.UnicodeService.extractWidth(t4);let s4=p.UnicodeService.extractShouldJoin(t4),m2=s4?p.UnicodeService.extractWidth(g2):0;if(g2=t4,o2&&this._onA11yChar.fire((0,c.stringFromCodePoint)(i3)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r7-m2>a2){if(h2){let e4=_3,t5=this._activeBuffer.x-m2;for(this._activeBuffer.x=m2,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),_3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m2>0&&_3 instanceof l.BufferLine&&_3.copyCellsFrom(e4,t5,0,m2,!1);t5<a2;)e4.setCellFromCodepoint(t5++,0,1,f2)}else if(this._activeBuffer.x=a2-1,r7===2)continue}if(s4&&this._activeBuffer.x){let e4=_3.getWidth(this._activeBuffer.x-1)?1:2;_3.addCodepointToCell(this._activeBuffer.x-e4,i3,r7);for(let e5=r7-m2;--e5>=0;)_3.setCellFromCodepoint(this._activeBuffer.x++,0,0,f2)}else if(d2&&(_3.insertCells(this._activeBuffer.x,r7-m2,this._activeBuffer.getNullCell(f2)),_3.getWidth(a2-1)===2&&_3.setCellFromCodepoint(a2-1,u.NULL_CELL_CODE,u.NULL_CELL_WIDTH,f2)),_3.setCellFromCodepoint(this._activeBuffer.x++,i3,r7,f2),r7>0)for(;--r7;)_3.setCellFromCodepoint(this._activeBuffer.x++,0,0,f2)}this._parser.precedingJoinState=g2,this._activeBuffer.x<a2&&s3-t3>0&&_3.getWidth(this._activeBuffer.x)===0&&!_3.hasContent(this._activeBuffer.x)&&_3.setCellFromCodepoint(this._activeBuffer.x,0,1,f2),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e3,t3){return e3.final!=="t"||e3.prefix||e3.intermediates?this._parser.registerCsiHandler(e3,t3):this._parser.registerCsiHandler(e3,(e4)=>!C2(e4.params[0],this._optionsService.rawOptions.windowOptions)||t3(e4))}registerDcsHandler(e3,t3){return this._parser.registerDcsHandler(e3,new v.DcsHandler(t3))}registerEscHandler(e3,t3){return this._parser.registerEscHandler(e3,t3)}registerOscHandler(e3,t3){return this._parser.registerOscHandler(e3,new g.OscHandler(t3))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e3.hasWidth(this._activeBuffer.x)&&!e3.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e3=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e3),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e3=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e3,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(e3,t3){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e3,this._activeBuffer.y=this._activeBuffer.scrollTop+t3):(this._activeBuffer.x=e3,this._activeBuffer.y=t3),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e3,t3){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e3,this._activeBuffer.y+t3)}cursorUp(e3){let t3=this._activeBuffer.y-this._activeBuffer.scrollTop;return t3>=0?this._moveCursor(0,-Math.min(t3,e3.params[0]||1)):this._moveCursor(0,-(e3.params[0]||1)),!0}cursorDown(e3){let t3=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t3>=0?this._moveCursor(0,Math.min(t3,e3.params[0]||1)):this._moveCursor(0,e3.params[0]||1),!0}cursorForward(e3){return this._moveCursor(e3.params[0]||1,0),!0}cursorBackward(e3){return this._moveCursor(-(e3.params[0]||1),0),!0}cursorNextLine(e3){return this.cursorDown(e3),this._activeBuffer.x=0,!0}cursorPrecedingLine(e3){return this.cursorUp(e3),this._activeBuffer.x=0,!0}cursorCharAbsolute(e3){return this._setCursor((e3.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e3){return this._setCursor(e3.length>=2?(e3.params[1]||1)-1:0,(e3.params[0]||1)-1),!0}charPosAbsolute(e3){return this._setCursor((e3.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e3){return this._moveCursor(e3.params[0]||1,0),!0}linePosAbsolute(e3){return this._setCursor(this._activeBuffer.x,(e3.params[0]||1)-1),!0}vPositionRelative(e3){return this._moveCursor(0,e3.params[0]||1),!0}hVPosition(e3){return this.cursorPosition(e3),!0}tabClear(e3){let t3=e3.params[0];return t3===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t3===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e3){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t3=e3.params[0]||1;for(;t3--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e3){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t3=e3.params[0]||1;for(;t3--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e3){let t3=e3.params[0];return t3===1&&(this._curAttrData.bg|=536870912),t3!==2&&t3!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e3,t3,s3,i3=!1,r7=!1){let n3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e3);n3.replaceCells(t3,s3,this._activeBuffer.getNullCell(this._eraseAttrData()),r7),i3&&(n3.isWrapped=!1)}_resetBufferLine(e3,t3=!1){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e3);s3&&(s3.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t3),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e3),s3.isWrapped=!1)}eraseInDisplay(e3,t3=!1){let s3;switch(this._restrictCursor(this._bufferService.cols),e3.params[0]){case 0:for(s3=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s3),this._eraseInBufferLine(s3++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t3);s3<this._bufferService.rows;s3++)this._resetBufferLine(s3,t3);this._dirtyRowTracker.markDirty(s3);break;case 1:for(s3=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s3),this._eraseInBufferLine(s3,0,this._activeBuffer.x+1,!0,t3),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(s3+1).isWrapped=!1);s3--;)this._resetBufferLine(s3,t3);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(s3=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,s3-1);s3--;)if(this._activeBuffer.lines.get(this._activeBuffer.ybase+s3)?.getTrimmedLength())break;for(;s3>=0;s3--)this._bufferService.scroll(this._eraseAttrData())}else{for(s3=this._bufferService.rows,this._dirtyRowTracker.markDirty(s3-1);s3--;)this._resetBufferLine(s3,t3);this._dirtyRowTracker.markDirty(0)}break;case 3:let e4=this._activeBuffer.lines.length-this._bufferService.rows;e4>0&&(this._activeBuffer.lines.trimStart(e4),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e4,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e4,0),this._onScroll.fire(0))}return!0}eraseInLine(e3,t3=!1){switch(this._restrictCursor(this._bufferService.cols),e3.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t3);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t3);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t3)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e3){this._restrictCursor();let t3=e3.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s3=this._activeBuffer.ybase+this._activeBuffer.y,i3=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r7=this._bufferService.rows-1+this._activeBuffer.ybase-i3+1;for(;t3--;)this._activeBuffer.lines.splice(r7-1,1),this._activeBuffer.lines.splice(s3,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e3){this._restrictCursor();let t3=e3.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s3=this._activeBuffer.ybase+this._activeBuffer.y,i3;for(i3=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i3=this._bufferService.rows-1+this._activeBuffer.ybase-i3;t3--;)this._activeBuffer.lines.splice(s3,1),this._activeBuffer.lines.splice(i3,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e3){this._restrictCursor();let t3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t3&&(t3.insertCells(this._activeBuffer.x,e3.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e3){this._restrictCursor();let t3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t3&&(t3.deleteCells(this._activeBuffer.x,e3.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e3){let t3=e3.params[0]||1;for(;t3--;)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(e3){let t3=e3.params[0]||1;for(;t3--;)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(l.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e3){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t3=e3.params[0]||1;for(let e4=this._activeBuffer.scrollTop;e4<=this._activeBuffer.scrollBottom;++e4){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e4);s3.deleteCells(0,t3,this._activeBuffer.getNullCell(this._eraseAttrData())),s3.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e3){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t3=e3.params[0]||1;for(let e4=this._activeBuffer.scrollTop;e4<=this._activeBuffer.scrollBottom;++e4){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e4);s3.insertCells(0,t3,this._activeBuffer.getNullCell(this._eraseAttrData())),s3.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e3){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t3=e3.params[0]||1;for(let e4=this._activeBuffer.scrollTop;e4<=this._activeBuffer.scrollBottom;++e4){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e4);s3.insertCells(this._activeBuffer.x,t3,this._activeBuffer.getNullCell(this._eraseAttrData())),s3.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e3){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t3=e3.params[0]||1;for(let e4=this._activeBuffer.scrollTop;e4<=this._activeBuffer.scrollBottom;++e4){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e4);s3.deleteCells(this._activeBuffer.x,t3,this._activeBuffer.getNullCell(this._eraseAttrData())),s3.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e3){this._restrictCursor();let t3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t3&&(t3.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e3.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e3){let t3=this._parser.precedingJoinState;if(!t3)return!0;let s3=e3.params[0]||1,i3=p.UnicodeService.extractWidth(t3),r7=this._activeBuffer.x-i3,n3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r7),o2=new Uint32Array(n3.length*s3),a2=0;for(let e4=0;e4<n3.length;){let t4=n3.codePointAt(e4)||0;o2[a2++]=t4,e4+=t4>65535?2:1}let h2=a2;for(let e4=1;e4<s3;++e4)o2.copyWithin(h2,0,a2),h2+=a2;return this.print(o2,0,h2),!0}sendDeviceAttributesPrimary(e3){return e3.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n2.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n2.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e3){return e3.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n2.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n2.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e3.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n2.C0.ESC+"[>83;40003;0c")),!0}_is(e3){return(this._optionsService.rawOptions.termName+"").indexOf(e3)===0}setMode(e3){for(let t3=0;t3<e3.length;t3++)switch(e3.params[t3]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e3){for(let t3=0;t3<e3.length;t3++)switch(e3.params[t3]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),this._charsetService.setgCharset(1,o.DEFAULT_CHARSET),this._charsetService.setgCharset(2,o.DEFAULT_CHARSET),this._charsetService.setgCharset(3,o.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 1000: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(e3){for(let t3=0;t3<e3.length;t3++)switch(e3.params[t3]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e3){for(let t3=0;t3<e3.length;t3++)switch(e3.params[t3]){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 1000: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(),e3.params[t3]===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(e3,t3){let s3=this._coreService.decPrivateModes,{activeProtocol:i3,activeEncoding:r7}=this._coreMouseService,o2=this._coreService,{buffers:a2,cols:h2}=this._bufferService,{active:c2,alt:l2}=a2,u2=this._optionsService.rawOptions,d2=(e4)=>e4?1:2,f2=e3.params[0];return _3=f2,p2=t3?f2===2?4:f2===4?d2(o2.modes.insertMode):f2===12?3:f2===20?d2(u2.convertEol):0:f2===1?d2(s3.applicationCursorKeys):f2===3?u2.windowOptions.setWinLines?h2===80?2:h2===132?1:0:0:f2===6?d2(s3.origin):f2===7?d2(s3.wraparound):f2===8?3:f2===9?d2(i3==="X10"):f2===12?d2(u2.cursorBlink):f2===25?d2(!o2.isCursorHidden):f2===45?d2(s3.reverseWraparound):f2===66?d2(s3.applicationKeypad):f2===67?4:f2===1000?d2(i3==="VT200"):f2===1002?d2(i3==="DRAG"):f2===1003?d2(i3==="ANY"):f2===1004?d2(s3.sendFocus):f2===1005?4:f2===1006?d2(r7==="SGR"):f2===1015?4:f2===1016?d2(r7==="SGR_PIXELS"):f2===1048?1:f2===47||f2===1047||f2===1049?d2(c2===l2):f2===2004?d2(s3.bracketedPasteMode):f2===2026?d2(s3.synchronizedOutput):0,o2.triggerDataEvent(`${n2.C0.ESC}[${t3?"":"?"}${_3};${p2}$y`),!0;var _3,p2}_updateAttrColor(e3,t3,s3,i3,r7){return t3===2?(e3|=50331648,e3&=-16777216,e3|=f.AttributeData.fromColorRGB([s3,i3,r7])):t3===5&&(e3&=-50331904,e3|=33554432|255&s3),e3}_extractColor(e3,t3,s3){let i3=[0,0,-1,0,0,0],r7=0,n3=0;do{if(i3[n3+r7]=e3.params[t3+n3],e3.hasSubParams(t3+n3)){let s4=e3.getSubParams(t3+n3),o2=0;do i3[1]===5&&(r7=1),i3[n3+o2+1+r7]=s4[o2];while(++o2<s4.length&&o2+n3+1+r7<i3.length);break}if(i3[1]===5&&n3+r7>=2||i3[1]===2&&n3+r7>=5)break;i3[1]&&(r7=1)}while(++n3+t3<e3.length&&n3+r7<i3.length);for(let e4=2;e4<i3.length;++e4)i3[e4]===-1&&(i3[e4]=0);switch(i3[0]){case 38:s3.fg=this._updateAttrColor(s3.fg,i3[1],i3[3],i3[4],i3[5]);break;case 48:s3.bg=this._updateAttrColor(s3.bg,i3[1],i3[3],i3[4],i3[5]);break;case 58:s3.extended=s3.extended.clone(),s3.extended.underlineColor=this._updateAttrColor(s3.extended.underlineColor,i3[1],i3[3],i3[4],i3[5])}return n3}_processUnderline(e3,t3){t3.extended=t3.extended.clone(),(!~e3||e3>5)&&(e3=1),t3.extended.underlineStyle=e3,t3.fg|=268435456,e3===0&&(t3.fg&=-268435457),t3.updateExtended()}_processSGR0(e3){e3.fg=l.DEFAULT_ATTR_DATA.fg,e3.bg=l.DEFAULT_ATTR_DATA.bg,e3.extended=e3.extended.clone(),e3.extended.underlineStyle=0,e3.extended.underlineColor&=-67108864,e3.updateExtended()}charAttributes(e3){if(e3.length===1&&e3.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t3=e3.length,s3,i3=this._curAttrData;for(let r7=0;r7<t3;r7++)s3=e3.params[r7],s3>=30&&s3<=37?(i3.fg&=-50331904,i3.fg|=16777216|s3-30):s3>=40&&s3<=47?(i3.bg&=-50331904,i3.bg|=16777216|s3-40):s3>=90&&s3<=97?(i3.fg&=-50331904,i3.fg|=16777224|s3-90):s3>=100&&s3<=107?(i3.bg&=-50331904,i3.bg|=16777224|s3-100):s3===0?this._processSGR0(i3):s3===1?i3.fg|=134217728:s3===3?i3.bg|=67108864:s3===4?(i3.fg|=268435456,this._processUnderline(e3.hasSubParams(r7)?e3.getSubParams(r7)[0]:1,i3)):s3===5?i3.fg|=536870912:s3===7?i3.fg|=67108864:s3===8?i3.fg|=1073741824:s3===9?i3.fg|=2147483648:s3===2?i3.bg|=134217728:s3===21?this._processUnderline(2,i3):s3===22?(i3.fg&=-134217729,i3.bg&=-134217729):s3===23?i3.bg&=-67108865:s3===24?(i3.fg&=-268435457,this._processUnderline(0,i3)):s3===25?i3.fg&=-536870913:s3===27?i3.fg&=-67108865:s3===28?i3.fg&=-1073741825:s3===29?i3.fg&=2147483647:s3===39?(i3.fg&=-67108864,i3.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):s3===49?(i3.bg&=-67108864,i3.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):s3===38||s3===48||s3===58?r7+=this._extractColor(e3,r7,i3):s3===53?i3.bg|=1073741824:s3===55?i3.bg&=-1073741825:s3===59?(i3.extended=i3.extended.clone(),i3.extended.underlineColor=-1,i3.updateExtended()):s3===100?(i3.fg&=-67108864,i3.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,i3.bg&=-67108864,i3.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",s3);return!0}deviceStatus(e3){switch(e3.params[0]){case 5:this._coreService.triggerDataEvent(`${n2.C0.ESC}[0n`);break;case 6:let e4=this._activeBuffer.y+1,t3=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n2.C0.ESC}[${e4};${t3}R`)}return!0}deviceStatusPrivate(e3){if(e3.params[0]===6){let e4=this._activeBuffer.y+1,t3=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n2.C0.ESC}[?${e4};${t3}R`)}return!0}softReset(e3){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.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(e3){let t3=e3.length===0?1:e3.params[0];if(t3===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t3){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"}let e4=t3%2==1;this._coreService.decPrivateModes.cursorBlink=e4}return!0}setScrollRegion(e3){let t3=e3.params[0]||1,s3;return(e3.length<2||(s3=e3.params[1])>this._bufferService.rows||s3===0)&&(s3=this._bufferService.rows),s3>t3&&(this._activeBuffer.scrollTop=t3-1,this._activeBuffer.scrollBottom=s3-1,this._setCursor(0,0)),!0}windowOptions(e3){if(!C2(e3.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t3=e3.length>1?e3.params[1]:0;switch(e3.params[0]){case 14:t3!==2&&this._onRequestWindowsOptionsReport.fire(w2.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w2.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n2.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:t3!==0&&t3!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),t3!==0&&t3!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:t3!==0&&t3!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),t3!==0&&t3!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e3){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(e3){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(e3){return this._windowTitle=e3,this._onTitleChange.fire(e3),!0}setIconName(e3){return this._iconName=e3,!0}setOrReportIndexedColor(e3){let t3=[],s3=e3.split(";");for(;s3.length>1;){let e4=s3.shift(),i3=s3.shift();if(/^\d+$/.exec(e4)){let s4=parseInt(e4);if(k(s4))if(i3==="?")t3.push({type:0,index:s4});else{let e5=(0,m.parseColor)(i3);e5&&t3.push({type:1,index:s4,color:e5})}}}return t3.length&&this._onColor.fire(t3),!0}setHyperlink(e3){let t3=e3.indexOf(";");if(t3===-1)return!0;let s3=e3.slice(0,t3).trim(),i3=e3.slice(t3+1);return i3?this._createHyperlink(s3,i3):!s3.trim()&&this._finishHyperlink()}_createHyperlink(e3,t3){this._getCurrentLinkId()&&this._finishHyperlink();let s3=e3.split(":"),i3,r7=s3.findIndex((e4)=>e4.startsWith("id="));return r7!==-1&&(i3=s3[r7].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i3,uri:t3}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e3,t3){let s3=e3.split(";");for(let e4=0;e4<s3.length&&!(t3>=this._specialColors.length);++e4,++t3)if(s3[e4]==="?")this._onColor.fire([{type:0,index:this._specialColors[t3]}]);else{let i3=(0,m.parseColor)(s3[e4]);i3&&this._onColor.fire([{type:1,index:this._specialColors[t3],color:i3}])}return!0}setOrReportFgColor(e3){return this._setOrReportSpecialColor(e3,0)}setOrReportBgColor(e3){return this._setOrReportSpecialColor(e3,1)}setOrReportCursorColor(e3){return this._setOrReportSpecialColor(e3,2)}restoreIndexedColor(e3){if(!e3)return this._onColor.fire([{type:2}]),!0;let t3=[],s3=e3.split(";");for(let e4=0;e4<s3.length;++e4)if(/^\d+$/.exec(s3[e4])){let i3=parseInt(s3[e4]);k(i3)&&t3.push({type:2,index:i3})}return t3.length&&this._onColor.fire(t3),!0}restoreFgColor(e3){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e3){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e3){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,o.DEFAULT_CHARSET),!0}selectCharset(e3){return e3.length!==2?(this.selectDefaultCharset(),!0):(e3[0]==="/"||this._charsetService.setgCharset(S[e3[0]],o.CHARSETS[e3[1]]||o.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e3=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e3,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e3){return this._charsetService.setgLevel(e3),!0}screenAlignmentPattern(){let e3=new d.CellData;e3.content=4194373,e3.fg=this._curAttrData.fg,e3.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t3=0;t3<this._bufferService.rows;++t3){let s3=this._activeBuffer.ybase+this._activeBuffer.y+t3,i3=this._activeBuffer.lines.get(s3);i3&&(i3.fill(e3),i3.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e3,t3){let s3=this._bufferService.buffer,i3=this._optionsService.rawOptions;return((e4)=>(this._coreService.triggerDataEvent(`${n2.C0.ESC}${e4}${n2.C0.ESC}\\`),!0))(e3==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e3==='"p'?'P1$r61;1"p':e3==="r"?`P1$r${s3.scrollTop+1};${s3.scrollBottom+1}r`:e3==="m"?"P1$r0m":e3===" q"?`P1$r${{block:2,underline:4,bar:6}[i3.cursorStyle]-(i3.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e3,t3){this._dirtyRowTracker.markRangeDirty(e3,t3)}}t2.InputHandler=A2;let L=class{constructor(e3){this._bufferService=e3,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e3){e3<this.start?this.start=e3:e3>this.end&&(this.end=e3)}markRangeDirty(e3,t3){e3>t3&&(E=e3,e3=t3,t3=E),e3<this.start&&(this.start=e3),t3>this.end&&(this.end=t3)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function k(e3){return 0<=e3&&e3<256}L=i2([r6(0,_2.IBufferService)],L)},701:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.isChromeOS=t2.isLinux=t2.isWindows=t2.isIphone=t2.isIpad=t2.isMac=t2.isSafari=t2.isLegacyEdge=t2.isFirefox=t2.isNode=void 0,t2.getSafariVersion=function(){if(!t2.isSafari)return 0;let e3=s2.match(/Version\/(\d+)/);return e3===null||e3.length<2?0:parseInt(e3[1])},t2.isNode=typeof process<"u"&&"title"in process;let s2=t2.isNode?"node":navigator.userAgent,i2=t2.isNode?"node":navigator.platform;t2.isFirefox=s2.includes("Firefox"),t2.isLegacyEdge=s2.includes("Edge"),t2.isSafari=/^((?!chrome|android).)*safari/i.test(s2),t2.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(i2),t2.isIpad=i2==="iPad",t2.isIphone=i2==="iPhone",t2.isWindows=["Windows","Win16","Win32","WinCE"].includes(i2),t2.isLinux=i2.indexOf("Linux")>=0,t2.isChromeOS=/\bCrOS\b/.test(s2)},6168:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.DebouncedIdleTask=t2.IdleTaskQueue=t2.PriorityTaskQueue=void 0;let i2=s2(701);class r6{constructor(){this._tasks=[],this._i=0}enqueue(e3){this._tasks.push(e3),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(e3){this._idleCallback=void 0;let t3=0,s3=0,i3=e3.timeRemaining(),r7=0;for(;this._i<this._tasks.length;){if(t3=performance.now(),this._tasks[this._i]()||this._i++,t3=Math.max(1,performance.now()-t3),s3=Math.max(t3,s3),r7=e3.timeRemaining(),1.5*s3>r7)return i3-t3<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i3-t3))}ms`),void this._start();i3=r7}this.clear()}}class n2 extends r6{_requestCallback(e3){return setTimeout(()=>e3(this._createDeadline(16)))}_cancelCallback(e3){clearTimeout(e3)}_createDeadline(e3){let t3=performance.now()+e3;return{timeRemaining:()=>Math.max(0,t3-performance.now())}}}t2.PriorityTaskQueue=n2,t2.IdleTaskQueue=!i2.isNode&&"requestIdleCallback"in window?class extends r6{_requestCallback(e3){return requestIdleCallback(e3)}_cancelCallback(e3){cancelIdleCallback(e3)}}:n2,t2.DebouncedIdleTask=class{constructor(){this._queue=new t2.IdleTaskQueue}set(e3){this._queue.clear(),this._queue.enqueue(e3)}flush(){this._queue.flush()}}},5882:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.updateWindowsModeWrappedState=function(e3){let t3=e3.buffer.lines.get(e3.buffer.ybase+e3.buffer.y-1),s3=t3?.get(e3.cols-1),r6=e3.buffer.lines.get(e3.buffer.ybase+e3.buffer.y);r6&&s3&&(r6.isWrapped=s3[i2.CHAR_DATA_CODE_INDEX]!==i2.NULL_CELL_CODE&&s3[i2.CHAR_DATA_CODE_INDEX]!==i2.WHITESPACE_CELL_CODE)};let i2=s2(8938)},5451:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.ExtendedAttrs=t2.AttributeData=void 0;class s2{constructor(){this.fg=0,this.bg=0,this.extended=new i2}static toColorRGB(e3){return[e3>>>16&255,e3>>>8&255,255&e3]}static fromColorRGB(e3){return(255&e3[0])<<16|(255&e3[1])<<8|255&e3[2]}clone(){let e3=new s2;return e3.fg=this.fg,e3.bg=this.bg,e3.extended=this.extended.clone(),e3}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}}t2.AttributeData=s2;class i2{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e3){this._ext=e3}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e3){this._ext&=-469762049,this._ext|=e3<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e3){this._ext&=-67108864,this._ext|=67108863&e3}get urlId(){return this._urlId}set urlId(e3){this._urlId=e3}get underlineVariantOffset(){let e3=(3758096384&this._ext)>>29;return e3<0?4294967288^e3:e3}set underlineVariantOffset(e3){this._ext&=536870911,this._ext|=e3<<29&3758096384}constructor(e3=0,t3=0){this._ext=0,this._urlId=0,this._ext=e3,this._urlId=t3}clone(){return new i2(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t2.ExtendedAttrs=i2},1073:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.Buffer=t2.MAX_BUFFER_SIZE=void 0;let i2=s2(5639),r6=s2(6168),n2=s2(5451),o=s2(6107),a=s2(732),h=s2(3055),c=s2(8938),l=s2(8158),u=s2(6760);t2.MAX_BUFFER_SIZE=4294967295,t2.Buffer=class{constructor(e3,t3,s3){this._hasScrollback=e3,this._optionsService=t3,this._bufferService=s3,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=h.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]),this._whitespaceCell=h.CellData.fromCharData([0,c.WHITESPACE_CELL_CHAR,c.WHITESPACE_CELL_WIDTH,c.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new r6.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new i2.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e3){return e3?(this._nullCell.fg=e3.fg,this._nullCell.bg=e3.bg,this._nullCell.extended=e3.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n2.ExtendedAttrs),this._nullCell}getWhitespaceCell(e3){return e3?(this._whitespaceCell.fg=e3.fg,this._whitespaceCell.bg=e3.bg,this._whitespaceCell.extended=e3.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n2.ExtendedAttrs),this._whitespaceCell}getBlankLine(e3,t3){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e3),t3)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e3=this.ybase+this.y-this.ydisp;return e3>=0&&e3<this._rows}_getCorrectBufferLength(e3){if(!this._hasScrollback)return e3;let s3=e3+this._optionsService.rawOptions.scrollback;return s3>t2.MAX_BUFFER_SIZE?t2.MAX_BUFFER_SIZE:s3}fillViewportRows(e3){if(this.lines.length===0){e3===void 0&&(e3=o.DEFAULT_ATTR_DATA);let t3=this._rows;for(;t3--;)this.lines.push(this.getBlankLine(e3))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new i2.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e3,t3){let s3=this.getNullCell(o.DEFAULT_ATTR_DATA),i3=0,r7=this._getCorrectBufferLength(t3);if(r7>this.lines.maxLength&&(this.lines.maxLength=r7),this.lines.length>0){if(this._cols<e3)for(let t4=0;t4<this.lines.length;t4++)i3+=+this.lines.get(t4).resize(e3,s3);let n3=0;if(this._rows<t3)for(let i4=this._rows;i4<t3;i4++)this.lines.length<t3+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new o.BufferLine(e3,s3)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n3+1?(this.ybase--,n3++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e3,s3)));else for(let e4=this._rows;e4>t3;e4--)this.lines.length>t3+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r7<this.lines.maxLength){let e4=this.lines.length-r7;e4>0&&(this.lines.trimStart(e4),this.ybase=Math.max(this.ybase-e4,0),this.ydisp=Math.max(this.ydisp-e4,0),this.savedY=Math.max(this.savedY-e4,0)),this.lines.maxLength=r7}this.x=Math.min(this.x,e3-1),this.y=Math.min(this.y,t3-1),n3&&(this.y+=n3),this.savedX=Math.min(this.savedX,e3-1),this.scrollTop=0}if(this.scrollBottom=t3-1,this._isReflowEnabled&&(this._reflow(e3,t3),this._cols>e3))for(let t4=0;t4<this.lines.length;t4++)i3+=+this.lines.get(t4).resize(e3,s3);this._cols=e3,this._rows=t3,this._memoryCleanupQueue.clear(),i3>0.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e3=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e3=!1);let t3=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t3+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t3>100)return!0;return e3}get _isReflowEnabled(){let e3=this._optionsService.rawOptions.windowsPty;return e3&&e3.buildNumber?this._hasScrollback&&e3.backend==="conpty"&&e3.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e3,t3){this._cols!==e3&&(e3>this._cols?this._reflowLarger(e3,t3):this._reflowSmaller(e3,t3))}_reflowLarger(e3,t3){let s3=this._optionsService.rawOptions.reflowCursorLine,i3=(0,a.reflowLargerGetLinesToRemove)(this.lines,this._cols,e3,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA),s3);if(i3.length>0){let s4=(0,a.reflowLargerCreateNewLayout)(this.lines,i3);(0,a.reflowLargerApplyNewLayout)(this.lines,s4.layout),this._reflowLargerAdjustViewport(e3,t3,s4.countRemoved)}}_reflowLargerAdjustViewport(e3,t3,s3){let i3=this.getNullCell(o.DEFAULT_ATTR_DATA),r7=s3;for(;r7-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t3&&this.lines.push(new o.BufferLine(e3,i3))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s3,0)}_reflowSmaller(e3,t3){let s3=this._optionsService.rawOptions.reflowCursorLine,i3=this.getNullCell(o.DEFAULT_ATTR_DATA),r7=[],n3=0;for(let h2=this.lines.length-1;h2>=0;h2--){let c2=this.lines.get(h2);if(!c2||!c2.isWrapped&&c2.getTrimmedLength()<=e3)continue;let l2=[c2];for(;c2.isWrapped&&h2>0;)c2=this.lines.get(--h2),l2.unshift(c2);if(!s3){let e4=this.ybase+this.y;if(e4>=h2&&e4<h2+l2.length)continue}let u2=l2[l2.length-1].getTrimmedLength(),d=(0,a.reflowSmallerGetNewLineLengths)(l2,this._cols,e3),f=d.length-l2.length,_2;_2=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+f):Math.max(0,this.lines.length-this.lines.maxLength+f);let p=[];for(let e4=0;e4<f;e4++){let e5=this.getBlankLine(o.DEFAULT_ATTR_DATA,!0);p.push(e5)}p.length>0&&(r7.push({start:h2+l2.length+n3,newLines:p}),n3+=p.length),l2.push(...p);let g=d.length-1,v=d[g];v===0&&(g--,v=d[g]);let m=l2.length-f-1,b=u2;for(;m>=0;){let e4=Math.min(b,v);if(l2[g]===void 0)break;if(l2[g].copyCellsFrom(l2[m],b-e4,v-e4,e4,!0),v-=e4,v===0&&(g--,v=d[g]),b-=e4,b===0){m--;let e5=Math.max(m,0);b=(0,a.getWrappedLineTrimmedLength)(l2,e5,this._cols)}}for(let t4=0;t4<l2.length;t4++)d[t4]<e3&&l2[t4].setCell(d[t4],i3);let S=f-_2;for(;S-- >0;)this.ybase===0?this.y<t3-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n3)-t3&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+f,this.ybase+t3-1)}if(r7.length>0){let e4=[],t4=[];for(let e5=0;e5<this.lines.length;e5++)t4.push(this.lines.get(e5));let s4=this.lines.length,i4=s4-1,o2=0,a2=r7[o2];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n3);let h2=0;for(let c3=Math.min(this.lines.maxLength-1,s4+n3-1);c3>=0;c3--)if(a2&&a2.start>i4+h2){for(let e5=a2.newLines.length-1;e5>=0;e5--)this.lines.set(c3--,a2.newLines[e5]);c3++,e4.push({index:i4+1,amount:a2.newLines.length}),h2+=a2.newLines.length,a2=r7[++o2]}else this.lines.set(c3,t4[i4--]);let c2=0;for(let t5=e4.length-1;t5>=0;t5--)e4[t5].index+=c2,this.lines.onInsertEmitter.fire(e4[t5]),c2+=e4[t5].amount;let l2=Math.max(0,s4+n3-this.lines.maxLength);l2>0&&this.lines.onTrimEmitter.fire(l2)}}translateBufferLineToString(e3,t3,s3=0,i3){let r7=this.lines.get(e3);return r7?r7.translateToString(t3,s3,i3):""}getWrappedRangeForLine(e3){let t3=e3,s3=e3;for(;t3>0&&this.lines.get(t3).isWrapped;)t3--;for(;s3+1<this.lines.length&&this.lines.get(s3+1).isWrapped;)s3++;return{first:t3,last:s3}}setupTabStops(e3){for(e3!=null?this.tabs[e3]||(e3=this.prevStop(e3)):(this.tabs={},e3=0);e3<this._cols;e3+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e3]=!0}prevStop(e3){for(e3==null&&(e3=this.x);!this.tabs[--e3]&&e3>0;);return e3>=this._cols?this._cols-1:e3<0?0:e3}nextStop(e3){for(e3==null&&(e3=this.x);!this.tabs[++e3]&&e3<this._cols;);return e3>=this._cols?this._cols-1:e3<0?0:e3}clearMarkers(e3){this._isClearing=!0;for(let t3=0;t3<this.markers.length;t3++)this.markers[t3].line===e3&&(this.markers[t3].dispose(),this.markers.splice(t3--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e3=0;e3<this.markers.length;e3++)this.markers[e3].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e3){let t3=new l.Marker(e3);return this.markers.push(t3),t3.register(this.lines.onTrim((e4)=>{t3.line-=e4,t3.line<0&&t3.dispose()})),t3.register(this.lines.onInsert((e4)=>{t3.line>=e4.index&&(t3.line+=e4.amount)})),t3.register(this.lines.onDelete((e4)=>{t3.line>=e4.index&&t3.line<e4.index+e4.amount&&t3.dispose(),t3.line>e4.index&&(t3.line-=e4.amount)})),t3.register(t3.onDispose(()=>this._removeMarker(t3))),t3}_removeMarker(e3){this._isClearing||this.markers.splice(this.markers.indexOf(e3),1)}}},6107:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.BufferLine=t2.DEFAULT_ATTR_DATA=void 0;let i2=s2(5451),r6=s2(3055),n2=s2(8938),o=s2(726);t2.DEFAULT_ATTR_DATA=Object.freeze(new i2.AttributeData);let a=0;class h{constructor(e3,t3,s3=!1){this.isWrapped=s3,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e3);let i3=t3||r6.CellData.fromCharData([0,n2.NULL_CELL_CHAR,n2.NULL_CELL_WIDTH,n2.NULL_CELL_CODE]);for(let t4=0;t4<e3;++t4)this.setCell(t4,i3);this.length=e3}get(e3){let t3=this._data[3*e3+0],s3=2097151&t3;return[this._data[3*e3+1],2097152&t3?this._combined[e3]:s3?(0,o.stringFromCodePoint)(s3):"",t3>>22,2097152&t3?this._combined[e3].charCodeAt(this._combined[e3].length-1):s3]}set(e3,t3){this._data[3*e3+1]=t3[n2.CHAR_DATA_ATTR_INDEX],t3[n2.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e3]=t3[1],this._data[3*e3+0]=2097152|e3|t3[n2.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e3+0]=t3[n2.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t3[n2.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e3){return this._data[3*e3+0]>>22}hasWidth(e3){return 12582912&this._data[3*e3+0]}getFg(e3){return this._data[3*e3+1]}getBg(e3){return this._data[3*e3+2]}hasContent(e3){return 4194303&this._data[3*e3+0]}getCodePoint(e3){let t3=this._data[3*e3+0];return 2097152&t3?this._combined[e3].charCodeAt(this._combined[e3].length-1):2097151&t3}isCombined(e3){return 2097152&this._data[3*e3+0]}getString(e3){let t3=this._data[3*e3+0];return 2097152&t3?this._combined[e3]:2097151&t3?(0,o.stringFromCodePoint)(2097151&t3):""}isProtected(e3){return 536870912&this._data[3*e3+2]}loadCell(e3,t3){return a=3*e3,t3.content=this._data[a+0],t3.fg=this._data[a+1],t3.bg=this._data[a+2],2097152&t3.content&&(t3.combinedData=this._combined[e3]),268435456&t3.bg&&(t3.extended=this._extendedAttrs[e3]),t3}setCell(e3,t3){2097152&t3.content&&(this._combined[e3]=t3.combinedData),268435456&t3.bg&&(this._extendedAttrs[e3]=t3.extended),this._data[3*e3+0]=t3.content,this._data[3*e3+1]=t3.fg,this._data[3*e3+2]=t3.bg}setCellFromCodepoint(e3,t3,s3,i3){268435456&i3.bg&&(this._extendedAttrs[e3]=i3.extended),this._data[3*e3+0]=t3|s3<<22,this._data[3*e3+1]=i3.fg,this._data[3*e3+2]=i3.bg}addCodepointToCell(e3,t3,s3){let i3=this._data[3*e3+0];2097152&i3?this._combined[e3]+=(0,o.stringFromCodePoint)(t3):2097151&i3?(this._combined[e3]=(0,o.stringFromCodePoint)(2097151&i3)+(0,o.stringFromCodePoint)(t3),i3&=-2097152,i3|=2097152):i3=t3|4194304,s3&&(i3&=-12582913,i3|=s3<<22),this._data[3*e3+0]=i3}insertCells(e3,t3,s3){if((e3%=this.length)&&this.getWidth(e3-1)===2&&this.setCellFromCodepoint(e3-1,0,1,s3),t3<this.length-e3){let i3=new r6.CellData;for(let s4=this.length-e3-t3-1;s4>=0;--s4)this.setCell(e3+t3+s4,this.loadCell(e3+s4,i3));for(let i4=0;i4<t3;++i4)this.setCell(e3+i4,s3)}else for(let t4=e3;t4<this.length;++t4)this.setCell(t4,s3);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s3)}deleteCells(e3,t3,s3){if(e3%=this.length,t3<this.length-e3){let i3=new r6.CellData;for(let s4=0;s4<this.length-e3-t3;++s4)this.setCell(e3+s4,this.loadCell(e3+t3+s4,i3));for(let e4=this.length-t3;e4<this.length;++e4)this.setCell(e4,s3)}else for(let t4=e3;t4<this.length;++t4)this.setCell(t4,s3);e3&&this.getWidth(e3-1)===2&&this.setCellFromCodepoint(e3-1,0,1,s3),this.getWidth(e3)!==0||this.hasContent(e3)||this.setCellFromCodepoint(e3,0,1,s3)}replaceCells(e3,t3,s3,i3=!1){if(i3)for(e3&&this.getWidth(e3-1)===2&&!this.isProtected(e3-1)&&this.setCellFromCodepoint(e3-1,0,1,s3),t3<this.length&&this.getWidth(t3-1)===2&&!this.isProtected(t3)&&this.setCellFromCodepoint(t3,0,1,s3);e3<t3&&e3<this.length;)this.isProtected(e3)||this.setCell(e3,s3),e3++;else for(e3&&this.getWidth(e3-1)===2&&this.setCellFromCodepoint(e3-1,0,1,s3),t3<this.length&&this.getWidth(t3-1)===2&&this.setCellFromCodepoint(t3,0,1,s3);e3<t3&&e3<this.length;)this.setCell(e3++,s3)}resize(e3,t3){if(e3===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let s3=3*e3;if(e3>this.length){if(this._data.buffer.byteLength>=4*s3)this._data=new Uint32Array(this._data.buffer,0,s3);else{let e4=new Uint32Array(s3);e4.set(this._data),this._data=e4}for(let s4=this.length;s4<e3;++s4)this.setCell(s4,t3)}else{this._data=this._data.subarray(0,s3);let t4=Object.keys(this._combined);for(let s4=0;s4<t4.length;s4++){let i4=parseInt(t4[s4],10);i4>=e3&&delete this._combined[i4]}let i3=Object.keys(this._extendedAttrs);for(let t5=0;t5<i3.length;t5++){let s4=parseInt(i3[t5],10);s4>=e3&&delete this._extendedAttrs[s4]}}return this.length=e3,4*s3*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e3=new Uint32Array(this._data.length);return e3.set(this._data),this._data=e3,1}return 0}fill(e3,t3=!1){if(t3)for(let t4=0;t4<this.length;++t4)this.isProtected(t4)||this.setCell(t4,e3);else{this._combined={},this._extendedAttrs={};for(let t4=0;t4<this.length;++t4)this.setCell(t4,e3)}}copyFrom(e3){this.length!==e3.length?this._data=new Uint32Array(e3._data):this._data.set(e3._data),this.length=e3.length,this._combined={};for(let t3 in e3._combined)this._combined[t3]=e3._combined[t3];this._extendedAttrs={};for(let t3 in e3._extendedAttrs)this._extendedAttrs[t3]=e3._extendedAttrs[t3];this.isWrapped=e3.isWrapped}clone(){let e3=new h(0);e3._data=new Uint32Array(this._data),e3.length=this.length;for(let t3 in this._combined)e3._combined[t3]=this._combined[t3];for(let t3 in this._extendedAttrs)e3._extendedAttrs[t3]=this._extendedAttrs[t3];return e3.isWrapped=this.isWrapped,e3}getTrimmedLength(){for(let e3=this.length-1;e3>=0;--e3)if(4194303&this._data[3*e3+0])return e3+(this._data[3*e3+0]>>22);return 0}getNoBgTrimmedLength(){for(let e3=this.length-1;e3>=0;--e3)if(4194303&this._data[3*e3+0]||50331648&this._data[3*e3+2])return e3+(this._data[3*e3+0]>>22);return 0}copyCellsFrom(e3,t3,s3,i3,r7){let n3=e3._data;if(r7)for(let r8=i3-1;r8>=0;r8--){for(let e4=0;e4<3;e4++)this._data[3*(s3+r8)+e4]=n3[3*(t3+r8)+e4];268435456&n3[3*(t3+r8)+2]&&(this._extendedAttrs[s3+r8]=e3._extendedAttrs[t3+r8])}else for(let r8=0;r8<i3;r8++){for(let e4=0;e4<3;e4++)this._data[3*(s3+r8)+e4]=n3[3*(t3+r8)+e4];268435456&n3[3*(t3+r8)+2]&&(this._extendedAttrs[s3+r8]=e3._extendedAttrs[t3+r8])}let o2=Object.keys(e3._combined);for(let i4=0;i4<o2.length;i4++){let r8=parseInt(o2[i4],10);r8>=t3&&(this._combined[r8-t3+s3]=e3._combined[r8])}}translateToString(e3,t3,s3,i3){t3=t3??0,s3=s3??this.length,e3&&(s3=Math.min(s3,this.getTrimmedLength())),i3&&(i3.length=0);let r7="";for(;t3<s3;){let e4=this._data[3*t3+0],s4=2097151&e4,a2=2097152&e4?this._combined[t3]:s4?(0,o.stringFromCodePoint)(s4):n2.WHITESPACE_CELL_CHAR;if(r7+=a2,i3)for(let e5=0;e5<a2.length;++e5)i3.push(t3);t3+=e4>>22||1}return i3&&i3.push(t3),r7}}t2.BufferLine=h},732:(e2,t2)=>{function s2(e3,t3,s3){if(t3===e3.length-1)return e3[t3].getTrimmedLength();let i2=!e3[t3].hasContent(s3-1)&&e3[t3].getWidth(s3-1)===1,r6=e3[t3+1].getWidth(0)===2;return i2&&r6?s3-1:s3}Object.defineProperty(t2,"__esModule",{value:!0}),t2.reflowLargerGetLinesToRemove=function(e3,t3,i2,r6,n2,o){let a=[];for(let h=0;h<e3.length-1;h++){let c=h,l=e3.get(++c);if(!l.isWrapped)continue;let u=[e3.get(h)];for(;c<e3.length&&l.isWrapped;)u.push(l),l=e3.get(++c);if(!o&&r6>=h&&r6<c){h+=u.length-1;continue}let d=0,f=s2(u,d,t3),_2=1,p=0;for(;_2<u.length;){let e4=s2(u,_2,t3),r7=e4-p,o2=i2-f,a2=Math.min(r7,o2);u[d].copyCellsFrom(u[_2],p,f,a2,!1),f+=a2,f===i2&&(d++,f=0),p+=a2,p===e4&&(_2++,p=0),f===0&&d!==0&&u[d-1].getWidth(i2-1)===2&&(u[d].copyCellsFrom(u[d-1],i2-1,f++,1,!1),u[d-1].setCell(i2-1,n2))}u[d].replaceCells(f,i2,n2);let g=0;for(let e4=u.length-1;e4>0&&(e4>d||u[e4].getTrimmedLength()===0);e4--)g++;g>0&&(a.push(h+u.length-g),a.push(g)),h+=u.length-1}return a},t2.reflowLargerCreateNewLayout=function(e3,t3){let s3=[],i2=0,r6=t3[i2],n2=0;for(let o=0;o<e3.length;o++)if(r6===o){let s4=t3[++i2];e3.onDeleteEmitter.fire({index:o-n2,amount:s4}),o+=s4-1,n2+=s4,r6=t3[++i2]}else s3.push(o);return{layout:s3,countRemoved:n2}},t2.reflowLargerApplyNewLayout=function(e3,t3){let s3=[];for(let i2=0;i2<t3.length;i2++)s3.push(e3.get(t3[i2]));for(let t4=0;t4<s3.length;t4++)e3.set(t4,s3[t4]);e3.length=t3.length},t2.reflowSmallerGetNewLineLengths=function(e3,t3,i2){let r6=[],n2=e3.map((i3,r7)=>s2(e3,r7,t3)).reduce((e4,t4)=>e4+t4),o=0,a=0,h=0;for(;h<n2;){if(n2-h<i2){r6.push(n2-h);break}o+=i2;let c=s2(e3,a,t3);o>c&&(o-=c,a++);let l=e3[a].getWidth(o-1)===2;l&&o--;let u=l?i2-1:i2;r6.push(u),h+=u}return r6},t2.getWrappedLineTrimmedLength=s2},4097:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.BufferSet=void 0;let i2=s2(7150),r6=s2(1073),n2=s2(802);class o extends i2.Disposable{constructor(e3,t3){super(),this._optionsService=e3,this._bufferService=t3,this._onBufferActivate=this._register(new n2.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 r6.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r6.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(e3){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e3),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(e3,t3){this._normal.resize(e3,t3),this._alt.resize(e3,t3),this.setupTabStops(e3)}setupTabStops(e3){this._normal.setupTabStops(e3),this._alt.setupTabStops(e3)}}t2.BufferSet=o},3055:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.CellData=void 0;let i2=s2(726),r6=s2(8938),n2=s2(5451);class o extends n2.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n2.ExtendedAttrs,this.combinedData=""}static fromCharData(e3){let t3=new o;return t3.setFromCharData(e3),t3}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,i2.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e3){this.fg=e3[r6.CHAR_DATA_ATTR_INDEX],this.bg=0;let t3=!1;if(e3[r6.CHAR_DATA_CHAR_INDEX].length>2)t3=!0;else if(e3[r6.CHAR_DATA_CHAR_INDEX].length===2){let s3=e3[r6.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=s3&&s3<=56319){let i3=e3[r6.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i3&&i3<=57343?this.content=1024*(s3-55296)+i3-56320+65536|e3[r6.CHAR_DATA_WIDTH_INDEX]<<22:t3=!0}else t3=!0}else this.content=e3[r6.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e3[r6.CHAR_DATA_WIDTH_INDEX]<<22;t3&&(this.combinedData=e3[r6.CHAR_DATA_CHAR_INDEX],this.content=2097152|e3[r6.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t2.CellData=o},8938:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.WHITESPACE_CELL_CODE=t2.WHITESPACE_CELL_WIDTH=t2.WHITESPACE_CELL_CHAR=t2.NULL_CELL_CODE=t2.NULL_CELL_WIDTH=t2.NULL_CELL_CHAR=t2.CHAR_DATA_CODE_INDEX=t2.CHAR_DATA_WIDTH_INDEX=t2.CHAR_DATA_CHAR_INDEX=t2.CHAR_DATA_ATTR_INDEX=t2.DEFAULT_EXT=t2.DEFAULT_ATTR=t2.DEFAULT_COLOR=void 0,t2.DEFAULT_COLOR=0,t2.DEFAULT_ATTR=t2.DEFAULT_COLOR<<9|256,t2.DEFAULT_EXT=0,t2.CHAR_DATA_ATTR_INDEX=0,t2.CHAR_DATA_CHAR_INDEX=1,t2.CHAR_DATA_WIDTH_INDEX=2,t2.CHAR_DATA_CODE_INDEX=3,t2.NULL_CELL_CHAR="",t2.NULL_CELL_WIDTH=1,t2.NULL_CELL_CODE=0,t2.WHITESPACE_CELL_CHAR=" ",t2.WHITESPACE_CELL_WIDTH=1,t2.WHITESPACE_CELL_CODE=32},8158:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.Marker=void 0;let i2=s2(802),r6=s2(7150);class n2{get id(){return this._id}constructor(e3){this.line=e3,this.isDisposed=!1,this._disposables=[],this._id=n2._nextId++,this._onDispose=this.register(new i2.Emitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,r6.dispose)(this._disposables),this._disposables.length=0)}register(e3){return this._disposables.push(e3),e3}}t2.Marker=n2,n2._nextId=1},6760:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.DEFAULT_CHARSET=t2.CHARSETS=void 0,t2.CHARSETS={},t2.DEFAULT_CHARSET=t2.CHARSETS.B,t2.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"},t2.CHARSETS.A={"#":"\xA3"},t2.CHARSETS.B=void 0,t2.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},t2.CHARSETS.C=t2.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},t2.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},t2.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},t2.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},t2.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},t2.CHARSETS.E=t2.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},t2.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},t2.CHARSETS.H=t2.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},t2.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},3534:(e2,t2)=>{var s2,i2,r6;Object.defineProperty(t2,"__esModule",{value:!0}),t2.C1_ESCAPED=t2.C1=t2.C0=void 0,function(e3){e3.NUL="\x00",e3.SOH="\x01",e3.STX="\x02",e3.ETX="\x03",e3.EOT="\x04",e3.ENQ="\x05",e3.ACK="\x06",e3.BEL="\x07",e3.BS="\b",e3.HT="\t",e3.LF=`
2
+ import{remoteKeyForRepo}from"./chunk-rhsvvdcn.js";import{ensurePtyHostReachable}from"./chunk-zhbws9n3.js";import{protocolEntry,sessionProtocol}from"./chunk-qqw3p4fc.js";import{toPosixPath}from"./chunk-b99tf0jr.js";import{DEFAULT_TERMINAL_COLORS,parseTerminalDefaultColors}from"./chunk-7q67dz4c.js";import{resolveEngineLaunchInit}from"./chunk-h8m37225.js";import{kobeApiInvocation}from"./chunk-5agemmmn.js";import{BUNDLED_THEMES,DEFAULT_THEME,readPersistedUiPrefs}from"./chunk-y0nq7amn.js";import{loadUserThemes}from"./chunk-zqfbyq0a.js";import{terminalRows}from"./chunk-w25b7xxz.js";import{argvHasFlag}from"./chunk-jvxh93nz.js";import{KobeDaemonClient}from"./chunk-0gepyh6e.js";import{engineProcessIn,parsePsSnapshot,psSnapshot}from"./chunk-jn5dd6bv.js";import{engineEntry}from"./chunk-xhw8s2es.js";import{quoteShellArg,quoteShellArgv}from"./chunk-2fypr41w.js";import{getPersistedBool,loadStateFile}from"./chunk-j75axe29.js";import{BUILTIN_VENDORS}from"./chunk-bq3fyc0p.js";import{roveStateDir,worktreeInitMarkerPath}from"./chunk-ch9b1d5y.js";import{defaultPtyHostSocketPath}from"./chunk-mcdv19rs.js";import{readRoveEnv}from"./chunk-r3k9rbwm.js";import{__commonJS,__toESM}from"./chunk-wqfp8d9w.js";var require_xterm_headless=__commonJS((exports)=>{(()=>{var e={5639:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.CircularList=void 0;let i2=s2(7150),r6=s2(802);class n2 extends i2.Disposable{constructor(e3){super(),this._maxLength=e3,this.onDeleteEmitter=this._register(new r6.Emitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new r6.Emitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new r6.Emitter),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e3){if(this._maxLength===e3)return;let t3=Array(e3);for(let s3=0;s3<Math.min(e3,this.length);s3++)t3[s3]=this._array[this._getCyclicIndex(s3)];this._array=t3,this._maxLength=e3,this._startIndex=0}get length(){return this._length}set length(e3){if(e3>this._length)for(let t3=this._length;t3<e3;t3++)this._array[t3]=void 0;this._length=e3}get(e3){return this._array[this._getCyclicIndex(e3)]}set(e3,t3){this._array[this._getCyclicIndex(e3)]=t3}push(e3){this._array[this._getCyclicIndex(this._length)]=e3,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw 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(e3,t3,...s3){if(t3){for(let s4=e3;s4<this._length-t3;s4++)this._array[this._getCyclicIndex(s4)]=this._array[this._getCyclicIndex(s4+t3)];this._length-=t3,this.onDeleteEmitter.fire({index:e3,amount:t3})}for(let t4=this._length-1;t4>=e3;t4--)this._array[this._getCyclicIndex(t4+s3.length)]=this._array[this._getCyclicIndex(t4)];for(let t4=0;t4<s3.length;t4++)this._array[this._getCyclicIndex(e3+t4)]=s3[t4];if(s3.length&&this.onInsertEmitter.fire({index:e3,amount:s3.length}),this._length+s3.length>this._maxLength){let e4=this._length+s3.length-this._maxLength;this._startIndex+=e4,this._length=this._maxLength,this.onTrimEmitter.fire(e4)}else this._length+=s3.length}trimStart(e3){e3>this._length&&(e3=this._length),this._startIndex+=e3,this._length-=e3,this.onTrimEmitter.fire(e3)}shiftElements(e3,t3,s3){if(!(t3<=0)){if(e3<0||e3>=this._length)throw Error("start argument out of range");if(e3+s3<0)throw Error("Cannot shift elements in list beyond index 0");if(s3>0){for(let i4=t3-1;i4>=0;i4--)this.set(e3+i4+s3,this.get(e3+i4));let i3=e3+t3+s3-this._length;if(i3>0)for(this._length+=i3;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i3=0;i3<t3;i3++)this.set(e3+i3+s3,this.get(e3+i3))}}_getCyclicIndex(e3){return(this._startIndex+e3)%this._maxLength}}t2.CircularList=n2},7453:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.clone=function e3(t3,s2=5){if(typeof t3!="object")return t3;let i2=Array.isArray(t3)?[]:{};for(let r6 in t3)i2[r6]=s2<=1?t3[r6]:t3[r6]&&e3(t3[r6],s2-1);return i2}},5777:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.CoreTerminal=void 0;let i2=s2(6501),r6=s2(6025),n2=s2(7276),o=s2(9640),a=s2(56),h=s2(4071),c=s2(7792),l=s2(6415),u=s2(5746),d=s2(5882),f=s2(2486),_2=s2(3562),p=s2(8811),g=s2(802),v=s2(7150),m=!1;class b extends v.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new g.Emitter),this._onScroll.event((e3)=>{this._onScrollApi?.fire(e3.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(e3){for(let t3 in e3)this.optionsService.options[t3]=e3[t3]}constructor(e3){super(),this._windowsWrappingHeuristics=this._register(new v.MutableDisposable),this._onBinary=this._register(new g.Emitter),this.onBinary=this._onBinary.event,this._onData=this._register(new g.Emitter),this.onData=this._onData.event,this._onLineFeed=this._register(new g.Emitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new g.Emitter),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new g.Emitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new g.Emitter),this._instantiationService=new r6.InstantiationService,this.optionsService=this._register(new a.OptionsService(e3)),this._instantiationService.setService(i2.IOptionsService,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(o.BufferService)),this._instantiationService.setService(i2.IBufferService,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(n2.LogService)),this._instantiationService.setService(i2.ILogService,this._logService),this.coreService=this._register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(i2.ICoreService,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(i2.ICoreMouseService,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(i2.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(i2.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(i2.IOscLinkService,this._oscLinkService),this._inputHandler=this._register(new f.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(g.Event.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(g.Event.forward(this._bufferService.onResize,this._onResize)),this._register(g.Event.forward(this.coreService.onData,this._onData)),this._register(g.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 _2.WriteBuffer((e4,t3)=>this._inputHandler.parse(e4,t3))),this._register(g.Event.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(e3,t3){this._writeBuffer.write(e3,t3)}writeSync(e3,t3){this._logService.logLevel<=i2.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e3,t3)}input(e3,t3=!0){this.coreService.triggerDataEvent(e3,t3)}resize(e3,t3){isNaN(e3)||isNaN(t3)||(e3=Math.max(e3,o.MINIMUM_COLS),t3=Math.max(t3,o.MINIMUM_ROWS),this._bufferService.resize(e3,t3))}scroll(e3,t3=!1){this._bufferService.scroll(e3,t3)}scrollLines(e3,t3){this._bufferService.scrollLines(e3,t3)}scrollPages(e3){this.scrollLines(e3*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e3){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e3){let t3=e3-this._bufferService.buffer.ydisp;t3!==0&&this.scrollLines(t3)}registerEscHandler(e3,t3){return this._inputHandler.registerEscHandler(e3,t3)}registerDcsHandler(e3,t3){return this._inputHandler.registerDcsHandler(e3,t3)}registerCsiHandler(e3,t3){return this._inputHandler.registerCsiHandler(e3,t3)}registerOscHandler(e3,t3){return this._inputHandler.registerOscHandler(e3,t3)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e3=!1,t3=this.optionsService.rawOptions.windowsPty;t3&&t3.buildNumber!==void 0&&t3.buildNumber!==void 0?e3=t3.backend==="conpty"&&t3.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e3=!0),e3?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e3=[];e3.push(this.onLineFeed(d.updateWindowsModeWrappedState.bind(null,this._bufferService))),e3.push(this.registerCsiHandler({final:"H"},()=>((0,d.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,v.toDisposable)(()=>{for(let t3 of e3)t3.dispose()})}}}t2.CoreTerminal=b},2486:function(e2,t2,s2){var i2=this&&this.__decorate||function(e3,t3,s3,i3){var r7,n3=arguments.length,o2=n3<3?t3:i3===null?i3=Object.getOwnPropertyDescriptor(t3,s3):i3;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o2=Reflect.decorate(e3,t3,s3,i3);else for(var a2=e3.length-1;a2>=0;a2--)(r7=e3[a2])&&(o2=(n3<3?r7(o2):n3>3?r7(t3,s3,o2):r7(t3,s3))||o2);return n3>3&&o2&&Object.defineProperty(t3,s3,o2),o2},r6=this&&this.__param||function(e3,t3){return function(s3,i3){t3(s3,i3,e3)}};Object.defineProperty(t2,"__esModule",{value:!0}),t2.InputHandler=t2.WindowsOptionsReportType=void 0,t2.isValidColorIndex=k;let n2=s2(3534),o=s2(6760),a=s2(6717),h=s2(7150),c=s2(726),l=s2(6107),u=s2(8938),d=s2(3055),f=s2(5451),_2=s2(6501),p=s2(6415),g=s2(1346),v=s2(9823),m=s2(8693),b=s2(802),S={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=131072;function C2(e3,t3){if(e3>24)return t3.setWinLines||!1;switch(e3){case 1:return!!t3.restoreWin;case 2:return!!t3.minimizeWin;case 3:return!!t3.setWinPosition;case 4:return!!t3.setWinSizePixels;case 5:return!!t3.raiseWin;case 6:return!!t3.lowerWin;case 7:return!!t3.refreshWin;case 8:return!!t3.setWinSizeChars;case 9:return!!t3.maximizeWin;case 10:return!!t3.fullscreenWin;case 11:return!!t3.getWinState;case 13:return!!t3.getWinPosition;case 14:return!!t3.getWinSizePixels;case 15:return!!t3.getScreenSizePixels;case 16:return!!t3.getCellSizePixels;case 18:return!!t3.getWinSizeChars;case 19:return!!t3.getScreenSizeChars;case 20:return!!t3.getIconTitle;case 21:return!!t3.getWinTitle;case 22:return!!t3.pushTitle;case 23:return!!t3.popTitle;case 24:return!!t3.setWinLines}return!1}var w2;(function(e3){e3[e3.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e3[e3.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w2||(t2.WindowsOptionsReportType=w2={}));let E=0;class A2 extends h.Disposable{getAttrData(){return this._curAttrData}constructor(e3,t3,s3,i3,r7,h2,u2,d2,f2=new a.EscapeSequenceParser){super(),this._bufferService=e3,this._charsetService=t3,this._coreService=s3,this._logService=i3,this._optionsService=r7,this._oscLinkService=h2,this._coreMouseService=u2,this._unicodeService=d2,this._parser=f2,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this._register(new b.Emitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new b.Emitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new b.Emitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new b.Emitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new b.Emitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new b.Emitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new b.Emitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new b.Emitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new b.Emitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new b.Emitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new b.Emitter),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new b.Emitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new b.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 L(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate((e4)=>this._activeBuffer=e4.activeBuffer)),this._parser.setCsiHandlerFallback((e4,t4)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e4),params:t4.toArray()})}),this._parser.setEscHandlerFallback((e4)=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e4)})}),this._parser.setExecuteHandlerFallback((e4)=>{this._logService.debug("Unknown EXECUTE code: ",{code:e4})}),this._parser.setOscHandlerFallback((e4,t4,s4)=>{this._logService.debug("Unknown OSC code: ",{identifier:e4,action:t4,data:s4})}),this._parser.setDcsHandlerFallback((e4,t4,s4)=>{t4==="HOOK"&&(s4=s4.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e4),action:t4,payload:s4})}),this._parser.setPrintHandler((e4,t4,s4)=>this.print(e4,t4,s4)),this._parser.registerCsiHandler({final:"@"},(e4)=>this.insertChars(e4)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(e4)=>this.scrollLeft(e4)),this._parser.registerCsiHandler({final:"A"},(e4)=>this.cursorUp(e4)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(e4)=>this.scrollRight(e4)),this._parser.registerCsiHandler({final:"B"},(e4)=>this.cursorDown(e4)),this._parser.registerCsiHandler({final:"C"},(e4)=>this.cursorForward(e4)),this._parser.registerCsiHandler({final:"D"},(e4)=>this.cursorBackward(e4)),this._parser.registerCsiHandler({final:"E"},(e4)=>this.cursorNextLine(e4)),this._parser.registerCsiHandler({final:"F"},(e4)=>this.cursorPrecedingLine(e4)),this._parser.registerCsiHandler({final:"G"},(e4)=>this.cursorCharAbsolute(e4)),this._parser.registerCsiHandler({final:"H"},(e4)=>this.cursorPosition(e4)),this._parser.registerCsiHandler({final:"I"},(e4)=>this.cursorForwardTab(e4)),this._parser.registerCsiHandler({final:"J"},(e4)=>this.eraseInDisplay(e4,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},(e4)=>this.eraseInDisplay(e4,!0)),this._parser.registerCsiHandler({final:"K"},(e4)=>this.eraseInLine(e4,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},(e4)=>this.eraseInLine(e4,!0)),this._parser.registerCsiHandler({final:"L"},(e4)=>this.insertLines(e4)),this._parser.registerCsiHandler({final:"M"},(e4)=>this.deleteLines(e4)),this._parser.registerCsiHandler({final:"P"},(e4)=>this.deleteChars(e4)),this._parser.registerCsiHandler({final:"S"},(e4)=>this.scrollUp(e4)),this._parser.registerCsiHandler({final:"T"},(e4)=>this.scrollDown(e4)),this._parser.registerCsiHandler({final:"X"},(e4)=>this.eraseChars(e4)),this._parser.registerCsiHandler({final:"Z"},(e4)=>this.cursorBackwardTab(e4)),this._parser.registerCsiHandler({final:"`"},(e4)=>this.charPosAbsolute(e4)),this._parser.registerCsiHandler({final:"a"},(e4)=>this.hPositionRelative(e4)),this._parser.registerCsiHandler({final:"b"},(e4)=>this.repeatPrecedingCharacter(e4)),this._parser.registerCsiHandler({final:"c"},(e4)=>this.sendDeviceAttributesPrimary(e4)),this._parser.registerCsiHandler({prefix:">",final:"c"},(e4)=>this.sendDeviceAttributesSecondary(e4)),this._parser.registerCsiHandler({final:"d"},(e4)=>this.linePosAbsolute(e4)),this._parser.registerCsiHandler({final:"e"},(e4)=>this.vPositionRelative(e4)),this._parser.registerCsiHandler({final:"f"},(e4)=>this.hVPosition(e4)),this._parser.registerCsiHandler({final:"g"},(e4)=>this.tabClear(e4)),this._parser.registerCsiHandler({final:"h"},(e4)=>this.setMode(e4)),this._parser.registerCsiHandler({prefix:"?",final:"h"},(e4)=>this.setModePrivate(e4)),this._parser.registerCsiHandler({final:"l"},(e4)=>this.resetMode(e4)),this._parser.registerCsiHandler({prefix:"?",final:"l"},(e4)=>this.resetModePrivate(e4)),this._parser.registerCsiHandler({final:"m"},(e4)=>this.charAttributes(e4)),this._parser.registerCsiHandler({final:"n"},(e4)=>this.deviceStatus(e4)),this._parser.registerCsiHandler({prefix:"?",final:"n"},(e4)=>this.deviceStatusPrivate(e4)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(e4)=>this.softReset(e4)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(e4)=>this.setCursorStyle(e4)),this._parser.registerCsiHandler({final:"r"},(e4)=>this.setScrollRegion(e4)),this._parser.registerCsiHandler({final:"s"},(e4)=>this.saveCursor(e4)),this._parser.registerCsiHandler({final:"t"},(e4)=>this.windowOptions(e4)),this._parser.registerCsiHandler({final:"u"},(e4)=>this.restoreCursor(e4)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(e4)=>this.insertColumns(e4)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(e4)=>this.deleteColumns(e4)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(e4)=>this.selectProtected(e4)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(e4)=>this.requestMode(e4,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(e4)=>this.requestMode(e4,!1)),this._parser.setExecuteHandler(n2.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n2.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n2.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n2.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n2.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n2.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n2.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n2.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n2.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n2.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n2.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n2.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new g.OscHandler((e4)=>(this.setTitle(e4),this.setIconName(e4),!0))),this._parser.registerOscHandler(1,new g.OscHandler((e4)=>this.setIconName(e4))),this._parser.registerOscHandler(2,new g.OscHandler((e4)=>this.setTitle(e4))),this._parser.registerOscHandler(4,new g.OscHandler((e4)=>this.setOrReportIndexedColor(e4))),this._parser.registerOscHandler(8,new g.OscHandler((e4)=>this.setHyperlink(e4))),this._parser.registerOscHandler(10,new g.OscHandler((e4)=>this.setOrReportFgColor(e4))),this._parser.registerOscHandler(11,new g.OscHandler((e4)=>this.setOrReportBgColor(e4))),this._parser.registerOscHandler(12,new g.OscHandler((e4)=>this.setOrReportCursorColor(e4))),this._parser.registerOscHandler(104,new g.OscHandler((e4)=>this.restoreIndexedColor(e4))),this._parser.registerOscHandler(110,new g.OscHandler((e4)=>this.restoreFgColor(e4))),this._parser.registerOscHandler(111,new g.OscHandler((e4)=>this.restoreBgColor(e4))),this._parser.registerOscHandler(112,new g.OscHandler((e4)=>this.restoreCursorColor(e4))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let e4 in o.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e4},()=>this.selectCharset("("+e4)),this._parser.registerEscHandler({intermediates:")",final:e4},()=>this.selectCharset(")"+e4)),this._parser.registerEscHandler({intermediates:"*",final:e4},()=>this.selectCharset("*"+e4)),this._parser.registerEscHandler({intermediates:"+",final:e4},()=>this.selectCharset("+"+e4)),this._parser.registerEscHandler({intermediates:"-",final:e4},()=>this.selectCharset("-"+e4)),this._parser.registerEscHandler({intermediates:".",final:e4},()=>this.selectCharset("."+e4)),this._parser.registerEscHandler({intermediates:"/",final:e4},()=>this.selectCharset("/"+e4));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler((e4)=>(this._logService.error("Parsing error: ",e4),e4)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler((e4,t4)=>this.requestStatusString(e4,t4)))}_preserveStack(e3,t3,s3,i3){this._parseStack.paused=!0,this._parseStack.cursorStartX=e3,this._parseStack.cursorStartY=t3,this._parseStack.decodedLength=s3,this._parseStack.position=i3}_logSlowResolvingAsync(e3){this._logService.logLevel<=_2.LogLevelEnum.WARN&&Promise.race([e3,new Promise((e4,t3)=>setTimeout(()=>t3("#SLOW_TIMEOUT"),5000))]).catch((e4)=>{if(e4!=="#SLOW_TIMEOUT")throw e4;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e3,t3){let s3,i3=this._activeBuffer.x,r7=this._activeBuffer.y,n3=0,o2=this._parseStack.paused;if(o2){if(s3=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t3))return this._logSlowResolvingAsync(s3),s3;i3=this._parseStack.cursorStartX,r7=this._parseStack.cursorStartY,this._parseStack.paused=!1,e3.length>y&&(n3=this._parseStack.position+y)}if(this._logService.logLevel<=_2.LogLevelEnum.DEBUG&&this._logService.debug("parsing data "+(typeof e3=="string"?` "${e3}"`:` "${Array.prototype.map.call(e3,(e4)=>String.fromCharCode(e4)).join("")}"`)),this._logService.logLevel===_2.LogLevelEnum.TRACE&&this._logService.trace("parsing data (codes)",typeof e3=="string"?e3.split("").map((e4)=>e4.charCodeAt(0)):e3),this._parseBuffer.length<e3.length&&this._parseBuffer.length<y&&(this._parseBuffer=new Uint32Array(Math.min(e3.length,y))),o2||this._dirtyRowTracker.clearRange(),e3.length>y)for(let t4=n3;t4<e3.length;t4+=y){let n4=t4+y<e3.length?t4+y:e3.length,o3=typeof e3=="string"?this._stringDecoder.decode(e3.substring(t4,n4),this._parseBuffer):this._utf8Decoder.decode(e3.subarray(t4,n4),this._parseBuffer);if(s3=this._parser.parse(this._parseBuffer,o3))return this._preserveStack(i3,r7,o3,t4),this._logSlowResolvingAsync(s3),s3}else if(!o2){let t4=typeof e3=="string"?this._stringDecoder.decode(e3,this._parseBuffer):this._utf8Decoder.decode(e3,this._parseBuffer);if(s3=this._parser.parse(this._parseBuffer,t4))return this._preserveStack(i3,r7,t4,0),this._logSlowResolvingAsync(s3),s3}this._activeBuffer.x===i3&&this._activeBuffer.y===r7||this._onCursorMove.fire();let a2=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),h2=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h2<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h2,this._bufferService.rows-1),end:Math.min(a2,this._bufferService.rows-1)})}print(e3,t3,s3){let i3,r7,n3=this._charsetService.charset,o2=this._optionsService.rawOptions.screenReaderMode,a2=this._bufferService.cols,h2=this._coreService.decPrivateModes.wraparound,d2=this._coreService.modes.insertMode,f2=this._curAttrData,_3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&s3-t3>0&&_3.getWidth(this._activeBuffer.x-1)===2&&_3.setCellFromCodepoint(this._activeBuffer.x-1,0,1,f2);let g2=this._parser.precedingJoinState;for(let v2=t3;v2<s3;++v2){if(i3=e3[v2],i3<127&&n3){let e4=n3[String.fromCharCode(i3)];e4&&(i3=e4.charCodeAt(0))}let t4=this._unicodeService.charProperties(i3,g2);r7=p.UnicodeService.extractWidth(t4);let s4=p.UnicodeService.extractShouldJoin(t4),m2=s4?p.UnicodeService.extractWidth(g2):0;if(g2=t4,o2&&this._onA11yChar.fire((0,c.stringFromCodePoint)(i3)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r7-m2>a2){if(h2){let e4=_3,t5=this._activeBuffer.x-m2;for(this._activeBuffer.x=m2,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),_3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m2>0&&_3 instanceof l.BufferLine&&_3.copyCellsFrom(e4,t5,0,m2,!1);t5<a2;)e4.setCellFromCodepoint(t5++,0,1,f2)}else if(this._activeBuffer.x=a2-1,r7===2)continue}if(s4&&this._activeBuffer.x){let e4=_3.getWidth(this._activeBuffer.x-1)?1:2;_3.addCodepointToCell(this._activeBuffer.x-e4,i3,r7);for(let e5=r7-m2;--e5>=0;)_3.setCellFromCodepoint(this._activeBuffer.x++,0,0,f2)}else if(d2&&(_3.insertCells(this._activeBuffer.x,r7-m2,this._activeBuffer.getNullCell(f2)),_3.getWidth(a2-1)===2&&_3.setCellFromCodepoint(a2-1,u.NULL_CELL_CODE,u.NULL_CELL_WIDTH,f2)),_3.setCellFromCodepoint(this._activeBuffer.x++,i3,r7,f2),r7>0)for(;--r7;)_3.setCellFromCodepoint(this._activeBuffer.x++,0,0,f2)}this._parser.precedingJoinState=g2,this._activeBuffer.x<a2&&s3-t3>0&&_3.getWidth(this._activeBuffer.x)===0&&!_3.hasContent(this._activeBuffer.x)&&_3.setCellFromCodepoint(this._activeBuffer.x,0,1,f2),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e3,t3){return e3.final!=="t"||e3.prefix||e3.intermediates?this._parser.registerCsiHandler(e3,t3):this._parser.registerCsiHandler(e3,(e4)=>!C2(e4.params[0],this._optionsService.rawOptions.windowOptions)||t3(e4))}registerDcsHandler(e3,t3){return this._parser.registerDcsHandler(e3,new v.DcsHandler(t3))}registerEscHandler(e3,t3){return this._parser.registerEscHandler(e3,t3)}registerOscHandler(e3,t3){return this._parser.registerOscHandler(e3,new g.OscHandler(t3))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e3.hasWidth(this._activeBuffer.x)&&!e3.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e3=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e3),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e3=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e3,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(e3,t3){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e3,this._activeBuffer.y=this._activeBuffer.scrollTop+t3):(this._activeBuffer.x=e3,this._activeBuffer.y=t3),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e3,t3){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e3,this._activeBuffer.y+t3)}cursorUp(e3){let t3=this._activeBuffer.y-this._activeBuffer.scrollTop;return t3>=0?this._moveCursor(0,-Math.min(t3,e3.params[0]||1)):this._moveCursor(0,-(e3.params[0]||1)),!0}cursorDown(e3){let t3=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t3>=0?this._moveCursor(0,Math.min(t3,e3.params[0]||1)):this._moveCursor(0,e3.params[0]||1),!0}cursorForward(e3){return this._moveCursor(e3.params[0]||1,0),!0}cursorBackward(e3){return this._moveCursor(-(e3.params[0]||1),0),!0}cursorNextLine(e3){return this.cursorDown(e3),this._activeBuffer.x=0,!0}cursorPrecedingLine(e3){return this.cursorUp(e3),this._activeBuffer.x=0,!0}cursorCharAbsolute(e3){return this._setCursor((e3.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e3){return this._setCursor(e3.length>=2?(e3.params[1]||1)-1:0,(e3.params[0]||1)-1),!0}charPosAbsolute(e3){return this._setCursor((e3.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e3){return this._moveCursor(e3.params[0]||1,0),!0}linePosAbsolute(e3){return this._setCursor(this._activeBuffer.x,(e3.params[0]||1)-1),!0}vPositionRelative(e3){return this._moveCursor(0,e3.params[0]||1),!0}hVPosition(e3){return this.cursorPosition(e3),!0}tabClear(e3){let t3=e3.params[0];return t3===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t3===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e3){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t3=e3.params[0]||1;for(;t3--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e3){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t3=e3.params[0]||1;for(;t3--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e3){let t3=e3.params[0];return t3===1&&(this._curAttrData.bg|=536870912),t3!==2&&t3!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e3,t3,s3,i3=!1,r7=!1){let n3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e3);n3.replaceCells(t3,s3,this._activeBuffer.getNullCell(this._eraseAttrData()),r7),i3&&(n3.isWrapped=!1)}_resetBufferLine(e3,t3=!1){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e3);s3&&(s3.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t3),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e3),s3.isWrapped=!1)}eraseInDisplay(e3,t3=!1){let s3;switch(this._restrictCursor(this._bufferService.cols),e3.params[0]){case 0:for(s3=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s3),this._eraseInBufferLine(s3++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t3);s3<this._bufferService.rows;s3++)this._resetBufferLine(s3,t3);this._dirtyRowTracker.markDirty(s3);break;case 1:for(s3=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s3),this._eraseInBufferLine(s3,0,this._activeBuffer.x+1,!0,t3),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(s3+1).isWrapped=!1);s3--;)this._resetBufferLine(s3,t3);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(s3=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,s3-1);s3--;)if(this._activeBuffer.lines.get(this._activeBuffer.ybase+s3)?.getTrimmedLength())break;for(;s3>=0;s3--)this._bufferService.scroll(this._eraseAttrData())}else{for(s3=this._bufferService.rows,this._dirtyRowTracker.markDirty(s3-1);s3--;)this._resetBufferLine(s3,t3);this._dirtyRowTracker.markDirty(0)}break;case 3:let e4=this._activeBuffer.lines.length-this._bufferService.rows;e4>0&&(this._activeBuffer.lines.trimStart(e4),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e4,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e4,0),this._onScroll.fire(0))}return!0}eraseInLine(e3,t3=!1){switch(this._restrictCursor(this._bufferService.cols),e3.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t3);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t3);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t3)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e3){this._restrictCursor();let t3=e3.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s3=this._activeBuffer.ybase+this._activeBuffer.y,i3=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r7=this._bufferService.rows-1+this._activeBuffer.ybase-i3+1;for(;t3--;)this._activeBuffer.lines.splice(r7-1,1),this._activeBuffer.lines.splice(s3,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e3){this._restrictCursor();let t3=e3.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s3=this._activeBuffer.ybase+this._activeBuffer.y,i3;for(i3=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i3=this._bufferService.rows-1+this._activeBuffer.ybase-i3;t3--;)this._activeBuffer.lines.splice(s3,1),this._activeBuffer.lines.splice(i3,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e3){this._restrictCursor();let t3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t3&&(t3.insertCells(this._activeBuffer.x,e3.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e3){this._restrictCursor();let t3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t3&&(t3.deleteCells(this._activeBuffer.x,e3.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e3){let t3=e3.params[0]||1;for(;t3--;)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(e3){let t3=e3.params[0]||1;for(;t3--;)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(l.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e3){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t3=e3.params[0]||1;for(let e4=this._activeBuffer.scrollTop;e4<=this._activeBuffer.scrollBottom;++e4){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e4);s3.deleteCells(0,t3,this._activeBuffer.getNullCell(this._eraseAttrData())),s3.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e3){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t3=e3.params[0]||1;for(let e4=this._activeBuffer.scrollTop;e4<=this._activeBuffer.scrollBottom;++e4){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e4);s3.insertCells(0,t3,this._activeBuffer.getNullCell(this._eraseAttrData())),s3.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e3){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t3=e3.params[0]||1;for(let e4=this._activeBuffer.scrollTop;e4<=this._activeBuffer.scrollBottom;++e4){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e4);s3.insertCells(this._activeBuffer.x,t3,this._activeBuffer.getNullCell(this._eraseAttrData())),s3.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e3){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t3=e3.params[0]||1;for(let e4=this._activeBuffer.scrollTop;e4<=this._activeBuffer.scrollBottom;++e4){let s3=this._activeBuffer.lines.get(this._activeBuffer.ybase+e4);s3.deleteCells(this._activeBuffer.x,t3,this._activeBuffer.getNullCell(this._eraseAttrData())),s3.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e3){this._restrictCursor();let t3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t3&&(t3.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e3.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e3){let t3=this._parser.precedingJoinState;if(!t3)return!0;let s3=e3.params[0]||1,i3=p.UnicodeService.extractWidth(t3),r7=this._activeBuffer.x-i3,n3=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r7),o2=new Uint32Array(n3.length*s3),a2=0;for(let e4=0;e4<n3.length;){let t4=n3.codePointAt(e4)||0;o2[a2++]=t4,e4+=t4>65535?2:1}let h2=a2;for(let e4=1;e4<s3;++e4)o2.copyWithin(h2,0,a2),h2+=a2;return this.print(o2,0,h2),!0}sendDeviceAttributesPrimary(e3){return e3.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n2.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n2.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e3){return e3.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n2.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n2.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e3.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n2.C0.ESC+"[>83;40003;0c")),!0}_is(e3){return(this._optionsService.rawOptions.termName+"").indexOf(e3)===0}setMode(e3){for(let t3=0;t3<e3.length;t3++)switch(e3.params[t3]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e3){for(let t3=0;t3<e3.length;t3++)switch(e3.params[t3]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),this._charsetService.setgCharset(1,o.DEFAULT_CHARSET),this._charsetService.setgCharset(2,o.DEFAULT_CHARSET),this._charsetService.setgCharset(3,o.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 1000: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(e3){for(let t3=0;t3<e3.length;t3++)switch(e3.params[t3]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e3){for(let t3=0;t3<e3.length;t3++)switch(e3.params[t3]){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 1000: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(),e3.params[t3]===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(e3,t3){let s3=this._coreService.decPrivateModes,{activeProtocol:i3,activeEncoding:r7}=this._coreMouseService,o2=this._coreService,{buffers:a2,cols:h2}=this._bufferService,{active:c2,alt:l2}=a2,u2=this._optionsService.rawOptions,d2=(e4)=>e4?1:2,f2=e3.params[0];return _3=f2,p2=t3?f2===2?4:f2===4?d2(o2.modes.insertMode):f2===12?3:f2===20?d2(u2.convertEol):0:f2===1?d2(s3.applicationCursorKeys):f2===3?u2.windowOptions.setWinLines?h2===80?2:h2===132?1:0:0:f2===6?d2(s3.origin):f2===7?d2(s3.wraparound):f2===8?3:f2===9?d2(i3==="X10"):f2===12?d2(u2.cursorBlink):f2===25?d2(!o2.isCursorHidden):f2===45?d2(s3.reverseWraparound):f2===66?d2(s3.applicationKeypad):f2===67?4:f2===1000?d2(i3==="VT200"):f2===1002?d2(i3==="DRAG"):f2===1003?d2(i3==="ANY"):f2===1004?d2(s3.sendFocus):f2===1005?4:f2===1006?d2(r7==="SGR"):f2===1015?4:f2===1016?d2(r7==="SGR_PIXELS"):f2===1048?1:f2===47||f2===1047||f2===1049?d2(c2===l2):f2===2004?d2(s3.bracketedPasteMode):f2===2026?d2(s3.synchronizedOutput):0,o2.triggerDataEvent(`${n2.C0.ESC}[${t3?"":"?"}${_3};${p2}$y`),!0;var _3,p2}_updateAttrColor(e3,t3,s3,i3,r7){return t3===2?(e3|=50331648,e3&=-16777216,e3|=f.AttributeData.fromColorRGB([s3,i3,r7])):t3===5&&(e3&=-50331904,e3|=33554432|255&s3),e3}_extractColor(e3,t3,s3){let i3=[0,0,-1,0,0,0],r7=0,n3=0;do{if(i3[n3+r7]=e3.params[t3+n3],e3.hasSubParams(t3+n3)){let s4=e3.getSubParams(t3+n3),o2=0;do i3[1]===5&&(r7=1),i3[n3+o2+1+r7]=s4[o2];while(++o2<s4.length&&o2+n3+1+r7<i3.length);break}if(i3[1]===5&&n3+r7>=2||i3[1]===2&&n3+r7>=5)break;i3[1]&&(r7=1)}while(++n3+t3<e3.length&&n3+r7<i3.length);for(let e4=2;e4<i3.length;++e4)i3[e4]===-1&&(i3[e4]=0);switch(i3[0]){case 38:s3.fg=this._updateAttrColor(s3.fg,i3[1],i3[3],i3[4],i3[5]);break;case 48:s3.bg=this._updateAttrColor(s3.bg,i3[1],i3[3],i3[4],i3[5]);break;case 58:s3.extended=s3.extended.clone(),s3.extended.underlineColor=this._updateAttrColor(s3.extended.underlineColor,i3[1],i3[3],i3[4],i3[5])}return n3}_processUnderline(e3,t3){t3.extended=t3.extended.clone(),(!~e3||e3>5)&&(e3=1),t3.extended.underlineStyle=e3,t3.fg|=268435456,e3===0&&(t3.fg&=-268435457),t3.updateExtended()}_processSGR0(e3){e3.fg=l.DEFAULT_ATTR_DATA.fg,e3.bg=l.DEFAULT_ATTR_DATA.bg,e3.extended=e3.extended.clone(),e3.extended.underlineStyle=0,e3.extended.underlineColor&=-67108864,e3.updateExtended()}charAttributes(e3){if(e3.length===1&&e3.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t3=e3.length,s3,i3=this._curAttrData;for(let r7=0;r7<t3;r7++)s3=e3.params[r7],s3>=30&&s3<=37?(i3.fg&=-50331904,i3.fg|=16777216|s3-30):s3>=40&&s3<=47?(i3.bg&=-50331904,i3.bg|=16777216|s3-40):s3>=90&&s3<=97?(i3.fg&=-50331904,i3.fg|=16777224|s3-90):s3>=100&&s3<=107?(i3.bg&=-50331904,i3.bg|=16777224|s3-100):s3===0?this._processSGR0(i3):s3===1?i3.fg|=134217728:s3===3?i3.bg|=67108864:s3===4?(i3.fg|=268435456,this._processUnderline(e3.hasSubParams(r7)?e3.getSubParams(r7)[0]:1,i3)):s3===5?i3.fg|=536870912:s3===7?i3.fg|=67108864:s3===8?i3.fg|=1073741824:s3===9?i3.fg|=2147483648:s3===2?i3.bg|=134217728:s3===21?this._processUnderline(2,i3):s3===22?(i3.fg&=-134217729,i3.bg&=-134217729):s3===23?i3.bg&=-67108865:s3===24?(i3.fg&=-268435457,this._processUnderline(0,i3)):s3===25?i3.fg&=-536870913:s3===27?i3.fg&=-67108865:s3===28?i3.fg&=-1073741825:s3===29?i3.fg&=2147483647:s3===39?(i3.fg&=-67108864,i3.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):s3===49?(i3.bg&=-67108864,i3.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):s3===38||s3===48||s3===58?r7+=this._extractColor(e3,r7,i3):s3===53?i3.bg|=1073741824:s3===55?i3.bg&=-1073741825:s3===59?(i3.extended=i3.extended.clone(),i3.extended.underlineColor=-1,i3.updateExtended()):s3===100?(i3.fg&=-67108864,i3.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,i3.bg&=-67108864,i3.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",s3);return!0}deviceStatus(e3){switch(e3.params[0]){case 5:this._coreService.triggerDataEvent(`${n2.C0.ESC}[0n`);break;case 6:let e4=this._activeBuffer.y+1,t3=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n2.C0.ESC}[${e4};${t3}R`)}return!0}deviceStatusPrivate(e3){if(e3.params[0]===6){let e4=this._activeBuffer.y+1,t3=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n2.C0.ESC}[?${e4};${t3}R`)}return!0}softReset(e3){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.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(e3){let t3=e3.length===0?1:e3.params[0];if(t3===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t3){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"}let e4=t3%2==1;this._coreService.decPrivateModes.cursorBlink=e4}return!0}setScrollRegion(e3){let t3=e3.params[0]||1,s3;return(e3.length<2||(s3=e3.params[1])>this._bufferService.rows||s3===0)&&(s3=this._bufferService.rows),s3>t3&&(this._activeBuffer.scrollTop=t3-1,this._activeBuffer.scrollBottom=s3-1,this._setCursor(0,0)),!0}windowOptions(e3){if(!C2(e3.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t3=e3.length>1?e3.params[1]:0;switch(e3.params[0]){case 14:t3!==2&&this._onRequestWindowsOptionsReport.fire(w2.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w2.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n2.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:t3!==0&&t3!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),t3!==0&&t3!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:t3!==0&&t3!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),t3!==0&&t3!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e3){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(e3){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(e3){return this._windowTitle=e3,this._onTitleChange.fire(e3),!0}setIconName(e3){return this._iconName=e3,!0}setOrReportIndexedColor(e3){let t3=[],s3=e3.split(";");for(;s3.length>1;){let e4=s3.shift(),i3=s3.shift();if(/^\d+$/.exec(e4)){let s4=parseInt(e4);if(k(s4))if(i3==="?")t3.push({type:0,index:s4});else{let e5=(0,m.parseColor)(i3);e5&&t3.push({type:1,index:s4,color:e5})}}}return t3.length&&this._onColor.fire(t3),!0}setHyperlink(e3){let t3=e3.indexOf(";");if(t3===-1)return!0;let s3=e3.slice(0,t3).trim(),i3=e3.slice(t3+1);return i3?this._createHyperlink(s3,i3):!s3.trim()&&this._finishHyperlink()}_createHyperlink(e3,t3){this._getCurrentLinkId()&&this._finishHyperlink();let s3=e3.split(":"),i3,r7=s3.findIndex((e4)=>e4.startsWith("id="));return r7!==-1&&(i3=s3[r7].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i3,uri:t3}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e3,t3){let s3=e3.split(";");for(let e4=0;e4<s3.length&&!(t3>=this._specialColors.length);++e4,++t3)if(s3[e4]==="?")this._onColor.fire([{type:0,index:this._specialColors[t3]}]);else{let i3=(0,m.parseColor)(s3[e4]);i3&&this._onColor.fire([{type:1,index:this._specialColors[t3],color:i3}])}return!0}setOrReportFgColor(e3){return this._setOrReportSpecialColor(e3,0)}setOrReportBgColor(e3){return this._setOrReportSpecialColor(e3,1)}setOrReportCursorColor(e3){return this._setOrReportSpecialColor(e3,2)}restoreIndexedColor(e3){if(!e3)return this._onColor.fire([{type:2}]),!0;let t3=[],s3=e3.split(";");for(let e4=0;e4<s3.length;++e4)if(/^\d+$/.exec(s3[e4])){let i3=parseInt(s3[e4]);k(i3)&&t3.push({type:2,index:i3})}return t3.length&&this._onColor.fire(t3),!0}restoreFgColor(e3){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e3){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e3){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,o.DEFAULT_CHARSET),!0}selectCharset(e3){return e3.length!==2?(this.selectDefaultCharset(),!0):(e3[0]==="/"||this._charsetService.setgCharset(S[e3[0]],o.CHARSETS[e3[1]]||o.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e3=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e3,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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e3){return this._charsetService.setgLevel(e3),!0}screenAlignmentPattern(){let e3=new d.CellData;e3.content=4194373,e3.fg=this._curAttrData.fg,e3.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t3=0;t3<this._bufferService.rows;++t3){let s3=this._activeBuffer.ybase+this._activeBuffer.y+t3,i3=this._activeBuffer.lines.get(s3);i3&&(i3.fill(e3),i3.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e3,t3){let s3=this._bufferService.buffer,i3=this._optionsService.rawOptions;return((e4)=>(this._coreService.triggerDataEvent(`${n2.C0.ESC}${e4}${n2.C0.ESC}\\`),!0))(e3==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e3==='"p'?'P1$r61;1"p':e3==="r"?`P1$r${s3.scrollTop+1};${s3.scrollBottom+1}r`:e3==="m"?"P1$r0m":e3===" q"?`P1$r${{block:2,underline:4,bar:6}[i3.cursorStyle]-(i3.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e3,t3){this._dirtyRowTracker.markRangeDirty(e3,t3)}}t2.InputHandler=A2;let L=class{constructor(e3){this._bufferService=e3,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e3){e3<this.start?this.start=e3:e3>this.end&&(this.end=e3)}markRangeDirty(e3,t3){e3>t3&&(E=e3,e3=t3,t3=E),e3<this.start&&(this.start=e3),t3>this.end&&(this.end=t3)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function k(e3){return 0<=e3&&e3<256}L=i2([r6(0,_2.IBufferService)],L)},701:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.isChromeOS=t2.isLinux=t2.isWindows=t2.isIphone=t2.isIpad=t2.isMac=t2.isSafari=t2.isLegacyEdge=t2.isFirefox=t2.isNode=void 0,t2.getSafariVersion=function(){if(!t2.isSafari)return 0;let e3=s2.match(/Version\/(\d+)/);return e3===null||e3.length<2?0:parseInt(e3[1])},t2.isNode=typeof process<"u"&&"title"in process;let s2=t2.isNode?"node":navigator.userAgent,i2=t2.isNode?"node":navigator.platform;t2.isFirefox=s2.includes("Firefox"),t2.isLegacyEdge=s2.includes("Edge"),t2.isSafari=/^((?!chrome|android).)*safari/i.test(s2),t2.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(i2),t2.isIpad=i2==="iPad",t2.isIphone=i2==="iPhone",t2.isWindows=["Windows","Win16","Win32","WinCE"].includes(i2),t2.isLinux=i2.indexOf("Linux")>=0,t2.isChromeOS=/\bCrOS\b/.test(s2)},6168:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.DebouncedIdleTask=t2.IdleTaskQueue=t2.PriorityTaskQueue=void 0;let i2=s2(701);class r6{constructor(){this._tasks=[],this._i=0}enqueue(e3){this._tasks.push(e3),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(e3){this._idleCallback=void 0;let t3=0,s3=0,i3=e3.timeRemaining(),r7=0;for(;this._i<this._tasks.length;){if(t3=performance.now(),this._tasks[this._i]()||this._i++,t3=Math.max(1,performance.now()-t3),s3=Math.max(t3,s3),r7=e3.timeRemaining(),1.5*s3>r7)return i3-t3<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i3-t3))}ms`),void this._start();i3=r7}this.clear()}}class n2 extends r6{_requestCallback(e3){return setTimeout(()=>e3(this._createDeadline(16)))}_cancelCallback(e3){clearTimeout(e3)}_createDeadline(e3){let t3=performance.now()+e3;return{timeRemaining:()=>Math.max(0,t3-performance.now())}}}t2.PriorityTaskQueue=n2,t2.IdleTaskQueue=!i2.isNode&&"requestIdleCallback"in window?class extends r6{_requestCallback(e3){return requestIdleCallback(e3)}_cancelCallback(e3){cancelIdleCallback(e3)}}:n2,t2.DebouncedIdleTask=class{constructor(){this._queue=new t2.IdleTaskQueue}set(e3){this._queue.clear(),this._queue.enqueue(e3)}flush(){this._queue.flush()}}},5882:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.updateWindowsModeWrappedState=function(e3){let t3=e3.buffer.lines.get(e3.buffer.ybase+e3.buffer.y-1),s3=t3?.get(e3.cols-1),r6=e3.buffer.lines.get(e3.buffer.ybase+e3.buffer.y);r6&&s3&&(r6.isWrapped=s3[i2.CHAR_DATA_CODE_INDEX]!==i2.NULL_CELL_CODE&&s3[i2.CHAR_DATA_CODE_INDEX]!==i2.WHITESPACE_CELL_CODE)};let i2=s2(8938)},5451:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.ExtendedAttrs=t2.AttributeData=void 0;class s2{constructor(){this.fg=0,this.bg=0,this.extended=new i2}static toColorRGB(e3){return[e3>>>16&255,e3>>>8&255,255&e3]}static fromColorRGB(e3){return(255&e3[0])<<16|(255&e3[1])<<8|255&e3[2]}clone(){let e3=new s2;return e3.fg=this.fg,e3.bg=this.bg,e3.extended=this.extended.clone(),e3}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}}t2.AttributeData=s2;class i2{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e3){this._ext=e3}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e3){this._ext&=-469762049,this._ext|=e3<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e3){this._ext&=-67108864,this._ext|=67108863&e3}get urlId(){return this._urlId}set urlId(e3){this._urlId=e3}get underlineVariantOffset(){let e3=(3758096384&this._ext)>>29;return e3<0?4294967288^e3:e3}set underlineVariantOffset(e3){this._ext&=536870911,this._ext|=e3<<29&3758096384}constructor(e3=0,t3=0){this._ext=0,this._urlId=0,this._ext=e3,this._urlId=t3}clone(){return new i2(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t2.ExtendedAttrs=i2},1073:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.Buffer=t2.MAX_BUFFER_SIZE=void 0;let i2=s2(5639),r6=s2(6168),n2=s2(5451),o=s2(6107),a=s2(732),h=s2(3055),c=s2(8938),l=s2(8158),u=s2(6760);t2.MAX_BUFFER_SIZE=4294967295,t2.Buffer=class{constructor(e3,t3,s3){this._hasScrollback=e3,this._optionsService=t3,this._bufferService=s3,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=h.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]),this._whitespaceCell=h.CellData.fromCharData([0,c.WHITESPACE_CELL_CHAR,c.WHITESPACE_CELL_WIDTH,c.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new r6.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new i2.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e3){return e3?(this._nullCell.fg=e3.fg,this._nullCell.bg=e3.bg,this._nullCell.extended=e3.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n2.ExtendedAttrs),this._nullCell}getWhitespaceCell(e3){return e3?(this._whitespaceCell.fg=e3.fg,this._whitespaceCell.bg=e3.bg,this._whitespaceCell.extended=e3.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n2.ExtendedAttrs),this._whitespaceCell}getBlankLine(e3,t3){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e3),t3)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e3=this.ybase+this.y-this.ydisp;return e3>=0&&e3<this._rows}_getCorrectBufferLength(e3){if(!this._hasScrollback)return e3;let s3=e3+this._optionsService.rawOptions.scrollback;return s3>t2.MAX_BUFFER_SIZE?t2.MAX_BUFFER_SIZE:s3}fillViewportRows(e3){if(this.lines.length===0){e3===void 0&&(e3=o.DEFAULT_ATTR_DATA);let t3=this._rows;for(;t3--;)this.lines.push(this.getBlankLine(e3))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new i2.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e3,t3){let s3=this.getNullCell(o.DEFAULT_ATTR_DATA),i3=0,r7=this._getCorrectBufferLength(t3);if(r7>this.lines.maxLength&&(this.lines.maxLength=r7),this.lines.length>0){if(this._cols<e3)for(let t4=0;t4<this.lines.length;t4++)i3+=+this.lines.get(t4).resize(e3,s3);let n3=0;if(this._rows<t3)for(let i4=this._rows;i4<t3;i4++)this.lines.length<t3+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new o.BufferLine(e3,s3)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n3+1?(this.ybase--,n3++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e3,s3)));else for(let e4=this._rows;e4>t3;e4--)this.lines.length>t3+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r7<this.lines.maxLength){let e4=this.lines.length-r7;e4>0&&(this.lines.trimStart(e4),this.ybase=Math.max(this.ybase-e4,0),this.ydisp=Math.max(this.ydisp-e4,0),this.savedY=Math.max(this.savedY-e4,0)),this.lines.maxLength=r7}this.x=Math.min(this.x,e3-1),this.y=Math.min(this.y,t3-1),n3&&(this.y+=n3),this.savedX=Math.min(this.savedX,e3-1),this.scrollTop=0}if(this.scrollBottom=t3-1,this._isReflowEnabled&&(this._reflow(e3,t3),this._cols>e3))for(let t4=0;t4<this.lines.length;t4++)i3+=+this.lines.get(t4).resize(e3,s3);this._cols=e3,this._rows=t3,this._memoryCleanupQueue.clear(),i3>0.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e3=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e3=!1);let t3=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t3+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t3>100)return!0;return e3}get _isReflowEnabled(){let e3=this._optionsService.rawOptions.windowsPty;return e3&&e3.buildNumber?this._hasScrollback&&e3.backend==="conpty"&&e3.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e3,t3){this._cols!==e3&&(e3>this._cols?this._reflowLarger(e3,t3):this._reflowSmaller(e3,t3))}_reflowLarger(e3,t3){let s3=this._optionsService.rawOptions.reflowCursorLine,i3=(0,a.reflowLargerGetLinesToRemove)(this.lines,this._cols,e3,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA),s3);if(i3.length>0){let s4=(0,a.reflowLargerCreateNewLayout)(this.lines,i3);(0,a.reflowLargerApplyNewLayout)(this.lines,s4.layout),this._reflowLargerAdjustViewport(e3,t3,s4.countRemoved)}}_reflowLargerAdjustViewport(e3,t3,s3){let i3=this.getNullCell(o.DEFAULT_ATTR_DATA),r7=s3;for(;r7-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t3&&this.lines.push(new o.BufferLine(e3,i3))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s3,0)}_reflowSmaller(e3,t3){let s3=this._optionsService.rawOptions.reflowCursorLine,i3=this.getNullCell(o.DEFAULT_ATTR_DATA),r7=[],n3=0;for(let h2=this.lines.length-1;h2>=0;h2--){let c2=this.lines.get(h2);if(!c2||!c2.isWrapped&&c2.getTrimmedLength()<=e3)continue;let l2=[c2];for(;c2.isWrapped&&h2>0;)c2=this.lines.get(--h2),l2.unshift(c2);if(!s3){let e4=this.ybase+this.y;if(e4>=h2&&e4<h2+l2.length)continue}let u2=l2[l2.length-1].getTrimmedLength(),d=(0,a.reflowSmallerGetNewLineLengths)(l2,this._cols,e3),f=d.length-l2.length,_2;_2=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+f):Math.max(0,this.lines.length-this.lines.maxLength+f);let p=[];for(let e4=0;e4<f;e4++){let e5=this.getBlankLine(o.DEFAULT_ATTR_DATA,!0);p.push(e5)}p.length>0&&(r7.push({start:h2+l2.length+n3,newLines:p}),n3+=p.length),l2.push(...p);let g=d.length-1,v=d[g];v===0&&(g--,v=d[g]);let m=l2.length-f-1,b=u2;for(;m>=0;){let e4=Math.min(b,v);if(l2[g]===void 0)break;if(l2[g].copyCellsFrom(l2[m],b-e4,v-e4,e4,!0),v-=e4,v===0&&(g--,v=d[g]),b-=e4,b===0){m--;let e5=Math.max(m,0);b=(0,a.getWrappedLineTrimmedLength)(l2,e5,this._cols)}}for(let t4=0;t4<l2.length;t4++)d[t4]<e3&&l2[t4].setCell(d[t4],i3);let S=f-_2;for(;S-- >0;)this.ybase===0?this.y<t3-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n3)-t3&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+f,this.ybase+t3-1)}if(r7.length>0){let e4=[],t4=[];for(let e5=0;e5<this.lines.length;e5++)t4.push(this.lines.get(e5));let s4=this.lines.length,i4=s4-1,o2=0,a2=r7[o2];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n3);let h2=0;for(let c3=Math.min(this.lines.maxLength-1,s4+n3-1);c3>=0;c3--)if(a2&&a2.start>i4+h2){for(let e5=a2.newLines.length-1;e5>=0;e5--)this.lines.set(c3--,a2.newLines[e5]);c3++,e4.push({index:i4+1,amount:a2.newLines.length}),h2+=a2.newLines.length,a2=r7[++o2]}else this.lines.set(c3,t4[i4--]);let c2=0;for(let t5=e4.length-1;t5>=0;t5--)e4[t5].index+=c2,this.lines.onInsertEmitter.fire(e4[t5]),c2+=e4[t5].amount;let l2=Math.max(0,s4+n3-this.lines.maxLength);l2>0&&this.lines.onTrimEmitter.fire(l2)}}translateBufferLineToString(e3,t3,s3=0,i3){let r7=this.lines.get(e3);return r7?r7.translateToString(t3,s3,i3):""}getWrappedRangeForLine(e3){let t3=e3,s3=e3;for(;t3>0&&this.lines.get(t3).isWrapped;)t3--;for(;s3+1<this.lines.length&&this.lines.get(s3+1).isWrapped;)s3++;return{first:t3,last:s3}}setupTabStops(e3){for(e3!=null?this.tabs[e3]||(e3=this.prevStop(e3)):(this.tabs={},e3=0);e3<this._cols;e3+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e3]=!0}prevStop(e3){for(e3==null&&(e3=this.x);!this.tabs[--e3]&&e3>0;);return e3>=this._cols?this._cols-1:e3<0?0:e3}nextStop(e3){for(e3==null&&(e3=this.x);!this.tabs[++e3]&&e3<this._cols;);return e3>=this._cols?this._cols-1:e3<0?0:e3}clearMarkers(e3){this._isClearing=!0;for(let t3=0;t3<this.markers.length;t3++)this.markers[t3].line===e3&&(this.markers[t3].dispose(),this.markers.splice(t3--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e3=0;e3<this.markers.length;e3++)this.markers[e3].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e3){let t3=new l.Marker(e3);return this.markers.push(t3),t3.register(this.lines.onTrim((e4)=>{t3.line-=e4,t3.line<0&&t3.dispose()})),t3.register(this.lines.onInsert((e4)=>{t3.line>=e4.index&&(t3.line+=e4.amount)})),t3.register(this.lines.onDelete((e4)=>{t3.line>=e4.index&&t3.line<e4.index+e4.amount&&t3.dispose(),t3.line>e4.index&&(t3.line-=e4.amount)})),t3.register(t3.onDispose(()=>this._removeMarker(t3))),t3}_removeMarker(e3){this._isClearing||this.markers.splice(this.markers.indexOf(e3),1)}}},6107:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.BufferLine=t2.DEFAULT_ATTR_DATA=void 0;let i2=s2(5451),r6=s2(3055),n2=s2(8938),o=s2(726);t2.DEFAULT_ATTR_DATA=Object.freeze(new i2.AttributeData);let a=0;class h{constructor(e3,t3,s3=!1){this.isWrapped=s3,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e3);let i3=t3||r6.CellData.fromCharData([0,n2.NULL_CELL_CHAR,n2.NULL_CELL_WIDTH,n2.NULL_CELL_CODE]);for(let t4=0;t4<e3;++t4)this.setCell(t4,i3);this.length=e3}get(e3){let t3=this._data[3*e3+0],s3=2097151&t3;return[this._data[3*e3+1],2097152&t3?this._combined[e3]:s3?(0,o.stringFromCodePoint)(s3):"",t3>>22,2097152&t3?this._combined[e3].charCodeAt(this._combined[e3].length-1):s3]}set(e3,t3){this._data[3*e3+1]=t3[n2.CHAR_DATA_ATTR_INDEX],t3[n2.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e3]=t3[1],this._data[3*e3+0]=2097152|e3|t3[n2.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e3+0]=t3[n2.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t3[n2.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e3){return this._data[3*e3+0]>>22}hasWidth(e3){return 12582912&this._data[3*e3+0]}getFg(e3){return this._data[3*e3+1]}getBg(e3){return this._data[3*e3+2]}hasContent(e3){return 4194303&this._data[3*e3+0]}getCodePoint(e3){let t3=this._data[3*e3+0];return 2097152&t3?this._combined[e3].charCodeAt(this._combined[e3].length-1):2097151&t3}isCombined(e3){return 2097152&this._data[3*e3+0]}getString(e3){let t3=this._data[3*e3+0];return 2097152&t3?this._combined[e3]:2097151&t3?(0,o.stringFromCodePoint)(2097151&t3):""}isProtected(e3){return 536870912&this._data[3*e3+2]}loadCell(e3,t3){return a=3*e3,t3.content=this._data[a+0],t3.fg=this._data[a+1],t3.bg=this._data[a+2],2097152&t3.content&&(t3.combinedData=this._combined[e3]),268435456&t3.bg&&(t3.extended=this._extendedAttrs[e3]),t3}setCell(e3,t3){2097152&t3.content&&(this._combined[e3]=t3.combinedData),268435456&t3.bg&&(this._extendedAttrs[e3]=t3.extended),this._data[3*e3+0]=t3.content,this._data[3*e3+1]=t3.fg,this._data[3*e3+2]=t3.bg}setCellFromCodepoint(e3,t3,s3,i3){268435456&i3.bg&&(this._extendedAttrs[e3]=i3.extended),this._data[3*e3+0]=t3|s3<<22,this._data[3*e3+1]=i3.fg,this._data[3*e3+2]=i3.bg}addCodepointToCell(e3,t3,s3){let i3=this._data[3*e3+0];2097152&i3?this._combined[e3]+=(0,o.stringFromCodePoint)(t3):2097151&i3?(this._combined[e3]=(0,o.stringFromCodePoint)(2097151&i3)+(0,o.stringFromCodePoint)(t3),i3&=-2097152,i3|=2097152):i3=t3|4194304,s3&&(i3&=-12582913,i3|=s3<<22),this._data[3*e3+0]=i3}insertCells(e3,t3,s3){if((e3%=this.length)&&this.getWidth(e3-1)===2&&this.setCellFromCodepoint(e3-1,0,1,s3),t3<this.length-e3){let i3=new r6.CellData;for(let s4=this.length-e3-t3-1;s4>=0;--s4)this.setCell(e3+t3+s4,this.loadCell(e3+s4,i3));for(let i4=0;i4<t3;++i4)this.setCell(e3+i4,s3)}else for(let t4=e3;t4<this.length;++t4)this.setCell(t4,s3);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s3)}deleteCells(e3,t3,s3){if(e3%=this.length,t3<this.length-e3){let i3=new r6.CellData;for(let s4=0;s4<this.length-e3-t3;++s4)this.setCell(e3+s4,this.loadCell(e3+t3+s4,i3));for(let e4=this.length-t3;e4<this.length;++e4)this.setCell(e4,s3)}else for(let t4=e3;t4<this.length;++t4)this.setCell(t4,s3);e3&&this.getWidth(e3-1)===2&&this.setCellFromCodepoint(e3-1,0,1,s3),this.getWidth(e3)!==0||this.hasContent(e3)||this.setCellFromCodepoint(e3,0,1,s3)}replaceCells(e3,t3,s3,i3=!1){if(i3)for(e3&&this.getWidth(e3-1)===2&&!this.isProtected(e3-1)&&this.setCellFromCodepoint(e3-1,0,1,s3),t3<this.length&&this.getWidth(t3-1)===2&&!this.isProtected(t3)&&this.setCellFromCodepoint(t3,0,1,s3);e3<t3&&e3<this.length;)this.isProtected(e3)||this.setCell(e3,s3),e3++;else for(e3&&this.getWidth(e3-1)===2&&this.setCellFromCodepoint(e3-1,0,1,s3),t3<this.length&&this.getWidth(t3-1)===2&&this.setCellFromCodepoint(t3,0,1,s3);e3<t3&&e3<this.length;)this.setCell(e3++,s3)}resize(e3,t3){if(e3===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let s3=3*e3;if(e3>this.length){if(this._data.buffer.byteLength>=4*s3)this._data=new Uint32Array(this._data.buffer,0,s3);else{let e4=new Uint32Array(s3);e4.set(this._data),this._data=e4}for(let s4=this.length;s4<e3;++s4)this.setCell(s4,t3)}else{this._data=this._data.subarray(0,s3);let t4=Object.keys(this._combined);for(let s4=0;s4<t4.length;s4++){let i4=parseInt(t4[s4],10);i4>=e3&&delete this._combined[i4]}let i3=Object.keys(this._extendedAttrs);for(let t5=0;t5<i3.length;t5++){let s4=parseInt(i3[t5],10);s4>=e3&&delete this._extendedAttrs[s4]}}return this.length=e3,4*s3*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e3=new Uint32Array(this._data.length);return e3.set(this._data),this._data=e3,1}return 0}fill(e3,t3=!1){if(t3)for(let t4=0;t4<this.length;++t4)this.isProtected(t4)||this.setCell(t4,e3);else{this._combined={},this._extendedAttrs={};for(let t4=0;t4<this.length;++t4)this.setCell(t4,e3)}}copyFrom(e3){this.length!==e3.length?this._data=new Uint32Array(e3._data):this._data.set(e3._data),this.length=e3.length,this._combined={};for(let t3 in e3._combined)this._combined[t3]=e3._combined[t3];this._extendedAttrs={};for(let t3 in e3._extendedAttrs)this._extendedAttrs[t3]=e3._extendedAttrs[t3];this.isWrapped=e3.isWrapped}clone(){let e3=new h(0);e3._data=new Uint32Array(this._data),e3.length=this.length;for(let t3 in this._combined)e3._combined[t3]=this._combined[t3];for(let t3 in this._extendedAttrs)e3._extendedAttrs[t3]=this._extendedAttrs[t3];return e3.isWrapped=this.isWrapped,e3}getTrimmedLength(){for(let e3=this.length-1;e3>=0;--e3)if(4194303&this._data[3*e3+0])return e3+(this._data[3*e3+0]>>22);return 0}getNoBgTrimmedLength(){for(let e3=this.length-1;e3>=0;--e3)if(4194303&this._data[3*e3+0]||50331648&this._data[3*e3+2])return e3+(this._data[3*e3+0]>>22);return 0}copyCellsFrom(e3,t3,s3,i3,r7){let n3=e3._data;if(r7)for(let r8=i3-1;r8>=0;r8--){for(let e4=0;e4<3;e4++)this._data[3*(s3+r8)+e4]=n3[3*(t3+r8)+e4];268435456&n3[3*(t3+r8)+2]&&(this._extendedAttrs[s3+r8]=e3._extendedAttrs[t3+r8])}else for(let r8=0;r8<i3;r8++){for(let e4=0;e4<3;e4++)this._data[3*(s3+r8)+e4]=n3[3*(t3+r8)+e4];268435456&n3[3*(t3+r8)+2]&&(this._extendedAttrs[s3+r8]=e3._extendedAttrs[t3+r8])}let o2=Object.keys(e3._combined);for(let i4=0;i4<o2.length;i4++){let r8=parseInt(o2[i4],10);r8>=t3&&(this._combined[r8-t3+s3]=e3._combined[r8])}}translateToString(e3,t3,s3,i3){t3=t3??0,s3=s3??this.length,e3&&(s3=Math.min(s3,this.getTrimmedLength())),i3&&(i3.length=0);let r7="";for(;t3<s3;){let e4=this._data[3*t3+0],s4=2097151&e4,a2=2097152&e4?this._combined[t3]:s4?(0,o.stringFromCodePoint)(s4):n2.WHITESPACE_CELL_CHAR;if(r7+=a2,i3)for(let e5=0;e5<a2.length;++e5)i3.push(t3);t3+=e4>>22||1}return i3&&i3.push(t3),r7}}t2.BufferLine=h},732:(e2,t2)=>{function s2(e3,t3,s3){if(t3===e3.length-1)return e3[t3].getTrimmedLength();let i2=!e3[t3].hasContent(s3-1)&&e3[t3].getWidth(s3-1)===1,r6=e3[t3+1].getWidth(0)===2;return i2&&r6?s3-1:s3}Object.defineProperty(t2,"__esModule",{value:!0}),t2.reflowLargerGetLinesToRemove=function(e3,t3,i2,r6,n2,o){let a=[];for(let h=0;h<e3.length-1;h++){let c=h,l=e3.get(++c);if(!l.isWrapped)continue;let u=[e3.get(h)];for(;c<e3.length&&l.isWrapped;)u.push(l),l=e3.get(++c);if(!o&&r6>=h&&r6<c){h+=u.length-1;continue}let d=0,f=s2(u,d,t3),_2=1,p=0;for(;_2<u.length;){let e4=s2(u,_2,t3),r7=e4-p,o2=i2-f,a2=Math.min(r7,o2);u[d].copyCellsFrom(u[_2],p,f,a2,!1),f+=a2,f===i2&&(d++,f=0),p+=a2,p===e4&&(_2++,p=0),f===0&&d!==0&&u[d-1].getWidth(i2-1)===2&&(u[d].copyCellsFrom(u[d-1],i2-1,f++,1,!1),u[d-1].setCell(i2-1,n2))}u[d].replaceCells(f,i2,n2);let g=0;for(let e4=u.length-1;e4>0&&(e4>d||u[e4].getTrimmedLength()===0);e4--)g++;g>0&&(a.push(h+u.length-g),a.push(g)),h+=u.length-1}return a},t2.reflowLargerCreateNewLayout=function(e3,t3){let s3=[],i2=0,r6=t3[i2],n2=0;for(let o=0;o<e3.length;o++)if(r6===o){let s4=t3[++i2];e3.onDeleteEmitter.fire({index:o-n2,amount:s4}),o+=s4-1,n2+=s4,r6=t3[++i2]}else s3.push(o);return{layout:s3,countRemoved:n2}},t2.reflowLargerApplyNewLayout=function(e3,t3){let s3=[];for(let i2=0;i2<t3.length;i2++)s3.push(e3.get(t3[i2]));for(let t4=0;t4<s3.length;t4++)e3.set(t4,s3[t4]);e3.length=t3.length},t2.reflowSmallerGetNewLineLengths=function(e3,t3,i2){let r6=[],n2=e3.map((i3,r7)=>s2(e3,r7,t3)).reduce((e4,t4)=>e4+t4),o=0,a=0,h=0;for(;h<n2;){if(n2-h<i2){r6.push(n2-h);break}o+=i2;let c=s2(e3,a,t3);o>c&&(o-=c,a++);let l=e3[a].getWidth(o-1)===2;l&&o--;let u=l?i2-1:i2;r6.push(u),h+=u}return r6},t2.getWrappedLineTrimmedLength=s2},4097:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.BufferSet=void 0;let i2=s2(7150),r6=s2(1073),n2=s2(802);class o extends i2.Disposable{constructor(e3,t3){super(),this._optionsService=e3,this._bufferService=t3,this._onBufferActivate=this._register(new n2.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 r6.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r6.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(e3){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e3),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(e3,t3){this._normal.resize(e3,t3),this._alt.resize(e3,t3),this.setupTabStops(e3)}setupTabStops(e3){this._normal.setupTabStops(e3),this._alt.setupTabStops(e3)}}t2.BufferSet=o},3055:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.CellData=void 0;let i2=s2(726),r6=s2(8938),n2=s2(5451);class o extends n2.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n2.ExtendedAttrs,this.combinedData=""}static fromCharData(e3){let t3=new o;return t3.setFromCharData(e3),t3}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,i2.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e3){this.fg=e3[r6.CHAR_DATA_ATTR_INDEX],this.bg=0;let t3=!1;if(e3[r6.CHAR_DATA_CHAR_INDEX].length>2)t3=!0;else if(e3[r6.CHAR_DATA_CHAR_INDEX].length===2){let s3=e3[r6.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=s3&&s3<=56319){let i3=e3[r6.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i3&&i3<=57343?this.content=1024*(s3-55296)+i3-56320+65536|e3[r6.CHAR_DATA_WIDTH_INDEX]<<22:t3=!0}else t3=!0}else this.content=e3[r6.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e3[r6.CHAR_DATA_WIDTH_INDEX]<<22;t3&&(this.combinedData=e3[r6.CHAR_DATA_CHAR_INDEX],this.content=2097152|e3[r6.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t2.CellData=o},8938:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.WHITESPACE_CELL_CODE=t2.WHITESPACE_CELL_WIDTH=t2.WHITESPACE_CELL_CHAR=t2.NULL_CELL_CODE=t2.NULL_CELL_WIDTH=t2.NULL_CELL_CHAR=t2.CHAR_DATA_CODE_INDEX=t2.CHAR_DATA_WIDTH_INDEX=t2.CHAR_DATA_CHAR_INDEX=t2.CHAR_DATA_ATTR_INDEX=t2.DEFAULT_EXT=t2.DEFAULT_ATTR=t2.DEFAULT_COLOR=void 0,t2.DEFAULT_COLOR=0,t2.DEFAULT_ATTR=t2.DEFAULT_COLOR<<9|256,t2.DEFAULT_EXT=0,t2.CHAR_DATA_ATTR_INDEX=0,t2.CHAR_DATA_CHAR_INDEX=1,t2.CHAR_DATA_WIDTH_INDEX=2,t2.CHAR_DATA_CODE_INDEX=3,t2.NULL_CELL_CHAR="",t2.NULL_CELL_WIDTH=1,t2.NULL_CELL_CODE=0,t2.WHITESPACE_CELL_CHAR=" ",t2.WHITESPACE_CELL_WIDTH=1,t2.WHITESPACE_CELL_CODE=32},8158:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.Marker=void 0;let i2=s2(802),r6=s2(7150);class n2{get id(){return this._id}constructor(e3){this.line=e3,this.isDisposed=!1,this._disposables=[],this._id=n2._nextId++,this._onDispose=this.register(new i2.Emitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,r6.dispose)(this._disposables),this._disposables.length=0)}register(e3){return this._disposables.push(e3),e3}}t2.Marker=n2,n2._nextId=1},6760:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.DEFAULT_CHARSET=t2.CHARSETS=void 0,t2.CHARSETS={},t2.DEFAULT_CHARSET=t2.CHARSETS.B,t2.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"},t2.CHARSETS.A={"#":"\xA3"},t2.CHARSETS.B=void 0,t2.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},t2.CHARSETS.C=t2.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},t2.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},t2.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},t2.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},t2.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},t2.CHARSETS.E=t2.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},t2.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},t2.CHARSETS.H=t2.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},t2.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},3534:(e2,t2)=>{var s2,i2,r6;Object.defineProperty(t2,"__esModule",{value:!0}),t2.C1_ESCAPED=t2.C1=t2.C0=void 0,function(e3){e3.NUL="\x00",e3.SOH="\x01",e3.STX="\x02",e3.ETX="\x03",e3.EOT="\x04",e3.ENQ="\x05",e3.ACK="\x06",e3.BEL="\x07",e3.BS="\b",e3.HT="\t",e3.LF=`
3
3
  `,e3.VT="\v",e3.FF="\f",e3.CR="\r",e3.SO="\x0E",e3.SI="\x0F",e3.DLE="\x10",e3.DC1="\x11",e3.DC2="\x12",e3.DC3="\x13",e3.DC4="\x14",e3.NAK="\x15",e3.SYN="\x16",e3.ETB="\x17",e3.CAN="\x18",e3.EM="\x19",e3.SUB="\x1A",e3.ESC="\x1B",e3.FS="\x1C",e3.GS="\x1D",e3.RS="\x1E",e3.US="\x1F",e3.SP=" ",e3.DEL="\x7F"}(s2||(t2.C0=s2={})),function(e3){e3.PAD="\x80",e3.HOP="\x81",e3.BPH="\x82",e3.NBH="\x83",e3.IND="\x84",e3.NEL="\x85",e3.SSA="\x86",e3.ESA="\x87",e3.HTS="\x88",e3.HTJ="\x89",e3.VTS="\x8A",e3.PLD="\x8B",e3.PLU="\x8C",e3.RI="\x8D",e3.SS2="\x8E",e3.SS3="\x8F",e3.DCS="\x90",e3.PU1="\x91",e3.PU2="\x92",e3.STS="\x93",e3.CCH="\x94",e3.MW="\x95",e3.SPA="\x96",e3.EPA="\x97",e3.SOS="\x98",e3.SGCI="\x99",e3.SCI="\x9A",e3.CSI="\x9B",e3.ST="\x9C",e3.OSC="\x9D",e3.PM="\x9E",e3.APC="\x9F"}(i2||(t2.C1=i2={})),function(e3){e3.ST=`${s2.ESC}\\`}(r6||(t2.C1_ESCAPED=r6={}))},726:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.Utf8ToUtf32=t2.StringToUtf32=void 0,t2.stringFromCodePoint=function(e3){return e3>65535?(e3-=65536,String.fromCharCode(55296+(e3>>10))+String.fromCharCode(e3%1024+56320)):String.fromCharCode(e3)},t2.utf32ToString=function(e3,t3=0,s2=e3.length){let i2="";for(let r6=t3;r6<s2;++r6){let t4=e3[r6];t4>65535?(t4-=65536,i2+=String.fromCharCode(55296+(t4>>10))+String.fromCharCode(t4%1024+56320)):i2+=String.fromCharCode(t4)}return i2},t2.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e3,t3){let s2=e3.length;if(!s2)return 0;let i2=0,r6=0;if(this._interim){let s3=e3.charCodeAt(r6++);56320<=s3&&s3<=57343?t3[i2++]=1024*(this._interim-55296)+s3-56320+65536:(t3[i2++]=this._interim,t3[i2++]=s3),this._interim=0}for(let n2=r6;n2<s2;++n2){let r7=e3.charCodeAt(n2);if(55296<=r7&&r7<=56319){if(++n2>=s2)return this._interim=r7,i2;let o=e3.charCodeAt(n2);56320<=o&&o<=57343?t3[i2++]=1024*(r7-55296)+o-56320+65536:(t3[i2++]=r7,t3[i2++]=o)}else r7!==65279&&(t3[i2++]=r7)}return i2}},t2.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e3,t3){let s2=e3.length;if(!s2)return 0;let i2,r6,n2,o,a=0,h=0,c=0;if(this.interim[0]){let i3=!1,r7=this.interim[0];r7&=(224&r7)==192?31:(240&r7)==224?15:7;let n3,o2=0;for(;(n3=63&this.interim[++o2])&&o2<4;)r7<<=6,r7|=n3;let h2=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,l2=h2-o2;for(;c<l2;){if(c>=s2)return 0;if(n3=e3[c++],(192&n3)!=128){c--,i3=!0;break}this.interim[o2++]=n3,r7<<=6,r7|=63&n3}i3||(h2===2?r7<128?c--:t3[a++]=r7:h2===3?r7<2048||r7>=55296&&r7<=57343||r7===65279||(t3[a++]=r7):r7<65536||r7>1114111||(t3[a++]=r7)),this.interim.fill(0)}let l=s2-4,u=c;for(;u<s2;){for(;!(!(u<l)||128&(i2=e3[u])||128&(r6=e3[u+1])||128&(n2=e3[u+2])||128&(o=e3[u+3]));)t3[a++]=i2,t3[a++]=r6,t3[a++]=n2,t3[a++]=o,u+=4;if(i2=e3[u++],i2<128)t3[a++]=i2;else if((224&i2)==192){if(u>=s2)return this.interim[0]=i2,a;if(r6=e3[u++],(192&r6)!=128){u--;continue}if(h=(31&i2)<<6|63&r6,h<128){u--;continue}t3[a++]=h}else if((240&i2)==224){if(u>=s2)return this.interim[0]=i2,a;if(r6=e3[u++],(192&r6)!=128){u--;continue}if(u>=s2)return this.interim[0]=i2,this.interim[1]=r6,a;if(n2=e3[u++],(192&n2)!=128){u--;continue}if(h=(15&i2)<<12|(63&r6)<<6|63&n2,h<2048||h>=55296&&h<=57343||h===65279)continue;t3[a++]=h}else if((248&i2)==240){if(u>=s2)return this.interim[0]=i2,a;if(r6=e3[u++],(192&r6)!=128){u--;continue}if(u>=s2)return this.interim[0]=i2,this.interim[1]=r6,a;if(n2=e3[u++],(192&n2)!=128){u--;continue}if(u>=s2)return this.interim[0]=i2,this.interim[1]=r6,this.interim[2]=n2,a;if(o=e3[u++],(192&o)!=128){u--;continue}if(h=(7&i2)<<18|(63&r6)<<12|(63&n2)<<6|63&o,h<65536||h>1114111)continue;t3[a++]=h}}return a}}},7428:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.UnicodeV6=void 0;let i2=s2(6415),r6=[[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]],n2=[[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]],o;t2.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),o.fill(1),o[0]=0,o.fill(0,1,32),o.fill(0,127,160),o.fill(2,4352,4448),o[9001]=2,o[9002]=2,o.fill(2,11904,42192),o[12351]=1,o.fill(2,44032,55204),o.fill(2,63744,64256),o.fill(2,65040,65050),o.fill(2,65072,65136),o.fill(2,65280,65377),o.fill(2,65504,65511);for(let e3=0;e3<r6.length;++e3)o.fill(0,r6[e3][0],r6[e3][1]+1)}}wcwidth(e3){return e3<32?0:e3<127?1:e3<65536?o[e3]:function(e4,t3){let s3,i3=0,r7=t3.length-1;if(e4<t3[0][0]||e4>t3[r7][1])return!1;for(;r7>=i3;)if(s3=i3+r7>>1,e4>t3[s3][1])i3=s3+1;else{if(!(e4<t3[s3][0]))return!0;r7=s3-1}return!1}(e3,n2)?0:e3>=131072&&e3<=196605||e3>=196608&&e3<=262141?2:1}charProperties(e3,t3){let s3=this.wcwidth(e3),r7=s3===0&&t3!==0;if(r7){let e4=i2.UnicodeService.extractWidth(t3);e4===0?r7=!1:e4>s3&&(s3=e4)}return i2.UnicodeService.createPropertyValue(0,s3,r7)}}},3562:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.WriteBuffer=void 0;let i2=s2(7150),r6=s2(802);class n2 extends i2.Disposable{constructor(e3){super(),this._action=e3,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new r6.Emitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e3,t3){if(t3!==void 0&&this._syncCalls>t3)return void(this._syncCalls=0);if(this._pendingData+=e3.length,this._writeBuffer.push(e3),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let s3;for(this._isSyncWriting=!0;s3=this._writeBuffer.shift();){this._action(s3);let e4=this._callbacks.shift();e4&&e4()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e3,t3){if(this._pendingData>50000000)throw 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+=e3.length,this._writeBuffer.push(e3),this._callbacks.push(t3),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=e3.length,this._writeBuffer.push(e3),this._callbacks.push(t3)}_innerWrite(e3=0,t3=!0){let s3=e3||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e4=this._writeBuffer[this._bufferOffset],i3=this._action(e4,t3);if(i3){let e5=(e6)=>performance.now()-s3>=12?setTimeout(()=>this._innerWrite(0,e6)):this._innerWrite(s3,e6);return void i3.catch((e6)=>(queueMicrotask(()=>{throw e6}),Promise.resolve(!1))).then(e5)}let r7=this._callbacks[this._bufferOffset];if(r7&&r7(),this._bufferOffset++,this._pendingData-=e4.length,performance.now()-s3>=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()}}t2.WriteBuffer=n2},8693:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.parseColor=function(e3){if(!e3)return;let t3=e3.toLowerCase();if(t3.indexOf("rgb:")===0){t3=t3.slice(4);let e4=s2.exec(t3);if(e4){let t4=e4[1]?15:e4[4]?255:e4[7]?4095:65535;return[Math.round(parseInt(e4[1]||e4[4]||e4[7]||e4[10],16)/t4*255),Math.round(parseInt(e4[2]||e4[5]||e4[8]||e4[11],16)/t4*255),Math.round(parseInt(e4[3]||e4[6]||e4[9]||e4[12],16)/t4*255)]}}else if(t3.indexOf("#")===0&&(t3=t3.slice(1),i2.exec(t3)&&[3,6,9,12].includes(t3.length))){let e4=t3.length/3,s3=[0,0,0];for(let i3=0;i3<3;++i3){let r7=parseInt(t3.slice(e4*i3,e4*i3+e4),16);s3[i3]=e4===1?r7<<4:e4===2?r7:e4===3?r7>>4:r7>>8}return s3}},t2.toRgbString=function(e3,t3=16){let[s3,i3,n2]=e3;return`rgb:${r6(s3,t3)}/${r6(i3,t3)}/${r6(n2,t3)}`};let s2=/^([\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})$/,i2=/^[\da-f]+$/;function r6(e3,t3){let s3=e3.toString(16),i3=s3.length<2?"0"+s3:s3;switch(t3){case 4:return s3[0];case 8:return i3;case 12:return(i3+i3).slice(0,3);default:return i3+i3}}},1263:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.PAYLOAD_LIMIT=void 0,t2.PAYLOAD_LIMIT=1e7},9823:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.DcsHandler=t2.DcsParser=void 0;let i2=s2(726),r6=s2(7262),n2=s2(1263),o=[];t2.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e3,t3){this._handlers[e3]===void 0&&(this._handlers[e3]=[]);let s3=this._handlers[e3];return s3.push(t3),{dispose:()=>{let e4=s3.indexOf(t3);e4!==-1&&s3.splice(e4,1)}}}clearHandler(e3){this._handlers[e3]&&delete this._handlers[e3]}setHandlerFallback(e3){this._handlerFb=e3}reset(){if(this._active.length)for(let e3=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e3>=0;--e3)this._active[e3].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e3,t3){if(this.reset(),this._ident=e3,this._active=this._handlers[e3]||o,this._active.length)for(let e4=this._active.length-1;e4>=0;e4--)this._active[e4].hook(t3);else this._handlerFb(this._ident,"HOOK",t3)}put(e3,t3,s3){if(this._active.length)for(let i3=this._active.length-1;i3>=0;i3--)this._active[i3].put(e3,t3,s3);else this._handlerFb(this._ident,"PUT",(0,i2.utf32ToString)(e3,t3,s3))}unhook(e3,t3=!0){if(this._active.length){let s3=!1,i3=this._active.length-1,r7=!1;if(this._stack.paused&&(i3=this._stack.loopPosition-1,s3=t3,r7=this._stack.fallThrough,this._stack.paused=!1),!r7&&s3===!1){for(;i3>=0&&(s3=this._active[i3].unhook(e3),s3!==!0);i3--)if(s3 instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i3,this._stack.fallThrough=!1,s3;i3--}for(;i3>=0;i3--)if(s3=this._active[i3].unhook(!1),s3 instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i3,this._stack.fallThrough=!0,s3}else this._handlerFb(this._ident,"UNHOOK",e3);this._active=o,this._ident=0}};let a=new r6.Params;a.addParam(0),t2.DcsHandler=class{constructor(e3){this._handler=e3,this._data="",this._params=a,this._hitLimit=!1}hook(e3){this._params=e3.length>1||e3.params[0]?e3.clone():a,this._data="",this._hitLimit=!1}put(e3,t3,s3){this._hitLimit||(this._data+=(0,i2.utf32ToString)(e3,t3,s3),this._data.length>n2.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(e3){let t3=!1;if(this._hitLimit)t3=!1;else if(e3&&(t3=this._handler(this._data,this._params),t3 instanceof Promise))return t3.then((e4)=>(this._params=a,this._data="",this._hitLimit=!1,e4));return this._params=a,this._data="",this._hitLimit=!1,t3}}},6717:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.EscapeSequenceParser=t2.VT500_TRANSITION_TABLE=t2.TransitionTable=void 0;let i2=s2(7150),r6=s2(7262),n2=s2(1346),o=s2(9823);class a{constructor(e3){this.table=new Uint8Array(e3)}setDefault(e3,t3){this.table.fill(e3<<4|t3)}add(e3,t3,s3,i3){this.table[t3<<8|e3]=s3<<4|i3}addMany(e3,t3,s3,i3){for(let r7=0;r7<e3.length;r7++)this.table[t3<<8|e3[r7]]=s3<<4|i3}}t2.TransitionTable=a;let h=160;t2.VT500_TRANSITION_TABLE=function(){let e3=new a(4095),t3=Array.apply(null,Array(256)).map((e4,t4)=>t4),s3=(e4,s4)=>t3.slice(e4,s4),i3=s3(32,127),r7=s3(0,24);r7.push(25),r7.push.apply(r7,s3(28,32));let n3=s3(0,14),o2;for(o2 in e3.setDefault(1,0),e3.addMany(i3,0,2,0),n3)e3.addMany([24,26,153,154],o2,3,0),e3.addMany(s3(128,144),o2,3,0),e3.addMany(s3(144,152),o2,3,0),e3.add(156,o2,0,0),e3.add(27,o2,11,1),e3.add(157,o2,4,8),e3.addMany([152,158,159],o2,0,7),e3.add(155,o2,11,3),e3.add(144,o2,11,9);return e3.addMany(r7,0,3,0),e3.addMany(r7,1,3,1),e3.add(127,1,0,1),e3.addMany(r7,8,0,8),e3.addMany(r7,3,3,3),e3.add(127,3,0,3),e3.addMany(r7,4,3,4),e3.add(127,4,0,4),e3.addMany(r7,6,3,6),e3.addMany(r7,5,3,5),e3.add(127,5,0,5),e3.addMany(r7,2,3,2),e3.add(127,2,0,2),e3.add(93,1,4,8),e3.addMany(i3,8,5,8),e3.add(127,8,5,8),e3.addMany([156,27,24,26,7],8,6,0),e3.addMany(s3(28,32),8,0,8),e3.addMany([88,94,95],1,0,7),e3.addMany(i3,7,0,7),e3.addMany(r7,7,0,7),e3.add(156,7,0,0),e3.add(127,7,0,7),e3.add(91,1,11,3),e3.addMany(s3(64,127),3,7,0),e3.addMany(s3(48,60),3,8,4),e3.addMany([60,61,62,63],3,9,4),e3.addMany(s3(48,60),4,8,4),e3.addMany(s3(64,127),4,7,0),e3.addMany([60,61,62,63],4,0,6),e3.addMany(s3(32,64),6,0,6),e3.add(127,6,0,6),e3.addMany(s3(64,127),6,0,0),e3.addMany(s3(32,48),3,9,5),e3.addMany(s3(32,48),5,9,5),e3.addMany(s3(48,64),5,0,6),e3.addMany(s3(64,127),5,7,0),e3.addMany(s3(32,48),4,9,5),e3.addMany(s3(32,48),1,9,2),e3.addMany(s3(32,48),2,9,2),e3.addMany(s3(48,127),2,10,0),e3.addMany(s3(48,80),1,10,0),e3.addMany(s3(81,88),1,10,0),e3.addMany([89,90,92],1,10,0),e3.addMany(s3(96,127),1,10,0),e3.add(80,1,11,9),e3.addMany(r7,9,0,9),e3.add(127,9,0,9),e3.addMany(s3(28,32),9,0,9),e3.addMany(s3(32,48),9,9,12),e3.addMany(s3(48,60),9,8,10),e3.addMany([60,61,62,63],9,9,10),e3.addMany(r7,11,0,11),e3.addMany(s3(32,128),11,0,11),e3.addMany(s3(28,32),11,0,11),e3.addMany(r7,10,0,10),e3.add(127,10,0,10),e3.addMany(s3(28,32),10,0,10),e3.addMany(s3(48,60),10,8,10),e3.addMany([60,61,62,63],10,0,11),e3.addMany(s3(32,48),10,9,12),e3.addMany(r7,12,0,12),e3.add(127,12,0,12),e3.addMany(s3(28,32),12,0,12),e3.addMany(s3(32,48),12,9,12),e3.addMany(s3(48,64),12,0,11),e3.addMany(s3(64,127),12,12,13),e3.addMany(s3(64,127),10,12,13),e3.addMany(s3(64,127),9,12,13),e3.addMany(r7,13,13,13),e3.addMany(i3,13,13,13),e3.add(127,13,0,13),e3.addMany([27,156,24,26],13,14,0),e3.add(h,0,2,0),e3.add(h,8,5,8),e3.add(h,6,0,6),e3.add(h,11,0,11),e3.add(h,13,13,13),e3}();class c extends i2.Disposable{constructor(e3=t2.VT500_TRANSITION_TABLE){super(),this._transitions=e3,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new r6.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e4,t3,s3)=>{},this._executeHandlerFb=(e4)=>{},this._csiHandlerFb=(e4,t3)=>{},this._escHandlerFb=(e4)=>{},this._errorHandlerFb=(e4)=>e4,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register((0,i2.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new n2.OscParser),this._dcsParser=this._register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e3,t3=[64,126]){let s3=0;if(e3.prefix){if(e3.prefix.length>1)throw Error("only one byte as prefix supported");if(s3=e3.prefix.charCodeAt(0),s3&&60>s3||s3>63)throw Error("prefix must be in range 0x3c .. 0x3f")}if(e3.intermediates){if(e3.intermediates.length>2)throw Error("only two bytes as intermediates are supported");for(let t4=0;t4<e3.intermediates.length;++t4){let i4=e3.intermediates.charCodeAt(t4);if(32>i4||i4>47)throw Error("intermediate must be in range 0x20 .. 0x2f");s3<<=8,s3|=i4}}if(e3.final.length!==1)throw Error("final must be a single byte");let i3=e3.final.charCodeAt(0);if(t3[0]>i3||i3>t3[1])throw Error(`final must be in range ${t3[0]} .. ${t3[1]}`);return s3<<=8,s3|=i3,s3}identToString(e3){let t3=[];for(;e3;)t3.push(String.fromCharCode(255&e3)),e3>>=8;return t3.reverse().join("")}setPrintHandler(e3){this._printHandler=e3}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e3,t3){let s3=this._identifier(e3,[48,126]);this._escHandlers[s3]===void 0&&(this._escHandlers[s3]=[]);let i3=this._escHandlers[s3];return i3.push(t3),{dispose:()=>{let e4=i3.indexOf(t3);e4!==-1&&i3.splice(e4,1)}}}clearEscHandler(e3){this._escHandlers[this._identifier(e3,[48,126])]&&delete this._escHandlers[this._identifier(e3,[48,126])]}setEscHandlerFallback(e3){this._escHandlerFb=e3}setExecuteHandler(e3,t3){this._executeHandlers[e3.charCodeAt(0)]=t3}clearExecuteHandler(e3){this._executeHandlers[e3.charCodeAt(0)]&&delete this._executeHandlers[e3.charCodeAt(0)]}setExecuteHandlerFallback(e3){this._executeHandlerFb=e3}registerCsiHandler(e3,t3){let s3=this._identifier(e3);this._csiHandlers[s3]===void 0&&(this._csiHandlers[s3]=[]);let i3=this._csiHandlers[s3];return i3.push(t3),{dispose:()=>{let e4=i3.indexOf(t3);e4!==-1&&i3.splice(e4,1)}}}clearCsiHandler(e3){this._csiHandlers[this._identifier(e3)]&&delete this._csiHandlers[this._identifier(e3)]}setCsiHandlerFallback(e3){this._csiHandlerFb=e3}registerDcsHandler(e3,t3){return this._dcsParser.registerHandler(this._identifier(e3),t3)}clearDcsHandler(e3){this._dcsParser.clearHandler(this._identifier(e3))}setDcsHandlerFallback(e3){this._dcsParser.setHandlerFallback(e3)}registerOscHandler(e3,t3){return this._oscParser.registerHandler(e3,t3)}clearOscHandler(e3){this._oscParser.clearHandler(e3)}setOscHandlerFallback(e3){this._oscParser.setHandlerFallback(e3)}setErrorHandler(e3){this._errorHandler=e3}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(e3,t3,s3,i3,r7){this._parseStack.state=e3,this._parseStack.handlers=t3,this._parseStack.handlerPos=s3,this._parseStack.transition=i3,this._parseStack.chunkPos=r7}parse(e3,t3,s3){let i3,r7=0,n3=0,o2=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o2=this._parseStack.chunkPos+1;else{if(s3===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error("improper continuation due to previous async handler, giving up parsing");let t4=this._parseStack.handlers,n4=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s3===!1&&n4>-1){for(;n4>=0&&(i3=t4[n4](this._params),i3!==!0);n4--)if(i3 instanceof Promise)return this._parseStack.handlerPos=n4,i3}this._parseStack.handlers=[];break;case 4:if(s3===!1&&n4>-1){for(;n4>=0&&(i3=t4[n4](),i3!==!0);n4--)if(i3 instanceof Promise)return this._parseStack.handlerPos=n4,i3}this._parseStack.handlers=[];break;case 6:if(r7=e3[this._parseStack.chunkPos],i3=this._dcsParser.unhook(r7!==24&&r7!==26,s3),i3)return i3;r7===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r7=e3[this._parseStack.chunkPos],i3=this._oscParser.end(r7!==24&&r7!==26,s3),i3)return i3;r7===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o2=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let s4=o2;s4<t3;++s4){switch(r7=e3[s4],n3=this._transitions.table[this.currentState<<8|(r7<160?r7:h)],n3>>4){case 2:for(let i4=s4+1;;++i4){if(i4>=t3||(r7=e3[i4])<32||r7>126&&r7<h){this._printHandler(e3,s4,i4),s4=i4-1;break}if(++i4>=t3||(r7=e3[i4])<32||r7>126&&r7<h){this._printHandler(e3,s4,i4),s4=i4-1;break}if(++i4>=t3||(r7=e3[i4])<32||r7>126&&r7<h){this._printHandler(e3,s4,i4),s4=i4-1;break}if(++i4>=t3||(r7=e3[i4])<32||r7>126&&r7<h){this._printHandler(e3,s4,i4),s4=i4-1;break}}break;case 3:this._executeHandlers[r7]?this._executeHandlers[r7]():this._executeHandlerFb(r7),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:s4,code:r7,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o3=this._csiHandlers[this._collect<<8|r7],a2=o3?o3.length-1:-1;for(;a2>=0&&(i3=o3[a2](this._params),i3!==!0);a2--)if(i3 instanceof Promise)return this._preserveStack(3,o3,a2,n3,s4),i3;a2<0&&this._csiHandlerFb(this._collect<<8|r7,this._params),this.precedingJoinState=0;break;case 8:do switch(r7){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r7-48)}while(++s4<t3&&(r7=e3[s4])>47&&r7<60);s4--;break;case 9:this._collect<<=8,this._collect|=r7;break;case 10:let c2=this._escHandlers[this._collect<<8|r7],l=c2?c2.length-1:-1;for(;l>=0&&(i3=c2[l](),i3!==!0);l--)if(i3 instanceof Promise)return this._preserveStack(4,c2,l,n3,s4),i3;l<0&&this._escHandlerFb(this._collect<<8|r7),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|r7,this._params);break;case 13:for(let i4=s4+1;;++i4)if(i4>=t3||(r7=e3[i4])===24||r7===26||r7===27||r7>127&&r7<h){this._dcsParser.put(e3,s4,i4),s4=i4-1;break}break;case 14:if(i3=this._dcsParser.unhook(r7!==24&&r7!==26),i3)return this._preserveStack(6,[],0,n3,s4),i3;r7===27&&(n3|=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 i4=s4+1;;i4++)if(i4>=t3||(r7=e3[i4])<32||r7>127&&r7<h){this._oscParser.put(e3,s4,i4),s4=i4-1;break}break;case 6:if(i3=this._oscParser.end(r7!==24&&r7!==26),i3)return this._preserveStack(5,[],0,n3,s4),i3;r7===27&&(n3|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&n3}}}t2.EscapeSequenceParser=c},1346:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.OscHandler=t2.OscParser=void 0;let i2=s2(1263),r6=s2(726),n2=[];t2.OscParser=class{constructor(){this._state=0,this._active=n2,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e3,t3){this._handlers[e3]===void 0&&(this._handlers[e3]=[]);let s3=this._handlers[e3];return s3.push(t3),{dispose:()=>{let e4=s3.indexOf(t3);e4!==-1&&s3.splice(e4,1)}}}clearHandler(e3){this._handlers[e3]&&delete this._handlers[e3]}setHandlerFallback(e3){this._handlerFb=e3}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n2}reset(){if(this._state===2)for(let e3=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e3>=0;--e3)this._active[e3].end(!1);this._stack.paused=!1,this._active=n2,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n2,this._active.length)for(let e3=this._active.length-1;e3>=0;e3--)this._active[e3].start();else this._handlerFb(this._id,"START")}_put(e3,t3,s3){if(this._active.length)for(let i3=this._active.length-1;i3>=0;i3--)this._active[i3].put(e3,t3,s3);else this._handlerFb(this._id,"PUT",(0,r6.utf32ToString)(e3,t3,s3))}start(){this.reset(),this._state=1}put(e3,t3,s3){if(this._state!==3){if(this._state===1)for(;t3<s3;){let s4=e3[t3++];if(s4===59){this._state=2,this._start();break}if(s4<48||57<s4)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+s4-48}this._state===2&&s3-t3>0&&this._put(e3,t3,s3)}}end(e3,t3=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let s3=!1,i3=this._active.length-1,r7=!1;if(this._stack.paused&&(i3=this._stack.loopPosition-1,s3=t3,r7=this._stack.fallThrough,this._stack.paused=!1),!r7&&s3===!1){for(;i3>=0&&(s3=this._active[i3].end(e3),s3!==!0);i3--)if(s3 instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i3,this._stack.fallThrough=!1,s3;i3--}for(;i3>=0;i3--)if(s3=this._active[i3].end(!1),s3 instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i3,this._stack.fallThrough=!0,s3}else this._handlerFb(this._id,"END",e3);this._active=n2,this._id=-1,this._state=0}}},t2.OscHandler=class{constructor(e3){this._handler=e3,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e3,t3,s3){this._hitLimit||(this._data+=(0,r6.utf32ToString)(e3,t3,s3),this._data.length>i2.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(e3){let t3=!1;if(this._hitLimit)t3=!1;else if(e3&&(t3=this._handler(this._data),t3 instanceof Promise))return t3.then((e4)=>(this._data="",this._hitLimit=!1,e4));return this._data="",this._hitLimit=!1,t3}}},7262:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.Params=void 0;let s2=2147483647;class i2{static fromArray(e3){let t3=new i2;if(!e3.length)return t3;for(let s3=Array.isArray(e3[0])?1:0;s3<e3.length;++s3){let i3=e3[s3];if(Array.isArray(i3))for(let e4=0;e4<i3.length;++e4)t3.addSubParam(i3[e4]);else t3.addParam(i3)}return t3}constructor(e3=32,t3=32){if(this.maxLength=e3,this.maxSubParamsLength=t3,t3>256)throw Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e3),this.length=0,this._subParams=new Int32Array(t3),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e3),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let e3=new i2(this.maxLength,this.maxSubParamsLength);return e3.params.set(this.params),e3.length=this.length,e3._subParams.set(this._subParams),e3._subParamsLength=this._subParamsLength,e3._subParamsIdx.set(this._subParamsIdx),e3._rejectDigits=this._rejectDigits,e3._rejectSubDigits=this._rejectSubDigits,e3._digitIsSub=this._digitIsSub,e3}toArray(){let e3=[];for(let t3=0;t3<this.length;++t3){e3.push(this.params[t3]);let s3=this._subParamsIdx[t3]>>8,i3=255&this._subParamsIdx[t3];i3-s3>0&&e3.push(Array.prototype.slice.call(this._subParams,s3,i3))}return e3}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e3){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e3<-1)throw Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e3>s2?s2:e3}}addSubParam(e3){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e3<-1)throw Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e3>s2?s2:e3,this._subParamsIdx[this.length-1]++}}hasSubParams(e3){return(255&this._subParamsIdx[e3])-(this._subParamsIdx[e3]>>8)>0}getSubParams(e3){let t3=this._subParamsIdx[e3]>>8,s3=255&this._subParamsIdx[e3];return s3-t3>0?this._subParams.subarray(t3,s3):null}getSubParamsAll(){let e3={};for(let t3=0;t3<this.length;++t3){let s3=this._subParamsIdx[t3]>>8,i3=255&this._subParamsIdx[t3];i3-s3>0&&(e3[t3]=this._subParams.slice(s3,i3))}return e3}addDigit(e3){let t3;if(this._rejectDigits||!(t3=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i3=this._digitIsSub?this._subParams:this.params,r6=i3[t3-1];i3[t3-1]=~r6?Math.min(10*r6+e3,s2):e3}}t2.Params=i2},3027:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.AddonManager=void 0,t2.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e3=this._addons.length-1;e3>=0;e3--)this._addons[e3].instance.dispose()}loadAddon(e3,t3){let s2={instance:t3,dispose:t3.dispose,isDisposed:!1};this._addons.push(s2),t3.dispose=()=>this._wrappedAddonDispose(s2),t3.activate(e3)}_wrappedAddonDispose(e3){if(e3.isDisposed)return;let t3=-1;for(let s2=0;s2<this._addons.length;s2++)if(this._addons[s2]===e3){t3=s2;break}if(t3===-1)throw Error("Could not dispose an addon that has not been loaded");e3.isDisposed=!0,e3.dispose.apply(e3.instance),this._addons.splice(t3,1)}}},3235:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.BufferApiView=void 0;let i2=s2(793),r6=s2(3055);t2.BufferApiView=class{constructor(e3,t3){this._buffer=e3,this.type=t3}init(e3){return this._buffer=e3,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(e3){let t3=this._buffer.lines.get(e3);if(t3)return new i2.BufferLineApiView(t3)}getNullCell(){return new r6.CellData}}},793:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.BufferLineApiView=void 0;let i2=s2(3055);t2.BufferLineApiView=class{constructor(e3){this._line=e3}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e3,t3){if(!(e3<0||e3>=this._line.length))return t3?(this._line.loadCell(e3,t3),t3):this._line.loadCell(e3,new i2.CellData)}translateToString(e3,t3,s3){return this._line.translateToString(e3,t3,s3)}}},5101:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.BufferNamespaceApi=void 0;let i2=s2(3235),r6=s2(7150),n2=s2(802);class o extends r6.Disposable{constructor(e3){super(),this._core=e3,this._onBufferChange=this._register(new n2.Emitter),this.onBufferChange=this._onBufferChange.event,this._normal=new i2.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new i2.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 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)}}t2.BufferNamespaceApi=o},6097:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.ParserApi=void 0,t2.ParserApi=class{constructor(e3){this._core=e3}registerCsiHandler(e3,t3){return this._core.registerCsiHandler(e3,(e4)=>t3(e4.toArray()))}addCsiHandler(e3,t3){return this.registerCsiHandler(e3,t3)}registerDcsHandler(e3,t3){return this._core.registerDcsHandler(e3,(e4,s2)=>t3(e4,s2.toArray()))}addDcsHandler(e3,t3){return this.registerDcsHandler(e3,t3)}registerEscHandler(e3,t3){return this._core.registerEscHandler(e3,t3)}addEscHandler(e3,t3){return this.registerEscHandler(e3,t3)}registerOscHandler(e3,t3){return this._core.registerOscHandler(e3,t3)}addOscHandler(e3,t3){return this.registerOscHandler(e3,t3)}}},4335:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.UnicodeApi=void 0,t2.UnicodeApi=class{constructor(e3){this._core=e3}register(e3){this._core.unicodeService.register(e3)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e3){this._core.unicodeService.activeVersion=e3}}},9640:function(e2,t2,s2){var i2=this&&this.__decorate||function(e3,t3,s3,i3){var r7,n3=arguments.length,o2=n3<3?t3:i3===null?i3=Object.getOwnPropertyDescriptor(t3,s3):i3;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o2=Reflect.decorate(e3,t3,s3,i3);else for(var a2=e3.length-1;a2>=0;a2--)(r7=e3[a2])&&(o2=(n3<3?r7(o2):n3>3?r7(t3,s3,o2):r7(t3,s3))||o2);return n3>3&&o2&&Object.defineProperty(t3,s3,o2),o2},r6=this&&this.__param||function(e3,t3){return function(s3,i3){t3(s3,i3,e3)}};Object.defineProperty(t2,"__esModule",{value:!0}),t2.BufferService=t2.MINIMUM_ROWS=t2.MINIMUM_COLS=void 0;let n2=s2(7150),o=s2(4097),a=s2(6501),h=s2(802);t2.MINIMUM_COLS=2,t2.MINIMUM_ROWS=1;let c=class extends n2.Disposable{get buffer(){return this.buffers.active}constructor(e3){super(),this.isUserScrolling=!1,this._onResize=this._register(new h.Emitter),this.onResize=this._onResize.event,this._onScroll=this._register(new h.Emitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e3.rawOptions.cols||0,t2.MINIMUM_COLS),this.rows=Math.max(e3.rawOptions.rows||0,t2.MINIMUM_ROWS),this.buffers=this._register(new o.BufferSet(e3,this)),this._register(this.buffers.onBufferActivate((e4)=>{this._onScroll.fire(e4.activeBuffer.ydisp)}))}resize(e3,t3){let s3=this.cols!==e3,i3=this.rows!==t3;this.cols=e3,this.rows=t3,this.buffers.resize(e3,t3),this._onResize.fire({cols:e3,rows:t3,colsChanged:s3,rowsChanged:i3})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e3,t3=!1){let s3=this.buffer,i3;i3=this._cachedBlankLine,i3&&i3.length===this.cols&&i3.getFg(0)===e3.fg&&i3.getBg(0)===e3.bg||(i3=s3.getBlankLine(e3,t3),this._cachedBlankLine=i3),i3.isWrapped=t3;let r7=s3.ybase+s3.scrollTop,n3=s3.ybase+s3.scrollBottom;if(s3.scrollTop===0){let e4=s3.lines.isFull;n3===s3.lines.length-1?e4?s3.lines.recycle().copyFrom(i3):s3.lines.push(i3.clone()):s3.lines.splice(n3+1,0,i3.clone()),e4?this.isUserScrolling&&(s3.ydisp=Math.max(s3.ydisp-1,0)):(s3.ybase++,this.isUserScrolling||s3.ydisp++)}else{let e4=n3-r7+1;s3.lines.shiftElements(r7+1,e4-1,-1),s3.lines.set(n3,i3.clone())}this.isUserScrolling||(s3.ydisp=s3.ybase),this._onScroll.fire(s3.ydisp)}scrollLines(e3,t3){let s3=this.buffer;if(e3<0){if(s3.ydisp===0)return;this.isUserScrolling=!0}else e3+s3.ydisp>=s3.ybase&&(this.isUserScrolling=!1);let i3=s3.ydisp;s3.ydisp=Math.max(Math.min(s3.ydisp+e3,s3.ybase),0),i3!==s3.ydisp&&(t3||this._onScroll.fire(s3.ydisp))}};t2.BufferService=c,t2.BufferService=c=i2([r6(0,a.IOptionsService)],c)},5746:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.CharsetService=void 0,t2.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e3){this.glevel=e3,this.charset=this._charsets[e3]}setgCharset(e3,t3){this._charsets[e3]=t3,this.glevel===e3&&(this.charset=t3)}}},7792:function(e2,t2,s2){var i2=this&&this.__decorate||function(e3,t3,s3,i3){var r7,n3=arguments.length,o2=n3<3?t3:i3===null?i3=Object.getOwnPropertyDescriptor(t3,s3):i3;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o2=Reflect.decorate(e3,t3,s3,i3);else for(var a2=e3.length-1;a2>=0;a2--)(r7=e3[a2])&&(o2=(n3<3?r7(o2):n3>3?r7(t3,s3,o2):r7(t3,s3))||o2);return n3>3&&o2&&Object.defineProperty(t3,s3,o2),o2},r6=this&&this.__param||function(e3,t3){return function(s3,i3){t3(s3,i3,e3)}};Object.defineProperty(t2,"__esModule",{value:!0}),t2.CoreMouseService=void 0;let n2=s2(6501),o=s2(7150),a=s2(802),h={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:(e3)=>e3.button!==4&&e3.action===1&&(e3.ctrl=!1,e3.alt=!1,e3.shift=!1,!0)},VT200:{events:19,restrict:(e3)=>e3.action!==32},DRAG:{events:23,restrict:(e3)=>e3.action!==32||e3.button!==3},ANY:{events:31,restrict:(e3)=>!0}};function c(e3,t3){let s3=(e3.ctrl?16:0)|(e3.shift?4:0)|(e3.alt?8:0);return e3.button===4?(s3|=64,s3|=e3.action):(s3|=3&e3.button,4&e3.button&&(s3|=64),8&e3.button&&(s3|=128),e3.action===32?s3|=32:e3.action!==0||t3||(s3|=3)),s3}let l=String.fromCharCode,u={DEFAULT:(e3)=>{let t3=[c(e3,!1)+32,e3.col+32,e3.row+32];return t3[0]>255||t3[1]>255||t3[2]>255?"":`\x1B[M${l(t3[0])}${l(t3[1])}${l(t3[2])}`},SGR:(e3)=>{let t3=e3.action===0&&e3.button!==4?"m":"M";return`\x1B[<${c(e3,!0)};${e3.col};${e3.row}${t3}`},SGR_PIXELS:(e3)=>{let t3=e3.action===0&&e3.button!==4?"m":"M";return`\x1B[<${c(e3,!0)};${e3.x};${e3.y}${t3}`}},d=class extends o.Disposable{constructor(e3,t3,s3){super(),this._bufferService=e3,this._coreService=t3,this._optionsService=s3,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new a.Emitter),this.onProtocolChange=this._onProtocolChange.event;for(let e4 of Object.keys(h))this.addProtocol(e4,h[e4]);for(let e4 of Object.keys(u))this.addEncoding(e4,u[e4]);this.reset()}addProtocol(e3,t3){this._protocols[e3]=t3}addEncoding(e3,t3){this._encodings[e3]=t3}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e3){if(!this._protocols[e3])throw Error(`unknown protocol "${e3}"`);this._activeProtocol=e3,this._onProtocolChange.fire(this._protocols[e3].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e3){if(!this._encodings[e3])throw Error(`unknown encoding "${e3}"`);this._activeEncoding=e3}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e3,t3,s3){if(e3.deltaY===0||e3.shiftKey)return 0;if(t3===void 0||s3===void 0)return 0;let i3=t3/s3,r7=this._applyScrollModifier(e3.deltaY,e3);return e3.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r7/=i3+0,Math.abs(e3.deltaY)<50&&(r7*=0.3),this._wheelPartialScroll+=r7,r7=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e3.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r7*=this._bufferService.rows),r7}_applyScrollModifier(e3,t3){return t3.altKey||t3.ctrlKey||t3.shiftKey?e3*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e3*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e3){if(e3.col<0||e3.col>=this._bufferService.cols||e3.row<0||e3.row>=this._bufferService.rows)return!1;if(e3.button===4&&e3.action===32)return!1;if(e3.button===3&&e3.action!==32)return!1;if(e3.button!==4&&(e3.action===2||e3.action===3))return!1;if(e3.col++,e3.row++,e3.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e3,this._activeEncoding==="SGR_PIXELS"))return!1;if(!this._protocols[this._activeProtocol].restrict(e3))return!1;let t3=this._encodings[this._activeEncoding](e3);return t3&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t3):this._coreService.triggerDataEvent(t3,!0)),this._lastEvent=e3,!0}explainEvents(e3){return{down:!!(1&e3),up:!!(2&e3),drag:!!(4&e3),move:!!(8&e3),wheel:!!(16&e3)}}_equalEvents(e3,t3,s3){if(s3){if(e3.x!==t3.x)return!1;if(e3.y!==t3.y)return!1}else{if(e3.col!==t3.col)return!1;if(e3.row!==t3.row)return!1}return e3.button===t3.button&&e3.action===t3.action&&e3.ctrl===t3.ctrl&&e3.alt===t3.alt&&e3.shift===t3.shift}};t2.CoreMouseService=d,t2.CoreMouseService=d=i2([r6(0,n2.IBufferService),r6(1,n2.ICoreService),r6(2,n2.IOptionsService)],d)},4071:function(e2,t2,s2){var i2=this&&this.__decorate||function(e3,t3,s3,i3){var r7,n3=arguments.length,o2=n3<3?t3:i3===null?i3=Object.getOwnPropertyDescriptor(t3,s3):i3;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o2=Reflect.decorate(e3,t3,s3,i3);else for(var a2=e3.length-1;a2>=0;a2--)(r7=e3[a2])&&(o2=(n3<3?r7(o2):n3>3?r7(t3,s3,o2):r7(t3,s3))||o2);return n3>3&&o2&&Object.defineProperty(t3,s3,o2),o2},r6=this&&this.__param||function(e3,t3){return function(s3,i3){t3(s3,i3,e3)}};Object.defineProperty(t2,"__esModule",{value:!0}),t2.CoreService=void 0;let n2=s2(7453),o=s2(7150),a=s2(6501),h=s2(802),c=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),u=class extends o.Disposable{constructor(e3,t3,s3){super(),this._bufferService=e3,this._logService=t3,this._optionsService=s3,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new h.Emitter),this.onData=this._onData.event,this._onUserInput=this._register(new h.Emitter),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new h.Emitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new h.Emitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n2.clone)(c),this.decPrivateModes=(0,n2.clone)(l)}reset(){this.modes=(0,n2.clone)(c),this.decPrivateModes=(0,n2.clone)(l)}triggerDataEvent(e3,t3=!1){if(this._optionsService.rawOptions.disableStdin)return;let s3=this._bufferService.buffer;t3&&this._optionsService.rawOptions.scrollOnUserInput&&s3.ybase!==s3.ydisp&&this._onRequestScrollToBottom.fire(),t3&&this._onUserInput.fire(),this._logService.debug(`sending data "${e3}"`),this._logService.trace("sending data (codes)",()=>e3.split("").map((e4)=>e4.charCodeAt(0))),this._onData.fire(e3)}triggerBinaryEvent(e3){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e3}"`),this._logService.trace("sending binary (codes)",()=>e3.split("").map((e4)=>e4.charCodeAt(0))),this._onBinary.fire(e3))}};t2.CoreService=u,t2.CoreService=u=i2([r6(0,a.IBufferService),r6(1,a.ILogService),r6(2,a.IOptionsService)],u)},6025:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.InstantiationService=t2.ServiceCollection=void 0;let i2=s2(6501),r6=s2(6201);class n2{constructor(...e3){this._entries=new Map;for(let[t3,s3]of e3)this.set(t3,s3)}set(e3,t3){let s3=this._entries.get(e3);return this._entries.set(e3,t3),s3}forEach(e3){for(let[t3,s3]of this._entries.entries())e3(t3,s3)}has(e3){return this._entries.has(e3)}get(e3){return this._entries.get(e3)}}t2.ServiceCollection=n2,t2.InstantiationService=class{constructor(){this._services=new n2,this._services.set(i2.IInstantiationService,this)}setService(e3,t3){this._services.set(e3,t3)}getService(e3){return this._services.get(e3)}createInstance(e3,...t3){let s3=(0,r6.getServiceDependencies)(e3).sort((e4,t4)=>e4.index-t4.index),i3=[];for(let t4 of s3){let s4=this._services.get(t4.id);if(!s4)throw Error(`[createInstance] ${e3.name} depends on UNKNOWN service ${t4.id._id}.`);i3.push(s4)}let n3=s3.length>0?s3[0].index:t3.length;if(t3.length!==n3)throw Error(`[createInstance] First service dependency of ${e3.name} at position ${n3+1} conflicts with ${t3.length} static arguments`);return new e3(...[...t3,...i3])}}},7276:function(e2,t2,s2){var i2=this&&this.__decorate||function(e3,t3,s3,i3){var r7,n3=arguments.length,o2=n3<3?t3:i3===null?i3=Object.getOwnPropertyDescriptor(t3,s3):i3;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o2=Reflect.decorate(e3,t3,s3,i3);else for(var a2=e3.length-1;a2>=0;a2--)(r7=e3[a2])&&(o2=(n3<3?r7(o2):n3>3?r7(t3,s3,o2):r7(t3,s3))||o2);return n3>3&&o2&&Object.defineProperty(t3,s3,o2),o2},r6=this&&this.__param||function(e3,t3){return function(s3,i3){t3(s3,i3,e3)}};Object.defineProperty(t2,"__esModule",{value:!0}),t2.LogService=void 0,t2.setTraceLogger=function(e3){h=e3},t2.traceCall=function(e3,t3,s3){if(typeof s3.value!="function")throw Error("not supported");let i3=s3.value;s3.value=function(...e4){if(h.logLevel!==o.LogLevelEnum.TRACE)return i3.apply(this,e4);h.trace(`GlyphRenderer#${i3.name}(${e4.map((e5)=>JSON.stringify(e5)).join(", ")})`);let t4=i3.apply(this,e4);return h.trace(`GlyphRenderer#${i3.name} return`,t4),t4}};let n2=s2(7150),o=s2(6501),a={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF},h,c=class extends n2.Disposable{get logLevel(){return this._logLevel}constructor(e3){super(),this._optionsService=e3,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),h=this}_updateLogLevel(){this._logLevel=a[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e3){for(let t3=0;t3<e3.length;t3++)typeof e3[t3]=="function"&&(e3[t3]=e3[t3]())}_log(e3,t3,s3){this._evalLazyOptionalParams(s3),e3.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t3,...s3)}trace(e3,...t3){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e3,t3)}debug(e3,...t3){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e3,t3)}info(e3,...t3){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e3,t3)}warn(e3,...t3){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e3,t3)}error(e3,...t3){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e3,t3)}};t2.LogService=c,t2.LogService=c=i2([r6(0,o.IOptionsService)],c)},56:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.OptionsService=t2.DEFAULT_OPTIONS=void 0;let i2=s2(7150),r6=s2(701),n2=s2(802);t2.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:1000,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:r6.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}};let o=["normal","bold","100","200","300","400","500","600","700","800","900"];class a extends i2.Disposable{constructor(e3){super(),this._onOptionChange=this._register(new n2.Emitter),this.onOptionChange=this._onOptionChange.event;let s3={...t2.DEFAULT_OPTIONS};for(let t3 in e3)if(t3 in s3)try{let i3=e3[t3];s3[t3]=this._sanitizeAndValidateOption(t3,i3)}catch(e4){console.error(e4)}this.rawOptions=s3,this.options={...s3},this._setupOptions(),this._register((0,i2.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e3,t3){return this.onOptionChange((s3)=>{s3===e3&&t3(this.rawOptions[e3])})}onMultipleOptionChange(e3,t3){return this.onOptionChange((s3)=>{e3.indexOf(s3)!==-1&&t3()})}_setupOptions(){let e3=(e4)=>{if(!(e4 in t2.DEFAULT_OPTIONS))throw Error(`No option with key "${e4}"`);return this.rawOptions[e4]},s3=(e4,s4)=>{if(!(e4 in t2.DEFAULT_OPTIONS))throw Error(`No option with key "${e4}"`);s4=this._sanitizeAndValidateOption(e4,s4),this.rawOptions[e4]!==s4&&(this.rawOptions[e4]=s4,this._onOptionChange.fire(e4))};for(let t3 in this.rawOptions){let i3={get:e3.bind(this,t3),set:s3.bind(this,t3)};Object.defineProperty(this.options,t3,i3)}}_sanitizeAndValidateOption(e3,s3){switch(e3){case"cursorStyle":if(s3||(s3=t2.DEFAULT_OPTIONS[e3]),!function(e4){return e4==="block"||e4==="underline"||e4==="bar"}(s3))throw Error(`"${s3}" is not a valid value for ${e3}`);break;case"wordSeparator":s3||(s3=t2.DEFAULT_OPTIONS[e3]);break;case"fontWeight":case"fontWeightBold":if(typeof s3=="number"&&1<=s3&&s3<=1000)break;s3=o.includes(s3)?s3:t2.DEFAULT_OPTIONS[e3];break;case"cursorWidth":s3=Math.floor(s3);case"lineHeight":case"tabStopWidth":if(s3<1)throw Error(`${e3} cannot be less than 1, value: ${s3}`);break;case"minimumContrastRatio":s3=Math.max(1,Math.min(21,Math.round(10*s3)/10));break;case"scrollback":if((s3=Math.min(s3,4294967295))<0)throw Error(`${e3} cannot be less than 0, value: ${s3}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(s3<=0)throw Error(`${e3} cannot be less than or equal to 0, value: ${s3}`);break;case"rows":case"cols":if(!s3&&s3!==0)throw Error(`${e3} must be numeric, value: ${s3}`);break;case"windowsPty":s3=s3??{}}return s3}}t2.OptionsService=a},8811:function(e2,t2,s2){var i2=this&&this.__decorate||function(e3,t3,s3,i3){var r7,n3=arguments.length,o2=n3<3?t3:i3===null?i3=Object.getOwnPropertyDescriptor(t3,s3):i3;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o2=Reflect.decorate(e3,t3,s3,i3);else for(var a=e3.length-1;a>=0;a--)(r7=e3[a])&&(o2=(n3<3?r7(o2):n3>3?r7(t3,s3,o2):r7(t3,s3))||o2);return n3>3&&o2&&Object.defineProperty(t3,s3,o2),o2},r6=this&&this.__param||function(e3,t3){return function(s3,i3){t3(s3,i3,e3)}};Object.defineProperty(t2,"__esModule",{value:!0}),t2.OscLinkService=void 0;let n2=s2(6501),o=class{constructor(e3){this._bufferService=e3,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e3){let t3=this._bufferService.buffer;if(e3.id===void 0){let s4=t3.addMarker(t3.ybase+t3.y),i4={data:e3,id:this._nextId++,lines:[s4]};return s4.onDispose(()=>this._removeMarkerFromLink(i4,s4)),this._dataByLinkId.set(i4.id,i4),i4.id}let s3=e3,i3=this._getEntryIdKey(s3),r7=this._entriesWithId.get(i3);if(r7)return this.addLineToLink(r7.id,t3.ybase+t3.y),r7.id;let n3=t3.addMarker(t3.ybase+t3.y),o2={id:this._nextId++,key:this._getEntryIdKey(s3),data:s3,lines:[n3]};return n3.onDispose(()=>this._removeMarkerFromLink(o2,n3)),this._entriesWithId.set(o2.key,o2),this._dataByLinkId.set(o2.id,o2),o2.id}addLineToLink(e3,t3){let s3=this._dataByLinkId.get(e3);if(s3&&s3.lines.every((e4)=>e4.line!==t3)){let e4=this._bufferService.buffer.addMarker(t3);s3.lines.push(e4),e4.onDispose(()=>this._removeMarkerFromLink(s3,e4))}}getLinkData(e3){return this._dataByLinkId.get(e3)?.data}_getEntryIdKey(e3){return`${e3.id};;${e3.uri}`}_removeMarkerFromLink(e3,t3){let s3=e3.lines.indexOf(t3);s3!==-1&&(e3.lines.splice(s3,1),e3.lines.length===0&&(e3.data.id!==void 0&&this._entriesWithId.delete(e3.key),this._dataByLinkId.delete(e3.id)))}};t2.OscLinkService=o,t2.OscLinkService=o=i2([r6(0,n2.IBufferService)],o)},6201:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.serviceRegistry=void 0,t2.getServiceDependencies=function(e3){return e3[i2]||[]},t2.createDecorator=function(e3){if(t2.serviceRegistry.has(e3))return t2.serviceRegistry.get(e3);let r6=function(e4,t3,n2){if(arguments.length!==3)throw Error("@IServiceName-decorator can only be used to decorate a parameter");(function(e5,t4,r7){t4[s2]===t4?t4[i2].push({id:e5,index:r7}):(t4[i2]=[{id:e5,index:r7}],t4[s2]=t4)})(r6,e4,n2)};return r6._id=e3,t2.serviceRegistry.set(e3,r6),r6};let s2="di$target",i2="di$dependencies";t2.serviceRegistry=new Map},6501:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.IDecorationService=t2.IUnicodeService=t2.IOscLinkService=t2.IOptionsService=t2.ILogService=t2.LogLevelEnum=t2.IInstantiationService=t2.ICharsetService=t2.ICoreService=t2.ICoreMouseService=t2.IBufferService=void 0;let i2=s2(6201);var r6;t2.IBufferService=(0,i2.createDecorator)("BufferService"),t2.ICoreMouseService=(0,i2.createDecorator)("CoreMouseService"),t2.ICoreService=(0,i2.createDecorator)("CoreService"),t2.ICharsetService=(0,i2.createDecorator)("CharsetService"),t2.IInstantiationService=(0,i2.createDecorator)("InstantiationService"),function(e3){e3[e3.TRACE=0]="TRACE",e3[e3.DEBUG=1]="DEBUG",e3[e3.INFO=2]="INFO",e3[e3.WARN=3]="WARN",e3[e3.ERROR=4]="ERROR",e3[e3.OFF=5]="OFF"}(r6||(t2.LogLevelEnum=r6={})),t2.ILogService=(0,i2.createDecorator)("LogService"),t2.IOptionsService=(0,i2.createDecorator)("OptionsService"),t2.IOscLinkService=(0,i2.createDecorator)("OscLinkService"),t2.IUnicodeService=(0,i2.createDecorator)("UnicodeService"),t2.IDecorationService=(0,i2.createDecorator)("DecorationService")},6415:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.UnicodeService=void 0;let i2=s2(7428),r6=s2(802);class n2{static extractShouldJoin(e3){return!!(1&e3)}static extractWidth(e3){return e3>>1&3}static extractCharKind(e3){return e3>>3}static createPropertyValue(e3,t3,s3=!1){return(16777215&e3)<<3|(3&t3)<<1|(s3?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new r6.Emitter,this.onChange=this._onChange.event;let e3=new i2.UnicodeV6;this.register(e3),this._active=e3.version,this._activeProvider=e3}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e3){if(!this._providers[e3])throw Error(`unknown Unicode version "${e3}"`);this._active=e3,this._activeProvider=this._providers[e3],this._onChange.fire(e3)}register(e3){this._providers[e3.version]=e3}wcwidth(e3){return this._activeProvider.wcwidth(e3)}getStringCellWidth(e3){let t3=0,s3=0,i3=e3.length;for(let r7=0;r7<i3;++r7){let o=e3.charCodeAt(r7);if(55296<=o&&o<=56319){if(++r7>=i3)return t3+this.wcwidth(o);let s4=e3.charCodeAt(r7);56320<=s4&&s4<=57343?o=1024*(o-55296)+s4-56320+65536:t3+=this.wcwidth(s4)}let a=this.charProperties(o,s3),h=n2.extractWidth(a);n2.extractShouldJoin(a)&&(h-=n2.extractWidth(s3)),t3+=h,s3=a}return t3}charProperties(e3,t3){return this._activeProvider.charProperties(e3,t3)}}t2.UnicodeService=n2},5856:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.Terminal=void 0;let i2=s2(6107),r6=s2(5777),n2=s2(802);class o extends r6.CoreTerminal{constructor(e3={}){super(e3),this._onBell=this._register(new n2.Emitter),this.onBell=this._onBell.event,this._onCursorMove=this._register(new n2.Emitter),this.onCursorMove=this._onCursorMove.event,this._onTitleChange=this._register(new n2.Emitter),this.onTitleChange=this._onTitleChange.event,this._onA11yCharEmitter=this._register(new n2.Emitter),this.onA11yChar=this._onA11yCharEmitter.event,this._onA11yTabEmitter=this._register(new n2.Emitter),this.onA11yTab=this._onA11yTabEmitter.event,this._setup(),this._register(this._inputHandler.onRequestBell(()=>this.bell())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(n2.Event.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(n2.Event.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(n2.Event.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(n2.Event.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter))}get buffer(){return this.buffers.active}get markers(){return this.buffer.markers}addMarker(e3){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e3)}bell(){this._onBell.fire()}input(e3,t3=!0){this.coreService.triggerDataEvent(e3,t3)}resize(e3,t3){e3===this.cols&&t3===this.rows||super.resize(e3,t3)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){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 e3=1;e3<this.rows;e3++)this.buffer.lines.push(this.buffer.getBlankLine(i2.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp})}}reset(){this.options.rows=this.rows,this.options.cols=this.cols,this._setup(),super.reset()}}t2.Terminal=o},3058:(e2,t2,s2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.Permutation=t2.CallbackIterable=t2.ArrayQueue=t2.booleanComparator=t2.numberComparator=t2.CompareResult=void 0,t2.tail=function(e3,t3=0){return e3[e3.length-(1+t3)]},t2.tail2=function(e3){if(e3.length===0)throw Error("Invalid tail call");return[e3.slice(0,e3.length-1),e3[e3.length-1]]},t2.equals=function(e3,t3,s3=(e4,t4)=>e4===t4){if(e3===t3)return!0;if(!e3||!t3)return!1;if(e3.length!==t3.length)return!1;for(let i3=0,r7=e3.length;i3<r7;i3++)if(!s3(e3[i3],t3[i3]))return!1;return!0},t2.removeFastWithoutKeepingOrder=function(e3,t3){let s3=e3.length-1;t3<s3&&(e3[t3]=e3[s3]),e3.pop()},t2.binarySearch=function(e3,t3,s3){return n2(e3.length,(i3)=>s3(e3[i3],t3))},t2.binarySearch2=n2,t2.quickSelect=function e3(t3,s3,i3){if((t3|=0)>=s3.length)throw TypeError("invalid index");let r7=s3[Math.floor(s3.length*Math.random())],n3=[],o2=[],a2=[];for(let e4 of s3){let t4=i3(e4,r7);t4<0?n3.push(e4):t4>0?o2.push(e4):a2.push(e4)}return t3<n3.length?e3(t3,n3,i3):t3<n3.length+a2.length?a2[0]:e3(t3-(n3.length+a2.length),o2,i3)},t2.groupBy=function(e3,t3){let s3=[],i3;for(let r7 of e3.slice(0).sort(t3))i3&&t3(i3[0],r7)===0?i3.push(r7):(i3=[r7],s3.push(i3));return s3},t2.groupAdjacentBy=function*(e3,t3){let s3,i3;for(let r7 of e3)i3!==void 0&&t3(i3,r7)?s3.push(r7):(s3&&(yield s3),s3=[r7]),i3=r7;s3&&(yield s3)},t2.forEachAdjacent=function(e3,t3){for(let s3=0;s3<=e3.length;s3++)t3(s3===0?void 0:e3[s3-1],s3===e3.length?void 0:e3[s3])},t2.forEachWithNeighbors=function(e3,t3){for(let s3=0;s3<e3.length;s3++)t3(s3===0?void 0:e3[s3-1],e3[s3],s3+1===e3.length?void 0:e3[s3+1])},t2.sortedDiff=o,t2.delta=function(e3,t3,s3){let i3=o(e3,t3,s3),r7=[],n3=[];for(let t4 of i3)r7.push(...e3.slice(t4.start,t4.start+t4.deleteCount)),n3.push(...t4.toInsert);return{removed:r7,added:n3}},t2.top=function(e3,t3,s3){if(s3===0)return[];let i3=e3.slice(0,s3).sort(t3);return a(e3,t3,i3,s3,e3.length),i3},t2.topAsync=function(e3,t3,s3,r7,n3){return s3===0?Promise.resolve([]):new Promise((o2,h2)=>{(async()=>{let o3=e3.length,h3=e3.slice(0,s3).sort(t3);for(let c2=s3,l2=Math.min(s3+r7,o3);c2<o3;c2=l2,l2=Math.min(l2+r7,o3)){if(c2>s3&&await new Promise((e4)=>setTimeout(e4)),n3&&n3.isCancellationRequested)throw new i2.CancellationError;a(e3,t3,h3,c2,l2)}return h3})().then(o2,h2)})},t2.coalesce=function(e3){return e3.filter((e4)=>!!e4)},t2.coalesceInPlace=function(e3){let t3=0;for(let s3=0;s3<e3.length;s3++)e3[s3]&&(e3[t3]=e3[s3],t3+=1);e3.length=t3},t2.move=function(e3,t3,s3){e3.splice(s3,0,e3.splice(t3,1)[0])},t2.isFalsyOrEmpty=function(e3){return!Array.isArray(e3)||e3.length===0},t2.isNonEmptyArray=function(e3){return Array.isArray(e3)&&e3.length>0},t2.distinct=function(e3,t3=(e4)=>e4){let s3=new Set;return e3.filter((e4)=>{let i3=t3(e4);return!s3.has(i3)&&(s3.add(i3),!0)})},t2.uniqueFilter=function(e3){let t3=new Set;return(s3)=>{let i3=e3(s3);return!t3.has(i3)&&(t3.add(i3),!0)}},t2.firstOrDefault=function(e3,t3){return e3.length>0?e3[0]:t3},t2.lastOrDefault=function(e3,t3){return e3.length>0?e3[e3.length-1]:t3},t2.commonPrefixLength=function(e3,t3,s3=(e4,t4)=>e4===t4){let i3=0;for(let r7=0,n3=Math.min(e3.length,t3.length);r7<n3&&s3(e3[r7],t3[r7]);r7++)i3++;return i3},t2.range=function(e3,t3){let s3=typeof t3=="number"?e3:0;typeof t3=="number"?s3=e3:(s3=0,t3=e3);let i3=[];if(s3<=t3)for(let e4=s3;e4<t3;e4++)i3.push(e4);else for(let e4=s3;e4>t3;e4--)i3.push(e4);return i3},t2.index=function(e3,t3,s3){return e3.reduce((e4,i3)=>(e4[t3(i3)]=s3?s3(i3):i3,e4),Object.create(null))},t2.insert=function(e3,t3){return e3.push(t3),()=>h(e3,t3)},t2.remove=h,t2.arrayInsert=function(e3,t3,s3){let i3=e3.slice(0,t3),r7=e3.slice(t3);return i3.concat(s3,r7)},t2.shuffle=function(e3,t3){let s3;if(typeof t3=="number"){let e4=t3;s3=()=>{let t4=179426549*Math.sin(e4++);return t4-Math.floor(t4)}}else s3=Math.random;for(let t4=e3.length-1;t4>0;t4-=1){let i3=Math.floor(s3()*(t4+1)),r7=e3[t4];e3[t4]=e3[i3],e3[i3]=r7}},t2.pushToStart=function(e3,t3){let s3=e3.indexOf(t3);s3>-1&&(e3.splice(s3,1),e3.unshift(t3))},t2.pushToEnd=function(e3,t3){let s3=e3.indexOf(t3);s3>-1&&(e3.splice(s3,1),e3.push(t3))},t2.pushMany=function(e3,t3){for(let s3 of t3)e3.push(s3)},t2.mapArrayOrNot=function(e3,t3){return Array.isArray(e3)?e3.map(t3):t3(e3)},t2.asArray=function(e3){return Array.isArray(e3)?e3:[e3]},t2.getRandomElement=function(e3){return e3[Math.floor(Math.random()*e3.length)]},t2.insertInto=c,t2.splice=function(e3,t3,s3,i3){let r7=l(e3,t3),n3=e3.splice(r7,s3);return n3===void 0&&(n3=[]),c(e3,r7,i3),n3},t2.compareBy=function(e3,t3){return(s3,i3)=>t3(e3(s3),e3(i3))},t2.tieBreakComparators=function(...e3){return(t3,s3)=>{for(let i3 of e3){let e4=i3(t3,s3);if(!u.isNeitherLessOrGreaterThan(e4))return e4}return u.neitherLessOrGreaterThan}},t2.reverseOrder=function(e3){return(t3,s3)=>-e3(t3,s3)};let i2=s2(9807),r6=s2(8297);function n2(e3,t3){let s3=0,i3=e3-1;for(;s3<=i3;){let e4=(s3+i3)/2|0,r7=t3(e4);if(r7<0)s3=e4+1;else{if(!(r7>0))return e4;i3=e4-1}}return-(s3+1)}function o(e3,t3,s3){let i3=[];function r7(e4,t4,s4){if(t4===0&&s4.length===0)return;let r8=i3[i3.length-1];r8&&r8.start+r8.deleteCount===e4?(r8.deleteCount+=t4,r8.toInsert.push(...s4)):i3.push({start:e4,deleteCount:t4,toInsert:s4})}let n3=0,o2=0;for(;;){if(n3===e3.length){r7(n3,0,t3.slice(o2));break}if(o2===t3.length){r7(n3,e3.length-n3,[]);break}let i4=e3[n3],a2=t3[o2],h2=s3(i4,a2);h2===0?(n3+=1,o2+=1):h2<0?(r7(n3,1,[]),n3+=1):h2>0&&(r7(n3,0,[a2]),o2+=1)}return i3}function a(e3,t3,s3,i3,n3){for(let o2=s3.length;i3<n3;i3++){let n4=e3[i3];if(t3(n4,s3[o2-1])<0){s3.pop();let e4=(0,r6.findFirstIdxMonotonousOrArrLen)(s3,(e5)=>t3(n4,e5)<0);s3.splice(e4,0,n4)}}}function h(e3,t3){let s3=e3.indexOf(t3);if(s3>-1)return e3.splice(s3,1),t3}function c(e3,t3,s3){let i3=l(e3,t3),r7=e3.length,n3=s3.length;e3.length=r7+n3;for(let t4=r7-1;t4>=i3;t4--)e3[t4+n3]=e3[t4];for(let t4=0;t4<n3;t4++)e3[t4+i3]=s3[t4]}function l(e3,t3){return t3<0?Math.max(t3+e3.length,0):Math.min(t3,e3.length)}var u;(function(e3){e3.isLessThan=function(e4){return e4<0},e3.isLessThanOrEqual=function(e4){return e4<=0},e3.isGreaterThan=function(e4){return e4>0},e3.isNeitherLessOrGreaterThan=function(e4){return e4===0},e3.greaterThan=1,e3.lessThan=-1,e3.neitherLessOrGreaterThan=0})(u||(t2.CompareResult=u={})),t2.numberComparator=(e3,t3)=>e3-t3,t2.booleanComparator=(e3,s3)=>(0,t2.numberComparator)(e3?1:0,s3?1:0),t2.ArrayQueue=class{constructor(e3){this.items=e3,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e3){let t3=this.firstIdx;for(;t3<this.items.length&&e3(this.items[t3]);)t3++;let s3=t3===this.firstIdx?null:this.items.slice(this.firstIdx,t3);return this.firstIdx=t3,s3}takeFromEndWhile(e3){let t3=this.lastIdx;for(;t3>=0&&e3(this.items[t3]);)t3--;let s3=t3===this.lastIdx?null:this.items.slice(t3+1,this.lastIdx+1);return this.lastIdx=t3,s3}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e3=this.items[this.firstIdx];return this.firstIdx++,e3}removeLast(){let e3=this.items[this.lastIdx];return this.lastIdx--,e3}takeCount(e3){let t3=this.items.slice(this.firstIdx,this.firstIdx+e3);return this.firstIdx+=e3,t3}};class d{static{this.empty=new d((e3)=>{})}constructor(e3){this.iterate=e3}forEach(e3){this.iterate((t3)=>(e3(t3),!0))}toArray(){let e3=[];return this.iterate((t3)=>(e3.push(t3),!0)),e3}filter(e3){return new d((t3)=>this.iterate((s3)=>!e3(s3)||t3(s3)))}map(e3){return new d((t3)=>this.iterate((s3)=>t3(e3(s3))))}some(e3){let t3=!1;return this.iterate((s3)=>(t3=e3(s3),!t3)),t3}findFirst(e3){let t3;return this.iterate((s3)=>!e3(s3)||(t3=s3,!1)),t3}findLast(e3){let t3;return this.iterate((s3)=>(e3(s3)&&(t3=s3),!0)),t3}findLastMaxBy(e3){let t3,s3=!0;return this.iterate((i3)=>((s3||u.isGreaterThan(e3(i3,t3)))&&(s3=!1,t3=i3),!0)),t3}}t2.CallbackIterable=d;class f{constructor(e3){this._indexMap=e3}static createSortPermutation(e3,t3){let s3=Array.from(e3.keys()).sort((s4,i3)=>t3(e3[s4],e3[i3]));return new f(s3)}apply(e3){return e3.map((t3,s3)=>e3[this._indexMap[s3]])}inverse(){let e3=this._indexMap.slice();for(let t3=0;t3<this._indexMap.length;t3++)e3[this._indexMap[t3]]=t3;return new f(e3)}}t2.Permutation=f},8297:(e2,t2)=>{function s2(e3,t3,s3=e3.length-1){for(let i3=s3;i3>=0;i3--)if(t3(e3[i3]))return i3;return-1}function i2(e3,t3,s3=0,i3=e3.length){let r7=s3,n3=i3;for(;r7<n3;){let s4=Math.floor((r7+n3)/2);t3(e3[s4])?r7=s4+1:n3=s4}return r7-1}function r6(e3,t3,s3=0,i3=e3.length){let r7=s3,n3=i3;for(;r7<n3;){let s4=Math.floor((r7+n3)/2);t3(e3[s4])?n3=s4:r7=s4+1}return r7}Object.defineProperty(t2,"__esModule",{value:!0}),t2.MonotonousArray=void 0,t2.findLast=function(e3,t3){let i3=s2(e3,t3);if(i3!==-1)return e3[i3]},t2.findLastIdx=s2,t2.findLastMonotonous=function(e3,t3){let s3=i2(e3,t3);return s3===-1?void 0:e3[s3]},t2.findLastIdxMonotonous=i2,t2.findFirstMonotonous=function(e3,t3){let s3=r6(e3,t3);return s3===e3.length?void 0:e3[s3]},t2.findFirstIdxMonotonousOrArrLen=r6,t2.findFirstIdxMonotonous=function(e3,t3,s3=0,i3=e3.length){let n3=r6(e3,t3,s3,i3);return n3===e3.length?-1:n3},t2.findFirstMax=o,t2.findLastMax=function(e3,t3){if(e3.length===0)return;let s3=e3[0];for(let i3=1;i3<e3.length;i3++){let r7=e3[i3];t3(r7,s3)>=0&&(s3=r7)}return s3},t2.findFirstMin=function(e3,t3){return o(e3,(e4,s3)=>-t3(e4,s3))},t2.findMaxIdx=function(e3,t3){if(e3.length===0)return-1;let s3=0;for(let i3=1;i3<e3.length;i3++)t3(e3[i3],e3[s3])>0&&(s3=i3);return s3},t2.mapFindFirst=function(e3,t3){for(let s3 of e3){let e4=t3(s3);if(e4!==void 0)return e4}};class n2{static{this.assertInvariants=!1}constructor(e3){this._array=e3,this._findLastMonotonousLastIdx=0}findLastMonotonous(e3){if(n2.assertInvariants){if(this._prevFindLastPredicate){for(let t4 of this._array)if(this._prevFindLastPredicate(t4)&&!e3(t4))throw Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e3}let t3=i2(this._array,e3,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t3+1,t3===-1?void 0:this._array[t3]}}function o(e3,t3){if(e3.length===0)return;let s3=e3[0];for(let i3=1;i3<e3.length;i3++){let r7=e3[i3];t3(r7,s3)>0&&(s3=r7)}return s3}t2.MonotonousArray=n2},9087:(e2,t2)=>{var s2;Object.defineProperty(t2,"__esModule",{value:!0}),t2.SetWithKey=void 0,t2.groupBy=function(e3,t3){let s3=Object.create(null);for(let i3 of e3){let e4=t3(i3),r6=s3[e4];r6||(r6=s3[e4]=[]),r6.push(i3)}return s3},t2.diffSets=function(e3,t3){let s3=[],i3=[];for(let i4 of e3)t3.has(i4)||s3.push(i4);for(let s4 of t3)e3.has(s4)||i3.push(s4);return{removed:s3,added:i3}},t2.diffMaps=function(e3,t3){let s3=[],i3=[];for(let[i4,r6]of e3)t3.has(i4)||s3.push(r6);for(let[s4,r6]of t3)e3.has(s4)||i3.push(r6);return{removed:s3,added:i3}},t2.intersection=function(e3,t3){let s3=new Set;for(let i3 of t3)e3.has(i3)&&s3.add(i3);return s3};class i2{static{s2=Symbol.toStringTag}constructor(e3,t3){this.toKey=t3,this._map=new Map,this[s2]="SetWithKey";for(let t4 of e3)this.add(t4)}get size(){return this._map.size}add(e3){let t3=this.toKey(e3);return this._map.set(t3,e3),this}delete(e3){return this._map.delete(this.toKey(e3))}has(e3){return this._map.has(this.toKey(e3))}*entries(){for(let e3 of this._map.values())yield[e3,e3]}keys(){return this.values()}*values(){for(let e3 of this._map.values())yield e3}clear(){this._map.clear()}forEach(e3,t3){this._map.forEach((s3)=>e3.call(t3,s3,s3,this))}[Symbol.iterator](){return this.values()}}t2.SetWithKey=i2},9807:(e2,t2)=>{Object.defineProperty(t2,"__esModule",{value:!0}),t2.BugIndicatingError=t2.ErrorNoTelemetry=t2.ExpectedError=t2.NotSupportedError=t2.NotImplementedError=t2.ReadonlyError=t2.CancellationError=t2.errorHandler=t2.ErrorHandler=void 0,t2.setUnexpectedErrorHandler=function(e3){t2.errorHandler.setUnexpectedErrorHandler(e3)},t2.isSigPipeError=function(e3){if(!e3||typeof e3!="object")return!1;let t3=e3;return t3.code==="EPIPE"&&t3.syscall?.toUpperCase()==="WRITE"},t2.onUnexpectedError=function(e3){r6(e3)||t2.errorHandler.onUnexpectedError(e3)},t2.onUnexpectedExternalError=function(e3){r6(e3)||t2.errorHandler.onUnexpectedExternalError(e3)},t2.transformErrorForSerialization=function(e3){if(e3 instanceof Error){let{name:t3,message:s3}=e3;return{$isError:!0,name:t3,message:s3,stack:e3.stacktrace||e3.stack,noTelemetry:l.isErrorNoTelemetry(e3)}}return e3},t2.transformErrorFromSerialization=function(e3){let t3;return e3.noTelemetry?t3=new l:(t3=Error(),t3.name=e3.name),t3.message=e3.message,t3.stack=e3.stack,t3},t2.isCancellationError=r6,t2.canceled=function(){let e3=Error(i2);return e3.name=e3.message,e3},t2.illegalArgument=function(e3){return e3?Error(`Illegal argument: ${e3}`):Error("Illegal argument")},t2.illegalState=function(e3){return e3?Error(`Illegal state: ${e3}`):Error("Illegal state")},t2.getErrorMessage=function(e3){return e3?e3.message?e3.message:e3.stack?e3.stack.split(`
4
4
  `)[0]:String(e3):"Error"};class s2{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e3){setTimeout(()=>{if(e3.stack){if(l.isErrorNoTelemetry(e3))throw new l(e3.message+`
5
5