@tui-sandbox/library 2.3.0 → 4.0.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 (72) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/browser/assets/DejaVuSansMNerdFontMono-Regular-CRJgiq0O.ttf +0 -0
  3. package/dist/browser/assets/index-Bf37MeF1.css +32 -0
  4. package/dist/browser/assets/index-hNatvKyq.js +9 -0
  5. package/dist/browser/index.html +12 -0
  6. package/dist/src/browser/neovim-client.d.ts +7 -0
  7. package/dist/src/browser/neovim-client.js +14 -0
  8. package/dist/src/client/index.d.ts +1 -1
  9. package/dist/src/client/index.js +1 -1
  10. package/dist/src/client/neovim-client.js +4 -4
  11. package/dist/src/client/websocket-client.js +1 -1
  12. package/dist/src/scripts/tui.d.ts +1 -0
  13. package/dist/src/scripts/tui.js +25 -0
  14. package/dist/src/server/TestServer.d.ts +6 -4
  15. package/dist/src/server/TestServer.js +35 -11
  16. package/dist/src/server/dirtree/index.js +2 -2
  17. package/dist/src/server/dirtree/index.test.js +9 -9
  18. package/dist/src/server/index.d.ts +4 -4
  19. package/dist/src/server/index.js +3 -3
  20. package/dist/src/server/neovim/NeovimApplication.d.ts +2 -2
  21. package/dist/src/server/neovim/NeovimApplication.js +3 -3
  22. package/dist/src/server/neovim/NeovimJavascriptApiClient.d.ts +1 -1
  23. package/dist/src/server/neovim/NeovimJavascriptApiClient.js +1 -1
  24. package/dist/src/server/neovim/NeovimJavascriptApiClient.test.js +1 -1
  25. package/dist/src/server/neovim/environment/createTempDir.d.ts +2 -2
  26. package/dist/src/server/neovim/environment/createTempDir.js +2 -2
  27. package/dist/src/server/neovim/environment/createTempDir.test.js +75 -11
  28. package/dist/src/server/neovim/index.d.ts +4 -4
  29. package/dist/src/server/neovim/index.js +3 -3
  30. package/dist/src/server/server.d.ts +4 -3
  31. package/dist/src/server/server.js +80 -12
  32. package/dist/src/server/server.test.js +2 -2
  33. package/dist/src/server/updateTestdirectorySchemaFile.d.ts +0 -1
  34. package/dist/src/server/updateTestdirectorySchemaFile.js +1 -2
  35. package/dist/src/server/updateTestdirectorySchemaFile.test.js +2 -2
  36. package/dist/src/server/utilities/DisposableSingleApplication.d.ts +1 -1
  37. package/dist/src/server/utilities/DisposableSingleApplication.test.js +1 -1
  38. package/dist/src/server/utilities/TerminalApplication.d.ts +1 -1
  39. package/dist/src/server/utilities/applicationAvailable.test.js +1 -1
  40. package/dist/src/server/utilities/generator.test.js +1 -1
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/index.html +11 -0
  43. package/package.json +16 -6
  44. package/src/browser/neovim-client.ts +26 -0
  45. package/src/client/index.ts +1 -1
  46. package/src/client/neovim-client.ts +4 -4
  47. package/src/client/websocket-client.ts +1 -1
  48. package/src/scripts/tui.ts +29 -0
  49. package/src/server/TestServer.ts +50 -15
  50. package/src/server/dirtree/index.test.ts +9 -9
  51. package/src/server/dirtree/index.ts +2 -2
  52. package/src/server/index.ts +4 -5
  53. package/src/server/neovim/NeovimApplication.ts +5 -5
  54. package/src/server/neovim/NeovimJavascriptApiClient.test.ts +2 -2
  55. package/src/server/neovim/NeovimJavascriptApiClient.ts +1 -1
  56. package/src/server/neovim/environment/createTempDir.test.ts +2 -2
  57. package/src/server/neovim/environment/createTempDir.ts +4 -4
  58. package/src/server/neovim/index.ts +7 -7
  59. package/src/server/server.test.ts +2 -2
  60. package/src/server/server.ts +10 -7
  61. package/src/server/updateTestdirectorySchemaFile.test.ts +3 -3
  62. package/src/server/updateTestdirectorySchemaFile.ts +1 -2
  63. package/src/server/utilities/DisposableSingleApplication.test.ts +2 -2
  64. package/src/server/utilities/DisposableSingleApplication.ts +1 -1
  65. package/src/server/utilities/TerminalApplication.ts +1 -1
  66. package/src/server/utilities/applicationAvailable.test.ts +1 -1
  67. package/src/server/utilities/generator.test.ts +1 -1
  68. package/tsconfig.json +10 -4
  69. package/vite.config.js +26 -0
  70. package/dist/vitest.config.d.ts +0 -2
  71. package/dist/vitest.config.js +0 -8
  72. package/vitest.config.ts +0 -9
