@abtnode/blocklet-services 1.17.4-beta-20251203-225234-75da41dd → 1.17.4-beta-20251204-152224-243ff54f
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.
- package/api/middlewares/verify-sig.js +29 -10
- package/dist/assets/{AdapterDayjs-BuAhqT20.js → AdapterDayjs-DEl3BogQ.js} +1 -1
- package/dist/assets/{Google-Dp7qGnxg.js → Google-FE-PKKgg.js} +1 -1
- package/dist/assets/{access-control-D1ovo6-o.js → access-control-DOpkbifA.js} +1 -1
- package/dist/assets/{add-component-core-BIhDwpuV.js → add-component-core-wpc1J2BH.js} +1 -1
- package/dist/assets/{add-resource-C4TkG7UD.js → add-resource-CslAO771.js} +1 -1
- package/dist/assets/{addon-DAMRKj2r.js → addon-DdNYGDp4.js} +1 -1
- package/dist/assets/{advanced-BPAoOjLm.js → advanced-QWXBTgpB.js} +1 -1
- package/dist/assets/{aigne-B6ByRL09.js → aigne-DoudzB_0.js} +1 -1
- package/dist/assets/api-uGeIZn4a.js +1 -0
- package/dist/assets/{appearance-EkIyryBQ.js → appearance-C--T1yEy.js} +1 -1
- package/dist/assets/ar-Cwm1-0yA.js +7 -0
- package/dist/assets/{arrow-down.svg-Cn1jfZom.js → arrow-down.svg-BE-0knfW.js} +1 -1
- package/dist/assets/{audit-logs-C9C7P-Sv.js → audit-logs-CBGJi3D2.js} +1 -1
- package/dist/assets/{authorize-DrmC8YuR.js → authorize-QdLwmrZR.js} +1 -1
- package/dist/assets/{base-chart-DJyGks5q.js → base-chart-CcNdwghd.js} +1 -1
- package/dist/assets/{base32-CnxuWLTI.js → base32-eAS52qli.js} +1 -1
- package/dist/assets/{bind-account-BBEcbwvl.js → bind-account-D5vP44eh.js} +1 -1
- package/dist/assets/{branding-BznRcuN9.js → branding-B0sUWGQz.js} +1 -1
- package/dist/assets/branding-De5qPtGR.js +1 -0
- package/dist/assets/{branding-ChfGbwwx.js → branding-_1kxBl_k.js} +1 -1
- package/dist/assets/{bundle-avatar-DGFHJNB_.js → bundle-avatar-32N3x3xU.js} +1 -1
- package/dist/assets/{button-pTTwNqRf.js → button-DqhIB3De.js} +1 -1
- package/dist/assets/{click-to-copy-CAd3nEo4.js → click-to-copy-BuSTGPjJ.js} +1 -1
- package/dist/assets/{cloneDeep-B7kH4W7U.js → cloneDeep-DHlHhGOY.js} +1 -1
- package/dist/assets/{complete-DGRt8hbz.js → complete-Dow8rsOd.js} +1 -1
- package/dist/assets/{component-7HXhlkqA.js → component-BAz0O6p3.js} +57 -57
- package/dist/assets/{config-jsIGlbhn.js → config-CpjVTk_0.js} +1 -1
- package/dist/assets/{config-hYngbDX9.js → config-CzKzlfrL.js} +5 -5
- package/dist/assets/{config-De0LSoek.js → config-S1ErpcbM.js} +1 -1
- package/dist/assets/{config-navigation-Dnu_lIYd.js → config-navigation-CDLoKHDM.js} +3 -3
- package/dist/assets/{config-space-Cjm8zHqm.js → config-space-BywO8K6k.js} +1 -1
- package/dist/assets/{confirm-g44rz8hw.js → confirm-CsXep4ZX.js} +1 -1
- package/dist/assets/{connect-DiOZmi5p.js → connect-BVziqmk-.js} +1 -1
- package/dist/assets/{connect-CdDqD7_5.js → connect-Dg3BjAlC.js} +1 -1
- package/dist/assets/{connect-to-Bi5k3ZXU.js → connect-to-DvsUYNJv.js} +1 -1
- package/dist/assets/{create-passport-svg-BLBQxsEK.js → create-passport-svg-CIUyZVGt.js} +1 -1
- package/dist/assets/{createClass-mqcDPFI4.js → createClass-C4n9PQtV.js} +1 -1
- package/dist/assets/dashboard-CL6mI9qw.js +106 -0
- package/dist/assets/de-XQM4sDLo.js +7 -0
- package/dist/assets/{delete-confirm-Cw0wPOzJ.js → delete-confirm-BSzvSp8_.js} +1 -1
- package/dist/assets/{did-address-BOsJWqi1.js → did-address-j4poFq12.js} +1 -1
- package/dist/assets/{domain-BpCcezRq.js → domain-CNIwNykZ.js} +1 -1
- package/dist/assets/{domain-action-card-FG12ETj5.js → domain-action-card-BWxruxm4.js} +1 -1
- package/dist/assets/domains-CYSnteZ-.js +1 -0
- package/dist/assets/{email-DmAbJJ8K.js → email-BUE0xhg8.js} +1 -1
- package/dist/assets/engine-D_YTKCbf.js +1 -0
- package/dist/assets/es-D4zFwVhj.js +9 -0
- package/dist/assets/{exchange-passport-C3TLdHrh.js → exchange-passport-B_YUy8xg.js} +1 -1
- package/dist/assets/{form-BGvxztTN.js → form-C3lQx0_f.js} +1 -1
- package/dist/assets/{form-text-input-BFJU5Psq.js → form-text-input-Sp9mVO8Z.js} +1 -1
- package/dist/assets/fr-BQXlmrTL.js +7 -0
- package/dist/assets/{fuel-BHnBcNst.js → fuel-8vtXn14o.js} +1 -1
- package/dist/assets/{gen-access-key-DMekoh9G.js → gen-access-key-Cv0mVir2.js} +1 -1
- package/dist/assets/{gen-simple-access-key-CKo8-San.js → gen-simple-access-key-CG7rkGCK.js} +1 -1
- package/dist/assets/get-safe-url-DB8WYPm8.js +1 -0
- package/dist/assets/hi-Cdz2GskJ.js +5 -0
- package/dist/assets/{home-Disgh1zw.js → home-Da9sD5LZ.js} +1 -1
- package/dist/assets/id-Q9i8FdSt.js +7 -0
- package/dist/assets/{iframe-DWt09ONv.js → iframe-BOu2WQ8Y.js} +1 -1
- package/dist/assets/{index-Cbz9zwoD.js → index-9EeZkpuz.js} +1 -1
- package/dist/assets/index-B3lpnLC0.js +1 -0
- package/dist/assets/{index-C3cD5fjJ.js → index-B7Hwfql4.js} +1 -1
- package/dist/assets/{index-B87ktLq-.js → index-BHyRI_gV.js} +1 -1
- package/dist/assets/{index-BnfJXuxc.js → index-BO-5QIwf.js} +1 -1
- package/dist/assets/{index-CG-mH6e1.js → index-BmFAdUmE.js} +2 -2
- package/dist/assets/{index-DA2Pny4B.js → index-BnOhhAn2.js} +1 -1
- package/dist/assets/{index-CwAM1jrM.js → index-BpulWIIa.js} +1 -1
- package/dist/assets/{index-DxaRhCwJ.js → index-ByefI9hC.js} +1 -1
- package/dist/assets/{index-DxQFjZlw.js → index-BzDzFVcf.js} +2 -2
- package/dist/assets/{index-CPDkpfNV.js → index-C5-jy29d.js} +1 -1
- package/dist/assets/{index-D5tCTUjA.js → index-CC4kGiqP.js} +1 -1
- package/dist/assets/{index-CSfyeeXh.js → index-CEbTLr_A.js} +1 -1
- package/dist/assets/{index-BIJNkmLb.js → index-CJ1z6qNA.js} +1 -1
- package/dist/assets/{index-Dgb4cDcB.js → index-CJongjoV.js} +1 -1
- package/dist/assets/{index-C_W4n3wb.js → index-CVclk1-n.js} +1 -1
- package/dist/assets/{index-Duu9lR4r.js → index-CY8CdteZ.js} +1 -1
- package/dist/assets/{index-Cke5eCl6.js → index-Cmd4UiOo.js} +1 -1
- package/dist/assets/{index-fJzIwqxQ.js → index-CzTPIbVu.js} +1 -1
- package/dist/assets/{index--6oAMl0L.js → index-DFfEr4If.js} +1 -1
- package/dist/assets/{index-bb9HF7R1.js → index-DQCqwXpW.js} +1 -1
- package/dist/assets/{index-Hh69Xj8u.js → index-DSbS9vii.js} +2 -2
- package/dist/assets/{index-CJ1a35hD.js → index-DdXkI8FK.js} +1 -1
- package/dist/assets/{index-CYxU-iOV.js → index-DiNmJxr2.js} +1 -1
- package/dist/assets/{index-gy2ZIEt_.js → index-DkaI7B4e.js} +1 -1
- package/dist/assets/{index-EH5vv2Ba.js → index-d0ayyNAl.js} +3 -3
- package/dist/assets/{index-Cx5JU0Ln.js → index-jPmRCtiq.js} +7 -7
- package/dist/assets/{index-BC_wNmTA.js → index-o-_irE6S.js} +1 -1
- package/dist/assets/{index-7uZYu-Ep.js → index-y-XalrLG.js} +1 -1
- package/dist/assets/{index-Ca4Ccmqm.js → index-ySP_m_Ux.js} +1 -1
- package/dist/assets/{index-k8gDRcJR.js → index-z0V_qaSH.js} +1 -1
- package/dist/assets/{invitation-C9uUexLK.js → invitation-Dr0R_Zm3.js} +1 -1
- package/dist/assets/{invitations-sELORD_h.js → invitations-DgB-ff90.js} +1 -1
- package/dist/assets/{invite-CXR3ZLRS.js → invite-DM8gXHE_.js} +1 -1
- package/dist/assets/{isURL-CohjRVvR.js → isURL-CTWDUgGm.js} +1 -1
- package/dist/assets/{issue-passport-q8H-mSA2.js → issue-passport-5xsfQh4x.js} +1 -1
- package/dist/assets/{item-BIqA21iq.js → item-B7J3-doM.js} +1 -1
- package/dist/assets/ja-CH8WZngC.js +9 -0
- package/dist/assets/ko-Nli9PwTV.js +9 -0
- package/dist/assets/{landing-page-DgPDUi6Y.js → landing-page-D5rNUC4m.js} +1 -1
- package/dist/assets/{layout-Cr6KApqq.js → layout-Dqc1Rw-q.js} +1 -1
- package/dist/assets/{list-DaqruRvJ.js → list-Dm7-Jiww.js} +1 -1
- package/dist/assets/{list-DZKko9y8.js → list-uwVz32FG.js} +1 -1
- package/dist/assets/localization-ByyQzA4g.js +1 -0
- package/dist/assets/{log-DwPeERno.js → log-DmRGsyT9.js} +17 -17
- package/dist/assets/logger-Du6zTrGC.js +1 -0
- package/dist/assets/{login-Fd_qnrRk.js → login-DVxbUkmV.js} +1 -1
- package/dist/assets/{login-oauth-callback-BWKfq40w.js → login-oauth-callback-D3NWzIdd.js} +1 -1
- package/dist/assets/{logo-uploader-_reea4L6.js → logo-uploader-Bs_7E0-m.js} +1 -1
- package/dist/assets/{lost-passport-DmkXn2Nz.js → lost-passport-DR_9dtm9.js} +1 -1
- package/dist/assets/{omit-W13eVnqC.js → omit-CpvduH4b.js} +1 -1
- package/dist/assets/{open-window-DCReXykr.js → open-window-n4P49X8a.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-Bsp5V3AP.js → over-due-invoice-payment-C-ZuUAsL.js} +1 -1
- package/dist/assets/{overview-CXMCgIAo.js → overview-Tdx-8ilS.js} +3 -3
- package/dist/assets/passport-DnUeoVIR.js +1 -0
- package/dist/assets/{passport-item-CEM3FQ2i.js → passport-item-DAeIvzgs.js} +1 -1
- package/dist/assets/{permission-G7gi0qR2.js → permission-iIDMQlq_.js} +1 -1
- package/dist/assets/{preferences-DalbRqbk.js → preferences-RXCdhC2X.js} +1 -1
- package/dist/assets/profile-embed-xkS3CrGD.js +1 -0
- package/dist/assets/pt-eVksFEJb.js +5 -0
- package/dist/assets/{publish-resource-BqB_XJ-d.js → publish-resource-CcexZ4v9.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-Clor-N66.js → react-beautiful-dnd.esm-DFHKVO-K.js} +1 -1
- package/dist/assets/ru-ycnIgUGb.js +5 -0
- package/dist/assets/runtime-DeZdhum6.js +1 -0
- package/dist/assets/{sanitize-Bm63FeNh.js → sanitize-CdfxCSD9.js} +1 -1
- package/dist/assets/sdk-DxKHN0C9.js +1 -0
- package/dist/assets/{security-CnSkbe_3.js → security-C6PwatSL.js} +1 -1
- package/dist/assets/{session-CAOgTWka.js → session-L__eR8rN.js} +1 -1
- package/dist/assets/{setup-B6xOe2m-.js → setup-C6HhC4jt.js} +1 -1
- package/dist/assets/{simple-select-Cg51s1gv.js → simple-select-CxoXsQVr.js} +1 -1
- package/dist/assets/{spaces-3bFBxoYi.js → spaces-24WmguiI.js} +1 -1
- package/dist/assets/{start-CkQJJ_tn.js → start-CEgdy1zB.js} +1 -1
- package/dist/assets/{starting-progress-C1yUqqL2.js → starting-progress-BoRrvgWe.js} +1 -1
- package/dist/assets/{status-6KTOVV9E.js → status-viNRhemG.js} +1 -1
- package/dist/assets/{step-actions-DHdqImlg.js → step-actions-C_mNllFC.js} +1 -1
- package/dist/assets/{studio-B65PiAI_.js → studio-CH0XVaW0.js} +1 -1
- package/dist/assets/{switch-CjOUxynL.js → switch-D2wksu-s.js} +1 -1
- package/dist/assets/{switch-control-BFsTsyuN.js → switch-control-D-yLpfsT.js} +1 -1
- package/dist/assets/{table-tips-EHWVzPWe.js → table-tips-sMVI7VOu.js} +1 -1
- package/dist/assets/{team-CG74iq-4.js → team-Caq5y5Xs.js} +1 -1
- package/dist/assets/th-BvLhxkpi.js +5 -0
- package/dist/assets/{traffic-Cyi-eL2B.js → traffic-KlkugfEB.js} +1 -1
- package/dist/assets/{transfer-BNHZEvsT.js → transfer-CXj22i68.js} +1 -1
- package/dist/assets/{unsubscribe-DmlsM6iA.js → unsubscribe-Bm4Jw2Kh.js} +1 -1
- package/dist/assets/{use-app-logo-BAJtA-EN.js → use-app-logo-C_3MNDVC.js} +1 -1
- package/dist/assets/{use-window-close-Bo92fPIm.js → use-window-close-CgevJhno.js} +1 -1
- package/dist/assets/{useAsync-Cc-dQGZL.js → useAsync-BCC9JxQR.js} +1 -1
- package/dist/assets/{useAsync-Be4McwD-.js → useAsync-P_Velqz1.js} +1 -1
- package/dist/assets/{useAsyncRetry-a2Wewn3F.js → useAsyncRetry-LJm0Fhbe.js} +1 -1
- package/dist/assets/{useLocalStorage-BBhMedc2.js → useLocalStorage-6wbaKET6.js} +1 -1
- package/dist/assets/{user-center-CNFpJssw.js → user-center-eZZBxCnH.js} +2 -2
- package/dist/assets/{user-follower-BsFDOo99.js → user-follower-udSlTR0u.js} +1 -1
- package/dist/assets/{util-B41ySVcQ.js → util-9a6OMNK7.js} +1 -1
- package/dist/assets/{util-DkhTntVV.js → util-BQfBCQq1.js} +1 -1
- package/dist/assets/{vendor-arcblock-BL_VyzmH.js → vendor-arcblock-D8WYBDYe.js} +1 -1
- package/dist/assets/{vendor-hooks-fhL5FJET.js → vendor-hooks-PN9SWiQm.js} +1 -1
- package/dist/assets/{vendor-utils-BSZ4yJws.js → vendor-utils-BgSaqjGx.js} +1 -1
- package/dist/assets/{vendor-ux-D507n6h6.js → vendor-ux-r9bApERu.js} +2 -2
- package/dist/assets/vi-BmM-09Iq.js +5 -0
- package/dist/assets/{wait-connect-48vXA6Ey.js → wait-connect-D-anNiug.js} +1 -1
- package/dist/assets/{wizard-BwJoQAJL.js → wizard-DnHSYuTP.js} +1 -1
- package/dist/assets/{wizard-components-C4msLQny.js → wizard-components-C6KwiiLp.js} +1 -1
- package/dist/assets/wrap-locale--xtBp5yb.js +1 -0
- package/dist/assets/{zh-DZI4Yy2m.js → zh-BkVzTN9N.js} +2 -2
- package/dist/assets/{zh-BNKpRkuo.js → zh-Djej3j0D.js} +1 -1
- package/dist/assets/zh-tw-CW4J6ddt.js +9 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +24 -24
- package/dist/assets/api-DIucIOLX.js +0 -1
- package/dist/assets/ar-C89Z16Ql.js +0 -7
- package/dist/assets/branding-GuXEK2Lx.js +0 -1
- package/dist/assets/dashboard-Bcb81CDA.js +0 -106
- package/dist/assets/de-BsCDrfBl.js +0 -7
- package/dist/assets/domains-Cgl-LcPh.js +0 -1
- package/dist/assets/engine-BXpJ8aB3.js +0 -1
- package/dist/assets/es-BJh_XsEm.js +0 -9
- package/dist/assets/fr-DRJMwn7V.js +0 -7
- package/dist/assets/get-safe-url-DHtEly1m.js +0 -1
- package/dist/assets/hi-h-9Yl5g9.js +0 -5
- package/dist/assets/id-BDWggRsa.js +0 -7
- package/dist/assets/index-DLvroCDC.js +0 -1
- package/dist/assets/ja-R9EF3xbB.js +0 -9
- package/dist/assets/ko-C_QLPZyk.js +0 -9
- package/dist/assets/localization-B72YTR3I.js +0 -1
- package/dist/assets/logger-CjpdOowp.js +0 -1
- package/dist/assets/observability-SEfRhcXj.js +0 -1
- package/dist/assets/passport-Dsw-sETA.js +0 -1
- package/dist/assets/playground-Bo63Spph.js +0 -1
- package/dist/assets/profile-embed-CQgwIw3w.js +0 -1
- package/dist/assets/pt-DpYO8djd.js +0 -5
- package/dist/assets/ru-DkZtar3s.js +0 -5
- package/dist/assets/runtime-k8xPJwHr.js +0 -1
- package/dist/assets/sdk-BLKW-lxg.js +0 -1
- package/dist/assets/th-04iX5CrT.js +0 -5
- package/dist/assets/vi-kOP0E9Ga.js +0 -5
- package/dist/assets/wrap-locale-D5uKJYzr.js +0 -1
- package/dist/assets/zh-tw-BLapUUeq.js +0 -9
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{at as fe,j as Y,W as te,J as Ye,bi as Xe,Q as Je,ak as _e,a6 as Le,cO as Ze,y as Fe,bc as We,M as Ue,ck as Qe,z as et}from"./vendor-mui-core-BPQ6AEW_.js";import{u as tt}from"./useLocalStorage-
|
|
2
|
-
`))),this.register(this._terminal.onA11yTab(p=>this._handleTab(p))),this.register(this._terminal.onKey(p=>this._handleKey(p.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,t.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,u.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let
|
|
3
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,r){this._liveRegionDebouncer.refresh(e,r,this._terminal.rows)}_renderRows(e,r){const a=this._terminal.buffer,f=a.lines.length.toString();for(let p=e;p<=r;p++){const g=a.lines.get(a.ydisp+p),l=[],m=g?.translateToString(!0,void 0,void 0,l)||"",E=(a.ydisp+p+1).toString(),x=this._rowElements[p];x&&(m.length===0?(x.innerText=" ",this._rowColumns.set(x,[0,1])):(x.textContent=m,this._rowColumns.set(x,l)),x.setAttribute("aria-posinset",E),x.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,r){const a=e.target,f=this._rowElements[r===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(r===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let p,g;if(r===0?(p=a,g=this._rowElements.pop(),this._rowContainer.removeChild(g)):(p=this._rowElements.shift(),g=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),g.removeEventListener("focus",this._bottomBoundaryFocusListener),r===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(r===0?-1:1),this._rowElements[r===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let r={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((r.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||r.node===a.node&&r.offset>a.offset)&&([r,a]=[a,r]),r.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(r={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(r.node))return;const f=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:f,offset:f.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:m,offset:E})=>{const x=m instanceof Text?m.parentNode:m;let L=parseInt(x?.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const b=this._rowColumns.get(x);if(!b)return console.warn("columns is null. Race condition?"),null;let A=E<b.length?b[E]:b.slice(-1)[0]+1;return A>=this._terminal.cols&&(++L,A=0),{row:L,column:A}},g=p(r),l=p(a);if(g&&l){if(g.row>l.row||g.row===l.row&&g.column>=l.column)throw new Error("invalid range");this._terminal.select(g.column,g.row,(l.row-g.row)*this._terminal.cols-g.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let r=this._rowContainer.children.length;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=i=c([_(1,h.IInstantiationService),_(2,v.ICoreBrowserService),_(3,v.IRenderService)],i)},3614:(R,s)=>{function o(d){return d.replace(/\r?\n/g,"\r")}function c(d,u){return u?"\x1B[200~"+d+"\x1B[201~":d}function _(d,u,v,h){d=c(d=o(d),v.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(d,!0),u.value=""}function n(d,u,v){const h=v.getBoundingClientRect(),t=d.clientX-h.left-10,i=d.clientY-h.top-10;u.style.width="20px",u.style.height="20px",u.style.left=`${t}px`,u.style.top=`${i}px`,u.style.zIndex="1000",u.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=c,s.copyHandler=function(d,u){d.clipboardData&&d.clipboardData.setData("text/plain",u.selectionText),d.preventDefault()},s.handlePasteEvent=function(d,u,v,h){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),u,v,h)},s.paste=_,s.moveTextAreaUnderMouseCursor=n,s.rightClickHandler=function(d,u,v,h,t){n(d,u,v),t&&h.rightClickSelect(d),u.value=h.selectionText,u.select()}},7239:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=o(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,c,_,n){o.addEventListener(c,_,n);let d=!1;return{dispose:()=>{d||(d=!0,o.removeEventListener(c,_,n))}}}},3551:function(R,s,o){var c=this&&this.__decorate||function(i,e,r,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,e,r,a);else for(var l=i.length-1;l>=0;l--)(f=i[l])&&(g=(p<3?f(g):p>3?f(e,r,g):f(e,r))||g);return p>3&&g&&Object.defineProperty(e,r,g),g},_=this&&this.__param||function(i,e){return function(r,a){e(r,a,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const n=o(3656),d=o(8460),u=o(844),v=o(2585),h=o(4725);let t=s.Linkifier=class extends u.Disposable{get currentLink(){return this._currentLink}constructor(i,e,r,a,f){super(),this._element=i,this._mouseService=e,this._renderService=r,this._bufferService=a,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,u.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,u.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(i){this._lastMouseEvent=i;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const r=i.composedPath();for(let a=0;a<r.length;a++){const f=r[a];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(i){if(this._activeLine!==i.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(i,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,i)||(this._clearCurrentLink(),this._askForLink(i,!0))}_askForLink(i,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach(a=>{a?.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=i.y);let r=!1;for(const[a,f]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(r=this._checkLinkProviderResult(a,i,r)):f.provideLinks(i.y,p=>{if(this._isMouseOut)return;const g=p?.map(l=>({link:l}));this._activeProviderReplies?.set(a,g),r=this._checkLinkProviderResult(a,i,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(i.y,this._activeProviderReplies)})}_removeIntersectingLinks(i,e){const r=new Set;for(let a=0;a<e.size;a++){const f=e.get(a);if(f)for(let p=0;p<f.length;p++){const g=f[p],l=g.link.range.start.y<i?0:g.link.range.start.x,m=g.link.range.end.y>i?this._bufferService.cols:g.link.range.end.x;for(let E=l;E<=m;E++){if(r.has(E)){f.splice(p--,1);break}r.add(E)}}}}_checkLinkProviderResult(i,e,r){if(!this._activeProviderReplies)return r;const a=this._activeProviderReplies.get(i);let f=!1;for(let p=0;p<i;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&a){const p=a.find(g=>this._linkAtPosition(g.link,e));p&&(r=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let p=0;p<this._activeProviderReplies.size;p++){const g=this._activeProviderReplies.get(p)?.find(l=>this._linkAtPosition(l.link,e));if(g){r=!0,this._handleNewLink(g);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(i){if(!this._currentLink)return;const e=this._positionFromMouseEvent(i,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(i,this._currentLink.link.text)}_clearCurrentLink(i,e){this._currentLink&&this._lastMouseEvent&&(!i||!e||this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,u.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:i.link.decorations===void 0||i.link.decorations.underline,pointerCursor:i.link.decorations===void 0||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(i.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;const a=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(a,f),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}})))}_linkHover(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&i.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(r,e.text)}_fireUnderlineEvent(i,e){const r=i.range,a=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-a-1,r.end.x,r.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(i,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&i.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(r,e.text)}_linkAtPosition(i,e){const r=i.range.start.y*this._bufferService.cols+i.range.start.x,a=i.range.end.y*this._bufferService.cols+i.range.end.x,f=e.y*this._bufferService.cols+e.x;return r<=f&&f<=a}_positionFromMouseEvent(i,e,r){const a=r.getCoords(i,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(i,e,r,a,f){return{x1:i,y1:e,x2:r,y2:a,cols:this._bufferService.cols,fg:f}}};s.Linkifier=t=c([_(1,h.IMouseService),_(2,h.IRenderService),_(3,v.IBufferService),_(4,h.ILinkProviderService)],t)},9042:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(R,s,o){var c=this&&this.__decorate||function(h,t,i,e){var r,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,i,e);else for(var p=h.length-1;p>=0;p--)(r=h[p])&&(f=(a<3?r(f):a>3?r(t,i,f):r(t,i))||f);return a>3&&f&&Object.defineProperty(t,i,f),f},_=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const n=o(511),d=o(2585);let u=s.OscLinkProvider=class{constructor(h,t,i){this._bufferService=h,this._optionsService=t,this._oscLinkService=i}provideLinks(h,t){const i=this._bufferService.buffer.lines.get(h-1);if(!i)return void t(void 0);const e=[],r=this._optionsService.rawOptions.linkHandler,a=new n.CellData,f=i.getTrimmedLength();let p=-1,g=-1,l=!1;for(let m=0;m<f;m++)if(g!==-1||i.hasContent(m)){if(i.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId){if(g===-1){g=m,p=a.extended.urlId;continue}l=a.extended.urlId!==p}else g!==-1&&(l=!0);if(l||g!==-1&&m===f-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const x={start:{x:g+1,y:h},end:{x:m+(l||m!==f-1?0:1),y:h}};let L=!1;if(!r?.allowNonHttpProtocols)try{const b=new URL(E);["http:","https:"].includes(b.protocol)||(L=!0)}catch{L=!0}L||e.push({text:E,range:x,activate:(b,A)=>r?r.activate(b,A,x):v(0,A),hover:(b,A)=>r?.hover?.(b,A,x),leave:(b,A)=>r?.leave?.(b,A,x)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(g=m,p=a.extended.urlId):(g=-1,p=-1)}}t(e)}};function v(h,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1
|
+
import{at as fe,j as Y,W as te,J as Ye,bi as Xe,Q as Je,ak as _e,a6 as Le,cO as Ze,y as Fe,bc as We,M as Ue,ck as Qe,z as et}from"./vendor-mui-core-BPQ6AEW_.js";import{u as tt}from"./useLocalStorage-6wbaKET6.js";import{p as De,a as it,d as rt,g as Ne,r as oe,u as st}from"./vendor-react-CUXIiAnY.js";import{d as nt,n as Re}from"./vendor-utils-BgSaqjGx.js";import{aH as ot,_ as $e,a1 as at}from"./index-jPmRCtiq.js";import{V as ht,n as Ae,b as lt,H as ct}from"./vendor-ux-r9bApERu.js";import{B as dt}from"./bundle-avatar-32N3x3xU.js";import"./vendor-arcblock-D8WYBDYe.js";import"./vendor-hooks-PN9SWiQm.js";import"./lottie-web-4koyQiv_.js";var ye={exports:{}},Be;function ut(){return Be||(Be=1,function(G,V){(function(j,K){G.exports=K()})(globalThis,()=>(()=>{var j={4567:function(R,s,o){var d=this&&this.__decorate||function(e,i,a,f){var p,g=arguments.length,l=g<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(i,a,l):p(i,a))||l);return g>3&&l&&Object.defineProperty(i,a,l),l},_=this&&this.__param||function(e,i){return function(a,f){i(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const n=o(9042),c=o(9924),u=o(844),v=o(4725),h=o(2585),t=o(3656);let r=s.AccessibilityManager=class extends u.Disposable{constructor(e,i,a,f){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=f,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new c.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(p=>this._handleResize(p.rows))),this.register(this._terminal.onRender(p=>this._refreshRows(p.start,p.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(p=>this._handleChar(p))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
|
+
`))),this.register(this._terminal.onA11yTab(p=>this._handleTab(p))),this.register(this._terminal.onKey(p=>this._handleKey(p.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,t.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,u.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){const a=this._terminal.buffer,f=a.lines.length.toString();for(let p=e;p<=i;p++){const g=a.lines.get(a.ydisp+p),l=[],m=g?.translateToString(!0,void 0,void 0,l)||"",E=(a.ydisp+p+1).toString(),x=this._rowElements[p];x&&(m.length===0?(x.innerText=" ",this._rowColumns.set(x,[0,1])):(x.textContent=m,this._rowColumns.set(x,l)),x.setAttribute("aria-posinset",E),x.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){const a=e.target,f=this._rowElements[i===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let p,g;if(i===0?(p=a,g=this._rowElements.pop(),this._rowContainer.removeChild(g)):(p=this._rowElements.shift(),g=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),g.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===a.node&&i.offset>a.offset)&&([i,a]=[a,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;const f=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:f,offset:f.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:m,offset:E})=>{const x=m instanceof Text?m.parentNode:m;let L=parseInt(x?.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const b=this._rowColumns.get(x);if(!b)return console.warn("columns is null. Race condition?"),null;let A=E<b.length?b[E]:b.slice(-1)[0]+1;return A>=this._terminal.cols&&(++L,A=0),{row:L,column:A}},g=p(i),l=p(a);if(g&&l){if(g.row>l.row||g.row===l.row&&g.column>=l.column)throw new Error("invalid range");this._terminal.select(g.column,g.row,(l.row-g.row)*this._terminal.cols-g.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=r=d([_(1,h.IInstantiationService),_(2,v.ICoreBrowserService),_(3,v.IRenderService)],r)},3614:(R,s)=>{function o(c){return c.replace(/\r?\n/g,"\r")}function d(c,u){return u?"\x1B[200~"+c+"\x1B[201~":c}function _(c,u,v,h){c=d(c=o(c),v.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(c,!0),u.value=""}function n(c,u,v){const h=v.getBoundingClientRect(),t=c.clientX-h.left-10,r=c.clientY-h.top-10;u.style.width="20px",u.style.height="20px",u.style.left=`${t}px`,u.style.top=`${r}px`,u.style.zIndex="1000",u.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=d,s.copyHandler=function(c,u){c.clipboardData&&c.clipboardData.setData("text/plain",u.selectionText),c.preventDefault()},s.handlePasteEvent=function(c,u,v,h){c.stopPropagation(),c.clipboardData&&_(c.clipboardData.getData("text/plain"),u,v,h)},s.paste=_,s.moveTextAreaUnderMouseCursor=n,s.rightClickHandler=function(c,u,v,h,t){n(c,u,v),t&&h.rightClickSelect(c),u.value=h.selectionText,u.select()}},7239:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const d=o(1505);s.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(_,n,c){this._css.set(_,n,c)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,c){this._color.set(_,n,c)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,d,_,n){o.addEventListener(d,_,n);let c=!1;return{dispose:()=>{c||(c=!0,o.removeEventListener(d,_,n))}}}},3551:function(R,s,o){var d=this&&this.__decorate||function(r,e,i,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,e,i,a);else for(var l=r.length-1;l>=0;l--)(f=r[l])&&(g=(p<3?f(g):p>3?f(e,i,g):f(e,i))||g);return p>3&&g&&Object.defineProperty(e,i,g),g},_=this&&this.__param||function(r,e){return function(i,a){e(i,a,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const n=o(3656),c=o(8460),u=o(844),v=o(2585),h=o(4725);let t=s.Linkifier=class extends u.Disposable{get currentLink(){return this._currentLink}constructor(r,e,i,a,f){super(),this._element=r,this._mouseService=e,this._renderService=i,this._bufferService=a,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new c.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new c.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,u.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,u.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(r){this._lastMouseEvent=r;const e=this._positionFromMouseEvent(r,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const i=r.composedPath();for(let a=0;a<i.length;a++){const f=i[a];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(r){if(this._activeLine!==r.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(r,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,r)||(this._clearCurrentLink(),this._askForLink(r,!0))}_askForLink(r,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach(a=>{a?.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=r.y);let i=!1;for(const[a,f]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(i=this._checkLinkProviderResult(a,r,i)):f.provideLinks(r.y,p=>{if(this._isMouseOut)return;const g=p?.map(l=>({link:l}));this._activeProviderReplies?.set(a,g),i=this._checkLinkProviderResult(a,r,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(r.y,this._activeProviderReplies)})}_removeIntersectingLinks(r,e){const i=new Set;for(let a=0;a<e.size;a++){const f=e.get(a);if(f)for(let p=0;p<f.length;p++){const g=f[p],l=g.link.range.start.y<r?0:g.link.range.start.x,m=g.link.range.end.y>r?this._bufferService.cols:g.link.range.end.x;for(let E=l;E<=m;E++){if(i.has(E)){f.splice(p--,1);break}i.add(E)}}}}_checkLinkProviderResult(r,e,i){if(!this._activeProviderReplies)return i;const a=this._activeProviderReplies.get(r);let f=!1;for(let p=0;p<r;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&a){const p=a.find(g=>this._linkAtPosition(g.link,e));p&&(i=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let p=0;p<this._activeProviderReplies.size;p++){const g=this._activeProviderReplies.get(p)?.find(l=>this._linkAtPosition(l.link,e));if(g){i=!0,this._handleNewLink(g);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(r){if(!this._currentLink)return;const e=this._positionFromMouseEvent(r,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(r,this._currentLink.link.text)}_clearCurrentLink(r,e){this._currentLink&&this._lastMouseEvent&&(!r||!e||this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,u.disposeArray)(this._linkCacheDisposables))}_handleNewLink(r){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(r.link,e)&&(this._currentLink=r,this._currentLink.state={decorations:{underline:r.link.decorations===void 0||r.link.decorations.underline,pointerCursor:r.link.decorations===void 0||r.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,r.link,this._lastMouseEvent),r.link.decorations={},Object.defineProperties(r.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(r.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;const a=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(a,f),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}})))}_linkHover(r,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&r.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(r,e){const i=r.range,a=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-a-1,i.end.x,i.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(r,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&r.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(r,e){const i=r.range.start.y*this._bufferService.cols+r.range.start.x,a=r.range.end.y*this._bufferService.cols+r.range.end.x,f=e.y*this._bufferService.cols+e.x;return i<=f&&f<=a}_positionFromMouseEvent(r,e,i){const a=i.getCoords(r,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(r,e,i,a,f){return{x1:r,y1:e,x2:i,y2:a,cols:this._bufferService.cols,fg:f}}};s.Linkifier=t=d([_(1,h.IMouseService),_(2,h.IRenderService),_(3,v.IBufferService),_(4,h.ILinkProviderService)],t)},9042:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(R,s,o){var d=this&&this.__decorate||function(h,t,r,e){var i,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,r):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,r,e);else for(var p=h.length-1;p>=0;p--)(i=h[p])&&(f=(a<3?i(f):a>3?i(t,r,f):i(t,r))||f);return a>3&&f&&Object.defineProperty(t,r,f),f},_=this&&this.__param||function(h,t){return function(r,e){t(r,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const n=o(511),c=o(2585);let u=s.OscLinkProvider=class{constructor(h,t,r){this._bufferService=h,this._optionsService=t,this._oscLinkService=r}provideLinks(h,t){const r=this._bufferService.buffer.lines.get(h-1);if(!r)return void t(void 0);const e=[],i=this._optionsService.rawOptions.linkHandler,a=new n.CellData,f=r.getTrimmedLength();let p=-1,g=-1,l=!1;for(let m=0;m<f;m++)if(g!==-1||r.hasContent(m)){if(r.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId){if(g===-1){g=m,p=a.extended.urlId;continue}l=a.extended.urlId!==p}else g!==-1&&(l=!0);if(l||g!==-1&&m===f-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const x={start:{x:g+1,y:h},end:{x:m+(l||m!==f-1?0:1),y:h}};let L=!1;if(!i?.allowNonHttpProtocols)try{const b=new URL(E);["http:","https:"].includes(b.protocol)||(L=!0)}catch{L=!0}L||e.push({text:E,range:x,activate:(b,A)=>i?i.activate(b,A,x):v(0,A),hover:(b,A)=>i?.hover?.(b,A,x),leave:(b,A)=>i?.leave?.(b,A,x)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(g=m,p=a.extended.urlId):(g=-1,p=-1)}}t(e)}};function v(h,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
4
|
|
|
5
|
-
WARNING: This link could potentially be dangerous`)){const i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=u=c([_(0,d.IBufferService),_(1,d.IOptionsService),_(2,d.IOscLinkService)],u)},6193:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,_){this._rowCount=_,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=o(3614),_=o(3656),n=o(3551),d=o(9042),u=o(3730),v=o(1680),h=o(3107),t=o(5744),i=o(2950),e=o(1296),r=o(428),a=o(4269),f=o(5114),p=o(8934),g=o(3230),l=o(9312),m=o(4725),E=o(6731),x=o(8055),L=o(8969),b=o(8460),A=o(844),M=o(6114),P=o(8437),U=o(2584),I=o(7399),S=o(5941),w=o(9074),y=o(2585),k=o(5435),T=o(4567),H=o(779);class $ extends L.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(D={}){super(D),this.browser=M,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new A.MutableDisposable),this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new b.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new b.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new b.EventEmitter),this._onBlur=this.register(new b.EventEmitter),this._onA11yCharEmitter=this.register(new b.EventEmitter),this._onA11yTabEmitter=this.register(new b.EventEmitter),this._onWillOpen=this.register(new b.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(w.DecorationService),this._instantiationService.setService(y.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(H.LinkProviderService),this._instantiationService.setService(m.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(u.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((C,B)=>this.refresh(C,B))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(C=>this._reportWindowsOptions(C))),this.register(this._inputHandler.onColor(C=>this._handleColorEvent(C))),this.register((0,b.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,b.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,b.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,b.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(C=>this._afterResize(C.cols,C.rows))),this.register((0,A.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(D){if(this._themeService)for(const C of D){let B,O="";switch(C.index){case 256:B="foreground",O="10";break;case 257:B="background",O="11";break;case 258:B="cursor",O="12";break;default:B="ansi",O="4;"+C.index}switch(C.type){case 0:const W=x.color.toColorRGB(B==="ansi"?this._themeService.colors.ansi[C.index]:this._themeService.colors[B]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${O};${(0,S.toRgbString)(W)}${U.C1_ESCAPED.ST}`);break;case 1:if(B==="ansi")this._themeService.modifyColors(F=>F.ansi[C.index]=x.channels.toColor(...C.color));else{const F=B;this._themeService.modifyColors(X=>X[F]=x.channels.toColor(...C.color))}break;case 2:this._themeService.restoreColor(C.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(D){D?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(T.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(D){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const D=this.buffer.ybase+this.buffer.y,C=this.buffer.lines.get(D);if(!C)return;const B=Math.min(this.buffer.x,this.cols-1),O=this._renderService.dimensions.css.cell.height,W=C.getWidth(B),F=this._renderService.dimensions.css.cell.width*W,X=this.buffer.y*this._renderService.dimensions.css.cell.height,Q=B*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Q+"px",this.textarea.style.top=X+"px",this.textarea.style.width=F+"px",this.textarea.style.height=O+"px",this.textarea.style.lineHeight=O+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",C=>{this.hasSelection()&&(0,c.copyHandler)(C,this._selectionService)}));const D=C=>(0,c.handlePasteEvent)(C,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",D)),this.register((0,_.addDisposableDomListener)(this.element,"paste",D)),M.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",C=>{C.button===2&&(0,c.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",C=>{(0,c.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),M.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",C=>{C.button===1&&(0,c.moveTextAreaUnderMouseCursor)(C,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",D=>this._keyUp(D),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",D=>this._keyDown(D),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",D=>this._keyPress(D),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",D=>this._compositionHelper.compositionupdate(D))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",D=>this._inputEvent(D),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(D){if(!D)throw new Error("Terminal requires a parent element.");if(D.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=D.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),D.appendChild(this.element);const C=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),C.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",B=>this.updateCursorStyle(B))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),C.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),M.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(f.CoreBrowserService,this.textarea,D.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",B=>this._handleTextAreaFocus(B))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(r.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(E.ThemeService),this._instantiationService.setService(m.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(a.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(g.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(B=>this._onRender.fire(B))),this.onResize(B=>this._renderService.resize(B.cols,B.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(i.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(p.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(C);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(v.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(B=>this.scrollLines(B.amount,B.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(l.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(B=>this.scrollLines(B.amount,B.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(B=>this._renderService.handleSelectionChanged(B.start,B.end,B.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(B=>{this.textarea.value=B,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(B=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(h.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",B=>this._selectionService.handleMouseDown(B))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(T.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",B=>this._handleScreenReaderModeOptionChange(B))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",B=>{!this._overviewRulerRenderer&&B&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const D=this,C=this.element;function B(F){const X=D._mouseService.getMouseReportCoords(F,D.screenElement);if(!X)return!1;let Q,ee;switch(F.overrideType||F.type){case"mousemove":ee=32,F.buttons===void 0?(Q=3,F.button!==void 0&&(Q=F.button<3?F.button:3)):Q=1&F.buttons?0:4&F.buttons?1:2&F.buttons?2:3;break;case"mouseup":ee=0,Q=F.button<3?F.button:3;break;case"mousedown":ee=1,Q=F.button<3?F.button:3;break;case"wheel":if(D._customWheelEventHandler&&D._customWheelEventHandler(F)===!1||D.viewport.getLinesScrolled(F)===0)return!1;ee=F.deltaY<0?0:1,Q=4;break;default:return!1}return!(ee===void 0||Q===void 0||Q>4)&&D.coreMouseService.triggerMouseEvent({col:X.col,row:X.row,x:X.x,y:X.y,button:Q,action:ee,ctrl:F.ctrlKey,alt:F.altKey,shift:F.shiftKey})}const O={mouseup:null,wheel:null,mousedrag:null,mousemove:null},W={mouseup:F=>(B(F),F.buttons||(this._document.removeEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.removeEventListener("mousemove",O.mousedrag)),this.cancel(F)),wheel:F=>(B(F),this.cancel(F,!0)),mousedrag:F=>{F.buttons&&B(F)},mousemove:F=>{F.buttons||B(F)}};this.register(this.coreMouseService.onProtocolChange(F=>{F?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(F)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&F?O.mousemove||(C.addEventListener("mousemove",W.mousemove),O.mousemove=W.mousemove):(C.removeEventListener("mousemove",O.mousemove),O.mousemove=null),16&F?O.wheel||(C.addEventListener("wheel",W.wheel,{passive:!1}),O.wheel=W.wheel):(C.removeEventListener("wheel",O.wheel),O.wheel=null),2&F?O.mouseup||(O.mouseup=W.mouseup):(this._document.removeEventListener("mouseup",O.mouseup),O.mouseup=null),4&F?O.mousedrag||(O.mousedrag=W.mousedrag):(this._document.removeEventListener("mousemove",O.mousedrag),O.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(C,"mousedown",F=>{if(F.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(F))return B(F),O.mouseup&&this._document.addEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.addEventListener("mousemove",O.mousedrag),this.cancel(F)})),this.register((0,_.addDisposableDomListener)(C,"wheel",F=>{if(!O.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(F)===!1)return!1;if(!this.buffer.hasScrollback){const X=this.viewport.getLinesScrolled(F);if(X===0)return;const Q=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(F.deltaY<0?"A":"B");let ee="";for(let re=0;re<Math.abs(X);re++)ee+=Q;return this.coreService.triggerDataEvent(ee,!0),this.cancel(F,!0)}return this.viewport.handleWheel(F)?this.cancel(F):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(C,"touchstart",F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(F),this.cancel(F)},{passive:!0})),this.register((0,_.addDisposableDomListener)(C,"touchmove",F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(F)?void 0:this.cancel(F)},{passive:!1}))}refresh(D,C){this._renderService?.refreshRows(D,C)}updateCursorStyle(D){this._selectionService?.shouldColumnSelect(D)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(D,C,B=0){B===1?(super.scrollLines(D,C,B),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(D)}paste(D){(0,c.paste)(D,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(D){this._customKeyEventHandler=D}attachCustomWheelEventHandler(D){this._customWheelEventHandler=D}registerLinkProvider(D){return this._linkProviderService.registerLinkProvider(D)}registerCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const C=this._characterJoinerService.register(D);return this.refresh(0,this.rows-1),C}deregisterCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(D)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(D){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+D)}registerDecoration(D){return this._decorationService.registerDecoration(D)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(D,C,B){this._selectionService.setSelection(D,C,B)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(D,C){this._selectionService?.selectLines(D,C)}_keyDown(D){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;const C=this.browser.isMac&&this.options.macOptionIsMeta&&D.altKey;if(!C&&!this._compositionHelper.keydown(D))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;C||D.key!=="Dead"&&D.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const B=(0,I.evaluateKeyboardEvent)(D,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(D),B.type===3||B.type===2){const O=this.rows-1;return this.scrollLines(B.type===2?-O:O),this.cancel(D,!0)}return B.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,D)||(B.cancel&&this.cancel(D,!0),!B.key||!!(D.key&&!D.ctrlKey&&!D.altKey&&!D.metaKey&&D.key.length===1&&D.key.charCodeAt(0)>=65&&D.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(B.key!==U.C0.ETX&&B.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:B.key,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(B.key,!0),!this.optionsService.rawOptions.screenReaderMode||D.altKey||D.ctrlKey?this.cancel(D,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(D,C){const B=D.isMac&&!this.options.macOptionIsMeta&&C.altKey&&!C.ctrlKey&&!C.metaKey||D.isWindows&&C.altKey&&C.ctrlKey&&!C.metaKey||D.isWindows&&C.getModifierState("AltGraph");return C.type==="keypress"?B:B&&(!C.keyCode||C.keyCode>47)}_keyUp(D){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1||(function(C){return C.keyCode===16||C.keyCode===17||C.keyCode===18}(D)||this.focus(),this.updateCursorStyle(D),this._keyPressHandled=!1)}_keyPress(D){let C;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;if(this.cancel(D),D.charCode)C=D.charCode;else if(D.which===null||D.which===void 0)C=D.keyCode;else{if(D.which===0||D.charCode===0)return!1;C=D.which}return!(!C||(D.altKey||D.ctrlKey||D.metaKey)&&!this._isThirdLevelShift(this.browser,D)||(C=String.fromCharCode(C),this._onKey.fire({key:C,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(C,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(D){if(D.data&&D.inputType==="insertText"&&(!D.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const C=D.data;return this.coreService.triggerDataEvent(C,!0),this.cancel(D),!0}return!1}resize(D,C){D!==this.cols||C!==this.rows?super.resize(D,C):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(D,C){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(P.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const D=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=D,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(D){if(this._renderService)switch(D){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const C=this._renderService.dimensions.css.canvas.width.toFixed(0),B=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${B};${C}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const O=this._renderService.dimensions.css.cell.width.toFixed(0),W=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${W};${O}t`)}}cancel(D,C){if(this.options.cancelEvents||C)return D.preventDefault(),D.stopPropagation(),!1}}s.Terminal=$},9924:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,_){this._rowCount=_,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=n-this._lastRefreshMs,u=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},u)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(R,s,o){var c=this&&this.__decorate||function(i,e,r,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,e,r,a);else for(var l=i.length-1;l>=0;l--)(f=i[l])&&(g=(p<3?f(g):p>3?f(e,r,g):f(e,r))||g);return p>3&&g&&Object.defineProperty(e,r,g),g},_=this&&this.__param||function(i,e){return function(r,a){e(r,a,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const n=o(3656),d=o(4725),u=o(8460),v=o(844),h=o(2585);let t=s.Viewport=class extends v.Disposable{constructor(i,e,r,a,f,p,g,l){super(),this._viewportElement=i,this._scrollArea=e,this._bufferService=r,this._optionsService=a,this._charSizeService=f,this._renderService=p,this._coreBrowserService=g,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(m=>this._activeBuffer=m.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(m=>this._renderDimensions=m)),this._handleThemeChange(l.colors),this.register(l.onChangeColors(m=>this._handleThemeChange(m))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(i){this._viewportElement.style.backgroundColor=i.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(i){if(i)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==i&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=i),this._refreshAnimationFrame=null}syncScrollArea(i=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(i);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(i)}_handleScroll(i){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const i=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(i*(this._smoothScrollState.target-this._smoothScrollState.origin)),i<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(i,e){const r=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&r<this._lastRecordedBufferHeight)||(i.cancelable&&i.preventDefault(),!1)}handleWheel(i){const e=this._getPixelsScrolled(i);return e!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(i,e))}scrollLines(i){if(i!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=i*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!1})}_getPixelsScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let e=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(i,e){let r,a="";const f=[],p=e??this._bufferService.buffer.lines.length,g=this._bufferService.buffer.lines;for(let l=i;l<p;l++){const m=g.get(l);if(!m)continue;const E=g.get(l+1)?.isWrapped;if(a+=m.translateToString(!E),!E||l===g.length-1){const x=document.createElement("div");x.textContent=a,f.push(x),a.length>0&&(r=x),a=""}}return{bufferElements:f,cursorElement:r}}getLinesScrolled(i){if(i.deltaY===0||i.shiftKey)return 0;let e=this._applyScrollModifier(i.deltaY,i);return i.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):i.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(i,e){const r=this._optionsService.rawOptions.fastScrollModifier;return r==="alt"&&e.altKey||r==="ctrl"&&e.ctrlKey||r==="shift"&&e.shiftKey?i*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:i*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(i){this._lastTouchY=i.touches[0].pageY}handleTouchMove(i){const e=this._lastTouchY-i.touches[0].pageY;return this._lastTouchY=i.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(i,e))}};s.Viewport=t=c([_(2,h.IBufferService),_(3,h.IOptionsService),_(4,d.ICharSizeService),_(5,d.IRenderService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],t)},3107:function(R,s,o){var c=this&&this.__decorate||function(h,t,i,e){var r,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,i,e);else for(var p=h.length-1;p>=0;p--)(r=h[p])&&(f=(a<3?r(f):a>3?r(t,i,f):r(t,i))||f);return a>3&&f&&Object.defineProperty(t,i,f),f},_=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const n=o(4725),d=o(844),u=o(2585);let v=s.BufferDecorationRenderer=class extends d.Disposable{constructor(h,t,i,e,r){super(),this._screenElement=h,this._bufferService=t,this._coreBrowserService=i,this._decorationService=e,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(a=>this._removeDecoration(a))),this.register((0,d.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){const t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",h?.options?.layer==="top"),t.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const i=h.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(h,t),t}_refreshStyle(h){const t=h.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let i=this._decorationElements.get(h);i||(i=this._createElement(h),h.element=i,this._decorationElements.set(h,i),this._container.appendChild(i),h.onDispose(()=>{this._decorationElements.delete(h),i.remove()})),i.style.top=t*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(i)}}_refreshXPosition(h,t=h.element){if(!t)return;const i=h.options.x??0;(h.options.anchor||"left")==="right"?t.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){this._decorationElements.get(h)?.remove(),this._decorationElements.delete(h),h.dispose()}};s.BufferDecorationRenderer=v=c([_(1,u.IBufferService),_(2,n.ICoreBrowserService),_(3,u.IDecorationService),_(4,n.IRenderService)],v)},5871:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,_){return c>=o.startBufferLine-this._linePadding[_||"full"]&&c<=o.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(R,s,o){var c=this&&this.__decorate||function(r,a,f,p){var g,l=arguments.length,m=l<3?a:p===null?p=Object.getOwnPropertyDescriptor(a,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,a,f,p);else for(var E=r.length-1;E>=0;E--)(g=r[E])&&(m=(l<3?g(m):l>3?g(a,f,m):g(a,f))||m);return l>3&&m&&Object.defineProperty(a,f,m),m},_=this&&this.__param||function(r,a){return function(f,p){a(f,p,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const n=o(5871),d=o(4725),u=o(844),v=o(2585),h={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0};let e=s.OverviewRulerRenderer=class extends u.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(r,a,f,p,g,l,m){super(),this._viewportElement=r,this._screenElement=a,this._bufferService=f,this._decorationService=p,this._renderService=g,this._optionsService=l,this._coreBrowserService=m,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const E=this._canvas.getContext("2d");if(!E)throw new Error("Ctx cannot be null");this._ctx=E,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,u.toDisposable)(()=>{this._canvas?.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const r=Math.floor(this._canvas.width/3),a=Math.ceil(this._canvas.width/3);t.full=this._canvas.width,t.left=r,t.center=a,t.right=r,this._refreshDrawHeightConstants(),i.full=0,i.left=0,i.center=t.left,i.right=t.left+t.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const r=this._canvas.height/this._bufferService.buffer.lines.length,a=Math.round(Math.max(Math.min(r,12),6)*this._coreBrowserService.dpr);h.left=a,h.center=a,h.right=a}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const a of this._decorationService.decorations)this._colorZoneStore.addDecoration(a);this._ctx.lineWidth=1;const r=this._colorZoneStore.zones;for(const a of r)a.position!=="full"&&this._renderColorZone(a);for(const a of r)a.position==="full"&&this._renderColorZone(a);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(r){this._ctx.fillStyle=r.color,this._ctx.fillRect(i[r.position||"full"],Math.round((this._canvas.height-1)*(r.startBufferLine/this._bufferService.buffers.active.lines.length)-h[r.position||"full"]/2),t[r.position||"full"],Math.round((this._canvas.height-1)*((r.endBufferLine-r.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[r.position||"full"]))}_queueRefresh(r,a){this._shouldUpdateDimensions=r||this._shouldUpdateDimensions,this._shouldUpdateAnchor=a||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=e=c([_(2,v.IBufferService),_(3,v.IDecorationService),_(4,d.IRenderService),_(5,v.IOptionsService),_(6,d.ICoreBrowserService)],e)},2950:function(R,s,o){var c=this&&this.__decorate||function(h,t,i,e){var r,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,i):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,i,e);else for(var p=h.length-1;p>=0;p--)(r=h[p])&&(f=(a<3?r(f):a>3?r(t,i,f):r(t,i))||f);return a>3&&f&&Object.defineProperty(t,i,f),f},_=this&&this.__param||function(h,t){return function(i,e){t(i,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const n=o(4725),d=o(2585),u=o(2584);let v=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(h,t,i,e,r,a){this._textarea=h,this._compositionView=t,this._bufferService=i,this._optionsService=e,this._coreService=r,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){const t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let i;this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,i=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;const t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){const h=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const t=this._textarea.value,i=t.replace(h,"");this._dataAlreadySent=i,t.length>h.length?this._coreService.triggerDataEvent(i,!0):t.length<h.length?this._coreService.triggerDataEvent(`${u.C0.DEL}`,!0):t.length===h.length&&t!==h&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(h){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const a=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}h||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=v=c([_(2,d.IBufferService),_(3,d.IOptionsService),_(4,d.ICoreService),_(5,n.IRenderService)],v)},9806:(R,s)=>{function o(c,_,n){const d=n.getBoundingClientRect(),u=c.getComputedStyle(n),v=parseInt(u.getPropertyValue("padding-left")),h=parseInt(u.getPropertyValue("padding-top"));return[_.clientX-d.left-v,_.clientY-d.top-h]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=o,s.getCoords=function(c,_,n,d,u,v,h,t,i){if(!v)return;const e=o(c,_,n);return e?(e[0]=Math.ceil((e[0]+(i?h/2:0))/h),e[1]=Math.ceil(e[1]/t),e[0]=Math.min(Math.max(e[0],1),d+(i?1:0)),e[1]=Math.min(Math.max(e[1],1),u),e):void 0}},9504:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=o(2584);function _(t,i,e,r){const a=t-n(t,e),f=i-n(i,e),p=Math.abs(a-f)-function(g,l,m){let E=0;const x=g-n(g,m),L=l-n(l,m);for(let b=0;b<Math.abs(x-L);b++){const A=d(g,l)==="A"?-1:1;m.buffer.lines.get(x+A*b)?.isWrapped&&E++}return E}(t,i,e);return h(p,v(d(t,i),r))}function n(t,i){let e=0,r=i.buffer.lines.get(t),a=r?.isWrapped;for(;a&&t>=0&&t<i.rows;)e++,r=i.buffer.lines.get(--t),a=r?.isWrapped;return e}function d(t,i){return t>i?"A":"B"}function u(t,i,e,r,a,f){let p=t,g=i,l="";for(;p!==e||g!==r;)p+=a?1:-1,a&&p>f.cols-1?(l+=f.buffer.translateBufferLineToString(g,!1,t,p),p=0,t=0,g++):!a&&p<0&&(l+=f.buffer.translateBufferLineToString(g,!1,0,t+1),p=f.cols-1,t=p,g--);return l+f.buffer.translateBufferLineToString(g,!1,t,p)}function v(t,i){const e=i?"O":"[";return c.C0.ESC+e+t}function h(t,i){t=Math.floor(t);let e="";for(let r=0;r<t;r++)e+=i;return e}s.moveToCellSequence=function(t,i,e,r){const a=e.buffer.x,f=e.buffer.y;if(!e.buffer.hasScrollback)return function(l,m,E,x,L,b){return _(m,x,L,b).length===0?"":h(u(l,m,l,m-n(m,L),!1,L).length,v("D",b))}(a,f,0,i,e,r)+_(f,i,e,r)+function(l,m,E,x,L,b){let A;A=_(m,x,L,b).length>0?x-n(x,L):m;const M=x,P=function(U,I,S,w,y,k){let T;return T=_(S,w,y,k).length>0?w-n(w,y):I,U<S&&T<=w||U>=S&&T<w?"C":"D"}(l,m,E,x,L,b);return h(u(l,A,E,M,P==="C",L).length,v(P,b))}(a,f,t,i,e,r);let p;if(f===i)return p=a>t?"D":"C",h(Math.abs(a-t),v(p,r));p=f>i?"D":"C";const g=Math.abs(f-i);return h(function(l,m){return m.cols-l}(f>i?t:a,e)+(g-1)*e.cols+1+((f>i?a:t)-1),v(p,r))}},1296:function(R,s,o){var c=this&&this.__decorate||function(b,A,M,P){var U,I=arguments.length,S=I<3?A:P===null?P=Object.getOwnPropertyDescriptor(A,M):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,A,M,P);else for(var w=b.length-1;w>=0;w--)(U=b[w])&&(S=(I<3?U(S):I>3?U(A,M,S):U(A,M))||S);return I>3&&S&&Object.defineProperty(A,M,S),S},_=this&&this.__param||function(b,A){return function(M,P){A(M,P,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const n=o(3787),d=o(2550),u=o(2223),v=o(6171),h=o(6052),t=o(4725),i=o(8055),e=o(8460),r=o(844),a=o(2585),f="xterm-dom-renderer-owner-",p="xterm-rows",g="xterm-fg-",l="xterm-bg-",m="xterm-focus",E="xterm-selection";let x=1,L=s.DomRenderer=class extends r.Disposable{constructor(b,A,M,P,U,I,S,w,y,k,T,H,$){super(),this._terminal=b,this._document=A,this._element=M,this._screenElement=P,this._viewportElement=U,this._helperContainer=I,this._linkifier2=S,this._charSizeService=y,this._optionsService=k,this._bufferService=T,this._coreBrowserService=H,this._themeService=$,this._terminalClass=x++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(p),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,v.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(z=>this._injectCss(z))),this._injectCss(this._themeService.colors),this._rowFactory=w.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(f+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(z=>this._handleLinkHover(z))),this.register(this._linkifier2.onHideLinkUnderline(z=>this._handleLinkLeave(z))),this.register((0,r.toDisposable)(()=>{this._element.classList.remove(f+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new d.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const b=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*b,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*b),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/b),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/b),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const M of this._rowElements)M.style.width=`${this.dimensions.css.canvas.width}px`,M.style.height=`${this.dimensions.css.cell.height}px`,M.style.lineHeight=`${this.dimensions.css.cell.height}px`,M.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const A=`${this._terminalSelector} .${p} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=A,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(b){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let A=`${this._terminalSelector} .${p} { color: ${b.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;A+=`${this._terminalSelector} .${p} .xterm-dim { color: ${i.color.multiplyOpacity(b.foreground,.5).css};}`,A+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const M=`blink_underline_${this._terminalClass}`,P=`blink_bar_${this._terminalClass}`,U=`blink_block_${this._terminalClass}`;A+=`@keyframes ${M} { 50% { border-bottom-style: hidden; }}`,A+=`@keyframes ${P} { 50% { box-shadow: none; }}`,A+=`@keyframes ${U} { 0% { background-color: ${b.cursor.css}; color: ${b.cursorAccent.css}; } 50% { background-color: inherit; color: ${b.cursor.css}; }}`,A+=`${this._terminalSelector} .${p}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${M} 1s step-end infinite;}${this._terminalSelector} .${p}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${p}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block { background-color: ${b.cursor.css}; color: ${b.cursorAccent.css};}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${b.cursor.css} !important; color: ${b.cursorAccent.css} !important;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${b.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${b.cursor.css} inset;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${b.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,A+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${b.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${b.selectionInactiveBackgroundOpaque.css};}`;for(const[I,S]of b.ansi.entries())A+=`${this._terminalSelector} .${g}${I} { color: ${S.css}; }${this._terminalSelector} .${g}${I}.xterm-dim { color: ${i.color.multiplyOpacity(S,.5).css}; }${this._terminalSelector} .${l}${I} { background-color: ${S.css}; }`;A+=`${this._terminalSelector} .${g}${u.INVERTED_DEFAULT_COLOR} { color: ${i.color.opaque(b.background).css}; }${this._terminalSelector} .${g}${u.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${i.color.multiplyOpacity(i.color.opaque(b.background),.5).css}; }${this._terminalSelector} .${l}${u.INVERTED_DEFAULT_COLOR} { background-color: ${b.foreground.css}; }`,this._themeStyleElement.textContent=A}_setDefaultSpacing(){const b=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${b}px`,this._rowFactory.defaultSpacing=b}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(b,A){for(let M=this._rowElements.length;M<=A;M++){const P=this._document.createElement("div");this._rowContainer.appendChild(P),this._rowElements.push(P)}for(;this._rowElements.length>A;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(b,A){this._refreshRowElements(b,A),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(m),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(m),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(b,A,M){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(b,A,M),this.renderRows(0,this._bufferService.rows-1),!b||!A)return;this._selectionRenderModel.update(this._terminal,b,A,M);const P=this._selectionRenderModel.viewportStartRow,U=this._selectionRenderModel.viewportEndRow,I=this._selectionRenderModel.viewportCappedStartRow,S=this._selectionRenderModel.viewportCappedEndRow;if(I>=this._bufferService.rows||S<0)return;const w=this._document.createDocumentFragment();if(M){const y=b[0]>A[0];w.appendChild(this._createSelectionElement(I,y?A[0]:b[0],y?b[0]:A[0],S-I+1))}else{const y=P===I?b[0]:0,k=I===U?A[0]:this._bufferService.cols;w.appendChild(this._createSelectionElement(I,y,k));const T=S-I-1;if(w.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,T)),I!==S){const H=U===S?A[0]:this._bufferService.cols;w.appendChild(this._createSelectionElement(S,0,H))}}this._selectionContainer.appendChild(w)}_createSelectionElement(b,A,M,P=1){const U=this._document.createElement("div"),I=A*this.dimensions.css.cell.width;let S=this.dimensions.css.cell.width*(M-A);return I+S>this.dimensions.css.canvas.width&&(S=this.dimensions.css.canvas.width-I),U.style.height=P*this.dimensions.css.cell.height+"px",U.style.top=b*this.dimensions.css.cell.height+"px",U.style.left=`${I}px`,U.style.width=`${S}px`,U}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const b of this._rowElements)b.replaceChildren()}renderRows(b,A){const M=this._bufferService.buffer,P=M.ybase+M.y,U=Math.min(M.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,w=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=b;y<=A;y++){const k=y+M.ydisp,T=this._rowElements[y],H=M.lines.get(k);if(!T||!H)break;T.replaceChildren(...this._rowFactory.createRow(H,k,k===P,S,w,U,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${f}${this._terminalClass}`}_handleLinkHover(b){this._setCellUnderline(b.x1,b.x2,b.y1,b.y2,b.cols,!0)}_handleLinkLeave(b){this._setCellUnderline(b.x1,b.x2,b.y1,b.y2,b.cols,!1)}_setCellUnderline(b,A,M,P,U,I){M<0&&(b=0),P<0&&(A=0);const S=this._bufferService.rows-1;M=Math.max(Math.min(M,S),0),P=Math.max(Math.min(P,S),0),U=Math.min(U,this._bufferService.cols);const w=this._bufferService.buffer,y=w.ybase+w.y,k=Math.min(w.x,U-1),T=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let z=M;z<=P;++z){const D=z+w.ydisp,C=this._rowElements[z],B=w.lines.get(D);if(!C||!B)break;C.replaceChildren(...this._rowFactory.createRow(B,D,D===y,H,$,k,T,this.dimensions.css.cell.width,this._widthCache,I?z===M?b:0:-1,I?(z===P?A:U)-1:-1))}}};s.DomRenderer=L=c([_(7,a.IInstantiationService),_(8,t.ICharSizeService),_(9,a.IOptionsService),_(10,a.IBufferService),_(11,t.ICoreBrowserService),_(12,t.IThemeService)],L)},3787:function(R,s,o){var c=this&&this.__decorate||function(p,g,l,m){var E,x=arguments.length,L=x<3?g:m===null?m=Object.getOwnPropertyDescriptor(g,l):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,g,l,m);else for(var b=p.length-1;b>=0;b--)(E=p[b])&&(L=(x<3?E(L):x>3?E(g,l,L):E(g,l))||L);return x>3&&L&&Object.defineProperty(g,l,L),L},_=this&&this.__param||function(p,g){return function(l,m){g(l,m,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const n=o(2223),d=o(643),u=o(511),v=o(2585),h=o(8055),t=o(4725),i=o(4269),e=o(6171),r=o(3734);let a=s.DomRendererRowFactory=class{constructor(p,g,l,m,E,x,L){this._document=p,this._characterJoinerService=g,this._optionsService=l,this._coreBrowserService=m,this._coreService=E,this._decorationService=x,this._themeService=L,this._workCell=new u.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(p,g,l){this._selectionStart=p,this._selectionEnd=g,this._columnSelectMode=l}createRow(p,g,l,m,E,x,L,b,A,M,P){const U=[],I=this._characterJoinerService.getJoinedCharacters(g),S=this._themeService.colors;let w,y=p.getNoBgTrimmedLength();l&&y<x+1&&(y=x+1);let k=0,T="",H=0,$=0,z=0,D=!1,C=0,B=!1,O=0;const W=[],F=M!==-1&&P!==-1;for(let X=0;X<y;X++){p.loadCell(X,this._workCell);let Q=this._workCell.getWidth();if(Q===0)continue;let ee=!1,re=X,q=this._workCell;if(I.length>0&&X===I[0][0]){ee=!0;const Z=I.shift();q=new i.JoinedCellData(this._workCell,p.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),re=Z[1]-1,Q=q.getWidth()}const le=this._isCellInSelection(X,g),Se=l&&X===x,Ce=F&&X>=M&&X<=P;let be=!1;this._decorationService.forEachDecorationAtCell(X,g,void 0,Z=>{be=!0});let pe=q.getChars()||d.WHITESPACE_CELL_CHAR;if(pe===" "&&(q.isUnderline()||q.isOverline())&&(pe=" "),O=Q*b-A.get(pe,q.isBold(),q.isItalic()),w){if(k&&(le&&B||!le&&!B&&q.bg===H)&&(le&&B&&S.selectionForeground||q.fg===$)&&q.extended.ext===z&&Ce===D&&O===C&&!Se&&!ee&&!be){q.isInvisible()?T+=d.WHITESPACE_CELL_CHAR:T+=pe,k++;continue}k&&(w.textContent=T),w=this._document.createElement("span"),k=0,T=""}else w=this._document.createElement("span");if(H=q.bg,$=q.fg,z=q.extended.ext,D=Ce,C=O,B=le,ee&&x>=X&&x<=re&&(x=X),!this._coreService.isCursorHidden&&Se&&this._coreService.isCursorInitialized){if(W.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&W.push("xterm-cursor-blink"),W.push(m==="bar"?"xterm-cursor-bar":m==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(E)switch(E){case"outline":W.push("xterm-cursor-outline");break;case"block":W.push("xterm-cursor-block");break;case"bar":W.push("xterm-cursor-bar");break;case"underline":W.push("xterm-cursor-underline")}}if(q.isBold()&&W.push("xterm-bold"),q.isItalic()&&W.push("xterm-italic"),q.isDim()&&W.push("xterm-dim"),T=q.isInvisible()?d.WHITESPACE_CELL_CHAR:q.getChars()||d.WHITESPACE_CELL_CHAR,q.isUnderline()&&(W.push(`xterm-underline-${q.extended.underlineStyle}`),T===" "&&(T=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${r.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let Z=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&Z<8&&(Z+=8),w.style.textDecorationColor=S.ansi[Z].css}q.isOverline()&&(W.push("xterm-overline"),T===" "&&(T=" ")),q.isStrikethrough()&&W.push("xterm-strikethrough"),Ce&&(w.style.textDecoration="underline");let se=q.getFgColor(),ce=q.getFgColorMode(),ne=q.getBgColor(),de=q.getBgColorMode();const we=!!q.isInverse();if(we){const Z=se;se=ne,ne=Z;const Ge=ce;ce=de,de=Ge}let ae,ve,he,ue=!1;switch(this._decorationService.forEachDecorationAtCell(X,g,void 0,Z=>{Z.options.layer!=="top"&&ue||(Z.backgroundColorRGB&&(de=50331648,ne=Z.backgroundColorRGB.rgba>>8&16777215,ae=Z.backgroundColorRGB),Z.foregroundColorRGB&&(ce=50331648,se=Z.foregroundColorRGB.rgba>>8&16777215,ve=Z.foregroundColorRGB),ue=Z.options.layer==="top")}),!ue&&le&&(ae=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,ne=ae.rgba>>8&16777215,de=50331648,ue=!0,S.selectionForeground&&(ce=50331648,se=S.selectionForeground.rgba>>8&16777215,ve=S.selectionForeground)),ue&&W.push("xterm-decoration-top"),de){case 16777216:case 33554432:he=S.ansi[ne],W.push(`xterm-bg-${ne}`);break;case 50331648:he=h.channels.toColor(ne>>16,ne>>8&255,255&ne),this._addStyle(w,`background-color:#${f((ne>>>0).toString(16),"0",6)}`);break;default:we?(he=S.foreground,W.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):he=S.background}switch(ae||q.isDim()&&(ae=h.color.multiplyOpacity(he,.5)),ce){case 16777216:case 33554432:q.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(w,he,S.ansi[se],q,ae,void 0)||W.push(`xterm-fg-${se}`);break;case 50331648:const Z=h.channels.toColor(se>>16&255,se>>8&255,255&se);this._applyMinimumContrast(w,he,Z,q,ae,ve)||this._addStyle(w,`color:#${f(se.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(w,he,S.foreground,q,ae,ve)||we&&W.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}W.length&&(w.className=W.join(" "),W.length=0),Se||ee||be?w.textContent=T:k++,O!==this.defaultSpacing&&(w.style.letterSpacing=`${O}px`),U.push(w),X=re}return w&&k&&(w.textContent=T),U}_applyMinimumContrast(p,g,l,m,E,x){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(m.getCode()))return!1;const L=this._getContrastCache(m);let b;if(E||x||(b=L.getColor(g.rgba,l.rgba)),b===void 0){const A=this._optionsService.rawOptions.minimumContrastRatio/(m.isDim()?2:1);b=h.color.ensureContrastRatio(E||g,x||l,A),L.setColor((E||g).rgba,(x||l).rgba,b??null)}return!!b&&(this._addStyle(p,`color:${b.css}`),!0)}_getContrastCache(p){return p.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(p,g){p.setAttribute("style",`${p.getAttribute("style")||""}${g};`)}_isCellInSelection(p,g){const l=this._selectionStart,m=this._selectionEnd;return!(!l||!m)&&(this._columnSelectMode?l[0]<=m[0]?p>=l[0]&&g>=l[1]&&p<m[0]&&g<=m[1]:p<l[0]&&g>=l[1]&&p>=m[0]&&g<=m[1]:g>l[1]&&g<m[1]||l[1]===m[1]&&g===l[1]&&p>=l[0]&&p<m[0]||l[1]<m[1]&&g===m[1]&&p<m[0]||l[1]<m[1]&&g===l[1]&&p>=l[0])}};function f(p,g,l){for(;p.length<l;)p=g+p;return p}s.DomRendererRowFactory=a=c([_(1,t.ICharacterJoinerService),_(2,v.IOptionsService),_(3,t.ICoreBrowserService),_(4,v.ICoreService),_(5,v.IDecorationService),_(6,t.IThemeService)],a)},2550:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=o.createElement("span");_.classList.add("xterm-char-measure-element");const n=o.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const d=o.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const u=o.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold",u.style.fontStyle="italic",this._measureElements=[_,n,d,u],this._container.appendChild(_),this._container.appendChild(n),this._container.appendChild(d),this._container.appendChild(u),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,c,_,n){o===this._font&&c===this._fontSize&&_===this._weight&&n===this._weightBold||(this._font=o,this._fontSize=c,this._weight=_,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(o,c,_){let n=0;if(!c&&!_&&o.length===1&&(n=o.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const v=this._measure(o,0);return v>0&&(this._flat[n]=v),v}let d=o;c&&(d+="B"),_&&(d+="I");let u=this._holey.get(d);if(u===void 0){let v=0;c&&(v|=1),_&&(v|=2),u=this._measure(o,v),u>0&&this._holey.set(d,u)}return u}_measure(o,c){const _=this._measureElements[c];return _.textContent=o.repeat(32),_.offsetWidth/32}}},2223:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(R,s)=>{function o(_){return 57508<=_&&_<=57558}function c(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},s.isEmoji=c,s.allowRescaling=function(_,n,d,u){return n===1&&d>Math.ceil(1.5*u)&&_!==void 0&&_>255&&!c(_)&&!o(_)&&!function(v){return 57344<=v&&v<=63743}(_)},s.treatGlyphAsBackgroundColor=function(_){return o(_)||function(n){return 9472<=n&&n<=9631}(_)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(_,n,d=0){return(_-(2*Math.round(n)-d))%(2*Math.round(n))}},6052:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,n,d,u=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const v=_.buffers.active.ydisp,h=n[1]-v,t=d[1]-v,i=Math.max(h,0),e=Math.min(t,_.rows-1);i>=_.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=u,this.viewportStartRow=h,this.viewportEndRow=t,this.viewportCappedStartRow=i,this.viewportCappedEndRow=e,this.startCol=n[0],this.endCol=d[0])}isCellSelected(_,n,d){return!!this.hasSelection&&(d-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},456:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(R,s,o){var c=this&&this.__decorate||function(e,r,a,f){var p,g=arguments.length,l=g<3?r:f===null?f=Object.getOwnPropertyDescriptor(r,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(r,a,l):p(r,a))||l);return g>3&&l&&Object.defineProperty(r,a,l),l},_=this&&this.__param||function(e,r){return function(a,f){r(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const n=o(2585),d=o(8460),u=o(844);let v=s.CharSizeService=class extends u.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,r,a){super(),this._optionsService=a,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new i(this._optionsService))}catch{this._measureStrategy=this.register(new t(e,r,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};s.CharSizeService=v=c([_(2,n.IOptionsService)],v);class h extends u.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(r,a){r!==void 0&&r>0&&a!==void 0&&a>0&&(this._result.width=r,this._result.height=a)}}class t extends h{constructor(r,a,f){super(),this._document=r,this._parentElement=a,this._optionsService=f,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class i extends h{constructor(r){super(),this._optionsService=r,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const a=this._ctx.measureText("W");if(!("width"in a&&"fontBoundingBoxAscent"in a&&"fontBoundingBoxDescent"in a))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const r=this._ctx.measureText("W");return this._validateAndSet(r.width,r.fontBoundingBoxAscent+r.fontBoundingBoxDescent),this._result}}},4269:function(R,s,o){var c=this&&this.__decorate||function(i,e,r,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,e,r,a);else for(var l=i.length-1;l>=0;l--)(f=i[l])&&(g=(p<3?f(g):p>3?f(e,r,g):f(e,r))||g);return p>3&&g&&Object.defineProperty(e,r,g),g},_=this&&this.__param||function(i,e){return function(r,a){e(r,a,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const n=o(3734),d=o(643),u=o(511),v=o(2585);class h extends n.AttributeData{constructor(e,r,a){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=r,this._width=a}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=h;let t=s.CharacterJoinerService=class je{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new u.CellData}register(e){const r={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(r),r.id}deregister(e){for(let r=0;r<this._characterJoiners.length;r++)if(this._characterJoiners[r].id===e)return this._characterJoiners.splice(r,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const r=this._bufferService.buffer.lines.get(e);if(!r||r.length===0)return[];const a=[],f=r.translateToString(!0);let p=0,g=0,l=0,m=r.getFg(0),E=r.getBg(0);for(let x=0;x<r.getTrimmedLength();x++)if(r.loadCell(x,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==m||this._workCell.bg!==E){if(x-p>1){const L=this._getJoinedRanges(f,l,g,r,p);for(let b=0;b<L.length;b++)a.push(L[b])}p=x,l=g,m=this._workCell.fg,E=this._workCell.bg}g+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-p>1){const x=this._getJoinedRanges(f,l,g,r,p);for(let L=0;L<x.length;L++)a.push(x[L])}return a}_getJoinedRanges(e,r,a,f,p){const g=e.substring(r,a);let l=[];try{l=this._characterJoiners[0].handler(g)}catch(m){console.error(m)}for(let m=1;m<this._characterJoiners.length;m++)try{const E=this._characterJoiners[m].handler(g);for(let x=0;x<E.length;x++)je._mergeRanges(l,E[x])}catch(E){console.error(E)}return this._stringRangesToCellRanges(l,f,p),l}_stringRangesToCellRanges(e,r,a){let f=0,p=!1,g=0,l=e[f];if(l){for(let m=a;m<this._bufferService.cols;m++){const E=r.getWidth(m),x=r.getString(m).length||d.WHITESPACE_CELL_CHAR.length;if(E!==0){if(!p&&l[0]<=g&&(l[0]=m,p=!0),l[1]<=g){if(l[1]=m,l=e[++f],!l)break;l[0]<=g?(l[0]=m,p=!0):p=!1}g+=x}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,r){let a=!1;for(let f=0;f<e.length;f++){const p=e[f];if(a){if(r[1]<=p[0])return e[f-1][1]=r[1],e;if(r[1]<=p[1])return e[f-1][1]=Math.max(r[1],p[1]),e.splice(f,1),e;e.splice(f,1),f--}else{if(r[1]<=p[0])return e.splice(f,0,r),e;if(r[1]<=p[1])return p[0]=Math.min(r[0],p[0]),e;r[0]<p[1]&&(p[0]=Math.min(r[0],p[0]),a=!0)}}return a?e[e.length-1][1]=r[1]:e.push(r),e}};s.CharacterJoinerService=t=c([_(0,v.IBufferService)],t)},5114:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=o(844),_=o(8460),n=o(3656);class d extends c.Disposable{constructor(h,t,i){super(),this._textarea=h,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new u(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(h){this._window!==h&&(this._window=h,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}s.CoreBrowserService=d;class u extends c.Disposable{constructor(h){super(),this._parentWindow=h,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(h){this._parentWindow=h,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=o(844);class _ extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const u=this.linkProviders.indexOf(d);u!==-1&&this.linkProviders.splice(u,1)}}}}s.LinkProviderService=_},8934:function(R,s,o){var c=this&&this.__decorate||function(v,h,t,i){var e,r=arguments.length,a=r<3?h:i===null?i=Object.getOwnPropertyDescriptor(h,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(v,h,t,i);else for(var f=v.length-1;f>=0;f--)(e=v[f])&&(a=(r<3?e(a):r>3?e(h,t,a):e(h,t))||a);return r>3&&a&&Object.defineProperty(h,t,a),a},_=this&&this.__param||function(v,h){return function(t,i){h(t,i,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const n=o(4725),d=o(9806);let u=s.MouseService=class{constructor(v,h){this._renderService=v,this._charSizeService=h}getCoords(v,h,t,i,e){return(0,d.getCoords)(window,v,h,t,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(v,h){const t=(0,d.getCoordsRelativeToElement)(window,v,h);if(this._charSizeService.hasValidSize)return t[0]=Math.min(Math.max(t[0],0),this._renderService.dimensions.css.canvas.width-1),t[1]=Math.min(Math.max(t[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(t[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(t[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(t[0]),y:Math.floor(t[1])}}};s.MouseService=u=c([_(0,n.IRenderService),_(1,n.ICharSizeService)],u)},3230:function(R,s,o){var c=this&&this.__decorate||function(e,r,a,f){var p,g=arguments.length,l=g<3?r:f===null?f=Object.getOwnPropertyDescriptor(r,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(r,a,l):p(r,a))||l);return g>3&&l&&Object.defineProperty(r,a,l),l},_=this&&this.__param||function(e,r){return function(a,f){r(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const n=o(6193),d=o(4725),u=o(8460),v=o(844),h=o(7226),t=o(2585);let i=s.RenderService=class extends v.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,r,a,f,p,g,l,m){super(),this._rowCount=e,this._charSizeService=f,this._renderer=this.register(new v.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._observerDisposable=this.register(new v.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new u.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new u.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new u.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new u.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer((E,x)=>this._renderRows(E,x),l),this.register(this._renderDebouncer),this.register(l.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(g.onResize(()=>this._fullRefresh())),this.register(g.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(a.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(p.onDecorationRegistered(()=>this._fullRefresh())),this.register(p.onDecorationRemoved(()=>this._fullRefresh())),this.register(a.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(g.cols,g.rows),this._fullRefresh()})),this.register(a.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(g.buffer.y,g.buffer.y,!0))),this.register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(l.window,r),this.register(l.onWindowChange(E=>this._registerIntersectionObserver(E,r)))}_registerIntersectionObserver(e,r){if("IntersectionObserver"in e){const a=new e.IntersectionObserver(f=>this._handleIntersectionChange(f[f.length-1]),{threshold:0});a.observe(r),this._observerDisposable.value=(0,v.toDisposable)(()=>a.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,r,a=!1){this._isPaused?this._needsFullRefresh=!0:(a||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,r,this._rowCount))}_renderRows(e,r){this._renderer.value&&(e=Math.min(e,this._rowCount-1),r=Math.min(r,this._rowCount-1),this._renderer.value.renderRows(e,r),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:r}),this._onRender.fire({start:e,end:r}),this._isNextRenderRedrawOnly=!0)}resize(e,r){this._rowCount=r,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(r=>this.refreshRows(r.start,r.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,r){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,r)):this._renderer.value.handleResize(e,r),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,r,a){this._selectionState.start=e,this._selectionState.end=r,this._selectionState.columnSelectMode=a,this._renderer.value?.handleSelectionChanged(e,r,a)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};s.RenderService=i=c([_(2,t.IOptionsService),_(3,d.ICharSizeService),_(4,t.IDecorationService),_(5,t.IBufferService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],i)},9312:function(R,s,o){var c=this&&this.__decorate||function(l,m,E,x){var L,b=arguments.length,A=b<3?m:x===null?x=Object.getOwnPropertyDescriptor(m,E):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(l,m,E,x);else for(var M=l.length-1;M>=0;M--)(L=l[M])&&(A=(b<3?L(A):b>3?L(m,E,A):L(m,E))||A);return b>3&&A&&Object.defineProperty(m,E,A),A},_=this&&this.__param||function(l,m){return function(E,x){m(E,x,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const n=o(9806),d=o(9504),u=o(456),v=o(4725),h=o(8460),t=o(844),i=o(6114),e=o(4841),r=o(511),a=o(2585),f=" ",p=new RegExp(f,"g");let g=s.SelectionService=class extends t.Disposable{constructor(l,m,E,x,L,b,A,M,P){super(),this._element=l,this._screenElement=m,this._linkifier=E,this._bufferService=x,this._coreService=L,this._mouseService=b,this._optionsService=A,this._renderService=M,this._coreBrowserService=P,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new r.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=U=>this._handleMouseMove(U),this._mouseUpListener=U=>this._handleMouseUp(U),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(U=>this._handleTrim(U)),this.register(this._bufferService.buffers.onBufferActivate(U=>this._handleBufferActivate(U))),this.enable(),this._model=new u.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const l=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;return!(!l||!m||l[0]===m[0]&&l[1]===m[1])}get selectionText(){const l=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;if(!l||!m)return"";const E=this._bufferService.buffer,x=[];if(this._activeSelectionMode===3){if(l[0]===m[0])return"";const L=l[0]<m[0]?l[0]:m[0],b=l[0]<m[0]?m[0]:l[0];for(let A=l[1];A<=m[1];A++){const M=E.translateBufferLineToString(A,!0,L,b);x.push(M)}}else{const L=l[1]===m[1]?m[0]:void 0;x.push(E.translateBufferLineToString(l[1],!0,l[0],L));for(let b=l[1]+1;b<=m[1]-1;b++){const A=E.lines.get(b),M=E.translateBufferLineToString(b,!0);A?.isWrapped?x[x.length-1]+=M:x.push(M)}if(l[1]!==m[1]){const b=E.lines.get(m[1]),A=E.translateBufferLineToString(m[1],!0,0,m[0]);b&&b.isWrapped?x[x.length-1]+=A:x.push(A)}}return x.map(L=>L.replace(p," ")).join(i.isWindows?`\r
|
|
5
|
+
WARNING: This link could potentially be dangerous`)){const r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=u=d([_(0,c.IBufferService),_(1,c.IOptionsService),_(2,c.IOscLinkService)],u)},6193:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(o,d){this._renderCallback=o,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,d,_){this._rowCount=_,o=o!==void 0?o:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const d=o(3614),_=o(3656),n=o(3551),c=o(9042),u=o(3730),v=o(1680),h=o(3107),t=o(5744),r=o(2950),e=o(1296),i=o(428),a=o(4269),f=o(5114),p=o(8934),g=o(3230),l=o(9312),m=o(4725),E=o(6731),x=o(8055),L=o(8969),b=o(8460),A=o(844),M=o(6114),I=o(8437),U=o(2584),P=o(7399),S=o(5941),w=o(9074),y=o(2585),k=o(5435),T=o(4567),H=o(779);class $ extends L.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(D={}){super(D),this.browser=M,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new A.MutableDisposable),this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new b.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new b.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new b.EventEmitter),this._onBlur=this.register(new b.EventEmitter),this._onA11yCharEmitter=this.register(new b.EventEmitter),this._onA11yTabEmitter=this.register(new b.EventEmitter),this._onWillOpen=this.register(new b.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(w.DecorationService),this._instantiationService.setService(y.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(H.LinkProviderService),this._instantiationService.setService(m.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(u.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((C,B)=>this.refresh(C,B))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(C=>this._reportWindowsOptions(C))),this.register(this._inputHandler.onColor(C=>this._handleColorEvent(C))),this.register((0,b.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,b.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,b.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,b.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(C=>this._afterResize(C.cols,C.rows))),this.register((0,A.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(D){if(this._themeService)for(const C of D){let B,O="";switch(C.index){case 256:B="foreground",O="10";break;case 257:B="background",O="11";break;case 258:B="cursor",O="12";break;default:B="ansi",O="4;"+C.index}switch(C.type){case 0:const W=x.color.toColorRGB(B==="ansi"?this._themeService.colors.ansi[C.index]:this._themeService.colors[B]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${O};${(0,S.toRgbString)(W)}${U.C1_ESCAPED.ST}`);break;case 1:if(B==="ansi")this._themeService.modifyColors(F=>F.ansi[C.index]=x.channels.toColor(...C.color));else{const F=B;this._themeService.modifyColors(X=>X[F]=x.channels.toColor(...C.color))}break;case 2:this._themeService.restoreColor(C.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(D){D?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(T.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(D){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const D=this.buffer.ybase+this.buffer.y,C=this.buffer.lines.get(D);if(!C)return;const B=Math.min(this.buffer.x,this.cols-1),O=this._renderService.dimensions.css.cell.height,W=C.getWidth(B),F=this._renderService.dimensions.css.cell.width*W,X=this.buffer.y*this._renderService.dimensions.css.cell.height,Q=B*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Q+"px",this.textarea.style.top=X+"px",this.textarea.style.width=F+"px",this.textarea.style.height=O+"px",this.textarea.style.lineHeight=O+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",C=>{this.hasSelection()&&(0,d.copyHandler)(C,this._selectionService)}));const D=C=>(0,d.handlePasteEvent)(C,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",D)),this.register((0,_.addDisposableDomListener)(this.element,"paste",D)),M.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",C=>{C.button===2&&(0,d.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",C=>{(0,d.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),M.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",C=>{C.button===1&&(0,d.moveTextAreaUnderMouseCursor)(C,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",D=>this._keyUp(D),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",D=>this._keyDown(D),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",D=>this._keyPress(D),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",D=>this._compositionHelper.compositionupdate(D))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",D=>this._inputEvent(D),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(D){if(!D)throw new Error("Terminal requires a parent element.");if(D.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=D.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),D.appendChild(this.element);const C=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),C.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",B=>this.updateCursorStyle(B))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),C.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",c.promptLabel),M.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(f.CoreBrowserService,this.textarea,D.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",B=>this._handleTextAreaFocus(B))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(E.ThemeService),this._instantiationService.setService(m.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(a.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(g.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(B=>this._onRender.fire(B))),this.onResize(B=>this._renderService.resize(B.cols,B.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(r.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(p.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(C);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(v.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(B=>this.scrollLines(B.amount,B.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(l.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(B=>this.scrollLines(B.amount,B.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(B=>this._renderService.handleSelectionChanged(B.start,B.end,B.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(B=>{this.textarea.value=B,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(B=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(h.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",B=>this._selectionService.handleMouseDown(B))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(T.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",B=>this._handleScreenReaderModeOptionChange(B))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",B=>{!this._overviewRulerRenderer&&B&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(t.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const D=this,C=this.element;function B(F){const X=D._mouseService.getMouseReportCoords(F,D.screenElement);if(!X)return!1;let Q,ee;switch(F.overrideType||F.type){case"mousemove":ee=32,F.buttons===void 0?(Q=3,F.button!==void 0&&(Q=F.button<3?F.button:3)):Q=1&F.buttons?0:4&F.buttons?1:2&F.buttons?2:3;break;case"mouseup":ee=0,Q=F.button<3?F.button:3;break;case"mousedown":ee=1,Q=F.button<3?F.button:3;break;case"wheel":if(D._customWheelEventHandler&&D._customWheelEventHandler(F)===!1||D.viewport.getLinesScrolled(F)===0)return!1;ee=F.deltaY<0?0:1,Q=4;break;default:return!1}return!(ee===void 0||Q===void 0||Q>4)&&D.coreMouseService.triggerMouseEvent({col:X.col,row:X.row,x:X.x,y:X.y,button:Q,action:ee,ctrl:F.ctrlKey,alt:F.altKey,shift:F.shiftKey})}const O={mouseup:null,wheel:null,mousedrag:null,mousemove:null},W={mouseup:F=>(B(F),F.buttons||(this._document.removeEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.removeEventListener("mousemove",O.mousedrag)),this.cancel(F)),wheel:F=>(B(F),this.cancel(F,!0)),mousedrag:F=>{F.buttons&&B(F)},mousemove:F=>{F.buttons||B(F)}};this.register(this.coreMouseService.onProtocolChange(F=>{F?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(F)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&F?O.mousemove||(C.addEventListener("mousemove",W.mousemove),O.mousemove=W.mousemove):(C.removeEventListener("mousemove",O.mousemove),O.mousemove=null),16&F?O.wheel||(C.addEventListener("wheel",W.wheel,{passive:!1}),O.wheel=W.wheel):(C.removeEventListener("wheel",O.wheel),O.wheel=null),2&F?O.mouseup||(O.mouseup=W.mouseup):(this._document.removeEventListener("mouseup",O.mouseup),O.mouseup=null),4&F?O.mousedrag||(O.mousedrag=W.mousedrag):(this._document.removeEventListener("mousemove",O.mousedrag),O.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(C,"mousedown",F=>{if(F.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(F))return B(F),O.mouseup&&this._document.addEventListener("mouseup",O.mouseup),O.mousedrag&&this._document.addEventListener("mousemove",O.mousedrag),this.cancel(F)})),this.register((0,_.addDisposableDomListener)(C,"wheel",F=>{if(!O.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(F)===!1)return!1;if(!this.buffer.hasScrollback){const X=this.viewport.getLinesScrolled(F);if(X===0)return;const Q=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(F.deltaY<0?"A":"B");let ee="";for(let re=0;re<Math.abs(X);re++)ee+=Q;return this.coreService.triggerDataEvent(ee,!0),this.cancel(F,!0)}return this.viewport.handleWheel(F)?this.cancel(F):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(C,"touchstart",F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(F),this.cancel(F)},{passive:!0})),this.register((0,_.addDisposableDomListener)(C,"touchmove",F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(F)?void 0:this.cancel(F)},{passive:!1}))}refresh(D,C){this._renderService?.refreshRows(D,C)}updateCursorStyle(D){this._selectionService?.shouldColumnSelect(D)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(D,C,B=0){B===1?(super.scrollLines(D,C,B),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(D)}paste(D){(0,d.paste)(D,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(D){this._customKeyEventHandler=D}attachCustomWheelEventHandler(D){this._customWheelEventHandler=D}registerLinkProvider(D){return this._linkProviderService.registerLinkProvider(D)}registerCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const C=this._characterJoinerService.register(D);return this.refresh(0,this.rows-1),C}deregisterCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(D)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(D){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+D)}registerDecoration(D){return this._decorationService.registerDecoration(D)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(D,C,B){this._selectionService.setSelection(D,C,B)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(D,C){this._selectionService?.selectLines(D,C)}_keyDown(D){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;const C=this.browser.isMac&&this.options.macOptionIsMeta&&D.altKey;if(!C&&!this._compositionHelper.keydown(D))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;C||D.key!=="Dead"&&D.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const B=(0,P.evaluateKeyboardEvent)(D,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(D),B.type===3||B.type===2){const O=this.rows-1;return this.scrollLines(B.type===2?-O:O),this.cancel(D,!0)}return B.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,D)||(B.cancel&&this.cancel(D,!0),!B.key||!!(D.key&&!D.ctrlKey&&!D.altKey&&!D.metaKey&&D.key.length===1&&D.key.charCodeAt(0)>=65&&D.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(B.key!==U.C0.ETX&&B.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:B.key,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(B.key,!0),!this.optionsService.rawOptions.screenReaderMode||D.altKey||D.ctrlKey?this.cancel(D,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(D,C){const B=D.isMac&&!this.options.macOptionIsMeta&&C.altKey&&!C.ctrlKey&&!C.metaKey||D.isWindows&&C.altKey&&C.ctrlKey&&!C.metaKey||D.isWindows&&C.getModifierState("AltGraph");return C.type==="keypress"?B:B&&(!C.keyCode||C.keyCode>47)}_keyUp(D){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1||(function(C){return C.keyCode===16||C.keyCode===17||C.keyCode===18}(D)||this.focus(),this.updateCursorStyle(D),this._keyPressHandled=!1)}_keyPress(D){let C;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;if(this.cancel(D),D.charCode)C=D.charCode;else if(D.which===null||D.which===void 0)C=D.keyCode;else{if(D.which===0||D.charCode===0)return!1;C=D.which}return!(!C||(D.altKey||D.ctrlKey||D.metaKey)&&!this._isThirdLevelShift(this.browser,D)||(C=String.fromCharCode(C),this._onKey.fire({key:C,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(C,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(D){if(D.data&&D.inputType==="insertText"&&(!D.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const C=D.data;return this.coreService.triggerDataEvent(C,!0),this.cancel(D),!0}return!1}resize(D,C){D!==this.cols||C!==this.rows?super.resize(D,C):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(D,C){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(I.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const D=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=D,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(D){if(this._renderService)switch(D){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const C=this._renderService.dimensions.css.canvas.width.toFixed(0),B=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${B};${C}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const O=this._renderService.dimensions.css.cell.width.toFixed(0),W=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${W};${O}t`)}}cancel(D,C){if(this.options.cancelEvents||C)return D.preventDefault(),D.stopPropagation(),!1}}s.Terminal=$},9924:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(o,d=1e3){this._renderCallback=o,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,d,_){this._rowCount=_,o=o!==void 0?o:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const c=n-this._lastRefreshMs,u=this._debounceThresholdMS-c;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},u)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,d)}}},1680:function(R,s,o){var d=this&&this.__decorate||function(r,e,i,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,e,i,a);else for(var l=r.length-1;l>=0;l--)(f=r[l])&&(g=(p<3?f(g):p>3?f(e,i,g):f(e,i))||g);return p>3&&g&&Object.defineProperty(e,i,g),g},_=this&&this.__param||function(r,e){return function(i,a){e(i,a,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const n=o(3656),c=o(4725),u=o(8460),v=o(844),h=o(2585);let t=s.Viewport=class extends v.Disposable{constructor(r,e,i,a,f,p,g,l){super(),this._viewportElement=r,this._scrollArea=e,this._bufferService=i,this._optionsService=a,this._charSizeService=f,this._renderService=p,this._coreBrowserService=g,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(m=>this._activeBuffer=m.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(m=>this._renderDimensions=m)),this._handleThemeChange(l.colors),this.register(l.onChangeColors(m=>this._handleThemeChange(m))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(r){this._viewportElement.style.backgroundColor=r.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(r){if(r)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==r&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=r),this._refreshAnimationFrame=null}syncScrollArea(r=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(r);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(r)}_handleScroll(r){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const r=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(r*(this._smoothScrollState.target-this._smoothScrollState.origin)),r<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(r,e){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&i<this._lastRecordedBufferHeight)||(r.cancelable&&r.preventDefault(),!1)}handleWheel(r){const e=this._getPixelsScrolled(r);return e!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(r,e))}scrollLines(r){if(r!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=r*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:r,suppressScrollEvent:!1})}_getPixelsScrolled(r){if(r.deltaY===0||r.shiftKey)return 0;let e=this._applyScrollModifier(r.deltaY,r);return r.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:r.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(r,e){let i,a="";const f=[],p=e??this._bufferService.buffer.lines.length,g=this._bufferService.buffer.lines;for(let l=r;l<p;l++){const m=g.get(l);if(!m)continue;const E=g.get(l+1)?.isWrapped;if(a+=m.translateToString(!E),!E||l===g.length-1){const x=document.createElement("div");x.textContent=a,f.push(x),a.length>0&&(i=x),a=""}}return{bufferElements:f,cursorElement:i}}getLinesScrolled(r){if(r.deltaY===0||r.shiftKey)return 0;let e=this._applyScrollModifier(r.deltaY,r);return r.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):r.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(r,e){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&e.altKey||i==="ctrl"&&e.ctrlKey||i==="shift"&&e.shiftKey?r*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:r*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(r){this._lastTouchY=r.touches[0].pageY}handleTouchMove(r){const e=this._lastTouchY-r.touches[0].pageY;return this._lastTouchY=r.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(r,e))}};s.Viewport=t=d([_(2,h.IBufferService),_(3,h.IOptionsService),_(4,c.ICharSizeService),_(5,c.IRenderService),_(6,c.ICoreBrowserService),_(7,c.IThemeService)],t)},3107:function(R,s,o){var d=this&&this.__decorate||function(h,t,r,e){var i,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,r):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,r,e);else for(var p=h.length-1;p>=0;p--)(i=h[p])&&(f=(a<3?i(f):a>3?i(t,r,f):i(t,r))||f);return a>3&&f&&Object.defineProperty(t,r,f),f},_=this&&this.__param||function(h,t){return function(r,e){t(r,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const n=o(4725),c=o(844),u=o(2585);let v=s.BufferDecorationRenderer=class extends c.Disposable{constructor(h,t,r,e,i){super(),this._screenElement=h,this._bufferService=t,this._coreBrowserService=r,this._decorationService=e,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(a=>this._removeDecoration(a))),this.register((0,c.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){const t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",h?.options?.layer==="top"),t.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const r=h.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(h,t),t}_refreshStyle(h){const t=h.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let r=this._decorationElements.get(h);r||(r=this._createElement(h),h.element=r,this._decorationElements.set(h,r),this._container.appendChild(r),h.onDispose(()=>{this._decorationElements.delete(h),r.remove()})),r.style.top=t*this._renderService.dimensions.css.cell.height+"px",r.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(r)}}_refreshXPosition(h,t=h.element){if(!t)return;const r=h.options.x??0;(h.options.anchor||"left")==="right"?t.style.right=r?r*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=r?r*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){this._decorationElements.get(h)?.remove(),this._decorationElements.delete(h),h.dispose()}};s.BufferDecorationRenderer=v=d([_(1,u.IBufferService),_(2,n.ICoreBrowserService),_(3,u.IDecorationService),_(4,n.IRenderService)],v)},5871:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const d of this._zones)if(d.color===o.options.overviewRulerOptions.color&&d.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,o.marker.line))return;if(this._lineAdjacentToZone(d,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(d,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,d){return d>=o.startBufferLine&&d<=o.endBufferLine}_lineAdjacentToZone(o,d,_){return d>=o.startBufferLine-this._linePadding[_||"full"]&&d<=o.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(o,d){o.startBufferLine=Math.min(o.startBufferLine,d),o.endBufferLine=Math.max(o.endBufferLine,d)}}},5744:function(R,s,o){var d=this&&this.__decorate||function(i,a,f,p){var g,l=arguments.length,m=l<3?a:p===null?p=Object.getOwnPropertyDescriptor(a,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,a,f,p);else for(var E=i.length-1;E>=0;E--)(g=i[E])&&(m=(l<3?g(m):l>3?g(a,f,m):g(a,f))||m);return l>3&&m&&Object.defineProperty(a,f,m),m},_=this&&this.__param||function(i,a){return function(f,p){a(f,p,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const n=o(5871),c=o(4725),u=o(844),v=o(2585),h={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0};let e=s.OverviewRulerRenderer=class extends u.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(i,a,f,p,g,l,m){super(),this._viewportElement=i,this._screenElement=a,this._bufferService=f,this._decorationService=p,this._renderService=g,this._optionsService=l,this._coreBrowserService=m,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const E=this._canvas.getContext("2d");if(!E)throw new Error("Ctx cannot be null");this._ctx=E,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,u.toDisposable)(()=>{this._canvas?.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const i=Math.floor(this._canvas.width/3),a=Math.ceil(this._canvas.width/3);t.full=this._canvas.width,t.left=i,t.center=a,t.right=i,this._refreshDrawHeightConstants(),r.full=0,r.left=0,r.center=t.left,r.right=t.left+t.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const i=this._canvas.height/this._bufferService.buffer.lines.length,a=Math.round(Math.max(Math.min(i,12),6)*this._coreBrowserService.dpr);h.left=a,h.center=a,h.right=a}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const a of this._decorationService.decorations)this._colorZoneStore.addDecoration(a);this._ctx.lineWidth=1;const i=this._colorZoneStore.zones;for(const a of i)a.position!=="full"&&this._renderColorZone(a);for(const a of i)a.position==="full"&&this._renderColorZone(a);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(i){this._ctx.fillStyle=i.color,this._ctx.fillRect(r[i.position||"full"],Math.round((this._canvas.height-1)*(i.startBufferLine/this._bufferService.buffers.active.lines.length)-h[i.position||"full"]/2),t[i.position||"full"],Math.round((this._canvas.height-1)*((i.endBufferLine-i.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[i.position||"full"]))}_queueRefresh(i,a){this._shouldUpdateDimensions=i||this._shouldUpdateDimensions,this._shouldUpdateAnchor=a||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=e=d([_(2,v.IBufferService),_(3,v.IDecorationService),_(4,c.IRenderService),_(5,v.IOptionsService),_(6,c.ICoreBrowserService)],e)},2950:function(R,s,o){var d=this&&this.__decorate||function(h,t,r,e){var i,a=arguments.length,f=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,r):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,t,r,e);else for(var p=h.length-1;p>=0;p--)(i=h[p])&&(f=(a<3?i(f):a>3?i(t,r,f):i(t,r))||f);return a>3&&f&&Object.defineProperty(t,r,f),f},_=this&&this.__param||function(h,t){return function(r,e){t(r,e,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const n=o(4725),c=o(2585),u=o(2584);let v=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(h,t,r,e,i,a){this._textarea=h,this._compositionView=t,this._bufferService=r,this._optionsService=e,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){const t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let r;this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,r=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;const t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){const h=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const t=this._textarea.value,r=t.replace(h,"");this._dataAlreadySent=r,t.length>h.length?this._coreService.triggerDataEvent(r,!0):t.length<h.length?this._coreService.triggerDataEvent(`${u.C0.DEL}`,!0):t.length===h.length&&t!==h&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(h){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const a=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}h||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=v=d([_(2,c.IBufferService),_(3,c.IOptionsService),_(4,c.ICoreService),_(5,n.IRenderService)],v)},9806:(R,s)=>{function o(d,_,n){const c=n.getBoundingClientRect(),u=d.getComputedStyle(n),v=parseInt(u.getPropertyValue("padding-left")),h=parseInt(u.getPropertyValue("padding-top"));return[_.clientX-c.left-v,_.clientY-c.top-h]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=o,s.getCoords=function(d,_,n,c,u,v,h,t,r){if(!v)return;const e=o(d,_,n);return e?(e[0]=Math.ceil((e[0]+(r?h/2:0))/h),e[1]=Math.ceil(e[1]/t),e[0]=Math.min(Math.max(e[0],1),c+(r?1:0)),e[1]=Math.min(Math.max(e[1],1),u),e):void 0}},9504:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const d=o(2584);function _(t,r,e,i){const a=t-n(t,e),f=r-n(r,e),p=Math.abs(a-f)-function(g,l,m){let E=0;const x=g-n(g,m),L=l-n(l,m);for(let b=0;b<Math.abs(x-L);b++){const A=c(g,l)==="A"?-1:1;m.buffer.lines.get(x+A*b)?.isWrapped&&E++}return E}(t,r,e);return h(p,v(c(t,r),i))}function n(t,r){let e=0,i=r.buffer.lines.get(t),a=i?.isWrapped;for(;a&&t>=0&&t<r.rows;)e++,i=r.buffer.lines.get(--t),a=i?.isWrapped;return e}function c(t,r){return t>r?"A":"B"}function u(t,r,e,i,a,f){let p=t,g=r,l="";for(;p!==e||g!==i;)p+=a?1:-1,a&&p>f.cols-1?(l+=f.buffer.translateBufferLineToString(g,!1,t,p),p=0,t=0,g++):!a&&p<0&&(l+=f.buffer.translateBufferLineToString(g,!1,0,t+1),p=f.cols-1,t=p,g--);return l+f.buffer.translateBufferLineToString(g,!1,t,p)}function v(t,r){const e=r?"O":"[";return d.C0.ESC+e+t}function h(t,r){t=Math.floor(t);let e="";for(let i=0;i<t;i++)e+=r;return e}s.moveToCellSequence=function(t,r,e,i){const a=e.buffer.x,f=e.buffer.y;if(!e.buffer.hasScrollback)return function(l,m,E,x,L,b){return _(m,x,L,b).length===0?"":h(u(l,m,l,m-n(m,L),!1,L).length,v("D",b))}(a,f,0,r,e,i)+_(f,r,e,i)+function(l,m,E,x,L,b){let A;A=_(m,x,L,b).length>0?x-n(x,L):m;const M=x,I=function(U,P,S,w,y,k){let T;return T=_(S,w,y,k).length>0?w-n(w,y):P,U<S&&T<=w||U>=S&&T<w?"C":"D"}(l,m,E,x,L,b);return h(u(l,A,E,M,I==="C",L).length,v(I,b))}(a,f,t,r,e,i);let p;if(f===r)return p=a>t?"D":"C",h(Math.abs(a-t),v(p,i));p=f>r?"D":"C";const g=Math.abs(f-r);return h(function(l,m){return m.cols-l}(f>r?t:a,e)+(g-1)*e.cols+1+((f>r?a:t)-1),v(p,i))}},1296:function(R,s,o){var d=this&&this.__decorate||function(b,A,M,I){var U,P=arguments.length,S=P<3?A:I===null?I=Object.getOwnPropertyDescriptor(A,M):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,A,M,I);else for(var w=b.length-1;w>=0;w--)(U=b[w])&&(S=(P<3?U(S):P>3?U(A,M,S):U(A,M))||S);return P>3&&S&&Object.defineProperty(A,M,S),S},_=this&&this.__param||function(b,A){return function(M,I){A(M,I,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const n=o(3787),c=o(2550),u=o(2223),v=o(6171),h=o(6052),t=o(4725),r=o(8055),e=o(8460),i=o(844),a=o(2585),f="xterm-dom-renderer-owner-",p="xterm-rows",g="xterm-fg-",l="xterm-bg-",m="xterm-focus",E="xterm-selection";let x=1,L=s.DomRenderer=class extends i.Disposable{constructor(b,A,M,I,U,P,S,w,y,k,T,H,$){super(),this._terminal=b,this._document=A,this._element=M,this._screenElement=I,this._viewportElement=U,this._helperContainer=P,this._linkifier2=S,this._charSizeService=y,this._optionsService=k,this._bufferService=T,this._coreBrowserService=H,this._themeService=$,this._terminalClass=x++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(p),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,v.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(z=>this._injectCss(z))),this._injectCss(this._themeService.colors),this._rowFactory=w.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(f+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(z=>this._handleLinkHover(z))),this.register(this._linkifier2.onHideLinkUnderline(z=>this._handleLinkLeave(z))),this.register((0,i.toDisposable)(()=>{this._element.classList.remove(f+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new c.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const b=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*b,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*b),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/b),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/b),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const M of this._rowElements)M.style.width=`${this.dimensions.css.canvas.width}px`,M.style.height=`${this.dimensions.css.cell.height}px`,M.style.lineHeight=`${this.dimensions.css.cell.height}px`,M.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const A=`${this._terminalSelector} .${p} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=A,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(b){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let A=`${this._terminalSelector} .${p} { color: ${b.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;A+=`${this._terminalSelector} .${p} .xterm-dim { color: ${r.color.multiplyOpacity(b.foreground,.5).css};}`,A+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const M=`blink_underline_${this._terminalClass}`,I=`blink_bar_${this._terminalClass}`,U=`blink_block_${this._terminalClass}`;A+=`@keyframes ${M} { 50% { border-bottom-style: hidden; }}`,A+=`@keyframes ${I} { 50% { box-shadow: none; }}`,A+=`@keyframes ${U} { 0% { background-color: ${b.cursor.css}; color: ${b.cursorAccent.css}; } 50% { background-color: inherit; color: ${b.cursor.css}; }}`,A+=`${this._terminalSelector} .${p}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${M} 1s step-end infinite;}${this._terminalSelector} .${p}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${p}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block { background-color: ${b.cursor.css}; color: ${b.cursorAccent.css};}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${b.cursor.css} !important; color: ${b.cursorAccent.css} !important;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${b.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${b.cursor.css} inset;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${b.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,A+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${b.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${b.selectionInactiveBackgroundOpaque.css};}`;for(const[P,S]of b.ansi.entries())A+=`${this._terminalSelector} .${g}${P} { color: ${S.css}; }${this._terminalSelector} .${g}${P}.xterm-dim { color: ${r.color.multiplyOpacity(S,.5).css}; }${this._terminalSelector} .${l}${P} { background-color: ${S.css}; }`;A+=`${this._terminalSelector} .${g}${u.INVERTED_DEFAULT_COLOR} { color: ${r.color.opaque(b.background).css}; }${this._terminalSelector} .${g}${u.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${r.color.multiplyOpacity(r.color.opaque(b.background),.5).css}; }${this._terminalSelector} .${l}${u.INVERTED_DEFAULT_COLOR} { background-color: ${b.foreground.css}; }`,this._themeStyleElement.textContent=A}_setDefaultSpacing(){const b=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${b}px`,this._rowFactory.defaultSpacing=b}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(b,A){for(let M=this._rowElements.length;M<=A;M++){const I=this._document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>A;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(b,A){this._refreshRowElements(b,A),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(m),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(m),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(b,A,M){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(b,A,M),this.renderRows(0,this._bufferService.rows-1),!b||!A)return;this._selectionRenderModel.update(this._terminal,b,A,M);const I=this._selectionRenderModel.viewportStartRow,U=this._selectionRenderModel.viewportEndRow,P=this._selectionRenderModel.viewportCappedStartRow,S=this._selectionRenderModel.viewportCappedEndRow;if(P>=this._bufferService.rows||S<0)return;const w=this._document.createDocumentFragment();if(M){const y=b[0]>A[0];w.appendChild(this._createSelectionElement(P,y?A[0]:b[0],y?b[0]:A[0],S-P+1))}else{const y=I===P?b[0]:0,k=P===U?A[0]:this._bufferService.cols;w.appendChild(this._createSelectionElement(P,y,k));const T=S-P-1;if(w.appendChild(this._createSelectionElement(P+1,0,this._bufferService.cols,T)),P!==S){const H=U===S?A[0]:this._bufferService.cols;w.appendChild(this._createSelectionElement(S,0,H))}}this._selectionContainer.appendChild(w)}_createSelectionElement(b,A,M,I=1){const U=this._document.createElement("div"),P=A*this.dimensions.css.cell.width;let S=this.dimensions.css.cell.width*(M-A);return P+S>this.dimensions.css.canvas.width&&(S=this.dimensions.css.canvas.width-P),U.style.height=I*this.dimensions.css.cell.height+"px",U.style.top=b*this.dimensions.css.cell.height+"px",U.style.left=`${P}px`,U.style.width=`${S}px`,U}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const b of this._rowElements)b.replaceChildren()}renderRows(b,A){const M=this._bufferService.buffer,I=M.ybase+M.y,U=Math.min(M.x,this._bufferService.cols-1),P=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,w=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=b;y<=A;y++){const k=y+M.ydisp,T=this._rowElements[y],H=M.lines.get(k);if(!T||!H)break;T.replaceChildren(...this._rowFactory.createRow(H,k,k===I,S,w,U,P,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${f}${this._terminalClass}`}_handleLinkHover(b){this._setCellUnderline(b.x1,b.x2,b.y1,b.y2,b.cols,!0)}_handleLinkLeave(b){this._setCellUnderline(b.x1,b.x2,b.y1,b.y2,b.cols,!1)}_setCellUnderline(b,A,M,I,U,P){M<0&&(b=0),I<0&&(A=0);const S=this._bufferService.rows-1;M=Math.max(Math.min(M,S),0),I=Math.max(Math.min(I,S),0),U=Math.min(U,this._bufferService.cols);const w=this._bufferService.buffer,y=w.ybase+w.y,k=Math.min(w.x,U-1),T=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let z=M;z<=I;++z){const D=z+w.ydisp,C=this._rowElements[z],B=w.lines.get(D);if(!C||!B)break;C.replaceChildren(...this._rowFactory.createRow(B,D,D===y,H,$,k,T,this.dimensions.css.cell.width,this._widthCache,P?z===M?b:0:-1,P?(z===I?A:U)-1:-1))}}};s.DomRenderer=L=d([_(7,a.IInstantiationService),_(8,t.ICharSizeService),_(9,a.IOptionsService),_(10,a.IBufferService),_(11,t.ICoreBrowserService),_(12,t.IThemeService)],L)},3787:function(R,s,o){var d=this&&this.__decorate||function(p,g,l,m){var E,x=arguments.length,L=x<3?g:m===null?m=Object.getOwnPropertyDescriptor(g,l):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,g,l,m);else for(var b=p.length-1;b>=0;b--)(E=p[b])&&(L=(x<3?E(L):x>3?E(g,l,L):E(g,l))||L);return x>3&&L&&Object.defineProperty(g,l,L),L},_=this&&this.__param||function(p,g){return function(l,m){g(l,m,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const n=o(2223),c=o(643),u=o(511),v=o(2585),h=o(8055),t=o(4725),r=o(4269),e=o(6171),i=o(3734);let a=s.DomRendererRowFactory=class{constructor(p,g,l,m,E,x,L){this._document=p,this._characterJoinerService=g,this._optionsService=l,this._coreBrowserService=m,this._coreService=E,this._decorationService=x,this._themeService=L,this._workCell=new u.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(p,g,l){this._selectionStart=p,this._selectionEnd=g,this._columnSelectMode=l}createRow(p,g,l,m,E,x,L,b,A,M,I){const U=[],P=this._characterJoinerService.getJoinedCharacters(g),S=this._themeService.colors;let w,y=p.getNoBgTrimmedLength();l&&y<x+1&&(y=x+1);let k=0,T="",H=0,$=0,z=0,D=!1,C=0,B=!1,O=0;const W=[],F=M!==-1&&I!==-1;for(let X=0;X<y;X++){p.loadCell(X,this._workCell);let Q=this._workCell.getWidth();if(Q===0)continue;let ee=!1,re=X,q=this._workCell;if(P.length>0&&X===P[0][0]){ee=!0;const Z=P.shift();q=new r.JoinedCellData(this._workCell,p.translateToString(!0,Z[0],Z[1]),Z[1]-Z[0]),re=Z[1]-1,Q=q.getWidth()}const le=this._isCellInSelection(X,g),Se=l&&X===x,Ce=F&&X>=M&&X<=I;let be=!1;this._decorationService.forEachDecorationAtCell(X,g,void 0,Z=>{be=!0});let pe=q.getChars()||c.WHITESPACE_CELL_CHAR;if(pe===" "&&(q.isUnderline()||q.isOverline())&&(pe=" "),O=Q*b-A.get(pe,q.isBold(),q.isItalic()),w){if(k&&(le&&B||!le&&!B&&q.bg===H)&&(le&&B&&S.selectionForeground||q.fg===$)&&q.extended.ext===z&&Ce===D&&O===C&&!Se&&!ee&&!be){q.isInvisible()?T+=c.WHITESPACE_CELL_CHAR:T+=pe,k++;continue}k&&(w.textContent=T),w=this._document.createElement("span"),k=0,T=""}else w=this._document.createElement("span");if(H=q.bg,$=q.fg,z=q.extended.ext,D=Ce,C=O,B=le,ee&&x>=X&&x<=re&&(x=X),!this._coreService.isCursorHidden&&Se&&this._coreService.isCursorInitialized){if(W.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&W.push("xterm-cursor-blink"),W.push(m==="bar"?"xterm-cursor-bar":m==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(E)switch(E){case"outline":W.push("xterm-cursor-outline");break;case"block":W.push("xterm-cursor-block");break;case"bar":W.push("xterm-cursor-bar");break;case"underline":W.push("xterm-cursor-underline")}}if(q.isBold()&&W.push("xterm-bold"),q.isItalic()&&W.push("xterm-italic"),q.isDim()&&W.push("xterm-dim"),T=q.isInvisible()?c.WHITESPACE_CELL_CHAR:q.getChars()||c.WHITESPACE_CELL_CHAR,q.isUnderline()&&(W.push(`xterm-underline-${q.extended.underlineStyle}`),T===" "&&(T=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let Z=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&Z<8&&(Z+=8),w.style.textDecorationColor=S.ansi[Z].css}q.isOverline()&&(W.push("xterm-overline"),T===" "&&(T=" ")),q.isStrikethrough()&&W.push("xterm-strikethrough"),Ce&&(w.style.textDecoration="underline");let se=q.getFgColor(),ce=q.getFgColorMode(),ne=q.getBgColor(),de=q.getBgColorMode();const we=!!q.isInverse();if(we){const Z=se;se=ne,ne=Z;const Ge=ce;ce=de,de=Ge}let ae,ve,he,ue=!1;switch(this._decorationService.forEachDecorationAtCell(X,g,void 0,Z=>{Z.options.layer!=="top"&&ue||(Z.backgroundColorRGB&&(de=50331648,ne=Z.backgroundColorRGB.rgba>>8&16777215,ae=Z.backgroundColorRGB),Z.foregroundColorRGB&&(ce=50331648,se=Z.foregroundColorRGB.rgba>>8&16777215,ve=Z.foregroundColorRGB),ue=Z.options.layer==="top")}),!ue&&le&&(ae=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,ne=ae.rgba>>8&16777215,de=50331648,ue=!0,S.selectionForeground&&(ce=50331648,se=S.selectionForeground.rgba>>8&16777215,ve=S.selectionForeground)),ue&&W.push("xterm-decoration-top"),de){case 16777216:case 33554432:he=S.ansi[ne],W.push(`xterm-bg-${ne}`);break;case 50331648:he=h.channels.toColor(ne>>16,ne>>8&255,255&ne),this._addStyle(w,`background-color:#${f((ne>>>0).toString(16),"0",6)}`);break;default:we?(he=S.foreground,W.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):he=S.background}switch(ae||q.isDim()&&(ae=h.color.multiplyOpacity(he,.5)),ce){case 16777216:case 33554432:q.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(w,he,S.ansi[se],q,ae,void 0)||W.push(`xterm-fg-${se}`);break;case 50331648:const Z=h.channels.toColor(se>>16&255,se>>8&255,255&se);this._applyMinimumContrast(w,he,Z,q,ae,ve)||this._addStyle(w,`color:#${f(se.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(w,he,S.foreground,q,ae,ve)||we&&W.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}W.length&&(w.className=W.join(" "),W.length=0),Se||ee||be?w.textContent=T:k++,O!==this.defaultSpacing&&(w.style.letterSpacing=`${O}px`),U.push(w),X=re}return w&&k&&(w.textContent=T),U}_applyMinimumContrast(p,g,l,m,E,x){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(m.getCode()))return!1;const L=this._getContrastCache(m);let b;if(E||x||(b=L.getColor(g.rgba,l.rgba)),b===void 0){const A=this._optionsService.rawOptions.minimumContrastRatio/(m.isDim()?2:1);b=h.color.ensureContrastRatio(E||g,x||l,A),L.setColor((E||g).rgba,(x||l).rgba,b??null)}return!!b&&(this._addStyle(p,`color:${b.css}`),!0)}_getContrastCache(p){return p.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(p,g){p.setAttribute("style",`${p.getAttribute("style")||""}${g};`)}_isCellInSelection(p,g){const l=this._selectionStart,m=this._selectionEnd;return!(!l||!m)&&(this._columnSelectMode?l[0]<=m[0]?p>=l[0]&&g>=l[1]&&p<m[0]&&g<=m[1]:p<l[0]&&g>=l[1]&&p>=m[0]&&g<=m[1]:g>l[1]&&g<m[1]||l[1]===m[1]&&g===l[1]&&p>=l[0]&&p<m[0]||l[1]<m[1]&&g===m[1]&&p<m[0]||l[1]<m[1]&&g===l[1]&&p>=l[0])}};function f(p,g,l){for(;p.length<l;)p=g+p;return p}s.DomRendererRowFactory=a=d([_(1,t.ICharacterJoinerService),_(2,v.IOptionsService),_(3,t.ICoreBrowserService),_(4,v.ICoreService),_(5,v.IDecorationService),_(6,t.IThemeService)],a)},2550:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(o,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=o.createElement("span");_.classList.add("xterm-char-measure-element");const n=o.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const c=o.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontStyle="italic";const u=o.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold",u.style.fontStyle="italic",this._measureElements=[_,n,c,u],this._container.appendChild(_),this._container.appendChild(n),this._container.appendChild(c),this._container.appendChild(u),d.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,d,_,n){o===this._font&&d===this._fontSize&&_===this._weight&&n===this._weightBold||(this._font=o,this._fontSize=d,this._weight=_,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(o,d,_){let n=0;if(!d&&!_&&o.length===1&&(n=o.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const v=this._measure(o,0);return v>0&&(this._flat[n]=v),v}let c=o;d&&(c+="B"),_&&(c+="I");let u=this._holey.get(c);if(u===void 0){let v=0;d&&(v|=1),_&&(v|=2),u=this._measure(o,v),u>0&&this._holey.set(c,u)}return u}_measure(o,d){const _=this._measureElements[d];return _.textContent=o.repeat(32),_.offsetWidth/32}}},2223:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=o(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(R,s)=>{function o(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},s.isEmoji=d,s.allowRescaling=function(_,n,c,u){return n===1&&c>Math.ceil(1.5*u)&&_!==void 0&&_>255&&!d(_)&&!o(_)&&!function(v){return 57344<=v&&v<=63743}(_)},s.treatGlyphAsBackgroundColor=function(_){return o(_)||function(n){return 9472<=n&&n<=9631}(_)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(_,n,c=0){return(_-(2*Math.round(n)-c))%(2*Math.round(n))}},6052:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,n,c,u=!1){if(this.selectionStart=n,this.selectionEnd=c,!n||!c||n[0]===c[0]&&n[1]===c[1])return void this.clear();const v=_.buffers.active.ydisp,h=n[1]-v,t=c[1]-v,r=Math.max(h,0),e=Math.min(t,_.rows-1);r>=_.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=u,this.viewportStartRow=h,this.viewportEndRow=t,this.viewportCappedStartRow=r,this.viewportCappedEndRow=e,this.startCol=n[0],this.endCol=c[0])}isCellSelected(_,n,c){return!!this.hasSelection&&(c-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&c>=this.viewportCappedStartRow&&n<this.endCol&&c<=this.viewportCappedEndRow:n<this.startCol&&c>=this.viewportCappedStartRow&&n>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&c===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportStartRow&&n>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},456:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,d=this.selectionEnd;return!(!o||!d)&&(o[1]>d[1]||o[1]===d[1]&&o[0]>d[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(R,s,o){var d=this&&this.__decorate||function(e,i,a,f){var p,g=arguments.length,l=g<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(i,a,l):p(i,a))||l);return g>3&&l&&Object.defineProperty(i,a,l),l},_=this&&this.__param||function(e,i){return function(a,f){i(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const n=o(2585),c=o(8460),u=o(844);let v=s.CharSizeService=class extends u.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,i,a){super(),this._optionsService=a,this.width=0,this.height=0,this._onCharSizeChange=this.register(new c.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new r(this._optionsService))}catch{this._measureStrategy=this.register(new t(e,i,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};s.CharSizeService=v=d([_(2,n.IOptionsService)],v);class h extends u.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(i,a){i!==void 0&&i>0&&a!==void 0&&a>0&&(this._result.width=i,this._result.height=a)}}class t extends h{constructor(i,a,f){super(),this._document=i,this._parentElement=a,this._optionsService=f,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class r extends h{constructor(i){super(),this._optionsService=i,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const a=this._ctx.measureText("W");if(!("width"in a&&"fontBoundingBoxAscent"in a&&"fontBoundingBoxDescent"in a))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const i=this._ctx.measureText("W");return this._validateAndSet(i.width,i.fontBoundingBoxAscent+i.fontBoundingBoxDescent),this._result}}},4269:function(R,s,o){var d=this&&this.__decorate||function(r,e,i,a){var f,p=arguments.length,g=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,e,i,a);else for(var l=r.length-1;l>=0;l--)(f=r[l])&&(g=(p<3?f(g):p>3?f(e,i,g):f(e,i))||g);return p>3&&g&&Object.defineProperty(e,i,g),g},_=this&&this.__param||function(r,e){return function(i,a){e(i,a,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const n=o(3734),c=o(643),u=o(511),v=o(2585);class h extends n.AttributeData{constructor(e,i,a){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=a}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=h;let t=s.CharacterJoinerService=class je{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new u.CellData}register(e){const i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===e)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(e);if(!i||i.length===0)return[];const a=[],f=i.translateToString(!0);let p=0,g=0,l=0,m=i.getFg(0),E=i.getBg(0);for(let x=0;x<i.getTrimmedLength();x++)if(i.loadCell(x,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==m||this._workCell.bg!==E){if(x-p>1){const L=this._getJoinedRanges(f,l,g,i,p);for(let b=0;b<L.length;b++)a.push(L[b])}p=x,l=g,m=this._workCell.fg,E=this._workCell.bg}g+=this._workCell.getChars().length||c.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-p>1){const x=this._getJoinedRanges(f,l,g,i,p);for(let L=0;L<x.length;L++)a.push(x[L])}return a}_getJoinedRanges(e,i,a,f,p){const g=e.substring(i,a);let l=[];try{l=this._characterJoiners[0].handler(g)}catch(m){console.error(m)}for(let m=1;m<this._characterJoiners.length;m++)try{const E=this._characterJoiners[m].handler(g);for(let x=0;x<E.length;x++)je._mergeRanges(l,E[x])}catch(E){console.error(E)}return this._stringRangesToCellRanges(l,f,p),l}_stringRangesToCellRanges(e,i,a){let f=0,p=!1,g=0,l=e[f];if(l){for(let m=a;m<this._bufferService.cols;m++){const E=i.getWidth(m),x=i.getString(m).length||c.WHITESPACE_CELL_CHAR.length;if(E!==0){if(!p&&l[0]<=g&&(l[0]=m,p=!0),l[1]<=g){if(l[1]=m,l=e[++f],!l)break;l[0]<=g?(l[0]=m,p=!0):p=!1}g+=x}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,i){let a=!1;for(let f=0;f<e.length;f++){const p=e[f];if(a){if(i[1]<=p[0])return e[f-1][1]=i[1],e;if(i[1]<=p[1])return e[f-1][1]=Math.max(i[1],p[1]),e.splice(f,1),e;e.splice(f,1),f--}else{if(i[1]<=p[0])return e.splice(f,0,i),e;if(i[1]<=p[1])return p[0]=Math.min(i[0],p[0]),e;i[0]<p[1]&&(p[0]=Math.min(i[0],p[0]),a=!0)}}return a?e[e.length-1][1]=i[1]:e.push(i),e}};s.CharacterJoinerService=t=d([_(0,v.IBufferService)],t)},5114:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const d=o(844),_=o(8460),n=o(3656);class c extends d.Disposable{constructor(h,t,r){super(),this._textarea=h,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new u(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(h){this._window!==h&&(this._window=h,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}s.CoreBrowserService=c;class u extends d.Disposable{constructor(h){super(),this._parentWindow=h,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)(()=>this.clearListener()))}setWindow(h){this._parentWindow=h,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const d=o(844);class _ extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(c){return this.linkProviders.push(c),{dispose:()=>{const u=this.linkProviders.indexOf(c);u!==-1&&this.linkProviders.splice(u,1)}}}}s.LinkProviderService=_},8934:function(R,s,o){var d=this&&this.__decorate||function(v,h,t,r){var e,i=arguments.length,a=i<3?h:r===null?r=Object.getOwnPropertyDescriptor(h,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(v,h,t,r);else for(var f=v.length-1;f>=0;f--)(e=v[f])&&(a=(i<3?e(a):i>3?e(h,t,a):e(h,t))||a);return i>3&&a&&Object.defineProperty(h,t,a),a},_=this&&this.__param||function(v,h){return function(t,r){h(t,r,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const n=o(4725),c=o(9806);let u=s.MouseService=class{constructor(v,h){this._renderService=v,this._charSizeService=h}getCoords(v,h,t,r,e){return(0,c.getCoords)(window,v,h,t,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(v,h){const t=(0,c.getCoordsRelativeToElement)(window,v,h);if(this._charSizeService.hasValidSize)return t[0]=Math.min(Math.max(t[0],0),this._renderService.dimensions.css.canvas.width-1),t[1]=Math.min(Math.max(t[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(t[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(t[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(t[0]),y:Math.floor(t[1])}}};s.MouseService=u=d([_(0,n.IRenderService),_(1,n.ICharSizeService)],u)},3230:function(R,s,o){var d=this&&this.__decorate||function(e,i,a,f){var p,g=arguments.length,l=g<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(i,a,l):p(i,a))||l);return g>3&&l&&Object.defineProperty(i,a,l),l},_=this&&this.__param||function(e,i){return function(a,f){i(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const n=o(6193),c=o(4725),u=o(8460),v=o(844),h=o(7226),t=o(2585);let r=s.RenderService=class extends v.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,i,a,f,p,g,l,m){super(),this._rowCount=e,this._charSizeService=f,this._renderer=this.register(new v.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._observerDisposable=this.register(new v.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new u.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new u.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new u.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new u.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer((E,x)=>this._renderRows(E,x),l),this.register(this._renderDebouncer),this.register(l.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(g.onResize(()=>this._fullRefresh())),this.register(g.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(a.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(p.onDecorationRegistered(()=>this._fullRefresh())),this.register(p.onDecorationRemoved(()=>this._fullRefresh())),this.register(a.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(g.cols,g.rows),this._fullRefresh()})),this.register(a.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(g.buffer.y,g.buffer.y,!0))),this.register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(l.window,i),this.register(l.onWindowChange(E=>this._registerIntersectionObserver(E,i)))}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){const a=new e.IntersectionObserver(f=>this._handleIntersectionChange(f[f.length-1]),{threshold:0});a.observe(i),this._observerDisposable.value=(0,v.toDisposable)(()=>a.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i,a=!1){this._isPaused?this._needsFullRefresh=!0:(a||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount))}_renderRows(e,i){this._renderer.value&&(e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0)}resize(e,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,a){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=a,this._renderer.value?.handleSelectionChanged(e,i,a)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};s.RenderService=r=d([_(2,t.IOptionsService),_(3,c.ICharSizeService),_(4,t.IDecorationService),_(5,t.IBufferService),_(6,c.ICoreBrowserService),_(7,c.IThemeService)],r)},9312:function(R,s,o){var d=this&&this.__decorate||function(l,m,E,x){var L,b=arguments.length,A=b<3?m:x===null?x=Object.getOwnPropertyDescriptor(m,E):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(l,m,E,x);else for(var M=l.length-1;M>=0;M--)(L=l[M])&&(A=(b<3?L(A):b>3?L(m,E,A):L(m,E))||A);return b>3&&A&&Object.defineProperty(m,E,A),A},_=this&&this.__param||function(l,m){return function(E,x){m(E,x,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const n=o(9806),c=o(9504),u=o(456),v=o(4725),h=o(8460),t=o(844),r=o(6114),e=o(4841),i=o(511),a=o(2585),f=" ",p=new RegExp(f,"g");let g=s.SelectionService=class extends t.Disposable{constructor(l,m,E,x,L,b,A,M,I){super(),this._element=l,this._screenElement=m,this._linkifier=E,this._bufferService=x,this._coreService=L,this._mouseService=b,this._optionsService=A,this._renderService=M,this._coreBrowserService=I,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new i.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=U=>this._handleMouseMove(U),this._mouseUpListener=U=>this._handleMouseUp(U),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(U=>this._handleTrim(U)),this.register(this._bufferService.buffers.onBufferActivate(U=>this._handleBufferActivate(U))),this.enable(),this._model=new u.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const l=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;return!(!l||!m||l[0]===m[0]&&l[1]===m[1])}get selectionText(){const l=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;if(!l||!m)return"";const E=this._bufferService.buffer,x=[];if(this._activeSelectionMode===3){if(l[0]===m[0])return"";const L=l[0]<m[0]?l[0]:m[0],b=l[0]<m[0]?m[0]:l[0];for(let A=l[1];A<=m[1];A++){const M=E.translateBufferLineToString(A,!0,L,b);x.push(M)}}else{const L=l[1]===m[1]?m[0]:void 0;x.push(E.translateBufferLineToString(l[1],!0,l[0],L));for(let b=l[1]+1;b<=m[1]-1;b++){const A=E.lines.get(b),M=E.translateBufferLineToString(b,!0);A?.isWrapped?x[x.length-1]+=M:x.push(M)}if(l[1]!==m[1]){const b=E.lines.get(m[1]),A=E.translateBufferLineToString(m[1],!0,0,m[0]);b&&b.isWrapped?x[x.length-1]+=A:x.push(A)}}return x.map(L=>L.replace(p," ")).join(r.isWindows?`\r
|
|
6
6
|
`:`
|
|
7
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(l){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),i.isLinux&&l&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(l){const m=this._getMouseBufferCoords(l),E=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!!(E&&x&&m)&&this._areCoordsInSelection(m,E,x)}isCellInSelection(l,m){const E=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!E||!x)&&this._areCoordsInSelection([l,m],E,x)}_areCoordsInSelection(l,m,E){return l[1]>m[1]&&l[1]<E[1]||m[1]===E[1]&&l[1]===m[1]&&l[0]>=m[0]&&l[0]<E[0]||m[1]<E[1]&&l[1]===E[1]&&l[0]<E[0]||m[1]<E[1]&&l[1]===m[1]&&l[0]>=m[0]}_selectWordAtCursor(l,m){const E=this._linkifier.currentLink?.link?.range;if(E)return this._model.selectionStart=[E.start.x-1,E.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const x=this._getMouseBufferCoords(l);return!!x&&(this._selectWordAt(x,m),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,m){this._model.clearSelection(),l=Math.max(l,0),m=Math.min(m,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,m],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){const m=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(m)return m[0]--,m[1]--,m[1]+=this._bufferService.buffer.ydisp,m}_getMouseEventScrollAmount(l){let m=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1];const E=this._renderService.dimensions.css.canvas.height;return m>=0&&m<=E?0:(m>E&&(m-=E),m=Math.min(Math.max(m,-50),50),m/=50,m/Math.abs(m)+Math.round(14*m))}shouldForceSelection(l){return i.isMac?l.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:l.shiftKey}handleMouseDown(l){if(this._mouseDownTimeStamp=l.timeStamp,(l.button!==2||!this.hasSelection)&&l.button===0){if(!this._enabled){if(!this.shouldForceSelection(l))return;l.stopPropagation()}l.preventDefault(),this._dragScrollAmount=0,this._enabled&&l.shiftKey?this._handleIncrementalClick(l):l.detail===1?this._handleSingleClick(l):l.detail===2?this._handleDoubleClick(l):l.detail===3&&this._handleTripleClick(l),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(l){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(l))}_handleSingleClick(l){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(l)?3:0,this._model.selectionStart=this._getMouseBufferCoords(l),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const m=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);m&&m.length!==this._model.selectionStart[0]&&m.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){const m=this._getMouseBufferCoords(l);m&&(this._activeSelectionMode=2,this._selectLineAt(m[1]))}shouldColumnSelect(l){return l.altKey&&!(i.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;const m=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(l),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(l),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const E=this._bufferService.buffer;if(this._model.selectionEnd[1]<E.lines.length){const x=E.lines.get(this._model.selectionEnd[1]);x&&x.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}m&&m[0]===this._model.selectionEnd[0]&&m[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const l=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(l.ydisp+this._bufferService.rows,l.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=l.ydisp),this.refresh()}}_handleMouseUp(l){const m=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&m<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const E=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(E&&E[0]!==void 0&&E[1]!==void 0){const x=(0,d.moveToCellSequence)(E[0]-1,E[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(x,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const l=this._model.finalSelectionStart,m=this._model.finalSelectionEnd,E=!(!l||!m||l[0]===m[0]&&l[1]===m[1]);E?l&&m&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&m[0]===this._oldSelectionEnd[0]&&m[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,m,E)):this._oldHasSelection&&this._fireOnSelectionChange(l,m,E)}_fireOnSelectionChange(l,m,E){this._oldSelectionStart=l,this._oldSelectionEnd=m,this._oldHasSelection=E,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim(m=>this._handleTrim(m))}_convertViewportColToCharacterIndex(l,m){let E=m;for(let x=0;m>=x;x++){const L=l.loadCell(x,this._workCell).getChars().length;this._workCell.getWidth()===0?E--:L>1&&m!==x&&(E+=L-1)}return E}setSelection(l,m,E){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,m],this._model.selectionStartLength=E,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,m,E=!0,x=!0){if(l[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,b=L.lines.get(l[1]);if(!b)return;const A=L.translateBufferLineToString(l[1],!1);let M=this._convertViewportColToCharacterIndex(b,l[0]),P=M;const U=l[0]-M;let I=0,S=0,w=0,y=0;if(A.charAt(M)===" "){for(;M>0&&A.charAt(M-1)===" ";)M--;for(;P<A.length&&A.charAt(P+1)===" ";)P++}else{let H=l[0],$=l[0];b.getWidth(H)===0&&(I++,H--),b.getWidth($)===2&&(S++,$++);const z=b.getString($).length;for(z>1&&(y+=z-1,P+=z-1);H>0&&M>0&&!this._isCharWordSeparator(b.loadCell(H-1,this._workCell));){b.loadCell(H-1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,H--):D>1&&(w+=D-1,M-=D-1),M--,H--}for(;$<b.length&&P+1<A.length&&!this._isCharWordSeparator(b.loadCell($+1,this._workCell));){b.loadCell($+1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,$++):D>1&&(y+=D-1,P+=D-1),P++,$++}}P++;let k=M+U-I+w,T=Math.min(this._bufferService.cols,P-M+I+S-w-y);if(m||A.slice(M,P).trim()!==""){if(E&&k===0&&b.getCodePoint(0)!==32){const H=L.lines.get(l[1]-1);if(H&&b.isWrapped&&H.getCodePoint(this._bufferService.cols-1)!==32){const $=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if($){const z=this._bufferService.cols-$.start;k-=z,T+=z}}}if(x&&k+T===this._bufferService.cols&&b.getCodePoint(this._bufferService.cols-1)!==32){const H=L.lines.get(l[1]+1);if(H?.isWrapped&&H.getCodePoint(0)!==32){const $=this._getWordAt([0,l[1]+1],!1,!1,!0);$&&(T+=$.length)}}return{start:k,length:T}}}_selectWordAt(l,m){const E=this._getWordAt(l,m);if(E){for(;E.start<0;)E.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[E.start,l[1]],this._model.selectionStartLength=E.length}}_selectToWordAt(l){const m=this._getWordAt(l,!0);if(m){let E=l[1];for(;m.start<0;)m.start+=this._bufferService.cols,E--;if(!this._model.areSelectionValuesReversed())for(;m.start+m.length>this._bufferService.cols;)m.length-=this._bufferService.cols,E++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?m.start:m.start+m.length,E]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){const m=this._bufferService.buffer.getWrappedRangeForLine(l),E={start:{x:0,y:m.first},end:{x:this._bufferService.cols-1,y:m.last}};this._model.selectionStart=[0,m.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols)}};s.SelectionService=g=c([_(3,a.IBufferService),_(4,a.ICoreService),_(5,v.IMouseService),_(6,a.IOptionsService),_(7,v.IRenderService),_(8,v.ICoreBrowserService)],g)},4725:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=o(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(R,s,o){var c=this&&this.__decorate||function(g,l,m,E){var x,L=arguments.length,b=L<3?l:E===null?E=Object.getOwnPropertyDescriptor(l,m):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(g,l,m,E);else for(var A=g.length-1;A>=0;A--)(x=g[A])&&(b=(L<3?x(b):L>3?x(l,m,b):x(l,m))||b);return L>3&&b&&Object.defineProperty(l,m,b),b},_=this&&this.__param||function(g,l){return function(m,E){l(m,E,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const n=o(7239),d=o(8055),u=o(8460),v=o(844),h=o(2585),t=d.css.toColor("#ffffff"),i=d.css.toColor("#000000"),e=d.css.toColor("#ffffff"),r=d.css.toColor("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const g=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],l=[0,95,135,175,215,255];for(let m=0;m<216;m++){const E=l[m/36%6|0],x=l[m/6%6|0],L=l[m%6];g.push({css:d.channels.toCss(E,x,L),rgba:d.channels.toRgba(E,x,L)})}for(let m=0;m<24;m++){const E=8+10*m;g.push({css:d.channels.toCss(E,E,E),rgba:d.channels.toRgba(E,E,E)})}return g})());let f=s.ThemeService=class extends v.Disposable{get colors(){return this._colors}constructor(g){super(),this._optionsService=g,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new u.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:t,background:i,cursor:e,cursorAccent:r,selectionForeground:void 0,selectionBackgroundTransparent:a,selectionBackgroundOpaque:d.color.blend(i,a),selectionInactiveBackgroundTransparent:a,selectionInactiveBackgroundOpaque:d.color.blend(i,a),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(g={}){const l=this._colors;if(l.foreground=p(g.foreground,t),l.background=p(g.background,i),l.cursor=p(g.cursor,e),l.cursorAccent=p(g.cursorAccent,r),l.selectionBackgroundTransparent=p(g.selectionBackground,a),l.selectionBackgroundOpaque=d.color.blend(l.background,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundTransparent=p(g.selectionInactiveBackground,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundOpaque=d.color.blend(l.background,l.selectionInactiveBackgroundTransparent),l.selectionForeground=g.selectionForeground?p(g.selectionForeground,d.NULL_COLOR):void 0,l.selectionForeground===d.NULL_COLOR&&(l.selectionForeground=void 0),d.color.isOpaque(l.selectionBackgroundTransparent)&&(l.selectionBackgroundTransparent=d.color.opacity(l.selectionBackgroundTransparent,.3)),d.color.isOpaque(l.selectionInactiveBackgroundTransparent)&&(l.selectionInactiveBackgroundTransparent=d.color.opacity(l.selectionInactiveBackgroundTransparent,.3)),l.ansi=s.DEFAULT_ANSI_COLORS.slice(),l.ansi[0]=p(g.black,s.DEFAULT_ANSI_COLORS[0]),l.ansi[1]=p(g.red,s.DEFAULT_ANSI_COLORS[1]),l.ansi[2]=p(g.green,s.DEFAULT_ANSI_COLORS[2]),l.ansi[3]=p(g.yellow,s.DEFAULT_ANSI_COLORS[3]),l.ansi[4]=p(g.blue,s.DEFAULT_ANSI_COLORS[4]),l.ansi[5]=p(g.magenta,s.DEFAULT_ANSI_COLORS[5]),l.ansi[6]=p(g.cyan,s.DEFAULT_ANSI_COLORS[6]),l.ansi[7]=p(g.white,s.DEFAULT_ANSI_COLORS[7]),l.ansi[8]=p(g.brightBlack,s.DEFAULT_ANSI_COLORS[8]),l.ansi[9]=p(g.brightRed,s.DEFAULT_ANSI_COLORS[9]),l.ansi[10]=p(g.brightGreen,s.DEFAULT_ANSI_COLORS[10]),l.ansi[11]=p(g.brightYellow,s.DEFAULT_ANSI_COLORS[11]),l.ansi[12]=p(g.brightBlue,s.DEFAULT_ANSI_COLORS[12]),l.ansi[13]=p(g.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),l.ansi[14]=p(g.brightCyan,s.DEFAULT_ANSI_COLORS[14]),l.ansi[15]=p(g.brightWhite,s.DEFAULT_ANSI_COLORS[15]),g.extendedAnsi){const m=Math.min(l.ansi.length-16,g.extendedAnsi.length);for(let E=0;E<m;E++)l.ansi[E+16]=p(g.extendedAnsi[E],s.DEFAULT_ANSI_COLORS[E+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(g){this._restoreColor(g),this._onChangeColors.fire(this.colors)}_restoreColor(g){if(g!==void 0)switch(g){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[g]=this._restoreColors.ansi[g]}else for(let l=0;l<this._restoreColors.ansi.length;++l)this._colors.ansi[l]=this._restoreColors.ansi[l]}modifyColors(g){g(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function p(g,l){if(g!==void 0)try{return d.css.toColor(g)}catch{}return l}s.ThemeService=f=c([_(0,h.IOptionsService)],f)},6349:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=o(8460),_=o(844);class n extends _.Disposable{constructor(u){super(),this._maxLength=u,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(u){if(this._maxLength===u)return;const v=new Array(u);for(let h=0;h<Math.min(u,this.length);h++)v[h]=this._array[this._getCyclicIndex(h)];this._array=v,this._maxLength=u,this._startIndex=0}get length(){return this._length}set length(u){if(u>this._length)for(let v=this._length;v<u;v++)this._array[v]=void 0;this._length=u}get(u){return this._array[this._getCyclicIndex(u)]}set(u,v){this._array[this._getCyclicIndex(u)]=v}push(u){this._array[this._getCyclicIndex(this._length)]=u,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(u,v,...h){if(v){for(let t=u;t<this._length-v;t++)this._array[this._getCyclicIndex(t)]=this._array[this._getCyclicIndex(t+v)];this._length-=v,this.onDeleteEmitter.fire({index:u,amount:v})}for(let t=this._length-1;t>=u;t--)this._array[this._getCyclicIndex(t+h.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<h.length;t++)this._array[this._getCyclicIndex(u+t)]=h[t];if(h.length&&this.onInsertEmitter.fire({index:u,amount:h.length}),this._length+h.length>this._maxLength){const t=this._length+h.length-this._maxLength;this._startIndex+=t,this._length=this._maxLength,this.onTrimEmitter.fire(t)}else this._length+=h.length}trimStart(u){u>this._length&&(u=this._length),this._startIndex+=u,this._length-=u,this.onTrimEmitter.fire(u)}shiftElements(u,v,h){if(!(v<=0)){if(u<0||u>=this._length)throw new Error("start argument out of range");if(u+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let i=v-1;i>=0;i--)this.set(u+i+h,this.get(u+i));const t=u+v+h-this._length;if(t>0)for(this._length+=t;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let t=0;t<v;t++)this.set(u+t+h,this.get(u+t))}}_getCyclicIndex(u){return(this._startIndex+u)%this._maxLength}}s.CircularList=n},1439:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function o(c,_=5){if(typeof c!="object")return c;const n=Array.isArray(c)?[]:{};for(const d in c)n[d]=_<=1?c[d]:c[d]&&o(c[d],_-1);return n}},8055:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,c=0,_=0,n=0;var d,u,v,h,t;function i(r){const a=r.toString(16);return a.length<2?"0"+a:a}function e(r,a){return r<a?(a+.05)/(r+.05):(r+.05)/(a+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(r){r.toCss=function(a,f,p,g){return g!==void 0?`#${i(a)}${i(f)}${i(p)}${i(g)}`:`#${i(a)}${i(f)}${i(p)}`},r.toRgba=function(a,f,p,g=255){return(a<<24|f<<16|p<<8|g)>>>0},r.toColor=function(a,f,p,g){return{css:r.toCss(a,f,p,g),rgba:r.toRgba(a,f,p,g)}}}(d||(s.channels=d={})),function(r){function a(f,p){return n=Math.round(255*p),[o,c,_]=t.toChannels(f.rgba),{css:d.toCss(o,c,_,n),rgba:d.toRgba(o,c,_,n)}}r.blend=function(f,p){if(n=(255&p.rgba)/255,n===1)return{css:p.css,rgba:p.rgba};const g=p.rgba>>24&255,l=p.rgba>>16&255,m=p.rgba>>8&255,E=f.rgba>>24&255,x=f.rgba>>16&255,L=f.rgba>>8&255;return o=E+Math.round((g-E)*n),c=x+Math.round((l-x)*n),_=L+Math.round((m-L)*n),{css:d.toCss(o,c,_),rgba:d.toRgba(o,c,_)}},r.isOpaque=function(f){return(255&f.rgba)==255},r.ensureContrastRatio=function(f,p,g){const l=t.ensureContrastRatio(f.rgba,p.rgba,g);if(l)return d.toColor(l>>24&255,l>>16&255,l>>8&255)},r.opaque=function(f){const p=(255|f.rgba)>>>0;return[o,c,_]=t.toChannels(p),{css:d.toCss(o,c,_),rgba:p}},r.opacity=a,r.multiplyOpacity=function(f,p){return n=255&f.rgba,a(f,n*p/255)},r.toColorRGB=function(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}}(u||(s.color=u={})),function(r){let a,f;try{const p=document.createElement("canvas");p.width=1,p.height=1;const g=p.getContext("2d",{willReadFrequently:!0});g&&(a=g,a.globalCompositeOperation="copy",f=a.createLinearGradient(0,0,1,1))}catch{}r.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return o=parseInt(p.slice(1,2).repeat(2),16),c=parseInt(p.slice(2,3).repeat(2),16),_=parseInt(p.slice(3,4).repeat(2),16),d.toColor(o,c,_);case 5:return o=parseInt(p.slice(1,2).repeat(2),16),c=parseInt(p.slice(2,3).repeat(2),16),_=parseInt(p.slice(3,4).repeat(2),16),n=parseInt(p.slice(4,5).repeat(2),16),d.toColor(o,c,_,n);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const g=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return o=parseInt(g[1]),c=parseInt(g[2]),_=parseInt(g[3]),n=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),d.toColor(o,c,_,n);if(!a||!f)throw new Error("css.toColor: Unsupported css format");if(a.fillStyle=f,a.fillStyle=p,typeof a.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(a.fillRect(0,0,1,1),[o,c,_,n]=a.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(o,c,_,n),css:p}}}(v||(s.css=v={})),function(r){function a(f,p,g){const l=f/255,m=p/255,E=g/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))}r.relativeLuminance=function(f){return a(f>>16&255,f>>8&255,255&f)},r.relativeLuminance2=a}(h||(s.rgb=h={})),function(r){function a(p,g,l){const m=p>>24&255,E=p>>16&255,x=p>>8&255;let L=g>>24&255,b=g>>16&255,A=g>>8&255,M=e(h.relativeLuminance2(L,b,A),h.relativeLuminance2(m,E,x));for(;M<l&&(L>0||b>0||A>0);)L-=Math.max(0,Math.ceil(.1*L)),b-=Math.max(0,Math.ceil(.1*b)),A-=Math.max(0,Math.ceil(.1*A)),M=e(h.relativeLuminance2(L,b,A),h.relativeLuminance2(m,E,x));return(L<<24|b<<16|A<<8|255)>>>0}function f(p,g,l){const m=p>>24&255,E=p>>16&255,x=p>>8&255;let L=g>>24&255,b=g>>16&255,A=g>>8&255,M=e(h.relativeLuminance2(L,b,A),h.relativeLuminance2(m,E,x));for(;M<l&&(L<255||b<255||A<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),b=Math.min(255,b+Math.ceil(.1*(255-b))),A=Math.min(255,A+Math.ceil(.1*(255-A))),M=e(h.relativeLuminance2(L,b,A),h.relativeLuminance2(m,E,x));return(L<<24|b<<16|A<<8|255)>>>0}r.blend=function(p,g){if(n=(255&g)/255,n===1)return g;const l=g>>24&255,m=g>>16&255,E=g>>8&255,x=p>>24&255,L=p>>16&255,b=p>>8&255;return o=x+Math.round((l-x)*n),c=L+Math.round((m-L)*n),_=b+Math.round((E-b)*n),d.toRgba(o,c,_)},r.ensureContrastRatio=function(p,g,l){const m=h.relativeLuminance(p>>8),E=h.relativeLuminance(g>>8);if(e(m,E)<l){if(E<m){const b=a(p,g,l),A=e(m,h.relativeLuminance(b>>8));if(A<l){const M=f(p,g,l);return A>e(m,h.relativeLuminance(M>>8))?b:M}return b}const x=f(p,g,l),L=e(m,h.relativeLuminance(x>>8));if(L<l){const b=a(p,g,l);return L>e(m,h.relativeLuminance(b>>8))?x:b}return x}},r.reduceLuminance=a,r.increaseLuminance=f,r.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]}}(t||(s.rgba=t={})),s.toPaddedHex=i,s.contrastRatio=e},8969:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=o(844),_=o(2585),n=o(4348),d=o(7866),u=o(744),v=o(7302),h=o(6975),t=o(8460),i=o(1753),e=o(1480),r=o(7994),a=o(9282),f=o(5435),p=o(5981),g=o(2660);let l=!1;class m extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new t.EventEmitter),this._onScroll.event(x=>{this._onScrollApi?.fire(x.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(x){for(const L in x)this.optionsService.options[L]=x[L]}constructor(x){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new t.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new t.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new t.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new t.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new t.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new t.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new v.OptionsService(x)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(u.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(i.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(r.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(g.OscLinkService),this._instantiationService.setService(_.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((0,t.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,t.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,t.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,t.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new p.WriteBuffer((L,b)=>this._inputHandler.parse(L,b))),this.register((0,t.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(x,L){this._writeBuffer.write(x,L)}writeSync(x,L){this._logService.logLevel<=_.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(x,L)}input(x,L=!0){this.coreService.triggerDataEvent(x,L)}resize(x,L){isNaN(x)||isNaN(L)||(x=Math.max(x,u.MINIMUM_COLS),L=Math.max(L,u.MINIMUM_ROWS),this._bufferService.resize(x,L))}scroll(x,L=!1){this._bufferService.scroll(x,L)}scrollLines(x,L,b){this._bufferService.scrollLines(x,L,b)}scrollPages(x){this.scrollLines(x*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(x){const L=x-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(x,L){return this._inputHandler.registerEscHandler(x,L)}registerDcsHandler(x,L){return this._inputHandler.registerDcsHandler(x,L)}registerCsiHandler(x,L){return this._inputHandler.registerCsiHandler(x,L)}registerOscHandler(x,L){return this._inputHandler.registerOscHandler(x,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let x=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?x=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(x=!0),x?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const x=[];x.push(this.onLineFeed(a.updateWindowsModeWrappedState.bind(null,this._bufferService))),x.push(this.registerCsiHandler({final:"H"},()=>((0,a.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const L of x)L.dispose()})}}}s.CoreTerminal=m},8460:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const _=[];for(let n=0;n<this._listeners.length;n++)_.push(this._listeners[n]);for(let n=0;n<_.length;n++)_[n].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,c){return o(_=>c.fire(_))},s.runAndSubscribe=function(o,c){return c(void 0),o(_=>c(_))}},5435:function(R,s,o){var c=this&&this.__decorate||function(I,S,w,y){var k,T=arguments.length,H=T<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(I,S,w,y);else for(var $=I.length-1;$>=0;$--)(k=I[$])&&(H=(T<3?k(H):T>3?k(S,w,H):k(S,w))||H);return T>3&&H&&Object.defineProperty(S,w,H),H},_=this&&this.__param||function(I,S){return function(w,y){S(w,y,I)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const n=o(2584),d=o(7116),u=o(2015),v=o(844),h=o(482),t=o(8437),i=o(8460),e=o(643),r=o(511),a=o(3734),f=o(2585),p=o(1480),g=o(6242),l=o(6351),m=o(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},x=131072;function L(I,S){if(I>24)return S.setWinLines||!1;switch(I){case 1:return!!S.restoreWin;case 2:return!!S.minimizeWin;case 3:return!!S.setWinPosition;case 4:return!!S.setWinSizePixels;case 5:return!!S.raiseWin;case 6:return!!S.lowerWin;case 7:return!!S.refreshWin;case 8:return!!S.setWinSizeChars;case 9:return!!S.maximizeWin;case 10:return!!S.fullscreenWin;case 11:return!!S.getWinState;case 13:return!!S.getWinPosition;case 14:return!!S.getWinSizePixels;case 15:return!!S.getScreenSizePixels;case 16:return!!S.getCellSizePixels;case 18:return!!S.getWinSizeChars;case 19:return!!S.getScreenSizeChars;case 20:return!!S.getIconTitle;case 21:return!!S.getWinTitle;case 22:return!!S.pushTitle;case 23:return!!S.popTitle;case 24:return!!S.setWinLines}return!1}var b;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(b||(s.WindowsOptionsReportType=b={}));let A=0;class M extends v.Disposable{getAttrData(){return this._curAttrData}constructor(S,w,y,k,T,H,$,z,D=new u.EscapeSequenceParser){super(),this._bufferService=S,this._charsetService=w,this._coreService=y,this._logService=k,this._optionsService=T,this._oscLinkService=H,this._coreMouseService=$,this._unicodeService=z,this._parser=D,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new r.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new i.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new i.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new i.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new i.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new i.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new i.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new i.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new i.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new i.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new i.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new i.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new i.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new P(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(C=>this._activeBuffer=C.activeBuffer)),this._parser.setCsiHandlerFallback((C,B)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(C),params:B.toArray()})}),this._parser.setEscHandlerFallback(C=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(C)})}),this._parser.setExecuteHandlerFallback(C=>{this._logService.debug("Unknown EXECUTE code: ",{code:C})}),this._parser.setOscHandlerFallback((C,B,O)=>{this._logService.debug("Unknown OSC code: ",{identifier:C,action:B,data:O})}),this._parser.setDcsHandlerFallback((C,B,O)=>{B==="HOOK"&&(O=O.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(C),action:B,payload:O})}),this._parser.setPrintHandler((C,B,O)=>this.print(C,B,O)),this._parser.registerCsiHandler({final:"@"},C=>this.insertChars(C)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},C=>this.scrollLeft(C)),this._parser.registerCsiHandler({final:"A"},C=>this.cursorUp(C)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},C=>this.scrollRight(C)),this._parser.registerCsiHandler({final:"B"},C=>this.cursorDown(C)),this._parser.registerCsiHandler({final:"C"},C=>this.cursorForward(C)),this._parser.registerCsiHandler({final:"D"},C=>this.cursorBackward(C)),this._parser.registerCsiHandler({final:"E"},C=>this.cursorNextLine(C)),this._parser.registerCsiHandler({final:"F"},C=>this.cursorPrecedingLine(C)),this._parser.registerCsiHandler({final:"G"},C=>this.cursorCharAbsolute(C)),this._parser.registerCsiHandler({final:"H"},C=>this.cursorPosition(C)),this._parser.registerCsiHandler({final:"I"},C=>this.cursorForwardTab(C)),this._parser.registerCsiHandler({final:"J"},C=>this.eraseInDisplay(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},C=>this.eraseInDisplay(C,!0)),this._parser.registerCsiHandler({final:"K"},C=>this.eraseInLine(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},C=>this.eraseInLine(C,!0)),this._parser.registerCsiHandler({final:"L"},C=>this.insertLines(C)),this._parser.registerCsiHandler({final:"M"},C=>this.deleteLines(C)),this._parser.registerCsiHandler({final:"P"},C=>this.deleteChars(C)),this._parser.registerCsiHandler({final:"S"},C=>this.scrollUp(C)),this._parser.registerCsiHandler({final:"T"},C=>this.scrollDown(C)),this._parser.registerCsiHandler({final:"X"},C=>this.eraseChars(C)),this._parser.registerCsiHandler({final:"Z"},C=>this.cursorBackwardTab(C)),this._parser.registerCsiHandler({final:"`"},C=>this.charPosAbsolute(C)),this._parser.registerCsiHandler({final:"a"},C=>this.hPositionRelative(C)),this._parser.registerCsiHandler({final:"b"},C=>this.repeatPrecedingCharacter(C)),this._parser.registerCsiHandler({final:"c"},C=>this.sendDeviceAttributesPrimary(C)),this._parser.registerCsiHandler({prefix:">",final:"c"},C=>this.sendDeviceAttributesSecondary(C)),this._parser.registerCsiHandler({final:"d"},C=>this.linePosAbsolute(C)),this._parser.registerCsiHandler({final:"e"},C=>this.vPositionRelative(C)),this._parser.registerCsiHandler({final:"f"},C=>this.hVPosition(C)),this._parser.registerCsiHandler({final:"g"},C=>this.tabClear(C)),this._parser.registerCsiHandler({final:"h"},C=>this.setMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"h"},C=>this.setModePrivate(C)),this._parser.registerCsiHandler({final:"l"},C=>this.resetMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"l"},C=>this.resetModePrivate(C)),this._parser.registerCsiHandler({final:"m"},C=>this.charAttributes(C)),this._parser.registerCsiHandler({final:"n"},C=>this.deviceStatus(C)),this._parser.registerCsiHandler({prefix:"?",final:"n"},C=>this.deviceStatusPrivate(C)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},C=>this.softReset(C)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},C=>this.setCursorStyle(C)),this._parser.registerCsiHandler({final:"r"},C=>this.setScrollRegion(C)),this._parser.registerCsiHandler({final:"s"},C=>this.saveCursor(C)),this._parser.registerCsiHandler({final:"t"},C=>this.windowOptions(C)),this._parser.registerCsiHandler({final:"u"},C=>this.restoreCursor(C)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},C=>this.insertColumns(C)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},C=>this.deleteColumns(C)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},C=>this.selectProtected(C)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},C=>this.requestMode(C,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},C=>this.requestMode(C,!1)),this._parser.setExecuteHandler(n.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new g.OscHandler(C=>(this.setTitle(C),this.setIconName(C),!0))),this._parser.registerOscHandler(1,new g.OscHandler(C=>this.setIconName(C))),this._parser.registerOscHandler(2,new g.OscHandler(C=>this.setTitle(C))),this._parser.registerOscHandler(4,new g.OscHandler(C=>this.setOrReportIndexedColor(C))),this._parser.registerOscHandler(8,new g.OscHandler(C=>this.setHyperlink(C))),this._parser.registerOscHandler(10,new g.OscHandler(C=>this.setOrReportFgColor(C))),this._parser.registerOscHandler(11,new g.OscHandler(C=>this.setOrReportBgColor(C))),this._parser.registerOscHandler(12,new g.OscHandler(C=>this.setOrReportCursorColor(C))),this._parser.registerOscHandler(104,new g.OscHandler(C=>this.restoreIndexedColor(C))),this._parser.registerOscHandler(110,new g.OscHandler(C=>this.restoreFgColor(C))),this._parser.registerOscHandler(111,new g.OscHandler(C=>this.restoreBgColor(C))),this._parser.registerOscHandler(112,new g.OscHandler(C=>this.restoreCursorColor(C))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const C in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:C},()=>this.selectCharset("("+C)),this._parser.registerEscHandler({intermediates:")",final:C},()=>this.selectCharset(")"+C)),this._parser.registerEscHandler({intermediates:"*",final:C},()=>this.selectCharset("*"+C)),this._parser.registerEscHandler({intermediates:"+",final:C},()=>this.selectCharset("+"+C)),this._parser.registerEscHandler({intermediates:"-",final:C},()=>this.selectCharset("-"+C)),this._parser.registerEscHandler({intermediates:".",final:C},()=>this.selectCharset("."+C)),this._parser.registerEscHandler({intermediates:"/",final:C},()=>this.selectCharset("/"+C));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(C=>(this._logService.error("Parsing error: ",C),C)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new l.DcsHandler((C,B)=>this.requestStatusString(C,B)))}_preserveStack(S,w,y,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=S,this._parseStack.cursorStartY=w,this._parseStack.decodedLength=y,this._parseStack.position=k}_logSlowResolvingAsync(S){this._logService.logLevel<=f.LogLevelEnum.WARN&&Promise.race([S,new Promise((w,y)=>setTimeout(()=>y("#SLOW_TIMEOUT"),5e3))]).catch(w=>{if(w!=="#SLOW_TIMEOUT")throw w;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(S,w){let y,k=this._activeBuffer.x,T=this._activeBuffer.y,H=0;const $=this._parseStack.paused;if($){if(y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,w))return this._logSlowResolvingAsync(y),y;k=this._parseStack.cursorStartX,T=this._parseStack.cursorStartY,this._parseStack.paused=!1,S.length>x&&(H=this._parseStack.position+x)}if(this._logService.logLevel<=f.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof S=="string"?` "${S}"`:` "${Array.prototype.map.call(S,C=>String.fromCharCode(C)).join("")}"`),typeof S=="string"?S.split("").map(C=>C.charCodeAt(0)):S),this._parseBuffer.length<S.length&&this._parseBuffer.length<x&&(this._parseBuffer=new Uint32Array(Math.min(S.length,x))),$||this._dirtyRowTracker.clearRange(),S.length>x)for(let C=H;C<S.length;C+=x){const B=C+x<S.length?C+x:S.length,O=typeof S=="string"?this._stringDecoder.decode(S.substring(C,B),this._parseBuffer):this._utf8Decoder.decode(S.subarray(C,B),this._parseBuffer);if(y=this._parser.parse(this._parseBuffer,O))return this._preserveStack(k,T,O,C),this._logSlowResolvingAsync(y),y}else if(!$){const C=typeof S=="string"?this._stringDecoder.decode(S,this._parseBuffer):this._utf8Decoder.decode(S,this._parseBuffer);if(y=this._parser.parse(this._parseBuffer,C))return this._preserveStack(k,T,C,0),this._logSlowResolvingAsync(y),y}this._activeBuffer.x===k&&this._activeBuffer.y===T||this._onCursorMove.fire();const z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),D=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);D<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(D,this._bufferService.rows-1),Math.min(z,this._bufferService.rows-1))}print(S,w,y){let k,T;const H=this._charsetService.charset,$=this._optionsService.rawOptions.screenReaderMode,z=this._bufferService.cols,D=this._coreService.decPrivateModes.wraparound,C=this._coreService.modes.insertMode,B=this._curAttrData;let O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&y-w>0&&O.getWidth(this._activeBuffer.x-1)===2&&O.setCellFromCodepoint(this._activeBuffer.x-1,0,1,B);let W=this._parser.precedingJoinState;for(let F=w;F<y;++F){if(k=S[F],k<127&&H){const re=H[String.fromCharCode(k)];re&&(k=re.charCodeAt(0))}const X=this._unicodeService.charProperties(k,W);T=p.UnicodeService.extractWidth(X);const Q=p.UnicodeService.extractShouldJoin(X),ee=Q?p.UnicodeService.extractWidth(W):0;if(W=X,$&&this._onA11yChar.fire((0,h.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+T-ee>z){if(D){const re=O;let q=this._activeBuffer.x-ee;for(this._activeBuffer.x=ee,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ee>0&&O instanceof t.BufferLine&&O.copyCellsFrom(re,q,0,ee,!1);q<z;)re.setCellFromCodepoint(q++,0,1,B)}else if(this._activeBuffer.x=z-1,T===2)continue}if(Q&&this._activeBuffer.x){const re=O.getWidth(this._activeBuffer.x-1)?1:2;O.addCodepointToCell(this._activeBuffer.x-re,k,T);for(let q=T-ee;--q>=0;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,B)}else if(C&&(O.insertCells(this._activeBuffer.x,T-ee,this._activeBuffer.getNullCell(B)),O.getWidth(z-1)===2&&O.setCellFromCodepoint(z-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,B)),O.setCellFromCodepoint(this._activeBuffer.x++,k,T,B),T>0)for(;--T;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,B)}this._parser.precedingJoinState=W,this._activeBuffer.x<z&&y-w>0&&O.getWidth(this._activeBuffer.x)===0&&!O.hasContent(this._activeBuffer.x)&&O.setCellFromCodepoint(this._activeBuffer.x,0,1,B),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(S,w){return S.final!=="t"||S.prefix||S.intermediates?this._parser.registerCsiHandler(S,w):this._parser.registerCsiHandler(S,y=>!L(y.params[0],this._optionsService.rawOptions.windowOptions)||w(y))}registerDcsHandler(S,w){return this._parser.registerDcsHandler(S,new l.DcsHandler(w))}registerEscHandler(S,w){return this._parser.registerEscHandler(S,w)}registerOscHandler(S,w){return this._parser.registerOscHandler(S,new g.OscHandler(w))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);S.hasWidth(this._activeBuffer.x)&&!S.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const S=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-S),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(S=this._bufferService.cols-1){this._activeBuffer.x=Math.min(S,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(S,w){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=S,this._activeBuffer.y=this._activeBuffer.scrollTop+w):(this._activeBuffer.x=S,this._activeBuffer.y=w),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(S,w){this._restrictCursor(),this._setCursor(this._activeBuffer.x+S,this._activeBuffer.y+w)}cursorUp(S){const w=this._activeBuffer.y-this._activeBuffer.scrollTop;return w>=0?this._moveCursor(0,-Math.min(w,S.params[0]||1)):this._moveCursor(0,-(S.params[0]||1)),!0}cursorDown(S){const w=this._activeBuffer.scrollBottom-this._activeBuffer.y;return w>=0?this._moveCursor(0,Math.min(w,S.params[0]||1)):this._moveCursor(0,S.params[0]||1),!0}cursorForward(S){return this._moveCursor(S.params[0]||1,0),!0}cursorBackward(S){return this._moveCursor(-(S.params[0]||1),0),!0}cursorNextLine(S){return this.cursorDown(S),this._activeBuffer.x=0,!0}cursorPrecedingLine(S){return this.cursorUp(S),this._activeBuffer.x=0,!0}cursorCharAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(S){return this._setCursor(S.length>=2?(S.params[1]||1)-1:0,(S.params[0]||1)-1),!0}charPosAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(S){return this._moveCursor(S.params[0]||1,0),!0}linePosAbsolute(S){return this._setCursor(this._activeBuffer.x,(S.params[0]||1)-1),!0}vPositionRelative(S){return this._moveCursor(0,S.params[0]||1),!0}hVPosition(S){return this.cursorPosition(S),!0}tabClear(S){const w=S.params[0];return w===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:w===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let w=S.params[0]||1;for(;w--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let w=S.params[0]||1;for(;w--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(S){const w=S.params[0];return w===1&&(this._curAttrData.bg|=536870912),w!==2&&w!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(S,w,y,k=!1,T=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);H.replaceCells(w,y,this._activeBuffer.getNullCell(this._eraseAttrData()),T),k&&(H.isWrapped=!1)}_resetBufferLine(S,w=!1){const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);y&&(y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),w),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+S),y.isWrapped=!1)}eraseInDisplay(S,w=!1){let y;switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,w);y<this._bufferService.rows;y++)this._resetBufferLine(y,w);this._dirtyRowTracker.markDirty(y);break;case 1:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y,0,this._activeBuffer.x+1,!0,w),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(y+1).isWrapped=!1);y--;)this._resetBufferLine(y,w);this._dirtyRowTracker.markDirty(0);break;case 2:for(y=this._bufferService.rows,this._dirtyRowTracker.markDirty(y-1);y--;)this._resetBufferLine(y,w);this._dirtyRowTracker.markDirty(0);break;case 3:const k=this._activeBuffer.lines.length-this._bufferService.rows;k>0&&(this._activeBuffer.lines.trimStart(k),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-k,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-k,0),this._onScroll.fire(0))}return!0}eraseInLine(S,w=!1){switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,w);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,w);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,w)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(S){this._restrictCursor();let w=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,T=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;w--;)this._activeBuffer.lines.splice(T-1,1),this._activeBuffer.lines.splice(y,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(S){this._restrictCursor();let w=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=this._activeBuffer.ybase+this._activeBuffer.y;let k;for(k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-k;w--;)this._activeBuffer.lines.splice(y,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(S){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.insertCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(S){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.deleteCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(S){let w=S.params[0]||1;for(;w--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(S){let w=S.params[0]||1;for(;w--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(t.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=S.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);k.deleteCells(0,w,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=S.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);k.insertCells(0,w,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=S.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);k.insertCells(this._activeBuffer.x,w,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=S.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);k.deleteCells(this._activeBuffer.x,w,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(S){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(S.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(S){const w=this._parser.precedingJoinState;if(!w)return!0;const y=S.params[0]||1,k=p.UnicodeService.extractWidth(w),T=this._activeBuffer.x-k,H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(T),$=new Uint32Array(H.length*y);let z=0;for(let C=0;C<H.length;){const B=H.codePointAt(C)||0;$[z++]=B,C+=B>65535?2:1}let D=z;for(let C=1;C<y;++C)$.copyWithin(D,0,z),D+=z;return this.print($,0,D),!0}sendDeviceAttributesPrimary(S){return S.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(S){return S.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(S.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(S){return(this._optionsService.rawOptions.termName+"").indexOf(S)===0}setMode(S){for(let w=0;w<S.length;w++)switch(S.params[w]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(S){for(let w=0;w<S.length;w++)switch(S.params[w]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(S){for(let w=0;w<S.length;w++)switch(S.params[w]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(S){for(let w=0;w<S.length;w++)switch(S.params[w]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),S.params[w]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(S,w){const y=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:T}=this._coreMouseService,H=this._coreService,{buffers:$,cols:z}=this._bufferService,{active:D,alt:C}=$,B=this._optionsService.rawOptions,O=Q=>Q?1:2,W=S.params[0];return F=W,X=w?W===2?4:W===4?O(H.modes.insertMode):W===12?3:W===20?O(B.convertEol):0:W===1?O(y.applicationCursorKeys):W===3?B.windowOptions.setWinLines?z===80?2:z===132?1:0:0:W===6?O(y.origin):W===7?O(y.wraparound):W===8?3:W===9?O(k==="X10"):W===12?O(B.cursorBlink):W===25?O(!H.isCursorHidden):W===45?O(y.reverseWraparound):W===66?O(y.applicationKeypad):W===67?4:W===1e3?O(k==="VT200"):W===1002?O(k==="DRAG"):W===1003?O(k==="ANY"):W===1004?O(y.sendFocus):W===1005?4:W===1006?O(T==="SGR"):W===1015?4:W===1016?O(T==="SGR_PIXELS"):W===1048?1:W===47||W===1047||W===1049?O(D===C):W===2004?O(y.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${w?"":"?"}${F};${X}$y`),!0;var F,X}_updateAttrColor(S,w,y,k,T){return w===2?(S|=50331648,S&=-16777216,S|=a.AttributeData.fromColorRGB([y,k,T])):w===5&&(S&=-50331904,S|=33554432|255&y),S}_extractColor(S,w,y){const k=[0,0,-1,0,0,0];let T=0,H=0;do{if(k[H+T]=S.params[w+H],S.hasSubParams(w+H)){const $=S.getSubParams(w+H);let z=0;do k[1]===5&&(T=1),k[H+z+1+T]=$[z];while(++z<$.length&&z+H+1+T<k.length);break}if(k[1]===5&&H+T>=2||k[1]===2&&H+T>=5)break;k[1]&&(T=1)}while(++H+w<S.length&&H+T<k.length);for(let $=2;$<k.length;++$)k[$]===-1&&(k[$]=0);switch(k[0]){case 38:y.fg=this._updateAttrColor(y.fg,k[1],k[3],k[4],k[5]);break;case 48:y.bg=this._updateAttrColor(y.bg,k[1],k[3],k[4],k[5]);break;case 58:y.extended=y.extended.clone(),y.extended.underlineColor=this._updateAttrColor(y.extended.underlineColor,k[1],k[3],k[4],k[5])}return H}_processUnderline(S,w){w.extended=w.extended.clone(),(!~S||S>5)&&(S=1),w.extended.underlineStyle=S,w.fg|=268435456,S===0&&(w.fg&=-268435457),w.updateExtended()}_processSGR0(S){S.fg=t.DEFAULT_ATTR_DATA.fg,S.bg=t.DEFAULT_ATTR_DATA.bg,S.extended=S.extended.clone(),S.extended.underlineStyle=0,S.extended.underlineColor&=-67108864,S.updateExtended()}charAttributes(S){if(S.length===1&&S.params[0]===0)return this._processSGR0(this._curAttrData),!0;const w=S.length;let y;const k=this._curAttrData;for(let T=0;T<w;T++)y=S.params[T],y>=30&&y<=37?(k.fg&=-50331904,k.fg|=16777216|y-30):y>=40&&y<=47?(k.bg&=-50331904,k.bg|=16777216|y-40):y>=90&&y<=97?(k.fg&=-50331904,k.fg|=16777224|y-90):y>=100&&y<=107?(k.bg&=-50331904,k.bg|=16777224|y-100):y===0?this._processSGR0(k):y===1?k.fg|=134217728:y===3?k.bg|=67108864:y===4?(k.fg|=268435456,this._processUnderline(S.hasSubParams(T)?S.getSubParams(T)[0]:1,k)):y===5?k.fg|=536870912:y===7?k.fg|=67108864:y===8?k.fg|=1073741824:y===9?k.fg|=2147483648:y===2?k.bg|=134217728:y===21?this._processUnderline(2,k):y===22?(k.fg&=-134217729,k.bg&=-134217729):y===23?k.bg&=-67108865:y===24?(k.fg&=-268435457,this._processUnderline(0,k)):y===25?k.fg&=-536870913:y===27?k.fg&=-67108865:y===28?k.fg&=-1073741825:y===29?k.fg&=2147483647:y===39?(k.fg&=-67108864,k.fg|=16777215&t.DEFAULT_ATTR_DATA.fg):y===49?(k.bg&=-67108864,k.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):y===38||y===48||y===58?T+=this._extractColor(S,T,k):y===53?k.bg|=1073741824:y===55?k.bg&=-1073741825:y===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):y===100?(k.fg&=-67108864,k.fg|=16777215&t.DEFAULT_ATTR_DATA.fg,k.bg&=-67108864,k.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",y);return!0}deviceStatus(S){switch(S.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const w=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${w};${y}R`)}return!0}deviceStatusPrivate(S){if(S.params[0]===6){const w=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${w};${y}R`)}return!0}softReset(S){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(S){const w=S.params[0]||1;switch(w){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const y=w%2==1;return this._optionsService.options.cursorBlink=y,!0}setScrollRegion(S){const w=S.params[0]||1;let y;return(S.length<2||(y=S.params[1])>this._bufferService.rows||y===0)&&(y=this._bufferService.rows),y>w&&(this._activeBuffer.scrollTop=w-1,this._activeBuffer.scrollBottom=y-1,this._setCursor(0,0)),!0}windowOptions(S){if(!L(S.params[0],this._optionsService.rawOptions.windowOptions))return!0;const w=S.length>1?S.params[1]:0;switch(S.params[0]){case 14:w!==2&&this._onRequestWindowsOptionsReport.fire(b.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(b.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:w!==0&&w!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),w!==0&&w!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:w!==0&&w!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),w!==0&&w!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(S){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(S){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(S){return this._windowTitle=S,this._onTitleChange.fire(S),!0}setIconName(S){return this._iconName=S,!0}setOrReportIndexedColor(S){const w=[],y=S.split(";");for(;y.length>1;){const k=y.shift(),T=y.shift();if(/^\d+$/.exec(k)){const H=parseInt(k);if(U(H))if(T==="?")w.push({type:0,index:H});else{const $=(0,m.parseColor)(T);$&&w.push({type:1,index:H,color:$})}}}return w.length&&this._onColor.fire(w),!0}setHyperlink(S){const w=S.split(";");return!(w.length<2)&&(w[1]?this._createHyperlink(w[0],w[1]):!w[0]&&this._finishHyperlink())}_createHyperlink(S,w){this._getCurrentLinkId()&&this._finishHyperlink();const y=S.split(":");let k;const T=y.findIndex(H=>H.startsWith("id="));return T!==-1&&(k=y[T].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:k,uri:w}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(S,w){const y=S.split(";");for(let k=0;k<y.length&&!(w>=this._specialColors.length);++k,++w)if(y[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[w]}]);else{const T=(0,m.parseColor)(y[k]);T&&this._onColor.fire([{type:1,index:this._specialColors[w],color:T}])}return!0}setOrReportFgColor(S){return this._setOrReportSpecialColor(S,0)}setOrReportBgColor(S){return this._setOrReportSpecialColor(S,1)}setOrReportCursorColor(S){return this._setOrReportSpecialColor(S,2)}restoreIndexedColor(S){if(!S)return this._onColor.fire([{type:2}]),!0;const w=[],y=S.split(";");for(let k=0;k<y.length;++k)if(/^\d+$/.exec(y[k])){const T=parseInt(y[k]);U(T)&&w.push({type:2,index:T})}return w.length&&this._onColor.fire(w),!0}restoreFgColor(S){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(S){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(S){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),!0}selectCharset(S){return S.length!==2?(this.selectDefaultCharset(),!0):(S[0]==="/"||this._charsetService.setgCharset(E[S[0]],d.CHARSETS[S[1]]||d.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const S=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,S,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(S){return this._charsetService.setgLevel(S),!0}screenAlignmentPattern(){const S=new r.CellData;S.content=4194373,S.fg=this._curAttrData.fg,S.bg=this._curAttrData.bg,this._setCursor(0,0);for(let w=0;w<this._bufferService.rows;++w){const y=this._activeBuffer.ybase+this._activeBuffer.y+w,k=this._activeBuffer.lines.get(y);k&&(k.fill(S),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(S,w){const y=this._bufferService.buffer,k=this._optionsService.rawOptions;return(T=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${T}${n.C0.ESC}\\`),!0))(S==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:S==='"p'?'P1$r61;1"p':S==="r"?`P1$r${y.scrollTop+1};${y.scrollBottom+1}r`:S==="m"?"P1$r0m":S===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(S,w){this._dirtyRowTracker.markRangeDirty(S,w)}}s.InputHandler=M;let P=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,S){I>S&&(A=I,I=S,S=A),I<this.start&&(this.start=I),S>this.end&&(this.end=S)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(I){return 0<=I&&I<256}P=c([_(0,f.IBufferService)],P)},844:(R,s)=>{function o(c){for(const _ of c)_.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const _=this._disposables.indexOf(c);_!==-1&&this._disposables.splice(_,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){this._isDisposed||c===this._value||(this._value?.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=o,s.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(_,n,d){this._data[_]||(this._data[_]={}),this._data[_][n]=d}get(_,n){return this._data[_]?this._data[_][n]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(c,_,n,d,u){this._data.get(c,_)||this._data.set(c,_,new o),this._data.get(c,_).set(n,d,u)}get(c,_,n,d){return this._data.get(c,_)?.get(n,d)}clear(){this._data.clear()}}},6114:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof De<"u"&&"title"in De;const o=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const _=o.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},6106:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let o=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const _=this._getKey(c);if(_===void 0||(o=this._search(_),o===-1)||this._getKey(this._array[o])!==_)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===_);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,_){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do _(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return[...this._array].values()}_search(c){let _=0,n=this._array.length-1;for(;n>=_;){let d=_+n>>1;const u=this._getKey(this._array[d]);if(u>c)n=d-1;else{if(!(u<c)){for(;d>0&&this._getKey(this._array[d-1])===c;)d--;return d}_=d+1}}return _}}},7226:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=o(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(u){this._tasks.push(u),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(u){this._idleCallback=void 0;let v=0,h=0,t=u.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),h=Math.max(v,h),i=u.timeRemaining(),1.5*h>i)return t-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(t-v))}ms`),void this._start();t=i}this.clear()}}class n extends _{_requestCallback(u){return setTimeout(()=>u(this._createDeadline(16)))}_cancelCallback(u){clearTimeout(u)}_createDeadline(u){const v=Date.now()+u;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}s.PriorityTaskQueue=n,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=o(643);s.updateWindowsModeWrappedState=function(_){const n=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),d=n?.get(_.cols-1),u=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);u&&d&&(u.isWrapped=d[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&d[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=o(6349),_=o(7226),n=o(3734),d=o(8437),u=o(4634),v=o(511),h=o(643),t=o(4863),i=o(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(e,r,a){this._hasScrollback=e,this._optionsService=r,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=i.DEFAULT_CHARSET,this.markers=[],this._nullCell=v.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=v.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,r){return new d.BufferLine(this._bufferService.cols,this.getNullCell(e),r)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const r=e+this._optionsService.rawOptions.scrollback;return r>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:r}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=d.DEFAULT_ATTR_DATA);let r=this._rows;for(;r--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,r){const a=this.getNullCell(d.DEFAULT_ATTR_DATA);let f=0;const p=this._getCorrectBufferLength(r);if(p>this.lines.maxLength&&(this.lines.maxLength=p),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)f+=+this.lines.get(l).resize(e,a);let g=0;if(this._rows<r)for(let l=this._rows;l<r;l++)this.lines.length<r+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new d.BufferLine(e,a)):this.ybase>0&&this.lines.length<=this.ybase+this.y+g+1?(this.ybase--,g++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(e,a)));else for(let l=this._rows;l>r;l--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(p<this.lines.maxLength){const l=this.lines.length-p;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=p}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,r-1),g&&(this.y+=g),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(e,r),this._cols>e))for(let g=0;g<this.lines.length;g++)f+=+this.lines.get(g).resize(e,a);this._cols=e,this._rows=r,this._memoryCleanupQueue.clear(),f>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let r=0;for(;this._memoryCleanupPosition<this.lines.length;)if(r+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),r>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,r){this._cols!==e&&(e>this._cols?this._reflowLarger(e,r):this._reflowSmaller(e,r))}_reflowLarger(e,r){const a=(0,u.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(a.length>0){const f=(0,u.reflowLargerCreateNewLayout)(this.lines,a);(0,u.reflowLargerApplyNewLayout)(this.lines,f.layout),this._reflowLargerAdjustViewport(e,r,f.countRemoved)}}_reflowLargerAdjustViewport(e,r,a){const f=this.getNullCell(d.DEFAULT_ATTR_DATA);let p=a;for(;p-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new d.BufferLine(e,f))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-a,0)}_reflowSmaller(e,r){const a=this.getNullCell(d.DEFAULT_ATTR_DATA),f=[];let p=0;for(let g=this.lines.length-1;g>=0;g--){let l=this.lines.get(g);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;const m=[l];for(;l.isWrapped&&g>0;)l=this.lines.get(--g),m.unshift(l);const E=this.ybase+this.y;if(E>=g&&E<g+m.length)continue;const x=m[m.length-1].getTrimmedLength(),L=(0,u.reflowSmallerGetNewLineLengths)(m,this._cols,e),b=L.length-m.length;let A;A=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+b):Math.max(0,this.lines.length-this.lines.maxLength+b);const M=[];for(let y=0;y<b;y++){const k=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);M.push(k)}M.length>0&&(f.push({start:g+m.length+p,newLines:M}),p+=M.length),m.push(...M);let P=L.length-1,U=L[P];U===0&&(P--,U=L[P]);let I=m.length-b-1,S=x;for(;I>=0;){const y=Math.min(S,U);if(m[P]===void 0)break;if(m[P].copyCellsFrom(m[I],S-y,U-y,y,!0),U-=y,U===0&&(P--,U=L[P]),S-=y,S===0){I--;const k=Math.max(I,0);S=(0,u.getWrappedLineTrimmedLength)(m,k,this._cols)}}for(let y=0;y<m.length;y++)L[y]<e&&m[y].setCell(L[y],a);let w=b-A;for(;w-- >0;)this.ybase===0?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+p)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+r-1)}if(f.length>0){const g=[],l=[];for(let P=0;P<this.lines.length;P++)l.push(this.lines.get(P));const m=this.lines.length;let E=m-1,x=0,L=f[x];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+p);let b=0;for(let P=Math.min(this.lines.maxLength-1,m+p-1);P>=0;P--)if(L&&L.start>E+b){for(let U=L.newLines.length-1;U>=0;U--)this.lines.set(P--,L.newLines[U]);P++,g.push({index:E+1,amount:L.newLines.length}),b+=L.newLines.length,L=f[++x]}else this.lines.set(P,l[E--]);let A=0;for(let P=g.length-1;P>=0;P--)g[P].index+=A,this.lines.onInsertEmitter.fire(g[P]),A+=g[P].amount;const M=Math.max(0,m+p-this.lines.maxLength);M>0&&this.lines.onTrimEmitter.fire(M)}}translateBufferLineToString(e,r,a=0,f){const p=this.lines.get(e);return p?p.translateToString(r,a,f):""}getWrappedRangeForLine(e){let r=e,a=e;for(;r>0&&this.lines.get(r).isWrapped;)r--;for(;a+1<this.lines.length&&this.lines.get(a+1).isWrapped;)a++;return{first:r,last:a}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let r=0;r<this.markers.length;r++)this.markers[r].line===e&&(this.markers[r].dispose(),this.markers.splice(r--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const r=new t.Marker(e);return this.markers.push(r),r.register(this.lines.onTrim(a=>{r.line-=a,r.line<0&&r.dispose()})),r.register(this.lines.onInsert(a=>{r.line>=a.index&&(r.line+=a.amount)})),r.register(this.lines.onDelete(a=>{r.line>=a.index&&r.line<a.index+a.amount&&r.dispose(),r.line>a.index&&(r.line-=a.amount)})),r.register(r.onDispose(()=>this._removeMarker(r))),r}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=o(3734),_=o(511),n=o(643),d=o(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let u=0;class v{constructor(t,i,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);const r=i||_.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let a=0;a<t;++a)this.setCell(a,r);this.length=t}get(t){const i=this._data[3*t+0],e=2097151&i;return[this._data[3*t+1],2097152&i?this._combined[t]:e?(0,d.stringFromCodePoint)(e):"",i>>22,2097152&i?this._combined[t].charCodeAt(this._combined[t].length-1):e]}set(t,i){this._data[3*t+1]=i[n.CHAR_DATA_ATTR_INDEX],i[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=i[1],this._data[3*t+0]=2097152|t|i[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=i[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|i[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){const i=this._data[3*t+0];return 2097152&i?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&i}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){const i=this._data[3*t+0];return 2097152&i?this._combined[t]:2097151&i?(0,d.stringFromCodePoint)(2097151&i):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,i){return u=3*t,i.content=this._data[u+0],i.fg=this._data[u+1],i.bg=this._data[u+2],2097152&i.content&&(i.combinedData=this._combined[t]),268435456&i.bg&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){2097152&i.content&&(this._combined[t]=i.combinedData),268435456&i.bg&&(this._extendedAttrs[t]=i.extended),this._data[3*t+0]=i.content,this._data[3*t+1]=i.fg,this._data[3*t+2]=i.bg}setCellFromCodepoint(t,i,e,r){268435456&r.bg&&(this._extendedAttrs[t]=r.extended),this._data[3*t+0]=i|e<<22,this._data[3*t+1]=r.fg,this._data[3*t+2]=r.bg}addCodepointToCell(t,i,e){let r=this._data[3*t+0];2097152&r?this._combined[t]+=(0,d.stringFromCodePoint)(i):2097151&r?(this._combined[t]=(0,d.stringFromCodePoint)(2097151&r)+(0,d.stringFromCodePoint)(i),r&=-2097152,r|=2097152):r=i|4194304,e&&(r&=-12582913,r|=e<<22),this._data[3*t+0]=r}insertCells(t,i,e){if((t%=this.length)&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length-t){const r=new _.CellData;for(let a=this.length-t-i-1;a>=0;--a)this.setCell(t+i+a,this.loadCell(t+a,r));for(let a=0;a<i;++a)this.setCell(t+a,e)}else for(let r=t;r<this.length;++r)this.setCell(r,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(t,i,e){if(t%=this.length,i<this.length-t){const r=new _.CellData;for(let a=0;a<this.length-t-i;++a)this.setCell(t+a,this.loadCell(t+i+a,r));for(let a=this.length-i;a<this.length;++a)this.setCell(a,e)}else for(let r=t;r<this.length;++r)this.setCell(r,e);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),this.getWidth(t)!==0||this.hasContent(t)||this.setCellFromCodepoint(t,0,1,e)}replaceCells(t,i,e,r=!1){if(r)for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,e);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,e),t++;else for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,e);t<i&&t<this.length;)this.setCell(t++,e)}resize(t,i){if(t===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*t;if(t>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const r=new Uint32Array(e);r.set(this._data),this._data=r}for(let r=this.length;r<t;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,e);const r=Object.keys(this._combined);for(let f=0;f<r.length;f++){const p=parseInt(r[f],10);p>=t&&delete this._combined[p]}const a=Object.keys(this._extendedAttrs);for(let f=0;f<a.length;f++){const p=parseInt(a[f],10);p>=t&&delete this._extendedAttrs[p]}}return this.length=t,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(const i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(const i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){const t=new v(0);t._data=new Uint32Array(this._data),t.length=this.length;for(const i in this._combined)t._combined[i]=this._combined[i];for(const i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0]||50331648&this._data[3*t+2])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,i,e,r,a){const f=t._data;if(a)for(let g=r-1;g>=0;g--){for(let l=0;l<3;l++)this._data[3*(e+g)+l]=f[3*(i+g)+l];268435456&f[3*(i+g)+2]&&(this._extendedAttrs[e+g]=t._extendedAttrs[i+g])}else for(let g=0;g<r;g++){for(let l=0;l<3;l++)this._data[3*(e+g)+l]=f[3*(i+g)+l];268435456&f[3*(i+g)+2]&&(this._extendedAttrs[e+g]=t._extendedAttrs[i+g])}const p=Object.keys(t._combined);for(let g=0;g<p.length;g++){const l=parseInt(p[g],10);l>=i&&(this._combined[l-i+e]=t._combined[l])}}translateToString(t,i,e,r){i=i??0,e=e??this.length,t&&(e=Math.min(e,this.getTrimmedLength())),r&&(r.length=0);let a="";for(;i<e;){const f=this._data[3*i+0],p=2097151&f,g=2097152&f?this._combined[i]:p?(0,d.stringFromCodePoint)(p):n.WHITESPACE_CELL_CHAR;if(a+=g,r)for(let l=0;l<g.length;++l)r.push(i);i+=f>>22||1}return r&&r.push(i),a}}s.BufferLine=v},4841:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(R,s)=>{function o(c,_,n){if(_===c.length-1)return c[_].getTrimmedLength();const d=!c[_].hasContent(n-1)&&c[_].getWidth(n-1)===1,u=c[_+1].getWidth(0)===2;return d&&u?n-1:n}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,_,n,d,u){const v=[];for(let h=0;h<c.length-1;h++){let t=h,i=c.get(++t);if(!i.isWrapped)continue;const e=[c.get(h)];for(;t<c.length&&i.isWrapped;)e.push(i),i=c.get(++t);if(d>=h&&d<t){h+=e.length-1;continue}let r=0,a=o(e,r,_),f=1,p=0;for(;f<e.length;){const l=o(e,f,_),m=l-p,E=n-a,x=Math.min(m,E);e[r].copyCellsFrom(e[f],p,a,x,!1),a+=x,a===n&&(r++,a=0),p+=x,p===l&&(f++,p=0),a===0&&r!==0&&e[r-1].getWidth(n-1)===2&&(e[r].copyCellsFrom(e[r-1],n-1,a++,1,!1),e[r-1].setCell(n-1,u))}e[r].replaceCells(a,n,u);let g=0;for(let l=e.length-1;l>0&&(l>r||e[l].getTrimmedLength()===0);l--)g++;g>0&&(v.push(h+e.length-g),v.push(g)),h+=e.length-1}return v},s.reflowLargerCreateNewLayout=function(c,_){const n=[];let d=0,u=_[d],v=0;for(let h=0;h<c.length;h++)if(u===h){const t=_[++d];c.onDeleteEmitter.fire({index:h-v,amount:t}),h+=t-1,v+=t,u=_[++d]}else n.push(h);return{layout:n,countRemoved:v}},s.reflowLargerApplyNewLayout=function(c,_){const n=[];for(let d=0;d<_.length;d++)n.push(c.get(_[d]));for(let d=0;d<n.length;d++)c.set(d,n[d]);c.length=_.length},s.reflowSmallerGetNewLineLengths=function(c,_,n){const d=[],u=c.map((i,e)=>o(c,e,_)).reduce((i,e)=>i+e);let v=0,h=0,t=0;for(;t<u;){if(u-t<n){d.push(u-t);break}v+=n;const i=o(c,h,_);v>i&&(v-=i,h++);const e=c[h].getWidth(v-1)===2;e&&v--;const r=e?n-1:n;d.push(r),t+=r}return d},s.getWrappedLineTrimmedLength=o},5295:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=o(8460),_=o(844),n=o(9092);class d extends _.Disposable{constructor(v,h){super(),this._optionsService=v,this._bufferService=h,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(v){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(v),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(v,h){this._normal.resize(v,h),this._alt.resize(v,h),this.setupTabStops(v)}setupTabStops(v){this._normal.setupTabStops(v),this._alt.setupTabStops(v)}}s.BufferSet=d},511:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=o(482),_=o(643),n=o(3734);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(v){const h=new d;return h.setFromCharData(v),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(v){this.fg=v[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(v[_.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(v[_.CHAR_DATA_CHAR_INDEX].length===2){const t=v[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){const i=v[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(t-55296)+i-56320+65536|v[_.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=v[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[_.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=v[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=d},643:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=o(8460),_=o(844);class n{get id(){return this._id}constructor(u){this.line=u,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(u){return this._disposables.push(u),u}}s.Marker=n,n._nextId=1},7116:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(R,s)=>{var o,c,_;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
|
|
8
|
-
`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""}(o||(s.C0=o={})),function(n){n.PAD="",n.HOP="",n.BPH="",n.NBH="",n.IND="",n.NEL="
",n.SSA="",n.ESA="",n.HTS="",n.HTJ="",n.VTS="",n.PLD="",n.PLU="",n.RI="",n.SS2="",n.SS3="",n.DCS="",n.PU1="",n.PU2="",n.STS="",n.CCH="",n.MW="",n.SPA="",n.EPA="",n.SOS="",n.SGCI="",n.SCI="",n.CSI="",n.ST="",n.OSC="",n.PM="",n.APC=""}(c||(s.C1=c={})),function(n){n.ST=`${o.ESC}\\`}(_||(s.C1_ESCAPED=_={}))},7399:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=o(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(n,d,u,v){const h={type:0,cancel:!1,key:void 0},t=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?h.key=d?c.C0.ESC+"OA":c.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?h.key=d?c.C0.ESC+"OD":c.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?h.key=d?c.C0.ESC+"OC":c.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(h.key=d?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:h.key=n.ctrlKey?"\b":c.C0.DEL,n.altKey&&(h.key=c.C0.ESC+h.key);break;case 9:if(n.shiftKey){h.key=c.C0.ESC+"[Z";break}h.key=c.C0.HT,h.cancel=!0;break;case 13:h.key=n.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,h.cancel=!0;break;case 27:h.key=c.C0.ESC,n.altKey&&(h.key=c.C0.ESC+c.C0.ESC),h.cancel=!0;break;case 37:if(n.metaKey)break;t?(h.key=c.C0.ESC+"[1;"+(t+1)+"D",h.key===c.C0.ESC+"[1;3D"&&(h.key=c.C0.ESC+(u?"b":"[1;5D"))):h.key=d?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(n.metaKey)break;t?(h.key=c.C0.ESC+"[1;"+(t+1)+"C",h.key===c.C0.ESC+"[1;3C"&&(h.key=c.C0.ESC+(u?"f":"[1;5C"))):h.key=d?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(n.metaKey)break;t?(h.key=c.C0.ESC+"[1;"+(t+1)+"A",u||h.key!==c.C0.ESC+"[1;3A"||(h.key=c.C0.ESC+"[1;5A")):h.key=d?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(n.metaKey)break;t?(h.key=c.C0.ESC+"[1;"+(t+1)+"B",u||h.key!==c.C0.ESC+"[1;3B"||(h.key=c.C0.ESC+"[1;5B")):h.key=d?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(h.key=c.C0.ESC+"[2~");break;case 46:h.key=t?c.C0.ESC+"[3;"+(t+1)+"~":c.C0.ESC+"[3~";break;case 36:h.key=t?c.C0.ESC+"[1;"+(t+1)+"H":d?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:h.key=t?c.C0.ESC+"[1;"+(t+1)+"F":d?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:n.shiftKey?h.type=2:n.ctrlKey?h.key=c.C0.ESC+"[5;"+(t+1)+"~":h.key=c.C0.ESC+"[5~";break;case 34:n.shiftKey?h.type=3:n.ctrlKey?h.key=c.C0.ESC+"[6;"+(t+1)+"~":h.key=c.C0.ESC+"[6~";break;case 112:h.key=t?c.C0.ESC+"[1;"+(t+1)+"P":c.C0.ESC+"OP";break;case 113:h.key=t?c.C0.ESC+"[1;"+(t+1)+"Q":c.C0.ESC+"OQ";break;case 114:h.key=t?c.C0.ESC+"[1;"+(t+1)+"R":c.C0.ESC+"OR";break;case 115:h.key=t?c.C0.ESC+"[1;"+(t+1)+"S":c.C0.ESC+"OS";break;case 116:h.key=t?c.C0.ESC+"[15;"+(t+1)+"~":c.C0.ESC+"[15~";break;case 117:h.key=t?c.C0.ESC+"[17;"+(t+1)+"~":c.C0.ESC+"[17~";break;case 118:h.key=t?c.C0.ESC+"[18;"+(t+1)+"~":c.C0.ESC+"[18~";break;case 119:h.key=t?c.C0.ESC+"[19;"+(t+1)+"~":c.C0.ESC+"[19~";break;case 120:h.key=t?c.C0.ESC+"[20;"+(t+1)+"~":c.C0.ESC+"[20~";break;case 121:h.key=t?c.C0.ESC+"[21;"+(t+1)+"~":c.C0.ESC+"[21~";break;case 122:h.key=t?c.C0.ESC+"[23;"+(t+1)+"~":c.C0.ESC+"[23~";break;case 123:h.key=t?c.C0.ESC+"[24;"+(t+1)+"~":c.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(u&&!v||!n.altKey||n.metaKey)!u||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?h.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(h.key=c.C0.US),n.key==="@"&&(h.key=c.C0.NUL)):n.keyCode===65&&(h.type=1);else{const i=_[n.keyCode],e=i?.[n.shiftKey?1:0];if(e)h.key=c.C0.ESC+e;else if(n.keyCode>=65&&n.keyCode<=90){const r=n.ctrlKey?n.keyCode-64:n.keyCode+32;let a=String.fromCharCode(r);n.shiftKey&&(a=a.toUpperCase()),h.key=c.C0.ESC+a}else if(n.keyCode===32)h.key=c.C0.ESC+(n.ctrlKey?c.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let r=n.code.slice(3,4);n.shiftKey||(r=r.toLowerCase()),h.key=c.C0.ESC+r,h.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?h.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?h.key=c.C0.NUL:n.keyCode>=51&&n.keyCode<=55?h.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?h.key=c.C0.DEL:n.keyCode===219?h.key=c.C0.ESC:n.keyCode===220?h.key=c.C0.FS:n.keyCode===221&&(h.key=c.C0.GS)}return h}},482:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,c=0,_=o.length){let n="";for(let d=c;d<_;++d){let u=o[d];u>65535?(u-=65536,n+=String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):n+=String.fromCharCode(u)}return n},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const _=o.length;if(!_)return 0;let n=0,d=0;if(this._interim){const u=o.charCodeAt(d++);56320<=u&&u<=57343?c[n++]=1024*(this._interim-55296)+u-56320+65536:(c[n++]=this._interim,c[n++]=u),this._interim=0}for(let u=d;u<_;++u){const v=o.charCodeAt(u);if(55296<=v&&v<=56319){if(++u>=_)return this._interim=v,n;const h=o.charCodeAt(u);56320<=h&&h<=57343?c[n++]=1024*(v-55296)+h-56320+65536:(c[n++]=v,c[n++]=h)}else v!==65279&&(c[n++]=v)}return n}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const _=o.length;if(!_)return 0;let n,d,u,v,h=0,t=0,i=0;if(this.interim[0]){let a=!1,f=this.interim[0];f&=(224&f)==192?31:(240&f)==224?15:7;let p,g=0;for(;(p=63&this.interim[++g])&&g<4;)f<<=6,f|=p;const l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=l-g;for(;i<m;){if(i>=_)return 0;if(p=o[i++],(192&p)!=128){i--,a=!0;break}this.interim[g++]=p,f<<=6,f|=63&p}a||(l===2?f<128?i--:c[h++]=f:l===3?f<2048||f>=55296&&f<=57343||f===65279||(c[h++]=f):f<65536||f>1114111||(c[h++]=f)),this.interim.fill(0)}const e=_-4;let r=i;for(;r<_;){for(;!(!(r<e)||128&(n=o[r])||128&(d=o[r+1])||128&(u=o[r+2])||128&(v=o[r+3]));)c[h++]=n,c[h++]=d,c[h++]=u,c[h++]=v,r+=4;if(n=o[r++],n<128)c[h++]=n;else if((224&n)==192){if(r>=_)return this.interim[0]=n,h;if(d=o[r++],(192&d)!=128){r--;continue}if(t=(31&n)<<6|63&d,t<128){r--;continue}c[h++]=t}else if((240&n)==224){if(r>=_)return this.interim[0]=n,h;if(d=o[r++],(192&d)!=128){r--;continue}if(r>=_)return this.interim[0]=n,this.interim[1]=d,h;if(u=o[r++],(192&u)!=128){r--;continue}if(t=(15&n)<<12|(63&d)<<6|63&u,t<2048||t>=55296&&t<=57343||t===65279)continue;c[h++]=t}else if((248&n)==240){if(r>=_)return this.interim[0]=n,h;if(d=o[r++],(192&d)!=128){r--;continue}if(r>=_)return this.interim[0]=n,this.interim[1]=d,h;if(u=o[r++],(192&u)!=128){r--;continue}if(r>=_)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=u,h;if(v=o[r++],(192&v)!=128){r--;continue}if(t=(7&n)<<18|(63&d)<<12|(63&u)<<6|63&v,t<65536||t>1114111)continue;c[h++]=t}}return h}}},225:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=o(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let d;s.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let u=0;u<_.length;++u)d.fill(0,_[u][0],_[u][1]+1)}}wcwidth(u){return u<32?0:u<127?1:u<65536?d[u]:function(v,h){let t,i=0,e=h.length-1;if(v<h[0][0]||v>h[e][1])return!1;for(;e>=i;)if(t=i+e>>1,v>h[t][1])i=t+1;else{if(!(v<h[t][0]))return!0;e=t-1}return!1}(u,n)?0:u>=131072&&u<=196605||u>=196608&&u<=262141?2:1}charProperties(u,v){let h=this.wcwidth(u),t=h===0&&v!==0;if(t){const i=c.UnicodeService.extractWidth(v);i===0?t=!1:i>h&&(h=i)}return c.UnicodeService.createPropertyValue(0,h,t)}}},5981:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=o(8460),_=o(844);class n extends _.Disposable{constructor(u){super(),this._action=u,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(u,v){if(v!==void 0&&this._syncCalls>v)return void(this._syncCalls=0);if(this._pendingData+=u.length,this._writeBuffer.push(u),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let h;for(this._isSyncWriting=!0;h=this._writeBuffer.shift();){this._action(h);const t=this._callbacks.shift();t&&t()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(u,v){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=u.length,this._writeBuffer.push(u),this._callbacks.push(v),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=u.length,this._writeBuffer.push(u),this._callbacks.push(v)}_innerWrite(u=0,v=!0){const h=u||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const t=this._writeBuffer[this._bufferOffset],i=this._action(t,v);if(i){const r=a=>Date.now()-h>=12?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(h,a);return void i.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(r)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=t.length,Date.now()-h>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=n},5941:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function _(n,d){const u=n.toString(16),v=u.length<2?"0"+u:u;switch(d){case 4:return u[0];case 8:return v;case 12:return(v+v).slice(0,3);default:return v+v}}s.parseColor=function(n){if(!n)return;let d=n.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const u=o.exec(d);if(u){const v=u[1]?15:u[4]?255:u[7]?4095:65535;return[Math.round(parseInt(u[1]||u[4]||u[7]||u[10],16)/v*255),Math.round(parseInt(u[2]||u[5]||u[8]||u[11],16)/v*255),Math.round(parseInt(u[3]||u[6]||u[9]||u[12],16)/v*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),c.exec(d)&&[3,6,9,12].includes(d.length))){const u=d.length/3,v=[0,0,0];for(let h=0;h<3;++h){const t=parseInt(d.slice(u*h,u*h+u),16);v[h]=u===1?t<<4:u===2?t:u===3?t>>4:t>>8}return v}},s.toRgbString=function(n,d=16){const[u,v,h]=n;return`rgb:${_(u,d)}/${_(v,d)}/${_(h,d)}`}},5770:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=o(482),_=o(8742),n=o(5770),d=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(v,h){this._handlers[v]===void 0&&(this._handlers[v]=[]);const t=this._handlers[v];return t.push(h),{dispose:()=>{const i=t.indexOf(h);i!==-1&&t.splice(i,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}reset(){if(this._active.length)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(v,h){if(this.reset(),this._ident=v,this._active=this._handlers[v]||d,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(h);else this._handlerFb(this._ident,"HOOK",h)}put(v,h,t){if(this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].put(v,h,t);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(v,h,t))}unhook(v,h=!0){if(this._active.length){let t=!1,i=this._active.length-1,e=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,t=h,e=this._stack.fallThrough,this._stack.paused=!1),!e&&t===!1){for(;i>=0&&(t=this._active[i].unhook(v),t!==!0);i--)if(t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,t;i--}for(;i>=0;i--)if(t=this._active[i].unhook(!1),t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,t}else this._handlerFb(this._ident,"UNHOOK",v);this._active=d,this._ident=0}};const u=new _.Params;u.addParam(0),s.DcsHandler=class{constructor(v){this._handler=v,this._data="",this._params=u,this._hitLimit=!1}hook(v){this._params=v.length>1||v.params[0]?v.clone():u,this._data="",this._hitLimit=!1}put(v,h,t){this._hitLimit||(this._data+=(0,c.utf32ToString)(v,h,t),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(v){let h=!1;if(this._hitLimit)h=!1;else if(v&&(h=this._handler(this._data,this._params),h instanceof Promise))return h.then(t=>(this._params=u,this._data="",this._hitLimit=!1,t));return this._params=u,this._data="",this._hitLimit=!1,h}}},2015:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=o(844),_=o(8742),n=o(6242),d=o(6351);class u{constructor(i){this.table=new Uint8Array(i)}setDefault(i,e){this.table.fill(i<<4|e)}add(i,e,r,a){this.table[e<<8|i]=r<<4|a}addMany(i,e,r,a){for(let f=0;f<i.length;f++)this.table[e<<8|i[f]]=r<<4|a}}s.TransitionTable=u;const v=160;s.VT500_TRANSITION_TABLE=function(){const t=new u(4095),i=Array.apply(null,Array(256)).map((g,l)=>l),e=(g,l)=>i.slice(g,l),r=e(32,127),a=e(0,24);a.push(25),a.push.apply(a,e(28,32));const f=e(0,14);let p;for(p in t.setDefault(1,0),t.addMany(r,0,2,0),f)t.addMany([24,26,153,154],p,3,0),t.addMany(e(128,144),p,3,0),t.addMany(e(144,152),p,3,0),t.add(156,p,0,0),t.add(27,p,11,1),t.add(157,p,4,8),t.addMany([152,158,159],p,0,7),t.add(155,p,11,3),t.add(144,p,11,9);return t.addMany(a,0,3,0),t.addMany(a,1,3,1),t.add(127,1,0,1),t.addMany(a,8,0,8),t.addMany(a,3,3,3),t.add(127,3,0,3),t.addMany(a,4,3,4),t.add(127,4,0,4),t.addMany(a,6,3,6),t.addMany(a,5,3,5),t.add(127,5,0,5),t.addMany(a,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(r,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(r,7,0,7),t.addMany(a,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(a,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(a,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(a,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(a,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(a,13,13,13),t.addMany(r,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(v,0,2,0),t.add(v,8,5,8),t.add(v,6,0,6),t.add(v,11,0,11),t.add(v,13,13,13),t}();class h extends c.Disposable{constructor(i=s.VT500_TRANSITION_TABLE){super(),this._transitions=i,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,r,a)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,r)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(i,e=[64,126]){let r=0;if(i.prefix){if(i.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=i.prefix.charCodeAt(0),r&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(i.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let f=0;f<i.intermediates.length;++f){const p=i.intermediates.charCodeAt(f);if(32>p||p>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=p}}if(i.final.length!==1)throw new Error("final must be a single byte");const a=i.final.charCodeAt(0);if(e[0]>a||a>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return r<<=8,r|=a,r}identToString(i){const e=[];for(;i;)e.push(String.fromCharCode(255&i)),i>>=8;return e.reverse().join("")}setPrintHandler(i){this._printHandler=i}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(i,e){const r=this._identifier(i,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);const a=this._escHandlers[r];return a.push(e),{dispose:()=>{const f=a.indexOf(e);f!==-1&&a.splice(f,1)}}}clearEscHandler(i){this._escHandlers[this._identifier(i,[48,126])]&&delete this._escHandlers[this._identifier(i,[48,126])]}setEscHandlerFallback(i){this._escHandlerFb=i}setExecuteHandler(i,e){this._executeHandlers[i.charCodeAt(0)]=e}clearExecuteHandler(i){this._executeHandlers[i.charCodeAt(0)]&&delete this._executeHandlers[i.charCodeAt(0)]}setExecuteHandlerFallback(i){this._executeHandlerFb=i}registerCsiHandler(i,e){const r=this._identifier(i);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);const a=this._csiHandlers[r];return a.push(e),{dispose:()=>{const f=a.indexOf(e);f!==-1&&a.splice(f,1)}}}clearCsiHandler(i){this._csiHandlers[this._identifier(i)]&&delete this._csiHandlers[this._identifier(i)]}setCsiHandlerFallback(i){this._csiHandlerFb=i}registerDcsHandler(i,e){return this._dcsParser.registerHandler(this._identifier(i),e)}clearDcsHandler(i){this._dcsParser.clearHandler(this._identifier(i))}setDcsHandlerFallback(i){this._dcsParser.setHandlerFallback(i)}registerOscHandler(i,e){return this._oscParser.registerHandler(i,e)}clearOscHandler(i){this._oscParser.clearHandler(i)}setOscHandlerFallback(i){this._oscParser.setHandlerFallback(i)}setErrorHandler(i){this._errorHandler=i}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(i,e,r,a,f){this._parseStack.state=i,this._parseStack.handlers=e,this._parseStack.handlerPos=r,this._parseStack.transition=a,this._parseStack.chunkPos=f}parse(i,e,r){let a,f=0,p=0,g=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,g=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const l=this._parseStack.handlers;let m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&m>-1){for(;m>=0&&(a=l[m](this._params),a!==!0);m--)if(a instanceof Promise)return this._parseStack.handlerPos=m,a}this._parseStack.handlers=[];break;case 4:if(r===!1&&m>-1){for(;m>=0&&(a=l[m](),a!==!0);m--)if(a instanceof Promise)return this._parseStack.handlerPos=m,a}this._parseStack.handlers=[];break;case 6:if(f=i[this._parseStack.chunkPos],a=this._dcsParser.unhook(f!==24&&f!==26,r),a)return a;f===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(f=i[this._parseStack.chunkPos],a=this._oscParser.end(f!==24&&f!==26,r),a)return a;f===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,g=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let l=g;l<e;++l){switch(f=i[l],p=this._transitions.table[this.currentState<<8|(f<160?f:v)],p>>4){case 2:for(let b=l+1;;++b){if(b>=e||(f=i[b])<32||f>126&&f<v){this._printHandler(i,l,b),l=b-1;break}if(++b>=e||(f=i[b])<32||f>126&&f<v){this._printHandler(i,l,b),l=b-1;break}if(++b>=e||(f=i[b])<32||f>126&&f<v){this._printHandler(i,l,b),l=b-1;break}if(++b>=e||(f=i[b])<32||f>126&&f<v){this._printHandler(i,l,b),l=b-1;break}}break;case 3:this._executeHandlers[f]?this._executeHandlers[f]():this._executeHandlerFb(f),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:f,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const m=this._csiHandlers[this._collect<<8|f];let E=m?m.length-1:-1;for(;E>=0&&(a=m[E](this._params),a!==!0);E--)if(a instanceof Promise)return this._preserveStack(3,m,E,p,l),a;E<0&&this._csiHandlerFb(this._collect<<8|f,this._params),this.precedingJoinState=0;break;case 8:do switch(f){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(f-48)}while(++l<e&&(f=i[l])>47&&f<60);l--;break;case 9:this._collect<<=8,this._collect|=f;break;case 10:const x=this._escHandlers[this._collect<<8|f];let L=x?x.length-1:-1;for(;L>=0&&(a=x[L](),a!==!0);L--)if(a instanceof Promise)return this._preserveStack(4,x,L,p,l),a;L<0&&this._escHandlerFb(this._collect<<8|f),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|f,this._params);break;case 13:for(let b=l+1;;++b)if(b>=e||(f=i[b])===24||f===26||f===27||f>127&&f<v){this._dcsParser.put(i,l,b),l=b-1;break}break;case 14:if(a=this._dcsParser.unhook(f!==24&&f!==26),a)return this._preserveStack(6,[],0,p,l),a;f===27&&(p|=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 b=l+1;;b++)if(b>=e||(f=i[b])<32||f>127&&f<v){this._oscParser.put(i,l,b),l=b-1;break}break;case 6:if(a=this._oscParser.end(f!==24&&f!==26),a)return this._preserveStack(5,[],0,p,l),a;f===27&&(p|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&p}}}s.EscapeSequenceParser=h},6242:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=o(5770),_=o(482),n=[];s.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,u){this._handlers[d]===void 0&&(this._handlers[d]=[]);const v=this._handlers[d];return v.push(u),{dispose:()=>{const h=v.indexOf(u);h!==-1&&v.splice(h,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,u,v){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(d,u,v);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(d,u,v))}start(){this.reset(),this._state=1}put(d,u,v){if(this._state!==3){if(this._state===1)for(;u<v;){const h=d[u++];if(h===59){this._state=2,this._start();break}if(h<48||57<h)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+h-48}this._state===2&&v-u>0&&this._put(d,u,v)}}end(d,u=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let v=!1,h=this._active.length-1,t=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,v=u,t=this._stack.fallThrough,this._stack.paused=!1),!t&&v===!1){for(;h>=0&&(v=this._active[h].end(d),v!==!0);h--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,v;h--}for(;h>=0;h--)if(v=this._active[h].end(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,v}else this._handlerFb(this._id,"END",d);this._active=n,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,u,v){this._hitLimit||(this._data+=(0,_.utf32ToString)(d,u,v),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let u=!1;if(this._hitLimit)u=!1;else if(d&&(u=this._handler(this._data),u instanceof Promise))return u.then(v=>(this._data="",this._hitLimit=!1,v));return this._data="",this._hitLimit=!1,u}}},8742:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const o=2147483647;class c{static fromArray(n){const d=new c;if(!n.length)return d;for(let u=Array.isArray(n[0])?1:0;u<n.length;++u){const v=n[u];if(Array.isArray(v))for(let h=0;h<v.length;++h)d.addSubParam(v[h]);else d.addParam(v)}return d}constructor(n=32,d=32){if(this.maxLength=n,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new c(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let d=0;d<this.length;++d){n.push(this.params[d]);const u=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];v-u>0&&n.push(Array.prototype.slice.call(this._subParams,u,v))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>o?o:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>o?o:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const d=this._subParamsIdx[n]>>8,u=255&this._subParamsIdx[n];return u-d>0?this._subParams.subarray(d,u):null}getSubParamsAll(){const n={};for(let d=0;d<this.length;++d){const u=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];v-u>0&&(n[d]=this._subParams.slice(u,v))}return n}addDigit(n){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const u=this._digitIsSub?this._subParams:this.params,v=u[d-1];u[d-1]=~v?Math.min(10*v+n,o):n}}s.Params=c},5741:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const _={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(_),c.dispose=()=>this._wrappedAddonDispose(_),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===o){c=_;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(c,1)}}},8771:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=o(3785),_=o(511);s.BufferApiView=class{constructor(n,d){this._buffer=n,this.type=d}init(n){return this._buffer=n,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(n){const d=this._buffer.lines.get(n);if(d)return new c.BufferLineApiView(d)}getNullCell(){return new _.CellData}}},3785:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=o(511);s.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,n){if(!(_<0||_>=this._line.length))return n?(this._line.loadCell(_,n),n):this._line.loadCell(_,new c.CellData)}translateToString(_,n,d){return this._line.translateToString(_,n,d)}}},8285:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=o(8771),_=o(8460),n=o(844);class d extends n.Disposable{constructor(v){super(),this._core=v,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=d},7975:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,_=>c(_.toArray()))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,(_,n)=>c(_,n.toArray()))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(R,s,o){var c=this&&this.__decorate||function(t,i,e,r){var a,f=arguments.length,p=f<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,i,e,r);else for(var g=t.length-1;g>=0;g--)(a=t[g])&&(p=(f<3?a(p):f>3?a(i,e,p):a(i,e))||p);return f>3&&p&&Object.defineProperty(i,e,p),p},_=this&&this.__param||function(t,i){return function(e,r){i(e,r,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const n=o(8460),d=o(844),u=o(5295),v=o(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let h=s.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(t){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new u.BufferSet(t,this))}resize(t,i){this.cols=t,this.rows=i,this.buffers.resize(t,i),this._onResize.fire({cols:t,rows:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,i=!1){const e=this.buffer;let r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===t.fg&&r.getBg(0)===t.bg||(r=e.getBlankLine(t,i),this._cachedBlankLine=r),r.isWrapped=i;const a=e.ybase+e.scrollTop,f=e.ybase+e.scrollBottom;if(e.scrollTop===0){const p=e.lines.isFull;f===e.lines.length-1?p?e.lines.recycle().copyFrom(r):e.lines.push(r.clone()):e.lines.splice(f+1,0,r.clone()),p?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const p=f-a+1;e.lines.shiftElements(a+1,p-1,-1),e.lines.set(f,r.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(t,i,e){const r=this.buffer;if(t<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else t+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);const a=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+t,r.ybase),0),a!==r.ydisp&&(i||this._onScroll.fire(r.ydisp))}};s.BufferService=h=c([_(0,v.IOptionsService)],h)},7994:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(R,s,o){var c=this&&this.__decorate||function(r,a,f,p){var g,l=arguments.length,m=l<3?a:p===null?p=Object.getOwnPropertyDescriptor(a,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,a,f,p);else for(var E=r.length-1;E>=0;E--)(g=r[E])&&(m=(l<3?g(m):l>3?g(a,f,m):g(a,f))||m);return l>3&&m&&Object.defineProperty(a,f,m),m},_=this&&this.__param||function(r,a){return function(f,p){a(f,p,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const n=o(2585),d=o(8460),u=o(844),v={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:r=>r.button!==4&&r.action===1&&(r.ctrl=!1,r.alt=!1,r.shift=!1,!0)},VT200:{events:19,restrict:r=>r.action!==32},DRAG:{events:23,restrict:r=>r.action!==32||r.button!==3},ANY:{events:31,restrict:r=>!0}};function h(r,a){let f=(r.ctrl?16:0)|(r.shift?4:0)|(r.alt?8:0);return r.button===4?(f|=64,f|=r.action):(f|=3&r.button,4&r.button&&(f|=64),8&r.button&&(f|=128),r.action===32?f|=32:r.action!==0||a||(f|=3)),f}const t=String.fromCharCode,i={DEFAULT:r=>{const a=[h(r,!1)+32,r.col+32,r.row+32];return a[0]>255||a[1]>255||a[2]>255?"":`\x1B[M${t(a[0])}${t(a[1])}${t(a[2])}`},SGR:r=>{const a=r.action===0&&r.button!==4?"m":"M";return`\x1B[<${h(r,!0)};${r.col};${r.row}${a}`},SGR_PIXELS:r=>{const a=r.action===0&&r.button!==4?"m":"M";return`\x1B[<${h(r,!0)};${r.x};${r.y}${a}`}};let e=s.CoreMouseService=class extends u.Disposable{constructor(r,a){super(),this._bufferService=r,this._coreService=a,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const f of Object.keys(v))this.addProtocol(f,v[f]);for(const f of Object.keys(i))this.addEncoding(f,i[f]);this.reset()}addProtocol(r,a){this._protocols[r]=a}addEncoding(r,a){this._encodings[r]=a}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(r){if(!this._protocols[r])throw new Error(`unknown protocol "${r}"`);this._activeProtocol=r,this._onProtocolChange.fire(this._protocols[r].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(r){if(!this._encodings[r])throw new Error(`unknown encoding "${r}"`);this._activeEncoding=r}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(r){if(r.col<0||r.col>=this._bufferService.cols||r.row<0||r.row>=this._bufferService.rows||r.button===4&&r.action===32||r.button===3&&r.action!==32||r.button!==4&&(r.action===2||r.action===3)||(r.col++,r.row++,r.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,r,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(r))return!1;const a=this._encodings[this._activeEncoding](r);return a&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(a):this._coreService.triggerDataEvent(a,!0)),this._lastEvent=r,!0}explainEvents(r){return{down:!!(1&r),up:!!(2&r),drag:!!(4&r),move:!!(8&r),wheel:!!(16&r)}}_equalEvents(r,a,f){if(f){if(r.x!==a.x||r.y!==a.y)return!1}else if(r.col!==a.col||r.row!==a.row)return!1;return r.button===a.button&&r.action===a.action&&r.ctrl===a.ctrl&&r.alt===a.alt&&r.shift===a.shift}};s.CoreMouseService=e=c([_(0,n.IBufferService),_(1,n.ICoreService)],e)},6975:function(R,s,o){var c=this&&this.__decorate||function(e,r,a,f){var p,g=arguments.length,l=g<3?r:f===null?f=Object.getOwnPropertyDescriptor(r,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,r,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(r,a,l):p(r,a))||l);return g>3&&l&&Object.defineProperty(r,a,l),l},_=this&&this.__param||function(e,r){return function(a,f){r(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const n=o(1439),d=o(8460),u=o(844),v=o(2585),h=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let i=s.CoreService=class extends u.Disposable{constructor(e,r,a){super(),this._bufferService=e,this._logService=r,this._optionsService=a,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(t)}reset(){this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(t)}triggerDataEvent(e,r=!1){if(this._optionsService.rawOptions.disableStdin)return;const a=this._bufferService.buffer;r&&this._optionsService.rawOptions.scrollOnUserInput&&a.ybase!==a.ydisp&&this._onRequestScrollToBottom.fire(),r&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(f=>f.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(r=>r.charCodeAt(0))),this._onBinary.fire(e))}};s.CoreService=i=c([_(0,v.IBufferService),_(1,v.ILogService),_(2,v.IOptionsService)],i)},9074:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=o(8055),_=o(8460),n=o(844),d=o(6106);let u=0,v=0;class h extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList(e=>e?.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)(()=>this.reset()))}registerDecoration(e){if(e.marker.isDisposed)return;const r=new t(e);if(r){const a=r.marker.onDispose(()=>r.dispose());r.onDispose(()=>{r&&(this._decorations.delete(r)&&this._onDecorationRemoved.fire(r),a.dispose())}),this._decorations.insert(r),this._onDecorationRegistered.fire(r)}return r}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,r,a){let f=0,p=0;for(const g of this._decorations.getKeyIterator(r))f=g.options.x??0,p=f+(g.options.width??1),e>=f&&e<p&&(!a||(g.options.layer??"bottom")===a)&&(yield g)}forEachDecorationAtCell(e,r,a,f){this._decorations.forEachByKey(r,p=>{u=p.options.x??0,v=u+(p.options.width??1),e>=u&&e<v&&(!a||(p.options.layer??"bottom")===a)&&f(p)})}}s.DecorationService=h;class t extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=o(2585),_=o(8343);class n{constructor(...u){this._entries=new Map;for(const[v,h]of u)this.set(v,h)}set(u,v){const h=this._entries.get(u);return this._entries.set(u,v),h}forEach(u){for(const[v,h]of this._entries.entries())u(v,h)}has(u){return this._entries.has(u)}get(u){return this._entries.get(u)}}s.ServiceCollection=n,s.InstantiationService=class{constructor(){this._services=new n,this._services.set(c.IInstantiationService,this)}setService(d,u){this._services.set(d,u)}getService(d){return this._services.get(d)}createInstance(d,...u){const v=(0,_.getServiceDependencies)(d).sort((i,e)=>i.index-e.index),h=[];for(const i of v){const e=this._services.get(i.id);if(!e)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${i.id}.`);h.push(e)}const t=v.length>0?v[0].index:u.length;if(u.length!==t)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${t+1} conflicts with ${u.length} static arguments`);return new d(...u,...h)}}},7866:function(R,s,o){var c=this&&this.__decorate||function(t,i,e,r){var a,f=arguments.length,p=f<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,i,e,r);else for(var g=t.length-1;g>=0;g--)(a=t[g])&&(p=(f<3?a(p):f>3?a(i,e,p):a(i,e))||p);return f>3&&p&&Object.defineProperty(i,e,p),p},_=this&&this.__param||function(t,i){return function(e,r){i(e,r,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const n=o(844),d=o(2585),u={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let v,h=s.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),v=this}_updateLogLevel(){this._logLevel=u[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let i=0;i<t.length;i++)typeof t[i]=="function"&&(t[i]=t[i]())}_log(t,i,e){this._evalLazyOptionalParams(e),t.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...e)}trace(t,...i){this._logLevel<=d.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,i)}debug(t,...i){this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,i)}info(t,...i){this._logLevel<=d.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,i)}warn(t,...i){this._logLevel<=d.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,i)}error(t,...i){this._logLevel<=d.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,i)}};s.LogService=h=c([_(0,d.IOptionsService)],h),s.setTraceLogger=function(t){v=t},s.traceCall=function(t,i,e){if(typeof e.value!="function")throw new Error("not supported");const r=e.value;e.value=function(...a){if(v.logLevel!==d.LogLevelEnum.TRACE)return r.apply(this,a);v.trace(`GlyphRenderer#${r.name}(${a.map(p=>JSON.stringify(p)).join(", ")})`);const f=r.apply(this,a);return v.trace(`GlyphRenderer#${r.name} return`,f),f}}},7302:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=o(8460),_=o(844),n=o(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class u extends _.Disposable{constructor(h){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const t={...s.DEFAULT_OPTIONS};for(const i in h)if(i in t)try{const e=h[i];t[i]=this._sanitizeAndValidateOption(i,e)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(h,t){return this.onOptionChange(i=>{i===h&&t(this.rawOptions[h])})}onMultipleOptionChange(h,t){return this.onOptionChange(i=>{h.indexOf(i)!==-1&&t()})}_setupOptions(){const h=i=>{if(!(i in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,e)=>{if(!(i in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${i}"`);e=this._sanitizeAndValidateOption(i,e),this.rawOptions[i]!==e&&(this.rawOptions[i]=e,this._onOptionChange.fire(i))};for(const i in this.rawOptions){const e={get:h.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,e)}}_sanitizeAndValidateOption(h,t){switch(h){case"cursorStyle":if(t||(t=s.DEFAULT_OPTIONS[h]),!function(i){return i==="block"||i==="underline"||i==="bar"}(t))throw new Error(`"${t}" is not a valid value for ${h}`);break;case"wordSeparator":t||(t=s.DEFAULT_OPTIONS[h]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=d.includes(t)?t:s.DEFAULT_OPTIONS[h];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${h} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(`${h} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${h} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${h} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{}}return t}}s.OptionsService=u},2660:function(R,s,o){var c=this&&this.__decorate||function(u,v,h,t){var i,e=arguments.length,r=e<3?v:t===null?t=Object.getOwnPropertyDescriptor(v,h):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(u,v,h,t);else for(var a=u.length-1;a>=0;a--)(i=u[a])&&(r=(e<3?i(r):e>3?i(v,h,r):i(v,h))||r);return e>3&&r&&Object.defineProperty(v,h,r),r},_=this&&this.__param||function(u,v){return function(h,t){v(h,t,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const n=o(2585);let d=s.OscLinkService=class{constructor(u){this._bufferService=u,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(u){const v=this._bufferService.buffer;if(u.id===void 0){const a=v.addMarker(v.ybase+v.y),f={data:u,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(f,a)),this._dataByLinkId.set(f.id,f),f.id}const h=u,t=this._getEntryIdKey(h),i=this._entriesWithId.get(t);if(i)return this.addLineToLink(i.id,v.ybase+v.y),i.id;const e=v.addMarker(v.ybase+v.y),r={id:this._nextId++,key:this._getEntryIdKey(h),data:h,lines:[e]};return e.onDispose(()=>this._removeMarkerFromLink(r,e)),this._entriesWithId.set(r.key,r),this._dataByLinkId.set(r.id,r),r.id}addLineToLink(u,v){const h=this._dataByLinkId.get(u);if(h&&h.lines.every(t=>t.line!==v)){const t=this._bufferService.buffer.addMarker(v);h.lines.push(t),t.onDispose(()=>this._removeMarkerFromLink(h,t))}}getLinkData(u){return this._dataByLinkId.get(u)?.data}_getEntryIdKey(u){return`${u.id};;${u.uri}`}_removeMarkerFromLink(u,v){const h=u.lines.indexOf(v);h!==-1&&(u.lines.splice(h,1),u.lines.length===0&&(u.data.id!==void 0&&this._entriesWithId.delete(u.key),this._dataByLinkId.delete(u.id)))}};s.OscLinkService=d=c([_(0,n.IBufferService)],d)},8343:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(_){return _[c]||[]},s.createDecorator=function(_){if(s.serviceRegistry.has(_))return s.serviceRegistry.get(_);const n=function(d,u,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,t,i){t[o]===t?t[c].push({id:h,index:i}):(t[c]=[{id:h,index:i}],t[o]=t)})(n,d,v)};return n.toString=()=>_,s.serviceRegistry.set(_,n),n}},2585:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=o(8343);var _;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(_||(s.LogLevelEnum=_={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=o(8460),_=o(225);class n{static extractShouldJoin(u){return(1&u)!=0}static extractWidth(u){return u>>1&3}static extractCharKind(u){return u>>3}static createPropertyValue(u,v,h=!1){return(16777215&u)<<3|(3&v)<<1|(h?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const u=new _.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let v=0,h=0;const t=u.length;for(let i=0;i<t;++i){let e=u.charCodeAt(i);if(55296<=e&&e<=56319){if(++i>=t)return v+this.wcwidth(e);const f=u.charCodeAt(i);56320<=f&&f<=57343?e=1024*(e-55296)+f-56320+65536:v+=this.wcwidth(f)}const r=this.charProperties(e,h);let a=n.extractWidth(r);n.extractShouldJoin(r)&&(a-=n.extractWidth(h)),v+=a,h=r}return v}charProperties(u,v){return this._activeProvider.charProperties(u,v)}}s.UnicodeService=n}},K={};function N(R){var s=K[R];if(s!==void 0)return s.exports;var o=K[R]={exports:{}};return j[R].call(o.exports,o,o.exports,N),o.exports}var J={};return(()=>{var R=J;Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;const s=N(9042),o=N(3236),c=N(844),_=N(5741),n=N(8285),d=N(7975),u=N(7090),v=["cols","rows"];class h extends c.Disposable{constructor(i){super(),this._core=this.register(new o.Terminal(i)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const e=a=>this._core.options[a],r=(a,f)=>{this._checkReadonlyOptions(a),this._core.options[a]=f};for(const a in this._core.options){const f={get:e.bind(this,a),set:r.bind(this,a)};Object.defineProperty(this._publicOptions,a,f)}}_checkReadonlyOptions(i){if(v.includes(i))throw new Error(`Option "${i}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new u.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const i=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:i.applicationCursorKeys,applicationKeypadMode:i.applicationKeypad,bracketedPasteMode:i.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:i.origin,reverseWraparoundMode:i.reverseWraparound,sendFocusMode:i.sendFocus,wraparoundMode:i.wraparound}}get options(){return this._publicOptions}set options(i){for(const e in i)this._publicOptions[e]=i[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(i,e=!0){this._core.input(i,e)}resize(i,e){this._verifyIntegers(i,e),this._core.resize(i,e)}open(i){this._core.open(i)}attachCustomKeyEventHandler(i){this._core.attachCustomKeyEventHandler(i)}attachCustomWheelEventHandler(i){this._core.attachCustomWheelEventHandler(i)}registerLinkProvider(i){return this._core.registerLinkProvider(i)}registerCharacterJoiner(i){return this._checkProposedApi(),this._core.registerCharacterJoiner(i)}deregisterCharacterJoiner(i){this._checkProposedApi(),this._core.deregisterCharacterJoiner(i)}registerMarker(i=0){return this._verifyIntegers(i),this._core.registerMarker(i)}registerDecoration(i){return this._checkProposedApi(),this._verifyPositiveIntegers(i.x??0,i.width??0,i.height??0),this._core.registerDecoration(i)}hasSelection(){return this._core.hasSelection()}select(i,e,r){this._verifyIntegers(i,e,r),this._core.select(i,e,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(i,e){this._verifyIntegers(i,e),this._core.selectLines(i,e)}dispose(){super.dispose()}scrollLines(i){this._verifyIntegers(i),this._core.scrollLines(i)}scrollPages(i){this._verifyIntegers(i),this._core.scrollPages(i)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(i){this._verifyIntegers(i),this._core.scrollToLine(i)}clear(){this._core.clear()}write(i,e){this._core.write(i,e)}writeln(i,e){this._core.write(i),this._core.write(`\r
|
|
9
|
-
`,e)}paste(
|
|
7
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(l){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),r.isLinux&&l&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(l){const m=this._getMouseBufferCoords(l),E=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!!(E&&x&&m)&&this._areCoordsInSelection(m,E,x)}isCellInSelection(l,m){const E=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!E||!x)&&this._areCoordsInSelection([l,m],E,x)}_areCoordsInSelection(l,m,E){return l[1]>m[1]&&l[1]<E[1]||m[1]===E[1]&&l[1]===m[1]&&l[0]>=m[0]&&l[0]<E[0]||m[1]<E[1]&&l[1]===E[1]&&l[0]<E[0]||m[1]<E[1]&&l[1]===m[1]&&l[0]>=m[0]}_selectWordAtCursor(l,m){const E=this._linkifier.currentLink?.link?.range;if(E)return this._model.selectionStart=[E.start.x-1,E.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const x=this._getMouseBufferCoords(l);return!!x&&(this._selectWordAt(x,m),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,m){this._model.clearSelection(),l=Math.max(l,0),m=Math.min(m,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,m],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){const m=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(m)return m[0]--,m[1]--,m[1]+=this._bufferService.buffer.ydisp,m}_getMouseEventScrollAmount(l){let m=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1];const E=this._renderService.dimensions.css.canvas.height;return m>=0&&m<=E?0:(m>E&&(m-=E),m=Math.min(Math.max(m,-50),50),m/=50,m/Math.abs(m)+Math.round(14*m))}shouldForceSelection(l){return r.isMac?l.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:l.shiftKey}handleMouseDown(l){if(this._mouseDownTimeStamp=l.timeStamp,(l.button!==2||!this.hasSelection)&&l.button===0){if(!this._enabled){if(!this.shouldForceSelection(l))return;l.stopPropagation()}l.preventDefault(),this._dragScrollAmount=0,this._enabled&&l.shiftKey?this._handleIncrementalClick(l):l.detail===1?this._handleSingleClick(l):l.detail===2?this._handleDoubleClick(l):l.detail===3&&this._handleTripleClick(l),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(l){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(l))}_handleSingleClick(l){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(l)?3:0,this._model.selectionStart=this._getMouseBufferCoords(l),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const m=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);m&&m.length!==this._model.selectionStart[0]&&m.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){const m=this._getMouseBufferCoords(l);m&&(this._activeSelectionMode=2,this._selectLineAt(m[1]))}shouldColumnSelect(l){return l.altKey&&!(r.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;const m=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(l),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(l),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const E=this._bufferService.buffer;if(this._model.selectionEnd[1]<E.lines.length){const x=E.lines.get(this._model.selectionEnd[1]);x&&x.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}m&&m[0]===this._model.selectionEnd[0]&&m[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const l=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(l.ydisp+this._bufferService.rows,l.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=l.ydisp),this.refresh()}}_handleMouseUp(l){const m=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&m<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const E=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(E&&E[0]!==void 0&&E[1]!==void 0){const x=(0,c.moveToCellSequence)(E[0]-1,E[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(x,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const l=this._model.finalSelectionStart,m=this._model.finalSelectionEnd,E=!(!l||!m||l[0]===m[0]&&l[1]===m[1]);E?l&&m&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&m[0]===this._oldSelectionEnd[0]&&m[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,m,E)):this._oldHasSelection&&this._fireOnSelectionChange(l,m,E)}_fireOnSelectionChange(l,m,E){this._oldSelectionStart=l,this._oldSelectionEnd=m,this._oldHasSelection=E,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim(m=>this._handleTrim(m))}_convertViewportColToCharacterIndex(l,m){let E=m;for(let x=0;m>=x;x++){const L=l.loadCell(x,this._workCell).getChars().length;this._workCell.getWidth()===0?E--:L>1&&m!==x&&(E+=L-1)}return E}setSelection(l,m,E){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,m],this._model.selectionStartLength=E,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,m,E=!0,x=!0){if(l[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,b=L.lines.get(l[1]);if(!b)return;const A=L.translateBufferLineToString(l[1],!1);let M=this._convertViewportColToCharacterIndex(b,l[0]),I=M;const U=l[0]-M;let P=0,S=0,w=0,y=0;if(A.charAt(M)===" "){for(;M>0&&A.charAt(M-1)===" ";)M--;for(;I<A.length&&A.charAt(I+1)===" ";)I++}else{let H=l[0],$=l[0];b.getWidth(H)===0&&(P++,H--),b.getWidth($)===2&&(S++,$++);const z=b.getString($).length;for(z>1&&(y+=z-1,I+=z-1);H>0&&M>0&&!this._isCharWordSeparator(b.loadCell(H-1,this._workCell));){b.loadCell(H-1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,H--):D>1&&(w+=D-1,M-=D-1),M--,H--}for(;$<b.length&&I+1<A.length&&!this._isCharWordSeparator(b.loadCell($+1,this._workCell));){b.loadCell($+1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,$++):D>1&&(y+=D-1,I+=D-1),I++,$++}}I++;let k=M+U-P+w,T=Math.min(this._bufferService.cols,I-M+P+S-w-y);if(m||A.slice(M,I).trim()!==""){if(E&&k===0&&b.getCodePoint(0)!==32){const H=L.lines.get(l[1]-1);if(H&&b.isWrapped&&H.getCodePoint(this._bufferService.cols-1)!==32){const $=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if($){const z=this._bufferService.cols-$.start;k-=z,T+=z}}}if(x&&k+T===this._bufferService.cols&&b.getCodePoint(this._bufferService.cols-1)!==32){const H=L.lines.get(l[1]+1);if(H?.isWrapped&&H.getCodePoint(0)!==32){const $=this._getWordAt([0,l[1]+1],!1,!1,!0);$&&(T+=$.length)}}return{start:k,length:T}}}_selectWordAt(l,m){const E=this._getWordAt(l,m);if(E){for(;E.start<0;)E.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[E.start,l[1]],this._model.selectionStartLength=E.length}}_selectToWordAt(l){const m=this._getWordAt(l,!0);if(m){let E=l[1];for(;m.start<0;)m.start+=this._bufferService.cols,E--;if(!this._model.areSelectionValuesReversed())for(;m.start+m.length>this._bufferService.cols;)m.length-=this._bufferService.cols,E++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?m.start:m.start+m.length,E]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){const m=this._bufferService.buffer.getWrappedRangeForLine(l),E={start:{x:0,y:m.first},end:{x:this._bufferService.cols-1,y:m.last}};this._model.selectionStart=[0,m.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols)}};s.SelectionService=g=d([_(3,a.IBufferService),_(4,a.ICoreService),_(5,v.IMouseService),_(6,a.IOptionsService),_(7,v.IRenderService),_(8,v.ICoreBrowserService)],g)},4725:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const d=o(8343);s.ICharSizeService=(0,d.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),s.IMouseService=(0,d.createDecorator)("MouseService"),s.IRenderService=(0,d.createDecorator)("RenderService"),s.ISelectionService=(0,d.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,d.createDecorator)("ThemeService"),s.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(R,s,o){var d=this&&this.__decorate||function(g,l,m,E){var x,L=arguments.length,b=L<3?l:E===null?E=Object.getOwnPropertyDescriptor(l,m):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(g,l,m,E);else for(var A=g.length-1;A>=0;A--)(x=g[A])&&(b=(L<3?x(b):L>3?x(l,m,b):x(l,m))||b);return L>3&&b&&Object.defineProperty(l,m,b),b},_=this&&this.__param||function(g,l){return function(m,E){l(m,E,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const n=o(7239),c=o(8055),u=o(8460),v=o(844),h=o(2585),t=c.css.toColor("#ffffff"),r=c.css.toColor("#000000"),e=c.css.toColor("#ffffff"),i=c.css.toColor("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const g=[c.css.toColor("#2e3436"),c.css.toColor("#cc0000"),c.css.toColor("#4e9a06"),c.css.toColor("#c4a000"),c.css.toColor("#3465a4"),c.css.toColor("#75507b"),c.css.toColor("#06989a"),c.css.toColor("#d3d7cf"),c.css.toColor("#555753"),c.css.toColor("#ef2929"),c.css.toColor("#8ae234"),c.css.toColor("#fce94f"),c.css.toColor("#729fcf"),c.css.toColor("#ad7fa8"),c.css.toColor("#34e2e2"),c.css.toColor("#eeeeec")],l=[0,95,135,175,215,255];for(let m=0;m<216;m++){const E=l[m/36%6|0],x=l[m/6%6|0],L=l[m%6];g.push({css:c.channels.toCss(E,x,L),rgba:c.channels.toRgba(E,x,L)})}for(let m=0;m<24;m++){const E=8+10*m;g.push({css:c.channels.toCss(E,E,E),rgba:c.channels.toRgba(E,E,E)})}return g})());let f=s.ThemeService=class extends v.Disposable{get colors(){return this._colors}constructor(g){super(),this._optionsService=g,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new u.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:t,background:r,cursor:e,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:a,selectionBackgroundOpaque:c.color.blend(r,a),selectionInactiveBackgroundTransparent:a,selectionInactiveBackgroundOpaque:c.color.blend(r,a),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(g={}){const l=this._colors;if(l.foreground=p(g.foreground,t),l.background=p(g.background,r),l.cursor=p(g.cursor,e),l.cursorAccent=p(g.cursorAccent,i),l.selectionBackgroundTransparent=p(g.selectionBackground,a),l.selectionBackgroundOpaque=c.color.blend(l.background,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundTransparent=p(g.selectionInactiveBackground,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundOpaque=c.color.blend(l.background,l.selectionInactiveBackgroundTransparent),l.selectionForeground=g.selectionForeground?p(g.selectionForeground,c.NULL_COLOR):void 0,l.selectionForeground===c.NULL_COLOR&&(l.selectionForeground=void 0),c.color.isOpaque(l.selectionBackgroundTransparent)&&(l.selectionBackgroundTransparent=c.color.opacity(l.selectionBackgroundTransparent,.3)),c.color.isOpaque(l.selectionInactiveBackgroundTransparent)&&(l.selectionInactiveBackgroundTransparent=c.color.opacity(l.selectionInactiveBackgroundTransparent,.3)),l.ansi=s.DEFAULT_ANSI_COLORS.slice(),l.ansi[0]=p(g.black,s.DEFAULT_ANSI_COLORS[0]),l.ansi[1]=p(g.red,s.DEFAULT_ANSI_COLORS[1]),l.ansi[2]=p(g.green,s.DEFAULT_ANSI_COLORS[2]),l.ansi[3]=p(g.yellow,s.DEFAULT_ANSI_COLORS[3]),l.ansi[4]=p(g.blue,s.DEFAULT_ANSI_COLORS[4]),l.ansi[5]=p(g.magenta,s.DEFAULT_ANSI_COLORS[5]),l.ansi[6]=p(g.cyan,s.DEFAULT_ANSI_COLORS[6]),l.ansi[7]=p(g.white,s.DEFAULT_ANSI_COLORS[7]),l.ansi[8]=p(g.brightBlack,s.DEFAULT_ANSI_COLORS[8]),l.ansi[9]=p(g.brightRed,s.DEFAULT_ANSI_COLORS[9]),l.ansi[10]=p(g.brightGreen,s.DEFAULT_ANSI_COLORS[10]),l.ansi[11]=p(g.brightYellow,s.DEFAULT_ANSI_COLORS[11]),l.ansi[12]=p(g.brightBlue,s.DEFAULT_ANSI_COLORS[12]),l.ansi[13]=p(g.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),l.ansi[14]=p(g.brightCyan,s.DEFAULT_ANSI_COLORS[14]),l.ansi[15]=p(g.brightWhite,s.DEFAULT_ANSI_COLORS[15]),g.extendedAnsi){const m=Math.min(l.ansi.length-16,g.extendedAnsi.length);for(let E=0;E<m;E++)l.ansi[E+16]=p(g.extendedAnsi[E],s.DEFAULT_ANSI_COLORS[E+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(g){this._restoreColor(g),this._onChangeColors.fire(this.colors)}_restoreColor(g){if(g!==void 0)switch(g){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[g]=this._restoreColors.ansi[g]}else for(let l=0;l<this._restoreColors.ansi.length;++l)this._colors.ansi[l]=this._restoreColors.ansi[l]}modifyColors(g){g(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function p(g,l){if(g!==void 0)try{return c.css.toColor(g)}catch{}return l}s.ThemeService=f=d([_(0,h.IOptionsService)],f)},6349:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const d=o(8460),_=o(844);class n extends _.Disposable{constructor(u){super(),this._maxLength=u,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(u){if(this._maxLength===u)return;const v=new Array(u);for(let h=0;h<Math.min(u,this.length);h++)v[h]=this._array[this._getCyclicIndex(h)];this._array=v,this._maxLength=u,this._startIndex=0}get length(){return this._length}set length(u){if(u>this._length)for(let v=this._length;v<u;v++)this._array[v]=void 0;this._length=u}get(u){return this._array[this._getCyclicIndex(u)]}set(u,v){this._array[this._getCyclicIndex(u)]=v}push(u){this._array[this._getCyclicIndex(this._length)]=u,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(u,v,...h){if(v){for(let t=u;t<this._length-v;t++)this._array[this._getCyclicIndex(t)]=this._array[this._getCyclicIndex(t+v)];this._length-=v,this.onDeleteEmitter.fire({index:u,amount:v})}for(let t=this._length-1;t>=u;t--)this._array[this._getCyclicIndex(t+h.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<h.length;t++)this._array[this._getCyclicIndex(u+t)]=h[t];if(h.length&&this.onInsertEmitter.fire({index:u,amount:h.length}),this._length+h.length>this._maxLength){const t=this._length+h.length-this._maxLength;this._startIndex+=t,this._length=this._maxLength,this.onTrimEmitter.fire(t)}else this._length+=h.length}trimStart(u){u>this._length&&(u=this._length),this._startIndex+=u,this._length-=u,this.onTrimEmitter.fire(u)}shiftElements(u,v,h){if(!(v<=0)){if(u<0||u>=this._length)throw new Error("start argument out of range");if(u+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let r=v-1;r>=0;r--)this.set(u+r+h,this.get(u+r));const t=u+v+h-this._length;if(t>0)for(this._length+=t;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let t=0;t<v;t++)this.set(u+t+h,this.get(u+t))}}_getCyclicIndex(u){return(this._startIndex+u)%this._maxLength}}s.CircularList=n},1439:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function o(d,_=5){if(typeof d!="object")return d;const n=Array.isArray(d)?[]:{};for(const c in d)n[c]=_<=1?d[c]:d[c]&&o(d[c],_-1);return n}},8055:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,d=0,_=0,n=0;var c,u,v,h,t;function r(i){const a=i.toString(16);return a.length<2?"0"+a:a}function e(i,a){return i<a?(a+.05)/(i+.05):(i+.05)/(a+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(i){i.toCss=function(a,f,p,g){return g!==void 0?`#${r(a)}${r(f)}${r(p)}${r(g)}`:`#${r(a)}${r(f)}${r(p)}`},i.toRgba=function(a,f,p,g=255){return(a<<24|f<<16|p<<8|g)>>>0},i.toColor=function(a,f,p,g){return{css:i.toCss(a,f,p,g),rgba:i.toRgba(a,f,p,g)}}}(c||(s.channels=c={})),function(i){function a(f,p){return n=Math.round(255*p),[o,d,_]=t.toChannels(f.rgba),{css:c.toCss(o,d,_,n),rgba:c.toRgba(o,d,_,n)}}i.blend=function(f,p){if(n=(255&p.rgba)/255,n===1)return{css:p.css,rgba:p.rgba};const g=p.rgba>>24&255,l=p.rgba>>16&255,m=p.rgba>>8&255,E=f.rgba>>24&255,x=f.rgba>>16&255,L=f.rgba>>8&255;return o=E+Math.round((g-E)*n),d=x+Math.round((l-x)*n),_=L+Math.round((m-L)*n),{css:c.toCss(o,d,_),rgba:c.toRgba(o,d,_)}},i.isOpaque=function(f){return(255&f.rgba)==255},i.ensureContrastRatio=function(f,p,g){const l=t.ensureContrastRatio(f.rgba,p.rgba,g);if(l)return c.toColor(l>>24&255,l>>16&255,l>>8&255)},i.opaque=function(f){const p=(255|f.rgba)>>>0;return[o,d,_]=t.toChannels(p),{css:c.toCss(o,d,_),rgba:p}},i.opacity=a,i.multiplyOpacity=function(f,p){return n=255&f.rgba,a(f,n*p/255)},i.toColorRGB=function(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}}(u||(s.color=u={})),function(i){let a,f;try{const p=document.createElement("canvas");p.width=1,p.height=1;const g=p.getContext("2d",{willReadFrequently:!0});g&&(a=g,a.globalCompositeOperation="copy",f=a.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return o=parseInt(p.slice(1,2).repeat(2),16),d=parseInt(p.slice(2,3).repeat(2),16),_=parseInt(p.slice(3,4).repeat(2),16),c.toColor(o,d,_);case 5:return o=parseInt(p.slice(1,2).repeat(2),16),d=parseInt(p.slice(2,3).repeat(2),16),_=parseInt(p.slice(3,4).repeat(2),16),n=parseInt(p.slice(4,5).repeat(2),16),c.toColor(o,d,_,n);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const g=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return o=parseInt(g[1]),d=parseInt(g[2]),_=parseInt(g[3]),n=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),c.toColor(o,d,_,n);if(!a||!f)throw new Error("css.toColor: Unsupported css format");if(a.fillStyle=f,a.fillStyle=p,typeof a.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(a.fillRect(0,0,1,1),[o,d,_,n]=a.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:c.toRgba(o,d,_,n),css:p}}}(v||(s.css=v={})),function(i){function a(f,p,g){const l=f/255,m=p/255,E=g/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))}i.relativeLuminance=function(f){return a(f>>16&255,f>>8&255,255&f)},i.relativeLuminance2=a}(h||(s.rgb=h={})),function(i){function a(p,g,l){const m=p>>24&255,E=p>>16&255,x=p>>8&255;let L=g>>24&255,b=g>>16&255,A=g>>8&255,M=e(h.relativeLuminance2(L,b,A),h.relativeLuminance2(m,E,x));for(;M<l&&(L>0||b>0||A>0);)L-=Math.max(0,Math.ceil(.1*L)),b-=Math.max(0,Math.ceil(.1*b)),A-=Math.max(0,Math.ceil(.1*A)),M=e(h.relativeLuminance2(L,b,A),h.relativeLuminance2(m,E,x));return(L<<24|b<<16|A<<8|255)>>>0}function f(p,g,l){const m=p>>24&255,E=p>>16&255,x=p>>8&255;let L=g>>24&255,b=g>>16&255,A=g>>8&255,M=e(h.relativeLuminance2(L,b,A),h.relativeLuminance2(m,E,x));for(;M<l&&(L<255||b<255||A<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),b=Math.min(255,b+Math.ceil(.1*(255-b))),A=Math.min(255,A+Math.ceil(.1*(255-A))),M=e(h.relativeLuminance2(L,b,A),h.relativeLuminance2(m,E,x));return(L<<24|b<<16|A<<8|255)>>>0}i.blend=function(p,g){if(n=(255&g)/255,n===1)return g;const l=g>>24&255,m=g>>16&255,E=g>>8&255,x=p>>24&255,L=p>>16&255,b=p>>8&255;return o=x+Math.round((l-x)*n),d=L+Math.round((m-L)*n),_=b+Math.round((E-b)*n),c.toRgba(o,d,_)},i.ensureContrastRatio=function(p,g,l){const m=h.relativeLuminance(p>>8),E=h.relativeLuminance(g>>8);if(e(m,E)<l){if(E<m){const b=a(p,g,l),A=e(m,h.relativeLuminance(b>>8));if(A<l){const M=f(p,g,l);return A>e(m,h.relativeLuminance(M>>8))?b:M}return b}const x=f(p,g,l),L=e(m,h.relativeLuminance(x>>8));if(L<l){const b=a(p,g,l);return L>e(m,h.relativeLuminance(b>>8))?x:b}return x}},i.reduceLuminance=a,i.increaseLuminance=f,i.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]}}(t||(s.rgba=t={})),s.toPaddedHex=r,s.contrastRatio=e},8969:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const d=o(844),_=o(2585),n=o(4348),c=o(7866),u=o(744),v=o(7302),h=o(6975),t=o(8460),r=o(1753),e=o(1480),i=o(7994),a=o(9282),f=o(5435),p=o(5981),g=o(2660);let l=!1;class m extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new t.EventEmitter),this._onScroll.event(x=>{this._onScrollApi?.fire(x.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(x){for(const L in x)this.optionsService.options[L]=x[L]}constructor(x){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new t.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new t.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new t.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new t.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new t.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new t.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new v.OptionsService(x)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(u.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(c.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(r.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(g.OscLinkService),this._instantiationService.setService(_.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((0,t.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,t.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,t.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,t.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new p.WriteBuffer((L,b)=>this._inputHandler.parse(L,b))),this.register((0,t.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(x,L){this._writeBuffer.write(x,L)}writeSync(x,L){this._logService.logLevel<=_.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(x,L)}input(x,L=!0){this.coreService.triggerDataEvent(x,L)}resize(x,L){isNaN(x)||isNaN(L)||(x=Math.max(x,u.MINIMUM_COLS),L=Math.max(L,u.MINIMUM_ROWS),this._bufferService.resize(x,L))}scroll(x,L=!1){this._bufferService.scroll(x,L)}scrollLines(x,L,b){this._bufferService.scrollLines(x,L,b)}scrollPages(x){this.scrollLines(x*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(x){const L=x-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(x,L){return this._inputHandler.registerEscHandler(x,L)}registerDcsHandler(x,L){return this._inputHandler.registerDcsHandler(x,L)}registerCsiHandler(x,L){return this._inputHandler.registerCsiHandler(x,L)}registerOscHandler(x,L){return this._inputHandler.registerOscHandler(x,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let x=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?x=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(x=!0),x?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const x=[];x.push(this.onLineFeed(a.updateWindowsModeWrappedState.bind(null,this._bufferService))),x.push(this.registerCsiHandler({final:"H"},()=>((0,a.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const L of x)L.dispose()})}}}s.CoreTerminal=m},8460:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===o)return void this._listeners.splice(d,1)}}})),this._event}fire(o,d){const _=[];for(let n=0;n<this._listeners.length;n++)_.push(this._listeners[n]);for(let n=0;n<_.length;n++)_[n].call(void 0,o,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,d){return o(_=>d.fire(_))},s.runAndSubscribe=function(o,d){return d(void 0),o(_=>d(_))}},5435:function(R,s,o){var d=this&&this.__decorate||function(P,S,w,y){var k,T=arguments.length,H=T<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(P,S,w,y);else for(var $=P.length-1;$>=0;$--)(k=P[$])&&(H=(T<3?k(H):T>3?k(S,w,H):k(S,w))||H);return T>3&&H&&Object.defineProperty(S,w,H),H},_=this&&this.__param||function(P,S){return function(w,y){S(w,y,P)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const n=o(2584),c=o(7116),u=o(2015),v=o(844),h=o(482),t=o(8437),r=o(8460),e=o(643),i=o(511),a=o(3734),f=o(2585),p=o(1480),g=o(6242),l=o(6351),m=o(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},x=131072;function L(P,S){if(P>24)return S.setWinLines||!1;switch(P){case 1:return!!S.restoreWin;case 2:return!!S.minimizeWin;case 3:return!!S.setWinPosition;case 4:return!!S.setWinSizePixels;case 5:return!!S.raiseWin;case 6:return!!S.lowerWin;case 7:return!!S.refreshWin;case 8:return!!S.setWinSizeChars;case 9:return!!S.maximizeWin;case 10:return!!S.fullscreenWin;case 11:return!!S.getWinState;case 13:return!!S.getWinPosition;case 14:return!!S.getWinSizePixels;case 15:return!!S.getScreenSizePixels;case 16:return!!S.getCellSizePixels;case 18:return!!S.getWinSizeChars;case 19:return!!S.getScreenSizeChars;case 20:return!!S.getIconTitle;case 21:return!!S.getWinTitle;case 22:return!!S.pushTitle;case 23:return!!S.popTitle;case 24:return!!S.setWinLines}return!1}var b;(function(P){P[P.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",P[P.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(b||(s.WindowsOptionsReportType=b={}));let A=0;class M extends v.Disposable{getAttrData(){return this._curAttrData}constructor(S,w,y,k,T,H,$,z,D=new u.EscapeSequenceParser){super(),this._bufferService=S,this._charsetService=w,this._coreService=y,this._logService=k,this._optionsService=T,this._oscLinkService=H,this._coreMouseService=$,this._unicodeService=z,this._parser=D,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new i.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new r.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new r.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new r.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new r.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new r.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new r.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new r.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new r.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new r.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new r.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new r.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new r.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(C=>this._activeBuffer=C.activeBuffer)),this._parser.setCsiHandlerFallback((C,B)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(C),params:B.toArray()})}),this._parser.setEscHandlerFallback(C=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(C)})}),this._parser.setExecuteHandlerFallback(C=>{this._logService.debug("Unknown EXECUTE code: ",{code:C})}),this._parser.setOscHandlerFallback((C,B,O)=>{this._logService.debug("Unknown OSC code: ",{identifier:C,action:B,data:O})}),this._parser.setDcsHandlerFallback((C,B,O)=>{B==="HOOK"&&(O=O.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(C),action:B,payload:O})}),this._parser.setPrintHandler((C,B,O)=>this.print(C,B,O)),this._parser.registerCsiHandler({final:"@"},C=>this.insertChars(C)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},C=>this.scrollLeft(C)),this._parser.registerCsiHandler({final:"A"},C=>this.cursorUp(C)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},C=>this.scrollRight(C)),this._parser.registerCsiHandler({final:"B"},C=>this.cursorDown(C)),this._parser.registerCsiHandler({final:"C"},C=>this.cursorForward(C)),this._parser.registerCsiHandler({final:"D"},C=>this.cursorBackward(C)),this._parser.registerCsiHandler({final:"E"},C=>this.cursorNextLine(C)),this._parser.registerCsiHandler({final:"F"},C=>this.cursorPrecedingLine(C)),this._parser.registerCsiHandler({final:"G"},C=>this.cursorCharAbsolute(C)),this._parser.registerCsiHandler({final:"H"},C=>this.cursorPosition(C)),this._parser.registerCsiHandler({final:"I"},C=>this.cursorForwardTab(C)),this._parser.registerCsiHandler({final:"J"},C=>this.eraseInDisplay(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},C=>this.eraseInDisplay(C,!0)),this._parser.registerCsiHandler({final:"K"},C=>this.eraseInLine(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},C=>this.eraseInLine(C,!0)),this._parser.registerCsiHandler({final:"L"},C=>this.insertLines(C)),this._parser.registerCsiHandler({final:"M"},C=>this.deleteLines(C)),this._parser.registerCsiHandler({final:"P"},C=>this.deleteChars(C)),this._parser.registerCsiHandler({final:"S"},C=>this.scrollUp(C)),this._parser.registerCsiHandler({final:"T"},C=>this.scrollDown(C)),this._parser.registerCsiHandler({final:"X"},C=>this.eraseChars(C)),this._parser.registerCsiHandler({final:"Z"},C=>this.cursorBackwardTab(C)),this._parser.registerCsiHandler({final:"`"},C=>this.charPosAbsolute(C)),this._parser.registerCsiHandler({final:"a"},C=>this.hPositionRelative(C)),this._parser.registerCsiHandler({final:"b"},C=>this.repeatPrecedingCharacter(C)),this._parser.registerCsiHandler({final:"c"},C=>this.sendDeviceAttributesPrimary(C)),this._parser.registerCsiHandler({prefix:">",final:"c"},C=>this.sendDeviceAttributesSecondary(C)),this._parser.registerCsiHandler({final:"d"},C=>this.linePosAbsolute(C)),this._parser.registerCsiHandler({final:"e"},C=>this.vPositionRelative(C)),this._parser.registerCsiHandler({final:"f"},C=>this.hVPosition(C)),this._parser.registerCsiHandler({final:"g"},C=>this.tabClear(C)),this._parser.registerCsiHandler({final:"h"},C=>this.setMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"h"},C=>this.setModePrivate(C)),this._parser.registerCsiHandler({final:"l"},C=>this.resetMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"l"},C=>this.resetModePrivate(C)),this._parser.registerCsiHandler({final:"m"},C=>this.charAttributes(C)),this._parser.registerCsiHandler({final:"n"},C=>this.deviceStatus(C)),this._parser.registerCsiHandler({prefix:"?",final:"n"},C=>this.deviceStatusPrivate(C)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},C=>this.softReset(C)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},C=>this.setCursorStyle(C)),this._parser.registerCsiHandler({final:"r"},C=>this.setScrollRegion(C)),this._parser.registerCsiHandler({final:"s"},C=>this.saveCursor(C)),this._parser.registerCsiHandler({final:"t"},C=>this.windowOptions(C)),this._parser.registerCsiHandler({final:"u"},C=>this.restoreCursor(C)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},C=>this.insertColumns(C)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},C=>this.deleteColumns(C)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},C=>this.selectProtected(C)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},C=>this.requestMode(C,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},C=>this.requestMode(C,!1)),this._parser.setExecuteHandler(n.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new g.OscHandler(C=>(this.setTitle(C),this.setIconName(C),!0))),this._parser.registerOscHandler(1,new g.OscHandler(C=>this.setIconName(C))),this._parser.registerOscHandler(2,new g.OscHandler(C=>this.setTitle(C))),this._parser.registerOscHandler(4,new g.OscHandler(C=>this.setOrReportIndexedColor(C))),this._parser.registerOscHandler(8,new g.OscHandler(C=>this.setHyperlink(C))),this._parser.registerOscHandler(10,new g.OscHandler(C=>this.setOrReportFgColor(C))),this._parser.registerOscHandler(11,new g.OscHandler(C=>this.setOrReportBgColor(C))),this._parser.registerOscHandler(12,new g.OscHandler(C=>this.setOrReportCursorColor(C))),this._parser.registerOscHandler(104,new g.OscHandler(C=>this.restoreIndexedColor(C))),this._parser.registerOscHandler(110,new g.OscHandler(C=>this.restoreFgColor(C))),this._parser.registerOscHandler(111,new g.OscHandler(C=>this.restoreBgColor(C))),this._parser.registerOscHandler(112,new g.OscHandler(C=>this.restoreCursorColor(C))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const C in c.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:C},()=>this.selectCharset("("+C)),this._parser.registerEscHandler({intermediates:")",final:C},()=>this.selectCharset(")"+C)),this._parser.registerEscHandler({intermediates:"*",final:C},()=>this.selectCharset("*"+C)),this._parser.registerEscHandler({intermediates:"+",final:C},()=>this.selectCharset("+"+C)),this._parser.registerEscHandler({intermediates:"-",final:C},()=>this.selectCharset("-"+C)),this._parser.registerEscHandler({intermediates:".",final:C},()=>this.selectCharset("."+C)),this._parser.registerEscHandler({intermediates:"/",final:C},()=>this.selectCharset("/"+C));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(C=>(this._logService.error("Parsing error: ",C),C)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new l.DcsHandler((C,B)=>this.requestStatusString(C,B)))}_preserveStack(S,w,y,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=S,this._parseStack.cursorStartY=w,this._parseStack.decodedLength=y,this._parseStack.position=k}_logSlowResolvingAsync(S){this._logService.logLevel<=f.LogLevelEnum.WARN&&Promise.race([S,new Promise((w,y)=>setTimeout(()=>y("#SLOW_TIMEOUT"),5e3))]).catch(w=>{if(w!=="#SLOW_TIMEOUT")throw w;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(S,w){let y,k=this._activeBuffer.x,T=this._activeBuffer.y,H=0;const $=this._parseStack.paused;if($){if(y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,w))return this._logSlowResolvingAsync(y),y;k=this._parseStack.cursorStartX,T=this._parseStack.cursorStartY,this._parseStack.paused=!1,S.length>x&&(H=this._parseStack.position+x)}if(this._logService.logLevel<=f.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof S=="string"?` "${S}"`:` "${Array.prototype.map.call(S,C=>String.fromCharCode(C)).join("")}"`),typeof S=="string"?S.split("").map(C=>C.charCodeAt(0)):S),this._parseBuffer.length<S.length&&this._parseBuffer.length<x&&(this._parseBuffer=new Uint32Array(Math.min(S.length,x))),$||this._dirtyRowTracker.clearRange(),S.length>x)for(let C=H;C<S.length;C+=x){const B=C+x<S.length?C+x:S.length,O=typeof S=="string"?this._stringDecoder.decode(S.substring(C,B),this._parseBuffer):this._utf8Decoder.decode(S.subarray(C,B),this._parseBuffer);if(y=this._parser.parse(this._parseBuffer,O))return this._preserveStack(k,T,O,C),this._logSlowResolvingAsync(y),y}else if(!$){const C=typeof S=="string"?this._stringDecoder.decode(S,this._parseBuffer):this._utf8Decoder.decode(S,this._parseBuffer);if(y=this._parser.parse(this._parseBuffer,C))return this._preserveStack(k,T,C,0),this._logSlowResolvingAsync(y),y}this._activeBuffer.x===k&&this._activeBuffer.y===T||this._onCursorMove.fire();const z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),D=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);D<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(D,this._bufferService.rows-1),Math.min(z,this._bufferService.rows-1))}print(S,w,y){let k,T;const H=this._charsetService.charset,$=this._optionsService.rawOptions.screenReaderMode,z=this._bufferService.cols,D=this._coreService.decPrivateModes.wraparound,C=this._coreService.modes.insertMode,B=this._curAttrData;let O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&y-w>0&&O.getWidth(this._activeBuffer.x-1)===2&&O.setCellFromCodepoint(this._activeBuffer.x-1,0,1,B);let W=this._parser.precedingJoinState;for(let F=w;F<y;++F){if(k=S[F],k<127&&H){const re=H[String.fromCharCode(k)];re&&(k=re.charCodeAt(0))}const X=this._unicodeService.charProperties(k,W);T=p.UnicodeService.extractWidth(X);const Q=p.UnicodeService.extractShouldJoin(X),ee=Q?p.UnicodeService.extractWidth(W):0;if(W=X,$&&this._onA11yChar.fire((0,h.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+T-ee>z){if(D){const re=O;let q=this._activeBuffer.x-ee;for(this._activeBuffer.x=ee,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ee>0&&O instanceof t.BufferLine&&O.copyCellsFrom(re,q,0,ee,!1);q<z;)re.setCellFromCodepoint(q++,0,1,B)}else if(this._activeBuffer.x=z-1,T===2)continue}if(Q&&this._activeBuffer.x){const re=O.getWidth(this._activeBuffer.x-1)?1:2;O.addCodepointToCell(this._activeBuffer.x-re,k,T);for(let q=T-ee;--q>=0;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,B)}else if(C&&(O.insertCells(this._activeBuffer.x,T-ee,this._activeBuffer.getNullCell(B)),O.getWidth(z-1)===2&&O.setCellFromCodepoint(z-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,B)),O.setCellFromCodepoint(this._activeBuffer.x++,k,T,B),T>0)for(;--T;)O.setCellFromCodepoint(this._activeBuffer.x++,0,0,B)}this._parser.precedingJoinState=W,this._activeBuffer.x<z&&y-w>0&&O.getWidth(this._activeBuffer.x)===0&&!O.hasContent(this._activeBuffer.x)&&O.setCellFromCodepoint(this._activeBuffer.x,0,1,B),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(S,w){return S.final!=="t"||S.prefix||S.intermediates?this._parser.registerCsiHandler(S,w):this._parser.registerCsiHandler(S,y=>!L(y.params[0],this._optionsService.rawOptions.windowOptions)||w(y))}registerDcsHandler(S,w){return this._parser.registerDcsHandler(S,new l.DcsHandler(w))}registerEscHandler(S,w){return this._parser.registerEscHandler(S,w)}registerOscHandler(S,w){return this._parser.registerOscHandler(S,new g.OscHandler(w))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);S.hasWidth(this._activeBuffer.x)&&!S.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const S=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-S),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(S=this._bufferService.cols-1){this._activeBuffer.x=Math.min(S,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(S,w){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=S,this._activeBuffer.y=this._activeBuffer.scrollTop+w):(this._activeBuffer.x=S,this._activeBuffer.y=w),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(S,w){this._restrictCursor(),this._setCursor(this._activeBuffer.x+S,this._activeBuffer.y+w)}cursorUp(S){const w=this._activeBuffer.y-this._activeBuffer.scrollTop;return w>=0?this._moveCursor(0,-Math.min(w,S.params[0]||1)):this._moveCursor(0,-(S.params[0]||1)),!0}cursorDown(S){const w=this._activeBuffer.scrollBottom-this._activeBuffer.y;return w>=0?this._moveCursor(0,Math.min(w,S.params[0]||1)):this._moveCursor(0,S.params[0]||1),!0}cursorForward(S){return this._moveCursor(S.params[0]||1,0),!0}cursorBackward(S){return this._moveCursor(-(S.params[0]||1),0),!0}cursorNextLine(S){return this.cursorDown(S),this._activeBuffer.x=0,!0}cursorPrecedingLine(S){return this.cursorUp(S),this._activeBuffer.x=0,!0}cursorCharAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(S){return this._setCursor(S.length>=2?(S.params[1]||1)-1:0,(S.params[0]||1)-1),!0}charPosAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(S){return this._moveCursor(S.params[0]||1,0),!0}linePosAbsolute(S){return this._setCursor(this._activeBuffer.x,(S.params[0]||1)-1),!0}vPositionRelative(S){return this._moveCursor(0,S.params[0]||1),!0}hVPosition(S){return this.cursorPosition(S),!0}tabClear(S){const w=S.params[0];return w===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:w===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let w=S.params[0]||1;for(;w--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let w=S.params[0]||1;for(;w--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(S){const w=S.params[0];return w===1&&(this._curAttrData.bg|=536870912),w!==2&&w!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(S,w,y,k=!1,T=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);H.replaceCells(w,y,this._activeBuffer.getNullCell(this._eraseAttrData()),T),k&&(H.isWrapped=!1)}_resetBufferLine(S,w=!1){const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);y&&(y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),w),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+S),y.isWrapped=!1)}eraseInDisplay(S,w=!1){let y;switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,w);y<this._bufferService.rows;y++)this._resetBufferLine(y,w);this._dirtyRowTracker.markDirty(y);break;case 1:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y,0,this._activeBuffer.x+1,!0,w),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(y+1).isWrapped=!1);y--;)this._resetBufferLine(y,w);this._dirtyRowTracker.markDirty(0);break;case 2:for(y=this._bufferService.rows,this._dirtyRowTracker.markDirty(y-1);y--;)this._resetBufferLine(y,w);this._dirtyRowTracker.markDirty(0);break;case 3:const k=this._activeBuffer.lines.length-this._bufferService.rows;k>0&&(this._activeBuffer.lines.trimStart(k),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-k,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-k,0),this._onScroll.fire(0))}return!0}eraseInLine(S,w=!1){switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,w);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,w);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,w)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(S){this._restrictCursor();let w=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,T=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;w--;)this._activeBuffer.lines.splice(T-1,1),this._activeBuffer.lines.splice(y,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(S){this._restrictCursor();let w=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=this._activeBuffer.ybase+this._activeBuffer.y;let k;for(k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-k;w--;)this._activeBuffer.lines.splice(y,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(S){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.insertCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(S){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.deleteCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(S){let w=S.params[0]||1;for(;w--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(S){let w=S.params[0]||1;for(;w--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(t.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=S.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);k.deleteCells(0,w,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=S.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);k.insertCells(0,w,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=S.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);k.insertCells(this._activeBuffer.x,w,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const w=S.params[0]||1;for(let y=this._activeBuffer.scrollTop;y<=this._activeBuffer.scrollBottom;++y){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);k.deleteCells(this._activeBuffer.x,w,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(S){this._restrictCursor();const w=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return w&&(w.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(S.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(S){const w=this._parser.precedingJoinState;if(!w)return!0;const y=S.params[0]||1,k=p.UnicodeService.extractWidth(w),T=this._activeBuffer.x-k,H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(T),$=new Uint32Array(H.length*y);let z=0;for(let C=0;C<H.length;){const B=H.codePointAt(C)||0;$[z++]=B,C+=B>65535?2:1}let D=z;for(let C=1;C<y;++C)$.copyWithin(D,0,z),D+=z;return this.print($,0,D),!0}sendDeviceAttributesPrimary(S){return S.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(S){return S.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(S.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(S){return(this._optionsService.rawOptions.termName+"").indexOf(S)===0}setMode(S){for(let w=0;w<S.length;w++)switch(S.params[w]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(S){for(let w=0;w<S.length;w++)switch(S.params[w]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),this._charsetService.setgCharset(1,c.DEFAULT_CHARSET),this._charsetService.setgCharset(2,c.DEFAULT_CHARSET),this._charsetService.setgCharset(3,c.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(S){for(let w=0;w<S.length;w++)switch(S.params[w]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(S){for(let w=0;w<S.length;w++)switch(S.params[w]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),S.params[w]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(S,w){const y=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:T}=this._coreMouseService,H=this._coreService,{buffers:$,cols:z}=this._bufferService,{active:D,alt:C}=$,B=this._optionsService.rawOptions,O=Q=>Q?1:2,W=S.params[0];return F=W,X=w?W===2?4:W===4?O(H.modes.insertMode):W===12?3:W===20?O(B.convertEol):0:W===1?O(y.applicationCursorKeys):W===3?B.windowOptions.setWinLines?z===80?2:z===132?1:0:0:W===6?O(y.origin):W===7?O(y.wraparound):W===8?3:W===9?O(k==="X10"):W===12?O(B.cursorBlink):W===25?O(!H.isCursorHidden):W===45?O(y.reverseWraparound):W===66?O(y.applicationKeypad):W===67?4:W===1e3?O(k==="VT200"):W===1002?O(k==="DRAG"):W===1003?O(k==="ANY"):W===1004?O(y.sendFocus):W===1005?4:W===1006?O(T==="SGR"):W===1015?4:W===1016?O(T==="SGR_PIXELS"):W===1048?1:W===47||W===1047||W===1049?O(D===C):W===2004?O(y.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${w?"":"?"}${F};${X}$y`),!0;var F,X}_updateAttrColor(S,w,y,k,T){return w===2?(S|=50331648,S&=-16777216,S|=a.AttributeData.fromColorRGB([y,k,T])):w===5&&(S&=-50331904,S|=33554432|255&y),S}_extractColor(S,w,y){const k=[0,0,-1,0,0,0];let T=0,H=0;do{if(k[H+T]=S.params[w+H],S.hasSubParams(w+H)){const $=S.getSubParams(w+H);let z=0;do k[1]===5&&(T=1),k[H+z+1+T]=$[z];while(++z<$.length&&z+H+1+T<k.length);break}if(k[1]===5&&H+T>=2||k[1]===2&&H+T>=5)break;k[1]&&(T=1)}while(++H+w<S.length&&H+T<k.length);for(let $=2;$<k.length;++$)k[$]===-1&&(k[$]=0);switch(k[0]){case 38:y.fg=this._updateAttrColor(y.fg,k[1],k[3],k[4],k[5]);break;case 48:y.bg=this._updateAttrColor(y.bg,k[1],k[3],k[4],k[5]);break;case 58:y.extended=y.extended.clone(),y.extended.underlineColor=this._updateAttrColor(y.extended.underlineColor,k[1],k[3],k[4],k[5])}return H}_processUnderline(S,w){w.extended=w.extended.clone(),(!~S||S>5)&&(S=1),w.extended.underlineStyle=S,w.fg|=268435456,S===0&&(w.fg&=-268435457),w.updateExtended()}_processSGR0(S){S.fg=t.DEFAULT_ATTR_DATA.fg,S.bg=t.DEFAULT_ATTR_DATA.bg,S.extended=S.extended.clone(),S.extended.underlineStyle=0,S.extended.underlineColor&=-67108864,S.updateExtended()}charAttributes(S){if(S.length===1&&S.params[0]===0)return this._processSGR0(this._curAttrData),!0;const w=S.length;let y;const k=this._curAttrData;for(let T=0;T<w;T++)y=S.params[T],y>=30&&y<=37?(k.fg&=-50331904,k.fg|=16777216|y-30):y>=40&&y<=47?(k.bg&=-50331904,k.bg|=16777216|y-40):y>=90&&y<=97?(k.fg&=-50331904,k.fg|=16777224|y-90):y>=100&&y<=107?(k.bg&=-50331904,k.bg|=16777224|y-100):y===0?this._processSGR0(k):y===1?k.fg|=134217728:y===3?k.bg|=67108864:y===4?(k.fg|=268435456,this._processUnderline(S.hasSubParams(T)?S.getSubParams(T)[0]:1,k)):y===5?k.fg|=536870912:y===7?k.fg|=67108864:y===8?k.fg|=1073741824:y===9?k.fg|=2147483648:y===2?k.bg|=134217728:y===21?this._processUnderline(2,k):y===22?(k.fg&=-134217729,k.bg&=-134217729):y===23?k.bg&=-67108865:y===24?(k.fg&=-268435457,this._processUnderline(0,k)):y===25?k.fg&=-536870913:y===27?k.fg&=-67108865:y===28?k.fg&=-1073741825:y===29?k.fg&=2147483647:y===39?(k.fg&=-67108864,k.fg|=16777215&t.DEFAULT_ATTR_DATA.fg):y===49?(k.bg&=-67108864,k.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):y===38||y===48||y===58?T+=this._extractColor(S,T,k):y===53?k.bg|=1073741824:y===55?k.bg&=-1073741825:y===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):y===100?(k.fg&=-67108864,k.fg|=16777215&t.DEFAULT_ATTR_DATA.fg,k.bg&=-67108864,k.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",y);return!0}deviceStatus(S){switch(S.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const w=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${w};${y}R`)}return!0}deviceStatusPrivate(S){if(S.params[0]===6){const w=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${w};${y}R`)}return!0}softReset(S){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(S){const w=S.params[0]||1;switch(w){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const y=w%2==1;return this._optionsService.options.cursorBlink=y,!0}setScrollRegion(S){const w=S.params[0]||1;let y;return(S.length<2||(y=S.params[1])>this._bufferService.rows||y===0)&&(y=this._bufferService.rows),y>w&&(this._activeBuffer.scrollTop=w-1,this._activeBuffer.scrollBottom=y-1,this._setCursor(0,0)),!0}windowOptions(S){if(!L(S.params[0],this._optionsService.rawOptions.windowOptions))return!0;const w=S.length>1?S.params[1]:0;switch(S.params[0]){case 14:w!==2&&this._onRequestWindowsOptionsReport.fire(b.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(b.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:w!==0&&w!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),w!==0&&w!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:w!==0&&w!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),w!==0&&w!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(S){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(S){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(S){return this._windowTitle=S,this._onTitleChange.fire(S),!0}setIconName(S){return this._iconName=S,!0}setOrReportIndexedColor(S){const w=[],y=S.split(";");for(;y.length>1;){const k=y.shift(),T=y.shift();if(/^\d+$/.exec(k)){const H=parseInt(k);if(U(H))if(T==="?")w.push({type:0,index:H});else{const $=(0,m.parseColor)(T);$&&w.push({type:1,index:H,color:$})}}}return w.length&&this._onColor.fire(w),!0}setHyperlink(S){const w=S.split(";");return!(w.length<2)&&(w[1]?this._createHyperlink(w[0],w[1]):!w[0]&&this._finishHyperlink())}_createHyperlink(S,w){this._getCurrentLinkId()&&this._finishHyperlink();const y=S.split(":");let k;const T=y.findIndex(H=>H.startsWith("id="));return T!==-1&&(k=y[T].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:k,uri:w}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(S,w){const y=S.split(";");for(let k=0;k<y.length&&!(w>=this._specialColors.length);++k,++w)if(y[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[w]}]);else{const T=(0,m.parseColor)(y[k]);T&&this._onColor.fire([{type:1,index:this._specialColors[w],color:T}])}return!0}setOrReportFgColor(S){return this._setOrReportSpecialColor(S,0)}setOrReportBgColor(S){return this._setOrReportSpecialColor(S,1)}setOrReportCursorColor(S){return this._setOrReportSpecialColor(S,2)}restoreIndexedColor(S){if(!S)return this._onColor.fire([{type:2}]),!0;const w=[],y=S.split(";");for(let k=0;k<y.length;++k)if(/^\d+$/.exec(y[k])){const T=parseInt(y[k]);U(T)&&w.push({type:2,index:T})}return w.length&&this._onColor.fire(w),!0}restoreFgColor(S){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(S){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(S){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),!0}selectCharset(S){return S.length!==2?(this.selectDefaultCharset(),!0):(S[0]==="/"||this._charsetService.setgCharset(E[S[0]],c.CHARSETS[S[1]]||c.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const S=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,S,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(S){return this._charsetService.setgLevel(S),!0}screenAlignmentPattern(){const S=new i.CellData;S.content=4194373,S.fg=this._curAttrData.fg,S.bg=this._curAttrData.bg,this._setCursor(0,0);for(let w=0;w<this._bufferService.rows;++w){const y=this._activeBuffer.ybase+this._activeBuffer.y+w,k=this._activeBuffer.lines.get(y);k&&(k.fill(S),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(S,w){const y=this._bufferService.buffer,k=this._optionsService.rawOptions;return(T=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${T}${n.C0.ESC}\\`),!0))(S==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:S==='"p'?'P1$r61;1"p':S==="r"?`P1$r${y.scrollTop+1};${y.scrollBottom+1}r`:S==="m"?"P1$r0m":S===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(S,w){this._dirtyRowTracker.markRangeDirty(S,w)}}s.InputHandler=M;let I=class{constructor(P){this._bufferService=P,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(P){P<this.start?this.start=P:P>this.end&&(this.end=P)}markRangeDirty(P,S){P>S&&(A=P,P=S,S=A),P<this.start&&(this.start=P),S>this.end&&(this.end=S)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(P){return 0<=P&&P<256}I=d([_(0,f.IBufferService)],I)},844:(R,s)=>{function o(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=o,s.getDisposeArrayDisposable=function(d){return{dispose:()=>o(d)}}},1505:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(_,n,c){this._data[_]||(this._data[_]={}),this._data[_][n]=c}get(_,n){return this._data[_]?this._data[_][n]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(d,_,n,c,u){this._data.get(d,_)||this._data.set(d,_,new o),this._data.get(d,_).set(n,c,u)}get(d,_,n,c){return this._data.get(d,_)?.get(n,c)}clear(){this._data.clear()}}},6114:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof De<"u"&&"title"in De;const o=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const _=o.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},6106:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let o=0;s.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(o=this._search(this._getKey(d)),this._array.splice(o,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const _=this._getKey(d);if(_===void 0||(o=this._search(_),o===-1)||this._getKey(this._array[o])!==_)return!1;do if(this._array[o]===d)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===_);return!1}*getKeyIterator(d){if(this._array.length!==0&&(o=this._search(d),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===d))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===d)}forEachByKey(d,_){if(this._array.length!==0&&(o=this._search(d),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===d))do _(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===d)}values(){return[...this._array].values()}_search(d){let _=0,n=this._array.length-1;for(;n>=_;){let c=_+n>>1;const u=this._getKey(this._array[c]);if(u>d)n=c-1;else{if(!(u<d)){for(;c>0&&this._getKey(this._array[c-1])===d;)c--;return c}_=c+1}}return _}}},7226:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=o(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(u){this._tasks.push(u),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(u){this._idleCallback=void 0;let v=0,h=0,t=u.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),h=Math.max(v,h),r=u.timeRemaining(),1.5*h>r)return t-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(t-v))}ms`),void this._start();t=r}this.clear()}}class n extends _{_requestCallback(u){return setTimeout(()=>u(this._createDeadline(16)))}_cancelCallback(u){clearTimeout(u)}_createDeadline(u){const v=Date.now()+u;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}s.PriorityTaskQueue=n,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(c){return requestIdleCallback(c)}_cancelCallback(c){cancelIdleCallback(c)}}:n,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(c){this._queue.clear(),this._queue.enqueue(c)}flush(){this._queue.flush()}}},9282:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const d=o(643);s.updateWindowsModeWrappedState=function(_){const n=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),c=n?.get(_.cols-1),u=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);u&&c&&(u.isWrapped=c[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&c[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,c=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=c}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},9092:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const d=o(6349),_=o(7226),n=o(3734),c=o(8437),u=o(4634),v=o(511),h=o(643),t=o(4863),r=o(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(e,i,a){this._hasScrollback=e,this._optionsService=i,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=c.DEFAULT_ATTR_DATA.clone(),this.savedCharset=r.DEFAULT_CHARSET,this.markers=[],this._nullCell=v.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=v.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,i){return new c.BufferLine(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const i=e+this._optionsService.rawOptions.scrollback;return i>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=c.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){const a=this.getNullCell(c.DEFAULT_ATTR_DATA);let f=0;const p=this._getCorrectBufferLength(i);if(p>this.lines.maxLength&&(this.lines.maxLength=p),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)f+=+this.lines.get(l).resize(e,a);let g=0;if(this._rows<i)for(let l=this._rows;l<i;l++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new c.BufferLine(e,a)):this.ybase>0&&this.lines.length<=this.ybase+this.y+g+1?(this.ybase--,g++,this.ydisp>0&&this.ydisp--):this.lines.push(new c.BufferLine(e,a)));else for(let l=this._rows;l>i;l--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(p<this.lines.maxLength){const l=this.lines.length-p;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=p}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),g&&(this.y+=g),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let g=0;g<this.lines.length;g++)f+=+this.lines.get(g).resize(e,a);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),f>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){const a=(0,u.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(c.DEFAULT_ATTR_DATA));if(a.length>0){const f=(0,u.reflowLargerCreateNewLayout)(this.lines,a);(0,u.reflowLargerApplyNewLayout)(this.lines,f.layout),this._reflowLargerAdjustViewport(e,i,f.countRemoved)}}_reflowLargerAdjustViewport(e,i,a){const f=this.getNullCell(c.DEFAULT_ATTR_DATA);let p=a;for(;p-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new c.BufferLine(e,f))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-a,0)}_reflowSmaller(e,i){const a=this.getNullCell(c.DEFAULT_ATTR_DATA),f=[];let p=0;for(let g=this.lines.length-1;g>=0;g--){let l=this.lines.get(g);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;const m=[l];for(;l.isWrapped&&g>0;)l=this.lines.get(--g),m.unshift(l);const E=this.ybase+this.y;if(E>=g&&E<g+m.length)continue;const x=m[m.length-1].getTrimmedLength(),L=(0,u.reflowSmallerGetNewLineLengths)(m,this._cols,e),b=L.length-m.length;let A;A=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+b):Math.max(0,this.lines.length-this.lines.maxLength+b);const M=[];for(let y=0;y<b;y++){const k=this.getBlankLine(c.DEFAULT_ATTR_DATA,!0);M.push(k)}M.length>0&&(f.push({start:g+m.length+p,newLines:M}),p+=M.length),m.push(...M);let I=L.length-1,U=L[I];U===0&&(I--,U=L[I]);let P=m.length-b-1,S=x;for(;P>=0;){const y=Math.min(S,U);if(m[I]===void 0)break;if(m[I].copyCellsFrom(m[P],S-y,U-y,y,!0),U-=y,U===0&&(I--,U=L[I]),S-=y,S===0){P--;const k=Math.max(P,0);S=(0,u.getWrappedLineTrimmedLength)(m,k,this._cols)}}for(let y=0;y<m.length;y++)L[y]<e&&m[y].setCell(L[y],a);let w=b-A;for(;w-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+p)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+i-1)}if(f.length>0){const g=[],l=[];for(let I=0;I<this.lines.length;I++)l.push(this.lines.get(I));const m=this.lines.length;let E=m-1,x=0,L=f[x];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+p);let b=0;for(let I=Math.min(this.lines.maxLength-1,m+p-1);I>=0;I--)if(L&&L.start>E+b){for(let U=L.newLines.length-1;U>=0;U--)this.lines.set(I--,L.newLines[U]);I++,g.push({index:E+1,amount:L.newLines.length}),b+=L.newLines.length,L=f[++x]}else this.lines.set(I,l[E--]);let A=0;for(let I=g.length-1;I>=0;I--)g[I].index+=A,this.lines.onInsertEmitter.fire(g[I]),A+=g[I].amount;const M=Math.max(0,m+p-this.lines.maxLength);M>0&&this.lines.onTrimEmitter.fire(M)}}translateBufferLineToString(e,i,a=0,f){const p=this.lines.get(e);return p?p.translateToString(i,a,f):""}getWrappedRangeForLine(e){let i=e,a=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;a+1<this.lines.length&&this.lines.get(a+1).isWrapped;)a++;return{first:i,last:a}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const i=new t.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim(a=>{i.line-=a,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(a=>{i.line>=a.index&&(i.line+=a.amount)})),i.register(this.lines.onDelete(a=>{i.line>=a.index&&i.line<a.index+a.amount&&i.dispose(),i.line>a.index&&(i.line-=a.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const d=o(3734),_=o(511),n=o(643),c=o(482);s.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let u=0;class v{constructor(t,r,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);const i=r||_.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let a=0;a<t;++a)this.setCell(a,i);this.length=t}get(t){const r=this._data[3*t+0],e=2097151&r;return[this._data[3*t+1],2097152&r?this._combined[t]:e?(0,c.stringFromCodePoint)(e):"",r>>22,2097152&r?this._combined[t].charCodeAt(this._combined[t].length-1):e]}set(t,r){this._data[3*t+1]=r[n.CHAR_DATA_ATTR_INDEX],r[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=r[1],this._data[3*t+0]=2097152|t|r[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=r[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|r[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){const r=this._data[3*t+0];return 2097152&r?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&r}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){const r=this._data[3*t+0];return 2097152&r?this._combined[t]:2097151&r?(0,c.stringFromCodePoint)(2097151&r):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,r){return u=3*t,r.content=this._data[u+0],r.fg=this._data[u+1],r.bg=this._data[u+2],2097152&r.content&&(r.combinedData=this._combined[t]),268435456&r.bg&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){2097152&r.content&&(this._combined[t]=r.combinedData),268435456&r.bg&&(this._extendedAttrs[t]=r.extended),this._data[3*t+0]=r.content,this._data[3*t+1]=r.fg,this._data[3*t+2]=r.bg}setCellFromCodepoint(t,r,e,i){268435456&i.bg&&(this._extendedAttrs[t]=i.extended),this._data[3*t+0]=r|e<<22,this._data[3*t+1]=i.fg,this._data[3*t+2]=i.bg}addCodepointToCell(t,r,e){let i=this._data[3*t+0];2097152&i?this._combined[t]+=(0,c.stringFromCodePoint)(r):2097151&i?(this._combined[t]=(0,c.stringFromCodePoint)(2097151&i)+(0,c.stringFromCodePoint)(r),i&=-2097152,i|=2097152):i=r|4194304,e&&(i&=-12582913,i|=e<<22),this._data[3*t+0]=i}insertCells(t,r,e){if((t%=this.length)&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),r<this.length-t){const i=new _.CellData;for(let a=this.length-t-r-1;a>=0;--a)this.setCell(t+r+a,this.loadCell(t+a,i));for(let a=0;a<r;++a)this.setCell(t+a,e)}else for(let i=t;i<this.length;++i)this.setCell(i,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(t,r,e){if(t%=this.length,r<this.length-t){const i=new _.CellData;for(let a=0;a<this.length-t-r;++a)this.setCell(t+a,this.loadCell(t+r+a,i));for(let a=this.length-r;a<this.length;++a)this.setCell(a,e)}else for(let i=t;i<this.length;++i)this.setCell(i,e);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),this.getWidth(t)!==0||this.hasContent(t)||this.setCellFromCodepoint(t,0,1,e)}replaceCells(t,r,e,i=!1){if(i)for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,e),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,e);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,e),t++;else for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,e);t<r&&t<this.length;)this.setCell(t++,e)}resize(t,r){if(t===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*t;if(t>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const i=new Uint32Array(e);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,r)}else{this._data=this._data.subarray(0,e);const i=Object.keys(this._combined);for(let f=0;f<i.length;f++){const p=parseInt(i[f],10);p>=t&&delete this._combined[p]}const a=Object.keys(this._extendedAttrs);for(let f=0;f<a.length;f++){const p=parseInt(a[f],10);p>=t&&delete this._extendedAttrs[p]}}return this.length=t,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(const r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(const r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){const t=new v(0);t._data=new Uint32Array(this._data),t.length=this.length;for(const r in this._combined)t._combined[r]=this._combined[r];for(const r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0]||50331648&this._data[3*t+2])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,r,e,i,a){const f=t._data;if(a)for(let g=i-1;g>=0;g--){for(let l=0;l<3;l++)this._data[3*(e+g)+l]=f[3*(r+g)+l];268435456&f[3*(r+g)+2]&&(this._extendedAttrs[e+g]=t._extendedAttrs[r+g])}else for(let g=0;g<i;g++){for(let l=0;l<3;l++)this._data[3*(e+g)+l]=f[3*(r+g)+l];268435456&f[3*(r+g)+2]&&(this._extendedAttrs[e+g]=t._extendedAttrs[r+g])}const p=Object.keys(t._combined);for(let g=0;g<p.length;g++){const l=parseInt(p[g],10);l>=r&&(this._combined[l-r+e]=t._combined[l])}}translateToString(t,r,e,i){r=r??0,e=e??this.length,t&&(e=Math.min(e,this.getTrimmedLength())),i&&(i.length=0);let a="";for(;r<e;){const f=this._data[3*r+0],p=2097151&f,g=2097152&f?this._combined[r]:p?(0,c.stringFromCodePoint)(p):n.WHITESPACE_CELL_CHAR;if(a+=g,i)for(let l=0;l<g.length;++l)i.push(r);r+=f>>22||1}return i&&i.push(r),a}}s.BufferLine=v},4841:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(o,d){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return d*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(R,s)=>{function o(d,_,n){if(_===d.length-1)return d[_].getTrimmedLength();const c=!d[_].hasContent(n-1)&&d[_].getWidth(n-1)===1,u=d[_+1].getWidth(0)===2;return c&&u?n-1:n}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(d,_,n,c,u){const v=[];for(let h=0;h<d.length-1;h++){let t=h,r=d.get(++t);if(!r.isWrapped)continue;const e=[d.get(h)];for(;t<d.length&&r.isWrapped;)e.push(r),r=d.get(++t);if(c>=h&&c<t){h+=e.length-1;continue}let i=0,a=o(e,i,_),f=1,p=0;for(;f<e.length;){const l=o(e,f,_),m=l-p,E=n-a,x=Math.min(m,E);e[i].copyCellsFrom(e[f],p,a,x,!1),a+=x,a===n&&(i++,a=0),p+=x,p===l&&(f++,p=0),a===0&&i!==0&&e[i-1].getWidth(n-1)===2&&(e[i].copyCellsFrom(e[i-1],n-1,a++,1,!1),e[i-1].setCell(n-1,u))}e[i].replaceCells(a,n,u);let g=0;for(let l=e.length-1;l>0&&(l>i||e[l].getTrimmedLength()===0);l--)g++;g>0&&(v.push(h+e.length-g),v.push(g)),h+=e.length-1}return v},s.reflowLargerCreateNewLayout=function(d,_){const n=[];let c=0,u=_[c],v=0;for(let h=0;h<d.length;h++)if(u===h){const t=_[++c];d.onDeleteEmitter.fire({index:h-v,amount:t}),h+=t-1,v+=t,u=_[++c]}else n.push(h);return{layout:n,countRemoved:v}},s.reflowLargerApplyNewLayout=function(d,_){const n=[];for(let c=0;c<_.length;c++)n.push(d.get(_[c]));for(let c=0;c<n.length;c++)d.set(c,n[c]);d.length=_.length},s.reflowSmallerGetNewLineLengths=function(d,_,n){const c=[],u=d.map((r,e)=>o(d,e,_)).reduce((r,e)=>r+e);let v=0,h=0,t=0;for(;t<u;){if(u-t<n){c.push(u-t);break}v+=n;const r=o(d,h,_);v>r&&(v-=r,h++);const e=d[h].getWidth(v-1)===2;e&&v--;const i=e?n-1:n;c.push(i),t+=i}return c},s.getWrappedLineTrimmedLength=o},5295:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const d=o(8460),_=o(844),n=o(9092);class c extends _.Disposable{constructor(v,h){super(),this._optionsService=v,this._bufferService=h,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(v){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(v),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(v,h){this._normal.resize(v,h),this._alt.resize(v,h),this.setupTabStops(v)}setupTabStops(v){this._normal.setupTabStops(v),this._alt.setupTabStops(v)}}s.BufferSet=c},511:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=o(482),_=o(643),n=o(3734);class c extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(v){const h=new c;return h.setFromCharData(v),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(v){this.fg=v[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(v[_.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(v[_.CHAR_DATA_CHAR_INDEX].length===2){const t=v[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){const r=v[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(t-55296)+r-56320+65536|v[_.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=v[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[_.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=v[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=c},643:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const d=o(8460),_=o(844);class n{get id(){return this._id}constructor(u){this.line=u,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(u){return this._disposables.push(u),u}}s.Marker=n,n._nextId=1},7116:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(R,s)=>{var o,d,_;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
|
|
8
|
+
`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""}(o||(s.C0=o={})),function(n){n.PAD="",n.HOP="",n.BPH="",n.NBH="",n.IND="",n.NEL="
",n.SSA="",n.ESA="",n.HTS="",n.HTJ="",n.VTS="",n.PLD="",n.PLU="",n.RI="",n.SS2="",n.SS3="",n.DCS="",n.PU1="",n.PU2="",n.STS="",n.CCH="",n.MW="",n.SPA="",n.EPA="",n.SOS="",n.SGCI="",n.SCI="",n.CSI="",n.ST="",n.OSC="",n.PM="",n.APC=""}(d||(s.C1=d={})),function(n){n.ST=`${o.ESC}\\`}(_||(s.C1_ESCAPED=_={}))},7399:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const d=o(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(n,c,u,v){const h={type:0,cancel:!1,key:void 0},t=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?h.key=c?d.C0.ESC+"OA":d.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?h.key=c?d.C0.ESC+"OD":d.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?h.key=c?d.C0.ESC+"OC":d.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(h.key=c?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:h.key=n.ctrlKey?"\b":d.C0.DEL,n.altKey&&(h.key=d.C0.ESC+h.key);break;case 9:if(n.shiftKey){h.key=d.C0.ESC+"[Z";break}h.key=d.C0.HT,h.cancel=!0;break;case 13:h.key=n.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,h.cancel=!0;break;case 27:h.key=d.C0.ESC,n.altKey&&(h.key=d.C0.ESC+d.C0.ESC),h.cancel=!0;break;case 37:if(n.metaKey)break;t?(h.key=d.C0.ESC+"[1;"+(t+1)+"D",h.key===d.C0.ESC+"[1;3D"&&(h.key=d.C0.ESC+(u?"b":"[1;5D"))):h.key=c?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(n.metaKey)break;t?(h.key=d.C0.ESC+"[1;"+(t+1)+"C",h.key===d.C0.ESC+"[1;3C"&&(h.key=d.C0.ESC+(u?"f":"[1;5C"))):h.key=c?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(n.metaKey)break;t?(h.key=d.C0.ESC+"[1;"+(t+1)+"A",u||h.key!==d.C0.ESC+"[1;3A"||(h.key=d.C0.ESC+"[1;5A")):h.key=c?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(n.metaKey)break;t?(h.key=d.C0.ESC+"[1;"+(t+1)+"B",u||h.key!==d.C0.ESC+"[1;3B"||(h.key=d.C0.ESC+"[1;5B")):h.key=c?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(h.key=d.C0.ESC+"[2~");break;case 46:h.key=t?d.C0.ESC+"[3;"+(t+1)+"~":d.C0.ESC+"[3~";break;case 36:h.key=t?d.C0.ESC+"[1;"+(t+1)+"H":c?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:h.key=t?d.C0.ESC+"[1;"+(t+1)+"F":c?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:n.shiftKey?h.type=2:n.ctrlKey?h.key=d.C0.ESC+"[5;"+(t+1)+"~":h.key=d.C0.ESC+"[5~";break;case 34:n.shiftKey?h.type=3:n.ctrlKey?h.key=d.C0.ESC+"[6;"+(t+1)+"~":h.key=d.C0.ESC+"[6~";break;case 112:h.key=t?d.C0.ESC+"[1;"+(t+1)+"P":d.C0.ESC+"OP";break;case 113:h.key=t?d.C0.ESC+"[1;"+(t+1)+"Q":d.C0.ESC+"OQ";break;case 114:h.key=t?d.C0.ESC+"[1;"+(t+1)+"R":d.C0.ESC+"OR";break;case 115:h.key=t?d.C0.ESC+"[1;"+(t+1)+"S":d.C0.ESC+"OS";break;case 116:h.key=t?d.C0.ESC+"[15;"+(t+1)+"~":d.C0.ESC+"[15~";break;case 117:h.key=t?d.C0.ESC+"[17;"+(t+1)+"~":d.C0.ESC+"[17~";break;case 118:h.key=t?d.C0.ESC+"[18;"+(t+1)+"~":d.C0.ESC+"[18~";break;case 119:h.key=t?d.C0.ESC+"[19;"+(t+1)+"~":d.C0.ESC+"[19~";break;case 120:h.key=t?d.C0.ESC+"[20;"+(t+1)+"~":d.C0.ESC+"[20~";break;case 121:h.key=t?d.C0.ESC+"[21;"+(t+1)+"~":d.C0.ESC+"[21~";break;case 122:h.key=t?d.C0.ESC+"[23;"+(t+1)+"~":d.C0.ESC+"[23~";break;case 123:h.key=t?d.C0.ESC+"[24;"+(t+1)+"~":d.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(u&&!v||!n.altKey||n.metaKey)!u||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?h.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(h.key=d.C0.US),n.key==="@"&&(h.key=d.C0.NUL)):n.keyCode===65&&(h.type=1);else{const r=_[n.keyCode],e=r?.[n.shiftKey?1:0];if(e)h.key=d.C0.ESC+e;else if(n.keyCode>=65&&n.keyCode<=90){const i=n.ctrlKey?n.keyCode-64:n.keyCode+32;let a=String.fromCharCode(i);n.shiftKey&&(a=a.toUpperCase()),h.key=d.C0.ESC+a}else if(n.keyCode===32)h.key=d.C0.ESC+(n.ctrlKey?d.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let i=n.code.slice(3,4);n.shiftKey||(i=i.toLowerCase()),h.key=d.C0.ESC+i,h.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?h.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?h.key=d.C0.NUL:n.keyCode>=51&&n.keyCode<=55?h.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?h.key=d.C0.DEL:n.keyCode===219?h.key=d.C0.ESC:n.keyCode===220?h.key=d.C0.FS:n.keyCode===221&&(h.key=d.C0.GS)}return h}},482:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,d=0,_=o.length){let n="";for(let c=d;c<_;++c){let u=o[c];u>65535?(u-=65536,n+=String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):n+=String.fromCharCode(u)}return n},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,d){const _=o.length;if(!_)return 0;let n=0,c=0;if(this._interim){const u=o.charCodeAt(c++);56320<=u&&u<=57343?d[n++]=1024*(this._interim-55296)+u-56320+65536:(d[n++]=this._interim,d[n++]=u),this._interim=0}for(let u=c;u<_;++u){const v=o.charCodeAt(u);if(55296<=v&&v<=56319){if(++u>=_)return this._interim=v,n;const h=o.charCodeAt(u);56320<=h&&h<=57343?d[n++]=1024*(v-55296)+h-56320+65536:(d[n++]=v,d[n++]=h)}else v!==65279&&(d[n++]=v)}return n}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,d){const _=o.length;if(!_)return 0;let n,c,u,v,h=0,t=0,r=0;if(this.interim[0]){let a=!1,f=this.interim[0];f&=(224&f)==192?31:(240&f)==224?15:7;let p,g=0;for(;(p=63&this.interim[++g])&&g<4;)f<<=6,f|=p;const l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=l-g;for(;r<m;){if(r>=_)return 0;if(p=o[r++],(192&p)!=128){r--,a=!0;break}this.interim[g++]=p,f<<=6,f|=63&p}a||(l===2?f<128?r--:d[h++]=f:l===3?f<2048||f>=55296&&f<=57343||f===65279||(d[h++]=f):f<65536||f>1114111||(d[h++]=f)),this.interim.fill(0)}const e=_-4;let i=r;for(;i<_;){for(;!(!(i<e)||128&(n=o[i])||128&(c=o[i+1])||128&(u=o[i+2])||128&(v=o[i+3]));)d[h++]=n,d[h++]=c,d[h++]=u,d[h++]=v,i+=4;if(n=o[i++],n<128)d[h++]=n;else if((224&n)==192){if(i>=_)return this.interim[0]=n,h;if(c=o[i++],(192&c)!=128){i--;continue}if(t=(31&n)<<6|63&c,t<128){i--;continue}d[h++]=t}else if((240&n)==224){if(i>=_)return this.interim[0]=n,h;if(c=o[i++],(192&c)!=128){i--;continue}if(i>=_)return this.interim[0]=n,this.interim[1]=c,h;if(u=o[i++],(192&u)!=128){i--;continue}if(t=(15&n)<<12|(63&c)<<6|63&u,t<2048||t>=55296&&t<=57343||t===65279)continue;d[h++]=t}else if((248&n)==240){if(i>=_)return this.interim[0]=n,h;if(c=o[i++],(192&c)!=128){i--;continue}if(i>=_)return this.interim[0]=n,this.interim[1]=c,h;if(u=o[i++],(192&u)!=128){i--;continue}if(i>=_)return this.interim[0]=n,this.interim[1]=c,this.interim[2]=u,h;if(v=o[i++],(192&v)!=128){i--;continue}if(t=(7&n)<<18|(63&c)<<12|(63&u)<<6|63&v,t<65536||t>1114111)continue;d[h++]=t}}return h}}},225:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const d=o(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let c;s.UnicodeV6=class{constructor(){if(this.version="6",!c){c=new Uint8Array(65536),c.fill(1),c[0]=0,c.fill(0,1,32),c.fill(0,127,160),c.fill(2,4352,4448),c[9001]=2,c[9002]=2,c.fill(2,11904,42192),c[12351]=1,c.fill(2,44032,55204),c.fill(2,63744,64256),c.fill(2,65040,65050),c.fill(2,65072,65136),c.fill(2,65280,65377),c.fill(2,65504,65511);for(let u=0;u<_.length;++u)c.fill(0,_[u][0],_[u][1]+1)}}wcwidth(u){return u<32?0:u<127?1:u<65536?c[u]:function(v,h){let t,r=0,e=h.length-1;if(v<h[0][0]||v>h[e][1])return!1;for(;e>=r;)if(t=r+e>>1,v>h[t][1])r=t+1;else{if(!(v<h[t][0]))return!0;e=t-1}return!1}(u,n)?0:u>=131072&&u<=196605||u>=196608&&u<=262141?2:1}charProperties(u,v){let h=this.wcwidth(u),t=h===0&&v!==0;if(t){const r=d.UnicodeService.extractWidth(v);r===0?t=!1:r>h&&(h=r)}return d.UnicodeService.createPropertyValue(0,h,t)}}},5981:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const d=o(8460),_=o(844);class n extends _.Disposable{constructor(u){super(),this._action=u,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(u,v){if(v!==void 0&&this._syncCalls>v)return void(this._syncCalls=0);if(this._pendingData+=u.length,this._writeBuffer.push(u),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let h;for(this._isSyncWriting=!0;h=this._writeBuffer.shift();){this._action(h);const t=this._callbacks.shift();t&&t()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(u,v){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=u.length,this._writeBuffer.push(u),this._callbacks.push(v),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=u.length,this._writeBuffer.push(u),this._callbacks.push(v)}_innerWrite(u=0,v=!0){const h=u||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const t=this._writeBuffer[this._bufferOffset],r=this._action(t,v);if(r){const i=a=>Date.now()-h>=12?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(h,a);return void r.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(i)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=t.length,Date.now()-h>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=n},5941:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function _(n,c){const u=n.toString(16),v=u.length<2?"0"+u:u;switch(c){case 4:return u[0];case 8:return v;case 12:return(v+v).slice(0,3);default:return v+v}}s.parseColor=function(n){if(!n)return;let c=n.toLowerCase();if(c.indexOf("rgb:")===0){c=c.slice(4);const u=o.exec(c);if(u){const v=u[1]?15:u[4]?255:u[7]?4095:65535;return[Math.round(parseInt(u[1]||u[4]||u[7]||u[10],16)/v*255),Math.round(parseInt(u[2]||u[5]||u[8]||u[11],16)/v*255),Math.round(parseInt(u[3]||u[6]||u[9]||u[12],16)/v*255)]}}else if(c.indexOf("#")===0&&(c=c.slice(1),d.exec(c)&&[3,6,9,12].includes(c.length))){const u=c.length/3,v=[0,0,0];for(let h=0;h<3;++h){const t=parseInt(c.slice(u*h,u*h+u),16);v[h]=u===1?t<<4:u===2?t:u===3?t>>4:t>>8}return v}},s.toRgbString=function(n,c=16){const[u,v,h]=n;return`rgb:${_(u,c)}/${_(v,c)}/${_(h,c)}`}},5770:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const d=o(482),_=o(8742),n=o(5770),c=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=c,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}registerHandler(v,h){this._handlers[v]===void 0&&(this._handlers[v]=[]);const t=this._handlers[v];return t.push(h),{dispose:()=>{const r=t.indexOf(h);r!==-1&&t.splice(r,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}reset(){if(this._active.length)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].unhook(!1);this._stack.paused=!1,this._active=c,this._ident=0}hook(v,h){if(this.reset(),this._ident=v,this._active=this._handlers[v]||c,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(h);else this._handlerFb(this._ident,"HOOK",h)}put(v,h,t){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(v,h,t);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(v,h,t))}unhook(v,h=!0){if(this._active.length){let t=!1,r=this._active.length-1,e=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,t=h,e=this._stack.fallThrough,this._stack.paused=!1),!e&&t===!1){for(;r>=0&&(t=this._active[r].unhook(v),t!==!0);r--)if(t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,t;r--}for(;r>=0;r--)if(t=this._active[r].unhook(!1),t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,t}else this._handlerFb(this._ident,"UNHOOK",v);this._active=c,this._ident=0}};const u=new _.Params;u.addParam(0),s.DcsHandler=class{constructor(v){this._handler=v,this._data="",this._params=u,this._hitLimit=!1}hook(v){this._params=v.length>1||v.params[0]?v.clone():u,this._data="",this._hitLimit=!1}put(v,h,t){this._hitLimit||(this._data+=(0,d.utf32ToString)(v,h,t),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(v){let h=!1;if(this._hitLimit)h=!1;else if(v&&(h=this._handler(this._data,this._params),h instanceof Promise))return h.then(t=>(this._params=u,this._data="",this._hitLimit=!1,t));return this._params=u,this._data="",this._hitLimit=!1,h}}},2015:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const d=o(844),_=o(8742),n=o(6242),c=o(6351);class u{constructor(r){this.table=new Uint8Array(r)}setDefault(r,e){this.table.fill(r<<4|e)}add(r,e,i,a){this.table[e<<8|r]=i<<4|a}addMany(r,e,i,a){for(let f=0;f<r.length;f++)this.table[e<<8|r[f]]=i<<4|a}}s.TransitionTable=u;const v=160;s.VT500_TRANSITION_TABLE=function(){const t=new u(4095),r=Array.apply(null,Array(256)).map((g,l)=>l),e=(g,l)=>r.slice(g,l),i=e(32,127),a=e(0,24);a.push(25),a.push.apply(a,e(28,32));const f=e(0,14);let p;for(p in t.setDefault(1,0),t.addMany(i,0,2,0),f)t.addMany([24,26,153,154],p,3,0),t.addMany(e(128,144),p,3,0),t.addMany(e(144,152),p,3,0),t.add(156,p,0,0),t.add(27,p,11,1),t.add(157,p,4,8),t.addMany([152,158,159],p,0,7),t.add(155,p,11,3),t.add(144,p,11,9);return t.addMany(a,0,3,0),t.addMany(a,1,3,1),t.add(127,1,0,1),t.addMany(a,8,0,8),t.addMany(a,3,3,3),t.add(127,3,0,3),t.addMany(a,4,3,4),t.add(127,4,0,4),t.addMany(a,6,3,6),t.addMany(a,5,3,5),t.add(127,5,0,5),t.addMany(a,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(i,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(i,7,0,7),t.addMany(a,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(a,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(a,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(a,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(a,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(a,13,13,13),t.addMany(i,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(v,0,2,0),t.add(v,8,5,8),t.add(v,6,0,6),t.add(v,11,0,11),t.add(v,13,13,13),t}();class h extends d.Disposable{constructor(r=s.VT500_TRANSITION_TABLE){super(),this._transitions=r,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,i,a)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,i)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new c.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(r,e=[64,126]){let i=0;if(r.prefix){if(r.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=r.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(r.intermediates){if(r.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let f=0;f<r.intermediates.length;++f){const p=r.intermediates.charCodeAt(f);if(32>p||p>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=p}}if(r.final.length!==1)throw new Error("final must be a single byte");const a=r.final.charCodeAt(0);if(e[0]>a||a>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return i<<=8,i|=a,i}identToString(r){const e=[];for(;r;)e.push(String.fromCharCode(255&r)),r>>=8;return e.reverse().join("")}setPrintHandler(r){this._printHandler=r}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(r,e){const i=this._identifier(r,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);const a=this._escHandlers[i];return a.push(e),{dispose:()=>{const f=a.indexOf(e);f!==-1&&a.splice(f,1)}}}clearEscHandler(r){this._escHandlers[this._identifier(r,[48,126])]&&delete this._escHandlers[this._identifier(r,[48,126])]}setEscHandlerFallback(r){this._escHandlerFb=r}setExecuteHandler(r,e){this._executeHandlers[r.charCodeAt(0)]=e}clearExecuteHandler(r){this._executeHandlers[r.charCodeAt(0)]&&delete this._executeHandlers[r.charCodeAt(0)]}setExecuteHandlerFallback(r){this._executeHandlerFb=r}registerCsiHandler(r,e){const i=this._identifier(r);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);const a=this._csiHandlers[i];return a.push(e),{dispose:()=>{const f=a.indexOf(e);f!==-1&&a.splice(f,1)}}}clearCsiHandler(r){this._csiHandlers[this._identifier(r)]&&delete this._csiHandlers[this._identifier(r)]}setCsiHandlerFallback(r){this._csiHandlerFb=r}registerDcsHandler(r,e){return this._dcsParser.registerHandler(this._identifier(r),e)}clearDcsHandler(r){this._dcsParser.clearHandler(this._identifier(r))}setDcsHandlerFallback(r){this._dcsParser.setHandlerFallback(r)}registerOscHandler(r,e){return this._oscParser.registerHandler(r,e)}clearOscHandler(r){this._oscParser.clearHandler(r)}setOscHandlerFallback(r){this._oscParser.setHandlerFallback(r)}setErrorHandler(r){this._errorHandler=r}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(r,e,i,a,f){this._parseStack.state=r,this._parseStack.handlers=e,this._parseStack.handlerPos=i,this._parseStack.transition=a,this._parseStack.chunkPos=f}parse(r,e,i){let a,f=0,p=0,g=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,g=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const l=this._parseStack.handlers;let m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&m>-1){for(;m>=0&&(a=l[m](this._params),a!==!0);m--)if(a instanceof Promise)return this._parseStack.handlerPos=m,a}this._parseStack.handlers=[];break;case 4:if(i===!1&&m>-1){for(;m>=0&&(a=l[m](),a!==!0);m--)if(a instanceof Promise)return this._parseStack.handlerPos=m,a}this._parseStack.handlers=[];break;case 6:if(f=r[this._parseStack.chunkPos],a=this._dcsParser.unhook(f!==24&&f!==26,i),a)return a;f===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(f=r[this._parseStack.chunkPos],a=this._oscParser.end(f!==24&&f!==26,i),a)return a;f===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,g=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let l=g;l<e;++l){switch(f=r[l],p=this._transitions.table[this.currentState<<8|(f<160?f:v)],p>>4){case 2:for(let b=l+1;;++b){if(b>=e||(f=r[b])<32||f>126&&f<v){this._printHandler(r,l,b),l=b-1;break}if(++b>=e||(f=r[b])<32||f>126&&f<v){this._printHandler(r,l,b),l=b-1;break}if(++b>=e||(f=r[b])<32||f>126&&f<v){this._printHandler(r,l,b),l=b-1;break}if(++b>=e||(f=r[b])<32||f>126&&f<v){this._printHandler(r,l,b),l=b-1;break}}break;case 3:this._executeHandlers[f]?this._executeHandlers[f]():this._executeHandlerFb(f),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:f,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const m=this._csiHandlers[this._collect<<8|f];let E=m?m.length-1:-1;for(;E>=0&&(a=m[E](this._params),a!==!0);E--)if(a instanceof Promise)return this._preserveStack(3,m,E,p,l),a;E<0&&this._csiHandlerFb(this._collect<<8|f,this._params),this.precedingJoinState=0;break;case 8:do switch(f){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(f-48)}while(++l<e&&(f=r[l])>47&&f<60);l--;break;case 9:this._collect<<=8,this._collect|=f;break;case 10:const x=this._escHandlers[this._collect<<8|f];let L=x?x.length-1:-1;for(;L>=0&&(a=x[L](),a!==!0);L--)if(a instanceof Promise)return this._preserveStack(4,x,L,p,l),a;L<0&&this._escHandlerFb(this._collect<<8|f),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|f,this._params);break;case 13:for(let b=l+1;;++b)if(b>=e||(f=r[b])===24||f===26||f===27||f>127&&f<v){this._dcsParser.put(r,l,b),l=b-1;break}break;case 14:if(a=this._dcsParser.unhook(f!==24&&f!==26),a)return this._preserveStack(6,[],0,p,l),a;f===27&&(p|=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 b=l+1;;b++)if(b>=e||(f=r[b])<32||f>127&&f<v){this._oscParser.put(r,l,b),l=b-1;break}break;case 6:if(a=this._oscParser.end(f!==24&&f!==26),a)return this._preserveStack(5,[],0,p,l),a;f===27&&(p|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&p}}}s.EscapeSequenceParser=h},6242:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const d=o(5770),_=o(482),n=[];s.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(c,u){this._handlers[c]===void 0&&(this._handlers[c]=[]);const v=this._handlers[c];return v.push(u),{dispose:()=>{const h=v.indexOf(u);h!==-1&&v.splice(h,1)}}}clearHandler(c){this._handlers[c]&&delete this._handlers[c]}setHandlerFallback(c){this._handlerFb=c}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let c=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;c>=0;--c)this._active[c].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].start();else this._handlerFb(this._id,"START")}_put(c,u,v){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(c,u,v);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(c,u,v))}start(){this.reset(),this._state=1}put(c,u,v){if(this._state!==3){if(this._state===1)for(;u<v;){const h=c[u++];if(h===59){this._state=2,this._start();break}if(h<48||57<h)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+h-48}this._state===2&&v-u>0&&this._put(c,u,v)}}end(c,u=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let v=!1,h=this._active.length-1,t=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,v=u,t=this._stack.fallThrough,this._stack.paused=!1),!t&&v===!1){for(;h>=0&&(v=this._active[h].end(c),v!==!0);h--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,v;h--}for(;h>=0;h--)if(v=this._active[h].end(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,v}else this._handlerFb(this._id,"END",c);this._active=n,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(c){this._handler=c,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(c,u,v){this._hitLimit||(this._data+=(0,_.utf32ToString)(c,u,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(c){let u=!1;if(this._hitLimit)u=!1;else if(c&&(u=this._handler(this._data),u instanceof Promise))return u.then(v=>(this._data="",this._hitLimit=!1,v));return this._data="",this._hitLimit=!1,u}}},8742:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const o=2147483647;class d{static fromArray(n){const c=new d;if(!n.length)return c;for(let u=Array.isArray(n[0])?1:0;u<n.length;++u){const v=n[u];if(Array.isArray(v))for(let h=0;h<v.length;++h)c.addSubParam(v[h]);else c.addParam(v)}return c}constructor(n=32,c=32){if(this.maxLength=n,this.maxSubParamsLength=c,c>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(c),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new d(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let c=0;c<this.length;++c){n.push(this.params[c]);const u=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-u>0&&n.push(Array.prototype.slice.call(this._subParams,u,v))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>o?o:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>o?o:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const c=this._subParamsIdx[n]>>8,u=255&this._subParamsIdx[n];return u-c>0?this._subParams.subarray(c,u):null}getSubParamsAll(){const n={};for(let c=0;c<this.length;++c){const u=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-u>0&&(n[c]=this._subParams.slice(u,v))}return n}addDigit(n){let c;if(this._rejectDigits||!(c=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const u=this._digitIsSub?this._subParams:this.params,v=u[c-1];u[c-1]=~v?Math.min(10*v+n,o):n}}s.Params=d},5741:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,d){const _={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(_),d.dispose=()=>this._wrappedAddonDispose(_),d.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let d=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===o){d=_;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(d,1)}}},8771:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const d=o(3785),_=o(511);s.BufferApiView=class{constructor(n,c){this._buffer=n,this.type=c}init(n){return this._buffer=n,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(n){const c=this._buffer.lines.get(n);if(c)return new d.BufferLineApiView(c)}getNullCell(){return new _.CellData}}},3785:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const d=o(511);s.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,n){if(!(_<0||_>=this._line.length))return n?(this._line.loadCell(_,n),n):this._line.loadCell(_,new d.CellData)}translateToString(_,n,c){return this._line.translateToString(_,n,c)}}},8285:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const d=o(8771),_=o(8460),n=o(844);class c extends n.Disposable{constructor(v){super(),this._core=v,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=c},7975:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,d){return this._core.registerCsiHandler(o,_=>d(_.toArray()))}addCsiHandler(o,d){return this.registerCsiHandler(o,d)}registerDcsHandler(o,d){return this._core.registerDcsHandler(o,(_,n)=>d(_,n.toArray()))}addDcsHandler(o,d){return this.registerDcsHandler(o,d)}registerEscHandler(o,d){return this._core.registerEscHandler(o,d)}addEscHandler(o,d){return this.registerEscHandler(o,d)}registerOscHandler(o,d){return this._core.registerOscHandler(o,d)}addOscHandler(o,d){return this.registerOscHandler(o,d)}}},7090:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(R,s,o){var d=this&&this.__decorate||function(t,r,e,i){var a,f=arguments.length,p=f<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,r,e,i);else for(var g=t.length-1;g>=0;g--)(a=t[g])&&(p=(f<3?a(p):f>3?a(r,e,p):a(r,e))||p);return f>3&&p&&Object.defineProperty(r,e,p),p},_=this&&this.__param||function(t,r){return function(e,i){r(e,i,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const n=o(8460),c=o(844),u=o(5295),v=o(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let h=s.BufferService=class extends c.Disposable{get buffer(){return this.buffers.active}constructor(t){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new u.BufferSet(t,this))}resize(t,r){this.cols=t,this.rows=r,this.buffers.resize(t,r),this._onResize.fire({cols:t,rows:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,r=!1){const e=this.buffer;let i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===t.fg&&i.getBg(0)===t.bg||(i=e.getBlankLine(t,r),this._cachedBlankLine=i),i.isWrapped=r;const a=e.ybase+e.scrollTop,f=e.ybase+e.scrollBottom;if(e.scrollTop===0){const p=e.lines.isFull;f===e.lines.length-1?p?e.lines.recycle().copyFrom(i):e.lines.push(i.clone()):e.lines.splice(f+1,0,i.clone()),p?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const p=f-a+1;e.lines.shiftElements(a+1,p-1,-1),e.lines.set(f,i.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(t,r,e){const i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);const a=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),a!==i.ydisp&&(r||this._onScroll.fire(i.ydisp))}};s.BufferService=h=d([_(0,v.IOptionsService)],h)},7994:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,d){this._charsets[o]=d,this.glevel===o&&(this.charset=d)}}},1753:function(R,s,o){var d=this&&this.__decorate||function(i,a,f,p){var g,l=arguments.length,m=l<3?a:p===null?p=Object.getOwnPropertyDescriptor(a,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,a,f,p);else for(var E=i.length-1;E>=0;E--)(g=i[E])&&(m=(l<3?g(m):l>3?g(a,f,m):g(a,f))||m);return l>3&&m&&Object.defineProperty(a,f,m),m},_=this&&this.__param||function(i,a){return function(f,p){a(f,p,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const n=o(2585),c=o(8460),u=o(844),v={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:i=>i.button!==4&&i.action===1&&(i.ctrl=!1,i.alt=!1,i.shift=!1,!0)},VT200:{events:19,restrict:i=>i.action!==32},DRAG:{events:23,restrict:i=>i.action!==32||i.button!==3},ANY:{events:31,restrict:i=>!0}};function h(i,a){let f=(i.ctrl?16:0)|(i.shift?4:0)|(i.alt?8:0);return i.button===4?(f|=64,f|=i.action):(f|=3&i.button,4&i.button&&(f|=64),8&i.button&&(f|=128),i.action===32?f|=32:i.action!==0||a||(f|=3)),f}const t=String.fromCharCode,r={DEFAULT:i=>{const a=[h(i,!1)+32,i.col+32,i.row+32];return a[0]>255||a[1]>255||a[2]>255?"":`\x1B[M${t(a[0])}${t(a[1])}${t(a[2])}`},SGR:i=>{const a=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${h(i,!0)};${i.col};${i.row}${a}`},SGR_PIXELS:i=>{const a=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${h(i,!0)};${i.x};${i.y}${a}`}};let e=s.CoreMouseService=class extends u.Disposable{constructor(i,a){super(),this._bufferService=i,this._coreService=a,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new c.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const f of Object.keys(v))this.addProtocol(f,v[f]);for(const f of Object.keys(r))this.addEncoding(f,r[f]);this.reset()}addProtocol(i,a){this._protocols[i]=a}addEncoding(i,a){this._encodings[i]=a}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(i){if(!this._protocols[i])throw new Error(`unknown protocol "${i}"`);this._activeProtocol=i,this._onProtocolChange.fire(this._protocols[i].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(i){if(!this._encodings[i])throw new Error(`unknown encoding "${i}"`);this._activeEncoding=i}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(i){if(i.col<0||i.col>=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows||i.button===4&&i.action===32||i.button===3&&i.action!==32||i.button!==4&&(i.action===2||i.action===3)||(i.col++,i.row++,i.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,i,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(i))return!1;const a=this._encodings[this._activeEncoding](i);return a&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(a):this._coreService.triggerDataEvent(a,!0)),this._lastEvent=i,!0}explainEvents(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}}_equalEvents(i,a,f){if(f){if(i.x!==a.x||i.y!==a.y)return!1}else if(i.col!==a.col||i.row!==a.row)return!1;return i.button===a.button&&i.action===a.action&&i.ctrl===a.ctrl&&i.alt===a.alt&&i.shift===a.shift}};s.CoreMouseService=e=d([_(0,n.IBufferService),_(1,n.ICoreService)],e)},6975:function(R,s,o){var d=this&&this.__decorate||function(e,i,a,f){var p,g=arguments.length,l=g<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,i,a,f);else for(var m=e.length-1;m>=0;m--)(p=e[m])&&(l=(g<3?p(l):g>3?p(i,a,l):p(i,a))||l);return g>3&&l&&Object.defineProperty(i,a,l),l},_=this&&this.__param||function(e,i){return function(a,f){i(a,f,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const n=o(1439),c=o(8460),u=o(844),v=o(2585),h=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let r=s.CoreService=class extends u.Disposable{constructor(e,i,a){super(),this._bufferService=e,this._logService=i,this._optionsService=a,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new c.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new c.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(t)}reset(){this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(t)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;const a=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&a.ybase!==a.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(f=>f.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};s.CoreService=r=d([_(0,v.IBufferService),_(1,v.ILogService),_(2,v.IOptionsService)],r)},9074:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const d=o(8055),_=o(8460),n=o(844),c=o(6106);let u=0,v=0;class h extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new c.SortedList(e=>e?.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)(()=>this.reset()))}registerDecoration(e){if(e.marker.isDisposed)return;const i=new t(e);if(i){const a=i.marker.onDispose(()=>i.dispose());i.onDispose(()=>{i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),a.dispose())}),this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,a){let f=0,p=0;for(const g of this._decorations.getKeyIterator(i))f=g.options.x??0,p=f+(g.options.width??1),e>=f&&e<p&&(!a||(g.options.layer??"bottom")===a)&&(yield g)}forEachDecorationAtCell(e,i,a,f){this._decorations.forEachByKey(i,p=>{u=p.options.x??0,v=u+(p.options.width??1),e>=u&&e<v&&(!a||(p.options.layer??"bottom")===a)&&f(p)})}}s.DecorationService=h;class t extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const d=o(2585),_=o(8343);class n{constructor(...u){this._entries=new Map;for(const[v,h]of u)this.set(v,h)}set(u,v){const h=this._entries.get(u);return this._entries.set(u,v),h}forEach(u){for(const[v,h]of this._entries.entries())u(v,h)}has(u){return this._entries.has(u)}get(u){return this._entries.get(u)}}s.ServiceCollection=n,s.InstantiationService=class{constructor(){this._services=new n,this._services.set(d.IInstantiationService,this)}setService(c,u){this._services.set(c,u)}getService(c){return this._services.get(c)}createInstance(c,...u){const v=(0,_.getServiceDependencies)(c).sort((r,e)=>r.index-e.index),h=[];for(const r of v){const e=this._services.get(r.id);if(!e)throw new Error(`[createInstance] ${c.name} depends on UNKNOWN service ${r.id}.`);h.push(e)}const t=v.length>0?v[0].index:u.length;if(u.length!==t)throw new Error(`[createInstance] First service dependency of ${c.name} at position ${t+1} conflicts with ${u.length} static arguments`);return new c(...u,...h)}}},7866:function(R,s,o){var d=this&&this.__decorate||function(t,r,e,i){var a,f=arguments.length,p=f<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,r,e,i);else for(var g=t.length-1;g>=0;g--)(a=t[g])&&(p=(f<3?a(p):f>3?a(r,e,p):a(r,e))||p);return f>3&&p&&Object.defineProperty(r,e,p),p},_=this&&this.__param||function(t,r){return function(e,i){r(e,i,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const n=o(844),c=o(2585),u={trace:c.LogLevelEnum.TRACE,debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF};let v,h=s.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),v=this}_updateLogLevel(){this._logLevel=u[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let r=0;r<t.length;r++)typeof t[r]=="function"&&(t[r]=t[r]())}_log(t,r,e){this._evalLazyOptionalParams(e),t.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+r,...e)}trace(t,...r){this._logLevel<=c.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,r)}debug(t,...r){this._logLevel<=c.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,r)}info(t,...r){this._logLevel<=c.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,r)}warn(t,...r){this._logLevel<=c.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,r)}error(t,...r){this._logLevel<=c.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,r)}};s.LogService=h=d([_(0,c.IOptionsService)],h),s.setTraceLogger=function(t){v=t},s.traceCall=function(t,r,e){if(typeof e.value!="function")throw new Error("not supported");const i=e.value;e.value=function(...a){if(v.logLevel!==c.LogLevelEnum.TRACE)return i.apply(this,a);v.trace(`GlyphRenderer#${i.name}(${a.map(p=>JSON.stringify(p)).join(", ")})`);const f=i.apply(this,a);return v.trace(`GlyphRenderer#${i.name} return`,f),f}}},7302:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const d=o(8460),_=o(844),n=o(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const c=["normal","bold","100","200","300","400","500","600","700","800","900"];class u extends _.Disposable{constructor(h){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const t={...s.DEFAULT_OPTIONS};for(const r in h)if(r in t)try{const e=h[r];t[r]=this._sanitizeAndValidateOption(r,e)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(h,t){return this.onOptionChange(r=>{r===h&&t(this.rawOptions[h])})}onMultipleOptionChange(h,t){return this.onOptionChange(r=>{h.indexOf(r)!==-1&&t()})}_setupOptions(){const h=r=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,e)=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);e=this._sanitizeAndValidateOption(r,e),this.rawOptions[r]!==e&&(this.rawOptions[r]=e,this._onOptionChange.fire(r))};for(const r in this.rawOptions){const e={get:h.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,e)}}_sanitizeAndValidateOption(h,t){switch(h){case"cursorStyle":if(t||(t=s.DEFAULT_OPTIONS[h]),!function(r){return r==="block"||r==="underline"||r==="bar"}(t))throw new Error(`"${t}" is not a valid value for ${h}`);break;case"wordSeparator":t||(t=s.DEFAULT_OPTIONS[h]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=c.includes(t)?t:s.DEFAULT_OPTIONS[h];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${h} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(`${h} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${h} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${h} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{}}return t}}s.OptionsService=u},2660:function(R,s,o){var d=this&&this.__decorate||function(u,v,h,t){var r,e=arguments.length,i=e<3?v:t===null?t=Object.getOwnPropertyDescriptor(v,h):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(u,v,h,t);else for(var a=u.length-1;a>=0;a--)(r=u[a])&&(i=(e<3?r(i):e>3?r(v,h,i):r(v,h))||i);return e>3&&i&&Object.defineProperty(v,h,i),i},_=this&&this.__param||function(u,v){return function(h,t){v(h,t,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const n=o(2585);let c=s.OscLinkService=class{constructor(u){this._bufferService=u,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(u){const v=this._bufferService.buffer;if(u.id===void 0){const a=v.addMarker(v.ybase+v.y),f={data:u,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(f,a)),this._dataByLinkId.set(f.id,f),f.id}const h=u,t=this._getEntryIdKey(h),r=this._entriesWithId.get(t);if(r)return this.addLineToLink(r.id,v.ybase+v.y),r.id;const e=v.addMarker(v.ybase+v.y),i={id:this._nextId++,key:this._getEntryIdKey(h),data:h,lines:[e]};return e.onDispose(()=>this._removeMarkerFromLink(i,e)),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(u,v){const h=this._dataByLinkId.get(u);if(h&&h.lines.every(t=>t.line!==v)){const t=this._bufferService.buffer.addMarker(v);h.lines.push(t),t.onDispose(()=>this._removeMarkerFromLink(h,t))}}getLinkData(u){return this._dataByLinkId.get(u)?.data}_getEntryIdKey(u){return`${u.id};;${u.uri}`}_removeMarkerFromLink(u,v){const h=u.lines.indexOf(v);h!==-1&&(u.lines.splice(h,1),u.lines.length===0&&(u.data.id!==void 0&&this._entriesWithId.delete(u.key),this._dataByLinkId.delete(u.id)))}};s.OscLinkService=c=d([_(0,n.IBufferService)],c)},8343:(R,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(_){return _[d]||[]},s.createDecorator=function(_){if(s.serviceRegistry.has(_))return s.serviceRegistry.get(_);const n=function(c,u,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,t,r){t[o]===t?t[d].push({id:h,index:r}):(t[d]=[{id:h,index:r}],t[o]=t)})(n,c,v)};return n.toString=()=>_,s.serviceRegistry.set(_,n),n}},2585:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=o(8343);var _;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(_||(s.LogLevelEnum=_={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(R,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const d=o(8460),_=o(225);class n{static extractShouldJoin(u){return(1&u)!=0}static extractWidth(u){return u>>1&3}static extractCharKind(u){return u>>3}static createPropertyValue(u,v,h=!1){return(16777215&u)<<3|(3&v)<<1|(h?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const u=new _.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let v=0,h=0;const t=u.length;for(let r=0;r<t;++r){let e=u.charCodeAt(r);if(55296<=e&&e<=56319){if(++r>=t)return v+this.wcwidth(e);const f=u.charCodeAt(r);56320<=f&&f<=57343?e=1024*(e-55296)+f-56320+65536:v+=this.wcwidth(f)}const i=this.charProperties(e,h);let a=n.extractWidth(i);n.extractShouldJoin(i)&&(a-=n.extractWidth(h)),v+=a,h=i}return v}charProperties(u,v){return this._activeProvider.charProperties(u,v)}}s.UnicodeService=n}},K={};function N(R){var s=K[R];if(s!==void 0)return s.exports;var o=K[R]={exports:{}};return j[R].call(o.exports,o,o.exports,N),o.exports}var J={};return(()=>{var R=J;Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;const s=N(9042),o=N(3236),d=N(844),_=N(5741),n=N(8285),c=N(7975),u=N(7090),v=["cols","rows"];class h extends d.Disposable{constructor(r){super(),this._core=this.register(new o.Terminal(r)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const e=a=>this._core.options[a],i=(a,f)=>{this._checkReadonlyOptions(a),this._core.options[a]=f};for(const a in this._core.options){const f={get:e.bind(this,a),set:i.bind(this,a)};Object.defineProperty(this._publicOptions,a,f)}}_checkReadonlyOptions(r){if(v.includes(r))throw new Error(`Option "${r}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new c.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new u.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const r=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:r.applicationCursorKeys,applicationKeypadMode:r.applicationKeypad,bracketedPasteMode:r.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:r.origin,reverseWraparoundMode:r.reverseWraparound,sendFocusMode:r.sendFocus,wraparoundMode:r.wraparound}}get options(){return this._publicOptions}set options(r){for(const e in r)this._publicOptions[e]=r[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(r,e=!0){this._core.input(r,e)}resize(r,e){this._verifyIntegers(r,e),this._core.resize(r,e)}open(r){this._core.open(r)}attachCustomKeyEventHandler(r){this._core.attachCustomKeyEventHandler(r)}attachCustomWheelEventHandler(r){this._core.attachCustomWheelEventHandler(r)}registerLinkProvider(r){return this._core.registerLinkProvider(r)}registerCharacterJoiner(r){return this._checkProposedApi(),this._core.registerCharacterJoiner(r)}deregisterCharacterJoiner(r){this._checkProposedApi(),this._core.deregisterCharacterJoiner(r)}registerMarker(r=0){return this._verifyIntegers(r),this._core.registerMarker(r)}registerDecoration(r){return this._checkProposedApi(),this._verifyPositiveIntegers(r.x??0,r.width??0,r.height??0),this._core.registerDecoration(r)}hasSelection(){return this._core.hasSelection()}select(r,e,i){this._verifyIntegers(r,e,i),this._core.select(r,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(r,e){this._verifyIntegers(r,e),this._core.selectLines(r,e)}dispose(){super.dispose()}scrollLines(r){this._verifyIntegers(r),this._core.scrollLines(r)}scrollPages(r){this._verifyIntegers(r),this._core.scrollPages(r)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(r){this._verifyIntegers(r),this._core.scrollToLine(r)}clear(){this._core.clear()}write(r,e){this._core.write(r,e)}writeln(r,e){this._core.write(r),this._core.write(`\r
|
|
9
|
+
`,e)}paste(r){this._core.paste(r)}refresh(r,e){this._verifyIntegers(r,e),this._core.refresh(r,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(r){this._addonManager.loadAddon(this,r)}static get strings(){return s}_verifyIntegers(...r){for(const e of r)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...r){for(const e of r)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}R.Terminal=h})(),J})())}(ye)),ye.exports}var _t=ut(),Ee={exports:{}},Te;function ft(){return Te||(Te=1,function(G,V){(function(j,K){G.exports=K()})(self,()=>(()=>{var j={6:(R,s)=>{function o(_){try{const n=new URL(_),c=n.password&&n.username?`${n.protocol}//${n.username}:${n.password}@${n.host}`:n.username?`${n.protocol}//${n.username}@${n.host}`:`${n.protocol}//${n.host}`;return _.toLocaleLowerCase().startsWith(c.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(_,n,c,u={}){this._terminal=_,this._regex=n,this._handler=c,this._options=u}provideLinks(_,n){const c=d.computeLink(_,this._regex,this._terminal,this._handler);n(this._addCallbacks(c))}_addCallbacks(_){return _.map(n=>(n.leave=this._options.leave,n.hover=(c,u)=>{if(this._options.hover){const{range:v}=n;this._options.hover(c,u,v)}},n))}};class d{static computeLink(n,c,u,v){const h=new RegExp(c.source,(c.flags||"")+"g"),[t,r]=d._getWindowedLineStrings(n-1,u),e=t.join("");let i;const a=[];for(;i=h.exec(e);){const f=i[0];if(!o(f))continue;const[p,g]=d._mapStrIdx(u,r,0,i.index),[l,m]=d._mapStrIdx(u,p,g,f.length);if(p===-1||g===-1||l===-1||m===-1)continue;const E={start:{x:g+1,y:p+1},end:{x:m,y:l+1}};a.push({range:E,text:f,activate:v})}return a}static _getWindowedLineStrings(n,c){let u,v=n,h=n,t=0,r="";const e=[];if(u=c.buffer.active.getLine(n)){const i=u.translateToString(!0);if(u.isWrapped&&i[0]!==" "){for(t=0;(u=c.buffer.active.getLine(--v))&&t<2048&&(r=u.translateToString(!0),t+=r.length,e.push(r),u.isWrapped&&r.indexOf(" ")===-1););e.reverse()}for(e.push(i),t=0;(u=c.buffer.active.getLine(++h))&&u.isWrapped&&t<2048&&(r=u.translateToString(!0),t+=r.length,e.push(r),r.indexOf(" ")===-1););}return[e,v]}static _mapStrIdx(n,c,u,v){const h=n.buffer.active,t=h.getNullCell();let r=u;for(;v;){const e=h.getLine(c);if(!e)return[-1,-1];for(let i=r;i<e.length;++i){e.getCell(i,t);const a=t.getChars();if(t.getWidth()&&(v-=a.length||1,i===e.length-1&&a==="")){const f=h.getLine(c+1);f&&f.isWrapped&&(f.getCell(0,t),t.getWidth()===2&&(v+=1))}if(v<0)return[c,i]}c++,r=0}return[c,r]}}s.LinkComputer=d}},K={};function N(R){var s=K[R];if(s!==void 0)return s.exports;var o=K[R]={exports:{}};return j[R](o,o.exports,N),o.exports}var J={};return(()=>{var R=J;Object.defineProperty(R,"__esModule",{value:!0}),R.WebLinksAddon=void 0;const s=N(6),o=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(_,n){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}R.WebLinksAddon=class{constructor(_=d,n={}){this._handler=_,this._options=n}activate(_){this._terminal=_;const n=this._options,c=n.urlRegex||o;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,c,this._handler,n))}dispose(){this._linkProvider?.dispose()}}})(),J})())}(Ee)),Ee.exports}var pt=ft(),xe={exports:{}},Me;function vt(){return Me||(Me=1,function(G,V){(function(j,K){G.exports=K()})(self,()=>(()=>{var j={};return(()=>{var K=j;Object.defineProperty(K,"__esModule",{value:!0}),K.FitAddon=void 0,K.FitAddon=class{activate(N){this._terminal=N}dispose(){}fit(){const N=this.proposeDimensions();if(!N||!this._terminal||isNaN(N.cols)||isNaN(N.rows))return;const J=this._terminal._core;this._terminal.rows===N.rows&&this._terminal.cols===N.cols||(J._renderService.clear(),this._terminal.resize(N.cols,N.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const N=this._terminal._core,J=N._renderService.dimensions;if(J.css.cell.width===0||J.css.cell.height===0)return;const R=this._terminal.options.scrollback===0?0:N.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(s.getPropertyValue("height")),d=Math.max(0,parseInt(s.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),n=o-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),c=d-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-R;return{cols:Math.max(2,Math.floor(c/J.css.cell.width)),rows:Math.max(1,Math.floor(n/J.css.cell.height))}}}})(),j})())}(xe)),xe.exports}var gt=vt();const ie={BLACK_OVERLAY_LIGHT:"rgba(0, 0, 0, 0.3)",BLACK_OVERLAY_MEDIUM:"rgba(0, 0, 0, 0.7)",BLACK_OVERLAY_DARK:"rgba(0, 0, 0, 0.8)",BLACK_DROP_SHADOW:"rgba(0, 0, 0, 0.4)",BLACK_SOLID:"#000"};fe.div`
|
|
10
10
|
/* Base styles */
|
|
11
11
|
display: block;
|
|
12
12
|
position: relative;
|
|
@@ -355,14 +355,14 @@ WARNING: This link could potentially be dangerous`)){const i=window.open();if(i)
|
|
|
355
355
|
.terminal-watermark {
|
|
356
356
|
z-index: 99999;
|
|
357
357
|
}
|
|
358
|
-
`;const
|
|
359
|
-
`);return K.forEach((N,J)=>{const R=N.match(
|
|
360
|
-
`)}\x1B[0m`};function Ke({name:G,logId:V,types:j=["error","info","access","security","stdout","stderr"],defaultTypeIndex:K=0,initialData:N=[],prepend:J=null,postpend:R=null,onTypeChange:s=()=>{},...o}){const{ws:{useSubscription:
|
|
358
|
+
`;const mt=fe.div({"& .xterm":{cursor:"text",position:"relative",userSelect:"none",msUserSelect:"none",webkitUserSelect:"none"},"& .xterm.focus, & .xterm:focus":{outline:"none"},"& .xterm .xterm-helpers":{position:"absolute",top:0,zIndex:5},"& .xterm .xterm-helper-textarea":{padding:0,border:0,margin:0,position:"absolute",opacity:0,left:"-9999em",top:0,width:0,height:0,zIndex:-5,whiteSpace:"nowrap",overflow:"hidden",resize:"none"},"& .xterm .composition-view":{background:ie.BLACK_SOLID,color:"#FFF",display:"none",position:"absolute",whiteSpace:"nowrap",zIndex:1},"& .xterm .composition-view.active":{display:"block"},"& .xterm .xterm-viewport":{backgroundColor:"transparent !important",overflowY:"scroll",cursor:"default",position:"absolute",right:0,left:0,top:0,bottom:0,"&::-webkit-scrollbar":{width:"8px",backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#aaa",borderRadius:"4px"}},"& .xterm .xterm-screen":{position:"relative"},"& .xterm .xterm-screen canvas":{position:"absolute",left:0,top:0},"& .xterm .xterm-scroll-area":{visibility:"hidden"},"& .xterm-char-measure-element":{display:"inline-block",visibility:"hidden",position:"absolute",top:0,left:"-9999em",lineHeight:"normal"},"& .xterm.enable-mouse-events":{cursor:"default"},"& .xterm.xterm-cursor-pointer, & .xterm .xterm-cursor-pointer":{cursor:"pointer"},"& .xterm.column-select.focus":{cursor:"crosshair"},"& .xterm .xterm-accessibility:not(.debug), & .xterm .xterm-message":{position:"absolute",left:0,top:0,bottom:0,right:0,zIndex:10,color:"transparent",pointerEvents:"none"},"& .xterm .xterm-accessibility-tree:not(.debug) *::selection":{color:"transparent"},"& .xterm .xterm-accessibility-tree":{userSelect:"text",whiteSpace:"pre"},"& .xterm .live-region":{position:"absolute",left:"-9999px",width:"1px",height:"1px",overflow:"hidden"},"& .xterm-dim":{opacity:"1 !important"},"& .xterm-underline-1":{textDecoration:"underline"},"& .xterm-underline-2":{textDecoration:"double underline"},"& .xterm-underline-3":{textDecoration:"wavy underline"},"& .xterm-underline-4":{textDecoration:"dotted underline"},"& .xterm-underline-5":{textDecoration:"dashed underline"},"& .xterm-overline":{textDecoration:"overline"},"& .xterm-overline.xterm-underline-1":{textDecoration:"overline underline"},"& .xterm-overline.xterm-underline-2":{textDecoration:"overline double underline"},"& .xterm-overline.xterm-underline-3":{textDecoration:"overline wavy underline"},"& .xterm-overline.xterm-underline-4":{textDecoration:"overline dotted underline"},"& .xterm-overline.xterm-underline-5":{textDecoration:"overline dashed underline"},"& .xterm-strikethrough":{textDecoration:"line-through"},"& .xterm-screen .xterm-decoration-container .xterm-decoration":{zIndex:6,position:"absolute"},"& .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer":{zIndex:7},"& .xterm-decoration-overview-ruler":{zIndex:8,position:"absolute",top:0,right:0,pointerEvents:"none"},"& .xterm-decoration-top":{zIndex:2,position:"relative"}});class ze extends it.Component{xterm=null;container=null;shouldTriggerFitWhenWrite=!1;componentDidMount(){const{value:V="",options:j={}}=this.props;this.fitAddon=new gt.FitAddon,this.xterm=new _t.Terminal(j),this.xterm.loadAddon(new pt.WebLinksAddon),this.xterm.loadAddon(this.fitAddon),this.xterm.open(this.container),this.xterm.onData(this.onData.bind(this)),this.xterm.onRender(this.onRender.bind(this)),V&&this.xterm.write(V),setTimeout(()=>{this.xterm&&this.fitAddon.fit()},0),this.debounceFit=nt(()=>{this.fitAddon.fit()},500),window.addEventListener("resize",this.debounceFit)}componentWillUnmount(){this.xterm&&(this.xterm.dispose(),this.xterm=null),window.removeEventListener("resize",this.debounceFit)}shouldComponentUpdate(V){const{value:j=""}=V,{value:K=""}=this.props;return V.hasOwnProperty("value")&&j!==K&&this.xterm&&(this.xterm.clear(),setTimeout(()=>{this.xterm.write(j)},0)),!1}getXTerm(){return this.xterm}write(V,j){this.xterm&&(this.xterm.write(V,j),this.shouldTriggerFitWhenWrite&&(this.debounceFit(),this.shouldTriggerFitWhenWrite=!1))}focus(){this.xterm&&this.xterm.focus()}reset(){this.xterm&&this.xterm.reset()}onData=V=>{const{onData:j=Re}=this.props;j(V)};onRender=V=>{const{onRender:j=Re}=this.props;j(V)};resize(V,j){this.xterm&&(this.shouldTriggerFitWhenWrite=!0,setTimeout(()=>{const K=Math.round(V??this.props.options.cols),N=Math.round(j??this.props.options.rows);typeof K=="number"&&typeof N=="number"&&this.xterm.resize(K,N),this.shouldTriggerFitWhenWrite=!0},250))}setOption(V,j){this.xterm&&(this.xterm.options[V]=j)}getOption(V){if(this.xterm)return this.xterm.options[V]}refresh(){this.xterm&&this.xterm.refresh(0,this.xterm.rows-1)}render(){const{className:V="",style:j={}}=this.props,K=["react-xterm",V].filter(Boolean).join(" ");return Y.jsx(mt,{ref:N=>{this.container=N},className:K,style:j})}}ze.propTypes={onData:te.func,onRender:te.func,options:te.object,value:te.string,className:te.string,style:te.object};var ge={},Oe;function St(){if(Oe)return ge;Oe=1,Object.defineProperty(ge,"__esModule",{value:!0});var G=rt(),V=function(j,K){var N=G.useRef(function(){});G.useEffect(function(){N.current=j}),G.useEffect(function(){if(K!==null){var J=setInterval(function(){return N.current()},K||0);return function(){return clearInterval(J)}}},[K])};return ge.default=V,ge}var Ct=St();const bt=Ne(Ct);function wt(){const[G,V]=oe.useState(+new Date);return bt(()=>{V(+new Date)},1e3),ot(G,"MMMM Do YYYY, h:mm:ss a")}const Pe={info:"\x1B[34m",error:"\x1B[31m",stderr:"\x1B[31m",access:"\x1B[32m",stdout:"\x1B[37m",pm2:"\x1B[36m"},yt=/\[\d{2}\/[A-Za-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} \+\d{4}\]/g,Et=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}:/g,xt=/\(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\):/g,kt=/\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\]/g,Lt=/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/g,Dt=(G,V)=>{const j=Pe[V.toLowerCase()]||Pe.stdout,K=G.split(`\r
|
|
359
|
+
`);return K.forEach((N,J)=>{const R=N.match(yt)||N.match(Et)||N.match(xt)||N.match(kt)||N.match(Lt);if(R){const s=R[0],o=`\x1B[33m${s}\x1B[0m${j}`;K[J]=N.replace(s,o)}}),`${j}${K.join(`\r
|
|
360
|
+
`)}\x1B[0m`};function Ke({name:G,logId:V,types:j=["error","info","access","security","stdout","stderr"],defaultTypeIndex:K=0,initialData:N=[],prepend:J=null,postpend:R=null,onTypeChange:s=()=>{},...o}){const{ws:{useSubscription:d}}=$e(),_={info:"Info",error:"Error",access:"Access",security:"Security",stdout:"stdout",stderr:"stderr",pm2:"PM2"},n=Ye(r=>r.breakpoints.down("md")),[c,u]=oe.useState(j[K||0]),[v,h]=oe.useState(),t=oe.useRef({});return oe.useEffect(()=>{j.forEach(r=>{const e=t.current[r];e&&(e.write(`Collecting ${r} logs for ${G}...`),e.write(`\r
|
|
361
361
|
\r
|
|
362
|
-
`),N.forEach(
|
|
362
|
+
`),N.forEach(i=>e.write(i)))})},[]),d(`log.${V}`,r=>{v||h(r.logFiles||{});const e=t.current[r.level];if(e){const i=r.data.replace(/.\n/g,a=>a===`\r
|
|
363
363
|
`?a:`${a[0]}\r
|
|
364
|
-
`);e.write(
|
|
365
|
-
`)}},[]),Y.jsxs(
|
|
364
|
+
`);e.write(Dt(i,r.level)),e.write(`\r
|
|
365
|
+
`)}},[]),Y.jsxs(Rt,{...o,children:[Y.jsxs("div",{className:"log-terminal-group-head",style:{alignItems:n?"flex-start":"center"},children:[Y.jsxs("div",{className:"log-terminal-group-head-start",children:[J,Y.jsx(Xe,{variant:"outlined",size:n?"small":"medium",children:j.map(r=>{const e=r===c?{variant:"contained"}:{};return Y.jsx(Je,{...e,onClick:()=>{u(r),s(r)},children:_[r]},r)})})]}),Y.jsx("div",{className:"log-terminal-group-head-end",children:R})]}),Y.jsx("div",{className:"log-terminal-group-terminals",children:j.map(r=>Y.jsx(qe,{ref:e=>{t.current[r]=e},logFile:v?.[r],style:{visibility:r===c?"visible":"hidden"}},r))})]})}Ke.propTypes={name:te.string.isRequired,logId:te.string.isRequired,types:te.arrayOf(te.string),defaultTypeIndex:te.number,initialData:te.arrayOf(te.string),prepend:te.node,postpend:te.node,onTypeChange:te.func};const Rt=fe.div`
|
|
366
366
|
display: flex;
|
|
367
367
|
flex-direction: column;
|
|
368
368
|
height: 100%;
|
|
@@ -405,7 +405,7 @@ WARNING: This link could potentially be dangerous`)){const i=window.open();if(i)
|
|
|
405
405
|
right: 0;
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
`;function qe({ref:G=null,logFile:V="",...j}){const K={width:"100%",boxSizing:"border-box",height:"100%"},N={theme:{background:"#2C313C",foreground:"#EEEEEE",red:"#ff3333",black:"#1f2430",green:"#bae67e",yellow:"#ffa759",blue:"#73d0ff",purple:"#d4bfff",cyan:"#95e6cb",white:"#cbccc6"},screenReaderMode:!0};return Y.jsxs(
|
|
408
|
+
`;function qe({ref:G=null,logFile:V="",...j}){const K={width:"100%",boxSizing:"border-box",height:"100%"},N={theme:{background:"#2C313C",foreground:"#EEEEEE",red:"#ff3333",black:"#1f2430",green:"#bae67e",yellow:"#ffa759",blue:"#73d0ff",purple:"#d4bfff",cyan:"#95e6cb",white:"#cbccc6"},screenReaderMode:!0};return Y.jsxs(At,{...j,children:[Y.jsxs("div",{className:"log-terminal-top",children:[Y.jsx(wt,{}),V&&Y.jsx("span",{children:V})]}),Y.jsx("div",{className:"log-terminal-container",style:{position:"relative"},children:Y.jsx(ze,{ref:G,style:K,options:N})})]})}qe.propTypes={ref:te.any,logFile:te.string};const At=fe.div`
|
|
409
409
|
height: 100%;
|
|
410
410
|
display: flex;
|
|
411
411
|
flex-direction: column;
|
|
@@ -442,7 +442,7 @@ WARNING: This link could potentially be dangerous`)){const i=window.open();if(i)
|
|
|
442
442
|
min-height: 20px;
|
|
443
443
|
background-color: #ffffff20;
|
|
444
444
|
}
|
|
445
|
-
`;var me={exports:{}},
|
|
445
|
+
`;var me={exports:{}},Bt=me.exports,Ie;function Tt(){return Ie||(Ie=1,function(G,V){(function(j,K,N){G.exports=N(),G.exports.default=N()})("slugify",Bt,function(){var j=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),K=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function N(J,R){if(typeof J!="string")throw new Error("slugify: string argument expected");R=typeof R=="string"?{replacement:R}:R||{};var s=K[R.locale]||{},o=R.replacement===void 0?"-":R.replacement,d=R.trim===void 0?!0:R.trim,_=J.normalize().split("").reduce(function(n,c){var u=s[c];return u===void 0&&(u=j[c]),u===void 0&&(u=c),u===o&&(u=" "),n+u.replace(R.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return R.strict&&(_=_.replace(/[^A-Za-z0-9\s]/g,"")),d&&(_=_.trim()),_=_.replace(/\s+/g,o),R.lower&&(_=_.toLowerCase()),_}return N.extend=function(J){Object.assign(j,J)},N})}(me)),me.exports}var ke,He;function Mt(){if(He)return ke;He=1;const G=Tt();return ke=j=>G((j||"").replace(/^[@./-]/,"").replace(/[@./_]/g,"-")),ke}var Ot=Mt();const Pt=Ne(Ot),It=[1,7];function Ve({id:G,name:V=""}){const{t:j}=ht(),{restApi:K,inService:N}=$e(),[J,R]=oe.useState(!1),[s,o]=oe.useState(!1),[d,_]=oe.useState(1),n=async()=>{if(!s)try{o(!0);const u=N?"":`/${G}`,v=await K.get(`/download/log${u}?days=${d}`,{responseType:"blob",timeout:30*60*1e3}),h=URL.createObjectURL(v.data),t=document.createElement("a");t.href=h,t.setAttribute("download",`${Pt(V||G)}.${at().format("YYYYMMDDHHmmss")}.log.zip`),document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(h),o(!1),R(!1)}catch(u){o(!1),ct.error(u.message)}},c=u=>{_(u.target.value)};return[Y.jsx(_e,{style:{gap:16},sx:{display:"flex",alignItems:"center"},children:Y.jsxs(Ae,{"data-cy":"download-logs",variant:"outlined",onClick:()=>R(!0),disabled:s,children:[s?Y.jsx(Le,{size:16}):Y.jsx(Ze,{fontSize:"small",style:{transform:"translateY(2px)"}}),Y.jsx(_e,{sx:{ml:.5},children:j("common.download")})]})}),J&&Y.jsx(lt,{open:!0,onClose:()=>{R(!1)},disableEscapeKeyDown:!0,title:j("common.download"),PaperProps:{style:{minHeight:"auto"}},actions:Y.jsxs(Ae,{"data-cy":"download-logs",variant:"outlined",onClick:()=>n(),disabled:s,children:[s&&Y.jsx(Le,{size:16}),Y.jsx(_e,{sx:{ml:.5},children:j("common.confirm")})]}),children:Y.jsx(_e,{sx:{mb:2,display:"flex",justifyContent:"center"},children:Y.jsx(Fe,{size:"small",fullWidth:!0,children:Y.jsx(We,{value:d,onChange:c,children:It.map(u=>Y.jsx(Ue,{value:u,children:j(`log.lastDays.${u}`)},u))})})})})]}Ve.propTypes={id:te.string.isRequired,name:te.string};const Ht=fe.div`
|
|
446
446
|
display: flex;
|
|
447
447
|
justify-items: flex-start;
|
|
448
448
|
align-items: center;
|
|
@@ -454,6 +454,6 @@ WARNING: This link could potentially be dangerous`)){const i=window.open();if(i)
|
|
|
454
454
|
overflow: hidden;
|
|
455
455
|
text-overflow: ellipsis;
|
|
456
456
|
}
|
|
457
|
-
`;function
|
|
457
|
+
`;function Ft({blocklet:G,...V}){const j=['Tip: this tab will only show runtime logs. Please go to "Blocklet Server" to view other lifecycle logs of the blocklet (install/start/stop...)',`\r
|
|
458
458
|
\r
|
|
459
|
-
`],K=(G?.children||[]).map(
|
|
459
|
+
`],K=(G?.children||[]).map(e=>({did:e.meta.did,name:e.meta.title,types:["error","info","access","stdout","stderr"],component:e}));K.sort((e,i)=>e.name.localeCompare(i.name));const[N,J]=oe.useState(""),[R,s]=st(),o=R.get("component"),[d,_]=tt(`blocklet-log-${G.meta.did}`,"");let[n,c]=d.split(",");K.find(e=>e.did===n)||(n=K[0]?.did),o&&(n=o);const u=e=>{s({component:e.target.value}),_([e.target.value,c].join(","))},v=K.filter(e=>e.name.toLowerCase().includes(N.toLowerCase())),h=Y.jsx(Fe,{sx:{minWidth:240,maxWidth:300},children:Y.jsxs(We,{MenuProps:{autoFocus:!1},value:n,onChange:u,onClose:()=>J(""),size:"small",variant:"outlined",children:[Y.jsx(Qe,{children:Y.jsx(et,{autoFocus:!0,value:N,placeholder:"Search",variant:"outlined",size:"small",fullWidth:!0,onChange:e=>J(e.target.value),onKeyDown:e=>{e.key!=="Escape"&&e.stopPropagation()}})}),v.map(e=>Y.jsx(Ue,{value:e.did,children:Y.jsxs(Ht,{children:[Y.jsx(dt,{size:24,blocklet:e.component,ancestors:[G]}),Y.jsx("span",{className:"name",children:e.name})]})},e.did))]})}),t=K.find(e=>e.did===n)||K[0]||G.meta,r=e=>{const i=t.types.indexOf(e);_([n,i||0].join(","))};return Y.jsx(_e,{...V,sx:[{height:{xs:"calc(100vh - 444px)",sm:"calc(100vh - 508px)",md:"calc(100vh - 445px)"}},...Array.isArray(V.sx)?V.sx:[V.sx]],children:Y.jsx(Ke,{logId:t===G.meta?`blocklet-${G.meta.did}`:`blocklet-${G.meta.did}/${t.did}`,initialData:j,prepend:h,postpend:Y.jsx(Ve,{id:G.meta.did,name:G.meta.name}),name:t.name,types:t.types,defaultTypeIndex:c,onTypeChange:r},t.did)})}Ft.propTypes={blocklet:te.object.isRequired};export{Ft as default};
|