@tui-sandbox/library 11.2.0 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/browser/assets/{index-D4YBlffP.js → index-DXraucSs.js} +6 -6
  3. package/dist/browser/index.html +1 -1
  4. package/dist/src/browser/neovim-client.d.ts +2 -1
  5. package/dist/src/browser/neovim-client.js +3 -0
  6. package/dist/src/browser/neovim-client.js.map +1 -1
  7. package/dist/src/client/MyNeovimConfigModification.test.js +1 -1
  8. package/dist/src/client/MyNeovimConfigModification.test.js.map +1 -1
  9. package/dist/src/client/neovim-terminal-client.d.ts +2 -1
  10. package/dist/src/client/neovim-terminal-client.js +8 -0
  11. package/dist/src/client/neovim-terminal-client.js.map +1 -1
  12. package/dist/src/client/websocket-client.js +1 -1
  13. package/dist/src/client/websocket-client.js.map +1 -1
  14. package/dist/src/server/applications/neovim/neovimRouter.d.ts +10 -1
  15. package/dist/src/server/applications/neovim/neovimRouter.js +6 -1
  16. package/dist/src/server/applications/neovim/neovimRouter.js.map +1 -1
  17. package/dist/src/server/applications/terminal/terminalRouter.d.ts +1 -1
  18. package/dist/src/server/applications/terminal/terminalRouter.js +1 -1
  19. package/dist/src/server/applications/terminal/terminalRouter.js.map +1 -1
  20. package/dist/src/server/blockingCommandInputSchema.d.ts +1 -1
  21. package/dist/src/server/blockingCommandInputSchema.js +1 -1
  22. package/dist/src/server/blockingCommandInputSchema.js.map +1 -1
  23. package/dist/src/server/cypress-support/contents.js +15 -0
  24. package/dist/src/server/cypress-support/contents.js.map +1 -1
  25. package/dist/src/server/dirtree/index.test.js +2 -2
  26. package/dist/src/server/dirtree/json-to-zod.js +1 -1
  27. package/dist/src/server/dirtree/json-to-zod.js.map +1 -1
  28. package/dist/src/server/utilities/tabId.d.ts +1 -1
  29. package/dist/src/server/utilities/tabId.js +1 -1
  30. package/dist/src/server/utilities/tabId.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +2 -2
  33. package/src/browser/neovim-client.ts +5 -0
  34. package/src/client/MyNeovimConfigModification.test.ts +1 -1
  35. package/src/client/neovim-terminal-client.ts +10 -0
  36. package/src/client/websocket-client.ts +1 -1
  37. package/src/server/applications/neovim/neovimRouter.ts +9 -1
  38. package/src/server/applications/terminal/terminalRouter.ts +1 -1
  39. package/src/server/blockingCommandInputSchema.ts +1 -1
  40. package/src/server/cypress-support/contents.ts +15 -0
  41. package/src/server/dirtree/index.test.ts +2 -2
  42. package/src/server/dirtree/json-to-zod.ts +1 -1
  43. package/src/server/utilities/tabId.ts +1 -1
@@ -1,9 +1,9 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))g(m);new MutationObserver(m=>{for(const k of m)if(k.type==="childList")for(const w of k.addedNodes)w.tagName==="LINK"&&w.rel==="modulepreload"&&g(w)}).observe(document,{childList:!0,subtree:!0});function c(m){const k={};return m.integrity&&(k.integrity=m.integrity),m.referrerPolicy&&(k.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?k.credentials="include":m.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function g(m){if(m.ep)return;m.ep=!0;const k=c(m);fetch(m.href,k)}})();var $r=Object.create,Qt=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,er=Object.getOwnPropertyNames,Nr=Object.getPrototypeOf,Ur=Object.prototype.hasOwnProperty,_e=(e,t)=>function(){return t||(0,e[er(e)[0]])((t={exports:{}}).exports,t),t.exports},Zr=(e,t,c,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(var m=er(t),k=0,w=m.length,r;k<w;k++)r=m[k],!Ur.call(e,r)&&r!==c&&Qt(e,r,{get:(s=>t[s]).bind(null,r),enumerable:!(g=Wr(t,r))||g.enumerable});return e},oe=(e,t,c)=>(c=e!=null?$r(Nr(e)):{},Zr(Qt(c,"default",{value:e,enumerable:!0}),e)),tr=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function c(g){"@babel/helpers - typeof";return t.exports=c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},t.exports.__esModule=!0,t.exports.default=t.exports,c(g)}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),qr=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var c=tr().default;function g(m,k){if(c(m)!="object"||!m)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var r=w.call(m,k||"default");if(c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(m)}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),Kr=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var c=tr().default,g=qr();function m(k){var w=g(k,"string");return c(w)=="symbol"?w:w+""}t.exports=m,t.exports.__esModule=!0,t.exports.default=t.exports}}),we=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var c=Kr();function g(m,k,w){return(k=c(k))in m?Object.defineProperty(m,k,{value:w,enumerable:!0,configurable:!0,writable:!0}):m[k]=w,m}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),ue=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var c=we();function g(k,w){var r=Object.keys(k);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(k);w&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(k,l).enumerable})),r.push.apply(r,s)}return r}function m(k){for(var w=1;w<arguments.length;w++){var r=arguments[w]!=null?arguments[w]:{};w%2?g(Object(r),!0).forEach(function(s){c(k,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(s){Object.defineProperty(k,s,Object.getOwnPropertyDescriptor(r,s))})}return k}t.exports=m,t.exports.__esModule=!0,t.exports.default=t.exports}});function xe(e){const t={subscribe(c){let g=null,m=!1,k=!1,w=!1;function r(){if(g===null){w=!0;return}k||(k=!0,typeof g=="function"?g():g&&g.unsubscribe())}return g=e({next(s){var l;m||(l=c.next)===null||l===void 0||l.call(c,s)},error(s){var l;m||(m=!0,(l=c.error)===null||l===void 0||l.call(c,s),r())},complete(){var s;m||(m=!0,(s=c.complete)===null||s===void 0||s.call(c),r())}}),w&&r(),{unsubscribe:r}},pipe(...c){return c.reduce(Vr,t)}};return t}function Vr(e,t){return t(e)}function Gr(e){const t=new AbortController;return new Promise((g,m)=>{let k=!1;function w(){k||(k=!0,r.unsubscribe())}t.signal.addEventListener("abort",()=>{m(t.signal.reason)});const r=e.subscribe({next(s){k=!0,g(s),w()},error(s){m(s)},complete(){t.abort(),w()}})})}function Jr(e){return t=>{let c=0,g=null;const m=[];function k(){g||(g=t.subscribe({next(r){for(const l of m){var s;(s=l.next)===null||s===void 0||s.call(l,r)}},error(r){for(const l of m){var s;(s=l.error)===null||s===void 0||s.call(l,r)}},complete(){for(const s of m){var r;(r=s.complete)===null||r===void 0||r.call(s)}}}))}function w(){if(c===0&&g){const r=g;g=null,r.unsubscribe()}}return xe(r=>(c++,m.push(r),k(),{unsubscribe(){c--,w();const s=m.findIndex(l=>l===r);s>-1&&m.splice(s,1)}}))}}function rr(e){let t=e;const c=[],g=w=>{t!==void 0&&w.next(t),c.push(w)},m=w=>{c.splice(c.indexOf(w),1)},k=xe(w=>(g(w),()=>{m(w)}));return k.next=w=>{if(t!==w){t=w;for(const r of c)r.next(w)}},k.get=()=>t,k}function ir(e){return xe(t=>{function c(m=0,k=e.op){const w=e.links[m];if(!w)throw new Error("No more links to execute - did you forget to add an ending link?");return w({op:k,next(s){return c(m+1,s)}})}return c().subscribe(t)})}function wt(e){return Array.isArray(e)?e:[e]}function sr(e){return t=>{const c=wt(e.true).map(m=>m(t)),g=wt(e.false).map(m=>m(t));return m=>xe(k=>{const w=e.condition(m.op)?c:g;return ir({op:m.op,links:w}).subscribe(k)})}}const Ne={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603},Yr=[Ne.BAD_GATEWAY,Ne.SERVICE_UNAVAILABLE,Ne.GATEWAY_TIMEOUT,Ne.INTERNAL_SERVER_ERROR];function Oe(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const nr=e=>e();var Xr=Object.create,or=Object.defineProperty,Qr=Object.getOwnPropertyDescriptor,ar=Object.getOwnPropertyNames,ei=Object.getPrototypeOf,ti=Object.prototype.hasOwnProperty,de=(e,t)=>function(){return t||(0,e[ar(e)[0]])((t={exports:{}}).exports,t),t.exports},ri=(e,t,c,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(var m=ar(t),k=0,w=m.length,r;k<w;k++)r=m[k],!ti.call(e,r)&&r!==c&&or(e,r,{get:(s=>t[s]).bind(null,r),enumerable:!(g=Qr(t,r))||g.enumerable});return e},Q=(e,t,c)=>(c=e!=null?Xr(ei(e)):{},ri(or(c,"default",{value:e,enumerable:!0}),e));const cr=()=>{},Et=e=>{Object.freeze&&Object.freeze(e)};function hr(e,t,c){var g;const m=t.join(".");return(g=c[m])!==null&&g!==void 0||(c[m]=new Proxy(cr,{get(k,w){if(!(typeof w!="string"||w==="then"))return hr(e,[...t,w],c)},apply(k,w,r){const s=t[t.length-1];let l={args:r,path:t};return s==="call"?l={args:r.length>=2?[r[1]]:[],path:t.slice(0,-1)}:s==="apply"&&(l={args:r.length>=2?r[1]:[],path:t.slice(0,-1)}),Et(l.args),Et(l.path),e(l)}})),c[m]}const ii=e=>hr(e,[],Object.create(null)),si=e=>new Proxy(cr,{get(t,c){if(c!=="then")return e(c)}});var lr=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function c(g){"@babel/helpers - typeof";return t.exports=c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},t.exports.__esModule=!0,t.exports.default=t.exports,c(g)}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),ni=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var c=lr().default;function g(m,k){if(c(m)!="object"||!m)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var r=w.call(m,k||"default");if(c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(m)}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),oi=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var c=lr().default,g=ni();function m(k){var w=g(k,"string");return c(w)=="symbol"?w:w+""}t.exports=m,t.exports.__esModule=!0,t.exports.default=t.exports}}),_t=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var c=oi();function g(m,k,w){return(k=c(k))in m?Object.defineProperty(m,k,{value:w,enumerable:!0,configurable:!0,writable:!0}):m[k]=w,m}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),He=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var c=_t();function g(k,w){var r=Object.keys(k);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(k);w&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(k,l).enumerable})),r.push.apply(r,s)}return r}function m(k){for(var w=1;w<arguments.length;w++){var r=arguments[w]!=null?arguments[w]:{};w%2?g(Object(r),!0).forEach(function(s){c(k,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(s){Object.defineProperty(k,s,Object.getOwnPropertyDescriptor(r,s))})}return k}t.exports=m,t.exports.__esModule=!0,t.exports.default=t.exports}});Q(He());Q(_t());var Ue=Q(He());function ai(e,t){if("error"in e){const g=t.deserialize(e.error);return{ok:!1,error:(0,Ue.default)((0,Ue.default)({},e),{},{error:g})}}return{ok:!0,result:(0,Ue.default)((0,Ue.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var ot=class extends Error{constructor(){super("Unable to transform response from server")}};function ci(e,t){let c;try{c=ai(e,t)}catch{throw new ot}if(!c.ok&&(!Oe(c.error.error)||typeof c.error.error.code!="number"))throw new ot;if(c.ok&&!Oe(c.result))throw new ot;return c}Q(He());Q(He());var Ze=Q(_t());let ur;const at=new WeakMap,hi=()=>{};ur=Symbol.toStringTag;var dr=class be{constructor(t){(0,Ze.default)(this,"promise",void 0),(0,Ze.default)(this,"subscribers",[]),(0,Ze.default)(this,"settlement",null),(0,Ze.default)(this,ur,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const c=this.promise.then(g=>{const{subscribers:m}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:g},m?.forEach(({resolve:k})=>{k(g)})});"catch"in c&&c.catch(g=>{const{subscribers:m}=this;this.subscribers=null,this.settlement={status:"rejected",reason:g},m?.forEach(({reject:k})=>{k(g)})})}subscribe(){let t,c;const{settlement:g}=this;if(g===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const m=ui();this.subscribers=di(this.subscribers,m),t=m.promise,c=()=>{this.subscribers!==null&&(this.subscribers=_i(this.subscribers,m))}}else{const{status:m}=g;m==="fulfilled"?t=Promise.resolve(g.value):t=Promise.reject(g.reason),c=hi}return Object.assign(t,{unsubscribe:c})}then(t,c){const g=this.subscribe(),{unsubscribe:m}=g;return Object.assign(g.then(t,c),{unsubscribe:m})}catch(t){const c=this.subscribe(),{unsubscribe:g}=c;return Object.assign(c.catch(t),{unsubscribe:g})}finally(t){const c=this.subscribe(),{unsubscribe:g}=c;return Object.assign(c.finally(t),{unsubscribe:g})}static proxy(t){const c=be.getSubscribablePromise(t);return typeof c<"u"?c:be.createSubscribablePromise(t)}static createSubscribablePromise(t){const c=new be(t);return at.set(t,c),at.set(c,c),c}static getSubscribablePromise(t){return at.get(t)}static resolve(t){const c=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return be.proxy(c).subscribe()}static async any(t){const g=(Array.isArray(t)?t:[...t]).map(be.resolve);try{return await Promise.any(g)}finally{g.forEach(({unsubscribe:m})=>{m()})}}static async race(t){const g=(Array.isArray(t)?t:[...t]).map(be.resolve);try{return await Promise.race(g)}finally{g.forEach(({unsubscribe:m})=>{m()})}}static async raceReferences(t){const c=t.map(li);try{return await Promise.race(c)}finally{for(const g of c)g.unsubscribe()}}};function li(e){return dr.proxy(e).then(()=>[e])}function ui(){let e,t;return{promise:new Promise((g,m)=>{e=g,t=m}),resolve:e,reject:t}}function di(e,t){return[...e,t]}function fi(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function _i(e,t){const c=e.indexOf(t);return c!==-1?fi(e,c):e}var xt,kt,Dt,Rt;(kt=(xt=Symbol).dispose)!==null&&kt!==void 0||(xt.dispose=Symbol());(Rt=(Dt=Symbol).asyncDispose)!==null&&Rt!==void 0||(Dt.asyncDispose=Symbol());function pi(e,t){const c=e,g=c[Symbol.dispose];return c[Symbol.dispose]=()=>{t(),g?.()},c}function vi(e,t){const c=e,g=c[Symbol.asyncDispose];return c[Symbol.asyncDispose]=async()=>{await t(),await g?.()},c}const fr=Symbol();function gi(e){let t=null;return pi({start(){if(t)throw new Error("Timer already started");return new Promise(g=>{t=setTimeout(()=>g(fr),e)})}},()=>{t&&clearTimeout(t)})}var Fe=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function c(){var g=typeof SuppressedError=="function"?SuppressedError:function(r,s){var l=Error();return l.name="SuppressedError",l.error=r,l.suppressed=s,l},m={},k=[];function w(r,s){if(s!=null){if(Object(s)!==s)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(r)var l=s[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(l===void 0&&(l=s[Symbol.dispose||Symbol.for("Symbol.dispose")],r))var _=l;if(typeof l!="function")throw new TypeError("Object is not disposable.");_&&(l=function(){try{_.call(s)}catch(f){return Promise.reject(f)}}),k.push({v:s,d:l,a:r})}else r&&k.push({d:s,a:r});return s}return{e:m,u:w.bind(null,!1),a:w.bind(null,!0),d:function(){var s,l=this.e,_=0;function h(){for(;s=k.pop();)try{if(!s.a&&_===1)return _=0,k.push(s),Promise.resolve().then(h);if(s.d){var v=s.d.call(s.v);if(s.a)return _|=2,Promise.resolve(v).then(h,f)}else _|=1}catch(y){return f(y)}if(_===1)return l!==m?Promise.reject(l):Promise.resolve();if(l!==m)throw l}function f(v){return l=l!==m?new g(v,l):v,h()}return h()}}}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),pt=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function c(g,m){this.v=g,this.k=m}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),ze=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var c=pt();function g(m){return new c(m,0)}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),ke=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var c=pt();function g(k){return function(){return new m(k.apply(this,arguments))}}function m(k){var w,r;function s(_,h){try{var f=k[_](h),v=f.value,y=v instanceof c;Promise.resolve(y?v.v:v).then(function(u){if(y){var n=_==="return"?"return":"next";if(!v.k||u.done)return s(n,u);u=k[n](u).value}l(f.done?"return":"normal",u)},function(u){s("throw",u)})}catch(u){l("throw",u)}}function l(_,h){switch(_){case"return":w.resolve({value:h,done:!0});break;case"throw":w.reject(h);break;default:w.resolve({value:h,done:!1})}(w=w.next)?s(w.key,w.arg):r=null}this._invoke=function(_,h){return new Promise(function(f,v){var y={key:_,arg:h,resolve:f,reject:v,next:null};r?r=r.next=y:(w=r=y,s(_,h))})},typeof k.return!="function"&&(this.return=void 0)}m.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},m.prototype.next=function(k){return this._invoke("next",k)},m.prototype.throw=function(k){return this._invoke("throw",k)},m.prototype.return=function(k){return this._invoke("return",k)},t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}});Q(Fe());Q(ze());Q(ke());Q(Fe());Q(ze());Q(ke());Q(Fe());Q(ze());Q(ke());var _r=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function c(m){var k,w,r,s=2;for(typeof Symbol<"u"&&(w=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(w&&(k=m[w])!=null)return k.call(m);if(r&&(k=m[r])!=null)return new g(k.call(m));w="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function g(m){function k(w){if(Object(w)!==w)return Promise.reject(new TypeError(w+" is not an object."));var r=w.done;return Promise.resolve(w.value).then(function(s){return{value:s,done:r}})}return g=function(r){this.s=r,this.n=r.next},g.prototype={s:null,n:null,next:function(){return k(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):k(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):k(s.apply(this.s,arguments))}},new g(m)}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}});Q(ze());Q(ke());Q(Fe());Q(_r());var mi=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js"(e,t){var c=pt();function g(m){var k={},w=!1;function r(s,l){return w=!0,l=new Promise(function(_){_(m[s](l))}),{done:!1,value:new c(l,1)}}return k[typeof Symbol<"u"&&Symbol.iterator||"@@iterator"]=function(){return this},k.next=function(s){return w?(w=!1,s):r("next",s)},typeof m.throw=="function"&&(k.throw=function(s){if(w)throw w=!1,s;return r("throw",s)}),typeof m.return=="function"&&(k.return=function(s){return w?(w=!1,s):r("return",s)}),k}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}});Q(_r());var Lt=Q(ze()),bi=Q(ke());Q(mi());var pr=Q(Fe());const Si="ping",yi="serialized-error",Ci="connected",wi="return";async function Ei(e){try{var t=(0,pr.default)();const c=t.u(gi(e.timeoutMs)),g=await dr.race([e.promise,c.start()]);return g===fr?await e.onTimeout():g}catch(c){t.e=c}finally{t.d()}}function xi(e){const{deserialize:t=r=>r}=e;let c={};const g=e.signal;let m=null;const k=()=>new ReadableStream({async start(r){const[s,l]=await Promise.all([e.url(),e.init()]),_=m=new e.EventSource(s,l);r.enqueue({type:"connecting",eventSource:m,event:null}),_.addEventListener(Ci,f=>{const y=JSON.parse(f.data);c=y,r.enqueue({type:"connected",options:y,eventSource:_})}),_.addEventListener(yi,f=>{const v=f;r.enqueue({type:"serialized-error",error:t(JSON.parse(v.data)),eventSource:_})}),_.addEventListener(Si,()=>{r.enqueue({type:"ping",eventSource:_})}),_.addEventListener(wi,()=>{_.close(),r.close(),m=null}),_.addEventListener("error",f=>{_.readyState===_.CLOSED?r.error(f):r.enqueue({type:"connecting",eventSource:_,event:f})}),_.addEventListener("message",f=>{const v=f,u={data:t(JSON.parse(v.data))};v.lastEventId&&(u.id=v.lastEventId),r.enqueue({type:"data",data:u,eventSource:_})});const h=()=>{try{_.close(),r.close()}catch{}};g.aborted?h():g.addEventListener("abort",h)},cancel(){m?.close()}}),w=()=>{let r=k(),s=r.getReader();async function l(){await s.cancel(),m=null}return vi({read(){return s.read()},async recreate(){await l(),r=k(),s=r.getReader()}},l)};return nr((0,bi.default)(function*(){try{var r=(0,pr.default)();const s=r.a(w());for(;;){let l=s.read();const _=c.reconnectAfterInactivityMs;_&&(l=Ei({promise:l,timeoutMs:_,onTimeout:async()=>{const f={value:{type:"timeout",ms:_,eventSource:m},done:!1};return await s.recreate(),f}}));const h=yield(0,Lt.default)(l);if(h.done)return h.value;yield h.value}}catch(s){r.e=s}finally{yield(0,Lt.default)(r.d())}}))}Q(ke());Q(He());var qe=oe(we()),Ee=oe(ue());function ki(e){return e instanceof me}function Di(e){return Oe(e)&&Oe(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Ri(e,t){return typeof e=="string"?e:Oe(e)&&typeof e.message=="string"?e.message:t}var me=class Ye extends Error{constructor(t,c){var g,m;const k=c?.cause;super(t,{cause:k}),(0,qe.default)(this,"cause",void 0),(0,qe.default)(this,"shape",void 0),(0,qe.default)(this,"data",void 0),(0,qe.default)(this,"meta",void 0),this.meta=c?.meta,this.cause=k,this.shape=c==null||(g=c.result)===null||g===void 0?void 0:g.error,this.data=c==null||(m=c.result)===null||m===void 0?void 0:m.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ye.prototype)}static from(t,c={}){const g=t;return ki(g)?(c.meta&&(g.meta=(0,Ee.default)((0,Ee.default)({},g.meta),c.meta)),g):Di(g)?new Ye(g.error.message,(0,Ee.default)((0,Ee.default)({},c),{},{result:g})):new Ye(Ri(g,"Unknown error"),(0,Ee.default)((0,Ee.default)({},c),{},{cause:g}))}};function vr(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:c=>c,deserialize:c=>c},output:{serialize:c=>c,deserialize:c=>c}}}const At=e=>typeof e=="function";function Li(e){if(e)return e;if(typeof window<"u"&&At(window.fetch))return window.fetch;if(typeof globalThis<"u"&&At(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Pe=oe(ue());function Ai(e){return{url:e.url.toString(),fetch:e.fetch,transformer:vr(e.transformer),methodOverride:e.methodOverride}}function Pi(e){const t={};for(let c=0;c<e.length;c++){const g=e[c];t[c]=g}return t}const Ti={query:"GET",mutation:"POST",subscription:"PATCH"};function gr(e){return"input"in e?e.transformer.input.serialize(e.input):Pi(e.inputs.map(t=>e.transformer.input.serialize(t)))}const vt=e=>{const t=e.url.split("?");let g=t[0].replace(/\/$/,"")+"/"+e.path;const m=[];if(t[1]&&m.push(t[1]),"inputs"in e&&m.push("batch=1"),e.type==="query"||e.type==="subscription"){const k=gr(e);k!==void 0&&e.methodOverride!=="POST"&&m.push(`input=${encodeURIComponent(JSON.stringify(k))}`)}return m.length&&(g+="?"+m.join("&")),g},Oi=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=gr(e);return t!==void 0?JSON.stringify(t):void 0},Bi=e=>Fi((0,Pe.default)((0,Pe.default)({},e),{},{contentTypeHeader:"application/json",getUrl:vt,getBody:Oi}));var Ii=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Mi=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Ii};async function Hi(e){var t;Mi(e.signal);const c=e.getUrl(e),g=e.getBody(e),{type:m}=e,k=await(async()=>{const r=await e.headers();return Symbol.iterator in r?Object.fromEntries(r):r})(),w=(0,Pe.default)((0,Pe.default)((0,Pe.default)({},e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0),k);return Li(e.fetch)(c,{method:(t=e.methodOverride)!==null&&t!==void 0?t:Ti[m],signal:e.signal,body:g,headers:w})}async function Fi(e){const t={},c=await Hi(e);t.response=c;const g=await c.json();return t.responseJSON=g,{json:g,meta:t}}oe(ue());const Pt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Tt(e){let t=null,c=null;const g=()=>{clearTimeout(c),c=null,t=null};function m(r){const s=[[]];let l=0;for(;;){const f=r[l];if(!f)break;const v=s[s.length-1];if(f.aborted){var _;(_=f.reject)===null||_===void 0||_.call(f,new Error("Aborted")),l++;continue}if(e.validate(v.concat(f).map(u=>u.key))){v.push(f),l++;continue}if(v.length===0){var h;(h=f.reject)===null||h===void 0||h.call(f,new Error("Input is too big for a single dispatch")),l++;continue}s.push([])}return s}function k(){const r=m(t);g();for(const s of r){if(!s.length)continue;const l={items:s};for(const h of s)h.batch=l;e.fetch(l.items.map(h=>h.key)).then(async h=>{await Promise.all(h.map(async(v,y)=>{const u=l.items[y];try{var n;const i=await Promise.resolve(v);(n=u.resolve)===null||n===void 0||n.call(u,i)}catch(i){var a;(a=u.reject)===null||a===void 0||a.call(u,i)}u.batch=null,u.reject=null,u.resolve=null}));for(const v of l.items){var f;(f=v.reject)===null||f===void 0||f.call(v,new Error("Missing result")),v.batch=null}}).catch(h=>{for(const v of l.items){var f;(f=v.reject)===null||f===void 0||f.call(v,h),v.batch=null}})}}function w(r){var s;const l={aborted:!1,key:r,batch:null,resolve:Pt,reject:Pt},_=new Promise((h,f)=>{var v;l.reject=f,l.resolve=h,(v=t)!==null&&v!==void 0||(t=[]),t.push(l)});return(s=c)!==null&&s!==void 0||(c=setTimeout(k)),_}return{load:w}}function zi(...e){const t=new AbortController,c=e.length;let g=0;const m=()=>{++g===c&&t.abort()};for(const k of e)k?.aborted?m():k?.addEventListener("abort",m,{once:!0});return t.signal}function ji(...e){const t=new AbortController;for(const c of e)c?.aborted?t.abort():c?.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}var Ke=oe(ue());function mr(e){var t,c;const g=Ai(e),m=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,k=(c=e.maxItems)!==null&&c!==void 0?c:1/0;return()=>{const w=_=>({validate(h){if(m===1/0&&k===1/0)return!0;if(h.length>k)return!1;const f=h.map(u=>u.path).join(","),v=h.map(u=>u.input);return vt((0,Ke.default)((0,Ke.default)({},g),{},{type:_,path:f,inputs:v,signal:null})).length<=m},async fetch(h){const f=h.map(i=>i.path).join(","),v=h.map(i=>i.input),y=zi(...h.map(i=>i.signal)),u=await Bi((0,Ke.default)((0,Ke.default)({},g),{},{path:f,inputs:v,type:_,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:h}):e.headers:{}},signal:y}));return(Array.isArray(u.json)?u.json:h.map(()=>u.json)).map(i=>({meta:u.meta,json:i}))}}),r=Tt(w("query")),s=Tt(w("mutation")),l={query:r,mutation:s};return({op:_})=>xe(h=>{/* istanbul ignore if -- @preserve */if(_.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const v=l[_.type].load(_);let y;return v.then(u=>{y=u;const n=ci(u.json,g.transformer.output);if(!n.ok){h.error(me.from(n.error,{meta:u.meta}));return}h.next({context:u.meta,result:n.result}),h.complete()}).catch(u=>{h.error(me.from(u,{meta:y?.meta}))}),()=>{}})}}oe(ue());const Be=(e,...t)=>typeof e=="function"?e(...t):e;oe(we());function $i(){let e,t;return{promise:new Promise((g,m)=>{e=g,t=m}),resolve:e,reject:t}}async function Wi(e){const t=await Be(e.url);if(!e.connectionParams)return t;const g=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+g}async function Ni(e){const t={method:"connectionParams",data:await Be(e)};return JSON.stringify(t)}oe(we());var Se=oe(we());function Ui(e){const{promise:t,resolve:c,reject:g}=$i();return e.addEventListener("open",()=>{e.removeEventListener("error",g),c()}),e.addEventListener("error",g),t}function Zi(e,{intervalMs:t,pongTimeoutMs:c}){let g,m;function k(){g=setTimeout(()=>{e.send("PING"),m=setTimeout(()=>{e.close()},c)},t)}function w(){clearTimeout(g),k()}function r(){clearTimeout(m),w()}e.addEventListener("open",k),e.addEventListener("message",({data:s})=>{clearTimeout(g),k(),s==="PONG"&&r()}),e.addEventListener("close",()=>{clearTimeout(g),clearTimeout(m)})}var qi=class ut{constructor(t){var c;if((0,Se.default)(this,"id",++ut.connectCount),(0,Se.default)(this,"WebSocketPonyfill",void 0),(0,Se.default)(this,"urlOptions",void 0),(0,Se.default)(this,"keepAliveOpts",void 0),(0,Se.default)(this,"wsObservable",rr(null)),(0,Se.default)(this,"openPromise",null),this.WebSocketPonyfill=(c=t.WebSocketPonyfill)!==null&&c!==void 0?c:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++ut.connectCount;const c=Wi(t.urlOptions).then(g=>new t.WebSocketPonyfill(g));t.openPromise=c.then(async g=>{t.ws=g,g.addEventListener("message",function({data:m}){m==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&Zi(g,t.keepAliveOpts),g.addEventListener("close",()=>{t.ws===g&&(t.ws=null)}),await Ui(g),t.urlOptions.connectionParams&&g.send(await Ni(t.urlOptions.connectionParams))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var c;(c=t.ws)===null||c===void 0||c.close()}}};(0,Se.default)(qi,"connectCount",0);oe(we());oe(ue());var ct=oe(we()),Ot=oe(ue()),Ki=class{constructor(e){(0,ct.default)(this,"links",void 0),(0,ct.default)(this,"runtime",void 0),(0,ct.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return ir({links:this.links,op:(0,Ot.default)((0,Ot.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Jr())}async requestAsPromise(e){var t=this;try{const c=t.$request(e);return(await Gr(c)).result.data}catch(c){throw me.from(c)}}query(e,t,c){return this.requestAsPromise({type:"query",path:e,input:t,context:c?.context,signal:c?.signal})}mutation(e,t,c){return this.requestAsPromise({type:"mutation",path:e,input:t,context:c?.context,signal:c?.signal})}subscription(e,t,c){return this.$request({type:"subscription",path:e,input:t,context:c.context,signal:c.signal}).subscribe({next(m){switch(m.result.type){case"state":{var k;(k=c.onConnectionStateChange)===null||k===void 0||k.call(c,m.result);break}case"started":{var w;(w=c.onStarted)===null||w===void 0||w.call(c,{context:m.context});break}case"stopped":{var r;(r=c.onStopped)===null||r===void 0||r.call(c);break}case"data":case void 0:{var s;(s=c.onData)===null||s===void 0||s.call(c,m.result.data);break}}},error(m){var k;(k=c.onError)===null||k===void 0||k.call(c,m)},complete(){var m;(m=c.onComplete)===null||m===void 0||m.call(c)}})}};const Vi=Symbol.for("trpc_untypedClient"),Gi={query:"query",mutate:"mutation",subscribe:"subscription"},Ji=e=>Gi[e];function Yi(e){const t=ii(({path:c,args:g})=>{const m=[...c],k=Ji(m.pop()),w=m.join(".");return e[k](w,...g)});return si(c=>c===Vi?e:t[c])}function br(e){const t=new Ki(e);return Yi(t)}oe(ue());var Bt=oe(ue());function Xi(e,t){return!t||e!=null&&typeof e!="object"?e:(0,Bt.default)((0,Bt.default)({},e??{}),{},{lastEventId:t})}var Qi=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function c(m){var k,w,r,s=2;for(typeof Symbol<"u"&&(w=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(w&&(k=m[w])!=null)return k.call(m);if(r&&(k=m[r])!=null)return new g(k.call(m));w="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function g(m){function k(w){if(Object(w)!==w)return Promise.reject(new TypeError(w+" is not an object."));var r=w.done;return Promise.resolve(w.value).then(function(s){return{value:s,done:r}})}return g=function(r){this.s=r,this.n=r.next},g.prototype={s:null,n:null,next:function(){return k(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):k(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):k(s.apply(this.s,arguments))}},new g(m)}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),es=oe(Qi());async function ts(e){let t=await Be(e.url);if(e.connectionParams){const c=await Be(e.connectionParams),g=t.includes("?")?"&":"?";t+=g+"connectionParams="+encodeURIComponent(JSON.stringify(c))}return t}function Sr(e){const t=vr(e.transformer);return()=>({op:c})=>xe(g=>{var m;const{type:k,path:w,input:r}=c;/* istanbul ignore if -- @preserve */if(k!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let s;const l=new AbortController,_=ji(c.signal,l.signal),h=xi({url:async()=>vt({transformer:t,url:await ts(e),input:Xi(r,s),path:w,type:k,signal:null}),init:()=>Be(e.eventSourceOptions,{op:c}),signal:_,deserialize:t.output.deserialize,EventSource:(m=e.EventSource)!==null&&m!==void 0?m:globalThis.EventSource}),f=rr({type:"state",state:"connecting",error:null}),v=f.subscribe({next(y){g.next({result:y})}});return nr(async()=>{var y=!1,u=!1,n;try{for(var a=(0,es.default)(h),i;y=!(i=await a.next()).done;y=!1){const o=i.value;switch(o.type){case"ping":break;case"data":const d=o.data;let S;d.id?(s=d.id,S={id:d.id,data:d}):S={data:d.data},g.next({result:S,context:{eventSource:o.eventSource}});break;case"connected":{g.next({result:{type:"started"},context:{eventSource:o.eventSource}}),f.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const b=me.from({error:o.error});if(Yr.includes(o.error.code)){f.next({type:"state",state:"connecting",error:b});break}throw b}case"connecting":{const b=f.get(),C=o.event&&me.from(o.event);if(!C&&b.state==="connecting")break;f.next({type:"state",state:"connecting",error:C});break}case"timeout":f.next({type:"state",state:"connecting",error:new me(`Timeout of ${o.ms}ms reached while waiting for a response`)})}}}catch(o){u=!0,n=o}finally{try{y&&a.return!=null&&await a.return()}finally{if(u)throw n}}g.next({result:{type:"stopped"}}),f.next({type:"state",state:"idle",error:null}),g.complete()}).catch(y=>{g.error(me.from(y))}),()=>{g.complete(),l.abort(),v.unsubscribe()}})}oe(ue());var rs=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function c(){var g=typeof SuppressedError=="function"?SuppressedError:function(r,s){var l=Error();return l.name="SuppressedError",l.error=r,l.suppressed=s,l},m={},k=[];function w(r,s){if(s!=null){if(Object(s)!==s)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(r)var l=s[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(l===void 0&&(l=s[Symbol.dispose||Symbol.for("Symbol.dispose")],r))var _=l;if(typeof l!="function")throw new TypeError("Object is not disposable.");_&&(l=function(){try{_.call(s)}catch(f){return Promise.reject(f)}}),k.push({v:s,d:l,a:r})}else r&&k.push({d:s,a:r});return s}return{e:m,u:w.bind(null,!1),a:w.bind(null,!0),d:function(){var s,l=this.e,_=0;function h(){for(;s=k.pop();)try{if(!s.a&&_===1)return _=0,k.push(s),Promise.resolve().then(h);if(s.d){var v=s.d.call(s.v);if(s.a)return _|=2,Promise.resolve(v).then(h,f)}else _|=1}catch(y){return f(y)}if(_===1)return l!==m?Promise.reject(l):Promise.resolve();if(l!==m)throw l}function f(v){return l=l!==m?new g(v,l):v,h()}return h()}}}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),yr=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function c(g,m){this.v=g,this.k=m}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),is=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var c=yr();function g(m){return new c(m,0)}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),ss=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var c=yr();function g(k){return function(){return new m(k.apply(this,arguments))}}function m(k){var w,r;function s(_,h){try{var f=k[_](h),v=f.value,y=v instanceof c;Promise.resolve(y?v.v:v).then(function(u){if(y){var n=_==="return"?"return":"next";if(!v.k||u.done)return s(n,u);u=k[n](u).value}l(f.done?"return":"normal",u)},function(u){s("throw",u)})}catch(u){l("throw",u)}}function l(_,h){switch(_){case"return":w.resolve({value:h,done:!0});break;case"throw":w.reject(h);break;default:w.resolve({value:h,done:!1})}(w=w.next)?s(w.key,w.arg):r=null}this._invoke=function(_,h){return new Promise(function(f,v){var y={key:_,arg:h,resolve:f,reject:v,next:null};r?r=r.next=y:(w=r=y,s(_,h))})},typeof k.return!="function"&&(this.return=void 0)}m.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},m.prototype.next=function(k){return this._invoke("next",k)},m.prototype.throw=function(k){return this._invoke("throw",k)},m.prototype.return=function(k){return this._invoke("return",k)},t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}});oe(rs());oe(is());oe(ss());oe(ue());const ns={version:"1.7.1",latte:{name:"Latte",emoji:"🌻",order:0,dark:!1,colors:{rosewater:{name:"Rosewater",order:0,hex:"#dc8a78",rgb:{r:220,g:138,b:120},hsl:{h:10.799999999999995,s:.5882352941176472,l:.6666666666666667},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#dd7878",rgb:{r:221,g:120,b:120},hsl:{h:0,s:.5976331360946746,l:.6686274509803922},accent:!0},pink:{name:"Pink",order:2,hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},accent:!0},mauve:{name:"Mauve",order:3,hex:"#8839ef",rgb:{r:136,g:57,b:239},hsl:{h:266.0439560439561,s:.8504672897196262,l:.5803921568627451},accent:!0},red:{name:"Red",order:4,hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},accent:!0},maroon:{name:"Maroon",order:5,hex:"#e64553",rgb:{r:230,g:69,b:83},hsl:{h:354.78260869565213,s:.76303317535545,l:.5862745098039216},accent:!0},peach:{name:"Peach",order:6,hex:"#fe640b",rgb:{r:254,g:100,b:11},hsl:{h:21.975308641975307,s:.9918367346938776,l:.5196078431372549},accent:!0},yellow:{name:"Yellow",order:7,hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},accent:!0},green:{name:"Green",order:8,hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},accent:!0},teal:{name:"Teal",order:9,hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},accent:!0},sky:{name:"Sky",order:10,hex:"#04a5e5",rgb:{r:4,g:165,b:229},hsl:{h:197.0666666666667,s:.965665236051502,l:.45686274509803926},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#209fb5",rgb:{r:32,g:159,b:181},hsl:{h:188.85906040268458,s:.6995305164319249,l:.4176470588235294},accent:!0},blue:{name:"Blue",order:12,hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},accent:!0},lavender:{name:"Lavender",order:13,hex:"#7287fd",rgb:{r:114,g:135,b:253},hsl:{h:230.93525179856115,s:.9720279720279721,l:.7196078431372549},accent:!0},text:{name:"Text",order:14,hex:"#4c4f69",rgb:{r:76,g:79,b:105},hsl:{h:233.79310344827587,s:.16022099447513813,l:.3549019607843137},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#7c7f93",rgb:{r:124,g:127,b:147},hsl:{h:232.17391304347825,s:.09623430962343092,l:.5313725490196078},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8c8fa1",rgb:{r:140,g:143,b:161},hsl:{h:231.42857142857144,s:.10047846889952144,l:.5901960784313726},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#9ca0b0",rgb:{r:156,g:160,b:176},hsl:{h:228.00000000000003,s:.11235955056179768,l:.6509803921568628},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#ccd0da",rgb:{r:204,g:208,b:218},hsl:{h:222.85714285714292,s:.1590909090909089,l:.8274509803921568},accent:!1},base:{name:"Base",order:23,hex:"#eff1f5",rgb:{r:239,g:241,b:245},hsl:{h:220.00000000000009,s:.23076923076923136,l:.9490196078431372},accent:!1},mantle:{name:"Mantle",order:24,hex:"#e6e9ef",rgb:{r:230,g:233,b:239},hsl:{h:220.00000000000006,s:.21951219512195116,l:.919607843137255},accent:!1},crust:{name:"Crust",order:25,hex:"#dce0e8",rgb:{r:220,g:224,b:232},hsl:{h:220.00000000000006,s:.20689655172413762,l:.8862745098039215},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},code:0},bright:{name:"Bright Black",hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},code:1},bright:{name:"Bright Red",hex:"#de293e",rgb:{r:222,g:41,b:62},hsl:{h:353.0386740331492,s:.7327935222672065,l:.515686274509804},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},code:2},bright:{name:"Bright Green",hex:"#49af3d",rgb:{r:73,g:175,b:61},hsl:{h:113.68421052631581,s:.48305084745762705,l:.4627450980392157},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},code:3},bright:{name:"Bright Yellow",hex:"#eea02d",rgb:{r:238,g:160,b:45},hsl:{h:35.751295336787564,s:.8502202643171807,l:.5549019607843138},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},code:4},bright:{name:"Bright Blue",hex:"#456eff",rgb:{r:69,g:110,b:255},hsl:{h:226.77419354838707,s:1,l:.6352941176470588},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},code:5},bright:{name:"Bright Magenta",hex:"#fe85d8",rgb:{r:254,g:133,b:216},hsl:{h:318.8429752066116,s:.983739837398374,l:.7588235294117647},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},code:6},bright:{name:"Bright Cyan",hex:"#2d9fa8",rgb:{r:45,g:159,b:168},hsl:{h:184.39024390243904,s:.5774647887323943,l:.4176470588235294},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},code:7},bright:{name:"Bright White",hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},code:15}}}},frappe:{name:"Frappé",emoji:"🪴",order:1,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f2d5cf",rgb:{r:242,g:213,b:207},hsl:{h:10.2857142857143,s:.5737704918032784,l:.8803921568627451},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#eebebe",rgb:{r:238,g:190,b:190},hsl:{h:0,s:.5853658536585367,l:.8392156862745098},accent:!0},pink:{name:"Pink",order:2,hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},accent:!0},mauve:{name:"Mauve",order:3,hex:"#ca9ee6",rgb:{r:202,g:158,b:230},hsl:{h:276.66666666666663,s:.5901639344262294,l:.7607843137254902},accent:!0},red:{name:"Red",order:4,hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ea999c",rgb:{r:234,g:153,b:156},hsl:{h:357.77777777777777,s:.6585365853658534,l:.7588235294117647},accent:!0},peach:{name:"Peach",order:6,hex:"#ef9f76",rgb:{r:239,g:159,b:118},hsl:{h:20.33057851239669,s:.7908496732026143,l:.7},accent:!0},yellow:{name:"Yellow",order:7,hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},accent:!0},green:{name:"Green",order:8,hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},accent:!0},teal:{name:"Teal",order:9,hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},accent:!0},sky:{name:"Sky",order:10,hex:"#99d1db",rgb:{r:153,g:209,b:219},hsl:{h:189.09090909090907,s:.47826086956521735,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#85c1dc",rgb:{r:133,g:193,b:220},hsl:{h:198.62068965517244,s:.5541401273885351,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},accent:!0},lavender:{name:"Lavender",order:13,hex:"#babbf1",rgb:{r:186,g:187,b:241},hsl:{h:238.90909090909093,s:.6626506024096385,l:.8372549019607842},accent:!0},text:{name:"Text",order:14,hex:"#c6d0f5",rgb:{r:198,g:208,b:245},hsl:{h:227.2340425531915,s:.7014925373134333,l:.8686274509803922},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#949cbb",rgb:{r:148,g:156,b:187},hsl:{h:227.69230769230768,s:.22285714285714275,l:.6568627450980392},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#838ba7",rgb:{r:131,g:139,b:167},hsl:{h:226.66666666666669,s:.16981132075471703,l:.584313725490196},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#737994",rgb:{r:115,g:121,b:148},hsl:{h:229.0909090909091,s:.13360323886639683,l:.515686274509804},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#414559",rgb:{r:65,g:69,b:89},hsl:{h:230.00000000000003,s:.15584415584415584,l:.30196078431372547},accent:!1},base:{name:"Base",order:23,hex:"#303446",rgb:{r:48,g:52,b:70},hsl:{h:229.0909090909091,s:.18644067796610175,l:.23137254901960785},accent:!1},mantle:{name:"Mantle",order:24,hex:"#292c3c",rgb:{r:41,g:44,b:60},hsl:{h:230.52631578947367,s:.18811881188118806,l:.19803921568627453},accent:!1},crust:{name:"Crust",order:25,hex:"#232634",rgb:{r:35,g:38,b:52},hsl:{h:229.41176470588238,s:.19540229885057467,l:.17058823529411765},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},code:0},bright:{name:"Bright Black",hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},code:1},bright:{name:"Bright Red",hex:"#e67172",rgb:{r:230,g:113,b:114},hsl:{h:359.4871794871795,s:.7005988023952096,l:.6725490196078432},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},code:2},bright:{name:"Bright Green",hex:"#8ec772",rgb:{r:142,g:199,b:114},hsl:{h:100.23529411764706,s:.431472081218274,l:.6137254901960785},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},code:3},bright:{name:"Bright Yellow",hex:"#d9ba73",rgb:{r:217,g:186,b:115},hsl:{h:41.764705882352935,s:.5730337078651685,l:.6509803921568628},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},code:4},bright:{name:"Bright Blue",hex:"#7b9ef0",rgb:{r:123,g:158,b:240},hsl:{h:222.05128205128207,s:.7959183673469388,l:.711764705882353},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},code:5},bright:{name:"Bright Magenta",hex:"#f2a4db",rgb:{r:242,g:164,b:219},hsl:{h:317.6923076923077,s:.7499999999999998,l:.7960784313725491},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},code:6},bright:{name:"Bright Cyan",hex:"#5abfb5",rgb:{r:90,g:191,b:181},hsl:{h:174.05940594059405,s:.44104803493449785,l:.5509803921568628},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},code:7},bright:{name:"Bright White",hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},code:15}}}},macchiato:{name:"Macchiato",emoji:"🌺",order:2,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f4dbd6",rgb:{r:244,g:219,b:214},hsl:{h:9.999999999999963,s:.5769230769230775,l:.8980392156862745},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f0c6c6",rgb:{r:240,g:198,b:198},hsl:{h:0,s:.5833333333333333,l:.8588235294117648},accent:!0},pink:{name:"Pink",order:2,hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},accent:!0},mauve:{name:"Mauve",order:3,hex:"#c6a0f6",rgb:{r:198,g:160,b:246},hsl:{h:266.51162790697674,s:.8269230769230772,l:.7960784313725491},accent:!0},red:{name:"Red",order:4,hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ee99a0",rgb:{r:238,g:153,b:160},hsl:{h:355.05882352941177,s:.7142857142857143,l:.7666666666666666},accent:!0},peach:{name:"Peach",order:6,hex:"#f5a97f",rgb:{r:245,g:169,b:127},hsl:{h:21.355932203389827,s:.8550724637681162,l:.7294117647058824},accent:!0},yellow:{name:"Yellow",order:7,hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},accent:!0},green:{name:"Green",order:8,hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},accent:!0},teal:{name:"Teal",order:9,hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},accent:!0},sky:{name:"Sky",order:10,hex:"#91d7e3",rgb:{r:145,g:215,b:227},hsl:{h:188.78048780487802,s:.5942028985507245,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#7dc4e4",rgb:{r:125,g:196,b:228},hsl:{h:198.64077669902912,s:.6560509554140128,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b7bdf8",rgb:{r:183,g:189,b:248},hsl:{h:234.46153846153848,s:.8227848101265824,l:.8450980392156863},accent:!0},text:{name:"Text",order:14,hex:"#cad3f5",rgb:{r:202,g:211,b:245},hsl:{h:227.4418604651163,s:.6825396825396831,l:.8764705882352941},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#939ab7",rgb:{r:147,g:154,b:183},hsl:{h:228.33333333333331,s:.2000000000000001,l:.6470588235294117},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8087a2",rgb:{r:128,g:135,b:162},hsl:{h:227.6470588235294,s:.1545454545454545,l:.5686274509803921},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6e738d",rgb:{r:110,g:115,b:141},hsl:{h:230.32258064516128,s:.12350597609561753,l:.49215686274509807},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#363a4f",rgb:{r:54,g:58,b:79},hsl:{h:230.4,s:.1879699248120301,l:.2607843137254902},accent:!1},base:{name:"Base",order:23,hex:"#24273a",rgb:{r:36,g:39,b:58},hsl:{h:231.8181818181818,s:.23404255319148934,l:.1843137254901961},accent:!1},mantle:{name:"Mantle",order:24,hex:"#1e2030",rgb:{r:30,g:32,b:48},hsl:{h:233.33333333333334,s:.23076923076923075,l:.15294117647058825},accent:!1},crust:{name:"Crust",order:25,hex:"#181926",rgb:{r:24,g:25,b:38},hsl:{h:235.71428571428572,s:.22580645161290322,l:.12156862745098039},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},code:0},bright:{name:"Bright Black",hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},code:1},bright:{name:"Bright Red",hex:"#ec7486",rgb:{r:236,g:116,b:134},hsl:{h:351,s:.759493670886076,l:.6901960784313725},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},code:2},bright:{name:"Bright Green",hex:"#8ccf7f",rgb:{r:140,g:207,b:127},hsl:{h:110.24999999999999,s:.45454545454545453,l:.6549019607843137},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},code:3},bright:{name:"Bright Yellow",hex:"#e1c682",rgb:{r:225,g:198,b:130},hsl:{h:42.94736842105264,s:.6129032258064515,l:.696078431372549},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},code:4},bright:{name:"Bright Blue",hex:"#78a1f6",rgb:{r:120,g:161,b:246},hsl:{h:220.47619047619048,s:.8750000000000002,l:.7176470588235294},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},code:5},bright:{name:"Bright Magenta",hex:"#f2a9dd",rgb:{r:242,g:169,b:221},hsl:{h:317.26027397260276,s:.7373737373737372,l:.8058823529411765},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},code:6},bright:{name:"Bright Cyan",hex:"#63cbc0",rgb:{r:99,g:203,b:192},hsl:{h:173.65384615384616,s:.4999999999999998,l:.592156862745098},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},code:7},bright:{name:"Bright White",hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},code:15}}}},mocha:{name:"Mocha",emoji:"🌿",order:3,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f5e0dc",rgb:{r:245,g:224,b:220},hsl:{h:9.599999999999968,s:.555555555555556,l:.911764705882353},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f2cdcd",rgb:{r:242,g:205,b:205},hsl:{h:0,s:.587301587301587,l:.8764705882352941},accent:!0},pink:{name:"Pink",order:2,hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},accent:!0},mauve:{name:"Mauve",order:3,hex:"#cba6f7",rgb:{r:203,g:166,b:247},hsl:{h:267.4074074074074,s:.8350515463917528,l:.8098039215686275},accent:!0},red:{name:"Red",order:4,hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},accent:!0},maroon:{name:"Maroon",order:5,hex:"#eba0ac",rgb:{r:235,g:160,b:172},hsl:{h:350.4,s:.6521739130434779,l:.7745098039215685},accent:!0},peach:{name:"Peach",order:6,hex:"#fab387",rgb:{r:250,g:179,b:135},hsl:{h:22.95652173913043,s:.92,l:.7549019607843137},accent:!0},yellow:{name:"Yellow",order:7,hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},accent:!0},green:{name:"Green",order:8,hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},accent:!0},teal:{name:"Teal",order:9,hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},accent:!0},sky:{name:"Sky",order:10,hex:"#89dceb",rgb:{r:137,g:220,b:235},hsl:{h:189.18367346938774,s:.7101449275362316,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#74c7ec",rgb:{r:116,g:199,b:236},hsl:{h:198.5,s:.759493670886076,l:.6901960784313725},accent:!0},blue:{name:"Blue",order:12,hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b4befe",rgb:{r:180,g:190,b:254},hsl:{h:231.89189189189187,s:.9736842105263159,l:.8509803921568628},accent:!0},text:{name:"Text",order:14,hex:"#cdd6f4",rgb:{r:205,g:214,b:244},hsl:{h:226.15384615384616,s:.6393442622950825,l:.8803921568627451},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#9399b2",rgb:{r:147,g:153,b:178},hsl:{h:228.38709677419354,s:.16756756756756758,l:.6372549019607843},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#7f849c",rgb:{r:127,g:132,b:156},hsl:{h:229.65517241379308,s:.12775330396475776,l:.5549019607843138},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6c7086",rgb:{r:108,g:112,b:134},hsl:{h:230.7692307692308,s:.10743801652892565,l:.4745098039215686},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#313244",rgb:{r:49,g:50,b:68},hsl:{h:236.84210526315792,s:.16239316239316234,l:.22941176470588237},accent:!1},base:{name:"Base",order:23,hex:"#1e1e2e",rgb:{r:30,g:30,b:46},hsl:{h:240,s:.21052631578947367,l:.14901960784313725},accent:!1},mantle:{name:"Mantle",order:24,hex:"#181825",rgb:{r:24,g:24,b:37},hsl:{h:240,s:.2131147540983607,l:.11960784313725491},accent:!1},crust:{name:"Crust",order:25,hex:"#11111b",rgb:{r:17,g:17,b:27},hsl:{h:240,s:.22727272727272727,l:.08627450980392157},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},code:0},bright:{name:"Bright Black",hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},code:1},bright:{name:"Bright Red",hex:"#f37799",rgb:{r:243,g:119,b:153},hsl:{h:343.54838709677415,s:.8378378378378376,l:.7098039215686274},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},code:2},bright:{name:"Bright Green",hex:"#89d88b",rgb:{r:137,g:216,b:139},hsl:{h:121.51898734177213,s:.5031847133757963,l:.692156862745098},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},code:3},bright:{name:"Bright Yellow",hex:"#ebd391",rgb:{r:235,g:211,b:145},hsl:{h:44,s:.692307692307692,l:.7450980392156863},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},code:4},bright:{name:"Bright Blue",hex:"#74a8fc",rgb:{r:116,g:168,b:252},hsl:{h:217.05882352941174,s:.9577464788732396,l:.7215686274509804},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},code:5},bright:{name:"Bright Magenta",hex:"#f2aede",rgb:{r:242,g:174,b:222},hsl:{h:317.6470588235294,s:.7234042553191488,l:.8156862745098039},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},code:6},bright:{name:"Bright Cyan",hex:"#6bd7ca",rgb:{r:107,g:215,b:202},hsl:{h:172.77777777777777,s:.5744680851063831,l:.6313725490196078},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},code:7},bright:{name:"Bright White",hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},code:15}}}}},Xe=e=>Object.entries(e),{version:Ma,...os}=ns,Cr=Xe(os).reduce((e,[t,c])=>(e[t]={...c,colorEntries:Xe(c.colors),ansiColorEntries:Xe(c.ansiColors)},e),{});Xe(Cr);var ht={exports:{}},It;function as(){return It||(It=1,function(e,t){(function(c,g){e.exports=g()})(self,()=>(()=>{var c={};return(()=>{var g=c;Object.defineProperty(g,"__esModule",{value:!0}),g.FitAddon=void 0,g.FitAddon=class{activate(m){this._terminal=m}dispose(){}fit(){const m=this.proposeDimensions();if(!m||!this._terminal||isNaN(m.cols)||isNaN(m.rows))return;const k=this._terminal._core;this._terminal.rows===m.rows&&this._terminal.cols===m.cols||(k._renderService.clear(),this._terminal.resize(m.cols,m.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const m=this._terminal._core,k=m._renderService.dimensions;if(k.css.cell.width===0||k.css.cell.height===0)return;const w=this._terminal.options.scrollback===0?0:m.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),h=s-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),f=l-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-w;return{cols:Math.max(2,Math.floor(f/k.css.cell.width)),rows:Math.max(1,Math.floor(h/k.css.cell.height))}}}})(),c})())}(ht)),ht.exports}var cs=as(),lt={exports:{}},Mt;function hs(){return Mt||(Mt=1,function(e,t){(function(c,g){e.exports=g()})(globalThis,()=>(()=>{var c={4567:function(w,r,s){var l=this&&this.__decorate||function(i,o,d,S){var b,C=arguments.length,p=C<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,d,S);else for(var E=i.length-1;E>=0;E--)(b=i[E])&&(p=(C<3?b(p):C>3?b(o,d,p):b(o,d))||p);return C>3&&p&&Object.defineProperty(o,d,p),p},_=this&&this.__param||function(i,o){return function(d,S){o(d,S,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const h=s(9042),f=s(9924),v=s(844),y=s(4725),u=s(2585),n=s(3656);let a=r.AccessibilityManager=class extends v.Disposable{constructor(i,o,d,S){super(),this._terminal=i,this._coreBrowserService=d,this._renderService=S,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 b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,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 f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(b=>this._handleResize(b.rows))),this.register(this._terminal.onRender(b=>this._refreshRows(b.start,b.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(b=>this._handleChar(b))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))g(m);new MutationObserver(m=>{for(const k of m)if(k.type==="childList")for(const w of k.addedNodes)w.tagName==="LINK"&&w.rel==="modulepreload"&&g(w)}).observe(document,{childList:!0,subtree:!0});function c(m){const k={};return m.integrity&&(k.integrity=m.integrity),m.referrerPolicy&&(k.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?k.credentials="include":m.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function g(m){if(m.ep)return;m.ep=!0;const k=c(m);fetch(m.href,k)}})();var Nr=Object.create,tr=Object.defineProperty,Ur=Object.getOwnPropertyDescriptor,rr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,qr=Object.prototype.hasOwnProperty,_e=(e,t)=>function(){return t||(0,e[rr(e)[0]])((t={exports:{}}).exports,t),t.exports},Kr=(e,t,c,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(var m=rr(t),k=0,w=m.length,r;k<w;k++)r=m[k],!qr.call(e,r)&&r!==c&&tr(e,r,{get:(s=>t[s]).bind(null,r),enumerable:!(g=Ur(t,r))||g.enumerable});return e},oe=(e,t,c)=>(c=e!=null?Nr(Zr(e)):{},Kr(tr(c,"default",{value:e,enumerable:!0}),e)),ir=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function c(g){"@babel/helpers - typeof";return t.exports=c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},t.exports.__esModule=!0,t.exports.default=t.exports,c(g)}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),Vr=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var c=ir().default;function g(m,k){if(c(m)!="object"||!m)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var r=w.call(m,k||"default");if(c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(m)}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),Gr=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var c=ir().default,g=Vr();function m(k){var w=g(k,"string");return c(w)=="symbol"?w:w+""}t.exports=m,t.exports.__esModule=!0,t.exports.default=t.exports}}),we=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var c=Gr();function g(m,k,w){return(k=c(k))in m?Object.defineProperty(m,k,{value:w,enumerable:!0,configurable:!0,writable:!0}):m[k]=w,m}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),ue=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var c=we();function g(k,w){var r=Object.keys(k);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(k);w&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(k,l).enumerable})),r.push.apply(r,s)}return r}function m(k){for(var w=1;w<arguments.length;w++){var r=arguments[w]!=null?arguments[w]:{};w%2?g(Object(r),!0).forEach(function(s){c(k,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(s){Object.defineProperty(k,s,Object.getOwnPropertyDescriptor(r,s))})}return k}t.exports=m,t.exports.__esModule=!0,t.exports.default=t.exports}});function xe(e){const t={subscribe(c){let g=null,m=!1,k=!1,w=!1;function r(){if(g===null){w=!0;return}k||(k=!0,typeof g=="function"?g():g&&g.unsubscribe())}return g=e({next(s){var l;m||(l=c.next)===null||l===void 0||l.call(c,s)},error(s){var l;m||(m=!0,(l=c.error)===null||l===void 0||l.call(c,s),r())},complete(){var s;m||(m=!0,(s=c.complete)===null||s===void 0||s.call(c),r())}}),w&&r(),{unsubscribe:r}},pipe(...c){return c.reduce(Jr,t)}};return t}function Jr(e,t){return t(e)}function Yr(e){const t=new AbortController;return new Promise((g,m)=>{let k=!1;function w(){k||(k=!0,r.unsubscribe())}t.signal.addEventListener("abort",()=>{m(t.signal.reason)});const r=e.subscribe({next(s){k=!0,g(s),w()},error(s){m(s)},complete(){t.abort(),w()}})})}function Xr(e){return t=>{let c=0,g=null;const m=[];function k(){g||(g=t.subscribe({next(r){for(const l of m){var s;(s=l.next)===null||s===void 0||s.call(l,r)}},error(r){for(const l of m){var s;(s=l.error)===null||s===void 0||s.call(l,r)}},complete(){for(const s of m){var r;(r=s.complete)===null||r===void 0||r.call(s)}}}))}function w(){if(c===0&&g){const r=g;g=null,r.unsubscribe()}}return xe(r=>(c++,m.push(r),k(),{unsubscribe(){c--,w();const s=m.findIndex(l=>l===r);s>-1&&m.splice(s,1)}}))}}function sr(e){let t=e;const c=[],g=w=>{t!==void 0&&w.next(t),c.push(w)},m=w=>{c.splice(c.indexOf(w),1)},k=xe(w=>(g(w),()=>{m(w)}));return k.next=w=>{if(t!==w){t=w;for(const r of c)r.next(w)}},k.get=()=>t,k}function nr(e){return xe(t=>{function c(m=0,k=e.op){const w=e.links[m];if(!w)throw new Error("No more links to execute - did you forget to add an ending link?");return w({op:k,next(s){return c(m+1,s)}})}return c().subscribe(t)})}function wt(e){return Array.isArray(e)?e:[e]}function or(e){return t=>{const c=wt(e.true).map(m=>m(t)),g=wt(e.false).map(m=>m(t));return m=>xe(k=>{const w=e.condition(m.op)?c:g;return nr({op:m.op,links:w}).subscribe(k)})}}const Ne={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603},Qr=[Ne.BAD_GATEWAY,Ne.SERVICE_UNAVAILABLE,Ne.GATEWAY_TIMEOUT,Ne.INTERNAL_SERVER_ERROR];function Oe(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const ar=e=>e();var ei=Object.create,cr=Object.defineProperty,ti=Object.getOwnPropertyDescriptor,hr=Object.getOwnPropertyNames,ri=Object.getPrototypeOf,ii=Object.prototype.hasOwnProperty,de=(e,t)=>function(){return t||(0,e[hr(e)[0]])((t={exports:{}}).exports,t),t.exports},si=(e,t,c,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(var m=hr(t),k=0,w=m.length,r;k<w;k++)r=m[k],!ii.call(e,r)&&r!==c&&cr(e,r,{get:(s=>t[s]).bind(null,r),enumerable:!(g=ti(t,r))||g.enumerable});return e},Q=(e,t,c)=>(c=e!=null?ei(ri(e)):{},si(cr(c,"default",{value:e,enumerable:!0}),e));const lr=()=>{},Et=e=>{Object.freeze&&Object.freeze(e)};function ur(e,t,c){var g;const m=t.join(".");return(g=c[m])!==null&&g!==void 0||(c[m]=new Proxy(lr,{get(k,w){if(!(typeof w!="string"||w==="then"))return ur(e,[...t,w],c)},apply(k,w,r){const s=t[t.length-1];let l={args:r,path:t};return s==="call"?l={args:r.length>=2?[r[1]]:[],path:t.slice(0,-1)}:s==="apply"&&(l={args:r.length>=2?r[1]:[],path:t.slice(0,-1)}),Et(l.args),Et(l.path),e(l)}})),c[m]}const ni=e=>ur(e,[],Object.create(null)),oi=e=>new Proxy(lr,{get(t,c){if(c!=="then")return e(c)}});var dr=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function c(g){"@babel/helpers - typeof";return t.exports=c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},t.exports.__esModule=!0,t.exports.default=t.exports,c(g)}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),ai=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var c=dr().default;function g(m,k){if(c(m)!="object"||!m)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var r=w.call(m,k||"default");if(c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(m)}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),ci=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var c=dr().default,g=ai();function m(k){var w=g(k,"string");return c(w)=="symbol"?w:w+""}t.exports=m,t.exports.__esModule=!0,t.exports.default=t.exports}}),_t=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var c=ci();function g(m,k,w){return(k=c(k))in m?Object.defineProperty(m,k,{value:w,enumerable:!0,configurable:!0,writable:!0}):m[k]=w,m}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),He=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var c=_t();function g(k,w){var r=Object.keys(k);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(k);w&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(k,l).enumerable})),r.push.apply(r,s)}return r}function m(k){for(var w=1;w<arguments.length;w++){var r=arguments[w]!=null?arguments[w]:{};w%2?g(Object(r),!0).forEach(function(s){c(k,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(s){Object.defineProperty(k,s,Object.getOwnPropertyDescriptor(r,s))})}return k}t.exports=m,t.exports.__esModule=!0,t.exports.default=t.exports}});Q(He());Q(_t());var Ue=Q(He());function hi(e,t){if("error"in e){const g=t.deserialize(e.error);return{ok:!1,error:(0,Ue.default)((0,Ue.default)({},e),{},{error:g})}}return{ok:!0,result:(0,Ue.default)((0,Ue.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var ot=class extends Error{constructor(){super("Unable to transform response from server")}};function li(e,t){let c;try{c=hi(e,t)}catch{throw new ot}if(!c.ok&&(!Oe(c.error.error)||typeof c.error.error.code!="number"))throw new ot;if(c.ok&&!Oe(c.result))throw new ot;return c}Q(He());Q(He());var Ze=Q(_t());let fr;const at=new WeakMap,ui=()=>{};fr=Symbol.toStringTag;var _r=class be{constructor(t){(0,Ze.default)(this,"promise",void 0),(0,Ze.default)(this,"subscribers",[]),(0,Ze.default)(this,"settlement",null),(0,Ze.default)(this,fr,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const c=this.promise.then(g=>{const{subscribers:m}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:g},m?.forEach(({resolve:k})=>{k(g)})});"catch"in c&&c.catch(g=>{const{subscribers:m}=this;this.subscribers=null,this.settlement={status:"rejected",reason:g},m?.forEach(({reject:k})=>{k(g)})})}subscribe(){let t,c;const{settlement:g}=this;if(g===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const m=fi();this.subscribers=_i(this.subscribers,m),t=m.promise,c=()=>{this.subscribers!==null&&(this.subscribers=vi(this.subscribers,m))}}else{const{status:m}=g;m==="fulfilled"?t=Promise.resolve(g.value):t=Promise.reject(g.reason),c=ui}return Object.assign(t,{unsubscribe:c})}then(t,c){const g=this.subscribe(),{unsubscribe:m}=g;return Object.assign(g.then(t,c),{unsubscribe:m})}catch(t){const c=this.subscribe(),{unsubscribe:g}=c;return Object.assign(c.catch(t),{unsubscribe:g})}finally(t){const c=this.subscribe(),{unsubscribe:g}=c;return Object.assign(c.finally(t),{unsubscribe:g})}static proxy(t){const c=be.getSubscribablePromise(t);return typeof c<"u"?c:be.createSubscribablePromise(t)}static createSubscribablePromise(t){const c=new be(t);return at.set(t,c),at.set(c,c),c}static getSubscribablePromise(t){return at.get(t)}static resolve(t){const c=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return be.proxy(c).subscribe()}static async any(t){const g=(Array.isArray(t)?t:[...t]).map(be.resolve);try{return await Promise.any(g)}finally{g.forEach(({unsubscribe:m})=>{m()})}}static async race(t){const g=(Array.isArray(t)?t:[...t]).map(be.resolve);try{return await Promise.race(g)}finally{g.forEach(({unsubscribe:m})=>{m()})}}static async raceReferences(t){const c=t.map(di);try{return await Promise.race(c)}finally{for(const g of c)g.unsubscribe()}}};function di(e){return _r.proxy(e).then(()=>[e])}function fi(){let e,t;return{promise:new Promise((g,m)=>{e=g,t=m}),resolve:e,reject:t}}function _i(e,t){return[...e,t]}function pi(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function vi(e,t){const c=e.indexOf(t);return c!==-1?pi(e,c):e}var xt,kt,Rt,Dt;(kt=(xt=Symbol).dispose)!==null&&kt!==void 0||(xt.dispose=Symbol());(Dt=(Rt=Symbol).asyncDispose)!==null&&Dt!==void 0||(Rt.asyncDispose=Symbol());function gi(e,t){const c=e,g=c[Symbol.dispose];return c[Symbol.dispose]=()=>{t(),g?.()},c}function mi(e,t){const c=e,g=c[Symbol.asyncDispose];return c[Symbol.asyncDispose]=async()=>{await t(),await g?.()},c}const pr=Symbol();function bi(e){let t=null;return gi({start(){if(t)throw new Error("Timer already started");return new Promise(g=>{t=setTimeout(()=>g(pr),e)})}},()=>{t&&clearTimeout(t)})}var Fe=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function c(){var g=typeof SuppressedError=="function"?SuppressedError:function(r,s){var l=Error();return l.name="SuppressedError",l.error=r,l.suppressed=s,l},m={},k=[];function w(r,s){if(s!=null){if(Object(s)!==s)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(r)var l=s[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(l===void 0&&(l=s[Symbol.dispose||Symbol.for("Symbol.dispose")],r))var _=l;if(typeof l!="function")throw new TypeError("Object is not disposable.");_&&(l=function(){try{_.call(s)}catch(f){return Promise.reject(f)}}),k.push({v:s,d:l,a:r})}else r&&k.push({d:s,a:r});return s}return{e:m,u:w.bind(null,!1),a:w.bind(null,!0),d:function(){var s,l=this.e,_=0;function h(){for(;s=k.pop();)try{if(!s.a&&_===1)return _=0,k.push(s),Promise.resolve().then(h);if(s.d){var v=s.d.call(s.v);if(s.a)return _|=2,Promise.resolve(v).then(h,f)}else _|=1}catch(y){return f(y)}if(_===1)return l!==m?Promise.reject(l):Promise.resolve();if(l!==m)throw l}function f(v){return l=l!==m?new g(v,l):v,h()}return h()}}}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),pt=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function c(g,m){this.v=g,this.k=m}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),ze=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var c=pt();function g(m){return new c(m,0)}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),ke=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var c=pt();function g(k){return function(){return new m(k.apply(this,arguments))}}function m(k){var w,r;function s(_,h){try{var f=k[_](h),v=f.value,y=v instanceof c;Promise.resolve(y?v.v:v).then(function(u){if(y){var n=_==="return"?"return":"next";if(!v.k||u.done)return s(n,u);u=k[n](u).value}l(f.done?"return":"normal",u)},function(u){s("throw",u)})}catch(u){l("throw",u)}}function l(_,h){switch(_){case"return":w.resolve({value:h,done:!0});break;case"throw":w.reject(h);break;default:w.resolve({value:h,done:!1})}(w=w.next)?s(w.key,w.arg):r=null}this._invoke=function(_,h){return new Promise(function(f,v){var y={key:_,arg:h,resolve:f,reject:v,next:null};r?r=r.next=y:(w=r=y,s(_,h))})},typeof k.return!="function"&&(this.return=void 0)}m.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},m.prototype.next=function(k){return this._invoke("next",k)},m.prototype.throw=function(k){return this._invoke("throw",k)},m.prototype.return=function(k){return this._invoke("return",k)},t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}});Q(Fe());Q(ze());Q(ke());Q(Fe());Q(ze());Q(ke());Q(Fe());Q(ze());Q(ke());var vr=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function c(m){var k,w,r,s=2;for(typeof Symbol<"u"&&(w=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(w&&(k=m[w])!=null)return k.call(m);if(r&&(k=m[r])!=null)return new g(k.call(m));w="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function g(m){function k(w){if(Object(w)!==w)return Promise.reject(new TypeError(w+" is not an object."));var r=w.done;return Promise.resolve(w.value).then(function(s){return{value:s,done:r}})}return g=function(r){this.s=r,this.n=r.next},g.prototype={s:null,n:null,next:function(){return k(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):k(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):k(s.apply(this.s,arguments))}},new g(m)}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}});Q(ze());Q(ke());Q(Fe());Q(vr());var Si=de({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js"(e,t){var c=pt();function g(m){var k={},w=!1;function r(s,l){return w=!0,l=new Promise(function(_){_(m[s](l))}),{done:!1,value:new c(l,1)}}return k[typeof Symbol<"u"&&Symbol.iterator||"@@iterator"]=function(){return this},k.next=function(s){return w?(w=!1,s):r("next",s)},typeof m.throw=="function"&&(k.throw=function(s){if(w)throw w=!1,s;return r("throw",s)}),typeof m.return=="function"&&(k.return=function(s){return w?(w=!1,s):r("return",s)}),k}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}});Q(vr());var Lt=Q(ze()),yi=Q(ke());Q(Si());var gr=Q(Fe());const Ci="ping",wi="serialized-error",Ei="connected",xi="return";async function ki(e){try{var t=(0,gr.default)();const c=t.u(bi(e.timeoutMs)),g=await _r.race([e.promise,c.start()]);return g===pr?await e.onTimeout():g}catch(c){t.e=c}finally{t.d()}}function Ri(e){const{deserialize:t=r=>r}=e;let c={};const g=e.signal;let m=null;const k=()=>new ReadableStream({async start(r){const[s,l]=await Promise.all([e.url(),e.init()]),_=m=new e.EventSource(s,l);r.enqueue({type:"connecting",eventSource:m,event:null}),_.addEventListener(Ei,f=>{const y=JSON.parse(f.data);c=y,r.enqueue({type:"connected",options:y,eventSource:_})}),_.addEventListener(wi,f=>{const v=f;r.enqueue({type:"serialized-error",error:t(JSON.parse(v.data)),eventSource:_})}),_.addEventListener(Ci,()=>{r.enqueue({type:"ping",eventSource:_})}),_.addEventListener(xi,()=>{_.close(),r.close(),m=null}),_.addEventListener("error",f=>{_.readyState===_.CLOSED?r.error(f):r.enqueue({type:"connecting",eventSource:_,event:f})}),_.addEventListener("message",f=>{const v=f,u={data:t(JSON.parse(v.data))};v.lastEventId&&(u.id=v.lastEventId),r.enqueue({type:"data",data:u,eventSource:_})});const h=()=>{try{_.close(),r.close()}catch{}};g.aborted?h():g.addEventListener("abort",h)},cancel(){m?.close()}}),w=()=>{let r=k(),s=r.getReader();async function l(){await s.cancel(),m=null}return mi({read(){return s.read()},async recreate(){await l(),r=k(),s=r.getReader()}},l)};return ar((0,yi.default)(function*(){try{var r=(0,gr.default)();const s=r.a(w());for(;;){let l=s.read();const _=c.reconnectAfterInactivityMs;_&&(l=ki({promise:l,timeoutMs:_,onTimeout:async()=>{const f={value:{type:"timeout",ms:_,eventSource:m},done:!1};return await s.recreate(),f}}));const h=yield(0,Lt.default)(l);if(h.done)return h.value;yield h.value}}catch(s){r.e=s}finally{yield(0,Lt.default)(r.d())}}))}Q(ke());Q(He());var qe=oe(we()),Ee=oe(ue());function Di(e){return e instanceof me}function Li(e){return Oe(e)&&Oe(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Ai(e,t){return typeof e=="string"?e:Oe(e)&&typeof e.message=="string"?e.message:t}var me=class Ye extends Error{constructor(t,c){var g,m;const k=c?.cause;super(t,{cause:k}),(0,qe.default)(this,"cause",void 0),(0,qe.default)(this,"shape",void 0),(0,qe.default)(this,"data",void 0),(0,qe.default)(this,"meta",void 0),this.meta=c?.meta,this.cause=k,this.shape=c==null||(g=c.result)===null||g===void 0?void 0:g.error,this.data=c==null||(m=c.result)===null||m===void 0?void 0:m.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ye.prototype)}static from(t,c={}){const g=t;return Di(g)?(c.meta&&(g.meta=(0,Ee.default)((0,Ee.default)({},g.meta),c.meta)),g):Li(g)?new Ye(g.error.message,(0,Ee.default)((0,Ee.default)({},c),{},{result:g})):new Ye(Ai(g,"Unknown error"),(0,Ee.default)((0,Ee.default)({},c),{},{cause:g}))}};function mr(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:c=>c,deserialize:c=>c},output:{serialize:c=>c,deserialize:c=>c}}}const At=e=>typeof e=="function";function Pi(e){if(e)return e;if(typeof window<"u"&&At(window.fetch))return window.fetch;if(typeof globalThis<"u"&&At(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Pe=oe(ue());function Ti(e){return{url:e.url.toString(),fetch:e.fetch,transformer:mr(e.transformer),methodOverride:e.methodOverride}}function Oi(e){const t={};for(let c=0;c<e.length;c++){const g=e[c];t[c]=g}return t}const Bi={query:"GET",mutation:"POST",subscription:"PATCH"};function br(e){return"input"in e?e.transformer.input.serialize(e.input):Oi(e.inputs.map(t=>e.transformer.input.serialize(t)))}const vt=e=>{const t=e.url.split("?");let g=t[0].replace(/\/$/,"")+"/"+e.path;const m=[];if(t[1]&&m.push(t[1]),"inputs"in e&&m.push("batch=1"),e.type==="query"||e.type==="subscription"){const k=br(e);k!==void 0&&e.methodOverride!=="POST"&&m.push(`input=${encodeURIComponent(JSON.stringify(k))}`)}return m.length&&(g+="?"+m.join("&")),g},Ii=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=br(e);return t!==void 0?JSON.stringify(t):void 0},Mi=e=>ji((0,Pe.default)((0,Pe.default)({},e),{},{contentTypeHeader:"application/json",getUrl:vt,getBody:Ii}));var Hi=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Fi=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Hi};async function zi(e){var t;Fi(e.signal);const c=e.getUrl(e),g=e.getBody(e),{type:m}=e,k=await(async()=>{const r=await e.headers();return Symbol.iterator in r?Object.fromEntries(r):r})(),w=(0,Pe.default)((0,Pe.default)((0,Pe.default)({},e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0),k);return Pi(e.fetch)(c,{method:(t=e.methodOverride)!==null&&t!==void 0?t:Bi[m],signal:e.signal,body:g,headers:w})}async function ji(e){const t={},c=await zi(e);t.response=c;const g=await c.json();return t.responseJSON=g,{json:g,meta:t}}oe(ue());const Pt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Tt(e){let t=null,c=null;const g=()=>{clearTimeout(c),c=null,t=null};function m(r){const s=[[]];let l=0;for(;;){const f=r[l];if(!f)break;const v=s[s.length-1];if(f.aborted){var _;(_=f.reject)===null||_===void 0||_.call(f,new Error("Aborted")),l++;continue}if(e.validate(v.concat(f).map(u=>u.key))){v.push(f),l++;continue}if(v.length===0){var h;(h=f.reject)===null||h===void 0||h.call(f,new Error("Input is too big for a single dispatch")),l++;continue}s.push([])}return s}function k(){const r=m(t);g();for(const s of r){if(!s.length)continue;const l={items:s};for(const h of s)h.batch=l;e.fetch(l.items.map(h=>h.key)).then(async h=>{await Promise.all(h.map(async(v,y)=>{const u=l.items[y];try{var n;const i=await Promise.resolve(v);(n=u.resolve)===null||n===void 0||n.call(u,i)}catch(i){var a;(a=u.reject)===null||a===void 0||a.call(u,i)}u.batch=null,u.reject=null,u.resolve=null}));for(const v of l.items){var f;(f=v.reject)===null||f===void 0||f.call(v,new Error("Missing result")),v.batch=null}}).catch(h=>{for(const v of l.items){var f;(f=v.reject)===null||f===void 0||f.call(v,h),v.batch=null}})}}function w(r){var s;const l={aborted:!1,key:r,batch:null,resolve:Pt,reject:Pt},_=new Promise((h,f)=>{var v;l.reject=f,l.resolve=h,(v=t)!==null&&v!==void 0||(t=[]),t.push(l)});return(s=c)!==null&&s!==void 0||(c=setTimeout(k)),_}return{load:w}}function $i(...e){const t=new AbortController,c=e.length;let g=0;const m=()=>{++g===c&&t.abort()};for(const k of e)k?.aborted?m():k?.addEventListener("abort",m,{once:!0});return t.signal}function Wi(...e){const t=new AbortController;for(const c of e)c?.aborted?t.abort():c?.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}var Ke=oe(ue());function Sr(e){var t,c;const g=Ti(e),m=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,k=(c=e.maxItems)!==null&&c!==void 0?c:1/0;return()=>{const w=_=>({validate(h){if(m===1/0&&k===1/0)return!0;if(h.length>k)return!1;const f=h.map(u=>u.path).join(","),v=h.map(u=>u.input);return vt((0,Ke.default)((0,Ke.default)({},g),{},{type:_,path:f,inputs:v,signal:null})).length<=m},async fetch(h){const f=h.map(i=>i.path).join(","),v=h.map(i=>i.input),y=$i(...h.map(i=>i.signal)),u=await Mi((0,Ke.default)((0,Ke.default)({},g),{},{path:f,inputs:v,type:_,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:h}):e.headers:{}},signal:y}));return(Array.isArray(u.json)?u.json:h.map(()=>u.json)).map(i=>({meta:u.meta,json:i}))}}),r=Tt(w("query")),s=Tt(w("mutation")),l={query:r,mutation:s};return({op:_})=>xe(h=>{/* istanbul ignore if -- @preserve */if(_.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const v=l[_.type].load(_);let y;return v.then(u=>{y=u;const n=li(u.json,g.transformer.output);if(!n.ok){h.error(me.from(n.error,{meta:u.meta}));return}h.next({context:u.meta,result:n.result}),h.complete()}).catch(u=>{h.error(me.from(u,{meta:y?.meta}))}),()=>{}})}}oe(ue());const Be=(e,...t)=>typeof e=="function"?e(...t):e;oe(we());function Ni(){let e,t;return{promise:new Promise((g,m)=>{e=g,t=m}),resolve:e,reject:t}}async function Ui(e){const t=await Be(e.url);if(!e.connectionParams)return t;const g=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+g}async function Zi(e){const t={method:"connectionParams",data:await Be(e)};return JSON.stringify(t)}oe(we());var Se=oe(we());function qi(e){const{promise:t,resolve:c,reject:g}=Ni();return e.addEventListener("open",()=>{e.removeEventListener("error",g),c()}),e.addEventListener("error",g),t}function Ki(e,{intervalMs:t,pongTimeoutMs:c}){let g,m;function k(){g=setTimeout(()=>{e.send("PING"),m=setTimeout(()=>{e.close()},c)},t)}function w(){clearTimeout(g),k()}function r(){clearTimeout(m),w()}e.addEventListener("open",k),e.addEventListener("message",({data:s})=>{clearTimeout(g),k(),s==="PONG"&&r()}),e.addEventListener("close",()=>{clearTimeout(g),clearTimeout(m)})}var Vi=class ut{constructor(t){var c;if((0,Se.default)(this,"id",++ut.connectCount),(0,Se.default)(this,"WebSocketPonyfill",void 0),(0,Se.default)(this,"urlOptions",void 0),(0,Se.default)(this,"keepAliveOpts",void 0),(0,Se.default)(this,"wsObservable",sr(null)),(0,Se.default)(this,"openPromise",null),this.WebSocketPonyfill=(c=t.WebSocketPonyfill)!==null&&c!==void 0?c:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++ut.connectCount;const c=Ui(t.urlOptions).then(g=>new t.WebSocketPonyfill(g));t.openPromise=c.then(async g=>{t.ws=g,g.addEventListener("message",function({data:m}){m==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&Ki(g,t.keepAliveOpts),g.addEventListener("close",()=>{t.ws===g&&(t.ws=null)}),await qi(g),t.urlOptions.connectionParams&&g.send(await Zi(t.urlOptions.connectionParams))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var c;(c=t.ws)===null||c===void 0||c.close()}}};(0,Se.default)(Vi,"connectCount",0);oe(we());oe(ue());var ct=oe(we()),Ot=oe(ue()),Gi=class{constructor(e){(0,ct.default)(this,"links",void 0),(0,ct.default)(this,"runtime",void 0),(0,ct.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return nr({links:this.links,op:(0,Ot.default)((0,Ot.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Xr())}async requestAsPromise(e){var t=this;try{const c=t.$request(e);return(await Yr(c)).result.data}catch(c){throw me.from(c)}}query(e,t,c){return this.requestAsPromise({type:"query",path:e,input:t,context:c?.context,signal:c?.signal})}mutation(e,t,c){return this.requestAsPromise({type:"mutation",path:e,input:t,context:c?.context,signal:c?.signal})}subscription(e,t,c){return this.$request({type:"subscription",path:e,input:t,context:c.context,signal:c.signal}).subscribe({next(m){switch(m.result.type){case"state":{var k;(k=c.onConnectionStateChange)===null||k===void 0||k.call(c,m.result);break}case"started":{var w;(w=c.onStarted)===null||w===void 0||w.call(c,{context:m.context});break}case"stopped":{var r;(r=c.onStopped)===null||r===void 0||r.call(c);break}case"data":case void 0:{var s;(s=c.onData)===null||s===void 0||s.call(c,m.result.data);break}}},error(m){var k;(k=c.onError)===null||k===void 0||k.call(c,m)},complete(){var m;(m=c.onComplete)===null||m===void 0||m.call(c)}})}};const Ji=Symbol.for("trpc_untypedClient"),Yi={query:"query",mutate:"mutation",subscribe:"subscription"},Xi=e=>Yi[e];function Qi(e){const t=ni(({path:c,args:g})=>{const m=[...c],k=Xi(m.pop()),w=m.join(".");return e[k](w,...g)});return oi(c=>c===Ji?e:t[c])}function yr(e){const t=new Gi(e);return Qi(t)}oe(ue());var Bt=oe(ue());function es(e,t){return!t||e!=null&&typeof e!="object"?e:(0,Bt.default)((0,Bt.default)({},e??{}),{},{lastEventId:t})}var ts=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function c(m){var k,w,r,s=2;for(typeof Symbol<"u"&&(w=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(w&&(k=m[w])!=null)return k.call(m);if(r&&(k=m[r])!=null)return new g(k.call(m));w="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function g(m){function k(w){if(Object(w)!==w)return Promise.reject(new TypeError(w+" is not an object."));var r=w.done;return Promise.resolve(w.value).then(function(s){return{value:s,done:r}})}return g=function(r){this.s=r,this.n=r.next},g.prototype={s:null,n:null,next:function(){return k(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):k(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):k(s.apply(this.s,arguments))}},new g(m)}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),rs=oe(ts());async function is(e){let t=await Be(e.url);if(e.connectionParams){const c=await Be(e.connectionParams),g=t.includes("?")?"&":"?";t+=g+"connectionParams="+encodeURIComponent(JSON.stringify(c))}return t}function Cr(e){const t=mr(e.transformer);return()=>({op:c})=>xe(g=>{var m;const{type:k,path:w,input:r}=c;/* istanbul ignore if -- @preserve */if(k!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let s;const l=new AbortController,_=Wi(c.signal,l.signal),h=Ri({url:async()=>vt({transformer:t,url:await is(e),input:es(r,s),path:w,type:k,signal:null}),init:()=>Be(e.eventSourceOptions,{op:c}),signal:_,deserialize:t.output.deserialize,EventSource:(m=e.EventSource)!==null&&m!==void 0?m:globalThis.EventSource}),f=sr({type:"state",state:"connecting",error:null}),v=f.subscribe({next(y){g.next({result:y})}});return ar(async()=>{var y=!1,u=!1,n;try{for(var a=(0,rs.default)(h),i;y=!(i=await a.next()).done;y=!1){const o=i.value;switch(o.type){case"ping":break;case"data":const d=o.data;let S;d.id?(s=d.id,S={id:d.id,data:d}):S={data:d.data},g.next({result:S,context:{eventSource:o.eventSource}});break;case"connected":{g.next({result:{type:"started"},context:{eventSource:o.eventSource}}),f.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const b=me.from({error:o.error});if(Qr.includes(o.error.code)){f.next({type:"state",state:"connecting",error:b});break}throw b}case"connecting":{const b=f.get(),C=o.event&&me.from(o.event);if(!C&&b.state==="connecting")break;f.next({type:"state",state:"connecting",error:C});break}case"timeout":f.next({type:"state",state:"connecting",error:new me(`Timeout of ${o.ms}ms reached while waiting for a response`)})}}}catch(o){u=!0,n=o}finally{try{y&&a.return!=null&&await a.return()}finally{if(u)throw n}}g.next({result:{type:"stopped"}}),f.next({type:"state",state:"idle",error:null}),g.complete()}).catch(y=>{g.error(me.from(y))}),()=>{g.complete(),l.abort(),v.unsubscribe()}})}oe(ue());var ss=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function c(){var g=typeof SuppressedError=="function"?SuppressedError:function(r,s){var l=Error();return l.name="SuppressedError",l.error=r,l.suppressed=s,l},m={},k=[];function w(r,s){if(s!=null){if(Object(s)!==s)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(r)var l=s[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(l===void 0&&(l=s[Symbol.dispose||Symbol.for("Symbol.dispose")],r))var _=l;if(typeof l!="function")throw new TypeError("Object is not disposable.");_&&(l=function(){try{_.call(s)}catch(f){return Promise.reject(f)}}),k.push({v:s,d:l,a:r})}else r&&k.push({d:s,a:r});return s}return{e:m,u:w.bind(null,!1),a:w.bind(null,!0),d:function(){var s,l=this.e,_=0;function h(){for(;s=k.pop();)try{if(!s.a&&_===1)return _=0,k.push(s),Promise.resolve().then(h);if(s.d){var v=s.d.call(s.v);if(s.a)return _|=2,Promise.resolve(v).then(h,f)}else _|=1}catch(y){return f(y)}if(_===1)return l!==m?Promise.reject(l):Promise.resolve();if(l!==m)throw l}function f(v){return l=l!==m?new g(v,l):v,h()}return h()}}}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),wr=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function c(g,m){this.v=g,this.k=m}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}}),ns=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var c=wr();function g(m){return new c(m,0)}t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}}),os=_e({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var c=wr();function g(k){return function(){return new m(k.apply(this,arguments))}}function m(k){var w,r;function s(_,h){try{var f=k[_](h),v=f.value,y=v instanceof c;Promise.resolve(y?v.v:v).then(function(u){if(y){var n=_==="return"?"return":"next";if(!v.k||u.done)return s(n,u);u=k[n](u).value}l(f.done?"return":"normal",u)},function(u){s("throw",u)})}catch(u){l("throw",u)}}function l(_,h){switch(_){case"return":w.resolve({value:h,done:!0});break;case"throw":w.reject(h);break;default:w.resolve({value:h,done:!1})}(w=w.next)?s(w.key,w.arg):r=null}this._invoke=function(_,h){return new Promise(function(f,v){var y={key:_,arg:h,resolve:f,reject:v,next:null};r?r=r.next=y:(w=r=y,s(_,h))})},typeof k.return!="function"&&(this.return=void 0)}m.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},m.prototype.next=function(k){return this._invoke("next",k)},m.prototype.throw=function(k){return this._invoke("throw",k)},m.prototype.return=function(k){return this._invoke("return",k)},t.exports=g,t.exports.__esModule=!0,t.exports.default=t.exports}});oe(ss());oe(ns());oe(os());oe(ue());const as={version:"1.7.1",latte:{name:"Latte",emoji:"🌻",order:0,dark:!1,colors:{rosewater:{name:"Rosewater",order:0,hex:"#dc8a78",rgb:{r:220,g:138,b:120},hsl:{h:10.799999999999995,s:.5882352941176472,l:.6666666666666667},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#dd7878",rgb:{r:221,g:120,b:120},hsl:{h:0,s:.5976331360946746,l:.6686274509803922},accent:!0},pink:{name:"Pink",order:2,hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},accent:!0},mauve:{name:"Mauve",order:3,hex:"#8839ef",rgb:{r:136,g:57,b:239},hsl:{h:266.0439560439561,s:.8504672897196262,l:.5803921568627451},accent:!0},red:{name:"Red",order:4,hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},accent:!0},maroon:{name:"Maroon",order:5,hex:"#e64553",rgb:{r:230,g:69,b:83},hsl:{h:354.78260869565213,s:.76303317535545,l:.5862745098039216},accent:!0},peach:{name:"Peach",order:6,hex:"#fe640b",rgb:{r:254,g:100,b:11},hsl:{h:21.975308641975307,s:.9918367346938776,l:.5196078431372549},accent:!0},yellow:{name:"Yellow",order:7,hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},accent:!0},green:{name:"Green",order:8,hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},accent:!0},teal:{name:"Teal",order:9,hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},accent:!0},sky:{name:"Sky",order:10,hex:"#04a5e5",rgb:{r:4,g:165,b:229},hsl:{h:197.0666666666667,s:.965665236051502,l:.45686274509803926},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#209fb5",rgb:{r:32,g:159,b:181},hsl:{h:188.85906040268458,s:.6995305164319249,l:.4176470588235294},accent:!0},blue:{name:"Blue",order:12,hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},accent:!0},lavender:{name:"Lavender",order:13,hex:"#7287fd",rgb:{r:114,g:135,b:253},hsl:{h:230.93525179856115,s:.9720279720279721,l:.7196078431372549},accent:!0},text:{name:"Text",order:14,hex:"#4c4f69",rgb:{r:76,g:79,b:105},hsl:{h:233.79310344827587,s:.16022099447513813,l:.3549019607843137},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#7c7f93",rgb:{r:124,g:127,b:147},hsl:{h:232.17391304347825,s:.09623430962343092,l:.5313725490196078},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8c8fa1",rgb:{r:140,g:143,b:161},hsl:{h:231.42857142857144,s:.10047846889952144,l:.5901960784313726},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#9ca0b0",rgb:{r:156,g:160,b:176},hsl:{h:228.00000000000003,s:.11235955056179768,l:.6509803921568628},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#ccd0da",rgb:{r:204,g:208,b:218},hsl:{h:222.85714285714292,s:.1590909090909089,l:.8274509803921568},accent:!1},base:{name:"Base",order:23,hex:"#eff1f5",rgb:{r:239,g:241,b:245},hsl:{h:220.00000000000009,s:.23076923076923136,l:.9490196078431372},accent:!1},mantle:{name:"Mantle",order:24,hex:"#e6e9ef",rgb:{r:230,g:233,b:239},hsl:{h:220.00000000000006,s:.21951219512195116,l:.919607843137255},accent:!1},crust:{name:"Crust",order:25,hex:"#dce0e8",rgb:{r:220,g:224,b:232},hsl:{h:220.00000000000006,s:.20689655172413762,l:.8862745098039215},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#5c5f77",rgb:{r:92,g:95,b:119},hsl:{h:233.33333333333334,s:.1279620853080569,l:.4137254901960784},code:0},bright:{name:"Bright Black",hex:"#6c6f85",rgb:{r:108,g:111,b:133},hsl:{h:232.79999999999998,s:.10373443983402494,l:.4725490196078431},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#d20f39",rgb:{r:210,g:15,b:57},hsl:{h:347.0769230769231,s:.8666666666666666,l:.4411764705882353},code:1},bright:{name:"Bright Red",hex:"#de293e",rgb:{r:222,g:41,b:62},hsl:{h:353.0386740331492,s:.7327935222672065,l:.515686274509804},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#40a02b",rgb:{r:64,g:160,b:43},hsl:{h:109.23076923076923,s:.5763546798029556,l:.39803921568627454},code:2},bright:{name:"Bright Green",hex:"#49af3d",rgb:{r:73,g:175,b:61},hsl:{h:113.68421052631581,s:.48305084745762705,l:.4627450980392157},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#df8e1d",rgb:{r:223,g:142,b:29},hsl:{h:34.948453608247426,s:.7698412698412698,l:.49411764705882355},code:3},bright:{name:"Bright Yellow",hex:"#eea02d",rgb:{r:238,g:160,b:45},hsl:{h:35.751295336787564,s:.8502202643171807,l:.5549019607843138},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#1e66f5",rgb:{r:30,g:102,b:245},hsl:{h:219.90697674418607,s:.9148936170212768,l:.5392156862745098},code:4},bright:{name:"Bright Blue",hex:"#456eff",rgb:{r:69,g:110,b:255},hsl:{h:226.77419354838707,s:1,l:.6352941176470588},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#ea76cb",rgb:{r:234,g:118,b:203},hsl:{h:316.0344827586207,s:.7341772151898731,l:.6901960784313725},code:5},bright:{name:"Bright Magenta",hex:"#fe85d8",rgb:{r:254,g:133,b:216},hsl:{h:318.8429752066116,s:.983739837398374,l:.7588235294117647},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#179299",rgb:{r:23,g:146,b:153},hsl:{h:183.23076923076923,s:.7386363636363636,l:.34509803921568627},code:6},bright:{name:"Bright Cyan",hex:"#2d9fa8",rgb:{r:45,g:159,b:168},hsl:{h:184.39024390243904,s:.5774647887323943,l:.4176470588235294},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#acb0be",rgb:{r:172,g:176,b:190},hsl:{h:226.6666666666667,s:.12162162162162159,l:.7098039215686275},code:7},bright:{name:"Bright White",hex:"#bcc0cc",rgb:{r:188,g:192,b:204},hsl:{h:225.00000000000003,s:.13559322033898308,l:.7686274509803922},code:15}}}},frappe:{name:"Frappé",emoji:"🪴",order:1,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f2d5cf",rgb:{r:242,g:213,b:207},hsl:{h:10.2857142857143,s:.5737704918032784,l:.8803921568627451},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#eebebe",rgb:{r:238,g:190,b:190},hsl:{h:0,s:.5853658536585367,l:.8392156862745098},accent:!0},pink:{name:"Pink",order:2,hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},accent:!0},mauve:{name:"Mauve",order:3,hex:"#ca9ee6",rgb:{r:202,g:158,b:230},hsl:{h:276.66666666666663,s:.5901639344262294,l:.7607843137254902},accent:!0},red:{name:"Red",order:4,hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ea999c",rgb:{r:234,g:153,b:156},hsl:{h:357.77777777777777,s:.6585365853658534,l:.7588235294117647},accent:!0},peach:{name:"Peach",order:6,hex:"#ef9f76",rgb:{r:239,g:159,b:118},hsl:{h:20.33057851239669,s:.7908496732026143,l:.7},accent:!0},yellow:{name:"Yellow",order:7,hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},accent:!0},green:{name:"Green",order:8,hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},accent:!0},teal:{name:"Teal",order:9,hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},accent:!0},sky:{name:"Sky",order:10,hex:"#99d1db",rgb:{r:153,g:209,b:219},hsl:{h:189.09090909090907,s:.47826086956521735,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#85c1dc",rgb:{r:133,g:193,b:220},hsl:{h:198.62068965517244,s:.5541401273885351,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},accent:!0},lavender:{name:"Lavender",order:13,hex:"#babbf1",rgb:{r:186,g:187,b:241},hsl:{h:238.90909090909093,s:.6626506024096385,l:.8372549019607842},accent:!0},text:{name:"Text",order:14,hex:"#c6d0f5",rgb:{r:198,g:208,b:245},hsl:{h:227.2340425531915,s:.7014925373134333,l:.8686274509803922},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#949cbb",rgb:{r:148,g:156,b:187},hsl:{h:227.69230769230768,s:.22285714285714275,l:.6568627450980392},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#838ba7",rgb:{r:131,g:139,b:167},hsl:{h:226.66666666666669,s:.16981132075471703,l:.584313725490196},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#737994",rgb:{r:115,g:121,b:148},hsl:{h:229.0909090909091,s:.13360323886639683,l:.515686274509804},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#414559",rgb:{r:65,g:69,b:89},hsl:{h:230.00000000000003,s:.15584415584415584,l:.30196078431372547},accent:!1},base:{name:"Base",order:23,hex:"#303446",rgb:{r:48,g:52,b:70},hsl:{h:229.0909090909091,s:.18644067796610175,l:.23137254901960785},accent:!1},mantle:{name:"Mantle",order:24,hex:"#292c3c",rgb:{r:41,g:44,b:60},hsl:{h:230.52631578947367,s:.18811881188118806,l:.19803921568627453},accent:!1},crust:{name:"Crust",order:25,hex:"#232634",rgb:{r:35,g:38,b:52},hsl:{h:229.41176470588238,s:.19540229885057467,l:.17058823529411765},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#51576d",rgb:{r:81,g:87,b:109},hsl:{h:227.14285714285714,s:.14736842105263157,l:.37254901960784315},code:0},bright:{name:"Bright Black",hex:"#626880",rgb:{r:98,g:104,b:128},hsl:{h:228.00000000000003,s:.1327433628318584,l:.44313725490196076},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#e78284",rgb:{r:231,g:130,b:132},hsl:{h:358.8118811881188,s:.6778523489932885,l:.7078431372549019},code:1},bright:{name:"Bright Red",hex:"#e67172",rgb:{r:230,g:113,b:114},hsl:{h:359.4871794871795,s:.7005988023952096,l:.6725490196078432},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6d189",rgb:{r:166,g:209,b:137},hsl:{h:95.83333333333331,s:.4390243902439024,l:.6784313725490196},code:2},bright:{name:"Bright Green",hex:"#8ec772",rgb:{r:142,g:199,b:114},hsl:{h:100.23529411764706,s:.431472081218274,l:.6137254901960785},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#e5c890",rgb:{r:229,g:200,b:144},hsl:{h:39.52941176470588,s:.6204379562043796,l:.7313725490196079},code:3},bright:{name:"Bright Yellow",hex:"#d9ba73",rgb:{r:217,g:186,b:115},hsl:{h:41.764705882352935,s:.5730337078651685,l:.6509803921568628},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8caaee",rgb:{r:140,g:170,b:238},hsl:{h:221.6326530612245,s:.7424242424242424,l:.7411764705882353},code:4},bright:{name:"Bright Blue",hex:"#7b9ef0",rgb:{r:123,g:158,b:240},hsl:{h:222.05128205128207,s:.7959183673469388,l:.711764705882353},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f4b8e4",rgb:{r:244,g:184,b:228},hsl:{h:316,s:.7317073170731713,l:.8392156862745098},code:5},bright:{name:"Bright Magenta",hex:"#f2a4db",rgb:{r:242,g:164,b:219},hsl:{h:317.6923076923077,s:.7499999999999998,l:.7960784313725491},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#81c8be",rgb:{r:129,g:200,b:190},hsl:{h:171.5492957746479,s:.3922651933701657,l:.6450980392156862},code:6},bright:{name:"Bright Cyan",hex:"#5abfb5",rgb:{r:90,g:191,b:181},hsl:{h:174.05940594059405,s:.44104803493449785,l:.5509803921568628},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adce",rgb:{r:165,g:173,b:206},hsl:{h:228.29268292682926,s:.2949640287769784,l:.7274509803921569},code:7},bright:{name:"Bright White",hex:"#b5bfe2",rgb:{r:181,g:191,b:226},hsl:{h:226.66666666666669,s:.43689320388349495,l:.7980392156862746},code:15}}}},macchiato:{name:"Macchiato",emoji:"🌺",order:2,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f4dbd6",rgb:{r:244,g:219,b:214},hsl:{h:9.999999999999963,s:.5769230769230775,l:.8980392156862745},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f0c6c6",rgb:{r:240,g:198,b:198},hsl:{h:0,s:.5833333333333333,l:.8588235294117648},accent:!0},pink:{name:"Pink",order:2,hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},accent:!0},mauve:{name:"Mauve",order:3,hex:"#c6a0f6",rgb:{r:198,g:160,b:246},hsl:{h:266.51162790697674,s:.8269230769230772,l:.7960784313725491},accent:!0},red:{name:"Red",order:4,hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},accent:!0},maroon:{name:"Maroon",order:5,hex:"#ee99a0",rgb:{r:238,g:153,b:160},hsl:{h:355.05882352941177,s:.7142857142857143,l:.7666666666666666},accent:!0},peach:{name:"Peach",order:6,hex:"#f5a97f",rgb:{r:245,g:169,b:127},hsl:{h:21.355932203389827,s:.8550724637681162,l:.7294117647058824},accent:!0},yellow:{name:"Yellow",order:7,hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},accent:!0},green:{name:"Green",order:8,hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},accent:!0},teal:{name:"Teal",order:9,hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},accent:!0},sky:{name:"Sky",order:10,hex:"#91d7e3",rgb:{r:145,g:215,b:227},hsl:{h:188.78048780487802,s:.5942028985507245,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#7dc4e4",rgb:{r:125,g:196,b:228},hsl:{h:198.64077669902912,s:.6560509554140128,l:.692156862745098},accent:!0},blue:{name:"Blue",order:12,hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b7bdf8",rgb:{r:183,g:189,b:248},hsl:{h:234.46153846153848,s:.8227848101265824,l:.8450980392156863},accent:!0},text:{name:"Text",order:14,hex:"#cad3f5",rgb:{r:202,g:211,b:245},hsl:{h:227.4418604651163,s:.6825396825396831,l:.8764705882352941},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#939ab7",rgb:{r:147,g:154,b:183},hsl:{h:228.33333333333331,s:.2000000000000001,l:.6470588235294117},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#8087a2",rgb:{r:128,g:135,b:162},hsl:{h:227.6470588235294,s:.1545454545454545,l:.5686274509803921},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6e738d",rgb:{r:110,g:115,b:141},hsl:{h:230.32258064516128,s:.12350597609561753,l:.49215686274509807},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#363a4f",rgb:{r:54,g:58,b:79},hsl:{h:230.4,s:.1879699248120301,l:.2607843137254902},accent:!1},base:{name:"Base",order:23,hex:"#24273a",rgb:{r:36,g:39,b:58},hsl:{h:231.8181818181818,s:.23404255319148934,l:.1843137254901961},accent:!1},mantle:{name:"Mantle",order:24,hex:"#1e2030",rgb:{r:30,g:32,b:48},hsl:{h:233.33333333333334,s:.23076923076923075,l:.15294117647058825},accent:!1},crust:{name:"Crust",order:25,hex:"#181926",rgb:{r:24,g:25,b:38},hsl:{h:235.71428571428572,s:.22580645161290322,l:.12156862745098039},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#494d64",rgb:{r:73,g:77,b:100},hsl:{h:231.11111111111114,s:.15606936416184972,l:.3392156862745098},code:0},bright:{name:"Bright Black",hex:"#5b6078",rgb:{r:91,g:96,b:120},hsl:{h:229.65517241379308,s:.13744075829383887,l:.4137254901960784},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#ed8796",rgb:{r:237,g:135,b:150},hsl:{h:351.1764705882353,s:.7391304347826088,l:.7294117647058824},code:1},bright:{name:"Bright Red",hex:"#ec7486",rgb:{r:236,g:116,b:134},hsl:{h:351,s:.759493670886076,l:.6901960784313725},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6da95",rgb:{r:166,g:218,b:149},hsl:{h:105.21739130434783,s:.4825174825174825,l:.7196078431372549},code:2},bright:{name:"Bright Green",hex:"#8ccf7f",rgb:{r:140,g:207,b:127},hsl:{h:110.24999999999999,s:.45454545454545453,l:.6549019607843137},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#eed49f",rgb:{r:238,g:212,b:159},hsl:{h:40.253164556962034,s:.6991150442477877,l:.7784313725490196},code:3},bright:{name:"Bright Yellow",hex:"#e1c682",rgb:{r:225,g:198,b:130},hsl:{h:42.94736842105264,s:.6129032258064515,l:.696078431372549},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#8aadf4",rgb:{r:138,g:173,b:244},hsl:{h:220.188679245283,s:.8281250000000003,l:.7490196078431373},code:4},bright:{name:"Bright Blue",hex:"#78a1f6",rgb:{r:120,g:161,b:246},hsl:{h:220.47619047619048,s:.8750000000000002,l:.7176470588235294},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5bde6",rgb:{r:245,g:189,b:230},hsl:{h:316.0714285714286,s:.7368421052631583,l:.8509803921568628},code:5},bright:{name:"Bright Magenta",hex:"#f2a9dd",rgb:{r:242,g:169,b:221},hsl:{h:317.26027397260276,s:.7373737373737372,l:.8058823529411765},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#8bd5ca",rgb:{r:139,g:213,b:202},hsl:{h:171.08108108108107,s:.46835443037974706,l:.6901960784313725},code:6},bright:{name:"Bright Cyan",hex:"#63cbc0",rgb:{r:99,g:203,b:192},hsl:{h:173.65384615384616,s:.4999999999999998,l:.592156862745098},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a5adcb",rgb:{r:165,g:173,b:203},hsl:{h:227.36842105263156,s:.2676056338028167,l:.7215686274509804},code:7},bright:{name:"Bright White",hex:"#b8c0e0",rgb:{r:184,g:192,b:224},hsl:{h:228,s:.39215686274509803,l:.8},code:15}}}},mocha:{name:"Mocha",emoji:"🌿",order:3,dark:!0,colors:{rosewater:{name:"Rosewater",order:0,hex:"#f5e0dc",rgb:{r:245,g:224,b:220},hsl:{h:9.599999999999968,s:.555555555555556,l:.911764705882353},accent:!0},flamingo:{name:"Flamingo",order:1,hex:"#f2cdcd",rgb:{r:242,g:205,b:205},hsl:{h:0,s:.587301587301587,l:.8764705882352941},accent:!0},pink:{name:"Pink",order:2,hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},accent:!0},mauve:{name:"Mauve",order:3,hex:"#cba6f7",rgb:{r:203,g:166,b:247},hsl:{h:267.4074074074074,s:.8350515463917528,l:.8098039215686275},accent:!0},red:{name:"Red",order:4,hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},accent:!0},maroon:{name:"Maroon",order:5,hex:"#eba0ac",rgb:{r:235,g:160,b:172},hsl:{h:350.4,s:.6521739130434779,l:.7745098039215685},accent:!0},peach:{name:"Peach",order:6,hex:"#fab387",rgb:{r:250,g:179,b:135},hsl:{h:22.95652173913043,s:.92,l:.7549019607843137},accent:!0},yellow:{name:"Yellow",order:7,hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},accent:!0},green:{name:"Green",order:8,hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},accent:!0},teal:{name:"Teal",order:9,hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},accent:!0},sky:{name:"Sky",order:10,hex:"#89dceb",rgb:{r:137,g:220,b:235},hsl:{h:189.18367346938774,s:.7101449275362316,l:.7294117647058823},accent:!0},sapphire:{name:"Sapphire",order:11,hex:"#74c7ec",rgb:{r:116,g:199,b:236},hsl:{h:198.5,s:.759493670886076,l:.6901960784313725},accent:!0},blue:{name:"Blue",order:12,hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},accent:!0},lavender:{name:"Lavender",order:13,hex:"#b4befe",rgb:{r:180,g:190,b:254},hsl:{h:231.89189189189187,s:.9736842105263159,l:.8509803921568628},accent:!0},text:{name:"Text",order:14,hex:"#cdd6f4",rgb:{r:205,g:214,b:244},hsl:{h:226.15384615384616,s:.6393442622950825,l:.8803921568627451},accent:!1},subtext1:{name:"Subtext 1",order:15,hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},accent:!1},subtext0:{name:"Subtext 0",order:16,hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},accent:!1},overlay2:{name:"Overlay 2",order:17,hex:"#9399b2",rgb:{r:147,g:153,b:178},hsl:{h:228.38709677419354,s:.16756756756756758,l:.6372549019607843},accent:!1},overlay1:{name:"Overlay 1",order:18,hex:"#7f849c",rgb:{r:127,g:132,b:156},hsl:{h:229.65517241379308,s:.12775330396475776,l:.5549019607843138},accent:!1},overlay0:{name:"Overlay 0",order:19,hex:"#6c7086",rgb:{r:108,g:112,b:134},hsl:{h:230.7692307692308,s:.10743801652892565,l:.4745098039215686},accent:!1},surface2:{name:"Surface 2",order:20,hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},accent:!1},surface1:{name:"Surface 1",order:21,hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},accent:!1},surface0:{name:"Surface 0",order:22,hex:"#313244",rgb:{r:49,g:50,b:68},hsl:{h:236.84210526315792,s:.16239316239316234,l:.22941176470588237},accent:!1},base:{name:"Base",order:23,hex:"#1e1e2e",rgb:{r:30,g:30,b:46},hsl:{h:240,s:.21052631578947367,l:.14901960784313725},accent:!1},mantle:{name:"Mantle",order:24,hex:"#181825",rgb:{r:24,g:24,b:37},hsl:{h:240,s:.2131147540983607,l:.11960784313725491},accent:!1},crust:{name:"Crust",order:25,hex:"#11111b",rgb:{r:17,g:17,b:27},hsl:{h:240,s:.22727272727272727,l:.08627450980392157},accent:!1}},ansiColors:{black:{name:"Black",order:0,normal:{name:"Black",hex:"#45475a",rgb:{r:69,g:71,b:90},hsl:{h:234.2857142857143,s:.13207547169811326,l:.31176470588235294},code:0},bright:{name:"Bright Black",hex:"#585b70",rgb:{r:88,g:91,b:112},hsl:{h:232.5,s:.12,l:.39215686274509803},code:8}},red:{name:"Red",order:1,normal:{name:"Red",hex:"#f38ba8",rgb:{r:243,g:139,b:168},hsl:{h:343.2692307692308,s:.8124999999999998,l:.7490196078431373},code:1},bright:{name:"Bright Red",hex:"#f37799",rgb:{r:243,g:119,b:153},hsl:{h:343.54838709677415,s:.8378378378378376,l:.7098039215686274},code:9}},green:{name:"Green",order:2,normal:{name:"Green",hex:"#a6e3a1",rgb:{r:166,g:227,b:161},hsl:{h:115.45454545454544,s:.5409836065573769,l:.7607843137254902},code:2},bright:{name:"Bright Green",hex:"#89d88b",rgb:{r:137,g:216,b:139},hsl:{h:121.51898734177213,s:.5031847133757963,l:.692156862745098},code:10}},yellow:{name:"Yellow",order:3,normal:{name:"Yellow",hex:"#f9e2af",rgb:{r:249,g:226,b:175},hsl:{h:41.35135135135135,s:.8604651162790699,l:.8313725490196078},code:3},bright:{name:"Bright Yellow",hex:"#ebd391",rgb:{r:235,g:211,b:145},hsl:{h:44,s:.692307692307692,l:.7450980392156863},code:11}},blue:{name:"Blue",order:4,normal:{name:"Blue",hex:"#89b4fa",rgb:{r:137,g:180,b:250},hsl:{h:217.1681415929203,s:.9186991869918699,l:.7588235294117647},code:4},bright:{name:"Bright Blue",hex:"#74a8fc",rgb:{r:116,g:168,b:252},hsl:{h:217.05882352941174,s:.9577464788732396,l:.7215686274509804},code:12}},magenta:{name:"Magenta",order:5,normal:{name:"Magenta",hex:"#f5c2e7",rgb:{r:245,g:194,b:231},hsl:{h:316.4705882352941,s:.7183098591549301,l:.8607843137254902},code:5},bright:{name:"Bright Magenta",hex:"#f2aede",rgb:{r:242,g:174,b:222},hsl:{h:317.6470588235294,s:.7234042553191488,l:.8156862745098039},code:13}},cyan:{name:"Cyan",order:6,normal:{name:"Cyan",hex:"#94e2d5",rgb:{r:148,g:226,b:213},hsl:{h:170.00000000000003,s:.5735294117647057,l:.7333333333333334},code:6},bright:{name:"Bright Cyan",hex:"#6bd7ca",rgb:{r:107,g:215,b:202},hsl:{h:172.77777777777777,s:.5744680851063831,l:.6313725490196078},code:14}},white:{name:"White",order:7,normal:{name:"White",hex:"#a6adc8",rgb:{r:166,g:173,b:200},hsl:{h:227.6470588235294,s:.23611111111111102,l:.7176470588235294},code:7},bright:{name:"Bright White",hex:"#bac2de",rgb:{r:186,g:194,b:222},hsl:{h:226.66666666666669,s:.35294117647058837,l:.8},code:15}}}}},Xe=e=>Object.entries(e),{version:za,...cs}=as,Er=Xe(cs).reduce((e,[t,c])=>(e[t]={...c,colorEntries:Xe(c.colors),ansiColorEntries:Xe(c.ansiColors)},e),{});Xe(Er);var ht={exports:{}},It;function hs(){return It||(It=1,function(e,t){(function(c,g){e.exports=g()})(self,()=>(()=>{var c={};return(()=>{var g=c;Object.defineProperty(g,"__esModule",{value:!0}),g.FitAddon=void 0,g.FitAddon=class{activate(m){this._terminal=m}dispose(){}fit(){const m=this.proposeDimensions();if(!m||!this._terminal||isNaN(m.cols)||isNaN(m.rows))return;const k=this._terminal._core;this._terminal.rows===m.rows&&this._terminal.cols===m.cols||(k._renderService.clear(),this._terminal.resize(m.cols,m.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const m=this._terminal._core,k=m._renderService.dimensions;if(k.css.cell.width===0||k.css.cell.height===0)return;const w=this._terminal.options.scrollback===0?0:m.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),h=s-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),f=l-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-w;return{cols:Math.max(2,Math.floor(f/k.css.cell.width)),rows:Math.max(1,Math.floor(h/k.css.cell.height))}}}})(),c})())}(ht)),ht.exports}var ls=hs(),lt={exports:{}},Mt;function us(){return Mt||(Mt=1,function(e,t){(function(c,g){e.exports=g()})(globalThis,()=>(()=>{var c={4567:function(w,r,s){var l=this&&this.__decorate||function(i,o,d,S){var b,C=arguments.length,p=C<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,d,S);else for(var E=i.length-1;E>=0;E--)(b=i[E])&&(p=(C<3?b(p):C>3?b(o,d,p):b(o,d))||p);return C>3&&p&&Object.defineProperty(o,d,p),p},_=this&&this.__param||function(i,o){return function(d,S){o(d,S,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const h=s(9042),f=s(9924),v=s(844),y=s(4725),u=s(2585),n=s(3656);let a=r.AccessibilityManager=class extends v.Disposable{constructor(i,o,d,S){super(),this._terminal=i,this._coreBrowserService=d,this._renderService=S,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 b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,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 f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(b=>this._handleResize(b.rows))),this.register(this._terminal.onRender(b=>this._refreshRows(b.start,b.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(b=>this._handleChar(b))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
2
  `))),this.register(this._terminal.onA11yTab(b=>this._handleTab(b))),this.register(this._terminal.onKey(b=>this._handleKey(b.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,n.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,v.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(i){for(let o=0;o<i;o++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
3
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,o){this._liveRegionDebouncer.refresh(i,o,this._terminal.rows)}_renderRows(i,o){const d=this._terminal.buffer,S=d.lines.length.toString();for(let b=i;b<=o;b++){const C=d.lines.get(d.ydisp+b),p=[],E=C?.translateToString(!0,void 0,void 0,p)||"",P=(d.ydisp+b+1).toString(),T=this._rowElements[b];T&&(E.length===0?(T.innerText=" ",this._rowColumns.set(T,[0,1])):(T.textContent=E,this._rowColumns.set(T,p)),T.setAttribute("aria-posinset",P),T.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,o){const d=i.target,S=this._rowElements[o===0?1:this._rowElements.length-2];if(d.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==S)return;let b,C;if(o===0?(b=d,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(b=this._rowElements.shift(),C=d,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const i=document.getSelection();if(!i)return;if(i.isCollapsed)return void(this._rowContainer.contains(i.anchorNode)&&this._terminal.clearSelection());if(!i.anchorNode||!i.focusNode)return void console.error("anchorNode and/or focusNode are null");let o={node:i.anchorNode,offset:i.anchorOffset},d={node:i.focusNode,offset:i.focusOffset};if((o.node.compareDocumentPosition(d.node)&Node.DOCUMENT_POSITION_PRECEDING||o.node===d.node&&o.offset>d.offset)&&([o,d]=[d,o]),o.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(o={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(o.node))return;const S=this._rowElements.slice(-1)[0];if(d.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(d={node:S,offset:S.textContent?.length??0}),!this._rowContainer.contains(d.node))return;const b=({node:E,offset:P})=>{const T=E instanceof Text?E.parentNode:E;let B=parseInt(T?.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;const R=this._rowColumns.get(T);if(!R)return console.warn("columns is null. Race condition?"),null;let M=P<R.length?R[P]:R.slice(-1)[0]+1;return M>=this._terminal.cols&&(++B,M=0),{row:B,column:M}},C=b(o),p=b(d);if(C&&p){if(C.row>p.row||C.row===p.row&&C.column>=p.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(p.row-C.row)*this._terminal.cols-C.column+p.column)}}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=this._coreBrowserService.mainDocument.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=a=l([_(1,u.IInstantiationService),_(2,y.ICoreBrowserService),_(3,y.IRenderService)],a)},3614:(w,r)=>{function s(f){return f.replace(/\r?\n/g,"\r")}function l(f,v){return v?"\x1B[200~"+f+"\x1B[201~":f}function _(f,v,y,u){f=l(f=s(f),y.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(f,!0),v.value=""}function h(f,v,y){const u=y.getBoundingClientRect(),n=f.clientX-u.left-10,a=f.clientY-u.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${n}px`,v.style.top=`${a}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=s,r.bracketTextForPaste=l,r.copyHandler=function(f,v){f.clipboardData&&f.clipboardData.setData("text/plain",v.selectionText),f.preventDefault()},r.handlePasteEvent=function(f,v,y,u){f.stopPropagation(),f.clipboardData&&_(f.clipboardData.getData("text/plain"),v,y,u)},r.paste=_,r.moveTextAreaUnderMouseCursor=h,r.rightClickHandler=function(f,v,y,u,n){h(f,v,y),n&&u.rightClickSelect(f),v.value=u.selectionText,v.select()}},7239:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=s(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(_,h,f){this._css.set(_,h,f)}getCss(_,h){return this._css.get(_,h)}setColor(_,h,f){this._color.set(_,h,f)}getColor(_,h){return this._color.get(_,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(s,l,_,h){s.addEventListener(l,_,h);let f=!1;return{dispose:()=>{f||(f=!0,s.removeEventListener(l,_,h))}}}},3551:function(w,r,s){var l=this&&this.__decorate||function(a,i,o,d){var S,b=arguments.length,C=b<3?i:d===null?d=Object.getOwnPropertyDescriptor(i,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(a,i,o,d);else for(var p=a.length-1;p>=0;p--)(S=a[p])&&(C=(b<3?S(C):b>3?S(i,o,C):S(i,o))||C);return b>3&&C&&Object.defineProperty(i,o,C),C},_=this&&this.__param||function(a,i){return function(o,d){i(o,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const h=s(3656),f=s(8460),v=s(844),y=s(2585),u=s(4725);let n=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(a,i,o,d,S){super(),this._element=a,this._mouseService=i,this._renderService=o,this._bufferService=d,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const i=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const o=a.composedPath();for(let d=0;d<o.length;d++){const S=o[d];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,i){this._activeProviderReplies&&i||(this._activeProviderReplies?.forEach(d=>{d?.forEach(S=>{S.link.dispose&&S.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=a.y);let o=!1;for(const[d,S]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(d)&&(o=this._checkLinkProviderResult(d,a,o)):S.provideLinks(a.y,b=>{if(this._isMouseOut)return;const C=b?.map(p=>({link:p}));this._activeProviderReplies?.set(d,C),o=this._checkLinkProviderResult(d,a,o),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)})}_removeIntersectingLinks(a,i){const o=new Set;for(let d=0;d<i.size;d++){const S=i.get(d);if(S)for(let b=0;b<S.length;b++){const C=S[b],p=C.link.range.start.y<a?0:C.link.range.start.x,E=C.link.range.end.y>a?this._bufferService.cols:C.link.range.end.x;for(let P=p;P<=E;P++){if(o.has(P)){S.splice(b--,1);break}o.add(P)}}}}_checkLinkProviderResult(a,i,o){if(!this._activeProviderReplies)return o;const d=this._activeProviderReplies.get(a);let S=!1;for(let b=0;b<a;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(S=!0);if(!S&&d){const b=d.find(C=>this._linkAtPosition(C.link,i));b&&(o=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!o)for(let b=0;b<this._activeProviderReplies.size;b++){const C=this._activeProviderReplies.get(b)?.find(p=>this._linkAtPosition(p.link,i));if(C){o=!0,this._handleNewLink(C);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const i=this._positionFromMouseEvent(a,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,i){this._currentLink&&this._lastMouseEvent&&(!a||!i||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(a.link,i)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:o=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",o))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:o=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,o))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(o=>{if(!this._currentLink)return;const d=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(d,S),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}})))}_linkHover(a,i,o){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(o,i.text)}_fireUnderlineEvent(a,i){const o=a.range,d=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-d-1,o.end.x,o.end.y-d-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(a,i,o){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(o,i.text)}_linkAtPosition(a,i){const o=a.range.start.y*this._bufferService.cols+a.range.start.x,d=a.range.end.y*this._bufferService.cols+a.range.end.x,S=i.y*this._bufferService.cols+i.x;return o<=S&&S<=d}_positionFromMouseEvent(a,i,o){const d=o.getCoords(a,i,this._bufferService.cols,this._bufferService.rows);if(d)return{x:d[0],y:d[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,i,o,d,S){return{x1:a,y1:i,x2:o,y2:d,cols:this._bufferService.cols,fg:S}}};r.Linkifier=n=l([_(1,u.IMouseService),_(2,u.IRenderService),_(3,y.IBufferService),_(4,u.ILinkProviderService)],n)},9042:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(w,r,s){var l=this&&this.__decorate||function(u,n,a,i){var o,d=arguments.length,S=d<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,n,a,i);else for(var b=u.length-1;b>=0;b--)(o=u[b])&&(S=(d<3?o(S):d>3?o(n,a,S):o(n,a))||S);return d>3&&S&&Object.defineProperty(n,a,S),S},_=this&&this.__param||function(u,n){return function(a,i){n(a,i,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const h=s(511),f=s(2585);let v=r.OscLinkProvider=class{constructor(u,n,a){this._bufferService=u,this._optionsService=n,this._oscLinkService=a}provideLinks(u,n){const a=this._bufferService.buffer.lines.get(u-1);if(!a)return void n(void 0);const i=[],o=this._optionsService.rawOptions.linkHandler,d=new h.CellData,S=a.getTrimmedLength();let b=-1,C=-1,p=!1;for(let E=0;E<S;E++)if(C!==-1||a.hasContent(E)){if(a.loadCell(E,d),d.hasExtendedAttrs()&&d.extended.urlId){if(C===-1){C=E,b=d.extended.urlId;continue}p=d.extended.urlId!==b}else C!==-1&&(p=!0);if(p||C!==-1&&E===S-1){const P=this._oscLinkService.getLinkData(b)?.uri;if(P){const T={start:{x:C+1,y:u},end:{x:E+(p||E!==S-1?0:1),y:u}};let B=!1;if(!o?.allowNonHttpProtocols)try{const R=new URL(P);["http:","https:"].includes(R.protocol)||(B=!0)}catch{B=!0}B||i.push({text:P,range:T,activate:(R,M)=>o?o.activate(R,M,T):y(0,M),hover:(R,M)=>o?.hover?.(R,M,T),leave:(R,M)=>o?.leave?.(R,M,T)})}p=!1,d.hasExtendedAttrs()&&d.extended.urlId?(C=E,b=d.extended.urlId):(C=-1,b=-1)}}n(i)}};function y(u,n){if(confirm(`Do you want to navigate to ${n}?
3
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,o){this._liveRegionDebouncer.refresh(i,o,this._terminal.rows)}_renderRows(i,o){const d=this._terminal.buffer,S=d.lines.length.toString();for(let b=i;b<=o;b++){const C=d.lines.get(d.ydisp+b),p=[],E=C?.translateToString(!0,void 0,void 0,p)||"",P=(d.ydisp+b+1).toString(),T=this._rowElements[b];T&&(E.length===0?(T.innerText=" ",this._rowColumns.set(T,[0,1])):(T.textContent=E,this._rowColumns.set(T,p)),T.setAttribute("aria-posinset",P),T.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,o){const d=i.target,S=this._rowElements[o===0?1:this._rowElements.length-2];if(d.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==S)return;let b,C;if(o===0?(b=d,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(b=this._rowElements.shift(),C=d,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const i=document.getSelection();if(!i)return;if(i.isCollapsed)return void(this._rowContainer.contains(i.anchorNode)&&this._terminal.clearSelection());if(!i.anchorNode||!i.focusNode)return void console.error("anchorNode and/or focusNode are null");let o={node:i.anchorNode,offset:i.anchorOffset},d={node:i.focusNode,offset:i.focusOffset};if((o.node.compareDocumentPosition(d.node)&Node.DOCUMENT_POSITION_PRECEDING||o.node===d.node&&o.offset>d.offset)&&([o,d]=[d,o]),o.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(o={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(o.node))return;const S=this._rowElements.slice(-1)[0];if(d.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(d={node:S,offset:S.textContent?.length??0}),!this._rowContainer.contains(d.node))return;const b=({node:E,offset:P})=>{const T=E instanceof Text?E.parentNode:E;let B=parseInt(T?.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;const D=this._rowColumns.get(T);if(!D)return console.warn("columns is null. Race condition?"),null;let M=P<D.length?D[P]:D.slice(-1)[0]+1;return M>=this._terminal.cols&&(++B,M=0),{row:B,column:M}},C=b(o),p=b(d);if(C&&p){if(C.row>p.row||C.row===p.row&&C.column>=p.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(p.row-C.row)*this._terminal.cols-C.column+p.column)}}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=this._coreBrowserService.mainDocument.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=a=l([_(1,u.IInstantiationService),_(2,y.ICoreBrowserService),_(3,y.IRenderService)],a)},3614:(w,r)=>{function s(f){return f.replace(/\r?\n/g,"\r")}function l(f,v){return v?"\x1B[200~"+f+"\x1B[201~":f}function _(f,v,y,u){f=l(f=s(f),y.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(f,!0),v.value=""}function h(f,v,y){const u=y.getBoundingClientRect(),n=f.clientX-u.left-10,a=f.clientY-u.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${n}px`,v.style.top=`${a}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=s,r.bracketTextForPaste=l,r.copyHandler=function(f,v){f.clipboardData&&f.clipboardData.setData("text/plain",v.selectionText),f.preventDefault()},r.handlePasteEvent=function(f,v,y,u){f.stopPropagation(),f.clipboardData&&_(f.clipboardData.getData("text/plain"),v,y,u)},r.paste=_,r.moveTextAreaUnderMouseCursor=h,r.rightClickHandler=function(f,v,y,u,n){h(f,v,y),n&&u.rightClickSelect(f),v.value=u.selectionText,v.select()}},7239:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=s(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(_,h,f){this._css.set(_,h,f)}getCss(_,h){return this._css.get(_,h)}setColor(_,h,f){this._color.set(_,h,f)}getColor(_,h){return this._color.get(_,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(s,l,_,h){s.addEventListener(l,_,h);let f=!1;return{dispose:()=>{f||(f=!0,s.removeEventListener(l,_,h))}}}},3551:function(w,r,s){var l=this&&this.__decorate||function(a,i,o,d){var S,b=arguments.length,C=b<3?i:d===null?d=Object.getOwnPropertyDescriptor(i,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(a,i,o,d);else for(var p=a.length-1;p>=0;p--)(S=a[p])&&(C=(b<3?S(C):b>3?S(i,o,C):S(i,o))||C);return b>3&&C&&Object.defineProperty(i,o,C),C},_=this&&this.__param||function(a,i){return function(o,d){i(o,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const h=s(3656),f=s(8460),v=s(844),y=s(2585),u=s(4725);let n=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(a,i,o,d,S){super(),this._element=a,this._mouseService=i,this._renderService=o,this._bufferService=d,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const i=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const o=a.composedPath();for(let d=0;d<o.length;d++){const S=o[d];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,i){this._activeProviderReplies&&i||(this._activeProviderReplies?.forEach(d=>{d?.forEach(S=>{S.link.dispose&&S.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=a.y);let o=!1;for(const[d,S]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(d)&&(o=this._checkLinkProviderResult(d,a,o)):S.provideLinks(a.y,b=>{if(this._isMouseOut)return;const C=b?.map(p=>({link:p}));this._activeProviderReplies?.set(d,C),o=this._checkLinkProviderResult(d,a,o),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)})}_removeIntersectingLinks(a,i){const o=new Set;for(let d=0;d<i.size;d++){const S=i.get(d);if(S)for(let b=0;b<S.length;b++){const C=S[b],p=C.link.range.start.y<a?0:C.link.range.start.x,E=C.link.range.end.y>a?this._bufferService.cols:C.link.range.end.x;for(let P=p;P<=E;P++){if(o.has(P)){S.splice(b--,1);break}o.add(P)}}}}_checkLinkProviderResult(a,i,o){if(!this._activeProviderReplies)return o;const d=this._activeProviderReplies.get(a);let S=!1;for(let b=0;b<a;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(S=!0);if(!S&&d){const b=d.find(C=>this._linkAtPosition(C.link,i));b&&(o=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!o)for(let b=0;b<this._activeProviderReplies.size;b++){const C=this._activeProviderReplies.get(b)?.find(p=>this._linkAtPosition(p.link,i));if(C){o=!0,this._handleNewLink(C);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const i=this._positionFromMouseEvent(a,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,i){this._currentLink&&this._lastMouseEvent&&(!a||!i||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(a.link,i)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:o=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",o))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:o=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,o))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(o=>{if(!this._currentLink)return;const d=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(d,S),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}})))}_linkHover(a,i,o){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(o,i.text)}_fireUnderlineEvent(a,i){const o=a.range,d=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-d-1,o.end.x,o.end.y-d-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(a,i,o){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(o,i.text)}_linkAtPosition(a,i){const o=a.range.start.y*this._bufferService.cols+a.range.start.x,d=a.range.end.y*this._bufferService.cols+a.range.end.x,S=i.y*this._bufferService.cols+i.x;return o<=S&&S<=d}_positionFromMouseEvent(a,i,o){const d=o.getCoords(a,i,this._bufferService.cols,this._bufferService.rows);if(d)return{x:d[0],y:d[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,i,o,d,S){return{x1:a,y1:i,x2:o,y2:d,cols:this._bufferService.cols,fg:S}}};r.Linkifier=n=l([_(1,u.IMouseService),_(2,u.IRenderService),_(3,y.IBufferService),_(4,u.ILinkProviderService)],n)},9042:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(w,r,s){var l=this&&this.__decorate||function(u,n,a,i){var o,d=arguments.length,S=d<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,n,a,i);else for(var b=u.length-1;b>=0;b--)(o=u[b])&&(S=(d<3?o(S):d>3?o(n,a,S):o(n,a))||S);return d>3&&S&&Object.defineProperty(n,a,S),S},_=this&&this.__param||function(u,n){return function(a,i){n(a,i,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const h=s(511),f=s(2585);let v=r.OscLinkProvider=class{constructor(u,n,a){this._bufferService=u,this._optionsService=n,this._oscLinkService=a}provideLinks(u,n){const a=this._bufferService.buffer.lines.get(u-1);if(!a)return void n(void 0);const i=[],o=this._optionsService.rawOptions.linkHandler,d=new h.CellData,S=a.getTrimmedLength();let b=-1,C=-1,p=!1;for(let E=0;E<S;E++)if(C!==-1||a.hasContent(E)){if(a.loadCell(E,d),d.hasExtendedAttrs()&&d.extended.urlId){if(C===-1){C=E,b=d.extended.urlId;continue}p=d.extended.urlId!==b}else C!==-1&&(p=!0);if(p||C!==-1&&E===S-1){const P=this._oscLinkService.getLinkData(b)?.uri;if(P){const T={start:{x:C+1,y:u},end:{x:E+(p||E!==S-1?0:1),y:u}};let B=!1;if(!o?.allowNonHttpProtocols)try{const D=new URL(P);["http:","https:"].includes(D.protocol)||(B=!0)}catch{B=!0}B||i.push({text:P,range:T,activate:(D,M)=>o?o.activate(D,M,T):y(0,M),hover:(D,M)=>o?.hover?.(D,M,T),leave:(D,M)=>o?.leave?.(D,M,T)})}p=!1,d.hasExtendedAttrs()&&d.extended.urlId?(C=E,b=d.extended.urlId):(C=-1,b=-1)}}n(i)}};function y(u,n){if(confirm(`Do you want to navigate to ${n}?
4
4
 
5
- WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=v=l([_(0,f.IBufferService),_(1,f.IOptionsService),_(2,f.IOscLinkService)],v)},6193:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(s,l){this._renderCallback=s,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(s){return this._refreshCallbacks.push(s),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(s,l,_){this._rowCount=_,s=s!==void 0?s:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,s):s,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,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 s=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(s,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const s of this._refreshCallbacks)s(0);this._refreshCallbacks=[]}}},3236:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const l=s(3614),_=s(3656),h=s(3551),f=s(9042),v=s(3730),y=s(1680),u=s(3107),n=s(5744),a=s(2950),i=s(1296),o=s(428),d=s(4269),S=s(5114),b=s(8934),C=s(3230),p=s(9312),E=s(4725),P=s(6731),T=s(8055),B=s(8969),R=s(8460),M=s(844),j=s(6114),N=s(8437),K=s(2584),W=s(7399),x=s(5941),L=s(9074),A=s(2585),O=s(5435),F=s(4567),U=s(779);class V extends B.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(I={}){super(I),this.browser=j,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new M.MutableDisposable),this._onCursorMove=this.register(new R.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new R.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new R.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new R.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new R.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new R.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new R.EventEmitter),this._onBlur=this.register(new R.EventEmitter),this._onA11yCharEmitter=this.register(new R.EventEmitter),this._onA11yTabEmitter=this.register(new R.EventEmitter),this._onWillOpen=this.register(new R.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(U.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((D,H)=>this.refresh(D,H))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(D=>this._reportWindowsOptions(D))),this.register(this._inputHandler.onColor(D=>this._handleColorEvent(D))),this.register((0,R.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,R.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(D=>this._afterResize(D.cols,D.rows))),this.register((0,M.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(I){if(this._themeService)for(const D of I){let H,$="";switch(D.index){case 256:H="foreground",$="10";break;case 257:H="background",$="11";break;case 258:H="cursor",$="12";break;default:H="ansi",$="4;"+D.index}switch(D.type){case 0:const q=T.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${$};${(0,x.toRgbString)(q)}${K.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors(Z=>Z.ansi[D.index]=T.channels.toColor(...D.color));else{const Z=H;this._themeService.modifyColors(X=>X[Z]=T.channels.toColor(...D.color))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(I){I?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(I){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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(K.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 I=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(I);if(!D)return;const H=Math.min(this.buffer.x,this.cols-1),$=this._renderService.dimensions.css.cell.height,q=D.getWidth(H),Z=this._renderService.dimensions.css.cell.width*q,X=this.buffer.y*this._renderService.dimensions.css.cell.height,se=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=X+"px",this.textarea.style.width=Z+"px",this.textarea.style.height=$+"px",this.textarea.style.lineHeight=$+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",D=>{this.hasSelection()&&(0,l.copyHandler)(D,this._selectionService)}));const I=D=>(0,l.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,_.addDisposableDomListener)(this.element,"paste",I)),j.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",D=>{D.button===2&&(0,l.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",D=>{(0,l.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),j.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",D=>{D.button===1&&(0,l.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",I=>this._keyUp(I),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",I=>this._keyDown(I),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",I=>this._keyPress(I),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",I=>this._compositionHelper.compositionupdate(I))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",I=>this._inputEvent(I),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(I){if(!I)throw new Error("Terminal requires a parent element.");if(I.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=I.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"),I.appendChild(this.element);const D=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),D.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",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),D.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),j.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(S.CoreBrowserService,this.textarea,I.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(o.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(P.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(d.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(D);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.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(p.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(u.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),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(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const I=this,D=this.element;function H(Z){const X=I._mouseService.getMouseReportCoords(Z,I.screenElement);if(!X)return!1;let se,ne;switch(Z.overrideType||Z.type){case"mousemove":ne=32,Z.buttons===void 0?(se=3,Z.button!==void 0&&(se=Z.button<3?Z.button:3)):se=1&Z.buttons?0:4&Z.buttons?1:2&Z.buttons?2:3;break;case"mouseup":ne=0,se=Z.button<3?Z.button:3;break;case"mousedown":ne=1,se=Z.button<3?Z.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(Z)===!1||I.viewport.getLinesScrolled(Z)===0)return!1;ne=Z.deltaY<0?0:1,se=4;break;default:return!1}return!(ne===void 0||se===void 0||se>4)&&I.coreMouseService.triggerMouseEvent({col:X.col,row:X.row,x:X.x,y:X.y,button:se,action:ne,ctrl:Z.ctrlKey,alt:Z.altKey,shift:Z.shiftKey})}const $={mouseup:null,wheel:null,mousedrag:null,mousemove:null},q={mouseup:Z=>(H(Z),Z.buttons||(this._document.removeEventListener("mouseup",$.mouseup),$.mousedrag&&this._document.removeEventListener("mousemove",$.mousedrag)),this.cancel(Z)),wheel:Z=>(H(Z),this.cancel(Z,!0)),mousedrag:Z=>{Z.buttons&&H(Z)},mousemove:Z=>{Z.buttons||H(Z)}};this.register(this.coreMouseService.onProtocolChange(Z=>{Z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Z)),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&Z?$.mousemove||(D.addEventListener("mousemove",q.mousemove),$.mousemove=q.mousemove):(D.removeEventListener("mousemove",$.mousemove),$.mousemove=null),16&Z?$.wheel||(D.addEventListener("wheel",q.wheel,{passive:!1}),$.wheel=q.wheel):(D.removeEventListener("wheel",$.wheel),$.wheel=null),2&Z?$.mouseup||($.mouseup=q.mouseup):(this._document.removeEventListener("mouseup",$.mouseup),$.mouseup=null),4&Z?$.mousedrag||($.mousedrag=q.mousedrag):(this._document.removeEventListener("mousemove",$.mousedrag),$.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(D,"mousedown",Z=>{if(Z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Z))return H(Z),$.mouseup&&this._document.addEventListener("mouseup",$.mouseup),$.mousedrag&&this._document.addEventListener("mousemove",$.mousedrag),this.cancel(Z)})),this.register((0,_.addDisposableDomListener)(D,"wheel",Z=>{if(!$.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Z)===!1)return!1;if(!this.buffer.hasScrollback){const X=this.viewport.getLinesScrolled(Z);if(X===0)return;const se=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Z.deltaY<0?"A":"B");let ne="";for(let ce=0;ce<Math.abs(X);ce++)ne+=se;return this.coreService.triggerDataEvent(ne,!0),this.cancel(Z,!0)}return this.viewport.handleWheel(Z)?this.cancel(Z):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(D,"touchstart",Z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Z),this.cancel(Z)},{passive:!0})),this.register((0,_.addDisposableDomListener)(D,"touchmove",Z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Z)?void 0:this.cancel(Z)},{passive:!1}))}refresh(I,D){this._renderService?.refreshRows(I,D)}updateCursorStyle(I){this._selectionService?.shouldColumnSelect(I)?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(I,D,H=0){H===1?(super.scrollLines(I,D,H),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(I)}paste(I){(0,l.paste)(I,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(I){this._customKeyEventHandler=I}attachCustomWheelEventHandler(I){this._customWheelEventHandler=I}registerLinkProvider(I){return this._linkProviderService.registerLinkProvider(I)}registerCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(I);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(I)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(I){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+I)}registerDecoration(I){return this._decorationService.registerDecoration(I)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(I,D,H){this._selectionService.setSelection(I,D,H)}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(I,D){this._selectionService?.selectLines(I,D)}_keyDown(I){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&I.altKey;if(!D&&!this._compositionHelper.keydown(I))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||I.key!=="Dead"&&I.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,W.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),H.type===3||H.type===2){const $=this.rows-1;return this.scrollLines(H.type===2?-$:$),this.cancel(I,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,I)||(H.cancel&&this.cancel(I,!0),!H.key||!!(I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.key.length===1&&I.key.charCodeAt(0)>=65&&I.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(H.key!==K.C0.ETX&&H.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||I.altKey||I.ctrlKey?this.cancel(I,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(I,D){const H=I.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||I.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||I.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?H:H&&(!D.keyCode||D.keyCode>47)}_keyUp(I){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1||(function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18}(I)||this.focus(),this.updateCursorStyle(I),this._keyPressHandled=!1)}_keyPress(I){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;if(this.cancel(I),I.charCode)D=I.charCode;else if(I.which===null||I.which===void 0)D=I.keyCode;else{if(I.which===0||I.charCode===0)return!1;D=I.which}return!(!D||(I.altKey||I.ctrlKey||I.metaKey)&&!this._isThirdLevelShift(this.browser,I)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(I){if(I.data&&I.inputType==="insertText"&&(!I.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=I.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(I),!0}return!1}resize(I,D){I!==this.cols||D!==this.rows?super.resize(I,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(I,D){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 I=1;I<this.rows;I++)this.buffer.lines.push(this.buffer.getBlankLine(N.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 I=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${H};${D}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const $=this._renderService.dimensions.css.cell.width.toFixed(0),q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${q};${$}t`)}}cancel(I,D){if(this.options.cancelEvents||D)return I.preventDefault(),I.stopPropagation(),!1}}r.Terminal=V},9924:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(s,l=1e3){this._renderCallback=s,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(s,l,_){this._rowCount=_,s=s!==void 0?s:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,s):s,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=h-this._lastRefreshMs,v=this._debounceThresholdMS-f;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const s=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(s,l)}}},1680:function(w,r,s){var l=this&&this.__decorate||function(a,i,o,d){var S,b=arguments.length,C=b<3?i:d===null?d=Object.getOwnPropertyDescriptor(i,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(a,i,o,d);else for(var p=a.length-1;p>=0;p--)(S=a[p])&&(C=(b<3?S(C):b>3?S(i,o,C):S(i,o))||C);return b>3&&C&&Object.defineProperty(i,o,C),C},_=this&&this.__param||function(a,i){return function(o,d){i(o,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const h=s(3656),f=s(4725),v=s(8460),y=s(844),u=s(2585);let n=r.Viewport=class extends y.Disposable{constructor(a,i,o,d,S,b,C,p){super(),this._viewportElement=a,this._scrollArea=i,this._bufferService=o,this._optionsService=d,this._charSizeService=S,this._renderService=b,this._coreBrowserService=C,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 v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(p.colors),this.register(p.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.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(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const i=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==i&&(this._lastRecordedBufferHeight=i,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<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(a,i){const o=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&o<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const i=this._getPixelsScrolled(a);return i!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+i:this._smoothScrollState.target+=i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=i,this._bubbleScroll(a,i))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const i=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let i=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i}getBufferElements(a,i){let o,d="";const S=[],b=i??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let p=a;p<b;p++){const E=C.get(p);if(!E)continue;const P=C.get(p+1)?.isWrapped;if(d+=E.translateToString(!P),!P||p===C.length-1){const T=document.createElement("div");T.textContent=d,S.push(T),d.length>0&&(o=T),d=""}}return{bufferElements:S,cursorElement:o}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let i=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(a,i){const o=this._optionsService.rawOptions.fastScrollModifier;return o==="alt"&&i.altKey||o==="ctrl"&&i.ctrlKey||o==="shift"&&i.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const i=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(a,i))}};r.Viewport=n=l([_(2,u.IBufferService),_(3,u.IOptionsService),_(4,f.ICharSizeService),_(5,f.IRenderService),_(6,f.ICoreBrowserService),_(7,f.IThemeService)],n)},3107:function(w,r,s){var l=this&&this.__decorate||function(u,n,a,i){var o,d=arguments.length,S=d<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,n,a,i);else for(var b=u.length-1;b>=0;b--)(o=u[b])&&(S=(d<3?o(S):d>3?o(n,a,S):o(n,a))||S);return d>3&&S&&Object.defineProperty(n,a,S),S},_=this&&this.__param||function(u,n){return function(a,i){n(a,i,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const h=s(4725),f=s(844),v=s(2585);let y=r.BufferDecorationRenderer=class extends f.Disposable{constructor(u,n,a,i,o){super(),this._screenElement=u,this._bufferService=n,this._coreBrowserService=a,this._decorationService=i,this._renderService=o,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(d=>this._removeDecoration(d))),this.register((0,f.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",u?.options?.layer==="top"),n.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=u.options.x??0;return a&&a>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(u,n),n}_refreshStyle(u){const n=u.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let a=this._decorationElements.get(u);a||(a=this._createElement(u),u.element=a,this._decorationElements.set(u,a),this._container.appendChild(a),u.onDispose(()=>{this._decorationElements.delete(u),a.remove()})),a.style.top=n*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(a)}}_refreshXPosition(u,n=u.element){if(!n)return;const a=u.options.x??0;(u.options.anchor||"left")==="right"?n.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){this._decorationElements.get(u)?.remove(),this._decorationElements.delete(u),u.dispose()}};r.BufferDecorationRenderer=y=l([_(1,v.IBufferService),_(2,h.ICoreBrowserService),_(3,v.IDecorationService),_(4,h.IRenderService)],y)},5871:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(s){if(s.options.overviewRulerOptions){for(const l of this._zones)if(l.color===s.options.overviewRulerOptions.color&&l.position===s.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,s.marker.line))return;if(this._lineAdjacentToZone(l,s.marker.line,s.options.overviewRulerOptions.position))return void this._addLineToZone(l,s.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=s.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=s.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=s.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=s.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:s.options.overviewRulerOptions.color,position:s.options.overviewRulerOptions.position,startBufferLine:s.marker.line,endBufferLine:s.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(s){this._linePadding=s}_lineIntersectsZone(s,l){return l>=s.startBufferLine&&l<=s.endBufferLine}_lineAdjacentToZone(s,l,_){return l>=s.startBufferLine-this._linePadding[_||"full"]&&l<=s.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(s,l){s.startBufferLine=Math.min(s.startBufferLine,l),s.endBufferLine=Math.max(s.endBufferLine,l)}}},5744:function(w,r,s){var l=this&&this.__decorate||function(o,d,S,b){var C,p=arguments.length,E=p<3?d:b===null?b=Object.getOwnPropertyDescriptor(d,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,d,S,b);else for(var P=o.length-1;P>=0;P--)(C=o[P])&&(E=(p<3?C(E):p>3?C(d,S,E):C(d,S))||E);return p>3&&E&&Object.defineProperty(d,S,E),E},_=this&&this.__param||function(o,d){return function(S,b){d(S,b,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const h=s(5871),f=s(4725),v=s(844),y=s(2585),u={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let i=r.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(o,d,S,b,C,p,E){super(),this._viewportElement=o,this._screenElement=d,this._bufferService=S,this._decorationService=b,this._renderService=C,this._optionsService=p,this._coreBrowserService=E,this._colorZoneStore=new h.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 P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.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 o=Math.floor(this._canvas.width/3),d=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=o,n.center=d,n.right=o,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=n.left,a.right=n.left+n.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowserService.dpr);const o=this._canvas.height/this._bufferService.buffer.lines.length,d=Math.round(Math.max(Math.min(o,12),6)*this._coreBrowserService.dpr);u.left=d,u.center=d,u.right=d}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.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 d of this._decorationService.decorations)this._colorZoneStore.addDecoration(d);this._ctx.lineWidth=1;const o=this._colorZoneStore.zones;for(const d of o)d.position!=="full"&&this._renderColorZone(d);for(const d of o)d.position==="full"&&this._renderColorZone(d);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(o){this._ctx.fillStyle=o.color,this._ctx.fillRect(a[o.position||"full"],Math.round((this._canvas.height-1)*(o.startBufferLine/this._bufferService.buffers.active.lines.length)-u[o.position||"full"]/2),n[o.position||"full"],Math.round((this._canvas.height-1)*((o.endBufferLine-o.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[o.position||"full"]))}_queueRefresh(o,d){this._shouldUpdateDimensions=o||this._shouldUpdateDimensions,this._shouldUpdateAnchor=d||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=i=l([_(2,y.IBufferService),_(3,y.IDecorationService),_(4,f.IRenderService),_(5,y.IOptionsService),_(6,f.ICoreBrowserService)],i)},2950:function(w,r,s){var l=this&&this.__decorate||function(u,n,a,i){var o,d=arguments.length,S=d<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,n,a,i);else for(var b=u.length-1;b>=0;b--)(o=u[b])&&(S=(d<3?o(S):d>3?o(n,a,S):o(n,a))||S);return d>3&&S&&Object.defineProperty(n,a,S),S},_=this&&this.__param||function(u,n){return function(a,i){n(a,i,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const h=s(4725),f=s(2585),v=s(2584);let y=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(u,n,a,i,o,d){this._textarea=u,this._compositionView=n,this._bufferService=a,this._optionsService=i,this._coreService=o,this._renderService=d,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(u){this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(u){if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}},0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const u=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const n=this._textarea.value,a=n.replace(u,"");this._dataAlreadySent=a,n.length>u.length?this._coreService.triggerDataEvent(a,!0):n.length<u.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):n.length===u.length&&n!==u&&this._coreService.triggerDataEvent(n,!0)}},0)}updateCompositionElements(u){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const d=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(d.width,1)+"px",this._textarea.style.height=Math.max(d.height,1)+"px",this._textarea.style.lineHeight=d.height+"px"}u||setTimeout(()=>this.updateCompositionElements(!0),0)}}};r.CompositionHelper=y=l([_(2,f.IBufferService),_(3,f.IOptionsService),_(4,f.ICoreService),_(5,h.IRenderService)],y)},9806:(w,r)=>{function s(l,_,h){const f=h.getBoundingClientRect(),v=l.getComputedStyle(h),y=parseInt(v.getPropertyValue("padding-left")),u=parseInt(v.getPropertyValue("padding-top"));return[_.clientX-f.left-y,_.clientY-f.top-u]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=s,r.getCoords=function(l,_,h,f,v,y,u,n,a){if(!y)return;const i=s(l,_,h);return i?(i[0]=Math.ceil((i[0]+(a?u/2:0))/u),i[1]=Math.ceil(i[1]/n),i[0]=Math.min(Math.max(i[0],1),f+(a?1:0)),i[1]=Math.min(Math.max(i[1],1),v),i):void 0}},9504:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const l=s(2584);function _(n,a,i,o){const d=n-h(n,i),S=a-h(a,i),b=Math.abs(d-S)-function(C,p,E){let P=0;const T=C-h(C,E),B=p-h(p,E);for(let R=0;R<Math.abs(T-B);R++){const M=f(C,p)==="A"?-1:1;E.buffer.lines.get(T+M*R)?.isWrapped&&P++}return P}(n,a,i);return u(b,y(f(n,a),o))}function h(n,a){let i=0,o=a.buffer.lines.get(n),d=o?.isWrapped;for(;d&&n>=0&&n<a.rows;)i++,o=a.buffer.lines.get(--n),d=o?.isWrapped;return i}function f(n,a){return n>a?"A":"B"}function v(n,a,i,o,d,S){let b=n,C=a,p="";for(;b!==i||C!==o;)b+=d?1:-1,d&&b>S.cols-1?(p+=S.buffer.translateBufferLineToString(C,!1,n,b),b=0,n=0,C++):!d&&b<0&&(p+=S.buffer.translateBufferLineToString(C,!1,0,n+1),b=S.cols-1,n=b,C--);return p+S.buffer.translateBufferLineToString(C,!1,n,b)}function y(n,a){const i=a?"O":"[";return l.C0.ESC+i+n}function u(n,a){n=Math.floor(n);let i="";for(let o=0;o<n;o++)i+=a;return i}r.moveToCellSequence=function(n,a,i,o){const d=i.buffer.x,S=i.buffer.y;if(!i.buffer.hasScrollback)return function(p,E,P,T,B,R){return _(E,T,B,R).length===0?"":u(v(p,E,p,E-h(E,B),!1,B).length,y("D",R))}(d,S,0,a,i,o)+_(S,a,i,o)+function(p,E,P,T,B,R){let M;M=_(E,T,B,R).length>0?T-h(T,B):E;const j=T,N=function(K,W,x,L,A,O){let F;return F=_(x,L,A,O).length>0?L-h(L,A):W,K<x&&F<=L||K>=x&&F<L?"C":"D"}(p,E,P,T,B,R);return u(v(p,M,P,j,N==="C",B).length,y(N,R))}(d,S,n,a,i,o);let b;if(S===a)return b=d>n?"D":"C",u(Math.abs(d-n),y(b,o));b=S>a?"D":"C";const C=Math.abs(S-a);return u(function(p,E){return E.cols-p}(S>a?n:d,i)+(C-1)*i.cols+1+((S>a?d:n)-1),y(b,o))}},1296:function(w,r,s){var l=this&&this.__decorate||function(R,M,j,N){var K,W=arguments.length,x=W<3?M:N===null?N=Object.getOwnPropertyDescriptor(M,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(R,M,j,N);else for(var L=R.length-1;L>=0;L--)(K=R[L])&&(x=(W<3?K(x):W>3?K(M,j,x):K(M,j))||x);return W>3&&x&&Object.defineProperty(M,j,x),x},_=this&&this.__param||function(R,M){return function(j,N){M(j,N,R)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const h=s(3787),f=s(2550),v=s(2223),y=s(6171),u=s(6052),n=s(4725),a=s(8055),i=s(8460),o=s(844),d=s(2585),S="xterm-dom-renderer-owner-",b="xterm-rows",C="xterm-fg-",p="xterm-bg-",E="xterm-focus",P="xterm-selection";let T=1,B=r.DomRenderer=class extends o.Disposable{constructor(R,M,j,N,K,W,x,L,A,O,F,U,V){super(),this._terminal=R,this._document=M,this._element=j,this._screenElement=N,this._viewportElement=K,this._helperContainer=W,this._linkifier2=x,this._charSizeService=A,this._optionsService=O,this._bufferService=F,this._coreBrowserService=U,this._themeService=V,this._terminalClass=T++,this._rowElements=[],this._selectionRenderModel=(0,u.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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(P),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(G=>this._injectCss(G))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(G=>this._handleLinkHover(G))),this.register(this._linkifier2.onHideLinkUnderline(G=>this._handleLinkLeave(G))),this.register((0,o.toDisposable)(()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new f.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 R=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*R,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*R),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/R),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/R),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 j of this._rowElements)j.style.width=`${this.dimensions.css.canvas.width}px`,j.style.height=`${this.dimensions.css.cell.height}px`,j.style.lineHeight=`${this.dimensions.css.cell.height}px`,j.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const M=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=M,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(R){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let M=`${this._terminalSelector} .${b} { color: ${R.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;M+=`${this._terminalSelector} .${b} .xterm-dim { color: ${a.color.multiplyOpacity(R.foreground,.5).css};}`,M+=`${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 j=`blink_underline_${this._terminalClass}`,N=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;M+=`@keyframes ${j} { 50% { border-bottom-style: hidden; }}`,M+=`@keyframes ${N} { 50% { box-shadow: none; }}`,M+=`@keyframes ${K} { 0% { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css}; } 50% { background-color: inherit; color: ${R.cursor.css}; }}`,M+=`${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${N} 1s step-end infinite;}${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${R.cursor.css} !important; color: ${R.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${R.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${R.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${R.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,M+=`${this._terminalSelector} .${P} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${P} div { position: absolute; background-color: ${R.selectionBackgroundOpaque.css};}${this._terminalSelector} .${P} div { position: absolute; background-color: ${R.selectionInactiveBackgroundOpaque.css};}`;for(const[W,x]of R.ansi.entries())M+=`${this._terminalSelector} .${C}${W} { color: ${x.css}; }${this._terminalSelector} .${C}${W}.xterm-dim { color: ${a.color.multiplyOpacity(x,.5).css}; }${this._terminalSelector} .${p}${W} { background-color: ${x.css}; }`;M+=`${this._terminalSelector} .${C}${v.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(R.background).css}; }${this._terminalSelector} .${C}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(R.background),.5).css}; }${this._terminalSelector} .${p}${v.INVERTED_DEFAULT_COLOR} { background-color: ${R.foreground.css}; }`,this._themeStyleElement.textContent=M}_setDefaultSpacing(){const R=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${R}px`,this._rowFactory.defaultSpacing=R}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(R,M){for(let j=this._rowElements.length;j<=M;j++){const N=this._document.createElement("div");this._rowContainer.appendChild(N),this._rowElements.push(N)}for(;this._rowElements.length>M;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(R,M){this._refreshRowElements(R,M),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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(R,M,j){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(R,M,j),this.renderRows(0,this._bufferService.rows-1),!R||!M)return;this._selectionRenderModel.update(this._terminal,R,M,j);const N=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,x=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||x<0)return;const L=this._document.createDocumentFragment();if(j){const A=R[0]>M[0];L.appendChild(this._createSelectionElement(W,A?M[0]:R[0],A?R[0]:M[0],x-W+1))}else{const A=N===W?R[0]:0,O=W===K?M[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(W,A,O));const F=x-W-1;if(L.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,F)),W!==x){const U=K===x?M[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(x,0,U))}}this._selectionContainer.appendChild(L)}_createSelectionElement(R,M,j,N=1){const K=this._document.createElement("div"),W=M*this.dimensions.css.cell.width;let x=this.dimensions.css.cell.width*(j-M);return W+x>this.dimensions.css.canvas.width&&(x=this.dimensions.css.canvas.width-W),K.style.height=N*this.dimensions.css.cell.height+"px",K.style.top=R*this.dimensions.css.cell.height+"px",K.style.left=`${W}px`,K.style.width=`${x}px`,K}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 R of this._rowElements)R.replaceChildren()}renderRows(R,M){const j=this._bufferService.buffer,N=j.ybase+j.y,K=Math.min(j.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,x=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=R;A<=M;A++){const O=A+j.ydisp,F=this._rowElements[A],U=j.lines.get(O);if(!F||!U)break;F.replaceChildren(...this._rowFactory.createRow(U,O,O===N,x,L,K,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!0)}_handleLinkLeave(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!1)}_setCellUnderline(R,M,j,N,K,W){j<0&&(R=0),N<0&&(M=0);const x=this._bufferService.rows-1;j=Math.max(Math.min(j,x),0),N=Math.max(Math.min(N,x),0),K=Math.min(K,this._bufferService.cols);const L=this._bufferService.buffer,A=L.ybase+L.y,O=Math.min(L.x,K-1),F=this._optionsService.rawOptions.cursorBlink,U=this._optionsService.rawOptions.cursorStyle,V=this._optionsService.rawOptions.cursorInactiveStyle;for(let G=j;G<=N;++G){const I=G+L.ydisp,D=this._rowElements[G],H=L.lines.get(I);if(!D||!H)break;D.replaceChildren(...this._rowFactory.createRow(H,I,I===A,U,V,O,F,this.dimensions.css.cell.width,this._widthCache,W?G===j?R:0:-1,W?(G===N?M:K)-1:-1))}}};r.DomRenderer=B=l([_(7,d.IInstantiationService),_(8,n.ICharSizeService),_(9,d.IOptionsService),_(10,d.IBufferService),_(11,n.ICoreBrowserService),_(12,n.IThemeService)],B)},3787:function(w,r,s){var l=this&&this.__decorate||function(b,C,p,E){var P,T=arguments.length,B=T<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,p):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,C,p,E);else for(var R=b.length-1;R>=0;R--)(P=b[R])&&(B=(T<3?P(B):T>3?P(C,p,B):P(C,p))||B);return T>3&&B&&Object.defineProperty(C,p,B),B},_=this&&this.__param||function(b,C){return function(p,E){C(p,E,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const h=s(2223),f=s(643),v=s(511),y=s(2585),u=s(8055),n=s(4725),a=s(4269),i=s(6171),o=s(3734);let d=r.DomRendererRowFactory=class{constructor(b,C,p,E,P,T,B){this._document=b,this._characterJoinerService=C,this._optionsService=p,this._coreBrowserService=E,this._coreService=P,this._decorationService=T,this._themeService=B,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,C,p){this._selectionStart=b,this._selectionEnd=C,this._columnSelectMode=p}createRow(b,C,p,E,P,T,B,R,M,j,N){const K=[],W=this._characterJoinerService.getJoinedCharacters(C),x=this._themeService.colors;let L,A=b.getNoBgTrimmedLength();p&&A<T+1&&(A=T+1);let O=0,F="",U=0,V=0,G=0,I=!1,D=0,H=!1,$=0;const q=[],Z=j!==-1&&N!==-1;for(let X=0;X<A;X++){b.loadCell(X,this._workCell);let se=this._workCell.getWidth();if(se===0)continue;let ne=!1,ce=X,J=this._workCell;if(W.length>0&&X===W[0][0]){ne=!0;const re=W.shift();J=new a.JoinedCellData(this._workCell,b.translateToString(!0,re[0],re[1]),re[1]-re[0]),ce=re[1]-1,se=J.getWidth()}const De=this._isCellInSelection(X,C),rt=p&&X===T,it=Z&&X>=j&&X<=N;let st=!1;this._decorationService.forEachDecorationAtCell(X,C,void 0,re=>{st=!0});let $e=J.getChars()||f.WHITESPACE_CELL_CHAR;if($e===" "&&(J.isUnderline()||J.isOverline())&&($e=" "),$=se*R-M.get($e,J.isBold(),J.isItalic()),L){if(O&&(De&&H||!De&&!H&&J.bg===U)&&(De&&H&&x.selectionForeground||J.fg===V)&&J.extended.ext===G&&it===I&&$===D&&!rt&&!ne&&!st){J.isInvisible()?F+=f.WHITESPACE_CELL_CHAR:F+=$e,O++;continue}O&&(L.textContent=F),L=this._document.createElement("span"),O=0,F=""}else L=this._document.createElement("span");if(U=J.bg,V=J.fg,G=J.extended.ext,I=it,D=$,H=De,ne&&T>=X&&T<=ce&&(T=X),!this._coreService.isCursorHidden&&rt&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&q.push("xterm-cursor-blink"),q.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(P)switch(P){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline")}}if(J.isBold()&&q.push("xterm-bold"),J.isItalic()&&q.push("xterm-italic"),J.isDim()&&q.push("xterm-dim"),F=J.isInvisible()?f.WHITESPACE_CELL_CHAR:J.getChars()||f.WHITESPACE_CELL_CHAR,J.isUnderline()&&(q.push(`xterm-underline-${J.extended.underlineStyle}`),F===" "&&(F=" "),!J.isUnderlineColorDefault()))if(J.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${o.AttributeData.toColorRGB(J.getUnderlineColor()).join(",")})`;else{let re=J.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&J.isBold()&&re<8&&(re+=8),L.style.textDecorationColor=x.ansi[re].css}J.isOverline()&&(q.push("xterm-overline"),F===" "&&(F=" ")),J.isStrikethrough()&&q.push("xterm-strikethrough"),it&&(L.style.textDecoration="underline");let le=J.getFgColor(),Re=J.getFgColorMode(),fe=J.getBgColor(),Le=J.getBgColorMode();const nt=!!J.isInverse();if(nt){const re=le;le=fe,fe=re;const jr=Re;Re=Le,Le=jr}let ve,We,ge,Ae=!1;switch(this._decorationService.forEachDecorationAtCell(X,C,void 0,re=>{re.options.layer!=="top"&&Ae||(re.backgroundColorRGB&&(Le=50331648,fe=re.backgroundColorRGB.rgba>>8&16777215,ve=re.backgroundColorRGB),re.foregroundColorRGB&&(Re=50331648,le=re.foregroundColorRGB.rgba>>8&16777215,We=re.foregroundColorRGB),Ae=re.options.layer==="top")}),!Ae&&De&&(ve=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,fe=ve.rgba>>8&16777215,Le=50331648,Ae=!0,x.selectionForeground&&(Re=50331648,le=x.selectionForeground.rgba>>8&16777215,We=x.selectionForeground)),Ae&&q.push("xterm-decoration-top"),Le){case 16777216:case 33554432:ge=x.ansi[fe],q.push(`xterm-bg-${fe}`);break;case 50331648:ge=u.channels.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(L,`background-color:#${S((fe>>>0).toString(16),"0",6)}`);break;default:nt?(ge=x.foreground,q.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):ge=x.background}switch(ve||J.isDim()&&(ve=u.color.multiplyOpacity(ge,.5)),Re){case 16777216:case 33554432:J.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(L,ge,x.ansi[le],J,ve,void 0)||q.push(`xterm-fg-${le}`);break;case 50331648:const re=u.channels.toColor(le>>16&255,le>>8&255,255&le);this._applyMinimumContrast(L,ge,re,J,ve,We)||this._addStyle(L,`color:#${S(le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,ge,x.foreground,J,ve,We)||nt&&q.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}q.length&&(L.className=q.join(" "),q.length=0),rt||ne||st?L.textContent=F:O++,$!==this.defaultSpacing&&(L.style.letterSpacing=`${$}px`),K.push(L),X=ce}return L&&O&&(L.textContent=F),K}_applyMinimumContrast(b,C,p,E,P,T){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const B=this._getContrastCache(E);let R;if(P||T||(R=B.getColor(C.rgba,p.rgba)),R===void 0){const M=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);R=u.color.ensureContrastRatio(P||C,T||p,M),B.setColor((P||C).rgba,(T||p).rgba,R??null)}return!!R&&(this._addStyle(b,`color:${R.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,C){b.setAttribute("style",`${b.getAttribute("style")||""}${C};`)}_isCellInSelection(b,C){const p=this._selectionStart,E=this._selectionEnd;return!(!p||!E)&&(this._columnSelectMode?p[0]<=E[0]?b>=p[0]&&C>=p[1]&&b<E[0]&&C<=E[1]:b<p[0]&&C>=p[1]&&b>=E[0]&&C<=E[1]:C>p[1]&&C<E[1]||p[1]===E[1]&&C===p[1]&&b>=p[0]&&b<E[0]||p[1]<E[1]&&C===E[1]&&b<E[0]||p[1]<E[1]&&C===p[1]&&b>=p[0])}};function S(b,C,p){for(;b.length<p;)b=C+b;return b}r.DomRendererRowFactory=d=l([_(1,n.ICharacterJoinerService),_(2,y.IOptionsService),_(3,n.ICoreBrowserService),_(4,y.ICoreService),_(5,y.IDecorationService),_(6,n.IThemeService)],d)},2550:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(s,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=s.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 _=s.createElement("span");_.classList.add("xterm-char-measure-element");const h=s.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const f=s.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";const v=s.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[_,h,f,v],this._container.appendChild(_),this._container.appendChild(h),this._container.appendChild(f),this._container.appendChild(v),l.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(s,l,_,h){s===this._font&&l===this._fontSize&&_===this._weight&&h===this._weightBold||(this._font=s,this._fontSize=l,this._weight=_,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(s,l,_){let h=0;if(!l&&!_&&s.length===1&&(h=s.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const y=this._measure(s,0);return y>0&&(this._flat[h]=y),y}let f=s;l&&(f+="B"),_&&(f+="I");let v=this._holey.get(f);if(v===void 0){let y=0;l&&(y|=1),_&&(y|=2),v=this._measure(s,y),v>0&&this._holey.set(f,v)}return v}_measure(s,l){const _=this._measureElements[l];return _.textContent=s.repeat(32),_.offsetWidth/32}}},2223:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const l=s(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(w,r)=>{function s(_){return 57508<=_&&_<=57558}function l(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},r.isPowerlineGlyph=s,r.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},r.isEmoji=l,r.allowRescaling=function(_,h,f,v){return h===1&&f>Math.ceil(1.5*v)&&_!==void 0&&_>255&&!l(_)&&!s(_)&&!function(y){return 57344<=y&&y<=63743}(_)},r.treatGlyphAsBackgroundColor=function(_){return s(_)||function(h){return 9472<=h&&h<=9631}(_)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},r.computeNextVariantOffset=function(_,h,f=0){return(_-(2*Math.round(h)-f))%(2*Math.round(h))}},6052:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class s{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(_,h,f,v=!1){if(this.selectionStart=h,this.selectionEnd=f,!h||!f||h[0]===f[0]&&h[1]===f[1])return void this.clear();const y=_.buffers.active.ydisp,u=h[1]-y,n=f[1]-y,a=Math.max(u,0),i=Math.min(n,_.rows-1);a>=_.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=u,this.viewportEndRow=n,this.viewportCappedStartRow=a,this.viewportCappedEndRow=i,this.startCol=h[0],this.endCol=f[0])}isCellSelected(_,h,f){return!!this.hasSelection&&(f-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&f>=this.viewportCappedStartRow&&h<this.endCol&&f<=this.viewportCappedEndRow:h<this.startCol&&f>=this.viewportCappedStartRow&&h>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&h>=this.startCol)}}r.createSelectionRenderModel=function(){return new s}},456:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(s){this._bufferService=s,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 s=this.selectionStart[0]+this.selectionStartLength;return s>this._bufferService.cols?s%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(s/this._bufferService.cols)-1]:[s%this._bufferService.cols,this.selectionStart[1]+Math.floor(s/this._bufferService.cols)]:[s,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const s=this.selectionStart[0]+this.selectionStartLength;return s>this._bufferService.cols?[s%this._bufferService.cols,this.selectionStart[1]+Math.floor(s/this._bufferService.cols)]:[Math.max(s,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const s=this.selectionStart,l=this.selectionEnd;return!(!s||!l)&&(s[1]>l[1]||s[1]===l[1]&&s[0]>l[0])}handleTrim(s){return this.selectionStart&&(this.selectionStart[1]-=s),this.selectionEnd&&(this.selectionEnd[1]-=s),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(w,r,s){var l=this&&this.__decorate||function(i,o,d,S){var b,C=arguments.length,p=C<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,d,S);else for(var E=i.length-1;E>=0;E--)(b=i[E])&&(p=(C<3?b(p):C>3?b(o,d,p):b(o,d))||p);return C>3&&p&&Object.defineProperty(o,d,p),p},_=this&&this.__param||function(i,o){return function(d,S){o(d,S,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const h=s(2585),f=s(8460),v=s(844);let y=r.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(i,o,d){super(),this._optionsService=d,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new n(i,o,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};r.CharSizeService=y=l([_(2,h.IOptionsService)],y);class u extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(o,d){o!==void 0&&o>0&&d!==void 0&&d>0&&(this._result.width=o,this._result.height=d)}}class n extends u{constructor(o,d,S){super(),this._document=o,this._parentElement=d,this._optionsService=S,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 a extends u{constructor(o){super(),this._optionsService=o,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const d=this._ctx.measureText("W");if(!("width"in d&&"fontBoundingBoxAscent"in d&&"fontBoundingBoxDescent"in d))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const o=this._ctx.measureText("W");return this._validateAndSet(o.width,o.fontBoundingBoxAscent+o.fontBoundingBoxDescent),this._result}}},4269:function(w,r,s){var l=this&&this.__decorate||function(a,i,o,d){var S,b=arguments.length,C=b<3?i:d===null?d=Object.getOwnPropertyDescriptor(i,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(a,i,o,d);else for(var p=a.length-1;p>=0;p--)(S=a[p])&&(C=(b<3?S(C):b>3?S(i,o,C):S(i,o))||C);return b>3&&C&&Object.defineProperty(i,o,C),C},_=this&&this.__param||function(a,i){return function(o,d){i(o,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const h=s(3734),f=s(643),v=s(511),y=s(2585);class u extends h.AttributeData{constructor(i,o,d){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=o,this._width=d}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=u;let n=r.CharacterJoinerService=class wr{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(i){const o={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(o),o.id}deregister(i){for(let o=0;o<this._characterJoiners.length;o++)if(this._characterJoiners[o].id===i)return this._characterJoiners.splice(o,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const o=this._bufferService.buffer.lines.get(i);if(!o||o.length===0)return[];const d=[],S=o.translateToString(!0);let b=0,C=0,p=0,E=o.getFg(0),P=o.getBg(0);for(let T=0;T<o.getTrimmedLength();T++)if(o.loadCell(T,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==P){if(T-b>1){const B=this._getJoinedRanges(S,p,C,o,b);for(let R=0;R<B.length;R++)d.push(B[R])}b=T,p=C,E=this._workCell.fg,P=this._workCell.bg}C+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const T=this._getJoinedRanges(S,p,C,o,b);for(let B=0;B<T.length;B++)d.push(T[B])}return d}_getJoinedRanges(i,o,d,S,b){const C=i.substring(o,d);let p=[];try{p=this._characterJoiners[0].handler(C)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const P=this._characterJoiners[E].handler(C);for(let T=0;T<P.length;T++)wr._mergeRanges(p,P[T])}catch(P){console.error(P)}return this._stringRangesToCellRanges(p,S,b),p}_stringRangesToCellRanges(i,o,d){let S=0,b=!1,C=0,p=i[S];if(p){for(let E=d;E<this._bufferService.cols;E++){const P=o.getWidth(E),T=o.getString(E).length||f.WHITESPACE_CELL_CHAR.length;if(P!==0){if(!b&&p[0]<=C&&(p[0]=E,b=!0),p[1]<=C){if(p[1]=E,p=i[++S],!p)break;p[0]<=C?(p[0]=E,b=!0):b=!1}C+=T}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(i,o){let d=!1;for(let S=0;S<i.length;S++){const b=i[S];if(d){if(o[1]<=b[0])return i[S-1][1]=o[1],i;if(o[1]<=b[1])return i[S-1][1]=Math.max(o[1],b[1]),i.splice(S,1),i;i.splice(S,1),S--}else{if(o[1]<=b[0])return i.splice(S,0,o),i;if(o[1]<=b[1])return b[0]=Math.min(o[0],b[0]),i;o[0]<b[1]&&(b[0]=Math.min(o[0],b[0]),d=!0)}}return d?i[i.length-1][1]=o[1]:i.push(o),i}};r.CharacterJoinerService=n=l([_(0,y.IBufferService)],n)},5114:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const l=s(844),_=s(8460),h=s(3656);class f extends l.Disposable{constructor(u,n,a){super(),this._textarea=u,this._window=n,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(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(i=>this._screenDprMonitor.setWindow(i))),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(u){this._window!==u&&(this._window=u,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}}r.CoreBrowserService=f;class v extends l.Disposable{constructor(u){super(),this._parentWindow=u,this._windowResizeListener=this.register(new l.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,l.toDisposable)(()=>this.clearListener()))}setWindow(u){this._parentWindow=u,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.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:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const l=s(844);class _ extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const v=this.linkProviders.indexOf(f);v!==-1&&this.linkProviders.splice(v,1)}}}}r.LinkProviderService=_},8934:function(w,r,s){var l=this&&this.__decorate||function(y,u,n,a){var i,o=arguments.length,d=o<3?u:a===null?a=Object.getOwnPropertyDescriptor(u,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(y,u,n,a);else for(var S=y.length-1;S>=0;S--)(i=y[S])&&(d=(o<3?i(d):o>3?i(u,n,d):i(u,n))||d);return o>3&&d&&Object.defineProperty(u,n,d),d},_=this&&this.__param||function(y,u){return function(n,a){u(n,a,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const h=s(4725),f=s(9806);let v=r.MouseService=class{constructor(y,u){this._renderService=y,this._charSizeService=u}getCoords(y,u,n,a,i){return(0,f.getCoords)(window,y,u,n,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(y,u){const n=(0,f.getCoordsRelativeToElement)(window,y,u);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};r.MouseService=v=l([_(0,h.IRenderService),_(1,h.ICharSizeService)],v)},3230:function(w,r,s){var l=this&&this.__decorate||function(i,o,d,S){var b,C=arguments.length,p=C<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,d,S);else for(var E=i.length-1;E>=0;E--)(b=i[E])&&(p=(C<3?b(p):C>3?b(o,d,p):b(o,d))||p);return C>3&&p&&Object.defineProperty(o,d,p),p},_=this&&this.__param||function(i,o){return function(d,S){o(d,S,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const h=s(6193),f=s(4725),v=s(8460),y=s(844),u=s(7226),n=s(2585);let a=r.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(i,o,d,S,b,C,p,E){super(),this._rowCount=i,this._charSizeService=S,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new u.DebouncedIdleTask,this._observerDisposable=this.register(new y.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 v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((P,T)=>this._renderRows(P,T),p),this.register(this._renderDebouncer),this.register(p.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(C.onResize(()=>this._fullRefresh())),this.register(C.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(d.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(b.onDecorationRegistered(()=>this._fullRefresh())),this.register(b.onDecorationRemoved(()=>this._fullRefresh())),this.register(d.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()})),this.register(d.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(C.buffer.y,C.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(p.window,o),this.register(p.onWindowChange(P=>this._registerIntersectionObserver(P,o)))}_registerIntersectionObserver(i,o){if("IntersectionObserver"in i){const d=new i.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});d.observe(o),this._observerDisposable.value=(0,y.toDisposable)(()=>d.disconnect())}}_handleIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(i,o,d=!1){this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,o,this._rowCount))}_renderRows(i,o){this._renderer.value&&(i=Math.min(i,this._rowCount-1),o=Math.min(o,this._rowCount-1),this._renderer.value.renderRows(i,o),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:o}),this._onRender.fire({start:i,end:o}),this._isNextRenderRedrawOnly=!0)}resize(i,o){this._rowCount=o,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(i){this._renderer.value=i,this._renderer.value&&(this._renderer.value.onRequestRedraw(o=>this.refreshRows(o.start,o.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(i,o){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(i,o)):this._renderer.value.handleResize(i,o),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(i,o,d){this._selectionState.start=i,this._selectionState.end=o,this._selectionState.columnSelectMode=d,this._renderer.value?.handleSelectionChanged(i,o,d)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=a=l([_(2,n.IOptionsService),_(3,f.ICharSizeService),_(4,n.IDecorationService),_(5,n.IBufferService),_(6,f.ICoreBrowserService),_(7,f.IThemeService)],a)},9312:function(w,r,s){var l=this&&this.__decorate||function(p,E,P,T){var B,R=arguments.length,M=R<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,P):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,E,P,T);else for(var j=p.length-1;j>=0;j--)(B=p[j])&&(M=(R<3?B(M):R>3?B(E,P,M):B(E,P))||M);return R>3&&M&&Object.defineProperty(E,P,M),M},_=this&&this.__param||function(p,E){return function(P,T){E(P,T,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const h=s(9806),f=s(9504),v=s(456),y=s(4725),u=s(8460),n=s(844),a=s(6114),i=s(4841),o=s(511),d=s(2585),S=" ",b=new RegExp(S,"g");let C=r.SelectionService=class extends n.Disposable{constructor(p,E,P,T,B,R,M,j,N){super(),this._element=p,this._screenElement=E,this._linkifier=P,this._bufferService=T,this._coreService=B,this._mouseService=R,this._optionsService=M,this._renderService=j,this._coreBrowserService=N,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new o.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(K=>this._handleTrim(K)),this.register(this._bufferService.buffers.onBufferActivate(K=>this._handleBufferActivate(K))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.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 p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!p||!E||p[0]===E[0]&&p[1]===E[1])}get selectionText(){const p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!p||!E)return"";const P=this._bufferService.buffer,T=[];if(this._activeSelectionMode===3){if(p[0]===E[0])return"";const B=p[0]<E[0]?p[0]:E[0],R=p[0]<E[0]?E[0]:p[0];for(let M=p[1];M<=E[1];M++){const j=P.translateBufferLineToString(M,!0,B,R);T.push(j)}}else{const B=p[1]===E[1]?E[0]:void 0;T.push(P.translateBufferLineToString(p[1],!0,p[0],B));for(let R=p[1]+1;R<=E[1]-1;R++){const M=P.lines.get(R),j=P.translateBufferLineToString(R,!0);M?.isWrapped?T[T.length-1]+=j:T.push(j)}if(p[1]!==E[1]){const R=P.lines.get(E[1]),M=P.translateBufferLineToString(E[1],!0,0,E[0]);R&&R.isWrapped?T[T.length-1]+=M:T.push(M)}}return T.map(B=>B.replace(b," ")).join(a.isWindows?`\r
5
+ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=v=l([_(0,f.IBufferService),_(1,f.IOptionsService),_(2,f.IOscLinkService)],v)},6193:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(s,l){this._renderCallback=s,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(s){return this._refreshCallbacks.push(s),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(s,l,_){this._rowCount=_,s=s!==void 0?s:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,s):s,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,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 s=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(s,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const s of this._refreshCallbacks)s(0);this._refreshCallbacks=[]}}},3236:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const l=s(3614),_=s(3656),h=s(3551),f=s(9042),v=s(3730),y=s(1680),u=s(3107),n=s(5744),a=s(2950),i=s(1296),o=s(428),d=s(4269),S=s(5114),b=s(8934),C=s(3230),p=s(9312),E=s(4725),P=s(6731),T=s(8055),B=s(8969),D=s(8460),M=s(844),j=s(6114),N=s(8437),K=s(2584),W=s(7399),x=s(5941),L=s(9074),A=s(2585),O=s(5435),F=s(4567),U=s(779);class V extends B.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(I={}){super(I),this.browser=j,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new M.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(U.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,H)=>this.refresh(R,H))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(R=>this._reportWindowsOptions(R))),this.register(this._inputHandler.onColor(R=>this._handleColorEvent(R))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(R=>this._afterResize(R.cols,R.rows))),this.register((0,M.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(I){if(this._themeService)for(const R of I){let H,$="";switch(R.index){case 256:H="foreground",$="10";break;case 257:H="background",$="11";break;case 258:H="cursor",$="12";break;default:H="ansi",$="4;"+R.index}switch(R.type){case 0:const q=T.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${$};${(0,x.toRgbString)(q)}${K.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors(Z=>Z.ansi[R.index]=T.channels.toColor(...R.color));else{const Z=H;this._themeService.modifyColors(X=>X[Z]=T.channels.toColor(...R.color))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(I){I?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(I){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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(K.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 I=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(I);if(!R)return;const H=Math.min(this.buffer.x,this.cols-1),$=this._renderService.dimensions.css.cell.height,q=R.getWidth(H),Z=this._renderService.dimensions.css.cell.width*q,X=this.buffer.y*this._renderService.dimensions.css.cell.height,se=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=X+"px",this.textarea.style.width=Z+"px",this.textarea.style.height=$+"px",this.textarea.style.lineHeight=$+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",R=>{this.hasSelection()&&(0,l.copyHandler)(R,this._selectionService)}));const I=R=>(0,l.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,_.addDisposableDomListener)(this.element,"paste",I)),j.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",R=>{R.button===2&&(0,l.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",R=>{(0,l.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),j.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",R=>{R.button===1&&(0,l.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",I=>this._keyUp(I),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",I=>this._keyDown(I),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",I=>this._keyPress(I),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",I=>this._compositionHelper.compositionupdate(I))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",I=>this._inputEvent(I),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(I){if(!I)throw new Error("Terminal requires a parent element.");if(I.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=I.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"),I.appendChild(this.element);const R=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.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",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),R.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),j.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(S.CoreBrowserService,this.textarea,I.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(o.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(P.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(d.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(R);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.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(p.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(u.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),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(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const I=this,R=this.element;function H(Z){const X=I._mouseService.getMouseReportCoords(Z,I.screenElement);if(!X)return!1;let se,ne;switch(Z.overrideType||Z.type){case"mousemove":ne=32,Z.buttons===void 0?(se=3,Z.button!==void 0&&(se=Z.button<3?Z.button:3)):se=1&Z.buttons?0:4&Z.buttons?1:2&Z.buttons?2:3;break;case"mouseup":ne=0,se=Z.button<3?Z.button:3;break;case"mousedown":ne=1,se=Z.button<3?Z.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(Z)===!1||I.viewport.getLinesScrolled(Z)===0)return!1;ne=Z.deltaY<0?0:1,se=4;break;default:return!1}return!(ne===void 0||se===void 0||se>4)&&I.coreMouseService.triggerMouseEvent({col:X.col,row:X.row,x:X.x,y:X.y,button:se,action:ne,ctrl:Z.ctrlKey,alt:Z.altKey,shift:Z.shiftKey})}const $={mouseup:null,wheel:null,mousedrag:null,mousemove:null},q={mouseup:Z=>(H(Z),Z.buttons||(this._document.removeEventListener("mouseup",$.mouseup),$.mousedrag&&this._document.removeEventListener("mousemove",$.mousedrag)),this.cancel(Z)),wheel:Z=>(H(Z),this.cancel(Z,!0)),mousedrag:Z=>{Z.buttons&&H(Z)},mousemove:Z=>{Z.buttons||H(Z)}};this.register(this.coreMouseService.onProtocolChange(Z=>{Z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Z)),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&Z?$.mousemove||(R.addEventListener("mousemove",q.mousemove),$.mousemove=q.mousemove):(R.removeEventListener("mousemove",$.mousemove),$.mousemove=null),16&Z?$.wheel||(R.addEventListener("wheel",q.wheel,{passive:!1}),$.wheel=q.wheel):(R.removeEventListener("wheel",$.wheel),$.wheel=null),2&Z?$.mouseup||($.mouseup=q.mouseup):(this._document.removeEventListener("mouseup",$.mouseup),$.mouseup=null),4&Z?$.mousedrag||($.mousedrag=q.mousedrag):(this._document.removeEventListener("mousemove",$.mousedrag),$.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(R,"mousedown",Z=>{if(Z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Z))return H(Z),$.mouseup&&this._document.addEventListener("mouseup",$.mouseup),$.mousedrag&&this._document.addEventListener("mousemove",$.mousedrag),this.cancel(Z)})),this.register((0,_.addDisposableDomListener)(R,"wheel",Z=>{if(!$.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Z)===!1)return!1;if(!this.buffer.hasScrollback){const X=this.viewport.getLinesScrolled(Z);if(X===0)return;const se=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Z.deltaY<0?"A":"B");let ne="";for(let ce=0;ce<Math.abs(X);ce++)ne+=se;return this.coreService.triggerDataEvent(ne,!0),this.cancel(Z,!0)}return this.viewport.handleWheel(Z)?this.cancel(Z):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(R,"touchstart",Z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Z),this.cancel(Z)},{passive:!0})),this.register((0,_.addDisposableDomListener)(R,"touchmove",Z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Z)?void 0:this.cancel(Z)},{passive:!1}))}refresh(I,R){this._renderService?.refreshRows(I,R)}updateCursorStyle(I){this._selectionService?.shouldColumnSelect(I)?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(I,R,H=0){H===1?(super.scrollLines(I,R,H),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(I)}paste(I){(0,l.paste)(I,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(I){this._customKeyEventHandler=I}attachCustomWheelEventHandler(I){this._customWheelEventHandler=I}registerLinkProvider(I){return this._linkProviderService.registerLinkProvider(I)}registerCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(I);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(I)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(I){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+I)}registerDecoration(I){return this._decorationService.registerDecoration(I)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(I,R,H){this._selectionService.setSelection(I,R,H)}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(I,R){this._selectionService?.selectLines(I,R)}_keyDown(I){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&I.altKey;if(!R&&!this._compositionHelper.keydown(I))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||I.key!=="Dead"&&I.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,W.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),H.type===3||H.type===2){const $=this.rows-1;return this.scrollLines(H.type===2?-$:$),this.cancel(I,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,I)||(H.cancel&&this.cancel(I,!0),!H.key||!!(I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.key.length===1&&I.key.charCodeAt(0)>=65&&I.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(H.key!==K.C0.ETX&&H.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||I.altKey||I.ctrlKey?this.cancel(I,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(I,R){const H=I.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||I.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||I.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?H:H&&(!R.keyCode||R.keyCode>47)}_keyUp(I){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1||(function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18}(I)||this.focus(),this.updateCursorStyle(I),this._keyPressHandled=!1)}_keyPress(I){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;if(this.cancel(I),I.charCode)R=I.charCode;else if(I.which===null||I.which===void 0)R=I.keyCode;else{if(I.which===0||I.charCode===0)return!1;R=I.which}return!(!R||(I.altKey||I.ctrlKey||I.metaKey)&&!this._isThirdLevelShift(this.browser,I)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(I){if(I.data&&I.inputType==="insertText"&&(!I.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=I.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(I),!0}return!1}resize(I,R){I!==this.cols||R!==this.rows?super.resize(I,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(I,R){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 I=1;I<this.rows;I++)this.buffer.lines.push(this.buffer.getBlankLine(N.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 I=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${H};${R}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const $=this._renderService.dimensions.css.cell.width.toFixed(0),q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${q};${$}t`)}}cancel(I,R){if(this.options.cancelEvents||R)return I.preventDefault(),I.stopPropagation(),!1}}r.Terminal=V},9924:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(s,l=1e3){this._renderCallback=s,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(s,l,_){this._rowCount=_,s=s!==void 0?s:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,s):s,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=h-this._lastRefreshMs,v=this._debounceThresholdMS-f;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const s=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(s,l)}}},1680:function(w,r,s){var l=this&&this.__decorate||function(a,i,o,d){var S,b=arguments.length,C=b<3?i:d===null?d=Object.getOwnPropertyDescriptor(i,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(a,i,o,d);else for(var p=a.length-1;p>=0;p--)(S=a[p])&&(C=(b<3?S(C):b>3?S(i,o,C):S(i,o))||C);return b>3&&C&&Object.defineProperty(i,o,C),C},_=this&&this.__param||function(a,i){return function(o,d){i(o,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const h=s(3656),f=s(4725),v=s(8460),y=s(844),u=s(2585);let n=r.Viewport=class extends y.Disposable{constructor(a,i,o,d,S,b,C,p){super(),this._viewportElement=a,this._scrollArea=i,this._bufferService=o,this._optionsService=d,this._charSizeService=S,this._renderService=b,this._coreBrowserService=C,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 v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(p.colors),this.register(p.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.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(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const i=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==i&&(this._lastRecordedBufferHeight=i,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<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(a,i){const o=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&o<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const i=this._getPixelsScrolled(a);return i!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+i:this._smoothScrollState.target+=i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=i,this._bubbleScroll(a,i))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const i=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let i=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i}getBufferElements(a,i){let o,d="";const S=[],b=i??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let p=a;p<b;p++){const E=C.get(p);if(!E)continue;const P=C.get(p+1)?.isWrapped;if(d+=E.translateToString(!P),!P||p===C.length-1){const T=document.createElement("div");T.textContent=d,S.push(T),d.length>0&&(o=T),d=""}}return{bufferElements:S,cursorElement:o}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let i=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(a,i){const o=this._optionsService.rawOptions.fastScrollModifier;return o==="alt"&&i.altKey||o==="ctrl"&&i.ctrlKey||o==="shift"&&i.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const i=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(a,i))}};r.Viewport=n=l([_(2,u.IBufferService),_(3,u.IOptionsService),_(4,f.ICharSizeService),_(5,f.IRenderService),_(6,f.ICoreBrowserService),_(7,f.IThemeService)],n)},3107:function(w,r,s){var l=this&&this.__decorate||function(u,n,a,i){var o,d=arguments.length,S=d<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,n,a,i);else for(var b=u.length-1;b>=0;b--)(o=u[b])&&(S=(d<3?o(S):d>3?o(n,a,S):o(n,a))||S);return d>3&&S&&Object.defineProperty(n,a,S),S},_=this&&this.__param||function(u,n){return function(a,i){n(a,i,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const h=s(4725),f=s(844),v=s(2585);let y=r.BufferDecorationRenderer=class extends f.Disposable{constructor(u,n,a,i,o){super(),this._screenElement=u,this._bufferService=n,this._coreBrowserService=a,this._decorationService=i,this._renderService=o,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(d=>this._removeDecoration(d))),this.register((0,f.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",u?.options?.layer==="top"),n.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=u.options.x??0;return a&&a>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(u,n),n}_refreshStyle(u){const n=u.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let a=this._decorationElements.get(u);a||(a=this._createElement(u),u.element=a,this._decorationElements.set(u,a),this._container.appendChild(a),u.onDispose(()=>{this._decorationElements.delete(u),a.remove()})),a.style.top=n*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(a)}}_refreshXPosition(u,n=u.element){if(!n)return;const a=u.options.x??0;(u.options.anchor||"left")==="right"?n.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){this._decorationElements.get(u)?.remove(),this._decorationElements.delete(u),u.dispose()}};r.BufferDecorationRenderer=y=l([_(1,v.IBufferService),_(2,h.ICoreBrowserService),_(3,v.IDecorationService),_(4,h.IRenderService)],y)},5871:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(s){if(s.options.overviewRulerOptions){for(const l of this._zones)if(l.color===s.options.overviewRulerOptions.color&&l.position===s.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,s.marker.line))return;if(this._lineAdjacentToZone(l,s.marker.line,s.options.overviewRulerOptions.position))return void this._addLineToZone(l,s.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=s.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=s.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=s.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=s.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:s.options.overviewRulerOptions.color,position:s.options.overviewRulerOptions.position,startBufferLine:s.marker.line,endBufferLine:s.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(s){this._linePadding=s}_lineIntersectsZone(s,l){return l>=s.startBufferLine&&l<=s.endBufferLine}_lineAdjacentToZone(s,l,_){return l>=s.startBufferLine-this._linePadding[_||"full"]&&l<=s.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(s,l){s.startBufferLine=Math.min(s.startBufferLine,l),s.endBufferLine=Math.max(s.endBufferLine,l)}}},5744:function(w,r,s){var l=this&&this.__decorate||function(o,d,S,b){var C,p=arguments.length,E=p<3?d:b===null?b=Object.getOwnPropertyDescriptor(d,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,d,S,b);else for(var P=o.length-1;P>=0;P--)(C=o[P])&&(E=(p<3?C(E):p>3?C(d,S,E):C(d,S))||E);return p>3&&E&&Object.defineProperty(d,S,E),E},_=this&&this.__param||function(o,d){return function(S,b){d(S,b,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const h=s(5871),f=s(4725),v=s(844),y=s(2585),u={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let i=r.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(o,d,S,b,C,p,E){super(),this._viewportElement=o,this._screenElement=d,this._bufferService=S,this._decorationService=b,this._renderService=C,this._optionsService=p,this._coreBrowserService=E,this._colorZoneStore=new h.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 P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.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 o=Math.floor(this._canvas.width/3),d=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=o,n.center=d,n.right=o,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=n.left,a.right=n.left+n.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowserService.dpr);const o=this._canvas.height/this._bufferService.buffer.lines.length,d=Math.round(Math.max(Math.min(o,12),6)*this._coreBrowserService.dpr);u.left=d,u.center=d,u.right=d}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.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 d of this._decorationService.decorations)this._colorZoneStore.addDecoration(d);this._ctx.lineWidth=1;const o=this._colorZoneStore.zones;for(const d of o)d.position!=="full"&&this._renderColorZone(d);for(const d of o)d.position==="full"&&this._renderColorZone(d);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(o){this._ctx.fillStyle=o.color,this._ctx.fillRect(a[o.position||"full"],Math.round((this._canvas.height-1)*(o.startBufferLine/this._bufferService.buffers.active.lines.length)-u[o.position||"full"]/2),n[o.position||"full"],Math.round((this._canvas.height-1)*((o.endBufferLine-o.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[o.position||"full"]))}_queueRefresh(o,d){this._shouldUpdateDimensions=o||this._shouldUpdateDimensions,this._shouldUpdateAnchor=d||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=i=l([_(2,y.IBufferService),_(3,y.IDecorationService),_(4,f.IRenderService),_(5,y.IOptionsService),_(6,f.ICoreBrowserService)],i)},2950:function(w,r,s){var l=this&&this.__decorate||function(u,n,a,i){var o,d=arguments.length,S=d<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,n,a,i);else for(var b=u.length-1;b>=0;b--)(o=u[b])&&(S=(d<3?o(S):d>3?o(n,a,S):o(n,a))||S);return d>3&&S&&Object.defineProperty(n,a,S),S},_=this&&this.__param||function(u,n){return function(a,i){n(a,i,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const h=s(4725),f=s(2585),v=s(2584);let y=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(u,n,a,i,o,d){this._textarea=u,this._compositionView=n,this._bufferService=a,this._optionsService=i,this._coreService=o,this._renderService=d,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(u){this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(u){if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}},0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const u=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const n=this._textarea.value,a=n.replace(u,"");this._dataAlreadySent=a,n.length>u.length?this._coreService.triggerDataEvent(a,!0):n.length<u.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):n.length===u.length&&n!==u&&this._coreService.triggerDataEvent(n,!0)}},0)}updateCompositionElements(u){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const d=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(d.width,1)+"px",this._textarea.style.height=Math.max(d.height,1)+"px",this._textarea.style.lineHeight=d.height+"px"}u||setTimeout(()=>this.updateCompositionElements(!0),0)}}};r.CompositionHelper=y=l([_(2,f.IBufferService),_(3,f.IOptionsService),_(4,f.ICoreService),_(5,h.IRenderService)],y)},9806:(w,r)=>{function s(l,_,h){const f=h.getBoundingClientRect(),v=l.getComputedStyle(h),y=parseInt(v.getPropertyValue("padding-left")),u=parseInt(v.getPropertyValue("padding-top"));return[_.clientX-f.left-y,_.clientY-f.top-u]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=s,r.getCoords=function(l,_,h,f,v,y,u,n,a){if(!y)return;const i=s(l,_,h);return i?(i[0]=Math.ceil((i[0]+(a?u/2:0))/u),i[1]=Math.ceil(i[1]/n),i[0]=Math.min(Math.max(i[0],1),f+(a?1:0)),i[1]=Math.min(Math.max(i[1],1),v),i):void 0}},9504:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const l=s(2584);function _(n,a,i,o){const d=n-h(n,i),S=a-h(a,i),b=Math.abs(d-S)-function(C,p,E){let P=0;const T=C-h(C,E),B=p-h(p,E);for(let D=0;D<Math.abs(T-B);D++){const M=f(C,p)==="A"?-1:1;E.buffer.lines.get(T+M*D)?.isWrapped&&P++}return P}(n,a,i);return u(b,y(f(n,a),o))}function h(n,a){let i=0,o=a.buffer.lines.get(n),d=o?.isWrapped;for(;d&&n>=0&&n<a.rows;)i++,o=a.buffer.lines.get(--n),d=o?.isWrapped;return i}function f(n,a){return n>a?"A":"B"}function v(n,a,i,o,d,S){let b=n,C=a,p="";for(;b!==i||C!==o;)b+=d?1:-1,d&&b>S.cols-1?(p+=S.buffer.translateBufferLineToString(C,!1,n,b),b=0,n=0,C++):!d&&b<0&&(p+=S.buffer.translateBufferLineToString(C,!1,0,n+1),b=S.cols-1,n=b,C--);return p+S.buffer.translateBufferLineToString(C,!1,n,b)}function y(n,a){const i=a?"O":"[";return l.C0.ESC+i+n}function u(n,a){n=Math.floor(n);let i="";for(let o=0;o<n;o++)i+=a;return i}r.moveToCellSequence=function(n,a,i,o){const d=i.buffer.x,S=i.buffer.y;if(!i.buffer.hasScrollback)return function(p,E,P,T,B,D){return _(E,T,B,D).length===0?"":u(v(p,E,p,E-h(E,B),!1,B).length,y("D",D))}(d,S,0,a,i,o)+_(S,a,i,o)+function(p,E,P,T,B,D){let M;M=_(E,T,B,D).length>0?T-h(T,B):E;const j=T,N=function(K,W,x,L,A,O){let F;return F=_(x,L,A,O).length>0?L-h(L,A):W,K<x&&F<=L||K>=x&&F<L?"C":"D"}(p,E,P,T,B,D);return u(v(p,M,P,j,N==="C",B).length,y(N,D))}(d,S,n,a,i,o);let b;if(S===a)return b=d>n?"D":"C",u(Math.abs(d-n),y(b,o));b=S>a?"D":"C";const C=Math.abs(S-a);return u(function(p,E){return E.cols-p}(S>a?n:d,i)+(C-1)*i.cols+1+((S>a?d:n)-1),y(b,o))}},1296:function(w,r,s){var l=this&&this.__decorate||function(D,M,j,N){var K,W=arguments.length,x=W<3?M:N===null?N=Object.getOwnPropertyDescriptor(M,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(D,M,j,N);else for(var L=D.length-1;L>=0;L--)(K=D[L])&&(x=(W<3?K(x):W>3?K(M,j,x):K(M,j))||x);return W>3&&x&&Object.defineProperty(M,j,x),x},_=this&&this.__param||function(D,M){return function(j,N){M(j,N,D)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const h=s(3787),f=s(2550),v=s(2223),y=s(6171),u=s(6052),n=s(4725),a=s(8055),i=s(8460),o=s(844),d=s(2585),S="xterm-dom-renderer-owner-",b="xterm-rows",C="xterm-fg-",p="xterm-bg-",E="xterm-focus",P="xterm-selection";let T=1,B=r.DomRenderer=class extends o.Disposable{constructor(D,M,j,N,K,W,x,L,A,O,F,U,V){super(),this._terminal=D,this._document=M,this._element=j,this._screenElement=N,this._viewportElement=K,this._helperContainer=W,this._linkifier2=x,this._charSizeService=A,this._optionsService=O,this._bufferService=F,this._coreBrowserService=U,this._themeService=V,this._terminalClass=T++,this._rowElements=[],this._selectionRenderModel=(0,u.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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(P),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(G=>this._injectCss(G))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(G=>this._handleLinkHover(G))),this.register(this._linkifier2.onHideLinkUnderline(G=>this._handleLinkLeave(G))),this.register((0,o.toDisposable)(()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new f.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const j of this._rowElements)j.style.width=`${this.dimensions.css.canvas.width}px`,j.style.height=`${this.dimensions.css.cell.height}px`,j.style.lineHeight=`${this.dimensions.css.cell.height}px`,j.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const M=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=M,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let M=`${this._terminalSelector} .${b} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;M+=`${this._terminalSelector} .${b} .xterm-dim { color: ${a.color.multiplyOpacity(D.foreground,.5).css};}`,M+=`${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 j=`blink_underline_${this._terminalClass}`,N=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;M+=`@keyframes ${j} { 50% { border-bottom-style: hidden; }}`,M+=`@keyframes ${N} { 50% { box-shadow: none; }}`,M+=`@keyframes ${K} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,M+=`${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${N} 1s step-end infinite;}${this._terminalSelector} .${b}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,M+=`${this._terminalSelector} .${P} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${P} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${P} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[W,x]of D.ansi.entries())M+=`${this._terminalSelector} .${C}${W} { color: ${x.css}; }${this._terminalSelector} .${C}${W}.xterm-dim { color: ${a.color.multiplyOpacity(x,.5).css}; }${this._terminalSelector} .${p}${W} { background-color: ${x.css}; }`;M+=`${this._terminalSelector} .${C}${v.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(D.background).css}; }${this._terminalSelector} .${C}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${p}${v.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=M}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,M){for(let j=this._rowElements.length;j<=M;j++){const N=this._document.createElement("div");this._rowContainer.appendChild(N),this._rowElements.push(N)}for(;this._rowElements.length>M;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,M){this._refreshRowElements(D,M),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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,M,j){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,M,j),this.renderRows(0,this._bufferService.rows-1),!D||!M)return;this._selectionRenderModel.update(this._terminal,D,M,j);const N=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,x=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||x<0)return;const L=this._document.createDocumentFragment();if(j){const A=D[0]>M[0];L.appendChild(this._createSelectionElement(W,A?M[0]:D[0],A?D[0]:M[0],x-W+1))}else{const A=N===W?D[0]:0,O=W===K?M[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(W,A,O));const F=x-W-1;if(L.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,F)),W!==x){const U=K===x?M[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(x,0,U))}}this._selectionContainer.appendChild(L)}_createSelectionElement(D,M,j,N=1){const K=this._document.createElement("div"),W=M*this.dimensions.css.cell.width;let x=this.dimensions.css.cell.width*(j-M);return W+x>this.dimensions.css.canvas.width&&(x=this.dimensions.css.canvas.width-W),K.style.height=N*this.dimensions.css.cell.height+"px",K.style.top=D*this.dimensions.css.cell.height+"px",K.style.left=`${W}px`,K.style.width=`${x}px`,K}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const D of this._rowElements)D.replaceChildren()}renderRows(D,M){const j=this._bufferService.buffer,N=j.ybase+j.y,K=Math.min(j.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,x=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=D;A<=M;A++){const O=A+j.ydisp,F=this._rowElements[A],U=j.lines.get(O);if(!F||!U)break;F.replaceChildren(...this._rowFactory.createRow(U,O,O===N,x,L,K,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,M,j,N,K,W){j<0&&(D=0),N<0&&(M=0);const x=this._bufferService.rows-1;j=Math.max(Math.min(j,x),0),N=Math.max(Math.min(N,x),0),K=Math.min(K,this._bufferService.cols);const L=this._bufferService.buffer,A=L.ybase+L.y,O=Math.min(L.x,K-1),F=this._optionsService.rawOptions.cursorBlink,U=this._optionsService.rawOptions.cursorStyle,V=this._optionsService.rawOptions.cursorInactiveStyle;for(let G=j;G<=N;++G){const I=G+L.ydisp,R=this._rowElements[G],H=L.lines.get(I);if(!R||!H)break;R.replaceChildren(...this._rowFactory.createRow(H,I,I===A,U,V,O,F,this.dimensions.css.cell.width,this._widthCache,W?G===j?D:0:-1,W?(G===N?M:K)-1:-1))}}};r.DomRenderer=B=l([_(7,d.IInstantiationService),_(8,n.ICharSizeService),_(9,d.IOptionsService),_(10,d.IBufferService),_(11,n.ICoreBrowserService),_(12,n.IThemeService)],B)},3787:function(w,r,s){var l=this&&this.__decorate||function(b,C,p,E){var P,T=arguments.length,B=T<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,p):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,C,p,E);else for(var D=b.length-1;D>=0;D--)(P=b[D])&&(B=(T<3?P(B):T>3?P(C,p,B):P(C,p))||B);return T>3&&B&&Object.defineProperty(C,p,B),B},_=this&&this.__param||function(b,C){return function(p,E){C(p,E,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const h=s(2223),f=s(643),v=s(511),y=s(2585),u=s(8055),n=s(4725),a=s(4269),i=s(6171),o=s(3734);let d=r.DomRendererRowFactory=class{constructor(b,C,p,E,P,T,B){this._document=b,this._characterJoinerService=C,this._optionsService=p,this._coreBrowserService=E,this._coreService=P,this._decorationService=T,this._themeService=B,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,C,p){this._selectionStart=b,this._selectionEnd=C,this._columnSelectMode=p}createRow(b,C,p,E,P,T,B,D,M,j,N){const K=[],W=this._characterJoinerService.getJoinedCharacters(C),x=this._themeService.colors;let L,A=b.getNoBgTrimmedLength();p&&A<T+1&&(A=T+1);let O=0,F="",U=0,V=0,G=0,I=!1,R=0,H=!1,$=0;const q=[],Z=j!==-1&&N!==-1;for(let X=0;X<A;X++){b.loadCell(X,this._workCell);let se=this._workCell.getWidth();if(se===0)continue;let ne=!1,ce=X,J=this._workCell;if(W.length>0&&X===W[0][0]){ne=!0;const re=W.shift();J=new a.JoinedCellData(this._workCell,b.translateToString(!0,re[0],re[1]),re[1]-re[0]),ce=re[1]-1,se=J.getWidth()}const Re=this._isCellInSelection(X,C),rt=p&&X===T,it=Z&&X>=j&&X<=N;let st=!1;this._decorationService.forEachDecorationAtCell(X,C,void 0,re=>{st=!0});let $e=J.getChars()||f.WHITESPACE_CELL_CHAR;if($e===" "&&(J.isUnderline()||J.isOverline())&&($e=" "),$=se*D-M.get($e,J.isBold(),J.isItalic()),L){if(O&&(Re&&H||!Re&&!H&&J.bg===U)&&(Re&&H&&x.selectionForeground||J.fg===V)&&J.extended.ext===G&&it===I&&$===R&&!rt&&!ne&&!st){J.isInvisible()?F+=f.WHITESPACE_CELL_CHAR:F+=$e,O++;continue}O&&(L.textContent=F),L=this._document.createElement("span"),O=0,F=""}else L=this._document.createElement("span");if(U=J.bg,V=J.fg,G=J.extended.ext,I=it,R=$,H=Re,ne&&T>=X&&T<=ce&&(T=X),!this._coreService.isCursorHidden&&rt&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&q.push("xterm-cursor-blink"),q.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(P)switch(P){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline")}}if(J.isBold()&&q.push("xterm-bold"),J.isItalic()&&q.push("xterm-italic"),J.isDim()&&q.push("xterm-dim"),F=J.isInvisible()?f.WHITESPACE_CELL_CHAR:J.getChars()||f.WHITESPACE_CELL_CHAR,J.isUnderline()&&(q.push(`xterm-underline-${J.extended.underlineStyle}`),F===" "&&(F=" "),!J.isUnderlineColorDefault()))if(J.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${o.AttributeData.toColorRGB(J.getUnderlineColor()).join(",")})`;else{let re=J.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&J.isBold()&&re<8&&(re+=8),L.style.textDecorationColor=x.ansi[re].css}J.isOverline()&&(q.push("xterm-overline"),F===" "&&(F=" ")),J.isStrikethrough()&&q.push("xterm-strikethrough"),it&&(L.style.textDecoration="underline");let le=J.getFgColor(),De=J.getFgColorMode(),fe=J.getBgColor(),Le=J.getBgColorMode();const nt=!!J.isInverse();if(nt){const re=le;le=fe,fe=re;const Wr=De;De=Le,Le=Wr}let ve,We,ge,Ae=!1;switch(this._decorationService.forEachDecorationAtCell(X,C,void 0,re=>{re.options.layer!=="top"&&Ae||(re.backgroundColorRGB&&(Le=50331648,fe=re.backgroundColorRGB.rgba>>8&16777215,ve=re.backgroundColorRGB),re.foregroundColorRGB&&(De=50331648,le=re.foregroundColorRGB.rgba>>8&16777215,We=re.foregroundColorRGB),Ae=re.options.layer==="top")}),!Ae&&Re&&(ve=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,fe=ve.rgba>>8&16777215,Le=50331648,Ae=!0,x.selectionForeground&&(De=50331648,le=x.selectionForeground.rgba>>8&16777215,We=x.selectionForeground)),Ae&&q.push("xterm-decoration-top"),Le){case 16777216:case 33554432:ge=x.ansi[fe],q.push(`xterm-bg-${fe}`);break;case 50331648:ge=u.channels.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(L,`background-color:#${S((fe>>>0).toString(16),"0",6)}`);break;default:nt?(ge=x.foreground,q.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):ge=x.background}switch(ve||J.isDim()&&(ve=u.color.multiplyOpacity(ge,.5)),De){case 16777216:case 33554432:J.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(L,ge,x.ansi[le],J,ve,void 0)||q.push(`xterm-fg-${le}`);break;case 50331648:const re=u.channels.toColor(le>>16&255,le>>8&255,255&le);this._applyMinimumContrast(L,ge,re,J,ve,We)||this._addStyle(L,`color:#${S(le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,ge,x.foreground,J,ve,We)||nt&&q.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}q.length&&(L.className=q.join(" "),q.length=0),rt||ne||st?L.textContent=F:O++,$!==this.defaultSpacing&&(L.style.letterSpacing=`${$}px`),K.push(L),X=ce}return L&&O&&(L.textContent=F),K}_applyMinimumContrast(b,C,p,E,P,T){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const B=this._getContrastCache(E);let D;if(P||T||(D=B.getColor(C.rgba,p.rgba)),D===void 0){const M=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);D=u.color.ensureContrastRatio(P||C,T||p,M),B.setColor((P||C).rgba,(T||p).rgba,D??null)}return!!D&&(this._addStyle(b,`color:${D.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,C){b.setAttribute("style",`${b.getAttribute("style")||""}${C};`)}_isCellInSelection(b,C){const p=this._selectionStart,E=this._selectionEnd;return!(!p||!E)&&(this._columnSelectMode?p[0]<=E[0]?b>=p[0]&&C>=p[1]&&b<E[0]&&C<=E[1]:b<p[0]&&C>=p[1]&&b>=E[0]&&C<=E[1]:C>p[1]&&C<E[1]||p[1]===E[1]&&C===p[1]&&b>=p[0]&&b<E[0]||p[1]<E[1]&&C===E[1]&&b<E[0]||p[1]<E[1]&&C===p[1]&&b>=p[0])}};function S(b,C,p){for(;b.length<p;)b=C+b;return b}r.DomRendererRowFactory=d=l([_(1,n.ICharacterJoinerService),_(2,y.IOptionsService),_(3,n.ICoreBrowserService),_(4,y.ICoreService),_(5,y.IDecorationService),_(6,n.IThemeService)],d)},2550:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(s,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=s.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 _=s.createElement("span");_.classList.add("xterm-char-measure-element");const h=s.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const f=s.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";const v=s.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[_,h,f,v],this._container.appendChild(_),this._container.appendChild(h),this._container.appendChild(f),this._container.appendChild(v),l.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(s,l,_,h){s===this._font&&l===this._fontSize&&_===this._weight&&h===this._weightBold||(this._font=s,this._fontSize=l,this._weight=_,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(s,l,_){let h=0;if(!l&&!_&&s.length===1&&(h=s.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const y=this._measure(s,0);return y>0&&(this._flat[h]=y),y}let f=s;l&&(f+="B"),_&&(f+="I");let v=this._holey.get(f);if(v===void 0){let y=0;l&&(y|=1),_&&(y|=2),v=this._measure(s,y),v>0&&this._holey.set(f,v)}return v}_measure(s,l){const _=this._measureElements[l];return _.textContent=s.repeat(32),_.offsetWidth/32}}},2223:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const l=s(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(w,r)=>{function s(_){return 57508<=_&&_<=57558}function l(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},r.isPowerlineGlyph=s,r.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},r.isEmoji=l,r.allowRescaling=function(_,h,f,v){return h===1&&f>Math.ceil(1.5*v)&&_!==void 0&&_>255&&!l(_)&&!s(_)&&!function(y){return 57344<=y&&y<=63743}(_)},r.treatGlyphAsBackgroundColor=function(_){return s(_)||function(h){return 9472<=h&&h<=9631}(_)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},r.computeNextVariantOffset=function(_,h,f=0){return(_-(2*Math.round(h)-f))%(2*Math.round(h))}},6052:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class s{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(_,h,f,v=!1){if(this.selectionStart=h,this.selectionEnd=f,!h||!f||h[0]===f[0]&&h[1]===f[1])return void this.clear();const y=_.buffers.active.ydisp,u=h[1]-y,n=f[1]-y,a=Math.max(u,0),i=Math.min(n,_.rows-1);a>=_.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=u,this.viewportEndRow=n,this.viewportCappedStartRow=a,this.viewportCappedEndRow=i,this.startCol=h[0],this.endCol=f[0])}isCellSelected(_,h,f){return!!this.hasSelection&&(f-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&f>=this.viewportCappedStartRow&&h<this.endCol&&f<=this.viewportCappedEndRow:h<this.startCol&&f>=this.viewportCappedStartRow&&h>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&h>=this.startCol)}}r.createSelectionRenderModel=function(){return new s}},456:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(s){this._bufferService=s,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 s=this.selectionStart[0]+this.selectionStartLength;return s>this._bufferService.cols?s%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(s/this._bufferService.cols)-1]:[s%this._bufferService.cols,this.selectionStart[1]+Math.floor(s/this._bufferService.cols)]:[s,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const s=this.selectionStart[0]+this.selectionStartLength;return s>this._bufferService.cols?[s%this._bufferService.cols,this.selectionStart[1]+Math.floor(s/this._bufferService.cols)]:[Math.max(s,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const s=this.selectionStart,l=this.selectionEnd;return!(!s||!l)&&(s[1]>l[1]||s[1]===l[1]&&s[0]>l[0])}handleTrim(s){return this.selectionStart&&(this.selectionStart[1]-=s),this.selectionEnd&&(this.selectionEnd[1]-=s),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(w,r,s){var l=this&&this.__decorate||function(i,o,d,S){var b,C=arguments.length,p=C<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,d,S);else for(var E=i.length-1;E>=0;E--)(b=i[E])&&(p=(C<3?b(p):C>3?b(o,d,p):b(o,d))||p);return C>3&&p&&Object.defineProperty(o,d,p),p},_=this&&this.__param||function(i,o){return function(d,S){o(d,S,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const h=s(2585),f=s(8460),v=s(844);let y=r.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(i,o,d){super(),this._optionsService=d,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new n(i,o,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};r.CharSizeService=y=l([_(2,h.IOptionsService)],y);class u extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(o,d){o!==void 0&&o>0&&d!==void 0&&d>0&&(this._result.width=o,this._result.height=d)}}class n extends u{constructor(o,d,S){super(),this._document=o,this._parentElement=d,this._optionsService=S,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 a extends u{constructor(o){super(),this._optionsService=o,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const d=this._ctx.measureText("W");if(!("width"in d&&"fontBoundingBoxAscent"in d&&"fontBoundingBoxDescent"in d))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const o=this._ctx.measureText("W");return this._validateAndSet(o.width,o.fontBoundingBoxAscent+o.fontBoundingBoxDescent),this._result}}},4269:function(w,r,s){var l=this&&this.__decorate||function(a,i,o,d){var S,b=arguments.length,C=b<3?i:d===null?d=Object.getOwnPropertyDescriptor(i,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(a,i,o,d);else for(var p=a.length-1;p>=0;p--)(S=a[p])&&(C=(b<3?S(C):b>3?S(i,o,C):S(i,o))||C);return b>3&&C&&Object.defineProperty(i,o,C),C},_=this&&this.__param||function(a,i){return function(o,d){i(o,d,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const h=s(3734),f=s(643),v=s(511),y=s(2585);class u extends h.AttributeData{constructor(i,o,d){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=o,this._width=d}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=u;let n=r.CharacterJoinerService=class xr{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(i){const o={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(o),o.id}deregister(i){for(let o=0;o<this._characterJoiners.length;o++)if(this._characterJoiners[o].id===i)return this._characterJoiners.splice(o,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const o=this._bufferService.buffer.lines.get(i);if(!o||o.length===0)return[];const d=[],S=o.translateToString(!0);let b=0,C=0,p=0,E=o.getFg(0),P=o.getBg(0);for(let T=0;T<o.getTrimmedLength();T++)if(o.loadCell(T,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==P){if(T-b>1){const B=this._getJoinedRanges(S,p,C,o,b);for(let D=0;D<B.length;D++)d.push(B[D])}b=T,p=C,E=this._workCell.fg,P=this._workCell.bg}C+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const T=this._getJoinedRanges(S,p,C,o,b);for(let B=0;B<T.length;B++)d.push(T[B])}return d}_getJoinedRanges(i,o,d,S,b){const C=i.substring(o,d);let p=[];try{p=this._characterJoiners[0].handler(C)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const P=this._characterJoiners[E].handler(C);for(let T=0;T<P.length;T++)xr._mergeRanges(p,P[T])}catch(P){console.error(P)}return this._stringRangesToCellRanges(p,S,b),p}_stringRangesToCellRanges(i,o,d){let S=0,b=!1,C=0,p=i[S];if(p){for(let E=d;E<this._bufferService.cols;E++){const P=o.getWidth(E),T=o.getString(E).length||f.WHITESPACE_CELL_CHAR.length;if(P!==0){if(!b&&p[0]<=C&&(p[0]=E,b=!0),p[1]<=C){if(p[1]=E,p=i[++S],!p)break;p[0]<=C?(p[0]=E,b=!0):b=!1}C+=T}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(i,o){let d=!1;for(let S=0;S<i.length;S++){const b=i[S];if(d){if(o[1]<=b[0])return i[S-1][1]=o[1],i;if(o[1]<=b[1])return i[S-1][1]=Math.max(o[1],b[1]),i.splice(S,1),i;i.splice(S,1),S--}else{if(o[1]<=b[0])return i.splice(S,0,o),i;if(o[1]<=b[1])return b[0]=Math.min(o[0],b[0]),i;o[0]<b[1]&&(b[0]=Math.min(o[0],b[0]),d=!0)}}return d?i[i.length-1][1]=o[1]:i.push(o),i}};r.CharacterJoinerService=n=l([_(0,y.IBufferService)],n)},5114:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const l=s(844),_=s(8460),h=s(3656);class f extends l.Disposable{constructor(u,n,a){super(),this._textarea=u,this._window=n,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(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(i=>this._screenDprMonitor.setWindow(i))),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(u){this._window!==u&&(this._window=u,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}}r.CoreBrowserService=f;class v extends l.Disposable{constructor(u){super(),this._parentWindow=u,this._windowResizeListener=this.register(new l.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,l.toDisposable)(()=>this.clearListener()))}setWindow(u){this._parentWindow=u,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.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:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const l=s(844);class _ extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const v=this.linkProviders.indexOf(f);v!==-1&&this.linkProviders.splice(v,1)}}}}r.LinkProviderService=_},8934:function(w,r,s){var l=this&&this.__decorate||function(y,u,n,a){var i,o=arguments.length,d=o<3?u:a===null?a=Object.getOwnPropertyDescriptor(u,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(y,u,n,a);else for(var S=y.length-1;S>=0;S--)(i=y[S])&&(d=(o<3?i(d):o>3?i(u,n,d):i(u,n))||d);return o>3&&d&&Object.defineProperty(u,n,d),d},_=this&&this.__param||function(y,u){return function(n,a){u(n,a,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const h=s(4725),f=s(9806);let v=r.MouseService=class{constructor(y,u){this._renderService=y,this._charSizeService=u}getCoords(y,u,n,a,i){return(0,f.getCoords)(window,y,u,n,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(y,u){const n=(0,f.getCoordsRelativeToElement)(window,y,u);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};r.MouseService=v=l([_(0,h.IRenderService),_(1,h.ICharSizeService)],v)},3230:function(w,r,s){var l=this&&this.__decorate||function(i,o,d,S){var b,C=arguments.length,p=C<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,d,S);else for(var E=i.length-1;E>=0;E--)(b=i[E])&&(p=(C<3?b(p):C>3?b(o,d,p):b(o,d))||p);return C>3&&p&&Object.defineProperty(o,d,p),p},_=this&&this.__param||function(i,o){return function(d,S){o(d,S,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const h=s(6193),f=s(4725),v=s(8460),y=s(844),u=s(7226),n=s(2585);let a=r.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(i,o,d,S,b,C,p,E){super(),this._rowCount=i,this._charSizeService=S,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new u.DebouncedIdleTask,this._observerDisposable=this.register(new y.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 v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((P,T)=>this._renderRows(P,T),p),this.register(this._renderDebouncer),this.register(p.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(C.onResize(()=>this._fullRefresh())),this.register(C.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(d.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(b.onDecorationRegistered(()=>this._fullRefresh())),this.register(b.onDecorationRemoved(()=>this._fullRefresh())),this.register(d.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()})),this.register(d.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(C.buffer.y,C.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(p.window,o),this.register(p.onWindowChange(P=>this._registerIntersectionObserver(P,o)))}_registerIntersectionObserver(i,o){if("IntersectionObserver"in i){const d=new i.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});d.observe(o),this._observerDisposable.value=(0,y.toDisposable)(()=>d.disconnect())}}_handleIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(i,o,d=!1){this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,o,this._rowCount))}_renderRows(i,o){this._renderer.value&&(i=Math.min(i,this._rowCount-1),o=Math.min(o,this._rowCount-1),this._renderer.value.renderRows(i,o),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:o}),this._onRender.fire({start:i,end:o}),this._isNextRenderRedrawOnly=!0)}resize(i,o){this._rowCount=o,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(i){this._renderer.value=i,this._renderer.value&&(this._renderer.value.onRequestRedraw(o=>this.refreshRows(o.start,o.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(i,o){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(i,o)):this._renderer.value.handleResize(i,o),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(i,o,d){this._selectionState.start=i,this._selectionState.end=o,this._selectionState.columnSelectMode=d,this._renderer.value?.handleSelectionChanged(i,o,d)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=a=l([_(2,n.IOptionsService),_(3,f.ICharSizeService),_(4,n.IDecorationService),_(5,n.IBufferService),_(6,f.ICoreBrowserService),_(7,f.IThemeService)],a)},9312:function(w,r,s){var l=this&&this.__decorate||function(p,E,P,T){var B,D=arguments.length,M=D<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,P):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,E,P,T);else for(var j=p.length-1;j>=0;j--)(B=p[j])&&(M=(D<3?B(M):D>3?B(E,P,M):B(E,P))||M);return D>3&&M&&Object.defineProperty(E,P,M),M},_=this&&this.__param||function(p,E){return function(P,T){E(P,T,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const h=s(9806),f=s(9504),v=s(456),y=s(4725),u=s(8460),n=s(844),a=s(6114),i=s(4841),o=s(511),d=s(2585),S=" ",b=new RegExp(S,"g");let C=r.SelectionService=class extends n.Disposable{constructor(p,E,P,T,B,D,M,j,N){super(),this._element=p,this._screenElement=E,this._linkifier=P,this._bufferService=T,this._coreService=B,this._mouseService=D,this._optionsService=M,this._renderService=j,this._coreBrowserService=N,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new o.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(K=>this._handleTrim(K)),this.register(this._bufferService.buffers.onBufferActivate(K=>this._handleBufferActivate(K))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.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 p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!p||!E||p[0]===E[0]&&p[1]===E[1])}get selectionText(){const p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!p||!E)return"";const P=this._bufferService.buffer,T=[];if(this._activeSelectionMode===3){if(p[0]===E[0])return"";const B=p[0]<E[0]?p[0]:E[0],D=p[0]<E[0]?E[0]:p[0];for(let M=p[1];M<=E[1];M++){const j=P.translateBufferLineToString(M,!0,B,D);T.push(j)}}else{const B=p[1]===E[1]?E[0]:void 0;T.push(P.translateBufferLineToString(p[1],!0,p[0],B));for(let D=p[1]+1;D<=E[1]-1;D++){const M=P.lines.get(D),j=P.translateBufferLineToString(D,!0);M?.isWrapped?T[T.length-1]+=j:T.push(j)}if(p[1]!==E[1]){const D=P.lines.get(E[1]),M=P.translateBufferLineToString(E[1],!0,0,E[0]);D&&D.isWrapped?T[T.length-1]+=M:T.push(M)}}return T.map(B=>B.replace(b," ")).join(a.isWindows?`\r
6
6
  `:`
7
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(p){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),a.isLinux&&p&&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(p){const E=this._getMouseBufferCoords(p),P=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!!(P&&T&&E)&&this._areCoordsInSelection(E,P,T)}isCellInSelection(p,E){const P=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!P||!T)&&this._areCoordsInSelection([p,E],P,T)}_areCoordsInSelection(p,E,P){return p[1]>E[1]&&p[1]<P[1]||E[1]===P[1]&&p[1]===E[1]&&p[0]>=E[0]&&p[0]<P[0]||E[1]<P[1]&&p[1]===P[1]&&p[0]<P[0]||E[1]<P[1]&&p[1]===E[1]&&p[0]>=E[0]}_selectWordAtCursor(p,E){const P=this._linkifier.currentLink?.link?.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,i.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const T=this._getMouseBufferCoords(p);return!!T&&(this._selectWordAt(T,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,E){this._model.clearSelection(),p=Math.max(p,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const E=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(p){let E=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const P=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=P?0:(E>P&&(E-=P),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(p){return a.isMac?p.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:p.shiftKey}handleMouseDown(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._handleIncrementalClick(p):p.detail===1?this._handleSingleClick(p):p.detail===2?this._handleDoubleClick(p):p.detail===3&&this._handleTripleClick(p),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(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))}_handleSingleClick(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const E=this._getMouseBufferCoords(p);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(p){return p.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(p),!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(p),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const P=this._bufferService.buffer;if(this._model.selectionEnd[1]<P.lines.length){const T=P.lines.get(this._model.selectionEnd[1]);T&&T.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 p=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(p.ydisp+this._bufferService.rows,p.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=p.ydisp),this.refresh()}}_handleMouseUp(p){const E=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&p.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const P=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(P&&P[0]!==void 0&&P[1]!==void 0){const T=(0,f.moveToCellSequence)(P[0]-1,P[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(T,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,P=!(!p||!E||p[0]===E[0]&&p[1]===E[1]);P?p&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,E,P)):this._oldHasSelection&&this._fireOnSelectionChange(p,E,P)}_fireOnSelectionChange(p,E,P){this._oldSelectionStart=p,this._oldSelectionEnd=E,this._oldHasSelection=P,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(p,E){let P=E;for(let T=0;E>=T;T++){const B=p.loadCell(T,this._workCell).getChars().length;this._workCell.getWidth()===0?P--:B>1&&E!==T&&(P+=B-1)}return P}setSelection(p,E,P){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,E],this._model.selectionStartLength=P,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,E,P=!0,T=!0){if(p[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,R=B.lines.get(p[1]);if(!R)return;const M=B.translateBufferLineToString(p[1],!1);let j=this._convertViewportColToCharacterIndex(R,p[0]),N=j;const K=p[0]-j;let W=0,x=0,L=0,A=0;if(M.charAt(j)===" "){for(;j>0&&M.charAt(j-1)===" ";)j--;for(;N<M.length&&M.charAt(N+1)===" ";)N++}else{let U=p[0],V=p[0];R.getWidth(U)===0&&(W++,U--),R.getWidth(V)===2&&(x++,V++);const G=R.getString(V).length;for(G>1&&(A+=G-1,N+=G-1);U>0&&j>0&&!this._isCharWordSeparator(R.loadCell(U-1,this._workCell));){R.loadCell(U-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,U--):I>1&&(L+=I-1,j-=I-1),j--,U--}for(;V<R.length&&N+1<M.length&&!this._isCharWordSeparator(R.loadCell(V+1,this._workCell));){R.loadCell(V+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,V++):I>1&&(A+=I-1,N+=I-1),N++,V++}}N++;let O=j+K-W+L,F=Math.min(this._bufferService.cols,N-j+W+x-L-A);if(E||M.slice(j,N).trim()!==""){if(P&&O===0&&R.getCodePoint(0)!==32){const U=B.lines.get(p[1]-1);if(U&&R.isWrapped&&U.getCodePoint(this._bufferService.cols-1)!==32){const V=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(V){const G=this._bufferService.cols-V.start;O-=G,F+=G}}}if(T&&O+F===this._bufferService.cols&&R.getCodePoint(this._bufferService.cols-1)!==32){const U=B.lines.get(p[1]+1);if(U?.isWrapped&&U.getCodePoint(0)!==32){const V=this._getWordAt([0,p[1]+1],!1,!1,!0);V&&(F+=V.length)}}return{start:O,length:F}}}_selectWordAt(p,E){const P=this._getWordAt(p,E);if(P){for(;P.start<0;)P.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[P.start,p[1]],this._model.selectionStartLength=P.length}}_selectToWordAt(p){const E=this._getWordAt(p,!0);if(E){let P=p[1];for(;E.start<0;)E.start+=this._bufferService.cols,P--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,P++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,P]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const E=this._bufferService.buffer.getWrappedRangeForLine(p),P={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,i.getRangeLength)(P,this._bufferService.cols)}};r.SelectionService=C=l([_(3,d.IBufferService),_(4,d.ICoreService),_(5,y.IMouseService),_(6,d.IOptionsService),_(7,y.IRenderService),_(8,y.ICoreBrowserService)],C)},4725:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const l=s(8343);r.ICharSizeService=(0,l.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),r.IMouseService=(0,l.createDecorator)("MouseService"),r.IRenderService=(0,l.createDecorator)("RenderService"),r.ISelectionService=(0,l.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,l.createDecorator)("ThemeService"),r.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(w,r,s){var l=this&&this.__decorate||function(C,p,E,P){var T,B=arguments.length,R=B<3?p:P===null?P=Object.getOwnPropertyDescriptor(p,E):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,p,E,P);else for(var M=C.length-1;M>=0;M--)(T=C[M])&&(R=(B<3?T(R):B>3?T(p,E,R):T(p,E))||R);return B>3&&R&&Object.defineProperty(p,E,R),R},_=this&&this.__param||function(C,p){return function(E,P){p(E,P,C)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const h=s(7239),f=s(8055),v=s(8460),y=s(844),u=s(2585),n=f.css.toColor("#ffffff"),a=f.css.toColor("#000000"),i=f.css.toColor("#ffffff"),o=f.css.toColor("#000000"),d={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let E=0;E<216;E++){const P=p[E/36%6|0],T=p[E/6%6|0],B=p[E%6];C.push({css:f.channels.toCss(P,T,B),rgba:f.channels.toRgba(P,T,B)})}for(let E=0;E<24;E++){const P=8+10*E;C.push({css:f.channels.toCss(P,P,P),rgba:f.channels.toRgba(P,P,P)})}return C})());let S=r.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:a,cursor:i,cursorAccent:o,selectionForeground:void 0,selectionBackgroundTransparent:d,selectionBackgroundOpaque:f.color.blend(a,d),selectionInactiveBackgroundTransparent:d,selectionInactiveBackgroundOpaque:f.color.blend(a,d),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(C={}){const p=this._colors;if(p.foreground=b(C.foreground,n),p.background=b(C.background,a),p.cursor=b(C.cursor,i),p.cursorAccent=b(C.cursorAccent,o),p.selectionBackgroundTransparent=b(C.selectionBackground,d),p.selectionBackgroundOpaque=f.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=b(C.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=f.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=C.selectionForeground?b(C.selectionForeground,f.NULL_COLOR):void 0,p.selectionForeground===f.NULL_COLOR&&(p.selectionForeground=void 0),f.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=f.color.opacity(p.selectionBackgroundTransparent,.3)),f.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=f.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=r.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=b(C.black,r.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=b(C.red,r.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=b(C.green,r.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=b(C.yellow,r.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=b(C.blue,r.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=b(C.magenta,r.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=b(C.cyan,r.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=b(C.white,r.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=b(C.brightBlack,r.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=b(C.brightRed,r.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=b(C.brightGreen,r.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=b(C.brightYellow,r.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=b(C.brightBlue,r.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=b(C.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=b(C.brightCyan,r.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=b(C.brightWhite,r.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const E=Math.min(p.ansi.length-16,C.extendedAnsi.length);for(let P=0;P<E;P++)p.ansi[P+16]=b(C.extendedAnsi[P],r.DEFAULT_ANSI_COLORS[P+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(C){C(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 b(C,p){if(C!==void 0)try{return f.css.toColor(C)}catch{}return p}r.ThemeService=S=l([_(0,u.IOptionsService)],S)},6349:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const l=s(8460),_=s(844);class h extends _.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const y=new Array(v);for(let u=0;u<Math.min(v,this.length);u++)y[u]=this._array[this._getCyclicIndex(u)];this._array=y,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let y=this._length;y<v;y++)this._array[y]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,y){this._array[this._getCyclicIndex(v)]=y}push(v){this._array[this._getCyclicIndex(this._length)]=v,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(v,y,...u){if(y){for(let n=v;n<this._length-y;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+y)];this._length-=y,this.onDeleteEmitter.fire({index:v,amount:y})}for(let n=this._length-1;n>=v;n--)this._array[this._getCyclicIndex(n+u.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<u.length;n++)this._array[this._getCyclicIndex(v+n)]=u[n];if(u.length&&this.onInsertEmitter.fire({index:v,amount:u.length}),this._length+u.length>this._maxLength){const n=this._length+u.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=u.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,y,u){if(!(y<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let a=y-1;a>=0;a--)this.set(v+a+u,this.get(v+a));const n=v+y+u-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<y;n++)this.set(v+n+u,this.get(v+n))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}r.CircularList=h},1439:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function s(l,_=5){if(typeof l!="object")return l;const h=Array.isArray(l)?[]:{};for(const f in l)h[f]=_<=1?l[f]:l[f]&&s(l[f],_-1);return h}},8055:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let s=0,l=0,_=0,h=0;var f,v,y,u,n;function a(o){const d=o.toString(16);return d.length<2?"0"+d:d}function i(o,d){return o<d?(d+.05)/(o+.05):(o+.05)/(d+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(o){o.toCss=function(d,S,b,C){return C!==void 0?`#${a(d)}${a(S)}${a(b)}${a(C)}`:`#${a(d)}${a(S)}${a(b)}`},o.toRgba=function(d,S,b,C=255){return(d<<24|S<<16|b<<8|C)>>>0},o.toColor=function(d,S,b,C){return{css:o.toCss(d,S,b,C),rgba:o.toRgba(d,S,b,C)}}}(f||(r.channels=f={})),function(o){function d(S,b){return h=Math.round(255*b),[s,l,_]=n.toChannels(S.rgba),{css:f.toCss(s,l,_,h),rgba:f.toRgba(s,l,_,h)}}o.blend=function(S,b){if(h=(255&b.rgba)/255,h===1)return{css:b.css,rgba:b.rgba};const C=b.rgba>>24&255,p=b.rgba>>16&255,E=b.rgba>>8&255,P=S.rgba>>24&255,T=S.rgba>>16&255,B=S.rgba>>8&255;return s=P+Math.round((C-P)*h),l=T+Math.round((p-T)*h),_=B+Math.round((E-B)*h),{css:f.toCss(s,l,_),rgba:f.toRgba(s,l,_)}},o.isOpaque=function(S){return(255&S.rgba)==255},o.ensureContrastRatio=function(S,b,C){const p=n.ensureContrastRatio(S.rgba,b.rgba,C);if(p)return f.toColor(p>>24&255,p>>16&255,p>>8&255)},o.opaque=function(S){const b=(255|S.rgba)>>>0;return[s,l,_]=n.toChannels(b),{css:f.toCss(s,l,_),rgba:b}},o.opacity=d,o.multiplyOpacity=function(S,b){return h=255&S.rgba,d(S,h*b/255)},o.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(v||(r.color=v={})),function(o){let d,S;try{const b=document.createElement("canvas");b.width=1,b.height=1;const C=b.getContext("2d",{willReadFrequently:!0});C&&(d=C,d.globalCompositeOperation="copy",S=d.createLinearGradient(0,0,1,1))}catch{}o.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return s=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),_=parseInt(b.slice(3,4).repeat(2),16),f.toColor(s,l,_);case 5:return s=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),_=parseInt(b.slice(3,4).repeat(2),16),h=parseInt(b.slice(4,5).repeat(2),16),f.toColor(s,l,_,h);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const C=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return s=parseInt(C[1]),l=parseInt(C[2]),_=parseInt(C[3]),h=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),f.toColor(s,l,_,h);if(!d||!S)throw new Error("css.toColor: Unsupported css format");if(d.fillStyle=S,d.fillStyle=b,typeof d.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(d.fillRect(0,0,1,1),[s,l,_,h]=d.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(s,l,_,h),css:b}}}(y||(r.css=y={})),function(o){function d(S,b,C){const p=S/255,E=b/255,P=C/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}o.relativeLuminance=function(S){return d(S>>16&255,S>>8&255,255&S)},o.relativeLuminance2=d}(u||(r.rgb=u={})),function(o){function d(b,C,p){const E=b>>24&255,P=b>>16&255,T=b>>8&255;let B=C>>24&255,R=C>>16&255,M=C>>8&255,j=i(u.relativeLuminance2(B,R,M),u.relativeLuminance2(E,P,T));for(;j<p&&(B>0||R>0||M>0);)B-=Math.max(0,Math.ceil(.1*B)),R-=Math.max(0,Math.ceil(.1*R)),M-=Math.max(0,Math.ceil(.1*M)),j=i(u.relativeLuminance2(B,R,M),u.relativeLuminance2(E,P,T));return(B<<24|R<<16|M<<8|255)>>>0}function S(b,C,p){const E=b>>24&255,P=b>>16&255,T=b>>8&255;let B=C>>24&255,R=C>>16&255,M=C>>8&255,j=i(u.relativeLuminance2(B,R,M),u.relativeLuminance2(E,P,T));for(;j<p&&(B<255||R<255||M<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),R=Math.min(255,R+Math.ceil(.1*(255-R))),M=Math.min(255,M+Math.ceil(.1*(255-M))),j=i(u.relativeLuminance2(B,R,M),u.relativeLuminance2(E,P,T));return(B<<24|R<<16|M<<8|255)>>>0}o.blend=function(b,C){if(h=(255&C)/255,h===1)return C;const p=C>>24&255,E=C>>16&255,P=C>>8&255,T=b>>24&255,B=b>>16&255,R=b>>8&255;return s=T+Math.round((p-T)*h),l=B+Math.round((E-B)*h),_=R+Math.round((P-R)*h),f.toRgba(s,l,_)},o.ensureContrastRatio=function(b,C,p){const E=u.relativeLuminance(b>>8),P=u.relativeLuminance(C>>8);if(i(E,P)<p){if(P<E){const R=d(b,C,p),M=i(E,u.relativeLuminance(R>>8));if(M<p){const j=S(b,C,p);return M>i(E,u.relativeLuminance(j>>8))?R:j}return R}const T=S(b,C,p),B=i(E,u.relativeLuminance(T>>8));if(B<p){const R=d(b,C,p);return B>i(E,u.relativeLuminance(R>>8))?T:R}return T}},o.reduceLuminance=d,o.increaseLuminance=S,o.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}}(n||(r.rgba=n={})),r.toPaddedHex=a,r.contrastRatio=i},8969:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const l=s(844),_=s(2585),h=s(4348),f=s(7866),v=s(744),y=s(7302),u=s(6975),n=s(8460),a=s(1753),i=s(1480),o=s(7994),d=s(9282),S=s(5435),b=s(5981),C=s(2660);let p=!1;class E extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event(T=>{this._onScrollApi?.fire(T.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(T){for(const B in T)this.optionsService.options[B]=T[B]}constructor(T){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new y.OptionsService(T)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(u.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(o.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new b.WriteBuffer((B,R)=>this._inputHandler.parse(B,R))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(T,B){this._writeBuffer.write(T,B)}writeSync(T,B){this._logService.logLevel<=_.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(T,B)}input(T,B=!0){this.coreService.triggerDataEvent(T,B)}resize(T,B){isNaN(T)||isNaN(B)||(T=Math.max(T,v.MINIMUM_COLS),B=Math.max(B,v.MINIMUM_ROWS),this._bufferService.resize(T,B))}scroll(T,B=!1){this._bufferService.scroll(T,B)}scrollLines(T,B,R){this._bufferService.scrollLines(T,B,R)}scrollPages(T){this.scrollLines(T*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(T){const B=T-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(T,B){return this._inputHandler.registerEscHandler(T,B)}registerDcsHandler(T,B){return this._inputHandler.registerDcsHandler(T,B)}registerCsiHandler(T,B){return this._inputHandler.registerCsiHandler(T,B)}registerOscHandler(T,B){return this._inputHandler.registerOscHandler(T,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let T=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?T=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(T=!0),T?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const T=[];T.push(this.onLineFeed(d.updateWindowsModeWrappedState.bind(null,this._bufferService))),T.push(this.registerCsiHandler({final:"H"},()=>((0,d.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)(()=>{for(const B of T)B.dispose()})}}}r.CoreTerminal=E},8460:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=s=>(this._listeners.push(s),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===s)return void this._listeners.splice(l,1)}}})),this._event}fire(s,l){const _=[];for(let h=0;h<this._listeners.length;h++)_.push(this._listeners[h]);for(let h=0;h<_.length;h++)_[h].call(void 0,s,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(s,l){return s(_=>l.fire(_))},r.runAndSubscribe=function(s,l){return l(void 0),s(_=>l(_))}},5435:function(w,r,s){var l=this&&this.__decorate||function(W,x,L,A){var O,F=arguments.length,U=F<3?x:A===null?A=Object.getOwnPropertyDescriptor(x,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(W,x,L,A);else for(var V=W.length-1;V>=0;V--)(O=W[V])&&(U=(F<3?O(U):F>3?O(x,L,U):O(x,L))||U);return F>3&&U&&Object.defineProperty(x,L,U),U},_=this&&this.__param||function(W,x){return function(L,A){x(L,A,W)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const h=s(2584),f=s(7116),v=s(2015),y=s(844),u=s(482),n=s(8437),a=s(8460),i=s(643),o=s(511),d=s(3734),S=s(2585),b=s(1480),C=s(6242),p=s(6351),E=s(5941),P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},T=131072;function B(W,x){if(W>24)return x.setWinLines||!1;switch(W){case 1:return!!x.restoreWin;case 2:return!!x.minimizeWin;case 3:return!!x.setWinPosition;case 4:return!!x.setWinSizePixels;case 5:return!!x.raiseWin;case 6:return!!x.lowerWin;case 7:return!!x.refreshWin;case 8:return!!x.setWinSizeChars;case 9:return!!x.maximizeWin;case 10:return!!x.fullscreenWin;case 11:return!!x.getWinState;case 13:return!!x.getWinPosition;case 14:return!!x.getWinSizePixels;case 15:return!!x.getScreenSizePixels;case 16:return!!x.getCellSizePixels;case 18:return!!x.getWinSizeChars;case 19:return!!x.getScreenSizeChars;case 20:return!!x.getIconTitle;case 21:return!!x.getWinTitle;case 22:return!!x.pushTitle;case 23:return!!x.popTitle;case 24:return!!x.setWinLines}return!1}var R;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(R||(r.WindowsOptionsReportType=R={}));let M=0;class j extends y.Disposable{getAttrData(){return this._curAttrData}constructor(x,L,A,O,F,U,V,G,I=new v.EscapeSequenceParser){super(),this._bufferService=x,this._charsetService=L,this._coreService=A,this._logService=O,this._optionsService=F,this._oscLinkService=U,this._coreMouseService=V,this._unicodeService=G,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new o.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.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 N(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(D=>this._activeBuffer=D.activeBuffer)),this._parser.setCsiHandlerFallback((D,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:H.toArray()})}),this._parser.setEscHandlerFallback(D=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(D)})}),this._parser.setExecuteHandlerFallback(D=>{this._logService.debug("Unknown EXECUTE code: ",{code:D})}),this._parser.setOscHandlerFallback((D,H,$)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:H,data:$})}),this._parser.setDcsHandlerFallback((D,H,$)=>{H==="HOOK"&&($=$.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:H,payload:$})}),this._parser.setPrintHandler((D,H,$)=>this.print(D,H,$)),this._parser.registerCsiHandler({final:"@"},D=>this.insertChars(D)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},D=>this.scrollLeft(D)),this._parser.registerCsiHandler({final:"A"},D=>this.cursorUp(D)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},D=>this.scrollRight(D)),this._parser.registerCsiHandler({final:"B"},D=>this.cursorDown(D)),this._parser.registerCsiHandler({final:"C"},D=>this.cursorForward(D)),this._parser.registerCsiHandler({final:"D"},D=>this.cursorBackward(D)),this._parser.registerCsiHandler({final:"E"},D=>this.cursorNextLine(D)),this._parser.registerCsiHandler({final:"F"},D=>this.cursorPrecedingLine(D)),this._parser.registerCsiHandler({final:"G"},D=>this.cursorCharAbsolute(D)),this._parser.registerCsiHandler({final:"H"},D=>this.cursorPosition(D)),this._parser.registerCsiHandler({final:"I"},D=>this.cursorForwardTab(D)),this._parser.registerCsiHandler({final:"J"},D=>this.eraseInDisplay(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},D=>this.eraseInDisplay(D,!0)),this._parser.registerCsiHandler({final:"K"},D=>this.eraseInLine(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},D=>this.eraseInLine(D,!0)),this._parser.registerCsiHandler({final:"L"},D=>this.insertLines(D)),this._parser.registerCsiHandler({final:"M"},D=>this.deleteLines(D)),this._parser.registerCsiHandler({final:"P"},D=>this.deleteChars(D)),this._parser.registerCsiHandler({final:"S"},D=>this.scrollUp(D)),this._parser.registerCsiHandler({final:"T"},D=>this.scrollDown(D)),this._parser.registerCsiHandler({final:"X"},D=>this.eraseChars(D)),this._parser.registerCsiHandler({final:"Z"},D=>this.cursorBackwardTab(D)),this._parser.registerCsiHandler({final:"`"},D=>this.charPosAbsolute(D)),this._parser.registerCsiHandler({final:"a"},D=>this.hPositionRelative(D)),this._parser.registerCsiHandler({final:"b"},D=>this.repeatPrecedingCharacter(D)),this._parser.registerCsiHandler({final:"c"},D=>this.sendDeviceAttributesPrimary(D)),this._parser.registerCsiHandler({prefix:">",final:"c"},D=>this.sendDeviceAttributesSecondary(D)),this._parser.registerCsiHandler({final:"d"},D=>this.linePosAbsolute(D)),this._parser.registerCsiHandler({final:"e"},D=>this.vPositionRelative(D)),this._parser.registerCsiHandler({final:"f"},D=>this.hVPosition(D)),this._parser.registerCsiHandler({final:"g"},D=>this.tabClear(D)),this._parser.registerCsiHandler({final:"h"},D=>this.setMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"h"},D=>this.setModePrivate(D)),this._parser.registerCsiHandler({final:"l"},D=>this.resetMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"l"},D=>this.resetModePrivate(D)),this._parser.registerCsiHandler({final:"m"},D=>this.charAttributes(D)),this._parser.registerCsiHandler({final:"n"},D=>this.deviceStatus(D)),this._parser.registerCsiHandler({prefix:"?",final:"n"},D=>this.deviceStatusPrivate(D)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},D=>this.softReset(D)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},D=>this.setCursorStyle(D)),this._parser.registerCsiHandler({final:"r"},D=>this.setScrollRegion(D)),this._parser.registerCsiHandler({final:"s"},D=>this.saveCursor(D)),this._parser.registerCsiHandler({final:"t"},D=>this.windowOptions(D)),this._parser.registerCsiHandler({final:"u"},D=>this.restoreCursor(D)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},D=>this.insertColumns(D)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},D=>this.deleteColumns(D)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},D=>this.selectProtected(D)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},D=>this.requestMode(D,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},D=>this.requestMode(D,!1)),this._parser.setExecuteHandler(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new C.OscHandler(D=>(this.setTitle(D),this.setIconName(D),!0))),this._parser.registerOscHandler(1,new C.OscHandler(D=>this.setIconName(D))),this._parser.registerOscHandler(2,new C.OscHandler(D=>this.setTitle(D))),this._parser.registerOscHandler(4,new C.OscHandler(D=>this.setOrReportIndexedColor(D))),this._parser.registerOscHandler(8,new C.OscHandler(D=>this.setHyperlink(D))),this._parser.registerOscHandler(10,new C.OscHandler(D=>this.setOrReportFgColor(D))),this._parser.registerOscHandler(11,new C.OscHandler(D=>this.setOrReportBgColor(D))),this._parser.registerOscHandler(12,new C.OscHandler(D=>this.setOrReportCursorColor(D))),this._parser.registerOscHandler(104,new C.OscHandler(D=>this.restoreIndexedColor(D))),this._parser.registerOscHandler(110,new C.OscHandler(D=>this.restoreFgColor(D))),this._parser.registerOscHandler(111,new C.OscHandler(D=>this.restoreBgColor(D))),this._parser.registerOscHandler(112,new C.OscHandler(D=>this.restoreCursorColor(D))),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 D in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:D},()=>this.selectCharset("("+D)),this._parser.registerEscHandler({intermediates:")",final:D},()=>this.selectCharset(")"+D)),this._parser.registerEscHandler({intermediates:"*",final:D},()=>this.selectCharset("*"+D)),this._parser.registerEscHandler({intermediates:"+",final:D},()=>this.selectCharset("+"+D)),this._parser.registerEscHandler({intermediates:"-",final:D},()=>this.selectCharset("-"+D)),this._parser.registerEscHandler({intermediates:".",final:D},()=>this.selectCharset("."+D)),this._parser.registerEscHandler({intermediates:"/",final:D},()=>this.selectCharset("/"+D));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(D=>(this._logService.error("Parsing error: ",D),D)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new p.DcsHandler((D,H)=>this.requestStatusString(D,H)))}_preserveStack(x,L,A,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=x,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=A,this._parseStack.position=O}_logSlowResolvingAsync(x){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([x,new Promise((L,A)=>setTimeout(()=>A("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(x,L){let A,O=this._activeBuffer.x,F=this._activeBuffer.y,U=0;const V=this._parseStack.paused;if(V){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(A),A;O=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,x.length>T&&(U=this._parseStack.position+T)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof x=="string"?` "${x}"`:` "${Array.prototype.map.call(x,D=>String.fromCharCode(D)).join("")}"`),typeof x=="string"?x.split("").map(D=>D.charCodeAt(0)):x),this._parseBuffer.length<x.length&&this._parseBuffer.length<T&&(this._parseBuffer=new Uint32Array(Math.min(x.length,T))),V||this._dirtyRowTracker.clearRange(),x.length>T)for(let D=U;D<x.length;D+=T){const H=D+T<x.length?D+T:x.length,$=typeof x=="string"?this._stringDecoder.decode(x.substring(D,H),this._parseBuffer):this._utf8Decoder.decode(x.subarray(D,H),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,$))return this._preserveStack(O,F,$,D),this._logSlowResolvingAsync(A),A}else if(!V){const D=typeof x=="string"?this._stringDecoder.decode(x,this._parseBuffer):this._utf8Decoder.decode(x,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,D))return this._preserveStack(O,F,D,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===O&&this._activeBuffer.y===F||this._onCursorMove.fire();const G=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(G,this._bufferService.rows-1))}print(x,L,A){let O,F;const U=this._charsetService.charset,V=this._optionsService.rawOptions.screenReaderMode,G=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,H=this._curAttrData;let $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-L>0&&$.getWidth(this._activeBuffer.x-1)===2&&$.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let q=this._parser.precedingJoinState;for(let Z=L;Z<A;++Z){if(O=x[Z],O<127&&U){const ce=U[String.fromCharCode(O)];ce&&(O=ce.charCodeAt(0))}const X=this._unicodeService.charProperties(O,q);F=b.UnicodeService.extractWidth(X);const se=b.UnicodeService.extractShouldJoin(X),ne=se?b.UnicodeService.extractWidth(q):0;if(q=X,V&&this._onA11yChar.fire((0,u.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-ne>G){if(I){const ce=$;let J=this._activeBuffer.x-ne;for(this._activeBuffer.x=ne,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),$=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ne>0&&$ instanceof n.BufferLine&&$.copyCellsFrom(ce,J,0,ne,!1);J<G;)ce.setCellFromCodepoint(J++,0,1,H)}else if(this._activeBuffer.x=G-1,F===2)continue}if(se&&this._activeBuffer.x){const ce=$.getWidth(this._activeBuffer.x-1)?1:2;$.addCodepointToCell(this._activeBuffer.x-ce,O,F);for(let J=F-ne;--J>=0;)$.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(D&&($.insertCells(this._activeBuffer.x,F-ne,this._activeBuffer.getNullCell(H)),$.getWidth(G-1)===2&&$.setCellFromCodepoint(G-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,H)),$.setCellFromCodepoint(this._activeBuffer.x++,O,F,H),F>0)for(;--F;)$.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=q,this._activeBuffer.x<G&&A-L>0&&$.getWidth(this._activeBuffer.x)===0&&!$.hasContent(this._activeBuffer.x)&&$.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(x,L){return x.final!=="t"||x.prefix||x.intermediates?this._parser.registerCsiHandler(x,L):this._parser.registerCsiHandler(x,A=>!B(A.params[0],this._optionsService.rawOptions.windowOptions)||L(A))}registerDcsHandler(x,L){return this._parser.registerDcsHandler(x,new p.DcsHandler(L))}registerEscHandler(x,L){return this._parser.registerEscHandler(x,L)}registerOscHandler(x,L){return this._parser.registerOscHandler(x,new C.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const x=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-x),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(x=this._bufferService.cols-1){this._activeBuffer.x=Math.min(x,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(x,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=x,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=x,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(x,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+x,this._activeBuffer.y+L)}cursorUp(x){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,x.params[0]||1)):this._moveCursor(0,-(x.params[0]||1)),!0}cursorDown(x){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,x.params[0]||1)):this._moveCursor(0,x.params[0]||1),!0}cursorForward(x){return this._moveCursor(x.params[0]||1,0),!0}cursorBackward(x){return this._moveCursor(-(x.params[0]||1),0),!0}cursorNextLine(x){return this.cursorDown(x),this._activeBuffer.x=0,!0}cursorPrecedingLine(x){return this.cursorUp(x),this._activeBuffer.x=0,!0}cursorCharAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(x){return this._setCursor(x.length>=2?(x.params[1]||1)-1:0,(x.params[0]||1)-1),!0}charPosAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(x){return this._moveCursor(x.params[0]||1,0),!0}linePosAbsolute(x){return this._setCursor(this._activeBuffer.x,(x.params[0]||1)-1),!0}vPositionRelative(x){return this._moveCursor(0,x.params[0]||1),!0}hVPosition(x){return this.cursorPosition(x),!0}tabClear(x){const L=x.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=x.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=x.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(x){const L=x.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(x,L,A,O=!1,F=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);U.replaceCells(L,A,this._activeBuffer.getNullCell(this._eraseAttrData()),F),O&&(U.isWrapped=!1)}_resetBufferLine(x,L=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+x),A.isWrapped=!1)}eraseInDisplay(x,L=!1){let A;switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);A<this._bufferService.rows;A++)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(x,L=!1){switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(x){this._restrictCursor();let L=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;L--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(x){this._restrictCursor();let L=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;L--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(x){let L=x.params[0]||1;for(;L--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(x){let L=x.params[0]||1;for(;L--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(x.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(x){const L=this._parser.precedingJoinState;if(!L)return!0;const A=x.params[0]||1,O=b.UnicodeService.extractWidth(L),F=this._activeBuffer.x-O,U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),V=new Uint32Array(U.length*A);let G=0;for(let D=0;D<U.length;){const H=U.codePointAt(D)||0;V[G++]=H,D+=H>65535?2:1}let I=G;for(let D=1;D<A;++D)V.copyWithin(I,0,G),I+=G;return this.print(V,0,I),!0}sendDeviceAttributesPrimary(x){return x.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(x){return x.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(x.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(x){return(this._optionsService.rawOptions.termName+"").indexOf(x)===0}setMode(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.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(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),x.params[L]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(x,L){const A=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:F}=this._coreMouseService,U=this._coreService,{buffers:V,cols:G}=this._bufferService,{active:I,alt:D}=V,H=this._optionsService.rawOptions,$=se=>se?1:2,q=x.params[0];return Z=q,X=L?q===2?4:q===4?$(U.modes.insertMode):q===12?3:q===20?$(H.convertEol):0:q===1?$(A.applicationCursorKeys):q===3?H.windowOptions.setWinLines?G===80?2:G===132?1:0:0:q===6?$(A.origin):q===7?$(A.wraparound):q===8?3:q===9?$(O==="X10"):q===12?$(H.cursorBlink):q===25?$(!U.isCursorHidden):q===45?$(A.reverseWraparound):q===66?$(A.applicationKeypad):q===67?4:q===1e3?$(O==="VT200"):q===1002?$(O==="DRAG"):q===1003?$(O==="ANY"):q===1004?$(A.sendFocus):q===1005?4:q===1006?$(F==="SGR"):q===1015?4:q===1016?$(F==="SGR_PIXELS"):q===1048?1:q===47||q===1047||q===1049?$(I===D):q===2004?$(A.bracketedPasteMode):0,U.triggerDataEvent(`${h.C0.ESC}[${L?"":"?"}${Z};${X}$y`),!0;var Z,X}_updateAttrColor(x,L,A,O,F){return L===2?(x|=50331648,x&=-16777216,x|=d.AttributeData.fromColorRGB([A,O,F])):L===5&&(x&=-50331904,x|=33554432|255&A),x}_extractColor(x,L,A){const O=[0,0,-1,0,0,0];let F=0,U=0;do{if(O[U+F]=x.params[L+U],x.hasSubParams(L+U)){const V=x.getSubParams(L+U);let G=0;do O[1]===5&&(F=1),O[U+G+1+F]=V[G];while(++G<V.length&&G+U+1+F<O.length);break}if(O[1]===5&&U+F>=2||O[1]===2&&U+F>=5)break;O[1]&&(F=1)}while(++U+L<x.length&&U+F<O.length);for(let V=2;V<O.length;++V)O[V]===-1&&(O[V]=0);switch(O[0]){case 38:A.fg=this._updateAttrColor(A.fg,O[1],O[3],O[4],O[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,O[1],O[3],O[4],O[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,O[1],O[3],O[4],O[5])}return U}_processUnderline(x,L){L.extended=L.extended.clone(),(!~x||x>5)&&(x=1),L.extended.underlineStyle=x,L.fg|=268435456,x===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(x){x.fg=n.DEFAULT_ATTR_DATA.fg,x.bg=n.DEFAULT_ATTR_DATA.bg,x.extended=x.extended.clone(),x.extended.underlineStyle=0,x.extended.underlineColor&=-67108864,x.updateExtended()}charAttributes(x){if(x.length===1&&x.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=x.length;let A;const O=this._curAttrData;for(let F=0;F<L;F++)A=x.params[F],A>=30&&A<=37?(O.fg&=-50331904,O.fg|=16777216|A-30):A>=40&&A<=47?(O.bg&=-50331904,O.bg|=16777216|A-40):A>=90&&A<=97?(O.fg&=-50331904,O.fg|=16777224|A-90):A>=100&&A<=107?(O.bg&=-50331904,O.bg|=16777224|A-100):A===0?this._processSGR0(O):A===1?O.fg|=134217728:A===3?O.bg|=67108864:A===4?(O.fg|=268435456,this._processUnderline(x.hasSubParams(F)?x.getSubParams(F)[0]:1,O)):A===5?O.fg|=536870912:A===7?O.fg|=67108864:A===8?O.fg|=1073741824:A===9?O.fg|=2147483648:A===2?O.bg|=134217728:A===21?this._processUnderline(2,O):A===22?(O.fg&=-134217729,O.bg&=-134217729):A===23?O.bg&=-67108865:A===24?(O.fg&=-268435457,this._processUnderline(0,O)):A===25?O.fg&=-536870913:A===27?O.fg&=-67108865:A===28?O.fg&=-1073741825:A===29?O.fg&=2147483647:A===39?(O.fg&=-67108864,O.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):A===49?(O.bg&=-67108864,O.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?F+=this._extractColor(x,F,O):A===53?O.bg|=1073741824:A===55?O.bg&=-1073741825:A===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):A===100?(O.fg&=-67108864,O.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(x){switch(x.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${L};${A}R`)}return!0}deviceStatusPrivate(x){if(x.params[0]===6){const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${L};${A}R`)}return!0}softReset(x){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(x){const L=x.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const A=L%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(x){const L=x.params[0]||1;let A;return(x.length<2||(A=x.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(x){if(!B(x.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=x.length>1?x.params[1]:0;switch(x.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(R.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(R.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(x){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(x){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(x){return this._windowTitle=x,this._onTitleChange.fire(x),!0}setIconName(x){return this._iconName=x,!0}setOrReportIndexedColor(x){const L=[],A=x.split(";");for(;A.length>1;){const O=A.shift(),F=A.shift();if(/^\d+$/.exec(O)){const U=parseInt(O);if(K(U))if(F==="?")L.push({type:0,index:U});else{const V=(0,E.parseColor)(F);V&&L.push({type:1,index:U,color:V})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(x){const L=x.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(x,L){this._getCurrentLinkId()&&this._finishHyperlink();const A=x.split(":");let O;const F=A.findIndex(U=>U.startsWith("id="));return F!==-1&&(O=A[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(x,L){const A=x.split(";");for(let O=0;O<A.length&&!(L>=this._specialColors.length);++O,++L)if(A[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const F=(0,E.parseColor)(A[O]);F&&this._onColor.fire([{type:1,index:this._specialColors[L],color:F}])}return!0}setOrReportFgColor(x){return this._setOrReportSpecialColor(x,0)}setOrReportBgColor(x){return this._setOrReportSpecialColor(x,1)}setOrReportCursorColor(x){return this._setOrReportSpecialColor(x,2)}restoreIndexedColor(x){if(!x)return this._onColor.fire([{type:2}]),!0;const L=[],A=x.split(";");for(let O=0;O<A.length;++O)if(/^\d+$/.exec(A[O])){const F=parseInt(A[O]);K(F)&&L.push({type:2,index:F})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(x){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(x){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(x){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,f.DEFAULT_CHARSET),!0}selectCharset(x){return x.length!==2?(this.selectDefaultCharset(),!0):(x[0]==="/"||this._charsetService.setgCharset(P[x[0]],f.CHARSETS[x[1]]||f.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 x=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,x,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(x){return this._charsetService.setgLevel(x),!0}screenAlignmentPattern(){const x=new o.CellData;x.content=4194373,x.fg=this._curAttrData.fg,x.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const A=this._activeBuffer.ybase+this._activeBuffer.y+L,O=this._activeBuffer.lines.get(A);O&&(O.fill(x),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(x,L){const A=this._bufferService.buffer,O=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${F}${h.C0.ESC}\\`),!0))(x==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:x==='"p'?'P1$r61;1"p':x==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:x==="m"?"P1$r0m":x===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(x,L){this._dirtyRowTracker.markRangeDirty(x,L)}}r.InputHandler=j;let N=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){W<this.start?this.start=W:W>this.end&&(this.end=W)}markRangeDirty(W,x){W>x&&(M=W,W=x,x=M),W<this.start&&(this.start=W),x>this.end&&(this.end=x)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(W){return 0<=W&&W<256}N=l([_(0,S.IBufferService)],N)},844:(w,r)=>{function s(l){for(const _ of l)_.dispose();l.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const _=this._disposables.indexOf(l);_!==-1&&this._disposables.splice(_,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){this._isDisposed||l===this._value||(this._value?.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(l){return{dispose:l}},r.disposeArray=s,r.getDisposeArrayDisposable=function(l){return{dispose:()=>s(l)}}},1505:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class s{constructor(){this._data={}}set(_,h,f){this._data[_]||(this._data[_]={}),this._data[_][h]=f}get(_,h){return this._data[_]?this._data[_][h]:void 0}clear(){this._data={}}}r.TwoKeyMap=s,r.FourKeyMap=class{constructor(){this._data=new s}set(l,_,h,f,v){this._data.get(l,_)||this._data.set(l,_,new s),this._data.get(l,_).set(h,f,v)}get(l,_,h,f){return this._data.get(l,_)?.get(h,f)}clear(){this._data.clear()}}},6114:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const s=r.isNode?"node":navigator.userAgent,l=r.isNode?"node":navigator.platform;r.isFirefox=s.includes("Firefox"),r.isLegacyEdge=s.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(s),r.getSafariVersion=function(){if(!r.isSafari)return 0;const _=s.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),r.isIpad=l==="iPad",r.isIphone=l==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),r.isLinux=l.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(s)},6106:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let s=0;r.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(s=this._search(this._getKey(l)),this._array.splice(s,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const _=this._getKey(l);if(_===void 0||(s=this._search(_),s===-1)||this._getKey(this._array[s])!==_)return!1;do if(this._array[s]===l)return this._array.splice(s,1),!0;while(++s<this._array.length&&this._getKey(this._array[s])===_);return!1}*getKeyIterator(l){if(this._array.length!==0&&(s=this._search(l),!(s<0||s>=this._array.length)&&this._getKey(this._array[s])===l))do yield this._array[s];while(++s<this._array.length&&this._getKey(this._array[s])===l)}forEachByKey(l,_){if(this._array.length!==0&&(s=this._search(l),!(s<0||s>=this._array.length)&&this._getKey(this._array[s])===l))do _(this._array[s]);while(++s<this._array.length&&this._getKey(this._array[s])===l)}values(){return[...this._array].values()}_search(l){let _=0,h=this._array.length-1;for(;h>=_;){let f=_+h>>1;const v=this._getKey(this._array[f]);if(v>l)h=f-1;else{if(!(v<l)){for(;f>0&&this._getKey(this._array[f-1])===l;)f--;return f}_=f+1}}return _}}},7226:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const l=s(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),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(v){this._idleCallback=void 0;let y=0,u=0,n=v.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),u=Math.max(y,u),a=v.timeRemaining(),1.5*u>a)return n-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-y))}ms`),void this._start();n=a}this.clear()}}class h extends _{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const y=Date.now()+v;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}r.PriorityTaskQueue=h,r.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:h,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const l=s(643);r.updateWindowsModeWrappedState=function(_){const h=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),f=h?.get(_.cols-1),v=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);v&&f&&(v.isWrapped=f[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&f[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class s{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new s;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}r.AttributeData=s;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,f=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=f}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=l},9092:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const l=s(6349),_=s(7226),h=s(3734),f=s(8437),v=s(4634),y=s(511),u=s(643),n=s(4863),a=s(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(i,o,d){this._hasScrollback=i,this._optionsService=o,this._bufferService=d,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.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 l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,o){return new f.BufferLine(this._bufferService.cols,this.getNullCell(i),o)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const o=i+this._optionsService.rawOptions.scrollback;return o>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:o}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=f.DEFAULT_ATTR_DATA);let o=this._rows;for(;o--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,o){const d=this.getNullCell(f.DEFAULT_ATTR_DATA);let S=0;const b=this._getCorrectBufferLength(o);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<i)for(let p=0;p<this.lines.length;p++)S+=+this.lines.get(p).resize(i,d);let C=0;if(this._rows<o)for(let p=this._rows;p<o;p++)this.lines.length<o+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(i,d)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(i,d)));else for(let p=this._rows;p>o;p--)this.lines.length>o+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const p=this.lines.length-b;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=b}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,o-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=o-1,this._isReflowEnabled&&(this._reflow(i,o),this._cols>i))for(let C=0;C<this.lines.length;C++)S+=+this.lines.get(C).resize(i,d);this._cols=i,this._rows=o,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let o=0;for(;this._memoryCleanupPosition<this.lines.length;)if(o+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),o>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,o){this._cols!==i&&(i>this._cols?this._reflowLarger(i,o):this._reflowSmaller(i,o))}_reflowLarger(i,o){const d=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(d.length>0){const S=(0,v.reflowLargerCreateNewLayout)(this.lines,d);(0,v.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(i,o,S.countRemoved)}}_reflowLargerAdjustViewport(i,o,d){const S=this.getNullCell(f.DEFAULT_ATTR_DATA);let b=d;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<o&&this.lines.push(new f.BufferLine(i,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-d,0)}_reflowSmaller(i,o){const d=this.getNullCell(f.DEFAULT_ATTR_DATA),S=[];let b=0;for(let C=this.lines.length-1;C>=0;C--){let p=this.lines.get(C);if(!p||!p.isWrapped&&p.getTrimmedLength()<=i)continue;const E=[p];for(;p.isWrapped&&C>0;)p=this.lines.get(--C),E.unshift(p);const P=this.ybase+this.y;if(P>=C&&P<C+E.length)continue;const T=E[E.length-1].getTrimmedLength(),B=(0,v.reflowSmallerGetNewLineLengths)(E,this._cols,i),R=B.length-E.length;let M;M=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+R):Math.max(0,this.lines.length-this.lines.maxLength+R);const j=[];for(let A=0;A<R;A++){const O=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);j.push(O)}j.length>0&&(S.push({start:C+E.length+b,newLines:j}),b+=j.length),E.push(...j);let N=B.length-1,K=B[N];K===0&&(N--,K=B[N]);let W=E.length-R-1,x=T;for(;W>=0;){const A=Math.min(x,K);if(E[N]===void 0)break;if(E[N].copyCellsFrom(E[W],x-A,K-A,A,!0),K-=A,K===0&&(N--,K=B[N]),x-=A,x===0){W--;const O=Math.max(W,0);x=(0,v.getWrappedLineTrimmedLength)(E,O,this._cols)}}for(let A=0;A<E.length;A++)B[A]<i&&E[A].setCell(B[A],d);let L=R-M;for(;L-- >0;)this.ybase===0?this.y<o-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-o&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+R,this.ybase+o-1)}if(S.length>0){const C=[],p=[];for(let N=0;N<this.lines.length;N++)p.push(this.lines.get(N));const E=this.lines.length;let P=E-1,T=0,B=S[T];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let R=0;for(let N=Math.min(this.lines.maxLength-1,E+b-1);N>=0;N--)if(B&&B.start>P+R){for(let K=B.newLines.length-1;K>=0;K--)this.lines.set(N--,B.newLines[K]);N++,C.push({index:P+1,amount:B.newLines.length}),R+=B.newLines.length,B=S[++T]}else this.lines.set(N,p[P--]);let M=0;for(let N=C.length-1;N>=0;N--)C[N].index+=M,this.lines.onInsertEmitter.fire(C[N]),M+=C[N].amount;const j=Math.max(0,E+b-this.lines.maxLength);j>0&&this.lines.onTrimEmitter.fire(j)}}translateBufferLineToString(i,o,d=0,S){const b=this.lines.get(i);return b?b.translateToString(o,d,S):""}getWrappedRangeForLine(i){let o=i,d=i;for(;o>0&&this.lines.get(o).isWrapped;)o--;for(;d+1<this.lines.length&&this.lines.get(d+1).isWrapped;)d++;return{first:o,last:d}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].line===i&&(this.markers[o].dispose(),this.markers.splice(o--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const o=new n.Marker(i);return this.markers.push(o),o.register(this.lines.onTrim(d=>{o.line-=d,o.line<0&&o.dispose()})),o.register(this.lines.onInsert(d=>{o.line>=d.index&&(o.line+=d.amount)})),o.register(this.lines.onDelete(d=>{o.line>=d.index&&o.line<d.index+d.amount&&o.dispose(),o.line>d.index&&(o.line-=d.amount)})),o.register(o.onDispose(()=>this._removeMarker(o))),o}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const l=s(3734),_=s(511),h=s(643),f=s(482);r.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let v=0;class y{constructor(n,a,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const o=a||_.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let d=0;d<n;++d)this.setCell(d,o);this.length=n}get(n){const a=this._data[3*n+0],i=2097151&a;return[this._data[3*n+1],2097152&a?this._combined[n]:i?(0,f.stringFromCodePoint)(i):"",a>>22,2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):i]}set(n,a){this._data[3*n+1]=a[h.CHAR_DATA_ATTR_INDEX],a[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=a[1],this._data[3*n+0]=2097152|n|a[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=a[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&a}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n]:2097151&a?(0,f.stringFromCodePoint)(2097151&a):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,a){return v=3*n,a.content=this._data[v+0],a.fg=this._data[v+1],a.bg=this._data[v+2],2097152&a.content&&(a.combinedData=this._combined[n]),268435456&a.bg&&(a.extended=this._extendedAttrs[n]),a}setCell(n,a){2097152&a.content&&(this._combined[n]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[n]=a.extended),this._data[3*n+0]=a.content,this._data[3*n+1]=a.fg,this._data[3*n+2]=a.bg}setCellFromCodepoint(n,a,i,o){268435456&o.bg&&(this._extendedAttrs[n]=o.extended),this._data[3*n+0]=a|i<<22,this._data[3*n+1]=o.fg,this._data[3*n+2]=o.bg}addCodepointToCell(n,a,i){let o=this._data[3*n+0];2097152&o?this._combined[n]+=(0,f.stringFromCodePoint)(a):2097151&o?(this._combined[n]=(0,f.stringFromCodePoint)(2097151&o)+(0,f.stringFromCodePoint)(a),o&=-2097152,o|=2097152):o=a|4194304,i&&(o&=-12582913,o|=i<<22),this._data[3*n+0]=o}insertCells(n,a,i){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,i),a<this.length-n){const o=new _.CellData;for(let d=this.length-n-a-1;d>=0;--d)this.setCell(n+a+d,this.loadCell(n+d,o));for(let d=0;d<a;++d)this.setCell(n+d,i)}else for(let o=n;o<this.length;++o)this.setCell(o,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(n,a,i){if(n%=this.length,a<this.length-n){const o=new _.CellData;for(let d=0;d<this.length-n-a;++d)this.setCell(n+d,this.loadCell(n+a+d,o));for(let d=this.length-a;d<this.length;++d)this.setCell(d,i)}else for(let o=n;o<this.length;++o)this.setCell(o,i);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,i),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,i)}replaceCells(n,a,i,o=!1){if(o)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,i),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,i);n<a&&n<this.length;)this.isProtected(n)||this.setCell(n,i),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,i),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,i);n<a&&n<this.length;)this.setCell(n++,i)}resize(n,a){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const o=new Uint32Array(i);o.set(this._data),this._data=o}for(let o=this.length;o<n;++o)this.setCell(o,a)}else{this._data=this._data.subarray(0,i);const o=Object.keys(this._combined);for(let S=0;S<o.length;S++){const b=parseInt(o[S],10);b>=n&&delete this._combined[b]}const d=Object.keys(this._extendedAttrs);for(let S=0;S<d.length;S++){const b=parseInt(d[S],10);b>=n&&delete this._extendedAttrs[b]}}return this.length=n,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,a=!1){if(a)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,n);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const a in n._combined)this._combined[a]=n._combined[a];this._extendedAttrs={};for(const a in n._extendedAttrs)this._extendedAttrs[a]=n._extendedAttrs[a];this.isWrapped=n.isWrapped}clone(){const n=new y(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const a in this._combined)n._combined[a]=this._combined[a];for(const a in this._extendedAttrs)n._extendedAttrs[a]=this._extendedAttrs[a];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,a,i,o,d){const S=n._data;if(d)for(let C=o-1;C>=0;C--){for(let p=0;p<3;p++)this._data[3*(i+C)+p]=S[3*(a+C)+p];268435456&S[3*(a+C)+2]&&(this._extendedAttrs[i+C]=n._extendedAttrs[a+C])}else for(let C=0;C<o;C++){for(let p=0;p<3;p++)this._data[3*(i+C)+p]=S[3*(a+C)+p];268435456&S[3*(a+C)+2]&&(this._extendedAttrs[i+C]=n._extendedAttrs[a+C])}const b=Object.keys(n._combined);for(let C=0;C<b.length;C++){const p=parseInt(b[C],10);p>=a&&(this._combined[p-a+i]=n._combined[p])}}translateToString(n,a,i,o){a=a??0,i=i??this.length,n&&(i=Math.min(i,this.getTrimmedLength())),o&&(o.length=0);let d="";for(;a<i;){const S=this._data[3*a+0],b=2097151&S,C=2097152&S?this._combined[a]:b?(0,f.stringFromCodePoint)(b):h.WHITESPACE_CELL_CHAR;if(d+=C,o)for(let p=0;p<C.length;++p)o.push(a);a+=S>>22||1}return o&&o.push(a),d}}r.BufferLine=y},4841:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(s,l){if(s.start.y>s.end.y)throw new Error(`Buffer range end (${s.end.x}, ${s.end.y}) cannot be before start (${s.start.x}, ${s.start.y})`);return l*(s.end.y-s.start.y)+(s.end.x-s.start.x+1)}},4634:(w,r)=>{function s(l,_,h){if(_===l.length-1)return l[_].getTrimmedLength();const f=!l[_].hasContent(h-1)&&l[_].getWidth(h-1)===1,v=l[_+1].getWidth(0)===2;return f&&v?h-1:h}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(l,_,h,f,v){const y=[];for(let u=0;u<l.length-1;u++){let n=u,a=l.get(++n);if(!a.isWrapped)continue;const i=[l.get(u)];for(;n<l.length&&a.isWrapped;)i.push(a),a=l.get(++n);if(f>=u&&f<n){u+=i.length-1;continue}let o=0,d=s(i,o,_),S=1,b=0;for(;S<i.length;){const p=s(i,S,_),E=p-b,P=h-d,T=Math.min(E,P);i[o].copyCellsFrom(i[S],b,d,T,!1),d+=T,d===h&&(o++,d=0),b+=T,b===p&&(S++,b=0),d===0&&o!==0&&i[o-1].getWidth(h-1)===2&&(i[o].copyCellsFrom(i[o-1],h-1,d++,1,!1),i[o-1].setCell(h-1,v))}i[o].replaceCells(d,h,v);let C=0;for(let p=i.length-1;p>0&&(p>o||i[p].getTrimmedLength()===0);p--)C++;C>0&&(y.push(u+i.length-C),y.push(C)),u+=i.length-1}return y},r.reflowLargerCreateNewLayout=function(l,_){const h=[];let f=0,v=_[f],y=0;for(let u=0;u<l.length;u++)if(v===u){const n=_[++f];l.onDeleteEmitter.fire({index:u-y,amount:n}),u+=n-1,y+=n,v=_[++f]}else h.push(u);return{layout:h,countRemoved:y}},r.reflowLargerApplyNewLayout=function(l,_){const h=[];for(let f=0;f<_.length;f++)h.push(l.get(_[f]));for(let f=0;f<h.length;f++)l.set(f,h[f]);l.length=_.length},r.reflowSmallerGetNewLineLengths=function(l,_,h){const f=[],v=l.map((a,i)=>s(l,i,_)).reduce((a,i)=>a+i);let y=0,u=0,n=0;for(;n<v;){if(v-n<h){f.push(v-n);break}y+=h;const a=s(l,u,_);y>a&&(y-=a,u++);const i=l[u].getWidth(y-1)===2;i&&y--;const o=i?h-1:h;f.push(o),n+=o}return f},r.getWrappedLineTrimmedLength=s},5295:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const l=s(8460),_=s(844),h=s(9092);class f extends _.Disposable{constructor(y,u){super(),this._optionsService=y,this._bufferService=u,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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(y,u){this._normal.resize(y,u),this._alt.resize(y,u),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}r.BufferSet=f},511:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const l=s(482),_=s(643),h=s(3734);class f extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const u=new f;return u.setFromCharData(y),u}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(y[_.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(y[_.CHAR_DATA_CHAR_INDEX].length===2){const n=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const a=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(n-55296)+a-56320+65536|y[_.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[_.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=y[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=f},643:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const l=s(8460),_=s(844);class h{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}r.Marker=h,h._nextId=1},7116:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(w,r)=>{var s,l,_;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
8
- `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(s||(r.C0=s={})),function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"}(l||(r.C1=l={})),function(h){h.ST=`${s.ESC}\\`}(_||(r.C1_ESCAPED=_={}))},7399:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=s(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:["'",'"']};r.evaluateKeyboardEvent=function(h,f,v,y){const u={type:0,cancel:!1,key:void 0},n=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?u.key=f?l.C0.ESC+"OA":l.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?u.key=f?l.C0.ESC+"OD":l.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?u.key=f?l.C0.ESC+"OC":l.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(u.key=f?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:u.key=h.ctrlKey?"\b":l.C0.DEL,h.altKey&&(u.key=l.C0.ESC+u.key);break;case 9:if(h.shiftKey){u.key=l.C0.ESC+"[Z";break}u.key=l.C0.HT,u.cancel=!0;break;case 13:u.key=h.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,u.cancel=!0;break;case 27:u.key=l.C0.ESC,h.altKey&&(u.key=l.C0.ESC+l.C0.ESC),u.cancel=!0;break;case 37:if(h.metaKey)break;n?(u.key=l.C0.ESC+"[1;"+(n+1)+"D",u.key===l.C0.ESC+"[1;3D"&&(u.key=l.C0.ESC+(v?"b":"[1;5D"))):u.key=f?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(h.metaKey)break;n?(u.key=l.C0.ESC+"[1;"+(n+1)+"C",u.key===l.C0.ESC+"[1;3C"&&(u.key=l.C0.ESC+(v?"f":"[1;5C"))):u.key=f?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(h.metaKey)break;n?(u.key=l.C0.ESC+"[1;"+(n+1)+"A",v||u.key!==l.C0.ESC+"[1;3A"||(u.key=l.C0.ESC+"[1;5A")):u.key=f?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(h.metaKey)break;n?(u.key=l.C0.ESC+"[1;"+(n+1)+"B",v||u.key!==l.C0.ESC+"[1;3B"||(u.key=l.C0.ESC+"[1;5B")):u.key=f?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(u.key=l.C0.ESC+"[2~");break;case 46:u.key=n?l.C0.ESC+"[3;"+(n+1)+"~":l.C0.ESC+"[3~";break;case 36:u.key=n?l.C0.ESC+"[1;"+(n+1)+"H":f?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:u.key=n?l.C0.ESC+"[1;"+(n+1)+"F":f?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:h.shiftKey?u.type=2:h.ctrlKey?u.key=l.C0.ESC+"[5;"+(n+1)+"~":u.key=l.C0.ESC+"[5~";break;case 34:h.shiftKey?u.type=3:h.ctrlKey?u.key=l.C0.ESC+"[6;"+(n+1)+"~":u.key=l.C0.ESC+"[6~";break;case 112:u.key=n?l.C0.ESC+"[1;"+(n+1)+"P":l.C0.ESC+"OP";break;case 113:u.key=n?l.C0.ESC+"[1;"+(n+1)+"Q":l.C0.ESC+"OQ";break;case 114:u.key=n?l.C0.ESC+"[1;"+(n+1)+"R":l.C0.ESC+"OR";break;case 115:u.key=n?l.C0.ESC+"[1;"+(n+1)+"S":l.C0.ESC+"OS";break;case 116:u.key=n?l.C0.ESC+"[15;"+(n+1)+"~":l.C0.ESC+"[15~";break;case 117:u.key=n?l.C0.ESC+"[17;"+(n+1)+"~":l.C0.ESC+"[17~";break;case 118:u.key=n?l.C0.ESC+"[18;"+(n+1)+"~":l.C0.ESC+"[18~";break;case 119:u.key=n?l.C0.ESC+"[19;"+(n+1)+"~":l.C0.ESC+"[19~";break;case 120:u.key=n?l.C0.ESC+"[20;"+(n+1)+"~":l.C0.ESC+"[20~";break;case 121:u.key=n?l.C0.ESC+"[21;"+(n+1)+"~":l.C0.ESC+"[21~";break;case 122:u.key=n?l.C0.ESC+"[23;"+(n+1)+"~":l.C0.ESC+"[23~";break;case 123:u.key=n?l.C0.ESC+"[24;"+(n+1)+"~":l.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(v&&!y||!h.altKey||h.metaKey)!v||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?u.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(u.key=l.C0.US),h.key==="@"&&(u.key=l.C0.NUL)):h.keyCode===65&&(u.type=1);else{const a=_[h.keyCode],i=a?.[h.shiftKey?1:0];if(i)u.key=l.C0.ESC+i;else if(h.keyCode>=65&&h.keyCode<=90){const o=h.ctrlKey?h.keyCode-64:h.keyCode+32;let d=String.fromCharCode(o);h.shiftKey&&(d=d.toUpperCase()),u.key=l.C0.ESC+d}else if(h.keyCode===32)u.key=l.C0.ESC+(h.ctrlKey?l.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let o=h.code.slice(3,4);h.shiftKey||(o=o.toLowerCase()),u.key=l.C0.ESC+o,u.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?u.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?u.key=l.C0.NUL:h.keyCode>=51&&h.keyCode<=55?u.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?u.key=l.C0.DEL:h.keyCode===219?u.key=l.C0.ESC:h.keyCode===220?u.key=l.C0.FS:h.keyCode===221&&(u.key=l.C0.GS)}return u}},482:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(s){return s>65535?(s-=65536,String.fromCharCode(55296+(s>>10))+String.fromCharCode(s%1024+56320)):String.fromCharCode(s)},r.utf32ToString=function(s,l=0,_=s.length){let h="";for(let f=l;f<_;++f){let v=s[f];v>65535?(v-=65536,h+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):h+=String.fromCharCode(v)}return h},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(s,l){const _=s.length;if(!_)return 0;let h=0,f=0;if(this._interim){const v=s.charCodeAt(f++);56320<=v&&v<=57343?l[h++]=1024*(this._interim-55296)+v-56320+65536:(l[h++]=this._interim,l[h++]=v),this._interim=0}for(let v=f;v<_;++v){const y=s.charCodeAt(v);if(55296<=y&&y<=56319){if(++v>=_)return this._interim=y,h;const u=s.charCodeAt(v);56320<=u&&u<=57343?l[h++]=1024*(y-55296)+u-56320+65536:(l[h++]=y,l[h++]=u)}else y!==65279&&(l[h++]=y)}return h}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(s,l){const _=s.length;if(!_)return 0;let h,f,v,y,u=0,n=0,a=0;if(this.interim[0]){let d=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let b,C=0;for(;(b=63&this.interim[++C])&&C<4;)S<<=6,S|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=p-C;for(;a<E;){if(a>=_)return 0;if(b=s[a++],(192&b)!=128){a--,d=!0;break}this.interim[C++]=b,S<<=6,S|=63&b}d||(p===2?S<128?a--:l[u++]=S:p===3?S<2048||S>=55296&&S<=57343||S===65279||(l[u++]=S):S<65536||S>1114111||(l[u++]=S)),this.interim.fill(0)}const i=_-4;let o=a;for(;o<_;){for(;!(!(o<i)||128&(h=s[o])||128&(f=s[o+1])||128&(v=s[o+2])||128&(y=s[o+3]));)l[u++]=h,l[u++]=f,l[u++]=v,l[u++]=y,o+=4;if(h=s[o++],h<128)l[u++]=h;else if((224&h)==192){if(o>=_)return this.interim[0]=h,u;if(f=s[o++],(192&f)!=128){o--;continue}if(n=(31&h)<<6|63&f,n<128){o--;continue}l[u++]=n}else if((240&h)==224){if(o>=_)return this.interim[0]=h,u;if(f=s[o++],(192&f)!=128){o--;continue}if(o>=_)return this.interim[0]=h,this.interim[1]=f,u;if(v=s[o++],(192&v)!=128){o--;continue}if(n=(15&h)<<12|(63&f)<<6|63&v,n<2048||n>=55296&&n<=57343||n===65279)continue;l[u++]=n}else if((248&h)==240){if(o>=_)return this.interim[0]=h,u;if(f=s[o++],(192&f)!=128){o--;continue}if(o>=_)return this.interim[0]=h,this.interim[1]=f,u;if(v=s[o++],(192&v)!=128){o--;continue}if(o>=_)return this.interim[0]=h,this.interim[1]=f,this.interim[2]=v,u;if(y=s[o++],(192&y)!=128){o--;continue}if(n=(7&h)<<18|(63&f)<<12|(63&v)<<6|63&y,n<65536||n>1114111)continue;l[u++]=n}}return u}}},225:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const l=s(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]],h=[[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 f;r.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let v=0;v<_.length;++v)f.fill(0,_[v][0],_[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?f[v]:function(y,u){let n,a=0,i=u.length-1;if(y<u[0][0]||y>u[i][1])return!1;for(;i>=a;)if(n=a+i>>1,y>u[n][1])a=n+1;else{if(!(y<u[n][0]))return!0;i=n-1}return!1}(v,h)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,y){let u=this.wcwidth(v),n=u===0&&y!==0;if(n){const a=l.UnicodeService.extractWidth(y);a===0?n=!1:a>u&&(u=a)}return l.UnicodeService.createPropertyValue(0,u,n)}}},5981:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const l=s(8460),_=s(844);class h extends _.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let u;for(this._isSyncWriting=!0;u=this._writeBuffer.shift();){this._action(u);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,y){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+=v.length,this._writeBuffer.push(v),this._callbacks.push(y),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(y)}_innerWrite(v=0,y=!0){const u=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],a=this._action(n,y);if(a){const o=d=>Date.now()-u>=12?setTimeout(()=>this._innerWrite(0,d)):this._innerWrite(u,d);return void a.catch(d=>(queueMicrotask(()=>{throw d}),Promise.resolve(!1))).then(o)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-u>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}r.WriteBuffer=h},5941:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const s=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,l=/^[\da-f]+$/;function _(h,f){const v=h.toString(16),y=v.length<2?"0"+v:v;switch(f){case 4:return v[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}r.parseColor=function(h){if(!h)return;let f=h.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const v=s.exec(f);if(v){const y=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/y*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/y*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/y*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),l.exec(f)&&[3,6,9,12].includes(f.length))){const v=f.length/3,y=[0,0,0];for(let u=0;u<3;++u){const n=parseInt(f.slice(v*u,v*u+v),16);y[u]=v===1?n<<4:v===2?n:v===3?n>>4:n>>8}return y}},r.toRgbString=function(h,f=16){const[v,y,u]=h;return`rgb:${_(v,f)}/${_(y,f)}/${_(u,f)}`}},5770:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const l=s(482),_=s(8742),h=s(5770),f=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(y,u){this._handlers[y]===void 0&&(this._handlers[y]=[]);const n=this._handlers[y];return n.push(u),{dispose:()=>{const a=n.indexOf(u);a!==-1&&n.splice(a,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(y,u){if(this.reset(),this._ident=y,this._active=this._handlers[y]||f,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(u);else this._handlerFb(this._ident,"HOOK",u)}put(y,u,n){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(y,u,n);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(y,u,n))}unhook(y,u=!0){if(this._active.length){let n=!1,a=this._active.length-1,i=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=u,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;a>=0&&(n=this._active[a].unhook(y),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",y);this._active=f,this._ident=0}};const v=new _.Params;v.addParam(0),r.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=v,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():v,this._data="",this._hitLimit=!1}put(y,u,n){this._hitLimit||(this._data+=(0,l.utf32ToString)(y,u,n),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let u=!1;if(this._hitLimit)u=!1;else if(y&&(u=this._handler(this._data,this._params),u instanceof Promise))return u.then(n=>(this._params=v,this._data="",this._hitLimit=!1,n));return this._params=v,this._data="",this._hitLimit=!1,u}}},2015:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const l=s(844),_=s(8742),h=s(6242),f=s(6351);class v{constructor(a){this.table=new Uint8Array(a)}setDefault(a,i){this.table.fill(a<<4|i)}add(a,i,o,d){this.table[i<<8|a]=o<<4|d}addMany(a,i,o,d){for(let S=0;S<a.length;S++)this.table[i<<8|a[S]]=o<<4|d}}r.TransitionTable=v;const y=160;r.VT500_TRANSITION_TABLE=function(){const n=new v(4095),a=Array.apply(null,Array(256)).map((C,p)=>p),i=(C,p)=>a.slice(C,p),o=i(32,127),d=i(0,24);d.push(25),d.push.apply(d,i(28,32));const S=i(0,14);let b;for(b in n.setDefault(1,0),n.addMany(o,0,2,0),S)n.addMany([24,26,153,154],b,3,0),n.addMany(i(128,144),b,3,0),n.addMany(i(144,152),b,3,0),n.add(156,b,0,0),n.add(27,b,11,1),n.add(157,b,4,8),n.addMany([152,158,159],b,0,7),n.add(155,b,11,3),n.add(144,b,11,9);return n.addMany(d,0,3,0),n.addMany(d,1,3,1),n.add(127,1,0,1),n.addMany(d,8,0,8),n.addMany(d,3,3,3),n.add(127,3,0,3),n.addMany(d,4,3,4),n.add(127,4,0,4),n.addMany(d,6,3,6),n.addMany(d,5,3,5),n.add(127,5,0,5),n.addMany(d,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(o,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(i(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(o,7,0,7),n.addMany(d,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(i(64,127),3,7,0),n.addMany(i(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(i(48,60),4,8,4),n.addMany(i(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(i(32,64),6,0,6),n.add(127,6,0,6),n.addMany(i(64,127),6,0,0),n.addMany(i(32,48),3,9,5),n.addMany(i(32,48),5,9,5),n.addMany(i(48,64),5,0,6),n.addMany(i(64,127),5,7,0),n.addMany(i(32,48),4,9,5),n.addMany(i(32,48),1,9,2),n.addMany(i(32,48),2,9,2),n.addMany(i(48,127),2,10,0),n.addMany(i(48,80),1,10,0),n.addMany(i(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(i(96,127),1,10,0),n.add(80,1,11,9),n.addMany(d,9,0,9),n.add(127,9,0,9),n.addMany(i(28,32),9,0,9),n.addMany(i(32,48),9,9,12),n.addMany(i(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(d,11,0,11),n.addMany(i(32,128),11,0,11),n.addMany(i(28,32),11,0,11),n.addMany(d,10,0,10),n.add(127,10,0,10),n.addMany(i(28,32),10,0,10),n.addMany(i(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(i(32,48),10,9,12),n.addMany(d,12,0,12),n.add(127,12,0,12),n.addMany(i(28,32),12,0,12),n.addMany(i(32,48),12,9,12),n.addMany(i(48,64),12,0,11),n.addMany(i(64,127),12,12,13),n.addMany(i(64,127),10,12,13),n.addMany(i(64,127),9,12,13),n.addMany(d,13,13,13),n.addMany(o,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(y,0,2,0),n.add(y,8,5,8),n.add(y,6,0,6),n.add(y,11,0,11),n.add(y,13,13,13),n}();class u extends l.Disposable{constructor(a=r.VT500_TRANSITION_TABLE){super(),this._transitions=a,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=(i,o,d)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,o)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(a,i=[64,126]){let o=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(o=a.prefix.charCodeAt(0),o&&60>o||o>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<a.intermediates.length;++S){const b=a.intermediates.charCodeAt(S);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");o<<=8,o|=b}}if(a.final.length!==1)throw new Error("final must be a single byte");const d=a.final.charCodeAt(0);if(i[0]>d||d>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return o<<=8,o|=d,o}identToString(a){const i=[];for(;a;)i.push(String.fromCharCode(255&a)),a>>=8;return i.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,i){const o=this._identifier(a,[48,126]);this._escHandlers[o]===void 0&&(this._escHandlers[o]=[]);const d=this._escHandlers[o];return d.push(i),{dispose:()=>{const S=d.indexOf(i);S!==-1&&d.splice(S,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,i){this._executeHandlers[a.charCodeAt(0)]=i}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,i){const o=this._identifier(a);this._csiHandlers[o]===void 0&&(this._csiHandlers[o]=[]);const d=this._csiHandlers[o];return d.push(i),{dispose:()=>{const S=d.indexOf(i);S!==-1&&d.splice(S,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,i){return this._dcsParser.registerHandler(this._identifier(a),i)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,i){return this._oscParser.registerHandler(a,i)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}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(a,i,o,d,S){this._parseStack.state=a,this._parseStack.handlers=i,this._parseStack.handlerPos=o,this._parseStack.transition=d,this._parseStack.chunkPos=S}parse(a,i,o){let d,S=0,b=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(o===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const p=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(o===!1&&E>-1){for(;E>=0&&(d=p[E](this._params),d!==!0);E--)if(d instanceof Promise)return this._parseStack.handlerPos=E,d}this._parseStack.handlers=[];break;case 4:if(o===!1&&E>-1){for(;E>=0&&(d=p[E](),d!==!0);E--)if(d instanceof Promise)return this._parseStack.handlerPos=E,d}this._parseStack.handlers=[];break;case 6:if(S=a[this._parseStack.chunkPos],d=this._dcsParser.unhook(S!==24&&S!==26,o),d)return d;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=a[this._parseStack.chunkPos],d=this._oscParser.end(S!==24&&S!==26,o),d)return d;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let p=C;p<i;++p){switch(S=a[p],b=this._transitions.table[this.currentState<<8|(S<160?S:y)],b>>4){case 2:for(let R=p+1;;++R){if(R>=i||(S=a[R])<32||S>126&&S<y){this._printHandler(a,p,R),p=R-1;break}if(++R>=i||(S=a[R])<32||S>126&&S<y){this._printHandler(a,p,R),p=R-1;break}if(++R>=i||(S=a[R])<32||S>126&&S<y){this._printHandler(a,p,R),p=R-1;break}if(++R>=i||(S=a[R])<32||S>126&&S<y){this._printHandler(a,p,R),p=R-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|S];let P=E?E.length-1:-1;for(;P>=0&&(d=E[P](this._params),d!==!0);P--)if(d instanceof Promise)return this._preserveStack(3,E,P,b,p),d;P<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++p<i&&(S=a[p])>47&&S<60);p--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const T=this._escHandlers[this._collect<<8|S];let B=T?T.length-1:-1;for(;B>=0&&(d=T[B](),d!==!0);B--)if(d instanceof Promise)return this._preserveStack(4,T,B,b,p),d;B<0&&this._escHandlerFb(this._collect<<8|S),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|S,this._params);break;case 13:for(let R=p+1;;++R)if(R>=i||(S=a[R])===24||S===26||S===27||S>127&&S<y){this._dcsParser.put(a,p,R),p=R-1;break}break;case 14:if(d=this._dcsParser.unhook(S!==24&&S!==26),d)return this._preserveStack(6,[],0,b,p),d;S===27&&(b|=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 R=p+1;;R++)if(R>=i||(S=a[R])<32||S>127&&S<y){this._oscParser.put(a,p,R),p=R-1;break}break;case 6:if(d=this._oscParser.end(S!==24&&S!==26),d)return this._preserveStack(5,[],0,b,p),d;S===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}r.EscapeSequenceParser=u},6242:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const l=s(5770),_=s(482),h=[];r.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,v){this._handlers[f]===void 0&&(this._handlers[f]=[]);const y=this._handlers[f];return y.push(v),{dispose:()=>{const u=y.indexOf(v);u!==-1&&y.splice(u,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,v,y){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(f,v,y);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(f,v,y))}start(){this.reset(),this._state=1}put(f,v,y){if(this._state!==3){if(this._state===1)for(;v<y;){const u=f[v++];if(u===59){this._state=2,this._start();break}if(u<48||57<u)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+u-48}this._state===2&&y-v>0&&this._put(f,v,y)}}end(f,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,u=this._active.length-1,n=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,y=v,n=this._stack.fallThrough,this._stack.paused=!1),!n&&y===!1){for(;u>=0&&(y=this._active[u].end(f),y!==!0);u--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,y;u--}for(;u>=0;u--)if(y=this._active[u].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",f);this._active=h,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,v,y){this._hitLimit||(this._data+=(0,_.utf32ToString)(f,v,y),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let v=!1;if(this._hitLimit)v=!1;else if(f&&(v=this._handler(this._data),v instanceof Promise))return v.then(y=>(this._data="",this._hitLimit=!1,y));return this._data="",this._hitLimit=!1,v}}},8742:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const s=2147483647;class l{static fromArray(h){const f=new l;if(!h.length)return f;for(let v=Array.isArray(h[0])?1:0;v<h.length;++v){const y=h[v];if(Array.isArray(y))for(let u=0;u<y.length;++u)f.addSubParam(y[u]);else f.addParam(y)}return f}constructor(h=32,f=32){if(this.maxLength=h,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new l(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let f=0;f<this.length;++f){h.push(this.params[f]);const v=this._subParamsIdx[f]>>8,y=255&this._subParamsIdx[f];y-v>0&&h.push(Array.prototype.slice.call(this._subParams,v,y))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>s?s:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>s?s:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const f=this._subParamsIdx[h]>>8,v=255&this._subParamsIdx[h];return v-f>0?this._subParams.subarray(f,v):null}getSubParamsAll(){const h={};for(let f=0;f<this.length;++f){const v=this._subParamsIdx[f]>>8,y=255&this._subParamsIdx[f];y-v>0&&(h[f]=this._subParams.slice(v,y))}return h}addDigit(h){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,y=v[f-1];v[f-1]=~y?Math.min(10*y+h,s):h}}r.Params=l},5741:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let s=this._addons.length-1;s>=0;s--)this._addons[s].instance.dispose()}loadAddon(s,l){const _={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(_),l.dispose=()=>this._wrappedAddonDispose(_),l.activate(s)}_wrappedAddonDispose(s){if(s.isDisposed)return;let l=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===s){l=_;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");s.isDisposed=!0,s.dispose.apply(s.instance),this._addons.splice(l,1)}}},8771:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const l=s(3785),_=s(511);r.BufferApiView=class{constructor(h,f){this._buffer=h,this.type=f}init(h){return this._buffer=h,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(h){const f=this._buffer.lines.get(h);if(f)return new l.BufferLineApiView(f)}getNullCell(){return new _.CellData}}},3785:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const l=s(511);r.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,h){if(!(_<0||_>=this._line.length))return h?(this._line.loadCell(_,h),h):this._line.loadCell(_,new l.CellData)}translateToString(_,h,f){return this._line.translateToString(_,h,f)}}},8285:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const l=s(8771),_=s(8460),h=s(844);class f extends h.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}r.BufferNamespaceApi=f},7975:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(s){this._core=s}registerCsiHandler(s,l){return this._core.registerCsiHandler(s,_=>l(_.toArray()))}addCsiHandler(s,l){return this.registerCsiHandler(s,l)}registerDcsHandler(s,l){return this._core.registerDcsHandler(s,(_,h)=>l(_,h.toArray()))}addDcsHandler(s,l){return this.registerDcsHandler(s,l)}registerEscHandler(s,l){return this._core.registerEscHandler(s,l)}addEscHandler(s,l){return this.registerEscHandler(s,l)}registerOscHandler(s,l){return this._core.registerOscHandler(s,l)}addOscHandler(s,l){return this.registerOscHandler(s,l)}}},7090:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(s){this._core=s}register(s){this._core.unicodeService.register(s)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(s){this._core.unicodeService.activeVersion=s}}},744:function(w,r,s){var l=this&&this.__decorate||function(n,a,i,o){var d,S=arguments.length,b=S<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,i):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,a,i,o);else for(var C=n.length-1;C>=0;C--)(d=n[C])&&(b=(S<3?d(b):S>3?d(a,i,b):d(a,i))||b);return S>3&&b&&Object.defineProperty(a,i,b),b},_=this&&this.__param||function(n,a){return function(i,o){a(i,o,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const h=s(8460),f=s(844),v=s(5295),y=s(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let u=r.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(n,this))}resize(n,a){this.cols=n,this.rows=a,this.buffers.resize(n,a),this._onResize.fire({cols:n,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,a=!1){const i=this.buffer;let o;o=this._cachedBlankLine,o&&o.length===this.cols&&o.getFg(0)===n.fg&&o.getBg(0)===n.bg||(o=i.getBlankLine(n,a),this._cachedBlankLine=o),o.isWrapped=a;const d=i.ybase+i.scrollTop,S=i.ybase+i.scrollBottom;if(i.scrollTop===0){const b=i.lines.isFull;S===i.lines.length-1?b?i.lines.recycle().copyFrom(o):i.lines.push(o.clone()):i.lines.splice(S+1,0,o.clone()),b?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const b=S-d+1;i.lines.shiftElements(d+1,b-1,-1),i.lines.set(S,o.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(n,a,i){const o=this.buffer;if(n<0){if(o.ydisp===0)return;this.isUserScrolling=!0}else n+o.ydisp>=o.ybase&&(this.isUserScrolling=!1);const d=o.ydisp;o.ydisp=Math.max(Math.min(o.ydisp+n,o.ybase),0),d!==o.ydisp&&(a||this._onScroll.fire(o.ydisp))}};r.BufferService=u=l([_(0,y.IOptionsService)],u)},7994:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(s){this.glevel=s,this.charset=this._charsets[s]}setgCharset(s,l){this._charsets[s]=l,this.glevel===s&&(this.charset=l)}}},1753:function(w,r,s){var l=this&&this.__decorate||function(o,d,S,b){var C,p=arguments.length,E=p<3?d:b===null?b=Object.getOwnPropertyDescriptor(d,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,d,S,b);else for(var P=o.length-1;P>=0;P--)(C=o[P])&&(E=(p<3?C(E):p>3?C(d,S,E):C(d,S))||E);return p>3&&E&&Object.defineProperty(d,S,E),E},_=this&&this.__param||function(o,d){return function(S,b){d(S,b,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const h=s(2585),f=s(8460),v=s(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:o=>o.button!==4&&o.action===1&&(o.ctrl=!1,o.alt=!1,o.shift=!1,!0)},VT200:{events:19,restrict:o=>o.action!==32},DRAG:{events:23,restrict:o=>o.action!==32||o.button!==3},ANY:{events:31,restrict:o=>!0}};function u(o,d){let S=(o.ctrl?16:0)|(o.shift?4:0)|(o.alt?8:0);return o.button===4?(S|=64,S|=o.action):(S|=3&o.button,4&o.button&&(S|=64),8&o.button&&(S|=128),o.action===32?S|=32:o.action!==0||d||(S|=3)),S}const n=String.fromCharCode,a={DEFAULT:o=>{const d=[u(o,!1)+32,o.col+32,o.row+32];return d[0]>255||d[1]>255||d[2]>255?"":`\x1B[M${n(d[0])}${n(d[1])}${n(d[2])}`},SGR:o=>{const d=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${u(o,!0)};${o.col};${o.row}${d}`},SGR_PIXELS:o=>{const d=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${u(o,!0)};${o.x};${o.y}${d}`}};let i=r.CoreMouseService=class extends v.Disposable{constructor(o,d){super(),this._bufferService=o,this._coreService=d,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(y))this.addProtocol(S,y[S]);for(const S of Object.keys(a))this.addEncoding(S,a[S]);this.reset()}addProtocol(o,d){this._protocols[o]=d}addEncoding(o,d){this._encodings[o]=d}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(o){if(!this._protocols[o])throw new Error(`unknown protocol "${o}"`);this._activeProtocol=o,this._onProtocolChange.fire(this._protocols[o].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(o){if(!this._encodings[o])throw new Error(`unknown encoding "${o}"`);this._activeEncoding=o}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(o){if(o.col<0||o.col>=this._bufferService.cols||o.row<0||o.row>=this._bufferService.rows||o.button===4&&o.action===32||o.button===3&&o.action!==32||o.button!==4&&(o.action===2||o.action===3)||(o.col++,o.row++,o.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,o,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(o))return!1;const d=this._encodings[this._activeEncoding](o);return d&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(d):this._coreService.triggerDataEvent(d,!0)),this._lastEvent=o,!0}explainEvents(o){return{down:!!(1&o),up:!!(2&o),drag:!!(4&o),move:!!(8&o),wheel:!!(16&o)}}_equalEvents(o,d,S){if(S){if(o.x!==d.x||o.y!==d.y)return!1}else if(o.col!==d.col||o.row!==d.row)return!1;return o.button===d.button&&o.action===d.action&&o.ctrl===d.ctrl&&o.alt===d.alt&&o.shift===d.shift}};r.CoreMouseService=i=l([_(0,h.IBufferService),_(1,h.ICoreService)],i)},6975:function(w,r,s){var l=this&&this.__decorate||function(i,o,d,S){var b,C=arguments.length,p=C<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,d,S);else for(var E=i.length-1;E>=0;E--)(b=i[E])&&(p=(C<3?b(p):C>3?b(o,d,p):b(o,d))||p);return C>3&&p&&Object.defineProperty(o,d,p),p},_=this&&this.__param||function(i,o){return function(d,S){o(d,S,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const h=s(1439),f=s(8460),v=s(844),y=s(2585),u=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=r.CoreService=class extends v.Disposable{constructor(i,o,d){super(),this._bufferService=i,this._logService=o,this._optionsService=d,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(u),this.decPrivateModes=(0,h.clone)(n)}reset(){this.modes=(0,h.clone)(u),this.decPrivateModes=(0,h.clone)(n)}triggerDataEvent(i,o=!1){if(this._optionsService.rawOptions.disableStdin)return;const d=this._bufferService.buffer;o&&this._optionsService.rawOptions.scrollOnUserInput&&d.ybase!==d.ydisp&&this._onRequestScrollToBottom.fire(),o&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(S=>S.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(o=>o.charCodeAt(0))),this._onBinary.fire(i))}};r.CoreService=a=l([_(0,y.IBufferService),_(1,y.ILogService),_(2,y.IOptionsService)],a)},9074:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const l=s(8055),_=s(8460),h=s(844),f=s(6106);let v=0,y=0;class u extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(i=>i?.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,h.toDisposable)(()=>this.reset()))}registerDecoration(i){if(i.marker.isDisposed)return;const o=new n(i);if(o){const d=o.marker.onDispose(()=>o.dispose());o.onDispose(()=>{o&&(this._decorations.delete(o)&&this._onDecorationRemoved.fire(o),d.dispose())}),this._decorations.insert(o),this._onDecorationRegistered.fire(o)}return o}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,o,d){let S=0,b=0;for(const C of this._decorations.getKeyIterator(o))S=C.options.x??0,b=S+(C.options.width??1),i>=S&&i<b&&(!d||(C.options.layer??"bottom")===d)&&(yield C)}forEachDecorationAtCell(i,o,d,S){this._decorations.forEachByKey(o,b=>{v=b.options.x??0,y=v+(b.options.width??1),i>=v&&i<y&&(!d||(b.options.layer??"bottom")===d)&&S(b)})}}r.DecorationService=u;class n extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(i){super(),this.options=i,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=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const l=s(2585),_=s(8343);class h{constructor(...v){this._entries=new Map;for(const[y,u]of v)this.set(y,u)}set(v,y){const u=this._entries.get(v);return this._entries.set(v,y),u}forEach(v){for(const[y,u]of this._entries.entries())v(y,u)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}r.ServiceCollection=h,r.InstantiationService=class{constructor(){this._services=new h,this._services.set(l.IInstantiationService,this)}setService(f,v){this._services.set(f,v)}getService(f){return this._services.get(f)}createInstance(f,...v){const y=(0,_.getServiceDependencies)(f).sort((a,i)=>a.index-i.index),u=[];for(const a of y){const i=this._services.get(a.id);if(!i)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${a.id}.`);u.push(i)}const n=y.length>0?y[0].index:v.length;if(v.length!==n)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${n+1} conflicts with ${v.length} static arguments`);return new f(...v,...u)}}},7866:function(w,r,s){var l=this&&this.__decorate||function(n,a,i,o){var d,S=arguments.length,b=S<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,i):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,a,i,o);else for(var C=n.length-1;C>=0;C--)(d=n[C])&&(b=(S<3?d(b):S>3?d(a,i,b):d(a,i))||b);return S>3&&b&&Object.defineProperty(a,i,b),b},_=this&&this.__param||function(n,a){return function(i,o){a(i,o,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const h=s(844),f=s(2585),v={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let y,u=r.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let a=0;a<n.length;a++)typeof n[a]=="function"&&(n[a]=n[a]())}_log(n,a,i){this._evalLazyOptionalParams(i),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...i)}trace(n,...a){this._logLevel<=f.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,n,a)}debug(n,...a){this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,n,a)}info(n,...a){this._logLevel<=f.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,n,a)}warn(n,...a){this._logLevel<=f.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,n,a)}error(n,...a){this._logLevel<=f.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,n,a)}};r.LogService=u=l([_(0,f.IOptionsService)],u),r.setTraceLogger=function(n){y=n},r.traceCall=function(n,a,i){if(typeof i.value!="function")throw new Error("not supported");const o=i.value;i.value=function(...d){if(y.logLevel!==f.LogLevelEnum.TRACE)return o.apply(this,d);y.trace(`GlyphRenderer#${o.name}(${d.map(b=>JSON.stringify(b)).join(", ")})`);const S=o.apply(this,d);return y.trace(`GlyphRenderer#${o.name} return`,S),S}}},7302:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const l=s(8460),_=s(844),h=s(6114);r.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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends _.Disposable{constructor(u){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...r.DEFAULT_OPTIONS};for(const a in u)if(a in n)try{const i=u[a];n[a]=this._sanitizeAndValidateOption(a,i)}catch(i){console.error(i)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(u,n){return this.onOptionChange(a=>{a===u&&n(this.rawOptions[u])})}onMultipleOptionChange(u,n){return this.onOptionChange(a=>{u.indexOf(a)!==-1&&n()})}_setupOptions(){const u=a=>{if(!(a in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},n=(a,i)=>{if(!(a in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);i=this._sanitizeAndValidateOption(a,i),this.rawOptions[a]!==i&&(this.rawOptions[a]=i,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const i={get:u.bind(this,a),set:n.bind(this,a)};Object.defineProperty(this.options,a,i)}}_sanitizeAndValidateOption(u,n){switch(u){case"cursorStyle":if(n||(n=r.DEFAULT_OPTIONS[u]),!function(a){return a==="block"||a==="underline"||a==="bar"}(n))throw new Error(`"${n}" is not a valid value for ${u}`);break;case"wordSeparator":n||(n=r.DEFAULT_OPTIONS[u]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=f.includes(n)?n:r.DEFAULT_OPTIONS[u];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${u} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${u} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${u} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${u} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}r.OptionsService=v},2660:function(w,r,s){var l=this&&this.__decorate||function(v,y,u,n){var a,i=arguments.length,o=i<3?y:n===null?n=Object.getOwnPropertyDescriptor(y,u):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(v,y,u,n);else for(var d=v.length-1;d>=0;d--)(a=v[d])&&(o=(i<3?a(o):i>3?a(y,u,o):a(y,u))||o);return i>3&&o&&Object.defineProperty(y,u,o),o},_=this&&this.__param||function(v,y){return function(u,n){y(u,n,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const h=s(2585);let f=r.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const y=this._bufferService.buffer;if(v.id===void 0){const d=y.addMarker(y.ybase+y.y),S={data:v,id:this._nextId++,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(S,d)),this._dataByLinkId.set(S.id,S),S.id}const u=v,n=this._getEntryIdKey(u),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,y.ybase+y.y),a.id;const i=y.addMarker(y.ybase+y.y),o={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(o,i)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(v,y){const u=this._dataByLinkId.get(v);if(u&&u.lines.every(n=>n.line!==y)){const n=this._bufferService.buffer.addMarker(y);u.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(u,n))}}getLinkData(v){return this._dataByLinkId.get(v)?.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,y){const u=v.lines.indexOf(y);u!==-1&&(v.lines.splice(u,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};r.OscLinkService=f=l([_(0,h.IBufferService)],f)},8343:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const s="di$target",l="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(_){return _[l]||[]},r.createDecorator=function(_){if(r.serviceRegistry.has(_))return r.serviceRegistry.get(_);const h=function(f,v,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(u,n,a){n[s]===n?n[l].push({id:u,index:a}):(n[l]=[{id:u,index:a}],n[s]=n)})(h,f,y)};return h.toString=()=>_,r.serviceRegistry.set(_,h),h}},2585:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const l=s(8343);var _;r.IBufferService=(0,l.createDecorator)("BufferService"),r.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),r.ICoreService=(0,l.createDecorator)("CoreService"),r.ICharsetService=(0,l.createDecorator)("CharsetService"),r.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(_||(r.LogLevelEnum=_={})),r.ILogService=(0,l.createDecorator)("LogService"),r.IOptionsService=(0,l.createDecorator)("OptionsService"),r.IOscLinkService=(0,l.createDecorator)("OscLinkService"),r.IUnicodeService=(0,l.createDecorator)("UnicodeService"),r.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const l=s(8460),_=s(225);class h{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,y,u=!1){return(16777215&v)<<3|(3&y)<<1|(u?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const v=new _.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let y=0,u=0;const n=v.length;for(let a=0;a<n;++a){let i=v.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return y+this.wcwidth(i);const S=v.charCodeAt(a);56320<=S&&S<=57343?i=1024*(i-55296)+S-56320+65536:y+=this.wcwidth(S)}const o=this.charProperties(i,u);let d=h.extractWidth(o);h.extractShouldJoin(o)&&(d-=h.extractWidth(u)),y+=d,u=o}return y}charProperties(v,y){return this._activeProvider.charProperties(v,y)}}r.UnicodeService=h}},g={};function m(w){var r=g[w];if(r!==void 0)return r.exports;var s=g[w]={exports:{}};return c[w].call(s.exports,s,s.exports,m),s.exports}var k={};return(()=>{var w=k;Object.defineProperty(w,"__esModule",{value:!0}),w.Terminal=void 0;const r=m(9042),s=m(3236),l=m(844),_=m(5741),h=m(8285),f=m(7975),v=m(7090),y=["cols","rows"];class u extends l.Disposable{constructor(a){super(),this._core=this.register(new s.Terminal(a)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const i=d=>this._core.options[d],o=(d,S)=>{this._checkReadonlyOptions(d),this._core.options[d]=S};for(const d in this._core.options){const S={get:i.bind(this,d),set:o.bind(this,d)};Object.defineProperty(this._publicOptions,d,S)}}_checkReadonlyOptions(a){if(y.includes(a))throw new Error(`Option "${a}" 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 f.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const i in a)this._publicOptions[i]=a[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,i=!0){this._core.input(a,i)}resize(a,i){this._verifyIntegers(a,i),this._core.resize(a,i)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,i,o){this._verifyIntegers(a,i,o),this._core.select(a,i,o)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,i){this._verifyIntegers(a,i),this._core.selectLines(a,i)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,i){this._core.write(a,i)}writeln(a,i){this._core.write(a),this._core.write(`\r
9
- `,i)}paste(a){this._core.paste(a)}refresh(a,i){this._verifyIntegers(a,i),this._core.refresh(a,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return r}_verifyIntegers(...a){for(const i of a)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const i of a)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}w.Terminal=u})(),k})())}(lt)),lt.exports}var ls=hs();function z(e,t,c){function g(r,s){var l;Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(l=r._zod).traits??(l.traits=new Set),r._zod.traits.add(e),t(r,s);for(const _ in w.prototype)_ in r||Object.defineProperty(r,_,{value:w.prototype[_].bind(r)});r._zod.constr=w,r._zod.def=s}const m=c?.Parent??Object;class k extends m{}Object.defineProperty(k,"name",{value:e});function w(r){var s;const l=c?.Parent?new k:this;g(l,r),(s=l._zod).deferred??(s.deferred=[]);for(const _ of l._zod.deferred)_();return l}return Object.defineProperty(w,"init",{value:g}),Object.defineProperty(w,Symbol.hasInstance,{value:r=>c?.Parent&&r instanceof c.Parent?!0:r?._zod?.traits?.has(e)}),Object.defineProperty(w,"name",{value:e}),w}class Ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const us={};function ye(e){return us}function dt(e,t){return typeof t=="bigint"?t.toString():t}function gt(e){return e==null}function mt(e){const t=e.startsWith("^")?1:0,c=e.endsWith("$")?e.length-1:e.length;return e.slice(t,c)}function ee(e,t,c){Object.defineProperty(e,t,{get(){{const g=c();return e[t]=g,g}},set(g){Object.defineProperty(e,t,{value:g})},configurable:!0})}const Er="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ht(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ft(e){if(Ht(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const c=t.prototype;return!(Ht(c)===!1||Object.prototype.hasOwnProperty.call(c,"isPrototypeOf")===!1)}function bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ds(e,t,c){const g=new e._zod.constr(t??e._zod.def);return(!t||c?.parent)&&(g._zod.parent=e),g}function Y(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Te(e,t=0){for(let c=t;c<e.issues.length;c++)if(e.issues[c]?.continue!==!0)return!0;return!1}function fs(e,t){return t.map(c=>{var g;return(g=c).path??(g.path=[]),c.path.unshift(e),c})}function Ve(e){return typeof e=="string"?e:e?.message}function Ce(e,t,c){const g={...e,path:e.path??[]};if(!e.message){const m=Ve(e.inst?._zod.def?.error?.(e))??Ve(t?.error?.(e))??Ve(c.customError?.(e))??Ve(c.localeError?.(e))??"Invalid input";g.message=m}return delete g.inst,delete g.continue,t?.reportInput||delete g.input,g}function St(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Me(...e){const[t,c,g]=e;return typeof t=="string"?{message:t,code:"custom",input:c,inst:g}:{...t}}const xr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,dt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kr=z("$ZodError",xr),Dr=z("$ZodError",xr,{Parent:Error});function _s(e,t=c=>c.message){const c={},g=[];for(const m of e.issues)m.path.length>0?(c[m.path[0]]=c[m.path[0]]||[],c[m.path[0]].push(t(m))):g.push(t(m));return{formErrors:g,fieldErrors:c}}function ps(e,t){const c=t||function(k){return k.message},g={_errors:[]},m=k=>{for(const w of k.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map(r=>m({issues:r}));else if(w.code==="invalid_key")m({issues:w.issues});else if(w.code==="invalid_element")m({issues:w.issues});else if(w.path.length===0)g._errors.push(c(w));else{let r=g,s=0;for(;s<w.path.length;){const l=w.path[s];s===w.path.length-1?(r[l]=r[l]||{_errors:[]},r[l]._errors.push(c(w))):r[l]=r[l]||{_errors:[]},r=r[l],s++}}};return m(e),g}const vs=e=>(t,c,g,m)=>{const k=g?Object.assign(g,{async:!1}):{async:!1},w=t._zod.run({value:c,issues:[]},k);if(w instanceof Promise)throw new Ie;if(w.issues.length){const r=new(m?.Err??e)(w.issues.map(s=>Ce(s,k,ye())));throw Er(r,m?.callee),r}return w.value},gs=e=>async(t,c,g,m)=>{const k=g?Object.assign(g,{async:!0}):{async:!0};let w=t._zod.run({value:c,issues:[]},k);if(w instanceof Promise&&(w=await w),w.issues.length){const r=new(m?.Err??e)(w.issues.map(s=>Ce(s,k,ye())));throw Er(r,m?.callee),r}return w.value},Rr=e=>(t,c,g)=>{const m=g?{...g,async:!1}:{async:!1},k=t._zod.run({value:c,issues:[]},m);if(k instanceof Promise)throw new Ie;return k.issues.length?{success:!1,error:new(e??kr)(k.issues.map(w=>Ce(w,m,ye())))}:{success:!0,data:k.value}},ms=Rr(Dr),Lr=e=>async(t,c,g)=>{const m=g?Object.assign(g,{async:!0}):{async:!0};let k=t._zod.run({value:c,issues:[]},m);return k instanceof Promise&&(k=await k),k.issues.length?{success:!1,error:new e(k.issues.map(w=>Ce(w,m,ye())))}:{success:!0,data:k.value}},bs=Lr(Dr),Ss=/^[cC][^\s-]{8,}$/,ys=/^[0-9a-z]+$/,Cs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ws=/^[0-9a-vA-V]{20}$/,Es=/^[A-Za-z0-9]{27}$/,xs=/^[a-zA-Z0-9_-]{21}$/,ks=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ds=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,zt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Rs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ls="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function As(){return new RegExp(Ls,"u")}const Ps=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ts=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Os=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Bs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Is=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ar=/^[A-Za-z0-9_-]*$/,Ms=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Hs=/^\+(?:[0-9]){6,14}[0-9]$/,Pr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Fs=new RegExp(`^${Pr}$`);function Tr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function zs(e){return new RegExp(`^${Tr(e)}$`)}function js(e){const t=Tr({precision:e.precision}),c=["Z"];e.local&&c.push(""),e.offset&&c.push("([+-]\\d{2}:\\d{2})");const g=`${t}(?:${c.join("|")})`;return new RegExp(`^${Pr}T(?:${g})$`)}const $s=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ws=/^[^A-Z]*$/,Ns=/^[^a-z]*$/,pe=z("$ZodCheck",(e,t)=>{var c;e._zod??(e._zod={}),e._zod.def=t,(c=e._zod).onattach??(c.onattach=[])}),Us=z("$ZodCheckMaxLength",(e,t)=>{var c;pe.init(e,t),(c=e._zod.def).when??(c.when=g=>{const m=g.value;return!gt(m)&&m.length!==void 0}),e._zod.onattach.push(g=>{const m=g._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<m&&(g._zod.bag.maximum=t.maximum)}),e._zod.check=g=>{const m=g.value;if(m.length<=t.maximum)return;const w=St(m);g.issues.push({origin:w,code:"too_big",maximum:t.maximum,inclusive:!0,input:m,inst:e,continue:!t.abort})}}),Zs=z("$ZodCheckMinLength",(e,t)=>{var c;pe.init(e,t),(c=e._zod.def).when??(c.when=g=>{const m=g.value;return!gt(m)&&m.length!==void 0}),e._zod.onattach.push(g=>{const m=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>m&&(g._zod.bag.minimum=t.minimum)}),e._zod.check=g=>{const m=g.value;if(m.length>=t.minimum)return;const w=St(m);g.issues.push({origin:w,code:"too_small",minimum:t.minimum,inclusive:!0,input:m,inst:e,continue:!t.abort})}}),qs=z("$ZodCheckLengthEquals",(e,t)=>{var c;pe.init(e,t),(c=e._zod.def).when??(c.when=g=>{const m=g.value;return!gt(m)&&m.length!==void 0}),e._zod.onattach.push(g=>{const m=g._zod.bag;m.minimum=t.length,m.maximum=t.length,m.length=t.length}),e._zod.check=g=>{const m=g.value,k=m.length;if(k===t.length)return;const w=St(m),r=k>t.length;g.issues.push({origin:w,...r?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:g.value,inst:e,continue:!t.abort})}}),et=z("$ZodCheckStringFormat",(e,t)=>{var c,g;pe.init(e,t),e._zod.onattach.push(m=>{const k=m._zod.bag;k.format=t.format,t.pattern&&(k.patterns??(k.patterns=new Set),k.patterns.add(t.pattern))}),t.pattern?(c=e._zod).check??(c.check=m=>{t.pattern.lastIndex=0,!t.pattern.test(m.value)&&m.issues.push({origin:"string",code:"invalid_format",format:t.format,input:m.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(g=e._zod).check??(g.check=()=>{})}),Ks=z("$ZodCheckRegex",(e,t)=>{et.init(e,t),e._zod.check=c=>{t.pattern.lastIndex=0,!t.pattern.test(c.value)&&c.issues.push({origin:"string",code:"invalid_format",format:"regex",input:c.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Vs=z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ws),et.init(e,t)}),Gs=z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ns),et.init(e,t)}),Js=z("$ZodCheckIncludes",(e,t)=>{pe.init(e,t);const c=bt(t.includes),g=new RegExp(typeof t.position=="number"?`^.{${t.position}}${c}`:c);t.pattern=g,e._zod.onattach.push(m=>{const k=m._zod.bag;k.patterns??(k.patterns=new Set),k.patterns.add(g)}),e._zod.check=m=>{m.value.includes(t.includes,t.position)||m.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:m.value,inst:e,continue:!t.abort})}}),Ys=z("$ZodCheckStartsWith",(e,t)=>{pe.init(e,t);const c=new RegExp(`^${bt(t.prefix)}.*`);t.pattern??(t.pattern=c),e._zod.onattach.push(g=>{const m=g._zod.bag;m.patterns??(m.patterns=new Set),m.patterns.add(c)}),e._zod.check=g=>{g.value.startsWith(t.prefix)||g.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:g.value,inst:e,continue:!t.abort})}}),Xs=z("$ZodCheckEndsWith",(e,t)=>{pe.init(e,t);const c=new RegExp(`.*${bt(t.suffix)}$`);t.pattern??(t.pattern=c),e._zod.onattach.push(g=>{const m=g._zod.bag;m.patterns??(m.patterns=new Set),m.patterns.add(c)}),e._zod.check=g=>{g.value.endsWith(t.suffix)||g.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:g.value,inst:e,continue:!t.abort})}}),Qs=z("$ZodCheckOverwrite",(e,t)=>{pe.init(e,t),e._zod.check=c=>{c.value=t.tx(c.value)}}),en={major:4,minor:0,patch:10},ae=z("$ZodType",(e,t)=>{var c;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=en;const g=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&g.unshift(e);for(const m of g)for(const k of m._zod.onattach)k(e);if(g.length===0)(c=e._zod).deferred??(c.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const m=(k,w,r)=>{let s=Te(k),l;for(const _ of w){if(_._zod.def.when){if(!_._zod.def.when(k))continue}else if(s)continue;const h=k.issues.length,f=_._zod.check(k);if(f instanceof Promise&&r?.async===!1)throw new Ie;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,k.issues.length!==h&&(s||(s=Te(k,h)))});else{if(k.issues.length===h)continue;s||(s=Te(k,h))}}return l?l.then(()=>k):k};e._zod.run=(k,w)=>{const r=e._zod.parse(k,w);if(r instanceof Promise){if(w.async===!1)throw new Ie;return r.then(s=>m(s,g,w))}return m(r,g,w)}}e["~standard"]={validate:m=>{try{const k=ms(e,m);return k.success?{value:k.data}:{issues:k.error?.issues}}catch{return bs(e,m).then(w=>w.success?{value:w.data}:{issues:w.error?.issues})}},vendor:"zod",version:1}}),yt=z("$ZodString",(e,t)=>{ae.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$s(e._zod.bag),e._zod.parse=(c,g)=>{if(t.coerce)try{c.value=String(c.value)}catch{}return typeof c.value=="string"||c.issues.push({expected:"string",code:"invalid_type",input:c.value,inst:e}),c}}),te=z("$ZodStringFormat",(e,t)=>{et.init(e,t),yt.init(e,t)}),tn=z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ds),te.init(e,t)}),rn=z("$ZodUUID",(e,t)=>{if(t.version){const g={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(g===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=zt(g))}else t.pattern??(t.pattern=zt());te.init(e,t)}),sn=z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Rs),te.init(e,t)}),nn=z("$ZodURL",(e,t)=>{te.init(e,t),e._zod.check=c=>{try{const g=c.value.trim(),m=new URL(g);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(m.hostname)||c.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Ms.source,input:c.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(m.protocol.endsWith(":")?m.protocol.slice(0,-1):m.protocol)||c.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:c.value,inst:e,continue:!t.abort})),t.normalize?c.value=m.href:c.value=g;return}catch{c.issues.push({code:"invalid_format",format:"url",input:c.value,inst:e,continue:!t.abort})}}}),on=z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=As()),te.init(e,t)}),an=z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=xs),te.init(e,t)}),cn=z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ss),te.init(e,t)}),hn=z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ys),te.init(e,t)}),ln=z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Cs),te.init(e,t)}),un=z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ws),te.init(e,t)}),dn=z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Es),te.init(e,t)}),fn=z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=js(t)),te.init(e,t)}),_n=z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Fs),te.init(e,t)}),pn=z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=zs(t)),te.init(e,t)}),vn=z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ks),te.init(e,t)}),gn=z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ps),te.init(e,t),e._zod.onattach.push(c=>{const g=c._zod.bag;g.format="ipv4"})}),mn=z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ts),te.init(e,t),e._zod.onattach.push(c=>{const g=c._zod.bag;g.format="ipv6"}),e._zod.check=c=>{try{new URL(`http://[${c.value}]`)}catch{c.issues.push({code:"invalid_format",format:"ipv6",input:c.value,inst:e,continue:!t.abort})}}}),bn=z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Os),te.init(e,t)}),Sn=z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Bs),te.init(e,t),e._zod.check=c=>{const[g,m]=c.value.split("/");try{if(!m)throw new Error;const k=Number(m);if(`${k}`!==m)throw new Error;if(k<0||k>128)throw new Error;new URL(`http://[${g}]`)}catch{c.issues.push({code:"invalid_format",format:"cidrv6",input:c.value,inst:e,continue:!t.abort})}}});function Or(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const yn=z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Is),te.init(e,t),e._zod.onattach.push(c=>{c._zod.bag.contentEncoding="base64"}),e._zod.check=c=>{Or(c.value)||c.issues.push({code:"invalid_format",format:"base64",input:c.value,inst:e,continue:!t.abort})}});function Cn(e){if(!Ar.test(e))return!1;const t=e.replace(/[-_]/g,g=>g==="-"?"+":"/"),c=t.padEnd(Math.ceil(t.length/4)*4,"=");return Or(c)}const wn=z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ar),te.init(e,t),e._zod.onattach.push(c=>{c._zod.bag.contentEncoding="base64url"}),e._zod.check=c=>{Cn(c.value)||c.issues.push({code:"invalid_format",format:"base64url",input:c.value,inst:e,continue:!t.abort})}}),En=z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Hs),te.init(e,t)});function xn(e,t=null){try{const c=e.split(".");if(c.length!==3)return!1;const[g]=c;if(!g)return!1;const m=JSON.parse(atob(g));return!("typ"in m&&m?.typ!=="JWT"||!m.alg||t&&(!("alg"in m)||m.alg!==t))}catch{return!1}}const kn=z("$ZodJWT",(e,t)=>{te.init(e,t),e._zod.check=c=>{xn(c.value,t.alg)||c.issues.push({code:"invalid_format",format:"jwt",input:c.value,inst:e,continue:!t.abort})}});function jt(e,t,c){e.issues.length&&t.issues.push(...fs(c,e.issues)),t.value[c]=e.value}const Dn=z("$ZodArray",(e,t)=>{ae.init(e,t),e._zod.parse=(c,g)=>{const m=c.value;if(!Array.isArray(m))return c.issues.push({expected:"array",code:"invalid_type",input:m,inst:e}),c;c.value=Array(m.length);const k=[];for(let w=0;w<m.length;w++){const r=m[w],s=t.element._zod.run({value:r,issues:[]},g);s instanceof Promise?k.push(s.then(l=>jt(l,c,w))):jt(s,c,w)}return k.length?Promise.all(k).then(()=>c):c}});function $t(e,t,c,g){for(const k of e)if(k.issues.length===0)return t.value=k.value,t;const m=e.filter(k=>!Te(k));return m.length===1?(t.value=m[0].value,m[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:c,errors:e.map(k=>k.issues.map(w=>Ce(w,g,ye())))}),t)}const Rn=z("$ZodUnion",(e,t)=>{ae.init(e,t),ee(e._zod,"optin",()=>t.options.some(c=>c._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(c=>c._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(c=>c._zod.values))return new Set(t.options.flatMap(c=>Array.from(c._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(c=>c._zod.pattern)){const c=t.options.map(g=>g._zod.pattern);return new RegExp(`^(${c.map(g=>mt(g.source)).join("|")})$`)}}),e._zod.parse=(c,g)=>{let m=!1;const k=[];for(const w of t.options){const r=w._zod.run({value:c.value,issues:[]},g);if(r instanceof Promise)k.push(r),m=!0;else{if(r.issues.length===0)return r;k.push(r)}}return m?Promise.all(k).then(w=>$t(w,c,e,g)):$t(k,c,e,g)}}),Ln=z("$ZodIntersection",(e,t)=>{ae.init(e,t),e._zod.parse=(c,g)=>{const m=c.value,k=t.left._zod.run({value:m,issues:[]},g),w=t.right._zod.run({value:m,issues:[]},g);return k instanceof Promise||w instanceof Promise?Promise.all([k,w]).then(([s,l])=>Wt(c,s,l)):Wt(c,k,w)}});function ft(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ft(e)&&Ft(t)){const c=Object.keys(t),g=Object.keys(e).filter(k=>c.indexOf(k)!==-1),m={...e,...t};for(const k of g){const w=ft(e[k],t[k]);if(!w.valid)return{valid:!1,mergeErrorPath:[k,...w.mergeErrorPath]};m[k]=w.data}return{valid:!0,data:m}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const c=[];for(let g=0;g<e.length;g++){const m=e[g],k=t[g],w=ft(m,k);if(!w.valid)return{valid:!1,mergeErrorPath:[g,...w.mergeErrorPath]};c.push(w.data)}return{valid:!0,data:c}}return{valid:!1,mergeErrorPath:[]}}function Wt(e,t,c){if(t.issues.length&&e.issues.push(...t.issues),c.issues.length&&e.issues.push(...c.issues),Te(e))return e;const g=ft(t.value,c.value);if(!g.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`);return e.value=g.data,e}const An=z("$ZodTransform",(e,t)=>{ae.init(e,t),e._zod.parse=(c,g)=>{const m=t.transform(c.value,c);if(g.async)return(m instanceof Promise?m:Promise.resolve(m)).then(w=>(c.value=w,c));if(m instanceof Promise)throw new Ie;return c.value=m,c}}),Pn=z("$ZodOptional",(e,t)=>{ae.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{const c=t.innerType._zod.pattern;return c?new RegExp(`^(${mt(c.source)})?$`):void 0}),e._zod.parse=(c,g)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(c,g):c.value===void 0?c:t.innerType._zod.run(c,g)}),Tn=z("$ZodNullable",(e,t)=>{ae.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{const c=t.innerType._zod.pattern;return c?new RegExp(`^(${mt(c.source)}|null)$`):void 0}),ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(c,g)=>c.value===null?c:t.innerType._zod.run(c,g)}),On=z("$ZodDefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(c,g)=>{if(c.value===void 0)return c.value=t.defaultValue,c;const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(k=>Nt(k,t)):Nt(m,t)}});function Nt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Bn=z("$ZodPrefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(c,g)=>(c.value===void 0&&(c.value=t.defaultValue),t.innerType._zod.run(c,g))}),In=z("$ZodNonOptional",(e,t)=>{ae.init(e,t),ee(e._zod,"values",()=>{const c=t.innerType._zod.values;return c?new Set([...c].filter(g=>g!==void 0)):void 0}),e._zod.parse=(c,g)=>{const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(k=>Ut(k,e)):Ut(m,e)}});function Ut(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Mn=z("$ZodCatch",(e,t)=>{ae.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(c,g)=>{const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(k=>(c.value=k.value,k.issues.length&&(c.value=t.catchValue({...c,error:{issues:k.issues.map(w=>Ce(w,g,ye()))},input:c.value}),c.issues=[]),c)):(c.value=m.value,m.issues.length&&(c.value=t.catchValue({...c,error:{issues:m.issues.map(k=>Ce(k,g,ye()))},input:c.value}),c.issues=[]),c)}}),Hn=z("$ZodPipe",(e,t)=>{ae.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(c,g)=>{const m=t.in._zod.run(c,g);return m instanceof Promise?m.then(k=>Zt(k,t,g)):Zt(m,t,g)}});function Zt(e,t,c){return e.issues.length?e:t.out._zod.run({value:e.value,issues:e.issues},c)}const Fn=z("$ZodReadonly",(e,t)=>{ae.init(e,t),ee(e._zod,"propValues",()=>t.innerType._zod.propValues),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(c,g)=>{const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(qt):qt(m)}});function qt(e){return e.value=Object.freeze(e.value),e}const zn=z("$ZodCustom",(e,t)=>{pe.init(e,t),ae.init(e,t),e._zod.parse=(c,g)=>c,e._zod.check=c=>{const g=c.value,m=t.fn(g);if(m instanceof Promise)return m.then(k=>Kt(k,c,g,e));Kt(m,c,g,e)}});function Kt(e,t,c,g){if(!e){const m={code:"custom",input:c,inst:g,path:[...g._zod.def.path??[]],continue:!g._zod.def.abort};g._zod.def.params&&(m.params=g._zod.def.params),t.issues.push(Me(m))}}class jn{constructor(){this._map=new Map,this._idmap=new Map}add(t,...c){const g=c[0];if(this._map.set(t,g),g&&typeof g=="object"&&"id"in g){if(this._idmap.has(g.id))throw new Error(`ID ${g.id} already exists in the registry`);this._idmap.set(g.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const c=this._map.get(t);return c&&typeof c=="object"&&"id"in c&&this._idmap.delete(c.id),this._map.delete(t),this}get(t){const c=t._zod.parent;if(c){const g={...this.get(c)??{}};delete g.id;const m={...g,...this._map.get(t)};return Object.keys(m).length?m:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function $n(){return new jn}const Ge=$n();function Wn(e,t){return new e({type:"string",...Y(t)})}function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Y(t)})}function Vt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Y(t)})}function Un(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Y(t)})}function Zn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Y(t)})}function qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Y(t)})}function Kn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Y(t)})}function Vn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Y(t)})}function Gn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Y(t)})}function Jn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Y(t)})}function Yn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Y(t)})}function Xn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Y(t)})}function Qn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Y(t)})}function eo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Y(t)})}function to(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Y(t)})}function ro(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Y(t)})}function io(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Y(t)})}function so(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Y(t)})}function no(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Y(t)})}function oo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Y(t)})}function ao(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Y(t)})}function co(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Y(t)})}function ho(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Y(t)})}function lo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Y(t)})}function uo(e,t){return new e({type:"string",format:"date",check:"string_format",...Y(t)})}function fo(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Y(t)})}function _o(e,t){return new e({type:"string",format:"duration",check:"string_format",...Y(t)})}function Br(e,t){return new Us({check:"max_length",...Y(t),maximum:e})}function Qe(e,t){return new Zs({check:"min_length",...Y(t),minimum:e})}function Ir(e,t){return new qs({check:"length_equals",...Y(t),length:e})}function po(e,t){return new Ks({check:"string_format",format:"regex",...Y(t),pattern:e})}function vo(e){return new Vs({check:"string_format",format:"lowercase",...Y(e)})}function go(e){return new Gs({check:"string_format",format:"uppercase",...Y(e)})}function mo(e,t){return new Js({check:"string_format",format:"includes",...Y(t),includes:e})}function bo(e,t){return new Ys({check:"string_format",format:"starts_with",...Y(t),prefix:e})}function So(e,t){return new Xs({check:"string_format",format:"ends_with",...Y(t),suffix:e})}function je(e){return new Qs({check:"overwrite",tx:e})}function yo(e){return je(t=>t.normalize(e))}function Co(){return je(e=>e.trim())}function wo(){return je(e=>e.toLowerCase())}function Eo(){return je(e=>e.toUpperCase())}function xo(e,t,c){return new e({type:"array",element:t,...Y(c)})}function ko(e,t,c){return new e({type:"custom",check:"custom",fn:t,...Y(c)})}const Do=z("ZodISODateTime",(e,t)=>{fn.init(e,t),ie.init(e,t)});function Ro(e){return lo(Do,e)}const Lo=z("ZodISODate",(e,t)=>{_n.init(e,t),ie.init(e,t)});function Ao(e){return uo(Lo,e)}const Po=z("ZodISOTime",(e,t)=>{pn.init(e,t),ie.init(e,t)});function To(e){return fo(Po,e)}const Oo=z("ZodISODuration",(e,t)=>{vn.init(e,t),ie.init(e,t)});function Bo(e){return _o(Oo,e)}const Io=(e,t)=>{kr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:c=>ps(e,c)},flatten:{value:c=>_s(e,c)},addIssue:{value:c=>{e.issues.push(c),e.message=JSON.stringify(e.issues,dt,2)}},addIssues:{value:c=>{e.issues.push(...c),e.message=JSON.stringify(e.issues,dt,2)}},isEmpty:{get(){return e.issues.length===0}}})},tt=z("ZodError",Io,{Parent:Error}),Mo=vs(tt),Ho=gs(tt),Fo=Rr(tt),zo=Lr(tt),he=z("ZodType",(e,t)=>(ae.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...c)=>e.clone({...t,checks:[...t.checks??[],...c.map(g=>typeof g=="function"?{_zod:{check:g,def:{check:"custom"},onattach:[]}}:g)]}),e.clone=(c,g)=>ds(e,c,g),e.brand=()=>e,e.register=(c,g)=>(c.add(e,g),e),e.parse=(c,g)=>Mo(e,c,g,{callee:e.parse}),e.safeParse=(c,g)=>Fo(e,c,g),e.parseAsync=async(c,g)=>Ho(e,c,g,{callee:e.parseAsync}),e.safeParseAsync=async(c,g)=>zo(e,c,g),e.spa=e.safeParseAsync,e.refine=(c,g)=>e.check(Ra(c,g)),e.superRefine=c=>e.check(La(c)),e.overwrite=c=>e.check(je(c)),e.optional=()=>Jt(e),e.nullable=()=>Yt(e),e.nullish=()=>Jt(Yt(e)),e.nonoptional=c=>Sa(e,c),e.array=()=>oa(e),e.or=c=>ca([e,c]),e.and=c=>la(e,c),e.transform=c=>Xt(e,da(c)),e.default=c=>va(e,c),e.prefault=c=>ma(e,c),e.catch=c=>Ca(e,c),e.pipe=c=>Xt(e,c),e.readonly=()=>xa(e),e.describe=c=>{const g=e.clone();return Ge.add(g,{description:c}),g},Object.defineProperty(e,"description",{get(){return Ge.get(e)?.description},configurable:!0}),e.meta=(...c)=>{if(c.length===0)return Ge.get(e);const g=e.clone();return Ge.add(g,c[0]),g},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Mr=z("_ZodString",(e,t)=>{yt.init(e,t),he.init(e,t);const c=e._zod.bag;e.format=c.format??null,e.minLength=c.minimum??null,e.maxLength=c.maximum??null,e.regex=(...g)=>e.check(po(...g)),e.includes=(...g)=>e.check(mo(...g)),e.startsWith=(...g)=>e.check(bo(...g)),e.endsWith=(...g)=>e.check(So(...g)),e.min=(...g)=>e.check(Qe(...g)),e.max=(...g)=>e.check(Br(...g)),e.length=(...g)=>e.check(Ir(...g)),e.nonempty=(...g)=>e.check(Qe(1,...g)),e.lowercase=g=>e.check(vo(g)),e.uppercase=g=>e.check(go(g)),e.trim=()=>e.check(Co()),e.normalize=(...g)=>e.check(yo(...g)),e.toLowerCase=()=>e.check(wo()),e.toUpperCase=()=>e.check(Eo())}),jo=z("ZodString",(e,t)=>{yt.init(e,t),Mr.init(e,t),e.email=c=>e.check(Nn(Wo,c)),e.url=c=>e.check(Vn(No,c)),e.jwt=c=>e.check(ho(sa,c)),e.emoji=c=>e.check(Gn(Uo,c)),e.guid=c=>e.check(Vt(Gt,c)),e.uuid=c=>e.check(Un(Je,c)),e.uuidv4=c=>e.check(Zn(Je,c)),e.uuidv6=c=>e.check(qn(Je,c)),e.uuidv7=c=>e.check(Kn(Je,c)),e.nanoid=c=>e.check(Jn(Zo,c)),e.guid=c=>e.check(Vt(Gt,c)),e.cuid=c=>e.check(Yn(qo,c)),e.cuid2=c=>e.check(Xn(Ko,c)),e.ulid=c=>e.check(Qn(Vo,c)),e.base64=c=>e.check(oo(ta,c)),e.base64url=c=>e.check(ao(ra,c)),e.xid=c=>e.check(eo(Go,c)),e.ksuid=c=>e.check(to(Jo,c)),e.ipv4=c=>e.check(ro(Yo,c)),e.ipv6=c=>e.check(io(Xo,c)),e.cidrv4=c=>e.check(so(Qo,c)),e.cidrv6=c=>e.check(no(ea,c)),e.e164=c=>e.check(co(ia,c)),e.datetime=c=>e.check(Ro(c)),e.date=c=>e.check(Ao(c)),e.time=c=>e.check(To(c)),e.duration=c=>e.check(Bo(c))});function $o(e){return Wn(jo,e)}const ie=z("ZodStringFormat",(e,t)=>{te.init(e,t),Mr.init(e,t)}),Wo=z("ZodEmail",(e,t)=>{sn.init(e,t),ie.init(e,t)}),Gt=z("ZodGUID",(e,t)=>{tn.init(e,t),ie.init(e,t)}),Je=z("ZodUUID",(e,t)=>{rn.init(e,t),ie.init(e,t)}),No=z("ZodURL",(e,t)=>{nn.init(e,t),ie.init(e,t)}),Uo=z("ZodEmoji",(e,t)=>{on.init(e,t),ie.init(e,t)}),Zo=z("ZodNanoID",(e,t)=>{an.init(e,t),ie.init(e,t)}),qo=z("ZodCUID",(e,t)=>{cn.init(e,t),ie.init(e,t)}),Ko=z("ZodCUID2",(e,t)=>{hn.init(e,t),ie.init(e,t)}),Vo=z("ZodULID",(e,t)=>{ln.init(e,t),ie.init(e,t)}),Go=z("ZodXID",(e,t)=>{un.init(e,t),ie.init(e,t)}),Jo=z("ZodKSUID",(e,t)=>{dn.init(e,t),ie.init(e,t)}),Yo=z("ZodIPv4",(e,t)=>{gn.init(e,t),ie.init(e,t)}),Xo=z("ZodIPv6",(e,t)=>{mn.init(e,t),ie.init(e,t)}),Qo=z("ZodCIDRv4",(e,t)=>{bn.init(e,t),ie.init(e,t)}),ea=z("ZodCIDRv6",(e,t)=>{Sn.init(e,t),ie.init(e,t)}),ta=z("ZodBase64",(e,t)=>{yn.init(e,t),ie.init(e,t)}),ra=z("ZodBase64URL",(e,t)=>{wn.init(e,t),ie.init(e,t)}),ia=z("ZodE164",(e,t)=>{En.init(e,t),ie.init(e,t)}),sa=z("ZodJWT",(e,t)=>{kn.init(e,t),ie.init(e,t)}),na=z("ZodArray",(e,t)=>{Dn.init(e,t),he.init(e,t),e.element=t.element,e.min=(c,g)=>e.check(Qe(c,g)),e.nonempty=c=>e.check(Qe(1,c)),e.max=(c,g)=>e.check(Br(c,g)),e.length=(c,g)=>e.check(Ir(c,g)),e.unwrap=()=>e.element});function oa(e,t){return xo(na,e,t)}const aa=z("ZodUnion",(e,t)=>{Rn.init(e,t),he.init(e,t),e.options=t.options});function ca(e,t){return new aa({type:"union",options:e,...Y(t)})}const ha=z("ZodIntersection",(e,t)=>{Ln.init(e,t),he.init(e,t)});function la(e,t){return new ha({type:"intersection",left:e,right:t})}const ua=z("ZodTransform",(e,t)=>{An.init(e,t),he.init(e,t),e._zod.parse=(c,g)=>{c.addIssue=k=>{if(typeof k=="string")c.issues.push(Me(k,c.value,t));else{const w=k;w.fatal&&(w.continue=!1),w.code??(w.code="custom"),w.input??(w.input=c.value),w.inst??(w.inst=e),c.issues.push(Me(w))}};const m=t.transform(c.value,c);return m instanceof Promise?m.then(k=>(c.value=k,c)):(c.value=m,c)}});function da(e){return new ua({type:"transform",transform:e})}const fa=z("ZodOptional",(e,t)=>{Pn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Jt(e){return new fa({type:"optional",innerType:e})}const _a=z("ZodNullable",(e,t)=>{Tn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Yt(e){return new _a({type:"nullable",innerType:e})}const pa=z("ZodDefault",(e,t)=>{On.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function va(e,t){return new pa({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const ga=z("ZodPrefault",(e,t)=>{Bn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ma(e,t){return new ga({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const ba=z("ZodNonOptional",(e,t)=>{In.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sa(e,t){return new ba({type:"nonoptional",innerType:e,...Y(t)})}const ya=z("ZodCatch",(e,t)=>{Mn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ca(e,t){return new ya({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const wa=z("ZodPipe",(e,t)=>{Hn.init(e,t),he.init(e,t),e.in=t.in,e.out=t.out});function Xt(e,t){return new wa({type:"pipe",in:e,out:t})}const Ea=z("ZodReadonly",(e,t)=>{Fn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xa(e){return new Ea({type:"readonly",innerType:e})}const ka=z("ZodCustom",(e,t)=>{zn.init(e,t),he.init(e,t)});function Da(e){const t=new pe({check:"custom"});return t._zod.check=e,t}function Ra(e,t={}){return ko(ka,e,t)}function La(e){const t=Da(c=>(c.addIssue=g=>{if(typeof g=="string")c.issues.push(Me(g,c.value,t._zod.def));else{const m=g;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=c.value),m.inst??(m.inst=t),m.continue??(m.continue=!t._zod.def.abort),c.issues.push(Me(m))}},e(c.value,c)));return t}function Aa(e){const t=/\x1b\[<(\d+);(\d+);(\d+)([mM])/.exec(e);if(!t)return;if(!t[1]||!t[2]||!t[3]||!t[4])throw new Error(`Mouse event: Invalid match for data ${e}`);const c=parseInt(t[1],10),g=parseInt(t[2],10),m=parseInt(t[3],10),k=t[4]==="m";return console.log(`Mouse event: buttonCode=${c}, column=${g}, row=${m}, isRelease=${k}`),e}function Hr(e,t){const c=new ls.Terminal({cursorBlink:!1,convertEol:!0,fontSize:13}),g=Cr.macchiato.colors;c.options.theme={background:g.base.hex,black:g.crust.hex,brightBlack:g.surface2.hex,blue:g.blue.hex,brightBlue:g.blue.hex,brightCyan:g.sky.hex,brightRed:g.maroon.hex,brightYellow:g.yellow.hex,cursor:g.text.hex,cyan:g.sky.hex,foreground:g.text.hex,green:g.green.hex,magenta:g.lavender.hex,red:g.red.hex,white:g.text.hex,yellow:g.yellow.hex};const m=new cs.FitAddon;return c.loadAddon(m),c.open(e),m.fit(),window.addEventListener("resize",()=>{m.fit()}),c.onData(k=>{if(typeof k!="string")throw new Error(`unexpected onData message type: '${JSON.stringify(k)}'`);const w=Aa(k);w&&t.onMouseEvent(w)}),c.onKey(k=>{t.onKeyPress(k)}),c}function Fr(){let e=$o().safeParse(sessionStorage.getItem("tabId")).data;return e||(e=Math.random().toString(36),sessionStorage.setItem("tabId",e)),{tabId:e}}class Pa{ready;tabId;terminal;trpc;constructor(t){const c=br({links:[sr({condition:k=>k.type==="subscription",true:Sr({url:"/trpc"}),false:mr({url:"/trpc"})})]});this.trpc=c,this.tabId=Fr();const g=this.tabId,m=Hr(t,{onMouseEvent(k){c.neovim.sendStdin.mutate({tabId:g,data:k}).catch(w=>{console.error("Error sending mouse event",w)})},onKeyPress(k){c.neovim.sendStdin.mutate({tabId:g,data:k.key})}});this.terminal=m,this.ready=new Promise(k=>{console.log("Subscribing to stdout"),c.neovim.initializeStdout.subscribe({client:g},{onStarted(){k()},onData(w){m.write(w)},onError(w){console.error("Error from the application",w)}})})}async startNeovim(t){return await this.ready,await this.trpc.neovim.start.mutate({startNeovimArguments:{filename:t.filename,additionalEnvironmentVariables:t.additionalEnvironmentVariables,startupScriptModifications:t.startupScriptModifications,NVIM_APPNAME:t.NVIM_APPNAME},terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows},tabId:this.tabId})}async runBlockingShellCommand(t){return await this.ready,this.trpc.neovim.runBlockingShellCommand.mutate({...t,tabId:this.tabId})}async runLuaCode(t){return await this.ready,this.trpc.neovim.runLuaCode.mutate({...t,tabId:this.tabId})}async waitForLuaCode(t){await this.ready;try{return await this.trpc.neovim.waitForLuaCode.mutate({...t,tabId:this.tabId})}catch(c){throw c}}async runExCommand(t){return await this.ready,this.trpc.neovim.runExCommand.mutate({...t,tabId:this.tabId})}}function Ta(e,t){e.parser.registerCsiHandler({final:"c"},()=>(t.onKeyPress({key:"\x1B[?1;2c",domEvent:new KeyboardEvent("keydown",{key:"Escape"})}),!0))}class Oa{ready;tabId;terminal;trpc;terminalApi;constructor(t){const c=br({links:[sr({condition:k=>k.type==="subscription",true:Sr({url:"/trpc"}),false:mr({url:"/trpc"})})]});this.trpc=c,this.tabId=Fr();const g=this.tabId;this.terminalApi={onMouseEvent(k){c.terminal.sendStdin.mutate({tabId:g,data:k}).catch(w=>{console.error("Error sending mouse event",w)})},onKeyPress(k){c.terminal.sendStdin.mutate({tabId:g,data:k.key})}};const m=Hr(t,this.terminalApi);this.terminal=m,this.ready=new Promise(k=>{console.log("Subscribing to stdout"),c.terminal.onStdout.subscribe({client:g},{onStarted(){k()},onData(w){m.write(w)},onError(w){console.error("Error from the application",w)}})})}async startTerminalApplication(t){return await this.ready,t.browserSettings.configureTerminal?.({terminal:this.terminal,api:this.terminalApi,recipes:{supportDA1:()=>{Ta(this.terminal,this.terminalApi)}}}),await this.trpc.terminal.start.mutate({tabId:this.tabId,startTerminalArguments:{additionalEnvironmentVariables:t.serverSettings.additionalEnvironmentVariables,commandToRun:t.serverSettings.commandToRun,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}}})}async runBlockingShellCommand(t){return await this.ready,this.trpc.terminal.runBlockingShellCommand.mutate({...t,tabId:this.tabId})}}class zr{constructor(t){this.factory=t}value;get(){return this.value===void 0&&(this.value=this.factory()),this.value}}const Ct=document.querySelector("#app");if(!Ct)throw new Error("No app element found");const Ba=new zr(()=>new Pa(Ct)),Ia=new zr(()=>new Oa(Ct));window.startNeovim=async function(e){const t=Ba.get(),c=await t.startNeovim({additionalEnvironmentVariables:e?.additionalEnvironmentVariables,filename:e?.filename??"initial-file.txt",startupScriptModifications:e?.startupScriptModifications??[],headlessCmd:void 0,NVIM_APPNAME:e?.NVIM_APPNAME});return{runBlockingShellCommand(m){return t.runBlockingShellCommand(m)},runLuaCode(m){return t.runLuaCode(m)},waitForLuaCode(m){return t.waitForLuaCode(m)},runExCommand(m){return t.runExCommand(m)},dir:c}};window.startTerminalApplication=async function(e){const t=Ia.get();return{dir:await t.startTerminalApplication(e),runBlockingShellCommand(m){return t.runBlockingShellCommand(m)}}};
7
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(p){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),a.isLinux&&p&&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(p){const E=this._getMouseBufferCoords(p),P=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!!(P&&T&&E)&&this._areCoordsInSelection(E,P,T)}isCellInSelection(p,E){const P=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!P||!T)&&this._areCoordsInSelection([p,E],P,T)}_areCoordsInSelection(p,E,P){return p[1]>E[1]&&p[1]<P[1]||E[1]===P[1]&&p[1]===E[1]&&p[0]>=E[0]&&p[0]<P[0]||E[1]<P[1]&&p[1]===P[1]&&p[0]<P[0]||E[1]<P[1]&&p[1]===E[1]&&p[0]>=E[0]}_selectWordAtCursor(p,E){const P=this._linkifier.currentLink?.link?.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,i.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const T=this._getMouseBufferCoords(p);return!!T&&(this._selectWordAt(T,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,E){this._model.clearSelection(),p=Math.max(p,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const E=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(p){let E=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const P=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=P?0:(E>P&&(E-=P),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(p){return a.isMac?p.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:p.shiftKey}handleMouseDown(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._handleIncrementalClick(p):p.detail===1?this._handleSingleClick(p):p.detail===2?this._handleDoubleClick(p):p.detail===3&&this._handleTripleClick(p),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(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))}_handleSingleClick(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const E=this._getMouseBufferCoords(p);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(p){return p.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(p),!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(p),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const P=this._bufferService.buffer;if(this._model.selectionEnd[1]<P.lines.length){const T=P.lines.get(this._model.selectionEnd[1]);T&&T.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 p=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(p.ydisp+this._bufferService.rows,p.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=p.ydisp),this.refresh()}}_handleMouseUp(p){const E=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&p.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const P=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(P&&P[0]!==void 0&&P[1]!==void 0){const T=(0,f.moveToCellSequence)(P[0]-1,P[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(T,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,P=!(!p||!E||p[0]===E[0]&&p[1]===E[1]);P?p&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,E,P)):this._oldHasSelection&&this._fireOnSelectionChange(p,E,P)}_fireOnSelectionChange(p,E,P){this._oldSelectionStart=p,this._oldSelectionEnd=E,this._oldHasSelection=P,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(p,E){let P=E;for(let T=0;E>=T;T++){const B=p.loadCell(T,this._workCell).getChars().length;this._workCell.getWidth()===0?P--:B>1&&E!==T&&(P+=B-1)}return P}setSelection(p,E,P){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,E],this._model.selectionStartLength=P,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,E,P=!0,T=!0){if(p[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,D=B.lines.get(p[1]);if(!D)return;const M=B.translateBufferLineToString(p[1],!1);let j=this._convertViewportColToCharacterIndex(D,p[0]),N=j;const K=p[0]-j;let W=0,x=0,L=0,A=0;if(M.charAt(j)===" "){for(;j>0&&M.charAt(j-1)===" ";)j--;for(;N<M.length&&M.charAt(N+1)===" ";)N++}else{let U=p[0],V=p[0];D.getWidth(U)===0&&(W++,U--),D.getWidth(V)===2&&(x++,V++);const G=D.getString(V).length;for(G>1&&(A+=G-1,N+=G-1);U>0&&j>0&&!this._isCharWordSeparator(D.loadCell(U-1,this._workCell));){D.loadCell(U-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,U--):I>1&&(L+=I-1,j-=I-1),j--,U--}for(;V<D.length&&N+1<M.length&&!this._isCharWordSeparator(D.loadCell(V+1,this._workCell));){D.loadCell(V+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,V++):I>1&&(A+=I-1,N+=I-1),N++,V++}}N++;let O=j+K-W+L,F=Math.min(this._bufferService.cols,N-j+W+x-L-A);if(E||M.slice(j,N).trim()!==""){if(P&&O===0&&D.getCodePoint(0)!==32){const U=B.lines.get(p[1]-1);if(U&&D.isWrapped&&U.getCodePoint(this._bufferService.cols-1)!==32){const V=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(V){const G=this._bufferService.cols-V.start;O-=G,F+=G}}}if(T&&O+F===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const U=B.lines.get(p[1]+1);if(U?.isWrapped&&U.getCodePoint(0)!==32){const V=this._getWordAt([0,p[1]+1],!1,!1,!0);V&&(F+=V.length)}}return{start:O,length:F}}}_selectWordAt(p,E){const P=this._getWordAt(p,E);if(P){for(;P.start<0;)P.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[P.start,p[1]],this._model.selectionStartLength=P.length}}_selectToWordAt(p){const E=this._getWordAt(p,!0);if(E){let P=p[1];for(;E.start<0;)E.start+=this._bufferService.cols,P--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,P++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,P]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const E=this._bufferService.buffer.getWrappedRangeForLine(p),P={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,i.getRangeLength)(P,this._bufferService.cols)}};r.SelectionService=C=l([_(3,d.IBufferService),_(4,d.ICoreService),_(5,y.IMouseService),_(6,d.IOptionsService),_(7,y.IRenderService),_(8,y.ICoreBrowserService)],C)},4725:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const l=s(8343);r.ICharSizeService=(0,l.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),r.IMouseService=(0,l.createDecorator)("MouseService"),r.IRenderService=(0,l.createDecorator)("RenderService"),r.ISelectionService=(0,l.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,l.createDecorator)("ThemeService"),r.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(w,r,s){var l=this&&this.__decorate||function(C,p,E,P){var T,B=arguments.length,D=B<3?p:P===null?P=Object.getOwnPropertyDescriptor(p,E):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(C,p,E,P);else for(var M=C.length-1;M>=0;M--)(T=C[M])&&(D=(B<3?T(D):B>3?T(p,E,D):T(p,E))||D);return B>3&&D&&Object.defineProperty(p,E,D),D},_=this&&this.__param||function(C,p){return function(E,P){p(E,P,C)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const h=s(7239),f=s(8055),v=s(8460),y=s(844),u=s(2585),n=f.css.toColor("#ffffff"),a=f.css.toColor("#000000"),i=f.css.toColor("#ffffff"),o=f.css.toColor("#000000"),d={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let E=0;E<216;E++){const P=p[E/36%6|0],T=p[E/6%6|0],B=p[E%6];C.push({css:f.channels.toCss(P,T,B),rgba:f.channels.toRgba(P,T,B)})}for(let E=0;E<24;E++){const P=8+10*E;C.push({css:f.channels.toCss(P,P,P),rgba:f.channels.toRgba(P,P,P)})}return C})());let S=r.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:a,cursor:i,cursorAccent:o,selectionForeground:void 0,selectionBackgroundTransparent:d,selectionBackgroundOpaque:f.color.blend(a,d),selectionInactiveBackgroundTransparent:d,selectionInactiveBackgroundOpaque:f.color.blend(a,d),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(C={}){const p=this._colors;if(p.foreground=b(C.foreground,n),p.background=b(C.background,a),p.cursor=b(C.cursor,i),p.cursorAccent=b(C.cursorAccent,o),p.selectionBackgroundTransparent=b(C.selectionBackground,d),p.selectionBackgroundOpaque=f.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=b(C.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=f.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=C.selectionForeground?b(C.selectionForeground,f.NULL_COLOR):void 0,p.selectionForeground===f.NULL_COLOR&&(p.selectionForeground=void 0),f.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=f.color.opacity(p.selectionBackgroundTransparent,.3)),f.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=f.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=r.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=b(C.black,r.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=b(C.red,r.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=b(C.green,r.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=b(C.yellow,r.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=b(C.blue,r.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=b(C.magenta,r.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=b(C.cyan,r.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=b(C.white,r.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=b(C.brightBlack,r.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=b(C.brightRed,r.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=b(C.brightGreen,r.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=b(C.brightYellow,r.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=b(C.brightBlue,r.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=b(C.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=b(C.brightCyan,r.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=b(C.brightWhite,r.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const E=Math.min(p.ansi.length-16,C.extendedAnsi.length);for(let P=0;P<E;P++)p.ansi[P+16]=b(C.extendedAnsi[P],r.DEFAULT_ANSI_COLORS[P+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(C){C(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 b(C,p){if(C!==void 0)try{return f.css.toColor(C)}catch{}return p}r.ThemeService=S=l([_(0,u.IOptionsService)],S)},6349:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const l=s(8460),_=s(844);class h extends _.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const y=new Array(v);for(let u=0;u<Math.min(v,this.length);u++)y[u]=this._array[this._getCyclicIndex(u)];this._array=y,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let y=this._length;y<v;y++)this._array[y]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,y){this._array[this._getCyclicIndex(v)]=y}push(v){this._array[this._getCyclicIndex(this._length)]=v,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(v,y,...u){if(y){for(let n=v;n<this._length-y;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+y)];this._length-=y,this.onDeleteEmitter.fire({index:v,amount:y})}for(let n=this._length-1;n>=v;n--)this._array[this._getCyclicIndex(n+u.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<u.length;n++)this._array[this._getCyclicIndex(v+n)]=u[n];if(u.length&&this.onInsertEmitter.fire({index:v,amount:u.length}),this._length+u.length>this._maxLength){const n=this._length+u.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=u.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,y,u){if(!(y<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let a=y-1;a>=0;a--)this.set(v+a+u,this.get(v+a));const n=v+y+u-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<y;n++)this.set(v+n+u,this.get(v+n))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}r.CircularList=h},1439:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function s(l,_=5){if(typeof l!="object")return l;const h=Array.isArray(l)?[]:{};for(const f in l)h[f]=_<=1?l[f]:l[f]&&s(l[f],_-1);return h}},8055:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let s=0,l=0,_=0,h=0;var f,v,y,u,n;function a(o){const d=o.toString(16);return d.length<2?"0"+d:d}function i(o,d){return o<d?(d+.05)/(o+.05):(o+.05)/(d+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(o){o.toCss=function(d,S,b,C){return C!==void 0?`#${a(d)}${a(S)}${a(b)}${a(C)}`:`#${a(d)}${a(S)}${a(b)}`},o.toRgba=function(d,S,b,C=255){return(d<<24|S<<16|b<<8|C)>>>0},o.toColor=function(d,S,b,C){return{css:o.toCss(d,S,b,C),rgba:o.toRgba(d,S,b,C)}}}(f||(r.channels=f={})),function(o){function d(S,b){return h=Math.round(255*b),[s,l,_]=n.toChannels(S.rgba),{css:f.toCss(s,l,_,h),rgba:f.toRgba(s,l,_,h)}}o.blend=function(S,b){if(h=(255&b.rgba)/255,h===1)return{css:b.css,rgba:b.rgba};const C=b.rgba>>24&255,p=b.rgba>>16&255,E=b.rgba>>8&255,P=S.rgba>>24&255,T=S.rgba>>16&255,B=S.rgba>>8&255;return s=P+Math.round((C-P)*h),l=T+Math.round((p-T)*h),_=B+Math.round((E-B)*h),{css:f.toCss(s,l,_),rgba:f.toRgba(s,l,_)}},o.isOpaque=function(S){return(255&S.rgba)==255},o.ensureContrastRatio=function(S,b,C){const p=n.ensureContrastRatio(S.rgba,b.rgba,C);if(p)return f.toColor(p>>24&255,p>>16&255,p>>8&255)},o.opaque=function(S){const b=(255|S.rgba)>>>0;return[s,l,_]=n.toChannels(b),{css:f.toCss(s,l,_),rgba:b}},o.opacity=d,o.multiplyOpacity=function(S,b){return h=255&S.rgba,d(S,h*b/255)},o.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(v||(r.color=v={})),function(o){let d,S;try{const b=document.createElement("canvas");b.width=1,b.height=1;const C=b.getContext("2d",{willReadFrequently:!0});C&&(d=C,d.globalCompositeOperation="copy",S=d.createLinearGradient(0,0,1,1))}catch{}o.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return s=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),_=parseInt(b.slice(3,4).repeat(2),16),f.toColor(s,l,_);case 5:return s=parseInt(b.slice(1,2).repeat(2),16),l=parseInt(b.slice(2,3).repeat(2),16),_=parseInt(b.slice(3,4).repeat(2),16),h=parseInt(b.slice(4,5).repeat(2),16),f.toColor(s,l,_,h);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const C=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return s=parseInt(C[1]),l=parseInt(C[2]),_=parseInt(C[3]),h=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),f.toColor(s,l,_,h);if(!d||!S)throw new Error("css.toColor: Unsupported css format");if(d.fillStyle=S,d.fillStyle=b,typeof d.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(d.fillRect(0,0,1,1),[s,l,_,h]=d.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(s,l,_,h),css:b}}}(y||(r.css=y={})),function(o){function d(S,b,C){const p=S/255,E=b/255,P=C/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}o.relativeLuminance=function(S){return d(S>>16&255,S>>8&255,255&S)},o.relativeLuminance2=d}(u||(r.rgb=u={})),function(o){function d(b,C,p){const E=b>>24&255,P=b>>16&255,T=b>>8&255;let B=C>>24&255,D=C>>16&255,M=C>>8&255,j=i(u.relativeLuminance2(B,D,M),u.relativeLuminance2(E,P,T));for(;j<p&&(B>0||D>0||M>0);)B-=Math.max(0,Math.ceil(.1*B)),D-=Math.max(0,Math.ceil(.1*D)),M-=Math.max(0,Math.ceil(.1*M)),j=i(u.relativeLuminance2(B,D,M),u.relativeLuminance2(E,P,T));return(B<<24|D<<16|M<<8|255)>>>0}function S(b,C,p){const E=b>>24&255,P=b>>16&255,T=b>>8&255;let B=C>>24&255,D=C>>16&255,M=C>>8&255,j=i(u.relativeLuminance2(B,D,M),u.relativeLuminance2(E,P,T));for(;j<p&&(B<255||D<255||M<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),D=Math.min(255,D+Math.ceil(.1*(255-D))),M=Math.min(255,M+Math.ceil(.1*(255-M))),j=i(u.relativeLuminance2(B,D,M),u.relativeLuminance2(E,P,T));return(B<<24|D<<16|M<<8|255)>>>0}o.blend=function(b,C){if(h=(255&C)/255,h===1)return C;const p=C>>24&255,E=C>>16&255,P=C>>8&255,T=b>>24&255,B=b>>16&255,D=b>>8&255;return s=T+Math.round((p-T)*h),l=B+Math.round((E-B)*h),_=D+Math.round((P-D)*h),f.toRgba(s,l,_)},o.ensureContrastRatio=function(b,C,p){const E=u.relativeLuminance(b>>8),P=u.relativeLuminance(C>>8);if(i(E,P)<p){if(P<E){const D=d(b,C,p),M=i(E,u.relativeLuminance(D>>8));if(M<p){const j=S(b,C,p);return M>i(E,u.relativeLuminance(j>>8))?D:j}return D}const T=S(b,C,p),B=i(E,u.relativeLuminance(T>>8));if(B<p){const D=d(b,C,p);return B>i(E,u.relativeLuminance(D>>8))?T:D}return T}},o.reduceLuminance=d,o.increaseLuminance=S,o.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}}(n||(r.rgba=n={})),r.toPaddedHex=a,r.contrastRatio=i},8969:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const l=s(844),_=s(2585),h=s(4348),f=s(7866),v=s(744),y=s(7302),u=s(6975),n=s(8460),a=s(1753),i=s(1480),o=s(7994),d=s(9282),S=s(5435),b=s(5981),C=s(2660);let p=!1;class E extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event(T=>{this._onScrollApi?.fire(T.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(T){for(const B in T)this.optionsService.options[B]=T[B]}constructor(T){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new y.OptionsService(T)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(u.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(o.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new b.WriteBuffer((B,D)=>this._inputHandler.parse(B,D))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(T,B){this._writeBuffer.write(T,B)}writeSync(T,B){this._logService.logLevel<=_.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(T,B)}input(T,B=!0){this.coreService.triggerDataEvent(T,B)}resize(T,B){isNaN(T)||isNaN(B)||(T=Math.max(T,v.MINIMUM_COLS),B=Math.max(B,v.MINIMUM_ROWS),this._bufferService.resize(T,B))}scroll(T,B=!1){this._bufferService.scroll(T,B)}scrollLines(T,B,D){this._bufferService.scrollLines(T,B,D)}scrollPages(T){this.scrollLines(T*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(T){const B=T-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(T,B){return this._inputHandler.registerEscHandler(T,B)}registerDcsHandler(T,B){return this._inputHandler.registerDcsHandler(T,B)}registerCsiHandler(T,B){return this._inputHandler.registerCsiHandler(T,B)}registerOscHandler(T,B){return this._inputHandler.registerOscHandler(T,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let T=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?T=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(T=!0),T?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const T=[];T.push(this.onLineFeed(d.updateWindowsModeWrappedState.bind(null,this._bufferService))),T.push(this.registerCsiHandler({final:"H"},()=>((0,d.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)(()=>{for(const B of T)B.dispose()})}}}r.CoreTerminal=E},8460:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=s=>(this._listeners.push(s),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===s)return void this._listeners.splice(l,1)}}})),this._event}fire(s,l){const _=[];for(let h=0;h<this._listeners.length;h++)_.push(this._listeners[h]);for(let h=0;h<_.length;h++)_[h].call(void 0,s,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(s,l){return s(_=>l.fire(_))},r.runAndSubscribe=function(s,l){return l(void 0),s(_=>l(_))}},5435:function(w,r,s){var l=this&&this.__decorate||function(W,x,L,A){var O,F=arguments.length,U=F<3?x:A===null?A=Object.getOwnPropertyDescriptor(x,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(W,x,L,A);else for(var V=W.length-1;V>=0;V--)(O=W[V])&&(U=(F<3?O(U):F>3?O(x,L,U):O(x,L))||U);return F>3&&U&&Object.defineProperty(x,L,U),U},_=this&&this.__param||function(W,x){return function(L,A){x(L,A,W)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const h=s(2584),f=s(7116),v=s(2015),y=s(844),u=s(482),n=s(8437),a=s(8460),i=s(643),o=s(511),d=s(3734),S=s(2585),b=s(1480),C=s(6242),p=s(6351),E=s(5941),P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},T=131072;function B(W,x){if(W>24)return x.setWinLines||!1;switch(W){case 1:return!!x.restoreWin;case 2:return!!x.minimizeWin;case 3:return!!x.setWinPosition;case 4:return!!x.setWinSizePixels;case 5:return!!x.raiseWin;case 6:return!!x.lowerWin;case 7:return!!x.refreshWin;case 8:return!!x.setWinSizeChars;case 9:return!!x.maximizeWin;case 10:return!!x.fullscreenWin;case 11:return!!x.getWinState;case 13:return!!x.getWinPosition;case 14:return!!x.getWinSizePixels;case 15:return!!x.getScreenSizePixels;case 16:return!!x.getCellSizePixels;case 18:return!!x.getWinSizeChars;case 19:return!!x.getScreenSizeChars;case 20:return!!x.getIconTitle;case 21:return!!x.getWinTitle;case 22:return!!x.pushTitle;case 23:return!!x.popTitle;case 24:return!!x.setWinLines}return!1}var D;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(r.WindowsOptionsReportType=D={}));let M=0;class j extends y.Disposable{getAttrData(){return this._curAttrData}constructor(x,L,A,O,F,U,V,G,I=new v.EscapeSequenceParser){super(),this._bufferService=x,this._charsetService=L,this._coreService=A,this._logService=O,this._optionsService=F,this._oscLinkService=U,this._coreMouseService=V,this._unicodeService=G,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new o.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.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 N(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:H.toArray()})}),this._parser.setEscHandlerFallback(R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})}),this._parser.setExecuteHandlerFallback(R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})}),this._parser.setOscHandlerFallback((R,H,$)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:H,data:$})}),this._parser.setDcsHandlerFallback((R,H,$)=>{H==="HOOK"&&($=$.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:H,payload:$})}),this._parser.setPrintHandler((R,H,$)=>this.print(R,H,$)),this._parser.registerCsiHandler({final:"@"},R=>this.insertChars(R)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},R=>this.scrollLeft(R)),this._parser.registerCsiHandler({final:"A"},R=>this.cursorUp(R)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},R=>this.scrollRight(R)),this._parser.registerCsiHandler({final:"B"},R=>this.cursorDown(R)),this._parser.registerCsiHandler({final:"C"},R=>this.cursorForward(R)),this._parser.registerCsiHandler({final:"D"},R=>this.cursorBackward(R)),this._parser.registerCsiHandler({final:"E"},R=>this.cursorNextLine(R)),this._parser.registerCsiHandler({final:"F"},R=>this.cursorPrecedingLine(R)),this._parser.registerCsiHandler({final:"G"},R=>this.cursorCharAbsolute(R)),this._parser.registerCsiHandler({final:"H"},R=>this.cursorPosition(R)),this._parser.registerCsiHandler({final:"I"},R=>this.cursorForwardTab(R)),this._parser.registerCsiHandler({final:"J"},R=>this.eraseInDisplay(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},R=>this.eraseInDisplay(R,!0)),this._parser.registerCsiHandler({final:"K"},R=>this.eraseInLine(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},R=>this.eraseInLine(R,!0)),this._parser.registerCsiHandler({final:"L"},R=>this.insertLines(R)),this._parser.registerCsiHandler({final:"M"},R=>this.deleteLines(R)),this._parser.registerCsiHandler({final:"P"},R=>this.deleteChars(R)),this._parser.registerCsiHandler({final:"S"},R=>this.scrollUp(R)),this._parser.registerCsiHandler({final:"T"},R=>this.scrollDown(R)),this._parser.registerCsiHandler({final:"X"},R=>this.eraseChars(R)),this._parser.registerCsiHandler({final:"Z"},R=>this.cursorBackwardTab(R)),this._parser.registerCsiHandler({final:"`"},R=>this.charPosAbsolute(R)),this._parser.registerCsiHandler({final:"a"},R=>this.hPositionRelative(R)),this._parser.registerCsiHandler({final:"b"},R=>this.repeatPrecedingCharacter(R)),this._parser.registerCsiHandler({final:"c"},R=>this.sendDeviceAttributesPrimary(R)),this._parser.registerCsiHandler({prefix:">",final:"c"},R=>this.sendDeviceAttributesSecondary(R)),this._parser.registerCsiHandler({final:"d"},R=>this.linePosAbsolute(R)),this._parser.registerCsiHandler({final:"e"},R=>this.vPositionRelative(R)),this._parser.registerCsiHandler({final:"f"},R=>this.hVPosition(R)),this._parser.registerCsiHandler({final:"g"},R=>this.tabClear(R)),this._parser.registerCsiHandler({final:"h"},R=>this.setMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"h"},R=>this.setModePrivate(R)),this._parser.registerCsiHandler({final:"l"},R=>this.resetMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"l"},R=>this.resetModePrivate(R)),this._parser.registerCsiHandler({final:"m"},R=>this.charAttributes(R)),this._parser.registerCsiHandler({final:"n"},R=>this.deviceStatus(R)),this._parser.registerCsiHandler({prefix:"?",final:"n"},R=>this.deviceStatusPrivate(R)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},R=>this.softReset(R)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},R=>this.setCursorStyle(R)),this._parser.registerCsiHandler({final:"r"},R=>this.setScrollRegion(R)),this._parser.registerCsiHandler({final:"s"},R=>this.saveCursor(R)),this._parser.registerCsiHandler({final:"t"},R=>this.windowOptions(R)),this._parser.registerCsiHandler({final:"u"},R=>this.restoreCursor(R)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},R=>this.insertColumns(R)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},R=>this.deleteColumns(R)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},R=>this.selectProtected(R)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},R=>this.requestMode(R,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},R=>this.requestMode(R,!1)),this._parser.setExecuteHandler(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new C.OscHandler(R=>(this.setTitle(R),this.setIconName(R),!0))),this._parser.registerOscHandler(1,new C.OscHandler(R=>this.setIconName(R))),this._parser.registerOscHandler(2,new C.OscHandler(R=>this.setTitle(R))),this._parser.registerOscHandler(4,new C.OscHandler(R=>this.setOrReportIndexedColor(R))),this._parser.registerOscHandler(8,new C.OscHandler(R=>this.setHyperlink(R))),this._parser.registerOscHandler(10,new C.OscHandler(R=>this.setOrReportFgColor(R))),this._parser.registerOscHandler(11,new C.OscHandler(R=>this.setOrReportBgColor(R))),this._parser.registerOscHandler(12,new C.OscHandler(R=>this.setOrReportCursorColor(R))),this._parser.registerOscHandler(104,new C.OscHandler(R=>this.restoreIndexedColor(R))),this._parser.registerOscHandler(110,new C.OscHandler(R=>this.restoreFgColor(R))),this._parser.registerOscHandler(111,new C.OscHandler(R=>this.restoreBgColor(R))),this._parser.registerOscHandler(112,new C.OscHandler(R=>this.restoreCursorColor(R))),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 R in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},()=>this.selectCharset("("+R)),this._parser.registerEscHandler({intermediates:")",final:R},()=>this.selectCharset(")"+R)),this._parser.registerEscHandler({intermediates:"*",final:R},()=>this.selectCharset("*"+R)),this._parser.registerEscHandler({intermediates:"+",final:R},()=>this.selectCharset("+"+R)),this._parser.registerEscHandler({intermediates:"-",final:R},()=>this.selectCharset("-"+R)),this._parser.registerEscHandler({intermediates:".",final:R},()=>this.selectCharset("."+R)),this._parser.registerEscHandler({intermediates:"/",final:R},()=>this.selectCharset("/"+R));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(R=>(this._logService.error("Parsing error: ",R),R)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new p.DcsHandler((R,H)=>this.requestStatusString(R,H)))}_preserveStack(x,L,A,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=x,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=A,this._parseStack.position=O}_logSlowResolvingAsync(x){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([x,new Promise((L,A)=>setTimeout(()=>A("#SLOW_TIMEOUT"),5e3))]).catch(L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(x,L){let A,O=this._activeBuffer.x,F=this._activeBuffer.y,U=0;const V=this._parseStack.paused;if(V){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(A),A;O=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,x.length>T&&(U=this._parseStack.position+T)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof x=="string"?` "${x}"`:` "${Array.prototype.map.call(x,R=>String.fromCharCode(R)).join("")}"`),typeof x=="string"?x.split("").map(R=>R.charCodeAt(0)):x),this._parseBuffer.length<x.length&&this._parseBuffer.length<T&&(this._parseBuffer=new Uint32Array(Math.min(x.length,T))),V||this._dirtyRowTracker.clearRange(),x.length>T)for(let R=U;R<x.length;R+=T){const H=R+T<x.length?R+T:x.length,$=typeof x=="string"?this._stringDecoder.decode(x.substring(R,H),this._parseBuffer):this._utf8Decoder.decode(x.subarray(R,H),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,$))return this._preserveStack(O,F,$,R),this._logSlowResolvingAsync(A),A}else if(!V){const R=typeof x=="string"?this._stringDecoder.decode(x,this._parseBuffer):this._utf8Decoder.decode(x,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,R))return this._preserveStack(O,F,R,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===O&&this._activeBuffer.y===F||this._onCursorMove.fire();const G=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(G,this._bufferService.rows-1))}print(x,L,A){let O,F;const U=this._charsetService.charset,V=this._optionsService.rawOptions.screenReaderMode,G=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,H=this._curAttrData;let $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-L>0&&$.getWidth(this._activeBuffer.x-1)===2&&$.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let q=this._parser.precedingJoinState;for(let Z=L;Z<A;++Z){if(O=x[Z],O<127&&U){const ce=U[String.fromCharCode(O)];ce&&(O=ce.charCodeAt(0))}const X=this._unicodeService.charProperties(O,q);F=b.UnicodeService.extractWidth(X);const se=b.UnicodeService.extractShouldJoin(X),ne=se?b.UnicodeService.extractWidth(q):0;if(q=X,V&&this._onA11yChar.fire((0,u.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-ne>G){if(I){const ce=$;let J=this._activeBuffer.x-ne;for(this._activeBuffer.x=ne,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),$=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ne>0&&$ instanceof n.BufferLine&&$.copyCellsFrom(ce,J,0,ne,!1);J<G;)ce.setCellFromCodepoint(J++,0,1,H)}else if(this._activeBuffer.x=G-1,F===2)continue}if(se&&this._activeBuffer.x){const ce=$.getWidth(this._activeBuffer.x-1)?1:2;$.addCodepointToCell(this._activeBuffer.x-ce,O,F);for(let J=F-ne;--J>=0;)$.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(R&&($.insertCells(this._activeBuffer.x,F-ne,this._activeBuffer.getNullCell(H)),$.getWidth(G-1)===2&&$.setCellFromCodepoint(G-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,H)),$.setCellFromCodepoint(this._activeBuffer.x++,O,F,H),F>0)for(;--F;)$.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=q,this._activeBuffer.x<G&&A-L>0&&$.getWidth(this._activeBuffer.x)===0&&!$.hasContent(this._activeBuffer.x)&&$.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(x,L){return x.final!=="t"||x.prefix||x.intermediates?this._parser.registerCsiHandler(x,L):this._parser.registerCsiHandler(x,A=>!B(A.params[0],this._optionsService.rawOptions.windowOptions)||L(A))}registerDcsHandler(x,L){return this._parser.registerDcsHandler(x,new p.DcsHandler(L))}registerEscHandler(x,L){return this._parser.registerEscHandler(x,L)}registerOscHandler(x,L){return this._parser.registerOscHandler(x,new C.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const x=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-x),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(x=this._bufferService.cols-1){this._activeBuffer.x=Math.min(x,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(x,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=x,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=x,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(x,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+x,this._activeBuffer.y+L)}cursorUp(x){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,x.params[0]||1)):this._moveCursor(0,-(x.params[0]||1)),!0}cursorDown(x){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,x.params[0]||1)):this._moveCursor(0,x.params[0]||1),!0}cursorForward(x){return this._moveCursor(x.params[0]||1,0),!0}cursorBackward(x){return this._moveCursor(-(x.params[0]||1),0),!0}cursorNextLine(x){return this.cursorDown(x),this._activeBuffer.x=0,!0}cursorPrecedingLine(x){return this.cursorUp(x),this._activeBuffer.x=0,!0}cursorCharAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(x){return this._setCursor(x.length>=2?(x.params[1]||1)-1:0,(x.params[0]||1)-1),!0}charPosAbsolute(x){return this._setCursor((x.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(x){return this._moveCursor(x.params[0]||1,0),!0}linePosAbsolute(x){return this._setCursor(this._activeBuffer.x,(x.params[0]||1)-1),!0}vPositionRelative(x){return this._moveCursor(0,x.params[0]||1),!0}hVPosition(x){return this.cursorPosition(x),!0}tabClear(x){const L=x.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=x.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(x){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=x.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(x){const L=x.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(x,L,A,O=!1,F=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);U.replaceCells(L,A,this._activeBuffer.getNullCell(this._eraseAttrData()),F),O&&(U.isWrapped=!1)}_resetBufferLine(x,L=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+x),A.isWrapped=!1)}eraseInDisplay(x,L=!1){let A;switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);A<this._bufferService.rows;A++)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,L);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(x,L=!1){switch(this._restrictCursor(this._bufferService.cols),x.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(x){this._restrictCursor();let L=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;L--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(x){this._restrictCursor();let L=x.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;L--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,x.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(x){let L=x.params[0]||1;for(;L--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(x){let L=x.params[0]||1;for(;L--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(x){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=x.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(x){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(x.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(x){const L=this._parser.precedingJoinState;if(!L)return!0;const A=x.params[0]||1,O=b.UnicodeService.extractWidth(L),F=this._activeBuffer.x-O,U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),V=new Uint32Array(U.length*A);let G=0;for(let R=0;R<U.length;){const H=U.codePointAt(R)||0;V[G++]=H,R+=H>65535?2:1}let I=G;for(let R=1;R<A;++R)V.copyWithin(I,0,G),I+=G;return this.print(V,0,I),!0}sendDeviceAttributesPrimary(x){return x.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(x){return x.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(x.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(x){return(this._optionsService.rawOptions.termName+"").indexOf(x)===0}setMode(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.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(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(x){for(let L=0;L<x.length;L++)switch(x.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),x.params[L]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(x,L){const A=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:F}=this._coreMouseService,U=this._coreService,{buffers:V,cols:G}=this._bufferService,{active:I,alt:R}=V,H=this._optionsService.rawOptions,$=se=>se?1:2,q=x.params[0];return Z=q,X=L?q===2?4:q===4?$(U.modes.insertMode):q===12?3:q===20?$(H.convertEol):0:q===1?$(A.applicationCursorKeys):q===3?H.windowOptions.setWinLines?G===80?2:G===132?1:0:0:q===6?$(A.origin):q===7?$(A.wraparound):q===8?3:q===9?$(O==="X10"):q===12?$(H.cursorBlink):q===25?$(!U.isCursorHidden):q===45?$(A.reverseWraparound):q===66?$(A.applicationKeypad):q===67?4:q===1e3?$(O==="VT200"):q===1002?$(O==="DRAG"):q===1003?$(O==="ANY"):q===1004?$(A.sendFocus):q===1005?4:q===1006?$(F==="SGR"):q===1015?4:q===1016?$(F==="SGR_PIXELS"):q===1048?1:q===47||q===1047||q===1049?$(I===R):q===2004?$(A.bracketedPasteMode):0,U.triggerDataEvent(`${h.C0.ESC}[${L?"":"?"}${Z};${X}$y`),!0;var Z,X}_updateAttrColor(x,L,A,O,F){return L===2?(x|=50331648,x&=-16777216,x|=d.AttributeData.fromColorRGB([A,O,F])):L===5&&(x&=-50331904,x|=33554432|255&A),x}_extractColor(x,L,A){const O=[0,0,-1,0,0,0];let F=0,U=0;do{if(O[U+F]=x.params[L+U],x.hasSubParams(L+U)){const V=x.getSubParams(L+U);let G=0;do O[1]===5&&(F=1),O[U+G+1+F]=V[G];while(++G<V.length&&G+U+1+F<O.length);break}if(O[1]===5&&U+F>=2||O[1]===2&&U+F>=5)break;O[1]&&(F=1)}while(++U+L<x.length&&U+F<O.length);for(let V=2;V<O.length;++V)O[V]===-1&&(O[V]=0);switch(O[0]){case 38:A.fg=this._updateAttrColor(A.fg,O[1],O[3],O[4],O[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,O[1],O[3],O[4],O[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,O[1],O[3],O[4],O[5])}return U}_processUnderline(x,L){L.extended=L.extended.clone(),(!~x||x>5)&&(x=1),L.extended.underlineStyle=x,L.fg|=268435456,x===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(x){x.fg=n.DEFAULT_ATTR_DATA.fg,x.bg=n.DEFAULT_ATTR_DATA.bg,x.extended=x.extended.clone(),x.extended.underlineStyle=0,x.extended.underlineColor&=-67108864,x.updateExtended()}charAttributes(x){if(x.length===1&&x.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=x.length;let A;const O=this._curAttrData;for(let F=0;F<L;F++)A=x.params[F],A>=30&&A<=37?(O.fg&=-50331904,O.fg|=16777216|A-30):A>=40&&A<=47?(O.bg&=-50331904,O.bg|=16777216|A-40):A>=90&&A<=97?(O.fg&=-50331904,O.fg|=16777224|A-90):A>=100&&A<=107?(O.bg&=-50331904,O.bg|=16777224|A-100):A===0?this._processSGR0(O):A===1?O.fg|=134217728:A===3?O.bg|=67108864:A===4?(O.fg|=268435456,this._processUnderline(x.hasSubParams(F)?x.getSubParams(F)[0]:1,O)):A===5?O.fg|=536870912:A===7?O.fg|=67108864:A===8?O.fg|=1073741824:A===9?O.fg|=2147483648:A===2?O.bg|=134217728:A===21?this._processUnderline(2,O):A===22?(O.fg&=-134217729,O.bg&=-134217729):A===23?O.bg&=-67108865:A===24?(O.fg&=-268435457,this._processUnderline(0,O)):A===25?O.fg&=-536870913:A===27?O.fg&=-67108865:A===28?O.fg&=-1073741825:A===29?O.fg&=2147483647:A===39?(O.fg&=-67108864,O.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):A===49?(O.bg&=-67108864,O.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?F+=this._extractColor(x,F,O):A===53?O.bg|=1073741824:A===55?O.bg&=-1073741825:A===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):A===100?(O.fg&=-67108864,O.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(x){switch(x.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${L};${A}R`)}return!0}deviceStatusPrivate(x){if(x.params[0]===6){const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${L};${A}R`)}return!0}softReset(x){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(x){const L=x.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const A=L%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(x){const L=x.params[0]||1;let A;return(x.length<2||(A=x.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(x){if(!B(x.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=x.length>1?x.params[1]:0;switch(x.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(x){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(x){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(x){return this._windowTitle=x,this._onTitleChange.fire(x),!0}setIconName(x){return this._iconName=x,!0}setOrReportIndexedColor(x){const L=[],A=x.split(";");for(;A.length>1;){const O=A.shift(),F=A.shift();if(/^\d+$/.exec(O)){const U=parseInt(O);if(K(U))if(F==="?")L.push({type:0,index:U});else{const V=(0,E.parseColor)(F);V&&L.push({type:1,index:U,color:V})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(x){const L=x.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(x,L){this._getCurrentLinkId()&&this._finishHyperlink();const A=x.split(":");let O;const F=A.findIndex(U=>U.startsWith("id="));return F!==-1&&(O=A[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(x,L){const A=x.split(";");for(let O=0;O<A.length&&!(L>=this._specialColors.length);++O,++L)if(A[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const F=(0,E.parseColor)(A[O]);F&&this._onColor.fire([{type:1,index:this._specialColors[L],color:F}])}return!0}setOrReportFgColor(x){return this._setOrReportSpecialColor(x,0)}setOrReportBgColor(x){return this._setOrReportSpecialColor(x,1)}setOrReportCursorColor(x){return this._setOrReportSpecialColor(x,2)}restoreIndexedColor(x){if(!x)return this._onColor.fire([{type:2}]),!0;const L=[],A=x.split(";");for(let O=0;O<A.length;++O)if(/^\d+$/.exec(A[O])){const F=parseInt(A[O]);K(F)&&L.push({type:2,index:F})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(x){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(x){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(x){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,f.DEFAULT_CHARSET),!0}selectCharset(x){return x.length!==2?(this.selectDefaultCharset(),!0):(x[0]==="/"||this._charsetService.setgCharset(P[x[0]],f.CHARSETS[x[1]]||f.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 x=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,x,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(x){return this._charsetService.setgLevel(x),!0}screenAlignmentPattern(){const x=new o.CellData;x.content=4194373,x.fg=this._curAttrData.fg,x.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const A=this._activeBuffer.ybase+this._activeBuffer.y+L,O=this._activeBuffer.lines.get(A);O&&(O.fill(x),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(x,L){const A=this._bufferService.buffer,O=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${F}${h.C0.ESC}\\`),!0))(x==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:x==='"p'?'P1$r61;1"p':x==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:x==="m"?"P1$r0m":x===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(x,L){this._dirtyRowTracker.markRangeDirty(x,L)}}r.InputHandler=j;let N=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){W<this.start?this.start=W:W>this.end&&(this.end=W)}markRangeDirty(W,x){W>x&&(M=W,W=x,x=M),W<this.start&&(this.start=W),x>this.end&&(this.end=x)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(W){return 0<=W&&W<256}N=l([_(0,S.IBufferService)],N)},844:(w,r)=>{function s(l){for(const _ of l)_.dispose();l.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const _=this._disposables.indexOf(l);_!==-1&&this._disposables.splice(_,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){this._isDisposed||l===this._value||(this._value?.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},r.toDisposable=function(l){return{dispose:l}},r.disposeArray=s,r.getDisposeArrayDisposable=function(l){return{dispose:()=>s(l)}}},1505:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class s{constructor(){this._data={}}set(_,h,f){this._data[_]||(this._data[_]={}),this._data[_][h]=f}get(_,h){return this._data[_]?this._data[_][h]:void 0}clear(){this._data={}}}r.TwoKeyMap=s,r.FourKeyMap=class{constructor(){this._data=new s}set(l,_,h,f,v){this._data.get(l,_)||this._data.set(l,_,new s),this._data.get(l,_).set(h,f,v)}get(l,_,h,f){return this._data.get(l,_)?.get(h,f)}clear(){this._data.clear()}}},6114:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const s=r.isNode?"node":navigator.userAgent,l=r.isNode?"node":navigator.platform;r.isFirefox=s.includes("Firefox"),r.isLegacyEdge=s.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(s),r.getSafariVersion=function(){if(!r.isSafari)return 0;const _=s.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),r.isIpad=l==="iPad",r.isIphone=l==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),r.isLinux=l.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(s)},6106:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let s=0;r.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(s=this._search(this._getKey(l)),this._array.splice(s,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const _=this._getKey(l);if(_===void 0||(s=this._search(_),s===-1)||this._getKey(this._array[s])!==_)return!1;do if(this._array[s]===l)return this._array.splice(s,1),!0;while(++s<this._array.length&&this._getKey(this._array[s])===_);return!1}*getKeyIterator(l){if(this._array.length!==0&&(s=this._search(l),!(s<0||s>=this._array.length)&&this._getKey(this._array[s])===l))do yield this._array[s];while(++s<this._array.length&&this._getKey(this._array[s])===l)}forEachByKey(l,_){if(this._array.length!==0&&(s=this._search(l),!(s<0||s>=this._array.length)&&this._getKey(this._array[s])===l))do _(this._array[s]);while(++s<this._array.length&&this._getKey(this._array[s])===l)}values(){return[...this._array].values()}_search(l){let _=0,h=this._array.length-1;for(;h>=_;){let f=_+h>>1;const v=this._getKey(this._array[f]);if(v>l)h=f-1;else{if(!(v<l)){for(;f>0&&this._getKey(this._array[f-1])===l;)f--;return f}_=f+1}}return _}}},7226:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const l=s(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),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(v){this._idleCallback=void 0;let y=0,u=0,n=v.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),u=Math.max(y,u),a=v.timeRemaining(),1.5*u>a)return n-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-y))}ms`),void this._start();n=a}this.clear()}}class h extends _{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const y=Date.now()+v;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}r.PriorityTaskQueue=h,r.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:h,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const l=s(643);r.updateWindowsModeWrappedState=function(_){const h=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),f=h?.get(_.cols-1),v=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);v&&f&&(v.isWrapped=f[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&f[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class s{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new s;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}r.AttributeData=s;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,f=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=f}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=l},9092:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const l=s(6349),_=s(7226),h=s(3734),f=s(8437),v=s(4634),y=s(511),u=s(643),n=s(4863),a=s(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(i,o,d){this._hasScrollback=i,this._optionsService=o,this._bufferService=d,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.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 l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,o){return new f.BufferLine(this._bufferService.cols,this.getNullCell(i),o)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const o=i+this._optionsService.rawOptions.scrollback;return o>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:o}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=f.DEFAULT_ATTR_DATA);let o=this._rows;for(;o--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,o){const d=this.getNullCell(f.DEFAULT_ATTR_DATA);let S=0;const b=this._getCorrectBufferLength(o);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<i)for(let p=0;p<this.lines.length;p++)S+=+this.lines.get(p).resize(i,d);let C=0;if(this._rows<o)for(let p=this._rows;p<o;p++)this.lines.length<o+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(i,d)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(i,d)));else for(let p=this._rows;p>o;p--)this.lines.length>o+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const p=this.lines.length-b;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=b}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,o-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=o-1,this._isReflowEnabled&&(this._reflow(i,o),this._cols>i))for(let C=0;C<this.lines.length;C++)S+=+this.lines.get(C).resize(i,d);this._cols=i,this._rows=o,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let o=0;for(;this._memoryCleanupPosition<this.lines.length;)if(o+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),o>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,o){this._cols!==i&&(i>this._cols?this._reflowLarger(i,o):this._reflowSmaller(i,o))}_reflowLarger(i,o){const d=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(d.length>0){const S=(0,v.reflowLargerCreateNewLayout)(this.lines,d);(0,v.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(i,o,S.countRemoved)}}_reflowLargerAdjustViewport(i,o,d){const S=this.getNullCell(f.DEFAULT_ATTR_DATA);let b=d;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<o&&this.lines.push(new f.BufferLine(i,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-d,0)}_reflowSmaller(i,o){const d=this.getNullCell(f.DEFAULT_ATTR_DATA),S=[];let b=0;for(let C=this.lines.length-1;C>=0;C--){let p=this.lines.get(C);if(!p||!p.isWrapped&&p.getTrimmedLength()<=i)continue;const E=[p];for(;p.isWrapped&&C>0;)p=this.lines.get(--C),E.unshift(p);const P=this.ybase+this.y;if(P>=C&&P<C+E.length)continue;const T=E[E.length-1].getTrimmedLength(),B=(0,v.reflowSmallerGetNewLineLengths)(E,this._cols,i),D=B.length-E.length;let M;M=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const j=[];for(let A=0;A<D;A++){const O=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);j.push(O)}j.length>0&&(S.push({start:C+E.length+b,newLines:j}),b+=j.length),E.push(...j);let N=B.length-1,K=B[N];K===0&&(N--,K=B[N]);let W=E.length-D-1,x=T;for(;W>=0;){const A=Math.min(x,K);if(E[N]===void 0)break;if(E[N].copyCellsFrom(E[W],x-A,K-A,A,!0),K-=A,K===0&&(N--,K=B[N]),x-=A,x===0){W--;const O=Math.max(W,0);x=(0,v.getWrappedLineTrimmedLength)(E,O,this._cols)}}for(let A=0;A<E.length;A++)B[A]<i&&E[A].setCell(B[A],d);let L=D-M;for(;L-- >0;)this.ybase===0?this.y<o-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-o&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+o-1)}if(S.length>0){const C=[],p=[];for(let N=0;N<this.lines.length;N++)p.push(this.lines.get(N));const E=this.lines.length;let P=E-1,T=0,B=S[T];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let D=0;for(let N=Math.min(this.lines.maxLength-1,E+b-1);N>=0;N--)if(B&&B.start>P+D){for(let K=B.newLines.length-1;K>=0;K--)this.lines.set(N--,B.newLines[K]);N++,C.push({index:P+1,amount:B.newLines.length}),D+=B.newLines.length,B=S[++T]}else this.lines.set(N,p[P--]);let M=0;for(let N=C.length-1;N>=0;N--)C[N].index+=M,this.lines.onInsertEmitter.fire(C[N]),M+=C[N].amount;const j=Math.max(0,E+b-this.lines.maxLength);j>0&&this.lines.onTrimEmitter.fire(j)}}translateBufferLineToString(i,o,d=0,S){const b=this.lines.get(i);return b?b.translateToString(o,d,S):""}getWrappedRangeForLine(i){let o=i,d=i;for(;o>0&&this.lines.get(o).isWrapped;)o--;for(;d+1<this.lines.length&&this.lines.get(d+1).isWrapped;)d++;return{first:o,last:d}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].line===i&&(this.markers[o].dispose(),this.markers.splice(o--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const o=new n.Marker(i);return this.markers.push(o),o.register(this.lines.onTrim(d=>{o.line-=d,o.line<0&&o.dispose()})),o.register(this.lines.onInsert(d=>{o.line>=d.index&&(o.line+=d.amount)})),o.register(this.lines.onDelete(d=>{o.line>=d.index&&o.line<d.index+d.amount&&o.dispose(),o.line>d.index&&(o.line-=d.amount)})),o.register(o.onDispose(()=>this._removeMarker(o))),o}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const l=s(3734),_=s(511),h=s(643),f=s(482);r.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let v=0;class y{constructor(n,a,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const o=a||_.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let d=0;d<n;++d)this.setCell(d,o);this.length=n}get(n){const a=this._data[3*n+0],i=2097151&a;return[this._data[3*n+1],2097152&a?this._combined[n]:i?(0,f.stringFromCodePoint)(i):"",a>>22,2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):i]}set(n,a){this._data[3*n+1]=a[h.CHAR_DATA_ATTR_INDEX],a[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=a[1],this._data[3*n+0]=2097152|n|a[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=a[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&a}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n]:2097151&a?(0,f.stringFromCodePoint)(2097151&a):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,a){return v=3*n,a.content=this._data[v+0],a.fg=this._data[v+1],a.bg=this._data[v+2],2097152&a.content&&(a.combinedData=this._combined[n]),268435456&a.bg&&(a.extended=this._extendedAttrs[n]),a}setCell(n,a){2097152&a.content&&(this._combined[n]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[n]=a.extended),this._data[3*n+0]=a.content,this._data[3*n+1]=a.fg,this._data[3*n+2]=a.bg}setCellFromCodepoint(n,a,i,o){268435456&o.bg&&(this._extendedAttrs[n]=o.extended),this._data[3*n+0]=a|i<<22,this._data[3*n+1]=o.fg,this._data[3*n+2]=o.bg}addCodepointToCell(n,a,i){let o=this._data[3*n+0];2097152&o?this._combined[n]+=(0,f.stringFromCodePoint)(a):2097151&o?(this._combined[n]=(0,f.stringFromCodePoint)(2097151&o)+(0,f.stringFromCodePoint)(a),o&=-2097152,o|=2097152):o=a|4194304,i&&(o&=-12582913,o|=i<<22),this._data[3*n+0]=o}insertCells(n,a,i){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,i),a<this.length-n){const o=new _.CellData;for(let d=this.length-n-a-1;d>=0;--d)this.setCell(n+a+d,this.loadCell(n+d,o));for(let d=0;d<a;++d)this.setCell(n+d,i)}else for(let o=n;o<this.length;++o)this.setCell(o,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(n,a,i){if(n%=this.length,a<this.length-n){const o=new _.CellData;for(let d=0;d<this.length-n-a;++d)this.setCell(n+d,this.loadCell(n+a+d,o));for(let d=this.length-a;d<this.length;++d)this.setCell(d,i)}else for(let o=n;o<this.length;++o)this.setCell(o,i);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,i),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,i)}replaceCells(n,a,i,o=!1){if(o)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,i),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,i);n<a&&n<this.length;)this.isProtected(n)||this.setCell(n,i),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,i),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,i);n<a&&n<this.length;)this.setCell(n++,i)}resize(n,a){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const o=new Uint32Array(i);o.set(this._data),this._data=o}for(let o=this.length;o<n;++o)this.setCell(o,a)}else{this._data=this._data.subarray(0,i);const o=Object.keys(this._combined);for(let S=0;S<o.length;S++){const b=parseInt(o[S],10);b>=n&&delete this._combined[b]}const d=Object.keys(this._extendedAttrs);for(let S=0;S<d.length;S++){const b=parseInt(d[S],10);b>=n&&delete this._extendedAttrs[b]}}return this.length=n,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,a=!1){if(a)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,n);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const a in n._combined)this._combined[a]=n._combined[a];this._extendedAttrs={};for(const a in n._extendedAttrs)this._extendedAttrs[a]=n._extendedAttrs[a];this.isWrapped=n.isWrapped}clone(){const n=new y(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const a in this._combined)n._combined[a]=this._combined[a];for(const a in this._extendedAttrs)n._extendedAttrs[a]=this._extendedAttrs[a];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,a,i,o,d){const S=n._data;if(d)for(let C=o-1;C>=0;C--){for(let p=0;p<3;p++)this._data[3*(i+C)+p]=S[3*(a+C)+p];268435456&S[3*(a+C)+2]&&(this._extendedAttrs[i+C]=n._extendedAttrs[a+C])}else for(let C=0;C<o;C++){for(let p=0;p<3;p++)this._data[3*(i+C)+p]=S[3*(a+C)+p];268435456&S[3*(a+C)+2]&&(this._extendedAttrs[i+C]=n._extendedAttrs[a+C])}const b=Object.keys(n._combined);for(let C=0;C<b.length;C++){const p=parseInt(b[C],10);p>=a&&(this._combined[p-a+i]=n._combined[p])}}translateToString(n,a,i,o){a=a??0,i=i??this.length,n&&(i=Math.min(i,this.getTrimmedLength())),o&&(o.length=0);let d="";for(;a<i;){const S=this._data[3*a+0],b=2097151&S,C=2097152&S?this._combined[a]:b?(0,f.stringFromCodePoint)(b):h.WHITESPACE_CELL_CHAR;if(d+=C,o)for(let p=0;p<C.length;++p)o.push(a);a+=S>>22||1}return o&&o.push(a),d}}r.BufferLine=y},4841:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(s,l){if(s.start.y>s.end.y)throw new Error(`Buffer range end (${s.end.x}, ${s.end.y}) cannot be before start (${s.start.x}, ${s.start.y})`);return l*(s.end.y-s.start.y)+(s.end.x-s.start.x+1)}},4634:(w,r)=>{function s(l,_,h){if(_===l.length-1)return l[_].getTrimmedLength();const f=!l[_].hasContent(h-1)&&l[_].getWidth(h-1)===1,v=l[_+1].getWidth(0)===2;return f&&v?h-1:h}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(l,_,h,f,v){const y=[];for(let u=0;u<l.length-1;u++){let n=u,a=l.get(++n);if(!a.isWrapped)continue;const i=[l.get(u)];for(;n<l.length&&a.isWrapped;)i.push(a),a=l.get(++n);if(f>=u&&f<n){u+=i.length-1;continue}let o=0,d=s(i,o,_),S=1,b=0;for(;S<i.length;){const p=s(i,S,_),E=p-b,P=h-d,T=Math.min(E,P);i[o].copyCellsFrom(i[S],b,d,T,!1),d+=T,d===h&&(o++,d=0),b+=T,b===p&&(S++,b=0),d===0&&o!==0&&i[o-1].getWidth(h-1)===2&&(i[o].copyCellsFrom(i[o-1],h-1,d++,1,!1),i[o-1].setCell(h-1,v))}i[o].replaceCells(d,h,v);let C=0;for(let p=i.length-1;p>0&&(p>o||i[p].getTrimmedLength()===0);p--)C++;C>0&&(y.push(u+i.length-C),y.push(C)),u+=i.length-1}return y},r.reflowLargerCreateNewLayout=function(l,_){const h=[];let f=0,v=_[f],y=0;for(let u=0;u<l.length;u++)if(v===u){const n=_[++f];l.onDeleteEmitter.fire({index:u-y,amount:n}),u+=n-1,y+=n,v=_[++f]}else h.push(u);return{layout:h,countRemoved:y}},r.reflowLargerApplyNewLayout=function(l,_){const h=[];for(let f=0;f<_.length;f++)h.push(l.get(_[f]));for(let f=0;f<h.length;f++)l.set(f,h[f]);l.length=_.length},r.reflowSmallerGetNewLineLengths=function(l,_,h){const f=[],v=l.map((a,i)=>s(l,i,_)).reduce((a,i)=>a+i);let y=0,u=0,n=0;for(;n<v;){if(v-n<h){f.push(v-n);break}y+=h;const a=s(l,u,_);y>a&&(y-=a,u++);const i=l[u].getWidth(y-1)===2;i&&y--;const o=i?h-1:h;f.push(o),n+=o}return f},r.getWrappedLineTrimmedLength=s},5295:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const l=s(8460),_=s(844),h=s(9092);class f extends _.Disposable{constructor(y,u){super(),this._optionsService=y,this._bufferService=u,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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(y,u){this._normal.resize(y,u),this._alt.resize(y,u),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}r.BufferSet=f},511:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const l=s(482),_=s(643),h=s(3734);class f extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const u=new f;return u.setFromCharData(y),u}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(y[_.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(y[_.CHAR_DATA_CHAR_INDEX].length===2){const n=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const a=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(n-55296)+a-56320+65536|y[_.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[_.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=y[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=f},643:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const l=s(8460),_=s(844);class h{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}r.Marker=h,h._nextId=1},7116:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(w,r)=>{var s,l,_;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
8
+ `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(s||(r.C0=s={})),function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"}(l||(r.C1=l={})),function(h){h.ST=`${s.ESC}\\`}(_||(r.C1_ESCAPED=_={}))},7399:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=s(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:["'",'"']};r.evaluateKeyboardEvent=function(h,f,v,y){const u={type:0,cancel:!1,key:void 0},n=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?u.key=f?l.C0.ESC+"OA":l.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?u.key=f?l.C0.ESC+"OD":l.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?u.key=f?l.C0.ESC+"OC":l.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(u.key=f?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:u.key=h.ctrlKey?"\b":l.C0.DEL,h.altKey&&(u.key=l.C0.ESC+u.key);break;case 9:if(h.shiftKey){u.key=l.C0.ESC+"[Z";break}u.key=l.C0.HT,u.cancel=!0;break;case 13:u.key=h.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,u.cancel=!0;break;case 27:u.key=l.C0.ESC,h.altKey&&(u.key=l.C0.ESC+l.C0.ESC),u.cancel=!0;break;case 37:if(h.metaKey)break;n?(u.key=l.C0.ESC+"[1;"+(n+1)+"D",u.key===l.C0.ESC+"[1;3D"&&(u.key=l.C0.ESC+(v?"b":"[1;5D"))):u.key=f?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(h.metaKey)break;n?(u.key=l.C0.ESC+"[1;"+(n+1)+"C",u.key===l.C0.ESC+"[1;3C"&&(u.key=l.C0.ESC+(v?"f":"[1;5C"))):u.key=f?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(h.metaKey)break;n?(u.key=l.C0.ESC+"[1;"+(n+1)+"A",v||u.key!==l.C0.ESC+"[1;3A"||(u.key=l.C0.ESC+"[1;5A")):u.key=f?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(h.metaKey)break;n?(u.key=l.C0.ESC+"[1;"+(n+1)+"B",v||u.key!==l.C0.ESC+"[1;3B"||(u.key=l.C0.ESC+"[1;5B")):u.key=f?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(u.key=l.C0.ESC+"[2~");break;case 46:u.key=n?l.C0.ESC+"[3;"+(n+1)+"~":l.C0.ESC+"[3~";break;case 36:u.key=n?l.C0.ESC+"[1;"+(n+1)+"H":f?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:u.key=n?l.C0.ESC+"[1;"+(n+1)+"F":f?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:h.shiftKey?u.type=2:h.ctrlKey?u.key=l.C0.ESC+"[5;"+(n+1)+"~":u.key=l.C0.ESC+"[5~";break;case 34:h.shiftKey?u.type=3:h.ctrlKey?u.key=l.C0.ESC+"[6;"+(n+1)+"~":u.key=l.C0.ESC+"[6~";break;case 112:u.key=n?l.C0.ESC+"[1;"+(n+1)+"P":l.C0.ESC+"OP";break;case 113:u.key=n?l.C0.ESC+"[1;"+(n+1)+"Q":l.C0.ESC+"OQ";break;case 114:u.key=n?l.C0.ESC+"[1;"+(n+1)+"R":l.C0.ESC+"OR";break;case 115:u.key=n?l.C0.ESC+"[1;"+(n+1)+"S":l.C0.ESC+"OS";break;case 116:u.key=n?l.C0.ESC+"[15;"+(n+1)+"~":l.C0.ESC+"[15~";break;case 117:u.key=n?l.C0.ESC+"[17;"+(n+1)+"~":l.C0.ESC+"[17~";break;case 118:u.key=n?l.C0.ESC+"[18;"+(n+1)+"~":l.C0.ESC+"[18~";break;case 119:u.key=n?l.C0.ESC+"[19;"+(n+1)+"~":l.C0.ESC+"[19~";break;case 120:u.key=n?l.C0.ESC+"[20;"+(n+1)+"~":l.C0.ESC+"[20~";break;case 121:u.key=n?l.C0.ESC+"[21;"+(n+1)+"~":l.C0.ESC+"[21~";break;case 122:u.key=n?l.C0.ESC+"[23;"+(n+1)+"~":l.C0.ESC+"[23~";break;case 123:u.key=n?l.C0.ESC+"[24;"+(n+1)+"~":l.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(v&&!y||!h.altKey||h.metaKey)!v||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?u.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(u.key=l.C0.US),h.key==="@"&&(u.key=l.C0.NUL)):h.keyCode===65&&(u.type=1);else{const a=_[h.keyCode],i=a?.[h.shiftKey?1:0];if(i)u.key=l.C0.ESC+i;else if(h.keyCode>=65&&h.keyCode<=90){const o=h.ctrlKey?h.keyCode-64:h.keyCode+32;let d=String.fromCharCode(o);h.shiftKey&&(d=d.toUpperCase()),u.key=l.C0.ESC+d}else if(h.keyCode===32)u.key=l.C0.ESC+(h.ctrlKey?l.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let o=h.code.slice(3,4);h.shiftKey||(o=o.toLowerCase()),u.key=l.C0.ESC+o,u.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?u.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?u.key=l.C0.NUL:h.keyCode>=51&&h.keyCode<=55?u.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?u.key=l.C0.DEL:h.keyCode===219?u.key=l.C0.ESC:h.keyCode===220?u.key=l.C0.FS:h.keyCode===221&&(u.key=l.C0.GS)}return u}},482:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(s){return s>65535?(s-=65536,String.fromCharCode(55296+(s>>10))+String.fromCharCode(s%1024+56320)):String.fromCharCode(s)},r.utf32ToString=function(s,l=0,_=s.length){let h="";for(let f=l;f<_;++f){let v=s[f];v>65535?(v-=65536,h+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):h+=String.fromCharCode(v)}return h},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(s,l){const _=s.length;if(!_)return 0;let h=0,f=0;if(this._interim){const v=s.charCodeAt(f++);56320<=v&&v<=57343?l[h++]=1024*(this._interim-55296)+v-56320+65536:(l[h++]=this._interim,l[h++]=v),this._interim=0}for(let v=f;v<_;++v){const y=s.charCodeAt(v);if(55296<=y&&y<=56319){if(++v>=_)return this._interim=y,h;const u=s.charCodeAt(v);56320<=u&&u<=57343?l[h++]=1024*(y-55296)+u-56320+65536:(l[h++]=y,l[h++]=u)}else y!==65279&&(l[h++]=y)}return h}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(s,l){const _=s.length;if(!_)return 0;let h,f,v,y,u=0,n=0,a=0;if(this.interim[0]){let d=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let b,C=0;for(;(b=63&this.interim[++C])&&C<4;)S<<=6,S|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=p-C;for(;a<E;){if(a>=_)return 0;if(b=s[a++],(192&b)!=128){a--,d=!0;break}this.interim[C++]=b,S<<=6,S|=63&b}d||(p===2?S<128?a--:l[u++]=S:p===3?S<2048||S>=55296&&S<=57343||S===65279||(l[u++]=S):S<65536||S>1114111||(l[u++]=S)),this.interim.fill(0)}const i=_-4;let o=a;for(;o<_;){for(;!(!(o<i)||128&(h=s[o])||128&(f=s[o+1])||128&(v=s[o+2])||128&(y=s[o+3]));)l[u++]=h,l[u++]=f,l[u++]=v,l[u++]=y,o+=4;if(h=s[o++],h<128)l[u++]=h;else if((224&h)==192){if(o>=_)return this.interim[0]=h,u;if(f=s[o++],(192&f)!=128){o--;continue}if(n=(31&h)<<6|63&f,n<128){o--;continue}l[u++]=n}else if((240&h)==224){if(o>=_)return this.interim[0]=h,u;if(f=s[o++],(192&f)!=128){o--;continue}if(o>=_)return this.interim[0]=h,this.interim[1]=f,u;if(v=s[o++],(192&v)!=128){o--;continue}if(n=(15&h)<<12|(63&f)<<6|63&v,n<2048||n>=55296&&n<=57343||n===65279)continue;l[u++]=n}else if((248&h)==240){if(o>=_)return this.interim[0]=h,u;if(f=s[o++],(192&f)!=128){o--;continue}if(o>=_)return this.interim[0]=h,this.interim[1]=f,u;if(v=s[o++],(192&v)!=128){o--;continue}if(o>=_)return this.interim[0]=h,this.interim[1]=f,this.interim[2]=v,u;if(y=s[o++],(192&y)!=128){o--;continue}if(n=(7&h)<<18|(63&f)<<12|(63&v)<<6|63&y,n<65536||n>1114111)continue;l[u++]=n}}return u}}},225:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const l=s(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]],h=[[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 f;r.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let v=0;v<_.length;++v)f.fill(0,_[v][0],_[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?f[v]:function(y,u){let n,a=0,i=u.length-1;if(y<u[0][0]||y>u[i][1])return!1;for(;i>=a;)if(n=a+i>>1,y>u[n][1])a=n+1;else{if(!(y<u[n][0]))return!0;i=n-1}return!1}(v,h)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,y){let u=this.wcwidth(v),n=u===0&&y!==0;if(n){const a=l.UnicodeService.extractWidth(y);a===0?n=!1:a>u&&(u=a)}return l.UnicodeService.createPropertyValue(0,u,n)}}},5981:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const l=s(8460),_=s(844);class h extends _.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let u;for(this._isSyncWriting=!0;u=this._writeBuffer.shift();){this._action(u);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,y){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+=v.length,this._writeBuffer.push(v),this._callbacks.push(y),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(y)}_innerWrite(v=0,y=!0){const u=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],a=this._action(n,y);if(a){const o=d=>Date.now()-u>=12?setTimeout(()=>this._innerWrite(0,d)):this._innerWrite(u,d);return void a.catch(d=>(queueMicrotask(()=>{throw d}),Promise.resolve(!1))).then(o)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-u>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}r.WriteBuffer=h},5941:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const s=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,l=/^[\da-f]+$/;function _(h,f){const v=h.toString(16),y=v.length<2?"0"+v:v;switch(f){case 4:return v[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}r.parseColor=function(h){if(!h)return;let f=h.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const v=s.exec(f);if(v){const y=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/y*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/y*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/y*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),l.exec(f)&&[3,6,9,12].includes(f.length))){const v=f.length/3,y=[0,0,0];for(let u=0;u<3;++u){const n=parseInt(f.slice(v*u,v*u+v),16);y[u]=v===1?n<<4:v===2?n:v===3?n>>4:n>>8}return y}},r.toRgbString=function(h,f=16){const[v,y,u]=h;return`rgb:${_(v,f)}/${_(y,f)}/${_(u,f)}`}},5770:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const l=s(482),_=s(8742),h=s(5770),f=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(y,u){this._handlers[y]===void 0&&(this._handlers[y]=[]);const n=this._handlers[y];return n.push(u),{dispose:()=>{const a=n.indexOf(u);a!==-1&&n.splice(a,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(y,u){if(this.reset(),this._ident=y,this._active=this._handlers[y]||f,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(u);else this._handlerFb(this._ident,"HOOK",u)}put(y,u,n){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(y,u,n);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(y,u,n))}unhook(y,u=!0){if(this._active.length){let n=!1,a=this._active.length-1,i=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=u,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;a>=0&&(n=this._active[a].unhook(y),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",y);this._active=f,this._ident=0}};const v=new _.Params;v.addParam(0),r.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=v,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():v,this._data="",this._hitLimit=!1}put(y,u,n){this._hitLimit||(this._data+=(0,l.utf32ToString)(y,u,n),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let u=!1;if(this._hitLimit)u=!1;else if(y&&(u=this._handler(this._data,this._params),u instanceof Promise))return u.then(n=>(this._params=v,this._data="",this._hitLimit=!1,n));return this._params=v,this._data="",this._hitLimit=!1,u}}},2015:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const l=s(844),_=s(8742),h=s(6242),f=s(6351);class v{constructor(a){this.table=new Uint8Array(a)}setDefault(a,i){this.table.fill(a<<4|i)}add(a,i,o,d){this.table[i<<8|a]=o<<4|d}addMany(a,i,o,d){for(let S=0;S<a.length;S++)this.table[i<<8|a[S]]=o<<4|d}}r.TransitionTable=v;const y=160;r.VT500_TRANSITION_TABLE=function(){const n=new v(4095),a=Array.apply(null,Array(256)).map((C,p)=>p),i=(C,p)=>a.slice(C,p),o=i(32,127),d=i(0,24);d.push(25),d.push.apply(d,i(28,32));const S=i(0,14);let b;for(b in n.setDefault(1,0),n.addMany(o,0,2,0),S)n.addMany([24,26,153,154],b,3,0),n.addMany(i(128,144),b,3,0),n.addMany(i(144,152),b,3,0),n.add(156,b,0,0),n.add(27,b,11,1),n.add(157,b,4,8),n.addMany([152,158,159],b,0,7),n.add(155,b,11,3),n.add(144,b,11,9);return n.addMany(d,0,3,0),n.addMany(d,1,3,1),n.add(127,1,0,1),n.addMany(d,8,0,8),n.addMany(d,3,3,3),n.add(127,3,0,3),n.addMany(d,4,3,4),n.add(127,4,0,4),n.addMany(d,6,3,6),n.addMany(d,5,3,5),n.add(127,5,0,5),n.addMany(d,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(o,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(i(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(o,7,0,7),n.addMany(d,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(i(64,127),3,7,0),n.addMany(i(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(i(48,60),4,8,4),n.addMany(i(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(i(32,64),6,0,6),n.add(127,6,0,6),n.addMany(i(64,127),6,0,0),n.addMany(i(32,48),3,9,5),n.addMany(i(32,48),5,9,5),n.addMany(i(48,64),5,0,6),n.addMany(i(64,127),5,7,0),n.addMany(i(32,48),4,9,5),n.addMany(i(32,48),1,9,2),n.addMany(i(32,48),2,9,2),n.addMany(i(48,127),2,10,0),n.addMany(i(48,80),1,10,0),n.addMany(i(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(i(96,127),1,10,0),n.add(80,1,11,9),n.addMany(d,9,0,9),n.add(127,9,0,9),n.addMany(i(28,32),9,0,9),n.addMany(i(32,48),9,9,12),n.addMany(i(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(d,11,0,11),n.addMany(i(32,128),11,0,11),n.addMany(i(28,32),11,0,11),n.addMany(d,10,0,10),n.add(127,10,0,10),n.addMany(i(28,32),10,0,10),n.addMany(i(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(i(32,48),10,9,12),n.addMany(d,12,0,12),n.add(127,12,0,12),n.addMany(i(28,32),12,0,12),n.addMany(i(32,48),12,9,12),n.addMany(i(48,64),12,0,11),n.addMany(i(64,127),12,12,13),n.addMany(i(64,127),10,12,13),n.addMany(i(64,127),9,12,13),n.addMany(d,13,13,13),n.addMany(o,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(y,0,2,0),n.add(y,8,5,8),n.add(y,6,0,6),n.add(y,11,0,11),n.add(y,13,13,13),n}();class u extends l.Disposable{constructor(a=r.VT500_TRANSITION_TABLE){super(),this._transitions=a,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=(i,o,d)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,o)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(a,i=[64,126]){let o=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(o=a.prefix.charCodeAt(0),o&&60>o||o>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<a.intermediates.length;++S){const b=a.intermediates.charCodeAt(S);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");o<<=8,o|=b}}if(a.final.length!==1)throw new Error("final must be a single byte");const d=a.final.charCodeAt(0);if(i[0]>d||d>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return o<<=8,o|=d,o}identToString(a){const i=[];for(;a;)i.push(String.fromCharCode(255&a)),a>>=8;return i.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,i){const o=this._identifier(a,[48,126]);this._escHandlers[o]===void 0&&(this._escHandlers[o]=[]);const d=this._escHandlers[o];return d.push(i),{dispose:()=>{const S=d.indexOf(i);S!==-1&&d.splice(S,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,i){this._executeHandlers[a.charCodeAt(0)]=i}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,i){const o=this._identifier(a);this._csiHandlers[o]===void 0&&(this._csiHandlers[o]=[]);const d=this._csiHandlers[o];return d.push(i),{dispose:()=>{const S=d.indexOf(i);S!==-1&&d.splice(S,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,i){return this._dcsParser.registerHandler(this._identifier(a),i)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,i){return this._oscParser.registerHandler(a,i)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}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(a,i,o,d,S){this._parseStack.state=a,this._parseStack.handlers=i,this._parseStack.handlerPos=o,this._parseStack.transition=d,this._parseStack.chunkPos=S}parse(a,i,o){let d,S=0,b=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(o===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const p=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(o===!1&&E>-1){for(;E>=0&&(d=p[E](this._params),d!==!0);E--)if(d instanceof Promise)return this._parseStack.handlerPos=E,d}this._parseStack.handlers=[];break;case 4:if(o===!1&&E>-1){for(;E>=0&&(d=p[E](),d!==!0);E--)if(d instanceof Promise)return this._parseStack.handlerPos=E,d}this._parseStack.handlers=[];break;case 6:if(S=a[this._parseStack.chunkPos],d=this._dcsParser.unhook(S!==24&&S!==26,o),d)return d;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=a[this._parseStack.chunkPos],d=this._oscParser.end(S!==24&&S!==26,o),d)return d;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let p=C;p<i;++p){switch(S=a[p],b=this._transitions.table[this.currentState<<8|(S<160?S:y)],b>>4){case 2:for(let D=p+1;;++D){if(D>=i||(S=a[D])<32||S>126&&S<y){this._printHandler(a,p,D),p=D-1;break}if(++D>=i||(S=a[D])<32||S>126&&S<y){this._printHandler(a,p,D),p=D-1;break}if(++D>=i||(S=a[D])<32||S>126&&S<y){this._printHandler(a,p,D),p=D-1;break}if(++D>=i||(S=a[D])<32||S>126&&S<y){this._printHandler(a,p,D),p=D-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|S];let P=E?E.length-1:-1;for(;P>=0&&(d=E[P](this._params),d!==!0);P--)if(d instanceof Promise)return this._preserveStack(3,E,P,b,p),d;P<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++p<i&&(S=a[p])>47&&S<60);p--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const T=this._escHandlers[this._collect<<8|S];let B=T?T.length-1:-1;for(;B>=0&&(d=T[B](),d!==!0);B--)if(d instanceof Promise)return this._preserveStack(4,T,B,b,p),d;B<0&&this._escHandlerFb(this._collect<<8|S),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|S,this._params);break;case 13:for(let D=p+1;;++D)if(D>=i||(S=a[D])===24||S===26||S===27||S>127&&S<y){this._dcsParser.put(a,p,D),p=D-1;break}break;case 14:if(d=this._dcsParser.unhook(S!==24&&S!==26),d)return this._preserveStack(6,[],0,b,p),d;S===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let D=p+1;;D++)if(D>=i||(S=a[D])<32||S>127&&S<y){this._oscParser.put(a,p,D),p=D-1;break}break;case 6:if(d=this._oscParser.end(S!==24&&S!==26),d)return this._preserveStack(5,[],0,b,p),d;S===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}r.EscapeSequenceParser=u},6242:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const l=s(5770),_=s(482),h=[];r.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,v){this._handlers[f]===void 0&&(this._handlers[f]=[]);const y=this._handlers[f];return y.push(v),{dispose:()=>{const u=y.indexOf(v);u!==-1&&y.splice(u,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,v,y){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(f,v,y);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(f,v,y))}start(){this.reset(),this._state=1}put(f,v,y){if(this._state!==3){if(this._state===1)for(;v<y;){const u=f[v++];if(u===59){this._state=2,this._start();break}if(u<48||57<u)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+u-48}this._state===2&&y-v>0&&this._put(f,v,y)}}end(f,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,u=this._active.length-1,n=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,y=v,n=this._stack.fallThrough,this._stack.paused=!1),!n&&y===!1){for(;u>=0&&(y=this._active[u].end(f),y!==!0);u--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,y;u--}for(;u>=0;u--)if(y=this._active[u].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",f);this._active=h,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,v,y){this._hitLimit||(this._data+=(0,_.utf32ToString)(f,v,y),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let v=!1;if(this._hitLimit)v=!1;else if(f&&(v=this._handler(this._data),v instanceof Promise))return v.then(y=>(this._data="",this._hitLimit=!1,y));return this._data="",this._hitLimit=!1,v}}},8742:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const s=2147483647;class l{static fromArray(h){const f=new l;if(!h.length)return f;for(let v=Array.isArray(h[0])?1:0;v<h.length;++v){const y=h[v];if(Array.isArray(y))for(let u=0;u<y.length;++u)f.addSubParam(y[u]);else f.addParam(y)}return f}constructor(h=32,f=32){if(this.maxLength=h,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new l(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let f=0;f<this.length;++f){h.push(this.params[f]);const v=this._subParamsIdx[f]>>8,y=255&this._subParamsIdx[f];y-v>0&&h.push(Array.prototype.slice.call(this._subParams,v,y))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>s?s:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>s?s:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const f=this._subParamsIdx[h]>>8,v=255&this._subParamsIdx[h];return v-f>0?this._subParams.subarray(f,v):null}getSubParamsAll(){const h={};for(let f=0;f<this.length;++f){const v=this._subParamsIdx[f]>>8,y=255&this._subParamsIdx[f];y-v>0&&(h[f]=this._subParams.slice(v,y))}return h}addDigit(h){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,y=v[f-1];v[f-1]=~y?Math.min(10*y+h,s):h}}r.Params=l},5741:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let s=this._addons.length-1;s>=0;s--)this._addons[s].instance.dispose()}loadAddon(s,l){const _={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(_),l.dispose=()=>this._wrappedAddonDispose(_),l.activate(s)}_wrappedAddonDispose(s){if(s.isDisposed)return;let l=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===s){l=_;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");s.isDisposed=!0,s.dispose.apply(s.instance),this._addons.splice(l,1)}}},8771:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const l=s(3785),_=s(511);r.BufferApiView=class{constructor(h,f){this._buffer=h,this.type=f}init(h){return this._buffer=h,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(h){const f=this._buffer.lines.get(h);if(f)return new l.BufferLineApiView(f)}getNullCell(){return new _.CellData}}},3785:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const l=s(511);r.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,h){if(!(_<0||_>=this._line.length))return h?(this._line.loadCell(_,h),h):this._line.loadCell(_,new l.CellData)}translateToString(_,h,f){return this._line.translateToString(_,h,f)}}},8285:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const l=s(8771),_=s(8460),h=s(844);class f extends h.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}r.BufferNamespaceApi=f},7975:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(s){this._core=s}registerCsiHandler(s,l){return this._core.registerCsiHandler(s,_=>l(_.toArray()))}addCsiHandler(s,l){return this.registerCsiHandler(s,l)}registerDcsHandler(s,l){return this._core.registerDcsHandler(s,(_,h)=>l(_,h.toArray()))}addDcsHandler(s,l){return this.registerDcsHandler(s,l)}registerEscHandler(s,l){return this._core.registerEscHandler(s,l)}addEscHandler(s,l){return this.registerEscHandler(s,l)}registerOscHandler(s,l){return this._core.registerOscHandler(s,l)}addOscHandler(s,l){return this.registerOscHandler(s,l)}}},7090:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(s){this._core=s}register(s){this._core.unicodeService.register(s)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(s){this._core.unicodeService.activeVersion=s}}},744:function(w,r,s){var l=this&&this.__decorate||function(n,a,i,o){var d,S=arguments.length,b=S<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,i):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,a,i,o);else for(var C=n.length-1;C>=0;C--)(d=n[C])&&(b=(S<3?d(b):S>3?d(a,i,b):d(a,i))||b);return S>3&&b&&Object.defineProperty(a,i,b),b},_=this&&this.__param||function(n,a){return function(i,o){a(i,o,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const h=s(8460),f=s(844),v=s(5295),y=s(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let u=r.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(n,this))}resize(n,a){this.cols=n,this.rows=a,this.buffers.resize(n,a),this._onResize.fire({cols:n,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,a=!1){const i=this.buffer;let o;o=this._cachedBlankLine,o&&o.length===this.cols&&o.getFg(0)===n.fg&&o.getBg(0)===n.bg||(o=i.getBlankLine(n,a),this._cachedBlankLine=o),o.isWrapped=a;const d=i.ybase+i.scrollTop,S=i.ybase+i.scrollBottom;if(i.scrollTop===0){const b=i.lines.isFull;S===i.lines.length-1?b?i.lines.recycle().copyFrom(o):i.lines.push(o.clone()):i.lines.splice(S+1,0,o.clone()),b?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const b=S-d+1;i.lines.shiftElements(d+1,b-1,-1),i.lines.set(S,o.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(n,a,i){const o=this.buffer;if(n<0){if(o.ydisp===0)return;this.isUserScrolling=!0}else n+o.ydisp>=o.ybase&&(this.isUserScrolling=!1);const d=o.ydisp;o.ydisp=Math.max(Math.min(o.ydisp+n,o.ybase),0),d!==o.ydisp&&(a||this._onScroll.fire(o.ydisp))}};r.BufferService=u=l([_(0,y.IOptionsService)],u)},7994:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(s){this.glevel=s,this.charset=this._charsets[s]}setgCharset(s,l){this._charsets[s]=l,this.glevel===s&&(this.charset=l)}}},1753:function(w,r,s){var l=this&&this.__decorate||function(o,d,S,b){var C,p=arguments.length,E=p<3?d:b===null?b=Object.getOwnPropertyDescriptor(d,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,d,S,b);else for(var P=o.length-1;P>=0;P--)(C=o[P])&&(E=(p<3?C(E):p>3?C(d,S,E):C(d,S))||E);return p>3&&E&&Object.defineProperty(d,S,E),E},_=this&&this.__param||function(o,d){return function(S,b){d(S,b,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const h=s(2585),f=s(8460),v=s(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:o=>o.button!==4&&o.action===1&&(o.ctrl=!1,o.alt=!1,o.shift=!1,!0)},VT200:{events:19,restrict:o=>o.action!==32},DRAG:{events:23,restrict:o=>o.action!==32||o.button!==3},ANY:{events:31,restrict:o=>!0}};function u(o,d){let S=(o.ctrl?16:0)|(o.shift?4:0)|(o.alt?8:0);return o.button===4?(S|=64,S|=o.action):(S|=3&o.button,4&o.button&&(S|=64),8&o.button&&(S|=128),o.action===32?S|=32:o.action!==0||d||(S|=3)),S}const n=String.fromCharCode,a={DEFAULT:o=>{const d=[u(o,!1)+32,o.col+32,o.row+32];return d[0]>255||d[1]>255||d[2]>255?"":`\x1B[M${n(d[0])}${n(d[1])}${n(d[2])}`},SGR:o=>{const d=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${u(o,!0)};${o.col};${o.row}${d}`},SGR_PIXELS:o=>{const d=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${u(o,!0)};${o.x};${o.y}${d}`}};let i=r.CoreMouseService=class extends v.Disposable{constructor(o,d){super(),this._bufferService=o,this._coreService=d,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(y))this.addProtocol(S,y[S]);for(const S of Object.keys(a))this.addEncoding(S,a[S]);this.reset()}addProtocol(o,d){this._protocols[o]=d}addEncoding(o,d){this._encodings[o]=d}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(o){if(!this._protocols[o])throw new Error(`unknown protocol "${o}"`);this._activeProtocol=o,this._onProtocolChange.fire(this._protocols[o].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(o){if(!this._encodings[o])throw new Error(`unknown encoding "${o}"`);this._activeEncoding=o}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(o){if(o.col<0||o.col>=this._bufferService.cols||o.row<0||o.row>=this._bufferService.rows||o.button===4&&o.action===32||o.button===3&&o.action!==32||o.button!==4&&(o.action===2||o.action===3)||(o.col++,o.row++,o.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,o,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(o))return!1;const d=this._encodings[this._activeEncoding](o);return d&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(d):this._coreService.triggerDataEvent(d,!0)),this._lastEvent=o,!0}explainEvents(o){return{down:!!(1&o),up:!!(2&o),drag:!!(4&o),move:!!(8&o),wheel:!!(16&o)}}_equalEvents(o,d,S){if(S){if(o.x!==d.x||o.y!==d.y)return!1}else if(o.col!==d.col||o.row!==d.row)return!1;return o.button===d.button&&o.action===d.action&&o.ctrl===d.ctrl&&o.alt===d.alt&&o.shift===d.shift}};r.CoreMouseService=i=l([_(0,h.IBufferService),_(1,h.ICoreService)],i)},6975:function(w,r,s){var l=this&&this.__decorate||function(i,o,d,S){var b,C=arguments.length,p=C<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,d,S);else for(var E=i.length-1;E>=0;E--)(b=i[E])&&(p=(C<3?b(p):C>3?b(o,d,p):b(o,d))||p);return C>3&&p&&Object.defineProperty(o,d,p),p},_=this&&this.__param||function(i,o){return function(d,S){o(d,S,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const h=s(1439),f=s(8460),v=s(844),y=s(2585),u=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=r.CoreService=class extends v.Disposable{constructor(i,o,d){super(),this._bufferService=i,this._logService=o,this._optionsService=d,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(u),this.decPrivateModes=(0,h.clone)(n)}reset(){this.modes=(0,h.clone)(u),this.decPrivateModes=(0,h.clone)(n)}triggerDataEvent(i,o=!1){if(this._optionsService.rawOptions.disableStdin)return;const d=this._bufferService.buffer;o&&this._optionsService.rawOptions.scrollOnUserInput&&d.ybase!==d.ydisp&&this._onRequestScrollToBottom.fire(),o&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(S=>S.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(o=>o.charCodeAt(0))),this._onBinary.fire(i))}};r.CoreService=a=l([_(0,y.IBufferService),_(1,y.ILogService),_(2,y.IOptionsService)],a)},9074:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const l=s(8055),_=s(8460),h=s(844),f=s(6106);let v=0,y=0;class u extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(i=>i?.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,h.toDisposable)(()=>this.reset()))}registerDecoration(i){if(i.marker.isDisposed)return;const o=new n(i);if(o){const d=o.marker.onDispose(()=>o.dispose());o.onDispose(()=>{o&&(this._decorations.delete(o)&&this._onDecorationRemoved.fire(o),d.dispose())}),this._decorations.insert(o),this._onDecorationRegistered.fire(o)}return o}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,o,d){let S=0,b=0;for(const C of this._decorations.getKeyIterator(o))S=C.options.x??0,b=S+(C.options.width??1),i>=S&&i<b&&(!d||(C.options.layer??"bottom")===d)&&(yield C)}forEachDecorationAtCell(i,o,d,S){this._decorations.forEachByKey(o,b=>{v=b.options.x??0,y=v+(b.options.width??1),i>=v&&i<y&&(!d||(b.options.layer??"bottom")===d)&&S(b)})}}r.DecorationService=u;class n extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(i){super(),this.options=i,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=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const l=s(2585),_=s(8343);class h{constructor(...v){this._entries=new Map;for(const[y,u]of v)this.set(y,u)}set(v,y){const u=this._entries.get(v);return this._entries.set(v,y),u}forEach(v){for(const[y,u]of this._entries.entries())v(y,u)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}r.ServiceCollection=h,r.InstantiationService=class{constructor(){this._services=new h,this._services.set(l.IInstantiationService,this)}setService(f,v){this._services.set(f,v)}getService(f){return this._services.get(f)}createInstance(f,...v){const y=(0,_.getServiceDependencies)(f).sort((a,i)=>a.index-i.index),u=[];for(const a of y){const i=this._services.get(a.id);if(!i)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${a.id}.`);u.push(i)}const n=y.length>0?y[0].index:v.length;if(v.length!==n)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${n+1} conflicts with ${v.length} static arguments`);return new f(...v,...u)}}},7866:function(w,r,s){var l=this&&this.__decorate||function(n,a,i,o){var d,S=arguments.length,b=S<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,i):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,a,i,o);else for(var C=n.length-1;C>=0;C--)(d=n[C])&&(b=(S<3?d(b):S>3?d(a,i,b):d(a,i))||b);return S>3&&b&&Object.defineProperty(a,i,b),b},_=this&&this.__param||function(n,a){return function(i,o){a(i,o,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const h=s(844),f=s(2585),v={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let y,u=r.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let a=0;a<n.length;a++)typeof n[a]=="function"&&(n[a]=n[a]())}_log(n,a,i){this._evalLazyOptionalParams(i),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...i)}trace(n,...a){this._logLevel<=f.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,n,a)}debug(n,...a){this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,n,a)}info(n,...a){this._logLevel<=f.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,n,a)}warn(n,...a){this._logLevel<=f.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,n,a)}error(n,...a){this._logLevel<=f.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,n,a)}};r.LogService=u=l([_(0,f.IOptionsService)],u),r.setTraceLogger=function(n){y=n},r.traceCall=function(n,a,i){if(typeof i.value!="function")throw new Error("not supported");const o=i.value;i.value=function(...d){if(y.logLevel!==f.LogLevelEnum.TRACE)return o.apply(this,d);y.trace(`GlyphRenderer#${o.name}(${d.map(b=>JSON.stringify(b)).join(", ")})`);const S=o.apply(this,d);return y.trace(`GlyphRenderer#${o.name} return`,S),S}}},7302:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const l=s(8460),_=s(844),h=s(6114);r.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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends _.Disposable{constructor(u){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...r.DEFAULT_OPTIONS};for(const a in u)if(a in n)try{const i=u[a];n[a]=this._sanitizeAndValidateOption(a,i)}catch(i){console.error(i)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(u,n){return this.onOptionChange(a=>{a===u&&n(this.rawOptions[u])})}onMultipleOptionChange(u,n){return this.onOptionChange(a=>{u.indexOf(a)!==-1&&n()})}_setupOptions(){const u=a=>{if(!(a in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},n=(a,i)=>{if(!(a in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);i=this._sanitizeAndValidateOption(a,i),this.rawOptions[a]!==i&&(this.rawOptions[a]=i,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const i={get:u.bind(this,a),set:n.bind(this,a)};Object.defineProperty(this.options,a,i)}}_sanitizeAndValidateOption(u,n){switch(u){case"cursorStyle":if(n||(n=r.DEFAULT_OPTIONS[u]),!function(a){return a==="block"||a==="underline"||a==="bar"}(n))throw new Error(`"${n}" is not a valid value for ${u}`);break;case"wordSeparator":n||(n=r.DEFAULT_OPTIONS[u]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=f.includes(n)?n:r.DEFAULT_OPTIONS[u];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${u} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${u} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${u} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${u} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}r.OptionsService=v},2660:function(w,r,s){var l=this&&this.__decorate||function(v,y,u,n){var a,i=arguments.length,o=i<3?y:n===null?n=Object.getOwnPropertyDescriptor(y,u):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(v,y,u,n);else for(var d=v.length-1;d>=0;d--)(a=v[d])&&(o=(i<3?a(o):i>3?a(y,u,o):a(y,u))||o);return i>3&&o&&Object.defineProperty(y,u,o),o},_=this&&this.__param||function(v,y){return function(u,n){y(u,n,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const h=s(2585);let f=r.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const y=this._bufferService.buffer;if(v.id===void 0){const d=y.addMarker(y.ybase+y.y),S={data:v,id:this._nextId++,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(S,d)),this._dataByLinkId.set(S.id,S),S.id}const u=v,n=this._getEntryIdKey(u),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,y.ybase+y.y),a.id;const i=y.addMarker(y.ybase+y.y),o={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(o,i)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(v,y){const u=this._dataByLinkId.get(v);if(u&&u.lines.every(n=>n.line!==y)){const n=this._bufferService.buffer.addMarker(y);u.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(u,n))}}getLinkData(v){return this._dataByLinkId.get(v)?.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,y){const u=v.lines.indexOf(y);u!==-1&&(v.lines.splice(u,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};r.OscLinkService=f=l([_(0,h.IBufferService)],f)},8343:(w,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const s="di$target",l="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(_){return _[l]||[]},r.createDecorator=function(_){if(r.serviceRegistry.has(_))return r.serviceRegistry.get(_);const h=function(f,v,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(u,n,a){n[s]===n?n[l].push({id:u,index:a}):(n[l]=[{id:u,index:a}],n[s]=n)})(h,f,y)};return h.toString=()=>_,r.serviceRegistry.set(_,h),h}},2585:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const l=s(8343);var _;r.IBufferService=(0,l.createDecorator)("BufferService"),r.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),r.ICoreService=(0,l.createDecorator)("CoreService"),r.ICharsetService=(0,l.createDecorator)("CharsetService"),r.IInstantiationService=(0,l.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(_||(r.LogLevelEnum=_={})),r.ILogService=(0,l.createDecorator)("LogService"),r.IOptionsService=(0,l.createDecorator)("OptionsService"),r.IOscLinkService=(0,l.createDecorator)("OscLinkService"),r.IUnicodeService=(0,l.createDecorator)("UnicodeService"),r.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(w,r,s)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const l=s(8460),_=s(225);class h{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,y,u=!1){return(16777215&v)<<3|(3&y)<<1|(u?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const v=new _.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let y=0,u=0;const n=v.length;for(let a=0;a<n;++a){let i=v.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return y+this.wcwidth(i);const S=v.charCodeAt(a);56320<=S&&S<=57343?i=1024*(i-55296)+S-56320+65536:y+=this.wcwidth(S)}const o=this.charProperties(i,u);let d=h.extractWidth(o);h.extractShouldJoin(o)&&(d-=h.extractWidth(u)),y+=d,u=o}return y}charProperties(v,y){return this._activeProvider.charProperties(v,y)}}r.UnicodeService=h}},g={};function m(w){var r=g[w];if(r!==void 0)return r.exports;var s=g[w]={exports:{}};return c[w].call(s.exports,s,s.exports,m),s.exports}var k={};return(()=>{var w=k;Object.defineProperty(w,"__esModule",{value:!0}),w.Terminal=void 0;const r=m(9042),s=m(3236),l=m(844),_=m(5741),h=m(8285),f=m(7975),v=m(7090),y=["cols","rows"];class u extends l.Disposable{constructor(a){super(),this._core=this.register(new s.Terminal(a)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const i=d=>this._core.options[d],o=(d,S)=>{this._checkReadonlyOptions(d),this._core.options[d]=S};for(const d in this._core.options){const S={get:i.bind(this,d),set:o.bind(this,d)};Object.defineProperty(this._publicOptions,d,S)}}_checkReadonlyOptions(a){if(y.includes(a))throw new Error(`Option "${a}" 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 f.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const i in a)this._publicOptions[i]=a[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,i=!0){this._core.input(a,i)}resize(a,i){this._verifyIntegers(a,i),this._core.resize(a,i)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,i,o){this._verifyIntegers(a,i,o),this._core.select(a,i,o)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,i){this._verifyIntegers(a,i),this._core.selectLines(a,i)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,i){this._core.write(a,i)}writeln(a,i){this._core.write(a),this._core.write(`\r
9
+ `,i)}paste(a){this._core.paste(a)}refresh(a,i){this._verifyIntegers(a,i),this._core.refresh(a,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return r}_verifyIntegers(...a){for(const i of a)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const i of a)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}w.Terminal=u})(),k})())}(lt)),lt.exports}var ds=us();function z(e,t,c){function g(r,s){var l;Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(l=r._zod).traits??(l.traits=new Set),r._zod.traits.add(e),t(r,s);for(const _ in w.prototype)_ in r||Object.defineProperty(r,_,{value:w.prototype[_].bind(r)});r._zod.constr=w,r._zod.def=s}const m=c?.Parent??Object;class k extends m{}Object.defineProperty(k,"name",{value:e});function w(r){var s;const l=c?.Parent?new k:this;g(l,r),(s=l._zod).deferred??(s.deferred=[]);for(const _ of l._zod.deferred)_();return l}return Object.defineProperty(w,"init",{value:g}),Object.defineProperty(w,Symbol.hasInstance,{value:r=>c?.Parent&&r instanceof c.Parent?!0:r?._zod?.traits?.has(e)}),Object.defineProperty(w,"name",{value:e}),w}class Ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const fs={};function ye(e){return fs}function dt(e,t){return typeof t=="bigint"?t.toString():t}function gt(e){return e==null}function mt(e){const t=e.startsWith("^")?1:0,c=e.endsWith("$")?e.length-1:e.length;return e.slice(t,c)}const Ht=Symbol("evaluating");function ee(e,t,c){let g;Object.defineProperty(e,t,{get(){if(g!==Ht)return g===void 0&&(g=Ht,g=c()),g},set(m){Object.defineProperty(e,t,{value:m})},configurable:!0})}const kr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zt(e){if(Ft(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const c=t.prototype;return!(Ft(c)===!1||Object.prototype.hasOwnProperty.call(c,"isPrototypeOf")===!1)}function bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _s(e,t,c){const g=new e._zod.constr(t??e._zod.def);return(!t||c?.parent)&&(g._zod.parent=e),g}function Y(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Te(e,t=0){for(let c=t;c<e.issues.length;c++)if(e.issues[c]?.continue!==!0)return!0;return!1}function ps(e,t){return t.map(c=>{var g;return(g=c).path??(g.path=[]),c.path.unshift(e),c})}function Ve(e){return typeof e=="string"?e:e?.message}function Ce(e,t,c){const g={...e,path:e.path??[]};if(!e.message){const m=Ve(e.inst?._zod.def?.error?.(e))??Ve(t?.error?.(e))??Ve(c.customError?.(e))??Ve(c.localeError?.(e))??"Invalid input";g.message=m}return delete g.inst,delete g.continue,t?.reportInput||delete g.input,g}function St(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Me(...e){const[t,c,g]=e;return typeof t=="string"?{message:t,code:"custom",input:c,inst:g}:{...t}}const Rr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,dt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Dr=z("$ZodError",Rr),Lr=z("$ZodError",Rr,{Parent:Error});function vs(e,t=c=>c.message){const c={},g=[];for(const m of e.issues)m.path.length>0?(c[m.path[0]]=c[m.path[0]]||[],c[m.path[0]].push(t(m))):g.push(t(m));return{formErrors:g,fieldErrors:c}}function gs(e,t){const c=t||function(k){return k.message},g={_errors:[]},m=k=>{for(const w of k.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map(r=>m({issues:r}));else if(w.code==="invalid_key")m({issues:w.issues});else if(w.code==="invalid_element")m({issues:w.issues});else if(w.path.length===0)g._errors.push(c(w));else{let r=g,s=0;for(;s<w.path.length;){const l=w.path[s];s===w.path.length-1?(r[l]=r[l]||{_errors:[]},r[l]._errors.push(c(w))):r[l]=r[l]||{_errors:[]},r=r[l],s++}}};return m(e),g}const ms=e=>(t,c,g,m)=>{const k=g?Object.assign(g,{async:!1}):{async:!1},w=t._zod.run({value:c,issues:[]},k);if(w instanceof Promise)throw new Ie;if(w.issues.length){const r=new(m?.Err??e)(w.issues.map(s=>Ce(s,k,ye())));throw kr(r,m?.callee),r}return w.value},bs=e=>async(t,c,g,m)=>{const k=g?Object.assign(g,{async:!0}):{async:!0};let w=t._zod.run({value:c,issues:[]},k);if(w instanceof Promise&&(w=await w),w.issues.length){const r=new(m?.Err??e)(w.issues.map(s=>Ce(s,k,ye())));throw kr(r,m?.callee),r}return w.value},Ar=e=>(t,c,g)=>{const m=g?{...g,async:!1}:{async:!1},k=t._zod.run({value:c,issues:[]},m);if(k instanceof Promise)throw new Ie;return k.issues.length?{success:!1,error:new(e??Dr)(k.issues.map(w=>Ce(w,m,ye())))}:{success:!0,data:k.value}},Ss=Ar(Lr),Pr=e=>async(t,c,g)=>{const m=g?Object.assign(g,{async:!0}):{async:!0};let k=t._zod.run({value:c,issues:[]},m);return k instanceof Promise&&(k=await k),k.issues.length?{success:!1,error:new e(k.issues.map(w=>Ce(w,m,ye())))}:{success:!0,data:k.value}},ys=Pr(Lr),Cs=/^[cC][^\s-]{8,}$/,ws=/^[0-9a-z]+$/,Es=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xs=/^[0-9a-vA-V]{20}$/,ks=/^[A-Za-z0-9]{27}$/,Rs=/^[a-zA-Z0-9_-]{21}$/,Ds=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ls=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,As=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ps="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ts(){return new RegExp(Ps,"u")}const Os=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Is=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ms=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Tr=/^[A-Za-z0-9_-]*$/,Fs=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,zs=/^\+(?:[0-9]){6,14}[0-9]$/,Or="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",js=new RegExp(`^${Or}$`);function Br(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $s(e){return new RegExp(`^${Br(e)}$`)}function Ws(e){const t=Br({precision:e.precision}),c=["Z"];e.local&&c.push(""),e.offset&&c.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const g=`${t}(?:${c.join("|")})`;return new RegExp(`^${Or}T(?:${g})$`)}const Ns=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Us=/^[^A-Z]*$/,Zs=/^[^a-z]*$/,pe=z("$ZodCheck",(e,t)=>{var c;e._zod??(e._zod={}),e._zod.def=t,(c=e._zod).onattach??(c.onattach=[])}),qs=z("$ZodCheckMaxLength",(e,t)=>{var c;pe.init(e,t),(c=e._zod.def).when??(c.when=g=>{const m=g.value;return!gt(m)&&m.length!==void 0}),e._zod.onattach.push(g=>{const m=g._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<m&&(g._zod.bag.maximum=t.maximum)}),e._zod.check=g=>{const m=g.value;if(m.length<=t.maximum)return;const w=St(m);g.issues.push({origin:w,code:"too_big",maximum:t.maximum,inclusive:!0,input:m,inst:e,continue:!t.abort})}}),Ks=z("$ZodCheckMinLength",(e,t)=>{var c;pe.init(e,t),(c=e._zod.def).when??(c.when=g=>{const m=g.value;return!gt(m)&&m.length!==void 0}),e._zod.onattach.push(g=>{const m=g._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>m&&(g._zod.bag.minimum=t.minimum)}),e._zod.check=g=>{const m=g.value;if(m.length>=t.minimum)return;const w=St(m);g.issues.push({origin:w,code:"too_small",minimum:t.minimum,inclusive:!0,input:m,inst:e,continue:!t.abort})}}),Vs=z("$ZodCheckLengthEquals",(e,t)=>{var c;pe.init(e,t),(c=e._zod.def).when??(c.when=g=>{const m=g.value;return!gt(m)&&m.length!==void 0}),e._zod.onattach.push(g=>{const m=g._zod.bag;m.minimum=t.length,m.maximum=t.length,m.length=t.length}),e._zod.check=g=>{const m=g.value,k=m.length;if(k===t.length)return;const w=St(m),r=k>t.length;g.issues.push({origin:w,...r?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:g.value,inst:e,continue:!t.abort})}}),et=z("$ZodCheckStringFormat",(e,t)=>{var c,g;pe.init(e,t),e._zod.onattach.push(m=>{const k=m._zod.bag;k.format=t.format,t.pattern&&(k.patterns??(k.patterns=new Set),k.patterns.add(t.pattern))}),t.pattern?(c=e._zod).check??(c.check=m=>{t.pattern.lastIndex=0,!t.pattern.test(m.value)&&m.issues.push({origin:"string",code:"invalid_format",format:t.format,input:m.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(g=e._zod).check??(g.check=()=>{})}),Gs=z("$ZodCheckRegex",(e,t)=>{et.init(e,t),e._zod.check=c=>{t.pattern.lastIndex=0,!t.pattern.test(c.value)&&c.issues.push({origin:"string",code:"invalid_format",format:"regex",input:c.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Js=z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Us),et.init(e,t)}),Ys=z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Zs),et.init(e,t)}),Xs=z("$ZodCheckIncludes",(e,t)=>{pe.init(e,t);const c=bt(t.includes),g=new RegExp(typeof t.position=="number"?`^.{${t.position}}${c}`:c);t.pattern=g,e._zod.onattach.push(m=>{const k=m._zod.bag;k.patterns??(k.patterns=new Set),k.patterns.add(g)}),e._zod.check=m=>{m.value.includes(t.includes,t.position)||m.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:m.value,inst:e,continue:!t.abort})}}),Qs=z("$ZodCheckStartsWith",(e,t)=>{pe.init(e,t);const c=new RegExp(`^${bt(t.prefix)}.*`);t.pattern??(t.pattern=c),e._zod.onattach.push(g=>{const m=g._zod.bag;m.patterns??(m.patterns=new Set),m.patterns.add(c)}),e._zod.check=g=>{g.value.startsWith(t.prefix)||g.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:g.value,inst:e,continue:!t.abort})}}),en=z("$ZodCheckEndsWith",(e,t)=>{pe.init(e,t);const c=new RegExp(`.*${bt(t.suffix)}$`);t.pattern??(t.pattern=c),e._zod.onattach.push(g=>{const m=g._zod.bag;m.patterns??(m.patterns=new Set),m.patterns.add(c)}),e._zod.check=g=>{g.value.endsWith(t.suffix)||g.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:g.value,inst:e,continue:!t.abort})}}),tn=z("$ZodCheckOverwrite",(e,t)=>{pe.init(e,t),e._zod.check=c=>{c.value=t.tx(c.value)}}),rn={major:4,minor:0,patch:14},ae=z("$ZodType",(e,t)=>{var c;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rn;const g=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&g.unshift(e);for(const m of g)for(const k of m._zod.onattach)k(e);if(g.length===0)(c=e._zod).deferred??(c.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const m=(k,w,r)=>{let s=Te(k),l;for(const _ of w){if(_._zod.def.when){if(!_._zod.def.when(k))continue}else if(s)continue;const h=k.issues.length,f=_._zod.check(k);if(f instanceof Promise&&r?.async===!1)throw new Ie;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,k.issues.length!==h&&(s||(s=Te(k,h)))});else{if(k.issues.length===h)continue;s||(s=Te(k,h))}}return l?l.then(()=>k):k};e._zod.run=(k,w)=>{const r=e._zod.parse(k,w);if(r instanceof Promise){if(w.async===!1)throw new Ie;return r.then(s=>m(s,g,w))}return m(r,g,w)}}e["~standard"]={validate:m=>{try{const k=Ss(e,m);return k.success?{value:k.data}:{issues:k.error?.issues}}catch{return ys(e,m).then(w=>w.success?{value:w.data}:{issues:w.error?.issues})}},vendor:"zod",version:1}}),yt=z("$ZodString",(e,t)=>{ae.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ns(e._zod.bag),e._zod.parse=(c,g)=>{if(t.coerce)try{c.value=String(c.value)}catch{}return typeof c.value=="string"||c.issues.push({expected:"string",code:"invalid_type",input:c.value,inst:e}),c}}),te=z("$ZodStringFormat",(e,t)=>{et.init(e,t),yt.init(e,t)}),sn=z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ls),te.init(e,t)}),nn=z("$ZodUUID",(e,t)=>{if(t.version){const g={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(g===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=jt(g))}else t.pattern??(t.pattern=jt());te.init(e,t)}),on=z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=As),te.init(e,t)}),an=z("$ZodURL",(e,t)=>{te.init(e,t),e._zod.check=c=>{try{const g=c.value.trim(),m=new URL(g);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(m.hostname)||c.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Fs.source,input:c.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(m.protocol.endsWith(":")?m.protocol.slice(0,-1):m.protocol)||c.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:c.value,inst:e,continue:!t.abort})),t.normalize?c.value=m.href:c.value=g;return}catch{c.issues.push({code:"invalid_format",format:"url",input:c.value,inst:e,continue:!t.abort})}}}),cn=z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ts()),te.init(e,t)}),hn=z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Rs),te.init(e,t)}),ln=z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Cs),te.init(e,t)}),un=z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ws),te.init(e,t)}),dn=z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Es),te.init(e,t)}),fn=z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xs),te.init(e,t)}),_n=z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ks),te.init(e,t)}),pn=z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ws(t)),te.init(e,t)}),vn=z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=js),te.init(e,t)}),gn=z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$s(t)),te.init(e,t)}),mn=z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ds),te.init(e,t)}),bn=z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Os),te.init(e,t),e._zod.onattach.push(c=>{const g=c._zod.bag;g.format="ipv4"})}),Sn=z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bs),te.init(e,t),e._zod.onattach.push(c=>{const g=c._zod.bag;g.format="ipv6"}),e._zod.check=c=>{try{new URL(`http://[${c.value}]`)}catch{c.issues.push({code:"invalid_format",format:"ipv6",input:c.value,inst:e,continue:!t.abort})}}}),yn=z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Is),te.init(e,t)}),Cn=z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ms),te.init(e,t),e._zod.check=c=>{const[g,m]=c.value.split("/");try{if(!m)throw new Error;const k=Number(m);if(`${k}`!==m)throw new Error;if(k<0||k>128)throw new Error;new URL(`http://[${g}]`)}catch{c.issues.push({code:"invalid_format",format:"cidrv6",input:c.value,inst:e,continue:!t.abort})}}});function Ir(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wn=z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Hs),te.init(e,t),e._zod.onattach.push(c=>{c._zod.bag.contentEncoding="base64"}),e._zod.check=c=>{Ir(c.value)||c.issues.push({code:"invalid_format",format:"base64",input:c.value,inst:e,continue:!t.abort})}});function En(e){if(!Tr.test(e))return!1;const t=e.replace(/[-_]/g,g=>g==="-"?"+":"/"),c=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ir(c)}const xn=z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Tr),te.init(e,t),e._zod.onattach.push(c=>{c._zod.bag.contentEncoding="base64url"}),e._zod.check=c=>{En(c.value)||c.issues.push({code:"invalid_format",format:"base64url",input:c.value,inst:e,continue:!t.abort})}}),kn=z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=zs),te.init(e,t)});function Rn(e,t=null){try{const c=e.split(".");if(c.length!==3)return!1;const[g]=c;if(!g)return!1;const m=JSON.parse(atob(g));return!("typ"in m&&m?.typ!=="JWT"||!m.alg||t&&(!("alg"in m)||m.alg!==t))}catch{return!1}}const Dn=z("$ZodJWT",(e,t)=>{te.init(e,t),e._zod.check=c=>{Rn(c.value,t.alg)||c.issues.push({code:"invalid_format",format:"jwt",input:c.value,inst:e,continue:!t.abort})}});function $t(e,t,c){e.issues.length&&t.issues.push(...ps(c,e.issues)),t.value[c]=e.value}const Ln=z("$ZodArray",(e,t)=>{ae.init(e,t),e._zod.parse=(c,g)=>{const m=c.value;if(!Array.isArray(m))return c.issues.push({expected:"array",code:"invalid_type",input:m,inst:e}),c;c.value=Array(m.length);const k=[];for(let w=0;w<m.length;w++){const r=m[w],s=t.element._zod.run({value:r,issues:[]},g);s instanceof Promise?k.push(s.then(l=>$t(l,c,w))):$t(s,c,w)}return k.length?Promise.all(k).then(()=>c):c}});function Wt(e,t,c,g){for(const k of e)if(k.issues.length===0)return t.value=k.value,t;const m=e.filter(k=>!Te(k));return m.length===1?(t.value=m[0].value,m[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:c,errors:e.map(k=>k.issues.map(w=>Ce(w,g,ye())))}),t)}const An=z("$ZodUnion",(e,t)=>{ae.init(e,t),ee(e._zod,"optin",()=>t.options.some(m=>m._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(m=>m._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(m=>m._zod.values))return new Set(t.options.flatMap(m=>Array.from(m._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(m=>m._zod.pattern)){const m=t.options.map(k=>k._zod.pattern);return new RegExp(`^(${m.map(k=>mt(k.source)).join("|")})$`)}});const c=t.options.length===1,g=t.options[0]._zod.run;e._zod.parse=(m,k)=>{if(c)return g(m,k);let w=!1;const r=[];for(const s of t.options){const l=s._zod.run({value:m.value,issues:[]},k);if(l instanceof Promise)r.push(l),w=!0;else{if(l.issues.length===0)return l;r.push(l)}}return w?Promise.all(r).then(s=>Wt(s,m,e,k)):Wt(r,m,e,k)}}),Pn=z("$ZodIntersection",(e,t)=>{ae.init(e,t),e._zod.parse=(c,g)=>{const m=c.value,k=t.left._zod.run({value:m,issues:[]},g),w=t.right._zod.run({value:m,issues:[]},g);return k instanceof Promise||w instanceof Promise?Promise.all([k,w]).then(([s,l])=>Nt(c,s,l)):Nt(c,k,w)}});function ft(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(zt(e)&&zt(t)){const c=Object.keys(t),g=Object.keys(e).filter(k=>c.indexOf(k)!==-1),m={...e,...t};for(const k of g){const w=ft(e[k],t[k]);if(!w.valid)return{valid:!1,mergeErrorPath:[k,...w.mergeErrorPath]};m[k]=w.data}return{valid:!0,data:m}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const c=[];for(let g=0;g<e.length;g++){const m=e[g],k=t[g],w=ft(m,k);if(!w.valid)return{valid:!1,mergeErrorPath:[g,...w.mergeErrorPath]};c.push(w.data)}return{valid:!0,data:c}}return{valid:!1,mergeErrorPath:[]}}function Nt(e,t,c){if(t.issues.length&&e.issues.push(...t.issues),c.issues.length&&e.issues.push(...c.issues),Te(e))return e;const g=ft(t.value,c.value);if(!g.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`);return e.value=g.data,e}const Tn=z("$ZodTransform",(e,t)=>{ae.init(e,t),e._zod.parse=(c,g)=>{const m=t.transform(c.value,c);if(g.async)return(m instanceof Promise?m:Promise.resolve(m)).then(w=>(c.value=w,c));if(m instanceof Promise)throw new Ie;return c.value=m,c}});function Ut(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const On=z("$ZodOptional",(e,t)=>{ae.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{const c=t.innerType._zod.pattern;return c?new RegExp(`^(${mt(c.source)})?$`):void 0}),e._zod.parse=(c,g)=>{if(t.innerType._zod.optin==="optional"){const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(k=>Ut(k,c.value)):Ut(m,c.value)}return c.value===void 0?c:t.innerType._zod.run(c,g)}}),Bn=z("$ZodNullable",(e,t)=>{ae.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{const c=t.innerType._zod.pattern;return c?new RegExp(`^(${mt(c.source)}|null)$`):void 0}),ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(c,g)=>c.value===null?c:t.innerType._zod.run(c,g)}),In=z("$ZodDefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(c,g)=>{if(c.value===void 0)return c.value=t.defaultValue,c;const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(k=>Zt(k,t)):Zt(m,t)}});function Zt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Mn=z("$ZodPrefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(c,g)=>(c.value===void 0&&(c.value=t.defaultValue),t.innerType._zod.run(c,g))}),Hn=z("$ZodNonOptional",(e,t)=>{ae.init(e,t),ee(e._zod,"values",()=>{const c=t.innerType._zod.values;return c?new Set([...c].filter(g=>g!==void 0)):void 0}),e._zod.parse=(c,g)=>{const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(k=>qt(k,e)):qt(m,e)}});function qt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Fn=z("$ZodCatch",(e,t)=>{ae.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(c,g)=>{const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(k=>(c.value=k.value,k.issues.length&&(c.value=t.catchValue({...c,error:{issues:k.issues.map(w=>Ce(w,g,ye()))},input:c.value}),c.issues=[]),c)):(c.value=m.value,m.issues.length&&(c.value=t.catchValue({...c,error:{issues:m.issues.map(k=>Ce(k,g,ye()))},input:c.value}),c.issues=[]),c)}}),zn=z("$ZodPipe",(e,t)=>{ae.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(c,g)=>{const m=t.in._zod.run(c,g);return m instanceof Promise?m.then(k=>Kt(k,t,g)):Kt(m,t,g)}});function Kt(e,t,c){return e.issues.length?e:t.out._zod.run({value:e.value,issues:e.issues},c)}const jn=z("$ZodReadonly",(e,t)=>{ae.init(e,t),ee(e._zod,"propValues",()=>t.innerType._zod.propValues),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(c,g)=>{const m=t.innerType._zod.run(c,g);return m instanceof Promise?m.then(Vt):Vt(m)}});function Vt(e){return e.value=Object.freeze(e.value),e}const $n=z("$ZodCustom",(e,t)=>{pe.init(e,t),ae.init(e,t),e._zod.parse=(c,g)=>c,e._zod.check=c=>{const g=c.value,m=t.fn(g);if(m instanceof Promise)return m.then(k=>Gt(k,c,g,e));Gt(m,c,g,e)}});function Gt(e,t,c,g){if(!e){const m={code:"custom",input:c,inst:g,path:[...g._zod.def.path??[]],continue:!g._zod.def.abort};g._zod.def.params&&(m.params=g._zod.def.params),t.issues.push(Me(m))}}class Wn{constructor(){this._map=new Map,this._idmap=new Map}add(t,...c){const g=c[0];if(this._map.set(t,g),g&&typeof g=="object"&&"id"in g){if(this._idmap.has(g.id))throw new Error(`ID ${g.id} already exists in the registry`);this._idmap.set(g.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const c=this._map.get(t);return c&&typeof c=="object"&&"id"in c&&this._idmap.delete(c.id),this._map.delete(t),this}get(t){const c=t._zod.parent;if(c){const g={...this.get(c)??{}};delete g.id;const m={...g,...this._map.get(t)};return Object.keys(m).length?m:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Nn(){return new Wn}const Ge=Nn();function Un(e,t){return new e({type:"string",...Y(t)})}function Zn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Y(t)})}function Jt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Y(t)})}function qn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Y(t)})}function Kn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Y(t)})}function Vn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Y(t)})}function Gn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Y(t)})}function Jn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Y(t)})}function Yn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Y(t)})}function Xn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Y(t)})}function Qn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Y(t)})}function eo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Y(t)})}function to(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Y(t)})}function ro(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Y(t)})}function io(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Y(t)})}function so(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Y(t)})}function no(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Y(t)})}function oo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Y(t)})}function ao(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Y(t)})}function co(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Y(t)})}function ho(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Y(t)})}function lo(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Y(t)})}function uo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Y(t)})}function fo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Y(t)})}function _o(e,t){return new e({type:"string",format:"date",check:"string_format",...Y(t)})}function po(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Y(t)})}function vo(e,t){return new e({type:"string",format:"duration",check:"string_format",...Y(t)})}function Mr(e,t){return new qs({check:"max_length",...Y(t),maximum:e})}function Qe(e,t){return new Ks({check:"min_length",...Y(t),minimum:e})}function Hr(e,t){return new Vs({check:"length_equals",...Y(t),length:e})}function go(e,t){return new Gs({check:"string_format",format:"regex",...Y(t),pattern:e})}function mo(e){return new Js({check:"string_format",format:"lowercase",...Y(e)})}function bo(e){return new Ys({check:"string_format",format:"uppercase",...Y(e)})}function So(e,t){return new Xs({check:"string_format",format:"includes",...Y(t),includes:e})}function yo(e,t){return new Qs({check:"string_format",format:"starts_with",...Y(t),prefix:e})}function Co(e,t){return new en({check:"string_format",format:"ends_with",...Y(t),suffix:e})}function je(e){return new tn({check:"overwrite",tx:e})}function wo(e){return je(t=>t.normalize(e))}function Eo(){return je(e=>e.trim())}function xo(){return je(e=>e.toLowerCase())}function ko(){return je(e=>e.toUpperCase())}function Ro(e,t,c){return new e({type:"array",element:t,...Y(c)})}function Do(e,t,c){return new e({type:"custom",check:"custom",fn:t,...Y(c)})}function Lo(e){const t=Ao(c=>(c.addIssue=g=>{if(typeof g=="string")c.issues.push(Me(g,c.value,t._zod.def));else{const m=g;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=c.value),m.inst??(m.inst=t),m.continue??(m.continue=!t._zod.def.abort),c.issues.push(Me(m))}},e(c.value,c)));return t}function Ao(e,t){const c=new pe({check:"custom",...Y(t)});return c._zod.check=e,c}const Po=z("ZodISODateTime",(e,t)=>{pn.init(e,t),ie.init(e,t)});function To(e){return fo(Po,e)}const Oo=z("ZodISODate",(e,t)=>{vn.init(e,t),ie.init(e,t)});function Bo(e){return _o(Oo,e)}const Io=z("ZodISOTime",(e,t)=>{gn.init(e,t),ie.init(e,t)});function Mo(e){return po(Io,e)}const Ho=z("ZodISODuration",(e,t)=>{mn.init(e,t),ie.init(e,t)});function Fo(e){return vo(Ho,e)}const zo=(e,t)=>{Dr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:c=>gs(e,c)},flatten:{value:c=>vs(e,c)},addIssue:{value:c=>{e.issues.push(c),e.message=JSON.stringify(e.issues,dt,2)}},addIssues:{value:c=>{e.issues.push(...c),e.message=JSON.stringify(e.issues,dt,2)}},isEmpty:{get(){return e.issues.length===0}}})},tt=z("ZodError",zo,{Parent:Error}),jo=ms(tt),$o=bs(tt),Wo=Ar(tt),No=Pr(tt),he=z("ZodType",(e,t)=>(ae.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...c)=>e.clone({...t,checks:[...t.checks??[],...c.map(g=>typeof g=="function"?{_zod:{check:g,def:{check:"custom"},onattach:[]}}:g)]}),e.clone=(c,g)=>_s(e,c,g),e.brand=()=>e,e.register=(c,g)=>(c.add(e,g),e),e.parse=(c,g)=>jo(e,c,g,{callee:e.parse}),e.safeParse=(c,g)=>Wo(e,c,g),e.parseAsync=async(c,g)=>$o(e,c,g,{callee:e.parseAsync}),e.safeParseAsync=async(c,g)=>No(e,c,g),e.spa=e.safeParseAsync,e.refine=(c,g)=>e.check(Pa(c,g)),e.superRefine=c=>e.check(Ta(c)),e.overwrite=c=>e.check(je(c)),e.optional=()=>Xt(e),e.nullable=()=>Qt(e),e.nullish=()=>Xt(Qt(e)),e.nonoptional=c=>Ea(e,c),e.array=()=>la(e),e.or=c=>da([e,c]),e.and=c=>_a(e,c),e.transform=c=>er(e,va(c)),e.default=c=>Sa(e,c),e.prefault=c=>Ca(e,c),e.catch=c=>ka(e,c),e.pipe=c=>er(e,c),e.readonly=()=>La(e),e.describe=c=>{const g=e.clone();return Ge.add(g,{description:c}),g},Object.defineProperty(e,"description",{get(){return Ge.get(e)?.description},configurable:!0}),e.meta=(...c)=>{if(c.length===0)return Ge.get(e);const g=e.clone();return Ge.add(g,c[0]),g},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Fr=z("_ZodString",(e,t)=>{yt.init(e,t),he.init(e,t);const c=e._zod.bag;e.format=c.format??null,e.minLength=c.minimum??null,e.maxLength=c.maximum??null,e.regex=(...g)=>e.check(go(...g)),e.includes=(...g)=>e.check(So(...g)),e.startsWith=(...g)=>e.check(yo(...g)),e.endsWith=(...g)=>e.check(Co(...g)),e.min=(...g)=>e.check(Qe(...g)),e.max=(...g)=>e.check(Mr(...g)),e.length=(...g)=>e.check(Hr(...g)),e.nonempty=(...g)=>e.check(Qe(1,...g)),e.lowercase=g=>e.check(mo(g)),e.uppercase=g=>e.check(bo(g)),e.trim=()=>e.check(Eo()),e.normalize=(...g)=>e.check(wo(...g)),e.toLowerCase=()=>e.check(xo()),e.toUpperCase=()=>e.check(ko())}),Uo=z("ZodString",(e,t)=>{yt.init(e,t),Fr.init(e,t),e.email=c=>e.check(Zn(qo,c)),e.url=c=>e.check(Jn(Ko,c)),e.jwt=c=>e.check(uo(ca,c)),e.emoji=c=>e.check(Yn(Vo,c)),e.guid=c=>e.check(Jt(Yt,c)),e.uuid=c=>e.check(qn(Je,c)),e.uuidv4=c=>e.check(Kn(Je,c)),e.uuidv6=c=>e.check(Vn(Je,c)),e.uuidv7=c=>e.check(Gn(Je,c)),e.nanoid=c=>e.check(Xn(Go,c)),e.guid=c=>e.check(Jt(Yt,c)),e.cuid=c=>e.check(Qn(Jo,c)),e.cuid2=c=>e.check(eo(Yo,c)),e.ulid=c=>e.check(to(Xo,c)),e.base64=c=>e.check(co(na,c)),e.base64url=c=>e.check(ho(oa,c)),e.xid=c=>e.check(ro(Qo,c)),e.ksuid=c=>e.check(io(ea,c)),e.ipv4=c=>e.check(so(ta,c)),e.ipv6=c=>e.check(no(ra,c)),e.cidrv4=c=>e.check(oo(ia,c)),e.cidrv6=c=>e.check(ao(sa,c)),e.e164=c=>e.check(lo(aa,c)),e.datetime=c=>e.check(To(c)),e.date=c=>e.check(Bo(c)),e.time=c=>e.check(Mo(c)),e.duration=c=>e.check(Fo(c))});function Zo(e){return Un(Uo,e)}const ie=z("ZodStringFormat",(e,t)=>{te.init(e,t),Fr.init(e,t)}),qo=z("ZodEmail",(e,t)=>{on.init(e,t),ie.init(e,t)}),Yt=z("ZodGUID",(e,t)=>{sn.init(e,t),ie.init(e,t)}),Je=z("ZodUUID",(e,t)=>{nn.init(e,t),ie.init(e,t)}),Ko=z("ZodURL",(e,t)=>{an.init(e,t),ie.init(e,t)}),Vo=z("ZodEmoji",(e,t)=>{cn.init(e,t),ie.init(e,t)}),Go=z("ZodNanoID",(e,t)=>{hn.init(e,t),ie.init(e,t)}),Jo=z("ZodCUID",(e,t)=>{ln.init(e,t),ie.init(e,t)}),Yo=z("ZodCUID2",(e,t)=>{un.init(e,t),ie.init(e,t)}),Xo=z("ZodULID",(e,t)=>{dn.init(e,t),ie.init(e,t)}),Qo=z("ZodXID",(e,t)=>{fn.init(e,t),ie.init(e,t)}),ea=z("ZodKSUID",(e,t)=>{_n.init(e,t),ie.init(e,t)}),ta=z("ZodIPv4",(e,t)=>{bn.init(e,t),ie.init(e,t)}),ra=z("ZodIPv6",(e,t)=>{Sn.init(e,t),ie.init(e,t)}),ia=z("ZodCIDRv4",(e,t)=>{yn.init(e,t),ie.init(e,t)}),sa=z("ZodCIDRv6",(e,t)=>{Cn.init(e,t),ie.init(e,t)}),na=z("ZodBase64",(e,t)=>{wn.init(e,t),ie.init(e,t)}),oa=z("ZodBase64URL",(e,t)=>{xn.init(e,t),ie.init(e,t)}),aa=z("ZodE164",(e,t)=>{kn.init(e,t),ie.init(e,t)}),ca=z("ZodJWT",(e,t)=>{Dn.init(e,t),ie.init(e,t)}),ha=z("ZodArray",(e,t)=>{Ln.init(e,t),he.init(e,t),e.element=t.element,e.min=(c,g)=>e.check(Qe(c,g)),e.nonempty=c=>e.check(Qe(1,c)),e.max=(c,g)=>e.check(Mr(c,g)),e.length=(c,g)=>e.check(Hr(c,g)),e.unwrap=()=>e.element});function la(e,t){return Ro(ha,e,t)}const ua=z("ZodUnion",(e,t)=>{An.init(e,t),he.init(e,t),e.options=t.options});function da(e,t){return new ua({type:"union",options:e,...Y(t)})}const fa=z("ZodIntersection",(e,t)=>{Pn.init(e,t),he.init(e,t)});function _a(e,t){return new fa({type:"intersection",left:e,right:t})}const pa=z("ZodTransform",(e,t)=>{Tn.init(e,t),he.init(e,t),e._zod.parse=(c,g)=>{c.addIssue=k=>{if(typeof k=="string")c.issues.push(Me(k,c.value,t));else{const w=k;w.fatal&&(w.continue=!1),w.code??(w.code="custom"),w.input??(w.input=c.value),w.inst??(w.inst=e),c.issues.push(Me(w))}};const m=t.transform(c.value,c);return m instanceof Promise?m.then(k=>(c.value=k,c)):(c.value=m,c)}});function va(e){return new pa({type:"transform",transform:e})}const ga=z("ZodOptional",(e,t)=>{On.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xt(e){return new ga({type:"optional",innerType:e})}const ma=z("ZodNullable",(e,t)=>{Bn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qt(e){return new ma({type:"nullable",innerType:e})}const ba=z("ZodDefault",(e,t)=>{In.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Sa(e,t){return new ba({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const ya=z("ZodPrefault",(e,t)=>{Mn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ca(e,t){return new ya({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const wa=z("ZodNonOptional",(e,t)=>{Hn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ea(e,t){return new wa({type:"nonoptional",innerType:e,...Y(t)})}const xa=z("ZodCatch",(e,t)=>{Fn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ka(e,t){return new xa({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ra=z("ZodPipe",(e,t)=>{zn.init(e,t),he.init(e,t),e.in=t.in,e.out=t.out});function er(e,t){return new Ra({type:"pipe",in:e,out:t})}const Da=z("ZodReadonly",(e,t)=>{jn.init(e,t),he.init(e,t),e.unwrap=()=>e._zod.def.innerType});function La(e){return new Da({type:"readonly",innerType:e})}const Aa=z("ZodCustom",(e,t)=>{$n.init(e,t),he.init(e,t)});function Pa(e,t={}){return Do(Aa,e,t)}function Ta(e){return Lo(e)}function Oa(e){const t=/\x1b\[<(\d+);(\d+);(\d+)([mM])/.exec(e);if(!t)return;if(!t[1]||!t[2]||!t[3]||!t[4])throw new Error(`Mouse event: Invalid match for data ${e}`);const c=parseInt(t[1],10),g=parseInt(t[2],10),m=parseInt(t[3],10),k=t[4]==="m";return console.log(`Mouse event: buttonCode=${c}, column=${g}, row=${m}, isRelease=${k}`),e}function zr(e,t){const c=new ds.Terminal({cursorBlink:!1,convertEol:!0,fontSize:13}),g=Er.macchiato.colors;c.options.theme={background:g.base.hex,black:g.crust.hex,brightBlack:g.surface2.hex,blue:g.blue.hex,brightBlue:g.blue.hex,brightCyan:g.sky.hex,brightRed:g.maroon.hex,brightYellow:g.yellow.hex,cursor:g.text.hex,cyan:g.sky.hex,foreground:g.text.hex,green:g.green.hex,magenta:g.lavender.hex,red:g.red.hex,white:g.text.hex,yellow:g.yellow.hex};const m=new ls.FitAddon;return c.loadAddon(m),c.open(e),m.fit(),window.addEventListener("resize",()=>{m.fit()}),c.onData(k=>{if(typeof k!="string")throw new Error(`unexpected onData message type: '${JSON.stringify(k)}'`);const w=Oa(k);w&&t.onMouseEvent(w)}),c.onKey(k=>{t.onKeyPress(k)}),c}function jr(){let e=Zo().safeParse(sessionStorage.getItem("tabId")).data;return e||(e=Math.random().toString(36),sessionStorage.setItem("tabId",e)),{tabId:e}}class Ba{ready;tabId;terminal;trpc;constructor(t){const c=yr({links:[or({condition:k=>k.type==="subscription",true:Cr({url:"/trpc"}),false:Sr({url:"/trpc"})})]});this.trpc=c,this.tabId=jr();const g=this.tabId,m=zr(t,{onMouseEvent(k){c.neovim.sendStdin.mutate({tabId:g,data:k}).catch(w=>{console.error("Error sending mouse event",w)})},onKeyPress(k){c.neovim.sendStdin.mutate({tabId:g,data:k.key})}});this.terminal=m,this.ready=new Promise(k=>{console.log("Subscribing to stdout"),c.neovim.initializeStdout.subscribe({client:g},{onStarted(){k()},onData(w){m.write(w)},onError(w){console.error("Error from the application",w)}})})}async startNeovim(t){return await this.ready,await this.trpc.neovim.start.mutate({startNeovimArguments:{filename:t.filename,additionalEnvironmentVariables:t.additionalEnvironmentVariables,startupScriptModifications:t.startupScriptModifications,NVIM_APPNAME:t.NVIM_APPNAME},terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows},tabId:this.tabId})}async runBlockingShellCommand(t){return await this.ready,this.trpc.neovim.runBlockingShellCommand.mutate({...t,tabId:this.tabId})}async runLuaCode(t){return await this.ready,this.trpc.neovim.runLuaCode.mutate({...t,tabId:this.tabId})}async doFile(t){return await this.ready,this.trpc.neovim.runExCommand.mutate({...t,tabId:this.tabId,command:`lua dofile("${t.luaFile}")`})}async waitForLuaCode(t){await this.ready;try{return await this.trpc.neovim.waitForLuaCode.mutate({...t,tabId:this.tabId})}catch(c){throw c}}async runExCommand(t){return await this.ready,this.trpc.neovim.runExCommand.mutate({...t,tabId:this.tabId})}}function Ia(e,t){e.parser.registerCsiHandler({final:"c"},()=>(t.onKeyPress({key:"\x1B[?1;2c",domEvent:new KeyboardEvent("keydown",{key:"Escape"})}),!0))}class Ma{ready;tabId;terminal;trpc;terminalApi;constructor(t){const c=yr({links:[or({condition:k=>k.type==="subscription",true:Cr({url:"/trpc"}),false:Sr({url:"/trpc"})})]});this.trpc=c,this.tabId=jr();const g=this.tabId;this.terminalApi={onMouseEvent(k){c.terminal.sendStdin.mutate({tabId:g,data:k}).catch(w=>{console.error("Error sending mouse event",w)})},onKeyPress(k){c.terminal.sendStdin.mutate({tabId:g,data:k.key})}};const m=zr(t,this.terminalApi);this.terminal=m,this.ready=new Promise(k=>{console.log("Subscribing to stdout"),c.terminal.onStdout.subscribe({client:g},{onStarted(){k()},onData(w){m.write(w)},onError(w){console.error("Error from the application",w)}})})}async startTerminalApplication(t){return await this.ready,t.browserSettings.configureTerminal?.({terminal:this.terminal,api:this.terminalApi,recipes:{supportDA1:()=>{Ia(this.terminal,this.terminalApi)}}}),await this.trpc.terminal.start.mutate({tabId:this.tabId,startTerminalArguments:{additionalEnvironmentVariables:t.serverSettings.additionalEnvironmentVariables,commandToRun:t.serverSettings.commandToRun,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}}})}async runBlockingShellCommand(t){return await this.ready,this.trpc.terminal.runBlockingShellCommand.mutate({...t,tabId:this.tabId})}}class $r{constructor(t){this.factory=t}value;get(){return this.value===void 0&&(this.value=this.factory()),this.value}}const Ct=document.querySelector("#app");if(!Ct)throw new Error("No app element found");const Ha=new $r(()=>new Ba(Ct)),Fa=new $r(()=>new Ma(Ct));window.startNeovim=async function(e){const t=Ha.get(),c=await t.startNeovim({additionalEnvironmentVariables:e?.additionalEnvironmentVariables,filename:e?.filename??"initial-file.txt",startupScriptModifications:e?.startupScriptModifications??[],headlessCmd:void 0,NVIM_APPNAME:e?.NVIM_APPNAME});return{runBlockingShellCommand(m){return t.runBlockingShellCommand(m)},runLuaCode(m){return t.runLuaCode(m)},doFile(m){return t.doFile(m)},waitForLuaCode(m){return t.waitForLuaCode(m)},runExCommand(m){return t.runExCommand(m)},dir:c}};window.startTerminalApplication=async function(e){const t=Fa.get();return{dir:await t.startTerminalApplication(e),runBlockingShellCommand(m){return t.runBlockingShellCommand(m)}}};