@@ -0,0 +1,9 @@
1
+ var mr=Object.defineProperty;var br=(l,e,c)=>e in l?mr(l,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):l[e]=c;var Ve=(l,e,c)=>br(l,typeof e!="symbol"?e+"":e,c);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const S of document.querySelectorAll('link[rel="modulepreload"]'))g(S);new MutationObserver(S=>{for(const w of S)if(w.type==="childList")for(const R of w.addedNodes)R.tagName==="LINK"&&R.rel==="modulepreload"&&g(R)}).observe(document,{childList:!0,subtree:!0});function c(S){const w={};return S.integrity&&(w.integrity=S.integrity),S.referrerPolicy&&(w.referrerPolicy=S.referrerPolicy),S.crossOrigin==="use-credentials"?w.credentials="include":S.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function g(S){if(S.ep)return;S.ep=!0;const w=c(S);fetch(S.href,w)}})();function je(l){const e={subscribe(c){let g=null,S=!1,w=!1,R=!1;function r(){if(g===null){R=!0;return}w||(w=!0,typeof g=="function"?g():g&&g.unsubscribe())}return g=l({next(o){var h;S||(h=c.next)==null||h.call(c,o)},error(o){var h;S||(S=!0,(h=c.error)==null||h.call(c,o),r())},complete(){var o;S||(S=!0,(o=c.complete)==null||o.call(c),r())}}),R&&r(),{unsubscribe:r}},pipe(...c){return c.reduce(Sr,e)}};return e}function Sr(l,e){return e(l)}function yr(l){const e=new AbortController;return new Promise((g,S)=>{let w=!1;function R(){w||(w=!0,r.unsubscribe())}e.signal.addEventListener("abort",()=>{S(e.signal.reason)});const r=l.subscribe({next(o){w=!0,g(o),R()},error(o){S(o)},complete(){e.abort(),R()}})})}function Cr(l){return e=>{let c=0,g=null;const S=[];function w(){g||(g=e.subscribe({next(r){var o;for(const h of S)(o=h.next)==null||o.call(h,r)},error(r){var o;for(const h of S)(o=h.error)==null||o.call(h,r)},complete(){var r;for(const o of S)(r=o.complete)==null||r.call(o)}}))}function R(){if(c===0&&g){const r=g;g=null,r.unsubscribe()}}return je(r=>(c++,S.push(r),w(),{unsubscribe(){c--,R();const o=S.findIndex(h=>h===r);o>-1&&S.splice(o,1)}}))}}function wr(l){let e=l;const c=[],g=R=>{e!==void 0&&R.next(e),c.push(R)},S=R=>{c.splice(c.indexOf(R),1)},w=je(R=>(g(R),()=>{S(R)}));return w.next=R=>{if(e!==R){e=R;for(const r of c)r.next(R)}},w.get=()=>e,w}function Jt(l){return je(e=>{function c(S=0,w=l.op){const R=l.links[S];if(!R)throw new Error("No more links to execute - did you forget to add an ending link?");return R({op:w,next(o){return c(S+1,o)}})}return c().subscribe(e)})}var Pt,Ht;const Xt=()=>{},Nt=l=>{Object.freeze&&Object.freeze(l)};function Qt(l,e,c){const g=e.join(".");return(Pt=c)[Ht=g]??(Pt[Ht]=new Proxy(Xt,{get(S,w){if(!(typeof w!="string"||w==="then"))return Qt(l,[...e,w],c)},apply(S,w,R){const r=e[e.length-1];let o={args:R,path:e};return r==="call"?o={args:R.length>=2?[R[1]]:[],path:e.slice(0,-1)}:r==="apply"&&(o={args:R.length>=2?R[1]:[],path:e.slice(0,-1)}),Nt(o.args),Nt(o.path),l(o)}})),c[g]}const Er=l=>Qt(l,[],Object.create(null)),xr=l=>new Proxy(Xt,{get(e,c){if(!(typeof c!="string"||c==="then"))return l(c)}}),ft={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};function Ge(l){return!!l&&!Array.isArray(l)&&typeof l=="object"}const kr=l=>l(),Rr="serialized-error";function Lr(l){const{deserialize:e=w=>w}=l,c=l.signal;let g=null;const S=new ReadableStream({async start(w){const[R,r]=await Promise.all([l.url(),l.init()]),o=g=new l.EventSource(R,r);w.enqueue({type:"connecting",eventSource:g,event:null}),o.addEventListener("open",()=>{w.enqueue({type:"opened",eventSource:o})}),o.addEventListener(Rr,_=>{const a=_;w.enqueue({type:"serialized-error",error:e(JSON.parse(a.data)),eventSource:o})}),o.addEventListener("error",_=>{o.readyState===EventSource.CLOSED?w.error(_):w.enqueue({type:"connecting",eventSource:o,event:_})}),o.addEventListener("message",_=>{const a=_,v={data:e(JSON.parse(a.data))};a.lastEventId&&(v.id=a.lastEventId),w.enqueue({type:"data",data:v,eventSource:o})});const h=()=>{w.close(),o.close()};c.aborted?h():c.addEventListener("abort",h)},cancel(){g==null||g.close()}});return{[Symbol.asyncIterator](){const w=S.getReader();return{async next(){const r=await w.read();return r.done?{value:void 0,done:!0}:{value:r.value,done:!1}},async return(){return w.releaseLock(),{value:void 0,done:!0}}}}}}function Dr(l,e){if("error"in l){const g=e.deserialize(l.error);return{ok:!1,error:{...l,error:g}}}return{ok:!0,result:{...l.result,...(!l.result.type||l.result.type==="data")&&{type:"data",data:e.deserialize(l.result.data)}}}}class Rt extends Error{constructor(){super("Unable to transform response from server")}}function Tr(l,e){let c;try{c=Dr(l,e)}catch{throw new Rt}if(!c.ok&&(!Ge(c.error.error)||typeof c.error.error.code!="number"))throw new Rt;if(c.ok&&!Ge(c.result))throw new Rt;return c}var qt,Vt,Zt,Kt,Gt,Yt;typeof window>"u"||"Deno"in window||((Vt=(qt=globalThis.process)==null?void 0:qt.env)==null?void 0:Vt.NODE_ENV)==="test"||(Kt=(Zt=globalThis.process)==null?void 0:Zt.env)!=null&&Kt.JEST_WORKER_ID||(Yt=(Gt=globalThis.process)==null?void 0:Gt.env)!=null&&Yt.VITEST_WORKER_ID;function Ar(l){return l instanceof ge||l instanceof Error&&l.name==="TRPCClientError"}function Br(l){return Ge(l)&&Ge(l.error)&&typeof l.error.code=="number"&&typeof l.error.message=="string"}function Or(l,e){return typeof l=="string"?l:Ge(l)&&typeof l.message=="string"?l.message:e}class ge extends Error{static from(e,c={}){const g=e;return Ar(g)?(c.meta&&(g.meta={...g.meta,...c.meta}),g):Br(g)?new ge(g.error.message,{...c,result:g}):new ge(Or(g,"Unknown error"),{...c,cause:g})}constructor(e,c){var S,w;const g=c==null?void 0:c.cause;super(e,{cause:g}),this.meta=c==null?void 0:c.meta,this.cause=g,this.shape=(S=c==null?void 0:c.result)==null?void 0:S.error,this.data=(w=c==null?void 0:c.result)==null?void 0:w.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,ge.prototype)}}class Mr{$request(e){return Jt({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(Cr())}async requestAsPromise(e){try{const c=this.$request(e);return(await yr(c)).result.data}catch(c){throw ge.from(c)}}query(e,c,g){return this.requestAsPromise({type:"query",path:e,input:c,context:g==null?void 0:g.context,signal:g==null?void 0:g.signal})}mutation(e,c,g){return this.requestAsPromise({type:"mutation",path:e,input:c,context:g==null?void 0:g.context,signal:g==null?void 0:g.signal})}subscription(e,c,g){return this.$request({type:"subscription",path:e,input:c,context:g==null?void 0:g.context,signal:g.signal}).subscribe({next(w){var R,r,o,h;switch(w.result.type){case"state":{(R=g.onConnectionStateChange)==null||R.call(g,w.result);break}case"started":{(r=g.onStarted)==null||r.call(g,{context:w.context});break}case"stopped":{(o=g.onStopped)==null||o.call(g);break}case"data":case void 0:{(h=g.onData)==null||h.call(g,w.result.data);break}}},error(w){var R;(R=g.onError)==null||R.call(g,w)},complete(){var w;(w=g.onComplete)==null||w.call(g)}})}constructor(e){this.requestId=0,this.runtime={},this.links=e.links.map(c=>c(this.runtime))}}const Ir={query:"query",mutate:"mutation",subscribe:"subscription"},Pr=l=>Ir[l];function Hr(l){const e=Er(({path:c,args:g})=>{const S=[...c],w=Pr(S.pop()),R=S.join(".");return l[w](R,...g)});return xr(c=>l.hasOwnProperty(c)?l[c]:c==="__untypedClient"?l:e[c])}function Nr(l){const e=new Mr(l);return Hr(e)}const Ft=l=>typeof l=="function";function Fr(l){if(l)return l;if(typeof window<"u"&&Ft(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Ft(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Wt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function jt(l){let e=null,c=null;const g=()=>{clearTimeout(c),c=null,e=null};function S(r){var _,a;const o=[[]];let h=0;for(;;){const f=r[h];if(!f)break;const v=o[o.length-1];if(f.aborted){(_=f.reject)==null||_.call(f,new Error("Aborted")),h++;continue}if(l.validate(v.concat(f).map(u=>u.key))){v.push(f),h++;continue}if(v.length===0){(a=f.reject)==null||a.call(f,new Error("Input is too big for a single dispatch")),h++;continue}o.push([])}return o}function w(){const r=S(e);g();for(const o of r){if(!o.length)continue;const h={items:o};for(const a of o)a.batch=h;l.fetch(h.items.map(a=>a.key)).then(async a=>{var f;await Promise.all(a.map(async(v,C)=>{var i,n;const u=h.items[C];try{const t=await Promise.resolve(v);(i=u.resolve)==null||i.call(u,t)}catch(t){(n=u.reject)==null||n.call(u,t)}u.batch=null,u.reject=null,u.resolve=null}));for(const v of h.items)(f=v.reject)==null||f.call(v,new Error("Missing result")),v.batch=null}).catch(a=>{var f;for(const v of h.items)(f=v.reject)==null||f.call(v,a),v.batch=null})}}function R(r){const o={aborted:!1,key:r,batch:null,resolve:Wt,reject:Wt},h=new Promise((_,a)=>{o.reject=a,o.resolve=_,e||(e=[]),e.push(o)});return c||(c=setTimeout(w)),h}return{load:R}}function Wr(...l){const e=new AbortController,c=l.length;let g=0;const S=()=>{++g===c&&e.abort()};for(const w of l)w!=null&&w.aborted?S():w==null||w.addEventListener("abort",S,{once:!0});return e.signal}function jr(...l){const e=new AbortController;for(const c of l)c!=null&&c.aborted?e.abort():c==null||c.addEventListener("abort",()=>e.abort(),{once:!0});return e.signal}function er(l){const e=l;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:c=>c,deserialize:c=>c},output:{serialize:c=>c,deserialize:c=>c}}}function Ur(l){return{url:l.url.toString(),fetch:l.fetch,transformer:er(l.transformer),methodOverride:l.methodOverride}}function $r(l){const e={};for(let c=0;c<l.length;c++){const g=l[c];e[c]=g}return e}const zr={query:"GET",mutation:"POST",subscription:"PATCH"};function tr(l){return"input"in l?l.transformer.input.serialize(l.input):$r(l.inputs.map(e=>l.transformer.input.serialize(e)))}const Mt=l=>{const e=l.url.split("?");let g=e[0].replace(/\/$/,"")+"/"+l.path;const S=[];if(e[1]&&S.push(e[1]),"inputs"in l&&S.push("batch=1"),l.type==="query"||l.type==="subscription"){const w=tr(l);w!==void 0&&l.methodOverride!=="POST"&&S.push(`input=${encodeURIComponent(JSON.stringify(w))}`)}return S.length&&(g+="?"+S.join("&")),g},qr=l=>{if(l.type==="query"&&l.methodOverride!=="POST")return;const e=tr(l);return e!==void 0?JSON.stringify(e):void 0},Vr=l=>Yr({...l,contentTypeHeader:"application/json",getUrl:Mt,getBody:qr});class Zr extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}}const Kr=l=>{var e;if(l!=null&&l.aborted)throw(e=l.throwIfAborted)==null||e.call(l),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Zr};async function Gr(l){Kr(l.signal);const e=l.getUrl(l),c=l.getBody(l),{type:g}=l,S=await(async()=>{const R=await l.headers();return Symbol.iterator in R?Object.fromEntries(R):R})(),w={...l.contentTypeHeader?{"content-type":l.contentTypeHeader}:{},...l.trpcAcceptHeader?{"trpc-accept":l.trpcAcceptHeader}:void 0,...S};return Fr(l.fetch)(e,{method:l.methodOverride??zr[g],signal:l.signal,body:c,headers:w})}async function Yr(l){const e={},c=await Gr(l);e.response=c;const g=await c.json();return e.responseJSON=g,{json:g,meta:e}}function Jr(l){const e=Ur(l),c=l.maxURLLength??1/0;return()=>{const g=r=>({validate(o){if(c===1/0)return!0;const h=o.map(f=>f.path).join(","),_=o.map(f=>f.input);return Mt({...e,type:r,path:h,inputs:_,signal:null}).length<=c},async fetch(o){const h=o.map(u=>u.path).join(","),_=o.map(u=>u.input),a=Wr(...o.map(u=>u.signal)),f=await Vr({...e,path:h,inputs:_,type:r,headers(){return l.headers?typeof l.headers=="function"?l.headers({opList:o}):l.headers:{}},signal:a});return(Array.isArray(f.json)?f.json:o.map(()=>f.json)).map(u=>({meta:f.meta,json:u}))}}),S=jt(g("query")),w=jt(g("mutation")),R={query:S,mutation:w};return({op:r})=>je(o=>{/* istanbul ignore if -- @preserve */if(r.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const _=R[r.type].load(r);let a;return _.then(f=>{a=f;const v=Tr(f.json,e.transformer.output);if(!v.ok){o.error(ge.from(v.error,{meta:f.meta}));return}o.next({context:f.meta,result:v.result}),o.complete()}).catch(f=>{o.error(ge.from(f,{meta:a==null?void 0:a.meta}))}),()=>{}})}}function Ut(l){return Array.isArray(l)?l:[l]}function Xr(l){return e=>{const c=Ut(l.true).map(S=>S(e)),g=Ut(l.false).map(S=>S(e));return S=>je(w=>{const R=l.condition(S.op)?c:g;return Jt({op:S.op,links:R}).subscribe(w)})}}const Dt=(l,...e)=>typeof l=="function"?l(...e):l;async function Qr(l){let e=await Dt(l.url);if(l.connectionParams){const c=await Dt(l.connectionParams),g=e.includes("?")?"&":"?";e+=g+"connectionParams="+encodeURIComponent(JSON.stringify(c))}return e}const es=[ft.BAD_GATEWAY,ft.SERVICE_UNAVAILABLE,ft.GATEWAY_TIMEOUT,ft.INTERNAL_SERVER_ERROR];function ts(l){const e=er(l.transformer);return()=>({op:c})=>je(g=>{const{type:S,path:w,input:R}=c;/* istanbul ignore if -- @preserve */if(S!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");const r=new AbortController,o=jr(c.signal,r.signal),h=Lr({url:async()=>Mt({transformer:e,url:await Qr(l),input:R,path:w,type:S,signal:null}),init:()=>Dt(l.eventSourceOptions,{op:c}),signal:o,deserialize:e.output.deserialize,EventSource:l.EventSource??globalThis.EventSource}),_=wr({type:"state",state:"connecting",error:null}),a=_.subscribe({next(f){g.next({result:f})}});return kr(async()=>{for await(const f of h)switch(f.type){case"data":const v=f.data,C="id"in v?v:v.data;g.next({result:{data:C},context:{eventSource:f.eventSource}});break;case"opened":{g.next({result:{type:"started"},context:{eventSource:f.eventSource}}),_.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const u=ge.from({error:f.error});if(es.includes(f.error.code)){_.next({type:"state",state:"connecting",error:u});break}throw u}case"connecting":{const u=_.get(),i=f.event&&ge.from(f.event);if(!i&&u.state==="connecting")break;_.next({type:"state",state:"connecting",error:i});break}}g.next({result:{type:"stopped"}}),g.complete()}).catch(f=>{g.error(ge.from(f))}),()=>{g.complete(),r.abort(),a.unsubscribe()}})}const rs={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}}}}},_t=l=>Object.entries(l),{version:pi,...ss}=rs,rr=_t(ss).reduce((l,[e,c])=>(l[e]={...c,colorEntries:_t(c.colors),ansiColorEntries:_t(c.ansiColors)},l),{});_t(rr);var sr={exports:{}};(function(l,e){(function(c,g){l.exports=g()})(self,()=>(()=>{var c={};return(()=>{var g=c;Object.defineProperty(g,"__esModule",{value:!0}),g.FitAddon=void 0,g.FitAddon=class{activate(S){this._terminal=S}dispose(){}fit(){const S=this.proposeDimensions();if(!S||!this._terminal||isNaN(S.cols)||isNaN(S.rows))return;const w=this._terminal._core;this._terminal.rows===S.rows&&this._terminal.cols===S.cols||(w._renderService.clear(),this._terminal.resize(S.cols,S.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const S=this._terminal._core,w=S._renderService.dimensions;if(w.css.cell.width===0||w.css.cell.height===0)return;const R=this._terminal.options.scrollback===0?0:S.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),h=Math.max(0,parseInt(r.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),a=o-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),f=h-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-R;return{cols:Math.max(2,Math.floor(f/w.css.cell.width)),rows:Math.max(1,Math.floor(a/w.css.cell.height))}}}})(),c})())})(sr);var is=sr.exports,ir={exports:{}};(function(l,e){(function(c,g){l.exports=g()})(globalThis,()=>(()=>{var c={4567:function(R,r,o){var h=this&&this.__decorate||function(t,s,d,b){var m,y=arguments.length,p=y<3?s:b===null?b=Object.getOwnPropertyDescriptor(s,d):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,d,b);else for(var E=t.length-1;E>=0;E--)(m=t[E])&&(p=(y<3?m(p):y>3?m(s,d,p):m(s,d))||p);return y>3&&p&&Object.defineProperty(s,d,p),p},_=this&&this.__param||function(t,s){return function(d,b){s(d,b,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const a=o(9042),f=o(9924),v=o(844),C=o(4725),u=o(2585),i=o(3656);let n=r.AccessibilityManager=class extends v.Disposable{constructor(t,s,d,b){super(),this._terminal=t,this._coreBrowserService=d,this._renderService=b,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 m=0;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);if(this._topBoundaryFocusListener=m=>this._handleBoundaryFocus(m,0),this._bottomBoundaryFocusListener=m=>this._handleBoundaryFocus(m,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(m=>this._handleResize(m.rows))),this.register(this._terminal.onRender(m=>this._refreshRows(m.start,m.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(m=>this._handleChar(m))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
+ `))),this.register(this._terminal.onA11yTab(m=>this._handleTab(m))),this.register(this._terminal.onKey(m=>this._handleKey(m.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,i.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(t){for(let s=0;s<t;s++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
3
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,s){this._liveRegionDebouncer.refresh(t,s,this._terminal.rows)}_renderRows(t,s){const d=this._terminal.buffer,b=d.lines.length.toString();for(let m=t;m<=s;m++){const y=d.lines.get(d.ydisp+m),p=[],E=(y==null?void 0:y.translateToString(!0,void 0,void 0,p))||"",T=(d.ydisp+m+1).toString(),B=this._rowElements[m];B&&(E.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=E,this._rowColumns.set(B,p)),B.setAttribute("aria-posinset",T),B.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,s){const d=t.target,b=this._rowElements[s===0?1:this._rowElements.length-2];if(d.getAttribute("aria-posinset")===(s===0?"1":`${this._terminal.buffer.lines.length}`)||t.relatedTarget!==b)return;let m,y;if(s===0?(m=d,y=this._rowElements.pop(),this._rowContainer.removeChild(y)):(m=this._rowElements.shift(),y=d,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),y.removeEventListener("focus",this._bottomBoundaryFocusListener),s===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(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const t=document.getSelection();if(!t)return;if(t.isCollapsed)return void(this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection());if(!t.anchorNode||!t.focusNode)return void console.error("anchorNode and/or focusNode are null");let s={node:t.anchorNode,offset:t.anchorOffset},d={node:t.focusNode,offset:t.focusOffset};if((s.node.compareDocumentPosition(d.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===d.node&&s.offset>d.offset)&&([s,d]=[d,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;const b=this._rowElements.slice(-1)[0];if(d.node.compareDocumentPosition(b)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(d={node:b,offset:((E=b.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(d.node))return;const m=({node:T,offset:B})=>{const O=T instanceof Text?T.parentNode:T;let D=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const P=this._rowColumns.get(O);if(!P)return console.warn("columns is null. Race condition?"),null;let N=B<P.length?P[B]:P.slice(-1)[0]+1;return N>=this._terminal.cols&&(++D,N=0),{row:D,column:N}},y=m(s),p=m(d);if(y&&p){if(y.row>p.row||y.row===p.row&&y.column>=p.column)throw new Error("invalid range");this._terminal.select(y.column,y.row,(p.row-y.row)*this._terminal.cols-y.column+p.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=n=h([_(1,u.IInstantiationService),_(2,C.ICoreBrowserService),_(3,C.IRenderService)],n)},3614:(R,r)=>{function o(f){return f.replace(/\r?\n/g,"\r")}function h(f,v){return v?"\x1B[200~"+f+"\x1B[201~":f}function _(f,v,C,u){f=h(f=o(f),C.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(f,!0),v.value=""}function a(f,v,C){const u=C.getBoundingClientRect(),i=f.clientX-u.left-10,n=f.clientY-u.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${i}px`,v.style.top=`${n}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=o,r.bracketTextForPaste=h,r.copyHandler=function(f,v){f.clipboardData&&f.clipboardData.setData("text/plain",v.selectionText),f.preventDefault()},r.handlePasteEvent=function(f,v,C,u){f.stopPropagation(),f.clipboardData&&_(f.clipboardData.getData("text/plain"),v,C,u)},r.paste=_,r.moveTextAreaUnderMouseCursor=a,r.rightClickHandler=function(f,v,C,u,i){a(f,v,C),i&&u.rightClickSelect(f),v.value=u.selectionText,v.select()}},7239:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const h=o(1505);r.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(_,a,f){this._css.set(_,a,f)}getCss(_,a){return this._css.get(_,a)}setColor(_,a,f){this._color.set(_,a,f)}getColor(_,a){return this._color.get(_,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,h,_,a){o.addEventListener(h,_,a);let f=!1;return{dispose:()=>{f||(f=!0,o.removeEventListener(h,_,a))}}}},3551:function(R,r,o){var h=this&&this.__decorate||function(n,t,s,d){var b,m=arguments.length,y=m<3?t:d===null?d=Object.getOwnPropertyDescriptor(t,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,t,s,d);else for(var p=n.length-1;p>=0;p--)(b=n[p])&&(y=(m<3?b(y):m>3?b(t,s,y):b(t,s))||y);return m>3&&y&&Object.defineProperty(t,s,y),y},_=this&&this.__param||function(n,t){return function(s,d){t(s,d,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const a=o(3656),f=o(8460),v=o(844),C=o(2585),u=o(4725);let i=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(n,t,s,d,b){super(),this._element=n,this._mouseService=t,this._renderService=s,this._bufferService=d,this._linkProviderService=b,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)(()=>{var m;this._lastMouseEvent=void 0,(m=this._activeProviderReplies)==null||m.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(n){this._lastMouseEvent=n;const t=this._positionFromMouseEvent(n,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;const s=n.composedPath();for(let d=0;d<s.length;d++){const b=s[d];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(n){if(this._activeLine!==n.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(n,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,n)||(this._clearCurrentLink(),this._askForLink(n,!0))}_askForLink(n,t){var d,b;this._activeProviderReplies&&t||((d=this._activeProviderReplies)==null||d.forEach(m=>{m==null||m.forEach(y=>{y.link.dispose&&y.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=n.y);let s=!1;for(const[m,y]of this._linkProviderService.linkProviders.entries())t?(b=this._activeProviderReplies)!=null&&b.get(m)&&(s=this._checkLinkProviderResult(m,n,s)):y.provideLinks(n.y,p=>{var T,B;if(this._isMouseOut)return;const E=p==null?void 0:p.map(O=>({link:O}));(T=this._activeProviderReplies)==null||T.set(m,E),s=this._checkLinkProviderResult(m,n,s),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(n.y,this._activeProviderReplies)})}_removeIntersectingLinks(n,t){const s=new Set;for(let d=0;d<t.size;d++){const b=t.get(d);if(b)for(let m=0;m<b.length;m++){const y=b[m],p=y.link.range.start.y<n?0:y.link.range.start.x,E=y.link.range.end.y>n?this._bufferService.cols:y.link.range.end.x;for(let T=p;T<=E;T++){if(s.has(T)){b.splice(m--,1);break}s.add(T)}}}}_checkLinkProviderResult(n,t,s){var m;if(!this._activeProviderReplies)return s;const d=this._activeProviderReplies.get(n);let b=!1;for(let y=0;y<n;y++)this._activeProviderReplies.has(y)&&!this._activeProviderReplies.get(y)||(b=!0);if(!b&&d){const y=d.find(p=>this._linkAtPosition(p.link,t));y&&(s=!0,this._handleNewLink(y))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let y=0;y<this._activeProviderReplies.size;y++){const p=(m=this._activeProviderReplies.get(y))==null?void 0:m.find(E=>this._linkAtPosition(E.link,t));if(p){s=!0,this._handleNewLink(p);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(n){if(!this._currentLink)return;const t=this._positionFromMouseEvent(n,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(n,this._currentLink.link.text)}_clearCurrentLink(n,t){this._currentLink&&this._lastMouseEvent&&(!n||!t||this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(n){if(!this._lastMouseEvent)return;const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(n.link,t)&&(this._currentLink=n,this._currentLink.state={decorations:{underline:n.link.decorations===void 0||n.link.decorations.underline,pointerCursor:n.link.decorations===void 0||n.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,n.link,this._lastMouseEvent),n.link.decorations={},Object.defineProperties(n.link.decorations,{pointerCursor:{get:()=>{var s,d;return(d=(s=this._currentLink)==null?void 0:s.state)==null?void 0:d.decorations.pointerCursor},set:s=>{var d;(d=this._currentLink)!=null&&d.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,d;return(d=(s=this._currentLink)==null?void 0:s.state)==null?void 0:d.decorations.underline},set:s=>{var d,b,m;(d=this._currentLink)!=null&&d.state&&((m=(b=this._currentLink)==null?void 0:b.state)==null?void 0:m.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(n.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;const d=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(d,b),this._lastMouseEvent)){const m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._askForLink(m,!1)}})))}_linkHover(n,t,s){var d;(d=this._currentLink)!=null&&d.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&n.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(s,t.text)}_fireUnderlineEvent(n,t){const s=n.range,d=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-d-1,s.end.x,s.end.y-d-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(n,t,s){var d;(d=this._currentLink)!=null&&d.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&n.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(s,t.text)}_linkAtPosition(n,t){const s=n.range.start.y*this._bufferService.cols+n.range.start.x,d=n.range.end.y*this._bufferService.cols+n.range.end.x,b=t.y*this._bufferService.cols+t.x;return s<=b&&b<=d}_positionFromMouseEvent(n,t,s){const d=s.getCoords(n,t,this._bufferService.cols,this._bufferService.rows);if(d)return{x:d[0],y:d[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(n,t,s,d,b){return{x1:n,y1:t,x2:s,y2:d,cols:this._bufferService.cols,fg:b}}};r.Linkifier=i=h([_(1,u.IMouseService),_(2,u.IRenderService),_(3,C.IBufferService),_(4,u.ILinkProviderService)],i)},9042:(R,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(R,r,o){var h=this&&this.__decorate||function(u,i,n,t){var s,d=arguments.length,b=d<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,n):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,i,n,t);else for(var m=u.length-1;m>=0;m--)(s=u[m])&&(b=(d<3?s(b):d>3?s(i,n,b):s(i,n))||b);return d>3&&b&&Object.defineProperty(i,n,b),b},_=this&&this.__param||function(u,i){return function(n,t){i(n,t,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const a=o(511),f=o(2585);let v=r.OscLinkProvider=class{constructor(u,i,n){this._bufferService=u,this._optionsService=i,this._oscLinkService=n}provideLinks(u,i){var E;const n=this._bufferService.buffer.lines.get(u-1);if(!n)return void i(void 0);const t=[],s=this._optionsService.rawOptions.linkHandler,d=new a.CellData,b=n.getTrimmedLength();let m=-1,y=-1,p=!1;for(let T=0;T<b;T++)if(y!==-1||n.hasContent(T)){if(n.loadCell(T,d),d.hasExtendedAttrs()&&d.extended.urlId){if(y===-1){y=T,m=d.extended.urlId;continue}p=d.extended.urlId!==m}else y!==-1&&(p=!0);if(p||y!==-1&&T===b-1){const B=(E=this._oscLinkService.getLinkData(m))==null?void 0:E.uri;if(B){const O={start:{x:y+1,y:u},end:{x:T+(p||T!==b-1?0:1),y:u}};let D=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{const P=new URL(B);["http:","https:"].includes(P.protocol)||(D=!0)}catch{D=!0}D||t.push({text:B,range:O,activate:(P,N)=>s?s.activate(P,N,O):C(0,N),hover:(P,N)=>{var U;return(U=s==null?void 0:s.hover)==null?void 0:U.call(s,P,N,O)},leave:(P,N)=>{var U;return(U=s==null?void 0:s.leave)==null?void 0:U.call(s,P,N,O)}})}p=!1,d.hasExtendedAttrs()&&d.extended.urlId?(y=T,m=d.extended.urlId):(y=-1,m=-1)}}i(t)}};function C(u,i){if(confirm(`Do you want to navigate to ${i}?
4
+
5
+ WARNING: This link could potentially be dangerous`)){const n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=v=h([_(0,f.IBufferService),_(1,f.IOptionsService),_(2,f.IOscLinkService)],v)},6193:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,h){this._renderCallback=o,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,h,_){this._rowCount=_,o=o!==void 0?o:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const h=o(3614),_=o(3656),a=o(3551),f=o(9042),v=o(3730),C=o(1680),u=o(3107),i=o(5744),n=o(2950),t=o(1296),s=o(428),d=o(4269),b=o(5114),m=o(8934),y=o(3230),p=o(9312),E=o(4725),T=o(6731),B=o(8055),O=o(8969),D=o(8460),P=o(844),N=o(6114),U=o(8437),G=o(2584),$=o(7399),x=o(5941),L=o(9074),A=o(2585),M=o(5435),F=o(4567),z=o(779);class J extends O.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=N,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new P.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(z.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((k,W)=>this.refresh(k,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(k=>this._reportWindowsOptions(k))),this.register(this._inputHandler.onColor(k=>this._handleColorEvent(k))),this.register((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(k=>this._afterResize(k.cols,k.rows))),this.register((0,P.toDisposable)(()=>{var k,W;this._customKeyEventHandler=void 0,(W=(k=this.element)==null?void 0:k.parentNode)==null||W.removeChild(this.element)}))}_handleColorEvent(I){if(this._themeService)for(const k of I){let W,H="";switch(k.index){case 256:W="foreground",H="10";break;case 257:W="background",H="11";break;case 258:W="cursor",H="12";break;default:W="ansi",H="4;"+k.index}switch(k.type){case 0:const Z=B.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[k.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${H};${(0,x.toRgbString)(Z)}${G.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(q=>q.ansi[k.index]=B.channels.toColor(...k.color));else{const q=W;this._themeService.modifyColors(ie=>ie[q]=B.channels.toColor(...k.color))}break;case 2:this._themeService.restoreColor(k.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(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(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var I;return(I=this.textarea)==null?void 0:I.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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,k=this.buffer.lines.get(I);if(!k)return;const W=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Z=k.getWidth(W),q=this._renderService.dimensions.css.cell.width*Z,ie=this.buffer.y*this._renderService.dimensions.css.cell.height,ce=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ce+"px",this.textarea.style.top=ie+"px",this.textarea.style.width=q+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",k=>{this.hasSelection()&&(0,h.copyHandler)(k,this._selectionService)}));const I=k=>(0,h.handlePasteEvent)(k,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,_.addDisposableDomListener)(this.element,"paste",I)),N.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",k=>{k.button===2&&(0,h.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",k=>{(0,h.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),N.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",k=>{k.button===1&&(0,h.moveTextAreaUnderMouseCursor)(k,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){var W;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"),((W=this.element)==null?void 0:W.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 k=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),k.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),k.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),N.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(b.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(s.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.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(y.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(n.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(m.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(k);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.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(i.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const I=this,k=this.element;function W(q){const ie=I._mouseService.getMouseReportCoords(q,I.screenElement);if(!ie)return!1;let ce,he;switch(q.overrideType||q.type){case"mousemove":he=32,q.buttons===void 0?(ce=3,q.button!==void 0&&(ce=q.button<3?q.button:3)):ce=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":he=0,ce=q.button<3?q.button:3;break;case"mousedown":he=1,ce=q.button<3?q.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(q)===!1||I.viewport.getLinesScrolled(q)===0)return!1;he=q.deltaY<0?0:1,ce=4;break;default:return!1}return!(he===void 0||ce===void 0||ce>4)&&I.coreMouseService.triggerMouseEvent({col:ie.col,row:ie.row,x:ie.x,y:ie.y,button:ce,action:he,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Z={mouseup:q=>(W(q),q.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(q)),wheel:q=>(W(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&W(q)},mousemove:q=>{q.buttons||W(q)}};this.register(this.coreMouseService.onProtocolChange(q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&q?H.mousemove||(k.addEventListener("mousemove",Z.mousemove),H.mousemove=Z.mousemove):(k.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&q?H.wheel||(k.addEventListener("wheel",Z.wheel,{passive:!1}),H.wheel=Z.wheel):(k.removeEventListener("wheel",H.wheel),H.wheel=null),2&q?H.mouseup||(H.mouseup=Z.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&q?H.mousedrag||(H.mousedrag=Z.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(k,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return W(q),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(q)})),this.register((0,_.addDisposableDomListener)(k,"wheel",q=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const ie=this.viewport.getLinesScrolled(q);if(ie===0)return;const ce=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let he="";for(let ue=0;ue<Math.abs(ie);ue++)he+=ce;return this.coreService.triggerDataEvent(he,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(k,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,_.addDisposableDomListener)(k,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(I,k){var W;(W=this._renderService)==null||W.refreshRows(I,k)}updateCursorStyle(I){var k;(k=this._selectionService)!=null&&k.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,k,W=0){var H;W===1?(super.scrollLines(I,k,W),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(I)}paste(I){(0,h.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 k=this._characterJoinerService.register(I);return this.refresh(0,this.rows-1),k}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,k,W){this._selectionService.setSelection(I,k,W)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var I;(I=this._selectionService)==null||I.clearSelection()}selectAll(){var I;(I=this._selectionService)==null||I.selectAll()}selectLines(I,k){var W;(W=this._selectionService)==null||W.selectLines(I,k)}_keyDown(I){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;const k=this.browser.isMac&&this.options.macOptionIsMeta&&I.altKey;if(!k&&!this._compositionHelper.keydown(I))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;k||I.key!=="Dead"&&I.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,$.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),W.type===3||W.type===2){const H=this.rows-1;return this.scrollLines(W.type===2?-H:H),this.cancel(I,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,I)||(W.cancel&&this.cancel(I,!0),!W.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):(W.key!==G.C0.ETX&&W.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||I.altKey||I.ctrlKey?this.cancel(I,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(I,k){const W=I.isMac&&!this.options.macOptionIsMeta&&k.altKey&&!k.ctrlKey&&!k.metaKey||I.isWindows&&k.altKey&&k.ctrlKey&&!k.metaKey||I.isWindows&&k.getModifierState("AltGraph");return k.type==="keypress"?W:W&&(!k.keyCode||k.keyCode>47)}_keyUp(I){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1||(function(k){return k.keyCode===16||k.keyCode===17||k.keyCode===18}(I)||this.focus(),this.updateCursorStyle(I),this._keyPressHandled=!1)}_keyPress(I){let k;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;if(this.cancel(I),I.charCode)k=I.charCode;else if(I.which===null||I.which===void 0)k=I.keyCode;else{if(I.which===0||I.charCode===0)return!1;k=I.which}return!(!k||(I.altKey||I.ctrlKey||I.metaKey)&&!this._isThirdLevelShift(this.browser,I)||(k=String.fromCharCode(k),this._onKey.fire({key:k,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(k,!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 k=I.data;return this.coreService.triggerDataEvent(k,!0),this.cancel(I),!0}return!1}resize(I,k){I!==this.cols||k!==this.rows?super.resize(I,k):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(I,k){var W,H;(W=this._charSizeService)==null||W.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var I;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 k=1;k<this.rows;k++)this.buffer.lines.push(this.buffer.getBlankLine(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(I=this.viewport)==null||I.reset(),this.refresh(0,this.rows-1)}}reset(){var k,W;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(k=this._selectionService)==null||k.reset(),this._decorationService.reset(),(W=this.viewport)==null||W.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var I;(I=this._renderService)==null||I.clearTextureAtlas()}_reportFocus(){var I;(I=this.element)!=null&&I.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case M.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const k=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${W};${k}t`);break;case M.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${Z};${H}t`)}}cancel(I,k){if(this.options.cancelEvents||k)return I.preventDefault(),I.stopPropagation(),!1}}r.Terminal=J},9924:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,h=1e3){this._renderCallback=o,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,h,_){this._rowCount=_,o=o!==void 0?o:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=a-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 o=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,h)}}},1680:function(R,r,o){var h=this&&this.__decorate||function(n,t,s,d){var b,m=arguments.length,y=m<3?t:d===null?d=Object.getOwnPropertyDescriptor(t,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,t,s,d);else for(var p=n.length-1;p>=0;p--)(b=n[p])&&(y=(m<3?b(y):m>3?b(t,s,y):b(t,s))||y);return m>3&&y&&Object.defineProperty(t,s,y),y},_=this&&this.__param||function(n,t){return function(s,d){t(s,d,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const a=o(3656),f=o(4725),v=o(8460),C=o(844),u=o(2585);let i=r.Viewport=class extends C.Disposable{constructor(n,t,s,d,b,m,y,p){super(),this._viewportElement=n,this._scrollArea=t,this._bufferService=s,this._optionsService=d,this._charSizeService=b,this._renderService=m,this._coreBrowserService=y,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,a.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(n){this._viewportElement.style.backgroundColor=n.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(n){if(n)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 t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const n=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==n&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=n),this._refreshAnimationFrame=null}syncScrollArea(n=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(n);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(n)}_handleScroll(n){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const n=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(n*(this._smoothScrollState.target-this._smoothScrollState.origin)),n<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(n,t){const s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&s<this._lastRecordedBufferHeight)||(n.cancelable&&n.preventDefault(),!1)}handleWheel(n){const t=this._getPixelsScrolled(n);return t!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(n,t))}scrollLines(n){if(n!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const t=n*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:n,suppressScrollEvent:!1})}_getPixelsScrolled(n){if(n.deltaY===0||n.shiftKey)return 0;let t=this._applyScrollModifier(n.deltaY,n);return n.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(n,t){var p;let s,d="";const b=[],m=t??this._bufferService.buffer.lines.length,y=this._bufferService.buffer.lines;for(let E=n;E<m;E++){const T=y.get(E);if(!T)continue;const B=(p=y.get(E+1))==null?void 0:p.isWrapped;if(d+=T.translateToString(!B),!B||E===y.length-1){const O=document.createElement("div");O.textContent=d,b.push(O),d.length>0&&(s=O),d=""}}return{bufferElements:b,cursorElement:s}}getLinesScrolled(n){if(n.deltaY===0||n.shiftKey)return 0;let t=this._applyScrollModifier(n.deltaY,n);return n.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(n,t){const s=this._optionsService.rawOptions.fastScrollModifier;return s==="alt"&&t.altKey||s==="ctrl"&&t.ctrlKey||s==="shift"&&t.shiftKey?n*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:n*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(n){this._lastTouchY=n.touches[0].pageY}handleTouchMove(n){const t=this._lastTouchY-n.touches[0].pageY;return this._lastTouchY=n.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(n,t))}};r.Viewport=i=h([_(2,u.IBufferService),_(3,u.IOptionsService),_(4,f.ICharSizeService),_(5,f.IRenderService),_(6,f.ICoreBrowserService),_(7,f.IThemeService)],i)},3107:function(R,r,o){var h=this&&this.__decorate||function(u,i,n,t){var s,d=arguments.length,b=d<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,n):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,i,n,t);else for(var m=u.length-1;m>=0;m--)(s=u[m])&&(b=(d<3?s(b):d>3?s(i,n,b):s(i,n))||b);return d>3&&b&&Object.defineProperty(i,n,b),b},_=this&&this.__param||function(u,i){return function(n,t){i(n,t,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const a=o(4725),f=o(844),v=o(2585);let C=r.BufferDecorationRenderer=class extends f.Disposable{constructor(u,i,n,t,s){super(),this._screenElement=u,this._bufferService=i,this._coreBrowserService=n,this._decorationService=t,this._renderService=s,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){var t;const i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((t=u==null?void 0:u.options)==null?void 0:t.layer)==="top"),i.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const n=u.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(u,i),i}_refreshStyle(u){const i=u.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let n=this._decorationElements.get(u);n||(n=this._createElement(u),u.element=n,this._decorationElements.set(u,n),this._container.appendChild(n),u.onDispose(()=>{this._decorationElements.delete(u),n.remove()})),n.style.top=i*this._renderService.dimensions.css.cell.height+"px",n.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(n)}}_refreshXPosition(u,i=u.element){if(!i)return;const n=u.options.x??0;(u.options.anchor||"left")==="right"?i.style.right=n?n*this._renderService.dimensions.css.cell.width+"px":"":i.style.left=n?n*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){var i;(i=this._decorationElements.get(u))==null||i.remove(),this._decorationElements.delete(u),u.dispose()}};r.BufferDecorationRenderer=C=h([_(1,v.IBufferService),_(2,a.ICoreBrowserService),_(3,v.IDecorationService),_(4,a.IRenderService)],C)},5871:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const h of this._zones)if(h.color===o.options.overviewRulerOptions.color&&h.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,o.marker.line))return;if(this._lineAdjacentToZone(h,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(h,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,h){return h>=o.startBufferLine&&h<=o.endBufferLine}_lineAdjacentToZone(o,h,_){return h>=o.startBufferLine-this._linePadding[_||"full"]&&h<=o.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(o,h){o.startBufferLine=Math.min(o.startBufferLine,h),o.endBufferLine=Math.max(o.endBufferLine,h)}}},5744:function(R,r,o){var h=this&&this.__decorate||function(s,d,b,m){var y,p=arguments.length,E=p<3?d:m===null?m=Object.getOwnPropertyDescriptor(d,b):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(s,d,b,m);else for(var T=s.length-1;T>=0;T--)(y=s[T])&&(E=(p<3?y(E):p>3?y(d,b,E):y(d,b))||E);return p>3&&E&&Object.defineProperty(d,b,E),E},_=this&&this.__param||function(s,d){return function(b,m){d(b,m,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const a=o(5871),f=o(4725),v=o(844),C=o(2585),u={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0};let t=r.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(s,d,b,m,y,p,E){var B;super(),this._viewportElement=s,this._screenElement=d,this._bufferService=b,this._decorationService=m,this._renderService=y,this._optionsService=p,this._coreBrowserService=E,this._colorZoneStore=new a.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(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)(()=>{var O;(O=this._canvas)==null||O.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 s=Math.floor(this._canvas.width/3),d=Math.ceil(this._canvas.width/3);i.full=this._canvas.width,i.left=s,i.center=d,i.right=s,this._refreshDrawHeightConstants(),n.full=0,n.left=0,n.center=i.left,n.right=i.left+i.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowserService.dpr);const s=this._canvas.height/this._bufferService.buffer.lines.length,d=Math.round(Math.max(Math.min(s,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 s=this._colorZoneStore.zones;for(const d of s)d.position!=="full"&&this._renderColorZone(d);for(const d of s)d.position==="full"&&this._renderColorZone(d);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(s){this._ctx.fillStyle=s.color,this._ctx.fillRect(n[s.position||"full"],Math.round((this._canvas.height-1)*(s.startBufferLine/this._bufferService.buffers.active.lines.length)-u[s.position||"full"]/2),i[s.position||"full"],Math.round((this._canvas.height-1)*((s.endBufferLine-s.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[s.position||"full"]))}_queueRefresh(s,d){this._shouldUpdateDimensions=s||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=t=h([_(2,C.IBufferService),_(3,C.IDecorationService),_(4,f.IRenderService),_(5,C.IOptionsService),_(6,f.ICoreBrowserService)],t)},2950:function(R,r,o){var h=this&&this.__decorate||function(u,i,n,t){var s,d=arguments.length,b=d<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,n):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,i,n,t);else for(var m=u.length-1;m>=0;m--)(s=u[m])&&(b=(d<3?s(b):d>3?s(i,n,b):s(i,n))||b);return d>3&&b&&Object.defineProperty(i,n,b),b},_=this&&this.__param||function(u,i){return function(n,t){i(n,t,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const a=o(4725),f=o(2585),v=o(2584);let C=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(u,i,n,t,s,d){this._textarea=u,this._compositionView=i,this._bufferService=n,this._optionsService=t,this._coreService=s,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 i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let n;this._isSendingComposition=!1,i.start+=this._dataAlreadySent.length,n=this._isComposing?this._textarea.value.substring(i.start,i.end):this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;const i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){const u=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const i=this._textarea.value,n=i.replace(u,"");this._dataAlreadySent=n,i.length>u.length?this._coreService.triggerDataEvent(n,!0):i.length<u.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):i.length===u.length&&i!==u&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(u){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,t=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=t+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"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=s+"px",this._textarea.style.top=t+"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=C=h([_(2,f.IBufferService),_(3,f.IOptionsService),_(4,f.ICoreService),_(5,a.IRenderService)],C)},9806:(R,r)=>{function o(h,_,a){const f=a.getBoundingClientRect(),v=h.getComputedStyle(a),C=parseInt(v.getPropertyValue("padding-left")),u=parseInt(v.getPropertyValue("padding-top"));return[_.clientX-f.left-C,_.clientY-f.top-u]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=o,r.getCoords=function(h,_,a,f,v,C,u,i,n){if(!C)return;const t=o(h,_,a);return t?(t[0]=Math.ceil((t[0]+(n?u/2:0))/u),t[1]=Math.ceil(t[1]/i),t[0]=Math.min(Math.max(t[0],1),f+(n?1:0)),t[1]=Math.min(Math.max(t[1],1),v),t):void 0}},9504:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const h=o(2584);function _(i,n,t,s){const d=i-a(i,t),b=n-a(n,t),m=Math.abs(d-b)-function(y,p,E){let T=0;const B=y-a(y,E),O=p-a(p,E);for(let D=0;D<Math.abs(B-O);D++){const P=f(y,p)==="A"?-1:1,N=E.buffer.lines.get(B+P*D);N!=null&&N.isWrapped&&T++}return T}(i,n,t);return u(m,C(f(i,n),s))}function a(i,n){let t=0,s=n.buffer.lines.get(i),d=s==null?void 0:s.isWrapped;for(;d&&i>=0&&i<n.rows;)t++,s=n.buffer.lines.get(--i),d=s==null?void 0:s.isWrapped;return t}function f(i,n){return i>n?"A":"B"}function v(i,n,t,s,d,b){let m=i,y=n,p="";for(;m!==t||y!==s;)m+=d?1:-1,d&&m>b.cols-1?(p+=b.buffer.translateBufferLineToString(y,!1,i,m),m=0,i=0,y++):!d&&m<0&&(p+=b.buffer.translateBufferLineToString(y,!1,0,i+1),m=b.cols-1,i=m,y--);return p+b.buffer.translateBufferLineToString(y,!1,i,m)}function C(i,n){const t=n?"O":"[";return h.C0.ESC+t+i}function u(i,n){i=Math.floor(i);let t="";for(let s=0;s<i;s++)t+=n;return t}r.moveToCellSequence=function(i,n,t,s){const d=t.buffer.x,b=t.buffer.y;if(!t.buffer.hasScrollback)return function(p,E,T,B,O,D){return _(E,B,O,D).length===0?"":u(v(p,E,p,E-a(E,O),!1,O).length,C("D",D))}(d,b,0,n,t,s)+_(b,n,t,s)+function(p,E,T,B,O,D){let P;P=_(E,B,O,D).length>0?B-a(B,O):E;const N=B,U=function(G,$,x,L,A,M){let F;return F=_(x,L,A,M).length>0?L-a(L,A):$,G<x&&F<=L||G>=x&&F<L?"C":"D"}(p,E,T,B,O,D);return u(v(p,P,T,N,U==="C",O).length,C(U,D))}(d,b,i,n,t,s);let m;if(b===n)return m=d>i?"D":"C",u(Math.abs(d-i),C(m,s));m=b>n?"D":"C";const y=Math.abs(b-n);return u(function(p,E){return E.cols-p}(b>n?i:d,t)+(y-1)*t.cols+1+((b>n?d:i)-1),C(m,s))}},1296:function(R,r,o){var h=this&&this.__decorate||function(D,P,N,U){var G,$=arguments.length,x=$<3?P:U===null?U=Object.getOwnPropertyDescriptor(P,N):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(D,P,N,U);else for(var L=D.length-1;L>=0;L--)(G=D[L])&&(x=($<3?G(x):$>3?G(P,N,x):G(P,N))||x);return $>3&&x&&Object.defineProperty(P,N,x),x},_=this&&this.__param||function(D,P){return function(N,U){P(N,U,D)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const a=o(3787),f=o(2550),v=o(2223),C=o(6171),u=o(6052),i=o(4725),n=o(8055),t=o(8460),s=o(844),d=o(2585),b="xterm-dom-renderer-owner-",m="xterm-rows",y="xterm-fg-",p="xterm-bg-",E="xterm-focus",T="xterm-selection";let B=1,O=r.DomRenderer=class extends s.Disposable{constructor(D,P,N,U,G,$,x,L,A,M,F,z,J){super(),this._terminal=D,this._document=P,this._element=N,this._screenElement=U,this._viewportElement=G,this._helperContainer=$,this._linkifier2=x,this._charSizeService=A,this._optionsService=M,this._bufferService=F,this._coreBrowserService=z,this._themeService=J,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,u.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new t.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(m),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(ee=>this._injectCss(ee))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(ee=>this._handleLinkHover(ee))),this.register(this._linkifier2.onHideLinkUnderline(ee=>this._handleLinkLeave(ee))),this.register((0,s.toDisposable)(()=>{this._element.classList.remove(b+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 N of this._rowElements)N.style.width=`${this.dimensions.css.canvas.width}px`,N.style.height=`${this.dimensions.css.cell.height}px`,N.style.lineHeight=`${this.dimensions.css.cell.height}px`,N.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const P=`${this._terminalSelector} .${m} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=P,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 P=`${this._terminalSelector} .${m} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;P+=`${this._terminalSelector} .${m} .xterm-dim { color: ${n.color.multiplyOpacity(D.foreground,.5).css};}`,P+=`${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 N=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;P+=`@keyframes ${N} { 50% { border-bottom-style: hidden; }}`,P+=`@keyframes ${U} { 50% { box-shadow: none; }}`,P+=`@keyframes ${G} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,P+=`${this._terminalSelector} .${m}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${N} 1s step-end infinite;}${this._terminalSelector} .${m}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${m}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,P+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[$,x]of D.ansi.entries())P+=`${this._terminalSelector} .${y}${$} { color: ${x.css}; }${this._terminalSelector} .${y}${$}.xterm-dim { color: ${n.color.multiplyOpacity(x,.5).css}; }${this._terminalSelector} .${p}${$} { background-color: ${x.css}; }`;P+=`${this._terminalSelector} .${y}${v.INVERTED_DEFAULT_COLOR} { color: ${n.color.opaque(D.background).css}; }${this._terminalSelector} .${y}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${n.color.multiplyOpacity(n.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${p}${v.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=P}_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,P){for(let N=this._rowElements.length;N<=P;N++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>P;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,P){this._refreshRowElements(D,P),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,P,N){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,P,N),this.renderRows(0,this._bufferService.rows-1),!D||!P)return;this._selectionRenderModel.update(this._terminal,D,P,N);const U=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,$=this._selectionRenderModel.viewportCappedStartRow,x=this._selectionRenderModel.viewportCappedEndRow;if($>=this._bufferService.rows||x<0)return;const L=this._document.createDocumentFragment();if(N){const A=D[0]>P[0];L.appendChild(this._createSelectionElement($,A?P[0]:D[0],A?D[0]:P[0],x-$+1))}else{const A=U===$?D[0]:0,M=$===G?P[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement($,A,M));const F=x-$-1;if(L.appendChild(this._createSelectionElement($+1,0,this._bufferService.cols,F)),$!==x){const z=G===x?P[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(x,0,z))}}this._selectionContainer.appendChild(L)}_createSelectionElement(D,P,N,U=1){const G=this._document.createElement("div"),$=P*this.dimensions.css.cell.width;let x=this.dimensions.css.cell.width*(N-P);return $+x>this.dimensions.css.canvas.width&&(x=this.dimensions.css.canvas.width-$),G.style.height=U*this.dimensions.css.cell.height+"px",G.style.top=D*this.dimensions.css.cell.height+"px",G.style.left=`${$}px`,G.style.width=`${x}px`,G}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,P){const N=this._bufferService.buffer,U=N.ybase+N.y,G=Math.min(N.x,this._bufferService.cols-1),$=this._optionsService.rawOptions.cursorBlink,x=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=D;A<=P;A++){const M=A+N.ydisp,F=this._rowElements[A],z=N.lines.get(M);if(!F||!z)break;F.replaceChildren(...this._rowFactory.createRow(z,M,M===U,x,L,G,$,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${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,P,N,U,G,$){N<0&&(D=0),U<0&&(P=0);const x=this._bufferService.rows-1;N=Math.max(Math.min(N,x),0),U=Math.max(Math.min(U,x),0),G=Math.min(G,this._bufferService.cols);const L=this._bufferService.buffer,A=L.ybase+L.y,M=Math.min(L.x,G-1),F=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=N;ee<=U;++ee){const I=ee+L.ydisp,k=this._rowElements[ee],W=L.lines.get(I);if(!k||!W)break;k.replaceChildren(...this._rowFactory.createRow(W,I,I===A,z,J,M,F,this.dimensions.css.cell.width,this._widthCache,$?ee===N?D:0:-1,$?(ee===U?P:G)-1:-1))}}};r.DomRenderer=O=h([_(7,d.IInstantiationService),_(8,i.ICharSizeService),_(9,d.IOptionsService),_(10,d.IBufferService),_(11,i.ICoreBrowserService),_(12,i.IThemeService)],O)},3787:function(R,r,o){var h=this&&this.__decorate||function(m,y,p,E){var T,B=arguments.length,O=B<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,p):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(m,y,p,E);else for(var D=m.length-1;D>=0;D--)(T=m[D])&&(O=(B<3?T(O):B>3?T(y,p,O):T(y,p))||O);return B>3&&O&&Object.defineProperty(y,p,O),O},_=this&&this.__param||function(m,y){return function(p,E){y(p,E,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const a=o(2223),f=o(643),v=o(511),C=o(2585),u=o(8055),i=o(4725),n=o(4269),t=o(6171),s=o(3734);let d=r.DomRendererRowFactory=class{constructor(m,y,p,E,T,B,O){this._document=m,this._characterJoinerService=y,this._optionsService=p,this._coreBrowserService=E,this._coreService=T,this._decorationService=B,this._themeService=O,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(m,y,p){this._selectionStart=m,this._selectionEnd=y,this._columnSelectMode=p}createRow(m,y,p,E,T,B,O,D,P,N,U){const G=[],$=this._characterJoinerService.getJoinedCharacters(y),x=this._themeService.colors;let L,A=m.getNoBgTrimmedLength();p&&A<B+1&&(A=B+1);let M=0,F="",z=0,J=0,ee=0,I=!1,k=0,W=!1,H=0;const Z=[],q=N!==-1&&U!==-1;for(let ie=0;ie<A;ie++){m.loadCell(ie,this._workCell);let ce=this._workCell.getWidth();if(ce===0)continue;let he=!1,ue=ie,te=this._workCell;if($.length>0&&ie===$[0][0]){he=!0;const oe=$.shift();te=new n.JoinedCellData(this._workCell,m.translateToString(!0,oe[0],oe[1]),oe[1]-oe[0]),ue=oe[1]-1,ce=te.getWidth()}const Ue=this._isCellInSelection(ie,y),wt=p&&ie===B,Et=q&&ie>=N&&ie<=U;let xt=!1;this._decorationService.forEachDecorationAtCell(ie,y,void 0,oe=>{xt=!0});let dt=te.getChars()||f.WHITESPACE_CELL_CHAR;if(dt===" "&&(te.isUnderline()||te.isOverline())&&(dt=" "),H=ce*D-P.get(dt,te.isBold(),te.isItalic()),L){if(M&&(Ue&&W||!Ue&&!W&&te.bg===z)&&(Ue&&W&&x.selectionForeground||te.fg===J)&&te.extended.ext===ee&&Et===I&&H===k&&!wt&&!he&&!xt){te.isInvisible()?F+=f.WHITESPACE_CELL_CHAR:F+=dt,M++;continue}M&&(L.textContent=F),L=this._document.createElement("span"),M=0,F=""}else L=this._document.createElement("span");if(z=te.bg,J=te.fg,ee=te.extended.ext,I=Et,k=H,W=Ue,he&&B>=ie&&B<=ue&&(B=ie),!this._coreService.isCursorHidden&&wt&&this._coreService.isCursorInitialized){if(Z.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&Z.push("xterm-cursor-blink"),Z.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Z.push("xterm-cursor-outline");break;case"block":Z.push("xterm-cursor-block");break;case"bar":Z.push("xterm-cursor-bar");break;case"underline":Z.push("xterm-cursor-underline")}}if(te.isBold()&&Z.push("xterm-bold"),te.isItalic()&&Z.push("xterm-italic"),te.isDim()&&Z.push("xterm-dim"),F=te.isInvisible()?f.WHITESPACE_CELL_CHAR:te.getChars()||f.WHITESPACE_CELL_CHAR,te.isUnderline()&&(Z.push(`xterm-underline-${te.extended.underlineStyle}`),F===" "&&(F=" "),!te.isUnderlineColorDefault()))if(te.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(te.getUnderlineColor()).join(",")})`;else{let oe=te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&te.isBold()&&oe<8&&(oe+=8),L.style.textDecorationColor=x.ansi[oe].css}te.isOverline()&&(Z.push("xterm-overline"),F===" "&&(F=" ")),te.isStrikethrough()&&Z.push("xterm-strikethrough"),Et&&(L.style.textDecoration="underline");let _e=te.getFgColor(),$e=te.getFgColorMode(),be=te.getBgColor(),ze=te.getBgColorMode();const kt=!!te.isInverse();if(kt){const oe=_e;_e=be,be=oe;const vr=$e;$e=ze,ze=vr}let xe,ut,ke,qe=!1;switch(this._decorationService.forEachDecorationAtCell(ie,y,void 0,oe=>{oe.options.layer!=="top"&&qe||(oe.backgroundColorRGB&&(ze=50331648,be=oe.backgroundColorRGB.rgba>>8&16777215,xe=oe.backgroundColorRGB),oe.foregroundColorRGB&&($e=50331648,_e=oe.foregroundColorRGB.rgba>>8&16777215,ut=oe.foregroundColorRGB),qe=oe.options.layer==="top")}),!qe&&Ue&&(xe=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,be=xe.rgba>>8&16777215,ze=50331648,qe=!0,x.selectionForeground&&($e=50331648,_e=x.selectionForeground.rgba>>8&16777215,ut=x.selectionForeground)),qe&&Z.push("xterm-decoration-top"),ze){case 16777216:case 33554432:ke=x.ansi[be],Z.push(`xterm-bg-${be}`);break;case 50331648:ke=u.channels.toColor(be>>16,be>>8&255,255&be),this._addStyle(L,`background-color:#${b((be>>>0).toString(16),"0",6)}`);break;default:kt?(ke=x.foreground,Z.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):ke=x.background}switch(xe||te.isDim()&&(xe=u.color.multiplyOpacity(ke,.5)),$e){case 16777216:case 33554432:te.isBold()&&_e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(_e+=8),this._applyMinimumContrast(L,ke,x.ansi[_e],te,xe,void 0)||Z.push(`xterm-fg-${_e}`);break;case 50331648:const oe=u.channels.toColor(_e>>16&255,_e>>8&255,255&_e);this._applyMinimumContrast(L,ke,oe,te,xe,ut)||this._addStyle(L,`color:#${b(_e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,ke,x.foreground,te,xe,ut)||kt&&Z.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}Z.length&&(L.className=Z.join(" "),Z.length=0),wt||he||xt?L.textContent=F:M++,H!==this.defaultSpacing&&(L.style.letterSpacing=`${H}px`),G.push(L),ie=ue}return L&&M&&(L.textContent=F),G}_applyMinimumContrast(m,y,p,E,T,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,t.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const O=this._getContrastCache(E);let D;if(T||B||(D=O.getColor(y.rgba,p.rgba)),D===void 0){const P=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);D=u.color.ensureContrastRatio(T||y,B||p,P),O.setColor((T||y).rgba,(B||p).rgba,D??null)}return!!D&&(this._addStyle(m,`color:${D.css}`),!0)}_getContrastCache(m){return m.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(m,y){m.setAttribute("style",`${m.getAttribute("style")||""}${y};`)}_isCellInSelection(m,y){const p=this._selectionStart,E=this._selectionEnd;return!(!p||!E)&&(this._columnSelectMode?p[0]<=E[0]?m>=p[0]&&y>=p[1]&&m<E[0]&&y<=E[1]:m<p[0]&&y>=p[1]&&m>=E[0]&&y<=E[1]:y>p[1]&&y<E[1]||p[1]===E[1]&&y===p[1]&&m>=p[0]&&m<E[0]||p[1]<E[1]&&y===E[1]&&m<E[0]||p[1]<E[1]&&y===p[1]&&m>=p[0])}};function b(m,y,p){for(;m.length<p;)m=y+m;return m}r.DomRendererRowFactory=d=h([_(1,i.ICharacterJoinerService),_(2,C.IOptionsService),_(3,i.ICoreBrowserService),_(4,C.ICoreService),_(5,C.IDecorationService),_(6,i.IThemeService)],d)},2550:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(o,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=o.createElement("span");_.classList.add("xterm-char-measure-element");const a=o.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const f=o.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";const v=o.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[_,a,f,v],this._container.appendChild(_),this._container.appendChild(a),this._container.appendChild(f),this._container.appendChild(v),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,h,_,a){o===this._font&&h===this._fontSize&&_===this._weight&&a===this._weightBold||(this._font=o,this._fontSize=h,this._weight=_,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(o,h,_){let a=0;if(!h&&!_&&o.length===1&&(a=o.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const C=this._measure(o,0);return C>0&&(this._flat[a]=C),C}let f=o;h&&(f+="B"),_&&(f+="I");let v=this._holey.get(f);if(v===void 0){let C=0;h&&(C|=1),_&&(C|=2),v=this._measure(o,C),v>0&&this._holey.set(f,v)}return v}_measure(o,h){const _=this._measureElements[h];return _.textContent=o.repeat(32),_.offsetWidth/32}}},2223:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const h=o(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(R,r)=>{function o(_){return 57508<=_&&_<=57558}function h(_){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=o,r.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},r.isEmoji=h,r.allowRescaling=function(_,a,f,v){return a===1&&f>Math.ceil(1.5*v)&&_!==void 0&&_>255&&!h(_)&&!o(_)&&!function(C){return 57344<=C&&C<=63743}(_)},r.treatGlyphAsBackgroundColor=function(_){return o(_)||function(a){return 9472<=a&&a<=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(_,a,f=0){return(_-(2*Math.round(a)-f))%(2*Math.round(a))}},6052:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,a,f,v=!1){if(this.selectionStart=a,this.selectionEnd=f,!a||!f||a[0]===f[0]&&a[1]===f[1])return void this.clear();const C=_.buffers.active.ydisp,u=a[1]-C,i=f[1]-C,n=Math.max(u,0),t=Math.min(i,_.rows-1);n>=_.rows||t<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=u,this.viewportEndRow=i,this.viewportCappedStartRow=n,this.viewportCappedEndRow=t,this.startCol=a[0],this.endCol=f[0])}isCellSelected(_,a,f){return!!this.hasSelection&&(f-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&f>=this.viewportCappedStartRow&&a<this.endCol&&f<=this.viewportCappedEndRow:a<this.startCol&&f>=this.viewportCappedStartRow&&a>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&a>=this.startCol)}}r.createSelectionRenderModel=function(){return new o}},456:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,h=this.selectionEnd;return!(!o||!h)&&(o[1]>h[1]||o[1]===h[1]&&o[0]>h[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(R,r,o){var h=this&&this.__decorate||function(t,s,d,b){var m,y=arguments.length,p=y<3?s:b===null?b=Object.getOwnPropertyDescriptor(s,d):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,d,b);else for(var E=t.length-1;E>=0;E--)(m=t[E])&&(p=(y<3?m(p):y>3?m(s,d,p):m(s,d))||p);return y>3&&p&&Object.defineProperty(s,d,p),p},_=this&&this.__param||function(t,s){return function(d,b){s(d,b,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const a=o(2585),f=o(8460),v=o(844);let C=r.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(t,s,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 n(this._optionsService))}catch{this._measureStrategy=this.register(new i(t,s,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const t=this._measureStrategy.measure();t.width===this.width&&t.height===this.height||(this.width=t.width,this.height=t.height,this._onCharSizeChange.fire())}};r.CharSizeService=C=h([_(2,a.IOptionsService)],C);class u extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(s,d){s!==void 0&&s>0&&d!==void 0&&d>0&&(this._result.width=s,this._result.height=d)}}class i extends u{constructor(s,d,b){super(),this._document=s,this._parentElement=d,this._optionsService=b,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 n extends u{constructor(s){super(),this._optionsService=s,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 s=this._ctx.measureText("W");return this._validateAndSet(s.width,s.fontBoundingBoxAscent+s.fontBoundingBoxDescent),this._result}}},4269:function(R,r,o){var h=this&&this.__decorate||function(n,t,s,d){var b,m=arguments.length,y=m<3?t:d===null?d=Object.getOwnPropertyDescriptor(t,s):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(n,t,s,d);else for(var p=n.length-1;p>=0;p--)(b=n[p])&&(y=(m<3?b(y):m>3?b(t,s,y):b(t,s))||y);return m>3&&y&&Object.defineProperty(t,s,y),y},_=this&&this.__param||function(n,t){return function(s,d){t(s,d,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const a=o(3734),f=o(643),v=o(511),C=o(2585);class u extends a.AttributeData{constructor(t,s,d){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=s,this._width=d}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=u;let i=r.CharacterJoinerService=class nr{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(t){const s={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(s),s.id}deregister(t){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===t)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(t);if(!s||s.length===0)return[];const d=[],b=s.translateToString(!0);let m=0,y=0,p=0,E=s.getFg(0),T=s.getBg(0);for(let B=0;B<s.getTrimmedLength();B++)if(s.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==T){if(B-m>1){const O=this._getJoinedRanges(b,p,y,s,m);for(let D=0;D<O.length;D++)d.push(O[D])}m=B,p=y,E=this._workCell.fg,T=this._workCell.bg}y+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-m>1){const B=this._getJoinedRanges(b,p,y,s,m);for(let O=0;O<B.length;O++)d.push(B[O])}return d}_getJoinedRanges(t,s,d,b,m){const y=t.substring(s,d);let p=[];try{p=this._characterJoiners[0].handler(y)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const T=this._characterJoiners[E].handler(y);for(let B=0;B<T.length;B++)nr._mergeRanges(p,T[B])}catch(T){console.error(T)}return this._stringRangesToCellRanges(p,b,m),p}_stringRangesToCellRanges(t,s,d){let b=0,m=!1,y=0,p=t[b];if(p){for(let E=d;E<this._bufferService.cols;E++){const T=s.getWidth(E),B=s.getString(E).length||f.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!m&&p[0]<=y&&(p[0]=E,m=!0),p[1]<=y){if(p[1]=E,p=t[++b],!p)break;p[0]<=y?(p[0]=E,m=!0):m=!1}y+=B}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(t,s){let d=!1;for(let b=0;b<t.length;b++){const m=t[b];if(d){if(s[1]<=m[0])return t[b-1][1]=s[1],t;if(s[1]<=m[1])return t[b-1][1]=Math.max(s[1],m[1]),t.splice(b,1),t;t.splice(b,1),b--}else{if(s[1]<=m[0])return t.splice(b,0,s),t;if(s[1]<=m[1])return m[0]=Math.min(s[0],m[0]),t;s[0]<m[1]&&(m[0]=Math.min(s[0],m[0]),d=!0)}}return d?t[t.length-1][1]=s[1]:t.push(s),t}};r.CharacterJoinerService=i=h([_(0,C.IBufferService)],i)},5114:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const h=o(844),_=o(8460),a=o(3656);class f extends h.Disposable{constructor(u,i,n){super(),this._textarea=u,this._window=i,this.mainDocument=n,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(t=>this._screenDprMonitor.setWindow(t))),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 h.Disposable{constructor(u){super(),this._parentWindow=u,this._windowResizeListener=this.register(new h.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,h.toDisposable)(()=>this.clearListener()))}setWindow(u){this._parentWindow=u,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var u;this._outerListener&&((u=this._resolutionMediaMatchList)==null||u.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const h=o(844);class _ extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.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(R,r,o){var h=this&&this.__decorate||function(C,u,i,n){var t,s=arguments.length,d=s<3?u:n===null?n=Object.getOwnPropertyDescriptor(u,i):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(C,u,i,n);else for(var b=C.length-1;b>=0;b--)(t=C[b])&&(d=(s<3?t(d):s>3?t(u,i,d):t(u,i))||d);return s>3&&d&&Object.defineProperty(u,i,d),d},_=this&&this.__param||function(C,u){return function(i,n){u(i,n,C)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const a=o(4725),f=o(9806);let v=r.MouseService=class{constructor(C,u){this._renderService=C,this._charSizeService=u}getCoords(C,u,i,n,t){return(0,f.getCoords)(window,C,u,i,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,t)}getMouseReportCoords(C,u){const i=(0,f.getCoordsRelativeToElement)(window,C,u);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};r.MouseService=v=h([_(0,a.IRenderService),_(1,a.ICharSizeService)],v)},3230:function(R,r,o){var h=this&&this.__decorate||function(t,s,d,b){var m,y=arguments.length,p=y<3?s:b===null?b=Object.getOwnPropertyDescriptor(s,d):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,d,b);else for(var E=t.length-1;E>=0;E--)(m=t[E])&&(p=(y<3?m(p):y>3?m(s,d,p):m(s,d))||p);return y>3&&p&&Object.defineProperty(s,d,p),p},_=this&&this.__param||function(t,s){return function(d,b){s(d,b,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const a=o(6193),f=o(4725),v=o(8460),C=o(844),u=o(7226),i=o(2585);let n=r.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(t,s,d,b,m,y,p,E){super(),this._rowCount=t,this._charSizeService=b,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new u.DebouncedIdleTask,this._observerDisposable=this.register(new C.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 a.RenderDebouncer((T,B)=>this._renderRows(T,B),p),this.register(this._renderDebouncer),this.register(p.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(y.onResize(()=>this._fullRefresh())),this.register(y.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(d.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(m.onDecorationRegistered(()=>this._fullRefresh())),this.register(m.onDecorationRemoved(()=>this._fullRefresh())),this.register(d.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(y.cols,y.rows),this._fullRefresh()})),this.register(d.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(y.buffer.y,y.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(p.window,s),this.register(p.onWindowChange(T=>this._registerIntersectionObserver(T,s)))}_registerIntersectionObserver(t,s){if("IntersectionObserver"in t){const d=new t.IntersectionObserver(b=>this._handleIntersectionChange(b[b.length-1]),{threshold:0});d.observe(s),this._observerDisposable.value=(0,C.toDisposable)(()=>d.disconnect())}}_handleIntersectionChange(t){this._isPaused=t.isIntersecting===void 0?t.intersectionRatio===0:!t.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(t,s,d=!1){this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(t,s,this._rowCount))}_renderRows(t,s){this._renderer.value&&(t=Math.min(t,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(t,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:t,end:s}),this._onRender.fire({start:t,end:s}),this._isNextRenderRedrawOnly=!0)}resize(t,s){this._rowCount=s,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(t){this._renderer.value=t,this._renderer.value&&(this._renderer.value.onRequestRedraw(s=>this.refreshRows(s.start,s.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(t){return this._renderDebouncer.addRefreshCallback(t)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var t,s;this._renderer.value&&((s=(t=this._renderer.value).clearTextureAtlas)==null||s.call(t),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(t,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var d;return(d=this._renderer.value)==null?void 0:d.handleResize(t,s)}):this._renderer.value.handleResize(t,s),this._fullRefresh())}handleCharSizeChanged(){var t;(t=this._renderer.value)==null||t.handleCharSizeChanged()}handleBlur(){var t;(t=this._renderer.value)==null||t.handleBlur()}handleFocus(){var t;(t=this._renderer.value)==null||t.handleFocus()}handleSelectionChanged(t,s,d){var b;this._selectionState.start=t,this._selectionState.end=s,this._selectionState.columnSelectMode=d,(b=this._renderer.value)==null||b.handleSelectionChanged(t,s,d)}handleCursorMove(){var t;(t=this._renderer.value)==null||t.handleCursorMove()}clear(){var t;(t=this._renderer.value)==null||t.clear()}};r.RenderService=n=h([_(2,i.IOptionsService),_(3,f.ICharSizeService),_(4,i.IDecorationService),_(5,i.IBufferService),_(6,f.ICoreBrowserService),_(7,f.IThemeService)],n)},9312:function(R,r,o){var h=this&&this.__decorate||function(p,E,T,B){var O,D=arguments.length,P=D<3?E:B===null?B=Object.getOwnPropertyDescriptor(E,T):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(p,E,T,B);else for(var N=p.length-1;N>=0;N--)(O=p[N])&&(P=(D<3?O(P):D>3?O(E,T,P):O(E,T))||P);return D>3&&P&&Object.defineProperty(E,T,P),P},_=this&&this.__param||function(p,E){return function(T,B){E(T,B,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const a=o(9806),f=o(9504),v=o(456),C=o(4725),u=o(8460),i=o(844),n=o(6114),t=o(4841),s=o(511),d=o(2585),b=" ",m=new RegExp(b,"g");let y=r.SelectionService=class extends i.Disposable{constructor(p,E,T,B,O,D,P,N,U){super(),this._element=p,this._screenElement=E,this._linkifier=T,this._bufferService=B,this._coreService=O,this._mouseService=D,this._optionsService=P,this._renderService=N,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new s.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new 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=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(G=>this._handleTrim(G)),this.register(this._bufferService.buffers.onBufferActivate(G=>this._handleBufferActivate(G))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,i.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 T=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(p[0]===E[0])return"";const O=p[0]<E[0]?p[0]:E[0],D=p[0]<E[0]?E[0]:p[0];for(let P=p[1];P<=E[1];P++){const N=T.translateBufferLineToString(P,!0,O,D);B.push(N)}}else{const O=p[1]===E[1]?E[0]:void 0;B.push(T.translateBufferLineToString(p[1],!0,p[0],O));for(let D=p[1]+1;D<=E[1]-1;D++){const P=T.lines.get(D),N=T.translateBufferLineToString(D,!0);P!=null&&P.isWrapped?B[B.length-1]+=N:B.push(N)}if(p[1]!==E[1]){const D=T.lines.get(E[1]),P=T.translateBufferLineToString(E[1],!0,0,E[0]);D&&D.isWrapped?B[B.length-1]+=P:B.push(P)}}return B.map(O=>O.replace(m," ")).join(n.isWindows?`\r
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())),n.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),T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(T&&B&&E)&&this._areCoordsInSelection(E,T,B)}isCellInSelection(p,E){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!T||!B)&&this._areCoordsInSelection([p,E],T,B)}_areCoordsInSelection(p,E,T){return p[1]>E[1]&&p[1]<T[1]||E[1]===T[1]&&p[1]===E[1]&&p[0]>=E[0]&&p[0]<T[0]||E[1]<T[1]&&p[1]===T[1]&&p[0]<T[0]||E[1]<T[1]&&p[1]===E[1]&&p[0]>=E[0]}_selectWordAtCursor(p,E){var O,D;const T=(D=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:D.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,t.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(p);return!!B&&(this._selectWordAt(B,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,a.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=T?0:(E>T&&(E-=T),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(p){return n.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&&!(n.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 T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const B=T.lines.get(this._model.selectionEnd[1]);B&&B.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 T=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const B=(0,f.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,T=!(!p||!E||p[0]===E[0]&&p[1]===E[1]);T?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,T)):this._oldHasSelection&&this._fireOnSelectionChange(p,E,T)}_fireOnSelectionChange(p,E,T){this._oldSelectionStart=p,this._oldSelectionEnd=E,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(p,E){let T=E;for(let B=0;E>=B;B++){const O=p.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:O>1&&E!==B&&(T+=O-1)}return T}setSelection(p,E,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,E],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,E,T=!0,B=!0){if(p[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,D=O.lines.get(p[1]);if(!D)return;const P=O.translateBufferLineToString(p[1],!1);let N=this._convertViewportColToCharacterIndex(D,p[0]),U=N;const G=p[0]-N;let $=0,x=0,L=0,A=0;if(P.charAt(N)===" "){for(;N>0&&P.charAt(N-1)===" ";)N--;for(;U<P.length&&P.charAt(U+1)===" ";)U++}else{let z=p[0],J=p[0];D.getWidth(z)===0&&($++,z--),D.getWidth(J)===2&&(x++,J++);const ee=D.getString(J).length;for(ee>1&&(A+=ee-1,U+=ee-1);z>0&&N>0&&!this._isCharWordSeparator(D.loadCell(z-1,this._workCell));){D.loadCell(z-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?($++,z--):I>1&&(L+=I-1,N-=I-1),N--,z--}for(;J<D.length&&U+1<P.length&&!this._isCharWordSeparator(D.loadCell(J+1,this._workCell));){D.loadCell(J+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,J++):I>1&&(A+=I-1,U+=I-1),U++,J++}}U++;let M=N+G-$+L,F=Math.min(this._bufferService.cols,U-N+$+x-L-A);if(E||P.slice(N,U).trim()!==""){if(T&&M===0&&D.getCodePoint(0)!==32){const z=O.lines.get(p[1]-1);if(z&&D.isWrapped&&z.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(J){const ee=this._bufferService.cols-J.start;M-=ee,F+=ee}}}if(B&&M+F===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const z=O.lines.get(p[1]+1);if(z!=null&&z.isWrapped&&z.getCodePoint(0)!==32){const J=this._getWordAt([0,p[1]+1],!1,!1,!0);J&&(F+=J.length)}}return{start:M,length:F}}}_selectWordAt(p,E){const T=this._getWordAt(p,E);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[T.start,p[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(p){const E=this._getWordAt(p,!0);if(E){let T=p[1];for(;E.start<0;)E.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,T]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const E=this._bufferService.buffer.getWrappedRangeForLine(p),T={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,t.getRangeLength)(T,this._bufferService.cols)}};r.SelectionService=y=h([_(3,d.IBufferService),_(4,d.ICoreService),_(5,C.IMouseService),_(6,d.IOptionsService),_(7,C.IRenderService),_(8,C.ICoreBrowserService)],y)},4725:(R,r,o)=>{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 h=o(8343);r.ICharSizeService=(0,h.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),r.IMouseService=(0,h.createDecorator)("MouseService"),r.IRenderService=(0,h.createDecorator)("RenderService"),r.ISelectionService=(0,h.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,h.createDecorator)("ThemeService"),r.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(R,r,o){var h=this&&this.__decorate||function(y,p,E,T){var B,O=arguments.length,D=O<3?p:T===null?T=Object.getOwnPropertyDescriptor(p,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,p,E,T);else for(var P=y.length-1;P>=0;P--)(B=y[P])&&(D=(O<3?B(D):O>3?B(p,E,D):B(p,E))||D);return O>3&&D&&Object.defineProperty(p,E,D),D},_=this&&this.__param||function(y,p){return function(E,T){p(E,T,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const a=o(7239),f=o(8055),v=o(8460),C=o(844),u=o(2585),i=f.css.toColor("#ffffff"),n=f.css.toColor("#000000"),t=f.css.toColor("#ffffff"),s=f.css.toColor("#000000"),d={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const y=[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 T=p[E/36%6|0],B=p[E/6%6|0],O=p[E%6];y.push({css:f.channels.toCss(T,B,O),rgba:f.channels.toRgba(T,B,O)})}for(let E=0;E<24;E++){const T=8+10*E;y.push({css:f.channels.toCss(T,T,T),rgba:f.channels.toRgba(T,T,T)})}return y})());let b=r.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(y){super(),this._optionsService=y,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:i,background:n,cursor:t,cursorAccent:s,selectionForeground:void 0,selectionBackgroundTransparent:d,selectionBackgroundOpaque:f.color.blend(n,d),selectionInactiveBackgroundTransparent:d,selectionInactiveBackgroundOpaque:f.color.blend(n,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(y={}){const p=this._colors;if(p.foreground=m(y.foreground,i),p.background=m(y.background,n),p.cursor=m(y.cursor,t),p.cursorAccent=m(y.cursorAccent,s),p.selectionBackgroundTransparent=m(y.selectionBackground,d),p.selectionBackgroundOpaque=f.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=m(y.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=f.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=y.selectionForeground?m(y.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]=m(y.black,r.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=m(y.red,r.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=m(y.green,r.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=m(y.yellow,r.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=m(y.blue,r.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=m(y.magenta,r.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=m(y.cyan,r.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=m(y.white,r.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=m(y.brightBlack,r.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=m(y.brightRed,r.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=m(y.brightGreen,r.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=m(y.brightYellow,r.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=m(y.brightBlue,r.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=m(y.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=m(y.brightCyan,r.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=m(y.brightWhite,r.DEFAULT_ANSI_COLORS[15]),y.extendedAnsi){const E=Math.min(p.ansi.length-16,y.extendedAnsi.length);for(let T=0;T<E;T++)p.ansi[T+16]=m(y.extendedAnsi[T],r.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(y){this._restoreColor(y),this._onChangeColors.fire(this.colors)}_restoreColor(y){if(y!==void 0)switch(y){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[y]=this._restoreColors.ansi[y]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(y){y(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 m(y,p){if(y!==void 0)try{return f.css.toColor(y)}catch{}return p}r.ThemeService=b=h([_(0,u.IOptionsService)],b)},6349:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const h=o(8460),_=o(844);class a extends _.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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 C=new Array(v);for(let u=0;u<Math.min(v,this.length);u++)C[u]=this._array[this._getCyclicIndex(u)];this._array=C,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let C=this._length;C<v;C++)this._array[C]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,C){this._array[this._getCyclicIndex(v)]=C}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,C,...u){if(C){for(let i=v;i<this._length-C;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+C)];this._length-=C,this.onDeleteEmitter.fire({index:v,amount:C})}for(let i=this._length-1;i>=v;i--)this._array[this._getCyclicIndex(i+u.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<u.length;i++)this._array[this._getCyclicIndex(v+i)]=u[i];if(u.length&&this.onInsertEmitter.fire({index:v,amount:u.length}),this._length+u.length>this._maxLength){const i=this._length+u.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}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,C,u){if(!(C<=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 n=C-1;n>=0;n--)this.set(v+n+u,this.get(v+n));const i=v+C+u-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<C;i++)this.set(v+i+u,this.get(v+i))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}r.CircularList=a},1439:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function o(h,_=5){if(typeof h!="object")return h;const a=Array.isArray(h)?[]:{};for(const f in h)a[f]=_<=1?h[f]:h[f]&&o(h[f],_-1);return a}},8055:(R,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 o=0,h=0,_=0,a=0;var f,v,C,u,i;function n(s){const d=s.toString(16);return d.length<2?"0"+d:d}function t(s,d){return s<d?(d+.05)/(s+.05):(s+.05)/(d+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(s){s.toCss=function(d,b,m,y){return y!==void 0?`#${n(d)}${n(b)}${n(m)}${n(y)}`:`#${n(d)}${n(b)}${n(m)}`},s.toRgba=function(d,b,m,y=255){return(d<<24|b<<16|m<<8|y)>>>0},s.toColor=function(d,b,m,y){return{css:s.toCss(d,b,m,y),rgba:s.toRgba(d,b,m,y)}}}(f||(r.channels=f={})),function(s){function d(b,m){return a=Math.round(255*m),[o,h,_]=i.toChannels(b.rgba),{css:f.toCss(o,h,_,a),rgba:f.toRgba(o,h,_,a)}}s.blend=function(b,m){if(a=(255&m.rgba)/255,a===1)return{css:m.css,rgba:m.rgba};const y=m.rgba>>24&255,p=m.rgba>>16&255,E=m.rgba>>8&255,T=b.rgba>>24&255,B=b.rgba>>16&255,O=b.rgba>>8&255;return o=T+Math.round((y-T)*a),h=B+Math.round((p-B)*a),_=O+Math.round((E-O)*a),{css:f.toCss(o,h,_),rgba:f.toRgba(o,h,_)}},s.isOpaque=function(b){return(255&b.rgba)==255},s.ensureContrastRatio=function(b,m,y){const p=i.ensureContrastRatio(b.rgba,m.rgba,y);if(p)return f.toColor(p>>24&255,p>>16&255,p>>8&255)},s.opaque=function(b){const m=(255|b.rgba)>>>0;return[o,h,_]=i.toChannels(m),{css:f.toCss(o,h,_),rgba:m}},s.opacity=d,s.multiplyOpacity=function(b,m){return a=255&b.rgba,d(b,a*m/255)},s.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(v||(r.color=v={})),function(s){let d,b;try{const m=document.createElement("canvas");m.width=1,m.height=1;const y=m.getContext("2d",{willReadFrequently:!0});y&&(d=y,d.globalCompositeOperation="copy",b=d.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(m){if(m.match(/#[\da-f]{3,8}/i))switch(m.length){case 4:return o=parseInt(m.slice(1,2).repeat(2),16),h=parseInt(m.slice(2,3).repeat(2),16),_=parseInt(m.slice(3,4).repeat(2),16),f.toColor(o,h,_);case 5:return o=parseInt(m.slice(1,2).repeat(2),16),h=parseInt(m.slice(2,3).repeat(2),16),_=parseInt(m.slice(3,4).repeat(2),16),a=parseInt(m.slice(4,5).repeat(2),16),f.toColor(o,h,_,a);case 7:return{css:m,rgba:(parseInt(m.slice(1),16)<<8|255)>>>0};case 9:return{css:m,rgba:parseInt(m.slice(1),16)>>>0}}const y=m.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(y)return o=parseInt(y[1]),h=parseInt(y[2]),_=parseInt(y[3]),a=Math.round(255*(y[5]===void 0?1:parseFloat(y[5]))),f.toColor(o,h,_,a);if(!d||!b)throw new Error("css.toColor: Unsupported css format");if(d.fillStyle=b,d.fillStyle=m,typeof d.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(d.fillRect(0,0,1,1),[o,h,_,a]=d.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(o,h,_,a),css:m}}}(C||(r.css=C={})),function(s){function d(b,m,y){const p=b/255,E=m/255,T=y/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*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}s.relativeLuminance=function(b){return d(b>>16&255,b>>8&255,255&b)},s.relativeLuminance2=d}(u||(r.rgb=u={})),function(s){function d(m,y,p){const E=m>>24&255,T=m>>16&255,B=m>>8&255;let O=y>>24&255,D=y>>16&255,P=y>>8&255,N=t(u.relativeLuminance2(O,D,P),u.relativeLuminance2(E,T,B));for(;N<p&&(O>0||D>0||P>0);)O-=Math.max(0,Math.ceil(.1*O)),D-=Math.max(0,Math.ceil(.1*D)),P-=Math.max(0,Math.ceil(.1*P)),N=t(u.relativeLuminance2(O,D,P),u.relativeLuminance2(E,T,B));return(O<<24|D<<16|P<<8|255)>>>0}function b(m,y,p){const E=m>>24&255,T=m>>16&255,B=m>>8&255;let O=y>>24&255,D=y>>16&255,P=y>>8&255,N=t(u.relativeLuminance2(O,D,P),u.relativeLuminance2(E,T,B));for(;N<p&&(O<255||D<255||P<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),D=Math.min(255,D+Math.ceil(.1*(255-D))),P=Math.min(255,P+Math.ceil(.1*(255-P))),N=t(u.relativeLuminance2(O,D,P),u.relativeLuminance2(E,T,B));return(O<<24|D<<16|P<<8|255)>>>0}s.blend=function(m,y){if(a=(255&y)/255,a===1)return y;const p=y>>24&255,E=y>>16&255,T=y>>8&255,B=m>>24&255,O=m>>16&255,D=m>>8&255;return o=B+Math.round((p-B)*a),h=O+Math.round((E-O)*a),_=D+Math.round((T-D)*a),f.toRgba(o,h,_)},s.ensureContrastRatio=function(m,y,p){const E=u.relativeLuminance(m>>8),T=u.relativeLuminance(y>>8);if(t(E,T)<p){if(T<E){const D=d(m,y,p),P=t(E,u.relativeLuminance(D>>8));if(P<p){const N=b(m,y,p);return P>t(E,u.relativeLuminance(N>>8))?D:N}return D}const B=b(m,y,p),O=t(E,u.relativeLuminance(B>>8));if(O<p){const D=d(m,y,p);return O>t(E,u.relativeLuminance(D>>8))?B:D}return B}},s.reduceLuminance=d,s.increaseLuminance=b,s.toChannels=function(m){return[m>>24&255,m>>16&255,m>>8&255,255&m]}}(i||(r.rgba=i={})),r.toPaddedHex=n,r.contrastRatio=t},8969:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const h=o(844),_=o(2585),a=o(4348),f=o(7866),v=o(744),C=o(7302),u=o(6975),i=o(8460),n=o(1753),t=o(1480),s=o(7994),d=o(9282),b=o(5435),m=o(5981),y=o(2660);let p=!1;class E extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new i.EventEmitter),this._onScroll.event(B=>{var O;(O=this._onScrollApi)==null||O.fire(B.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(B){for(const O in B)this.optionsService.options[O]=B[O]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new i.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new i.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new i.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new i.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new i.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new C.OptionsService(B)),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(n.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(t.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(y.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new b.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,i.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,i.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,i.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,i.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(O=>{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(O=>{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 m.WriteBuffer((O,D)=>this._inputHandler.parse(O,D))),this.register((0,i.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,O){this._writeBuffer.write(B,O)}writeSync(B,O){this._logService.logLevel<=_.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(B,O)}input(B,O=!0){this.coreService.triggerDataEvent(B,O)}resize(B,O){isNaN(B)||isNaN(O)||(B=Math.max(B,v.MINIMUM_COLS),O=Math.max(O,v.MINIMUM_ROWS),this._bufferService.resize(B,O))}scroll(B,O=!1){this._bufferService.scroll(B,O)}scrollLines(B,O,D){this._bufferService.scrollLines(B,O,D)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const O=B-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(B,O){return this._inputHandler.registerEscHandler(B,O)}registerDcsHandler(B,O){return this._inputHandler.registerDcsHandler(B,O)}registerCsiHandler(B,O){return this._inputHandler.registerCsiHandler(B,O)}registerOscHandler(B,O){return this._inputHandler.registerOscHandler(B,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?B=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(d.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},()=>((0,d.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)(()=>{for(const O of B)O.dispose()})}}}r.CoreTerminal=E},8460:(R,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=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===o)return void this._listeners.splice(h,1)}}})),this._event}fire(o,h){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,o,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(o,h){return o(_=>h.fire(_))},r.runAndSubscribe=function(o,h){return h(void 0),o(_=>h(_))}},5435:function(R,r,o){var h=this&&this.__decorate||function($,x,L,A){var M,F=arguments.length,z=F<3?x:A===null?A=Object.getOwnPropertyDescriptor(x,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate($,x,L,A);else for(var J=$.length-1;J>=0;J--)(M=$[J])&&(z=(F<3?M(z):F>3?M(x,L,z):M(x,L))||z);return F>3&&z&&Object.defineProperty(x,L,z),z},_=this&&this.__param||function($,x){return function(L,A){x(L,A,$)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const a=o(2584),f=o(7116),v=o(2015),C=o(844),u=o(482),i=o(8437),n=o(8460),t=o(643),s=o(511),d=o(3734),b=o(2585),m=o(1480),y=o(6242),p=o(6351),E=o(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function O($,x){if($>24)return x.setWinLines||!1;switch($){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($){$[$.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",$[$.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(r.WindowsOptionsReportType=D={}));let P=0;class N extends C.Disposable{getAttrData(){return this._curAttrData}constructor(x,L,A,M,F,z,J,ee,I=new v.EscapeSequenceParser){super(),this._bufferService=x,this._charsetService=L,this._coreService=A,this._logService=M,this._optionsService=F,this._oscLinkService=z,this._coreMouseService=J,this._unicodeService=ee,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new s.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new n.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new n.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new n.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new n.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new n.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new n.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new n.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new n.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new n.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new n.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new n.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 U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._parser.setCsiHandlerFallback((k,W)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(k),params:W.toArray()})}),this._parser.setEscHandlerFallback(k=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(k)})}),this._parser.setExecuteHandlerFallback(k=>{this._logService.debug("Unknown EXECUTE code: ",{code:k})}),this._parser.setOscHandlerFallback((k,W,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:k,action:W,data:H})}),this._parser.setDcsHandlerFallback((k,W,H)=>{W==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(k),action:W,payload:H})}),this._parser.setPrintHandler((k,W,H)=>this.print(k,W,H)),this._parser.registerCsiHandler({final:"@"},k=>this.insertChars(k)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},k=>this.scrollLeft(k)),this._parser.registerCsiHandler({final:"A"},k=>this.cursorUp(k)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},k=>this.scrollRight(k)),this._parser.registerCsiHandler({final:"B"},k=>this.cursorDown(k)),this._parser.registerCsiHandler({final:"C"},k=>this.cursorForward(k)),this._parser.registerCsiHandler({final:"D"},k=>this.cursorBackward(k)),this._parser.registerCsiHandler({final:"E"},k=>this.cursorNextLine(k)),this._parser.registerCsiHandler({final:"F"},k=>this.cursorPrecedingLine(k)),this._parser.registerCsiHandler({final:"G"},k=>this.cursorCharAbsolute(k)),this._parser.registerCsiHandler({final:"H"},k=>this.cursorPosition(k)),this._parser.registerCsiHandler({final:"I"},k=>this.cursorForwardTab(k)),this._parser.registerCsiHandler({final:"J"},k=>this.eraseInDisplay(k,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},k=>this.eraseInDisplay(k,!0)),this._parser.registerCsiHandler({final:"K"},k=>this.eraseInLine(k,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},k=>this.eraseInLine(k,!0)),this._parser.registerCsiHandler({final:"L"},k=>this.insertLines(k)),this._parser.registerCsiHandler({final:"M"},k=>this.deleteLines(k)),this._parser.registerCsiHandler({final:"P"},k=>this.deleteChars(k)),this._parser.registerCsiHandler({final:"S"},k=>this.scrollUp(k)),this._parser.registerCsiHandler({final:"T"},k=>this.scrollDown(k)),this._parser.registerCsiHandler({final:"X"},k=>this.eraseChars(k)),this._parser.registerCsiHandler({final:"Z"},k=>this.cursorBackwardTab(k)),this._parser.registerCsiHandler({final:"`"},k=>this.charPosAbsolute(k)),this._parser.registerCsiHandler({final:"a"},k=>this.hPositionRelative(k)),this._parser.registerCsiHandler({final:"b"},k=>this.repeatPrecedingCharacter(k)),this._parser.registerCsiHandler({final:"c"},k=>this.sendDeviceAttributesPrimary(k)),this._parser.registerCsiHandler({prefix:">",final:"c"},k=>this.sendDeviceAttributesSecondary(k)),this._parser.registerCsiHandler({final:"d"},k=>this.linePosAbsolute(k)),this._parser.registerCsiHandler({final:"e"},k=>this.vPositionRelative(k)),this._parser.registerCsiHandler({final:"f"},k=>this.hVPosition(k)),this._parser.registerCsiHandler({final:"g"},k=>this.tabClear(k)),this._parser.registerCsiHandler({final:"h"},k=>this.setMode(k)),this._parser.registerCsiHandler({prefix:"?",final:"h"},k=>this.setModePrivate(k)),this._parser.registerCsiHandler({final:"l"},k=>this.resetMode(k)),this._parser.registerCsiHandler({prefix:"?",final:"l"},k=>this.resetModePrivate(k)),this._parser.registerCsiHandler({final:"m"},k=>this.charAttributes(k)),this._parser.registerCsiHandler({final:"n"},k=>this.deviceStatus(k)),this._parser.registerCsiHandler({prefix:"?",final:"n"},k=>this.deviceStatusPrivate(k)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},k=>this.softReset(k)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},k=>this.setCursorStyle(k)),this._parser.registerCsiHandler({final:"r"},k=>this.setScrollRegion(k)),this._parser.registerCsiHandler({final:"s"},k=>this.saveCursor(k)),this._parser.registerCsiHandler({final:"t"},k=>this.windowOptions(k)),this._parser.registerCsiHandler({final:"u"},k=>this.restoreCursor(k)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},k=>this.insertColumns(k)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},k=>this.deleteColumns(k)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},k=>this.selectProtected(k)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},k=>this.requestMode(k,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},k=>this.requestMode(k,!1)),this._parser.setExecuteHandler(a.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(a.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(a.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(a.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(a.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(a.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(a.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(a.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(a.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(a.C1.IND,()=>this.index()),this._parser.setExecuteHandler(a.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(a.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new y.OscHandler(k=>(this.setTitle(k),this.setIconName(k),!0))),this._parser.registerOscHandler(1,new y.OscHandler(k=>this.setIconName(k))),this._parser.registerOscHandler(2,new y.OscHandler(k=>this.setTitle(k))),this._parser.registerOscHandler(4,new y.OscHandler(k=>this.setOrReportIndexedColor(k))),this._parser.registerOscHandler(8,new y.OscHandler(k=>this.setHyperlink(k))),this._parser.registerOscHandler(10,new y.OscHandler(k=>this.setOrReportFgColor(k))),this._parser.registerOscHandler(11,new y.OscHandler(k=>this.setOrReportBgColor(k))),this._parser.registerOscHandler(12,new y.OscHandler(k=>this.setOrReportCursorColor(k))),this._parser.registerOscHandler(104,new y.OscHandler(k=>this.restoreIndexedColor(k))),this._parser.registerOscHandler(110,new y.OscHandler(k=>this.restoreFgColor(k))),this._parser.registerOscHandler(111,new y.OscHandler(k=>this.restoreBgColor(k))),this._parser.registerOscHandler(112,new y.OscHandler(k=>this.restoreCursorColor(k))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const k in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:k},()=>this.selectCharset("("+k)),this._parser.registerEscHandler({intermediates:")",final:k},()=>this.selectCharset(")"+k)),this._parser.registerEscHandler({intermediates:"*",final:k},()=>this.selectCharset("*"+k)),this._parser.registerEscHandler({intermediates:"+",final:k},()=>this.selectCharset("+"+k)),this._parser.registerEscHandler({intermediates:"-",final:k},()=>this.selectCharset("-"+k)),this._parser.registerEscHandler({intermediates:".",final:k},()=>this.selectCharset("."+k)),this._parser.registerEscHandler({intermediates:"/",final:k},()=>this.selectCharset("/"+k));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(k=>(this._logService.error("Parsing error: ",k),k)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new p.DcsHandler((k,W)=>this.requestStatusString(k,W)))}_preserveStack(x,L,A,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=x,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=A,this._parseStack.position=M}_logSlowResolvingAsync(x){this._logService.logLevel<=b.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,M=this._activeBuffer.x,F=this._activeBuffer.y,z=0;const J=this._parseStack.paused;if(J){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(A),A;M=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,x.length>B&&(z=this._parseStack.position+B)}if(this._logService.logLevel<=b.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof x=="string"?` "${x}"`:` "${Array.prototype.map.call(x,k=>String.fromCharCode(k)).join("")}"`),typeof x=="string"?x.split("").map(k=>k.charCodeAt(0)):x),this._parseBuffer.length<x.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(x.length,B))),J||this._dirtyRowTracker.clearRange(),x.length>B)for(let k=z;k<x.length;k+=B){const W=k+B<x.length?k+B:x.length,H=typeof x=="string"?this._stringDecoder.decode(x.substring(k,W),this._parseBuffer):this._utf8Decoder.decode(x.subarray(k,W),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,H))return this._preserveStack(M,F,H,k),this._logSlowResolvingAsync(A),A}else if(!J){const k=typeof x=="string"?this._stringDecoder.decode(x,this._parseBuffer):this._utf8Decoder.decode(x,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,k))return this._preserveStack(M,F,k,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===M&&this._activeBuffer.y===F||this._onCursorMove.fire();const ee=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(ee,this._bufferService.rows-1))}print(x,L,A){let M,F;const z=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,k=this._coreService.modes.insertMode,W=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-L>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,W);let Z=this._parser.precedingJoinState;for(let q=L;q<A;++q){if(M=x[q],M<127&&z){const ue=z[String.fromCharCode(M)];ue&&(M=ue.charCodeAt(0))}const ie=this._unicodeService.charProperties(M,Z);F=m.UnicodeService.extractWidth(ie);const ce=m.UnicodeService.extractShouldJoin(ie),he=ce?m.UnicodeService.extractWidth(Z):0;if(Z=ie,J&&this._onA11yChar.fire((0,u.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-he>ee){if(I){const ue=H;let te=this._activeBuffer.x-he;for(this._activeBuffer.x=he,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),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),he>0&&H instanceof i.BufferLine&&H.copyCellsFrom(ue,te,0,he,!1);te<ee;)ue.setCellFromCodepoint(te++,0,1,W)}else if(this._activeBuffer.x=ee-1,F===2)continue}if(ce&&this._activeBuffer.x){const ue=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-ue,M,F);for(let te=F-he;--te>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}else if(k&&(H.insertCells(this._activeBuffer.x,F-he,this._activeBuffer.getNullCell(W)),H.getWidth(ee-1)===2&&H.setCellFromCodepoint(ee-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,W)),H.setCellFromCodepoint(this._activeBuffer.x++,M,F,W),F>0)for(;--F;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}this._parser.precedingJoinState=Z,this._activeBuffer.x<ee&&A-L>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,W),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=>!O(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 y.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(){var x;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&&((x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&x.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.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,M=!1,F=!1){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);z.replaceCells(L,A,this._activeBuffer.getNullCell(this._eraseAttrData()),F),M&&(z.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 M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,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,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-M+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 M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;L--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(M,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(i.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 M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.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 M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.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 M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.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 M=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);M.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),M.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,M=m.UnicodeService.extractWidth(L),F=this._activeBuffer.x-M,z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),J=new Uint32Array(z.length*A);let ee=0;for(let k=0;k<z.length;){const W=z.codePointAt(k)||0;J[ee++]=W,k+=W>65535?2:1}let I=ee;for(let k=1;k<A;++k)J.copyWithin(I,0,ee),I+=ee;return this.print(J,0,I),!0}sendDeviceAttributesPrimary(x){return x.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(x){return x.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(x.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.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:M,activeEncoding:F}=this._coreMouseService,z=this._coreService,{buffers:J,cols:ee}=this._bufferService,{active:I,alt:k}=J,W=this._optionsService.rawOptions,H=ce=>ce?1:2,Z=x.params[0];return q=Z,ie=L?Z===2?4:Z===4?H(z.modes.insertMode):Z===12?3:Z===20?H(W.convertEol):0:Z===1?H(A.applicationCursorKeys):Z===3?W.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:Z===6?H(A.origin):Z===7?H(A.wraparound):Z===8?3:Z===9?H(M==="X10"):Z===12?H(W.cursorBlink):Z===25?H(!z.isCursorHidden):Z===45?H(A.reverseWraparound):Z===66?H(A.applicationKeypad):Z===67?4:Z===1e3?H(M==="VT200"):Z===1002?H(M==="DRAG"):Z===1003?H(M==="ANY"):Z===1004?H(A.sendFocus):Z===1005?4:Z===1006?H(F==="SGR"):Z===1015?4:Z===1016?H(F==="SGR_PIXELS"):Z===1048?1:Z===47||Z===1047||Z===1049?H(I===k):Z===2004?H(A.bracketedPasteMode):0,z.triggerDataEvent(`${a.C0.ESC}[${L?"":"?"}${q};${ie}$y`),!0;var q,ie}_updateAttrColor(x,L,A,M,F){return L===2?(x|=50331648,x&=-16777216,x|=d.AttributeData.fromColorRGB([A,M,F])):L===5&&(x&=-50331904,x|=33554432|255&A),x}_extractColor(x,L,A){const M=[0,0,-1,0,0,0];let F=0,z=0;do{if(M[z+F]=x.params[L+z],x.hasSubParams(L+z)){const J=x.getSubParams(L+z);let ee=0;do M[1]===5&&(F=1),M[z+ee+1+F]=J[ee];while(++ee<J.length&&ee+z+1+F<M.length);break}if(M[1]===5&&z+F>=2||M[1]===2&&z+F>=5)break;M[1]&&(F=1)}while(++z+L<x.length&&z+F<M.length);for(let J=2;J<M.length;++J)M[J]===-1&&(M[J]=0);switch(M[0]){case 38:A.fg=this._updateAttrColor(A.fg,M[1],M[3],M[4],M[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,M[1],M[3],M[4],M[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,M[1],M[3],M[4],M[5])}return z}_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=i.DEFAULT_ATTR_DATA.fg,x.bg=i.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 M=this._curAttrData;for(let F=0;F<L;F++)A=x.params[F],A>=30&&A<=37?(M.fg&=-50331904,M.fg|=16777216|A-30):A>=40&&A<=47?(M.bg&=-50331904,M.bg|=16777216|A-40):A>=90&&A<=97?(M.fg&=-50331904,M.fg|=16777224|A-90):A>=100&&A<=107?(M.bg&=-50331904,M.bg|=16777224|A-100):A===0?this._processSGR0(M):A===1?M.fg|=134217728:A===3?M.bg|=67108864:A===4?(M.fg|=268435456,this._processUnderline(x.hasSubParams(F)?x.getSubParams(F)[0]:1,M)):A===5?M.fg|=536870912:A===7?M.fg|=67108864:A===8?M.fg|=1073741824:A===9?M.fg|=2147483648:A===2?M.bg|=134217728:A===21?this._processUnderline(2,M):A===22?(M.fg&=-134217729,M.bg&=-134217729):A===23?M.bg&=-67108865:A===24?(M.fg&=-268435457,this._processUnderline(0,M)):A===25?M.fg&=-536870913:A===27?M.fg&=-67108865:A===28?M.fg&=-1073741825:A===29?M.fg&=2147483647:A===39?(M.fg&=-67108864,M.fg|=16777215&i.DEFAULT_ATTR_DATA.fg):A===49?(M.bg&=-67108864,M.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?F+=this._extractColor(x,F,M):A===53?M.bg|=1073741824:A===55?M.bg&=-1073741825:A===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):A===100?(M.fg&=-67108864,M.fg|=16777215&i.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&i.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(`${a.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.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(`${a.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=i.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(!O(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(`${a.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 M=A.shift(),F=A.shift();if(/^\d+$/.exec(M)){const z=parseInt(M);if(G(z))if(F==="?")L.push({type:0,index:z});else{const J=(0,E.parseColor)(F);J&&L.push({type:1,index:z,color:J})}}}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 M;const F=A.findIndex(z=>z.startsWith("id="));return F!==-1&&(M=A[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,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 M=0;M<A.length&&!(L>=this._specialColors.length);++M,++L)if(A[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const F=(0,E.parseColor)(A[M]);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 M=0;M<A.length;++M)if(/^\d+$/.exec(A[M])){const F=parseInt(A[M]);G(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(T[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=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.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 s.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,M=this._activeBuffer.lines.get(A);M&&(M.fill(x),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(x,L){const A=this._bufferService.buffer,M=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${F}${a.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}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(x,L){this._dirtyRowTracker.markRangeDirty(x,L)}}r.InputHandler=N;let U=class{constructor($){this._bufferService=$,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty($){$<this.start?this.start=$:$>this.end&&(this.end=$)}markRangeDirty($,x){$>x&&(P=$,$=x,x=P),$<this.start&&(this.start=$),x>this.end&&(this.end=x)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G($){return 0<=$&&$<256}U=h([_(0,b.IBufferService)],U)},844:(R,r)=>{function o(h){for(const _ of h)_.dispose();h.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 h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const _=this._disposables.indexOf(h);_!==-1&&this._disposables.splice(_,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var _;this._isDisposed||h===this._value||((_=this._value)==null||_.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},r.toDisposable=function(h){return{dispose:h}},r.disposeArray=o,r.getDisposeArrayDisposable=function(h){return{dispose:()=>o(h)}}},1505:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(_,a,f){this._data[_]||(this._data[_]={}),this._data[_][a]=f}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(h,_,a,f,v){this._data.get(h,_)||this._data.set(h,_,new o),this._data.get(h,_).set(a,f,v)}get(h,_,a,f){var v;return(v=this._data.get(h,_))==null?void 0:v.get(a,f)}clear(){this._data.clear()}}},6114:(R,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 o=r.isNode?"node":navigator.userAgent,h=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const _=o.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),r.isIpad=h==="iPad",r.isIphone=h==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),r.isLinux=h.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},6106:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let o=0;r.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(o=this._search(this._getKey(h)),this._array.splice(o,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const _=this._getKey(h);if(_===void 0||(o=this._search(_),o===-1)||this._getKey(this._array[o])!==_)return!1;do if(this._array[o]===h)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===_);return!1}*getKeyIterator(h){if(this._array.length!==0&&(o=this._search(h),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===h))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===h)}forEachByKey(h,_){if(this._array.length!==0&&(o=this._search(h),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===h))do _(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===h)}values(){return[...this._array].values()}_search(h){let _=0,a=this._array.length-1;for(;a>=_;){let f=_+a>>1;const v=this._getKey(this._array[f]);if(v>h)a=f-1;else{if(!(v<h)){for(;f>0&&this._getKey(this._array[f-1])===h;)f--;return f}_=f+1}}return _}}},7226:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const h=o(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 C=0,u=0,i=v.timeRemaining(),n=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),u=Math.max(C,u),n=v.timeRemaining(),1.5*u>n)return i-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-C))}ms`),void this._start();i=n}this.clear()}}class a extends _{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const C=Date.now()+v;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}r.PriorityTaskQueue=a,r.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:a,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const h=o(643);r.updateWindowsModeWrappedState=function(_){const a=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),f=a==null?void 0:a.get(_.cols-1),v=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);v&&f&&(v.isWrapped=f[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&f[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new o;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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=o;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,f=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=f}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=h},9092:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const h=o(6349),_=o(7226),a=o(3734),f=o(8437),v=o(4634),C=o(511),u=o(643),i=o(4863),n=o(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(t,s,d){this._hasScrollback=t,this._optionsService=s,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=n.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=C.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 h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(t,s){return new f.BufferLine(this._bufferService.cols,this.getNullCell(t),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;const s=t+this._optionsService.rawOptions.scrollback;return s>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:s}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=f.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,s){const d=this.getNullCell(f.DEFAULT_ATTR_DATA);let b=0;const m=this._getCorrectBufferLength(s);if(m>this.lines.maxLength&&(this.lines.maxLength=m),this.lines.length>0){if(this._cols<t)for(let p=0;p<this.lines.length;p++)b+=+this.lines.get(p).resize(t,d);let y=0;if(this._rows<s)for(let p=this._rows;p<s;p++)this.lines.length<s+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(t,d)):this.ybase>0&&this.lines.length<=this.ybase+this.y+y+1?(this.ybase--,y++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(t,d)));else for(let p=this._rows;p>s;p--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(m<this.lines.maxLength){const p=this.lines.length-m;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=m}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,s-1),y&&(this.y+=y),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(t,s),this._cols>t))for(let y=0;y<this.lines.length;y++)b+=+this.lines.get(y).resize(t,d);this._cols=t,this._rows=s,this._memoryCleanupQueue.clear(),b>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return t}get _isReflowEnabled(){const t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,s){this._cols!==t&&(t>this._cols?this._reflowLarger(t,s):this._reflowSmaller(t,s))}_reflowLarger(t,s){const d=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(d.length>0){const b=(0,v.reflowLargerCreateNewLayout)(this.lines,d);(0,v.reflowLargerApplyNewLayout)(this.lines,b.layout),this._reflowLargerAdjustViewport(t,s,b.countRemoved)}}_reflowLargerAdjustViewport(t,s,d){const b=this.getNullCell(f.DEFAULT_ATTR_DATA);let m=d;for(;m-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new f.BufferLine(t,b))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-d,0)}_reflowSmaller(t,s){const d=this.getNullCell(f.DEFAULT_ATTR_DATA),b=[];let m=0;for(let y=this.lines.length-1;y>=0;y--){let p=this.lines.get(y);if(!p||!p.isWrapped&&p.getTrimmedLength()<=t)continue;const E=[p];for(;p.isWrapped&&y>0;)p=this.lines.get(--y),E.unshift(p);const T=this.ybase+this.y;if(T>=y&&T<y+E.length)continue;const B=E[E.length-1].getTrimmedLength(),O=(0,v.reflowSmallerGetNewLineLengths)(E,this._cols,t),D=O.length-E.length;let P;P=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 N=[];for(let A=0;A<D;A++){const M=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);N.push(M)}N.length>0&&(b.push({start:y+E.length+m,newLines:N}),m+=N.length),E.push(...N);let U=O.length-1,G=O[U];G===0&&(U--,G=O[U]);let $=E.length-D-1,x=B;for(;$>=0;){const A=Math.min(x,G);if(E[U]===void 0)break;if(E[U].copyCellsFrom(E[$],x-A,G-A,A,!0),G-=A,G===0&&(U--,G=O[U]),x-=A,x===0){$--;const M=Math.max($,0);x=(0,v.getWrappedLineTrimmedLength)(E,M,this._cols)}}for(let A=0;A<E.length;A++)O[A]<t&&E[A].setCell(O[A],d);let L=D-P;for(;L-- >0;)this.ybase===0?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+m)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+s-1)}if(b.length>0){const y=[],p=[];for(let U=0;U<this.lines.length;U++)p.push(this.lines.get(U));const E=this.lines.length;let T=E-1,B=0,O=b[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+m);let D=0;for(let U=Math.min(this.lines.maxLength-1,E+m-1);U>=0;U--)if(O&&O.start>T+D){for(let G=O.newLines.length-1;G>=0;G--)this.lines.set(U--,O.newLines[G]);U++,y.push({index:T+1,amount:O.newLines.length}),D+=O.newLines.length,O=b[++B]}else this.lines.set(U,p[T--]);let P=0;for(let U=y.length-1;U>=0;U--)y[U].index+=P,this.lines.onInsertEmitter.fire(y[U]),P+=y[U].amount;const N=Math.max(0,E+m-this.lines.maxLength);N>0&&this.lines.onTrimEmitter.fire(N)}}translateBufferLineToString(t,s,d=0,b){const m=this.lines.get(t);return m?m.translateToString(s,d,b):""}getWrappedRangeForLine(t){let s=t,d=t;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;d+1<this.lines.length&&this.lines.get(d+1).isWrapped;)d++;return{first:s,last:d}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===t&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose(),this.markers.splice(t--,1);this._isClearing=!1}addMarker(t){const s=new i.Marker(t);return this.markers.push(s),s.register(this.lines.onTrim(d=>{s.line-=d,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(d=>{s.line>=d.index&&(s.line+=d.amount)})),s.register(this.lines.onDelete(d=>{s.line>=d.index&&s.line<d.index+d.amount&&s.dispose(),s.line>d.index&&(s.line-=d.amount)})),s.register(s.onDispose(()=>this._removeMarker(s))),s}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}}},8437:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const h=o(3734),_=o(511),a=o(643),f=o(482);r.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let v=0;class C{constructor(i,n,t=!1){this.isWrapped=t,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*i);const s=n||_.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let d=0;d<i;++d)this.setCell(d,s);this.length=i}get(i){const n=this._data[3*i+0],t=2097151&n;return[this._data[3*i+1],2097152&n?this._combined[i]:t?(0,f.stringFromCodePoint)(t):"",n>>22,2097152&n?this._combined[i].charCodeAt(this._combined[i].length-1):t]}set(i,n){this._data[3*i+1]=n[a.CHAR_DATA_ATTR_INDEX],n[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[i]=n[1],this._data[3*i+0]=2097152|i|n[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*i+0]=n[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|n[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(i){return this._data[3*i+0]>>22}hasWidth(i){return 12582912&this._data[3*i+0]}getFg(i){return this._data[3*i+1]}getBg(i){return this._data[3*i+2]}hasContent(i){return 4194303&this._data[3*i+0]}getCodePoint(i){const n=this._data[3*i+0];return 2097152&n?this._combined[i].charCodeAt(this._combined[i].length-1):2097151&n}isCombined(i){return 2097152&this._data[3*i+0]}getString(i){const n=this._data[3*i+0];return 2097152&n?this._combined[i]:2097151&n?(0,f.stringFromCodePoint)(2097151&n):""}isProtected(i){return 536870912&this._data[3*i+2]}loadCell(i,n){return v=3*i,n.content=this._data[v+0],n.fg=this._data[v+1],n.bg=this._data[v+2],2097152&n.content&&(n.combinedData=this._combined[i]),268435456&n.bg&&(n.extended=this._extendedAttrs[i]),n}setCell(i,n){2097152&n.content&&(this._combined[i]=n.combinedData),268435456&n.bg&&(this._extendedAttrs[i]=n.extended),this._data[3*i+0]=n.content,this._data[3*i+1]=n.fg,this._data[3*i+2]=n.bg}setCellFromCodepoint(i,n,t,s){268435456&s.bg&&(this._extendedAttrs[i]=s.extended),this._data[3*i+0]=n|t<<22,this._data[3*i+1]=s.fg,this._data[3*i+2]=s.bg}addCodepointToCell(i,n,t){let s=this._data[3*i+0];2097152&s?this._combined[i]+=(0,f.stringFromCodePoint)(n):2097151&s?(this._combined[i]=(0,f.stringFromCodePoint)(2097151&s)+(0,f.stringFromCodePoint)(n),s&=-2097152,s|=2097152):s=n|4194304,t&&(s&=-12582913,s|=t<<22),this._data[3*i+0]=s}insertCells(i,n,t){if((i%=this.length)&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,t),n<this.length-i){const s=new _.CellData;for(let d=this.length-i-n-1;d>=0;--d)this.setCell(i+n+d,this.loadCell(i+d,s));for(let d=0;d<n;++d)this.setCell(i+d,t)}else for(let s=i;s<this.length;++s)this.setCell(s,t);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,t)}deleteCells(i,n,t){if(i%=this.length,n<this.length-i){const s=new _.CellData;for(let d=0;d<this.length-i-n;++d)this.setCell(i+d,this.loadCell(i+n+d,s));for(let d=this.length-n;d<this.length;++d)this.setCell(d,t)}else for(let s=i;s<this.length;++s)this.setCell(s,t);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,t),this.getWidth(i)!==0||this.hasContent(i)||this.setCellFromCodepoint(i,0,1,t)}replaceCells(i,n,t,s=!1){if(s)for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,t),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,t);i<n&&i<this.length;)this.isProtected(i)||this.setCell(i,t),i++;else for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,t),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,t);i<n&&i<this.length;)this.setCell(i++,t)}resize(i,n){if(i===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const t=3*i;if(i>this.length){if(this._data.buffer.byteLength>=4*t)this._data=new Uint32Array(this._data.buffer,0,t);else{const s=new Uint32Array(t);s.set(this._data),this._data=s}for(let s=this.length;s<i;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,t);const s=Object.keys(this._combined);for(let b=0;b<s.length;b++){const m=parseInt(s[b],10);m>=i&&delete this._combined[m]}const d=Object.keys(this._extendedAttrs);for(let b=0;b<d.length;b++){const m=parseInt(d[b],10);m>=i&&delete this._extendedAttrs[m]}}return this.length=i,4*t*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,n=!1){if(n)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,i);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,i)}}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(const n in i._combined)this._combined[n]=i._combined[n];this._extendedAttrs={};for(const n in i._extendedAttrs)this._extendedAttrs[n]=i._extendedAttrs[n];this.isWrapped=i.isWrapped}clone(){const i=new C(0);i._data=new Uint32Array(this._data),i.length=this.length;for(const n in this._combined)i._combined[n]=this._combined[n];for(const n in this._extendedAttrs)i._extendedAttrs[n]=this._extendedAttrs[n];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0])return i+(this._data[3*i+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0]||50331648&this._data[3*i+2])return i+(this._data[3*i+0]>>22);return 0}copyCellsFrom(i,n,t,s,d){const b=i._data;if(d)for(let y=s-1;y>=0;y--){for(let p=0;p<3;p++)this._data[3*(t+y)+p]=b[3*(n+y)+p];268435456&b[3*(n+y)+2]&&(this._extendedAttrs[t+y]=i._extendedAttrs[n+y])}else for(let y=0;y<s;y++){for(let p=0;p<3;p++)this._data[3*(t+y)+p]=b[3*(n+y)+p];268435456&b[3*(n+y)+2]&&(this._extendedAttrs[t+y]=i._extendedAttrs[n+y])}const m=Object.keys(i._combined);for(let y=0;y<m.length;y++){const p=parseInt(m[y],10);p>=n&&(this._combined[p-n+t]=i._combined[p])}}translateToString(i,n,t,s){n=n??0,t=t??this.length,i&&(t=Math.min(t,this.getTrimmedLength())),s&&(s.length=0);let d="";for(;n<t;){const b=this._data[3*n+0],m=2097151&b,y=2097152&b?this._combined[n]:m?(0,f.stringFromCodePoint)(m):a.WHITESPACE_CELL_CHAR;if(d+=y,s)for(let p=0;p<y.length;++p)s.push(n);n+=b>>22||1}return s&&s.push(n),d}}r.BufferLine=C},4841:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(o,h){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return h*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(R,r)=>{function o(h,_,a){if(_===h.length-1)return h[_].getTrimmedLength();const f=!h[_].hasContent(a-1)&&h[_].getWidth(a-1)===1,v=h[_+1].getWidth(0)===2;return f&&v?a-1:a}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(h,_,a,f,v){const C=[];for(let u=0;u<h.length-1;u++){let i=u,n=h.get(++i);if(!n.isWrapped)continue;const t=[h.get(u)];for(;i<h.length&&n.isWrapped;)t.push(n),n=h.get(++i);if(f>=u&&f<i){u+=t.length-1;continue}let s=0,d=o(t,s,_),b=1,m=0;for(;b<t.length;){const p=o(t,b,_),E=p-m,T=a-d,B=Math.min(E,T);t[s].copyCellsFrom(t[b],m,d,B,!1),d+=B,d===a&&(s++,d=0),m+=B,m===p&&(b++,m=0),d===0&&s!==0&&t[s-1].getWidth(a-1)===2&&(t[s].copyCellsFrom(t[s-1],a-1,d++,1,!1),t[s-1].setCell(a-1,v))}t[s].replaceCells(d,a,v);let y=0;for(let p=t.length-1;p>0&&(p>s||t[p].getTrimmedLength()===0);p--)y++;y>0&&(C.push(u+t.length-y),C.push(y)),u+=t.length-1}return C},r.reflowLargerCreateNewLayout=function(h,_){const a=[];let f=0,v=_[f],C=0;for(let u=0;u<h.length;u++)if(v===u){const i=_[++f];h.onDeleteEmitter.fire({index:u-C,amount:i}),u+=i-1,C+=i,v=_[++f]}else a.push(u);return{layout:a,countRemoved:C}},r.reflowLargerApplyNewLayout=function(h,_){const a=[];for(let f=0;f<_.length;f++)a.push(h.get(_[f]));for(let f=0;f<a.length;f++)h.set(f,a[f]);h.length=_.length},r.reflowSmallerGetNewLineLengths=function(h,_,a){const f=[],v=h.map((n,t)=>o(h,t,_)).reduce((n,t)=>n+t);let C=0,u=0,i=0;for(;i<v;){if(v-i<a){f.push(v-i);break}C+=a;const n=o(h,u,_);C>n&&(C-=n,u++);const t=h[u].getWidth(C-1)===2;t&&C--;const s=t?a-1:a;f.push(s),i+=s}return f},r.getWrappedLineTrimmedLength=o},5295:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const h=o(8460),_=o(844),a=o(9092);class f extends _.Disposable{constructor(C,u){super(),this._optionsService=C,this._bufferService=u,this._onBufferActivate=this.register(new h.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 a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.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(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,u){this._normal.resize(C,u),this._alt.resize(C,u),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}r.BufferSet=f},511:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const h=o(482),_=o(643),a=o(3734);class f extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const u=new f;return u.setFromCharData(C),u}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(C[_.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(C[_.CHAR_DATA_CHAR_INDEX].length===2){const i=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const n=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(i-55296)+n-56320+65536|C[_.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[_.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=C[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=f},643:(R,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:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const h=o(8460),_=o(844);class a{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new h.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=a,a._nextId=1},7116:(R,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:(R,r)=>{var o,h,_;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
8
+ `,a.VT="\v",a.FF="\f",a.CR="\r",a.SO="",a.SI="",a.DLE="",a.DC1="",a.DC2="",a.DC3="",a.DC4="",a.NAK="",a.SYN="",a.ETB="",a.CAN="",a.EM="",a.SUB="",a.ESC="\x1B",a.FS="",a.GS="",a.RS="",a.US="",a.SP=" ",a.DEL=""}(o||(r.C0=o={})),function(a){a.PAD="€",a.HOP="",a.BPH="‚",a.NBH="ƒ",a.IND="„",a.NEL="…",a.SSA="†",a.ESA="‡",a.HTS="ˆ",a.HTJ="‰",a.VTS="Š",a.PLD="‹",a.PLU="Œ",a.RI="",a.SS2="Ž",a.SS3="",a.DCS="",a.PU1="‘",a.PU2="’",a.STS="“",a.CCH="”",a.MW="•",a.SPA="–",a.EPA="—",a.SOS="˜",a.SGCI="™",a.SCI="š",a.CSI="›",a.ST="œ",a.OSC="",a.PM="ž",a.APC="Ÿ"}(h||(r.C1=h={})),function(a){a.ST=`${o.ESC}\\`}(_||(r.C1_ESCAPED=_={}))},7399:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const h=o(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(a,f,v,C){const u={type:0,cancel:!1,key:void 0},i=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:a.key==="UIKeyInputUpArrow"?u.key=f?h.C0.ESC+"OA":h.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?u.key=f?h.C0.ESC+"OD":h.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?u.key=f?h.C0.ESC+"OC":h.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(u.key=f?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:u.key=a.ctrlKey?"\b":h.C0.DEL,a.altKey&&(u.key=h.C0.ESC+u.key);break;case 9:if(a.shiftKey){u.key=h.C0.ESC+"[Z";break}u.key=h.C0.HT,u.cancel=!0;break;case 13:u.key=a.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,u.cancel=!0;break;case 27:u.key=h.C0.ESC,a.altKey&&(u.key=h.C0.ESC+h.C0.ESC),u.cancel=!0;break;case 37:if(a.metaKey)break;i?(u.key=h.C0.ESC+"[1;"+(i+1)+"D",u.key===h.C0.ESC+"[1;3D"&&(u.key=h.C0.ESC+(v?"b":"[1;5D"))):u.key=f?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(a.metaKey)break;i?(u.key=h.C0.ESC+"[1;"+(i+1)+"C",u.key===h.C0.ESC+"[1;3C"&&(u.key=h.C0.ESC+(v?"f":"[1;5C"))):u.key=f?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(a.metaKey)break;i?(u.key=h.C0.ESC+"[1;"+(i+1)+"A",v||u.key!==h.C0.ESC+"[1;3A"||(u.key=h.C0.ESC+"[1;5A")):u.key=f?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(a.metaKey)break;i?(u.key=h.C0.ESC+"[1;"+(i+1)+"B",v||u.key!==h.C0.ESC+"[1;3B"||(u.key=h.C0.ESC+"[1;5B")):u.key=f?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(u.key=h.C0.ESC+"[2~");break;case 46:u.key=i?h.C0.ESC+"[3;"+(i+1)+"~":h.C0.ESC+"[3~";break;case 36:u.key=i?h.C0.ESC+"[1;"+(i+1)+"H":f?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:u.key=i?h.C0.ESC+"[1;"+(i+1)+"F":f?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:a.shiftKey?u.type=2:a.ctrlKey?u.key=h.C0.ESC+"[5;"+(i+1)+"~":u.key=h.C0.ESC+"[5~";break;case 34:a.shiftKey?u.type=3:a.ctrlKey?u.key=h.C0.ESC+"[6;"+(i+1)+"~":u.key=h.C0.ESC+"[6~";break;case 112:u.key=i?h.C0.ESC+"[1;"+(i+1)+"P":h.C0.ESC+"OP";break;case 113:u.key=i?h.C0.ESC+"[1;"+(i+1)+"Q":h.C0.ESC+"OQ";break;case 114:u.key=i?h.C0.ESC+"[1;"+(i+1)+"R":h.C0.ESC+"OR";break;case 115:u.key=i?h.C0.ESC+"[1;"+(i+1)+"S":h.C0.ESC+"OS";break;case 116:u.key=i?h.C0.ESC+"[15;"+(i+1)+"~":h.C0.ESC+"[15~";break;case 117:u.key=i?h.C0.ESC+"[17;"+(i+1)+"~":h.C0.ESC+"[17~";break;case 118:u.key=i?h.C0.ESC+"[18;"+(i+1)+"~":h.C0.ESC+"[18~";break;case 119:u.key=i?h.C0.ESC+"[19;"+(i+1)+"~":h.C0.ESC+"[19~";break;case 120:u.key=i?h.C0.ESC+"[20;"+(i+1)+"~":h.C0.ESC+"[20~";break;case 121:u.key=i?h.C0.ESC+"[21;"+(i+1)+"~":h.C0.ESC+"[21~";break;case 122:u.key=i?h.C0.ESC+"[23;"+(i+1)+"~":h.C0.ESC+"[23~";break;case 123:u.key=i?h.C0.ESC+"[24;"+(i+1)+"~":h.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(v&&!C||!a.altKey||a.metaKey)!v||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?u.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(u.key=h.C0.US),a.key==="@"&&(u.key=h.C0.NUL)):a.keyCode===65&&(u.type=1);else{const n=_[a.keyCode],t=n==null?void 0:n[a.shiftKey?1:0];if(t)u.key=h.C0.ESC+t;else if(a.keyCode>=65&&a.keyCode<=90){const s=a.ctrlKey?a.keyCode-64:a.keyCode+32;let d=String.fromCharCode(s);a.shiftKey&&(d=d.toUpperCase()),u.key=h.C0.ESC+d}else if(a.keyCode===32)u.key=h.C0.ESC+(a.ctrlKey?h.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let s=a.code.slice(3,4);a.shiftKey||(s=s.toLowerCase()),u.key=h.C0.ESC+s,u.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?u.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?u.key=h.C0.NUL:a.keyCode>=51&&a.keyCode<=55?u.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?u.key=h.C0.DEL:a.keyCode===219?u.key=h.C0.ESC:a.keyCode===220?u.key=h.C0.FS:a.keyCode===221&&(u.key=h.C0.GS)}return u}},482:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,h=0,_=o.length){let a="";for(let f=h;f<_;++f){let v=o[f];v>65535?(v-=65536,a+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):a+=String.fromCharCode(v)}return a},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,h){const _=o.length;if(!_)return 0;let a=0,f=0;if(this._interim){const v=o.charCodeAt(f++);56320<=v&&v<=57343?h[a++]=1024*(this._interim-55296)+v-56320+65536:(h[a++]=this._interim,h[a++]=v),this._interim=0}for(let v=f;v<_;++v){const C=o.charCodeAt(v);if(55296<=C&&C<=56319){if(++v>=_)return this._interim=C,a;const u=o.charCodeAt(v);56320<=u&&u<=57343?h[a++]=1024*(C-55296)+u-56320+65536:(h[a++]=C,h[a++]=u)}else C!==65279&&(h[a++]=C)}return a}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,h){const _=o.length;if(!_)return 0;let a,f,v,C,u=0,i=0,n=0;if(this.interim[0]){let d=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let m,y=0;for(;(m=63&this.interim[++y])&&y<4;)b<<=6,b|=m;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=p-y;for(;n<E;){if(n>=_)return 0;if(m=o[n++],(192&m)!=128){n--,d=!0;break}this.interim[y++]=m,b<<=6,b|=63&m}d||(p===2?b<128?n--:h[u++]=b:p===3?b<2048||b>=55296&&b<=57343||b===65279||(h[u++]=b):b<65536||b>1114111||(h[u++]=b)),this.interim.fill(0)}const t=_-4;let s=n;for(;s<_;){for(;!(!(s<t)||128&(a=o[s])||128&(f=o[s+1])||128&(v=o[s+2])||128&(C=o[s+3]));)h[u++]=a,h[u++]=f,h[u++]=v,h[u++]=C,s+=4;if(a=o[s++],a<128)h[u++]=a;else if((224&a)==192){if(s>=_)return this.interim[0]=a,u;if(f=o[s++],(192&f)!=128){s--;continue}if(i=(31&a)<<6|63&f,i<128){s--;continue}h[u++]=i}else if((240&a)==224){if(s>=_)return this.interim[0]=a,u;if(f=o[s++],(192&f)!=128){s--;continue}if(s>=_)return this.interim[0]=a,this.interim[1]=f,u;if(v=o[s++],(192&v)!=128){s--;continue}if(i=(15&a)<<12|(63&f)<<6|63&v,i<2048||i>=55296&&i<=57343||i===65279)continue;h[u++]=i}else if((248&a)==240){if(s>=_)return this.interim[0]=a,u;if(f=o[s++],(192&f)!=128){s--;continue}if(s>=_)return this.interim[0]=a,this.interim[1]=f,u;if(v=o[s++],(192&v)!=128){s--;continue}if(s>=_)return this.interim[0]=a,this.interim[1]=f,this.interim[2]=v,u;if(C=o[s++],(192&C)!=128){s--;continue}if(i=(7&a)<<18|(63&f)<<12|(63&v)<<6|63&C,i<65536||i>1114111)continue;h[u++]=i}}return u}}},225:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const h=o(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],a=[[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(C,u){let i,n=0,t=u.length-1;if(C<u[0][0]||C>u[t][1])return!1;for(;t>=n;)if(i=n+t>>1,C>u[i][1])n=i+1;else{if(!(C<u[i][0]))return!0;t=i-1}return!1}(v,a)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,C){let u=this.wcwidth(v),i=u===0&&C!==0;if(i){const n=h.UnicodeService.extractWidth(C);n===0?i=!1:n>u&&(u=n)}return h.UnicodeService.createPropertyValue(0,u,i)}}},5981:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const h=o(8460),_=o(844);class a 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 h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,C){if(C!==void 0&&this._syncCalls>C)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 i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,C){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(C),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(C)}_innerWrite(v=0,C=!0){const u=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const i=this._writeBuffer[this._bufferOffset],n=this._action(i,C);if(n){const s=d=>Date.now()-u>=12?setTimeout(()=>this._innerWrite(0,d)):this._innerWrite(u,d);return void n.catch(d=>(queueMicrotask(()=>{throw d}),Promise.resolve(!1))).then(s)}const t=this._callbacks[this._bufferOffset];if(t&&t(),this._bufferOffset++,this._pendingData-=i.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=a},5941:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function _(a,f){const v=a.toString(16),C=v.length<2?"0"+v:v;switch(f){case 4:return v[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}r.parseColor=function(a){if(!a)return;let f=a.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const v=o.exec(f);if(v){const C=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/C*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/C*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/C*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),h.exec(f)&&[3,6,9,12].includes(f.length))){const v=f.length/3,C=[0,0,0];for(let u=0;u<3;++u){const i=parseInt(f.slice(v*u,v*u+v),16);C[u]=v===1?i<<4:v===2?i:v===3?i>>4:i>>8}return C}},r.toRgbString=function(a,f=16){const[v,C,u]=a;return`rgb:${_(v,f)}/${_(C,f)}/${_(u,f)}`}},5770:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const h=o(482),_=o(8742),a=o(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(C,u){this._handlers[C]===void 0&&(this._handlers[C]=[]);const i=this._handlers[C];return i.push(u),{dispose:()=>{const n=i.indexOf(u);n!==-1&&i.splice(n,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(C,u){if(this.reset(),this._ident=C,this._active=this._handlers[C]||f,this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(u);else this._handlerFb(this._ident,"HOOK",u)}put(C,u,i){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(C,u,i);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(C,u,i))}unhook(C,u=!0){if(this._active.length){let i=!1,n=this._active.length-1,t=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=u,t=this._stack.fallThrough,this._stack.paused=!1),!t&&i===!1){for(;n>=0&&(i=this._active[n].unhook(C),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",C);this._active=f,this._ident=0}};const v=new _.Params;v.addParam(0),r.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=v,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():v,this._data="",this._hitLimit=!1}put(C,u,i){this._hitLimit||(this._data+=(0,h.utf32ToString)(C,u,i),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let u=!1;if(this._hitLimit)u=!1;else if(C&&(u=this._handler(this._data,this._params),u instanceof Promise))return u.then(i=>(this._params=v,this._data="",this._hitLimit=!1,i));return this._params=v,this._data="",this._hitLimit=!1,u}}},2015:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const h=o(844),_=o(8742),a=o(6242),f=o(6351);class v{constructor(n){this.table=new Uint8Array(n)}setDefault(n,t){this.table.fill(n<<4|t)}add(n,t,s,d){this.table[t<<8|n]=s<<4|d}addMany(n,t,s,d){for(let b=0;b<n.length;b++)this.table[t<<8|n[b]]=s<<4|d}}r.TransitionTable=v;const C=160;r.VT500_TRANSITION_TABLE=function(){const i=new v(4095),n=Array.apply(null,Array(256)).map((y,p)=>p),t=(y,p)=>n.slice(y,p),s=t(32,127),d=t(0,24);d.push(25),d.push.apply(d,t(28,32));const b=t(0,14);let m;for(m in i.setDefault(1,0),i.addMany(s,0,2,0),b)i.addMany([24,26,153,154],m,3,0),i.addMany(t(128,144),m,3,0),i.addMany(t(144,152),m,3,0),i.add(156,m,0,0),i.add(27,m,11,1),i.add(157,m,4,8),i.addMany([152,158,159],m,0,7),i.add(155,m,11,3),i.add(144,m,11,9);return i.addMany(d,0,3,0),i.addMany(d,1,3,1),i.add(127,1,0,1),i.addMany(d,8,0,8),i.addMany(d,3,3,3),i.add(127,3,0,3),i.addMany(d,4,3,4),i.add(127,4,0,4),i.addMany(d,6,3,6),i.addMany(d,5,3,5),i.add(127,5,0,5),i.addMany(d,2,3,2),i.add(127,2,0,2),i.add(93,1,4,8),i.addMany(s,8,5,8),i.add(127,8,5,8),i.addMany([156,27,24,26,7],8,6,0),i.addMany(t(28,32),8,0,8),i.addMany([88,94,95],1,0,7),i.addMany(s,7,0,7),i.addMany(d,7,0,7),i.add(156,7,0,0),i.add(127,7,0,7),i.add(91,1,11,3),i.addMany(t(64,127),3,7,0),i.addMany(t(48,60),3,8,4),i.addMany([60,61,62,63],3,9,4),i.addMany(t(48,60),4,8,4),i.addMany(t(64,127),4,7,0),i.addMany([60,61,62,63],4,0,6),i.addMany(t(32,64),6,0,6),i.add(127,6,0,6),i.addMany(t(64,127),6,0,0),i.addMany(t(32,48),3,9,5),i.addMany(t(32,48),5,9,5),i.addMany(t(48,64),5,0,6),i.addMany(t(64,127),5,7,0),i.addMany(t(32,48),4,9,5),i.addMany(t(32,48),1,9,2),i.addMany(t(32,48),2,9,2),i.addMany(t(48,127),2,10,0),i.addMany(t(48,80),1,10,0),i.addMany(t(81,88),1,10,0),i.addMany([89,90,92],1,10,0),i.addMany(t(96,127),1,10,0),i.add(80,1,11,9),i.addMany(d,9,0,9),i.add(127,9,0,9),i.addMany(t(28,32),9,0,9),i.addMany(t(32,48),9,9,12),i.addMany(t(48,60),9,8,10),i.addMany([60,61,62,63],9,9,10),i.addMany(d,11,0,11),i.addMany(t(32,128),11,0,11),i.addMany(t(28,32),11,0,11),i.addMany(d,10,0,10),i.add(127,10,0,10),i.addMany(t(28,32),10,0,10),i.addMany(t(48,60),10,8,10),i.addMany([60,61,62,63],10,0,11),i.addMany(t(32,48),10,9,12),i.addMany(d,12,0,12),i.add(127,12,0,12),i.addMany(t(28,32),12,0,12),i.addMany(t(32,48),12,9,12),i.addMany(t(48,64),12,0,11),i.addMany(t(64,127),12,12,13),i.addMany(t(64,127),10,12,13),i.addMany(t(64,127),9,12,13),i.addMany(d,13,13,13),i.addMany(s,13,13,13),i.add(127,13,0,13),i.addMany([27,156,24,26],13,14,0),i.add(C,0,2,0),i.add(C,8,5,8),i.add(C,6,0,6),i.add(C,11,0,11),i.add(C,13,13,13),i}();class u extends h.Disposable{constructor(n=r.VT500_TRANSITION_TABLE){super(),this._transitions=n,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=(t,s,d)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,s)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(n,t=[64,126]){let s=0;if(n.prefix){if(n.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=n.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(n.intermediates){if(n.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let b=0;b<n.intermediates.length;++b){const m=n.intermediates.charCodeAt(b);if(32>m||m>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=m}}if(n.final.length!==1)throw new Error("final must be a single byte");const d=n.final.charCodeAt(0);if(t[0]>d||d>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return s<<=8,s|=d,s}identToString(n){const t=[];for(;n;)t.push(String.fromCharCode(255&n)),n>>=8;return t.reverse().join("")}setPrintHandler(n){this._printHandler=n}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(n,t){const s=this._identifier(n,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);const d=this._escHandlers[s];return d.push(t),{dispose:()=>{const b=d.indexOf(t);b!==-1&&d.splice(b,1)}}}clearEscHandler(n){this._escHandlers[this._identifier(n,[48,126])]&&delete this._escHandlers[this._identifier(n,[48,126])]}setEscHandlerFallback(n){this._escHandlerFb=n}setExecuteHandler(n,t){this._executeHandlers[n.charCodeAt(0)]=t}clearExecuteHandler(n){this._executeHandlers[n.charCodeAt(0)]&&delete this._executeHandlers[n.charCodeAt(0)]}setExecuteHandlerFallback(n){this._executeHandlerFb=n}registerCsiHandler(n,t){const s=this._identifier(n);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);const d=this._csiHandlers[s];return d.push(t),{dispose:()=>{const b=d.indexOf(t);b!==-1&&d.splice(b,1)}}}clearCsiHandler(n){this._csiHandlers[this._identifier(n)]&&delete this._csiHandlers[this._identifier(n)]}setCsiHandlerFallback(n){this._csiHandlerFb=n}registerDcsHandler(n,t){return this._dcsParser.registerHandler(this._identifier(n),t)}clearDcsHandler(n){this._dcsParser.clearHandler(this._identifier(n))}setDcsHandlerFallback(n){this._dcsParser.setHandlerFallback(n)}registerOscHandler(n,t){return this._oscParser.registerHandler(n,t)}clearOscHandler(n){this._oscParser.clearHandler(n)}setOscHandlerFallback(n){this._oscParser.setHandlerFallback(n)}setErrorHandler(n){this._errorHandler=n}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(n,t,s,d,b){this._parseStack.state=n,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=d,this._parseStack.chunkPos=b}parse(n,t,s){let d,b=0,m=0,y=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,y=this._parseStack.chunkPos+1;else{if(s===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(s===!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(s===!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(b=n[this._parseStack.chunkPos],d=this._dcsParser.unhook(b!==24&&b!==26,s),d)return d;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(b=n[this._parseStack.chunkPos],d=this._oscParser.end(b!==24&&b!==26,s),d)return d;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,y=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let p=y;p<t;++p){switch(b=n[p],m=this._transitions.table[this.currentState<<8|(b<160?b:C)],m>>4){case 2:for(let D=p+1;;++D){if(D>=t||(b=n[D])<32||b>126&&b<C){this._printHandler(n,p,D),p=D-1;break}if(++D>=t||(b=n[D])<32||b>126&&b<C){this._printHandler(n,p,D),p=D-1;break}if(++D>=t||(b=n[D])<32||b>126&&b<C){this._printHandler(n,p,D),p=D-1;break}if(++D>=t||(b=n[D])<32||b>126&&b<C){this._printHandler(n,p,D),p=D-1;break}}break;case 3:this._executeHandlers[b]?this._executeHandlers[b]():this._executeHandlerFb(b),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:b,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|b];let T=E?E.length-1:-1;for(;T>=0&&(d=E[T](this._params),d!==!0);T--)if(d instanceof Promise)return this._preserveStack(3,E,T,m,p),d;T<0&&this._csiHandlerFb(this._collect<<8|b,this._params),this.precedingJoinState=0;break;case 8:do switch(b){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(b-48)}while(++p<t&&(b=n[p])>47&&b<60);p--;break;case 9:this._collect<<=8,this._collect|=b;break;case 10:const B=this._escHandlers[this._collect<<8|b];let O=B?B.length-1:-1;for(;O>=0&&(d=B[O](),d!==!0);O--)if(d instanceof Promise)return this._preserveStack(4,B,O,m,p),d;O<0&&this._escHandlerFb(this._collect<<8|b),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|b,this._params);break;case 13:for(let D=p+1;;++D)if(D>=t||(b=n[D])===24||b===26||b===27||b>127&&b<C){this._dcsParser.put(n,p,D),p=D-1;break}break;case 14:if(d=this._dcsParser.unhook(b!==24&&b!==26),d)return this._preserveStack(6,[],0,m,p),d;b===27&&(m|=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>=t||(b=n[D])<32||b>127&&b<C){this._oscParser.put(n,p,D),p=D-1;break}break;case 6:if(d=this._oscParser.end(b!==24&&b!==26),d)return this._preserveStack(5,[],0,m,p),d;b===27&&(m|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&m}}}r.EscapeSequenceParser=u},6242:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const h=o(5770),_=o(482),a=[];r.OscParser=class{constructor(){this._state=0,this._active=a,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 C=this._handlers[f];return C.push(v),{dispose:()=>{const u=C.indexOf(v);u!==-1&&C.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=a}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=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,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,C){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(f,v,C);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(f,v,C))}start(){this.reset(),this._state=1}put(f,v,C){if(this._state!==3){if(this._state===1)for(;v<C;){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&&C-v>0&&this._put(f,v,C)}}end(f,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,u=this._active.length-1,i=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,C=v,i=this._stack.fallThrough,this._stack.paused=!1),!i&&C===!1){for(;u>=0&&(C=this._active[u].end(f),C!==!0);u--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,C;u--}for(;u>=0;u--)if(C=this._active[u].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",f);this._active=a,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,C){this._hitLimit||(this._data+=(0,_.utf32ToString)(f,v,C),this._data.length>h.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(C=>(this._data="",this._hitLimit=!1,C));return this._data="",this._hitLimit=!1,v}}},8742:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const o=2147483647;class h{static fromArray(a){const f=new h;if(!a.length)return f;for(let v=Array.isArray(a[0])?1:0;v<a.length;++v){const C=a[v];if(Array.isArray(C))for(let u=0;u<C.length;++u)f.addSubParam(C[u]);else f.addParam(C)}return f}constructor(a=32,f=32){if(this.maxLength=a,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new h(this.maxLength,this.maxSubParamsLength);return a.params.set(this.params),a.length=this.length,a._subParams.set(this._subParams),a._subParamsLength=this._subParamsLength,a._subParamsIdx.set(this._subParamsIdx),a._rejectDigits=this._rejectDigits,a._rejectSubDigits=this._rejectSubDigits,a._digitIsSub=this._digitIsSub,a}toArray(){const a=[];for(let f=0;f<this.length;++f){a.push(this.params[f]);const v=this._subParamsIdx[f]>>8,C=255&this._subParamsIdx[f];C-v>0&&a.push(Array.prototype.slice.call(this._subParams,v,C))}return a}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(a){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=a>o?o:a}}addSubParam(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=a>o?o:a,this._subParamsIdx[this.length-1]++}}hasSubParams(a){return(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)>0}getSubParams(a){const f=this._subParamsIdx[a]>>8,v=255&this._subParamsIdx[a];return v-f>0?this._subParams.subarray(f,v):null}getSubParamsAll(){const a={};for(let f=0;f<this.length;++f){const v=this._subParamsIdx[f]>>8,C=255&this._subParamsIdx[f];C-v>0&&(a[f]=this._subParams.slice(v,C))}return a}addDigit(a){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,C=v[f-1];v[f-1]=~C?Math.min(10*C+a,o):a}}r.Params=h},5741:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,h){const _={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(_),h.dispose=()=>this._wrappedAddonDispose(_),h.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let h=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===o){h=_;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(h,1)}}},8771:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const h=o(3785),_=o(511);r.BufferApiView=class{constructor(a,f){this._buffer=a,this.type=f}init(a){return this._buffer=a,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(a){const f=this._buffer.lines.get(a);if(f)return new h.BufferLineApiView(f)}getNullCell(){return new _.CellData}}},3785:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const h=o(511);r.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,a){if(!(_<0||_>=this._line.length))return a?(this._line.loadCell(_,a),a):this._line.loadCell(_,new h.CellData)}translateToString(_,a,f){return this._line.translateToString(_,a,f)}}},8285:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const h=o(8771),_=o(8460),a=o(844);class f extends a.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,h){return this._core.registerCsiHandler(o,_=>h(_.toArray()))}addCsiHandler(o,h){return this.registerCsiHandler(o,h)}registerDcsHandler(o,h){return this._core.registerDcsHandler(o,(_,a)=>h(_,a.toArray()))}addDcsHandler(o,h){return this.registerDcsHandler(o,h)}registerEscHandler(o,h){return this._core.registerEscHandler(o,h)}addEscHandler(o,h){return this.registerEscHandler(o,h)}registerOscHandler(o,h){return this._core.registerOscHandler(o,h)}addOscHandler(o,h){return this.registerOscHandler(o,h)}}},7090:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(R,r,o){var h=this&&this.__decorate||function(i,n,t,s){var d,b=arguments.length,m=b<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,n,t,s);else for(var y=i.length-1;y>=0;y--)(d=i[y])&&(m=(b<3?d(m):b>3?d(n,t,m):d(n,t))||m);return b>3&&m&&Object.defineProperty(n,t,m),m},_=this&&this.__param||function(i,n){return function(t,s){n(t,s,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const a=o(8460),f=o(844),v=o(5295),C=o(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let u=r.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(i){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(i.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(i.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(i,this))}resize(i,n){this.cols=i,this.rows=n,this.buffers.resize(i,n),this._onResize.fire({cols:i,rows:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(i,n=!1){const t=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===i.fg&&s.getBg(0)===i.bg||(s=t.getBlankLine(i,n),this._cachedBlankLine=s),s.isWrapped=n;const d=t.ybase+t.scrollTop,b=t.ybase+t.scrollBottom;if(t.scrollTop===0){const m=t.lines.isFull;b===t.lines.length-1?m?t.lines.recycle().copyFrom(s):t.lines.push(s.clone()):t.lines.splice(b+1,0,s.clone()),m?this.isUserScrolling&&(t.ydisp=Math.max(t.ydisp-1,0)):(t.ybase++,this.isUserScrolling||t.ydisp++)}else{const m=b-d+1;t.lines.shiftElements(d+1,m-1,-1),t.lines.set(b,s.clone())}this.isUserScrolling||(t.ydisp=t.ybase),this._onScroll.fire(t.ydisp)}scrollLines(i,n,t){const s=this.buffer;if(i<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else i+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const d=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+i,s.ybase),0),d!==s.ydisp&&(n||this._onScroll.fire(s.ydisp))}};r.BufferService=u=h([_(0,C.IOptionsService)],u)},7994:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,h){this._charsets[o]=h,this.glevel===o&&(this.charset=h)}}},1753:function(R,r,o){var h=this&&this.__decorate||function(s,d,b,m){var y,p=arguments.length,E=p<3?d:m===null?m=Object.getOwnPropertyDescriptor(d,b):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(s,d,b,m);else for(var T=s.length-1;T>=0;T--)(y=s[T])&&(E=(p<3?y(E):p>3?y(d,b,E):y(d,b))||E);return p>3&&E&&Object.defineProperty(d,b,E),E},_=this&&this.__param||function(s,d){return function(b,m){d(b,m,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const a=o(2585),f=o(8460),v=o(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>s.action!==32||s.button!==3},ANY:{events:31,restrict:s=>!0}};function u(s,d){let b=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(b|=64,b|=s.action):(b|=3&s.button,4&s.button&&(b|=64),8&s.button&&(b|=128),s.action===32?b|=32:s.action!==0||d||(b|=3)),b}const i=String.fromCharCode,n={DEFAULT:s=>{const d=[u(s,!1)+32,s.col+32,s.row+32];return d[0]>255||d[1]>255||d[2]>255?"":`\x1B[M${i(d[0])}${i(d[1])}${i(d[2])}`},SGR:s=>{const d=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${u(s,!0)};${s.col};${s.row}${d}`},SGR_PIXELS:s=>{const d=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${u(s,!0)};${s.x};${s.y}${d}`}};let t=r.CoreMouseService=class extends v.Disposable{constructor(s,d){super(),this._bufferService=s,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 b of Object.keys(C))this.addProtocol(b,C[b]);for(const b of Object.keys(n))this.addEncoding(b,n[b]);this.reset()}addProtocol(s,d){this._protocols[s]=d}addEncoding(s,d){this._encodings[s]=d}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(s){if(!this._protocols[s])throw new Error(`unknown protocol "${s}"`);this._activeProtocol=s,this._onProtocolChange.fire(this._protocols[s].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(s){if(!this._encodings[s])throw new Error(`unknown encoding "${s}"`);this._activeEncoding=s}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(s){if(s.col<0||s.col>=this._bufferService.cols||s.row<0||s.row>=this._bufferService.rows||s.button===4&&s.action===32||s.button===3&&s.action!==32||s.button!==4&&(s.action===2||s.action===3)||(s.col++,s.row++,s.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,s,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(s))return!1;const d=this._encodings[this._activeEncoding](s);return d&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(d):this._coreService.triggerDataEvent(d,!0)),this._lastEvent=s,!0}explainEvents(s){return{down:!!(1&s),up:!!(2&s),drag:!!(4&s),move:!!(8&s),wheel:!!(16&s)}}_equalEvents(s,d,b){if(b){if(s.x!==d.x||s.y!==d.y)return!1}else if(s.col!==d.col||s.row!==d.row)return!1;return s.button===d.button&&s.action===d.action&&s.ctrl===d.ctrl&&s.alt===d.alt&&s.shift===d.shift}};r.CoreMouseService=t=h([_(0,a.IBufferService),_(1,a.ICoreService)],t)},6975:function(R,r,o){var h=this&&this.__decorate||function(t,s,d,b){var m,y=arguments.length,p=y<3?s:b===null?b=Object.getOwnPropertyDescriptor(s,d):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,d,b);else for(var E=t.length-1;E>=0;E--)(m=t[E])&&(p=(y<3?m(p):y>3?m(s,d,p):m(s,d))||p);return y>3&&p&&Object.defineProperty(s,d,p),p},_=this&&this.__param||function(t,s){return function(d,b){s(d,b,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const a=o(1439),f=o(8460),v=o(844),C=o(2585),u=Object.freeze({insertMode:!1}),i=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let n=r.CoreService=class extends v.Disposable{constructor(t,s,d){super(),this._bufferService=t,this._logService=s,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,a.clone)(u),this.decPrivateModes=(0,a.clone)(i)}reset(){this.modes=(0,a.clone)(u),this.decPrivateModes=(0,a.clone)(i)}triggerDataEvent(t,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const d=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&d.ybase!==d.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`,()=>t.split("").map(b=>b.charCodeAt(0))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`,()=>t.split("").map(s=>s.charCodeAt(0))),this._onBinary.fire(t))}};r.CoreService=n=h([_(0,C.IBufferService),_(1,C.ILogService),_(2,C.IOptionsService)],n)},9074:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const h=o(8055),_=o(8460),a=o(844),f=o(6106);let v=0,C=0;class u extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(t=>t==null?void 0:t.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,a.toDisposable)(()=>this.reset()))}registerDecoration(t){if(t.marker.isDisposed)return;const s=new i(t);if(s){const d=s.marker.onDispose(()=>s.dispose());s.onDispose(()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),d.dispose())}),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,s,d){let b=0,m=0;for(const y of this._decorations.getKeyIterator(s))b=y.options.x??0,m=b+(y.options.width??1),t>=b&&t<m&&(!d||(y.options.layer??"bottom")===d)&&(yield y)}forEachDecorationAtCell(t,s,d,b){this._decorations.forEachByKey(s,m=>{v=m.options.x??0,C=v+(m.options.width??1),t>=v&&t<C&&(!d||(m.options.layer??"bottom")===d)&&b(m)})}}r.DecorationService=u;class i extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(t){super(),this.options=t,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=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const h=o(2585),_=o(8343);class a{constructor(...v){this._entries=new Map;for(const[C,u]of v)this.set(C,u)}set(v,C){const u=this._entries.get(v);return this._entries.set(v,C),u}forEach(v){for(const[C,u]of this._entries.entries())v(C,u)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}r.ServiceCollection=a,r.InstantiationService=class{constructor(){this._services=new a,this._services.set(h.IInstantiationService,this)}setService(f,v){this._services.set(f,v)}getService(f){return this._services.get(f)}createInstance(f,...v){const C=(0,_.getServiceDependencies)(f).sort((n,t)=>n.index-t.index),u=[];for(const n of C){const t=this._services.get(n.id);if(!t)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${n.id}.`);u.push(t)}const i=C.length>0?C[0].index:v.length;if(v.length!==i)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${i+1} conflicts with ${v.length} static arguments`);return new f(...v,...u)}}},7866:function(R,r,o){var h=this&&this.__decorate||function(i,n,t,s){var d,b=arguments.length,m=b<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,n,t,s);else for(var y=i.length-1;y>=0;y--)(d=i[y])&&(m=(b<3?d(m):b>3?d(n,t,m):d(n,t))||m);return b>3&&m&&Object.defineProperty(n,t,m),m},_=this&&this.__param||function(i,n){return function(t,s){n(t,s,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const a=o(844),f=o(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 C,u=r.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(i){super(),this._optionsService=i,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),C=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(i){for(let n=0;n<i.length;n++)typeof i[n]=="function"&&(i[n]=i[n]())}_log(i,n,t){this._evalLazyOptionalParams(t),i.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+n,...t)}trace(i,...n){var t;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.trace.bind(this._optionsService.options.logger))??console.log,i,n)}debug(i,...n){var t;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.debug.bind(this._optionsService.options.logger))??console.log,i,n)}info(i,...n){var t;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.info.bind(this._optionsService.options.logger))??console.info,i,n)}warn(i,...n){var t;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.warn.bind(this._optionsService.options.logger))??console.warn,i,n)}error(i,...n){var t;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((t=this._optionsService.options.logger)==null?void 0:t.error.bind(this._optionsService.options.logger))??console.error,i,n)}};r.LogService=u=h([_(0,f.IOptionsService)],u),r.setTraceLogger=function(i){C=i},r.traceCall=function(i,n,t){if(typeof t.value!="function")throw new Error("not supported");const s=t.value;t.value=function(...d){if(C.logLevel!==f.LogLevelEnum.TRACE)return s.apply(this,d);C.trace(`GlyphRenderer#${s.name}(${d.map(m=>JSON.stringify(m)).join(", ")})`);const b=s.apply(this,d);return C.trace(`GlyphRenderer#${s.name} return`,b),b}}},7302:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const h=o(8460),_=o(844),a=o(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:a.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 h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i={...r.DEFAULT_OPTIONS};for(const n in u)if(n in i)try{const t=u[n];i[n]=this._sanitizeAndValidateOption(n,t)}catch(t){console.error(t)}this.rawOptions=i,this.options={...i},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(u,i){return this.onOptionChange(n=>{n===u&&i(this.rawOptions[u])})}onMultipleOptionChange(u,i){return this.onOptionChange(n=>{u.indexOf(n)!==-1&&i()})}_setupOptions(){const u=n=>{if(!(n in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,t)=>{if(!(n in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${n}"`);t=this._sanitizeAndValidateOption(n,t),this.rawOptions[n]!==t&&(this.rawOptions[n]=t,this._onOptionChange.fire(n))};for(const n in this.rawOptions){const t={get:u.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,t)}}_sanitizeAndValidateOption(u,i){switch(u){case"cursorStyle":if(i||(i=r.DEFAULT_OPTIONS[u]),!function(n){return n==="block"||n==="underline"||n==="bar"}(i))throw new Error(`"${i}" is not a valid value for ${u}`);break;case"wordSeparator":i||(i=r.DEFAULT_OPTIONS[u]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=f.includes(i)?i:r.DEFAULT_OPTIONS[u];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${u} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${u} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${u} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${u} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}r.OptionsService=v},2660:function(R,r,o){var h=this&&this.__decorate||function(v,C,u,i){var n,t=arguments.length,s=t<3?C:i===null?i=Object.getOwnPropertyDescriptor(C,u):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(v,C,u,i);else for(var d=v.length-1;d>=0;d--)(n=v[d])&&(s=(t<3?n(s):t>3?n(C,u,s):n(C,u))||s);return t>3&&s&&Object.defineProperty(C,u,s),s},_=this&&this.__param||function(v,C){return function(u,i){C(u,i,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const a=o(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 C=this._bufferService.buffer;if(v.id===void 0){const d=C.addMarker(C.ybase+C.y),b={data:v,id:this._nextId++,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(b,d)),this._dataByLinkId.set(b.id,b),b.id}const u=v,i=this._getEntryIdKey(u),n=this._entriesWithId.get(i);if(n)return this.addLineToLink(n.id,C.ybase+C.y),n.id;const t=C.addMarker(C.ybase+C.y),s={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[t]};return t.onDispose(()=>this._removeMarkerFromLink(s,t)),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(v,C){const u=this._dataByLinkId.get(v);if(u&&u.lines.every(i=>i.line!==C)){const i=this._bufferService.buffer.addMarker(C);u.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(u,i))}}getLinkData(v){var C;return(C=this._dataByLinkId.get(v))==null?void 0:C.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,C){const u=v.lines.indexOf(C);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=h([_(0,a.IBufferService)],f)},8343:(R,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",h="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(_){return _[h]||[]},r.createDecorator=function(_){if(r.serviceRegistry.has(_))return r.serviceRegistry.get(_);const a=function(f,v,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(u,i,n){i[o]===i?i[h].push({id:u,index:n}):(i[h]=[{id:u,index:n}],i[o]=i)})(a,f,C)};return a.toString=()=>_,r.serviceRegistry.set(_,a),a}},2585:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const h=o(8343);var _;r.IBufferService=(0,h.createDecorator)("BufferService"),r.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),r.ICoreService=(0,h.createDecorator)("CoreService"),r.ICharsetService=(0,h.createDecorator)("CharsetService"),r.IInstantiationService=(0,h.createDecorator)("InstantiationService"),function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"}(_||(r.LogLevelEnum=_={})),r.ILogService=(0,h.createDecorator)("LogService"),r.IOptionsService=(0,h.createDecorator)("OptionsService"),r.IOscLinkService=(0,h.createDecorator)("OscLinkService"),r.IUnicodeService=(0,h.createDecorator)("UnicodeService"),r.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(R,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const h=o(8460),_=o(225);class a{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,C,u=!1){return(16777215&v)<<3|(3&C)<<1|(u?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.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 C=0,u=0;const i=v.length;for(let n=0;n<i;++n){let t=v.charCodeAt(n);if(55296<=t&&t<=56319){if(++n>=i)return C+this.wcwidth(t);const b=v.charCodeAt(n);56320<=b&&b<=57343?t=1024*(t-55296)+b-56320+65536:C+=this.wcwidth(b)}const s=this.charProperties(t,u);let d=a.extractWidth(s);a.extractShouldJoin(s)&&(d-=a.extractWidth(u)),C+=d,u=s}return C}charProperties(v,C){return this._activeProvider.charProperties(v,C)}}r.UnicodeService=a}},g={};function S(R){var r=g[R];if(r!==void 0)return r.exports;var o=g[R]={exports:{}};return c[R].call(o.exports,o,o.exports,S),o.exports}var w={};return(()=>{var R=w;Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;const r=S(9042),o=S(3236),h=S(844),_=S(5741),a=S(8285),f=S(7975),v=S(7090),C=["cols","rows"];class u extends h.Disposable{constructor(n){super(),this._core=this.register(new o.Terminal(n)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const t=d=>this._core.options[d],s=(d,b)=>{this._checkReadonlyOptions(d),this._core.options[d]=b};for(const d in this._core.options){const b={get:t.bind(this,d),set:s.bind(this,d)};Object.defineProperty(this._publicOptions,d,b)}}_checkReadonlyOptions(n){if(C.includes(n))throw new Error(`Option "${n}" 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 a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const n=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:n.applicationCursorKeys,applicationKeypadMode:n.applicationKeypad,bracketedPasteMode:n.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:n.origin,reverseWraparoundMode:n.reverseWraparound,sendFocusMode:n.sendFocus,wraparoundMode:n.wraparound}}get options(){return this._publicOptions}set options(n){for(const t in n)this._publicOptions[t]=n[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(n,t=!0){this._core.input(n,t)}resize(n,t){this._verifyIntegers(n,t),this._core.resize(n,t)}open(n){this._core.open(n)}attachCustomKeyEventHandler(n){this._core.attachCustomKeyEventHandler(n)}attachCustomWheelEventHandler(n){this._core.attachCustomWheelEventHandler(n)}registerLinkProvider(n){return this._core.registerLinkProvider(n)}registerCharacterJoiner(n){return this._checkProposedApi(),this._core.registerCharacterJoiner(n)}deregisterCharacterJoiner(n){this._checkProposedApi(),this._core.deregisterCharacterJoiner(n)}registerMarker(n=0){return this._verifyIntegers(n),this._core.registerMarker(n)}registerDecoration(n){return this._checkProposedApi(),this._verifyPositiveIntegers(n.x??0,n.width??0,n.height??0),this._core.registerDecoration(n)}hasSelection(){return this._core.hasSelection()}select(n,t,s){this._verifyIntegers(n,t,s),this._core.select(n,t,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(n,t){this._verifyIntegers(n,t),this._core.selectLines(n,t)}dispose(){super.dispose()}scrollLines(n){this._verifyIntegers(n),this._core.scrollLines(n)}scrollPages(n){this._verifyIntegers(n),this._core.scrollPages(n)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(n){this._verifyIntegers(n),this._core.scrollToLine(n)}clear(){this._core.clear()}write(n,t){this._core.write(n,t)}writeln(n,t){this._core.write(n),this._core.write(`\r
9
+ `,t)}paste(n){this._core.paste(n)}refresh(n,t){this._verifyIntegers(n,t),this._core.refresh(n,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(n){this._addonManager.loadAddon(this,n)}static get strings(){return r}_verifyIntegers(...n){for(const t of n)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...n){for(const t of n)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}R.Terminal=u})(),w})())})(ir);var ns=ir.exports,ne;(function(l){l.assertEqual=S=>S;function e(S){}l.assertIs=e;function c(S){throw new Error}l.assertNever=c,l.arrayToEnum=S=>{const w={};for(const R of S)w[R]=R;return w},l.getValidEnumValues=S=>{const w=l.objectKeys(S).filter(r=>typeof S[S[r]]!="number"),R={};for(const r of w)R[r]=S[r];return l.objectValues(R)},l.objectValues=S=>l.objectKeys(S).map(function(w){return S[w]}),l.objectKeys=typeof Object.keys=="function"?S=>Object.keys(S):S=>{const w=[];for(const R in S)Object.prototype.hasOwnProperty.call(S,R)&&w.push(R);return w},l.find=(S,w)=>{for(const R of S)if(w(R))return R},l.isInteger=typeof Number.isInteger=="function"?S=>Number.isInteger(S):S=>typeof S=="number"&&isFinite(S)&&Math.floor(S)===S;function g(S,w=" | "){return S.map(R=>typeof R=="string"?`'${R}'`:R).join(w)}l.joinValues=g,l.jsonStringifyReplacer=(S,w)=>typeof w=="bigint"?w.toString():w})(ne||(ne={}));var Tt;(function(l){l.mergeShapes=(e,c)=>({...e,...c})})(Tt||(Tt={}));const K=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Re=l=>{switch(typeof l){case"undefined":return K.undefined;case"string":return K.string;case"number":return isNaN(l)?K.nan:K.number;case"boolean":return K.boolean;case"function":return K.function;case"bigint":return K.bigint;case"symbol":return K.symbol;case"object":return Array.isArray(l)?K.array:l===null?K.null:l.then&&typeof l.then=="function"&&l.catch&&typeof l.catch=="function"?K.promise:typeof Map<"u"&&l instanceof Map?K.map:typeof Set<"u"&&l instanceof Set?K.set:typeof Date<"u"&&l instanceof Date?K.date:K.object;default:return K.unknown}},j=ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),os=l=>JSON.stringify(l,null,2).replace(/"([^"]+)":/g,"$1:");class fe extends Error{constructor(e){super(),this.issues=[],this.addIssue=g=>{this.issues=[...this.issues,g]},this.addIssues=(g=[])=>{this.issues=[...this.issues,...g]};const c=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,c):this.__proto__=c,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const c=e||function(w){return w.message},g={_errors:[]},S=w=>{for(const R of w.issues)if(R.code==="invalid_union")R.unionErrors.map(S);else if(R.code==="invalid_return_type")S(R.returnTypeError);else if(R.code==="invalid_arguments")S(R.argumentsError);else if(R.path.length===0)g._errors.push(c(R));else{let r=g,o=0;for(;o<R.path.length;){const h=R.path[o];o===R.path.length-1?(r[h]=r[h]||{_errors:[]},r[h]._errors.push(c(R))):r[h]=r[h]||{_errors:[]},r=r[h],o++}}};return S(this),g}static assert(e){if(!(e instanceof fe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=c=>c.message){const c={},g=[];for(const S of this.issues)S.path.length>0?(c[S.path[0]]=c[S.path[0]]||[],c[S.path[0]].push(e(S))):g.push(e(S));return{formErrors:g,fieldErrors:c}}get formErrors(){return this.flatten()}}fe.create=l=>new fe(l);const Ne=(l,e)=>{let c;switch(l.code){case j.invalid_type:l.received===K.undefined?c="Required":c=`Expected ${l.expected}, received ${l.received}`;break;case j.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(l.expected,ne.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:c=`Unrecognized key(s) in object: ${ne.joinValues(l.keys,", ")}`;break;case j.invalid_union:c="Invalid input";break;case j.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${ne.joinValues(l.options)}`;break;case j.invalid_enum_value:c=`Invalid enum value. Expected ${ne.joinValues(l.options)}, received '${l.received}'`;break;case j.invalid_arguments:c="Invalid function arguments";break;case j.invalid_return_type:c="Invalid function return type";break;case j.invalid_date:c="Invalid date";break;case j.invalid_string:typeof l.validation=="object"?"includes"in l.validation?(c=`Invalid input: must include "${l.validation.includes}"`,typeof l.validation.position=="number"&&(c=`${c} at one or more positions greater than or equal to ${l.validation.position}`)):"startsWith"in l.validation?c=`Invalid input: must start with "${l.validation.startsWith}"`:"endsWith"in l.validation?c=`Invalid input: must end with "${l.validation.endsWith}"`:ne.assertNever(l.validation):l.validation!=="regex"?c=`Invalid ${l.validation}`:c="Invalid";break;case j.too_small:l.type==="array"?c=`Array must contain ${l.exact?"exactly":l.inclusive?"at least":"more than"} ${l.minimum} element(s)`:l.type==="string"?c=`String must contain ${l.exact?"exactly":l.inclusive?"at least":"over"} ${l.minimum} character(s)`:l.type==="number"?c=`Number must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${l.minimum}`:l.type==="date"?c=`Date must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(l.minimum))}`:c="Invalid input";break;case j.too_big:l.type==="array"?c=`Array must contain ${l.exact?"exactly":l.inclusive?"at most":"less than"} ${l.maximum} element(s)`:l.type==="string"?c=`String must contain ${l.exact?"exactly":l.inclusive?"at most":"under"} ${l.maximum} character(s)`:l.type==="number"?c=`Number must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="bigint"?c=`BigInt must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="date"?c=`Date must be ${l.exact?"exactly":l.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(l.maximum))}`:c="Invalid input";break;case j.custom:c="Invalid input";break;case j.invalid_intersection_types:c="Intersection results could not be merged";break;case j.not_multiple_of:c=`Number must be a multiple of ${l.multipleOf}`;break;case j.not_finite:c="Number must be finite";break;default:c=e.defaultError,ne.assertNever(l)}return{message:c}};let or=Ne;function as(l){or=l}function pt(){return or}const gt=l=>{const{data:e,path:c,errorMaps:g,issueData:S}=l,w=[...c,...S.path||[]],R={...S,path:w};if(S.message!==void 0)return{...S,path:w,message:S.message};let r="";const o=g.filter(h=>!!h).slice().reverse();for(const h of o)r=h(R,{data:e,defaultError:r}).message;return{...S,path:w,message:r}},cs=[];function V(l,e){const c=pt(),g=gt({issueData:e,data:l.data,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,c,c===Ne?void 0:Ne].filter(S=>!!S)});l.common.issues.push(g)}class le{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,c){const g=[];for(const S of c){if(S.status==="aborted")return Q;S.status==="dirty"&&e.dirty(),g.push(S.value)}return{status:e.value,value:g}}static async mergeObjectAsync(e,c){const g=[];for(const S of c){const w=await S.key,R=await S.value;g.push({key:w,value:R})}return le.mergeObjectSync(e,g)}static mergeObjectSync(e,c){const g={};for(const S of c){const{key:w,value:R}=S;if(w.status==="aborted"||R.status==="aborted")return Q;w.status==="dirty"&&e.dirty(),R.status==="dirty"&&e.dirty(),w.value!=="__proto__"&&(typeof R.value<"u"||S.alwaysSet)&&(g[w.value]=R.value)}return{status:e.value,value:g}}}const Q=Object.freeze({status:"aborted"}),Pe=l=>({status:"dirty",value:l}),de=l=>({status:"valid",value:l}),At=l=>l.status==="aborted",Bt=l=>l.status==="dirty",Ye=l=>l.status==="valid",Je=l=>typeof Promise<"u"&&l instanceof Promise;function vt(l,e,c,g){if(typeof e=="function"?l!==e||!g:!e.has(l))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(l)}function ar(l,e,c,g,S){if(typeof e=="function"?l!==e||!S:!e.has(l))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(l,c),c}var Y;(function(l){l.errToObj=e=>typeof e=="string"?{message:e}:e||{},l.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Y||(Y={}));var Ze,Ke;class ye{constructor(e,c,g,S){this._cachedPath=[],this.parent=e,this.data=c,this._path=g,this._key=S}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $t=(l,e)=>{if(Ye(e))return{success:!0,data:e.value};if(!l.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const c=new fe(l.common.issues);return this._error=c,this._error}}};function re(l){if(!l)return{};const{errorMap:e,invalid_type_error:c,required_error:g,description:S}=l;if(e&&(c||g))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:S}:{errorMap:(R,r)=>{var o,h;const{message:_}=l;return R.code==="invalid_enum_value"?{message:_??r.defaultError}:typeof r.data>"u"?{message:(o=_??g)!==null&&o!==void 0?o:r.defaultError}:R.code!=="invalid_type"?{message:r.defaultError}:{message:(h=_??c)!==null&&h!==void 0?h:r.defaultError}},description:S}}class se{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Re(e.data)}_getOrReturnCtx(e,c){return c||{common:e.parent.common,data:e.data,parsedType:Re(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new le,ctx:{common:e.parent.common,data:e.data,parsedType:Re(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const c=this._parse(e);if(Je(c))throw new Error("Synchronous parse encountered promise.");return c}_parseAsync(e){const c=this._parse(e);return Promise.resolve(c)}parse(e,c){const g=this.safeParse(e,c);if(g.success)return g.data;throw g.error}safeParse(e,c){var g;const S={common:{issues:[],async:(g=c==null?void 0:c.async)!==null&&g!==void 0?g:!1,contextualErrorMap:c==null?void 0:c.errorMap},path:(c==null?void 0:c.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Re(e)},w=this._parseSync({data:e,path:S.path,parent:S});return $t(S,w)}async parseAsync(e,c){const g=await this.safeParseAsync(e,c);if(g.success)return g.data;throw g.error}async safeParseAsync(e,c){const g={common:{issues:[],contextualErrorMap:c==null?void 0:c.errorMap,async:!0},path:(c==null?void 0:c.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Re(e)},S=this._parse({data:e,path:g.path,parent:g}),w=await(Je(S)?S:Promise.resolve(S));return $t(g,w)}refine(e,c){const g=S=>typeof c=="string"||typeof c>"u"?{message:c}:typeof c=="function"?c(S):c;return this._refinement((S,w)=>{const R=e(S),r=()=>w.addIssue({code:j.custom,...g(S)});return typeof Promise<"u"&&R instanceof Promise?R.then(o=>o?!0:(r(),!1)):R?!0:(r(),!1)})}refinement(e,c){return this._refinement((g,S)=>e(g)?!0:(S.addIssue(typeof c=="function"?c(g,S):c),!1))}_refinement(e){return new me({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Se.create(this,this._def)}nullable(){return Ae.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ve.create(this,this._def)}promise(){return We.create(this,this._def)}or(e){return tt.create([this,e],this._def)}and(e){return rt.create(this,e,this._def)}transform(e){return new me({...re(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const c=typeof e=="function"?e:()=>e;return new at({...re(this._def),innerType:this,defaultValue:c,typeName:X.ZodDefault})}brand(){return new It({typeName:X.ZodBranded,type:this,...re(this._def)})}catch(e){const c=typeof e=="function"?e:()=>e;return new ct({...re(this._def),innerType:this,catchValue:c,typeName:X.ZodCatch})}describe(e){const c=this.constructor;return new c({...this._def,description:e})}pipe(e){return lt.create(this,e)}readonly(){return ht.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hs=/^c[^\s-]{8,}$/i,ls=/^[0-9a-z]+$/,ds=/^[0-9A-HJKMNP-TV-Z]{26}$/,us=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fs=/^[a-z0-9_-]{21}$/i,_s=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ps=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Lt;const vs=/^(?:(?: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])$/,ms=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,bs=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cr="((\\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])))",Ss=new RegExp(`^${cr}$`);function hr(l){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return l.precision?e=`${e}\\.\\d{${l.precision}}`:l.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ys(l){return new RegExp(`^${hr(l)}$`)}function lr(l){let e=`${cr}T${hr(l)}`;const c=[];return c.push(l.local?"Z?":"Z"),l.offset&&c.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${c.join("|")})`,new RegExp(`^${e}$`)}function Cs(l,e){return!!((e==="v4"||!e)&&vs.test(l)||(e==="v6"||!e)&&ms.test(l))}class pe extends se{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==K.string){const w=this._getOrReturnCtx(e);return V(w,{code:j.invalid_type,expected:K.string,received:w.parsedType}),Q}const g=new le;let S;for(const w of this._def.checks)if(w.kind==="min")e.data.length<w.value&&(S=this._getOrReturnCtx(e,S),V(S,{code:j.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),g.dirty());else if(w.kind==="max")e.data.length>w.value&&(S=this._getOrReturnCtx(e,S),V(S,{code:j.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!1,message:w.message}),g.dirty());else if(w.kind==="length"){const R=e.data.length>w.value,r=e.data.length<w.value;(R||r)&&(S=this._getOrReturnCtx(e,S),R?V(S,{code:j.too_big,maximum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message}):r&&V(S,{code:j.too_small,minimum:w.value,type:"string",inclusive:!0,exact:!0,message:w.message}),g.dirty())}else if(w.kind==="email")ps.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"email",code:j.invalid_string,message:w.message}),g.dirty());else if(w.kind==="emoji")Lt||(Lt=new RegExp(gs,"u")),Lt.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"emoji",code:j.invalid_string,message:w.message}),g.dirty());else if(w.kind==="uuid")us.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"uuid",code:j.invalid_string,message:w.message}),g.dirty());else if(w.kind==="nanoid")fs.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"nanoid",code:j.invalid_string,message:w.message}),g.dirty());else if(w.kind==="cuid")hs.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"cuid",code:j.invalid_string,message:w.message}),g.dirty());else if(w.kind==="cuid2")ls.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"cuid2",code:j.invalid_string,message:w.message}),g.dirty());else if(w.kind==="ulid")ds.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"ulid",code:j.invalid_string,message:w.message}),g.dirty());else if(w.kind==="url")try{new URL(e.data)}catch{S=this._getOrReturnCtx(e,S),V(S,{validation:"url",code:j.invalid_string,message:w.message}),g.dirty()}else w.kind==="regex"?(w.regex.lastIndex=0,w.regex.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"regex",code:j.invalid_string,message:w.message}),g.dirty())):w.kind==="trim"?e.data=e.data.trim():w.kind==="includes"?e.data.includes(w.value,w.position)||(S=this._getOrReturnCtx(e,S),V(S,{code:j.invalid_string,validation:{includes:w.value,position:w.position},message:w.message}),g.dirty()):w.kind==="toLowerCase"?e.data=e.data.toLowerCase():w.kind==="toUpperCase"?e.data=e.data.toUpperCase():w.kind==="startsWith"?e.data.startsWith(w.value)||(S=this._getOrReturnCtx(e,S),V(S,{code:j.invalid_string,validation:{startsWith:w.value},message:w.message}),g.dirty()):w.kind==="endsWith"?e.data.endsWith(w.value)||(S=this._getOrReturnCtx(e,S),V(S,{code:j.invalid_string,validation:{endsWith:w.value},message:w.message}),g.dirty()):w.kind==="datetime"?lr(w).test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{code:j.invalid_string,validation:"datetime",message:w.message}),g.dirty()):w.kind==="date"?Ss.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{code:j.invalid_string,validation:"date",message:w.message}),g.dirty()):w.kind==="time"?ys(w).test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{code:j.invalid_string,validation:"time",message:w.message}),g.dirty()):w.kind==="duration"?_s.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"duration",code:j.invalid_string,message:w.message}),g.dirty()):w.kind==="ip"?Cs(e.data,w.version)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"ip",code:j.invalid_string,message:w.message}),g.dirty()):w.kind==="base64"?bs.test(e.data)||(S=this._getOrReturnCtx(e,S),V(S,{validation:"base64",code:j.invalid_string,message:w.message}),g.dirty()):ne.assertNever(w);return{status:g.value,value:e.data}}_regex(e,c,g){return this.refinement(S=>e.test(S),{validation:c,code:j.invalid_string,...Y.errToObj(g)})}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Y.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Y.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Y.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Y.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Y.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Y.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Y.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Y.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Y.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Y.errToObj(e)})}datetime(e){var c,g;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(c=e==null?void 0:e.offset)!==null&&c!==void 0?c:!1,local:(g=e==null?void 0:e.local)!==null&&g!==void 0?g:!1,...Y.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Y.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Y.errToObj(e)})}regex(e,c){return this._addCheck({kind:"regex",regex:e,...Y.errToObj(c)})}includes(e,c){return this._addCheck({kind:"includes",value:e,position:c==null?void 0:c.position,...Y.errToObj(c==null?void 0:c.message)})}startsWith(e,c){return this._addCheck({kind:"startsWith",value:e,...Y.errToObj(c)})}endsWith(e,c){return this._addCheck({kind:"endsWith",value:e,...Y.errToObj(c)})}min(e,c){return this._addCheck({kind:"min",value:e,...Y.errToObj(c)})}max(e,c){return this._addCheck({kind:"max",value:e,...Y.errToObj(c)})}length(e,c){return this._addCheck({kind:"length",value:e,...Y.errToObj(c)})}nonempty(e){return this.min(1,Y.errToObj(e))}trim(){return new pe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const c of this._def.checks)c.kind==="min"&&(e===null||c.value>e)&&(e=c.value);return e}get maxLength(){let e=null;for(const c of this._def.checks)c.kind==="max"&&(e===null||c.value<e)&&(e=c.value);return e}}pe.create=l=>{var e;return new pe({checks:[],typeName:X.ZodString,coerce:(e=l==null?void 0:l.coerce)!==null&&e!==void 0?e:!1,...re(l)})};function ws(l,e){const c=(l.toString().split(".")[1]||"").length,g=(e.toString().split(".")[1]||"").length,S=c>g?c:g,w=parseInt(l.toFixed(S).replace(".","")),R=parseInt(e.toFixed(S).replace(".",""));return w%R/Math.pow(10,S)}class Le extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==K.number){const w=this._getOrReturnCtx(e);return V(w,{code:j.invalid_type,expected:K.number,received:w.parsedType}),Q}let g;const S=new le;for(const w of this._def.checks)w.kind==="int"?ne.isInteger(e.data)||(g=this._getOrReturnCtx(e,g),V(g,{code:j.invalid_type,expected:"integer",received:"float",message:w.message}),S.dirty()):w.kind==="min"?(w.inclusive?e.data<w.value:e.data<=w.value)&&(g=this._getOrReturnCtx(e,g),V(g,{code:j.too_small,minimum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),S.dirty()):w.kind==="max"?(w.inclusive?e.data>w.value:e.data>=w.value)&&(g=this._getOrReturnCtx(e,g),V(g,{code:j.too_big,maximum:w.value,type:"number",inclusive:w.inclusive,exact:!1,message:w.message}),S.dirty()):w.kind==="multipleOf"?ws(e.data,w.value)!==0&&(g=this._getOrReturnCtx(e,g),V(g,{code:j.not_multiple_of,multipleOf:w.value,message:w.message}),S.dirty()):w.kind==="finite"?Number.isFinite(e.data)||(g=this._getOrReturnCtx(e,g),V(g,{code:j.not_finite,message:w.message}),S.dirty()):ne.assertNever(w);return{status:S.value,value:e.data}}gte(e,c){return this.setLimit("min",e,!0,Y.toString(c))}gt(e,c){return this.setLimit("min",e,!1,Y.toString(c))}lte(e,c){return this.setLimit("max",e,!0,Y.toString(c))}lt(e,c){return this.setLimit("max",e,!1,Y.toString(c))}setLimit(e,c,g,S){return new Le({...this._def,checks:[...this._def.checks,{kind:e,value:c,inclusive:g,message:Y.toString(S)}]})}_addCheck(e){return new Le({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Y.toString(e)})}multipleOf(e,c){return this._addCheck({kind:"multipleOf",value:e,message:Y.toString(c)})}finite(e){return this._addCheck({kind:"finite",message:Y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Y.toString(e)})}get minValue(){let e=null;for(const c of this._def.checks)c.kind==="min"&&(e===null||c.value>e)&&(e=c.value);return e}get maxValue(){let e=null;for(const c of this._def.checks)c.kind==="max"&&(e===null||c.value<e)&&(e=c.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=null,c=null;for(const g of this._def.checks){if(g.kind==="finite"||g.kind==="int"||g.kind==="multipleOf")return!0;g.kind==="min"?(c===null||g.value>c)&&(c=g.value):g.kind==="max"&&(e===null||g.value<e)&&(e=g.value)}return Number.isFinite(c)&&Number.isFinite(e)}}Le.create=l=>new Le({checks:[],typeName:X.ZodNumber,coerce:(l==null?void 0:l.coerce)||!1,...re(l)});class De extends se{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==K.bigint){const w=this._getOrReturnCtx(e);return V(w,{code:j.invalid_type,expected:K.bigint,received:w.parsedType}),Q}let g;const S=new le;for(const w of this._def.checks)w.kind==="min"?(w.inclusive?e.data<w.value:e.data<=w.value)&&(g=this._getOrReturnCtx(e,g),V(g,{code:j.too_small,type:"bigint",minimum:w.value,inclusive:w.inclusive,message:w.message}),S.dirty()):w.kind==="max"?(w.inclusive?e.data>w.value:e.data>=w.value)&&(g=this._getOrReturnCtx(e,g),V(g,{code:j.too_big,type:"bigint",maximum:w.value,inclusive:w.inclusive,message:w.message}),S.dirty()):w.kind==="multipleOf"?e.data%w.value!==BigInt(0)&&(g=this._getOrReturnCtx(e,g),V(g,{code:j.not_multiple_of,multipleOf:w.value,message:w.message}),S.dirty()):ne.assertNever(w);return{status:S.value,value:e.data}}gte(e,c){return this.setLimit("min",e,!0,Y.toString(c))}gt(e,c){return this.setLimit("min",e,!1,Y.toString(c))}lte(e,c){return this.setLimit("max",e,!0,Y.toString(c))}lt(e,c){return this.setLimit("max",e,!1,Y.toString(c))}setLimit(e,c,g,S){return new De({...this._def,checks:[...this._def.checks,{kind:e,value:c,inclusive:g,message:Y.toString(S)}]})}_addCheck(e){return new De({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Y.toString(e)})}multipleOf(e,c){return this._addCheck({kind:"multipleOf",value:e,message:Y.toString(c)})}get minValue(){let e=null;for(const c of this._def.checks)c.kind==="min"&&(e===null||c.value>e)&&(e=c.value);return e}get maxValue(){let e=null;for(const c of this._def.checks)c.kind==="max"&&(e===null||c.value<e)&&(e=c.value);return e}}De.create=l=>{var e;return new De({checks:[],typeName:X.ZodBigInt,coerce:(e=l==null?void 0:l.coerce)!==null&&e!==void 0?e:!1,...re(l)})};class Xe extends se{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==K.boolean){const g=this._getOrReturnCtx(e);return V(g,{code:j.invalid_type,expected:K.boolean,received:g.parsedType}),Q}return de(e.data)}}Xe.create=l=>new Xe({typeName:X.ZodBoolean,coerce:(l==null?void 0:l.coerce)||!1,...re(l)});class Oe extends se{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==K.date){const w=this._getOrReturnCtx(e);return V(w,{code:j.invalid_type,expected:K.date,received:w.parsedType}),Q}if(isNaN(e.data.getTime())){const w=this._getOrReturnCtx(e);return V(w,{code:j.invalid_date}),Q}const g=new le;let S;for(const w of this._def.checks)w.kind==="min"?e.data.getTime()<w.value&&(S=this._getOrReturnCtx(e,S),V(S,{code:j.too_small,message:w.message,inclusive:!0,exact:!1,minimum:w.value,type:"date"}),g.dirty()):w.kind==="max"?e.data.getTime()>w.value&&(S=this._getOrReturnCtx(e,S),V(S,{code:j.too_big,message:w.message,inclusive:!0,exact:!1,maximum:w.value,type:"date"}),g.dirty()):ne.assertNever(w);return{status:g.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Oe({...this._def,checks:[...this._def.checks,e]})}min(e,c){return this._addCheck({kind:"min",value:e.getTime(),message:Y.toString(c)})}max(e,c){return this._addCheck({kind:"max",value:e.getTime(),message:Y.toString(c)})}get minDate(){let e=null;for(const c of this._def.checks)c.kind==="min"&&(e===null||c.value>e)&&(e=c.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const c of this._def.checks)c.kind==="max"&&(e===null||c.value<e)&&(e=c.value);return e!=null?new Date(e):null}}Oe.create=l=>new Oe({checks:[],coerce:(l==null?void 0:l.coerce)||!1,typeName:X.ZodDate,...re(l)});class mt extends se{_parse(e){if(this._getType(e)!==K.symbol){const g=this._getOrReturnCtx(e);return V(g,{code:j.invalid_type,expected:K.symbol,received:g.parsedType}),Q}return de(e.data)}}mt.create=l=>new mt({typeName:X.ZodSymbol,...re(l)});class Qe extends se{_parse(e){if(this._getType(e)!==K.undefined){const g=this._getOrReturnCtx(e);return V(g,{code:j.invalid_type,expected:K.undefined,received:g.parsedType}),Q}return de(e.data)}}Qe.create=l=>new Qe({typeName:X.ZodUndefined,...re(l)});class et extends se{_parse(e){if(this._getType(e)!==K.null){const g=this._getOrReturnCtx(e);return V(g,{code:j.invalid_type,expected:K.null,received:g.parsedType}),Q}return de(e.data)}}et.create=l=>new et({typeName:X.ZodNull,...re(l)});class Fe extends se{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}}Fe.create=l=>new Fe({typeName:X.ZodAny,...re(l)});class Be extends se{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}}Be.create=l=>new Be({typeName:X.ZodUnknown,...re(l)});class Ee extends se{_parse(e){const c=this._getOrReturnCtx(e);return V(c,{code:j.invalid_type,expected:K.never,received:c.parsedType}),Q}}Ee.create=l=>new Ee({typeName:X.ZodNever,...re(l)});class bt extends se{_parse(e){if(this._getType(e)!==K.undefined){const g=this._getOrReturnCtx(e);return V(g,{code:j.invalid_type,expected:K.void,received:g.parsedType}),Q}return de(e.data)}}bt.create=l=>new bt({typeName:X.ZodVoid,...re(l)});class ve extends se{_parse(e){const{ctx:c,status:g}=this._processInputParams(e),S=this._def;if(c.parsedType!==K.array)return V(c,{code:j.invalid_type,expected:K.array,received:c.parsedType}),Q;if(S.exactLength!==null){const R=c.data.length>S.exactLength.value,r=c.data.length<S.exactLength.value;(R||r)&&(V(c,{code:R?j.too_big:j.too_small,minimum:r?S.exactLength.value:void 0,maximum:R?S.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:S.exactLength.message}),g.dirty())}if(S.minLength!==null&&c.data.length<S.minLength.value&&(V(c,{code:j.too_small,minimum:S.minLength.value,type:"array",inclusive:!0,exact:!1,message:S.minLength.message}),g.dirty()),S.maxLength!==null&&c.data.length>S.maxLength.value&&(V(c,{code:j.too_big,maximum:S.maxLength.value,type:"array",inclusive:!0,exact:!1,message:S.maxLength.message}),g.dirty()),c.common.async)return Promise.all([...c.data].map((R,r)=>S.type._parseAsync(new ye(c,R,c.path,r)))).then(R=>le.mergeArray(g,R));const w=[...c.data].map((R,r)=>S.type._parseSync(new ye(c,R,c.path,r)));return le.mergeArray(g,w)}get element(){return this._def.type}min(e,c){return new ve({...this._def,minLength:{value:e,message:Y.toString(c)}})}max(e,c){return new ve({...this._def,maxLength:{value:e,message:Y.toString(c)}})}length(e,c){return new ve({...this._def,exactLength:{value:e,message:Y.toString(c)}})}nonempty(e){return this.min(1,e)}}ve.create=(l,e)=>new ve({type:l,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...re(e)});function Ie(l){if(l instanceof ae){const e={};for(const c in l.shape){const g=l.shape[c];e[c]=Se.create(Ie(g))}return new ae({...l._def,shape:()=>e})}else return l instanceof ve?new ve({...l._def,type:Ie(l.element)}):l instanceof Se?Se.create(Ie(l.unwrap())):l instanceof Ae?Ae.create(Ie(l.unwrap())):l instanceof Ce?Ce.create(l.items.map(e=>Ie(e))):l}class ae extends se{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),c=ne.objectKeys(e);return this._cached={shape:e,keys:c}}_parse(e){if(this._getType(e)!==K.object){const h=this._getOrReturnCtx(e);return V(h,{code:j.invalid_type,expected:K.object,received:h.parsedType}),Q}const{status:g,ctx:S}=this._processInputParams(e),{shape:w,keys:R}=this._getCached(),r=[];if(!(this._def.catchall instanceof Ee&&this._def.unknownKeys==="strip"))for(const h in S.data)R.includes(h)||r.push(h);const o=[];for(const h of R){const _=w[h],a=S.data[h];o.push({key:{status:"valid",value:h},value:_._parse(new ye(S,a,S.path,h)),alwaysSet:h in S.data})}if(this._def.catchall instanceof Ee){const h=this._def.unknownKeys;if(h==="passthrough")for(const _ of r)o.push({key:{status:"valid",value:_},value:{status:"valid",value:S.data[_]}});else if(h==="strict")r.length>0&&(V(S,{code:j.unrecognized_keys,keys:r}),g.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const _ of r){const a=S.data[_];o.push({key:{status:"valid",value:_},value:h._parse(new ye(S,a,S.path,_)),alwaysSet:_ in S.data})}}return S.common.async?Promise.resolve().then(async()=>{const h=[];for(const _ of o){const a=await _.key,f=await _.value;h.push({key:a,value:f,alwaysSet:_.alwaysSet})}return h}).then(h=>le.mergeObjectSync(g,h)):le.mergeObjectSync(g,o)}get shape(){return this._def.shape()}strict(e){return Y.errToObj,new ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(c,g)=>{var S,w,R,r;const o=(R=(w=(S=this._def).errorMap)===null||w===void 0?void 0:w.call(S,c,g).message)!==null&&R!==void 0?R:g.defaultError;return c.code==="unrecognized_keys"?{message:(r=Y.errToObj(e).message)!==null&&r!==void 0?r:o}:{message:o}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:X.ZodObject})}setKey(e,c){return this.augment({[e]:c})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const c={};return ne.objectKeys(e).forEach(g=>{e[g]&&this.shape[g]&&(c[g]=this.shape[g])}),new ae({...this._def,shape:()=>c})}omit(e){const c={};return ne.objectKeys(this.shape).forEach(g=>{e[g]||(c[g]=this.shape[g])}),new ae({...this._def,shape:()=>c})}deepPartial(){return Ie(this)}partial(e){const c={};return ne.objectKeys(this.shape).forEach(g=>{const S=this.shape[g];e&&!e[g]?c[g]=S:c[g]=S.optional()}),new ae({...this._def,shape:()=>c})}required(e){const c={};return ne.objectKeys(this.shape).forEach(g=>{if(e&&!e[g])c[g]=this.shape[g];else{let w=this.shape[g];for(;w instanceof Se;)w=w._def.innerType;c[g]=w}}),new ae({...this._def,shape:()=>c})}keyof(){return dr(ne.objectKeys(this.shape))}}ae.create=(l,e)=>new ae({shape:()=>l,unknownKeys:"strip",catchall:Ee.create(),typeName:X.ZodObject,...re(e)});ae.strictCreate=(l,e)=>new ae({shape:()=>l,unknownKeys:"strict",catchall:Ee.create(),typeName:X.ZodObject,...re(e)});ae.lazycreate=(l,e)=>new ae({shape:l,unknownKeys:"strip",catchall:Ee.create(),typeName:X.ZodObject,...re(e)});class tt extends se{_parse(e){const{ctx:c}=this._processInputParams(e),g=this._def.options;function S(w){for(const r of w)if(r.result.status==="valid")return r.result;for(const r of w)if(r.result.status==="dirty")return c.common.issues.push(...r.ctx.common.issues),r.result;const R=w.map(r=>new fe(r.ctx.common.issues));return V(c,{code:j.invalid_union,unionErrors:R}),Q}if(c.common.async)return Promise.all(g.map(async w=>{const R={...c,common:{...c.common,issues:[]},parent:null};return{result:await w._parseAsync({data:c.data,path:c.path,parent:R}),ctx:R}})).then(S);{let w;const R=[];for(const o of g){const h={...c,common:{...c.common,issues:[]},parent:null},_=o._parseSync({data:c.data,path:c.path,parent:h});if(_.status==="valid")return _;_.status==="dirty"&&!w&&(w={result:_,ctx:h}),h.common.issues.length&&R.push(h.common.issues)}if(w)return c.common.issues.push(...w.ctx.common.issues),w.result;const r=R.map(o=>new fe(o));return V(c,{code:j.invalid_union,unionErrors:r}),Q}}get options(){return this._def.options}}tt.create=(l,e)=>new tt({options:l,typeName:X.ZodUnion,...re(e)});const we=l=>l instanceof it?we(l.schema):l instanceof me?we(l.innerType()):l instanceof nt?[l.value]:l instanceof Te?l.options:l instanceof ot?ne.objectValues(l.enum):l instanceof at?we(l._def.innerType):l instanceof Qe?[void 0]:l instanceof et?[null]:l instanceof Se?[void 0,...we(l.unwrap())]:l instanceof Ae?[null,...we(l.unwrap())]:l instanceof It||l instanceof ht?we(l.unwrap()):l instanceof ct?we(l._def.innerType):[];class Ct extends se{_parse(e){const{ctx:c}=this._processInputParams(e);if(c.parsedType!==K.object)return V(c,{code:j.invalid_type,expected:K.object,received:c.parsedType}),Q;const g=this.discriminator,S=c.data[g],w=this.optionsMap.get(S);return w?c.common.async?w._parseAsync({data:c.data,path:c.path,parent:c}):w._parseSync({data:c.data,path:c.path,parent:c}):(V(c,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[g]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,c,g){const S=new Map;for(const w of c){const R=we(w.shape[e]);if(!R.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of R){if(S.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);S.set(r,w)}}return new Ct({typeName:X.ZodDiscriminatedUnion,discriminator:e,options:c,optionsMap:S,...re(g)})}}function Ot(l,e){const c=Re(l),g=Re(e);if(l===e)return{valid:!0,data:l};if(c===K.object&&g===K.object){const S=ne.objectKeys(e),w=ne.objectKeys(l).filter(r=>S.indexOf(r)!==-1),R={...l,...e};for(const r of w){const o=Ot(l[r],e[r]);if(!o.valid)return{valid:!1};R[r]=o.data}return{valid:!0,data:R}}else if(c===K.array&&g===K.array){if(l.length!==e.length)return{valid:!1};const S=[];for(let w=0;w<l.length;w++){const R=l[w],r=e[w],o=Ot(R,r);if(!o.valid)return{valid:!1};S.push(o.data)}return{valid:!0,data:S}}else return c===K.date&&g===K.date&&+l==+e?{valid:!0,data:l}:{valid:!1}}class rt extends se{_parse(e){const{status:c,ctx:g}=this._processInputParams(e),S=(w,R)=>{if(At(w)||At(R))return Q;const r=Ot(w.value,R.value);return r.valid?((Bt(w)||Bt(R))&&c.dirty(),{status:c.value,value:r.data}):(V(g,{code:j.invalid_intersection_types}),Q)};return g.common.async?Promise.all([this._def.left._parseAsync({data:g.data,path:g.path,parent:g}),this._def.right._parseAsync({data:g.data,path:g.path,parent:g})]).then(([w,R])=>S(w,R)):S(this._def.left._parseSync({data:g.data,path:g.path,parent:g}),this._def.right._parseSync({data:g.data,path:g.path,parent:g}))}}rt.create=(l,e,c)=>new rt({left:l,right:e,typeName:X.ZodIntersection,...re(c)});class Ce extends se{_parse(e){const{status:c,ctx:g}=this._processInputParams(e);if(g.parsedType!==K.array)return V(g,{code:j.invalid_type,expected:K.array,received:g.parsedType}),Q;if(g.data.length<this._def.items.length)return V(g,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&g.data.length>this._def.items.length&&(V(g,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.dirty());const w=[...g.data].map((R,r)=>{const o=this._def.items[r]||this._def.rest;return o?o._parse(new ye(g,R,g.path,r)):null}).filter(R=>!!R);return g.common.async?Promise.all(w).then(R=>le.mergeArray(c,R)):le.mergeArray(c,w)}get items(){return this._def.items}rest(e){return new Ce({...this._def,rest:e})}}Ce.create=(l,e)=>{if(!Array.isArray(l))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ce({items:l,typeName:X.ZodTuple,rest:null,...re(e)})};class st extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:c,ctx:g}=this._processInputParams(e);if(g.parsedType!==K.object)return V(g,{code:j.invalid_type,expected:K.object,received:g.parsedType}),Q;const S=[],w=this._def.keyType,R=this._def.valueType;for(const r in g.data)S.push({key:w._parse(new ye(g,r,g.path,r)),value:R._parse(new ye(g,g.data[r],g.path,r)),alwaysSet:r in g.data});return g.common.async?le.mergeObjectAsync(c,S):le.mergeObjectSync(c,S)}get element(){return this._def.valueType}static create(e,c,g){return c instanceof se?new st({keyType:e,valueType:c,typeName:X.ZodRecord,...re(g)}):new st({keyType:pe.create(),valueType:e,typeName:X.ZodRecord,...re(c)})}}class St extends se{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:c,ctx:g}=this._processInputParams(e);if(g.parsedType!==K.map)return V(g,{code:j.invalid_type,expected:K.map,received:g.parsedType}),Q;const S=this._def.keyType,w=this._def.valueType,R=[...g.data.entries()].map(([r,o],h)=>({key:S._parse(new ye(g,r,g.path,[h,"key"])),value:w._parse(new ye(g,o,g.path,[h,"value"]))}));if(g.common.async){const r=new Map;return Promise.resolve().then(async()=>{for(const o of R){const h=await o.key,_=await o.value;if(h.status==="aborted"||_.status==="aborted")return Q;(h.status==="dirty"||_.status==="dirty")&&c.dirty(),r.set(h.value,_.value)}return{status:c.value,value:r}})}else{const r=new Map;for(const o of R){const h=o.key,_=o.value;if(h.status==="aborted"||_.status==="aborted")return Q;(h.status==="dirty"||_.status==="dirty")&&c.dirty(),r.set(h.value,_.value)}return{status:c.value,value:r}}}}St.create=(l,e,c)=>new St({valueType:e,keyType:l,typeName:X.ZodMap,...re(c)});class Me extends se{_parse(e){const{status:c,ctx:g}=this._processInputParams(e);if(g.parsedType!==K.set)return V(g,{code:j.invalid_type,expected:K.set,received:g.parsedType}),Q;const S=this._def;S.minSize!==null&&g.data.size<S.minSize.value&&(V(g,{code:j.too_small,minimum:S.minSize.value,type:"set",inclusive:!0,exact:!1,message:S.minSize.message}),c.dirty()),S.maxSize!==null&&g.data.size>S.maxSize.value&&(V(g,{code:j.too_big,maximum:S.maxSize.value,type:"set",inclusive:!0,exact:!1,message:S.maxSize.message}),c.dirty());const w=this._def.valueType;function R(o){const h=new Set;for(const _ of o){if(_.status==="aborted")return Q;_.status==="dirty"&&c.dirty(),h.add(_.value)}return{status:c.value,value:h}}const r=[...g.data.values()].map((o,h)=>w._parse(new ye(g,o,g.path,h)));return g.common.async?Promise.all(r).then(o=>R(o)):R(r)}min(e,c){return new Me({...this._def,minSize:{value:e,message:Y.toString(c)}})}max(e,c){return new Me({...this._def,maxSize:{value:e,message:Y.toString(c)}})}size(e,c){return this.min(e,c).max(e,c)}nonempty(e){return this.min(1,e)}}Me.create=(l,e)=>new Me({valueType:l,minSize:null,maxSize:null,typeName:X.ZodSet,...re(e)});class He extends se{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:c}=this._processInputParams(e);if(c.parsedType!==K.function)return V(c,{code:j.invalid_type,expected:K.function,received:c.parsedType}),Q;function g(r,o){return gt({data:r,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,pt(),Ne].filter(h=>!!h),issueData:{code:j.invalid_arguments,argumentsError:o}})}function S(r,o){return gt({data:r,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,pt(),Ne].filter(h=>!!h),issueData:{code:j.invalid_return_type,returnTypeError:o}})}const w={errorMap:c.common.contextualErrorMap},R=c.data;if(this._def.returns instanceof We){const r=this;return de(async function(...o){const h=new fe([]),_=await r._def.args.parseAsync(o,w).catch(v=>{throw h.addIssue(g(o,v)),h}),a=await Reflect.apply(R,this,_);return await r._def.returns._def.type.parseAsync(a,w).catch(v=>{throw h.addIssue(S(a,v)),h})})}else{const r=this;return de(function(...o){const h=r._def.args.safeParse(o,w);if(!h.success)throw new fe([g(o,h.error)]);const _=Reflect.apply(R,this,h.data),a=r._def.returns.safeParse(_,w);if(!a.success)throw new fe([S(_,a.error)]);return a.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new He({...this._def,args:Ce.create(e).rest(Be.create())})}returns(e){return new He({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,c,g){return new He({args:e||Ce.create([]).rest(Be.create()),returns:c||Be.create(),typeName:X.ZodFunction,...re(g)})}}class it extends se{get schema(){return this._def.getter()}_parse(e){const{ctx:c}=this._processInputParams(e);return this._def.getter()._parse({data:c.data,path:c.path,parent:c})}}it.create=(l,e)=>new it({getter:l,typeName:X.ZodLazy,...re(e)});class nt extends se{_parse(e){if(e.data!==this._def.value){const c=this._getOrReturnCtx(e);return V(c,{received:c.data,code:j.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}}nt.create=(l,e)=>new nt({value:l,typeName:X.ZodLiteral,...re(e)});function dr(l,e){return new Te({values:l,typeName:X.ZodEnum,...re(e)})}class Te extends se{constructor(){super(...arguments),Ze.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const c=this._getOrReturnCtx(e),g=this._def.values;return V(c,{expected:ne.joinValues(g),received:c.parsedType,code:j.invalid_type}),Q}if(vt(this,Ze)||ar(this,Ze,new Set(this._def.values)),!vt(this,Ze).has(e.data)){const c=this._getOrReturnCtx(e),g=this._def.values;return V(c,{received:c.data,code:j.invalid_enum_value,options:g}),Q}return de(e.data)}get options(){return this._def.values}get enum(){const e={};for(const c of this._def.values)e[c]=c;return e}get Values(){const e={};for(const c of this._def.values)e[c]=c;return e}get Enum(){const e={};for(const c of this._def.values)e[c]=c;return e}extract(e,c=this._def){return Te.create(e,{...this._def,...c})}exclude(e,c=this._def){return Te.create(this.options.filter(g=>!e.includes(g)),{...this._def,...c})}}Ze=new WeakMap;Te.create=dr;class ot extends se{constructor(){super(...arguments),Ke.set(this,void 0)}_parse(e){const c=ne.getValidEnumValues(this._def.values),g=this._getOrReturnCtx(e);if(g.parsedType!==K.string&&g.parsedType!==K.number){const S=ne.objectValues(c);return V(g,{expected:ne.joinValues(S),received:g.parsedType,code:j.invalid_type}),Q}if(vt(this,Ke)||ar(this,Ke,new Set(ne.getValidEnumValues(this._def.values))),!vt(this,Ke).has(e.data)){const S=ne.objectValues(c);return V(g,{received:g.data,code:j.invalid_enum_value,options:S}),Q}return de(e.data)}get enum(){return this._def.values}}Ke=new WeakMap;ot.create=(l,e)=>new ot({values:l,typeName:X.ZodNativeEnum,...re(e)});class We extends se{unwrap(){return this._def.type}_parse(e){const{ctx:c}=this._processInputParams(e);if(c.parsedType!==K.promise&&c.common.async===!1)return V(c,{code:j.invalid_type,expected:K.promise,received:c.parsedType}),Q;const g=c.parsedType===K.promise?c.data:Promise.resolve(c.data);return de(g.then(S=>this._def.type.parseAsync(S,{path:c.path,errorMap:c.common.contextualErrorMap})))}}We.create=(l,e)=>new We({type:l,typeName:X.ZodPromise,...re(e)});class me extends se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:c,ctx:g}=this._processInputParams(e),S=this._def.effect||null,w={addIssue:R=>{V(g,R),R.fatal?c.abort():c.dirty()},get path(){return g.path}};if(w.addIssue=w.addIssue.bind(w),S.type==="preprocess"){const R=S.transform(g.data,w);if(g.common.async)return Promise.resolve(R).then(async r=>{if(c.value==="aborted")return Q;const o=await this._def.schema._parseAsync({data:r,path:g.path,parent:g});return o.status==="aborted"?Q:o.status==="dirty"||c.value==="dirty"?Pe(o.value):o});{if(c.value==="aborted")return Q;const r=this._def.schema._parseSync({data:R,path:g.path,parent:g});return r.status==="aborted"?Q:r.status==="dirty"||c.value==="dirty"?Pe(r.value):r}}if(S.type==="refinement"){const R=r=>{const o=S.refinement(r,w);if(g.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return r};if(g.common.async===!1){const r=this._def.schema._parseSync({data:g.data,path:g.path,parent:g});return r.status==="aborted"?Q:(r.status==="dirty"&&c.dirty(),R(r.value),{status:c.value,value:r.value})}else return this._def.schema._parseAsync({data:g.data,path:g.path,parent:g}).then(r=>r.status==="aborted"?Q:(r.status==="dirty"&&c.dirty(),R(r.value).then(()=>({status:c.value,value:r.value}))))}if(S.type==="transform")if(g.common.async===!1){const R=this._def.schema._parseSync({data:g.data,path:g.path,parent:g});if(!Ye(R))return R;const r=S.transform(R.value,w);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:c.value,value:r}}else return this._def.schema._parseAsync({data:g.data,path:g.path,parent:g}).then(R=>Ye(R)?Promise.resolve(S.transform(R.value,w)).then(r=>({status:c.value,value:r})):R);ne.assertNever(S)}}me.create=(l,e,c)=>new me({schema:l,typeName:X.ZodEffects,effect:e,...re(c)});me.createWithPreprocess=(l,e,c)=>new me({schema:e,effect:{type:"preprocess",transform:l},typeName:X.ZodEffects,...re(c)});class Se extends se{_parse(e){return this._getType(e)===K.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Se.create=(l,e)=>new Se({innerType:l,typeName:X.ZodOptional,...re(e)});class Ae extends se{_parse(e){return this._getType(e)===K.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ae.create=(l,e)=>new Ae({innerType:l,typeName:X.ZodNullable,...re(e)});class at extends se{_parse(e){const{ctx:c}=this._processInputParams(e);let g=c.data;return c.parsedType===K.undefined&&(g=this._def.defaultValue()),this._def.innerType._parse({data:g,path:c.path,parent:c})}removeDefault(){return this._def.innerType}}at.create=(l,e)=>new at({innerType:l,typeName:X.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class ct extends se{_parse(e){const{ctx:c}=this._processInputParams(e),g={...c,common:{...c.common,issues:[]}},S=this._def.innerType._parse({data:g.data,path:g.path,parent:{...g}});return Je(S)?S.then(w=>({status:"valid",value:w.status==="valid"?w.value:this._def.catchValue({get error(){return new fe(g.common.issues)},input:g.data})})):{status:"valid",value:S.status==="valid"?S.value:this._def.catchValue({get error(){return new fe(g.common.issues)},input:g.data})}}removeCatch(){return this._def.innerType}}ct.create=(l,e)=>new ct({innerType:l,typeName:X.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class yt extends se{_parse(e){if(this._getType(e)!==K.nan){const g=this._getOrReturnCtx(e);return V(g,{code:j.invalid_type,expected:K.nan,received:g.parsedType}),Q}return{status:"valid",value:e.data}}}yt.create=l=>new yt({typeName:X.ZodNaN,...re(l)});const Es=Symbol("zod_brand");class It extends se{_parse(e){const{ctx:c}=this._processInputParams(e),g=c.data;return this._def.type._parse({data:g,path:c.path,parent:c})}unwrap(){return this._def.type}}class lt extends se{_parse(e){const{status:c,ctx:g}=this._processInputParams(e);if(g.common.async)return(async()=>{const w=await this._def.in._parseAsync({data:g.data,path:g.path,parent:g});return w.status==="aborted"?Q:w.status==="dirty"?(c.dirty(),Pe(w.value)):this._def.out._parseAsync({data:w.value,path:g.path,parent:g})})();{const S=this._def.in._parseSync({data:g.data,path:g.path,parent:g});return S.status==="aborted"?Q:S.status==="dirty"?(c.dirty(),{status:"dirty",value:S.value}):this._def.out._parseSync({data:S.value,path:g.path,parent:g})}}static create(e,c){return new lt({in:e,out:c,typeName:X.ZodPipeline})}}class ht extends se{_parse(e){const c=this._def.innerType._parse(e),g=S=>(Ye(S)&&(S.value=Object.freeze(S.value)),S);return Je(c)?c.then(S=>g(S)):g(c)}unwrap(){return this._def.innerType}}ht.create=(l,e)=>new ht({innerType:l,typeName:X.ZodReadonly,...re(e)});function ur(l,e={},c){return l?Fe.create().superRefine((g,S)=>{var w,R;if(!l(g)){const r=typeof e=="function"?e(g):typeof e=="string"?{message:e}:e,o=(R=(w=r.fatal)!==null&&w!==void 0?w:c)!==null&&R!==void 0?R:!0,h=typeof r=="string"?{message:r}:r;S.addIssue({code:"custom",...h,fatal:o})}}):Fe.create()}const xs={object:ae.lazycreate};var X;(function(l){l.ZodString="ZodString",l.ZodNumber="ZodNumber",l.ZodNaN="ZodNaN",l.ZodBigInt="ZodBigInt",l.ZodBoolean="ZodBoolean",l.ZodDate="ZodDate",l.ZodSymbol="ZodSymbol",l.ZodUndefined="ZodUndefined",l.ZodNull="ZodNull",l.ZodAny="ZodAny",l.ZodUnknown="ZodUnknown",l.ZodNever="ZodNever",l.ZodVoid="ZodVoid",l.ZodArray="ZodArray",l.ZodObject="ZodObject",l.ZodUnion="ZodUnion",l.ZodDiscriminatedUnion="ZodDiscriminatedUnion",l.ZodIntersection="ZodIntersection",l.ZodTuple="ZodTuple",l.ZodRecord="ZodRecord",l.ZodMap="ZodMap",l.ZodSet="ZodSet",l.ZodFunction="ZodFunction",l.ZodLazy="ZodLazy",l.ZodLiteral="ZodLiteral",l.ZodEnum="ZodEnum",l.ZodEffects="ZodEffects",l.ZodNativeEnum="ZodNativeEnum",l.ZodOptional="ZodOptional",l.ZodNullable="ZodNullable",l.ZodDefault="ZodDefault",l.ZodCatch="ZodCatch",l.ZodPromise="ZodPromise",l.ZodBranded="ZodBranded",l.ZodPipeline="ZodPipeline",l.ZodReadonly="ZodReadonly"})(X||(X={}));const ks=(l,e={message:`Input not instance of ${l.name}`})=>ur(c=>c instanceof l,e),fr=pe.create,_r=Le.create,Rs=yt.create,Ls=De.create,pr=Xe.create,Ds=Oe.create,Ts=mt.create,As=Qe.create,Bs=et.create,Os=Fe.create,Ms=Be.create,Is=Ee.create,Ps=bt.create,Hs=ve.create,Ns=ae.create,Fs=ae.strictCreate,Ws=tt.create,js=Ct.create,Us=rt.create,$s=Ce.create,zs=st.create,qs=St.create,Vs=Me.create,Zs=He.create,Ks=it.create,Gs=nt.create,Ys=Te.create,Js=ot.create,Xs=We.create,zt=me.create,Qs=Se.create,ei=Ae.create,ti=me.createWithPreprocess,ri=lt.create,si=()=>fr().optional(),ii=()=>_r().optional(),ni=()=>pr().optional(),oi={string:l=>pe.create({...l,coerce:!0}),number:l=>Le.create({...l,coerce:!0}),boolean:l=>Xe.create({...l,coerce:!0}),bigint:l=>De.create({...l,coerce:!0}),date:l=>Oe.create({...l,coerce:!0})},ai=Q;var ci=Object.freeze({__proto__:null,defaultErrorMap:Ne,setErrorMap:as,getErrorMap:pt,makeIssue:gt,EMPTY_PATH:cs,addIssueToContext:V,ParseStatus:le,INVALID:Q,DIRTY:Pe,OK:de,isAborted:At,isDirty:Bt,isValid:Ye,isAsync:Je,get util(){return ne},get objectUtil(){return Tt},ZodParsedType:K,getParsedType:Re,ZodType:se,datetimeRegex:lr,ZodString:pe,ZodNumber:Le,ZodBigInt:De,ZodBoolean:Xe,ZodDate:Oe,ZodSymbol:mt,ZodUndefined:Qe,ZodNull:et,ZodAny:Fe,ZodUnknown:Be,ZodNever:Ee,ZodVoid:bt,ZodArray:ve,ZodObject:ae,ZodUnion:tt,ZodDiscriminatedUnion:Ct,ZodIntersection:rt,ZodTuple:Ce,ZodRecord:st,ZodMap:St,ZodSet:Me,ZodFunction:He,ZodLazy:it,ZodLiteral:nt,ZodEnum:Te,ZodNativeEnum:ot,ZodPromise:We,ZodEffects:me,ZodTransformer:me,ZodOptional:Se,ZodNullable:Ae,ZodDefault:at,ZodCatch:ct,ZodNaN:yt,BRAND:Es,ZodBranded:It,ZodPipeline:lt,ZodReadonly:ht,custom:ur,Schema:se,ZodSchema:se,late:xs,get ZodFirstPartyTypeKind(){return X},coerce:oi,any:Os,array:Hs,bigint:Ls,boolean:pr,date:Ds,discriminatedUnion:js,effect:zt,enum:Ys,function:Zs,instanceof:ks,intersection:Us,lazy:Ks,literal:Gs,map:qs,nan:Rs,nativeEnum:Js,never:Is,null:Bs,nullable:ei,number:_r,object:Ns,oboolean:ni,onumber:ii,optional:Qs,ostring:si,pipeline:ri,preprocess:ti,promise:Xs,record:zs,set:Vs,strictObject:Fs,string:fr,symbol:Ts,transformer:zt,tuple:$s,undefined:As,union:Ws,unknown:Ms,void:Ps,NEVER:ai,ZodIssueCode:j,quotelessJson:os,ZodError:fe});function hi(l){const e=/\x1b\[<(\d+);(\d+);(\d+)([mM])/.exec(l);if(!e)return;if(!e[1]||!e[2]||!e[3]||!e[4])throw new Error(`Mouse event: Invalid match for data ${l}`);const c=parseInt(e[1],10),g=parseInt(e[2],10),S=parseInt(e[3],10),w=e[4]==="m";return console.log(`Mouse event: buttonCode=${c}, column=${g}, row=${S}, isRelease=${w}`),l}function li(l,e){const c=new ns.Terminal({cursorBlink:!1,convertEol:!0,fontSize:13}),g=rr.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 S=new is.FitAddon;return c.loadAddon(S),c.open(l),S.fit(),window.addEventListener("resize",()=>{S.fit()}),c.onData(w=>{if(typeof w!="string")throw new Error(`unexpected onData message type: '${JSON.stringify(w)}'`);const R=hi(w);R&&e.onMouseEvent(R)}),c.onKey(w=>{e.onKeyPress(w)}),c}function di(){let l=ci.string().safeParse(sessionStorage.getItem("tabId")).data;return l||(l=Math.random().toString(36),sessionStorage.setItem("tabId",l)),{tabId:l}}class ui{constructor(e){Ve(this,"ready");Ve(this,"tabId");Ve(this,"terminal");Ve(this,"trpc");const c=Nr({links:[Xr({condition:w=>w.type==="subscription",true:ts({url:"/trpc"}),false:Jr({url:"/trpc"})})]});this.trpc=c,this.tabId=di();const g=this.tabId,S=li(e,{onMouseEvent(w){c.neovim.sendStdin.mutate({tabId:g,data:w}).catch(R=>{console.error("Error sending mouse event",R)})},onKeyPress(w){c.neovim.sendStdin.mutate({tabId:g,data:w.key})}});this.terminal=S,this.ready=new Promise(w=>{console.log("Subscribing to Neovim stdout"),c.neovim.onStdout.subscribe({client:g},{onStarted(){w()},onData(R){S.write(R)},onError(R){console.error("Error from Neovim",R)}})})}async startNeovim(e){return await this.ready,await this.trpc.neovim.start.mutate({startNeovimArguments:{...e,terminalDimensions:{cols:this.terminal.cols,rows:this.terminal.rows}},tabId:this.tabId})}}const gr=document.querySelector("#app");if(!gr)throw new Error("No app element found");const fi=new ui(gr);window.startNeovim=async function(l){return await fi.startNeovim({filename:(l==null?void 0:l.filename)??"initial-file.txt",startupScriptModifications:(l==null?void 0:l.startupScriptModifications)??[]})};